iris-gantt 1.0.5 → 1.0.7

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(N,T){typeof exports=="object"&&typeof module<"u"?T(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"],T):(N=typeof globalThis<"u"?globalThis:N||self,T(N.IrisGantt={},N.React,N.antd,N.ReactFontawesome,N.FontAwesomeSolid,N.dayjs))})(this,(function(N,T,a,L,O,jt){"use strict";var Ze={exports:{}},ze={};var vt;function Ut(){if(vt)return ze;vt=1;var n=T,r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function d(l,g,v){var c,y={},D=null,u=null;v!==void 0&&(D=""+v),g.key!==void 0&&(D=""+g.key),g.ref!==void 0&&(u=g.ref);for(c in g)o.call(g,c)&&!m.hasOwnProperty(c)&&(y[c]=g[c]);if(l&&l.defaultProps)for(c in g=l.defaultProps,g)y[c]===void 0&&(y[c]=g[c]);return{$$typeof:r,type:l,key:D,ref:u,props:y,_owner:s.current}}return ze.Fragment=i,ze.jsx=d,ze.jsxs=d,ze}var He={};var bt;function Vt(){return bt||(bt=1,process.env.NODE_ENV!=="production"&&(function(){var n=T,r=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),l=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),u=Symbol.for("react.offscreen"),f=Symbol.iterator,b="@@iterator";function k(t){if(t===null||typeof t!="object")return null;var p=f&&t[f]||t[b];return typeof p=="function"?p:null}var h=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(t){{for(var p=arguments.length,S=new Array(p>1?p-1:0),E=1;E<p;E++)S[E-1]=arguments[E];A("error",t,S)}}function A(t,p,S){{var E=h.ReactDebugCurrentFrame,H=E.getStackAddendum();H!==""&&(p+="%s",S=S.concat([H]));var J=S.map(function(R){return String(R)});J.unshift("Warning: "+p),Function.prototype.apply.call(console[t],console,J)}}var I=!1,z=!1,W=!1,re=!1,ge=!1,w;w=Symbol.for("react.module.reference");function U(t){return!!(typeof t=="string"||typeof t=="function"||t===o||t===m||ge||t===s||t===v||t===c||re||t===u||I||z||W||typeof t=="object"&&t!==null&&(t.$$typeof===D||t.$$typeof===y||t.$$typeof===d||t.$$typeof===l||t.$$typeof===g||t.$$typeof===w||t.getModuleId!==void 0))}function X(t,p,S){var E=t.displayName;if(E)return E;var H=p.displayName||p.name||"";return H!==""?S+"("+H+")":S}function ee(t){return t.displayName||"Context"}function Y(t){if(t==null)return null;if(typeof t.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case o:return"Fragment";case i:return"Portal";case m:return"Profiler";case s:return"StrictMode";case v:return"Suspense";case c:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case l:var p=t;return ee(p)+".Consumer";case d:var S=t;return ee(S._context)+".Provider";case g:return X(t,t.render,"ForwardRef");case y:var E=t.displayName||null;return E!==null?E:Y(t.type)||"Memo";case D:{var H=t,J=H._payload,R=H._init;try{return Y(R(J))}catch{return null}}}return null}var se=Object.assign,le=0,xe,fe,q,M,F,$,P;function K(){}K.__reactDisabledLog=!0;function ie(){{if(le===0){xe=console.log,fe=console.info,q=console.warn,M=console.error,F=console.group,$=console.groupCollapsed,P=console.groupEnd;var t={configurable:!0,enumerable:!0,value:K,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}le++}}function ce(){{if(le--,le===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},t,{value:xe}),info:se({},t,{value:fe}),warn:se({},t,{value:q}),error:se({},t,{value:M}),group:se({},t,{value:F}),groupCollapsed:se({},t,{value:$}),groupEnd:se({},t,{value:P})})}le<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Te=h.ReactCurrentDispatcher,Se;function we(t,p,S){{if(Se===void 0)try{throw Error()}catch(H){var E=H.stack.trim().match(/\n( *(at )?)/);Se=E&&E[1]||""}return`
2
- `+Se+t}}var De=!1,Me;{var Ie=typeof WeakMap=="function"?WeakMap:Map;Me=new Ie}function Ne(t,p){if(!t||De)return"";{var S=Me.get(t);if(S!==void 0)return S}var E;De=!0;var H=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var J;J=Te.current,Te.current=null,ie();try{if(p){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(je){E=je}Reflect.construct(t,[],R)}else{try{R.call()}catch(je){E=je}t.call(R.prototype)}}else{try{throw Error()}catch(je){E=je}t()}}catch(je){if(je&&E&&typeof je.stack=="string"){for(var _=je.stack.split(`
3
- `),ye=E.stack.split(`
4
- `),Q=_.length-1,ne=ye.length-1;Q>=1&&ne>=0&&_[Q]!==ye[ne];)ne--;for(;Q>=1&&ne>=0;Q--,ne--)if(_[Q]!==ye[ne]){if(Q!==1||ne!==1)do if(Q--,ne--,ne<0||_[Q]!==ye[ne]){var be=`
5
- `+_[Q].replace(" at new "," at ");return t.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",t.displayName)),typeof t=="function"&&Me.set(t,be),be}while(Q>=1&&ne>=0);break}}}finally{De=!1,Te.current=J,ce(),Error.prepareStackTrace=H}var Be=t?t.displayName||t.name:"",$e=Be?we(Be):"";return typeof t=="function"&&Me.set(t,$e),$e}function ut(t,p,S){return Ne(t,!1)}function _e(t){var p=t.prototype;return!!(p&&p.isReactComponent)}function Oe(t,p,S){if(t==null)return"";if(typeof t=="function")return Ne(t,_e(t));if(typeof t=="string")return we(t);switch(t){case v:return we("Suspense");case c:return we("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case g:return ut(t.render);case y:return Oe(t.type,p,S);case D:{var E=t,H=E._payload,J=E._init;try{return Oe(J(H),p,S)}catch{}}}return""}var he=Object.prototype.hasOwnProperty,tt={},ft=h.ReactDebugCurrentFrame;function Le(t){if(t){var p=t._owner,S=Oe(t.type,t._source,p?p.type:null);ft.setExtraStackFrame(S)}else ft.setExtraStackFrame(null)}function ht(t,p,S,E,H){{var J=Function.call.bind(he);for(var R in t)if(J(t,R)){var _=void 0;try{if(typeof t[R]!="function"){var ye=Error((E||"React class")+": "+S+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ye.name="Invariant Violation",ye}_=t[R](p,R,E,S,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Q){_=Q}_&&!(_ instanceof Error)&&(Le(H),x("%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).",E||"React class",S,R,typeof _),Le(null)),_ instanceof Error&&!(_.message in tt)&&(tt[_.message]=!0,Le(H),x("Failed %s type: %s",S,_.message),Le(null))}}}var pt=Array.isArray;function Ve(t){return pt(t)}function Je(t){{var p=typeof Symbol=="function"&&Symbol.toStringTag,S=p&&t[Symbol.toStringTag]||t.constructor.name||"Object";return S}}function gt(t){try{return nt(t),!1}catch{return!0}}function nt(t){return""+t}function rt(t){if(gt(t))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(t)),nt(t)}var Ge=h.ReactCurrentOwner,mt={key:!0,ref:!0,__self:!0,__source:!0},Re,qe;function st(t){if(he.call(t,"ref")){var p=Object.getOwnPropertyDescriptor(t,"ref").get;if(p&&p.isReactWarning)return!1}return t.ref!==void 0}function yt(t){if(he.call(t,"key")){var p=Object.getOwnPropertyDescriptor(t,"key").get;if(p&&p.isReactWarning)return!1}return t.key!==void 0}function xt(t,p){typeof t.ref=="string"&&Ge.current}function j(t,p){{var S=function(){Re||(Re=!0,x("%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)",p))};S.isReactWarning=!0,Object.defineProperty(t,"key",{get:S,configurable:!0})}}function C(t,p){{var S=function(){qe||(qe=!0,x("%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)",p))};S.isReactWarning=!0,Object.defineProperty(t,"ref",{get:S,configurable:!0})}}var B=function(t,p,S,E,H,J,R){var _={$$typeof:r,type:t,key:p,ref:S,props:R,_owner:J};return _._store={},Object.defineProperty(_._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(_,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(_,"_source",{configurable:!1,enumerable:!1,writable:!1,value:H}),Object.freeze&&(Object.freeze(_.props),Object.freeze(_)),_};function Z(t,p,S,E,H){{var J,R={},_=null,ye=null;S!==void 0&&(rt(S),_=""+S),yt(p)&&(rt(p.key),_=""+p.key),st(p)&&(ye=p.ref,xt(p,H));for(J in p)he.call(p,J)&&!mt.hasOwnProperty(J)&&(R[J]=p[J]);if(t&&t.defaultProps){var Q=t.defaultProps;for(J in Q)R[J]===void 0&&(R[J]=Q[J])}if(_||ye){var ne=typeof t=="function"?t.displayName||t.name||"Unknown":t;_&&j(R,ne),ye&&C(R,ne)}return B(t,_,ye,H,E,Ge.current,R)}}var ae=h.ReactCurrentOwner,V=h.ReactDebugCurrentFrame;function te(t){if(t){var p=t._owner,S=Oe(t.type,t._source,p?p.type:null);V.setExtraStackFrame(S)}else V.setExtraStackFrame(null)}var G;G=!1;function oe(t){return typeof t=="object"&&t!==null&&t.$$typeof===r}function Ee(){{if(ae.current){var t=Y(ae.current.type);if(t)return`
1
+ (function(_,j){typeof exports=="object"&&typeof module<"u"?j(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"],j):(_=typeof globalThis<"u"?globalThis:_||self,j(_.IrisGantt={},_.React,_.antd,_.ReactFontawesome,_.FontAwesomeSolid,_.dayjs))})(this,(function(_,j,l,J,Y,Lt){"use strict";var rt={exports:{}},Xe={};var Et;function Gt(){if(Et)return Xe;Et=1;var n=j,a=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,t=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g={key:!0,ref:!0,__self:!0,__source:!0};function y(i,c,v){var h,b={},k=null,x=null;v!==void 0&&(k=""+v),c.key!==void 0&&(k=""+c.key),c.ref!==void 0&&(x=c.ref);for(h in c)o.call(c,h)&&!g.hasOwnProperty(h)&&(b[h]=c[h]);if(i&&i.defaultProps)for(h in c=i.defaultProps,c)b[h]===void 0&&(b[h]=c[h]);return{$$typeof:a,type:i,key:k,ref:x,props:b,_owner:t.current}}return Xe.Fragment=s,Xe.jsx=y,Xe.jsxs=y,Xe}var Ke={};var Ft;function Xt(){return Ft||(Ft=1,process.env.NODE_ENV!=="production"&&(function(){var n=j,a=Symbol.for("react.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),t=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),p=Symbol.iterator,u="@@iterator";function P(r){if(r===null||typeof r!="object")return null;var m=p&&r[p]||r[u];return typeof m=="function"?m:null}var L=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(r){{for(var m=arguments.length,D=new Array(m>1?m-1:0),F=1;F<m;F++)D[F-1]=arguments[F];M("error",r,D)}}function M(r,m,D){{var F=L.ReactDebugCurrentFrame,W=F.getStackAddendum();W!==""&&(m+="%s",D=D.concat([W]));var z=D.map(function(B){return String(B)});z.unshift("Warning: "+m),Function.prototype.apply.call(console[r],console,z)}}var A=!1,R=!1,O=!1,re=!1,ye=!1,w;w=Symbol.for("react.module.reference");function H(r){return!!(typeof r=="string"||typeof r=="function"||r===o||r===g||ye||r===t||r===v||r===h||re||r===x||A||R||O||typeof r=="object"&&r!==null&&(r.$$typeof===k||r.$$typeof===b||r.$$typeof===y||r.$$typeof===i||r.$$typeof===c||r.$$typeof===w||r.getModuleId!==void 0))}function Q(r,m,D){var F=r.displayName;if(F)return F;var W=m.displayName||m.name||"";return W!==""?D+"("+W+")":D}function ne(r){return r.displayName||"Context"}function U(r){if(r==null)return null;if(typeof r.tag=="number"&&f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case o:return"Fragment";case s:return"Portal";case g:return"Profiler";case t:return"StrictMode";case v:return"Suspense";case h:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case i:var m=r;return ne(m)+".Consumer";case y:var D=r;return ne(D._context)+".Provider";case c:return Q(r,r.render,"ForwardRef");case b:var F=r.displayName||null;return F!==null?F:U(r.type)||"Memo";case k:{var W=r,z=W._payload,B=W._init;try{return U(B(z))}catch{return null}}}return null}var V=Object.assign,ce=0,de,me,Se,oe,Te,Ce,ke;function Me(){}Me.__reactDisabledLog=!0;function S(){{if(ce===0){de=console.log,me=console.info,Se=console.warn,oe=console.error,Te=console.group,Ce=console.groupCollapsed,ke=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Me,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}ce++}}function E(){{if(ce--,ce===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},r,{value:de}),info:V({},r,{value:me}),warn:V({},r,{value:Se}),error:V({},r,{value:oe}),group:V({},r,{value:Te}),groupCollapsed:V({},r,{value:Ce}),groupEnd:V({},r,{value:ke})})}ce<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var N=L.ReactCurrentDispatcher,$;function K(r,m,D){{if($===void 0)try{throw Error()}catch(W){var F=W.stack.trim().match(/\n( *(at )?)/);$=F&&F[1]||""}return`
2
+ `+$+r}}var X=!1,ee;{var se=typeof WeakMap=="function"?WeakMap:Map;ee=new se}function ge(r,m){if(!r||X)return"";{var D=ee.get(r);if(D!==void 0)return D}var F;X=!0;var W=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var z;z=N.current,N.current=null,S();try{if(m){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(je){F=je}Reflect.construct(r,[],B)}else{try{B.call()}catch(je){F=je}r.call(B.prototype)}}else{try{throw Error()}catch(je){F=je}r()}}catch(je){if(je&&F&&typeof je.stack=="string"){for(var I=je.stack.split(`
3
+ `),xe=F.stack.split(`
4
+ `),te=I.length-1,ae=xe.length-1;te>=1&&ae>=0&&I[te]!==xe[ae];)ae--;for(;te>=1&&ae>=0;te--,ae--)if(I[te]!==xe[ae]){if(te!==1||ae!==1)do if(te--,ae--,ae<0||I[te]!==xe[ae]){var ve=`
5
+ `+I[te].replace(" at new "," at ");return r.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",r.displayName)),typeof r=="function"&&ee.set(r,ve),ve}while(te>=1&&ae>=0);break}}}finally{X=!1,N.current=z,E(),Error.prepareStackTrace=W}var Ge=r?r.displayName||r.name:"",ze=Ge?K(Ge):"";return typeof r=="function"&&ee.set(r,ze),ze}function Ae(r,m,D){return ge(r,!1)}function Ye(r){var m=r.prototype;return!!(m&&m.isReactComponent)}function $e(r,m,D){if(r==null)return"";if(typeof r=="function")return ge(r,Ye(r));if(typeof r=="string")return K(r);switch(r){case v:return K("Suspense");case h:return K("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case c:return Ae(r.render);case b:return $e(r.type,m,D);case k:{var F=r,W=F._payload,z=F._init;try{return $e(z(W),m,D)}catch{}}}return""}var Le=Object.prototype.hasOwnProperty,Ue={},Qe=L.ReactDebugCurrentFrame;function Re(r){if(r){var m=r._owner,D=$e(r.type,r._source,m?m.type:null);Qe.setExtraStackFrame(D)}else Qe.setExtraStackFrame(null)}function wt(r,m,D,F,W){{var z=Function.call.bind(Le);for(var B in r)if(z(r,B)){var I=void 0;try{if(typeof r[B]!="function"){var xe=Error((F||"React class")+": "+D+" type `"+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[B]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw xe.name="Invariant Violation",xe}I=r[B](m,B,F,D,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(te){I=te}I&&!(I instanceof Error)&&(Re(W),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).",F||"React class",D,B,typeof I),Re(null)),I instanceof Error&&!(I.message in Ue)&&(Ue[I.message]=!0,Re(W),f("Failed %s type: %s",D,I.message),Re(null))}}}var at=Array.isArray;function Oe(r){return at(r)}function jt(r){{var m=typeof Symbol=="function"&&Symbol.toStringTag,D=m&&r[Symbol.toStringTag]||r.constructor.name||"Object";return D}}function Ie(r){try{return De(r),!1}catch{return!0}}function De(r){return""+r}function we(r){if(Ie(r))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jt(r)),De(r)}var ot=L.ReactCurrentOwner,Jt={key:!0,ref:!0,__self:!0,__source:!0},it,lt;function bt(r){if(Le.call(r,"ref")){var m=Object.getOwnPropertyDescriptor(r,"ref").get;if(m&&m.isReactWarning)return!1}return r.ref!==void 0}function vt(r){if(Le.call(r,"key")){var m=Object.getOwnPropertyDescriptor(r,"key").get;if(m&&m.isReactWarning)return!1}return r.key!==void 0}function et(r,m){typeof r.ref=="string"&&ot.current}function St(r,m){{var D=function(){it||(it=!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)",m))};D.isReactWarning=!0,Object.defineProperty(r,"key",{get:D,configurable:!0})}}function Tt(r,m){{var D=function(){lt||(lt=!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)",m))};D.isReactWarning=!0,Object.defineProperty(r,"ref",{get:D,configurable:!0})}}var tt=function(r,m,D,F,W,z,B){var I={$$typeof:a,type:r,key:m,ref:D,props:B,_owner:z};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:F}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:W}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function Dt(r,m,D,F,W){{var z,B={},I=null,xe=null;D!==void 0&&(we(D),I=""+D),vt(m)&&(we(m.key),I=""+m.key),bt(m)&&(xe=m.ref,et(m,W));for(z in m)Le.call(m,z)&&!Jt.hasOwnProperty(z)&&(B[z]=m[z]);if(r&&r.defaultProps){var te=r.defaultProps;for(z in te)B[z]===void 0&&(B[z]=te[z])}if(I||xe){var ae=typeof r=="function"?r.displayName||r.name||"Unknown":r;I&&St(B,ae),xe&&Tt(B,ae)}return tt(r,I,xe,W,F,ot.current,B)}}var Ve=L.ReactCurrentOwner,ct=L.ReactDebugCurrentFrame;function Ee(r){if(r){var m=r._owner,D=$e(r.type,r._source,m?m.type:null);ct.setExtraStackFrame(D)}else ct.setExtraStackFrame(null)}var qe;qe=!1;function Je(r){return typeof r=="object"&&r!==null&&r.$$typeof===a}function dt(){{if(Ve.current){var r=U(Ve.current.type);if(r)return`
6
6
 
7
- Check the render method of \``+t+"`."}return""}}function de(t){return""}var me={};function Xe(t){{var p=Ee();if(!p){var S=typeof t=="string"?t:t.displayName||t.name;S&&(p=`
7
+ Check the render method of \``+r+"`."}return""}}function kt(r){return""}var ut={};function d(r){{var m=dt();if(!m){var D=typeof r=="string"?r:r.displayName||r.name;D&&(m=`
8
8
 
9
- Check the top-level render call using <`+S+">.")}return p}}function Ke(t,p){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var S=Xe(p);if(me[S])return;me[S]=!0;var E="";t&&t._owner&&t._owner!==ae.current&&(E=" It was passed a child from "+Y(t._owner.type)+"."),te(t),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',S,E),te(null)}}function ke(t,p){{if(typeof t!="object")return;if(Ve(t))for(var S=0;S<t.length;S++){var E=t[S];oe(E)&&Ke(E,p)}else if(oe(t))t._store&&(t._store.validated=!0);else if(t){var H=k(t);if(typeof H=="function"&&H!==t.entries)for(var J=H.call(t),R;!(R=J.next()).done;)oe(R.value)&&Ke(R.value,p)}}}function zt(t){{var p=t.type;if(p==null||typeof p=="string")return;var S;if(typeof p=="function")S=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===g||p.$$typeof===y))S=p.propTypes;else return;if(S){var E=Y(p);ht(S,t.props,"prop",E,t)}else if(p.PropTypes!==void 0&&!G){G=!0;var H=Y(p);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",H||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ye(t){{for(var p=Object.keys(t.props),S=0;S<p.length;S++){var E=p[S];if(E!=="children"&&E!=="key"){te(t),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),te(null);break}}t.ref!==null&&(te(t),x("Invalid attribute `ref` supplied to `React.Fragment`."),te(null))}}var Ht={};function Wt(t,p,S,E,H,J){{var R=U(t);if(!R){var _="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).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 ye=de();ye?_+=ye:_+=Ee();var Q;t===null?Q="null":Ve(t)?Q="array":t!==void 0&&t.$$typeof===r?(Q="<"+(Y(t.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):Q=typeof t,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Q,_)}var ne=Z(t,p,S,H,J);if(ne==null)return ne;if(R){var be=p.children;if(be!==void 0)if(E)if(Ve(be)){for(var Be=0;Be<be.length;Be++)ke(be[Be],t);Object.freeze&&Object.freeze(be)}else x("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 ke(be,t)}if(he.call(p,"key")){var $e=Y(t),je=Object.keys(p).filter(function(Tn){return Tn!=="key"}),wt=je.length>0?"{key: someKey, "+je.join(": ..., ")+": ...}":"{key: someKey}";if(!Ht[$e+wt]){var Sn=je.length>0?"{"+je.join(": ..., ")+": ...}":"{}";x(`A props object containing a "key" prop is being spread into JSX:
9
+ Check the top-level render call using <`+D+">.")}return m}}function T(r,m){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var D=d(m);if(ut[D])return;ut[D]=!0;var F="";r&&r._owner&&r._owner!==Ve.current&&(F=" It was passed a child from "+U(r._owner.type)+"."),Ee(r),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',D,F),Ee(null)}}function C(r,m){{if(typeof r!="object")return;if(Oe(r))for(var D=0;D<r.length;D++){var F=r[D];Je(F)&&T(F,m)}else if(Je(r))r._store&&(r._store.validated=!0);else if(r){var W=P(r);if(typeof W=="function"&&W!==r.entries)for(var z=W.call(r),B;!(B=z.next()).done;)Je(B.value)&&T(B.value,m)}}}function G(r){{var m=r.type;if(m==null||typeof m=="string")return;var D;if(typeof m=="function")D=m.propTypes;else if(typeof m=="object"&&(m.$$typeof===c||m.$$typeof===b))D=m.propTypes;else return;if(D){var F=U(m);wt(D,r.props,"prop",F,r)}else if(m.PropTypes!==void 0&&!qe){qe=!0;var W=U(m);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",W||"Unknown")}typeof m.getDefaultProps=="function"&&!m.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ue(r){{for(var m=Object.keys(r.props),D=0;D<m.length;D++){var F=m[D];if(F!=="children"&&F!=="key"){Ee(r),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",F),Ee(null);break}}r.ref!==null&&(Ee(r),f("Invalid attribute `ref` supplied to `React.Fragment`."),Ee(null))}}var q={};function he(r,m,D,F,W,z){{var B=H(r);if(!B){var I="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).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 xe=kt();xe?I+=xe:I+=dt();var te;r===null?te="null":Oe(r)?te="array":r!==void 0&&r.$$typeof===a?(te="<"+(U(r.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):te=typeof r,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",te,I)}var ae=Dt(r,m,D,W,z);if(ae==null)return ae;if(B){var ve=m.children;if(ve!==void 0)if(F)if(Oe(ve)){for(var Ge=0;Ge<ve.length;Ge++)C(ve[Ge],r);Object.freeze&&Object.freeze(ve)}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 C(ve,r)}if(Le.call(m,"key")){var ze=U(r),je=Object.keys(m).filter(function(Dr){return Dr!=="key"}),Mt=je.length>0?"{key: someKey, "+je.join(": ..., ")+": ...}":"{key: someKey}";if(!q[ze+Mt]){var Tr=je.length>0?"{"+je.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} />`,wt,$e,Sn,$e),Ht[$e+wt]=!0}}return t===o?Ye(ne):zt(ne),ne}}function wn(t,p,S){return Wt(t,p,S,!0)}function jn(t,p,S){return Wt(t,p,S,!1)}var vn=jn,bn=wn;He.Fragment=o,He.jsx=vn,He.jsxs=bn})()),He}var St;function Jt(){return St||(St=1,process.env.NODE_ENV==="production"?Ze.exports=Ut():Ze.exports=Vt()),Ze.exports}var e=Jt();const ue=(n,r,i)=>{const o=new Date(n);switch(i){case"hour":o.setHours(o.getHours()+r);break;case"day":o.setDate(o.getDate()+r);break;case"week":o.setDate(o.getDate()+r*7);break;case"month":o.setMonth(o.getMonth()+r);break;case"quarter":o.setMonth(o.getMonth()+r*3);break;case"year":o.setFullYear(o.getFullYear()+r);break}return o},We=(n,r)=>{const i=r.getTime()-n.getTime();return Math.ceil(i/(1e3*60*60*24))},Tt=(n,r)=>{const i=r.getTime()-n.getTime();return Math.ceil(i/(1e3*60*60))},pe=(n,r)=>{const i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m={YYYY:n.getFullYear().toString(),YY:n.getFullYear().toString().slice(-2),MMMM:o[n.getMonth()],MMM:i[n.getMonth()],MM:String(n.getMonth()+1).padStart(2,"0"),M:String(n.getMonth()+1),DD:String(n.getDate()).padStart(2,"0"),D:String(n.getDate()),dddd:s[n.getDay()],HH:String(n.getHours()).padStart(2,"0"),H:String(n.getHours()),mm:String(n.getMinutes()).padStart(2,"0"),m:String(n.getMinutes())};return r.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g,d=>m[d])},it=n=>{const r=n.getDay();return r===0||r===6},at=(n,r)=>r.some(i=>i.getFullYear()===n.getFullYear()&&i.getMonth()===n.getMonth()&&i.getDate()===n.getDate()),Ue=n=>{const r=new Date(n);return r.setHours(0,0,0,0),r},Gt=n=>{const r=new Date(n);return r.setHours(23,59,59,999),r},qt=(n,r,i="day")=>{switch(i){case"hour":return Tt(n,r);case"day":return We(n,r);case"week":return Math.ceil(We(n,r)/7);case"month":return(r.getFullYear()-n.getFullYear())*12+(r.getMonth()-n.getMonth());default:return We(n,r)}};function Xt(n){if(!n||typeof n!="string")return null;const r=n.trim(),i=/^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,o=r.match(i);if(!o)return null;const s=parseInt(o[1],10),m=o[2].toUpperCase();let d=0,l="day";if(o[3]){const g=o[4]==="-"?-1:1;switch(d=parseInt(o[5],10)*g,o[6].toLowerCase()){case"d":l="day";break;case"h":l="hour";break;case"w":l="week";break;case"m":l="month";break}}return{taskNumber:s,type:m,lag:d,lagUnit:l}}function ot(n,r){switch(r){case"hour":return n/24;case"day":return n;case"week":return n*7;case"month":return n*30;default:return n}}function Kt(n,r){const o={e2s:"FS",s2s:"SS",e2e:"FF",s2e:"SF"}[n.type];let s=`${r}${o}`;if(n.lag&&n.lag!==0){const m=n.lag>0?"+":"",l=(n.lagUnit||"day").charAt(0);let g=n.lag;if(n.lagUnit&&n.lagUnit!=="day")switch(n.lagUnit){case"hour":g=n.lag*24;break;case"week":g=n.lag/7;break;case"month":g=n.lag/30;break}s+=`${m}${Math.round(g)}${l}`}return s}function Zt(n){return{FS:"e2s",SS:"s2s",FF:"e2e",SF:"s2e"}[n]}const{Text:Ce,Paragraph:Qt,Link:en}=a.Typography,{Option:Dt}=a.Select,tn=({task:n,allTasks:r,onAddDependency:i,children:o})=>{const[s,m]=T.useState(!1),[d,l]=T.useState(""),[g,v]=T.useState(null),[c,y]=T.useState("e2s"),[D,u]=T.useState("lag"),[f,b]=T.useState(0),[k,h]=T.useState(!0),x="day",A=T.useMemo(()=>{if(!d)return r.filter(U=>U.id!==n.id);const w=d.toLowerCase();return r.filter(U=>U.id!==n.id&&(U.text.toLowerCase().includes(w)||(r.indexOf(U)+1).toString().includes(w)))},[r,d,n.id]),I=()=>{if(g){const w=D==="lag"?f:-f,U=ot(w,x);i(g,n.id,c,U),m(!1),z()}},z=()=>{l(""),v(null),y("e2s"),u("lag"),b(0)},W=()=>{if(!k)return null;const w=c==="e2s",U=c==="s2s",X=c==="e2e",ee=c==="s2e";let Y=0,se=0,le="",xe=0,fe=-1;return w?(Y=20,se=160,xe=140,fe=160,le="M 140 40 L 150 40 C 160 40, 160 90, 150 90 L 160 90"):X?(Y=60,se=60,xe=180,fe=-1,le="M 180 40 L 200 40 L 200 90 L 180 90"):U?(Y=100,se=100,xe=100,fe=-1,le="M 100 40 L 80 40 L 80 90 L 100 90"):ee&&(Y=160,se=20,xe=160,fe=140,le="M 160 40 L 150 40 C 140 40, 140 90, 150 90 L 140 90"),e.jsx("div",{style:{width:"100%",height:120,backgroundColor:"#fff",borderRadius:4,marginBottom:10,border:"1px solid #e9ecef",position:"relative",overflow:"hidden"},children:e.jsxs("svg",{viewBox:"0 0 300 120",style:{width:"100%",height:"100%"},children:[e.jsx("line",{x1:xe,x2:xe,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),fe!==-1&&e.jsx("line",{x1:fe,x2:fe,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),e.jsx("rect",{x:Y,y:"28",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:Y+60,y:"44",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 2"}),e.jsx("rect",{x:se,y:"78",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:se+60,y:"94",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 3"}),e.jsx("path",{d:le,fill:"none",stroke:"#8c8c8c",strokeWidth:"1.5",markerEnd:"url(#arrowhead)"}),e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#8c8c8c"})})})]})})},re=()=>{const w=r.find(Y=>Y.id===g);if(!w)return"Select a task from the list to see how it will relate to the current task.";const U=r.indexOf(n)+1,X=r.indexOf(w)+1;let ee="";switch(c){case"e2s":ee=`Task ${U} starts after Task ${X} finishes`;break;case"s2s":ee=`Task ${U} starts when Task ${X} starts`;break;case"e2e":ee=`Task ${U} finishes when Task ${X} finishes`;break;case"s2e":ee=`Task ${U} finishes when Task ${X} starts`;break}if(f>0){const Y=`${f} ${x}${f>1?"s":""}`;D==="lag"?ee+=` + ${Y} delay`:ee+=` - ${Y} overlap`}return ee+"."},ge=e.jsxs("div",{style:{display:"flex",width:620,height:480,backgroundColor:"#fff",borderRadius:"8px",overflow:"hidden"},children:[e.jsxs("div",{style:{flex:1,borderRight:"1px solid #f0f0f0",display:"flex",flexDirection:"column",padding:0},children:[e.jsx("div",{style:{padding:"12px"},children:e.jsx(a.Input,{placeholder:"Search task...",value:d,onChange:w=>l(w.target.value),style:{marginBottom:8},autoFocus:!0,size:"large"})}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:e.jsx(a.List,{size:"small",dataSource:A,renderItem:w=>e.jsxs(a.List.Item,{className:`task-list-item ${g===w.id?"selected":""}`,onClick:()=>v(w.id),style:{cursor:"pointer",padding:"8px 16px",backgroundColor:g===w.id?"#f0f7ff":"transparent",display:"flex",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsx(Ce,{type:"secondary",style:{width:20},children:r.indexOf(w)+1}),e.jsx(Ce,{children:w.text})]}),e.jsx(L.FontAwesomeIcon,{icon:O.faChevronRight,style:{fontSize:10,color:"#bfbfbf"}})]})})})]}),e.jsxs("div",{style:{width:340,padding:"24px",display:"flex",flexDirection:"column",borderLeft:"1px solid #f0f0f0"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:15},children:[e.jsx(Ce,{strong:!0,children:"Dependency type"}),e.jsx(en,{style:{fontSize:"12px"},onClick:()=>h(!k),children:k?"Hide preview":"Show preview"})]}),W(),e.jsx(Qt,{style:{fontSize:"13px",color:"#262626",marginBottom:20,minHeight:48,lineHeight:"1.6"},children:re()}),e.jsx(a.Radio.Group,{value:c,onChange:w=>y(w.target.value),style:{width:"100%",marginBottom:20},children:e.jsxs(a.Space,{direction:"vertical",style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(a.Radio,{value:"e2s",children:"Finish to Start"}),e.jsx(Ce,{type:"secondary",children:"FS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(a.Radio,{value:"e2e",children:"Finish to Finish"}),e.jsx(Ce,{type:"secondary",children:"FF"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(a.Radio,{value:"s2s",children:"Start to Start"}),e.jsx(Ce,{type:"secondary",children:"SS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(a.Radio,{value:"s2e",children:"Start to Finish"}),e.jsx(Ce,{type:"secondary",children:"SF"})]})]})}),e.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:20},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(Ce,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Delay type"}),e.jsxs(a.Select,{value:D,onChange:w=>u(w),style:{width:"100%"},size:"large",children:[e.jsx(Dt,{value:"lag",children:"Lag by"}),e.jsx(Dt,{value:"lead",children:"Lead by"})]})]}),e.jsxs("div",{style:{width:100},children:[e.jsx(Ce,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Days"}),e.jsx(a.Space.Compact,{style:{width:"100%"},children:e.jsx(a.InputNumber,{min:0,value:f,onChange:w=>b(w||0),style:{width:"100%"},placeholder:"0",size:"large"})})]})]}),e.jsx(a.Button,{type:"primary",block:!0,onClick:I,disabled:!g,style:{marginTop:"auto",backgroundColor:"#5c67f2",height:44,borderRadius:"6px"},children:"Add"})]})]});return e.jsx(a.Popover,{content:ge,trigger:"click",open:s,onOpenChange:m,placement:"bottomLeft",overlayClassName:"dependency-popover",overlayInnerStyle:{padding:0},children:o})},lt=T.forwardRef(({tasks:n,allTasks:r=[],columns:i,selectedTask:o,onTaskClick:s,onTaskContextMenu:m,onTaskUpdate:d,onTaskDragStart:l,onAddTask:g,onAddDependency:v,links:c=[],dropIndicator:y,reorderTask:D},u)=>{const f=T.useRef(null);T.useImperativeHandle(u,()=>f.current);const b=(h,x=0)=>{if(!h.parent)return x;const A=n.find(I=>I.id===h.parent);return A?b(A,x+1):x},k=(h,x)=>{if(x.template)return x.template(h);switch(x.name){case"text":const A=b(h);return e.jsxs("div",{className:"gantt-grid-cell-text",style:{paddingLeft:A*14},children:[e.jsx("div",{className:"gantt-row-drag-handle",onMouseDown:z=>{z.preventDefault(),l?.(h.id,z.clientX,z.clientY,"reorder")},children:e.jsx(L.FontAwesomeIcon,{icon:O.faGripVertical})}),h.type==="project"?e.jsx("span",{className:"gantt-tree-icon",onClick:z=>{z.stopPropagation(),d?.({...h,open:!h.open})},children:e.jsx(L.FontAwesomeIcon,{icon:h.open?O.faChevronDown:O.faChevronRight})}):e.jsx("span",{style:{width:16,display:"inline-block"}}),e.jsx("span",{className:"gantt-task-name-text",children:h.text})]});case"start":return pe(h.start,"DD-MM-YYYY");case"end":return pe(h.end,"DD-MM-YYYY");case"duration":return e.jsxs("div",{style:{backgroundColor:"#f6e7db",padding:"4px 12px",borderRadius:"4px",fontWeight:600,color:"#434343",display:"inline-block",minWidth:"70px",textAlign:"center"},children:[h.duration," day",h.duration!==1?"s":""]});case"predecessors":const I=c.filter(z=>z.target===h.id);return e.jsx(tn,{task:h,allTasks:r,links:c,onAddDependency:(z,W,re,ge)=>v?.(z,W,re,ge),children:e.jsx("div",{style:{cursor:"pointer",minHeight:"24px",width:"100%",display:"flex",alignItems:"center",gap:"4px"},children:I.map(z=>{const W=r.find(ge=>ge.id===z.source),re=W?r.indexOf(W)+1:0;return e.jsx("span",{style:{fontSize:"11px",backgroundColor:"#e6f7ff",border:"1px solid #91d5ff",color:"#0050b3",padding:"1px 6px",borderRadius:"4px",whiteSpace:"nowrap"},children:Kt(z,re)},z.id)})})});case"add":return e.jsx(a.Button,{type:"text",size:"small",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faPlus,style:{fontSize:12,color:"#adb5bd"}}),onClick:z=>{z.stopPropagation(),g?.(h.id)}});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:`${h.progress}%`}})}),e.jsxs("span",{className:"gantt-progress-text",children:[h.progress,"%"]})]});case"index":return e.jsx("span",{style:{color:"#8c8c8c"},children:r.indexOf(h)+1});default:return h[x.name]||""}};return e.jsxs("div",{className:"gantt-grid",ref:f,children:[e.jsx("div",{className:"gantt-grid-header",children:i.map(h=>e.jsx("div",{className:"gantt-grid-header-cell",style:{width:h.width,justifyContent:h.align==="center"?"center":"flex-start"},children:h.name==="add"?e.jsx(L.FontAwesomeIcon,{icon:O.faPlus,style:{fontSize:12,color:"#64748b",cursor:"pointer"},onClick:()=>g?.()}):e.jsxs(e.Fragment,{children:[h.label,h.name==="start"&&e.jsx(L.FontAwesomeIcon,{icon:O.faChevronDown,style:{marginLeft:8,fontSize:10,color:"#64748b"}})]})},h.name))}),e.jsx("div",{className:"gantt-grid-body",children:n.map(h=>{const x=D?.id===h.id,A=D?.descendantIds.includes(h.id);return e.jsxs("div",{className:`gantt-grid-row ${o===h.id?"selected":""} ${x?"dragging-row":""} ${A?"descendant-dragging-row":""} ${y?.taskId===h.id?`drop-target-${y.position}`:""}`,onClick:()=>s(h.id),onContextMenu:I=>m?.(I,h.id),children:[i.map(I=>e.jsx("div",{className:"gantt-grid-cell",style:{width:I.width,textAlign:I.align||"left"},children:k(h,I)},`${h.id}-${I.name}`)),y?.taskId===h.id&&e.jsx("div",{className:`gantt-drop-indicator ${y.position}`})]},h.id)})})]})});lt.displayName="Grid";const Mt=({task:n,position:r,selected:i,dragging:o,onClick:s,onDragStart:m,dragDeltaX:d=0,dragType:l=null,readonly:g=!1})=>{const v=(f,b)=>{g||(f.preventDefault(),f.stopPropagation(),m(f.clientX,f.clientY,b))},c=()=>{const f=["gantt-task-bar"];return n.type==="milestone"&&f.push("milestone"),n.type==="project"&&f.push("project"),i&&f.push("selected"),o&&f.push("dragging"),f.join(" ")},y=()=>{let f=r.left,b=r.width;return o&&l&&(l==="move"?f+=d:l==="resize-left"?(f+=d,b-=d):l==="resize-right"&&(b+=d)),{left:`${f}px`,width:`${Math.max(b,0)}px`,backgroundColor:n.color||void 0}},D=(f=!1)=>e.jsxs(e.Fragment,{children:[!g&&n.type!=="milestone"&&!f&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-left",onMouseDown:b=>v(b,"resize-left")}),!f&&n.type!=="milestone"&&e.jsx("div",{className:"gantt-task-progress",style:{width:`${n.progress}%`}}),e.jsx("div",{className:"gantt-task-content",children:!f&&n.type!=="milestone"&&e.jsx("span",{className:"gantt-task-text",children:n.text})}),n.type==="milestone"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-milestone-diamond"}),e.jsx("span",{className:"gantt-milestone-text",children:n.text})]}),!g&&n.type!=="milestone"&&!f&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-right",onMouseDown:b=>v(b,"resize-right")})]}),u=e.jsxs("div",{className:"gantt-tooltip",children:[e.jsx("div",{className:"gantt-tooltip-title",children:n.text}),e.jsxs("div",{className:"gantt-tooltip-dates",children:[pe(n.start,"MMM D")," - ",pe(n.end,"MMM D")]}),e.jsxs("div",{className:"gantt-tooltip-progress",children:["Progress: ",n.progress,"%"]}),n.owner&&e.jsxs("div",{className:"gantt-tooltip-owner",children:["Owner: ",n.owner]})]});return n.segments&&n.segments.length>0?e.jsx("div",{className:"gantt-task-group",children:n.segments.map((f,b)=>e.jsx(a.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c()+" segment",style:{left:`${r.left+(f.start.getTime()-n.start.getTime())/(n.end.getTime()-n.start.getTime())*r.width}px`,width:`${(f.end.getTime()-f.start.getTime())/(n.end.getTime()-n.start.getTime())*r.width}px`,backgroundColor:n.color||"#ADCFFE"},onClick:s,onMouseDown:k=>v(k,"move"),children:D(!0)})},b))}):e.jsx(a.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:c(),style:y(),onClick:s,onMouseDown:f=>v(f,"move"),children:D()})})},nn=({links:n,tasks:r,getTaskPosition:i})=>{const o=d=>r.find(l=>l.id===d),s=d=>{const l=o(d.source),g=o(d.target);if(!l||!g)return"";const v=i(l),c=i(g),y=v.top+v.height/2,D=c.top+c.height/2;let u=0,f=0;switch(d.type){case"e2s":u=v.left+v.width,f=c.left;break;case"s2s":u=v.left,f=c.left;break;case"e2e":u=v.left+v.width,f=c.left+c.width;break;case"s2e":u=v.left,f=c.left+c.width;break}const b=f-u,k=D-y,h=20;if(d.type==="e2s")if(b>=h){const x=u+b/2;return`M ${u},${y} L ${x},${y} L ${x},${D} L ${f},${D}`}else{const x=h/2,A=y+k/2;return`M ${u},${y} L ${u+x},${y} L ${u+x},${A} L ${f-x},${A} L ${f-x},${D} L ${f},${D}`}else if(d.type==="s2s"){const x=Math.min(u,f)-h/2;return`M ${u},${y} L ${x},${y} L ${x},${D} L ${f},${D}`}else if(d.type==="e2e"){const x=Math.max(u,f)+h/2;return`M ${u},${y} L ${x},${y} L ${x},${D} L ${f},${D}`}else if(d.type==="s2e")if(b<=-h){const x=u+b/2;return`M ${u},${y} L ${x},${y} L ${x},${D} L ${f},${D}`}else{const x=h/2,A=y+k/2;return`M ${u},${y} L ${u-x},${y} L ${u-x},${A} L ${f+x},${A} L ${f+x},${D} L ${f},${D}`}return""},m=d=>{const l=o(d.target);if(!l)return"";const g=i(l),v=g.top+g.height/2,c=8,y=6;let D=0,u=!0;return d.type==="e2s"||d.type==="s2s"?(D=g.left,u=!0):(D=g.left+g.width,u=!1),u?`M ${D},${v} L ${D-c},${v-y/2} L ${D-c},${v+y/2} Z`:`M ${D},${v} L ${D+c},${v-y/2} L ${D+c},${v+y/2} Z`};return e.jsx("svg",{className:"gantt-links-layer",style:{overflow:"visible"},children:n.map(d=>{const l=o(d.source),g=o(d.target);if(!l||!g)return null;const v=s(d),c=m(d);return e.jsxs("g",{className:"gantt-link",children:[e.jsx("path",{d:v,fill:"none",strokeWidth:"1.5",className:"gantt-link-line"}),e.jsx("path",{d:c,className:"gantt-link-arrow"})]},d.id)})})},rn=(n,r,i=60,o="day",s=1)=>{const[m,d]=T.useState({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0}),l=T.useCallback((c,y,D,u)=>{const f=n.find(b=>b.id===c);f&&d({taskId:c,initialX:y,initialY:D,initialStart:new Date(f.start),initialEnd:new Date(f.end),type:u,dragDeltaX:0,dragDeltaY:0})},[n]),g=T.useCallback((c,y)=>{if(!m.taskId||!m.type)return null;const D=c-m.initialX,u=y-m.initialY;if(d(A=>({...A,dragDeltaX:D,dragDeltaY:u})),m.type==="reorder")return null;const f=n.find(A=>A.id===m.taskId);if(!f)return null;const b=Math.round(D/i);let k=new Date(m.initialStart),h=new Date(m.initialEnd);switch(m.type){case"move":k=ue(m.initialStart,b*s,o),h=ue(m.initialEnd,b*s,o);break;case"resize-left":k=ue(m.initialStart,b*s,o),k>=h&&(k=ue(h,-s,o));break;case"resize-right":h=ue(m.initialEnd,b*s,o),h<=k&&(h=ue(k,s,o));break}const x=We(k,h);return{...f,start:k,end:h,duration:x}},[m,n,i]),v=T.useCallback(c=>{if(c&&r){const{id:y,...D}=c;r(y,D)}d({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0})},[r]);return{dragState:m,handleDragStart:l,handleDrag:g,handleDragEnd:v}},ct=T.forwardRef(({tasks:n,links:r,range:i,scales:o,config:s,selectedTask:m,onTaskClick:d,onTaskDragStart:l,onTaskDragEnd:g,onTaskUpdate:v,zoomLevel:c,baselines:y},D)=>{const[u,f]=T.useState(n),b=(s.columnWidth||60)*c,k=s.baselines&&y&&y.size>0,{dragState:h,handleDragStart:x,handleDrag:A,handleDragEnd:I}=rn(u,v,b,o[1].unit,o[1].step);T.useEffect(()=>{f(n)},[n]);const z=M=>{const F=[];let $=new Date(i.start);for(;$<=i.end;)F.push({date:new Date($),label:pe($,M.format||"D")}),$=ue($,M.step,M.unit);return F},W=M=>{const F=o[1],$=i.start.getTime(),K=M.getTime()-$,ce={hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6}[F.unit]||864e5;return K/(ce*F.step)*b},re=M=>{const F=W(M.start),$=W(M.end);return{left:F,width:Math.max($-F,0)}},ge=M=>{const F=W(M.start),$=W(M.end);return{left:F,width:Math.max($-F,0)}},w=M=>{const F=re(M),$=u.findIndex(ce=>ce.id===M.id),P=s.rowHeight||48,K=32,ie=(P-K)/2;return{left:F.left,width:F.width,top:$*P+ie,height:K}},U=T.useCallback(M=>{if(h.taskId&&h.type){const F=A(M.clientX,M.clientY);F&&f($=>$.map(P=>P.id===F.id?F:P))}},[h,A]),X=T.useCallback(()=>{if(h.taskId){const M=u.find(F=>F.id===h.taskId);I(M||null),g()}},[h,u,I,g]),ee=o[1],Y=z(ee),se=()=>{const M=[];let F=-1,$=-1,P=0,K="";return Y.forEach(ie=>{const ce=ie.date.getMonth(),Te=ie.date.getFullYear(),Se=pe(ie.date,"MMM YYYY");ce!==F||Te!==$?(F!==-1&&M.push({label:K,width:P}),F=ce,$=Te,P=b,K=Se):P+=b}),F!==-1&&M.push({label:K,width:P}),M},le=()=>{const M=[];let F=-1,$=0,P=-1,K=-1,ie="";return Y.forEach(ce=>{const Se=ce.date.getDate()<=15?0:1,we=ce.date.getMonth(),De=ce.date.getFullYear(),Me=pe(ce.date,"MMM"),Ie=new Date(De,we+1,0).getDate(),Ne=Se===0?`${Me} 1 - 15`:`${Me} 16 - ${Ie}`;Se!==F||we!==P||De!==K?(F!==-1&&M.push({label:ie,width:$}),F=Se,P=we,K=De,$=b,ie=Ne):$+=b}),F!==-1&&M.push({label:ie,width:$}),M},xe=se(),fe=le(),q=Y.length*b;return e.jsxs("div",{className:"gantt-timeline-container",ref:D,onMouseMove:U,onMouseUp:X,style:{width:q},children:[e.jsxs("div",{className:"gantt-timeline-header",style:{width:q,minWidth:q},children:[e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-month",style:{width:q},children:xe.map((M,F)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:M.width,minWidth:M.width,maxWidth:M.width,borderRight:F===xe.length-1?"none":"var(--wx-gantt-border)"},children:M.label},`top-${F}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-range",style:{width:q},children:fe.map((M,F)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:M.width,minWidth:M.width,maxWidth:M.width,borderRight:F===fe.length-1?"none":"var(--wx-gantt-border)"},children:M.label},`mid-${F}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-day",style:{width:q},children:Y.map((M,F)=>{const $=s.weekends&&it(M.date),P=s.holidays&&at(M.date,s.holidays);return e.jsx("div",{className:`gantt-timeline-cell ${$?"weekend":""} ${P?"holiday":""}`,style:{width:b,minWidth:b,maxWidth:b,borderRight:F===Y.length-1?"none":"var(--wx-gantt-border)"},children:M.label},`day-${F}`)})})]}),e.jsxs("div",{className:"gantt-timeline-body",style:{width:q},children:[e.jsx("div",{className:"gantt-timeline-grid",children:Y.map((M,F)=>{const $=s.weekends&&it(M.date),P=s.holidays&&at(M.date,s.holidays);return e.jsx("div",{className:`gantt-timeline-grid-column ${$?"weekend":""} ${P?"holiday":""}`,style:{width:b,minWidth:b}},F)})}),r.length>0&&e.jsx(nn,{links:r,tasks:u,getTaskPosition:w}),e.jsx("div",{className:"gantt-timeline-tasks",style:{width:q},children:u.map(M=>{const F=re(M),$=k?y?.get(M.id):void 0,P=$?ge($):void 0;return e.jsxs("div",{className:"gantt-timeline-row",children:[$&&P&&M.type!=="milestone"&&e.jsx("div",{className:"gantt-baseline-bar",style:{left:`${P.left}px`,width:`${P.width}px`},title:`Baseline: ${$.start.toLocaleDateString()} - ${$.end.toLocaleDateString()}`}),e.jsx(Mt,{task:M,position:F,selected:m===M.id,dragging:h.taskId===M.id,dragDeltaX:h.dragDeltaX,dragType:h.type,onClick:()=>d(M.id),onDragStart:(K,ie,ce)=>{x(M.id,K,ie,ce),l(M.id,K,ie)},readonly:s.readonly})]},M.id)})})]})]})});ct.displayName="Timeline";const dt=T.forwardRef((n,r)=>e.jsx("div",{className:"gantt-chart-wrapper",style:{flex:1,minWidth:0},children:e.jsx(ct,{...n,ref:r})}));dt.displayName="Chart";const{Search:sn}=a.Input,Ct=({onFilterChange:n,owners:r=[]})=>{const[i,o]=T.useState({searchText:"",status:"all",priority:"all",owner:""}),s=l=>{const g={...i,...l};o(g),n(g)},m=()=>{const l={searchText:"",status:"all",priority:"all",owner:""};o(l),n(l)},d=i.searchText!==""||i.status!=="all"||i.priority!=="all"||i.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(sn,{placeholder:"Search tasks...",value:i.searchText,onChange:l=>s({searchText:l.target.value}),allowClear:!0,className:"gantt-search-antd",style:{width:250}})}),e.jsxs("div",{className:"gantt-filter-right",children:[e.jsx(a.Select,{value:i.status,onChange:l=>s({status:l}),className:"gantt-filter-select-antd",style:{width:140},options:[{value:"all",label:"All Status"},{value:"not-started",label:"Not Started"},{value:"in-progress",label:"In Progress"},{value:"completed",label:"Completed"}]}),e.jsx(a.Select,{value:i.priority,onChange:l=>s({priority:l}),className:"gantt-filter-select-antd",style:{width:130},options:[{value:"all",label:"All Priority"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}]}),e.jsx(a.Select,{value:i.owner||void 0,onChange:l=>s({owner:l||""}),className:"gantt-filter-select-antd",style:{width:130},placeholder:"All Owners",allowClear:!0,options:[{value:"",label:"All Owners"},...(r||[]).map(l=>({value:l,label:l}))]}),d&&e.jsx(a.Button,{type:"default",danger:!0,icon:e.jsx(L.FontAwesomeIcon,{icon:O.faTimesCircle}),onClick:m,className:"gantt-filter-clear-antd",children:"Clear"})]})]})})},Ft=(n,r)=>n.filter(i=>{if(r.searchText){const o=r.searchText.toLowerCase(),s=i.text.toLowerCase().includes(o),m=i.owner?.toLowerCase().includes(o),d=i.details?.toLowerCase().includes(o);if(!s&&!m&&!d)return!1}if(r.status!=="all"&&(i.progress===0?"not-started":i.progress===100?"completed":"in-progress")!==r.status||r.priority!=="all"&&i.priority!==r.priority||r.owner&&i.owner!==r.owner)return!1;if(r.dateRange){const o=i.start.getTime(),s=r.dateRange.start.getTime(),m=r.dateRange.end.getTime();if(o<s||o>m)return!1}return!0}),Et=({zoomLevel:n,setZoomLevel:r,onBaselineToggle:i,showBaselines:o,onExport:s,onFilterChange:m,owners:d,onAddTask:l})=>e.jsxs("div",{className:"gantt-toolbar-wrapper",children:[e.jsxs("div",{className:"gantt-toolbar",children:[e.jsx("div",{className:"gantt-toolbar-left",children:e.jsxs(a.Space,{size:8,children:[e.jsx(a.Button,{type:"primary",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faPlus}),onClick:l,children:"New Task"}),e.jsx(a.Tooltip,{title:o?"Hide Baselines":"Show Baselines",children:e.jsx(a.Button,{type:o?"primary":"default",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faCalendarCheck}),onClick:i,children:o?"Baselines":"Set Baseline"})})]})}),e.jsx("div",{className:"gantt-toolbar-right",children:e.jsxs(a.Space,{size:4,children:[e.jsx(a.Tooltip,{title:"Zoom Out",children:e.jsx(a.Button,{icon:e.jsx(L.FontAwesomeIcon,{icon:O.faSearchMinus}),onClick:()=>r(Math.max(.5,n-.25))})}),e.jsx(a.Tooltip,{title:"Zoom In",children:e.jsx(a.Button,{icon:e.jsx(L.FontAwesomeIcon,{icon:O.faSearchPlus}),onClick:()=>r(Math.min(2,n+.25))})}),e.jsx(a.Tooltip,{title:"Reset Zoom",children:e.jsx(a.Button,{icon:e.jsx(L.FontAwesomeIcon,{icon:O.faRotateLeft}),onClick:()=>r(1)})}),e.jsx(a.Divider,{type:"vertical",style:{height:24,margin:"0 4px"}}),e.jsx(a.Tooltip,{title:"Export to CSV",children:e.jsx(a.Button,{icon:e.jsx(L.FontAwesomeIcon,{icon:O.faFileCsv}),onClick:()=>s("csv")})}),e.jsx(a.Tooltip,{title:"Export to Excel",children:e.jsx(a.Button,{icon:e.jsx(L.FontAwesomeIcon,{icon:O.faFileExcel}),onClick:()=>s("excel")})}),e.jsx(a.Tooltip,{title:"Export to JSON",children:e.jsx(a.Button,{icon:e.jsx(L.FontAwesomeIcon,{icon:O.faFileCode}),onClick:()=>s("json")})}),e.jsx(a.Tooltip,{title:"Export to PDF",children:e.jsx(a.Button,{icon:e.jsx(L.FontAwesomeIcon,{icon:O.faFilePdf}),onClick:()=>s("pdf")})})]})})]}),e.jsx(Ct,{onFilterChange:m,owners:d})]}),{Option:Pe}=a.Select,{TextArea:an}=a.Input,kt=({onCreateTask:n,onClose:r})=>{const[i]=a.Form.useForm(),o=s=>{const m=s.start.toDate(),d=new Date(m);d.setDate(d.getDate()+(s.duration||1)),n({text:s.text,start:m,end:d,duration:s.duration||1,progress:s.progress||0,type:s.type,color:typeof s.color=="string"?s.color:s.color?.toHexString?.()||"#4A90E2",owner:s.owner||"",priority:s.priority||"medium",details:s.details||""}),r()};return e.jsx(a.Modal,{title:"Create New Task",open:!0,onCancel:r,onOk:()=>i.submit(),okText:"Create Task",cancelText:"Cancel",width:600,className:"gantt-modal-antd",children:e.jsxs(a.Form,{form:i,layout:"vertical",onFinish:o,initialValues:{type:"task",priority:"medium",start:jt(),duration:1,progress:0,color:"#4A90E2"},children:[e.jsx(a.Form.Item,{name:"text",label:"Task Name",rules:[{required:!0,message:"Please enter task name"}],children:e.jsx(a.Input,{placeholder:"Enter task name",autoFocus:!0})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(a.Form.Item,{name:"type",label:"Type",style:{flex:1},children:e.jsxs(a.Select,{children:[e.jsx(Pe,{value:"task",children:"Task"}),e.jsx(Pe,{value:"milestone",children:"Milestone"}),e.jsx(Pe,{value:"project",children:"Project"})]})}),e.jsx(a.Form.Item,{name:"priority",label:"Priority",style:{flex:1},children:e.jsxs(a.Select,{children:[e.jsx(Pe,{value:"low",children:"Low"}),e.jsx(Pe,{value:"medium",children:"Medium"}),e.jsx(Pe,{value:"high",children:"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(a.Form.Item,{name:"start",label:"Start Date",style:{flex:1},children:e.jsx(a.DatePicker,{style:{width:"100%"}})}),e.jsx(a.Form.Item,{name:"duration",label:"Duration (days)",style:{flex:1},children:e.jsx(a.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(a.Form.Item,{name:"color",label:"Color",style:{flex:1},children:e.jsx(a.ColorPicker,{showText:!0})}),e.jsx(a.Form.Item,{name:"progress",label:"Progress (%)",style:{flex:1},children:e.jsx(a.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(a.Form.Item,{name:"owner",label:"Owner",children:e.jsx(a.Input,{placeholder:"Assign to..."})}),e.jsx(a.Form.Item,{name:"details",label:"Details",children:e.jsx(an,{placeholder:"Add task description...",rows:3})})]})})},{Option:Ae}=a.Select,{TextArea:on}=a.Input,{confirm:ln}=a.Modal,$t=({task:n,onUpdate:r,onDelete:i,onClose:o})=>{const[s]=a.Form.useForm(),m=l=>{const g=l.start.toDate(),v=new Date(g);v.setDate(v.getDate()+(l.duration||1)),r({...n,text:l.text,start:g,end:v,duration:l.duration||1,progress:l.progress||0,type:l.type,color:typeof l.color=="string"?l.color:l.color?.toHexString?.()||"#4A90E2",owner:l.owner||"",priority:l.priority||"medium",details:l.details||""}),o()},d=()=>{ln({title:`Are you sure you want to delete "${n.text}"?`,icon:e.jsx(L.FontAwesomeIcon,{icon:O.faExclamationTriangle,style:{color:"#faad14",marginRight:8}}),content:"This action cannot be undone.",okText:"Yes, Delete",okType:"danger",cancelText:"No",onOk(){i(n.id),o()}})};return e.jsx(a.Modal,{title:"Edit Task",open:!0,onCancel:o,footer:[e.jsx(a.Button,{danger:!0,onClick:d,style:{float:"left"},children:"Delete"},"delete"),e.jsx(a.Button,{onClick:o,children:"Cancel"},"cancel"),e.jsx(a.Button,{type:"primary",onClick:()=>s.submit(),children:"Save Changes"},"submit")],width:600,className:"gantt-modal-antd",children:e.jsxs(a.Form,{form:s,layout:"vertical",onFinish:m,initialValues:{text:n.text,type:n.type||"task",priority:n.priority||"medium",start:jt(n.start),duration:n.duration,progress:n.progress,color:n.color||"#4A90E2",owner:n.owner||"",details:n.details||""},children:[e.jsx(a.Form.Item,{name:"text",label:"Task Name",rules:[{required:!0,message:"Please enter task name"}],children:e.jsx(a.Input,{placeholder:"Enter task name"})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(a.Form.Item,{name:"type",label:"Type",style:{flex:1},children:e.jsxs(a.Select,{children:[e.jsx(Ae,{value:"task",children:"Task"}),e.jsx(Ae,{value:"milestone",children:"Milestone"}),e.jsx(Ae,{value:"project",children:"Project"})]})}),e.jsx(a.Form.Item,{name:"priority",label:"Priority",style:{flex:1},children:e.jsxs(a.Select,{children:[e.jsx(Ae,{value:"low",children:"Low"}),e.jsx(Ae,{value:"medium",children:"Medium"}),e.jsx(Ae,{value:"high",children:"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(a.Form.Item,{name:"start",label:"Start Date",style:{flex:1},children:e.jsx(a.DatePicker,{style:{width:"100%"}})}),e.jsx(a.Form.Item,{name:"duration",label:"Duration (days)",style:{flex:1},children:e.jsx(a.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(a.Form.Item,{name:"color",label:"Color",style:{flex:1},children:e.jsx(a.ColorPicker,{showText:!0})}),e.jsx(a.Form.Item,{name:"progress",label:"Progress (%)",style:{flex:1},children:e.jsx(a.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(a.Form.Item,{name:"owner",label:"Owner",children:e.jsx(a.Input,{placeholder:"Assign to..."})}),e.jsx(a.Form.Item,{name:"details",label:"Details",children:e.jsx(on,{placeholder:"Add task description...",rows:3})})]})})},{Title:Qe,Text:ve,Paragraph:Pt}=a.Typography,{Option:Fe}=a.Select,At=({task:n,allTasks:r,links:i,onAddDependency:o,onRemoveDependency:s,onClose:m})=>{const[d,l]=T.useState(""),[g,v]=T.useState("e2s"),[c,y]=T.useState(0),[D,u]=T.useState("day"),[f,b]=T.useState(""),k=i.filter(w=>w.target===n.id),h=i.filter(w=>w.source===n.id),x=r.filter(w=>w.id!==n.id&&w.id!==n.parent),A=()=>{if(d){const w=ot(c,D);o(d,n.id,g,w),l(""),y(0),u("day")}},I=()=>{if(!f.trim())return;const w=Xt(f.trim());if(!w){alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
15
- Example: 3FS+10d`);return}const U=w.taskNumber-1,X=r[U];if(!X){alert(`Task ${w.taskNumber} not found`);return}const ee=Zt(w.type),Y=ot(w.lag,w.lagUnit);o(X.id,n.id,ee,Y),b("")},z=w=>{switch(w){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)"}},W=w=>{switch(w){case"e2s":return"blue";case"s2s":return"green";case"e2e":return"purple";case"s2e":return"orange"}},re=w=>!w||w===0?null:w>0?e.jsxs(a.Tag,{color:"warning",children:["+",w,"d lag"]}):e.jsxs(a.Tag,{color:"processing",children:[w,"d lead"]}),ge=(w,U)=>{const X=r.find(ee=>ee.id===(U==="source"?w.source:w.target));return e.jsx(a.List.Item,{actions:[e.jsx(a.Button,{type:"text",danger:!0,icon:e.jsx(L.FontAwesomeIcon,{icon:O.faTrash}),onClick:()=>s(w.id),children:"Remove"})],children:e.jsx(a.List.Item.Meta,{title:e.jsxs(a.Space,{children:[e.jsx(ve,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:X?.text||(U==="source"?w.source:w.target)}),e.jsx(a.Tag,{color:W(w.type),children:z(w.type)}),re(w.lag)]}),description:e.jsxs(ve,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:[X?.owner&&`Owner: ${X.owner}`,X?.priority&&` • Priority: ${X.priority}`]})})})};return e.jsxs(a.Modal,{title:e.jsxs(a.Space,{children:[e.jsx(L.FontAwesomeIcon,{icon:O.faLink,style:{fontSize:"20px"}}),e.jsx(Qe,{level:4,style:{margin:0,fontFamily:"IBM Plex Mono, monospace"},children:"Task Dependencies"})]}),open:!0,onCancel:m,width:900,footer:null,className:"gantt-dependency-modal",styles:{body:{maxHeight:"70vh",overflowY:"auto",fontFamily:"IBM Plex Sans, sans-serif"}},children:[e.jsx(a.Card,{size:"small",style:{marginBottom:24,backgroundColor:"#f5f5f5",borderColor:"#d9d9d9"},children:e.jsxs(a.Space,{direction:"vertical",size:4,children:[e.jsx(ve,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace",fontSize:"16px"},children:n.text}),e.jsxs(ve,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"13px"},children:[n.start.toLocaleDateString()," → ",n.end.toLocaleDateString(),n.owner&&` • Owner: ${n.owner}`,n.priority&&` • Priority: ${n.priority}`]})]})}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(Qe,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(L.FontAwesomeIcon,{icon:O.faArrowDown,style:{marginRight:"8px"}}),"Depends On (Predecessors)"]}),k.length===0?e.jsx(a.Alert,{message:"No dependencies",description:"This task doesn't depend on any other tasks.",type:"info",showIcon:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}}):e.jsx(a.List,{dataSource:k,renderItem:w=>ge(w,"source"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(Qe,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(L.FontAwesomeIcon,{icon:O.faArrowUp,style:{marginRight:"8px"}}),"Dependents (Successors)"]}),h.length===0?e.jsx(a.Alert,{message:"No dependent tasks",description:"No other tasks depend on this task.",type:"info",showIcon:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}}):e.jsx(a.List,{dataSource:h,renderItem:w=>ge(w,"target"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsx(a.Divider,{}),e.jsx(a.Card,{title:e.jsxs(Qe,{level:5,style:{margin:0,fontFamily:"IBM Plex Mono, monospace",fontSize:"14px"},children:[e.jsx(L.FontAwesomeIcon,{icon:O.faPlus,style:{marginRight:"8px"}}),"Add New Dependency"]}),style:{marginBottom:24},children:e.jsxs(a.Space,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsxs("div",{children:[e.jsx(ve,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Quick Add (Keyboard Shortcut):"}),e.jsx(ve,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px",display:"block",marginBottom:8},children:"Format: [TaskNumber][Type][+/-][Lag][Unit] • Example: 3FS+10d, 5SS-2w"}),e.jsxs(a.Space.Compact,{style:{width:"100%"},children:[e.jsx(a.Input,{placeholder:"e.g., 3FS+10d",value:f,onChange:w=>b(w.target.value),onPressEnter:I,size:"large",style:{fontFamily:"IBM Plex Mono, monospace"}}),e.jsx(a.Button,{type:"primary",size:"large",onClick:I,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Add"})]})]}),e.jsx(a.Divider,{style:{margin:"8px 0"},children:"OR"}),e.jsxs("div",{children:[e.jsx(ve,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Select Task:"}),e.jsx(a.Select,{placeholder:"Choose a task...",value:d||void 0,onChange:l,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",showSearch:!0,filterOption:(w,U)=>String(U?.children||"").toLowerCase().includes(w.toLowerCase()),children:x.map(w=>e.jsx(Fe,{value:w.id,children:w.text},w.id))})]}),e.jsxs("div",{children:[e.jsx(ve,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Dependency Type:"}),e.jsxs(a.Select,{value:g,onChange:v,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",children:[e.jsxs(Fe,{value:"e2s",children:[e.jsx(a.Tag,{color:"blue",children:"FS"})," Finish-to-Start"]}),e.jsxs(Fe,{value:"s2s",children:[e.jsx(a.Tag,{color:"green",children:"SS"})," Start-to-Start"]}),e.jsxs(Fe,{value:"e2e",children:[e.jsx(a.Tag,{color:"purple",children:"FF"})," Finish-to-Finish"]}),e.jsxs(Fe,{value:"s2e",children:[e.jsx(a.Tag,{color:"orange",children:"SF"})," Start-to-Finish"]})]})]}),e.jsx("div",{children:e.jsxs(a.Space,{direction:"vertical",size:4,style:{width:"100%"},children:[e.jsx(ve,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Lead/Lag Time:"}),e.jsx(ve,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:"Negative = lead time (overlap), Positive = lag time (delay)"}),e.jsxs(a.Space.Compact,{style:{width:"100%"},children:[e.jsx(a.InputNumber,{value:c,onChange:w=>y(w||0),style:{flex:1,fontFamily:"IBM Plex Sans, sans-serif"},size:"large",placeholder:"0",min:-365,max:365}),e.jsxs(a.Select,{value:D,onChange:u,style:{width:120,fontFamily:"IBM Plex Sans, sans-serif"},size:"large",children:[e.jsx(Fe,{value:"day",children:"Days"}),e.jsx(Fe,{value:"hour",children:"Hours"}),e.jsx(Fe,{value:"week",children:"Weeks"}),e.jsx(Fe,{value:"month",children:"Months"})]})]})]})}),e.jsx(a.Button,{type:"primary",size:"large",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faPlus}),onClick:A,disabled:!d,block:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",fontWeight:600},children:"Add Dependency"})]})}),e.jsx(a.Alert,{message:e.jsxs(ve,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace"},children:[e.jsx(L.FontAwesomeIcon,{icon:O.faInfoCircle,style:{marginRight:"8px"}}),"Dependency Types Explained"]}),description:e.jsxs("div",{style:{fontFamily:"IBM Plex Sans, sans-serif"},children:[e.jsxs("ul",{style:{marginBottom:12,paddingLeft:20},children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Finish-to-Start (FS):"})," Successor starts after predecessor finishes"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Start-to-Start (SS):"})," Both tasks start at the same time"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Finish-to-Finish (FF):"})," Both tasks finish at the same time"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Start-to-Finish (SF):"})," Successor finishes when predecessor starts"]})]}),e.jsx(a.Divider,{style:{margin:"12px 0"}}),e.jsx(ve,{strong:!0,style:{display:"block",marginBottom:4},children:"Keyboard Shortcuts:"}),e.jsx(Pt,{style:{margin:0,fontSize:"12px"},code:!0,children:"[TaskID][Type]+/-[Days]d"}),e.jsxs(Pt,{style:{margin:0,fontSize:"12px"},children:["Example: ",e.jsx("code",{children:"3FS+10d"})," = Task 3, Finish-to-Start, 10 days lag"]})]}),type:"info",showIcon:!0,icon:e.jsx(L.FontAwesomeIcon,{icon:O.faInfoCircle}),style:{marginTop:16}})]})},cn=({x:n,y:r,task:i,onEdit:o,onDelete:s,onCopy:m,onDependencies:d,onConvertToMilestone:l,onConvertToTask:g,onConvertToProject:v,onAutoSchedule:c,onClose:y})=>{if(!i)return null;const D=[{key:"edit",label:"Edit",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faEdit}),onClick:()=>{o(),y()}},{key:"copy",label:"Copy",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faCopy}),onClick:()=>{m(),y()}},{key:"dependencies",label:"Dependencies",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faLink}),onClick:()=>{d(),y()}},{type:"divider"},{key:"convert",label:"Convert to",type:"submenu",children:[{key:"milestone",label:"Milestone",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faFlag}),disabled:i.type==="milestone",onClick:()=>{l(),y()}},{key:"task",label:"Task",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faTasks}),disabled:i.type==="task",onClick:()=>{g(),y()}},{key:"project",label:"Project",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faFolder}),disabled:i.type==="project",onClick:()=>{v(),y()}}]},{key:"auto-schedule",label:"Auto Schedule",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faRotateLeft}),onClick:()=>{c?.(),y()}},{type:"divider"},{key:"delete",label:"Delete",icon:e.jsx(L.FontAwesomeIcon,{icon:O.faTrash}),danger:!0,onClick:()=>{s(),y()}}];return e.jsx("div",{className:"gantt-context-menu",style:{position:"fixed",left:`${n}px`,top:`${r}px`,zIndex:1e4},onClick:u=>u.stopPropagation(),children:e.jsx(a.Menu,{items:D,style:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"6px",border:"1px solid #e0e0e0"}})})},It=(n,r=[])=>{const[i,o]=T.useState([]),[s,m]=T.useState(-1),[d,l]=T.useState(n),[g,v]=T.useState(r);T.useEffect(()=>{l(n)},[n]),T.useEffect(()=>{v(r)},[r]);const c=T.useCallback((x,A,I)=>{const z={type:x,before:A,after:I,timestamp:Date.now()},W=i.slice(0,s+1);W.push(z),W.length>50?W.shift():m(s+1),o(W)},[i,s]),y=T.useCallback(()=>{if(s<0)return;const x=i[s];l(x.before.tasks),v(x.before.links),m(s-1)},[i,s]),D=T.useCallback(()=>{if(s>=i.length-1)return;const x=i[s+1];l(x.after.tasks),v(x.after.links),m(s+1)},[i,s]),u=s>=0,f=s<i.length-1,b=T.useCallback(x=>{const A={tasks:d,links:g},I=d.map(W=>W.id===x.id?x:W);c("task_update",A,{tasks:I,links:g}),l(I)},[d,g,c]),k=T.useCallback(x=>{const A={tasks:d,links:g},I=[...d,x];c("task_create",A,{tasks:I,links:g}),l(I)},[d,g,c]),h=T.useCallback(x=>{const A={tasks:d,links:g},I=d.filter(re=>re.id!==x),z=g.filter(re=>re.source!==x&&re.target!==x);c("task_delete",A,{tasks:I,links:z}),l(I),v(z)},[d,g,c]);return{tasks:d,links:g,setTasks:l,setLinks:v,undo:y,redo:D,canUndo:u,canRedo:f,updateTask:b,createTask:k,deleteTask:h,saveState:c,history:i}},Nt=(n,r,i={mode:"forward"})=>{const o=new Map,s=new Map;return n.forEach(m=>{o.set(m.id,[]),s.set(m.id,[])}),r.forEach(m=>{m.type==="e2s"&&(o.get(m.target)?.push(m.source),s.get(m.source)?.push(m.target))}),i.mode==="forward"?dn(n,o,i):un(n,s,i)},dn=(n,r,i)=>{const o=new Map,s=new Set,m=i.projectStart||new Date,d=l=>{if(s.has(l))return;const g=n.find(f=>f.id===l);if(!g)return;const v=r.get(l)||[];v.forEach(f=>d(f));let c=m;v.forEach(f=>{const b=o.get(f);b&&b.end>c&&(c=new Date(b.end))});const y=new Date(c),D=ue(y,g.duration,"day"),u={...g,start:y,end:D};o.set(l,u),s.add(l)};return n.forEach(l=>d(l.id)),n.map(l=>o.get(l.id)||l)},un=(n,r,i)=>{const o=new Map,s=new Set,m=i.projectEnd||new Date(Math.max(...n.map(l=>l.end.getTime()))),d=l=>{if(s.has(l))return;const g=n.find(f=>f.id===l);if(!g)return;const v=r.get(l)||[];v.forEach(f=>d(f));let c=m;v.forEach(f=>{const b=o.get(f);b&&b.start<c&&(c=new Date(b.start))});const y=new Date(c),D=ue(y,-g.duration,"day"),u={...g,start:D,end:y};o.set(l,u),s.add(l)};return n.forEach(l=>d(l.id)),n.map(l=>o.get(l.id)||l)},fn=Object.freeze(Object.defineProperty({__proto__:null,autoSchedule:Nt,levelResources:n=>{const r=new Map;n.forEach(o=>{o.owner&&(r.has(o.owner)||r.set(o.owner,[]),r.get(o.owner).push(o))});const i=[...n];return r.forEach((o,s)=>{const m=o.sort((d,l)=>d.start.getTime()-l.start.getTime());for(let d=1;d<m.length;d++){const l=m[d],g=m[d-1];if(l.start<g.end){const v=i.findIndex(c=>c.id===l.id);if(v>=0){const c=new Date(g.end),y=ue(c,l.duration,"day");i[v]={...l,start:c,end:y}}}}}),i}},Symbol.toStringTag,{value:"Module"})),_t=n=>{const r=new Map;return n.forEach(i=>{r.set(i.id,{taskId:i.id,start:new Date(i.start),end:new Date(i.end)})}),r},Ot=n=>{const r=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority"],i=n.map(s=>[s.id,s.text,pe(s.start,"YYYY-MM-DD"),pe(s.end,"YYYY-MM-DD"),s.duration.toString(),`${s.progress}%`,s.type||"task",s.owner||"",s.priority||"medium"]),o=[r.join(","),...i.map(s=>s.map(m=>`"${m}"`).join(","))].join(`
16
- `);et(o,"gantt-tasks.csv","text/csv")},Lt=n=>{const r=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority","Details"],i=n.map(s=>[s.id,s.text,pe(s.start,"MM/DD/YYYY"),pe(s.end,"MM/DD/YYYY"),s.duration.toString(),s.progress.toString(),s.type||"task",s.owner||"",s.priority||"medium",s.details||""]),o="\uFEFF"+[r.join(" "),...i.map(s=>s.map(m=>m.replace(/\t/g," ")).join(" "))].join(`
17
- `);et(o,"gantt-tasks.xls","application/vnd.ms-excel")},Rt=(n,r)=>{const i={tasks:n,links:r,exported:new Date().toISOString(),version:"1.0"},o=JSON.stringify(i,null,2);et(o,"gantt-project.json","application/json")},Yt=n=>{const r=`
14
+ <%s key={someKey} {...props} />`,Mt,ze,Tr,ze),q[ze+Mt]=!0}}return r===o?ue(ae):G(ae),ae}}function Z(r,m,D){return he(r,m,D,!0)}function pe(r,m,D){return he(r,m,D,!1)}var _e=pe,ie=Z;Ke.Fragment=o,Ke.jsx=_e,Ke.jsxs=ie})()),Ke}var Pt;function Kt(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?rt.exports=Gt():rt.exports=Xt()),rt.exports}var e=Kt();const le=(n,a,s)=>{const o=new Date(n);switch(s){case"hour":o.setHours(o.getHours()+a);break;case"day":o.setDate(o.getDate()+a);break;case"week":o.setDate(o.getDate()+a*7);break;case"month":o.setMonth(o.getMonth()+a);break;case"quarter":o.setMonth(o.getMonth()+a*3);break;case"year":o.setFullYear(o.getFullYear()+a);break}return o},Ze=(n,a)=>{const s=a.getTime()-n.getTime();return Math.ceil(s/(1e3*60*60*24))},Ct=(n,a)=>{const s=a.getTime()-n.getTime();return Math.ceil(s/(1e3*60*60))},fe=(n,a)=>{const s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],g={YYYY:n.getFullYear().toString(),YY:n.getFullYear().toString().slice(-2),MMMM:o[n.getMonth()],MMM:s[n.getMonth()],MM:String(n.getMonth()+1).padStart(2,"0"),M:String(n.getMonth()+1),DD:String(n.getDate()).padStart(2,"0"),D:String(n.getDate()),dddd:t[n.getDay()],HH:String(n.getHours()).padStart(2,"0"),H:String(n.getHours()),mm:String(n.getMinutes()).padStart(2,"0"),m:String(n.getMinutes())};return a.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g,y=>g[y])},ht=n=>{const a=n.getDay();return a===0||a===6},pt=(n,a)=>a.some(s=>s.getFullYear()===n.getFullYear()&&s.getMonth()===n.getMonth()&&s.getDate()===n.getDate()),Be=n=>{const a=new Date(n);return a.setHours(0,0,0,0),a},Zt=n=>{const a=new Date(n);return a.setHours(23,59,59,999),a},Qt=(n,a,s="day")=>{switch(s){case"hour":return Ct(n,a);case"day":return Ze(n,a);case"week":return Math.ceil(Ze(n,a)/7);case"month":return(a.getFullYear()-n.getFullYear())*12+(a.getMonth()-n.getMonth());default:return Ze(n,a)}};function er(n){if(!n||typeof n!="string")return null;const a=n.trim(),s=/^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,o=a.match(s);if(!o)return null;const t=parseInt(o[1],10),g=o[2].toUpperCase();let y=0,i="day";if(o[3]){const c=o[4]==="-"?-1:1;switch(y=parseInt(o[5],10)*c,o[6].toLowerCase()){case"d":i="day";break;case"h":i="hour";break;case"w":i="week";break;case"m":i="month";break}}return{taskNumber:t,type:g,lag:y,lagUnit:i}}function ft(n,a){switch(a){case"hour":return n/24;case"day":return n;case"week":return n*7;case"month":return n*30;default:return n}}function tr(n,a){const o={e2s:"FS",s2s:"SS",e2e:"FF",s2e:"SF"}[n.type];let t=`${a}${o}`;if(n.lag&&n.lag!==0){const g=n.lag>0?"+":"",i=(n.lagUnit||"day").charAt(0);let c=n.lag;if(n.lagUnit&&n.lagUnit!=="day")switch(n.lagUnit){case"hour":c=n.lag*24;break;case"week":c=n.lag/7;break;case"month":c=n.lag/30;break}t+=`${g}${Math.round(c)}${i}`}return t}function rr(n){return{FS:"e2s",SS:"s2s",FF:"e2e",SF:"s2e"}[n]}const{Text:Fe,Paragraph:nr,Link:sr}=l.Typography,{Option:$t}=l.Select,ar=({task:n,allTasks:a,onAddDependency:s,children:o})=>{const[t,g]=j.useState(!1),[y,i]=j.useState(""),[c,v]=j.useState(null),[h,b]=j.useState("e2s"),[k,x]=j.useState("lag"),[p,u]=j.useState(0),[P,L]=j.useState(!0),f="day",M=j.useMemo(()=>{if(!y)return a.filter(H=>H.id!==n.id);const w=y.toLowerCase();return a.filter(H=>H.id!==n.id&&(H.text.toLowerCase().includes(w)||(a.indexOf(H)+1).toString().includes(w)))},[a,y,n.id]),A=()=>{if(c){const w=k==="lag"?p:-p,H=ft(w,f);s(c,n.id,h,H),g(!1),R()}},R=()=>{i(""),v(null),b("e2s"),x("lag"),u(0)},O=()=>{if(!P)return null;const w=h==="e2s",H=h==="s2s",Q=h==="e2e",ne=h==="s2e";let U=0,V=0,ce="",de=0,me=-1;return w?(U=20,V=160,de=140,me=160,ce="M 140 40 L 150 40 C 160 40, 160 90, 150 90 L 160 90"):Q?(U=60,V=60,de=180,me=-1,ce="M 180 40 L 200 40 L 200 90 L 180 90"):H?(U=100,V=100,de=100,me=-1,ce="M 100 40 L 80 40 L 80 90 L 100 90"):ne&&(U=160,V=20,de=160,me=140,ce="M 160 40 L 150 40 C 140 40, 140 90, 150 90 L 140 90"),e.jsx("div",{style:{width:"100%",height:120,backgroundColor:"#fff",borderRadius:4,marginBottom:10,border:"1px solid #e9ecef",position:"relative",overflow:"hidden"},children:e.jsxs("svg",{viewBox:"0 0 300 120",style:{width:"100%",height:"100%"},children:[e.jsx("line",{x1:de,x2:de,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),me!==-1&&e.jsx("line",{x1:me,x2:me,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),e.jsx("rect",{x:U,y:"28",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:U+60,y:"44",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 2"}),e.jsx("rect",{x:V,y:"78",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:V+60,y:"94",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 3"}),e.jsx("path",{d:ce,fill:"none",stroke:"#8c8c8c",strokeWidth:"1.5",markerEnd:"url(#arrowhead)"}),e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#8c8c8c"})})})]})})},re=()=>{const w=a.find(U=>U.id===c);if(!w)return"Select a task from the list to see how it will relate to the current task.";const H=a.indexOf(n)+1,Q=a.indexOf(w)+1;let ne="";switch(h){case"e2s":ne=`Task ${H} starts after Task ${Q} finishes`;break;case"s2s":ne=`Task ${H} starts when Task ${Q} starts`;break;case"e2e":ne=`Task ${H} finishes when Task ${Q} finishes`;break;case"s2e":ne=`Task ${H} finishes when Task ${Q} starts`;break}if(p>0){const U=`${p} ${f}${p>1?"s":""}`;k==="lag"?ne+=` + ${U} delay`:ne+=` - ${U} overlap`}return ne+"."},ye=e.jsxs("div",{style:{display:"flex",width:620,height:480,backgroundColor:"#fff",borderRadius:"8px",overflow:"hidden"},children:[e.jsxs("div",{style:{flex:1,borderRight:"1px solid #f0f0f0",display:"flex",flexDirection:"column",padding:0},children:[e.jsx("div",{style:{padding:"12px"},children:e.jsx(l.Input,{placeholder:"Search task...",value:y,onChange:w=>i(w.target.value),style:{marginBottom:8},autoFocus:!0,size:"large"})}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:e.jsx(l.List,{size:"small",dataSource:M,renderItem:w=>e.jsxs(l.List.Item,{className:`task-list-item ${c===w.id?"selected":""}`,onClick:()=>v(w.id),style:{cursor:"pointer",padding:"8px 16px",backgroundColor:c===w.id?"#f0f7ff":"transparent",display:"flex",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsx(Fe,{type:"secondary",style:{width:20},children:a.indexOf(w)+1}),e.jsx(Fe,{children:w.text})]}),e.jsx(J.FontAwesomeIcon,{icon:Y.faChevronRight,style:{fontSize:10,color:"#bfbfbf"}})]})})})]}),e.jsxs("div",{style:{width:340,padding:"24px",display:"flex",flexDirection:"column",borderLeft:"1px solid #f0f0f0"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:15},children:[e.jsx(Fe,{strong:!0,children:"Dependency type"}),e.jsx(sr,{style:{fontSize:"12px"},onClick:()=>L(!P),children:P?"Hide preview":"Show preview"})]}),O(),e.jsx(nr,{style:{fontSize:"13px",color:"#262626",marginBottom:20,minHeight:48,lineHeight:"1.6"},children:re()}),e.jsx(l.Radio.Group,{value:h,onChange:w=>b(w.target.value),style:{width:"100%",marginBottom:20},children:e.jsxs(l.Space,{direction:"vertical",style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(l.Radio,{value:"e2s",children:"Finish to Start"}),e.jsx(Fe,{type:"secondary",children:"FS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(l.Radio,{value:"e2e",children:"Finish to Finish"}),e.jsx(Fe,{type:"secondary",children:"FF"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(l.Radio,{value:"s2s",children:"Start to Start"}),e.jsx(Fe,{type:"secondary",children:"SS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(l.Radio,{value:"s2e",children:"Start to Finish"}),e.jsx(Fe,{type:"secondary",children:"SF"})]})]})}),e.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:20},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(Fe,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Delay type"}),e.jsxs(l.Select,{value:k,onChange:w=>x(w),style:{width:"100%"},size:"large",children:[e.jsx($t,{value:"lag",children:"Lag by"}),e.jsx($t,{value:"lead",children:"Lead by"})]})]}),e.jsxs("div",{style:{width:100},children:[e.jsx(Fe,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Days"}),e.jsx(l.Space.Compact,{style:{width:"100%"},children:e.jsx(l.InputNumber,{min:0,value:p,onChange:w=>u(w||0),style:{width:"100%"},placeholder:"0",size:"large"})})]})]}),e.jsx(l.Button,{type:"primary",block:!0,onClick:A,disabled:!c,style:{marginTop:"auto",backgroundColor:"#5c67f2",height:44,borderRadius:"6px"},children:"Add"})]})]});return e.jsx(l.Popover,{content:ye,trigger:"click",open:t,onOpenChange:g,placement:"bottomLeft",overlayClassName:"dependency-popover",overlayInnerStyle:{padding:0},children:o})},mt=j.memo(j.forwardRef(({tasks:n,allTasks:a=[],columns:s,selectedTask:o,onTaskClick:t,onTaskContextMenu:g,onTaskUpdate:y,onTaskDragStart:i,onAddTask:c,onAddDependency:v,links:h=[],dropIndicator:b,reorderTask:k,iconConfig:x},p)=>{const u=j.useRef(null);j.useImperativeHandle(p,()=>u.current);const P=(f,M=0)=>{if(!f.parent)return M;const A=n.find(R=>R.id===f.parent);return A?P(A,M+1):M},L=(f,M)=>{if(M.template)return M.template(f);switch(M.name){case"text":const A=P(f);return e.jsxs("div",{className:"gantt-grid-cell-text",style:{paddingLeft:A*14},children:[e.jsx("div",{className:"gantt-row-drag-handle",onMouseDown:O=>{O.preventDefault(),i?.(f.id,O.clientX,O.clientY,"reorder")},children:e.jsx(J.FontAwesomeIcon,{icon:Y.faGripVertical})}),f.type==="project"?e.jsx("span",{className:"gantt-tree-icon",onClick:O=>{O.stopPropagation(),y?.({...f,open:!f.open})},children:e.jsx(J.FontAwesomeIcon,{icon:f.open?Y.faChevronDown:Y.faChevronRight})}):e.jsx("span",{style:{width:16,display:"inline-block"}}),e.jsx("span",{className:"gantt-task-name-text",children:f.text})]});case"start":return fe(f.start,"DD-MM-YYYY");case"end":return fe(f.end,"DD-MM-YYYY");case"duration":return e.jsxs("div",{style:{backgroundColor:"#f6e7db",padding:"4px 12px",borderRadius:"4px",fontWeight:600,color:"#434343",display:"inline-block",minWidth:"70px",textAlign:"center"},children:[f.duration," day",f.duration!==1?"s":""]});case"predecessors":const R=h.filter(O=>O.target===f.id);return e.jsx(ar,{task:f,allTasks:a,links:h,onAddDependency:(O,re,ye,w)=>v?.(O,re,ye,w),children:e.jsx("div",{style:{cursor:"pointer",minHeight:"24px",width:"100%",display:"flex",alignItems:"center",gap:"4px"},children:R.map(O=>{const re=a.find(w=>w.id===O.source),ye=re?a.indexOf(re)+1:0;return e.jsx("span",{style:{fontSize:"11px",backgroundColor:"#e6f7ff",border:"1px solid #91d5ff",color:"#0050b3",padding:"1px 6px",borderRadius:"4px",whiteSpace:"nowrap"},children:tr(O,ye)},O.id)})})});case"add":return e.jsx(l.Button,{type:"primary",size:"small",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faPlus,style:{fontSize:12}}),onClick:O=>{O.stopPropagation(),c?.(f.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:`${f.progress}%`}})}),e.jsxs("span",{className:"gantt-progress-text",children:[f.progress,"%"]})]});case"index":return e.jsx("span",{style:{color:"#8c8c8c"},children:a.indexOf(f)+1});default:return f[M.name]||""}};return e.jsxs("div",{className:"gantt-grid",ref:u,children:[e.jsx("div",{className:"gantt-grid-header",style:{display:"flex",minWidth:"100%"},children:s.map(f=>e.jsx("div",{className:"gantt-grid-header-cell",style:{width:f.width,minWidth:f.width,justifyContent:f.align==="center"?"center":"flex-start"},children:f.name==="add"?e.jsx("span",{style:{fontSize:11,color:"#64748b",fontWeight:600,whiteSpace:"nowrap"},children:"Add"}):e.jsxs(e.Fragment,{children:[f.label,f.name==="start"&&e.jsx(J.FontAwesomeIcon,{icon:Y.faChevronDown,style:{marginLeft:8,fontSize:10,color:"#64748b"}})]})},f.name))}),e.jsx("div",{className:"gantt-grid-body",children:n.map(f=>{const M=k?.id===f.id,A=k?.descendantIds.includes(f.id);return e.jsxs("div",{className:`gantt-grid-row ${o===f.id?"selected":""} ${M?"dragging-row":""} ${A?"descendant-dragging-row":""} ${b?.taskId===f.id?`drop-target-${b.position}`:""}`,onClick:()=>t(f.id),onContextMenu:R=>g?.(R,f.id),style:{display:"flex",minWidth:"100%"},children:[s.map(R=>{const O=R.name==="add";return e.jsx("div",{className:"gantt-grid-cell",style:{width:R.width,minWidth:R.width,textAlign:R.align||"left",display:"flex",alignItems:"center",justifyContent:O?"center":R.align||"flex-start",visibility:"visible",opacity:1},children:L(f,R)},`${f.id}-${R.name}`)}),b?.taskId===f.id&&e.jsx("div",{className:`gantt-drop-indicator ${b.position}`})]},f.id)})})]})}));mt.displayName="Grid";const Ot=({task:n,position:a,selected:s,dragging:o,onClick:t,onDragStart:g,dragDeltaX:y=0,dragType:i=null,readonly:c=!1})=>{const v=(p,u)=>{c||(p.preventDefault(),p.stopPropagation(),g(p.clientX,p.clientY,u))},h=()=>{const p=["gantt-task-bar"];return n.type==="milestone"&&p.push("milestone"),n.type==="project"&&p.push("project"),s&&p.push("selected"),o&&p.push("dragging"),p.join(" ")},b=()=>{let p=a.left,u=a.width;return o&&i&&(i==="move"?p+=y:i==="resize-left"?(p+=y,u-=y):i==="resize-right"&&(u+=y)),{left:`${p}px`,width:`${Math.max(u,0)}px`,backgroundColor:n.color||void 0}},k=(p=!1)=>e.jsxs(e.Fragment,{children:[!c&&n.type!=="milestone"&&!p&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-left",onMouseDown:u=>v(u,"resize-left")}),!p&&n.type!=="milestone"&&e.jsx("div",{className:"gantt-task-progress",style:{width:`${n.progress}%`}}),e.jsx("div",{className:"gantt-task-content",children:!p&&n.type!=="milestone"&&e.jsx("span",{className:"gantt-task-text",children:n.text})}),n.type==="milestone"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-milestone-diamond"}),e.jsx("span",{className:"gantt-milestone-text",children:n.text})]}),!c&&n.type!=="milestone"&&!p&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-right",onMouseDown:u=>v(u,"resize-right")})]}),x=e.jsxs("div",{className:"gantt-tooltip",children:[e.jsx("div",{className:"gantt-tooltip-title",children:n.text}),e.jsxs("div",{className:"gantt-tooltip-dates",children:[fe(n.start,"MMM D")," - ",fe(n.end,"MMM D")]}),e.jsxs("div",{className:"gantt-tooltip-progress",children:["Progress: ",n.progress,"%"]}),n.owner&&e.jsxs("div",{className:"gantt-tooltip-owner",children:["Owner: ",n.owner]})]});return n.segments&&n.segments.length>0?e.jsx("div",{className:"gantt-task-group",children:n.segments.map((p,u)=>e.jsx(l.Tooltip,{title:x,mouseEnterDelay:.5,children:e.jsx("div",{className:h()+" segment",style:{left:`${a.left+(p.start.getTime()-n.start.getTime())/(n.end.getTime()-n.start.getTime())*a.width}px`,width:`${(p.end.getTime()-p.start.getTime())/(n.end.getTime()-n.start.getTime())*a.width}px`,backgroundColor:n.color||"#ADCFFE"},onClick:t,onMouseDown:P=>v(P,"move"),children:k(!0)})},u))}):e.jsx(l.Tooltip,{title:x,mouseEnterDelay:.5,children:e.jsx("div",{className:h(),style:b(),onClick:t,onMouseDown:p=>v(p,"move"),children:k()})})},or=({links:n,tasks:a,getTaskPosition:s})=>{const o=i=>a.find(c=>c.id===i),t=j.useMemo(()=>{let i=0,c=0;return a.forEach(v=>{try{const h=s(v);h&&typeof h.left=="number"&&typeof h.width=="number"&&(i=Math.max(i,h.left+h.width)),h&&typeof h.top=="number"&&typeof h.height=="number"&&(c=Math.max(c,h.top+h.height))}catch(h){console.warn("Failed to position task for link rendering:",v.id,h)}}),{width:Math.max(i,1e3),height:Math.max(c,100)}},[a,s]),g=i=>{const c=o(i.source),v=o(i.target);if(!c||!v)return"";const h=s(c),b=s(v),k=h.top+h.height/2,x=b.top+b.height/2;let p=0,u=0;switch(i.type){case"e2s":p=h.left+h.width,u=b.left;break;case"s2s":p=h.left,u=b.left;break;case"e2e":p=h.left+h.width,u=b.left+b.width;break;case"s2e":p=h.left,u=b.left+b.width;break}const P=u-p,L=x-k,f=20;if(i.type==="e2s")if(P>=f){const M=p+P/2;return`M ${p},${k} L ${M},${k} L ${M},${x} L ${u},${x}`}else{const M=f/2,A=k+L/2;return`M ${p},${k} L ${p+M},${k} L ${p+M},${A} L ${u-M},${A} L ${u-M},${x} L ${u},${x}`}else if(i.type==="s2s"){const M=Math.min(p,u)-f/2;return`M ${p},${k} L ${M},${k} L ${M},${x} L ${u},${x}`}else if(i.type==="e2e"){const M=Math.max(p,u)+f/2;return`M ${p},${k} L ${M},${k} L ${M},${x} L ${u},${x}`}else if(i.type==="s2e")if(P<=-f){const M=p+P/2;return`M ${p},${k} L ${M},${k} L ${M},${x} L ${u},${x}`}else{const M=f/2,A=k+L/2;return`M ${p},${k} L ${p-M},${k} L ${p-M},${A} L ${u+M},${A} L ${u+M},${x} L ${u},${x}`}return""},y=i=>{const c=o(i.target);if(!c)return"";const v=s(c),h=v.top+v.height/2,b=8,k=6;let x=0,p=!0;return i.type==="e2s"||i.type==="s2s"?(x=v.left,p=!0):(x=v.left+v.width,p=!1),p?`M ${x},${h} L ${x-b},${h-k/2} L ${x-b},${h+k/2} Z`:`M ${x},${h} L ${x+b},${h-k/2} L ${x+b},${h+k/2} Z`};return n.length===0?null:e.jsx("svg",{className:"gantt-links-layer",style:{overflow:"visible",width:t.width,height:t.height,position:"absolute",top:0,left:0,pointerEvents:"none"},children:n.map(i=>{const c=o(i.source),v=o(i.target);if(!c||!v)return null;const h=g(i),b=y(i);return!h||!b?null:e.jsxs("g",{className:"gantt-link",children:[e.jsx("path",{d:h,fill:"none",strokeWidth:"1.5",className:"gantt-link-line"}),e.jsx("path",{d:b,className:"gantt-link-arrow"})]},i.id)})})},ir=(n,a,s=60,o="day",t=1)=>{const[g,y]=j.useState({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0}),i=j.useCallback((h,b,k,x)=>{const p=n.find(u=>u.id===h);p&&y({taskId:h,initialX:b,initialY:k,initialStart:new Date(p.start),initialEnd:new Date(p.end),type:x,dragDeltaX:0,dragDeltaY:0})},[n]),c=j.useCallback((h,b)=>{if(!g.taskId||!g.type)return null;const k=h-g.initialX,x=b-g.initialY;if(y(M=>({...M,dragDeltaX:k,dragDeltaY:x})),g.type==="reorder")return null;const p=n.find(M=>M.id===g.taskId);if(!p)return null;const u=Math.round(k/s);let P=new Date(g.initialStart),L=new Date(g.initialEnd);switch(g.type){case"move":P=le(g.initialStart,u*t,o),L=le(g.initialEnd,u*t,o);break;case"resize-left":P=le(g.initialStart,u*t,o),P>=L&&(P=le(L,-t,o));break;case"resize-right":L=le(g.initialEnd,u*t,o),L<=P&&(L=le(P,t,o));break}const f=Ze(P,L);return{...p,start:P,end:L,duration:f}},[g,n,s]),v=j.useCallback(h=>{if(h&&a){const{id:b,...k}=h;a(b,k)}y({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:c,handleDragEnd:v}},xt=j.forwardRef(({tasks:n,links:a,range:s,scales:o,config:t,selectedTask:g,onTaskClick:y,onTaskDragStart:i,onTaskDragEnd:c,onTaskUpdate:v,zoomLevel:h,baselines:b},k)=>{const[x,p]=j.useState(n),u=(t.columnWidth||60)*h,P=t.baselines&&b&&b.size>0,{dragState:L,handleDragStart:f,handleDrag:M,handleDragEnd:A}=ir(x,v,u,o[1].unit,o[1].step);j.useEffect(()=>{(n.length!==x.length||n.some((E,N)=>{const $=x[N];return!$||E.id!==$.id||E.start.getTime()!==$.start.getTime()||E.end.getTime()!==$.end.getTime()}))&&p(n)},[n]);const R=j.useCallback(S=>{const E=[];let N=new Date(s.start);for(;N<=s.end;)E.push({date:new Date(N),label:fe(N,S.format||"D")}),N=le(N,S.step,S.unit);return E},[s.start.getTime(),s.end.getTime()]),O=j.useCallback(S=>{const E=o[1],N=s.start.getTime(),K=S.getTime()-N,ee={hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6}[E.unit]||864e5;return K/(ee*E.step)*u},[o,s.start,u]),re=S=>{const E=O(S.start),N=O(S.end);return{left:E,width:Math.max(N-E,0)}},ye=S=>{const E=O(S.start),N=O(S.end);return{left:E,width:Math.max(N-E,0)}},w=S=>{const E=re(S),N=x.findIndex(ee=>ee.id===S.id),$=t.rowHeight||48,K=32,X=($-K)/2;return{left:E.left,width:E.width,top:N*$+X,height:K}},H=j.useRef(null),Q=j.useCallback(S=>{L.taskId&&L.type&&(H.current&&cancelAnimationFrame(H.current),H.current=requestAnimationFrame(()=>{const E=M(S.clientX,S.clientY);E&&p(N=>N.map($=>$.id===E.id?E:$))}))},[L,M]),ne=j.useCallback(()=>{if(L.taskId){const S=x.find(E=>E.id===L.taskId);A(S||null),c()}},[L,x,A,c]),U=o[1],V=j.useMemo(()=>R(U),[R,U]),ce=j.useCallback(()=>{const S=[];let E=-1,N=-1,$=0,K="";return V.forEach(X=>{const ee=X.date.getMonth(),se=X.date.getFullYear(),ge=fe(X.date,"MMM YYYY");ee!==E||se!==N?(E!==-1&&S.push({label:K,width:$}),E=ee,N=se,$=u,K=ge):$+=u}),E!==-1&&S.push({label:K,width:$}),S},[V,u]),de=j.useCallback(()=>{const S=[];let E=-1,N=0,$=-1,K=-1,X="";return V.forEach(ee=>{const ge=ee.date.getDate()<=15?0:1,Ae=ee.date.getMonth(),Ye=ee.date.getFullYear(),$e=fe(ee.date,"MMM"),Le=new Date(Ye,Ae+1,0).getDate(),Ue=ge===0?`${$e} 1 - 15`:`${$e} 16 - ${Le}`;ge!==E||Ae!==$||Ye!==K?(E!==-1&&S.push({label:X,width:N}),E=ge,$=Ae,K=Ye,N=u,X=Ue):N+=u}),E!==-1&&S.push({label:X,width:N}),S},[V,u]),me=j.useMemo(()=>ce(),[ce]),Se=j.useMemo(()=>de(),[de]),oe=j.useMemo(()=>V.length*u,[V.length,u]),Te=j.useMemo(()=>{const S=new Date;return S.setHours(0,0,0,0),S},[]),Ce=j.useMemo(()=>{if(!t.showTodayLine)return null;const S=O(Te);return S>=-u&&S<=oe+u?Math.max(0,Math.min(S,oe)):null},[t.showTodayLine,Te,oe,u,O]),ke=j.useMemo(()=>{if(t.projectStartDate)return Be(t.projectStartDate);if(n.length>0){const S=n.map(E=>E.start.getTime());return Be(new Date(Math.min(...S)))}return null},[t.projectStartDate,n]),Me=j.useMemo(()=>{if(!t.showProjectStartLine||!ke)return null;const S=O(ke);return S>=-u&&S<=oe+u?Math.max(0,Math.min(S,oe)):null},[t.showProjectStartLine,ke,oe,u,O]);return e.jsxs("div",{className:"gantt-timeline-container",ref:k,onMouseMove:Q,onMouseUp:ne,style:{width:oe,position:"relative"},children:[(t.todayLineLabel||t.projectStartLineLabel)&&e.jsxs("div",{style:{position:"absolute",top:"-40px",left:0,right:0,height:"32px",zIndex:100,pointerEvents:"none"},children:[Ce!==null&&t.todayLineLabel&&e.jsx("div",{className:"gantt-today-line-label",style:{position:"absolute",top:"0",left:`${Ce}px`,transform:"translateX(-50%)",backgroundColor:t.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",...t.todayLineLabelStyle},children:t.todayLineLabel}),Me!==null&&t.projectStartLineLabel&&e.jsx("div",{className:"gantt-project-start-line-label",style:{position:"absolute",top:"0",left:`${Me}px`,transform:"translateX(-50%)",backgroundColor:t.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",...t.projectStartLineLabelStyle},children:t.projectStartLineLabel})]}),e.jsxs("div",{className:"gantt-timeline-header",style:{width:oe,minWidth:oe,position:"relative"},children:[e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-month",style:{width:oe},children:me.map((S,E)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:S.width,minWidth:S.width,maxWidth:S.width,borderRight:E===me.length-1?"none":"var(--wx-gantt-border)"},children:S.label},`top-${E}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-range",style:{width:oe},children:Se.map((S,E)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:S.width,minWidth:S.width,maxWidth:S.width,borderRight:E===Se.length-1?"none":"var(--wx-gantt-border)"},children:S.label},`mid-${E}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-day",style:{width:oe},children:V.map((S,E)=>{const N=t.weekends&&ht(S.date),$=t.holidays&&pt(S.date,t.holidays);return e.jsx("div",{className:`gantt-timeline-cell ${N?"weekend":""} ${$?"holiday":""}`,style:{width:u,minWidth:u,maxWidth:u,borderRight:E===V.length-1?"none":"var(--wx-gantt-border)"},children:S.label},`day-${E}`)})})]}),e.jsxs("div",{className:"gantt-timeline-body",style:{width:oe,position:"relative"},children:[Ce!==null&&e.jsx("div",{className:"gantt-today-line",style:{position:"absolute",left:`${Ce}px`,top:0,bottom:0,width:`${t.todayLineWidth||1}px`,backgroundColor:t.todayLineColor||"#ff4d4f",opacity:t.todayLineOpacity!==void 0?t.todayLineOpacity:1,borderLeft:t.todayLineStyle==="dashed"?`${t.todayLineWidth||1}px dashed ${t.todayLineColor||"#ff4d4f"}`:t.todayLineStyle==="dotted"?`${t.todayLineWidth||1}px dotted ${t.todayLineColor||"#ff4d4f"}`:"none",zIndex:6,pointerEvents:"none"}}),Me!==null&&e.jsx("div",{className:"gantt-project-start-line",style:{position:"absolute",left:`${Me}px`,top:0,bottom:0,width:`${t.projectStartLineWidth||1}px`,backgroundColor:t.projectStartLineColor||"#40a9ff",opacity:t.projectStartLineOpacity!==void 0?t.projectStartLineOpacity:1,borderLeft:t.projectStartLineStyle==="dashed"?`${t.projectStartLineWidth||1}px dashed ${t.projectStartLineColor||"#40a9ff"}`:t.projectStartLineStyle==="dotted"?`${t.projectStartLineWidth||1}px dotted ${t.projectStartLineColor||"#40a9ff"}`:"none",zIndex:6,pointerEvents:"none"}}),e.jsx("div",{className:"gantt-timeline-grid",children:V.map((S,E)=>{const N=t.weekends&&ht(S.date),$=t.holidays&&pt(S.date,t.holidays);return e.jsx("div",{className:`gantt-timeline-grid-column ${N?"weekend":""} ${$?"holiday":""}`,style:{width:u,minWidth:u}},E)})}),a.length>0&&e.jsx(or,{links:a,tasks:x,getTaskPosition:w}),e.jsx("div",{className:"gantt-timeline-tasks",style:{width:oe},children:x.map(S=>{const E=re(S),N=P?b?.get(S.id):void 0,$=N?ye(N):void 0;return e.jsxs("div",{className:"gantt-timeline-row",children:[N&&$&&S.type!=="milestone"&&e.jsx("div",{className:"gantt-baseline-bar",style:{left:`${$.left}px`,width:`${$.width}px`},title:`Baseline: ${N.start.toLocaleDateString()} - ${N.end.toLocaleDateString()}`}),e.jsx(Ot,{task:S,position:E,selected:g===S.id,dragging:L.taskId===S.id,dragDeltaX:L.dragDeltaX,dragType:L.type,onClick:()=>y(S.id),onDragStart:(K,X,ee)=>{f(S.id,K,X,ee),i(S.id,K,X)},readonly:t.readonly})]},S.id)})})]})]})});xt.displayName="Timeline";const yt=j.forwardRef((n,a)=>e.jsx("div",{className:"gantt-chart-wrapper",style:{flex:1,minWidth:0},children:e.jsx(xt,{...n,ref:a})}));yt.displayName="Chart";const{Search:lr}=l.Input,Nt=({onFilterChange:n,owners:a=[],uiConfig:s={}})=>{const[o,t]=j.useState({searchText:"",status:"all",priority:"all",owner:""}),g=c=>{const v={...o,...c};t(v),n(v)},y=()=>{const c={searchText:"",status:"all",priority:"all",owner:""};t(c),n(c)},i=o.searchText!==""||o.status!=="all"||o.priority!=="all"||o.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(lr,{placeholder:s.searchPlaceholder||"Search tasks...",value:o.searchText,onChange:c=>g({searchText:c.target.value}),allowClear:!0,className:"gantt-search-antd",style:{width:250}})}),e.jsxs("div",{className:"gantt-filter-right",children:[e.jsx(l.Select,{value:o.status,onChange:c=>g({status:c}),className:"gantt-filter-select-antd",style:{width:140},options:[{value:"all",label:s.statusOptions?.all||"All Status"},{value:"not-started",label:s.statusOptions?.notStarted||"Not Started"},{value:"in-progress",label:s.statusOptions?.inProgress||"In Progress"},{value:"completed",label:s.statusOptions?.completed||"Completed"}]}),e.jsx(l.Select,{value:o.priority,onChange:c=>g({priority:c}),className:"gantt-filter-select-antd",style:{width:130},options:[{value:"all",label:s.priorityFilterOptions?.all||"All Priority"},{value:"low",label:s.priorityFilterOptions?.low||"Low"},{value:"medium",label:s.priorityFilterOptions?.medium||"Medium"},{value:"high",label:s.priorityFilterOptions?.high||"High"}]}),e.jsx(l.Select,{value:o.owner||void 0,onChange:c=>g({owner:c||""}),className:"gantt-filter-select-antd",style:{width:130},placeholder:s.allOwnersText||"All Owners",allowClear:!0,options:[{value:"",label:s.allOwnersText||"All Owners"},...(a||[]).map(c=>({value:c,label:c}))]}),i&&e.jsx(l.Button,{type:"default",danger:!0,icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faTimesCircle}),onClick:y,className:"gantt-filter-clear-antd",children:s.clearFiltersText||"Clear"})]})]})})},At=(n,a)=>n.filter(s=>{if(a.searchText){const o=a.searchText.toLowerCase(),t=s.text.toLowerCase().includes(o),g=s.owner?.toLowerCase().includes(o),y=s.details?.toLowerCase().includes(o);if(!t&&!g&&!y)return!1}if(a.status!=="all"&&(s.progress===0?"not-started":s.progress===100?"completed":"in-progress")!==a.status||a.priority!=="all"&&s.priority!==a.priority||a.owner&&s.owner!==a.owner)return!1;if(a.dateRange){const o=s.start.getTime(),t=a.dateRange.start.getTime(),g=a.dateRange.end.getTime();if(o<t||o>g)return!1}return!0}),Ne=(n,a)=>n?typeof n=="string"?e.jsx(J.FontAwesomeIcon,{icon:a}):n:e.jsx(J.FontAwesomeIcon,{icon:a}),It=({zoomLevel:n,setZoomLevel:a,onExport:s,onFilterChange:o,owners:t,onAddTask:g,uiConfig:y,iconConfig:i={}})=>{const c=y.showZoomButtons!==!1,v=y.showExportButtons!==!1,h=c&&v;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(l.Space,{size:8,children:y.showAddTaskButton!==!1&&e.jsx(l.Button,{type:"primary",icon:Ne(i.addTask,Y.faPlus),onClick:()=>g?.(),children:y.addTaskButtonText||"New Task"})})}),e.jsx("div",{className:"gantt-toolbar-right",children:e.jsxs(l.Space,{size:4,children:[c&&e.jsxs(e.Fragment,{children:[e.jsx(l.Tooltip,{title:y.zoomOutTooltip||"Zoom Out",children:e.jsx(l.Button,{icon:Ne(i.zoomOut,Y.faSearchMinus),onClick:()=>a(Math.max(.5,n-.25))})}),e.jsx(l.Tooltip,{title:y.zoomInTooltip||"Zoom In",children:e.jsx(l.Button,{icon:Ne(i.zoomIn,Y.faSearchPlus),onClick:()=>a(Math.min(2,n+.25))})}),e.jsx(l.Tooltip,{title:y.resetZoomTooltip||"Reset Zoom",children:e.jsx(l.Button,{icon:Ne(i.resetZoom,Y.faRotateLeft),onClick:()=>a(1)})})]}),h&&e.jsx(l.Divider,{type:"vertical",style:{height:24,margin:"0 4px"}}),v&&e.jsxs(e.Fragment,{children:[e.jsx(l.Tooltip,{title:y.exportCSVTooltip||"Export to CSV",children:e.jsx(l.Button,{icon:Ne(i.exportCSV,Y.faFileCsv),onClick:()=>s("csv")})}),e.jsx(l.Tooltip,{title:y.exportExcelTooltip||"Export to Excel",children:e.jsx(l.Button,{icon:Ne(i.exportExcel,Y.faFileExcel),onClick:()=>s("excel")})}),e.jsx(l.Tooltip,{title:y.exportJSONTooltip||"Export to JSON",children:e.jsx(l.Button,{icon:Ne(i.exportJSON,Y.faFileCode),onClick:()=>s("json")})}),e.jsx(l.Tooltip,{title:y.exportPDFTooltip||"Export to PDF",children:e.jsx(l.Button,{icon:Ne(i.exportPDF,Y.faFilePdf),onClick:()=>s("pdf")})})]})]})})]}),y.showFilterSearch!==!1&&e.jsx(Nt,{onFilterChange:o,owners:t,uiConfig:y})]})},{Option:We}=l.Select,{TextArea:cr}=l.Input,_t=({onCreateTask:n,onClose:a,uiConfig:s={},parentId:o,parentTaskName:t})=>{const[g]=l.Form.useForm(),y=i=>{const c=i.start.toDate(),v=new Date(c);v.setDate(v.getDate()+(i.duration||1)),n({text:i.text,start:c,end:v,duration:i.duration||1,progress:i.progress||0,type:i.type,color:typeof i.color=="string"?i.color:i.color?.toHexString?.()||"#4A90E2",owner:i.owner||"",priority:i.priority||"medium",details:i.details||"",parent:o},o),a()};return e.jsx(l.Modal,{title:o?(s.taskCreatorTitle||"Create Subtask")+(t?` for "${t}"`:""):s.taskCreatorTitle||"Create New Task",open:!0,onCancel:a,onOk:()=>g.submit(),okText:s.taskCreatorOkText||"Create Task",cancelText:s.taskCreatorCancelText||"Cancel",width:600,className:"gantt-modal-antd",children:e.jsxs(l.Form,{form:g,layout:"vertical",onFinish:y,initialValues:{type:"task",priority:"medium",start:Lt(),duration:1,progress:0,color:"#4A90E2"},children:[e.jsx(l.Form.Item,{name:"text",label:s.taskNameLabel||"Task Name",rules:[{required:!0,message:s.taskNameRequired||"Please enter task name"}],children:e.jsx(l.Input,{placeholder:s.taskNamePlaceholder||"Enter task name",autoFocus:!0})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(l.Form.Item,{name:"type",label:s.typeLabel||"Type",style:{flex:1},children:e.jsxs(l.Select,{children:[e.jsx(We,{value:"task",children:s.taskTypeOptions?.task||"Task"}),e.jsx(We,{value:"milestone",children:s.taskTypeOptions?.milestone||"Milestone"}),e.jsx(We,{value:"project",children:s.taskTypeOptions?.project||"Project"})]})}),e.jsx(l.Form.Item,{name:"priority",label:s.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(l.Select,{children:[e.jsx(We,{value:"low",children:s.priorityOptions?.low||"Low"}),e.jsx(We,{value:"medium",children:s.priorityOptions?.medium||"Medium"}),e.jsx(We,{value:"high",children:s.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(l.Form.Item,{name:"start",label:s.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(l.DatePicker,{style:{width:"100%"}})}),e.jsx(l.Form.Item,{name:"duration",label:s.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(l.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(l.Form.Item,{name:"color",label:s.colorLabel||"Color",style:{flex:1},children:e.jsx(l.ColorPicker,{showText:!0})}),e.jsx(l.Form.Item,{name:"progress",label:s.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(l.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(l.Form.Item,{name:"owner",label:s.ownerLabel||"Owner",children:e.jsx(l.Input,{placeholder:s.ownerPlaceholder||"Assign to..."})}),e.jsx(l.Form.Item,{name:"details",label:s.detailsLabel||"Details",children:e.jsx(cr,{placeholder:s.detailsPlaceholder||"Add task description...",rows:3})})]})})},{Option:He}=l.Select,{TextArea:dr}=l.Input,{confirm:ur}=l.Modal,Bt=({task:n,onUpdate:a,onDelete:s,onClose:o,uiConfig:t={}})=>{const[g]=l.Form.useForm(),y=c=>{const v=c.start.toDate(),h=new Date(v);h.setDate(h.getDate()+(c.duration||1)),a({...n,text:c.text,start:v,end:h,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||""}),o()},i=()=>{ur({title:t.deleteConfirmTitle?`${t.deleteConfirmTitle}: "${n.text}"?`:`Are you sure you want to delete "${n.text}"?`,icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faExclamationTriangle,style:{color:"#faad14",marginRight:8}}),content:t.deleteConfirmContent||"This action cannot be undone.",okText:t.deleteConfirmOkText||"Yes, Delete",okType:"danger",cancelText:t.deleteConfirmCancelText||"No",onOk(){s(n.id),o()}})};return e.jsx(l.Modal,{title:t.taskEditorTitle||"Edit Task",open:!0,onCancel:o,footer:[e.jsx(l.Button,{danger:!0,onClick:i,style:{float:"left"},children:t.taskEditorDeleteText||"Delete"},"delete"),e.jsx(l.Button,{onClick:o,children:t.taskEditorCancelText||"Cancel"},"cancel"),e.jsx(l.Button,{type:"primary",onClick:()=>g.submit(),children:t.taskEditorSaveText||"Save Changes"},"submit")],width:600,className:"gantt-modal-antd",children:e.jsxs(l.Form,{form:g,layout:"vertical",onFinish:y,initialValues:{text:n.text,type:n.type||"task",priority:n.priority||"medium",start:Lt(n.start),duration:n.duration,progress:n.progress,color:n.color||"#4A90E2",owner:n.owner||"",details:n.details||""},children:[e.jsx(l.Form.Item,{name:"text",label:t.taskNameLabel||"Task Name",rules:[{required:!0,message:t.taskNameRequired||"Please enter task name"}],children:e.jsx(l.Input,{placeholder:t.taskNamePlaceholder||"Enter task name"})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(l.Form.Item,{name:"type",label:t.typeLabel||"Type",style:{flex:1},children:e.jsxs(l.Select,{children:[e.jsx(He,{value:"task",children:t.taskTypeOptions?.task||"Task"}),e.jsx(He,{value:"milestone",children:t.taskTypeOptions?.milestone||"Milestone"}),e.jsx(He,{value:"project",children:t.taskTypeOptions?.project||"Project"})]})}),e.jsx(l.Form.Item,{name:"priority",label:t.priorityLabel||"Priority",style:{flex:1},children:e.jsxs(l.Select,{children:[e.jsx(He,{value:"low",children:t.priorityOptions?.low||"Low"}),e.jsx(He,{value:"medium",children:t.priorityOptions?.medium||"Medium"}),e.jsx(He,{value:"high",children:t.priorityOptions?.high||"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(l.Form.Item,{name:"start",label:t.startDateLabel||"Start Date",style:{flex:1},children:e.jsx(l.DatePicker,{style:{width:"100%"}})}),e.jsx(l.Form.Item,{name:"duration",label:t.durationLabel||"Duration (days)",style:{flex:1},children:e.jsx(l.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(l.Form.Item,{name:"color",label:t.colorLabel||"Color",style:{flex:1},children:e.jsx(l.ColorPicker,{showText:!0})}),e.jsx(l.Form.Item,{name:"progress",label:t.progressLabel||"Progress (%)",style:{flex:1},children:e.jsx(l.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(l.Form.Item,{name:"owner",label:t.ownerLabel||"Owner",children:e.jsx(l.Input,{placeholder:t.ownerPlaceholder||"Assign to..."})}),e.jsx(l.Form.Item,{name:"details",label:t.detailsLabel||"Details",children:e.jsx(dr,{placeholder:t.detailsPlaceholder||"Add task description...",rows:3})})]})})},{Title:nt,Text:be,Paragraph:Yt}=l.Typography,{Option:Pe}=l.Select,Rt=({task:n,allTasks:a,links:s,onAddDependency:o,onRemoveDependency:t,onClose:g})=>{const[y,i]=j.useState(""),[c,v]=j.useState("e2s"),[h,b]=j.useState(0),[k,x]=j.useState("day"),[p,u]=j.useState(""),P=s.filter(w=>w.target===n.id),L=s.filter(w=>w.source===n.id),f=a.filter(w=>w.id!==n.id&&w.id!==n.parent),M=()=>{if(y){const w=ft(h,k);o(y,n.id,c,w),i(""),b(0),x("day")}},A=()=>{if(!p.trim())return;const w=er(p.trim());if(!w){alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
15
+ Example: 3FS+10d`);return}const H=w.taskNumber-1,Q=a[H];if(!Q){alert(`Task ${w.taskNumber} not found`);return}const ne=rr(w.type),U=ft(w.lag,w.lagUnit);o(Q.id,n.id,ne,U),u("")},R=w=>{switch(w){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)"}},O=w=>{switch(w){case"e2s":return"blue";case"s2s":return"green";case"e2e":return"purple";case"s2e":return"orange"}},re=w=>!w||w===0?null:w>0?e.jsxs(l.Tag,{color:"warning",children:["+",w,"d lag"]}):e.jsxs(l.Tag,{color:"processing",children:[w,"d lead"]}),ye=(w,H)=>{const Q=a.find(ne=>ne.id===(H==="source"?w.source:w.target));return e.jsx(l.List.Item,{actions:[e.jsx(l.Button,{type:"text",danger:!0,icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faTrash}),onClick:()=>t(w.id),children:"Remove"})],children:e.jsx(l.List.Item.Meta,{title:e.jsxs(l.Space,{children:[e.jsx(be,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:Q?.text||(H==="source"?w.source:w.target)}),e.jsx(l.Tag,{color:O(w.type),children:R(w.type)}),re(w.lag)]}),description:e.jsxs(be,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:[Q?.owner&&`Owner: ${Q.owner}`,Q?.priority&&` • Priority: ${Q.priority}`]})})})};return e.jsxs(l.Modal,{title:e.jsxs(l.Space,{children:[e.jsx(J.FontAwesomeIcon,{icon:Y.faLink,style:{fontSize:"20px"}}),e.jsx(nt,{level:4,style:{margin:0,fontFamily:"IBM Plex Mono, monospace"},children:"Task Dependencies"})]}),open:!0,onCancel:g,width:900,footer:null,className:"gantt-dependency-modal",styles:{body:{maxHeight:"70vh",overflowY:"auto",fontFamily:"IBM Plex Sans, sans-serif"}},children:[e.jsx(l.Card,{size:"small",style:{marginBottom:24,backgroundColor:"#f5f5f5",borderColor:"#d9d9d9"},children:e.jsxs(l.Space,{direction:"vertical",size:4,children:[e.jsx(be,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace",fontSize:"16px"},children:n.text}),e.jsxs(be,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"13px"},children:[n.start.toLocaleDateString()," → ",n.end.toLocaleDateString(),n.owner&&` • Owner: ${n.owner}`,n.priority&&` • Priority: ${n.priority}`]})]})}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(nt,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(J.FontAwesomeIcon,{icon:Y.faArrowDown,style:{marginRight:"8px"}}),"Depends On (Predecessors)"]}),P.length===0?e.jsx(l.Alert,{message:"No dependencies",description:"This task doesn't depend on any other tasks.",type:"info",showIcon:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}}):e.jsx(l.List,{dataSource:P,renderItem:w=>ye(w,"source"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(nt,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(J.FontAwesomeIcon,{icon:Y.faArrowUp,style:{marginRight:"8px"}}),"Dependents (Successors)"]}),L.length===0?e.jsx(l.Alert,{message:"No dependent tasks",description:"No other tasks depend on this task.",type:"info",showIcon:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}}):e.jsx(l.List,{dataSource:L,renderItem:w=>ye(w,"target"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsx(l.Divider,{}),e.jsx(l.Card,{title:e.jsxs(nt,{level:5,style:{margin:0,fontFamily:"IBM Plex Mono, monospace",fontSize:"14px"},children:[e.jsx(J.FontAwesomeIcon,{icon:Y.faPlus,style:{marginRight:"8px"}}),"Add New Dependency"]}),style:{marginBottom:24},children:e.jsxs(l.Space,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsxs("div",{children:[e.jsx(be,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Quick Add (Keyboard Shortcut):"}),e.jsx(be,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px",display:"block",marginBottom:8},children:"Format: [TaskNumber][Type][+/-][Lag][Unit] • Example: 3FS+10d, 5SS-2w"}),e.jsxs(l.Space.Compact,{style:{width:"100%"},children:[e.jsx(l.Input,{placeholder:"e.g., 3FS+10d",value:p,onChange:w=>u(w.target.value),onPressEnter:A,size:"large",style:{fontFamily:"IBM Plex Mono, monospace"}}),e.jsx(l.Button,{type:"primary",size:"large",onClick:A,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Add"})]})]}),e.jsx(l.Divider,{style:{margin:"8px 0"},children:"OR"}),e.jsxs("div",{children:[e.jsx(be,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Select Task:"}),e.jsx(l.Select,{placeholder:"Choose a task...",value:y||void 0,onChange:i,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",showSearch:!0,filterOption:(w,H)=>String(H?.children||"").toLowerCase().includes(w.toLowerCase()),children:f.map(w=>e.jsx(Pe,{value:w.id,children:w.text},w.id))})]}),e.jsxs("div",{children:[e.jsx(be,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Dependency Type:"}),e.jsxs(l.Select,{value:c,onChange:v,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",children:[e.jsxs(Pe,{value:"e2s",children:[e.jsx(l.Tag,{color:"blue",children:"FS"})," Finish-to-Start"]}),e.jsxs(Pe,{value:"s2s",children:[e.jsx(l.Tag,{color:"green",children:"SS"})," Start-to-Start"]}),e.jsxs(Pe,{value:"e2e",children:[e.jsx(l.Tag,{color:"purple",children:"FF"})," Finish-to-Finish"]}),e.jsxs(Pe,{value:"s2e",children:[e.jsx(l.Tag,{color:"orange",children:"SF"})," Start-to-Finish"]})]})]}),e.jsx("div",{children:e.jsxs(l.Space,{direction:"vertical",size:4,style:{width:"100%"},children:[e.jsx(be,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Lead/Lag Time:"}),e.jsx(be,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:"Negative = lead time (overlap), Positive = lag time (delay)"}),e.jsxs(l.Space.Compact,{style:{width:"100%"},children:[e.jsx(l.InputNumber,{value:h,onChange:w=>b(w||0),style:{flex:1,fontFamily:"IBM Plex Sans, sans-serif"},size:"large",placeholder:"0",min:-365,max:365}),e.jsxs(l.Select,{value:k,onChange:x,style:{width:120,fontFamily:"IBM Plex Sans, sans-serif"},size:"large",children:[e.jsx(Pe,{value:"day",children:"Days"}),e.jsx(Pe,{value:"hour",children:"Hours"}),e.jsx(Pe,{value:"week",children:"Weeks"}),e.jsx(Pe,{value:"month",children:"Months"})]})]})]})}),e.jsx(l.Button,{type:"primary",size:"large",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faPlus}),onClick:M,disabled:!y,block:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",fontWeight:600},children:"Add Dependency"})]})}),e.jsx(l.Alert,{message:e.jsxs(be,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace"},children:[e.jsx(J.FontAwesomeIcon,{icon:Y.faInfoCircle,style:{marginRight:"8px"}}),"Dependency Types Explained"]}),description:e.jsxs("div",{style:{fontFamily:"IBM Plex Sans, sans-serif"},children:[e.jsxs("ul",{style:{marginBottom:12,paddingLeft:20},children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Finish-to-Start (FS):"})," Successor starts after predecessor finishes"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Start-to-Start (SS):"})," Both tasks start at the same time"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Finish-to-Finish (FF):"})," Both tasks finish at the same time"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Start-to-Finish (SF):"})," Successor finishes when predecessor starts"]})]}),e.jsx(l.Divider,{style:{margin:"12px 0"}}),e.jsx(be,{strong:!0,style:{display:"block",marginBottom:4},children:"Keyboard Shortcuts:"}),e.jsx(Yt,{style:{margin:0,fontSize:"12px"},code:!0,children:"[TaskID][Type]+/-[Days]d"}),e.jsxs(Yt,{style:{margin:0,fontSize:"12px"},children:["Example: ",e.jsx("code",{children:"3FS+10d"})," = Task 3, Finish-to-Start, 10 days lag"]})]}),type:"info",showIcon:!0,icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faInfoCircle}),style:{marginTop:16}})]})},hr=({x:n,y:a,task:s,onEdit:o,onDelete:t,onCopy:g,onDependencies:y,onConvertToMilestone:i,onConvertToTask:c,onConvertToProject:v,onAutoSchedule:h,onClose:b,iconConfig:k})=>{if(!s)return null;const x=[{key:"edit",label:"Edit",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faEdit}),onClick:()=>{o(),b()}},{key:"copy",label:"Copy",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faCopy}),onClick:()=>{g(),b()}},{key:"dependencies",label:"Dependencies",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faLink}),onClick:()=>{y(),b()}},{type:"divider"},{key:"convert",label:"Convert to",type:"submenu",children:[{key:"milestone",label:"Milestone",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faFlag}),disabled:s.type==="milestone",onClick:()=>{i(),b()}},{key:"task",label:"Task",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faTasks}),disabled:s.type==="task",onClick:()=>{c(),b()}},{key:"project",label:"Project",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faFolder}),disabled:s.type==="project",onClick:()=>{v(),b()}}]},{key:"auto-schedule",label:"Auto Schedule",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faRotateLeft}),onClick:()=>{h?.(),b()}},{type:"divider"},{key:"delete",label:"Delete",icon:e.jsx(J.FontAwesomeIcon,{icon:Y.faTrash}),danger:!0,onClick:()=>{t(),b()}}];return e.jsx("div",{className:"gantt-context-menu",style:{position:"fixed",left:`${n}px`,top:`${a}px`,zIndex:1e4},onClick:p=>p.stopPropagation(),children:e.jsx(l.Menu,{items:x,style:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"6px",border:"1px solid #e0e0e0"}})})},zt=(n,a=[])=>{const[s,o]=j.useState([]),[t,g]=j.useState(-1),[y,i]=j.useState(n),[c,v]=j.useState(a);j.useEffect(()=>{i(n)},[n]),j.useEffect(()=>{v(a)},[a]);const h=j.useCallback((f,M,A)=>{const R={type:f,before:M,after:A,timestamp:Date.now()},O=s.slice(0,t+1);O.push(R),O.length>50?O.shift():g(t+1),o(O)},[s,t]),b=j.useCallback(()=>{if(t<0)return;const f=s[t];i(f.before.tasks),v(f.before.links),g(t-1)},[s,t]),k=j.useCallback(()=>{if(t>=s.length-1)return;const f=s[t+1];i(f.after.tasks),v(f.after.links),g(t+1)},[s,t]),x=t>=0,p=t<s.length-1,u=j.useCallback(f=>{const M={tasks:y,links:c},A=y.map(O=>O.id===f.id?f:O);h("task_update",M,{tasks:A,links:c}),i(A)},[y,c,h]),P=j.useCallback(f=>{const M={tasks:y,links:c},A=[...y,f];h("task_create",M,{tasks:A,links:c}),i(A)},[y,c,h]),L=j.useCallback(f=>{const M={tasks:y,links:c},A=y.filter(re=>re.id!==f),R=c.filter(re=>re.source!==f&&re.target!==f);h("task_delete",M,{tasks:A,links:R}),i(A),v(R)},[y,c,h]);return{tasks:y,links:c,setTasks:i,setLinks:v,undo:b,redo:k,canUndo:x,canRedo:p,updateTask:u,createTask:P,deleteTask:L,saveState:h,history:s}},Wt=(n,a,s={mode:"forward"})=>{const o=new Map,t=new Map;return n.forEach(g=>{o.set(g.id,[]),t.set(g.id,[])}),a.forEach(g=>{g.type==="e2s"&&(o.get(g.target)?.push(g.source),t.get(g.source)?.push(g.target))}),s.mode==="forward"?pr(n,o,s):fr(n,t,s)},pr=(n,a,s)=>{const o=new Map,t=new Set,g=s.projectStart||new Date,y=i=>{if(t.has(i))return;const c=n.find(p=>p.id===i);if(!c)return;const v=a.get(i)||[];v.forEach(p=>y(p));let h=g;v.forEach(p=>{const u=o.get(p);u&&u.end>h&&(h=new Date(u.end))});const b=new Date(h),k=le(b,c.duration,"day"),x={...c,start:b,end:k};o.set(i,x),t.add(i)};return n.forEach(i=>y(i.id)),n.map(i=>o.get(i.id)||i)},fr=(n,a,s)=>{const o=new Map,t=new Set,g=s.projectEnd||new Date(Math.max(...n.map(i=>i.end.getTime()))),y=i=>{if(t.has(i))return;const c=n.find(p=>p.id===i);if(!c)return;const v=a.get(i)||[];v.forEach(p=>y(p));let h=g;v.forEach(p=>{const u=o.get(p);u&&u.start<h&&(h=new Date(u.start))});const b=new Date(h),k=le(b,-c.duration,"day"),x={...c,start:k,end:b};o.set(i,x),t.add(i)};return n.forEach(i=>y(i.id)),n.map(i=>o.get(i.id)||i)},mr=Object.freeze(Object.defineProperty({__proto__:null,autoSchedule:Wt,levelResources:n=>{const a=new Map;n.forEach(o=>{o.owner&&(a.has(o.owner)||a.set(o.owner,[]),a.get(o.owner).push(o))});const s=[...n];return a.forEach((o,t)=>{const g=o.sort((y,i)=>y.start.getTime()-i.start.getTime());for(let y=1;y<g.length;y++){const i=g[y],c=g[y-1];if(i.start<c.end){const v=s.findIndex(h=>h.id===i.id);if(v>=0){const h=new Date(c.end),b=le(h,i.duration,"day");s[v]={...i,start:h,end:b}}}}}),s}},Symbol.toStringTag,{value:"Module"})),gt=n=>{const a=new Map;return n.forEach(s=>{a.set(s.id,{taskId:s.id,start:new Date(s.start),end:new Date(s.end)})}),a},Ht=n=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority"],s=n.map(t=>[t.id,t.text,fe(t.start,"YYYY-MM-DD"),fe(t.end,"YYYY-MM-DD"),t.duration.toString(),`${t.progress}%`,t.type||"task",t.owner||"",t.priority||"medium"]),o=[a.join(","),...s.map(t=>t.map(g=>`"${g}"`).join(","))].join(`
16
+ `);st(o,"gantt-tasks.csv","text/csv")},Ut=n=>{const a=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority","Details"],s=n.map(t=>[t.id,t.text,fe(t.start,"MM/DD/YYYY"),fe(t.end,"MM/DD/YYYY"),t.duration.toString(),t.progress.toString(),t.type||"task",t.owner||"",t.priority||"medium",t.details||""]),o="\uFEFF"+[a.join(" "),...s.map(t=>t.map(g=>g.replace(/\t/g," ")).join(" "))].join(`
17
+ `);st(o,"gantt-tasks.xls","application/vnd.ms-excel")},Vt=(n,a)=>{const s={tasks:n,links:a,exported:new Date().toISOString(),version:"1.0"},o=JSON.stringify(s,null,2);st(o,"gantt-project.json","application/json")},qt=n=>{const a=`
18
18
  GANTT CHART PROJECT
19
19
  Generated: ${new Date().toLocaleString()}
20
20
 
21
21
  Tasks:
22
- ${n.map((i,o)=>`
23
- ${o+1}. ${i.text}
24
- Start: ${pe(i.start,"MM/DD/YYYY")}
25
- End: ${pe(i.end,"MM/DD/YYYY")}
26
- Duration: ${i.duration} days
27
- Progress: ${i.progress}%
28
- ${i.owner?`Owner: ${i.owner}`:""}
22
+ ${n.map((s,o)=>`
23
+ ${o+1}. ${s.text}
24
+ Start: ${fe(s.start,"MM/DD/YYYY")}
25
+ End: ${fe(s.end,"MM/DD/YYYY")}
26
+ Duration: ${s.duration} days
27
+ Progress: ${s.progress}%
28
+ ${s.owner?`Owner: ${s.owner}`:""}
29
29
  `).join(`
30
30
  `)}
31
- `.trim();et(r,"gantt-report.txt","text/plain"),alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.")},hn=(n,r,i="png")=>{if(!document.getElementById(n)){alert("Could not find Gantt chart element to export");return}if(i==="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")},et=(n,r,i)=>{const o=new Blob([n],{type:i}),s=URL.createObjectURL(o);pn(s,r),URL.revokeObjectURL(s)},pn=(n,r)=>{const i=document.createElement("a");i.href=n,i.download=r,document.body.appendChild(i),i.click(),document.body.removeChild(i)},gn=Object.freeze(Object.defineProperty({__proto__:null,exportToCSV:Ot,exportToExcel:Lt,exportToImage:hn,exportToJSON:Rt,exportToPDF:Yt,importFromJSON:n=>new Promise((r,i)=>{const o=new FileReader;o.onload=s=>{try{const m=s.target?.result,d=JSON.parse(m),l=d.tasks.map(g=>({...g,start:new Date(g.start),end:new Date(g.end)}));r({tasks:l,links:d.links||[]})}catch{i(new Error("Invalid JSON file"))}},o.onerror=()=>i(new Error("Failed to read file")),o.readAsText(n)})},Symbol.toStringTag,{value:"Module"})),mn=[{name:"index",label:"",width:40,align:"center"},{name:"text",label:"Name",width:300,align:"left",resize:!0},{name:"predecessors",label:"Depends on",width:120,align:"left"},{name:"duration",label:"Duration",width:100,align:"left"},{name:"start",label:"Start",width:120,align:"left"},{name:"add",label:"",width:40,align:"center"}],yn=[{unit:"month",step:1,format:"MMM"},{unit:"day",step:1,format:"D"}],Bt=({tasks:n=[],links:r=[],config:i={},onTaskUpdate:o,onTaskCreate:s,onTaskDelete:m,onLinkCreate:d,onLinkDelete:l})=>{const g=Array.isArray(n)?n:[],v=Array.isArray(r)?r:[],{tasks:c,links:y,setTasks:D,setLinks:u,undo:f,redo:b,updateTask:k,createTask:h,deleteTask:x,saveState:A}=It(g,v),[I,z]=T.useState(c),[W,re]=T.useState(null),[ge,w]=T.useState(null),[U,X]=T.useState(!1),[ee,Y]=T.useState(!1),[se,le]=T.useState(null),[xe,fe]=T.useState(null),[q,M]=T.useState(null),[F,$]=T.useState(null),[P,K]=T.useState(null),[ie,ce]=T.useState(1),[Te,Se]=T.useState(new Map),[we,De]=T.useState(!1),[Me]=T.useState(i.theme||"light"),[Ie,Ne]=T.useState({searchText:"",status:"all",priority:"all",owner:""}),ut=T.useRef(null),_e=T.useRef(null),Oe=T.useRef(null),he={columns:mn,scales:yn,readonly:!1,editable:!0,taskHeight:28,rowHeight:44,scaleHeight:28,columnWidth:80,minColumnWidth:60,autoSchedule:!1,criticalPath:!1,baselines:we,weekends:!0,holidays:[],theme:Me,locale:"en",...i};T.useEffect(()=>{const j=Ft(c,Ie);z((B=>{const Z=[],ae=V=>{if(!V)return!1;const te=B.find(G=>G.id===V);return te&&!te.open&&te.type==="project"?!0:ae(te?.parent)};return B.forEach(V=>{ae(V.parent)||Z.push(V)}),Z})(j))},[c,Ie]);const tt=T.useMemo(()=>{if(!c||!Array.isArray(c))return[];try{return Array.from(new Set(c.map(j=>j?.owner).filter(Boolean)))}catch(j){return console.warn("Error extracting owners:",j),[]}},[c]),Le=(()=>{const j=I.length>0?I:c;if(j.length===0){const V=new Date;return{start:Ue(ue(V,-30,"day")),end:Ue(ue(V,60,"day"))}}const C=j.map(V=>V.start.getTime()),B=j.map(V=>V.end.getTime()),Z=new Date(Math.min(...C)),ae=new Date(Math.max(...B));return{start:Ue(ue(Z,-7,"day")),end:Ue(ae)}})(),ht=j=>{re(j)},pt=(j,C)=>{if(he.readonly)return;j.preventDefault();const B=c.find(Z=>Z.id===C);B&&K({x:j.clientX,y:j.clientY,task:B})},Ve=()=>{if(!P?.task)return;const j=P.task,C={...j,id:`task-${Date.now()}`,text:`${j.text} (Copy)`,start:ue(j.start,7,"day"),end:ue(j.end,7,"day")};h(C),s&&s(C)},Je=j=>{if(!P?.task)return;const C={...P.task,type:j};k(C),o&&o(C)},gt=(j,C,B,Z)=>{if(!he.readonly)if(Z==="reorder"){const ae=I.findIndex(G=>G.id===j),V=(G,oe)=>{let Ee=[];return oe.filter(me=>me.parent===G).forEach(me=>{Ee.push(me.id),Ee=[...Ee,...V(me.id,oe)]}),Ee},te=V(j,c);M({id:j,initialIndex:ae,currentY:B,descendantIds:te}),document.body.classList.add("gantt-dragging")}else fe(j)},nt=()=>{if(q&&F){const j=c.find(B=>B.id===q.id),C=c.find(B=>B.id===F.taskId);if(j&&C&&j.id!==C.id){const B=[j.id,...q.descendantIds];if(!B.includes(C.id)){const Z=[...c];let ae=F.position==="inside"?C.id:C.parent;const V=Z.findIndex(de=>de.id===j.id);V!==-1&&(Z[V]={...Z[V],parent:ae});const te=Z.filter(de=>B.includes(de.id)),G=Z.filter(de=>!B.includes(de.id));let oe=G.findIndex(de=>de.id===C.id);if(F.position==="inside"){const de=G.filter(me=>me.parent===C.id);de.length>0?oe=G.findIndex(me=>me.id===de[de.length-1].id)+1:oe++}else if(F.position==="below"){const de=(Xe,Ke)=>{let ke=[];return Ke.filter(Ye=>Ye.parent===Xe).forEach(Ye=>{ke.push(Ye.id),ke=[...ke,...de(Ye.id,Ke)]}),ke},me=de(C.id,G);me.length>0?oe=G.findIndex(Xe=>Xe.id===me[me.length-1])+1:oe++}const Ee={tasks:[...c],links:[...y]};G.splice(oe,0,...te),D(G),A("task_update",Ee,{tasks:G,links:y})}}}fe(null),M(null),$(null),document.body.classList.remove("gantt-dragging")},rt=j=>{if(q){const C=he.rowHeight||44,B=_e.current?.querySelector(".gantt-grid-body");if(!B)return;const Z=B.getBoundingClientRect(),ae=j.clientY-Z.top;let V=Math.floor(ae/C);V=Math.max(0,Math.min(V,I.length-1));const te=I[V];if(te){const G=ae-V*C;let oe="above";te.type==="project"?G<C*.3?oe="above":G>C*.7?oe="below":oe="inside":oe=G<C/2?"above":"below",te.id!==q.id?$({taskId:te.id,position:oe}):$(null)}M(G=>G?{...G,currentY:j.clientY}:null)}},Ge=()=>{q&&nt()},mt=j=>{const C={...j,id:`task-${Date.now()}`};h(C),s&&s(C)},Re=j=>{k(j),o&&o(j)},qe=j=>{x(j),m&&m(j)},st=(j,C,B,Z)=>{const ae={id:`link-${Date.now()}`,source:j,target:C,type:B,lag:Z};u([...y,ae]),d&&d(ae)},yt=j=>{const C=y.filter(B=>B.id!==j);u(C),l&&l(j)},xt=()=>{if(!we&&Te.size===0){const j=_t(c);Se(j),De(!0)}else De(!we)};return T.useEffect(()=>{const j=C=>{(C.ctrlKey||C.metaKey)&&(C.key==="z"&&!C.shiftKey?(C.preventDefault(),f()):(C.key==="y"||C.key==="z"&&C.shiftKey)&&(C.preventDefault(),b()))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[f,b]),e.jsxs("div",{className:`gantt-page-wrapper theme-${Me}`,children:[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:"Iris Gantt"})})}),e.jsxs("div",{className:`gantt-container theme-${he.theme}`,children:[e.jsx(Et,{zoomLevel:ie,setZoomLevel:ce,onBaselineToggle:xt,showBaselines:we,onExport:j=>{j==="csv"&&Ot(c),j==="excel"&&Lt(c),j==="json"&&Rt(c,y),j==="pdf"&&Yt(c)},onFilterChange:j=>Ne(j),owners:tt||[],onAddTask:()=>X(!0)}),e.jsxs("div",{className:"gantt-layout",ref:Oe,onMouseMove:rt,onMouseUp:Ge,onMouseLeave:Ge,children:[e.jsx(lt,{ref:_e,tasks:I,columns:he.columns||[],selectedTask:W,onTaskClick:ht,onTaskContextMenu:pt,onTaskUpdate:Re,onTaskDragStart:gt,onAddTask:()=>X(!0),onAddDependency:st,onDependencyClick:j=>{const C=c.find(B=>B.id===j);C&&(le(C),Y(!0))},links:y,allTasks:c,dropIndicator:F,reorderTask:q}),e.jsx(dt,{ref:ut,tasks:I,links:y,range:Le,scales:he.scales,config:he,selectedTask:W,draggedTask:xe,onTaskClick:()=>{},onTaskDragStart:()=>{},onTaskDragEnd:()=>{},onTaskUpdate:(j,C)=>{const B=c.find(Z=>Z.id===j);B&&Re({...B,...C})},zoomLevel:ie,baselines:we?Te:new Map})]}),U&&e.jsx(kt,{onCreateTask:mt,onClose:()=>X(!1)}),ge&&e.jsx($t,{task:ge,onUpdate:Re,onDelete:qe,onClose:()=>w(null)}),ee&&se&&e.jsx(At,{task:se,allTasks:c,links:y,onAddDependency:st,onRemoveDependency:yt,onClose:()=>{Y(!1),le(null)}}),P&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-context-menu-overlay",onClick:()=>K(null),onContextMenu:j=>{j.preventDefault(),K(null)}}),e.jsx(cn,{x:P.x,y:P.y,task:P.task,onEdit:()=>{P.task&&w(P.task)},onDelete:()=>{P.task&&qe(P.task.id)},onCopy:Ve,onDependencies:()=>{P.task&&(le(P.task),Y(!0))},onConvertToMilestone:()=>Je("milestone"),onConvertToTask:()=>Je("task"),onConvertToProject:()=>Je("project"),onClose:()=>K(null),onAutoSchedule:()=>{const j=Nt(c,y,{mode:"forward"});D(j),K(null)}})]}),q&&e.jsx("div",{className:"gantt-grid-row ghost-row",style:{height:he.rowHeight,top:q.currentY-(he.rowHeight||48)/2,left:_e.current?.getBoundingClientRect().left,position:"fixed",pointerEvents:"none",opacity:.8,zIndex:9999,width:_e.current?.offsetWidth,backgroundColor:"#ffffff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #2196F3",display:"flex"},children:he.columns?.map(j=>e.jsx("div",{className:"gantt-grid-cell",style:{width:j.width,textAlign:j.align||"left"},children:(()=>{const C=c.find(B=>B.id===q.id);if(!C)return null;if(j.template)return j.template(C);switch(j.name){case"text":return e.jsxs("div",{className:"gantt-grid-cell-text",children:[e.jsx(L.FontAwesomeIcon,{icon:O.faGripVertical,style:{marginRight:8,color:"#adb5bd"}}),e.jsxs("span",{className:"gantt-task-name-text",children:[C.text,q.descendantIds.length>0&&e.jsxs("span",{children:[" +",q.descendantIds.length," subtasks"]})]})]});case"start":return pe(C.start,"DD MMM YYYY");case"duration":return`${C.duration}`;default:return C[j.name]||""}})()},`ghost-${j.name}`))})]})]})},xn=Object.freeze(Object.defineProperty({__proto__:null,calculateCriticalPath:(n,r)=>{const i=new Set,o=new Map,s=new Map,m=new Map;n.forEach(u=>{s.set(u.id,[]),m.set(u.id,[])}),r.forEach(u=>{u.type==="e2s"&&(s.get(u.source)?.push(u.target),m.get(u.target)?.push(u.source))});const d=new Map,l=new Map,g=(u,f=new Set)=>{if(f.has(u))return;f.add(u);const b=n.find(h=>h.id===u);if(!b)return;const k=m.get(u)||[];if(k.length===0)d.set(u,0),l.set(u,b.duration);else{let h=0;k.forEach(x=>{g(x,f);const A=l.get(x)||0;h=Math.max(h,A)}),d.set(u,h),l.set(u,h+b.duration)}};n.forEach(u=>g(u.id));const v=new Map,c=new Map,y=Math.max(...Array.from(l.values())),D=(u,f=new Set)=>{if(f.has(u))return;f.add(u);const b=n.find(h=>h.id===u);if(!b)return;const k=s.get(u)||[];if(k.length===0)c.set(u,y),v.set(u,y-b.duration);else{let h=1/0;k.forEach(x=>{D(x,f);const A=v.get(x)||0;h=Math.min(h,A)}),c.set(u,h),v.set(u,h-b.duration)}};return n.forEach(u=>D(u.id)),n.forEach(u=>{const f=d.get(u.id)||0,k=(v.get(u.id)||0)-f;o.set(u.id,k),Math.abs(k)<.01&&i.add(u.id)}),{criticalTasks:i,taskFloats:o,projectDuration:y}},getTaskFloat:(n,r)=>r.taskFloats.get(n)||0,isCriticalTask:(n,r)=>r.criticalTasks.has(n)},Symbol.toStringTag,{value:"Module"}));N.AutoScheduler=fn,N.Chart=dt,N.CriticalPath=xn,N.DependencyEditor=At,N.ExportUtils=gn,N.FilterSearch=Ct,N.Gantt=Bt,N.Grid=lt,N.TaskBar=Mt,N.TaskCreator=kt,N.TaskEditor=$t,N.Timeline=ct,N.Toolbar=Et,N.addToDate=ue,N.applyFilters=Ft,N.calculateDuration=qt,N.createBaseline=_t,N.default=Bt,N.formatDate=pe,N.getDaysBetween=We,N.getEndOfDay=Gt,N.getHoursBetween=Tt,N.getStartOfDay=Ue,N.isHoliday=at,N.isWeekend=it,N.useUndoRedo=It,Object.defineProperties(N,{__esModule:{value:!0},[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=(n,a,s="png")=>{if(!document.getElementById(n)){alert("Could not find Gantt chart element to export");return}if(s==="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=(n,a,s)=>{const o=new Blob([n],{type:s}),t=URL.createObjectURL(o);yr(t,a),URL.revokeObjectURL(t)},yr=(n,a)=>{const s=document.createElement("a");s.href=n,s.download=a,document.body.appendChild(s),s.click(),document.body.removeChild(s)},gr=Object.freeze(Object.defineProperty({__proto__:null,exportToCSV:Ht,exportToExcel:Ut,exportToImage:xr,exportToJSON:Vt,exportToPDF:qt,importFromJSON:n=>new Promise((a,s)=>{const o=new FileReader;o.onload=t=>{try{const g=t.target?.result,y=JSON.parse(g),i=y.tasks.map(c=>({...c,start:new Date(c.start),end:new Date(c.end)}));a({tasks:i,links:y.links||[]})}catch{s(new Error("Invalid JSON file"))}},o.onerror=()=>s(new Error("Failed to read file")),o.readAsText(n)})},Symbol.toStringTag,{value:"Module"})),wr=n=>[{name:"index",label:"",width:40,align:"center"},{name:"text",label:n?.columnLabels?.name||"Name",width:250,align:"left",resize:!0},{name:"predecessors",label:n?.columnLabels?.dependsOn||"Depends on",width:120,align:"left"},{name:"duration",label:n?.columnLabels?.duration||"Duration",width:110,align:"left"},{name:"start",label:n?.columnLabels?.start||"Start",width:130,align:"left"},{name:"add",label:"",width:50,align:"center"}],jr=[{unit:"month",step:1,format:"MMM"},{unit:"day",step:1,format:"D"}],br={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"},vr=({tasks:n=[],links:a=[],config:s={},uiConfig:o={},styleConfig:t={},iconConfig:g={},onTaskUpdate:y,onTaskCreate:i,onTaskDelete:c,onLinkCreate:v,onLinkDelete:h})=>{const b={...br,...o},k=j.useMemo(()=>{const d={};return t.primary&&(d["--wx-gantt-primary"]=t.primary),t.primarySelected&&(d["--wx-gantt-primary-selected"]=t.primarySelected),t.success&&(d["--wx-gantt-success"]=t.success),t.warning&&(d["--wx-gantt-warning"]=t.warning),t.danger&&(d["--wx-gantt-danger"]=t.danger),t.background&&(d["--wx-gantt-background"]=t.background),t.backgroundAlt&&(d["--wx-gantt-background-alt"]=t.backgroundAlt),t.backgroundHover&&(d["--wx-gantt-background-hover"]=t.backgroundHover),t.selectColor&&(d["--wx-gantt-select-color"]=t.selectColor),t.taskColor&&(d["--wx-gantt-task-color"]=t.taskColor),t.taskFillColor&&(d["--wx-gantt-task-fill-color"]=t.taskFillColor),t.projectColor&&(d["--wx-gantt-project-color"]=t.projectColor),t.milestoneColor&&(d["--wx-gantt-milestone-color"]=t.milestoneColor),t.fontColor&&(d["--wx-gantt-font-color"]=t.fontColor),t.fontColorAlt&&(d["--wx-gantt-font-color-alt"]=t.fontColorAlt),t.iconColor&&(d["--wx-gantt-icon-color"]=t.iconColor),t.borderColor&&(d["--wx-gantt-border-color"]=t.borderColor),t.fontFamily&&(d["--wx-gantt-font-family"]=t.fontFamily),t.fontMono&&(d["--wx-gantt-font-mono"]=t.fontMono),t.fontSize&&(d["--wx-gantt-font-size"]=t.fontSize),t.fontWeight&&(d["--wx-gantt-font-weight"]=String(t.fontWeight)),t.lineHeight&&(d["--wx-gantt-line-height"]=String(t.lineHeight)),t.spacingXS&&(d["--gantt-spacing-xs"]=t.spacingXS),t.spacingSM&&(d["--gantt-spacing-sm"]=t.spacingSM),t.spacingMD&&(d["--gantt-spacing-md"]=t.spacingMD),t.spacingLG&&(d["--gantt-spacing-lg"]=t.spacingLG),t.customCSSVariables&&Object.entries(t.customCSSVariables).forEach(([T,C])=>{d[T.startsWith("--")?T:`--${T}`]=C}),d},[t]),x=Array.isArray(n)?n:[],p=Array.isArray(a)?a:[],{tasks:u,links:P,setTasks:L,setLinks:f,undo:M,redo:A,updateTask:R,createTask:O,deleteTask:re,saveState:ye}=zt(x,p),[w,H]=j.useState(u),[Q,ne]=j.useState(null),[U,V]=j.useState(null),[ce,de]=j.useState(!1),[me,Se]=j.useState(void 0),[oe,Te]=j.useState(void 0),[Ce,ke]=j.useState(!1),[Me,S]=j.useState(null),[E,N]=j.useState(null),[$,K]=j.useState(null),[X,ee]=j.useState(null),[se,ge]=j.useState(null),[Ae,Ye]=j.useState(1),[$e,Le]=j.useState(()=>x.length>0?gt(x):new Map),Ue=!0,[Qe]=j.useState(s.theme||"light"),[Re,wt]=j.useState({searchText:"",status:"all",priority:"all",owner:""}),at=j.useRef(null),Oe=j.useRef(null),jt=j.useRef(null),Ie=j.useRef(!1),De=j.useRef(null),we={columns:s.columns||wr(o),scales:jr,readonly:!1,editable:!0,taskHeight:28,rowHeight:44,scaleHeight:28,columnWidth:80,minColumnWidth:60,autoSchedule:!1,criticalPath:!1,baselines:!0,weekends:!0,holidays:[],theme:Qe,locale:"en",showTodayLine:s.showTodayLine!==!1,todayLineColor:s.todayLineColor||"#ff4d4f",todayLineLabel:s.todayLineLabel,todayLineWidth:s.todayLineWidth||1,todayLineStyle:s.todayLineStyle||"solid",todayLineOpacity:s.todayLineOpacity!==void 0?s.todayLineOpacity:1,todayLineLabelStyle:s.todayLineLabelStyle,showProjectStartLine:s.showProjectStartLine!==!1,projectStartDate:s.projectStartDate,projectStartLineColor:s.projectStartLineColor||"#40a9ff",projectStartLineLabel:s.projectStartLineLabel,projectStartLineWidth:s.projectStartLineWidth||1,projectStartLineStyle:s.projectStartLineStyle||"solid",projectStartLineOpacity:s.projectStartLineOpacity!==void 0?s.projectStartLineOpacity:1,projectStartLineLabelStyle:s.projectStartLineLabelStyle,...s};j.useEffect(()=>{const d=At(u,Re);H((C=>{const G=[],ue=q=>{if(!q)return!1;const he=C.find(Z=>Z.id===q);return he&&!he.open&&he.type==="project"?!0:ue(he?.parent)};return C.forEach(q=>{ue(q.parent)||G.push(q)}),G})(d))},[u,Re]);const ot=j.useMemo(()=>{if(!u||!Array.isArray(u))return[];try{return Array.from(new Set(u.map(d=>d?.owner).filter(Boolean)))}catch(d){return console.warn("Error extracting owners:",d),[]}},[u]),it=(()=>{const d=w.length>0?w:u;if(d.length===0){const q=new Date;return{start:Be(le(q,-30,"day")),end:Be(le(q,60,"day"))}}const T=d.map(q=>q.start.getTime()),C=d.map(q=>q.end.getTime()),G=new Date(Math.min(...T)),ue=new Date(Math.max(...C));return{start:Be(le(G,-7,"day")),end:Be(ue)}})(),lt=d=>{ne(d)},bt=(d,T)=>{if(we.readonly)return;d.preventDefault();const C=u.find(G=>G.id===T);C&&ge({x:d.clientX,y:d.clientY,task:C})},vt=()=>{if(!se?.task)return;const d=se.task,T={...d,id:`task-${Date.now()}`,text:`${d.text} (Copy)`,start:le(d.start,7,"day"),end:le(d.end,7,"day")};O(T),i&&i(T)},et=d=>{if(!se?.task)return;const T={...se.task,type:d};R(T),y&&y(T)},St=(d,T,C,G)=>{if(!we.readonly)if(G==="reorder"){const ue=w.findIndex(Z=>Z.id===d),q=(Z,pe)=>{let _e=[];return pe.filter(r=>r.parent===Z).forEach(r=>{_e.push(r.id),_e=[..._e,...q(r.id,pe)]}),_e},he=q(d,u);K({id:d,initialIndex:ue,currentY:C,descendantIds:he}),document.body.classList.add("gantt-dragging")}else N(d)},Tt=()=>{if($&&X){const d=u.find(C=>C.id===$.id),T=u.find(C=>C.id===X.taskId);if(d&&T&&d.id!==T.id){const C=[d.id,...$.descendantIds];if(!C.includes(T.id)){const G=[...u];let ue=X.position==="inside"?T.id:T.parent;const q=G.findIndex(ie=>ie.id===d.id);q!==-1&&(G[q]={...G[q],parent:ue});const he=G.filter(ie=>C.includes(ie.id)),Z=G.filter(ie=>!C.includes(ie.id));let pe=Z.findIndex(ie=>ie.id===T.id);if(X.position==="inside"){const ie=Z.filter(r=>r.parent===T.id);ie.length>0?pe=Z.findIndex(r=>r.id===ie[ie.length-1].id)+1:pe++}else if(X.position==="below"){const ie=(m,D)=>{let F=[];return D.filter(z=>z.parent===m).forEach(z=>{F.push(z.id),F=[...F,...ie(z.id,D)]}),F},r=ie(T.id,Z);r.length>0?pe=Z.findIndex(m=>m.id===r[r.length-1])+1:pe++}const _e={tasks:[...u],links:[...P]};Z.splice(pe,0,...he),L(Z),ye("task_update",_e,{tasks:Z,links:P})}}}N(null),K(null),ee(null),document.body.classList.remove("gantt-dragging")},tt=j.useRef(null),Dt=j.useCallback(d=>{$&&(tt.current&&cancelAnimationFrame(tt.current),tt.current=requestAnimationFrame(()=>{const T=we.rowHeight||44,C=Oe.current?.querySelector(".gantt-grid-body");if(!C)return;const G=C.getBoundingClientRect(),ue=d.clientY-G.top;let q=Math.floor(ue/T);q=Math.max(0,Math.min(q,w.length-1));const he=w[q];if(he){const Z=ue-q*T;let pe="above";he.type==="project"?Z<T*.3?pe="above":Z>T*.7?pe="below":pe="inside":pe=Z<T/2?"above":"below",he.id!==$.id?ee({taskId:he.id,position:pe}):ee(null)}K(Z=>Z?{...Z,currentY:d.clientY}:null)}))},[$,w,we.rowHeight]),Ve=()=>{$&&Tt()},ct=(d,T)=>{const C={...d,id:`task-${Date.now()}`,parent:T};O(C),i&&i(C)},Ee=d=>{R(d),y&&y(d)},qe=d=>{re(d),c&&c(d)},Je=(d,T,C,G)=>{const ue={id:`link-${Date.now()}`,source:d,target:T,type:C,lag:G};f([...P,ue]),v&&v(ue)},dt=d=>{const T=P.filter(C=>C.id!==d);f(T),h&&h(d)};j.useEffect(()=>{if(u.length>0){const d=gt(u);Le(d)}else Le(new Map)},[u]),j.useEffect(()=>{const d=T=>{(T.ctrlKey||T.metaKey)&&(T.key==="z"&&!T.shiftKey?(T.preventDefault(),M()):(T.key==="y"||T.key==="z"&&T.shiftKey)&&(T.preventDefault(),A()))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[M,A]),j.useEffect(()=>{const d=Oe.current?.querySelector(".gantt-grid-body"),T=at.current?.querySelector(".gantt-timeline-body");if(!d||!T)return;const C=()=>{Ie.current||(Ie.current=!0,T.scrollTop=d.scrollTop,De.current&&clearTimeout(De.current),De.current=window.setTimeout(()=>{Ie.current=!1},150))},G=()=>{Ie.current||(Ie.current=!0,d.scrollTop=T.scrollTop,De.current&&clearTimeout(De.current),De.current=window.setTimeout(()=>{Ie.current=!1},150))};return d.addEventListener("scroll",C,{passive:!0}),T.addEventListener("scroll",G,{passive:!0}),()=>{d.removeEventListener("scroll",C),T.removeEventListener("scroll",G),De.current&&clearTimeout(De.current)}},[w]);const kt={height:s.containerHeight||"100%",minHeight:s.containerMinHeight||"400px"},ut=s.gridWidth?{"--gantt-grid-width":s.gridWidth}:{};return e.jsxs("div",{className:`gantt-page-wrapper theme-${Qe}`,style:{...kt,...k},children:[b.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:b.headerTitle})})}),e.jsxs("div",{className:`gantt-container theme-${we.theme}`,style:ut,children:[e.jsx(It,{zoomLevel:Ae,setZoomLevel:Ye,onBaselineToggle:()=>{},showBaselines:Ue,onExport:d=>{d==="csv"&&Ht(u),d==="excel"&&Ut(u),d==="json"&&Vt(u,P),d==="pdf"&&qt(u)},onFilterChange:d=>wt(d),owners:ot||[],onAddTask:d=>{if(d){const T=u.find(C=>C.id===d);Se(d),Te(T?.text)}else Se(void 0),Te(void 0);de(!0)},uiConfig:b,iconConfig:g}),e.jsxs("div",{className:"gantt-layout",ref:jt,onMouseMove:Dt,onMouseUp:Ve,onMouseLeave:Ve,children:[e.jsx(mt,{ref:Oe,tasks:w,columns:we.columns||[],selectedTask:Q,onTaskClick:lt,onTaskContextMenu:bt,onTaskUpdate:Ee,onTaskDragStart:St,onAddTask:d=>{if(d){const T=u.find(C=>C.id===d);Se(d),Te(T?.text)}else Se(void 0),Te(void 0);de(!0)},onAddDependency:Je,onDependencyClick:d=>{const T=u.find(C=>C.id===d);T&&(S(T),ke(!0))},links:P,allTasks:u,dropIndicator:X,reorderTask:$,iconConfig:g}),e.jsx(yt,{ref:at,tasks:w,links:P,range:it,scales:we.scales,config:we,selectedTask:Q,draggedTask:E,onTaskClick:()=>{},onTaskDragStart:()=>{},onTaskDragEnd:()=>{},onTaskUpdate:(d,T)=>{const C=u.find(G=>G.id===d);C&&Ee({...C,...T})},zoomLevel:Ae,baselines:$e})]}),ce&&e.jsx(_t,{onCreateTask:ct,onClose:()=>{de(!1),Se(void 0),Te(void 0)},uiConfig:b,parentId:me,parentTaskName:oe}),U&&e.jsx(Bt,{task:U,onUpdate:Ee,onDelete:qe,onClose:()=>V(null),uiConfig:b}),Ce&&Me&&e.jsx(Rt,{task:Me,allTasks:u,links:P,onAddDependency:Je,onRemoveDependency:dt,onClose:()=>{ke(!1),S(null)}}),se&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-context-menu-overlay",onClick:()=>ge(null),onContextMenu:d=>{d.preventDefault(),ge(null)}}),e.jsx(hr,{x:se.x,y:se.y,task:se.task,onEdit:()=>{se.task&&V(se.task)},onDelete:()=>{se.task&&qe(se.task.id)},onCopy:vt,onDependencies:()=>{se.task&&(S(se.task),ke(!0))},onConvertToMilestone:()=>et("milestone"),onConvertToTask:()=>et("task"),onConvertToProject:()=>et("project"),onClose:()=>ge(null),onAutoSchedule:()=>{const d=Wt(u,P,{mode:"forward"});L(d),ge(null)},iconConfig:g})]}),$&&e.jsx("div",{className:"gantt-grid-row ghost-row",style:{height:we.rowHeight,top:$.currentY-(we.rowHeight||48)/2,left:Oe.current?.getBoundingClientRect().left,position:"fixed",pointerEvents:"none",opacity:.8,zIndex:9999,width:Oe.current?.offsetWidth,backgroundColor:"#ffffff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #2196F3",display:"flex"},children:we.columns?.map(d=>e.jsx("div",{className:"gantt-grid-cell",style:{width:d.width,textAlign:d.align||"left"},children:(()=>{const T=u.find(C=>C.id===$.id);if(!T)return null;if(d.template)return d.template(T);switch(d.name){case"text":return e.jsxs("div",{className:"gantt-grid-cell-text",children:[e.jsx(J.FontAwesomeIcon,{icon:Y.faGripVertical,style:{marginRight:8,color:"#adb5bd"}}),e.jsxs("span",{className:"gantt-task-name-text",children:[T.text,$.descendantIds.length>0&&e.jsxs("span",{children:[" +",$.descendantIds.length," subtasks"]})]})]});case"start":return fe(T.start,"DD MMM YYYY");case"duration":return`${T.duration}`;default:return T[d.name]||""}})()},`ghost-${d.name}`))})]})]})},Sr=Object.freeze(Object.defineProperty({__proto__:null,calculateCriticalPath:(n,a)=>{const s=new Set,o=new Map,t=new Map,g=new Map;n.forEach(x=>{t.set(x.id,[]),g.set(x.id,[])}),a.forEach(x=>{x.type==="e2s"&&(t.get(x.source)?.push(x.target),g.get(x.target)?.push(x.source))});const y=new Map,i=new Map,c=(x,p=new Set)=>{if(p.has(x))return;p.add(x);const u=n.find(L=>L.id===x);if(!u)return;const P=g.get(x)||[];if(P.length===0)y.set(x,0),i.set(x,u.duration);else{let L=0;P.forEach(f=>{c(f,p);const M=i.get(f)||0;L=Math.max(L,M)}),y.set(x,L),i.set(x,L+u.duration)}};n.forEach(x=>c(x.id));const v=new Map,h=new Map,b=Math.max(...Array.from(i.values())),k=(x,p=new Set)=>{if(p.has(x))return;p.add(x);const u=n.find(L=>L.id===x);if(!u)return;const P=t.get(x)||[];if(P.length===0)h.set(x,b),v.set(x,b-u.duration);else{let L=1/0;P.forEach(f=>{k(f,p);const M=v.get(f)||0;L=Math.min(L,M)}),h.set(x,L),v.set(x,L-u.duration)}};return n.forEach(x=>k(x.id)),n.forEach(x=>{const p=y.get(x.id)||0,P=(v.get(x.id)||0)-p;o.set(x.id,P),Math.abs(P)<.01&&s.add(x.id)}),{criticalTasks:s,taskFloats:o,projectDuration:b}},getTaskFloat:(n,a)=>a.taskFloats.get(n)||0,isCriticalTask:(n,a)=>a.criticalTasks.has(n)},Symbol.toStringTag,{value:"Module"}));_.AutoScheduler=mr,_.Chart=yt,_.CriticalPath=Sr,_.DependencyEditor=Rt,_.ExportUtils=gr,_.FilterSearch=Nt,_.Gantt=vr,_.Grid=mt,_.TaskBar=Ot,_.TaskCreator=_t,_.TaskEditor=Bt,_.Timeline=xt,_.Toolbar=It,_.addToDate=le,_.applyFilters=At,_.calculateDuration=Qt,_.createBaseline=gt,_.formatDate=fe,_.getDaysBetween=Ze,_.getEndOfDay=Zt,_.getHoursBetween=Ct,_.getStartOfDay=Be,_.isHoliday=pt,_.isWeekend=ht,_.useUndoRedo=zt,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iris-gantt",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
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",
@@ -31,16 +31,26 @@
31
31
  "require": {
32
32
  "types": "./dist/index.d.ts",
33
33
  "default": "./dist/iris-gantt.umd.cjs"
34
- }
34
+ },
35
+ "types": "./dist/index.d.ts"
35
36
  },
36
37
  "./gantt.css": {
38
+ "import": "./dist/gantt.css",
39
+ "require": "./dist/gantt.css",
40
+ "default": "./dist/gantt.css"
41
+ },
42
+ "./dist/gantt.css": {
43
+ "import": "./dist/gantt.css",
44
+ "require": "./dist/gantt.css",
37
45
  "default": "./dist/gantt.css"
38
46
  }
39
47
  },
40
48
  "files": [
41
49
  "dist",
42
50
  "README.md",
43
- "USAGE.md"
51
+ "USAGE.md",
52
+ "QUICK_START.md",
53
+ "PACKAGE_SETUP.md"
44
54
  ],
45
55
  "scripts": {
46
56
  "dev": "vite",
@@ -55,8 +65,8 @@
55
65
  "peerDependencies": {
56
66
  "@fortawesome/fontawesome-svg-core": "^7.1.0",
57
67
  "@fortawesome/free-solid-svg-icons": "^7.1.0",
58
- "@fortawesome/react-fontawesome": "^3.1.0",
59
- "antd": "^5.29.3",
68
+ "@fortawesome/react-fontawesome": "^0.2.2",
69
+ "antd": "^5.19.2",
60
70
  "dayjs": "^1.11.0",
61
71
  "react": "^18.3.1",
62
72
  "react-dom": "^18.3.1"