iris-gantt 1.3.2 → 1.3.3

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,31 +1,31 @@
1
- (function(W,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("antd"),require("@fortawesome/react-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","react","antd","@fortawesome/react-fontawesome","@fortawesome/free-solid-svg-icons","dayjs"],g):(W=typeof globalThis<"u"?globalThis:W||self,g(W.IrisGantt={},W.React,W.antd,W.ReactFontawesome,W.FontAwesomeSolid,W.dayjs))})(this,(function(W,g,p,ce,G,Et){"use strict";var at={exports:{}},Ze={};var $t;function Jt(){if($t)return Ze;$t=1;var t=g,a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function m(i,s,b){var c,w={},T=null,u=null;b!==void 0&&(T=""+b),s.key!==void 0&&(T=""+s.key),s.ref!==void 0&&(u=s.ref);for(c in s)l.call(s,c)&&!y.hasOwnProperty(c)&&(w[c]=s[c]);if(i&&i.defaultProps)for(c in s=i.defaultProps,s)w[c]===void 0&&(w[c]=s[c]);return{$$typeof:a,type:i,key:T,ref:u,props:w,_owner:r.current}}return Ze.Fragment=o,Ze.jsx=m,Ze.jsxs=m,Ze}var Ke={};var Ft;function Gt(){return Ft||(Ft=1,process.env.NODE_ENV!=="production"&&(function(){var t=g,a=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),u=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function S(n){if(n===null||typeof n!="object")return null;var x=h&&n[h]||n[v];return typeof x=="function"?x:null}var D=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function $(n){{for(var x=arguments.length,k=new Array(x>1?x-1:0),N=1;N<x;N++)k[N-1]=arguments[N];F("error",n,k)}}function F(n,x,k){{var N=D.ReactDebugCurrentFrame,V=N.getStackAddendum();V!==""&&(x+="%s",k=k.concat([V]));var C=k.map(function(B){return String(B)});C.unshift("Warning: "+x),Function.prototype.apply.call(console[n],console,C)}}var H=!1,ae=!1,X=!1,fe=!1,E=!1,K;K=Symbol.for("react.module.reference");function q(n){return!!(typeof n=="string"||typeof n=="function"||n===l||n===y||E||n===r||n===b||n===c||fe||n===u||H||ae||X||typeof n=="object"&&n!==null&&(n.$$typeof===T||n.$$typeof===w||n.$$typeof===m||n.$$typeof===i||n.$$typeof===s||n.$$typeof===K||n.getModuleId!==void 0))}function M(n,x,k){var N=n.displayName;if(N)return N;var V=x.displayName||x.name||"";return V!==""?k+"("+V+")":k}function U(n){return n.displayName||"Context"}function se(n){if(n==null)return null;if(typeof n.tag=="number"&&$("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case l:return"Fragment";case o:return"Portal";case y:return"Profiler";case r:return"StrictMode";case b:return"Suspense";case c:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case i:var x=n;return U(x)+".Consumer";case m:var k=n;return U(k._context)+".Provider";case s:return M(n,n.render,"ForwardRef");case w:var N=n.displayName||null;return N!==null?N:se(n.type)||"Memo";case T:{var V=n,C=V._payload,B=V._init;try{return se(B(C))}catch{return null}}}return null}var Z=Object.assign,ye=0,$e,De,_,Y,pe,te,re;function Q(){}Q.__reactDisabledLog=!0;function f(){{if(ye===0){$e=console.log,De=console.info,_=console.warn,Y=console.error,pe=console.group,te=console.groupCollapsed,re=console.groupEnd;var n={configurable:!0,enumerable:!0,value:Q,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}ye++}}function L(){{if(ye--,ye===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Z({},n,{value:$e}),info:Z({},n,{value:De}),warn:Z({},n,{value:_}),error:Z({},n,{value:Y}),group:Z({},n,{value:pe}),groupCollapsed:Z({},n,{value:te}),groupEnd:Z({},n,{value:re})})}ye<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var P=D.ReactCurrentDispatcher,A;function R(n,x,k){{if(A===void 0)try{throw Error()}catch(V){var N=V.stack.trim().match(/\n( *(at )?)/);A=N&&N[1]||""}return`
2
- `+A+n}}var le=!1,ne;{var Fe=typeof WeakMap=="function"?WeakMap:Map;ne=new Fe}function de(n,x){if(!n||le)return"";{var k=ne.get(n);if(k!==void 0)return k}var N;le=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=P.current,P.current=null,f();try{if(x){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(Se){N=Se}Reflect.construct(n,[],B)}else{try{B.call()}catch(Se){N=Se}n.call(B.prototype)}}else{try{throw Error()}catch(Se){N=Se}n()}}catch(Se){if(Se&&N&&typeof Se.stack=="string"){for(var I=Se.stack.split(`
3
- `),me=N.stack.split(`
4
- `),ee=I.length-1,ue=me.length-1;ee>=1&&ue>=0&&I[ee]!==me[ue];)ue--;for(;ee>=1&&ue>=0;ee--,ue--)if(I[ee]!==me[ue]){if(ee!==1||ue!==1)do if(ee--,ue--,ue<0||I[ee]!==me[ue]){var ge=`
5
- `+I[ee].replace(" at new "," at ");return n.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",n.displayName)),typeof n=="function"&&ne.set(n,ge),ge}while(ee>=1&&ue>=0);break}}}finally{le=!1,P.current=C,L(),Error.prepareStackTrace=V}var Ge=n?n.displayName||n.name:"",We=Ge?R(Ge):"";return typeof n=="function"&&ne.set(n,We),We}function ke(n,x,k){return de(n,!1)}function Be(n){var x=n.prototype;return!!(x&&x.isReactComponent)}function Pe(n,x,k){if(n==null)return"";if(typeof n=="function")return de(n,Be(n));if(typeof n=="string")return R(n);switch(n){case b:return R("Suspense");case c:return R("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case s:return ke(n.render);case w:return Pe(n.type,x,k);case T:{var N=n,V=N._payload,C=N._init;try{return Pe(C(V),x,k)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Oe={},tt=D.ReactDebugCurrentFrame;function ze(n){if(n){var x=n._owner,k=Pe(n.type,n._source,x?x.type:null);tt.setExtraStackFrame(k)}else tt.setExtraStackFrame(null)}function bt(n,x,k,N,V){{var C=Function.call.bind(Te);for(var B in n)if(C(n,B)){var I=void 0;try{if(typeof n[B]!="function"){var me=Error((N||"React class")+": "+k+" type `"+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[B]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw me.name="Invariant Violation",me}I=n[B](x,B,N,k,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ee){I=ee}I&&!(I instanceof Error)&&(ze(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).",N||"React class",k,B,typeof I),ze(null)),I instanceof Error&&!(I.message in Oe)&&(Oe[I.message]=!0,ze(V),$("Failed %s type: %s",k,I.message),ze(null))}}}var it=Array.isArray;function Ce(n){return it(n)}function wt(n){{var x=typeof Symbol=="function"&&Symbol.toStringTag,k=x&&n[Symbol.toStringTag]||n.constructor.name||"Object";return k}}function Ie(n){try{return Me(n),!1}catch{return!0}}function Me(n){return""+n}function ve(n){if(Ie(n))return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",wt(n)),Me(n)}var lt=D.ReactCurrentOwner,Xt={key:!0,ref:!0,__self:!0,__source:!0},dt,ct;function vt(n){if(Te.call(n,"ref")){var x=Object.getOwnPropertyDescriptor(n,"ref").get;if(x&&x.isReactWarning)return!1}return n.ref!==void 0}function St(n){if(Te.call(n,"key")){var x=Object.getOwnPropertyDescriptor(n,"key").get;if(x&&x.isReactWarning)return!1}return n.key!==void 0}function rt(n,x){typeof n.ref=="string"&&lt.current}function jt(n,x){{var k=function(){dt||(dt=!0,$("%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))};k.isReactWarning=!0,Object.defineProperty(n,"key",{get:k,configurable:!0})}}function Tt(n,x){{var k=function(){ct||(ct=!0,$("%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))};k.isReactWarning=!0,Object.defineProperty(n,"ref",{get:k,configurable:!0})}}var nt=function(n,x,k,N,V,C,B){var I={$$typeof:a,type:n,key:x,ref:k,props:B,_owner:C};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function Dt(n,x,k,N,V){{var C,B={},I=null,me=null;k!==void 0&&(ve(k),I=""+k),St(x)&&(ve(x.key),I=""+x.key),vt(x)&&(me=x.ref,rt(x,V));for(C in x)Te.call(x,C)&&!Xt.hasOwnProperty(C)&&(B[C]=x[C]);if(n&&n.defaultProps){var ee=n.defaultProps;for(C in ee)B[C]===void 0&&(B[C]=ee[C])}if(I||me){var ue=typeof n=="function"?n.displayName||n.name||"Unknown":n;I&&jt(B,ue),me&&Tt(B,ue)}return nt(n,I,me,V,N,lt.current,B)}}var qe=D.ReactCurrentOwner,ut=D.ReactDebugCurrentFrame;function Le(n){if(n){var x=n._owner,k=Pe(n.type,n._source,x?x.type:null);ut.setExtraStackFrame(k)}else ut.setExtraStackFrame(null)}var Xe;Xe=!1;function Je(n){return typeof n=="object"&&n!==null&&n.$$typeof===a}function ot(){{if(qe.current){var n=se(qe.current.type);if(n)return`
1
+ (function(W,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("antd"),require("@fortawesome/react-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","react","antd","@fortawesome/react-fontawesome","@fortawesome/free-solid-svg-icons","dayjs"],y):(W=typeof globalThis<"u"?globalThis:W||self,y(W.IrisGantt={},W.React,W.antd,W.ReactFontawesome,W.FontAwesomeSolid,W.dayjs))})(this,(function(W,y,p,pe,Q,Ft){"use strict";var at={exports:{}},Ge={};var $t;function Jt(){if($t)return Ge;$t=1;var t=y,a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g={key:!0,ref:!0,__self:!0,__source:!0};function x(i,s,b){var c,w={},T=null,u=null;b!==void 0&&(T=""+b),s.key!==void 0&&(T=""+s.key),s.ref!==void 0&&(u=s.ref);for(c in s)l.call(s,c)&&!g.hasOwnProperty(c)&&(w[c]=s[c]);if(i&&i.defaultProps)for(c in s=i.defaultProps,s)w[c]===void 0&&(w[c]=s[c]);return{$$typeof:a,type:i,key:T,ref:u,props:w,_owner:r.current}}return Ge.Fragment=o,Ge.jsx=x,Ge.jsxs=x,Ge}var Ze={};var Pt;function Gt(){return Pt||(Pt=1,process.env.NODE_ENV!=="production"&&(function(){var t=y,a=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),u=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function S(n){if(n===null||typeof n!="object")return null;var f=h&&n[h]||n[v];return typeof f=="function"?f:null}var D=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function F(n){{for(var f=arguments.length,k=new Array(f>1?f-1:0),C=1;C<f;C++)k[C-1]=arguments[C];P("error",n,k)}}function P(n,f,k){{var C=D.ReactDebugCurrentFrame,V=C.getStackAddendum();V!==""&&(f+="%s",k=k.concat([V]));var Z=k.map(function(z){return String(z)});Z.unshift("Warning: "+f),Function.prototype.apply.call(console[n],console,Z)}}var H=!1,se=!1,J=!1,me=!1,E=!1,ee;ee=Symbol.for("react.module.reference");function X(n){return!!(typeof n=="string"||typeof n=="function"||n===l||n===g||E||n===r||n===b||n===c||me||n===u||H||se||J||typeof n=="object"&&n!==null&&(n.$$typeof===T||n.$$typeof===w||n.$$typeof===x||n.$$typeof===i||n.$$typeof===s||n.$$typeof===ee||n.getModuleId!==void 0))}function L(n,f,k){var C=n.displayName;if(C)return C;var V=f.displayName||f.name||"";return V!==""?k+"("+V+")":k}function U(n){return n.displayName||"Context"}function ie(n){if(n==null)return null;if(typeof n.tag=="number"&&F("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case l:return"Fragment";case o:return"Portal";case g:return"Profiler";case r:return"StrictMode";case b:return"Suspense";case c:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case i:var f=n;return U(f)+".Consumer";case x:var k=n;return U(k._context)+".Provider";case s:return L(n,n.render,"ForwardRef");case w:var C=n.displayName||null;return C!==null?C:ie(n.type)||"Memo";case T:{var V=n,Z=V._payload,z=V._init;try{return ie(z(Z))}catch{return null}}}return null}var K=Object.assign,xe=0,Ee,Te,R,Y,he,re,ne;function te(){}te.__reactDisabledLog=!0;function m(){{if(xe===0){Ee=console.log,Te=console.info,R=console.warn,Y=console.error,he=console.group,re=console.groupCollapsed,ne=console.groupEnd;var n={configurable:!0,enumerable:!0,value:te,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}xe++}}function M(){{if(xe--,xe===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},n,{value:Ee}),info:K({},n,{value:Te}),warn:K({},n,{value:R}),error:K({},n,{value:Y}),group:K({},n,{value:he}),groupCollapsed:K({},n,{value:re}),groupEnd:K({},n,{value:ne})})}xe<0&&F("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var O=D.ReactCurrentDispatcher,N;function I(n,f,k){{if(N===void 0)try{throw Error()}catch(V){var C=V.stack.trim().match(/\n( *(at )?)/);N=C&&C[1]||""}return`
2
+ `+N+n}}var le=!1,oe;{var Le=typeof WeakMap=="function"?WeakMap:Map;oe=new Le}function de(n,f){if(!n||le)return"";{var k=oe.get(n);if(k!==void 0)return k}var C;le=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Z;Z=O.current,O.current=null,m();try{if(f){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(be){C=be}Reflect.construct(n,[],z)}else{try{z.call()}catch(be){C=be}n.call(z.prototype)}}else{try{throw Error()}catch(be){C=be}n()}}catch(be){if(be&&C&&typeof be.stack=="string"){for(var _=be.stack.split(`
3
+ `),B=C.stack.split(`
4
+ `),ae=_.length-1,ue=B.length-1;ae>=1&&ue>=0&&_[ae]!==B[ue];)ue--;for(;ae>=1&&ue>=0;ae--,ue--)if(_[ae]!==B[ue]){if(ae!==1||ue!==1)do if(ae--,ue--,ue<0||_[ae]!==B[ue]){var je=`
5
+ `+_[ae].replace(" at new "," at ");return n.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",n.displayName)),typeof n=="function"&&oe.set(n,je),je}while(ae>=1&&ue>=0);break}}}finally{le=!1,O.current=Z,M(),Error.prepareStackTrace=V}var Je=n?n.displayName||n.name:"",ze=Je?I(Je):"";return typeof n=="function"&&oe.set(n,ze),ze}function De(n,f,k){return de(n,!1)}function Ne(n){var f=n.prototype;return!!(f&&f.isReactComponent)}function Fe(n,f,k){if(n==null)return"";if(typeof n=="function")return de(n,Ne(n));if(typeof n=="string")return I(n);switch(n){case b:return I("Suspense");case c:return I("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case s:return De(n.render);case w:return Fe(n.type,f,k);case T:{var C=n,V=C._payload,Z=C._init;try{return Fe(Z(V),f,k)}catch{}}}return""}var ve=Object.prototype.hasOwnProperty,$e={},et=D.ReactDebugCurrentFrame;function _e(n){if(n){var f=n._owner,k=Fe(n.type,n._source,f?f.type:null);et.setExtraStackFrame(k)}else et.setExtraStackFrame(null)}function vt(n,f,k,C,V){{var Z=Function.call.bind(ve);for(var z in n)if(Z(n,z)){var _=void 0;try{if(typeof n[z]!="function"){var B=Error((C||"React class")+": "+k+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw B.name="Invariant Violation",B}_=n[z](f,z,C,k,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ae){_=ae}_&&!(_ instanceof Error)&&(_e(V),F("%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).",C||"React class",k,z,typeof _),_e(null)),_ instanceof Error&&!(_.message in $e)&&($e[_.message]=!0,_e(V),F("Failed %s type: %s",k,_.message),_e(null))}}}var it=Array.isArray;function Re(n){return it(n)}function St(n){{var f=typeof Symbol=="function"&&Symbol.toStringTag,k=f&&n[Symbol.toStringTag]||n.constructor.name||"Object";return k}}function lt(n){try{return Pe(n),!1}catch{return!0}}function Pe(n){return""+n}function ke(n){if(lt(n))return F("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",St(n)),Pe(n)}var Se=D.ReactCurrentOwner,jt={key:!0,ref:!0,__self:!0,__source:!0},Tt,dt;function Dt(n){if(ve.call(n,"ref")){var f=Object.getOwnPropertyDescriptor(n,"ref").get;if(f&&f.isReactWarning)return!1}return n.ref!==void 0}function kt(n){if(ve.call(n,"key")){var f=Object.getOwnPropertyDescriptor(n,"key").get;if(f&&f.isReactWarning)return!1}return n.key!==void 0}function Lt(n,f){typeof n.ref=="string"&&Se.current}function tt(n,f){{var k=function(){Tt||(Tt=!0,F("%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)",f))};k.isReactWarning=!0,Object.defineProperty(n,"key",{get:k,configurable:!0})}}function Ve(n,f){{var k=function(){dt||(dt=!0,F("%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)",f))};k.isReactWarning=!0,Object.defineProperty(n,"ref",{get:k,configurable:!0})}}var ct=function(n,f,k,C,V,Z,z){var _={$$typeof:a,type:n,key:f,ref:k,props:z,_owner:Z};return _._store={},Object.defineProperty(_._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(_,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(_,"_source",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.freeze&&(Object.freeze(_.props),Object.freeze(_)),_};function Mt(n,f,k,C,V){{var Z,z={},_=null,B=null;k!==void 0&&(ke(k),_=""+k),kt(f)&&(ke(f.key),_=""+f.key),Dt(f)&&(B=f.ref,Lt(f,V));for(Z in f)ve.call(f,Z)&&!jt.hasOwnProperty(Z)&&(z[Z]=f[Z]);if(n&&n.defaultProps){var ae=n.defaultProps;for(Z in ae)z[Z]===void 0&&(z[Z]=ae[Z])}if(_||B){var ue=typeof n=="function"?n.displayName||n.name||"Unknown":n;_&&tt(z,ue),B&&Ve(z,ue)}return ct(n,_,B,V,C,Se.current,z)}}var rt=D.ReactCurrentOwner,Xe=D.ReactDebugCurrentFrame;function Ae(n){if(n){var f=n._owner,k=Fe(n.type,n._source,f?f.type:null);Xe.setExtraStackFrame(k)}else Xe.setExtraStackFrame(null)}var qe;qe=!1;function nt(n){return typeof n=="object"&&n!==null&&n.$$typeof===a}function Ye(){{if(rt.current){var n=ie(rt.current.type);if(n)return`
6
6
 
7
- Check the render method of \``+n+"`."}return""}}function kt(n){return""}var pt={};function d(n){{var x=ot();if(!x){var k=typeof n=="string"?n:n.displayName||n.name;k&&(x=`
7
+ Check the render method of \``+n+"`."}return""}}function ut(n){return""}var ot={};function pt(n){{var f=Ye();if(!f){var k=typeof n=="string"?n:n.displayName||n.name;k&&(f=`
8
8
 
9
- Check the top-level render call using <`+k+">.")}return x}}function j(n,x){{if(!n._store||n._store.validated||n.key!=null)return;n._store.validated=!0;var k=d(x);if(pt[k])return;pt[k]=!0;var N="";n&&n._owner&&n._owner!==qe.current&&(N=" It was passed a child from "+se(n._owner.type)+"."),Le(n),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',k,N),Le(null)}}function O(n,x){{if(typeof n!="object")return;if(Ce(n))for(var k=0;k<n.length;k++){var N=n[k];Je(N)&&j(N,x)}else if(Je(n))n._store&&(n._store.validated=!0);else if(n){var V=S(n);if(typeof V=="function"&&V!==n.entries)for(var C=V.call(n),B;!(B=C.next()).done;)Je(B.value)&&j(B.value,x)}}}function z(n){{var x=n.type;if(x==null||typeof x=="string")return;var k;if(typeof x=="function")k=x.propTypes;else if(typeof x=="object"&&(x.$$typeof===s||x.$$typeof===w))k=x.propTypes;else return;if(k){var N=se(x);bt(k,n.props,"prop",N,n)}else if(x.PropTypes!==void 0&&!Xe){Xe=!0;var V=se(x);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof x.getDefaultProps=="function"&&!x.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ie(n){{for(var x=Object.keys(n.props),k=0;k<x.length;k++){var N=x[k];if(N!=="children"&&N!=="key"){Le(n),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",N),Le(null);break}}n.ref!==null&&(Le(n),$("Invalid attribute `ref` supplied to `React.Fragment`."),Le(null))}}var J={};function be(n,x,k,N,V,C){{var B=q(n);if(!B){var I="";(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var me=kt();me?I+=me:I+=ot();var ee;n===null?ee="null":Ce(n)?ee="array":n!==void 0&&n.$$typeof===a?(ee="<"+(se(n.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):ee=typeof n,$("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ee,I)}var ue=Dt(n,x,k,V,C);if(ue==null)return ue;if(B){var ge=x.children;if(ge!==void 0)if(N)if(Ce(ge)){for(var Ge=0;Ge<ge.length;Ge++)O(ge[Ge],n);Object.freeze&&Object.freeze(ge)}else $("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else O(ge,n)}if(Te.call(x,"key")){var We=se(n),Se=Object.keys(x).filter(function(Dr){return Dr!=="key"}),Lt=Se.length>0?"{key: someKey, "+Se.join(": ..., ")+": ...}":"{key: someKey}";if(!J[We+Lt]){var Tr=Se.length>0?"{"+Se.join(": ..., ")+": ...}":"{}";$(`A props object containing a "key" prop is being spread into JSX:
9
+ Check the top-level render call using <`+k+">.")}return f}}function ht(n,f){{if(!n._store||n._store.validated||n.key!=null)return;n._store.validated=!0;var k=pt(f);if(ot[k])return;ot[k]=!0;var C="";n&&n._owner&&n._owner!==rt.current&&(C=" It was passed a child from "+ie(n._owner.type)+"."),Ae(n),F('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',k,C),Ae(null)}}function ft(n,f){{if(typeof n!="object")return;if(Re(n))for(var k=0;k<n.length;k++){var C=n[k];nt(C)&&ht(C,f)}else if(nt(n))n._store&&(n._store.validated=!0);else if(n){var V=S(n);if(typeof V=="function"&&V!==n.entries)for(var Z=V.call(n),z;!(z=Z.next()).done;)nt(z.value)&&ht(z.value,f)}}}function d(n){{var f=n.type;if(f==null||typeof f=="string")return;var k;if(typeof f=="function")k=f.propTypes;else if(typeof f=="object"&&(f.$$typeof===s||f.$$typeof===w))k=f.propTypes;else return;if(k){var C=ie(f);vt(k,n.props,"prop",C,n)}else if(f.PropTypes!==void 0&&!qe){qe=!0;var V=ie(f);F("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof f.getDefaultProps=="function"&&!f.getDefaultProps.isReactClassApproved&&F("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function j(n){{for(var f=Object.keys(n.props),k=0;k<f.length;k++){var C=f[k];if(C!=="children"&&C!=="key"){Ae(n),F("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),Ae(null);break}}n.ref!==null&&(Ae(n),F("Invalid attribute `ref` supplied to `React.Fragment`."),Ae(null))}}var $={};function A(n,f,k,C,V,Z){{var z=X(n);if(!z){var _="";(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(_+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var B=ut();B?_+=B:_+=Ye();var ae;n===null?ae="null":Re(n)?ae="array":n!==void 0&&n.$$typeof===a?(ae="<"+(ie(n.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):ae=typeof n,F("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ae,_)}var ue=Mt(n,f,k,V,Z);if(ue==null)return ue;if(z){var je=f.children;if(je!==void 0)if(C)if(Re(je)){for(var Je=0;Je<je.length;Je++)ft(je[Je],n);Object.freeze&&Object.freeze(je)}else F("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ft(je,n)}if(ve.call(f,"key")){var ze=ie(n),be=Object.keys(f).filter(function(Dr){return Dr!=="key"}),Et=be.length>0?"{key: someKey, "+be.join(": ..., ")+": ...}":"{key: someKey}";if(!$[ze+Et]){var Tr=be.length>0?"{"+be.join(": ..., ")+": ...}":"{}";F(`A props object containing a "key" prop is being spread into JSX:
10
10
  let props = %s;
11
11
  <%s {...props} />
12
12
  React keys must be passed directly to JSX without using spread:
13
13
  let props = %s;
14
- <%s key={someKey} {...props} />`,Lt,We,Tr,We),J[We+Lt]=!0}}return n===l?ie(ue):z(ue),ue}}function oe(n,x,k){return be(n,x,k,!0)}function we(n,x,k){return be(n,x,k,!1)}var _e=we,Mt=oe;Ke.Fragment=l,Ke.jsx=_e,Ke.jsxs=Mt})()),Ke}var Pt;function Zt(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?at.exports=Jt():at.exports=Gt()),at.exports}var e=Zt();const he=(t,a,o)=>{const l=new Date(t);switch(o){case"hour":l.setHours(l.getHours()+a);break;case"day":l.setDate(l.getDate()+a);break;case"week":l.setDate(l.getDate()+a*7);break;case"month":l.setMonth(l.getMonth()+a);break;case"quarter":l.setMonth(l.getMonth()+a*3);break;case"year":l.setFullYear(l.getFullYear()+a);break}return l},Qe=(t,a)=>{const o=a.getTime()-t.getTime();return Math.ceil(o/(1e3*60*60*24))},Ot=(t,a)=>{const o=a.getTime()-t.getTime();return Math.ceil(o/(1e3*60*60))},xe=(t,a)=>{const o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],y={YYYY:t.getFullYear().toString(),YY:t.getFullYear().toString().slice(-2),MMMM:l[t.getMonth()],MMM:o[t.getMonth()],MM:String(t.getMonth()+1).padStart(2,"0"),M:String(t.getMonth()+1),DD:String(t.getDate()).padStart(2,"0"),D:String(t.getDate()),dddd:r[t.getDay()],HH:String(t.getHours()).padStart(2,"0"),H:String(t.getHours()),mm:String(t.getMinutes()).padStart(2,"0"),m:String(t.getMinutes())};return a.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g,m=>y[m])},ht=t=>{const a=t.getDay();return a===0||a===6},ft=(t,a)=>a.some(o=>o.getFullYear()===t.getFullYear()&&o.getMonth()===t.getMonth()&&o.getDate()===t.getDate()),Ye=t=>{const a=new Date(t);return a.setHours(0,0,0,0),a},Kt=t=>{const a=new Date(t);return a.setHours(23,59,59,999),a},Qt=(t,a,o="day")=>{switch(o){case"hour":return Ot(t,a);case"day":return Qe(t,a);case"week":return Math.ceil(Qe(t,a)/7);case"month":return(a.getFullYear()-t.getFullYear())*12+(a.getMonth()-t.getMonth());default:return Qe(t,a)}};function er(t){if(!t||typeof t!="string")return null;const a=t.trim(),o=/^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,l=a.match(o);if(!l)return null;const r=parseInt(l[1],10),y=l[2].toUpperCase();let m=0,i="day";if(l[3]){const s=l[4]==="-"?-1:1;switch(m=parseInt(l[5],10)*s,l[6].toLowerCase()){case"d":i="day";break;case"h":i="hour";break;case"w":i="week";break;case"m":i="month";break}}return{taskNumber:r,type:y,lag:m,lagUnit:i}}function mt(t,a){switch(a){case"hour":return t/24;case"day":return t;case"week":return t*7;case"month":return t*30;default:return t}}function tr(t,a){const l={e2s:"FS",s2s:"SS",e2e:"FF",s2e:"SF"}[t.type];let r=`${a}${l}`;if(t.lag&&t.lag!==0){const y=t.lag>0?"+":"",i=(t.lagUnit||"day").charAt(0);let s=t.lag;if(t.lagUnit&&t.lagUnit!=="day")switch(t.lagUnit){case"hour":s=t.lag*24;break;case"week":s=t.lag/7;break;case"month":s=t.lag/30;break}r+=`${y}${Math.round(s)}${i}`}return r}function rr(t){return{FS:"e2s",SS:"s2s",FF:"e2e",SF:"s2e"}[t]}const He=t=>t?{popover:{backgroundColor:t.popoverBackground||"#fff",borderColor:t.popoverBorderColor||"#f0f0f0",borderRadius:t.popoverBorderRadius||"8px",boxShadow:t.popoverShadow||"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",padding:t.popoverPadding||"0",fontFamily:t.popoverFontFamily||t.fontFamily||"inherit",fontSize:t.popoverFontSize||t.fontSize||"14px"},modal:{backgroundColor:t.modalBackground||"#fff",borderRadius:t.modalBorderRadius||"8px",borderColor:t.modalBorderColor||"#f0f0f0",boxShadow:t.modalShadow||"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)"},buttonPrimary:{backgroundColor:t.buttonPrimaryBackground||"#1677ff",color:t.buttonPrimaryColor||"#fff",borderRadius:t.buttonPrimaryBorderRadius||"6px",fontWeight:t.buttonPrimaryFontWeight||400,fontFamily:t.buttonPrimaryFontFamily||t.fontFamily||"inherit",boxShadow:"0 2px 0 rgba(5, 145, 255, 0.1)"},buttonDanger:{backgroundColor:t.buttonDangerBackground||"#ff4d4f",color:t.buttonDangerColor||"#fff",borderRadius:t.buttonPrimaryBorderRadius||"6px",boxShadow:"0 2px 0 rgba(255, 38, 5, 0.06)"},buttonSecondary:{backgroundColor:t.buttonSecondaryBackground||"transparent",color:t.buttonSecondaryColor||"rgba(0, 0, 0, 0.88)",borderColor:t.buttonSecondaryBorderColor||"#d9d9d9",borderRadius:t.buttonPrimaryBorderRadius||"6px",boxShadow:"0 2px 0 rgba(0, 0, 0, 0.02)"},input:{backgroundColor:t.inputBackground,borderColor:t.inputBorderColor,borderRadius:t.inputBorderRadius||"6px",fontFamily:t.inputFontFamily||t.fontFamily||"inherit",fontSize:t.inputFontSize||t.fontSize||"14px"},listItem:{hoverBackground:t.listItemHoverBackground||"#f5f5f5",selectedBackground:t.listItemSelectedBackground||"#e6f4ff",borderColor:t.listItemBorderColor||"#f0f0f0"},badge:{backgroundColor:t.badgeBackground||"#e6f4ff",borderColor:t.badgeBorderColor||"transparent",color:t.badgeColor||"#1677ff",fontSize:t.badgeFontSize||"12px",padding:t.badgePadding||"0 7px",borderRadius:t.badgeBorderRadius||"10px"},link:{color:t.linkColor||"#1677ff",hoverColor:t.linkHoverColor||"#69b1ff",fontWeight:t.linkFontWeight||400},font:{fontFamily:t.fontFamily||"inherit",fontSize:t.fontSize||"14px",fontWeight:t.fontWeight||400,lineHeight:t.lineHeight||1.5714285714285714,color:t.fontColor||"rgba(0, 0, 0, 0.88)"}}:{},{Text:je,Paragraph:nr}=p.Typography,{Option:Ne}=p.Select,or=({task:t,allTasks:a,links:o,onAddDependency:l,onRemoveDependency:r,onTaskUpdate:y,children:m,styleConfig:i})=>{const s=He(i),[b,c]=g.useState(!1),[w,T]=g.useState(null),[u,h]=g.useState("e2s"),[v,S]=g.useState("lag"),[D,$]=g.useState(0),[F,H]=g.useState(t.duration),[ae,X]=g.useState(!0),fe="day",E=o.find(_=>_.target===t.id),K=!!E,q=g.useMemo(()=>a.length===0?new Date:new Date(Math.min(...a.map(_=>_.start.getTime()))),[a]),M=()=>{if(w){const _=v==="lag"?D:-D,Y=mt(_,fe);if(F!==t.duration&&y){const pe=he(new Date(t.start),F,"day");y({...t,duration:F,end:pe})}l(w,t.id,u,Y),c(!1),U()}},U=()=>{T(null),h("e2s"),S("lag"),$(0),H(t.duration)},se=()=>{E&&r&&(r(E.id),c(!1),U())},Z=_=>{if(c(_),_){if(X(!0),E){T(E.source),h(E.type);const Y=E.lag||0;Y>=0?(S("lag"),$(Y)):(S("lead"),$(Math.abs(Y)))}else U();H(t.duration)}},ye=()=>{if(!ae)return null;const _=u==="e2s",Y=u==="s2s",pe=u==="e2e",te=u==="s2e";let re=0,Q=0,f="",L=0,P=-1;_?(re=50,Q=350,L=250,P=350,f="M 250 60 L 300 60 L 300 140 L 348 140"):pe?(re=100,Q=100,L=300,P=-1,f="M 300 60 L 350 60 L 350 140 L 302 140"):Y?(re=250,Q=250,L=250,P=-1,f="M 250 60 L 200 60 L 200 140 L 248 140"):te&&(re=350,Q=50,L=350,P=250,f="M 350 60 L 300 60 L 300 140 L 252 140");const A=w==="gantt-start-date",R=a.find(le=>le.id===w);return e.jsx("div",{style:{width:"100%",height:90,backgroundColor:"#fbfbfb",borderRadius:4,marginBottom:12,border:"1px solid #f0f0f0",position:"relative",overflow:"hidden",flexShrink:0},children:e.jsxs("svg",{viewBox:"0 0 600 200",style:{width:"100%",height:"100%"},preserveAspectRatio:"xMidYMid meet",children:[e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead",markerWidth:"12",markerHeight:"9",refX:"12",refY:"4.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 12 4.5, 0 9",fill:"#8c8c8c"})})}),e.jsx("line",{x1:L,x2:L,y1:"0",y2:"200",stroke:"#f0f0f0",strokeDasharray:"3,3"}),P!==-1&&e.jsx("line",{x1:P,x2:P,y1:"0",y2:"200",stroke:"#f0f0f0",strokeDasharray:"3,3"}),e.jsx("rect",{x:re,y:"35",width:"200",height:"50",rx:"4",fill:"#e6f4ff",stroke:"#91caff",strokeWidth:"2"}),e.jsx("text",{x:re+100,y:"66",fontSize:"15",textAnchor:"middle",fill:"#003a8c",fontWeight:"600",children:A?"Start Date":R?`Stage ${a.indexOf(R)+1}`:"Predecessor"}),e.jsx("rect",{x:Q,y:"115",width:"200",height:"50",rx:"4",fill:"#e6f4ff",stroke:"#91caff",strokeWidth:"2"}),e.jsxs("text",{x:Q+100,y:"146",fontSize:"15",textAnchor:"middle",fill:"#003a8c",fontWeight:"600",children:["Stage ",a.indexOf(t)+1]}),e.jsx("path",{d:f,fill:"none",stroke:"#8c8c8c",strokeWidth:"2.5",markerEnd:"url(#arrowhead)"})]})})},$e=()=>{const _=w==="gantt-start-date",Y=a.find(Q=>Q.id===w);if(!w)return"Select a checklist from the list to see how it will relate to the current stage.";const pe=a.indexOf(t)+1,te=_?"Start Date":`Stage ${a.indexOf(Y)+1}`;let re="";switch(u){case"e2s":re=`Stage ${pe} starts after ${te} finishes`;break;case"s2s":re=`Stage ${pe} starts when ${te} starts`;break;case"e2e":re=`Stage ${pe} finishes when ${te} finishes`;break;case"s2e":re=`Stage ${pe} finishes when ${te} starts`;break}if(D>0){const Q=`${D} ${fe}${D>1?"s":""}`;v==="lag"?re+=` + ${Q} delay`:re+=` - ${Q} overlap`}return re+"."},De=e.jsxs("div",{style:{width:550,backgroundColor:s.popover?.backgroundColor||"#fff",borderRadius:s.popover?.borderRadius||"8px",padding:"16px 20px",boxShadow:s.popover?.boxShadow,fontFamily:s.popover?.fontFamily},children:[e.jsx(je,{strong:!0,style:{fontSize:"16px",display:"block",marginBottom:16,color:s.font?.color},children:"Add Dependency"}),e.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14},children:[e.jsx("div",{style:{flex:1},children:e.jsxs(p.Select,{showSearch:!0,placeholder:"Select checklist",value:w,onChange:T,style:{width:"100%"},filterOption:(_,Y)=>{if(Y?.value==="gantt-start-date")return"start date".includes(_.toLowerCase());const pe=a.find(re=>re.id===Y?.value);if(!pe)return!1;const te=a.indexOf(pe)+1;return pe.text.toLowerCase().includes(_.toLowerCase())||te.toString().includes(_)},optionLabelProp:"label",children:[a.filter(_=>_.id!==t.id).map(_=>e.jsx(Ne,{value:_.id,label:_.text,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"4px 0"},children:[e.jsxs(je,{style:{fontSize:"13px"},children:[a.indexOf(_)+1,". ",_.text]}),e.jsxs(je,{type:"secondary",style:{fontSize:"11px"},children:["Start: ",xe(_.start,"MMM D, YYYY")]})]})},_.id)),e.jsx(Ne,{value:"gantt-start-date",label:"Start Date",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"4px 0",borderTop:"1px solid #f0f0f0",marginTop:"4px",paddingTop:"8px"},children:[e.jsx(je,{style:{fontSize:"13px",fontWeight:600},children:"Start Date"}),e.jsx(je,{type:"secondary",style:{fontSize:"11px"},children:xe(q,"MMM D, YYYY")})]})},"gantt-start-date")]})}),e.jsx("div",{style:{width:100},children:e.jsxs(p.Select,{value:u,onChange:h,style:{width:"100%"},children:[e.jsx(Ne,{value:"e2s",children:"FS"}),e.jsx(Ne,{value:"e2e",children:"FF"}),e.jsx(Ne,{value:"s2s",children:"SS"}),e.jsx(Ne,{value:"s2e",children:"SF"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Delay type"}),e.jsxs(p.Select,{value:v,onChange:S,style:{width:"100%"},children:[e.jsx(Ne,{value:"lag",children:"Lag by"}),e.jsx(Ne,{value:"lead",children:"Lead by"})]})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Days"}),e.jsx(p.InputNumber,{min:0,value:D,onChange:_=>$(_||0),style:{width:"100%"},placeholder:"0"})]})]}),e.jsxs("div",{style:{marginBottom:14},children:[e.jsx(je,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Duration (days)"}),e.jsx(p.InputNumber,{min:1,value:F,onChange:_=>H(_||1),style:{width:"100%"},placeholder:"Duration"})]}),e.jsx("div",{style:{backgroundColor:"#f5f5f5",padding:"10px 12px",borderRadius:"4px",marginBottom:14},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"},children:[e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"FS: Finish to Start"}),e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"SS: Start to Start"}),e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"FF: Finish to Finish"}),e.jsx(je,{style:{fontSize:"11px",color:s.font?.color},children:"SF: Start to Finish"})]})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[e.jsx(je,{strong:!0,style:{fontSize:"13px",color:s.font?.color},children:"Dependency preview"}),e.jsx("a",{onClick:()=>X(!ae),style:{fontSize:"12px",color:"#1890ff",cursor:"pointer",textDecoration:"none"},children:ae?"Hide preview":"Show preview"})]}),ae&&e.jsxs(e.Fragment,{children:[ye(),e.jsx(nr,{style:{fontSize:"12px",color:s.font?.color||"#262626",marginBottom:14,lineHeight:"1.5"},children:$e()})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[K&&e.jsx(p.Button,{danger:!0,onClick:se,style:{...s.buttonDanger},children:"Remove Dependency"}),e.jsx(p.Button,{type:"primary",onClick:M,disabled:!w,style:{...s.buttonPrimary,minWidth:100},children:K?"Update":"Add"})]})]});return e.jsx(p.Popover,{content:De,trigger:"click",open:b,onOpenChange:Z,placement:"bottomLeft",overlayClassName:"dependency-popover",overlayInnerStyle:{padding:0},children:m})},xt=g.memo(g.forwardRef(({tasks:t,allTasks:a=[],columns:o,selectedTask:l,onTaskClick:r,onTaskContextMenu:y,onTaskUpdate:m,onTaskDragStart:i,onAddTask:s,onAddDependency:b,onRemoveDependency:c,links:w=[],dropIndicator:T,reorderTask:u,styleConfig:h},v)=>{const S=g.useRef(null);g.useImperativeHandle(v,()=>S.current);const[D,$]=g.useState(null),[F,H]=g.useState(0),ae=(E,K=0)=>{if(!E.parent)return K;const q=t.find(M=>M.id===E.parent);return q?ae(q,K+1):K},X=(E,K)=>{if(K===E.duration)return;const q=he(new Date(E.start),K,"day");m?.({...E,duration:K,end:q})},fe=(E,K)=>{if(K.template)return K.template(E);switch(K.name){case"text":{const q=ae(E);return e.jsxs("div",{className:"gantt-grid-cell-text",style:{paddingLeft:q*14},children:[e.jsx("div",{className:"gantt-row-drag-handle",onMouseDown:M=>{M.preventDefault(),i?.(E.id,M.clientX,M.clientY,"reorder")},children:e.jsx(ce.FontAwesomeIcon,{icon:G.faGripVertical})}),E.type==="project"?e.jsx("span",{className:"gantt-tree-icon",onClick:M=>{M.stopPropagation(),m?.({...E,open:!E.open})},children:e.jsx(ce.FontAwesomeIcon,{icon:E.open?G.faChevronDown:G.faChevronRight})}):e.jsx("span",{style:{width:16,display:"inline-block"}}),e.jsx("span",{className:"gantt-task-name-text",children:E.text})]})}case"start":return xe(E.start,"DD-MM-YYYY");case"end":return xe(E.end,"DD-MM-YYYY");case"duration":return D===E.id?e.jsx(p.InputNumber,{size:"small",min:1,value:F,onChange:M=>H(M||1),onBlur:()=>{X(E,F),$(null)},onPressEnter:()=>{X(E,F),$(null)},autoFocus:!0,style:{width:"100%",fontSize:"12px"}}):e.jsxs("div",{onClick:M=>{M.stopPropagation(),$(E.id),H(E.duration)},style:{backgroundColor:"#fff7e6",padding:"2px 8px",borderRadius:"4px",border:"1px solid #ffd591",fontWeight:400,color:"#d46b08",display:"inline-block",fontSize:"12px",cursor:"text"},children:[E.duration," day",E.duration!==1?"s":""]});case"predecessors":{const M=w.filter(U=>U.target===E.id)[0];return e.jsx(or,{task:E,allTasks:a,links:w,onAddDependency:(U,se,Z,ye)=>b?.(U,se,Z,ye),onRemoveDependency:U=>c?.(U),onTaskUpdate:m,styleConfig:h,children:e.jsx("div",{style:{cursor:"pointer",minHeight:"24px",width:"100%",display:"flex",alignItems:"center",gap:"4px"},children:M?(()=>{const U=a.find(Z=>Z.id===M.source),se=U?a.indexOf(U)+1:0;return e.jsx("span",{style:{fontSize:"12px",backgroundColor:"#e6f4ff",border:"1px solid #91caff",color:"#1677ff",padding:"0 7px",borderRadius:"4px",whiteSpace:"nowrap"},children:tr(M,se)})})():e.jsx("span",{style:{fontSize:"12px",color:"#1890ff",textDecoration:"none",fontWeight:500},onMouseEnter:U=>U.currentTarget.style.textDecoration="underline",onMouseLeave:U=>U.currentTarget.style.textDecoration="none",children:"Add"})})})}case"add":return e.jsx(p.Button,{type:"primary",size:"small",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faPlus,style:{fontSize:12}}),onClick:q=>{q.stopPropagation(),s?.(E.id)},title:"Add Subtask",style:{minWidth:"28px",width:"28px",height:"28px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px"}});case"progress":return e.jsxs("div",{className:"gantt-progress-cell",children:[e.jsx("div",{className:"gantt-progress-bar-bg",children:e.jsx("div",{className:"gantt-progress-bar-fill",style:{width:`${E.progress}%`}})}),e.jsxs("span",{className:"gantt-progress-text",children:[E.progress,"%"]})]});case"index":return e.jsx("span",{style:{color:"#8c8c8c"},children:a.indexOf(E)+1});default:return E[K.name]||""}};return e.jsxs("div",{className:"gantt-grid",ref:S,children:[e.jsx("div",{className:"gantt-grid-header",style:{display:"flex",minWidth:"100%"},children:o.map(E=>e.jsx("div",{className:"gantt-grid-header-cell",style:{width:E.width,minWidth:E.width,justifyContent:E.align==="center"?"center":"flex-start"},children:E.name==="add"?e.jsx("span",{style:{fontSize:11,color:"#64748b",fontWeight:600,whiteSpace:"nowrap"},children:"Add"}):e.jsxs(e.Fragment,{children:[E.label,E.name==="start"&&e.jsx(ce.FontAwesomeIcon,{icon:G.faChevronDown,style:{marginLeft:8,fontSize:10,color:"#64748b"}})]})},E.name))}),e.jsx("div",{className:"gantt-grid-body",children:t.map(E=>{const K=u?.id===E.id,q=u?.descendantIds.includes(E.id);return e.jsxs("div",{className:`gantt-grid-row ${l===E.id?"selected":""} ${K?"dragging-row":""} ${q?"descendant-dragging-row":""} ${T?.taskId===E.id?`drop-target-${T.position}`:""}`,onClick:()=>r(E.id),onContextMenu:M=>y?.(M,E.id),style:{display:"flex",minWidth:"100%"},children:[o.map(M=>{const U=M.name==="add";return e.jsx("div",{className:"gantt-grid-cell",style:{width:M.width,minWidth:M.width,textAlign:M.align||"left",display:"flex",alignItems:"center",justifyContent:U?"center":M.name==="text"?"flex-start":M.align==="center"?"center":M.align==="right"?"flex-end":"flex-start",visibility:"visible",opacity:1},children:fe(E,M)},`${E.id}-${M.name}`)}),T?.taskId===E.id&&e.jsx("div",{className:`gantt-drop-indicator ${T.position}`})]},E.id)})})]})}));xt.displayName="Grid";const Ct=({task:t,position:a,selected:o,dragging:l,onClick:r,onDragStart:y,dragDeltaX:m=0,dragType:i=null,readonly:s=!1})=>{const b=(h,v)=>{s||(h.preventDefault(),h.stopPropagation(),y(h.clientX,h.clientY,v))},c=()=>{const h=["gantt-task-bar"];return t.type==="milestone"&&h.push("milestone"),t.type==="project"&&h.push("project"),o&&h.push("selected"),l&&h.push("dragging"),t.status&&h.push(`status-${t.status}`),h.join(" ")},w=()=>{let h=a.left,v=a.width;return l&&i&&(i==="move"?h+=m:i==="resize-left"?(h+=m,v-=m):i==="resize-right"&&(v+=m)),{left:`${h}px`,width:`${Math.max(v,0)}px`,backgroundColor:t.color||void 0}},T=(h=!1)=>e.jsxs(e.Fragment,{children:[!s&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-left",onMouseDown:v=>b(v,"resize-left")}),!h&&t.type!=="milestone"&&e.jsx("div",{className:"gantt-task-progress",style:{width:`${t.progress}%`},children:t.progress>5&&t.progress<100&&e.jsxs("span",{className:"gantt-task-progress-text",children:[t.progress,"%"]})}),e.jsx("div",{className:"gantt-task-content",children:!h&&e.jsx("span",{className:"gantt-task-text",children:t.text})}),!s&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-right",onMouseDown:v=>b(v,"resize-right")})]}),u=e.jsxs("div",{className:"gantt-tooltip",children:[e.jsx("div",{className:"gantt-tooltip-title",children:t.text}),e.jsxs("div",{className:"gantt-tooltip-dates",children:[xe(t.start,"MMM D")," - ",xe(t.end,"MMM D")]}),e.jsxs("div",{className:"gantt-tooltip-progress",children:["Progress: ",t.progress,"%"]}),t.owner&&e.jsxs("div",{className:"gantt-tooltip-owner",children:["Owner: ",t.owner]})]});if(t.segments&&t.segments.length>0||t.onHoldPeriods&&t.onHoldPeriods.length>0){const h=t.end.getTime()-t.start.getTime(),v=t.segments&&t.segments.length>0?t.segments:[{start:t.start,end:t.end,duration:t.duration||0}];return e.jsxs("div",{className:"gantt-task-group",children:[t.onHoldPeriods?.map((S,D)=>e.jsx("div",{className:"gantt-on-hold-period",style:{left:`${a.left+(S.start.getTime()-t.start.getTime())/h*a.width}px`,width:`${(S.end.getTime()-S.start.getTime())/h*a.width}px`}},`hold-${D}`)),v.map((S,D)=>e.jsx(p.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c()+" segment",style:{left:`${a.left+(S.start.getTime()-t.start.getTime())/h*a.width}px`,width:`${(S.end.getTime()-S.start.getTime())/h*a.width}px`,backgroundColor:t.color||void 0},onClick:r,onMouseDown:$=>b($,"move"),children:T(D>0)})},`seg-${D}`))]})}return e.jsx(p.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c(),style:w(),onClick:r,onMouseDown:h=>b(h,"move"),children:T()})})},ar=({links:t,tasks:a,getTaskPosition:o})=>{const l=i=>a.find(s=>s.id===i),r=g.useMemo(()=>{let i=0,s=0;return a.forEach(b=>{try{const c=o(b);c&&typeof c.left=="number"&&typeof c.width=="number"&&(i=Math.max(i,c.left+c.width)),c&&typeof c.top=="number"&&typeof c.height=="number"&&(s=Math.max(s,c.top+c.height))}catch(c){console.warn("Failed to position task for link rendering:",b.id,c)}}),{width:Math.max(i,1e3),height:Math.max(s,100)}},[a,o]),y=i=>{const s=l(i.source),b=l(i.target);if(!s||!b)return"";const c=o(s),w=o(b),T=c.top+c.height/2,u=w.top+w.height/2;let h=0,v=0;switch(i.type){case"e2s":h=c.left+c.width,v=w.left;break;case"s2s":h=c.left,v=w.left;break;case"e2e":h=c.left+c.width,v=w.left+w.width;break;case"s2e":h=c.left,v=w.left+w.width;break}const S=v-h,D=u-T,$=20;if(i.type==="e2s")if(S>=$){const F=h+S/2;return`M ${h},${T} L ${F},${T} L ${F},${u} L ${v},${u}`}else{const F=$/2,H=T+D/2;return`M ${h},${T} L ${h+F},${T} L ${h+F},${H} L ${v-F},${H} L ${v-F},${u} L ${v},${u}`}else if(i.type==="s2s"){const F=Math.min(h,v)-$/2;return`M ${h},${T} L ${F},${T} L ${F},${u} L ${v},${u}`}else if(i.type==="e2e"){const F=Math.max(h,v)+$/2;return`M ${h},${T} L ${F},${T} L ${F},${u} L ${v},${u}`}else if(i.type==="s2e")if(S<=-$){const F=h+S/2;return`M ${h},${T} L ${F},${T} L ${F},${u} L ${v},${u}`}else{const F=$/2,H=T+D/2;return`M ${h},${T} L ${h-F},${T} L ${h-F},${H} L ${v+F},${H} L ${v+F},${u} L ${v},${u}`}return""},m=i=>{const s=l(i.target);if(!s)return"";const b=o(s),c=b.top+b.height/2,w=8,T=6;let u=0,h=!0;return i.type==="e2s"||i.type==="s2s"?(u=b.left,h=!0):(u=b.left+b.width,h=!1),h?`M ${u},${c} L ${u-w},${c-T/2} L ${u-w},${c+T/2} Z`:`M ${u},${c} L ${u+w},${c-T/2} L ${u+w},${c+T/2} Z`};return t.length===0?null:e.jsx("svg",{className:"gantt-links-layer",style:{overflow:"visible",width:r.width,height:r.height,position:"absolute",top:0,left:0,pointerEvents:"none"},children:t.map(i=>{const s=l(i.source),b=l(i.target);if(!s||!b)return null;const c=y(i),w=m(i);return!c||!w?null:e.jsxs("g",{className:"gantt-link",children:[e.jsx("path",{d:c,fill:"none",strokeWidth:"1.5",className:"gantt-link-line"}),e.jsx("path",{d:w,className:"gantt-link-arrow"})]},i.id)})})},sr=(t,a,o=60,l="day",r=1)=>{const[y,m]=g.useState({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0}),i=g.useCallback((c,w,T,u)=>{const h=t.find(v=>v.id===c);h&&m({taskId:c,initialX:w,initialY:T,initialStart:new Date(h.start),initialEnd:new Date(h.end),type:u,dragDeltaX:0,dragDeltaY:0})},[t]),s=g.useCallback((c,w)=>{if(!y.taskId||!y.type)return null;const T=c-y.initialX,u=w-y.initialY;if(m(F=>({...F,dragDeltaX:T,dragDeltaY:u})),y.type==="reorder")return null;const h=t.find(F=>F.id===y.taskId);if(!h)return null;const v=Math.round(T/o);let S=new Date(y.initialStart),D=new Date(y.initialEnd);switch(y.type){case"move":S=he(y.initialStart,v*r,l),D=he(y.initialEnd,v*r,l);break;case"resize-left":S=he(y.initialStart,v*r,l),S>=D&&(S=he(D,-r,l));break;case"resize-right":D=he(y.initialEnd,v*r,l),D<=S&&(D=he(S,r,l));break}const $=Qe(S,D);return{...h,start:S,end:D,duration:$}},[y,t,o,r,l]),b=g.useCallback(c=>{if(c&&a){const{id:w,...T}=c;a(w,T)}m({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0})},[a]);return{dragState:y,handleDragStart:i,handleDrag:s,handleDragEnd:b}},yt=g.forwardRef(({tasks:t,links:a,range:o,scales:l,config:r,selectedTask:y,onTaskClick:m,onTaskDragStart:i,onTaskDragEnd:s,onTaskUpdate:b,zoomLevel:c,baselines:w},T)=>{const[u,h]=g.useState(t),v=(r.columnWidth||60)*c,S=r.baselines&&w&&w.size>0,{dragState:D,handleDragStart:$,handleDrag:F,handleDragEnd:H}=sr(u,b,v,l[1].unit,l[1].step);g.useEffect(()=>{(t.length!==u.length||t.some((L,P)=>{const A=u[P];return!A||L.id!==A.id||L.start.getTime()!==A.start.getTime()||L.end.getTime()!==A.end.getTime()}))&&h(t)},[t]);const ae=g.useCallback(f=>{const L=[];let P=new Date(o.start);for(;P<=o.end;)L.push({date:new Date(P),label:xe(P,f.format||"D")}),P=he(P,f.step,f.unit);return L},[o.start,o.end]),X=g.useCallback(f=>{const L=l[1],P=o.start.getTime(),R=f.getTime()-P,ne={hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6}[L.unit]||864e5;return R/(ne*L.step)*v},[l,o.start,v]),fe=f=>{const L=X(f.start),P=X(f.end);return{left:L,width:Math.max(P-L,0)}},E=f=>{const L=X(f.start),P=X(f.end);return{left:L,width:Math.max(P-L,0)}},K=f=>{const L=fe(f),P=u.findIndex(ne=>ne.id===f.id),A=r.rowHeight||48,R=32,le=(A-R)/2;return{left:L.left,width:L.width,top:P*A+le,height:R}},q=g.useRef(null),M=g.useCallback(f=>{D.taskId&&D.type&&(q.current&&cancelAnimationFrame(q.current),q.current=requestAnimationFrame(()=>{const L=F(f.clientX,f.clientY);L&&h(P=>P.map(A=>A.id===L.id?L:A))}))},[D,F]),U=g.useCallback(()=>{if(D.taskId){const f=u.find(L=>L.id===D.taskId);H(f||null),s()}},[D,u,H,s]),se=l[1],Z=g.useMemo(()=>ae(se),[ae,se]),ye=g.useCallback(()=>{const f=[];let L=-1,P=-1,A=0,R="";return Z.forEach(le=>{const ne=le.date.getMonth(),Fe=le.date.getFullYear(),de=xe(le.date,"MMM YYYY");ne!==L||Fe!==P?(L!==-1&&f.push({label:R,width:A}),L=ne,P=Fe,A=v,R=de):A+=v}),L!==-1&&f.push({label:R,width:A}),f},[Z,v]),$e=g.useCallback(()=>{const f=[];let L=-1,P=0,A=-1,R=-1,le="";return Z.forEach(ne=>{const de=ne.date.getDate()<=15?0:1,ke=ne.date.getMonth(),Be=ne.date.getFullYear(),Pe=xe(ne.date,"MMM"),Te=new Date(Be,ke+1,0).getDate(),Oe=de===0?`${Pe} 1 - 15`:`${Pe} 16 - ${Te}`;de!==L||ke!==A||Be!==R?(L!==-1&&f.push({label:le,width:P}),L=de,A=ke,R=Be,P=v,le=Oe):P+=v}),L!==-1&&f.push({label:le,width:P}),f},[Z,v]),De=g.useMemo(()=>ye(),[ye]),_=g.useMemo(()=>$e(),[$e]),Y=g.useMemo(()=>Z.length*v,[Z.length,v]),pe=g.useMemo(()=>{const f=new Date;return f.setHours(0,0,0,0),f},[]),te=g.useMemo(()=>{if(!r.showTodayLine)return null;const f=X(pe);return f>=-v&&f<=Y+v?Math.max(0,Math.min(f,Y)):null},[r.showTodayLine,pe,Y,v,X]),re=g.useMemo(()=>{if(r.projectStartDate)return Ye(r.projectStartDate);if(t.length>0){const f=t.map(L=>L.start.getTime());return Ye(new Date(Math.min(...f)))}return null},[r.projectStartDate,t]),Q=g.useMemo(()=>{if(!r.showProjectStartLine||!re)return null;const f=X(re);return f>=-v&&f<=Y+v?Math.max(0,Math.min(f,Y)):null},[r.showProjectStartLine,re,Y,v,X]);return e.jsxs("div",{className:"gantt-timeline-container",ref:T,onMouseMove:M,onMouseUp:U,style:{width:Y,position:"relative"},children:[e.jsxs("div",{className:"gantt-timeline-header",style:{width:Y,minWidth:Y,position:"relative"},children:[te!==null&&r.showTodayLine&&r.todayLineLabel&&r.todayLineLabel!==""&&e.jsx("div",{className:"gantt-today-line-label",style:{position:"absolute",top:"calc(var(--gantt-scale-height, 24px) * 2)",left:`${te}px`,transform:"translateX(-50%)",backgroundColor:r.todayLineColor||"#ff4d4f",color:"#ffffff",padding:"4px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.2)",lineHeight:"1.2",zIndex:101,pointerEvents:"none",...r.todayLineLabelStyle},children:r.todayLineLabel}),Q!==null&&r.showProjectStartLine&&r.projectStartLineLabel&&r.projectStartLineLabel!==""&&e.jsx("div",{className:"gantt-project-start-line-label",style:{position:"absolute",top:"calc(var(--gantt-scale-height, 24px) * 2)",left:`${Q}px`,transform:"translateX(-50%)",backgroundColor:r.projectStartLineColor||"#40a9ff",color:"#ffffff",padding:"4px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.2)",lineHeight:"1.2",zIndex:101,pointerEvents:"none",...r.projectStartLineLabelStyle},children:r.projectStartLineLabel}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-month",style:{width:Y},children:De.map((f,L)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:f.width,minWidth:f.width,maxWidth:f.width,borderRight:L===De.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`top-${L}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-range",style:{width:Y},children:_.map((f,L)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:f.width,minWidth:f.width,maxWidth:f.width,borderRight:L===_.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`mid-${L}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-day",style:{width:Y},children:Z.map((f,L)=>{const P=r.weekends&&ht(f.date),A=r.holidays&&ft(f.date,r.holidays);return e.jsx("div",{className:`gantt-timeline-cell ${P?"weekend":""} ${A?"holiday":""}`,style:{width:v,minWidth:v,maxWidth:v,borderRight:L===Z.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`day-${L}`)})})]}),e.jsxs("div",{className:"gantt-timeline-body",style:{width:Y,position:"relative"},children:[te!==null&&e.jsxs(e.Fragment,{children:[r.showTodayLineMarker!==!1&&(()=>{const f=r.todayLineMarkerSize||8,L=r.todayLineColor||"#ff4d4f",P=r.todayLineMarkerStyle||"triangle",A=r.todayLineOpacity!==void 0?r.todayLineOpacity:1;return P==="triangle"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${te}px`,top:"-4px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:A}}):P==="arrow"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${te}px`,top:"-6px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f*.7}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:A}}):P==="dot"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${te}px`,top:`-${f/2}px`,transform:"translateX(-50%)",width:`${f}px`,height:`${f}px`,borderRadius:"50%",backgroundColor:L,zIndex:7,pointerEvents:"none",opacity:A}}):null})(),e.jsx("div",{className:"gantt-today-line",style:{position:"absolute",left:`${te}px`,top:0,bottom:0,width:`${r.todayLineWidth||1}px`,backgroundColor:r.todayLineColor||"#ff4d4f",opacity:r.todayLineOpacity!==void 0?r.todayLineOpacity:1,borderLeft:r.todayLineStyle==="dashed"?`${r.todayLineWidth||1}px dashed ${r.todayLineColor||"#ff4d4f"}`:r.todayLineStyle==="dotted"?`${r.todayLineWidth||1}px dotted ${r.todayLineColor||"#ff4d4f"}`:"none",zIndex:6,pointerEvents:"none"}})]}),Q!==null&&e.jsxs(e.Fragment,{children:[r.showProjectStartLineMarker!==!1&&(()=>{const f=r.projectStartLineMarkerSize||8,L=r.projectStartLineColor||"#40a9ff",P=r.projectStartLineMarkerStyle||"triangle",A=r.projectStartLineOpacity!==void 0?r.projectStartLineOpacity:1;return P==="triangle"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${Q}px`,top:"-4px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:A}}):P==="arrow"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${Q}px`,top:"-6px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${f}px solid transparent`,borderRight:`${f}px solid transparent`,borderBottom:`${f*.7}px solid ${L}`,zIndex:7,pointerEvents:"none",opacity:A}}):P==="dot"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${Q}px`,top:`-${f/2}px`,transform:"translateX(-50%)",width:`${f}px`,height:`${f}px`,borderRadius:"50%",backgroundColor:L,zIndex:7,pointerEvents:"none",opacity:A}}):null})(),e.jsx("div",{className:"gantt-project-start-line",style:{position:"absolute",left:`${Q}px`,top:0,bottom:0,width:`${r.projectStartLineWidth||1}px`,backgroundColor:r.projectStartLineColor||"#40a9ff",opacity:r.projectStartLineOpacity!==void 0?r.projectStartLineOpacity:1,borderLeft:r.projectStartLineStyle==="dashed"?`${r.projectStartLineWidth||1}px dashed ${r.projectStartLineColor||"#40a9ff"}`:r.projectStartLineStyle==="dotted"?`${r.projectStartLineWidth||1}px dotted ${r.projectStartLineColor||"#40a9ff"}`:"none",zIndex:6,pointerEvents:"none"}})]}),e.jsx("div",{className:"gantt-timeline-grid",children:Z.map((f,L)=>{const P=r.weekends&&ht(f.date),A=r.holidays&&ft(f.date,r.holidays);return e.jsx("div",{className:`gantt-timeline-grid-column ${P?"weekend":""} ${A?"holiday":""}`,style:{width:v,minWidth:v}},L)})}),a.length>0&&e.jsx(ar,{links:a,tasks:u,getTaskPosition:K}),e.jsx("div",{className:"gantt-timeline-tasks",style:{width:Y},children:u.map(f=>{const L=fe(f),P=S?w?.get(f.id):void 0,A=P?E(P):void 0;return e.jsxs("div",{className:"gantt-timeline-row",children:[P&&A&&e.jsx("div",{className:`gantt-baseline-bar ${f.type==="milestone"?"milestone":""}`,style:{left:`${A.left}px`,width:`${A.width}px`},title:`Baseline: ${P.start.toLocaleDateString()} - ${P.end.toLocaleDateString()}`}),e.jsx(Ct,{task:f,position:L,selected:y===f.id,dragging:D.taskId===f.id,dragDeltaX:D.dragDeltaX,dragType:D.type,onClick:()=>m(f.id),onDragStart:(R,le,ne)=>{$(f.id,R,le,ne),i(f.id,R,le)},readonly:r.readonly})]},f.id)})})]})]})});yt.displayName="Timeline";const gt=g.forwardRef((t,a)=>e.jsx("div",{className:"gantt-chart-wrapper",style:{flex:1,minWidth:0},children:e.jsx(yt,{...t,ref:a})}));gt.displayName="Chart";const{Search:ir}=p.Input,Nt=({onFilterChange:t,owners:a=[],uiConfig:o={}})=>{const[l,r]=g.useState({searchText:"",status:"all",priority:"all",owner:""}),y=s=>{const b={...l,...s};r(b),t(b)},m=()=>{const s={searchText:"",status:"all",priority:"all",owner:""};r(s),t(s)},i=l.searchText!==""||l.status!=="all"||l.priority!=="all"||l.owner!=="";return e.jsx("div",{className:"gantt-filter-container",children:e.jsxs("div",{className:"gantt-filter-bar",children:[e.jsx("div",{className:"gantt-filter-left",children:e.jsx(ir,{placeholder:o.searchPlaceholder||"Search stages...",value:l.searchText,onChange:s=>y({searchText:s.target.value}),allowClear:!0,className:"gantt-search-antd",style:{width:250}})}),e.jsxs("div",{className:"gantt-filter-right",children:[e.jsx(p.Select,{value:l.status,onChange:s=>y({status:s}),className:"gantt-filter-select-antd",style:{width:140},options:[{value:"all",label:o.statusOptions?.all||"All Status"},{value:"not-started",label:o.statusOptions?.notStarted||"Not Started"},{value:"in-progress",label:o.statusOptions?.inProgress||"In Progress"},{value:"completed",label:o.statusOptions?.completed||"Completed"}]}),e.jsx(p.Select,{value:l.priority,onChange:s=>y({priority:s}),className:"gantt-filter-select-antd",style:{width:130},options:[{value:"all",label:o.priorityFilterOptions?.all||"All Priority"},{value:"low",label:o.priorityFilterOptions?.low||"Low"},{value:"medium",label:o.priorityFilterOptions?.medium||"Medium"},{value:"high",label:o.priorityFilterOptions?.high||"High"}]}),e.jsx(p.Select,{value:l.owner||void 0,onChange:s=>y({owner:s||""}),className:"gantt-filter-select-antd",style:{width:130},placeholder:o.allOwnersText||"All Owners",allowClear:!0,options:[{value:"",label:o.allOwnersText||"All Owners"},...(a||[]).map(s=>({value:s,label:s}))]}),i&&e.jsx(p.Button,{type:"default",danger:!0,icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTimesCircle}),onClick:m,className:"gantt-filter-clear-antd",children:o.clearFiltersText||"Clear"})]})]})})},Ae=(t,a)=>t?typeof t=="string"?e.jsx(ce.FontAwesomeIcon,{icon:a}):t:e.jsx(ce.FontAwesomeIcon,{icon:a}),At=({zoomLevel:t,setZoomLevel:a,onExport:o,onFilterChange:l,owners:r,onAddTask:y,uiConfig:m,iconConfig:i={},styleConfig:s})=>{const b=He(s),c=m.showZoomButtons!==!1,w=m.showExportButtons!==!1,T=c&&w;return e.jsxs("div",{className:"gantt-toolbar-wrapper",children:[e.jsxs("div",{className:"gantt-toolbar",children:[e.jsx("div",{className:"gantt-toolbar-left",children:e.jsx(p.Space,{size:8,children:m.showAddTaskButton!==!1&&e.jsx(p.Button,{type:"primary",icon:Ae(i.addTask,G.faPlus),onClick:()=>y?.(),style:b.buttonPrimary,children:m.addTaskButtonText||"New Stage"})})}),e.jsx("div",{className:"gantt-toolbar-right",children:e.jsxs(p.Space,{size:4,children:[c&&e.jsxs(e.Fragment,{children:[e.jsx(p.Tooltip,{title:m.zoomOutTooltip||"Zoom Out",children:e.jsx(p.Button,{icon:Ae(i.zoomOut,G.faSearchMinus),onClick:()=>a(Math.max(.5,t-.25)),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.zoomInTooltip||"Zoom In",children:e.jsx(p.Button,{icon:Ae(i.zoomIn,G.faSearchPlus),onClick:()=>a(Math.min(2,t+.25)),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.resetZoomTooltip||"Reset Zoom",children:e.jsx(p.Button,{icon:Ae(i.resetZoom,G.faRotateLeft),onClick:()=>a(1),style:b.buttonSecondary})})]}),T&&e.jsx(p.Divider,{type:"vertical",style:{height:24,margin:"0 4px"}}),w&&e.jsxs(e.Fragment,{children:[e.jsx(p.Tooltip,{title:m.exportCSVTooltip||"Export to CSV",children:e.jsx(p.Button,{icon:Ae(i.exportCSV,G.faFileCsv),onClick:()=>o("csv"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.exportExcelTooltip||"Export to Excel",children:e.jsx(p.Button,{icon:Ae(i.exportExcel,G.faFileExcel),onClick:()=>o("excel"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.exportJSONTooltip||"Export to JSON",children:e.jsx(p.Button,{icon:Ae(i.exportJSON,G.faFileCode),onClick:()=>o("json"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:m.exportPDFTooltip||"Export to PDF",children:e.jsx(p.Button,{icon:Ae(i.exportPDF,G.faFilePdf),onClick:()=>o("pdf"),style:b.buttonSecondary})})]})]})})]}),m.showFilterSearch!==!1&&e.jsx(Nt,{onFilterChange:l,owners:r,uiConfig:m})]})},{Option:Ue}=p.Select,{TextArea:lr}=p.Input,Bt=({onCreateTask:t,onClose:a,uiConfig:o={},parentId:l,parentTaskName:r,styleConfig:y})=>{const[m]=p.Form.useForm(),i=He(y),s=b=>{const c=b.start.toDate(),w=new Date(c);w.setDate(w.getDate()+(b.duration||1)),t({text:b.text,start:c,end:w,duration:b.duration||1,progress:b.progress||0,type:b.type,color:typeof b.color=="string"?b.color:b.color?.toHexString?.()||"#4A90E2",owner:b.owner||"",priority:b.priority||"medium",details:b.details||"",parent:l},l),a()};return e.jsx(p.Modal,{title:l?(o.taskCreatorTitle||"Create Checklist")+(r?` for "${r}"`:""):o.taskCreatorTitle||"Create New Stage",open:!0,onCancel:a,onOk:()=>m.submit(),okText:o.taskCreatorOkText||"Create Stage",cancelText:o.taskCreatorCancelText||"Cancel",width:600,className:"gantt-modal-antd",styles:{content:i.modal,header:{borderBottom:`1px solid ${i.modal?.borderColor||"#f0f0f0"}`,marginBottom:16}},okButtonProps:{style:i.buttonPrimary},cancelButtonProps:{style:i.buttonSecondary},children:e.jsxs(p.Form,{form:m,layout:"vertical",onFinish:s,initialValues:{type:"task",priority:"medium",start:Et(),duration:1,progress:0,color:"#4A90E2"},children:[e.jsx(p.Form.Item,{name:"text",label:o.taskNameLabel||"Stage Name",rules:[{required:!0,message:o.taskNameRequired||"Please enter stage name"}],children:e.jsx(p.Input,{placeholder:o.taskNamePlaceholder||"Enter stage name",autoFocus:!0,style:i.input})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"type",label:o.typeLabel||"Type",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ue,{value:"task",children:o.taskTypeOptions?.task||"Stage"}),e.jsx(Ue,{value:"milestone",children:o.taskTypeOptions?.milestone||"Milestone"}),e.jsx(Ue,{value:"project",children:o.taskTypeOptions?.project||"Project"})]})}),e.jsx(p.Form.Item,{name:"priority",label:o.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ue,{value:"low",children:o.priorityOptions?.low||"Low"}),e.jsx(Ue,{value:"medium",children:o.priorityOptions?.medium||"Medium"}),e.jsx(Ue,{value:"high",children:o.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"start",label:o.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(p.DatePicker,{style:{width:"100%",...i.input}})}),e.jsx(p.Form.Item,{name:"duration",label:o.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,style:{width:"100%",...i.input}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"color",label:o.colorLabel||"Color",style:{flex:1},children:e.jsx(p.ColorPicker,{showText:!0})}),e.jsx(p.Form.Item,{name:"progress",label:o.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,max:100,style:{width:"100%",...i.input}})})]}),e.jsx(p.Form.Item,{name:"owner",label:o.ownerLabel||"Owner",children:e.jsx(p.Input,{placeholder:o.ownerPlaceholder||"Assign to...",style:i.input})}),e.jsx(p.Form.Item,{name:"details",label:o.detailsLabel||"Details",children:e.jsx(lr,{placeholder:o.detailsPlaceholder||"Add stage description...",rows:3,style:i.input})})]})})},{Option:Ve}=p.Select,{TextArea:dr}=p.Input,{confirm:cr}=p.Modal,It=({task:t,onUpdate:a,onDelete:o,onClose:l,uiConfig:r={},styleConfig:y})=>{const[m]=p.Form.useForm(),i=He(y),s=c=>{const w=c.start.toDate(),T=new Date(w);T.setDate(T.getDate()+(c.duration||1)),a({...t,text:c.text,start:w,end:T,duration:c.duration||1,progress:c.progress||0,type:c.type,color:typeof c.color=="string"?c.color:c.color?.toHexString?.()||"#4A90E2",owner:c.owner||"",priority:c.priority||"medium",details:c.details||""}),l()},b=()=>{cr({title:r.deleteConfirmTitle?`${r.deleteConfirmTitle}: "${t.text}"?`:`Are you sure you want to delete "${t.text}"?`,icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faExclamationTriangle,style:{color:"#faad14",marginRight:8}}),content:r.deleteConfirmContent||"This action cannot be undone.",okText:r.deleteConfirmOkText||"Yes, Delete",okType:"danger",cancelText:r.deleteConfirmCancelText||"No",onOk(){o(t.id),l()}})};return e.jsx(p.Modal,{title:r.taskEditorTitle||"Edit Stage",open:!0,onCancel:l,footer:[e.jsx(p.Button,{danger:!0,onClick:b,style:{float:"left",...i.buttonDanger},children:r.taskEditorDeleteText||"Delete"},"delete"),e.jsx(p.Button,{onClick:l,style:i.buttonSecondary,children:r.taskEditorCancelText||"Cancel"},"cancel"),e.jsx(p.Button,{type:"primary",onClick:()=>m.submit(),style:i.buttonPrimary,children:r.taskEditorSaveText||"Save Changes"},"submit")],width:600,className:"gantt-modal-antd",styles:{content:i.modal,header:{borderBottom:`1px solid ${i.modal?.borderColor||"#f0f0f0"}`,marginBottom:16}},children:e.jsxs(p.Form,{form:m,layout:"vertical",onFinish:s,initialValues:{text:t.text,type:t.type||"task",priority:t.priority||"medium",start:Et(t.start),duration:t.duration,progress:t.progress,color:t.color||"#4A90E2",owner:t.owner||"",details:t.details||""},children:[e.jsx(p.Form.Item,{name:"text",label:r.taskNameLabel||"Stage Name",rules:[{required:!0,message:r.taskNameRequired||"Please enter stage name"}],children:e.jsx(p.Input,{placeholder:r.taskNamePlaceholder||"Enter stage name",style:i.input})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"type",label:r.typeLabel||"Type",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ve,{value:"task",children:r.taskTypeOptions?.task||"Stage"}),e.jsx(Ve,{value:"milestone",children:r.taskTypeOptions?.milestone||"Milestone"}),e.jsx(Ve,{value:"project",children:r.taskTypeOptions?.project||"Project"})]})}),e.jsx(p.Form.Item,{name:"priority",label:r.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ve,{value:"low",children:r.priorityOptions?.low||"Low"}),e.jsx(Ve,{value:"medium",children:r.priorityOptions?.medium||"Medium"}),e.jsx(Ve,{value:"high",children:r.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"start",label:r.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(p.DatePicker,{style:{width:"100%",...i.input}})}),e.jsx(p.Form.Item,{name:"duration",label:r.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,style:{width:"100%",...i.input}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"color",label:r.colorLabel||"Color",style:{flex:1},children:e.jsx(p.ColorPicker,{showText:!0})}),e.jsx(p.Form.Item,{name:"progress",label:r.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,max:100,style:{width:"100%",...i.input}})})]}),e.jsx(p.Form.Item,{name:"owner",label:r.ownerLabel||"Owner",children:e.jsx(p.Input,{placeholder:r.ownerPlaceholder||"Assign to...",style:i.input})}),e.jsx(p.Form.Item,{name:"details",label:r.detailsLabel||"Details",children:e.jsx(dr,{placeholder:r.detailsPlaceholder||"Add stage description...",rows:3,style:i.input})})]})})},{Title:et,Text:Re,Paragraph:ur}=p.Typography,{Option:Ee}=p.Select,_t=({task:t,allTasks:a,links:o,onAddDependency:l,onRemoveDependency:r,onTaskUpdate:y,onClose:m,styleConfig:i})=>{const s=He(i),[b,c]=g.useState(""),[w,T]=g.useState("e2s"),[u,h]=g.useState(0),[v,S]=g.useState("day"),[D,$]=g.useState(t.duration),[F,H]=g.useState(""),ae=o.filter(M=>M.target===t.id),X=a.filter(M=>M.id!==t.id&&M.id!==t.parent),fe=()=>{if(b){const M=mt(u,v);if(D!==t.duration&&y){const U=he(new Date(t.start),D,"day");y({...t,duration:D,end:U})}l(b,t.id,w,M),c(""),h(0),S("day")}},E=()=>{if(!F.trim())return;const M=er(F.trim());if(!M){alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
15
- Example: 3FS+10d`);return}const U=M.taskNumber-1,se=a[U];if(!se){alert(`Task ${M.taskNumber} not found`);return}const Z=rr(M.type),ye=mt(M.lag,M.lagUnit);l(se.id,t.id,Z,ye),H("")},K=M=>{switch(M){case"e2s":return"Finish-to-Start (FS)";case"s2s":return"Start-to-Start (SS)";case"e2e":return"Finish-to-Finish (FF)";case"s2e":return"Start-to-Finish (SF)"}},q=M=>{switch(M){case"e2s":return"blue";case"s2s":return"green";case"e2e":return"purple";case"s2e":return"orange"}};return e.jsx(p.Modal,{title:e.jsx(et,{level:4,style:{margin:0,color:s.font?.color},children:"Dependency Editor"}),open:!0,onCancel:m,footer:null,width:700,styles:{content:s.modal,header:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`}},children:e.jsxs("div",{style:{padding:"8px 0"},children:[e.jsx(p.Alert,{message:"Managing dependencies helps in auto-scheduling and critical path calculation.",type:"info",showIcon:!0,style:{marginBottom:20,...s.font}}),e.jsxs("div",{style:{display:"flex",gap:20,marginBottom:24},children:[e.jsx(p.Card,{title:e.jsx(et,{level:5,style:{margin:0,fontSize:14,color:s.font?.color},children:"Settings"}),size:"small",style:{flex:1,...s.modal},headStyle:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`},children:e.jsxs(p.Space,{direction:"vertical",style:{width:"100%"},size:"middle",children:[e.jsxs("div",{children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Predecessor"}),e.jsx(p.Select,{showSearch:!0,placeholder:"Select a task",optionFilterProp:"children",style:{width:"100%",...s.input},value:b,onChange:c,children:X.map(M=>e.jsxs(Ee,{value:M.id,children:["[",a.indexOf(M)+1,"] ",M.text]},M.id))})]}),e.jsxs("div",{children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Type"}),e.jsxs(p.Select,{style:{width:"100%",...s.input},value:w,onChange:T,children:[e.jsx(Ee,{value:"e2s",children:"Finish-to-Start (FS)"}),e.jsx(Ee,{value:"s2s",children:"Start-to-Start (SS)"}),e.jsx(Ee,{value:"e2e",children:"Finish-to-Finish (FF)"}),e.jsx(Ee,{value:"s2e",children:"Start-to-Finish (SF)"})]})]}),e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Lag/Lead"}),e.jsx(p.InputNumber,{style:{width:"100%",...s.input},value:u,onChange:M=>h(M||0)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Units"}),e.jsxs(p.Select,{style:{width:"100%",...s.input},value:v,onChange:S,children:[e.jsx(Ee,{value:"day",children:"Days"}),e.jsx(Ee,{value:"hour",children:"Hours"}),e.jsx(Ee,{value:"week",children:"Weeks"}),e.jsx(Ee,{value:"month",children:"Months"})]})]})]}),e.jsxs("div",{children:[e.jsx(Re,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Duration (days)"}),e.jsx(p.InputNumber,{style:{width:"100%",...s.input},min:1,value:D,onChange:M=>$(M||1)})]}),e.jsx(p.Button,{type:"primary",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faPlus,style:{marginRight:8}}),block:!0,onClick:fe,disabled:!b,style:{height:40,marginTop:8,...s.buttonPrimary},children:"Add Dependency"})]})}),e.jsxs(p.Card,{title:e.jsx(et,{level:5,style:{margin:0,fontSize:14,color:s.font?.color},children:"Quick Add"}),size:"small",style:{width:250,...s.modal},headStyle:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`},children:[e.jsxs(ur,{type:"secondary",style:{fontSize:12,marginBottom:16,color:s.font?.color,opacity:.7},children:["Format: [TaskNumber][Type][+/-][Lag][Unit]",e.jsx("br",{}),"Example: 3FS+10d"]}),e.jsx(p.Input,{placeholder:"e.g. 5FS+2d",value:F,onChange:M=>H(M.target.value),onPressEnter:E,style:{marginBottom:16,height:40,...s.input}}),e.jsx(p.Button,{block:!0,onClick:E,style:{height:40,...s.buttonSecondary},children:"Apply"})]})]}),e.jsx(p.Divider,{style:{margin:"0 0 24px 0",borderColor:s.modal?.borderColor}}),e.jsxs("div",{style:{maxHeight:300,overflowY:"auto"},children:[e.jsx(et,{level:5,style:{fontSize:14,marginBottom:16,color:s.font?.color},children:"Current Dependencies"}),e.jsx(p.List,{dataSource:ae,locale:{emptyText:e.jsx(Re,{type:"secondary",style:{color:s.font?.color,opacity:.5},children:"No dependencies added yet."})},renderItem:M=>{const U=a.find(se=>se.id===M.source);return e.jsx(p.List.Item,{style:{padding:"12px 16px",background:"#fafafa",borderRadius:8,marginBottom:12,border:`1px solid ${s.listItem?.borderColor||"#f0f0f0"}`},actions:[e.jsx(p.Button,{type:"text",danger:!0,icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTrash}),onClick:()=>r(M.id)},"delete")],children:e.jsx(p.List.Item.Meta,{avatar:e.jsx("div",{style:{width:32,height:32,borderRadius:16,background:"#1890ff",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:12,fontWeight:"bold"},children:U?a.indexOf(U)+1:"?"}),title:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontWeight:600,color:s.font?.color},children:U?.text||"Unknown Task"}),e.jsx(p.Tag,{color:q(M.type),style:{margin:0},children:K(M.type)})]}),description:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16,marginTop:4},children:e.jsxs("span",{style:{fontSize:12,color:s.font?.color,opacity:.7},children:[e.jsx(ce.FontAwesomeIcon,{icon:G.faLink,style:{marginRight:6}}),"Lag: ",M.lag||0," days"]})})})})}})]}),e.jsxs("div",{style:{marginTop:24,padding:"16px",background:"#fff7e6",borderRadius:8,border:"1px solid #ffe7ba"},children:[e.jsxs(et,{level:5,style:{fontSize:13,marginBottom:8,display:"flex",alignItems:"center"},children:[e.jsx(ce.FontAwesomeIcon,{icon:G.faInfoCircle,style:{marginRight:8,color:"#fa8c16"}}),"Coming soon"]}),e.jsx(Re,{style:{fontSize:12,color:"rgba(0,0,0,0.65)"},children:"Dependency visualization on the chart and automatic lag calculations based on working hours."})]})]})})},pr=({x:t,y:a,task:o,onEdit:l,onDelete:r,onCopy:y,onDependencies:m,onConvertToMilestone:i,onConvertToTask:s,onConvertToProject:b,onAutoSchedule:c,onClose:w,styleConfig:T})=>{const u=He(T);if(!o)return null;const h=[{key:"edit",label:"Edit",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faEdit}),onClick:()=>{l(),w()}},{key:"copy",label:"Copy",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faCopy}),onClick:()=>{y(),w()}},{key:"dependencies",label:"Dependencies",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faLink}),onClick:()=>{m(),w()}},{type:"divider"},{key:"convert",label:"Convert to",type:"submenu",children:[{key:"milestone",label:"Milestone",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faFlag}),disabled:o.type==="milestone",onClick:()=>{i(),w()}},{key:"task",label:"Task",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTasks}),disabled:o.type==="task",onClick:()=>{s(),w()}},{key:"project",label:"Project",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faFolder}),disabled:o.type==="project",onClick:()=>{b(),w()}}]},{key:"auto-schedule",label:"Auto Schedule",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faRotateLeft}),onClick:()=>{c?.(),w()}},{type:"divider"},{key:"delete",label:"Delete",icon:e.jsx(ce.FontAwesomeIcon,{icon:G.faTrash}),danger:!0,onClick:()=>{r(),w()}}];return e.jsx("div",{className:"gantt-context-menu",style:{position:"fixed",left:`${t}px`,top:`${a}px`,zIndex:1e4},onClick:v=>v.stopPropagation(),children:e.jsx(p.Menu,{items:h,style:{boxShadow:u.popover?.boxShadow||"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:u.popover?.borderRadius||"6px",border:`1px solid ${u.popover?.borderColor||"#e0e0e0"}`,backgroundColor:u.popover?.backgroundColor,color:u.font?.color,fontFamily:u.font?.fontFamily}})})},Yt=(t,a=[])=>{const[o,l]=g.useState([]),[r,y]=g.useState(-1),[m,i]=g.useState(t),[s,b]=g.useState(a);g.useEffect(()=>{i(t)},[t]),g.useEffect(()=>{b(a)},[a]);const c=g.useCallback(($,F,H)=>{const ae={type:$,before:F,after:H,timestamp:Date.now()},X=o.slice(0,r+1);X.push(ae),X.length>50?X.shift():y(r+1),l(X)},[o,r]),w=g.useCallback(()=>{if(r<0)return;const $=o[r];i($.before.tasks),b($.before.links),y(r-1)},[o,r]),T=g.useCallback(()=>{if(r>=o.length-1)return;const $=o[r+1];i($.after.tasks),b($.after.links),y(r+1)},[o,r]),u=r>=0,h=r<o.length-1,v=g.useCallback($=>{const F={tasks:m,links:s},H=m.map(X=>X.id===$.id?$:X);c("task_update",F,{tasks:H,links:s}),i(H)},[m,s,c]),S=g.useCallback($=>{const F={tasks:m,links:s},H=[...m,$];c("task_create",F,{tasks:H,links:s}),i(H)},[m,s,c]),D=g.useCallback($=>{const F={tasks:m,links:s},H=m.filter(fe=>fe.id!==$),ae=s.filter(fe=>fe.source!==$&&fe.target!==$);c("task_delete",F,{tasks:H,links:ae}),i(H),b(ae)},[m,s,c]);return{tasks:m,links:s,setTasks:i,setLinks:b,undo:w,redo:T,canUndo:u,canRedo:h,updateTask:v,createTask:S,deleteTask:D,saveState:c,history:o}},Rt=(t,a,o={mode:"forward"})=>{const l=new Map,r=new Map;return t.forEach(y=>{l.set(y.id,[]),r.set(y.id,[])}),a.forEach(y=>{y.type==="e2s"&&(l.get(y.target)?.push(y.source),r.get(y.source)?.push(y.target))}),o.mode==="forward"?hr(t,l,o):fr(t,r,o)},hr=(t,a,o)=>{const l=new Map,r=new Set,y=o.projectStart||new Date,m=i=>{if(r.has(i))return;const s=t.find(h=>h.id===i);if(!s)return;const b=a.get(i)||[];b.forEach(h=>m(h));let c=y;b.forEach(h=>{const v=l.get(h);v&&v.end>c&&(c=new Date(v.end))});const w=new Date(c),T=he(w,s.duration,"day"),u={...s,start:w,end:T};l.set(i,u),r.add(i)};return t.forEach(i=>m(i.id)),t.map(i=>l.get(i.id)||i)},fr=(t,a,o)=>{const l=new Map,r=new Set,y=o.projectEnd||new Date(Math.max(...t.map(i=>i.end.getTime()))),m=i=>{if(r.has(i))return;const s=t.find(h=>h.id===i);if(!s)return;const b=a.get(i)||[];b.forEach(h=>m(h));let c=y;b.forEach(h=>{const v=l.get(h);v&&v.start<c&&(c=new Date(v.start))});const w=new Date(c),T=he(w,-s.duration,"day"),u={...s,start:T,end:w};l.set(i,u),r.add(i)};return t.forEach(i=>m(i.id)),t.map(i=>l.get(i.id)||i)},mr=Object.freeze(Object.defineProperty({__proto__:null,autoSchedule:Rt,levelResources:t=>{const a=new Map;t.forEach(l=>{l.owner&&(a.has(l.owner)||a.set(l.owner,[]),a.get(l.owner).push(l))});const o=[...t];return a.forEach(l=>{const r=l.sort((y,m)=>y.start.getTime()-m.start.getTime());for(let y=1;y<r.length;y++){const m=r[y],i=r[y-1];if(m.start<i.end){const s=o.findIndex(b=>b.id===m.id);if(s>=0){const b=new Date(i.end),c=he(b,m.duration,"day");o[s]={...m,start:b,end:c}}}}}),o}},Symbol.toStringTag,{value:"Module"})),zt=t=>{const a=new Map;return t.forEach(o=>{a.set(o.id,{taskId:o.id,start:new Date(o.start),end:new Date(o.end)})}),a},Wt=t=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority"],o=t.map(r=>[r.id,r.text,xe(r.start,"YYYY-MM-DD"),xe(r.end,"YYYY-MM-DD"),r.duration.toString(),`${r.progress}%`,r.type||"task",r.owner||"",r.priority||"medium"]),l=[a.join(","),...o.map(r=>r.map(y=>`"${y}"`).join(","))].join(`
16
- `);st(l,"gantt-tasks.csv","text/csv")},Ht=t=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority","Details"],o=t.map(r=>[r.id,r.text,xe(r.start,"MM/DD/YYYY"),xe(r.end,"MM/DD/YYYY"),r.duration.toString(),r.progress.toString(),r.type||"task",r.owner||"",r.priority||"medium",r.details||""]),l="\uFEFF"+[a.join(" "),...o.map(r=>r.map(y=>y.replace(/\t/g," ")).join(" "))].join(`
17
- `);st(l,"gantt-tasks.xls","application/vnd.ms-excel")},Ut=(t,a)=>{const o={tasks:t,links:a,exported:new Date().toISOString(),version:"1.0"},l=JSON.stringify(o,null,2);st(l,"gantt-project.json","application/json")},Vt=t=>{const a=`
14
+ <%s key={someKey} {...props} />`,Et,ze,Tr,ze),$[ze+Et]=!0}}return n===l?j(ue):d(ue),ue}}function q(n,f,k){return A(n,f,k,!0)}function G(n,f,k){return A(n,f,k,!1)}var ge=G,ce=q;Ze.Fragment=l,Ze.jsx=ge,Ze.jsxs=ce})()),Ze}var Ot;function Zt(){return Ot||(Ot=1,process.env.NODE_ENV==="production"?at.exports=Jt():at.exports=Gt()),at.exports}var e=Zt();const fe=(t,a,o)=>{const l=new Date(t);switch(o){case"hour":l.setHours(l.getHours()+a);break;case"day":l.setDate(l.getDate()+a);break;case"week":l.setDate(l.getDate()+a*7);break;case"month":l.setMonth(l.getMonth()+a);break;case"quarter":l.setMonth(l.getMonth()+a*3);break;case"year":l.setFullYear(l.getFullYear()+a);break}return l},Ke=(t,a)=>{const o=a.getTime()-t.getTime();return Math.ceil(o/(1e3*60*60*24))},Ct=(t,a)=>{const o=a.getTime()-t.getTime();return Math.ceil(o/(1e3*60*60))},ye=(t,a)=>{const o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],g={YYYY:t.getFullYear().toString(),YY:t.getFullYear().toString().slice(-2),MMMM:l[t.getMonth()],MMM:o[t.getMonth()],MM:String(t.getMonth()+1).padStart(2,"0"),M:String(t.getMonth()+1),DD:String(t.getDate()).padStart(2,"0"),D:String(t.getDate()),dddd:r[t.getDay()],HH:String(t.getHours()).padStart(2,"0"),H:String(t.getHours()),mm:String(t.getMinutes()).padStart(2,"0"),m:String(t.getMinutes())};return a.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g,x=>g[x])},mt=t=>{const a=t.getDay();return a===0||a===6},xt=(t,a)=>a.some(o=>o.getFullYear()===t.getFullYear()&&o.getMonth()===t.getMonth()&&o.getDate()===t.getDate()),Be=t=>{const a=new Date(t);return a.setHours(0,0,0,0),a},Kt=t=>{const a=new Date(t);return a.setHours(23,59,59,999),a},Qt=(t,a,o="day")=>{switch(o){case"hour":return Ct(t,a);case"day":return Ke(t,a);case"week":return Math.ceil(Ke(t,a)/7);case"month":return(a.getFullYear()-t.getFullYear())*12+(a.getMonth()-t.getMonth());default:return Ke(t,a)}};function er(t){if(!t||typeof t!="string")return null;const a=t.trim(),o=/^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,l=a.match(o);if(!l)return null;const r=parseInt(l[1],10),g=l[2].toUpperCase();let x=0,i="day";if(l[3]){const s=l[4]==="-"?-1:1;switch(x=parseInt(l[5],10)*s,l[6].toLowerCase()){case"d":i="day";break;case"h":i="hour";break;case"w":i="week";break;case"m":i="month";break}}return{taskNumber:r,type:g,lag:x,lagUnit:i}}function yt(t,a){switch(a){case"hour":return t/24;case"day":return t;case"week":return t*7;case"month":return t*30;default:return t}}function tr(t,a){const l={e2s:"FS",s2s:"SS",e2e:"FF",s2e:"SF"}[t.type];let r=`${a}${l}`;if(t.lag&&t.lag!==0){const g=t.lag>0?"+":"",i=(t.lagUnit||"day").charAt(0);let s=t.lag;if(t.lagUnit&&t.lagUnit!=="day")switch(t.lagUnit){case"hour":s=t.lag*24;break;case"week":s=t.lag/7;break;case"month":s=t.lag/30;break}r+=`${g}${Math.round(s)}${i}`}return r}function rr(t){return{FS:"e2s",SS:"s2s",FF:"e2e",SF:"s2e"}[t]}const We=t=>t?{popover:{backgroundColor:t.popoverBackground||"#fff",borderColor:t.popoverBorderColor||"#f0f0f0",borderRadius:t.popoverBorderRadius||"8px",boxShadow:t.popoverShadow||"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",padding:t.popoverPadding||"0",fontFamily:t.popoverFontFamily||t.fontFamily||"inherit",fontSize:t.popoverFontSize||t.fontSize||"14px"},modal:{backgroundColor:t.modalBackground||"#fff",borderRadius:t.modalBorderRadius||"8px",borderColor:t.modalBorderColor||"#f0f0f0",boxShadow:t.modalShadow||"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)"},buttonPrimary:{backgroundColor:t.buttonPrimaryBackground||"#1677ff",color:t.buttonPrimaryColor||"#fff",borderRadius:t.buttonPrimaryBorderRadius||"6px",fontWeight:t.buttonPrimaryFontWeight||400,fontFamily:t.buttonPrimaryFontFamily||t.fontFamily||"inherit",boxShadow:"0 2px 0 rgba(5, 145, 255, 0.1)"},buttonDanger:{backgroundColor:t.buttonDangerBackground||"#ff4d4f",color:t.buttonDangerColor||"#fff",borderRadius:t.buttonPrimaryBorderRadius||"6px",boxShadow:"0 2px 0 rgba(255, 38, 5, 0.06)"},buttonSecondary:{backgroundColor:t.buttonSecondaryBackground||"transparent",color:t.buttonSecondaryColor||"rgba(0, 0, 0, 0.88)",borderColor:t.buttonSecondaryBorderColor||"#d9d9d9",borderRadius:t.buttonPrimaryBorderRadius||"6px",boxShadow:"0 2px 0 rgba(0, 0, 0, 0.02)"},input:{backgroundColor:t.inputBackground,borderColor:t.inputBorderColor,borderRadius:t.inputBorderRadius||"6px",fontFamily:t.inputFontFamily||t.fontFamily||"inherit",fontSize:t.inputFontSize||t.fontSize||"14px"},listItem:{hoverBackground:t.listItemHoverBackground||"#f5f5f5",selectedBackground:t.listItemSelectedBackground||"#e6f4ff",borderColor:t.listItemBorderColor||"#f0f0f0"},badge:{backgroundColor:t.badgeBackground||"#e6f4ff",borderColor:t.badgeBorderColor||"transparent",color:t.badgeColor||"#1677ff",fontSize:t.badgeFontSize||"12px",padding:t.badgePadding||"0 7px",borderRadius:t.badgeBorderRadius||"10px"},link:{color:t.linkColor||"#1677ff",hoverColor:t.linkHoverColor||"#69b1ff",fontWeight:t.linkFontWeight||400},font:{fontFamily:t.fontFamily||"inherit",fontSize:t.fontSize||"14px",fontWeight:t.fontWeight||400,lineHeight:t.lineHeight||1.5714285714285714,color:t.fontColor||"rgba(0, 0, 0, 0.88)"}}:{},{Text:we,Paragraph:nr}=p.Typography,{Option:Oe}=p.Select,or=({task:t,allTasks:a,links:o,onAddDependency:l,onRemoveDependency:r,onTaskUpdate:g,children:x,styleConfig:i})=>{const s=We(i),[b,c]=y.useState(!1),[w,T]=y.useState(null),[u,h]=y.useState("e2s"),[v,S]=y.useState("lag"),[D,F]=y.useState(0),[P,H]=y.useState(t.duration),[se,J]=y.useState(!0),me="day",E=o.find(R=>R.target===t.id),ee=!!E,X=y.useMemo(()=>a.length===0?new Date:new Date(Math.min(...a.map(R=>R.start.getTime()))),[a]),L=()=>{if(w){const R=v==="lag"?D:-D,Y=yt(R,me);if(P!==t.duration&&g){const he=fe(new Date(t.start),P,"day");g({...t,duration:P,end:he})}l(w,t.id,u,Y),c(!1),U()}},U=()=>{T(null),h("e2s"),S("lag"),F(0),H(t.duration)},ie=()=>{E&&r&&(r(E.id),c(!1),U())},K=R=>{if(c(R),R){if(J(!0),E){T(E.source),h(E.type);const Y=E.lag||0;Y>=0?(S("lag"),F(Y)):(S("lead"),F(Math.abs(Y)))}else U();H(t.duration)}},xe=()=>{if(!se)return null;const R=u==="e2s",Y=u==="s2s",he=u==="e2e",re=u==="s2e";let ne=0,te=0,m="",M=0,O=-1;R?(ne=50,te=350,M=250,O=350,m="M 250 60 L 300 60 L 300 140 L 348 140"):he?(ne=100,te=100,M=300,O=-1,m="M 300 60 L 350 60 L 350 140 L 302 140"):Y?(ne=250,te=250,M=250,O=-1,m="M 250 60 L 200 60 L 200 140 L 248 140"):re&&(ne=350,te=50,M=350,O=250,m="M 350 60 L 300 60 L 300 140 L 252 140");const N=w==="gantt-start-date",I=a.find(le=>le.id===w);return e.jsx("div",{style:{width:"100%",height:90,backgroundColor:"#fbfbfb",borderRadius:4,marginBottom:12,border:"1px solid #f0f0f0",position:"relative",overflow:"hidden",flexShrink:0},children:e.jsxs("svg",{viewBox:"0 0 600 200",style:{width:"100%",height:"100%"},preserveAspectRatio:"xMidYMid meet",children:[e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead",markerWidth:"12",markerHeight:"9",refX:"12",refY:"4.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 12 4.5, 0 9",fill:"#8c8c8c"})})}),e.jsx("line",{x1:M,x2:M,y1:"0",y2:"200",stroke:"#f0f0f0",strokeDasharray:"3,3"}),O!==-1&&e.jsx("line",{x1:O,x2:O,y1:"0",y2:"200",stroke:"#f0f0f0",strokeDasharray:"3,3"}),e.jsx("rect",{x:ne,y:"35",width:"200",height:"50",rx:"4",fill:"#e6f4ff",stroke:"#91caff",strokeWidth:"2"}),e.jsx("text",{x:ne+100,y:"66",fontSize:"15",textAnchor:"middle",fill:"#003a8c",fontWeight:"600",children:N?"Start Date":I?`Stage ${a.indexOf(I)+1}`:"Predecessor"}),e.jsx("rect",{x:te,y:"115",width:"200",height:"50",rx:"4",fill:"#e6f4ff",stroke:"#91caff",strokeWidth:"2"}),e.jsxs("text",{x:te+100,y:"146",fontSize:"15",textAnchor:"middle",fill:"#003a8c",fontWeight:"600",children:["Stage ",a.indexOf(t)+1]}),e.jsx("path",{d:m,fill:"none",stroke:"#8c8c8c",strokeWidth:"2.5",markerEnd:"url(#arrowhead)"})]})})},Ee=()=>{const R=w==="gantt-start-date",Y=a.find(te=>te.id===w);if(!w)return"Select a checklist from the list to see how it will relate to the current stage.";const he=a.indexOf(t)+1,re=R?"Start Date":`Stage ${a.indexOf(Y)+1}`;let ne="";switch(u){case"e2s":ne=`Stage ${he} starts after ${re} finishes`;break;case"s2s":ne=`Stage ${he} starts when ${re} starts`;break;case"e2e":ne=`Stage ${he} finishes when ${re} finishes`;break;case"s2e":ne=`Stage ${he} finishes when ${re} starts`;break}if(D>0){const te=`${D} ${me}${D>1?"s":""}`;v==="lag"?ne+=` + ${te} delay`:ne+=` - ${te} overlap`}return ne+"."},Te=e.jsxs("div",{style:{width:550,backgroundColor:s.popover?.backgroundColor||"#fff",borderRadius:s.popover?.borderRadius||"8px",padding:"16px 20px",boxShadow:s.popover?.boxShadow,fontFamily:s.popover?.fontFamily},children:[e.jsx(we,{strong:!0,style:{fontSize:"16px",display:"block",marginBottom:16,color:s.font?.color},children:"Add Dependency"}),e.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14},children:[e.jsx("div",{style:{flex:1},children:e.jsxs(p.Select,{showSearch:!0,placeholder:"Select checklist",value:w,onChange:T,style:{width:"100%"},filterOption:(R,Y)=>{if(Y?.value==="gantt-start-date")return"start date".includes(R.toLowerCase());const he=a.find(ne=>ne.id===Y?.value);if(!he)return!1;const re=a.indexOf(he)+1;return he.text.toLowerCase().includes(R.toLowerCase())||re.toString().includes(R)},optionLabelProp:"label",children:[a.filter(R=>R.id!==t.id).map(R=>e.jsx(Oe,{value:R.id,label:R.text,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"4px 0"},children:[e.jsxs(we,{style:{fontSize:"13px"},children:[a.indexOf(R)+1,". ",R.text]}),e.jsxs(we,{type:"secondary",style:{fontSize:"11px"},children:["Start: ",ye(R.start,"MMM D, YYYY")]})]})},R.id)),e.jsx(Oe,{value:"gantt-start-date",label:"Start Date",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"4px 0",borderTop:"1px solid #f0f0f0",marginTop:"4px",paddingTop:"8px"},children:[e.jsx(we,{style:{fontSize:"13px",fontWeight:600},children:"Start Date"}),e.jsx(we,{type:"secondary",style:{fontSize:"11px"},children:ye(X,"MMM D, YYYY")})]})},"gantt-start-date")]})}),e.jsx("div",{style:{width:100},children:e.jsxs(p.Select,{value:u,onChange:h,style:{width:"100%"},children:[e.jsx(Oe,{value:"e2s",children:"FS"}),e.jsx(Oe,{value:"e2e",children:"FF"}),e.jsx(Oe,{value:"s2s",children:"SS"}),e.jsx(Oe,{value:"s2e",children:"SF"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(we,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Delay type"}),e.jsxs(p.Select,{value:v,onChange:S,style:{width:"100%"},children:[e.jsx(Oe,{value:"lag",children:"Lag by"}),e.jsx(Oe,{value:"lead",children:"Lead by"})]})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(we,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Days"}),e.jsx(p.InputNumber,{min:0,value:D,onChange:R=>F(R||0),style:{width:"100%"},placeholder:"0"})]})]}),e.jsxs("div",{style:{marginBottom:14},children:[e.jsx(we,{style:{fontSize:"12px",display:"block",marginBottom:6,color:s.font?.color},children:"Duration (days)"}),e.jsx(p.InputNumber,{min:1,value:P,onChange:R=>H(R||1),style:{width:"100%"},placeholder:"Duration"})]}),e.jsx("div",{style:{backgroundColor:"#f5f5f5",padding:"10px 12px",borderRadius:"4px",marginBottom:14},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"},children:[e.jsx(we,{style:{fontSize:"11px",color:s.font?.color},children:"FS: Finish to Start"}),e.jsx(we,{style:{fontSize:"11px",color:s.font?.color},children:"SS: Start to Start"}),e.jsx(we,{style:{fontSize:"11px",color:s.font?.color},children:"FF: Finish to Finish"}),e.jsx(we,{style:{fontSize:"11px",color:s.font?.color},children:"SF: Start to Finish"})]})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[e.jsx(we,{strong:!0,style:{fontSize:"13px",color:s.font?.color},children:"Dependency preview"}),e.jsx("a",{onClick:()=>J(!se),style:{fontSize:"12px",color:"#1890ff",cursor:"pointer",textDecoration:"none"},children:se?"Hide preview":"Show preview"})]}),se&&e.jsxs(e.Fragment,{children:[xe(),e.jsx(nr,{style:{fontSize:"12px",color:s.font?.color||"#262626",marginBottom:14,lineHeight:"1.5"},children:Ee()})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[ee&&e.jsx(p.Button,{danger:!0,onClick:ie,style:{...s.buttonDanger},children:"Remove Dependency"}),e.jsx(p.Button,{type:"primary",onClick:L,disabled:!w,style:{...s.buttonPrimary,minWidth:100},children:ee?"Update":"Add"})]})]});return e.jsx(p.Popover,{content:Te,trigger:"click",open:b,onOpenChange:K,placement:"bottomLeft",overlayClassName:"dependency-popover",overlayInnerStyle:{padding:0},children:x})},gt=y.memo(y.forwardRef(({tasks:t,allTasks:a=[],columns:o,selectedTask:l,onTaskClick:r,onTaskContextMenu:g,onTaskUpdate:x,onTaskDragStart:i,onAddTask:s,onAddDependency:b,onRemoveDependency:c,links:w=[],dropIndicator:T,reorderTask:u,styleConfig:h},v)=>{const S=y.useRef(null);y.useImperativeHandle(v,()=>S.current);const[D,F]=y.useState(null),[P,H]=y.useState(0),se=(E,ee=0)=>{if(!E.parent)return ee;const X=t.find(L=>L.id===E.parent);return X?se(X,ee+1):ee},J=(E,ee)=>{if(ee===E.duration)return;const X=fe(new Date(E.start),ee,"day");x?.({...E,duration:ee,end:X})},me=(E,ee)=>{if(ee.template)return ee.template(E);switch(ee.name){case"text":{const X=se(E);return e.jsxs("div",{className:"gantt-grid-cell-text",style:{paddingLeft:X*14},children:[e.jsx("div",{className:"gantt-row-drag-handle",onMouseDown:L=>{L.preventDefault(),i?.(E.id,L.clientX,L.clientY,"reorder")},children:e.jsx(pe.FontAwesomeIcon,{icon:Q.faGripVertical})}),E.type==="project"?e.jsx("span",{className:"gantt-tree-icon",onClick:L=>{L.stopPropagation(),x?.({...E,open:!E.open})},children:e.jsx(pe.FontAwesomeIcon,{icon:E.open?Q.faChevronDown:Q.faChevronRight})}):e.jsx("span",{style:{width:16,display:"inline-block"}}),e.jsx("span",{className:"gantt-task-name-text",children:E.text})]})}case"start":return ye(E.start,"DD-MM-YYYY");case"end":return ye(E.end,"DD-MM-YYYY");case"duration":return D===E.id?e.jsx(p.InputNumber,{size:"small",min:1,value:P,onChange:L=>H(L||1),onBlur:()=>{J(E,P),F(null)},onPressEnter:()=>{J(E,P),F(null)},autoFocus:!0,style:{width:"100%",fontSize:"12px"}}):e.jsxs("div",{onClick:L=>{L.stopPropagation(),F(E.id),H(E.duration)},style:{backgroundColor:"#fff7e6",padding:"2px 8px",borderRadius:"4px",border:"1px solid #ffd591",fontWeight:400,color:"#d46b08",display:"inline-block",fontSize:"12px",cursor:"text"},children:[E.duration," day",E.duration!==1?"s":""]});case"predecessors":{const L=w.filter(U=>U.target===E.id)[0];return e.jsx(or,{task:E,allTasks:a,links:w,onAddDependency:(U,ie,K,xe)=>b?.(U,ie,K,xe),onRemoveDependency:U=>c?.(U),onTaskUpdate:x,styleConfig:h,children:e.jsx("div",{style:{cursor:"pointer",minHeight:"24px",width:"100%",display:"flex",alignItems:"center",gap:"4px"},children:L?(()=>{const U=a.find(K=>K.id===L.source),ie=U?a.indexOf(U)+1:0;return e.jsx("span",{style:{fontSize:"12px",backgroundColor:"#e6f4ff",border:"1px solid #91caff",color:"#1677ff",padding:"0 7px",borderRadius:"4px",whiteSpace:"nowrap"},children:tr(L,ie)})})():e.jsx("span",{style:{fontSize:"12px",color:"#1890ff",textDecoration:"none",fontWeight:500},onMouseEnter:U=>U.currentTarget.style.textDecoration="underline",onMouseLeave:U=>U.currentTarget.style.textDecoration="none",children:"Add"})})})}case"add":return e.jsx(p.Button,{type:"primary",size:"small",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faPlus,style:{fontSize:12}}),onClick:X=>{X.stopPropagation(),s?.(E.id)},title:"Add Subtask",style:{minWidth:"28px",width:"28px",height:"28px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px"}});case"progress":return e.jsxs("div",{className:"gantt-progress-cell",children:[e.jsx("div",{className:"gantt-progress-bar-bg",children:e.jsx("div",{className:"gantt-progress-bar-fill",style:{width:`${E.progress}%`}})}),e.jsxs("span",{className:"gantt-progress-text",children:[E.progress,"%"]})]});case"index":return e.jsx("span",{style:{color:"#8c8c8c"},children:a.indexOf(E)+1});default:return E[ee.name]||""}};return e.jsxs("div",{className:"gantt-grid",ref:S,children:[e.jsx("div",{className:"gantt-grid-header",style:{display:"flex",minWidth:"100%"},children:o.map(E=>e.jsx("div",{className:"gantt-grid-header-cell",style:{width:E.width,minWidth:E.width,justifyContent:E.align==="center"?"center":"flex-start"},children:E.name==="add"?e.jsx("span",{style:{fontSize:11,color:"#64748b",fontWeight:600,whiteSpace:"nowrap"},children:"Add"}):e.jsxs(e.Fragment,{children:[E.label,E.name==="start"&&e.jsx(pe.FontAwesomeIcon,{icon:Q.faChevronDown,style:{marginLeft:8,fontSize:10,color:"#64748b"}})]})},E.name))}),e.jsx("div",{className:"gantt-grid-body",children:t.map(E=>{const ee=u?.id===E.id,X=u?.descendantIds.includes(E.id);return e.jsxs("div",{className:`gantt-grid-row ${l===E.id?"selected":""} ${ee?"dragging-row":""} ${X?"descendant-dragging-row":""} ${T?.taskId===E.id?`drop-target-${T.position}`:""}`,onClick:()=>r(E.id),onContextMenu:L=>g?.(L,E.id),style:{display:"flex",minWidth:"100%"},children:[o.map(L=>{const U=L.name==="add";return e.jsx("div",{className:"gantt-grid-cell",style:{width:L.width,minWidth:L.width,textAlign:L.align||"left",display:"flex",alignItems:"center",justifyContent:U?"center":L.name==="text"?"flex-start":L.align==="center"?"center":L.align==="right"?"flex-end":"flex-start",visibility:"visible",opacity:1},children:me(E,L)},`${E.id}-${L.name}`)}),T?.taskId===E.id&&e.jsx("div",{className:`gantt-drop-indicator ${T.position}`})]},E.id)})})]})}));gt.displayName="Grid";const Nt=({task:t,position:a,selected:o,dragging:l,onClick:r,onDragStart:g,dragDeltaX:x=0,dragType:i=null,readonly:s=!1})=>{const b=(h,v)=>{s||(h.preventDefault(),h.stopPropagation(),g(h.clientX,h.clientY,v))},c=()=>{const h=["gantt-task-bar"];return t.type==="milestone"&&h.push("milestone"),t.type==="project"&&h.push("project"),o&&h.push("selected"),l&&h.push("dragging"),t.status&&h.push(`status-${t.status}`),h.join(" ")},w=()=>{let h=a.left,v=a.width;return l&&i&&(i==="move"?h+=x:i==="resize-left"?(h+=x,v-=x):i==="resize-right"&&(v+=x)),{left:`${h}px`,width:`${Math.max(v,0)}px`,backgroundColor:t.color||void 0}},T=(h=!1)=>e.jsxs(e.Fragment,{children:[!s&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-left",onMouseDown:v=>b(v,"resize-left")}),!h&&t.type!=="milestone"&&e.jsx("div",{className:"gantt-task-progress",style:{width:`${t.progress}%`},children:t.progress>5&&t.progress<100&&e.jsxs("span",{className:"gantt-task-progress-text",children:[t.progress,"%"]})}),e.jsx("div",{className:"gantt-task-content",children:!h&&e.jsx("span",{className:"gantt-task-text",children:t.text})}),!s&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-right",onMouseDown:v=>b(v,"resize-right")})]}),u=e.jsxs("div",{className:"gantt-tooltip",children:[e.jsx("div",{className:"gantt-tooltip-title",children:t.text}),e.jsxs("div",{className:"gantt-tooltip-dates",children:[ye(t.start,"MMM D")," - ",ye(t.end,"MMM D")]}),e.jsxs("div",{className:"gantt-tooltip-progress",children:["Progress: ",t.progress,"%"]}),t.owner&&e.jsxs("div",{className:"gantt-tooltip-owner",children:["Owner: ",t.owner]})]});if(t.segments&&t.segments.length>0||t.onHoldPeriods&&t.onHoldPeriods.length>0){const h=t.end.getTime()-t.start.getTime(),v=t.segments&&t.segments.length>0?t.segments:[{start:t.start,end:t.end,duration:t.duration||0}];return e.jsxs("div",{className:"gantt-task-group",children:[t.onHoldPeriods?.map((S,D)=>e.jsx("div",{className:"gantt-on-hold-period",style:{left:`${a.left+(S.start.getTime()-t.start.getTime())/h*a.width}px`,width:`${(S.end.getTime()-S.start.getTime())/h*a.width}px`}},`hold-${D}`)),v.map((S,D)=>e.jsx(p.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c()+" segment",style:{left:`${a.left+(S.start.getTime()-t.start.getTime())/h*a.width}px`,width:`${(S.end.getTime()-S.start.getTime())/h*a.width}px`,backgroundColor:t.color||void 0},onClick:r,onMouseDown:F=>b(F,"move"),children:T(D>0)})},`seg-${D}`))]})}return e.jsx(p.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c(),style:w(),onClick:r,onMouseDown:h=>b(h,"move"),children:T()})})},ar=({links:t,tasks:a,getTaskPosition:o})=>{const l=i=>a.find(s=>s.id===i),r=y.useMemo(()=>{let i=0,s=0;return a.forEach(b=>{try{const c=o(b);c&&typeof c.left=="number"&&typeof c.width=="number"&&(i=Math.max(i,c.left+c.width)),c&&typeof c.top=="number"&&typeof c.height=="number"&&(s=Math.max(s,c.top+c.height))}catch(c){console.warn("Failed to position task for link rendering:",b.id,c)}}),{width:Math.max(i,1e3),height:Math.max(s,100)}},[a,o]),g=i=>{const s=l(i.source),b=l(i.target);if(!s||!b)return"";const c=o(s),w=o(b),T=c.top+c.height/2,u=w.top+w.height/2;let h=0,v=0;switch(i.type){case"e2s":h=c.left+c.width,v=w.left;break;case"s2s":h=c.left,v=w.left;break;case"e2e":h=c.left+c.width,v=w.left+w.width;break;case"s2e":h=c.left,v=w.left+w.width;break}const S=v-h,D=u-T,F=20;if(i.type==="e2s")if(S>=F){const P=h+S/2;return`M ${h},${T} L ${P},${T} L ${P},${u} L ${v},${u}`}else{const P=F/2,H=T+D/2;return`M ${h},${T} L ${h+P},${T} L ${h+P},${H} L ${v-P},${H} L ${v-P},${u} L ${v},${u}`}else if(i.type==="s2s"){const P=Math.min(h,v)-F/2;return`M ${h},${T} L ${P},${T} L ${P},${u} L ${v},${u}`}else if(i.type==="e2e"){const P=Math.max(h,v)+F/2;return`M ${h},${T} L ${P},${T} L ${P},${u} L ${v},${u}`}else if(i.type==="s2e")if(S<=-F){const P=h+S/2;return`M ${h},${T} L ${P},${T} L ${P},${u} L ${v},${u}`}else{const P=F/2,H=T+D/2;return`M ${h},${T} L ${h-P},${T} L ${h-P},${H} L ${v+P},${H} L ${v+P},${u} L ${v},${u}`}return""},x=i=>{const s=l(i.target);if(!s)return"";const b=o(s),c=b.top+b.height/2,w=8,T=6;let u=0,h=!0;return i.type==="e2s"||i.type==="s2s"?(u=b.left,h=!0):(u=b.left+b.width,h=!1),h?`M ${u},${c} L ${u-w},${c-T/2} L ${u-w},${c+T/2} Z`:`M ${u},${c} L ${u+w},${c-T/2} L ${u+w},${c+T/2} Z`};return t.length===0?null:e.jsx("svg",{className:"gantt-links-layer",style:{overflow:"visible",width:r.width,height:r.height,position:"absolute",top:0,left:0,pointerEvents:"none"},children:t.map(i=>{const s=l(i.source),b=l(i.target);if(!s||!b)return null;const c=g(i),w=x(i);return!c||!w?null:e.jsxs("g",{className:"gantt-link",children:[e.jsx("path",{d:c,fill:"none",strokeWidth:"1.5",className:"gantt-link-line"}),e.jsx("path",{d:w,className:"gantt-link-arrow"})]},i.id)})})},sr=(t,a,o=60,l="day",r=1)=>{const[g,x]=y.useState({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0}),i=y.useCallback((c,w,T,u)=>{const h=t.find(v=>v.id===c);h&&x({taskId:c,initialX:w,initialY:T,initialStart:new Date(h.start),initialEnd:new Date(h.end),type:u,dragDeltaX:0,dragDeltaY:0})},[t]),s=y.useCallback((c,w)=>{if(!g.taskId||!g.type)return null;const T=c-g.initialX,u=w-g.initialY;if(x(P=>({...P,dragDeltaX:T,dragDeltaY:u})),g.type==="reorder")return null;const h=t.find(P=>P.id===g.taskId);if(!h)return null;const v=Math.round(T/o);let S=new Date(g.initialStart),D=new Date(g.initialEnd);switch(g.type){case"move":S=fe(g.initialStart,v*r,l),D=fe(g.initialEnd,v*r,l);break;case"resize-left":S=fe(g.initialStart,v*r,l),S>=D&&(S=fe(D,-r,l));break;case"resize-right":D=fe(g.initialEnd,v*r,l),D<=S&&(D=fe(S,r,l));break}const F=Ke(S,D);return{...h,start:S,end:D,duration:F}},[g,t,o,r,l]),b=y.useCallback(c=>{if(c&&a){const{id:w,...T}=c;a(w,T)}x({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0})},[a]);return{dragState:g,handleDragStart:i,handleDrag:s,handleDragEnd:b}},bt=y.forwardRef(({tasks:t,links:a,range:o,scales:l,config:r,selectedTask:g,onTaskClick:x,onTaskDragStart:i,onTaskDragEnd:s,onTaskUpdate:b,zoomLevel:c,baselines:w},T)=>{const[u,h]=y.useState(t),v=(r.columnWidth||60)*c,S=r.baselines&&w&&w.size>0,{dragState:D,handleDragStart:F,handleDrag:P,handleDragEnd:H}=sr(u,b,v,l[1].unit,l[1].step);y.useEffect(()=>{(t.length!==u.length||t.some((M,O)=>{const N=u[O];return!N||M.id!==N.id||M.start.getTime()!==N.start.getTime()||M.end.getTime()!==N.end.getTime()}))&&h(t)},[t]);const se=y.useCallback(m=>{const M=[];let O=new Date(o.start);for(;O<=o.end;)M.push({date:new Date(O),label:ye(O,m.format||"D")}),O=fe(O,m.step,m.unit);return M},[o.start,o.end]),J=y.useCallback(m=>{const M=l[1],O=o.start.getTime(),I=m.getTime()-O,oe={hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6}[M.unit]||864e5;return I/(oe*M.step)*v},[l,o.start,v]),me=m=>{const M=J(m.start),O=J(m.end);return{left:M,width:Math.max(O-M,0)}},E=m=>{const M=J(m.start),O=J(m.end);return{left:M,width:Math.max(O-M,0)}},ee=m=>{const M=me(m),O=u.findIndex(oe=>oe.id===m.id),N=r.rowHeight||48,I=32,le=(N-I)/2;return{left:M.left,width:M.width,top:O*N+le,height:I}},X=y.useRef(null),L=y.useCallback(m=>{D.taskId&&D.type&&(X.current&&cancelAnimationFrame(X.current),X.current=requestAnimationFrame(()=>{const M=P(m.clientX,m.clientY);M&&h(O=>O.map(N=>N.id===M.id?M:N))}))},[D,P]),U=y.useCallback(()=>{if(D.taskId){const m=u.find(M=>M.id===D.taskId);H(m||null),s()}},[D,u,H,s]),ie=l[1],K=y.useMemo(()=>se(ie),[se,ie]),xe=y.useCallback(()=>{const m=[];let M=-1,O=-1,N=0,I="";return K.forEach(le=>{const oe=le.date.getMonth(),Le=le.date.getFullYear(),de=ye(le.date,"MMM YYYY");oe!==M||Le!==O?(M!==-1&&m.push({label:I,width:N}),M=oe,O=Le,N=v,I=de):N+=v}),M!==-1&&m.push({label:I,width:N}),m},[K,v]),Ee=y.useCallback(()=>{const m=[];let M=-1,O=0,N=-1,I=-1,le="";return K.forEach(oe=>{const de=oe.date.getDate()<=15?0:1,De=oe.date.getMonth(),Ne=oe.date.getFullYear(),Fe=ye(oe.date,"MMM"),ve=new Date(Ne,De+1,0).getDate(),$e=de===0?`${Fe} 1 - 15`:`${Fe} 16 - ${ve}`;de!==M||De!==N||Ne!==I?(M!==-1&&m.push({label:le,width:O}),M=de,N=De,I=Ne,O=v,le=$e):O+=v}),M!==-1&&m.push({label:le,width:O}),m},[K,v]),Te=y.useMemo(()=>xe(),[xe]),R=y.useMemo(()=>Ee(),[Ee]),Y=y.useMemo(()=>K.length*v,[K.length,v]),he=y.useMemo(()=>{const m=new Date;return m.setHours(0,0,0,0),m},[]),re=y.useMemo(()=>{if(!r.showTodayLine)return null;const m=J(he);return m>=-v&&m<=Y+v?Math.max(0,Math.min(m,Y)):null},[r.showTodayLine,he,Y,v,J]),ne=y.useMemo(()=>{if(r.projectStartDate)return Be(r.projectStartDate);if(t.length>0){const m=t.map(M=>M.start.getTime());return Be(new Date(Math.min(...m)))}return null},[r.projectStartDate,t]),te=y.useMemo(()=>{if(!r.showProjectStartLine||!ne)return null;const m=J(ne);return m>=-v&&m<=Y+v?Math.max(0,Math.min(m,Y)):null},[r.showProjectStartLine,ne,Y,v,J]);return e.jsxs("div",{className:"gantt-timeline-container",ref:T,onMouseMove:L,onMouseUp:U,style:{width:Y,position:"relative"},children:[e.jsxs("div",{className:"gantt-timeline-header",style:{width:Y,minWidth:Y,position:"relative"},children:[re!==null&&r.showTodayLine&&r.todayLineLabel&&r.todayLineLabel!==""&&e.jsx("div",{className:"gantt-today-line-label",style:{position:"absolute",top:"calc(var(--gantt-scale-height, 24px) * 2)",left:`${re}px`,transform:"translateX(-50%)",backgroundColor:r.todayLineColor||"#ff4d4f",color:"#ffffff",padding:"4px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.2)",lineHeight:"1.2",zIndex:101,pointerEvents:"none",...r.todayLineLabelStyle},children:r.todayLineLabel}),te!==null&&r.showProjectStartLine&&r.projectStartLineLabel&&r.projectStartLineLabel!==""&&e.jsx("div",{className:"gantt-project-start-line-label",style:{position:"absolute",top:"calc(var(--gantt-scale-height, 24px) * 2)",left:`${te}px`,transform:"translateX(-50%)",backgroundColor:r.projectStartLineColor||"#40a9ff",color:"#ffffff",padding:"4px 10px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.2)",lineHeight:"1.2",zIndex:101,pointerEvents:"none",...r.projectStartLineLabelStyle},children:r.projectStartLineLabel}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-month",style:{width:Y},children:Te.map((m,M)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:m.width,minWidth:m.width,maxWidth:m.width,borderRight:M===Te.length-1?"none":"var(--wx-gantt-border)"},children:m.label},`top-${M}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-range",style:{width:Y},children:R.map((m,M)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:m.width,minWidth:m.width,maxWidth:m.width,borderRight:M===R.length-1?"none":"var(--wx-gantt-border)"},children:m.label},`mid-${M}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-day",style:{width:Y},children:K.map((m,M)=>{const O=r.weekends&&mt(m.date),N=r.holidays&&xt(m.date,r.holidays);return e.jsx("div",{className:`gantt-timeline-cell ${O?"weekend":""} ${N?"holiday":""}`,style:{width:v,minWidth:v,maxWidth:v,borderRight:M===K.length-1?"none":"var(--wx-gantt-border)"},children:m.label},`day-${M}`)})})]}),e.jsxs("div",{className:"gantt-timeline-body",style:{width:Y,position:"relative"},children:[re!==null&&e.jsxs(e.Fragment,{children:[r.showTodayLineMarker!==!1&&(()=>{const m=r.todayLineMarkerSize||8,M=r.todayLineColor||"#ff4d4f",O=r.todayLineMarkerStyle||"triangle",N=r.todayLineOpacity!==void 0?r.todayLineOpacity:1;return O==="triangle"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${re}px`,top:"-4px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${m}px solid transparent`,borderRight:`${m}px solid transparent`,borderBottom:`${m}px solid ${M}`,zIndex:7,pointerEvents:"none",opacity:N}}):O==="arrow"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${re}px`,top:"-6px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${m}px solid transparent`,borderRight:`${m}px solid transparent`,borderBottom:`${m*.7}px solid ${M}`,zIndex:7,pointerEvents:"none",opacity:N}}):O==="dot"?e.jsx("div",{className:"gantt-today-line-marker",style:{position:"absolute",left:`${re}px`,top:`-${m/2}px`,transform:"translateX(-50%)",width:`${m}px`,height:`${m}px`,borderRadius:"50%",backgroundColor:M,zIndex:7,pointerEvents:"none",opacity:N}}):null})(),e.jsx("div",{className:"gantt-today-line",style:{position:"absolute",left:`${re}px`,top:0,bottom:0,width:`${r.todayLineWidth||1}px`,backgroundColor:r.todayLineColor||"#ff4d4f",opacity:r.todayLineOpacity!==void 0?r.todayLineOpacity:1,borderLeft:r.todayLineStyle==="dashed"?`${r.todayLineWidth||1}px dashed ${r.todayLineColor||"#ff4d4f"}`:r.todayLineStyle==="dotted"?`${r.todayLineWidth||1}px dotted ${r.todayLineColor||"#ff4d4f"}`:"none",zIndex:6,pointerEvents:"none"}})]}),te!==null&&e.jsxs(e.Fragment,{children:[r.showProjectStartLineMarker!==!1&&(()=>{const m=r.projectStartLineMarkerSize||8,M=r.projectStartLineColor||"#40a9ff",O=r.projectStartLineMarkerStyle||"triangle",N=r.projectStartLineOpacity!==void 0?r.projectStartLineOpacity:1;return O==="triangle"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${te}px`,top:"-4px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${m}px solid transparent`,borderRight:`${m}px solid transparent`,borderBottom:`${m}px solid ${M}`,zIndex:7,pointerEvents:"none",opacity:N}}):O==="arrow"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${te}px`,top:"-6px",transform:"translateX(-50%)",width:0,height:0,borderLeft:`${m}px solid transparent`,borderRight:`${m}px solid transparent`,borderBottom:`${m*.7}px solid ${M}`,zIndex:7,pointerEvents:"none",opacity:N}}):O==="dot"?e.jsx("div",{className:"gantt-project-start-line-marker",style:{position:"absolute",left:`${te}px`,top:`-${m/2}px`,transform:"translateX(-50%)",width:`${m}px`,height:`${m}px`,borderRadius:"50%",backgroundColor:M,zIndex:7,pointerEvents:"none",opacity:N}}):null})(),e.jsx("div",{className:"gantt-project-start-line",style:{position:"absolute",left:`${te}px`,top:0,bottom:0,width:`${r.projectStartLineWidth||1}px`,backgroundColor:r.projectStartLineColor||"#40a9ff",opacity:r.projectStartLineOpacity!==void 0?r.projectStartLineOpacity:1,borderLeft:r.projectStartLineStyle==="dashed"?`${r.projectStartLineWidth||1}px dashed ${r.projectStartLineColor||"#40a9ff"}`:r.projectStartLineStyle==="dotted"?`${r.projectStartLineWidth||1}px dotted ${r.projectStartLineColor||"#40a9ff"}`:"none",zIndex:6,pointerEvents:"none"}})]}),e.jsx("div",{className:"gantt-timeline-grid",children:K.map((m,M)=>{const O=r.weekends&&mt(m.date),N=r.holidays&&xt(m.date,r.holidays);return e.jsx("div",{className:`gantt-timeline-grid-column ${O?"weekend":""} ${N?"holiday":""}`,style:{width:v,minWidth:v}},M)})}),a.length>0&&e.jsx(ar,{links:a,tasks:u,getTaskPosition:ee}),e.jsx("div",{className:"gantt-timeline-tasks",style:{width:Y},children:u.map(m=>{const M=me(m),O=S?w?.get(m.id):void 0,N=O?E(O):void 0;return e.jsxs("div",{className:"gantt-timeline-row",children:[O&&N&&e.jsx("div",{className:`gantt-baseline-bar ${m.type==="milestone"?"milestone":""}`,style:{left:`${N.left}px`,width:`${N.width}px`},title:`Baseline: ${O.start.toLocaleDateString()} - ${O.end.toLocaleDateString()}`}),e.jsx(Nt,{task:m,position:M,selected:g===m.id,dragging:D.taskId===m.id,dragDeltaX:D.dragDeltaX,dragType:D.type,onClick:()=>x(m.id),onDragStart:(I,le,oe)=>{F(m.id,I,le,oe),i(m.id,I,le)},readonly:r.readonly})]},m.id)})})]})]})});bt.displayName="Timeline";const wt=y.forwardRef((t,a)=>e.jsx("div",{className:"gantt-chart-wrapper",style:{flex:1,minWidth:0},children:e.jsx(bt,{...t,ref:a})}));wt.displayName="Chart";const{Search:ir}=p.Input,At=({onFilterChange:t,owners:a=[],uiConfig:o={}})=>{const[l,r]=y.useState({searchText:"",status:"all",priority:"all",owner:""}),g=s=>{const b={...l,...s};r(b),t(b)},x=()=>{const s={searchText:"",status:"all",priority:"all",owner:""};r(s),t(s)},i=l.searchText!==""||l.status!=="all"||l.priority!=="all"||l.owner!=="";return e.jsx("div",{className:"gantt-filter-container",children:e.jsxs("div",{className:"gantt-filter-bar",children:[e.jsx("div",{className:"gantt-filter-left",children:e.jsx(ir,{placeholder:o.searchPlaceholder||"Search stages...",value:l.searchText,onChange:s=>g({searchText:s.target.value}),allowClear:!0,className:"gantt-search-antd",style:{width:250}})}),e.jsxs("div",{className:"gantt-filter-right",children:[e.jsx(p.Select,{value:l.status,onChange:s=>g({status:s}),className:"gantt-filter-select-antd",style:{width:140},options:[{value:"all",label:o.statusOptions?.all||"All Status"},{value:"not-started",label:o.statusOptions?.notStarted||"Not Started"},{value:"in-progress",label:o.statusOptions?.inProgress||"In Progress"},{value:"completed",label:o.statusOptions?.completed||"Completed"}]}),e.jsx(p.Select,{value:l.priority,onChange:s=>g({priority:s}),className:"gantt-filter-select-antd",style:{width:130},options:[{value:"all",label:o.priorityFilterOptions?.all||"All Priority"},{value:"low",label:o.priorityFilterOptions?.low||"Low"},{value:"medium",label:o.priorityFilterOptions?.medium||"Medium"},{value:"high",label:o.priorityFilterOptions?.high||"High"}]}),e.jsx(p.Select,{value:l.owner||void 0,onChange:s=>g({owner:s||""}),className:"gantt-filter-select-antd",style:{width:130},placeholder:o.allOwnersText||"All Owners",allowClear:!0,options:[{value:"",label:o.allOwnersText||"All Owners"},...(a||[]).map(s=>({value:s,label:s}))]}),i&&e.jsx(p.Button,{type:"default",danger:!0,icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faTimesCircle}),onClick:x,className:"gantt-filter-clear-antd",children:o.clearFiltersText||"Clear"})]})]})})},Ce=(t,a)=>t?typeof t=="string"?e.jsx(pe.FontAwesomeIcon,{icon:a}):t:e.jsx(pe.FontAwesomeIcon,{icon:a}),Bt=({zoomLevel:t,setZoomLevel:a,onExport:o,onFilterChange:l,owners:r,onAddTask:g,uiConfig:x,iconConfig:i={},styleConfig:s})=>{const b=We(s),c=x.showZoomButtons!==!1,w=x.showExportButtons!==!1,T=c&&w;return e.jsxs("div",{className:"gantt-toolbar-wrapper",children:[e.jsxs("div",{className:"gantt-toolbar",children:[e.jsx("div",{className:"gantt-toolbar-left",children:e.jsx(p.Space,{size:8,children:x.showAddTaskButton!==!1&&e.jsx(p.Button,{type:"primary",icon:Ce(i.addTask,Q.faPlus),onClick:()=>g?.(),style:b.buttonPrimary,children:x.addTaskButtonText||"New Stage"})})}),e.jsx("div",{className:"gantt-toolbar-right",children:e.jsxs(p.Space,{size:4,children:[c&&e.jsxs(e.Fragment,{children:[e.jsx(p.Tooltip,{title:x.zoomOutTooltip||"Zoom Out",children:e.jsx(p.Button,{icon:Ce(i.zoomOut,Q.faSearchMinus),onClick:()=>a(Math.max(.5,t-.25)),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.zoomInTooltip||"Zoom In",children:e.jsx(p.Button,{icon:Ce(i.zoomIn,Q.faSearchPlus),onClick:()=>a(Math.min(2,t+.25)),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.resetZoomTooltip||"Reset Zoom",children:e.jsx(p.Button,{icon:Ce(i.resetZoom,Q.faRotateLeft),onClick:()=>a(1),style:b.buttonSecondary})})]}),T&&e.jsx(p.Divider,{type:"vertical",style:{height:24,margin:"0 4px"}}),w&&e.jsxs(e.Fragment,{children:[e.jsx(p.Tooltip,{title:x.exportCSVTooltip||"Export to CSV",children:e.jsx(p.Button,{icon:Ce(i.exportCSV,Q.faFileCsv),onClick:()=>o("csv"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.exportExcelTooltip||"Export to Excel",children:e.jsx(p.Button,{icon:Ce(i.exportExcel,Q.faFileExcel),onClick:()=>o("excel"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.exportJSONTooltip||"Export to JSON",children:e.jsx(p.Button,{icon:Ce(i.exportJSON,Q.faFileCode),onClick:()=>o("json"),style:b.buttonSecondary})}),e.jsx(p.Tooltip,{title:x.exportPDFTooltip||"Export to PDF",children:e.jsx(p.Button,{icon:Ce(i.exportPDF,Q.faFilePdf),onClick:()=>o("pdf"),style:b.buttonSecondary})})]})]})})]}),x.showFilterSearch!==!1&&e.jsx(At,{onFilterChange:l,owners:r,uiConfig:x})]})},{Option:He}=p.Select,{TextArea:lr}=p.Input,It=({onCreateTask:t,onClose:a,uiConfig:o={},parentId:l,parentTaskName:r,styleConfig:g})=>{const[x]=p.Form.useForm(),i=We(g),s=b=>{const c=b.start.toDate(),w=new Date(c);w.setDate(w.getDate()+(b.duration||1)),t({text:b.text,start:c,end:w,duration:b.duration||1,progress:b.progress||0,type:b.type,color:typeof b.color=="string"?b.color:b.color?.toHexString?.()||"#4A90E2",owner:b.owner||"",priority:b.priority||"medium",details:b.details||"",parent:l},l),a()};return e.jsx(p.Modal,{title:l?(o.taskCreatorTitle||"Create Checklist")+(r?` for "${r}"`:""):o.taskCreatorTitle||"Create New Stage",open:!0,onCancel:a,onOk:()=>x.submit(),okText:o.taskCreatorOkText||"Create Stage",cancelText:o.taskCreatorCancelText||"Cancel",width:600,className:"gantt-modal-antd",styles:{content:i.modal,header:{borderBottom:`1px solid ${i.modal?.borderColor||"#f0f0f0"}`,marginBottom:16}},okButtonProps:{style:i.buttonPrimary},cancelButtonProps:{style:i.buttonSecondary},children:e.jsxs(p.Form,{form:x,layout:"vertical",onFinish:s,initialValues:{type:"task",priority:"medium",start:Ft(),duration:1,progress:0,color:"#4A90E2"},children:[e.jsx(p.Form.Item,{name:"text",label:o.taskNameLabel||"Stage Name",rules:[{required:!0,message:o.taskNameRequired||"Please enter stage name"}],children:e.jsx(p.Input,{placeholder:o.taskNamePlaceholder||"Enter stage name",autoFocus:!0,style:i.input})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"type",label:o.typeLabel||"Type",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(He,{value:"task",children:o.taskTypeOptions?.task||"Stage"}),e.jsx(He,{value:"milestone",children:o.taskTypeOptions?.milestone||"Milestone"}),e.jsx(He,{value:"project",children:o.taskTypeOptions?.project||"Project"})]})}),e.jsx(p.Form.Item,{name:"priority",label:o.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(He,{value:"low",children:o.priorityOptions?.low||"Low"}),e.jsx(He,{value:"medium",children:o.priorityOptions?.medium||"Medium"}),e.jsx(He,{value:"high",children:o.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"start",label:o.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(p.DatePicker,{style:{width:"100%",...i.input}})}),e.jsx(p.Form.Item,{name:"duration",label:o.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,style:{width:"100%",...i.input}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"color",label:o.colorLabel||"Color",style:{flex:1},children:e.jsx(p.ColorPicker,{showText:!0})}),e.jsx(p.Form.Item,{name:"progress",label:o.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,max:100,style:{width:"100%",...i.input}})})]}),e.jsx(p.Form.Item,{name:"owner",label:o.ownerLabel||"Owner",children:e.jsx(p.Input,{placeholder:o.ownerPlaceholder||"Assign to...",style:i.input})}),e.jsx(p.Form.Item,{name:"details",label:o.detailsLabel||"Details",children:e.jsx(lr,{placeholder:o.detailsPlaceholder||"Add stage description...",rows:3,style:i.input})})]})})},{Option:Ue}=p.Select,{TextArea:dr}=p.Input,{confirm:cr}=p.Modal,_t=({task:t,onUpdate:a,onDelete:o,onClose:l,uiConfig:r={},styleConfig:g})=>{const[x]=p.Form.useForm(),i=We(g),s=c=>{const w=c.start.toDate(),T=new Date(w);T.setDate(T.getDate()+(c.duration||1)),a({...t,text:c.text,start:w,end:T,duration:c.duration||1,progress:c.progress||0,type:c.type,color:typeof c.color=="string"?c.color:c.color?.toHexString?.()||"#4A90E2",owner:c.owner||"",priority:c.priority||"medium",details:c.details||""}),l()},b=()=>{cr({title:r.deleteConfirmTitle?`${r.deleteConfirmTitle}: "${t.text}"?`:`Are you sure you want to delete "${t.text}"?`,icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faExclamationTriangle,style:{color:"#faad14",marginRight:8}}),content:r.deleteConfirmContent||"This action cannot be undone.",okText:r.deleteConfirmOkText||"Yes, Delete",okType:"danger",cancelText:r.deleteConfirmCancelText||"No",onOk(){o(t.id),l()}})};return e.jsx(p.Modal,{title:r.taskEditorTitle||"Edit Stage",open:!0,onCancel:l,footer:[e.jsx(p.Button,{danger:!0,onClick:b,style:{float:"left",...i.buttonDanger},children:r.taskEditorDeleteText||"Delete"},"delete"),e.jsx(p.Button,{onClick:l,style:i.buttonSecondary,children:r.taskEditorCancelText||"Cancel"},"cancel"),e.jsx(p.Button,{type:"primary",onClick:()=>x.submit(),style:i.buttonPrimary,children:r.taskEditorSaveText||"Save Changes"},"submit")],width:600,className:"gantt-modal-antd",styles:{content:i.modal,header:{borderBottom:`1px solid ${i.modal?.borderColor||"#f0f0f0"}`,marginBottom:16}},children:e.jsxs(p.Form,{form:x,layout:"vertical",onFinish:s,initialValues:{text:t.text,type:t.type||"task",priority:t.priority||"medium",start:Ft(t.start),duration:t.duration,progress:t.progress,color:t.color||"#4A90E2",owner:t.owner||"",details:t.details||""},children:[e.jsx(p.Form.Item,{name:"text",label:r.taskNameLabel||"Stage Name",rules:[{required:!0,message:r.taskNameRequired||"Please enter stage name"}],children:e.jsx(p.Input,{placeholder:r.taskNamePlaceholder||"Enter stage name",style:i.input})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"type",label:r.typeLabel||"Type",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ue,{value:"task",children:r.taskTypeOptions?.task||"Stage"}),e.jsx(Ue,{value:"milestone",children:r.taskTypeOptions?.milestone||"Milestone"}),e.jsx(Ue,{value:"project",children:r.taskTypeOptions?.project||"Project"})]})}),e.jsx(p.Form.Item,{name:"priority",label:r.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(p.Select,{style:i.input,children:[e.jsx(Ue,{value:"low",children:r.priorityOptions?.low||"Low"}),e.jsx(Ue,{value:"medium",children:r.priorityOptions?.medium||"Medium"}),e.jsx(Ue,{value:"high",children:r.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"start",label:r.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(p.DatePicker,{style:{width:"100%",...i.input}})}),e.jsx(p.Form.Item,{name:"duration",label:r.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,style:{width:"100%",...i.input}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(p.Form.Item,{name:"color",label:r.colorLabel||"Color",style:{flex:1},children:e.jsx(p.ColorPicker,{showText:!0})}),e.jsx(p.Form.Item,{name:"progress",label:r.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(p.InputNumber,{min:0,max:100,style:{width:"100%",...i.input}})})]}),e.jsx(p.Form.Item,{name:"owner",label:r.ownerLabel||"Owner",children:e.jsx(p.Input,{placeholder:r.ownerPlaceholder||"Assign to...",style:i.input})}),e.jsx(p.Form.Item,{name:"details",label:r.detailsLabel||"Details",children:e.jsx(dr,{placeholder:r.detailsPlaceholder||"Add stage description...",rows:3,style:i.input})})]})})},{Title:Qe,Text:Ie,Paragraph:ur}=p.Typography,{Option:Me}=p.Select,Rt=({task:t,allTasks:a,links:o,onAddDependency:l,onRemoveDependency:r,onTaskUpdate:g,onClose:x,styleConfig:i})=>{const s=We(i),[b,c]=y.useState(""),[w,T]=y.useState("e2s"),[u,h]=y.useState(0),[v,S]=y.useState("day"),[D,F]=y.useState(t.duration),[P,H]=y.useState(""),se=o.filter(L=>L.target===t.id),J=a.filter(L=>L.id!==t.id&&L.id!==t.parent),me=()=>{if(b){const L=yt(u,v);if(D!==t.duration&&g){const U=fe(new Date(t.start),D,"day");g({...t,duration:D,end:U})}l(b,t.id,w,L),c(""),h(0),S("day")}},E=()=>{if(!P.trim())return;const L=er(P.trim());if(!L){alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
15
+ Example: 3FS+10d`);return}const U=L.taskNumber-1,ie=a[U];if(!ie){alert(`Task ${L.taskNumber} not found`);return}const K=rr(L.type),xe=yt(L.lag,L.lagUnit);l(ie.id,t.id,K,xe),H("")},ee=L=>{switch(L){case"e2s":return"Finish-to-Start (FS)";case"s2s":return"Start-to-Start (SS)";case"e2e":return"Finish-to-Finish (FF)";case"s2e":return"Start-to-Finish (SF)"}},X=L=>{switch(L){case"e2s":return"blue";case"s2s":return"green";case"e2e":return"purple";case"s2e":return"orange"}};return e.jsx(p.Modal,{title:e.jsx(Qe,{level:4,style:{margin:0,color:s.font?.color},children:"Dependency Editor"}),open:!0,onCancel:x,footer:null,width:700,styles:{content:s.modal,header:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`}},children:e.jsxs("div",{style:{padding:"8px 0"},children:[e.jsx(p.Alert,{message:"Managing dependencies helps in auto-scheduling and critical path calculation.",type:"info",showIcon:!0,style:{marginBottom:20,...s.font}}),e.jsxs("div",{style:{display:"flex",gap:20,marginBottom:24},children:[e.jsx(p.Card,{title:e.jsx(Qe,{level:5,style:{margin:0,fontSize:14,color:s.font?.color},children:"Settings"}),size:"small",style:{flex:1,...s.modal},headStyle:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`},children:e.jsxs(p.Space,{direction:"vertical",style:{width:"100%"},size:"middle",children:[e.jsxs("div",{children:[e.jsx(Ie,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Predecessor"}),e.jsx(p.Select,{showSearch:!0,placeholder:"Select a task",optionFilterProp:"children",style:{width:"100%",...s.input},value:b,onChange:c,children:J.map(L=>e.jsxs(Me,{value:L.id,children:["[",a.indexOf(L)+1,"] ",L.text]},L.id))})]}),e.jsxs("div",{children:[e.jsx(Ie,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Type"}),e.jsxs(p.Select,{style:{width:"100%",...s.input},value:w,onChange:T,children:[e.jsx(Me,{value:"e2s",children:"Finish-to-Start (FS)"}),e.jsx(Me,{value:"s2s",children:"Start-to-Start (SS)"}),e.jsx(Me,{value:"e2e",children:"Finish-to-Finish (FF)"}),e.jsx(Me,{value:"s2e",children:"Start-to-Finish (SF)"})]})]}),e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(Ie,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Lag/Lead"}),e.jsx(p.InputNumber,{style:{width:"100%",...s.input},value:u,onChange:L=>h(L||0)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(Ie,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Units"}),e.jsxs(p.Select,{style:{width:"100%",...s.input},value:v,onChange:S,children:[e.jsx(Me,{value:"day",children:"Days"}),e.jsx(Me,{value:"hour",children:"Hours"}),e.jsx(Me,{value:"week",children:"Weeks"}),e.jsx(Me,{value:"month",children:"Months"})]})]})]}),e.jsxs("div",{children:[e.jsx(Ie,{style:{display:"block",marginBottom:8,fontSize:13,color:s.font?.color},children:"Duration (days)"}),e.jsx(p.InputNumber,{style:{width:"100%",...s.input},min:1,value:D,onChange:L=>F(L||1)})]}),e.jsx(p.Button,{type:"primary",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faPlus,style:{marginRight:8}}),block:!0,onClick:me,disabled:!b,style:{height:40,marginTop:8,...s.buttonPrimary},children:"Add Dependency"})]})}),e.jsxs(p.Card,{title:e.jsx(Qe,{level:5,style:{margin:0,fontSize:14,color:s.font?.color},children:"Quick Add"}),size:"small",style:{width:250,...s.modal},headStyle:{borderBottom:`1px solid ${s.modal?.borderColor||"#f0f0f0"}`},children:[e.jsxs(ur,{type:"secondary",style:{fontSize:12,marginBottom:16,color:s.font?.color,opacity:.7},children:["Format: [TaskNumber][Type][+/-][Lag][Unit]",e.jsx("br",{}),"Example: 3FS+10d"]}),e.jsx(p.Input,{placeholder:"e.g. 5FS+2d",value:P,onChange:L=>H(L.target.value),onPressEnter:E,style:{marginBottom:16,height:40,...s.input}}),e.jsx(p.Button,{block:!0,onClick:E,style:{height:40,...s.buttonSecondary},children:"Apply"})]})]}),e.jsx(p.Divider,{style:{margin:"0 0 24px 0",borderColor:s.modal?.borderColor}}),e.jsxs("div",{style:{maxHeight:300,overflowY:"auto"},children:[e.jsx(Qe,{level:5,style:{fontSize:14,marginBottom:16,color:s.font?.color},children:"Current Dependencies"}),e.jsx(p.List,{dataSource:se,locale:{emptyText:e.jsx(Ie,{type:"secondary",style:{color:s.font?.color,opacity:.5},children:"No dependencies added yet."})},renderItem:L=>{const U=a.find(ie=>ie.id===L.source);return e.jsx(p.List.Item,{style:{padding:"12px 16px",background:"#fafafa",borderRadius:8,marginBottom:12,border:`1px solid ${s.listItem?.borderColor||"#f0f0f0"}`},actions:[e.jsx(p.Button,{type:"text",danger:!0,icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faTrash}),onClick:()=>r(L.id)},"delete")],children:e.jsx(p.List.Item.Meta,{avatar:e.jsx("div",{style:{width:32,height:32,borderRadius:16,background:"#1890ff",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:12,fontWeight:"bold"},children:U?a.indexOf(U)+1:"?"}),title:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontWeight:600,color:s.font?.color},children:U?.text||"Unknown Task"}),e.jsx(p.Tag,{color:X(L.type),style:{margin:0},children:ee(L.type)})]}),description:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:16,marginTop:4},children:e.jsxs("span",{style:{fontSize:12,color:s.font?.color,opacity:.7},children:[e.jsx(pe.FontAwesomeIcon,{icon:Q.faLink,style:{marginRight:6}}),"Lag: ",L.lag||0," days"]})})})})}})]}),e.jsxs("div",{style:{marginTop:24,padding:"16px",background:"#fff7e6",borderRadius:8,border:"1px solid #ffe7ba"},children:[e.jsxs(Qe,{level:5,style:{fontSize:13,marginBottom:8,display:"flex",alignItems:"center"},children:[e.jsx(pe.FontAwesomeIcon,{icon:Q.faInfoCircle,style:{marginRight:8,color:"#fa8c16"}}),"Coming soon"]}),e.jsx(Ie,{style:{fontSize:12,color:"rgba(0,0,0,0.65)"},children:"Dependency visualization on the chart and automatic lag calculations based on working hours."})]})]})})},pr=({x:t,y:a,task:o,onEdit:l,onDelete:r,onCopy:g,onDependencies:x,onConvertToMilestone:i,onConvertToTask:s,onConvertToProject:b,onAutoSchedule:c,onClose:w,styleConfig:T})=>{const u=We(T);if(!o)return null;const h=[{key:"edit",label:"Edit",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faEdit}),onClick:()=>{l(),w()}},{key:"copy",label:"Copy",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faCopy}),onClick:()=>{g(),w()}},{key:"dependencies",label:"Dependencies",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faLink}),onClick:()=>{x(),w()}},{type:"divider"},{key:"convert",label:"Convert to",type:"submenu",children:[{key:"milestone",label:"Milestone",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faFlag}),disabled:o.type==="milestone",onClick:()=>{i(),w()}},{key:"task",label:"Task",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faTasks}),disabled:o.type==="task",onClick:()=>{s(),w()}},{key:"project",label:"Project",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faFolder}),disabled:o.type==="project",onClick:()=>{b(),w()}}]},{key:"auto-schedule",label:"Auto Schedule",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faRotateLeft}),onClick:()=>{c?.(),w()}},{type:"divider"},{key:"delete",label:"Delete",icon:e.jsx(pe.FontAwesomeIcon,{icon:Q.faTrash}),danger:!0,onClick:()=>{r(),w()}}];return e.jsx("div",{className:"gantt-context-menu",style:{position:"fixed",left:`${t}px`,top:`${a}px`,zIndex:1e4},onClick:v=>v.stopPropagation(),children:e.jsx(p.Menu,{items:h,style:{boxShadow:u.popover?.boxShadow||"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:u.popover?.borderRadius||"6px",border:`1px solid ${u.popover?.borderColor||"#e0e0e0"}`,backgroundColor:u.popover?.backgroundColor,color:u.font?.color,fontFamily:u.font?.fontFamily}})})},Yt=(t,a=[])=>{const[o,l]=y.useState([]),[r,g]=y.useState(-1),[x,i]=y.useState(t),[s,b]=y.useState(a);y.useEffect(()=>{i(t)},[t]),y.useEffect(()=>{b(a)},[a]);const c=y.useCallback((F,P,H)=>{const se={type:F,before:P,after:H,timestamp:Date.now()},J=o.slice(0,r+1);J.push(se),J.length>50?J.shift():g(r+1),l(J)},[o,r]),w=y.useCallback(()=>{if(r<0)return;const F=o[r];i(F.before.tasks),b(F.before.links),g(r-1)},[o,r]),T=y.useCallback(()=>{if(r>=o.length-1)return;const F=o[r+1];i(F.after.tasks),b(F.after.links),g(r+1)},[o,r]),u=r>=0,h=r<o.length-1,v=y.useCallback(F=>{const P={tasks:x,links:s},H=x.map(J=>J.id===F.id?F:J);c("task_update",P,{tasks:H,links:s}),i(H)},[x,s,c]),S=y.useCallback(F=>{const P={tasks:x,links:s},H=[...x,F];c("task_create",P,{tasks:H,links:s}),i(H)},[x,s,c]),D=y.useCallback(F=>{const P={tasks:x,links:s},H=x.filter(me=>me.id!==F),se=s.filter(me=>me.source!==F&&me.target!==F);c("task_delete",P,{tasks:H,links:se}),i(H),b(se)},[x,s,c]);return{tasks:x,links:s,setTasks:i,setLinks:b,undo:w,redo:T,canUndo:u,canRedo:h,updateTask:v,createTask:S,deleteTask:D,saveState:c,history:o}},zt=(t,a,o={mode:"forward"})=>{const l=new Map,r=new Map;return t.forEach(g=>{l.set(g.id,[]),r.set(g.id,[])}),a.forEach(g=>{g.type==="e2s"&&(l.get(g.target)?.push(g.source),r.get(g.source)?.push(g.target))}),o.mode==="forward"?hr(t,l,o):fr(t,r,o)},hr=(t,a,o)=>{const l=new Map,r=new Set,g=o.projectStart||new Date,x=i=>{if(r.has(i))return;const s=t.find(h=>h.id===i);if(!s)return;const b=a.get(i)||[];b.forEach(h=>x(h));let c=g;b.forEach(h=>{const v=l.get(h);v&&v.end>c&&(c=new Date(v.end))});const w=new Date(c),T=fe(w,s.duration,"day"),u={...s,start:w,end:T};l.set(i,u),r.add(i)};return t.forEach(i=>x(i.id)),t.map(i=>l.get(i.id)||i)},fr=(t,a,o)=>{const l=new Map,r=new Set,g=o.projectEnd||new Date(Math.max(...t.map(i=>i.end.getTime()))),x=i=>{if(r.has(i))return;const s=t.find(h=>h.id===i);if(!s)return;const b=a.get(i)||[];b.forEach(h=>x(h));let c=g;b.forEach(h=>{const v=l.get(h);v&&v.start<c&&(c=new Date(v.start))});const w=new Date(c),T=fe(w,-s.duration,"day"),u={...s,start:T,end:w};l.set(i,u),r.add(i)};return t.forEach(i=>x(i.id)),t.map(i=>l.get(i.id)||i)},mr=Object.freeze(Object.defineProperty({__proto__:null,autoSchedule:zt,levelResources:t=>{const a=new Map;t.forEach(l=>{l.owner&&(a.has(l.owner)||a.set(l.owner,[]),a.get(l.owner).push(l))});const o=[...t];return a.forEach(l=>{const r=l.sort((g,x)=>g.start.getTime()-x.start.getTime());for(let g=1;g<r.length;g++){const x=r[g],i=r[g-1];if(x.start<i.end){const s=o.findIndex(b=>b.id===x.id);if(s>=0){const b=new Date(i.end),c=fe(b,x.duration,"day");o[s]={...x,start:b,end:c}}}}}),o}},Symbol.toStringTag,{value:"Module"})),Wt=t=>{const a=new Map;return t.forEach(o=>{a.set(o.id,{taskId:o.id,start:new Date(o.start),end:new Date(o.end)})}),a},Ht=t=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority"],o=t.map(r=>[r.id,r.text,ye(r.start,"YYYY-MM-DD"),ye(r.end,"YYYY-MM-DD"),r.duration.toString(),`${r.progress}%`,r.type||"task",r.owner||"",r.priority||"medium"]),l=[a.join(","),...o.map(r=>r.map(g=>`"${g}"`).join(","))].join(`
16
+ `);st(l,"gantt-tasks.csv","text/csv")},Ut=t=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority","Details"],o=t.map(r=>[r.id,r.text,ye(r.start,"MM/DD/YYYY"),ye(r.end,"MM/DD/YYYY"),r.duration.toString(),r.progress.toString(),r.type||"task",r.owner||"",r.priority||"medium",r.details||""]),l="\uFEFF"+[a.join(" "),...o.map(r=>r.map(g=>g.replace(/\t/g," ")).join(" "))].join(`
17
+ `);st(l,"gantt-tasks.xls","application/vnd.ms-excel")},Vt=(t,a)=>{const o={tasks:t,links:a,exported:new Date().toISOString(),version:"1.0"},l=JSON.stringify(o,null,2);st(l,"gantt-project.json","application/json")},Xt=t=>{const a=`
18
18
  GANTT CHART PROJECT
19
19
  Generated: ${new Date().toLocaleString()}
20
20
 
21
21
  Tasks:
22
22
  ${t.map((o,l)=>`
23
23
  ${l+1}. ${o.text}
24
- Start: ${xe(o.start,"MM/DD/YYYY")}
25
- End: ${xe(o.end,"MM/DD/YYYY")}
24
+ Start: ${ye(o.start,"MM/DD/YYYY")}
25
+ End: ${ye(o.end,"MM/DD/YYYY")}
26
26
  Duration: ${o.duration} days
27
27
  Progress: ${o.progress}%
28
28
  ${o.owner?`Owner: ${o.owner}`:""}
29
29
  `).join(`
30
30
  `)}
31
- `.trim();st(a,"gantt-report.txt","text/plain"),alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.")},xr=(t,a,o="png")=>{if(!document.getElementById(t)){alert("Could not find Gantt chart element to export");return}if(o==="svg"){alert("SVG export requires additional library. Use PNG or implement with dom-to-svg.");return}alert("Image export requires html2canvas library. Install with: npm install html2canvas")},st=(t,a,o)=>{const l=new Blob([t],{type:o}),r=URL.createObjectURL(l);yr(r,a),URL.revokeObjectURL(r)},yr=(t,a)=>{const o=document.createElement("a");o.href=t,o.download=a,document.body.appendChild(o),o.click(),document.body.removeChild(o)},gr=Object.freeze(Object.defineProperty({__proto__:null,exportToCSV:Wt,exportToExcel:Ht,exportToImage:xr,exportToJSON:Ut,exportToPDF:Vt,importFromJSON:t=>new Promise((a,o)=>{const l=new FileReader;l.onload=r=>{try{const y=r.target?.result,m=JSON.parse(y),i=m.tasks.map(s=>({...s,start:new Date(s.start),end:new Date(s.end)}));a({tasks:i,links:m.links||[]})}catch{o(new Error("Invalid JSON file"))}},l.onerror=()=>o(new Error("Failed to read file")),l.readAsText(t)})},Symbol.toStringTag,{value:"Module"})),qt=(t,a)=>t.filter(o=>{if(a.searchText){const l=a.searchText.toLowerCase(),r=o.text.toLowerCase().includes(l),y=o.owner?.toLowerCase().includes(l),m=o.details?.toLowerCase().includes(l);if(!r&&!y&&!m)return!1}if(a.status!=="all"&&(o.progress===0?"not-started":o.progress===100?"completed":"in-progress")!==a.status||a.priority!=="all"&&o.priority!==a.priority||a.owner&&o.owner!==a.owner)return!1;if(a.dateRange){const l=o.start.getTime(),r=a.dateRange.start.getTime(),y=a.dateRange.end.getTime();if(l<r||l>y)return!1}return!0}),br=t=>[{name:"index",label:"",width:40,align:"center"},{name:"text",label:t?.columnLabels?.name||"Name",width:250,align:"left",resize:!0},{name:"predecessors",label:t?.columnLabels?.dependsOn||"Depends on",width:120,align:"left"},{name:"duration",label:t?.columnLabels?.duration||"Duration",width:110,align:"left"},{name:"start",label:t?.columnLabels?.start||"Start",width:130,align:"left"},{name:"add",label:"",width:50,align:"center"}],wr=[{unit:"month",step:1,format:"MMM"},{unit:"day",step:1,format:"D"}],vr={headerTitle:"Iris Gantt",showHeader:!0,showAddTaskButton:!0,showBaselineButton:!1,showZoomButtons:!0,showExportButtons:!0,showFilterSearch:!0,addTaskButtonText:"New Task",baselineButtonText:"Set Baseline",baselineButtonTextActive:"Baselines",zoomOutTooltip:"Zoom Out",zoomInTooltip:"Zoom In",resetZoomTooltip:"Reset Zoom",exportCSVTooltip:"Export to CSV",exportExcelTooltip:"Export to Excel",exportJSONTooltip:"Export to JSON",exportPDFTooltip:"Export to PDF",hideBaselinesTooltip:"Hide Baselines",showBaselinesTooltip:"Show Baselines",taskCreatorTitle:"Create New Task",taskCreatorOkText:"Create Task",taskCreatorCancelText:"Cancel",taskNameLabel:"Task Name",taskNamePlaceholder:"Enter task name",typeLabel:"Type",priorityLabel:"Priority",startDateLabel:"Start Date",durationLabel:"Duration (days)",colorLabel:"Color",progressLabel:"Progress (%)",ownerLabel:"Owner",ownerPlaceholder:"Assign to...",detailsLabel:"Details",detailsPlaceholder:"Add task description...",taskTypeOptions:{task:"Task",milestone:"Milestone",project:"Project"},priorityOptions:{low:"Low",medium:"Medium",high:"High"},taskEditorTitle:"Edit Task",taskEditorSaveText:"Save Changes",taskEditorCancelText:"Cancel",taskEditorDeleteText:"Delete",deleteConfirmTitle:"Delete Task",deleteConfirmContent:"This action cannot be undone.",deleteConfirmOkText:"Yes, Delete",deleteConfirmCancelText:"No",searchPlaceholder:"Search tasks...",allOwnersText:"All Owners",allStatusText:"All Status",allPriorityText:"All Priority",clearFiltersText:"Clear",statusOptions:{all:"All Status",notStarted:"Not Started",inProgress:"In Progress",completed:"Completed"},priorityFilterOptions:{all:"All Priority",low:"Low",medium:"Medium",high:"High"},columnLabels:{name:"Name",dependsOn:"Depends on",duration:"Duration",start:"Start"},taskNameRequired:"Please enter task name"},Sr=({tasks:t=[],links:a=[],config:o={},uiConfig:l={},styleConfig:r={},iconConfig:y={},onTaskUpdate:m,onTaskCreate:i,onTaskDelete:s,onLinkCreate:b,onLinkDelete:c,baselines:w})=>{const T={...vr,...l},u=g.useMemo(()=>{const d={};return r.primary&&(d["--wx-gantt-primary"]=r.primary),r.primarySelected&&(d["--wx-gantt-primary-selected"]=r.primarySelected),r.success&&(d["--wx-gantt-success"]=r.success),r.warning&&(d["--wx-gantt-warning"]=r.warning),r.danger&&(d["--wx-gantt-danger"]=r.danger),r.background&&(d["--wx-gantt-background"]=r.background),r.backgroundAlt&&(d["--wx-gantt-background-alt"]=r.backgroundAlt),r.backgroundHover&&(d["--wx-gantt-background-hover"]=r.backgroundHover),r.selectColor&&(d["--wx-gantt-select-color"]=r.selectColor),r.taskColor&&(d["--wx-gantt-task-color"]=r.taskColor),r.taskFillColor&&(d["--wx-gantt-task-fill-color"]=r.taskFillColor),r.projectColor&&(d["--wx-gantt-project-color"]=r.projectColor),r.milestoneColor&&(d["--wx-gantt-milestone-color"]=r.milestoneColor),r.fontColor&&(d["--wx-gantt-font-color"]=r.fontColor),r.fontColorAlt&&(d["--wx-gantt-font-color-alt"]=r.fontColorAlt),r.iconColor&&(d["--wx-gantt-icon-color"]=r.iconColor),r.borderColor&&(d["--wx-gantt-border-color"]=r.borderColor),r.fontFamily&&(d["--wx-gantt-font-family"]=r.fontFamily),r.fontMono&&(d["--wx-gantt-font-mono"]=r.fontMono),r.fontSize&&(d["--wx-gantt-font-size"]=r.fontSize),r.fontWeight&&(d["--wx-gantt-font-weight"]=String(r.fontWeight)),r.lineHeight&&(d["--wx-gantt-line-height"]=String(r.lineHeight)),r.spacingXS&&(d["--gantt-spacing-xs"]=r.spacingXS),r.spacingSM&&(d["--gantt-spacing-sm"]=r.spacingSM),r.spacingMD&&(d["--gantt-spacing-md"]=r.spacingMD),r.spacingLG&&(d["--gantt-spacing-lg"]=r.spacingLG),r.customCSSVariables&&Object.entries(r.customCSSVariables).forEach(([j,O])=>{d[j.startsWith("--")?j:`--${j}`]=O}),d},[r]),h=Array.isArray(t)?t:[],v=Array.isArray(a)?a:[],{tasks:S,links:D,setTasks:$,setLinks:F,undo:H,redo:ae,updateTask:X,createTask:fe,deleteTask:E,saveState:K}=Yt(h,v),[q,M]=g.useState(S),[U,se]=g.useState(null),[Z,ye]=g.useState(null),[$e,De]=g.useState(!1),[_,Y]=g.useState(void 0),[pe,te]=g.useState(void 0),[re,Q]=g.useState(!1),[f,L]=g.useState(null),[P,A]=g.useState(null),[R,le]=g.useState(null),[ne,Fe]=g.useState(null),[de,ke]=g.useState(null),[Be,Pe]=g.useState(1),[Te,Oe]=g.useState(()=>w&&w.size>0?w:h.length>0?zt(h):new Map);g.useEffect(()=>{w&&w.size>0&&Oe(w)},[w]);const[tt]=g.useState(o.theme||"light"),[ze,bt]=g.useState({searchText:"",status:"all",priority:"all",owner:""}),it=g.useRef(null),Ce=g.useRef(null),wt=g.useRef(null),Ie=g.useRef(!1),Me=g.useRef(null),ve={columns:o.columns||br(l),scales:wr,readonly:!1,editable:!0,taskHeight:28,rowHeight:44,scaleHeight:28,columnWidth:80,minColumnWidth:60,autoSchedule:!1,criticalPath:!1,baselines:!0,weekends:!0,holidays:[],theme:tt,locale:"en",showTodayLine:o.showTodayLine!==!1,todayLineColor:o.todayLineColor||"#ff4d4f",todayLineLabel:o.todayLineLabel!==void 0?o.todayLineLabel:"Today",todayLineWidth:o.todayLineWidth||1,todayLineStyle:o.todayLineStyle||"solid",todayLineOpacity:o.todayLineOpacity!==void 0?o.todayLineOpacity:1,todayLineLabelStyle:o.todayLineLabelStyle,showTodayLineMarker:o.showTodayLineMarker!==!1,todayLineMarkerSize:o.todayLineMarkerSize||8,todayLineMarkerStyle:o.todayLineMarkerStyle||"triangle",showProjectStartLine:o.showProjectStartLine!==!1,projectStartDate:o.projectStartDate,projectStartLineColor:o.projectStartLineColor||"#40a9ff",projectStartLineLabel:o.projectStartLineLabel!==void 0?o.projectStartLineLabel:"Start Project",projectStartLineWidth:o.projectStartLineWidth||1,projectStartLineStyle:o.projectStartLineStyle||"solid",projectStartLineOpacity:o.projectStartLineOpacity!==void 0?o.projectStartLineOpacity:1,projectStartLineLabelStyle:o.projectStartLineLabelStyle,showProjectStartLineMarker:o.showProjectStartLineMarker!==!1,projectStartLineMarkerSize:o.projectStartLineMarkerSize||8,projectStartLineMarkerStyle:o.projectStartLineMarkerStyle||"triangle",...o};g.useEffect(()=>{const d=qt(S,ze);M((O=>{const z=[],ie=J=>{if(!J)return!1;const be=O.find(oe=>oe.id===J);return be&&!be.open&&be.type==="project"?!0:ie(be?.parent)};return O.forEach(J=>{ie(J.parent)||z.push(J)}),z})(d))},[S,ze]);const lt=g.useMemo(()=>{if(!S||!Array.isArray(S))return[];try{return Array.from(new Set(S.map(d=>d?.owner).filter(Boolean)))}catch(d){return console.warn("Error extracting owners:",d),[]}},[S]),dt=(()=>{const d=q.length>0?q:S;if(d.length===0){const J=new Date;return{start:Ye(he(J,-30,"day")),end:Ye(he(J,60,"day"))}}const j=d.map(J=>J.start.getTime()),O=d.map(J=>J.end.getTime()),z=new Date(Math.min(...j)),ie=new Date(Math.max(...O));return{start:Ye(he(z,-7,"day")),end:Ye(ie)}})(),ct=d=>{se(d)},vt=(d,j)=>{if(ve.readonly)return;d.preventDefault();const O=S.find(z=>z.id===j);O&&ke({x:d.clientX,y:d.clientY,task:O})},St=()=>{if(!de?.task)return;const d=de.task,j={...d,id:`task-${Date.now()}`,text:`${d.text} (Copy)`,start:he(d.start,7,"day"),end:he(d.end,7,"day")};fe(j),i&&i(j)},rt=d=>{if(!de?.task)return;const j={...de.task,type:d};X(j),m&&m(j)},jt=(d,j,O,z)=>{if(!ve.readonly)if(z==="reorder"){const ie=q.findIndex(oe=>oe.id===d),J=(oe,we)=>{let _e=[];return we.filter(n=>n.parent===oe).forEach(n=>{_e.push(n.id),_e=[..._e,...J(n.id,we)]}),_e},be=J(d,S);le({id:d,initialIndex:ie,currentY:O,descendantIds:be}),document.body.classList.add("gantt-dragging")}else A(d)},Tt=()=>{if(R&&ne){const d=S.find(O=>O.id===R.id),j=S.find(O=>O.id===ne.taskId);if(d&&j&&d.id!==j.id){const O=[d.id,...R.descendantIds];if(!O.includes(j.id)){const z=[...S],ie=ne.position==="inside"?j.id:j.parent,J=z.findIndex(C=>C.id===d.id);J!==-1&&(z[J]={...z[J],parent:ie});const be=z.filter(C=>O.includes(C.id)),oe=z.filter(C=>!O.includes(C.id));let we=oe.findIndex(C=>C.id===j.id);if(ne.position==="inside"){const C=oe.filter(B=>B.parent===j.id);C.length>0?we=oe.findIndex(B=>B.id===C[C.length-1].id)+1:we++}else if(ne.position==="below"){const C=(I,me)=>{let ee=[];return me.filter(ge=>ge.parent===I).forEach(ge=>{ee.push(ge.id),ee=[...ee,...C(ge.id,me)]}),ee},B=C(j.id,oe);B.length>0?we=oe.findIndex(I=>I.id===B[B.length-1])+1:we++}const _e={tasks:[...S],links:[...D]};oe.splice(we,0,...be),$(oe),K("task_update",_e,{tasks:oe,links:D});const n=S.filter(C=>C.parent===d.parent).findIndex(C=>C.id===d.id)+1,k=oe.filter(C=>C.parent===ie).findIndex(C=>C.id===d.id)+1,N={currentSequenceId:n,targetSequenceId:k,targetStageId:ie??null},V=oe.find(C=>C.id===d.id);if(V&&m){const C={...V,sequence_id:k,stage_id:ie??null};m(C,N)}}}}A(null),le(null),Fe(null),document.body.classList.remove("gantt-dragging")},nt=g.useRef(null),Dt=g.useCallback(d=>{R&&(nt.current&&cancelAnimationFrame(nt.current),nt.current=requestAnimationFrame(()=>{const j=ve.rowHeight||44,O=Ce.current?.querySelector(".gantt-grid-body");if(!O)return;const z=O.getBoundingClientRect(),ie=d.clientY-z.top;let J=Math.floor(ie/j);J=Math.max(0,Math.min(J,q.length-1));const be=q[J];if(be){const oe=ie-J*j;let we="above";be.type==="project"?oe<j*.3?we="above":oe>j*.7?we="below":we="inside":we=oe<j/2?"above":"below",be.id!==R.id?Fe({taskId:be.id,position:we}):Fe(null)}le(oe=>oe?{...oe,currentY:d.clientY}:null)}))},[R,q,ve.rowHeight]),qe=()=>{R&&Tt()},ut=(d,j)=>{const O={...d,id:`task-${Date.now()}`,parent:j};fe(O);const z={taskId:O.id,start:new Date(O.start),end:new Date(O.end)};Oe(ie=>{const J=new Map(ie);return J.set(O.id,z),J}),i&&i(O)},Le=d=>{X(d),m&&m(d)},Xe=d=>{E(d),Oe(j=>{const O=new Map(j);return O.delete(d),O}),s&&s(d)},Je=(d,j,O,z)=>{const ie={id:`link-${Date.now()}`,source:d,target:j,type:O,lag:z};F([...D,ie]),b&&b(ie)},ot=d=>{const j=D.filter(O=>O.id!==d);F(j),c&&c(d)};g.useEffect(()=>{const d=new Map(Te);let j=!1;S.forEach(z=>{Te.has(z.id)||(d.set(z.id,{taskId:z.id,start:new Date(z.start),end:new Date(z.end)}),j=!0)});const O=new Set(S.map(z=>z.id));Te.forEach((z,ie)=>{O.has(ie)||(d.delete(ie),j=!0)}),j&&Oe(d)},[S]),g.useEffect(()=>{const d=j=>{(j.ctrlKey||j.metaKey)&&(j.key==="z"&&!j.shiftKey?(j.preventDefault(),H()):(j.key==="y"||j.key==="z"&&j.shiftKey)&&(j.preventDefault(),ae()))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[H,ae]),g.useEffect(()=>{const d=Ce.current?.querySelector(".gantt-grid-body"),j=it.current?.querySelector(".gantt-timeline-body");if(!d||!j)return;const O=()=>{Ie.current||(Ie.current=!0,j.scrollTop=d.scrollTop,Me.current&&clearTimeout(Me.current),Me.current=window.setTimeout(()=>{Ie.current=!1},150))},z=()=>{Ie.current||(Ie.current=!0,d.scrollTop=j.scrollTop,Me.current&&clearTimeout(Me.current),Me.current=window.setTimeout(()=>{Ie.current=!1},150))};return d.addEventListener("scroll",O,{passive:!0}),j.addEventListener("scroll",z,{passive:!0}),()=>{d.removeEventListener("scroll",O),j.removeEventListener("scroll",z),Me.current&&clearTimeout(Me.current)}},[q]);const kt={height:o.containerHeight||"100%",minHeight:o.containerMinHeight||"400px"},pt=o.gridWidth?{"--gantt-grid-width":o.gridWidth}:{};return e.jsxs("div",{className:`gantt-page-wrapper theme-${tt}`,style:{...kt,...u},children:[T.showHeader&&e.jsx("div",{className:"gantt-page-header",children:e.jsx("div",{className:"gantt-page-header-left",children:e.jsx("h1",{className:"gantt-page-title",children:T.headerTitle})})}),e.jsxs("div",{className:`gantt-container theme-${ve.theme}`,style:pt,children:[e.jsx(At,{zoomLevel:Be,setZoomLevel:Pe,onExport:d=>{d==="csv"&&Wt(S),d==="excel"&&Ht(S),d==="json"&&Ut(S,D),d==="pdf"&&Vt(S)},onFilterChange:d=>bt(d),owners:lt||[],onAddTask:d=>{if(d){const j=S.find(O=>O.id===d);Y(d),te(j?.text)}else Y(void 0),te(void 0);De(!0)},uiConfig:T,iconConfig:y,styleConfig:r}),e.jsxs("div",{className:"gantt-layout",ref:wt,onMouseMove:Dt,onMouseUp:qe,onMouseLeave:qe,children:[e.jsx(xt,{ref:Ce,tasks:q,columns:ve.columns||[],selectedTask:U,onTaskClick:ct,onTaskContextMenu:vt,onTaskUpdate:Le,onTaskDragStart:jt,onAddTask:d=>{if(d){const j=S.find(O=>O.id===d);Y(d),te(j?.text)}else Y(void 0),te(void 0);De(!0)},onAddDependency:Je,onRemoveDependency:ot,onDependencyClick:d=>{const j=S.find(O=>O.id===d);j&&(L(j),Q(!0))},links:D,allTasks:S,dropIndicator:ne,reorderTask:R,iconConfig:y,styleConfig:r}),e.jsx(gt,{ref:it,tasks:q,links:D,range:dt,scales:ve.scales,config:ve,selectedTask:U,draggedTask:P,onTaskClick:()=>{},onTaskDragStart:()=>{},onTaskDragEnd:()=>{},onTaskUpdate:(d,j)=>{const O=S.find(z=>z.id===d);O&&Le({...O,...j})},zoomLevel:Be,baselines:Te})]}),$e&&e.jsx(Bt,{onCreateTask:ut,onClose:()=>{De(!1),Y(void 0),te(void 0)},uiConfig:T,parentId:_,parentTaskName:pe,styleConfig:r}),Z&&e.jsx(It,{task:Z,onUpdate:Le,onDelete:Xe,onClose:()=>ye(null),uiConfig:T,styleConfig:r}),re&&f&&e.jsx(_t,{task:f,allTasks:S,links:D,onAddDependency:Je,onRemoveDependency:ot,onTaskUpdate:Le,onClose:()=>{Q(!1),L(null)},styleConfig:r}),de&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-context-menu-overlay",onClick:()=>ke(null),onContextMenu:d=>{d.preventDefault(),ke(null)}}),e.jsx(pr,{x:de.x,y:de.y,task:de.task,onEdit:()=>{de.task&&ye(de.task)},onDelete:()=>{de.task&&Xe(de.task.id)},onCopy:St,onDependencies:()=>{de.task&&(L(de.task),Q(!0))},onConvertToMilestone:()=>rt("milestone"),onConvertToTask:()=>rt("task"),onConvertToProject:()=>rt("project"),onClose:()=>ke(null),onAutoSchedule:()=>{const d=Rt(S,D,{mode:"forward"});$(d),ke(null)},iconConfig:y,styleConfig:r})]}),R&&e.jsx("div",{className:"gantt-grid-row ghost-row",style:{height:ve.rowHeight,top:R.currentY-(ve.rowHeight||48)/2,left:Ce.current?.getBoundingClientRect().left,position:"fixed",pointerEvents:"none",opacity:.8,zIndex:9999,width:Ce.current?.offsetWidth,backgroundColor:"#ffffff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #2196F3",display:"flex"},children:ve.columns?.map(d=>e.jsx("div",{className:"gantt-grid-cell",style:{width:d.width,textAlign:d.align||"left"},children:(()=>{const j=S.find(O=>O.id===R.id);if(!j)return null;if(d.template)return d.template(j);switch(d.name){case"text":return e.jsxs("div",{className:"gantt-grid-cell-text",children:[e.jsx(ce.FontAwesomeIcon,{icon:G.faGripVertical,style:{marginRight:8,color:"#adb5bd"}}),e.jsxs("span",{className:"gantt-task-name-text",children:[j.text,R.descendantIds.length>0&&e.jsxs("span",{children:[" +",R.descendantIds.length," subtasks"]})]})]});case"start":return xe(j.start,"DD MMM YYYY");case"duration":return`${j.duration}`;default:return j[d.name]||""}})()},`ghost-${d.name}`))})]})]})},jr=Object.freeze(Object.defineProperty({__proto__:null,calculateCriticalPath:(t,a)=>{const o=new Set,l=new Map,r=new Map,y=new Map;t.forEach(u=>{r.set(u.id,[]),y.set(u.id,[])}),a.forEach(u=>{u.type==="e2s"&&(r.get(u.source)?.push(u.target),y.get(u.target)?.push(u.source))});const m=new Map,i=new Map,s=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const v=t.find(D=>D.id===u);if(!v)return;const S=y.get(u)||[];if(S.length===0)m.set(u,0),i.set(u,v.duration);else{let D=0;S.forEach($=>{s($,h);const F=i.get($)||0;D=Math.max(D,F)}),m.set(u,D),i.set(u,D+v.duration)}};t.forEach(u=>s(u.id));const b=new Map,c=new Map,w=Math.max(...Array.from(i.values())),T=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const v=t.find(D=>D.id===u);if(!v)return;const S=r.get(u)||[];if(S.length===0)c.set(u,w),b.set(u,w-v.duration);else{let D=1/0;S.forEach($=>{T($,h);const F=b.get($)||0;D=Math.min(D,F)}),c.set(u,D),b.set(u,D-v.duration)}};return t.forEach(u=>T(u.id)),t.forEach(u=>{const h=m.get(u.id)||0,S=(b.get(u.id)||0)-h;l.set(u.id,S),Math.abs(S)<.01&&o.add(u.id)}),{criticalTasks:o,taskFloats:l,projectDuration:w}},getTaskFloat:(t,a)=>a.taskFloats.get(t)||0,isCriticalTask:(t,a)=>a.criticalTasks.has(t)},Symbol.toStringTag,{value:"Module"}));W.AutoScheduler=mr,W.Chart=gt,W.CriticalPath=jr,W.DependencyEditor=_t,W.ExportUtils=gr,W.FilterSearch=Nt,W.Gantt=Sr,W.Grid=xt,W.TaskBar=Ct,W.TaskCreator=Bt,W.TaskEditor=It,W.Timeline=yt,W.Toolbar=At,W.addToDate=he,W.applyFilters=qt,W.calculateDuration=Qt,W.createBaseline=zt,W.formatDate=xe,W.getDaysBetween=Qe,W.getEndOfDay=Kt,W.getHoursBetween=Ot,W.getStartOfDay=Ye,W.isHoliday=ft,W.isWeekend=ht,W.useUndoRedo=Yt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
31
+ `.trim();st(a,"gantt-report.txt","text/plain"),alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.")},xr=(t,a,o="png")=>{if(!document.getElementById(t)){alert("Could not find Gantt chart element to export");return}if(o==="svg"){alert("SVG export requires additional library. Use PNG or implement with dom-to-svg.");return}alert("Image export requires html2canvas library. Install with: npm install html2canvas")},st=(t,a,o)=>{const l=new Blob([t],{type:o}),r=URL.createObjectURL(l);yr(r,a),URL.revokeObjectURL(r)},yr=(t,a)=>{const o=document.createElement("a");o.href=t,o.download=a,document.body.appendChild(o),o.click(),document.body.removeChild(o)},gr=Object.freeze(Object.defineProperty({__proto__:null,exportToCSV:Ht,exportToExcel:Ut,exportToImage:xr,exportToJSON:Vt,exportToPDF:Xt,importFromJSON:t=>new Promise((a,o)=>{const l=new FileReader;l.onload=r=>{try{const g=r.target?.result,x=JSON.parse(g),i=x.tasks.map(s=>({...s,start:new Date(s.start),end:new Date(s.end)}));a({tasks:i,links:x.links||[]})}catch{o(new Error("Invalid JSON file"))}},l.onerror=()=>o(new Error("Failed to read file")),l.readAsText(t)})},Symbol.toStringTag,{value:"Module"})),qt=(t,a)=>t.filter(o=>{if(a.searchText){const l=a.searchText.toLowerCase(),r=o.text.toLowerCase().includes(l),g=o.owner?.toLowerCase().includes(l),x=o.details?.toLowerCase().includes(l);if(!r&&!g&&!x)return!1}if(a.status!=="all"&&(o.progress===0?"not-started":o.progress===100?"completed":"in-progress")!==a.status||a.priority!=="all"&&o.priority!==a.priority||a.owner&&o.owner!==a.owner)return!1;if(a.dateRange){const l=o.start.getTime(),r=a.dateRange.start.getTime(),g=a.dateRange.end.getTime();if(l<r||l>g)return!1}return!0}),br=t=>[{name:"index",label:"",width:40,align:"center"},{name:"text",label:t?.columnLabels?.name||"Name",width:250,align:"left",resize:!0},{name:"predecessors",label:t?.columnLabels?.dependsOn||"Depends on",width:120,align:"left"},{name:"duration",label:t?.columnLabels?.duration||"Duration",width:110,align:"left"},{name:"start",label:t?.columnLabels?.start||"Start",width:130,align:"left"},{name:"add",label:"",width:50,align:"center"}],wr=[{unit:"month",step:1,format:"MMM"},{unit:"day",step:1,format:"D"}],vr={headerTitle:"Iris Gantt",showHeader:!0,showAddTaskButton:!0,showBaselineButton:!1,showZoomButtons:!0,showExportButtons:!0,showFilterSearch:!0,addTaskButtonText:"New Task",baselineButtonText:"Set Baseline",baselineButtonTextActive:"Baselines",zoomOutTooltip:"Zoom Out",zoomInTooltip:"Zoom In",resetZoomTooltip:"Reset Zoom",exportCSVTooltip:"Export to CSV",exportExcelTooltip:"Export to Excel",exportJSONTooltip:"Export to JSON",exportPDFTooltip:"Export to PDF",hideBaselinesTooltip:"Hide Baselines",showBaselinesTooltip:"Show Baselines",taskCreatorTitle:"Create New Task",taskCreatorOkText:"Create Task",taskCreatorCancelText:"Cancel",taskNameLabel:"Task Name",taskNamePlaceholder:"Enter task name",typeLabel:"Type",priorityLabel:"Priority",startDateLabel:"Start Date",durationLabel:"Duration (days)",colorLabel:"Color",progressLabel:"Progress (%)",ownerLabel:"Owner",ownerPlaceholder:"Assign to...",detailsLabel:"Details",detailsPlaceholder:"Add task description...",taskTypeOptions:{task:"Task",milestone:"Milestone",project:"Project"},priorityOptions:{low:"Low",medium:"Medium",high:"High"},taskEditorTitle:"Edit Task",taskEditorSaveText:"Save Changes",taskEditorCancelText:"Cancel",taskEditorDeleteText:"Delete",deleteConfirmTitle:"Delete Task",deleteConfirmContent:"This action cannot be undone.",deleteConfirmOkText:"Yes, Delete",deleteConfirmCancelText:"No",searchPlaceholder:"Search tasks...",allOwnersText:"All Owners",allStatusText:"All Status",allPriorityText:"All Priority",clearFiltersText:"Clear",statusOptions:{all:"All Status",notStarted:"Not Started",inProgress:"In Progress",completed:"Completed"},priorityFilterOptions:{all:"All Priority",low:"Low",medium:"Medium",high:"High"},columnLabels:{name:"Name",dependsOn:"Depends on",duration:"Duration",start:"Start"},taskNameRequired:"Please enter task name"},Sr=({tasks:t=[],links:a=[],config:o={},uiConfig:l={},styleConfig:r={},iconConfig:g={},onTaskUpdate:x,onTaskCreate:i,onTaskDelete:s,onLinkCreate:b,onLinkDelete:c,baselines:w})=>{const T={...vr,...l},u=y.useMemo(()=>{const d={};return r.primary&&(d["--wx-gantt-primary"]=r.primary),r.primarySelected&&(d["--wx-gantt-primary-selected"]=r.primarySelected),r.success&&(d["--wx-gantt-success"]=r.success),r.warning&&(d["--wx-gantt-warning"]=r.warning),r.danger&&(d["--wx-gantt-danger"]=r.danger),r.background&&(d["--wx-gantt-background"]=r.background),r.backgroundAlt&&(d["--wx-gantt-background-alt"]=r.backgroundAlt),r.backgroundHover&&(d["--wx-gantt-background-hover"]=r.backgroundHover),r.selectColor&&(d["--wx-gantt-select-color"]=r.selectColor),r.taskColor&&(d["--wx-gantt-task-color"]=r.taskColor),r.taskFillColor&&(d["--wx-gantt-task-fill-color"]=r.taskFillColor),r.projectColor&&(d["--wx-gantt-project-color"]=r.projectColor),r.milestoneColor&&(d["--wx-gantt-milestone-color"]=r.milestoneColor),r.fontColor&&(d["--wx-gantt-font-color"]=r.fontColor),r.fontColorAlt&&(d["--wx-gantt-font-color-alt"]=r.fontColorAlt),r.iconColor&&(d["--wx-gantt-icon-color"]=r.iconColor),r.borderColor&&(d["--wx-gantt-border-color"]=r.borderColor),r.fontFamily&&(d["--wx-gantt-font-family"]=r.fontFamily),r.fontMono&&(d["--wx-gantt-font-mono"]=r.fontMono),r.fontSize&&(d["--wx-gantt-font-size"]=r.fontSize),r.fontWeight&&(d["--wx-gantt-font-weight"]=String(r.fontWeight)),r.lineHeight&&(d["--wx-gantt-line-height"]=String(r.lineHeight)),r.spacingXS&&(d["--gantt-spacing-xs"]=r.spacingXS),r.spacingSM&&(d["--gantt-spacing-sm"]=r.spacingSM),r.spacingMD&&(d["--gantt-spacing-md"]=r.spacingMD),r.spacingLG&&(d["--gantt-spacing-lg"]=r.spacingLG),r.customCSSVariables&&Object.entries(r.customCSSVariables).forEach(([j,$])=>{d[j.startsWith("--")?j:`--${j}`]=$}),d},[r]),h=Array.isArray(t)?t:[],v=Array.isArray(a)?a:[],{tasks:S,links:D,setTasks:F,setLinks:P,undo:H,redo:se,updateTask:J,createTask:me,deleteTask:E,saveState:ee}=Yt(h,v),[X,L]=y.useState(S),[U,ie]=y.useState(null),[K,xe]=y.useState(null),[Ee,Te]=y.useState(!1),[R,Y]=y.useState(void 0),[he,re]=y.useState(void 0),[ne,te]=y.useState(!1),[m,M]=y.useState(null),[O,N]=y.useState(null),[I,le]=y.useState(null),[oe,Le]=y.useState(null),[de,De]=y.useState(null),[Ne,Fe]=y.useState(1),[ve,$e]=y.useState(()=>w&&w.size>0?w:h.length>0?Wt(h):new Map);y.useEffect(()=>{w&&w.size>0&&$e(w)},[w]);const[et]=y.useState(o.theme||"light"),[_e,vt]=y.useState({searchText:"",status:"all",priority:"all",owner:""}),it=y.useRef(null),Re=y.useRef(null),St=y.useRef(null),lt=y.useRef(null),Pe=y.useRef(!1),ke=y.useRef(null),Se={columns:o.columns||br(l),scales:wr,readonly:!1,editable:!0,taskHeight:28,rowHeight:44,scaleHeight:28,columnWidth:80,minColumnWidth:60,autoSchedule:!1,criticalPath:!1,baselines:!0,weekends:!0,holidays:[],theme:et,locale:"en",showTodayLine:o.showTodayLine!==!1,todayLineColor:o.todayLineColor||"#ff4d4f",todayLineLabel:o.todayLineLabel!==void 0?o.todayLineLabel:"Today",todayLineWidth:o.todayLineWidth||1,todayLineStyle:o.todayLineStyle||"solid",todayLineOpacity:o.todayLineOpacity!==void 0?o.todayLineOpacity:1,todayLineLabelStyle:o.todayLineLabelStyle,showTodayLineMarker:o.showTodayLineMarker!==!1,todayLineMarkerSize:o.todayLineMarkerSize||8,todayLineMarkerStyle:o.todayLineMarkerStyle||"triangle",showProjectStartLine:o.showProjectStartLine!==!1,projectStartDate:o.projectStartDate,projectStartLineColor:o.projectStartLineColor||"#40a9ff",projectStartLineLabel:o.projectStartLineLabel!==void 0?o.projectStartLineLabel:"Start Project",projectStartLineWidth:o.projectStartLineWidth||1,projectStartLineStyle:o.projectStartLineStyle||"solid",projectStartLineOpacity:o.projectStartLineOpacity!==void 0?o.projectStartLineOpacity:1,projectStartLineLabelStyle:o.projectStartLineLabelStyle,showProjectStartLineMarker:o.showProjectStartLineMarker!==!1,projectStartLineMarkerSize:o.projectStartLineMarkerSize||8,projectStartLineMarkerStyle:o.projectStartLineMarkerStyle||"triangle",...o};y.useEffect(()=>{const d=qt(S,_e);L(($=>{const A=[],q=G=>{if(!G)return!1;const ge=$.find(ce=>ce.id===G);return ge&&!ge.open&&ge.type==="project"?!0:q(ge?.parent)};return $.forEach(G=>{q(G.parent)||A.push(G)}),A})(d))},[S,_e]);const jt=y.useMemo(()=>{if(!S||!Array.isArray(S))return[];try{return Array.from(new Set(S.map(d=>d?.owner).filter(Boolean)))}catch(d){return console.warn("Error extracting owners:",d),[]}},[S]),dt=(()=>{const d=X.length>0?X:S;if(d.length===0){const G=new Date;return{start:Be(fe(G,-30,"day")),end:Be(fe(G,60,"day"))}}const j=d.map(G=>G.start.getTime()),$=d.map(G=>G.end.getTime()),A=new Date(Math.min(...j)),q=new Date(Math.max(...$));return{start:Be(fe(A,-7,"day")),end:Be(q)}})(),Dt=d=>{ie(d)},kt=(d,j)=>{if(Se.readonly)return;d.preventDefault();const $=S.find(A=>A.id===j);$&&De({x:d.clientX,y:d.clientY,task:$})},Lt=()=>{if(!de?.task)return;const d=de.task,j={...d,id:`task-${Date.now()}`,text:`${d.text} (Copy)`,start:fe(d.start,7,"day"),end:fe(d.end,7,"day")};me(j),i&&i(j)},tt=d=>{if(!de?.task)return;const j={...de.task,type:d};J(j),x&&x(j)},Ve=y.useCallback((d,j)=>{let $=[];return j.filter(q=>q.parent===d).forEach(q=>{$.push(q.id),$=[...$,...Ve(q.id,j)]}),$},[]),ct=(d,j)=>(d??null)===(j??null),Mt=(d,j,$,A)=>{if(!Se.readonly)if(A==="reorder"){const q=X.findIndex(ge=>ge.id===d),G=Ve(d,S);le({id:d,initialIndex:q,currentX:j,currentY:$,descendantIds:G}),document.body.classList.add("gantt-dragging")}else N(d)},rt=()=>{if(I&&oe){const d=S.find($=>$.id===I.id),j=S.find($=>$.id===oe.taskId);if(d&&j&&d.id!==j.id){const $=[d.id,...I.descendantIds];if(!$.includes(j.id)){const A=[...S],q=(oe.position==="inside"?j.id:j.parent)??void 0,G=A.findIndex(B=>B.id===d.id);G!==-1&&(A[G]={...A[G],parent:q});const ge=A.filter(B=>$.includes(B.id)),ce=A.filter(B=>!$.includes(B.id));let n=ce.findIndex(B=>B.id===j.id);if(oe.position==="inside"){const B=[j.id,...Ve(j.id,ce)],ae=B[B.length-1];n=ce.findIndex(ue=>ue.id===ae)+1}else if(oe.position==="below"){const B=Ve(j.id,ce);B.length>0?n=ce.findIndex(ae=>ae.id===B[B.length-1])+1:n++}n<0&&(n=ce.length);const f={tasks:[...S],links:[...D]};ce.splice(n,0,...ge),F(ce),ee("task_update",f,{tasks:ce,links:D});const C=S.filter(B=>ct(B.parent,d.parent)).findIndex(B=>B.id===d.id)+1,Z=ce.filter(B=>ct(B.parent,q)).findIndex(B=>B.id===d.id)+1,z={currentSequenceId:C,targetSequenceId:Z,targetStageId:q??null},_=ce.find(B=>B.id===d.id);if(_&&x){const B={..._,sequence_id:Z,stage_id:q??null};x(B,z)}}}}N(null),le(null),Le(null),document.body.classList.remove("gantt-dragging")},Xe=y.useRef(null),Ae=y.useCallback(d=>{if(I){const{clientX:j,clientY:$}=d;Xe.current&&cancelAnimationFrame(Xe.current),Xe.current=requestAnimationFrame(()=>{const A=Se.rowHeight||44,q=Re.current?.querySelector(".gantt-grid-body");if(!q||X.length===0){Le(null);return}const G=q.getBoundingClientRect(),ge=$-G.top+q.scrollTop;let ce=Math.floor(ge/A);ce=Math.max(0,Math.min(ce,X.length-1));const n=X[ce];if(n){if(n.id===I.id||I.descendantIds.includes(n.id)){Le(null),le(V=>V?{...V,currentX:j,currentY:$}:null);return}const k=ge-ce*A;let C="above";n.type!=="milestone"?k<A*.3?C="above":k>A*.7?C="below":C="inside":C=k<A/2?"above":"below",Le({taskId:n.id,position:C})}le(f=>f?{...f,currentX:j,currentY:$}:null)})}},[I,X,Se.rowHeight]),qe=()=>{I&&rt()},nt=(d,j)=>{const $={...d,id:`task-${Date.now()}`,parent:j};me($);const A={taskId:$.id,start:new Date($.start),end:new Date($.end)};$e(q=>{const G=new Map(q);return G.set($.id,A),G}),i&&i($)},Ye=d=>{J(d),x&&x(d)},ut=d=>{E(d),$e(j=>{const $=new Map(j);return $.delete(d),$}),s&&s(d)},ot=(d,j,$,A)=>{const q={id:`link-${Date.now()}`,source:d,target:j,type:$,lag:A};P([...D,q]),b&&b(q)},pt=d=>{const j=D.filter($=>$.id!==d);P(j),c&&c(d)};y.useEffect(()=>{const d=new Map(ve);let j=!1;S.forEach(A=>{ve.has(A.id)||(d.set(A.id,{taskId:A.id,start:new Date(A.start),end:new Date(A.end)}),j=!0)});const $=new Set(S.map(A=>A.id));ve.forEach((A,q)=>{$.has(q)||(d.delete(q),j=!0)}),j&&$e(d)},[S]),y.useEffect(()=>{const d=j=>{(j.ctrlKey||j.metaKey)&&(j.key==="z"&&!j.shiftKey?(j.preventDefault(),H()):(j.key==="y"||j.key==="z"&&j.shiftKey)&&(j.preventDefault(),se()))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[H,se]),y.useEffect(()=>{const d=Re.current?.querySelector(".gantt-grid-body"),j=it.current?.querySelector(".gantt-timeline-body");if(!d||!j)return;const $=()=>{Pe.current||(Pe.current=!0,j.scrollTop=d.scrollTop,ke.current&&clearTimeout(ke.current),ke.current=window.setTimeout(()=>{Pe.current=!1},150))},A=()=>{Pe.current||(Pe.current=!0,d.scrollTop=j.scrollTop,ke.current&&clearTimeout(ke.current),ke.current=window.setTimeout(()=>{Pe.current=!1},150))};return d.addEventListener("scroll",$,{passive:!0}),j.addEventListener("scroll",A,{passive:!0}),()=>{d.removeEventListener("scroll",$),j.removeEventListener("scroll",A),ke.current&&clearTimeout(ke.current)}},[X]);const ht={height:o.containerHeight||"100%",minHeight:o.containerMinHeight||"400px"},ft=o.gridWidth?{"--gantt-grid-width":o.gridWidth}:{};return e.jsxs("div",{className:`gantt-page-wrapper theme-${et}`,style:{...ht,...u},children:[T.showHeader&&e.jsx("div",{className:"gantt-page-header",children:e.jsx("div",{className:"gantt-page-header-left",children:e.jsx("h1",{className:"gantt-page-title",children:T.headerTitle})})}),e.jsxs("div",{className:`gantt-container theme-${Se.theme}`,ref:lt,style:ft,children:[e.jsx(Bt,{zoomLevel:Ne,setZoomLevel:Fe,onExport:d=>{d==="csv"&&Ht(S),d==="excel"&&Ut(S),d==="json"&&Vt(S,D),d==="pdf"&&Xt(S)},onFilterChange:d=>vt(d),owners:jt||[],onAddTask:d=>{if(d){const j=S.find($=>$.id===d);Y(d),re(j?.text)}else Y(void 0),re(void 0);Te(!0)},uiConfig:T,iconConfig:g,styleConfig:r}),e.jsxs("div",{className:"gantt-layout",ref:St,onMouseMove:Ae,onMouseUp:qe,onMouseLeave:qe,children:[e.jsx(gt,{ref:Re,tasks:X,columns:Se.columns||[],selectedTask:U,onTaskClick:Dt,onTaskContextMenu:kt,onTaskUpdate:Ye,onTaskDragStart:Mt,onAddTask:d=>{if(d){const j=S.find($=>$.id===d);Y(d),re(j?.text)}else Y(void 0),re(void 0);Te(!0)},onAddDependency:ot,onRemoveDependency:pt,onDependencyClick:d=>{const j=S.find($=>$.id===d);j&&(M(j),te(!0))},links:D,allTasks:S,dropIndicator:oe,reorderTask:I,iconConfig:g,styleConfig:r}),e.jsx(wt,{ref:it,tasks:X,links:D,range:dt,scales:Se.scales,config:Se,selectedTask:U,draggedTask:O,onTaskClick:()=>{},onTaskDragStart:()=>{},onTaskDragEnd:()=>{},onTaskUpdate:(d,j)=>{const $=S.find(A=>A.id===d);$&&Ye({...$,...j})},zoomLevel:Ne,baselines:ve})]}),Ee&&e.jsx(It,{onCreateTask:nt,onClose:()=>{Te(!1),Y(void 0),re(void 0)},uiConfig:T,parentId:R,parentTaskName:he,styleConfig:r}),K&&e.jsx(_t,{task:K,onUpdate:Ye,onDelete:ut,onClose:()=>xe(null),uiConfig:T,styleConfig:r}),ne&&m&&e.jsx(Rt,{task:m,allTasks:S,links:D,onAddDependency:ot,onRemoveDependency:pt,onTaskUpdate:Ye,onClose:()=>{te(!1),M(null)},styleConfig:r}),de&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-context-menu-overlay",onClick:()=>De(null),onContextMenu:d=>{d.preventDefault(),De(null)}}),e.jsx(pr,{x:de.x,y:de.y,task:de.task,onEdit:()=>{de.task&&xe(de.task)},onDelete:()=>{de.task&&ut(de.task.id)},onCopy:Lt,onDependencies:()=>{de.task&&(M(de.task),te(!0))},onConvertToMilestone:()=>tt("milestone"),onConvertToTask:()=>tt("task"),onConvertToProject:()=>tt("project"),onClose:()=>De(null),onAutoSchedule:()=>{const d=zt(S,D,{mode:"forward"});F(d),De(null)},iconConfig:g,styleConfig:r})]}),I&&(()=>{const d=S.find(n=>n.id===I.id);if(!d)return null;const j=Number.isFinite(I.currentX)?I.currentX:0,$=Number.isFinite(I.currentY)?I.currentY:0,A=Se.rowHeight||48,G=lt.current?.getBoundingClientRect(),ge=G?j-G.left+12:j+12,ce=G?$-G.top+12:$+12;return e.jsxs("div",{className:"gantt-drag-preview",style:{height:A,top:ce,left:ge,position:"absolute",pointerEvents:"none",zIndex:9999,maxWidth:"420px"},children:[e.jsx("span",{className:"gantt-drag-preview-name",title:d.text,children:d.text}),I.descendantIds.length>0&&e.jsxs("span",{className:"gantt-drag-preview-count",children:["+",I.descendantIds.length]})]})})()]})]})},jr=Object.freeze(Object.defineProperty({__proto__:null,calculateCriticalPath:(t,a)=>{const o=new Set,l=new Map,r=new Map,g=new Map;t.forEach(u=>{r.set(u.id,[]),g.set(u.id,[])}),a.forEach(u=>{u.type==="e2s"&&(r.get(u.source)?.push(u.target),g.get(u.target)?.push(u.source))});const x=new Map,i=new Map,s=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const v=t.find(D=>D.id===u);if(!v)return;const S=g.get(u)||[];if(S.length===0)x.set(u,0),i.set(u,v.duration);else{let D=0;S.forEach(F=>{s(F,h);const P=i.get(F)||0;D=Math.max(D,P)}),x.set(u,D),i.set(u,D+v.duration)}};t.forEach(u=>s(u.id));const b=new Map,c=new Map,w=Math.max(...Array.from(i.values())),T=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const v=t.find(D=>D.id===u);if(!v)return;const S=r.get(u)||[];if(S.length===0)c.set(u,w),b.set(u,w-v.duration);else{let D=1/0;S.forEach(F=>{T(F,h);const P=b.get(F)||0;D=Math.min(D,P)}),c.set(u,D),b.set(u,D-v.duration)}};return t.forEach(u=>T(u.id)),t.forEach(u=>{const h=x.get(u.id)||0,S=(b.get(u.id)||0)-h;l.set(u.id,S),Math.abs(S)<.01&&o.add(u.id)}),{criticalTasks:o,taskFloats:l,projectDuration:w}},getTaskFloat:(t,a)=>a.taskFloats.get(t)||0,isCriticalTask:(t,a)=>a.criticalTasks.has(t)},Symbol.toStringTag,{value:"Module"}));W.AutoScheduler=mr,W.Chart=wt,W.CriticalPath=jr,W.DependencyEditor=Rt,W.ExportUtils=gr,W.FilterSearch=At,W.Gantt=Sr,W.Grid=gt,W.TaskBar=Nt,W.TaskCreator=It,W.TaskEditor=_t,W.Timeline=bt,W.Toolbar=Bt,W.addToDate=fe,W.applyFilters=qt,W.calculateDuration=Qt,W.createBaseline=Wt,W.formatDate=ye,W.getDaysBetween=Ke,W.getEndOfDay=Kt,W.getHoursBetween=Ct,W.getStartOfDay=Be,W.isHoliday=xt,W.isWeekend=mt,W.useUndoRedo=Yt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iris-gantt",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "A comprehensive, production-ready Gantt chart component built with React and TypeScript. Easy to install, simple to use.",
5
5
  "keywords": [
6
6
  "gantt",
@@ -102,4 +102,4 @@
102
102
  "vite": "^7.2.4",
103
103
  "vitest": "^4.0.17"
104
104
  }
105
- }
105
+ }