iris-gantt 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iris-gantt.js +1726 -1375
- package/dist/iris-gantt.umd.cjs +18 -10
- package/package.json +10 -8
package/dist/iris-gantt.umd.cjs
CHANGED
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
(function(N,
|
|
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`
|
|
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=`
|
|
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:
|
|
2
10
|
let props = %s;
|
|
3
11
|
<%s {...props} />
|
|
4
12
|
React keys must be passed directly to JSX without using spread:
|
|
5
13
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,P,R,K,R),C[R+P]=!0)}if(R=null,k!==void 0&&(i(k),R=""+k),c(y)&&(i(y.key),R=""+y.key),"key"in y){k={};for(var ue in y)ue!=="key"&&(k[ue]=y[ue])}else k=y;return R&&l(k,typeof r=="function"?r.displayName||r.name||"Unknown":r),T(r,R,k,s(),V,de)}function g(r){D(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===m&&(r._payload.status==="fulfilled"?D(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function D(r){return typeof r=="object"&&r!==null&&r.$$typeof===h}var u=S,h=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),$=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),W=Symbol.for("react.client.reference"),U=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=Object.prototype.hasOwnProperty,oe=Array.isArray,te=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(r){return r()}};var se,Z={},z=u.react_stack_bottom_frame.bind(u,p)(),v=te(a(p)),C={};je.Fragment=F,je.jsx=function(r,y,k){var P=1e4>U.recentlyCreatedOwnerStacks++;return d(r,y,k,!1,P?Error("react-stack-top-frame"):z,P?te(a(r)):v)},je.jsxs=function(r,y,k){var P=1e4>U.recentlyCreatedOwnerStacks++;return d(r,y,k,!0,P?Error("react-stack-top-frame"):z,P?te(a(r)):v)}})()),je}var He;function ft(){return He||(He=1,process.env.NODE_ENV==="production"?Te.exports=ht():Te.exports=pt()),Te.exports}var e=ft();const q=(t,n,i)=>{const a=new Date(t);switch(i){case"hour":a.setHours(a.getHours()+n);break;case"day":a.setDate(a.getDate()+n);break;case"week":a.setDate(a.getDate()+n*7);break;case"month":a.setMonth(a.getMonth()+n);break;case"quarter":a.setMonth(a.getMonth()+n*3);break;case"year":a.setFullYear(a.getFullYear()+n);break}return a},be=(t,n)=>{const i=n.getTime()-t.getTime();return Math.ceil(i/(1e3*60*60*24))},We=(t,n)=>{const i=n.getTime()-t.getTime();return Math.ceil(i/(1e3*60*60))},Q=(t,n)=>{const i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],p={YYYY:t.getFullYear().toString(),YY:t.getFullYear().toString().slice(-2),MMMM:a[t.getMonth()],MMM:i[t.getMonth()],MM:String(t.getMonth()+1).padStart(2,"0"),M:String(t.getMonth()+1),DD:String(t.getDate()).padStart(2,"0"),D:String(t.getDate()),dddd:s[t.getDay()],HH:String(t.getHours()).padStart(2,"0"),H:String(t.getHours()),mm:String(t.getMinutes()).padStart(2,"0"),m:String(t.getMinutes())};return n.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g,c=>p[c])},Ee=t=>{const n=t.getDay();return n===0||n===6},$e=(t,n)=>n.some(i=>i.getFullYear()===t.getFullYear()&&i.getMonth()===t.getMonth()&&i.getDate()===t.getDate()),Se=t=>{const n=new Date(t);return n.setHours(0,0,0,0),n},mt=t=>{const n=new Date(t);return n.setHours(23,59,59,999),n},xt=(t,n,i="day")=>{switch(i){case"hour":return We(t,n);case"day":return be(t,n);case"week":return Math.ceil(be(t,n)/7);case"month":return(n.getFullYear()-t.getFullYear())*12+(n.getMonth()-t.getMonth());default:return be(t,n)}};function gt(t){if(!t||typeof t!="string")return null;const n=t.trim(),i=/^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,a=n.match(i);if(!a)return null;const s=parseInt(a[1],10),p=a[2].toUpperCase();let c=0,l="day";if(a[3]){const x=a[4]==="-"?-1:1;switch(c=parseInt(a[5],10)*x,a[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:p,lag:c,lagUnit:l}}function Ne(t,n){switch(n){case"hour":return t/24;case"day":return t;case"week":return t*7;case"month":return t*30;default:return t}}function yt(t,n){const a={e2s:"FS",s2s:"SS",e2e:"FF",s2e:"SF"}[t.type];let s=`${n}${a}`;if(t.lag&&t.lag!==0){const p=t.lag>0?"+":"",l=(t.lagUnit||"day").charAt(0);let x=t.lag;if(t.lagUnit&&t.lagUnit!=="day")switch(t.lagUnit){case"hour":x=t.lag*24;break;case"week":x=t.lag/7;break;case"month":x=t.lag/30;break}s+=`${p}${Math.round(x)}${l}`}return s}function wt(t){return{FS:"e2s",SS:"s2s",FF:"e2e",SF:"s2e"}[t]}const{Text:pe,Paragraph:jt,Link:bt}=o.Typography,{Option:Ue}=o.Select,St=({task:t,allTasks:n,onAddDependency:i,children:a})=>{const[s,p]=S.useState(!1),[c,l]=S.useState(""),[x,T]=S.useState(null),[d,g]=S.useState("e2s"),[D,u]=S.useState("lag"),[h,j]=S.useState(0),[F,f]=S.useState(!0),b="day",E=S.useMemo(()=>{if(!c)return n.filter(O=>O.id!==t.id);const m=c.toLowerCase();return n.filter(O=>O.id!==t.id&&(O.text.toLowerCase().includes(m)||(n.indexOf(O)+1).toString().includes(m)))},[n,c,t.id]),$=()=>{if(x){const m=D==="lag"?h:-h,O=Ne(m,b);i(x,t.id,d,O),p(!1),L()}},L=()=>{l(""),T(null),g("e2s"),u("lag"),j(0)},B=()=>{if(!F)return null;const m=d==="e2s",O=d==="s2s",W=d==="e2e",U=d==="s2e";let _=0,oe=0,te="",se=0,Z=-1;return m?(_=20,oe=160,se=140,Z=160,te="M 140 40 L 150 40 C 160 40, 160 90, 150 90 L 160 90"):W?(_=60,oe=60,se=180,Z=-1,te="M 180 40 L 200 40 L 200 90 L 180 90"):O?(_=100,oe=100,se=100,Z=-1,te="M 100 40 L 80 40 L 80 90 L 100 90"):U&&(_=160,oe=20,se=160,Z=140,te="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:se,x2:se,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),Z!==-1&&e.jsx("line",{x1:Z,x2:Z,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),e.jsx("rect",{x:_,y:"28",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:_+60,y:"44",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 2"}),e.jsx("rect",{x:oe,y:"78",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:oe+60,y:"94",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 3"}),e.jsx("path",{d:te,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"})})})]})})},X=()=>{const m=n.find(_=>_.id===x);if(!m)return"Select a task from the list to see how it will relate to the current task.";const O=n.indexOf(t)+1,W=n.indexOf(m)+1;let U="";switch(d){case"e2s":U=`Task ${O} starts after Task ${W} finishes`;break;case"s2s":U=`Task ${O} starts when Task ${W} starts`;break;case"e2e":U=`Task ${O} finishes when Task ${W} finishes`;break;case"s2e":U=`Task ${O} finishes when Task ${W} starts`;break}if(h>0){const _=`${h} ${b}${h>1?"s":""}`;D==="lag"?U+=` + ${_} delay`:U+=` - ${_} overlap`}return U+"."},ee=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(o.Input,{placeholder:"Search task...",value:c,onChange:m=>l(m.target.value),style:{marginBottom:8},autoFocus:!0,size:"large"})}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:e.jsx(o.List,{size:"small",dataSource:E,renderItem:m=>e.jsxs(o.List.Item,{className:`task-list-item ${x===m.id?"selected":""}`,onClick:()=>T(m.id),style:{cursor:"pointer",padding:"8px 16px",backgroundColor:x===m.id?"#f0f7ff":"transparent",display:"flex",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsx(pe,{type:"secondary",style:{width:20},children:n.indexOf(m)+1}),e.jsx(pe,{children:m.text})]}),e.jsx(I.FontAwesomeIcon,{icon:A.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(pe,{strong:!0,children:"Dependency type"}),e.jsx(bt,{style:{fontSize:"12px"},onClick:()=>f(!F),children:F?"Hide preview":"Show preview"})]}),B(),e.jsx(jt,{style:{fontSize:"13px",color:"#262626",marginBottom:20,minHeight:48,lineHeight:"1.6"},children:X()}),e.jsx(o.Radio.Group,{value:d,onChange:m=>g(m.target.value),style:{width:"100%",marginBottom:20},children:e.jsxs(o.Space,{direction:"vertical",style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"e2s",children:"Finish to Start"}),e.jsx(pe,{type:"secondary",children:"FS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"e2e",children:"Finish to Finish"}),e.jsx(pe,{type:"secondary",children:"FF"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"s2s",children:"Start to Start"}),e.jsx(pe,{type:"secondary",children:"SS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"s2e",children:"Start to Finish"}),e.jsx(pe,{type:"secondary",children:"SF"})]})]})}),e.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:20},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(pe,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Delay type"}),e.jsxs(o.Select,{value:D,onChange:m=>u(m),style:{width:"100%"},size:"large",children:[e.jsx(Ue,{value:"lag",children:"Lag by"}),e.jsx(Ue,{value:"lead",children:"Lead by"})]})]}),e.jsxs("div",{style:{width:100},children:[e.jsx(pe,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Days"}),e.jsx(o.Space.Compact,{style:{width:"100%"},children:e.jsx(o.InputNumber,{min:0,value:h,onChange:m=>j(m||0),style:{width:"100%"},placeholder:"0",size:"large"})})]})]}),e.jsx(o.Button,{type:"primary",block:!0,onClick:$,disabled:!x,style:{marginTop:"auto",backgroundColor:"#5c67f2",height:44,borderRadius:"6px"},children:"Add"})]})]});return e.jsx(o.Popover,{content:ee,trigger:"click",open:s,onOpenChange:p,placement:"bottomLeft",overlayClassName:"dependency-popover",overlayInnerStyle:{padding:0},children:a})},Pe=S.forwardRef(({tasks:t,allTasks:n=[],columns:i,selectedTask:a,onTaskClick:s,onTaskContextMenu:p,onTaskUpdate:c,onTaskDragStart:l,onAddTask:x,onAddDependency:T,links:d=[],dropIndicator:g,reorderTask:D},u)=>{const h=S.useRef(null);S.useImperativeHandle(u,()=>h.current);const j=(f,b=0)=>{if(!f.parent)return b;const E=t.find($=>$.id===f.parent);return E?j(E,b+1):b},F=(f,b)=>{if(b.template)return b.template(f);switch(b.name){case"text":const E=j(f);return e.jsxs("div",{className:"gantt-grid-cell-text",style:{paddingLeft:E*14},children:[e.jsx("div",{className:"gantt-row-drag-handle",onMouseDown:L=>{L.preventDefault(),l?.(f.id,L.clientX,L.clientY,"reorder")},children:e.jsx(I.FontAwesomeIcon,{icon:A.faGripVertical})}),f.type==="project"?e.jsx("span",{className:"gantt-tree-icon",onClick:L=>{L.stopPropagation(),c?.({...f,open:!f.open})},children:e.jsx(I.FontAwesomeIcon,{icon:f.open?A.faChevronDown:A.faChevronRight})}):e.jsx("span",{style:{width:16,display:"inline-block"}}),e.jsx("span",{className:"gantt-task-name-text",children:f.text})]});case"start":return Q(f.start,"DD-MM-YYYY");case"end":return Q(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 $=d.filter(L=>L.target===f.id);return e.jsx(St,{task:f,allTasks:n,links:d,onAddDependency:(L,B,X,ee)=>T?.(L,B,X,ee),children:e.jsx("div",{style:{cursor:"pointer",minHeight:"24px",width:"100%",display:"flex",alignItems:"center",gap:"4px"},children:$.map(L=>{const B=n.find(ee=>ee.id===L.source),X=B?n.indexOf(B)+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:yt(L,X)},L.id)})})});case"add":return e.jsx(o.Button,{type:"text",size:"small",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faPlus,style:{fontSize:12,color:"#adb5bd"}}),onClick:L=>{L.stopPropagation(),x?.(f.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:`${f.progress}%`}})}),e.jsxs("span",{className:"gantt-progress-text",children:[f.progress,"%"]})]});case"index":return e.jsx("span",{style:{color:"#8c8c8c"},children:n.indexOf(f)+1});default:return f[b.name]||""}};return e.jsxs("div",{className:"gantt-grid",ref:h,children:[e.jsx("div",{className:"gantt-grid-header",children:i.map(f=>e.jsx("div",{className:"gantt-grid-header-cell",style:{width:f.width,justifyContent:f.align==="center"?"center":"flex-start"},children:f.name==="add"?e.jsx(I.FontAwesomeIcon,{icon:A.faPlus,style:{fontSize:12,color:"#64748b",cursor:"pointer"},onClick:()=>x?.()}):e.jsxs(e.Fragment,{children:[f.label,f.name==="start"&&e.jsx(I.FontAwesomeIcon,{icon:A.faChevronDown,style:{marginLeft:8,fontSize:10,color:"#64748b"}})]})},f.name))}),e.jsx("div",{className:"gantt-grid-body",children:t.map(f=>{const b=D?.id===f.id,E=D?.descendantIds.includes(f.id);return e.jsxs("div",{className:`gantt-grid-row ${a===f.id?"selected":""} ${b?"dragging-row":""} ${E?"descendant-dragging-row":""} ${g?.taskId===f.id?`drop-target-${g.position}`:""}`,onClick:()=>s(f.id),onContextMenu:$=>p?.($,f.id),children:[i.map($=>e.jsx("div",{className:"gantt-grid-cell",style:{width:$.width,textAlign:$.align||"left"},children:F(f,$)},`${f.id}-${$.name}`)),g?.taskId===f.id&&e.jsx("div",{className:`gantt-drop-indicator ${g.position}`})]},f.id)})})]})});Pe.displayName="Grid";const Ge=({task:t,position:n,selected:i,dragging:a,onClick:s,onDragStart:p,dragDeltaX:c=0,dragType:l=null,readonly:x=!1})=>{const T=(h,j)=>{x||(h.preventDefault(),h.stopPropagation(),p(h.clientX,h.clientY,j))},d=()=>{const h=["gantt-task-bar"];return t.type==="milestone"&&h.push("milestone"),t.type==="project"&&h.push("project"),i&&h.push("selected"),a&&h.push("dragging"),h.join(" ")},g=()=>{let h=n.left,j=n.width;return a&&l&&(l==="move"?h+=c:l==="resize-left"?(h+=c,j-=c):l==="resize-right"&&(j+=c)),{left:`${h}px`,width:`${Math.max(j,0)}px`,backgroundColor:t.color||void 0}},D=(h=!1)=>e.jsxs(e.Fragment,{children:[!x&&t.type!=="milestone"&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-left",onMouseDown:j=>T(j,"resize-left")}),!h&&t.type!=="milestone"&&e.jsx("div",{className:"gantt-task-progress",style:{width:`${t.progress}%`}}),e.jsx("div",{className:"gantt-task-content",children:!h&&t.type!=="milestone"&&e.jsx("span",{className:"gantt-task-text",children:t.text})}),t.type==="milestone"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-milestone-diamond"}),e.jsx("span",{className:"gantt-milestone-text",children:t.text})]}),!x&&t.type!=="milestone"&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-right",onMouseDown:j=>T(j,"resize-right")})]}),u=e.jsxs("div",{className:"gantt-tooltip",children:[e.jsx("div",{className:"gantt-tooltip-title",children:t.text}),e.jsxs("div",{className:"gantt-tooltip-dates",children:[Q(t.start,"MMM D")," - ",Q(t.end,"MMM D")]}),e.jsxs("div",{className:"gantt-tooltip-progress",children:["Progress: ",t.progress,"%"]}),t.owner&&e.jsxs("div",{className:"gantt-tooltip-owner",children:["Owner: ",t.owner]})]});return t.segments&&t.segments.length>0?e.jsx("div",{className:"gantt-task-group",children:t.segments.map((h,j)=>e.jsx(o.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:d()+" segment",style:{left:`${n.left+(h.start.getTime()-t.start.getTime())/(t.end.getTime()-t.start.getTime())*n.width}px`,width:`${(h.end.getTime()-h.start.getTime())/(t.end.getTime()-t.start.getTime())*n.width}px`,backgroundColor:t.color||"#ADCFFE"},onClick:s,onMouseDown:F=>T(F,"move"),children:D(!0)})},j))}):e.jsx(o.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:d(),style:g(),onClick:s,onMouseDown:h=>T(h,"move"),children:D()})})},Tt=({links:t,tasks:n,getTaskPosition:i})=>{const a=c=>n.find(l=>l.id===c),s=c=>{const l=a(c.source),x=a(c.target);if(!l||!x)return"";const T=i(l),d=i(x),g=T.top+T.height/2,D=d.top+d.height/2;let u=0,h=0;switch(c.type){case"e2s":u=T.left+T.width,h=d.left;break;case"s2s":u=T.left,h=d.left;break;case"e2e":u=T.left+T.width,h=d.left+d.width;break;case"s2e":u=T.left,h=d.left+d.width;break}const j=h-u,F=D-g,f=20;if(c.type==="e2s")if(j>=f){const b=u+j/2;return`M ${u},${g} L ${b},${g} L ${b},${D} L ${h},${D}`}else{const b=f/2,E=g+F/2;return`M ${u},${g} L ${u+b},${g} L ${u+b},${E} L ${h-b},${E} L ${h-b},${D} L ${h},${D}`}else if(c.type==="s2s"){const b=Math.min(u,h)-f/2;return`M ${u},${g} L ${b},${g} L ${b},${D} L ${h},${D}`}else if(c.type==="e2e"){const b=Math.max(u,h)+f/2;return`M ${u},${g} L ${b},${g} L ${b},${D} L ${h},${D}`}else if(c.type==="s2e")if(j<=-f){const b=u+j/2;return`M ${u},${g} L ${b},${g} L ${b},${D} L ${h},${D}`}else{const b=f/2,E=g+F/2;return`M ${u},${g} L ${u-b},${g} L ${u-b},${E} L ${h+b},${E} L ${h+b},${D} L ${h},${D}`}return""},p=c=>{const l=a(c.target);if(!l)return"";const x=i(l),T=x.top+x.height/2,d=8,g=6;let D=0,u=!0;return c.type==="e2s"||c.type==="s2s"?(D=x.left,u=!0):(D=x.left+x.width,u=!1),u?`M ${D},${T} L ${D-d},${T-g/2} L ${D-d},${T+g/2} Z`:`M ${D},${T} L ${D+d},${T-g/2} L ${D+d},${T+g/2} Z`};return e.jsx("svg",{className:"gantt-links-layer",style:{overflow:"visible"},children:t.map(c=>{const l=a(c.source),x=a(c.target);if(!l||!x)return null;const T=s(c),d=p(c);return e.jsxs("g",{className:"gantt-link",children:[e.jsx("path",{d:T,fill:"none",strokeWidth:"1.5",className:"gantt-link-line"}),e.jsx("path",{d,className:"gantt-link-arrow"})]},c.id)})})},vt=(t,n,i=60,a="day",s=1)=>{const[p,c]=S.useState({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0}),l=S.useCallback((d,g,D,u)=>{const h=t.find(j=>j.id===d);h&&c({taskId:d,initialX:g,initialY:D,initialStart:new Date(h.start),initialEnd:new Date(h.end),type:u,dragDeltaX:0,dragDeltaY:0})},[t]),x=S.useCallback((d,g)=>{if(!p.taskId||!p.type)return null;const D=d-p.initialX,u=g-p.initialY;if(c(E=>({...E,dragDeltaX:D,dragDeltaY:u})),p.type==="reorder")return null;const h=t.find(E=>E.id===p.taskId);if(!h)return null;const j=Math.round(D/i);let F=new Date(p.initialStart),f=new Date(p.initialEnd);switch(p.type){case"move":F=q(p.initialStart,j*s,a),f=q(p.initialEnd,j*s,a);break;case"resize-left":F=q(p.initialStart,j*s,a),F>=f&&(F=q(f,-s,a));break;case"resize-right":f=q(p.initialEnd,j*s,a),f<=F&&(f=q(F,s,a));break}const b=be(F,f);return{...h,start:F,end:f,duration:b}},[p,t,i]),T=S.useCallback(d=>{if(d&&n){const{id:g,...D}=d;n(g,D)}c({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0})},[n]);return{dragState:p,handleDragStart:l,handleDrag:x,handleDragEnd:T}},Ae=S.forwardRef(({tasks:t,links:n,range:i,scales:a,config:s,selectedTask:p,onTaskClick:c,onTaskDragStart:l,onTaskDragEnd:x,onTaskUpdate:T,zoomLevel:d,baselines:g},D)=>{const[u,h]=S.useState(t),j=(s.columnWidth||60)*d,F=s.baselines&&g&&g.size>0,{dragState:f,handleDragStart:b,handleDrag:E,handleDragEnd:$}=vt(u,T,j,a[1].unit,a[1].step);S.useEffect(()=>{h(t)},[t]);const L=v=>{const C=[];let r=new Date(i.start);for(;r<=i.end;)C.push({date:new Date(r),label:Q(r,v.format||"D")}),r=q(r,v.step,v.unit);return C},B=v=>{const C=a[1],r=i.start.getTime(),k=v.getTime()-r,V={hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6}[C.unit]||864e5;return k/(V*C.step)*j},X=v=>{const C=B(v.start),r=B(v.end);return{left:C,width:Math.max(r-C,0)}},ee=v=>{const C=B(v.start),r=B(v.end);return{left:C,width:Math.max(r-C,0)}},m=v=>{const C=X(v),r=u.findIndex(V=>V.id===v.id),y=s.rowHeight||48,k=32,P=(y-k)/2;return{left:C.left,width:C.width,top:r*y+P,height:k}},O=S.useCallback(v=>{if(f.taskId&&f.type){const C=E(v.clientX,v.clientY);C&&h(r=>r.map(y=>y.id===C.id?C:y))}},[f,E]),W=S.useCallback(()=>{if(f.taskId){const v=u.find(C=>C.id===f.taskId);$(v||null),x()}},[f,u,$,x]),U=a[1],_=L(U),oe=()=>{const v=[];let C=-1,r=-1,y=0,k="";return _.forEach(P=>{const V=P.date.getMonth(),de=P.date.getFullYear(),R=Q(P.date,"MMM YYYY");V!==C||de!==r?(C!==-1&&v.push({label:k,width:y}),C=V,r=de,y=j,k=R):y+=j}),C!==-1&&v.push({label:k,width:y}),v},te=()=>{const v=[];let C=-1,r=0,y=-1,k=-1,P="";return _.forEach(V=>{const R=V.date.getDate()<=15?0:1,K=V.date.getMonth(),ue=V.date.getFullYear(),me=Q(V.date,"MMM"),Me=new Date(ue,K+1,0).getDate(),Le=R===0?`${me} 1 - 15`:`${me} 16 - ${Me}`;R!==C||K!==y||ue!==k?(C!==-1&&v.push({label:P,width:r}),C=R,y=K,k=ue,r=j,P=Le):r+=j}),C!==-1&&v.push({label:P,width:r}),v},se=oe(),Z=te(),z=_.length*j;return e.jsxs("div",{className:"gantt-timeline-container",ref:D,onMouseMove:O,onMouseUp:W,style:{width:z},children:[e.jsxs("div",{className:"gantt-timeline-header",style:{width:z,minWidth:z},children:[e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-month",style:{width:z},children:se.map((v,C)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:v.width,minWidth:v.width,maxWidth:v.width,borderRight:C===se.length-1?"none":"var(--wx-gantt-border)"},children:v.label},`top-${C}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-range",style:{width:z},children:Z.map((v,C)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:v.width,minWidth:v.width,maxWidth:v.width,borderRight:C===Z.length-1?"none":"var(--wx-gantt-border)"},children:v.label},`mid-${C}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-day",style:{width:z},children:_.map((v,C)=>{const r=s.weekends&&Ee(v.date),y=s.holidays&&$e(v.date,s.holidays);return e.jsx("div",{className:`gantt-timeline-cell ${r?"weekend":""} ${y?"holiday":""}`,style:{width:j,minWidth:j,maxWidth:j,borderRight:C===_.length-1?"none":"var(--wx-gantt-border)"},children:v.label},`day-${C}`)})})]}),e.jsxs("div",{className:"gantt-timeline-body",style:{width:z},children:[e.jsx("div",{className:"gantt-timeline-grid",children:_.map((v,C)=>{const r=s.weekends&&Ee(v.date),y=s.holidays&&$e(v.date,s.holidays);return e.jsx("div",{className:`gantt-timeline-grid-column ${r?"weekend":""} ${y?"holiday":""}`,style:{width:j,minWidth:j}},C)})}),n.length>0&&e.jsx(Tt,{links:n,tasks:u,getTaskPosition:m}),e.jsx("div",{className:"gantt-timeline-tasks",style:{width:z},children:u.map(v=>{const C=X(v),r=F?g?.get(v.id):void 0,y=r?ee(r):void 0;return e.jsxs("div",{className:"gantt-timeline-row",children:[r&&y&&v.type!=="milestone"&&e.jsx("div",{className:"gantt-baseline-bar",style:{left:`${y.left}px`,width:`${y.width}px`},title:`Baseline: ${r.start.toLocaleDateString()} - ${r.end.toLocaleDateString()}`}),e.jsx(Ge,{task:v,position:C,selected:p===v.id,dragging:f.taskId===v.id,dragDeltaX:f.dragDeltaX,dragType:f.type,onClick:()=>c(v.id),onDragStart:(k,P,V)=>{b(v.id,k,P,V),l(v.id,k,P)},readonly:s.readonly})]},v.id)})})]})]})});Ae.displayName="Timeline";const Ie=S.forwardRef((t,n)=>e.jsx("div",{className:"gantt-chart-wrapper",style:{flex:1,minWidth:0},children:e.jsx(Ae,{...t,ref:n})}));Ie.displayName="Chart";const{Search:Dt}=o.Input,Ve=({onFilterChange:t,owners:n=[]})=>{const[i,a]=S.useState({searchText:"",status:"all",priority:"all",owner:""}),s=l=>{const x={...i,...l};a(x),t(x)},p=()=>{const l={searchText:"",status:"all",priority:"all",owner:""};a(l),t(l)},c=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(Dt,{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(o.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(o.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(o.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"},...(n||[]).map(l=>({value:l,label:l}))]}),c&&e.jsx(o.Button,{type:"default",danger:!0,icon:e.jsx(I.FontAwesomeIcon,{icon:A.faTimesCircle}),onClick:p,className:"gantt-filter-clear-antd",children:"Clear"})]})]})})},Je=(t,n)=>t.filter(i=>{if(n.searchText){const a=n.searchText.toLowerCase(),s=i.text.toLowerCase().includes(a),p=i.owner?.toLowerCase().includes(a),c=i.details?.toLowerCase().includes(a);if(!s&&!p&&!c)return!1}if(n.status!=="all"&&(i.progress===0?"not-started":i.progress===100?"completed":"in-progress")!==n.status||n.priority!=="all"&&i.priority!==n.priority||n.owner&&i.owner!==n.owner)return!1;if(n.dateRange){const a=i.start.getTime(),s=n.dateRange.start.getTime(),p=n.dateRange.end.getTime();if(a<s||a>p)return!1}return!0}),Xe=({zoomLevel:t,setZoomLevel:n,onBaselineToggle:i,showBaselines:a,onExport:s,onFilterChange:p,owners:c,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(o.Space,{size:8,children:[e.jsx(o.Button,{type:"primary",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faPlus}),onClick:l,children:"New Task"}),e.jsx(o.Tooltip,{title:a?"Hide Baselines":"Show Baselines",children:e.jsx(o.Button,{type:a?"primary":"default",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faCalendarCheck}),onClick:i,children:a?"Baselines":"Set Baseline"})})]})}),e.jsx("div",{className:"gantt-toolbar-right",children:e.jsxs(o.Space,{size:4,children:[e.jsx(o.Tooltip,{title:"Zoom Out",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faSearchMinus}),onClick:()=>n(Math.max(.5,t-.25))})}),e.jsx(o.Tooltip,{title:"Zoom In",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faSearchPlus}),onClick:()=>n(Math.min(2,t+.25))})}),e.jsx(o.Tooltip,{title:"Reset Zoom",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faRotateLeft}),onClick:()=>n(1)})}),e.jsx(o.Divider,{type:"vertical",style:{height:24,margin:"0 4px"}}),e.jsx(o.Tooltip,{title:"Export to CSV",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFileCsv}),onClick:()=>s("csv")})}),e.jsx(o.Tooltip,{title:"Export to Excel",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFileExcel}),onClick:()=>s("excel")})}),e.jsx(o.Tooltip,{title:"Export to JSON",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFileCode}),onClick:()=>s("json")})}),e.jsx(o.Tooltip,{title:"Export to PDF",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFilePdf}),onClick:()=>s("pdf")})})]})})]}),e.jsx(Ve,{onFilterChange:p,owners:c})]}),{Option:xe}=o.Select,{TextArea:Mt}=o.Input,qe=({onCreateTask:t,onClose:n})=>{const[i]=o.Form.useForm(),a=s=>{const p=s.start.toDate(),c=new Date(p);c.setDate(c.getDate()+(s.duration||1)),t({text:s.text,start:p,end:c,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||""}),n()};return e.jsx(o.Modal,{title:"Create New Task",open:!0,onCancel:n,onOk:()=>i.submit(),okText:"Create Task",cancelText:"Cancel",width:600,className:"gantt-modal-antd",children:e.jsxs(o.Form,{form:i,layout:"vertical",onFinish:a,initialValues:{type:"task",priority:"medium",start:_e(),duration:1,progress:0,color:"#4A90E2"},children:[e.jsx(o.Form.Item,{name:"text",label:"Task Name",rules:[{required:!0,message:"Please enter task name"}],children:e.jsx(o.Input,{placeholder:"Enter task name",autoFocus:!0})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"type",label:"Type",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(xe,{value:"task",children:"Task"}),e.jsx(xe,{value:"milestone",children:"Milestone"}),e.jsx(xe,{value:"project",children:"Project"})]})}),e.jsx(o.Form.Item,{name:"priority",label:"Priority",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(xe,{value:"low",children:"Low"}),e.jsx(xe,{value:"medium",children:"Medium"}),e.jsx(xe,{value:"high",children:"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"start",label:"Start Date",style:{flex:1},children:e.jsx(o.DatePicker,{style:{width:"100%"}})}),e.jsx(o.Form.Item,{name:"duration",label:"Duration (days)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"color",label:"Color",style:{flex:1},children:e.jsx(o.ColorPicker,{showText:!0})}),e.jsx(o.Form.Item,{name:"progress",label:"Progress (%)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(o.Form.Item,{name:"owner",label:"Owner",children:e.jsx(o.Input,{placeholder:"Assign to..."})}),e.jsx(o.Form.Item,{name:"details",label:"Details",children:e.jsx(Mt,{placeholder:"Add task description...",rows:3})})]})})},{Option:ge}=o.Select,{TextArea:Ct}=o.Input,{confirm:kt}=o.Modal,Ze=({task:t,onUpdate:n,onDelete:i,onClose:a})=>{const[s]=o.Form.useForm(),p=l=>{const x=l.start.toDate(),T=new Date(x);T.setDate(T.getDate()+(l.duration||1)),n({...t,text:l.text,start:x,end:T,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||""}),a()},c=()=>{kt({title:`Are you sure you want to delete "${t.text}"?`,icon:e.jsx(I.FontAwesomeIcon,{icon:A.faExclamationTriangle,style:{color:"#faad14",marginRight:8}}),content:"This action cannot be undone.",okText:"Yes, Delete",okType:"danger",cancelText:"No",onOk(){i(t.id),a()}})};return e.jsx(o.Modal,{title:"Edit Task",open:!0,onCancel:a,footer:[e.jsx(o.Button,{danger:!0,onClick:c,style:{float:"left"},children:"Delete"},"delete"),e.jsx(o.Button,{onClick:a,children:"Cancel"},"cancel"),e.jsx(o.Button,{type:"primary",onClick:()=>s.submit(),children:"Save Changes"},"submit")],width:600,className:"gantt-modal-antd",children:e.jsxs(o.Form,{form:s,layout:"vertical",onFinish:p,initialValues:{text:t.text,type:t.type||"task",priority:t.priority||"medium",start:_e(t.start),duration:t.duration,progress:t.progress,color:t.color||"#4A90E2",owner:t.owner||"",details:t.details||""},children:[e.jsx(o.Form.Item,{name:"text",label:"Task Name",rules:[{required:!0,message:"Please enter task name"}],children:e.jsx(o.Input,{placeholder:"Enter task name"})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"type",label:"Type",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(ge,{value:"task",children:"Task"}),e.jsx(ge,{value:"milestone",children:"Milestone"}),e.jsx(ge,{value:"project",children:"Project"})]})}),e.jsx(o.Form.Item,{name:"priority",label:"Priority",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(ge,{value:"low",children:"Low"}),e.jsx(ge,{value:"medium",children:"Medium"}),e.jsx(ge,{value:"high",children:"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"start",label:"Start Date",style:{flex:1},children:e.jsx(o.DatePicker,{style:{width:"100%"}})}),e.jsx(o.Form.Item,{name:"duration",label:"Duration (days)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"color",label:"Color",style:{flex:1},children:e.jsx(o.ColorPicker,{showText:!0})}),e.jsx(o.Form.Item,{name:"progress",label:"Progress (%)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(o.Form.Item,{name:"owner",label:"Owner",children:e.jsx(o.Input,{placeholder:"Assign to..."})}),e.jsx(o.Form.Item,{name:"details",label:"Details",children:e.jsx(Ct,{placeholder:"Add task description...",rows:3})})]})})},{Title:ve,Text:le,Paragraph:Ke}=o.Typography,{Option:fe}=o.Select,Qe=({task:t,allTasks:n,links:i,onAddDependency:a,onRemoveDependency:s,onClose:p})=>{const[c,l]=S.useState(""),[x,T]=S.useState("e2s"),[d,g]=S.useState(0),[D,u]=S.useState("day"),[h,j]=S.useState(""),F=i.filter(m=>m.target===t.id),f=i.filter(m=>m.source===t.id),b=n.filter(m=>m.id!==t.id&&m.id!==t.parent),E=()=>{if(c){const m=Ne(d,D);a(c,t.id,x,m),l(""),g(0),u("day")}},$=()=>{if(!h.trim())return;const m=gt(h.trim());if(!m){alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
|
|
7
|
-
Example: 3FS+10d`);return}const O=m.taskNumber-1,W=n[O];if(!W){alert(`Task ${m.taskNumber} not found`);return}const U=wt(m.type),_=Ne(m.lag,m.lagUnit);a(W.id,t.id,U,_),j("")},L=m=>{switch(m){case"e2s":return"Finish-to-Start (FS)";case"s2s":return"Start-to-Start (SS)";case"e2e":return"Finish-to-Finish (FF)";case"s2e":return"Start-to-Finish (SF)"}},B=m=>{switch(m){case"e2s":return"blue";case"s2s":return"green";case"e2e":return"purple";case"s2e":return"orange"}},X=m=>!m||m===0?null:m>0?e.jsxs(o.Tag,{color:"warning",children:["+",m,"d lag"]}):e.jsxs(o.Tag,{color:"processing",children:[m,"d lead"]}),ee=(m,O)=>{const W=n.find(U=>U.id===(O==="source"?m.source:m.target));return e.jsx(o.List.Item,{actions:[e.jsx(o.Button,{type:"text",danger:!0,icon:e.jsx(I.FontAwesomeIcon,{icon:A.faTrash}),onClick:()=>s(m.id),children:"Remove"})],children:e.jsx(o.List.Item.Meta,{title:e.jsxs(o.Space,{children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:W?.text||(O==="source"?m.source:m.target)}),e.jsx(o.Tag,{color:B(m.type),children:L(m.type)}),X(m.lag)]}),description:e.jsxs(le,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:[W?.owner&&`Owner: ${W.owner}`,W?.priority&&` • Priority: ${W.priority}`]})})})};return e.jsxs(o.Modal,{title:e.jsxs(o.Space,{children:[e.jsx(I.FontAwesomeIcon,{icon:A.faLink,style:{fontSize:"20px"}}),e.jsx(ve,{level:4,style:{margin:0,fontFamily:"IBM Plex Mono, monospace"},children:"Task Dependencies"})]}),open:!0,onCancel:p,width:900,footer:null,className:"gantt-dependency-modal",styles:{body:{maxHeight:"70vh",overflowY:"auto",fontFamily:"IBM Plex Sans, sans-serif"}},children:[e.jsx(o.Card,{size:"small",style:{marginBottom:24,backgroundColor:"#f5f5f5",borderColor:"#d9d9d9"},children:e.jsxs(o.Space,{direction:"vertical",size:4,children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace",fontSize:"16px"},children:t.text}),e.jsxs(le,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"13px"},children:[t.start.toLocaleDateString()," → ",t.end.toLocaleDateString(),t.owner&&` • Owner: ${t.owner}`,t.priority&&` • Priority: ${t.priority}`]})]})}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(ve,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(I.FontAwesomeIcon,{icon:A.faArrowDown,style:{marginRight:"8px"}}),"Depends On (Predecessors)"]}),F.length===0?e.jsx(o.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(o.List,{dataSource:F,renderItem:m=>ee(m,"source"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(ve,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(I.FontAwesomeIcon,{icon:A.faArrowUp,style:{marginRight:"8px"}}),"Dependents (Successors)"]}),f.length===0?e.jsx(o.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(o.List,{dataSource:f,renderItem:m=>ee(m,"target"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsx(o.Divider,{}),e.jsx(o.Card,{title:e.jsxs(ve,{level:5,style:{margin:0,fontFamily:"IBM Plex Mono, monospace",fontSize:"14px"},children:[e.jsx(I.FontAwesomeIcon,{icon:A.faPlus,style:{marginRight:"8px"}}),"Add New Dependency"]}),style:{marginBottom:24},children:e.jsxs(o.Space,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsxs("div",{children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Quick Add (Keyboard Shortcut):"}),e.jsx(le,{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(o.Space.Compact,{style:{width:"100%"},children:[e.jsx(o.Input,{placeholder:"e.g., 3FS+10d",value:h,onChange:m=>j(m.target.value),onPressEnter:$,size:"large",style:{fontFamily:"IBM Plex Mono, monospace"}}),e.jsx(o.Button,{type:"primary",size:"large",onClick:$,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Add"})]})]}),e.jsx(o.Divider,{style:{margin:"8px 0"},children:"OR"}),e.jsxs("div",{children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Select Task:"}),e.jsx(o.Select,{placeholder:"Choose a task...",value:c||void 0,onChange:l,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",showSearch:!0,filterOption:(m,O)=>String(O?.children||"").toLowerCase().includes(m.toLowerCase()),children:b.map(m=>e.jsx(fe,{value:m.id,children:m.text},m.id))})]}),e.jsxs("div",{children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Dependency Type:"}),e.jsxs(o.Select,{value:x,onChange:T,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",children:[e.jsxs(fe,{value:"e2s",children:[e.jsx(o.Tag,{color:"blue",children:"FS"})," Finish-to-Start"]}),e.jsxs(fe,{value:"s2s",children:[e.jsx(o.Tag,{color:"green",children:"SS"})," Start-to-Start"]}),e.jsxs(fe,{value:"e2e",children:[e.jsx(o.Tag,{color:"purple",children:"FF"})," Finish-to-Finish"]}),e.jsxs(fe,{value:"s2e",children:[e.jsx(o.Tag,{color:"orange",children:"SF"})," Start-to-Finish"]})]})]}),e.jsx("div",{children:e.jsxs(o.Space,{direction:"vertical",size:4,style:{width:"100%"},children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Lead/Lag Time:"}),e.jsx(le,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:"Negative = lead time (overlap), Positive = lag time (delay)"}),e.jsxs(o.Space.Compact,{style:{width:"100%"},children:[e.jsx(o.InputNumber,{value:d,onChange:m=>g(m||0),style:{flex:1,fontFamily:"IBM Plex Sans, sans-serif"},size:"large",placeholder:"0",min:-365,max:365}),e.jsxs(o.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(o.Button,{type:"primary",size:"large",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faPlus}),onClick:E,disabled:!c,block:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",fontWeight:600},children:"Add Dependency"})]})}),e.jsx(o.Alert,{message:e.jsxs(le,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace"},children:[e.jsx(I.FontAwesomeIcon,{icon:A.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(o.Divider,{style:{margin:"12px 0"}}),e.jsx(le,{strong:!0,style:{display:"block",marginBottom:4},children:"Keyboard Shortcuts:"}),e.jsx(Ke,{style:{margin:0,fontSize:"12px"},code:!0,children:"[TaskID][Type]+/-[Days]d"}),e.jsxs(Ke,{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(I.FontAwesomeIcon,{icon:A.faInfoCircle}),style:{marginTop:16}})]})},Ft=({x:t,y:n,task:i,onEdit:a,onDelete:s,onCopy:p,onDependencies:c,onConvertToMilestone:l,onConvertToTask:x,onConvertToProject:T,onAutoSchedule:d,onClose:g})=>{if(!i)return null;const D=[{key:"edit",label:"Edit",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faEdit}),onClick:()=>{a(),g()}},{key:"copy",label:"Copy",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faCopy}),onClick:()=>{p(),g()}},{key:"dependencies",label:"Dependencies",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faLink}),onClick:()=>{c(),g()}},{type:"divider"},{key:"convert",label:"Convert to",type:"submenu",children:[{key:"milestone",label:"Milestone",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFlag}),disabled:i.type==="milestone",onClick:()=>{l(),g()}},{key:"task",label:"Task",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faTasks}),disabled:i.type==="task",onClick:()=>{x(),g()}},{key:"project",label:"Project",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFolder}),disabled:i.type==="project",onClick:()=>{T(),g()}}]},{key:"auto-schedule",label:"Auto Schedule",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faRotateLeft}),onClick:()=>{d?.(),g()}},{type:"divider"},{key:"delete",label:"Delete",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faTrash}),danger:!0,onClick:()=>{s(),g()}}];return e.jsx("div",{className:"gantt-context-menu",style:{position:"fixed",left:`${t}px`,top:`${n}px`,zIndex:1e4},onClick:u=>u.stopPropagation(),children:e.jsx(o.Menu,{items:D,style:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"6px",border:"1px solid #e0e0e0"}})})},et=(t,n=[])=>{const[i,a]=S.useState([]),[s,p]=S.useState(-1),[c,l]=S.useState(t),[x,T]=S.useState(n);S.useEffect(()=>{l(t)},[t]),S.useEffect(()=>{T(n)},[n]);const d=S.useCallback((b,E,$)=>{const L={type:b,before:E,after:$,timestamp:Date.now()},B=i.slice(0,s+1);B.push(L),B.length>50?B.shift():p(s+1),a(B)},[i,s]),g=S.useCallback(()=>{if(s<0)return;const b=i[s];l(b.before.tasks),T(b.before.links),p(s-1)},[i,s]),D=S.useCallback(()=>{if(s>=i.length-1)return;const b=i[s+1];l(b.after.tasks),T(b.after.links),p(s+1)},[i,s]),u=s>=0,h=s<i.length-1,j=S.useCallback(b=>{const E={tasks:c,links:x},$=c.map(B=>B.id===b.id?b:B);d("task_update",E,{tasks:$,links:x}),l($)},[c,x,d]),F=S.useCallback(b=>{const E={tasks:c,links:x},$=[...c,b];d("task_create",E,{tasks:$,links:x}),l($)},[c,x,d]),f=S.useCallback(b=>{const E={tasks:c,links:x},$=c.filter(X=>X.id!==b),L=x.filter(X=>X.source!==b&&X.target!==b);d("task_delete",E,{tasks:$,links:L}),l($),T(L)},[c,x,d]);return{tasks:c,links:x,setTasks:l,setLinks:T,undo:g,redo:D,canUndo:u,canRedo:h,updateTask:j,createTask:F,deleteTask:f,saveState:d,history:i}},tt=(t,n,i={mode:"forward"})=>{const a=new Map,s=new Map;return t.forEach(p=>{a.set(p.id,[]),s.set(p.id,[])}),n.forEach(p=>{p.type==="e2s"&&(a.get(p.target)?.push(p.source),s.get(p.source)?.push(p.target))}),i.mode==="forward"?Et(t,a,i):$t(t,s,i)},Et=(t,n,i)=>{const a=new Map,s=new Set,p=i.projectStart||new Date,c=l=>{if(s.has(l))return;const x=t.find(h=>h.id===l);if(!x)return;const T=n.get(l)||[];T.forEach(h=>c(h));let d=p;T.forEach(h=>{const j=a.get(h);j&&j.end>d&&(d=new Date(j.end))});const g=new Date(d),D=q(g,x.duration,"day"),u={...x,start:g,end:D};a.set(l,u),s.add(l)};return t.forEach(l=>c(l.id)),t.map(l=>a.get(l.id)||l)},$t=(t,n,i)=>{const a=new Map,s=new Set,p=i.projectEnd||new Date(Math.max(...t.map(l=>l.end.getTime()))),c=l=>{if(s.has(l))return;const x=t.find(h=>h.id===l);if(!x)return;const T=n.get(l)||[];T.forEach(h=>c(h));let d=p;T.forEach(h=>{const j=a.get(h);j&&j.start<d&&(d=new Date(j.start))});const g=new Date(d),D=q(g,-x.duration,"day"),u={...x,start:D,end:g};a.set(l,u),s.add(l)};return t.forEach(l=>c(l.id)),t.map(l=>a.get(l.id)||l)},Nt=Object.freeze(Object.defineProperty({__proto__:null,autoSchedule:tt,levelResources:t=>{const n=new Map;t.forEach(a=>{a.owner&&(n.has(a.owner)||n.set(a.owner,[]),n.get(a.owner).push(a))});const i=[...t];return n.forEach((a,s)=>{const p=a.sort((c,l)=>c.start.getTime()-l.start.getTime());for(let c=1;c<p.length;c++){const l=p[c],x=p[c-1];if(l.start<x.end){const T=i.findIndex(d=>d.id===l.id);if(T>=0){const d=new Date(x.end),g=q(d,l.duration,"day");i[T]={...l,start:d,end:g}}}}}),i}},Symbol.toStringTag,{value:"Module"})),nt=t=>{const n=new Map;return t.forEach(i=>{n.set(i.id,{taskId:i.id,start:new Date(i.start),end:new Date(i.end)})}),n},st=t=>{const n=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority"],i=t.map(s=>[s.id,s.text,Q(s.start,"YYYY-MM-DD"),Q(s.end,"YYYY-MM-DD"),s.duration.toString(),`${s.progress}%`,s.type||"task",s.owner||"",s.priority||"medium"]),a=[n.join(","),...i.map(s=>s.map(p=>`"${p}"`).join(","))].join(`
|
|
8
|
-
`);
|
|
9
|
-
`);
|
|
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=`
|
|
10
18
|
GANTT CHART PROJECT
|
|
11
19
|
Generated: ${new Date().toLocaleString()}
|
|
12
20
|
|
|
13
21
|
Tasks:
|
|
14
|
-
${
|
|
15
|
-
${
|
|
16
|
-
Start: ${
|
|
17
|
-
End: ${
|
|
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")}
|
|
18
26
|
Duration: ${i.duration} days
|
|
19
27
|
Progress: ${i.progress}%
|
|
20
28
|
${i.owner?`Owner: ${i.owner}`:""}
|
|
21
29
|
`).join(`
|
|
22
30
|
`)}
|
|
23
|
-
`.trim();De(n,"gantt-report.txt","text/plain"),alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.")},Pt=(t,n,i="png")=>{if(!document.getElementById(t)){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")},De=(t,n,i)=>{const a=new Blob([t],{type:i}),s=URL.createObjectURL(a);At(s,n),URL.revokeObjectURL(s)},At=(t,n)=>{const i=document.createElement("a");i.href=t,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i)},It=Object.freeze(Object.defineProperty({__proto__:null,exportToCSV:st,exportToExcel:rt,exportToImage:Pt,exportToJSON:it,exportToPDF:ot,importFromJSON:t=>new Promise((n,i)=>{const a=new FileReader;a.onload=s=>{try{const p=s.target?.result,c=JSON.parse(p),l=c.tasks.map(x=>({...x,start:new Date(x.start),end:new Date(x.end)}));n({tasks:l,links:c.links||[]})}catch{i(new Error("Invalid JSON file"))}},a.onerror=()=>i(new Error("Failed to read file")),a.readAsText(t)})},Symbol.toStringTag,{value:"Module"})),Lt=[{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"}],Yt=[{unit:"month",step:1,format:"MMM"},{unit:"day",step:1,format:"D"}],at=({tasks:t=[],links:n=[],config:i={},onTaskUpdate:a,onTaskCreate:s,onTaskDelete:p,onLinkCreate:c,onLinkDelete:l})=>{const x=Array.isArray(t)?t:[],T=Array.isArray(n)?n:[],{tasks:d,links:g,setTasks:D,setLinks:u,undo:h,redo:j,updateTask:F,createTask:f,deleteTask:b,saveState:E}=et(x,T),[$,L]=S.useState(d),[B,X]=S.useState(null),[ee,m]=S.useState(null),[O,W]=S.useState(!1),[U,_]=S.useState(!1),[oe,te]=S.useState(null),[se,Z]=S.useState(null),[z,v]=S.useState(null),[C,r]=S.useState(null),[y,k]=S.useState(null),[P,V]=S.useState(1),[de,R]=S.useState(new Map),[K,ue]=S.useState(!1),[me]=S.useState(i.theme||"light"),[Me,Le]=S.useState({searchText:"",status:"all",priority:"all",owner:""}),Ot=S.useRef(null),Ce=S.useRef(null),_t=S.useRef(null),he={columns:Lt,scales:Yt,readonly:!1,editable:!0,taskHeight:28,rowHeight:44,scaleHeight:28,columnWidth:80,minColumnWidth:60,autoSchedule:!1,criticalPath:!1,baselines:K,weekends:!0,holidays:[],theme:me,locale:"en",...i};S.useEffect(()=>{const w=Je(d,Me);L((Y=>{const J=[],re=H=>{if(!H)return!1;const ae=Y.find(G=>G.id===H);return ae&&!ae.open&&ae.type==="project"?!0:re(ae?.parent)};return Y.forEach(H=>{re(H.parent)||J.push(H)}),J})(w))},[d,Me]);const Rt=S.useMemo(()=>{if(!d||!Array.isArray(d))return[];try{return Array.from(new Set(d.map(w=>w?.owner).filter(Boolean)))}catch(w){return console.warn("Error extracting owners:",w),[]}},[d]),zt=(()=>{const w=$.length>0?$:d;if(w.length===0){const H=new Date;return{start:Se(q(H,-30,"day")),end:Se(q(H,60,"day"))}}const M=w.map(H=>H.start.getTime()),Y=w.map(H=>H.end.getTime()),J=new Date(Math.min(...M)),re=new Date(Math.max(...Y));return{start:Se(q(J,-7,"day")),end:Se(re)}})(),Ht=w=>{X(w)},Wt=(w,M)=>{if(he.readonly)return;w.preventDefault();const Y=d.find(J=>J.id===M);Y&&k({x:w.clientX,y:w.clientY,task:Y})},Ut=()=>{if(!y?.task)return;const w=y.task,M={...w,id:`task-${Date.now()}`,text:`${w.text} (Copy)`,start:q(w.start,7,"day"),end:q(w.end,7,"day")};f(M),s&&s(M)},Ye=w=>{if(!y?.task)return;const M={...y.task,type:w};F(M),a&&a(M)},Gt=(w,M,Y,J)=>{if(!he.readonly)if(J==="reorder"){const re=$.findIndex(G=>G.id===w),H=(G,ie)=>{let ye=[];return ie.filter(ce=>ce.parent===G).forEach(ce=>{ye.push(ce.id),ye=[...ye,...H(ce.id,ie)]}),ye},ae=H(w,d);v({id:w,initialIndex:re,currentY:Y,descendantIds:ae}),document.body.classList.add("gantt-dragging")}else Z(w)},Vt=()=>{if(z&&C){const w=d.find(Y=>Y.id===z.id),M=d.find(Y=>Y.id===C.taskId);if(w&&M&&w.id!==M.id){const Y=[w.id,...z.descendantIds];if(!Y.includes(M.id)){const J=[...d];let re=C.position==="inside"?M.id:M.parent;const H=J.findIndex(ne=>ne.id===w.id);H!==-1&&(J[H]={...J[H],parent:re});const ae=J.filter(ne=>Y.includes(ne.id)),G=J.filter(ne=>!Y.includes(ne.id));let ie=G.findIndex(ne=>ne.id===M.id);if(C.position==="inside"){const ne=G.filter(ce=>ce.parent===M.id);ne.length>0?ie=G.findIndex(ce=>ce.id===ne[ne.length-1].id)+1:ie++}else if(C.position==="below"){const ne=(Oe,ut)=>{let ke=[];return ut.filter(Fe=>Fe.parent===Oe).forEach(Fe=>{ke.push(Fe.id),ke=[...ke,...ne(Fe.id,ut)]}),ke},ce=ne(M.id,G);ce.length>0?ie=G.findIndex(Oe=>Oe.id===ce[ce.length-1])+1:ie++}const ye={tasks:[...d],links:[...g]};G.splice(ie,0,...ae),D(G),E("task_update",ye,{tasks:G,links:g})}}}Z(null),v(null),r(null),document.body.classList.remove("gantt-dragging")},Jt=w=>{if(z){const M=he.rowHeight||44,Y=Ce.current?.querySelector(".gantt-grid-body");if(!Y)return;const J=Y.getBoundingClientRect(),re=w.clientY-J.top;let H=Math.floor(re/M);H=Math.max(0,Math.min(H,$.length-1));const ae=$[H];if(ae){const G=re-H*M;let ie="above";ae.type==="project"?G<M*.3?ie="above":G>M*.7?ie="below":ie="inside":ie=G<M/2?"above":"below",ae.id!==z.id?r({taskId:ae.id,position:ie}):r(null)}v(G=>G?{...G,currentY:w.clientY}:null)}},lt=()=>{z&&Vt()},Xt=w=>{const M={...w,id:`task-${Date.now()}`};f(M),s&&s(M)},Be=w=>{F(w),a&&a(w)},ct=w=>{b(w),p&&p(w)},dt=(w,M,Y,J)=>{const re={id:`link-${Date.now()}`,source:w,target:M,type:Y,lag:J};u([...g,re]),c&&c(re)},qt=w=>{const M=g.filter(Y=>Y.id!==w);u(M),l&&l(w)},Zt=()=>{if(!K&&de.size===0){const w=nt(d);R(w),ue(!0)}else ue(!K)};return S.useEffect(()=>{const w=M=>{(M.ctrlKey||M.metaKey)&&(M.key==="z"&&!M.shiftKey?(M.preventDefault(),h()):(M.key==="y"||M.key==="z"&&M.shiftKey)&&(M.preventDefault(),j()))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[h,j]),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(Xe,{zoomLevel:P,setZoomLevel:V,onBaselineToggle:Zt,showBaselines:K,onExport:w=>{w==="csv"&&st(d),w==="excel"&&rt(d),w==="json"&&it(d,g),w==="pdf"&&ot(d)},onFilterChange:w=>Le(w),owners:Rt||[],onAddTask:()=>W(!0)}),e.jsxs("div",{className:"gantt-layout",ref:_t,onMouseMove:Jt,onMouseUp:lt,onMouseLeave:lt,children:[e.jsx(Pe,{ref:Ce,tasks:$,columns:he.columns||[],selectedTask:B,onTaskClick:Ht,onTaskContextMenu:Wt,onTaskUpdate:Be,onTaskDragStart:Gt,onAddTask:()=>W(!0),onAddDependency:dt,onDependencyClick:w=>{const M=d.find(Y=>Y.id===w);M&&(te(M),_(!0))},links:g,allTasks:d,dropIndicator:C,reorderTask:z}),e.jsx(Ie,{ref:Ot,tasks:$,links:g,range:zt,scales:he.scales,config:he,selectedTask:B,draggedTask:se,onTaskClick:()=>{},onTaskDragStart:()=>{},onTaskDragEnd:()=>{},onTaskUpdate:(w,M)=>{const Y=d.find(J=>J.id===w);Y&&Be({...Y,...M})},zoomLevel:P,baselines:K?de:new Map})]}),O&&e.jsx(qe,{onCreateTask:Xt,onClose:()=>W(!1)}),ee&&e.jsx(Ze,{task:ee,onUpdate:Be,onDelete:ct,onClose:()=>m(null)}),U&&oe&&e.jsx(Qe,{task:oe,allTasks:d,links:g,onAddDependency:dt,onRemoveDependency:qt,onClose:()=>{_(!1),te(null)}}),y&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-context-menu-overlay",onClick:()=>k(null),onContextMenu:w=>{w.preventDefault(),k(null)}}),e.jsx(Ft,{x:y.x,y:y.y,task:y.task,onEdit:()=>{y.task&&m(y.task)},onDelete:()=>{y.task&&ct(y.task.id)},onCopy:Ut,onDependencies:()=>{y.task&&(te(y.task),_(!0))},onConvertToMilestone:()=>Ye("milestone"),onConvertToTask:()=>Ye("task"),onConvertToProject:()=>Ye("project"),onClose:()=>k(null),onAutoSchedule:()=>{const w=tt(d,g,{mode:"forward"});D(w),k(null)}})]}),z&&e.jsx("div",{className:"gantt-grid-row ghost-row",style:{height:he.rowHeight,top:z.currentY-(he.rowHeight||48)/2,left:Ce.current?.getBoundingClientRect().left,position:"fixed",pointerEvents:"none",opacity:.8,zIndex:9999,width:Ce.current?.offsetWidth,backgroundColor:"#ffffff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #2196F3",display:"flex"},children:he.columns?.map(w=>e.jsx("div",{className:"gantt-grid-cell",style:{width:w.width,textAlign:w.align||"left"},children:(()=>{const M=d.find(Y=>Y.id===z.id);if(!M)return null;if(w.template)return w.template(M);switch(w.name){case"text":return e.jsxs("div",{className:"gantt-grid-cell-text",children:[e.jsx(I.FontAwesomeIcon,{icon:A.faGripVertical,style:{marginRight:8,color:"#adb5bd"}}),e.jsxs("span",{className:"gantt-task-name-text",children:[M.text,z.descendantIds.length>0&&e.jsxs("span",{children:[" +",z.descendantIds.length," subtasks"]})]})]});case"start":return Q(M.start,"DD MMM YYYY");case"duration":return`${M.duration}`;default:return M[w.name]||""}})()},`ghost-${w.name}`))})]})]})},Bt=Object.freeze(Object.defineProperty({__proto__:null,calculateCriticalPath:(t,n)=>{const i=new Set,a=new Map,s=new Map,p=new Map;t.forEach(u=>{s.set(u.id,[]),p.set(u.id,[])}),n.forEach(u=>{u.type==="e2s"&&(s.get(u.source)?.push(u.target),p.get(u.target)?.push(u.source))});const c=new Map,l=new Map,x=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const j=t.find(f=>f.id===u);if(!j)return;const F=p.get(u)||[];if(F.length===0)c.set(u,0),l.set(u,j.duration);else{let f=0;F.forEach(b=>{x(b,h);const E=l.get(b)||0;f=Math.max(f,E)}),c.set(u,f),l.set(u,f+j.duration)}};t.forEach(u=>x(u.id));const T=new Map,d=new Map,g=Math.max(...Array.from(l.values())),D=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const j=t.find(f=>f.id===u);if(!j)return;const F=s.get(u)||[];if(F.length===0)d.set(u,g),T.set(u,g-j.duration);else{let f=1/0;F.forEach(b=>{D(b,h);const E=T.get(b)||0;f=Math.min(f,E)}),d.set(u,f),T.set(u,f-j.duration)}};return t.forEach(u=>D(u.id)),t.forEach(u=>{const h=c.get(u.id)||0,F=(T.get(u.id)||0)-h;a.set(u.id,F),Math.abs(F)<.01&&i.add(u.id)}),{criticalTasks:i,taskFloats:a,projectDuration:g}},getTaskFloat:(t,n)=>n.taskFloats.get(t)||0,isCriticalTask:(t,n)=>n.criticalTasks.has(t)},Symbol.toStringTag,{value:"Module"}));N.AutoScheduler=Nt,N.Chart=Ie,N.CriticalPath=Bt,N.DependencyEditor=Qe,N.ExportUtils=It,N.FilterSearch=Ve,N.Gantt=at,N.Grid=Pe,N.TaskBar=Ge,N.TaskCreator=qe,N.TaskEditor=Ze,N.Timeline=Ae,N.Toolbar=Xe,N.addToDate=q,N.applyFilters=Je,N.calculateDuration=xt,N.createBaseline=nt,N.default=at,N.formatDate=Q,N.getDaysBetween=be,N.getEndOfDay=mt,N.getHoursBetween=We,N.getStartOfDay=Se,N.isHoliday=$e,N.isWeekend=Ee,N.useUndoRedo=et,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
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"}})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iris-gantt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"build-storybook": "storybook build"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"
|
|
57
|
-
"
|
|
56
|
+
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
57
|
+
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
58
|
+
"@fortawesome/react-fontawesome": "^3.1.0",
|
|
58
59
|
"antd": "^5.29.3",
|
|
59
60
|
"dayjs": "^1.11.0",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"@fortawesome/free-solid-svg-icons": "^7.1.0"
|
|
61
|
+
"react": "^18.3.1",
|
|
62
|
+
"react-dom": "^18.3.1"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@ant-design/icons": "^6.1.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"@storybook/addon-vitest": "^10.1.11",
|
|
76
76
|
"@storybook/react-vite": "^10.1.11",
|
|
77
77
|
"@types/node": "^24.10.1",
|
|
78
|
-
"@types/react": "^
|
|
79
|
-
"@types/react-dom": "^
|
|
78
|
+
"@types/react": "^18.3.0",
|
|
79
|
+
"@types/react-dom": "^18.3.0",
|
|
80
80
|
"@vitejs/plugin-react": "^5.1.1",
|
|
81
81
|
"@vitest/browser-playwright": "^4.0.17",
|
|
82
82
|
"@vitest/coverage-v8": "^4.0.17",
|
|
@@ -85,6 +85,8 @@
|
|
|
85
85
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
86
86
|
"globals": "^16.5.0",
|
|
87
87
|
"playwright": "^1.57.0",
|
|
88
|
+
"react": "^18.3.1",
|
|
89
|
+
"react-dom": "^18.3.1",
|
|
88
90
|
"storybook": "^10.1.11",
|
|
89
91
|
"typescript": "~5.9.3",
|
|
90
92
|
"typescript-eslint": "^8.46.4",
|