@jaeungkim/gantt-chart 0.2.4 → 0.3.0

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/README.md CHANGED
@@ -2,24 +2,31 @@
2
2
 
3
3
  <!-- ![React Gantt Chart](https://raw.githubusercontent.com/jaeungkim/gantt-chart/main/public/readmeImg.png) -->
4
4
 
5
- Lightweight, high-performance Gantt chart component for React applications, for fast rendering and state management. It is designed to be highly customizable and easy to integrate into modern React projects.
5
+ Lightweight, high-performance Gantt chart component for React applications. Designed for fast rendering with virtualization and clean, minimal aesthetics.
6
6
 
7
7
  ## 🎯 Motivation
8
8
 
9
- I originally wanted to use Microsoft Project's Gantt Chart for personal project management, but it required subscription 😔. Thus, I decided to build my own Gantt chart, referencing various open-source projects and examples, including MS Project, DHTMLX, Frappe Gantt Chart, and etc.
9
+ I originally wanted to use Microsoft Project's Gantt Chart for personal project management, but it required a subscription 😔. Thus, I decided to build my own Gantt chart, referencing various open-source projects and examples, including MS Project, DHTMLX, Frappe Gantt Chart, and etc.
10
10
 
11
- Since there arent many open-source Gantt chart solutions available, I hope this project will be useful for others as well. I am very open to feedback, feature requests, and contributions to make this Gantt chart as robust and versatile as possible.
11
+ Since there aren't many open-source Gantt chart solutions available, I hope this project will be useful for others as well. I am very open to feedback, feature requests, and contributions to make this Gantt chart as robust and versatile as possible.
12
12
 
13
13
  Currently, this project is built specifically for React due to my development background, but in the future, I may explore making it available for other frameworks as well. Since this is my first open-source project, I look forward to learning and improving it with the community!
14
14
 
15
15
  ## ✨ Features
16
16
 
17
- - 📆 Supports multiple timeline scales: Day, Week, Month, Year
18
- - 🔄 Drag-and-drop resizing (snap to configured intervals)
19
- - 🧲 Smart dependency lines (Finish-Start, Start-Start, Start-Finish, Finish-Finish)
20
- - 📦 Lightweight and framework-agnostic component design
17
+ - 📆 Multiple timeline scales: Day, Week, Month, Year
18
+ - 🔄 Drag-and-drop support:
19
+ - Move entire task bars
20
+ - Resize from left/right edges
21
+ - Snap to configured intervals
22
+ - 🧲 Smart dependency arrows (FS, SS, FF, SF)
23
+ - ⚡ Virtualized rendering for performance
24
+ - 🌙 Light/Dark/System theme support
25
+ - 📍 Today marker indicator
26
+ - 💬 Drag tooltip showing date changes
27
+ - 📦 Lightweight with minimal dependencies
21
28
 
22
- ## 📺 [Demo is worth a thousand words](https://jaeungkim.com/gantt-chart)
29
+ ## 📺 [Demo](https://jaeungkim.com/gantt-chart)
23
30
 
24
31
  ## 🚀 Getting Started
25
32
 
@@ -31,125 +38,123 @@ npm install @jaeungkim/gantt-chart
31
38
  yarn add @jaeungkim/gantt-chart
32
39
  ```
33
40
 
34
- ```ts
35
- import { Gantt } from '@jaeungkim/gantt-chart';
36
- import type { Task } from '@jaeungkim/gantt-chart';
41
+ ### Basic Usage
37
42
 
38
- export type DependencyType = 'FS' | 'SS' | 'FF' | 'SF';
43
+ ```tsx
44
+ import { ReactGanttChart } from '@jaeungkim/gantt-chart';
45
+ import type { Task } from '@jaeungkim/gantt-chart';
39
46
 
40
- const ReactGanttChart: Task[] = [
47
+ const tasks: Task[] = [
41
48
  {
42
49
  id: '1',
43
50
  name: 'Project Kickoff',
44
51
  startDate: '2024-06-01T09:00:00Z',
45
- endDate: '2024-06-01T11:00:00Z',
52
+ endDate: '2024-06-03T17:00:00Z',
46
53
  parentId: null,
47
54
  sequence: '1',
55
+ dependencies: [],
56
+ },
57
+ {
58
+ id: '2',
59
+ name: 'Requirements Gathering',
60
+ startDate: '2024-06-04T09:00:00Z',
61
+ endDate: '2024-06-10T17:00:00Z',
62
+ parentId: null,
63
+ sequence: '2',
48
64
  dependencies: [{ targetId: '1', type: 'FS' }],
49
65
  },
50
- ...
51
66
  ];
52
67
 
53
- export default function Example() {
68
+ export default function App() {
54
69
  return (
55
- <div style={{ width: 'auto', height: '100dvh' }}>
56
- <ReactGanttChart
57
- tasks={tasks}
58
- ganttHeight="100%"
59
- columnWidth="100%"
60
- onTasksChange={(updated) => console.log(updated)}
61
- />
62
- </div>
70
+ <ReactGanttChart
71
+ tasks={tasks}
72
+ height="100vh"
73
+ width="100%"
74
+ theme="system"
75
+ defaultScale="month"
76
+ onTasksChange={(updated) => console.log('Tasks updated:', updated)}
77
+ />
63
78
  );
64
79
  }
65
80
  ```
66
81
 
67
- ### Props
82
+ ## Props
68
83
 
69
- | Prop | Type | Description |
70
- | --------------- | -------------------------------- | ---------------------------------------------- |
71
- | `tasks` | `Task[]` | Array of task objects to render |
72
- | `onTasksChange` | `(updatedTasks: Task[]) => void` | Callback fired when a task is moved or resized |
73
- | `ganttHeight` | `number \| string` | Height of the chart (`number` or `string`) |
74
- | `columnWidth` | `number \| string` | Width of the chart (`number` or `string`) |
84
+ | Prop | Type | Default | Description |
85
+ |------|------|---------|-------------|
86
+ | `tasks` | `Task[]` | `[]` | Array of task objects to render |
87
+ | `onTasksChange` | `(tasks: Task[]) => void` | - | Callback when tasks are moved or resized |
88
+ | `height` | `number \| string` | `600` | Chart height (px or CSS value) |
89
+ | `width` | `number \| string` | `"100%"` | Chart width (px or CSS value) |
90
+ | `theme` | `"light" \| "dark" \| "system"` | - | Theme mode |
91
+ | `defaultScale` | `"day" \| "week" \| "month" \| "year"` | `"month"` | Initial timeline scale |
92
+ | `className` | `string` | - | Additional CSS class for the container |
75
93
 
76
- ### Task Format
94
+ ## Task Format
77
95
 
78
- All dates must be in **UTC ISO string format**, like: `"2024-06-01T09:00:00Z"`.
79
- Internally, dates are parsed and converted to local time using `dayjs`.
96
+ All dates must be in **UTC ISO string format**: `"2024-06-01T09:00:00Z"`
80
97
 
81
98
  ```ts
82
99
  interface Task {
83
100
  id: string;
84
101
  name: string;
85
- startDate: string; // UTC ISO string
86
- endDate: string; // UTC ISO string
102
+ startDate: string; // UTC ISO string
103
+ endDate: string; // UTC ISO string
87
104
  parentId: string | null;
88
105
  sequence: string;
89
106
  dependencies?: TaskDependency[];
90
107
  }
91
108
 
92
- export type DependencyType = 'FS' | 'SS' | 'FF' | 'SF';
93
-
94
109
  interface TaskDependency {
95
110
  targetId: string;
96
111
  type: DependencyType;
97
112
  }
113
+
114
+ type DependencyType = 'FS' | 'SS' | 'FF' | 'SF';
115
+ // FS = Finish-to-Start
116
+ // SS = Start-to-Start
117
+ // FF = Finish-to-Finish
118
+ // SF = Start-to-Finish
98
119
  ```
99
120
 
100
121
  ## Timeline Scales
101
122
 
102
- The chart supports four built-in scales:
103
-
104
- - **`day`**
105
- - Label: Day
106
- - Tick Unit: Hour
107
- - Drag Step: 15 minutes
108
-
109
- - **`week`**
110
- - Label: Week
111
- - Tick Unit: Day
112
- - Drag Step: 6 hours
113
-
114
- - **`month`**
115
- - Label: Month
116
- - Tick Unit: Day
117
- - Drag Step: 1 day
123
+ | Scale | Header Label | Tick Unit | Drag Step |
124
+ |-------|-------------|-----------|-----------|
125
+ | `day` | Day | Hour | 1 hour |
126
+ | `week` | Week | Day | 6 hours |
127
+ | `month` | Month | Day | 1 day |
128
+ | `year` | Year | Month | 7 days |
118
129
 
119
- - **`year`**
120
- - Label: Year
121
- - Tick Unit: 7 days
122
- - Drag Step: 1 day
130
+ Switch scales using the dropdown at the top-right of the chart.
123
131
 
124
- You can switch between them using the dropdown at the top-right of the chart.
132
+ ## Theming
125
133
 
126
- ## Customization
134
+ The chart supports three theme modes:
127
135
 
128
- Currently at this stage it's not quite customizable other than importing your own tasks.
129
- But in near future, I will definitely make it customizable with adding features like
136
+ - **`light`** - Light background with dark text
137
+ - **`dark`** - Dark background with light text
138
+ - **`system`** - Follows system preference (uses `prefers-color-scheme`)
130
139
 
131
- - Timeline structure (`setupTimelineStructure`)
132
- - Header display (`GanttChartHeader`)
133
- - Bar visuals (`GanttBar`)
134
- - Tick intervals, formats, and drag steps (`GANTT_SCALE_CONFIG`)
135
-
136
- Stay Tuned~
140
+ ```tsx
141
+ <ReactGanttChart theme="dark" ... />
142
+ ```
137
143
 
138
- ## Roadmap
144
+ ## Roadmap
139
145
 
140
- - [ ] Left sidebar for displaying tasks' names
141
- - [ ] Right sidebar for selected tasks' to view their information
146
+ - [ ] Left sidebar for task names
147
+ - [ ] Right sidebar for task details
142
148
  - [ ] Collapsible parent-child rows
143
- - [ ] Virtualized rows for large datasets
144
149
  - [ ] Inline editing for task names
145
- - [ ] Export to PNG or SVG
150
+ - [ ] Export to PNG/SVG
151
+ - [ ] Custom bar colors
146
152
 
147
153
  ## 🤝 Contributing
148
154
 
149
155
  Pull requests are welcome!
150
156
  If you find bugs or have suggestions, feel free to open an issue or contribute directly.
151
157
 
152
-
153
158
  ## 📄 License
154
159
 
155
- MIT © [jaeungkim](https://github.com/jaeungkim)
160
+ MIT © [jaeungkim](https://github.com/jaeungkim)
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap";:root{--background: #ffffff;--foreground: #333333;--muted: #f5f5f5;--muted-foreground: #999999;--border: #f0f0f0;--bar-bg: #f0f0f0;--bar-text: #333333;--today: #999999;--arrow: #c0c0c0}.dark,[data-theme=dark]{--background: #1a1a1a;--foreground: #e5e5e5;--muted: #252525;--muted-foreground: #888888;--border: #2a2a2a;--bar-bg: #333333;--bar-text: #e5e5e5;--today: #e5e5e5;--arrow: #555555}.gantt-container{position:relative;overflow:auto;background:var(--background);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:14px;line-height:1.5;color:var(--foreground);-webkit-font-smoothing:antialiased}.gantt-inner{width:100%;height:100%;overflow:hidden;background:var(--background)}.gantt-section{position:relative;display:flex;flex-direction:column;width:100%;height:100%}.gantt-scale-selector{position:absolute;top:10px;right:16px;z-index:50}.gantt-scale-select{height:28px;padding:0 28px 0 12px;font-family:inherit;font-size:13px;font-weight:500;border:1px solid var(--border);border-radius:6px;background-color:var(--background);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;color:var(--foreground);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gantt-scale-select:hover{border-color:var(--muted-foreground)}.gantt-scale-select:focus{outline:none;border-color:var(--foreground)}.gantt-list{width:100%;height:100%;overflow:auto}.gantt-list::-webkit-scrollbar{width:8px;height:8px}.gantt-list::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}.gantt-content{position:relative}.gantt-task-row{position:absolute;top:0;left:0;display:flex;width:100%;align-items:center;border-bottom:1px solid var(--border)}.gantt-header{position:sticky;top:0;z-index:30;background:var(--background);border-bottom:1px solid var(--border)}.gantt-header-content{display:flex;flex-direction:column}.gantt-top-header{position:relative;display:flex;height:40px}.gantt-top-groups{display:flex}.gantt-top-group{display:flex;align-items:center;padding:0 16px;font-size:14px;font-weight:600;background:var(--background);color:var(--foreground);z-index:40}.gantt-top-group.sticky{position:sticky;left:0}.gantt-top-group-label{margin:0;padding:0;white-space:nowrap}.gantt-bottom-row{display:flex;height:32px}.gantt-bottom-cell{display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;color:var(--muted-foreground)}.gantt-task-bar{position:relative;display:flex;align-items:center;background:var(--bar-bg);border-radius:6px;-webkit-user-select:none;user-select:none;cursor:grab;transition:opacity .15s ease}.gantt-task-bar:hover{opacity:.85}.gantt-task-bar:active,.gantt-task-bar.dragging{cursor:grabbing;opacity:.7}.gantt-task-name{flex:1;padding:0 10px;font-family:inherit;font-size:12px;font-weight:500;color:var(--bar-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gantt-today-marker{position:absolute;top:0;width:1px;background:var(--today);z-index:15;pointer-events:none}.gantt-today-marker:before{content:"";position:absolute;top:-4px;left:-3px;width:7px;height:7px;background:var(--today);border-radius:50%}.gantt-today-label{display:none}.gantt-dependency-arrows{position:absolute;top:0;left:0;width:100%;pointer-events:none;z-index:5}.gantt-dependency-arrow{stroke:var(--arrow);stroke-width:1;fill:none}.gantt-dependency-arrow-head{fill:var(--arrow);stroke:none}.gantt-bar-tooltip{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);z-index:100;padding:6px 10px;background:var(--foreground);color:var(--background);border-radius:4px;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:11px;font-weight:500;white-space:nowrap;box-shadow:0 2px 8px #0000001f;pointer-events:none}.gantt-bar-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:var(--foreground)}@media (max-width: 768px){.gantt-scale-select{height:26px;font-size:12px}.gantt-top-group{font-size:12px}.gantt-bottom-cell,.gantt-task-name{font-size:11px}}
package/dist/index.cjs.js CHANGED
@@ -1,34 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ee=require("react"),xt=require("react-dom");function bt(s){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(c,t,r.get?r:{enumerable:!0,get:()=>s[t]})}}return c.default=s,Object.freeze(c)}const Se=bt(ee);function ie(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Me={exports:{}},be={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Ge;function Dt(){if(Ge)return be;Ge=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function t(r,n,e){var a=null;if(e!==void 0&&(a=""+e),n.key!==void 0&&(a=""+n.key),"key"in n){e={};for(var i in n)i!=="key"&&(e[i]=n[i])}else e=n;return n=e.ref,{$$typeof:s,type:r,key:a,ref:n!==void 0?n:null,props:e}}return be.Fragment=c,be.jsx=t,be.jsxs=t,be}var De={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Xe;function wt(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&function(){function s(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===k?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case j:return"Fragment";case N:return"Portal";case D:return"Profiler";case E:return"StrictMode";case Y:return"Suspense";case V:return"SuspenseList"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case m:return(o.displayName||"Context")+".Provider";case l:return(o._context.displayName||"Context")+".Consumer";case C:var _=o.render;return o=o.displayName,o||(o=_.displayName||_.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case F:return _=o.displayName||null,_!==null?_:s(o.type)||"Memo";case O:_=o._payload,o=o._init;try{return s(o(_))}catch{}}return null}function c(o){return""+o}function t(o){try{c(o);var _=!1}catch{_=!0}if(_){_=console;var z=_.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return z.call(_,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),c(o)}}function r(){}function n(){if(J===0){re=console.log,ce=console.info,ae=console.warn,me=console.error,ue=console.group,te=console.groupCollapsed,oe=console.groupEnd;var o={configurable:!0,enumerable:!0,value:r,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}J++}function e(){if(J--,J===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},o,{value:re}),info:U({},o,{value:ce}),warn:U({},o,{value:ae}),error:U({},o,{value:me}),group:U({},o,{value:ue}),groupCollapsed:U({},o,{value:te}),groupEnd:U({},o,{value:oe})})}0>J&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function a(o){if(le===void 0)try{throw Error()}catch(z){var _=z.stack.trim().match(/\n( *(at )?)/);le=_&&_[1]||"",ge=-1<z.stack.indexOf(`
18
- at`)?" (<anonymous>)":-1<z.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+le+o+ge}function i(o,_){if(!o||qe)return"";var z=Ne.get(o);if(z!==void 0)return z;qe=!0,z=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var B=null;B=A.H,A.H=null,n();try{var ne={DetermineComponentFrameRoot:function(){try{if(_){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(fe){var we=fe}Reflect.construct(o,[],pe)}else{try{pe.call()}catch(fe){we=fe}o.call(pe.prototype)}}else{try{throw Error()}catch(fe){we=fe}(pe=o())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(fe){if(fe&&we&&typeof fe.stack=="string")return[fe.stack,we.stack]}return[null,null]}};ne.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var X=Object.getOwnPropertyDescriptor(ne.DetermineComponentFrameRoot,"name");X&&X.configurable&&Object.defineProperty(ne.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var H=ne.DetermineComponentFrameRoot(),de=H[0],$e=H[1];if(de&&$e){var se=de.split(`
20
- `),ve=$e.split(`
21
- `);for(H=X=0;X<se.length&&!se[X].includes("DetermineComponentFrameRoot");)X++;for(;H<ve.length&&!ve[H].includes("DetermineComponentFrameRoot");)H++;if(X===se.length||H===ve.length)for(X=se.length-1,H=ve.length-1;1<=X&&0<=H&&se[X]!==ve[H];)H--;for(;1<=X&&0<=H;X--,H--)if(se[X]!==ve[H]){if(X!==1||H!==1)do if(X--,H--,0>H||se[X]!==ve[H]){var xe=`
22
- `+se[X].replace(" at new "," at ");return o.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",o.displayName)),typeof o=="function"&&Ne.set(o,xe),xe}while(1<=X&&0<=H);break}}}finally{qe=!1,A.H=B,e(),Error.prepareStackTrace=z}return se=(se=o?o.displayName||o.name:"")?a(se):"",typeof o=="function"&&Ne.set(o,se),se}function d(o){if(o==null)return"";if(typeof o=="function"){var _=o.prototype;return i(o,!(!_||!_.isReactComponent))}if(typeof o=="string")return a(o);switch(o){case Y:return a("Suspense");case V:return a("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case C:return o=i(o.render,!1),o;case F:return d(o.type);case O:_=o._payload,o=o._init;try{return d(o(_))}catch{}}return""}function h(){var o=A.A;return o===null?null:o.getOwner()}function v(o){if(q.call(o,"key")){var _=Object.getOwnPropertyDescriptor(o,"key").get;if(_&&_.isReactWarning)return!1}return o.key!==void 0}function p(o,_){function z(){Ue||(Ue=!0,console.error("%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://react.dev/link/special-props)",_))}z.isReactWarning=!0,Object.defineProperty(o,"key",{get:z,configurable:!0})}function f(){var o=s(this.type);return Ye[o]||(Ye[o]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),o=this.props.ref,o!==void 0?o:null}function g(o,_,z,B,ne,X){return z=X.ref,o={$$typeof:L,type:o,key:_,props:X,_owner:ne},(z!==void 0?z:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:f}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function $(o,_,z,B,ne,X){if(typeof o=="string"||typeof o=="function"||o===j||o===D||o===E||o===Y||o===V||o===I||typeof o=="object"&&o!==null&&(o.$$typeof===O||o.$$typeof===F||o.$$typeof===m||o.$$typeof===l||o.$$typeof===C||o.$$typeof===G||o.getModuleId!==void 0)){var H=_.children;if(H!==void 0)if(B)if(Z(H)){for(B=0;B<H.length;B++)u(H[B],o);Object.freeze&&Object.freeze(H)}else console.error("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 u(H,o)}else H="",(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(H+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),o===null?B="null":Z(o)?B="array":o!==void 0&&o.$$typeof===L?(B="<"+(s(o.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):B=typeof o,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",B,H);if(q.call(_,"key")){H=s(o);var de=Object.keys(_).filter(function(se){return se!=="key"});B=0<de.length?"{key: someKey, "+de.join(": ..., ")+": ...}":"{key: someKey}",Be[H+B]||(de=0<de.length?"{"+de.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
- let props = %s;
24
- <%s {...props} />
25
- React keys must be passed directly to JSX without using spread:
26
- let props = %s;
27
- <%s key={someKey} {...props} />`,B,H,de,H),Be[H+B]=!0)}if(H=null,z!==void 0&&(t(z),H=""+z),v(_)&&(t(_.key),H=""+_.key),"key"in _){z={};for(var $e in _)$e!=="key"&&(z[$e]=_[$e])}else z=_;return H&&p(z,typeof o=="function"?o.displayName||o.name||"Unknown":o),g(o,H,X,ne,h(),z)}function u(o,_){if(typeof o=="object"&&o&&o.$$typeof!==St){if(Z(o))for(var z=0;z<o.length;z++){var B=o[z];w(B)&&T(B,_)}else if(w(o))o._store&&(o._store.validated=1);else if(o===null||typeof o!="object"?z=null:(z=P&&o[P]||o["@@iterator"],z=typeof z=="function"?z:null),typeof z=="function"&&z!==o.entries&&(z=z.call(o),z!==o))for(;!(o=z.next()).done;)w(o.value)&&T(o.value,_)}}function w(o){return typeof o=="object"&&o!==null&&o.$$typeof===L}function T(o,_){if(o._store&&!o._store.validated&&o.key==null&&(o._store.validated=1,_=R(_),!Ve[_])){Ve[_]=!0;var z="";o&&o._owner!=null&&o._owner!==h()&&(z=null,typeof o._owner.tag=="number"?z=s(o._owner.type):typeof o._owner.name=="string"&&(z=o._owner.name),z=" It was passed a child from "+z+".");var B=A.getCurrentStack;A.getCurrentStack=function(){var ne=d(o.type);return B&&(ne+=B()||""),ne},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',_,z),A.getCurrentStack=B}}function R(o){var _="",z=h();return z&&(z=s(z.type))&&(_=`
28
-
29
- Check the render method of \``+z+"`."),_||(o=s(o))&&(_=`
30
-
31
- Check the top-level render call using <`+o+">."),_}var M=ee,L=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),m=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),P=Symbol.iterator,k=Symbol.for("react.client.reference"),A=M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,U=Object.assign,G=Symbol.for("react.client.reference"),Z=Array.isArray,J=0,re,ce,ae,me,ue,te,oe;r.__reactDisabledLog=!0;var le,ge,qe=!1,Ne=new(typeof WeakMap=="function"?WeakMap:Map),St=Symbol.for("react.client.reference"),Ue,Ye={},Be={},Ve={};De.Fragment=j,De.jsx=function(o,_,z,B,ne){return $(o,_,z,!1,B,ne)},De.jsxs=function(o,_,z,B,ne){return $(o,_,z,!0,B,ne)}}()),De}var Ze;function Mt(){return Ze||(Ze=1,process.env.NODE_ENV==="production"?Me.exports=Dt():Me.exports=wt()),Me.exports}var W=Mt();function ye(s,c,t){let r=t.initialDeps??[],n;function e(){var a,i,d,h;let v;t.key&&((a=t.debug)!=null&&a.call(t))&&(v=Date.now());const p=s();if(!(p.length!==r.length||p.some(($,u)=>r[u]!==$)))return n;r=p;let g;if(t.key&&((i=t.debug)!=null&&i.call(t))&&(g=Date.now()),n=c(...p),t.key&&((d=t.debug)!=null&&d.call(t))){const $=Math.round((Date.now()-v)*100)/100,u=Math.round((Date.now()-g)*100)/100,w=u/16,T=(R,M)=>{for(R=String(R);R.length<M;)R=" "+R;return R};console.info(`%c⏱ ${T(u,5)} /${T($,5)} ms`,`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),N=require("react"),Gt=require("react-dom");function Xt(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(a,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return a.default=r,Object.freeze(a)}const gt=Xt(N),pt=38,Zt=5,Z={day:{labelUnit:"day",tickUnit:"hour",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:1,basePxPerDragStep:32,formatTickLabel:r=>r.format("hh"),formatHeaderLabel:r=>r.format("MMM D")},week:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:6,basePxPerDragStep:54,formatTickLabel:r=>r.format("D"),formatHeaderLabel:r=>r.format("MMM")},month:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:32,formatTickLabel:r=>r.format("D"),formatHeaderLabel:r=>r.format("MMM YYYY")},year:{labelUnit:"month",tickUnit:"month",unitPerTick:1,dragStepUnit:"day",dragStepAmount:7,basePxPerDragStep:28,formatTickLabel:r=>r.format("D"),formatHeaderLabel:r=>r.format("MMM YYYY")}},yt=r=>Symbol.iterator in r,St=r=>"entries"in r,xt=(r,a)=>{const e=r instanceof Map?r:new Map(r.entries()),n=a instanceof Map?a:new Map(a.entries());if(e.size!==n.size)return!1;for(const[s,t]of e)if(!n.has(s)||!Object.is(t,n.get(s)))return!1;return!0},Jt=(r,a)=>{const e=r[Symbol.iterator](),n=a[Symbol.iterator]();let s=e.next(),t=n.next();for(;!s.done&&!t.done;){if(!Object.is(s.value,t.value))return!1;s=e.next(),t=n.next()}return!!s.done&&!!t.done};function Kt(r,a){return Object.is(r,a)?!0:typeof r!="object"||r===null||typeof a!="object"||a===null||Object.getPrototypeOf(r)!==Object.getPrototypeOf(a)?!1:yt(r)&&yt(a)?St(r)&&St(a)?xt(r,a):Jt(r,a):xt({entries:()=>Object.entries(r)},{entries:()=>Object.entries(a)})}function Qt(r){const a=N.useRef(void 0);return e=>{const n=r(e);return Kt(a.current,n)?a.current:a.current=n}}const bt=r=>{let a;const e=new Set,n=(c,d)=>{const l=typeof c=="function"?c(a):c;if(!Object.is(l,a)){const h=a;a=d??(typeof l!="object"||l===null)?l:Object.assign({},a,l),e.forEach(x=>x(a,h))}},s=()=>a,i={setState:n,getState:s,getInitialState:()=>u,subscribe:c=>(e.add(c),()=>e.delete(c))},u=a=r(n,s,i);return i},te=(r=>r?bt(r):bt),ee=r=>r;function ne(r,a=ee){const e=N.useSyncExternalStore(r.subscribe,N.useCallback(()=>a(r.getState()),[r,a]),N.useCallback(()=>a(r.getInitialState()),[r,a]));return N.useDebugValue(e),e}const re=r=>{const a=te(r),e=n=>ne(a,n);return Object.assign(e,a),e},se=(r=>re);function qt(r,a){let e;try{e=r()}catch{return}return{getItem:s=>{var t;const o=u=>u===null?null:JSON.parse(u,void 0),i=(t=e.getItem(s))!=null?t:null;return i instanceof Promise?i.then(o):o(i)},setItem:(s,t)=>e.setItem(s,JSON.stringify(t,void 0)),removeItem:s=>e.removeItem(s)}}const vt=r=>a=>{try{const e=r(a);return e instanceof Promise?e:{then(n){return vt(n)(e)},catch(n){return this}}}catch(e){return{then(n){return this},catch(n){return vt(n)(e)}}}},ie=(r,a)=>(e,n,s)=>{let t={storage:qt(()=>localStorage),partialize:f=>f,version:0,merge:(f,S)=>({...S,...f}),...a},o=!1;const i=new Set,u=new Set;let c=t.storage;if(!c)return r((...f)=>{console.warn(`[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`),e(...f)},n,s);const d=()=>{const f=t.partialize({...n()});return c.setItem(t.name,{state:f,version:t.version})},l=s.setState;s.setState=(f,S)=>(l(f,S),d());const h=r((...f)=>(e(...f),d()),n,s);s.getInitialState=()=>h;let x;const y=()=>{var f,S;if(!c)return;o=!1,i.forEach(b=>{var g;return b((g=n())!=null?g:h)});const D=((S=t.onRehydrateStorage)==null?void 0:S.call(t,(f=n())!=null?f:h))||void 0;return vt(c.getItem.bind(c))(t.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==t.version){if(t.migrate){const g=t.migrate(b.state,b.version);return g instanceof Promise?g.then(z=>[!0,z]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var g;const[z,R]=b;if(x=t.merge(R,(g=n())!=null?g:h),e(x,!0),z)return d()}).then(()=>{D==null||D(x,void 0),x=n(),o=!0,u.forEach(b=>b(x))}).catch(b=>{D==null||D(void 0,b)})};return s.persist={setOptions:f=>{t={...t,...f},f.storage&&(c=f.storage)},clearStorage:()=>{c==null||c.removeItem(t.name)},getOptions:()=>t,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:f=>(i.add(f),()=>{i.delete(f)}),onFinishHydration:f=>(u.add(f),()=>{u.delete(f)})},t.skipHydration||y(),x||h},oe=ie,et=se()(oe((r,a)=>({rawTasks:[],transformedTasks:[],bottomRowCells:[],selectedScale:"month",currentTask:null,dragOffsets:{},setCurrentTask:e=>r({currentTask:e}),setSelectedScale:e=>r({selectedScale:e}),setRawTasks:e=>r({rawTasks:e}),setBottomRowCells:e=>r({bottomRowCells:e}),setTransformedTasks:e=>r({transformedTasks:e}),setDragOffset:(e,n)=>r(s=>({dragOffsets:{...s.dragOffsets,[e]:n}})),clearDragOffset:e=>r(n=>{const{[e]:s,...t}=n.dragOffsets;return{dragOffsets:t}}),getCurrentDragOffset:e=>a().dragOffsets[e]||null,getTotalWidth:()=>a().bottomRowCells.reduce((n,s)=>n+s.widthPx,0)}),{name:"gantt-storage",storage:qt(()=>sessionStorage),partialize:r=>({selectedScale:r.selectedScale})}));function Bt(){return et(Qt(r=>({rawTasks:r.rawTasks,transformedTasks:r.transformedTasks,bottomRowCells:r.bottomRowCells,selectedScale:r.selectedScale,currentTask:r.currentTask,dragOffsets:r.dragOffsets,setRawTasks:r.setRawTasks,setTransformedTasks:r.setTransformedTasks,setBottomRowCells:r.setBottomRowCells,setSelectedScale:r.setSelectedScale,setCurrentTask:r.setCurrentTask,setDragOffset:r.setDragOffset,clearDragOffset:r.clearDragOffset,getTotalWidth:r.getTotalWidth,getCurrentDragOffset:r.getCurrentDragOffset})))}function q(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var rt={exports:{}},ae=rt.exports,Mt;function ue(){return Mt||(Mt=1,(function(r,a){(function(e,n){r.exports=n()})(ae,(function(){var e=1e3,n=6e4,s=36e5,t="millisecond",o="second",i="minute",u="hour",c="day",d="week",l="month",h="quarter",x="year",y="date",f="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var O=["th","st","nd","rd"],M=E%100;return"["+E+(O[(M-20)%10]||O[M]||O[0])+"]"}},g=function(E,O,M){var I=String(E);return!I||I.length>=O?E:""+Array(O+1-I.length).join(M)+E},z={s:g,z:function(E){var O=-E.utcOffset(),M=Math.abs(O),I=Math.floor(M/60),w=M%60;return(O<=0?"+":"-")+g(I,2,"0")+":"+g(w,2,"0")},m:function E(O,M){if(O.date()<M.date())return-E(M,O);var I=12*(M.year()-O.year())+(M.month()-O.month()),w=O.clone().add(I,l),C=M-w<0,L=O.clone().add(I+(C?-1:1),l);return+(-(I+(M-w)/(C?w-L:L-w))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:l,y:x,w:d,d:c,D:y,h:u,m:i,s:o,ms:t,Q:h}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},R="en",T={};T[R]=b;var v="$isDayjsObject",p=function(E){return E instanceof P||!(!E||!E[v])},$=function E(O,M,I){var w;if(!O)return R;if(typeof O=="string"){var C=O.toLowerCase();T[C]&&(w=C),M&&(T[C]=M,w=C);var L=O.split("-");if(!w&&L.length>1)return E(L[0])}else{var j=O.name;T[j]=O,w=j}return!I&&w&&(R=w),w||!I&&R},m=function(E,O){if(p(E))return E.clone();var M=typeof O=="object"?O:{};return M.date=E,M.args=arguments,new P(M)},k=z;k.l=$,k.i=p,k.w=function(E,O){return m(E,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var P=(function(){function E(M){this.$L=$(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[v]=!0}var O=E.prototype;return O.parse=function(M){this.$d=(function(I){var w=I.date,C=I.utc;if(w===null)return new Date(NaN);if(k.u(w))return new Date;if(w instanceof Date)return new Date(w);if(typeof w=="string"&&!/Z$/i.test(w)){var L=w.match(S);if(L){var j=L[2]-1||0,F=(L[7]||"0").substring(0,3);return C?new Date(Date.UTC(L[1],j,L[3]||1,L[4]||0,L[5]||0,L[6]||0,F)):new Date(L[1],j,L[3]||1,L[4]||0,L[5]||0,L[6]||0,F)}}return new Date(w)})(M),this.init()},O.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},O.$utils=function(){return k},O.isValid=function(){return this.$d.toString()!==f},O.isSame=function(M,I){var w=m(M);return this.startOf(I)<=w&&w<=this.endOf(I)},O.isAfter=function(M,I){return m(M)<this.startOf(I)},O.isBefore=function(M,I){return this.endOf(I)<m(M)},O.$g=function(M,I,w){return k.u(M)?this[I]:this.set(w,M)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(M,I){var w=this,C=!!k.u(I)||I,L=k.p(M),j=function(X,U){var V=k.w(w.$u?Date.UTC(w.$y,U,X):new Date(w.$y,U,X),w);return C?V:V.endOf(c)},F=function(X,U){return k.w(w.toDate()[X].apply(w.toDate("s"),(C?[0,0,0,0]:[23,59,59,999]).slice(U)),w)},H=this.$W,Y=this.$M,B=this.$D,J="set"+(this.$u?"UTC":"");switch(L){case x:return C?j(1,0):j(31,11);case l:return C?j(1,Y):j(0,Y+1);case d:var G=this.$locale().weekStart||0,Q=(H<G?H+7:H)-G;return j(C?B-Q:B+(6-Q),Y);case c:case y:return F(J+"Hours",0);case u:return F(J+"Minutes",1);case i:return F(J+"Seconds",2);case o:return F(J+"Milliseconds",3);default:return this.clone()}},O.endOf=function(M){return this.startOf(M,!1)},O.$set=function(M,I){var w,C=k.p(M),L="set"+(this.$u?"UTC":""),j=(w={},w[c]=L+"Date",w[y]=L+"Date",w[l]=L+"Month",w[x]=L+"FullYear",w[u]=L+"Hours",w[i]=L+"Minutes",w[o]=L+"Seconds",w[t]=L+"Milliseconds",w)[C],F=C===c?this.$D+(I-this.$W):I;if(C===l||C===x){var H=this.clone().set(y,1);H.$d[j](F),H.init(),this.$d=H.set(y,Math.min(this.$D,H.daysInMonth())).$d}else j&&this.$d[j](F);return this.init(),this},O.set=function(M,I){return this.clone().$set(M,I)},O.get=function(M){return this[k.p(M)]()},O.add=function(M,I){var w,C=this;M=Number(M);var L=k.p(I),j=function(Y){var B=m(C);return k.w(B.date(B.date()+Math.round(Y*M)),C)};if(L===l)return this.set(l,this.$M+M);if(L===x)return this.set(x,this.$y+M);if(L===c)return j(1);if(L===d)return j(7);var F=(w={},w[i]=n,w[u]=s,w[o]=e,w)[L]||1,H=this.$d.getTime()+M*F;return k.w(H,this)},O.subtract=function(M,I){return this.add(-1*M,I)},O.format=function(M){var I=this,w=this.$locale();if(!this.isValid())return w.invalidDate||f;var C=M||"YYYY-MM-DDTHH:mm:ssZ",L=k.z(this),j=this.$H,F=this.$m,H=this.$M,Y=w.weekdays,B=w.months,J=w.meridiem,G=function(U,V,tt,nt){return U&&(U[V]||U(I,C))||tt[V].slice(0,nt)},Q=function(U){return k.s(j%12||12,U,"0")},X=J||function(U,V,tt){var nt=U<12?"AM":"PM";return tt?nt.toLowerCase():nt};return C.replace(D,(function(U,V){return V||(function(tt){switch(tt){case"YY":return String(I.$y).slice(-2);case"YYYY":return k.s(I.$y,4,"0");case"M":return H+1;case"MM":return k.s(H+1,2,"0");case"MMM":return G(w.monthsShort,H,B,3);case"MMMM":return G(B,H);case"D":return I.$D;case"DD":return k.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return G(w.weekdaysMin,I.$W,Y,2);case"ddd":return G(w.weekdaysShort,I.$W,Y,3);case"dddd":return Y[I.$W];case"H":return String(j);case"HH":return k.s(j,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return X(j,F,!0);case"A":return X(j,F,!1);case"m":return String(F);case"mm":return k.s(F,2,"0");case"s":return String(I.$s);case"ss":return k.s(I.$s,2,"0");case"SSS":return k.s(I.$ms,3,"0");case"Z":return L}return null})(U)||L.replace(":","")}))},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(M,I,w){var C,L=this,j=k.p(I),F=m(M),H=(F.utcOffset()-this.utcOffset())*n,Y=this-F,B=function(){return k.m(L,F)};switch(j){case x:C=B()/12;break;case l:C=B();break;case h:C=B()/3;break;case d:C=(Y-H)/6048e5;break;case c:C=(Y-H)/864e5;break;case u:C=Y/s;break;case i:C=Y/n;break;case o:C=Y/e;break;default:C=Y}return w?C:k.a(C)},O.daysInMonth=function(){return this.endOf(l).$D},O.$locale=function(){return T[this.$L]},O.locale=function(M,I){if(!M)return this.$L;var w=this.clone(),C=$(M,I,!0);return C&&(w.$L=C),w},O.clone=function(){return k.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},E})(),A=P.prototype;return m.prototype=A,[["$ms",t],["$s",o],["$m",i],["$H",u],["$W",c],["$M",l],["$y",x],["$D",y]].forEach((function(E){A[E[1]]=function(O){return this.$g(O,E[0],E[1])}})),m.extend=function(E,O){return E.$i||(E(O,P,m),E.$i=!0),m},m.locale=$,m.isDayjs=p,m.unix=function(E){return m(1e3*E)},m.en=T[R],m.Ls=T,m.p={},m}))})(rt)),rt.exports}var ce=ue();const W=q(ce);var st={exports:{}},le=st.exports,wt;function fe(){return wt||(wt=1,(function(r,a){(function(e,n){r.exports=n()})(le,(function(){var e,n,s=1e3,t=6e4,o=36e5,i=864e5,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=31536e6,d=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:c,months:d,days:i,hours:o,minutes:t,seconds:s,milliseconds:1,weeks:6048e5},x=function(T){return T instanceof z},y=function(T,v,p){return new z(T,p,v.$l)},f=function(T){return n.p(T)+"s"},S=function(T){return T<0},D=function(T){return S(T)?Math.ceil(T):Math.floor(T)},b=function(T){return Math.abs(T)},g=function(T,v){return T?S(T)?{negative:!0,format:""+b(T)+v}:{negative:!1,format:""+T+v}:{negative:!1,format:""}},z=(function(){function T(p,$,m){var k=this;if(this.$d={},this.$l=m,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),$)return y(p*h[f($)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(E){k.$d[f(E)]=p[E]})),this.calMilliseconds(),this;if(typeof p=="string"){var P=p.match(l);if(P){var A=P.slice(2).map((function(E){return E!=null?Number(E):0}));return this.$d.years=A[0],this.$d.months=A[1],this.$d.weeks=A[2],this.$d.days=A[3],this.$d.hours=A[4],this.$d.minutes=A[5],this.$d.seconds=A[6],this.calMilliseconds(),this}}return this}var v=T.prototype;return v.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function($,m){return $+(p.$d[m]||0)*h[m]}),0)},v.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=D(p/c),p%=c,this.$d.months=D(p/d),p%=d,this.$d.days=D(p/i),p%=i,this.$d.hours=D(p/o),p%=o,this.$d.minutes=D(p/t),p%=t,this.$d.seconds=D(p/s),p%=s,this.$d.milliseconds=p},v.toISOString=function(){var p=g(this.$d.years,"Y"),$=g(this.$d.months,"M"),m=+this.$d.days||0;this.$d.weeks&&(m+=7*this.$d.weeks);var k=g(m,"D"),P=g(this.$d.hours,"H"),A=g(this.$d.minutes,"M"),E=this.$d.seconds||0;this.$d.milliseconds&&(E+=this.$d.milliseconds/1e3,E=Math.round(1e3*E)/1e3);var O=g(E,"S"),M=p.negative||$.negative||k.negative||P.negative||A.negative||O.negative,I=P.format||A.format||O.format?"T":"",w=(M?"-":"")+"P"+p.format+$.format+k.format+I+P.format+A.format+O.format;return w==="P"||w==="-P"?"P0D":w},v.toJSON=function(){return this.toISOString()},v.format=function(p){var $=p||"YYYY-MM-DDTHH:mm:ss",m={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return $.replace(u,(function(k,P){return P||String(m[k])}))},v.as=function(p){return this.$ms/h[f(p)]},v.get=function(p){var $=this.$ms,m=f(p);return m==="milliseconds"?$%=1e3:$=m==="weeks"?D($/h[m]):this.$d[m],$||0},v.add=function(p,$,m){var k;return k=$?p*h[f($)]:x(p)?p.$ms:y(p,this).$ms,y(this.$ms+k*(m?-1:1),this)},v.subtract=function(p,$){return this.add(p,$,!0)},v.locale=function(p){var $=this.clone();return $.$l=p,$},v.clone=function(){return y(this.$ms,this)},v.humanize=function(p){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},v.valueOf=function(){return this.asMilliseconds()},v.milliseconds=function(){return this.get("milliseconds")},v.asMilliseconds=function(){return this.as("milliseconds")},v.seconds=function(){return this.get("seconds")},v.asSeconds=function(){return this.as("seconds")},v.minutes=function(){return this.get("minutes")},v.asMinutes=function(){return this.as("minutes")},v.hours=function(){return this.get("hours")},v.asHours=function(){return this.as("hours")},v.days=function(){return this.get("days")},v.asDays=function(){return this.as("days")},v.weeks=function(){return this.get("weeks")},v.asWeeks=function(){return this.as("weeks")},v.months=function(){return this.get("months")},v.asMonths=function(){return this.as("months")},v.years=function(){return this.get("years")},v.asYears=function(){return this.as("years")},T})(),R=function(T,v,p){return T.add(v.years()*p,"y").add(v.months()*p,"M").add(v.days()*p,"d").add(v.hours()*p,"h").add(v.minutes()*p,"m").add(v.seconds()*p,"s").add(v.milliseconds()*p,"ms")};return function(T,v,p){e=p,n=p().$utils(),p.duration=function(k,P){var A=p.locale();return y(k,{$l:A},P)},p.isDuration=x;var $=v.prototype.add,m=v.prototype.subtract;v.prototype.add=function(k,P){return x(k)?R(this,k,1):$.bind(this)(k,P)},v.prototype.subtract=function(k,P){return x(k)?R(this,k,-1):m.bind(this)(k,P)}}}))})(st)),st.exports}var de=fe();const he=q(de);var it={exports:{}},me=it.exports,Dt;function $e(){return Dt||(Dt=1,(function(r,a){(function(e,n){r.exports=n()})(me,(function(){return function(e,n,s){n.prototype.isBetween=function(t,o,i,u){var c=s(t),d=s(o),l=(u=u||"()")[0]==="(",h=u[1]===")";return(l?this.isAfter(c,i):!this.isBefore(c,i))&&(h?this.isBefore(d,i):!this.isAfter(d,i))||(l?this.isBefore(c,i):!this.isAfter(c,i))&&(h?this.isAfter(d,i):!this.isBefore(d,i))}}}))})(it)),it.exports}var ge=$e();const pe=q(ge);var ot={exports:{}},ve=ot.exports,Ot;function ye(){return Ot||(Ot=1,(function(r,a){(function(e,n){r.exports=n()})(ve,(function(){var e="day";return function(n,s,t){var o=function(c){return c.add(4-c.isoWeekday(),e)},i=s.prototype;i.isoWeekYear=function(){return o(this).year()},i.isoWeek=function(c){if(!this.$utils().u(c))return this.add(7*(c-this.isoWeek()),e);var d,l,h,x,y=o(this),f=(d=this.isoWeekYear(),l=this.$u,h=(l?t.utc:t)().year(d).startOf("year"),x=4-h.isoWeekday(),h.isoWeekday()>4&&(x+=7),h.add(x,e));return y.diff(f,"week")+1},i.isoWeekday=function(c){return this.$utils().u(c)?this.day()||7:this.day(this.day()%7?c:c-7)};var u=i.startOf;i.startOf=function(c,d){var l=this.$utils(),h=!!l.u(d)||d;return l.p(c)==="isoweek"?h?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(c,d)}}}))})(ot)),ot.exports}var Se=ye();const xe=q(Se);var at={exports:{}},be=at.exports,kt;function Me(){return kt||(kt=1,(function(r,a){(function(e,n){r.exports=n()})(be,(function(){return function(e,n){n.prototype.isSameOrAfter=function(s,t){return this.isSame(s,t)||this.isAfter(s,t)}}}))})(at)),at.exports}var we=Me();const De=q(we);var ut={exports:{}},Oe=ut.exports,Tt;function ke(){return Tt||(Tt=1,(function(r,a){(function(e,n){r.exports=n()})(Oe,(function(){return function(e,n){n.prototype.isSameOrBefore=function(s,t){return this.isSame(s,t)||this.isBefore(s,t)}}}))})(ut)),ut.exports}var Te=ke();const Ee=q(Te);var ct={exports:{}},Ie=ct.exports,Et;function ze(){return Et||(Et=1,(function(r,a){(function(e,n){r.exports=n()})(Ie,(function(){return function(e,n,s){n.prototype.isToday=function(){var t="YYYY-MM-DD",o=s();return this.format(t)===o.format(t)}}}))})(ct)),ct.exports}var Ce=ze();const Le=q(Ce);var lt={exports:{}},Re=lt.exports,It;function _e(){return It||(It=1,(function(r,a){(function(e,n){r.exports=n()})(Re,(function(){return function(e,n,s){var t=n.prototype,o=function(l){return l&&(l.indexOf?l:l.s)},i=function(l,h,x,y,f){var S=l.name?l:l.$locale(),D=o(S[h]),b=o(S[x]),g=D||b.map((function(R){return R.slice(0,y)}));if(!f)return g;var z=S.weekStart;return g.map((function(R,T){return g[(T+(z||0))%7]}))},u=function(){return s.Ls[s.locale()]},c=function(l,h){return l.formats[h]||(function(x){return x.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(y,f,S){return f||S.slice(1)}))})(l.formats[h.toUpperCase()])},d=function(){var l=this;return{months:function(h){return h?h.format("MMMM"):i(l,"months")},monthsShort:function(h){return h?h.format("MMM"):i(l,"monthsShort","months",3)},firstDayOfWeek:function(){return l.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):i(l,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):i(l,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):i(l,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return c(l.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};t.localeData=function(){return d.bind(this)()},s.localeData=function(){var l=u();return{firstDayOfWeek:function(){return l.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(h){return c(l,h)},meridiem:l.meridiem,ordinal:l.ordinal}},s.months=function(){return i(u(),"months")},s.monthsShort=function(){return i(u(),"monthsShort","months",3)},s.weekdays=function(l){return i(u(),"weekdays",null,null,l)},s.weekdaysShort=function(l){return i(u(),"weekdaysShort","weekdays",3,l)},s.weekdaysMin=function(l){return i(u(),"weekdaysMin","weekdays",2,l)}}}))})(lt)),lt.exports}var je=_e();const Pe=q(je);var ft={exports:{}},We=ft.exports,zt;function Ne(){return zt||(zt=1,(function(r,a){(function(e,n){r.exports=n()})(We,(function(){return function(e,n,s){var t=function(o,i){if(!i||!i.length||i.length===1&&!i[0]||i.length===1&&Array.isArray(i[0])&&!i[0].length)return null;var u;i.length===1&&i[0].length>0&&(i=i[0]),u=(i=i.filter((function(d){return d})))[0];for(var c=1;c<i.length;c+=1)i[c].isValid()&&!i[c][o](u)||(u=i[c]);return u};s.max=function(){var o=[].slice.call(arguments,0);return t("isAfter",o)},s.min=function(){var o=[].slice.call(arguments,0);return t("isBefore",o)}}}))})(ft)),ft.exports}var Fe=Ne();const He=q(Fe);var dt={exports:{}},Ae=dt.exports,Ct;function Ye(){return Ct||(Ct=1,(function(r,a){(function(e,n){r.exports=n()})(Ae,(function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(s,t,o){var i,u=function(h,x,y){y===void 0&&(y={});var f=new Date(h),S=(function(D,b){b===void 0&&(b={});var g=b.timeZoneName||"short",z=D+"|"+g,R=n[z];return R||(R=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:D,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),n[z]=R),R})(x,y);return S.formatToParts(f)},c=function(h,x){for(var y=u(h,x),f=[],S=0;S<y.length;S+=1){var D=y[S],b=D.type,g=D.value,z=e[b];z>=0&&(f[z]=parseInt(g,10))}var R=f[3],T=R===24?0:R,v=f[0]+"-"+f[1]+"-"+f[2]+" "+T+":"+f[4]+":"+f[5]+":000",p=+h;return(o.utc(v).valueOf()-(p-=p%1e3))/6e4},d=t.prototype;d.tz=function(h,x){h===void 0&&(h=i);var y,f=this.utcOffset(),S=this.toDate(),D=S.toLocaleString("en-US",{timeZone:h}),b=Math.round((S-new Date(D))/1e3/60),g=15*-Math.round(S.getTimezoneOffset()/15)-b;if(!Number(g))y=this.utcOffset(0,x);else if(y=o(D,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),x){var z=y.utcOffset();y=y.add(f-z,"minute")}return y.$x.$timezone=h,y},d.offsetName=function(h){var x=this.$x.$timezone||o.tz.guess(),y=u(this.valueOf(),x,{timeZoneName:h}).find((function(f){return f.type.toLowerCase()==="timezonename"}));return y&&y.value};var l=d.startOf;d.startOf=function(h,x){if(!this.$x||!this.$x.$timezone)return l.call(this,h,x);var y=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(y,h,x).tz(this.$x.$timezone,!0)},o.tz=function(h,x,y){var f=y&&x,S=y||x||i,D=c(+o(),S);if(typeof h!="string")return o(h).tz(S);var b=(function(T,v,p){var $=T-60*v*1e3,m=c($,p);if(v===m)return[$,v];var k=c($-=60*(m-v)*1e3,p);return m===k?[$,m]:[T-60*Math.min(m,k)*1e3,Math.max(m,k)]})(o.utc(h,f).valueOf(),D,S),g=b[0],z=b[1],R=o(g).utcOffset(z);return R.$x.$timezone=S,R},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}}))})(dt)),dt.exports}var Ue=Ye();const qe=q(Ue);var ht={exports:{}},Be=ht.exports,Lt;function Ve(){return Lt||(Lt=1,(function(r,a){(function(e,n){r.exports=n()})(Be,(function(){return function(e,n,s){s.updateLocale=function(t,o){var i=s.Ls[t];if(i)return(o?Object.keys(o):[]).forEach((function(u){i[u]=o[u]})),i}}}))})(ht)),ht.exports}var Ge=Ve();const Xe=q(Ge);var mt={exports:{}},Ze=mt.exports,Rt;function Je(){return Rt||(Rt=1,(function(r,a){(function(e,n){r.exports=n()})(Ze,(function(){var e="minute",n=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(t,o,i){var u=o.prototype;i.utc=function(f){var S={date:f,utc:!0,args:arguments};return new o(S)},u.utc=function(f){var S=i(this.toDate(),{locale:this.$L,utc:!0});return f?S.add(this.utcOffset(),e):S},u.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var c=u.parse;u.parse=function(f){f.utc&&(this.$u=!0),this.$utils().u(f.$offset)||(this.$offset=f.$offset),c.call(this,f)};var d=u.init;u.init=function(){if(this.$u){var f=this.$d;this.$y=f.getUTCFullYear(),this.$M=f.getUTCMonth(),this.$D=f.getUTCDate(),this.$W=f.getUTCDay(),this.$H=f.getUTCHours(),this.$m=f.getUTCMinutes(),this.$s=f.getUTCSeconds(),this.$ms=f.getUTCMilliseconds()}else d.call(this)};var l=u.utcOffset;u.utcOffset=function(f,S){var D=this.$utils().u;if(D(f))return this.$u?0:D(this.$offset)?l.call(this):this.$offset;if(typeof f=="string"&&(f=(function(R){R===void 0&&(R="");var T=R.match(n);if(!T)return null;var v=(""+T[0]).match(s)||["-",0,0],p=v[0],$=60*+v[1]+ +v[2];return $===0?0:p==="+"?$:-$})(f),f===null))return this;var b=Math.abs(f)<=16?60*f:f;if(b===0)return this.utc(S);var g=this.clone();if(S)return g.$offset=b,g.$u=!1,g;var z=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(g=this.local().add(b+z,e)).$offset=b,g.$x.$localOffset=z,g};var h=u.format;u.format=function(f){var S=f||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,S)},u.valueOf=function(){var f=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*f},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var x=u.toDate;u.toDate=function(f){return f==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():x.call(this)};var y=u.diff;u.diff=function(f,S,D){if(f&&this.$u===f.$u)return y.call(this,f,S,D);var b=this.local(),g=i(f).local();return y.call(b,g,S,D)}}}))})(mt)),mt.exports}var Ke=Je();const Qe=q(Ke);var $t={exports:{}},tn=$t.exports,_t;function en(){return _t||(_t=1,(function(r,a){(function(e,n){r.exports=n()})(tn,(function(){return function(e,n){n.prototype.weekday=function(s){var t=this.$locale().weekStart||0,o=this.$W,i=(o<t?o+7:o)-t;return this.$utils().u(s)?i:this.subtract(i,"day").add(s,"day")}}}))})($t)),$t.exports}var nn=en();const rn=q(nn);W.extend(He);W.extend(he);W.extend(rn);W.extend(Le);W.extend(Qe);W.extend(qe);W.extend(De);W.extend(Ee);W.extend(pe);W.extend(Pe);W.extend(Xe);W.extend(xe);const sn={minute:1,hour:60,day:1440,week:1440*7,month:1440*30},on=(r,a,e,n)=>a==="left"?Math.min(r,e-n):a==="right"?Math.max(r,-e+n):r,an=(r,a,e)=>a==="left"&&r<0?Math.floor(r/e)*e:a==="right"&&r>0?Math.ceil(r/e)*e:r,un=(r,a,e,n)=>{const s={offsetStartDate:e,offsetEndDate:n};switch(r){case"bar":return{...s,offsetX:a,offsetWidth:0};case"left":return{...s,offsetX:a,offsetWidth:-a};case"right":return{...s,offsetX:0,offsetWidth:a};default:return{...s,offsetX:0,offsetWidth:0}}},jt=8,cn=r=>{const e=r.currentTarget.getBoundingClientRect(),n=r.clientX-e.left;return n<=jt?"left":n>=e.width-jt?"right":"bar"};function ln(r,a){const{rawTasks:e,selectedScale:n,setCurrentTask:s,setDragOffset:t,clearDragOffset:o,setRawTasks:i}=Bt(),u=N.useRef(null),c=N.useRef(null),d=Z[n],{basePxPerDragStep:l,dragStepAmount:h,dragStepUnit:x}=d,y=h*sn[x]/l,f=b=>{const g=u.current;if(!g)return;let z=b.clientX-g.initialClientX;z=on(z,g.mode,r.barWidth,l),z=an(z,g.mode,l);const R=Math.round(z/g.basePxPerDragStep);if(R===g.dragSteps)return;g.dragSteps=R;const T=R*g.basePxPerDragStep,v=T*g.minutesPerPixel,p=g.mode==="right"?g.initialStartDate:g.initialStartDate.add(v,"minute"),$=g.mode==="left"?g.initialEndDate:g.initialEndDate.add(v,"minute");t(r.id,un(g.mode,T,p,$))},S=()=>{var T;document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",S),document.removeEventListener("pointercancel",S);const b=u.current;if(!b)return;const g=v=>v.add(b.dragSteps*h,x).toISOString(),z=e.map(v=>{if(v.id!==r.id)return v;switch(b.mode){case"bar":return{...v,startDate:g(W(v.startDate)),endDate:g(W(v.endDate))};case"left":return{...v,startDate:g(W(v.startDate))};case"right":return{...v,endDate:g(W(v.endDate))};default:return v}});i(z),a==null||a(z);const R=c.current;R!==null&&((T=document.getElementById(`task-${r.id}`))==null||T.releasePointerCapture(R)),c.current=null,u.current=null,s(null),o(r.id)};return{onPointerDown:b=>{const g=cn(b);u.current={mode:g,initialClientX:b.clientX,initialStartDate:W(r.startDate),initialEndDate:W(r.endDate),dragSteps:0,basePxPerDragStep:l,minutesPerPixel:y},s(r),b.currentTarget.setPointerCapture(b.pointerId),c.current=b.pointerId,document.addEventListener("pointermove",f),document.addEventListener("pointerup",S),document.addEventListener("pointercancel",S)}}}const Pt=8,fn={day:"MMM D, h A",week:"MMM D",month:"MMM D",year:"MMM YYYY"};function dn({currentTask:r,onTasksChange:a}){const e=N.useRef(null),{onPointerDown:n}=ln(r,a),[s,t]=N.useState("grab"),o=et(D=>D.dragOffsets[r.id]),i=et(D=>{var b;return((b=D.currentTask)==null?void 0:b.id)===r.id}),u=et(D=>D.selectedScale),c=(o==null?void 0:o.offsetX)??0,d=(o==null?void 0:o.offsetWidth)??0,l=r.barLeft+c,h=r.barWidth+d,x=N.useCallback(D=>{const b=e.current;if(!b)return;const g=b.getBoundingClientRect(),z=D.clientX-g.left;z<=Pt||z>=g.width-Pt?t("ew-resize"):t("grab")},[]),y=fn[u],f=o==null?void 0:o.offsetStartDate.format(y),S=o==null?void 0:o.offsetEndDate.format(y);return _.jsxs("div",{ref:e,id:`task-${r.id}`,className:`gantt-task-bar ${i?"dragging":""}`,onPointerDown:n,onMouseMove:x,onMouseLeave:()=>t("grab"),style:{transform:`translateX(${l}px)`,width:h,height:pt/2,cursor:i?"grabbing":s},role:"button",tabIndex:0,"aria-label":`Task: ${r.name}`,children:[_.jsx("span",{className:"gantt-task-name",children:r.name}),i&&o&&_.jsxs("div",{className:"gantt-bar-tooltip",role:"status","aria-live":"polite",children:[f," → ",S]})]})}function hn(r){const a=[];for(const e of r){const n=a[a.length-1];n&&n.label===e.label?n.widthPx+=e.widthPx:a.push({...e})}return a}function mn(r){let a=0;return r.map(e=>{const n={...e,left:a};return a+=e.widthPx,n})}function $n(r){const a=hn(r);return mn(a)}function Wt(r){return r.split(".").map(Number)}function gn(r){return[...r].sort((a,e)=>{const n=Wt(a.sequence),s=Wt(e.sequence),t=Math.max(n.length,s.length);for(let o=0;o<t;o++){const i=n[o]||0,u=s[o]||0;if(i!==u)return i-u}return 0})}function pn(r){return r.split(".").length-1}function vn(r,a,e){return gn(r).map((s,t)=>{const o=pn(s.sequence),i=t+1,{barMarginLeftAmount:u,barWidthSize:c}=yn(W(s.startDate),W(s.endDate),a,e);return{...s,barLeft:u,barWidth:c,depth:o,order:i,originalOrder:i}})}function yn(r,a,e,n){if(!e.length)return{barMarginLeftAmount:0,barWidthSize:0};const s=Z[n],{tickUnit:t,unitPerTick:o}=s;let i=0,u=0,c=!1;const d=r.valueOf(),l=a.valueOf();for(const h of e){const x=h.startDate,y=x.add(o,t),f=h.widthPx,S=x.valueOf(),D=y.valueOf();if(D<=d){i+=f;continue}if(S>=l)break;const b=d>S?r:x,g=l<D?a:y,z=D-S,T=(g.valueOf()-b.valueOf())/z;if(!c&&b.valueOf()>S){const v=(b.valueOf()-S)/z;i+=v*f}u+=T*f,c=!0}return{barMarginLeftAmount:i,barWidthSize:Math.max(u,1)}}function Sn(r){let a=1/0,e=-1/0;for(const n of r){const s=W(n.startDate).valueOf(),t=W(n.endDate).valueOf();Number.isNaN(s)||(a=Math.min(a,s)),Number.isNaN(t)||(e=Math.max(e,t))}return{minDate:W(a),maxDate:W(e)}}function xn(r,a,e){const n=Z[e],{tickUnit:s,unitPerTick:t}=n,o=Zt*t;return{paddedMinDate:r.subtract(o,s),paddedMaxDate:a.add(o,s)}}function bn(r,a,e){const n=Z[e],{tickUnit:s,unitPerTick:t,basePxPerDragStep:o,dragStepUnit:i,dragStepAmount:u}=n,c=[];let d=r.startOf(s);const l=a.valueOf(),h=o/u;for(;d.valueOf()<l;){const x=d.add(t,s),f=x.diff(d,i)*h;c.push({startDate:d,widthPx:f}),d=x}return c}function Mn(r,a){const e=Z[a],{labelUnit:n,formatHeaderLabel:s}=e;if(r.length===0)return[];const t=[];let o=null;for(const i of r){const u=i.startDate.startOf(n),c=u.valueOf(),d=(s==null?void 0:s(u))??u.format();o&&o.startDate.valueOf()===c?o.widthPx+=i.widthPx:(o&&t.push(o),o={label:d,widthPx:i.widthPx,startDate:u})}return o&&t.push(o),t}function wn(r,a){if(!r.length)return{bottomCells:[],transformedTasks:[]};const{minDate:e,maxDate:n}=Sn(r),{paddedMinDate:s,paddedMaxDate:t}=xn(e,n,a),o=bn(s,t,a),i=vn(r,o,a);return{bottomCells:o,transformedTasks:i}}function Dn({bottomRowCells:r,selectedScale:a,width:e,scrollRef:n}){const s=Z[a],[t,o]=N.useState(0),i=N.useMemo(()=>{const u=Mn(r,a);return $n(u)},[r,a]);return N.useEffect(()=>{const u=n.current;if(!u)return;const c=()=>{const d=u.scrollLeft;for(let l=i.length-1;l>=0;l--)if(d>=i[l].left){o(l);break}};return u.addEventListener("scroll",c),c(),()=>u.removeEventListener("scroll",c)},[i,n]),_.jsx("header",{className:"gantt-header",style:{width:`${e}px`},children:_.jsxs("div",{className:"gantt-header-content",children:[_.jsx("div",{className:"gantt-top-header",children:_.jsx("div",{className:"gantt-top-groups",children:i.map((u,c)=>{const d=c===t;return _.jsx("div",{className:`gantt-top-group ${d?"sticky":""}`,style:{width:`${u.widthPx}px`,...d&&{left:0}},children:_.jsx("p",{className:"gantt-top-group-label",children:u.label})},`${u.label}-${c}`)})})}),_.jsx("div",{className:"gantt-bottom-row",children:r.map((u,c)=>{var l;const d=((l=s.formatTickLabel)==null?void 0:l.call(s,u.startDate))||"";return _.jsx("div",{className:"gantt-bottom-cell",style:{width:`${u.widthPx}px`},children:d},`bottom-${c}`)})})]})})}function On(r,a,e,n,s){if(e<0||s<0)return`M ${a} ${e} h ${(n-a)/2}`;const t=7,o=11,i=25,u=20,c=`M ${a} ${e}`,d=n-a,l=s-e,h=Math.abs(d),x=Math.abs(l),y=s<=e,f=s>=e,S=n>=a,D=n<=a,b=h>u,g=Math.abs(d/2),z=Math.abs(l/2);function R(){function $(){return(S||D)&&f&&!b?"downSmallHorizontal":(S||D)&&y&&!b?"upSmallHorizontal":f&&D?"downLeft":f&&S?"downRight":y&&D?"upLeft":y&&S?"upRight":""}let m=c;switch($()){case"downRight":{m+=` h ${g-t}`,m+=` a ${t} ${t} 0 0 1 ${t} ${t}`,m+=` v ${l-t*2}`,m+=` a ${t} ${t} 0 0 0 ${t} ${t}`,m+=` h ${g-t}`;break}case"upRight":{m+=` h ${g-t}`,m+=` a ${t} ${t} 0 0 0 ${t} -${t}`,m+=` v -${x-t*2}`,m+=` a ${t} ${t} 0 0 1 ${t} -${t}`,m+=` h ${g-t}`;break}case"downLeft":case"downSmallHorizontal":{const P=e+l/2;m+=` h ${o}`,m+=` a ${t} ${t} 0 0 1 ${t} ${t}`,m+=` v ${P-e-t*2}`,m+=` a ${t} ${t} 0 0 1 -${t} ${t}`,m+=` h ${d-2*o}`,m+=` a ${t} ${t} 0 0 0 -${t} ${t}`,m+=` v ${P-e-t*2}`,m+=` a ${t} ${t} 0 0 0 ${t} ${t}`,m+=` h ${o}`;break}case"upLeft":case"upSmallHorizontal":{const P=e+l/2;m+=` h ${o}`,m+=` a ${t} ${t} 0 0 0 ${t} -${t}`,m+=` v -${e-P-t*2}`,m+=` a ${t} ${t} 0 0 0 -${t} -${t}`,m+=` h ${d-2*o}`,m+=` a ${t} ${t} 0 0 1 -${t} -${t}`,m+=` v -${e-P-t*2}`,m+=` a ${t} ${t} 0 0 1 ${t} -${t}`,m+=` h ${o}`;break}default:return m}return m}function T(){let $=c;return f&&D?($+=` h ${i-o}`,$+=` a ${t} ${t} 0 0 1 ${t} ${t}`,$+=` v ${l-t*2}`,$+=` a ${t} ${t} 0 0 1 -${t} ${t}`,$+=` h ${d-t*2}`):f&&S?($+=` h ${d+i-o}`,$+=` a ${t} ${t} 0 0 1 ${t} ${t}`,$+=` v ${l-t*2}`,$+=` a ${t} ${t} 0 0 1 -${t} ${t}`,$+=` h -${i-o}`):y&&D?($+=` h ${i-o}`,$+=` a ${t} ${t} 0 0 0 ${t} -${t}`,$+=` v ${l+t*2}`,$+=` a ${t} ${t} 0 0 0 -${t} -${t}`,$+=` h ${d-i+o}`):y&&S&&($+=` h ${d+i-o}`,$+=` a ${t} ${t} 0 0 0 ${t} -${t}`,$+=` v ${l+t*2}`,$+=` a ${t} ${t} 0 0 0 -${t} -${t}`,$+=` h -${i-o}`),$}function v(){function $(){return(S||D)&&f&&!b?"downSmallHorizontal":(S||D)&&y&&!b?"upSmallHorizontal":f&&D?"downLeft":f&&S?"downRight":y&&D?"upLeft":y&&S?"upRight":""}let m=c;switch($()){case"downRight":case"downSmallHorizontal":{m+=` h ${-o}`,m+=` a ${t} ${t} 0 0 0 -${t} ${t}`,m+=` v ${z-t*2}`,m+=` a ${t} ${t} 0 0 0 ${t} ${t}`,m+=` h ${o*2+d}`,m+=` a ${t} ${t} 0 0 1 ${t} ${t}`,m+=` v ${z-t*2}`,m+=` a ${t} ${t} 0 0 1 -${t} ${t}`,m+=` h ${-o}`;break}case"upRight":case"upSmallHorizontal":{m+=` h ${-o}`,m+=` a ${t} ${t} 0 0 1 -${t} -${t}`,m+=` v ${-(z-t*2)}`,m+=` a ${t} ${t} 0 0 1 ${t} -${t}`,m+=` h ${o*2+d}`,m+=` a ${t} ${t} 0 0 0 ${t} -${t}`,m+=` v ${-(z-t*2)}`,m+=` a ${t} ${t} 0 0 0 -${t} -${t}`,m+=` h ${-o}`;break}case"downLeft":{m+=` h ${-g+t}`,m+=` a ${t} ${t} 0 0 0 -${t} ${t}`,m+=` v ${x-t*2}`,m+=` a ${t} ${t} 0 0 1 -${t} ${t}`,m+=` h ${-g+t}`;break}case"upLeft":{m+=` h ${-(g-t)}`,m+=` a ${t} ${t} 0 0 1 -${t} -${t}`,m+=` v ${-(x-t*2)}`,m+=` a ${t} ${t} 0 0 0 -${t} -${t}`,m+=` h ${-g+t}`;break}default:return m}return m}function p(){let $=c;return f&&D?($+=` h ${d-i}`,$+=` a ${t} ${t} 0 0 0 -${t} ${t}`,$+=` v ${l-t*2}`,$+=` a ${t} ${t} 0 0 0 ${t} ${t}`,$+=` h ${i}`):f&&S?($+=` h ${-i}`,$+=` a ${t} ${t} 0 0 0 -${t} ${t}`,$+=` v ${l-t*2}`,$+=` a ${t} ${t} 0 0 0 ${t} ${t}`,$+=` h ${d+i}`):y&&D?($+=` h ${d-i}`,$+=` a ${t} ${t} 0 0 1 -${t} -${t}`,$+=` v ${l+t*2}`,$+=` a ${t} ${t} 0 0 1 ${t} -${t}`,$+=` h ${i}`):y&&S&&($+=` h ${-i}`,$+=` a ${t} ${t} 0 0 1 -${t} -${t}`,$+=` v ${l+t*2}`,$+=` a ${t} ${t} 0 0 1 ${t} -${t}`,$+=` h ${d+i}`),$}switch(r){case"FS":return R();case"FF":return T();case"SF":return v();case"SS":return p();default:return`${c} L ${n} ${s}`}}function kn(r,a,e,n){const s=pt,t=r.order-1,i=(a.order-1)*s+s/2-4,u=t*s+s/2+4,c=a.barLeft,d=a.barLeft+a.barWidth,l=r.barLeft+e.offsetX,h=l+r.barWidth+e.offsetWidth,x={FS:[d,l],SS:[c,l],FF:[d,h],SF:[c,h]},[y,f]=x[n];return{fromX:y,fromY:i,toX:f,toY:u}}function Tn(r,a){const e=[];for(const n of r){const s=a[n.id]??{offsetX:0,offsetWidth:0};for(const t of n.dependencies??[]){const o=r.find(l=>l.id===t.targetId);if(!o)continue;const{fromX:i,fromY:u,toX:c,toY:d}=kn(n,o,s,t.type);e.push({...t,fromX:i,fromY:u,toX:c,toY:d})}}return e}function En({transformedTasks:r}){const a=et(n=>n.dragOffsets),e=Tn(r,a);return _.jsxs("svg",{className:"gantt-dependency-arrows",style:{height:`${r.length*pt}px`},children:[_.jsx("defs",{children:_.jsx("marker",{id:"arrowhead",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",children:_.jsx("polygon",{className:"gantt-dependency-arrow-head",points:"0 0, 8 4, 0 8"})})}),e.map((n,s)=>_.jsx("path",{className:"gantt-dependency-arrow",d:On(n.type,n.fromX,n.fromY,n.toX,n.toY),markerEnd:"url(#arrowhead)",fill:"none"},`arrow-${s}`))]})}function In({selectedScale:r,onScaleChange:a}){const e=n=>{a(n.target.value)};return _.jsx("div",{className:"gantt-scale-selector",children:_.jsx("select",{className:"gantt-scale-select",value:r,onChange:e,"aria-label":"타임라인 스케일 선택",children:Object.keys(Z).map(n=>_.jsx("option",{value:n,children:n},n))})})}function zn({bottomRowCells:r,height:a}){const e=N.useMemo(()=>{if(r.length===0)return null;const n=W();let s=0;for(let t=0;t<r.length;t++){const o=r[t],i=o.startDate,u=r[t+1],c=(u==null?void 0:u.startDate)??i.add(1,"day");if(n.isSameOrAfter(i)&&n.isBefore(c)){const d=c.diff(i),h=n.diff(i)/d;return s+h*o.widthPx}s+=o.widthPx}return null},[r]);return e===null?null:_.jsx("div",{className:"gantt-today-marker",style:{left:`${e}px`,height:`${a}px`},role:"presentation","aria-label":"Today",children:_.jsx("span",{className:"gantt-today-label",children:"Today"})})}function K(r,a,e){let n=e.initialDeps??[],s;function t(){var o,i,u,c;let d;e.key&&((o=e.debug)!=null&&o.call(e))&&(d=Date.now());const l=r();if(!(l.length!==n.length||l.some((y,f)=>n[f]!==y)))return s;n=l;let x;if(e.key&&((i=e.debug)!=null&&i.call(e))&&(x=Date.now()),s=a(...l),e.key&&((u=e.debug)!=null&&u.call(e))){const y=Math.round((Date.now()-d)*100)/100,f=Math.round((Date.now()-x)*100)/100,S=f/16,D=(b,g)=>{for(b=String(b);b.length<g;)b=" "+b;return b};console.info(`%c⏱ ${D(f,5)} /${D(y,5)} ms`,`
32
2
  font-size: .6rem;
33
3
  font-weight: bold;
34
- color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(h=t==null?void 0:t.onChange)==null||h.call(t,n),n}return e.updateDeps=a=>{r=a},e}function We(s,c){if(s===void 0)throw new Error("Unexpected undefined");return s}const Et=(s,c)=>Math.abs(s-c)<1,It=(s,c,t)=>{let r;return function(...n){s.clearTimeout(r),r=s.setTimeout(()=>c.apply(this,n),t)}},Ot=s=>s,kt=s=>{const c=Math.max(s.startIndex-s.overscan,0),t=Math.min(s.endIndex+s.overscan,s.count-1),r=[];for(let n=c;n<=t;n++)r.push(n);return r},Tt=(s,c)=>{const t=s.scrollElement;if(!t)return;const r=s.targetWindow;if(!r)return;const n=a=>{const{width:i,height:d}=a;c({width:Math.round(i),height:Math.round(d)})};if(n(t.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const e=new r.ResizeObserver(a=>{const i=()=>{const d=a[0];if(d!=null&&d.borderBoxSize){const h=d.borderBoxSize[0];if(h){n({width:h.inlineSize,height:h.blockSize});return}}n(t.getBoundingClientRect())};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return e.observe(t,{box:"border-box"}),()=>{e.unobserve(t)}},Je={passive:!0},Ke=typeof window>"u"?!0:"onscrollend"in window,Rt=(s,c)=>{const t=s.scrollElement;if(!t)return;const r=s.targetWindow;if(!r)return;let n=0;const e=s.options.useScrollendEvent&&Ke?()=>{}:It(r,()=>{c(n,!1)},s.options.isScrollingResetDelay),a=v=>()=>{const{horizontal:p,isRtl:f}=s.options;n=p?t.scrollLeft*(f&&-1||1):t.scrollTop,e(),c(n,v)},i=a(!0),d=a(!1);d(),t.addEventListener("scroll",i,Je);const h=s.options.useScrollendEvent&&Ke;return h&&t.addEventListener("scrollend",d,Je),()=>{t.removeEventListener("scroll",i),h&&t.removeEventListener("scrollend",d)}},Ct=(s,c,t)=>{if(c!=null&&c.borderBoxSize){const r=c.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(s.getBoundingClientRect()[t.options.horizontal?"width":"height"])},Ft=(s,{adjustments:c=0,behavior:t},r)=>{var n,e;const a=s+c;(e=(n=r.scrollElement)==null?void 0:n.scrollTo)==null||e.call(n,{[r.options.horizontal?"left":"top"]:a,behavior:t})};class _t{constructor(c){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(e=>{const a=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var n;(n=r())==null||n.disconnect(),t=null},observe:n=>{var e;return(e=r())==null?void 0:e.observe(n,{box:"border-box"})},unobserve:n=>{var e;return(e=r())==null?void 0:e.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,n])=>{typeof n>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ot,rangeExtractor:kt,onChange:()=>{},measureElement:Ct,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,n;(n=(r=this.options).onChange)==null||n.call(r,this,t)},this.maybeNotify=ye(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,e)=>{this.scrollAdjustments=0,this.scrollDirection=e?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=e,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const n=new Map,e=new Map;for(let a=r-1;a>=0;a--){const i=t[a];if(n.has(i.lane))continue;const d=e.get(i.lane);if(d==null||i.end>d.end?e.set(i.lane,i):i.end<d.end&&n.set(i.lane,!0),n.size===this.options.lanes)break}return e.size===this.options.lanes?Array.from(e.values()).sort((a,i)=>a.end===i.end?a.index-i.index:a.end-i.end)[0]:void 0},this.getMeasurementOptions=ye(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,n,e,a)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:n,getItemKey:e,enabled:a}),{key:!1}),this.getMeasurements=ye(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:n,getItemKey:e,enabled:a},i)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(v=>{this.itemSizeCache.set(v.key,v.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const h=this.measurementsCache.slice(0,d);for(let v=d;v<t;v++){const p=e(v),f=this.options.lanes===1?h[v-1]:this.getFurthestMeasurement(h,v),g=f?f.end+this.options.gap:r+n,$=i.get(p),u=typeof $=="number"?$:this.options.estimateSize(v),w=g+u,T=f?f.lane:v%this.options.lanes;h[v]={index:v,start:g,size:u,end:w,key:p,lane:T}}return this.measurementsCache=h,h},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=ye(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,n,e)=>this.range=t.length>0&&r>0?zt({measurements:t,outerSize:r,scrollOffset:n,lanes:e}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=ye(()=>{let t=null,r=null;const n=this.calculateRange();return n&&(t=n.startIndex,r=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,n,e,a)=>e===null||a===null?[]:t({startIndex:e,endIndex:a,overscan:r,count:n}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,n=t.getAttribute(r);return n?parseInt(n,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const n=this.indexFromElement(t),e=this.measurementsCache[n];if(!e)return;const a=e.key,i=this.elementsCache.get(a);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(a,t)),t.isConnected&&this.resizeItem(n,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const n=this.measurementsCache[t];if(!n)return;const e=this.itemSizeCache.get(n.key)??n.size,a=r-e;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(n,a,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,n)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(n))});return}this._measureElement(t,void 0)},this.getVirtualItems=ye(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const n=[];for(let e=0,a=t.length;e<a;e++){const i=t[e],d=r[i];n.push(d)}return n},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return We(r[vt(0,r.length-1,n=>We(r[n]).start,t)])},this.getOffsetForAlignment=(t,r,n=0)=>{const e=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+e?"end":"start"),r==="center"?t+=(n-e)/2:r==="end"&&(t-=e);const i=this.options.horizontal?"scrollWidth":"scrollHeight",h=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-e;return Math.max(Math.min(h,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.measurementsCache[t];if(!n)return;const e=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(n.end>=a+e-this.options.scrollPaddingEnd)r="end";else if(n.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const i=r==="end"?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,r,n.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:r="start",behavior:n}={})=>{this.cancelScrollToIndex(),n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:n})},this.scrollToIndex=(t,{align:r="auto",behavior:n}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const e=this.getOffsetForIndex(t,r);if(!e)return;const[a,i]=e;this._scrollToOffset(a,{adjustments:void 0,behavior:n}),n!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[h]=We(this.getOffsetForIndex(t,i));Et(h,this.getScrollOffset())||this.scrollToIndex(t,{align:i,behavior:n})}else this.scrollToIndex(t,{align:i,behavior:n})}))},this.scrollBy=(t,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let n;if(r.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=r[r.length-1])==null?void 0:t.end)??0;else{const e=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&e.some(i=>i===null);){const i=r[a];e[i.lane]===null&&(e[i.lane]=i.end),a--}n=Math.max(...e.filter(i=>i!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(c)}}const vt=(s,c,t,r)=>{for(;s<=c;){const n=(s+c)/2|0,e=t(n);if(e<r)s=n+1;else if(e>r)c=n-1;else return n}return s>0?s-1:0};function zt({measurements:s,outerSize:c,scrollOffset:t,lanes:r}){const n=s.length-1,e=d=>s[d].start;if(s.length<=r)return{startIndex:0,endIndex:n};let a=vt(0,n,e,t),i=a;if(r===1)for(;i<n&&s[i].end<t+c;)i++;else if(r>1){const d=Array(r).fill(0);for(;i<n&&d.some(v=>v<t+c);){const v=s[i];d[v.lane]=v.end,i++}const h=Array(r).fill(t+c);for(;a>=0&&h.some(v=>v>=t);){const v=s[a];h[v.lane]=v.start,a--}a=Math.max(0,a-a%r),i=Math.min(n,i+(r-1-i%r))}return{startIndex:a,endIndex:i}}const Qe=typeof document<"u"?Se.useLayoutEffect:Se.useEffect;function jt(s){const c=Se.useReducer(()=>({}),{})[1],t={...s,onChange:(n,e)=>{var a;e?xt.flushSync(c):c(),(a=s.onChange)==null||a.call(s,n,e)}},[r]=Se.useState(()=>new _t(t));return r.setOptions(t),Qe(()=>r._didMount(),[]),Qe(()=>r._willUpdate()),r}function et(s){return jt({observeElementRect:Tt,observeElementOffset:Rt,scrollToFn:Ft,...s})}const Le=38,tt=3,he={day:{labelUnit:"day",tickUnit:"hour",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:1,basePxPerDragStep:32,formatTickLabel:s=>s.format("hh"),formatHeaderLabel:s=>s.format("MMM D")},week:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:6,basePxPerDragStep:54,formatTickLabel:s=>s.format("D"),formatHeaderLabel:s=>s.format("MMM")},month:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:32,formatTickLabel:s=>s.format("D"),formatHeaderLabel:s=>s.format("MMM YYYY")},year:{labelUnit:"month",tickUnit:"month",unitPerTick:1,dragStepUnit:"day",dragStepAmount:7,basePxPerDragStep:28,formatTickLabel:s=>s.format("D"),formatHeaderLabel:s=>s.format("MMM YYYY")}},nt=s=>{let c;const t=new Set,r=(h,v)=>{const p=typeof h=="function"?h(c):h;if(!Object.is(p,c)){const f=c;c=v??(typeof p!="object"||p===null)?p:Object.assign({},c,p),t.forEach(g=>g(c,f))}},n=()=>c,i={setState:r,getState:n,getInitialState:()=>d,subscribe:h=>(t.add(h),()=>t.delete(h))},d=c=s(r,n,i);return i},Pt=s=>s?nt(s):nt,At=s=>s;function Lt(s,c=At){const t=ee.useSyncExternalStore(s.subscribe,()=>c(s.getState()),()=>c(s.getInitialState()));return ee.useDebugValue(t),t}const qt=s=>{const c=Pt(s),t=r=>Lt(c,r);return Object.assign(t,c),t},Nt=s=>qt;function $t(s,c){let t;try{t=s()}catch{return}return{getItem:n=>{var e;const a=d=>d===null?null:JSON.parse(d,void 0),i=(e=t.getItem(n))!=null?e:null;return i instanceof Promise?i.then(a):a(i)},setItem:(n,e)=>t.setItem(n,JSON.stringify(e,void 0)),removeItem:n=>t.removeItem(n)}}const He=s=>c=>{try{const t=s(c);return t instanceof Promise?t:{then(r){return He(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return He(r)(t)}}}},Wt=(s,c)=>(t,r,n)=>{let e={storage:$t(()=>localStorage),partialize:u=>u,version:0,merge:(u,w)=>({...w,...u}),...c},a=!1;const i=new Set,d=new Set;let h=e.storage;if(!h)return s((...u)=>{console.warn(`[zustand persist middleware] Unable to update item '${e.name}', the given storage is currently unavailable.`),t(...u)},r,n);const v=()=>{const u=e.partialize({...r()});return h.setItem(e.name,{state:u,version:e.version})},p=n.setState;n.setState=(u,w)=>{p(u,w),v()};const f=s((...u)=>{t(...u),v()},r,n);n.getInitialState=()=>f;let g;const $=()=>{var u,w;if(!h)return;a=!1,i.forEach(R=>{var M;return R((M=r())!=null?M:f)});const T=((w=e.onRehydrateStorage)==null?void 0:w.call(e,(u=r())!=null?u:f))||void 0;return He(h.getItem.bind(h))(e.name).then(R=>{if(R)if(typeof R.version=="number"&&R.version!==e.version){if(e.migrate){const M=e.migrate(R.state,R.version);return M instanceof Promise?M.then(L=>[!0,L]):[!0,M]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,R.state];return[!1,void 0]}).then(R=>{var M;const[L,N]=R;if(g=e.merge(N,(M=r())!=null?M:f),t(g,!0),L)return v()}).then(()=>{T==null||T(g,void 0),g=r(),a=!0,d.forEach(R=>R(g))}).catch(R=>{T==null||T(void 0,R)})};return n.persist={setOptions:u=>{e={...e,...u},u.storage&&(h=u.storage)},clearStorage:()=>{h==null||h.removeItem(e.name)},getOptions:()=>e,rehydrate:()=>$(),hasHydrated:()=>a,onHydrate:u=>(i.add(u),()=>{i.delete(u)}),onFinishHydration:u=>(d.add(u),()=>{d.delete(u)})},e.skipHydration||$(),g||f},Ht=Wt,Q=Nt()(Ht(s=>({rawTasks:[],transformedTasks:[],bottomRowCells:[],topHeaderGroups:[],selectedScale:"month",currentTask:null,dragOffsets:{},setCurrentTask:c=>s({currentTask:c}),setSelectedScale:c=>s({selectedScale:c}),setRawTasks:c=>s({rawTasks:c}),setBottomRowCells:c=>s({bottomRowCells:c}),setTopHeaderGroups:c=>s({topHeaderGroups:c}),setTransformedTasks:c=>s({transformedTasks:c}),setDragOffset:(c,t)=>s(r=>({dragOffsets:{...r.dragOffsets,[c]:t}})),clearDragOffset:c=>s(t=>{const{[c]:r,...n}=t.dragOffsets;return{dragOffsets:n}})}),{name:"gantt-storage",storage:$t(()=>sessionStorage),partialize:s=>({selectedScale:s.selectedScale})}));var Ee={exports:{}},Ut=Ee.exports,rt;function Yt(){return rt||(rt=1,function(s,c){(function(t,r){s.exports=r()})(Ut,function(){var t=1e3,r=6e4,n=36e5,e="millisecond",a="second",i="minute",d="hour",h="day",v="week",p="month",f="quarter",g="year",$="date",u="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var O=["th","st","nd","rd"],I=F%100;return"["+F+(O[(I-20)%10]||O[I]||O[0])+"]"}},M=function(F,O,I){var P=String(F);return!P||P.length>=O?F:""+Array(O+1-P.length).join(I)+F},L={s:M,z:function(F){var O=-F.utcOffset(),I=Math.abs(O),P=Math.floor(I/60),k=I%60;return(O<=0?"+":"-")+M(P,2,"0")+":"+M(k,2,"0")},m:function F(O,I){if(O.date()<I.date())return-F(I,O);var P=12*(I.year()-O.year())+(I.month()-O.month()),k=O.clone().add(P,p),A=I-k<0,q=O.clone().add(P+(A?-1:1),p);return+(-(P+(I-k)/(A?k-q:q-k))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:p,y:g,w:v,d:h,D:$,h:d,m:i,s:a,ms:e,Q:f}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},N="en",j={};j[N]=R;var E="$isDayjsObject",D=function(F){return F instanceof Y||!(!F||!F[E])},l=function F(O,I,P){var k;if(!O)return N;if(typeof O=="string"){var A=O.toLowerCase();j[A]&&(k=A),I&&(j[A]=I,k=A);var q=O.split("-");if(!k&&q.length>1)return F(q[0])}else{var U=O.name;j[U]=O,k=U}return!P&&k&&(N=k),k||!P&&N},m=function(F,O){if(D(F))return F.clone();var I=typeof O=="object"?O:{};return I.date=F,I.args=arguments,new Y(I)},C=L;C.l=l,C.i=D,C.w=function(F,O){return m(F,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var Y=function(){function F(I){this.$L=l(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[E]=!0}var O=F.prototype;return O.parse=function(I){this.$d=function(P){var k=P.date,A=P.utc;if(k===null)return new Date(NaN);if(C.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var q=k.match(w);if(q){var U=q[2]-1||0,G=(q[7]||"0").substring(0,3);return A?new Date(Date.UTC(q[1],U,q[3]||1,q[4]||0,q[5]||0,q[6]||0,G)):new Date(q[1],U,q[3]||1,q[4]||0,q[5]||0,q[6]||0,G)}}return new Date(k)}(I),this.init()},O.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},O.$utils=function(){return C},O.isValid=function(){return this.$d.toString()!==u},O.isSame=function(I,P){var k=m(I);return this.startOf(P)<=k&&k<=this.endOf(P)},O.isAfter=function(I,P){return m(I)<this.startOf(P)},O.isBefore=function(I,P){return this.endOf(P)<m(I)},O.$g=function(I,P,k){return C.u(I)?this[P]:this.set(k,I)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(I,P){var k=this,A=!!C.u(P)||P,q=C.p(I),U=function(ue,te){var oe=C.w(k.$u?Date.UTC(k.$y,te,ue):new Date(k.$y,te,ue),k);return A?oe:oe.endOf(h)},G=function(ue,te){return C.w(k.toDate()[ue].apply(k.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(te)),k)},Z=this.$W,J=this.$M,re=this.$D,ce="set"+(this.$u?"UTC":"");switch(q){case g:return A?U(1,0):U(31,11);case p:return A?U(1,J):U(0,J+1);case v:var ae=this.$locale().weekStart||0,me=(Z<ae?Z+7:Z)-ae;return U(A?re-me:re+(6-me),J);case h:case $:return G(ce+"Hours",0);case d:return G(ce+"Minutes",1);case i:return G(ce+"Seconds",2);case a:return G(ce+"Milliseconds",3);default:return this.clone()}},O.endOf=function(I){return this.startOf(I,!1)},O.$set=function(I,P){var k,A=C.p(I),q="set"+(this.$u?"UTC":""),U=(k={},k[h]=q+"Date",k[$]=q+"Date",k[p]=q+"Month",k[g]=q+"FullYear",k[d]=q+"Hours",k[i]=q+"Minutes",k[a]=q+"Seconds",k[e]=q+"Milliseconds",k)[A],G=A===h?this.$D+(P-this.$W):P;if(A===p||A===g){var Z=this.clone().set($,1);Z.$d[U](G),Z.init(),this.$d=Z.set($,Math.min(this.$D,Z.daysInMonth())).$d}else U&&this.$d[U](G);return this.init(),this},O.set=function(I,P){return this.clone().$set(I,P)},O.get=function(I){return this[C.p(I)]()},O.add=function(I,P){var k,A=this;I=Number(I);var q=C.p(P),U=function(J){var re=m(A);return C.w(re.date(re.date()+Math.round(J*I)),A)};if(q===p)return this.set(p,this.$M+I);if(q===g)return this.set(g,this.$y+I);if(q===h)return U(1);if(q===v)return U(7);var G=(k={},k[i]=r,k[d]=n,k[a]=t,k)[q]||1,Z=this.$d.getTime()+I*G;return C.w(Z,this)},O.subtract=function(I,P){return this.add(-1*I,P)},O.format=function(I){var P=this,k=this.$locale();if(!this.isValid())return k.invalidDate||u;var A=I||"YYYY-MM-DDTHH:mm:ssZ",q=C.z(this),U=this.$H,G=this.$m,Z=this.$M,J=k.weekdays,re=k.months,ce=k.meridiem,ae=function(te,oe,le,ge){return te&&(te[oe]||te(P,A))||le[oe].slice(0,ge)},me=function(te){return C.s(U%12||12,te,"0")},ue=ce||function(te,oe,le){var ge=te<12?"AM":"PM";return le?ge.toLowerCase():ge};return A.replace(T,function(te,oe){return oe||function(le){switch(le){case"YY":return String(P.$y).slice(-2);case"YYYY":return C.s(P.$y,4,"0");case"M":return Z+1;case"MM":return C.s(Z+1,2,"0");case"MMM":return ae(k.monthsShort,Z,re,3);case"MMMM":return ae(re,Z);case"D":return P.$D;case"DD":return C.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return ae(k.weekdaysMin,P.$W,J,2);case"ddd":return ae(k.weekdaysShort,P.$W,J,3);case"dddd":return J[P.$W];case"H":return String(U);case"HH":return C.s(U,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return ue(U,G,!0);case"A":return ue(U,G,!1);case"m":return String(G);case"mm":return C.s(G,2,"0");case"s":return String(P.$s);case"ss":return C.s(P.$s,2,"0");case"SSS":return C.s(P.$ms,3,"0");case"Z":return q}return null}(te)||q.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(I,P,k){var A,q=this,U=C.p(P),G=m(I),Z=(G.utcOffset()-this.utcOffset())*r,J=this-G,re=function(){return C.m(q,G)};switch(U){case g:A=re()/12;break;case p:A=re();break;case f:A=re()/3;break;case v:A=(J-Z)/6048e5;break;case h:A=(J-Z)/864e5;break;case d:A=J/n;break;case i:A=J/r;break;case a:A=J/t;break;default:A=J}return k?A:C.a(A)},O.daysInMonth=function(){return this.endOf(p).$D},O.$locale=function(){return j[this.$L]},O.locale=function(I,P){if(!I)return this.$L;var k=this.clone(),A=l(I,P,!0);return A&&(k.$L=A),k},O.clone=function(){return C.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},F}(),V=Y.prototype;return m.prototype=V,[["$ms",e],["$s",a],["$m",i],["$H",d],["$W",h],["$M",p],["$y",g],["$D",$]].forEach(function(F){V[F[1]]=function(O){return this.$g(O,F[0],F[1])}}),m.extend=function(F,O){return F.$i||(F(O,Y,m),F.$i=!0),m},m.locale=l,m.isDayjs=D,m.unix=function(F){return m(1e3*F)},m.en=j[N],m.Ls=j,m.p={},m})}(Ee)),Ee.exports}var Bt=Yt();const K=ie(Bt);var Ie={exports:{}},Vt=Ie.exports,st;function Gt(){return st||(st=1,function(s,c){(function(t,r){s.exports=r()})(Vt,function(){var t,r,n=1e3,e=6e4,a=36e5,i=864e5,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=31536e6,v=2628e6,p=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,f={years:h,months:v,days:i,hours:a,minutes:e,seconds:n,milliseconds:1,weeks:6048e5},g=function(j){return j instanceof L},$=function(j,E,D){return new L(j,D,E.$l)},u=function(j){return r.p(j)+"s"},w=function(j){return j<0},T=function(j){return w(j)?Math.ceil(j):Math.floor(j)},R=function(j){return Math.abs(j)},M=function(j,E){return j?w(j)?{negative:!0,format:""+R(j)+E}:{negative:!1,format:""+j+E}:{negative:!1,format:""}},L=function(){function j(D,l,m){var C=this;if(this.$d={},this.$l=m,D===void 0&&(this.$ms=0,this.parseFromMilliseconds()),l)return $(D*f[u(l)],this);if(typeof D=="number")return this.$ms=D,this.parseFromMilliseconds(),this;if(typeof D=="object")return Object.keys(D).forEach(function(F){C.$d[u(F)]=D[F]}),this.calMilliseconds(),this;if(typeof D=="string"){var Y=D.match(p);if(Y){var V=Y.slice(2).map(function(F){return F!=null?Number(F):0});return this.$d.years=V[0],this.$d.months=V[1],this.$d.weeks=V[2],this.$d.days=V[3],this.$d.hours=V[4],this.$d.minutes=V[5],this.$d.seconds=V[6],this.calMilliseconds(),this}}return this}var E=j.prototype;return E.calMilliseconds=function(){var D=this;this.$ms=Object.keys(this.$d).reduce(function(l,m){return l+(D.$d[m]||0)*f[m]},0)},E.parseFromMilliseconds=function(){var D=this.$ms;this.$d.years=T(D/h),D%=h,this.$d.months=T(D/v),D%=v,this.$d.days=T(D/i),D%=i,this.$d.hours=T(D/a),D%=a,this.$d.minutes=T(D/e),D%=e,this.$d.seconds=T(D/n),D%=n,this.$d.milliseconds=D},E.toISOString=function(){var D=M(this.$d.years,"Y"),l=M(this.$d.months,"M"),m=+this.$d.days||0;this.$d.weeks&&(m+=7*this.$d.weeks);var C=M(m,"D"),Y=M(this.$d.hours,"H"),V=M(this.$d.minutes,"M"),F=this.$d.seconds||0;this.$d.milliseconds&&(F+=this.$d.milliseconds/1e3,F=Math.round(1e3*F)/1e3);var O=M(F,"S"),I=D.negative||l.negative||C.negative||Y.negative||V.negative||O.negative,P=Y.format||V.format||O.format?"T":"",k=(I?"-":"")+"P"+D.format+l.format+C.format+P+Y.format+V.format+O.format;return k==="P"||k==="-P"?"P0D":k},E.toJSON=function(){return this.toISOString()},E.format=function(D){var l=D||"YYYY-MM-DDTHH:mm:ss",m={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return l.replace(d,function(C,Y){return Y||String(m[C])})},E.as=function(D){return this.$ms/f[u(D)]},E.get=function(D){var l=this.$ms,m=u(D);return m==="milliseconds"?l%=1e3:l=m==="weeks"?T(l/f[m]):this.$d[m],l||0},E.add=function(D,l,m){var C;return C=l?D*f[u(l)]:g(D)?D.$ms:$(D,this).$ms,$(this.$ms+C*(m?-1:1),this)},E.subtract=function(D,l){return this.add(D,l,!0)},E.locale=function(D){var l=this.clone();return l.$l=D,l},E.clone=function(){return $(this.$ms,this)},E.humanize=function(D){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!D)},E.valueOf=function(){return this.asMilliseconds()},E.milliseconds=function(){return this.get("milliseconds")},E.asMilliseconds=function(){return this.as("milliseconds")},E.seconds=function(){return this.get("seconds")},E.asSeconds=function(){return this.as("seconds")},E.minutes=function(){return this.get("minutes")},E.asMinutes=function(){return this.as("minutes")},E.hours=function(){return this.get("hours")},E.asHours=function(){return this.as("hours")},E.days=function(){return this.get("days")},E.asDays=function(){return this.as("days")},E.weeks=function(){return this.get("weeks")},E.asWeeks=function(){return this.as("weeks")},E.months=function(){return this.get("months")},E.asMonths=function(){return this.as("months")},E.years=function(){return this.get("years")},E.asYears=function(){return this.as("years")},j}(),N=function(j,E,D){return j.add(E.years()*D,"y").add(E.months()*D,"M").add(E.days()*D,"d").add(E.hours()*D,"h").add(E.minutes()*D,"m").add(E.seconds()*D,"s").add(E.milliseconds()*D,"ms")};return function(j,E,D){t=D,r=D().$utils(),D.duration=function(C,Y){var V=D.locale();return $(C,{$l:V},Y)},D.isDuration=g;var l=E.prototype.add,m=E.prototype.subtract;E.prototype.add=function(C,Y){return g(C)?N(this,C,1):l.bind(this)(C,Y)},E.prototype.subtract=function(C,Y){return g(C)?N(this,C,-1):m.bind(this)(C,Y)}}})}(Ie)),Ie.exports}var Xt=Gt();const Zt=ie(Xt);var Oe={exports:{}},Jt=Oe.exports,it;function Kt(){return it||(it=1,function(s,c){(function(t,r){s.exports=r()})(Jt,function(){return function(t,r,n){r.prototype.isBetween=function(e,a,i,d){var h=n(e),v=n(a),p=(d=d||"()")[0]==="(",f=d[1]===")";return(p?this.isAfter(h,i):!this.isBefore(h,i))&&(f?this.isBefore(v,i):!this.isAfter(v,i))||(p?this.isBefore(h,i):!this.isAfter(h,i))&&(f?this.isAfter(v,i):!this.isBefore(v,i))}}})}(Oe)),Oe.exports}var Qt=Kt();const en=ie(Qt);var ke={exports:{}},tn=ke.exports,ot;function nn(){return ot||(ot=1,function(s,c){(function(t,r){s.exports=r()})(tn,function(){var t="day";return function(r,n,e){var a=function(h){return h.add(4-h.isoWeekday(),t)},i=n.prototype;i.isoWeekYear=function(){return a(this).year()},i.isoWeek=function(h){if(!this.$utils().u(h))return this.add(7*(h-this.isoWeek()),t);var v,p,f,g,$=a(this),u=(v=this.isoWeekYear(),p=this.$u,f=(p?e.utc:e)().year(v).startOf("year"),g=4-f.isoWeekday(),f.isoWeekday()>4&&(g+=7),f.add(g,t));return $.diff(u,"week")+1},i.isoWeekday=function(h){return this.$utils().u(h)?this.day()||7:this.day(this.day()%7?h:h-7)};var d=i.startOf;i.startOf=function(h,v){var p=this.$utils(),f=!!p.u(v)||v;return p.p(h)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):d.bind(this)(h,v)}}})}(ke)),ke.exports}var rn=nn();const sn=ie(rn);var Te={exports:{}},on=Te.exports,at;function an(){return at||(at=1,function(s,c){(function(t,r){s.exports=r()})(on,function(){return function(t,r){r.prototype.isSameOrAfter=function(n,e){return this.isSame(n,e)||this.isAfter(n,e)}}})}(Te)),Te.exports}var un=an();const cn=ie(un);var Re={exports:{}},ln=Re.exports,ut;function dn(){return ut||(ut=1,function(s,c){(function(t,r){s.exports=r()})(ln,function(){return function(t,r){r.prototype.isSameOrBefore=function(n,e){return this.isSame(n,e)||this.isBefore(n,e)}}})}(Re)),Re.exports}var fn=dn();const hn=ie(fn);var Ce={exports:{}},mn=Ce.exports,ct;function pn(){return ct||(ct=1,function(s,c){(function(t,r){s.exports=r()})(mn,function(){return function(t,r,n){r.prototype.isToday=function(){var e="YYYY-MM-DD",a=n();return this.format(e)===a.format(e)}}})}(Ce)),Ce.exports}var gn=pn();const vn=ie(gn);var Fe={exports:{}},$n=Fe.exports,lt;function yn(){return lt||(lt=1,function(s,c){(function(t,r){s.exports=r()})($n,function(){return function(t,r,n){var e=r.prototype,a=function(p){return p&&(p.indexOf?p:p.s)},i=function(p,f,g,$,u){var w=p.name?p:p.$locale(),T=a(w[f]),R=a(w[g]),M=T||R.map(function(N){return N.slice(0,$)});if(!u)return M;var L=w.weekStart;return M.map(function(N,j){return M[(j+(L||0))%7]})},d=function(){return n.Ls[n.locale()]},h=function(p,f){return p.formats[f]||function(g){return g.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function($,u,w){return u||w.slice(1)})}(p.formats[f.toUpperCase()])},v=function(){var p=this;return{months:function(f){return f?f.format("MMMM"):i(p,"months")},monthsShort:function(f){return f?f.format("MMM"):i(p,"monthsShort","months",3)},firstDayOfWeek:function(){return p.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):i(p,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):i(p,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):i(p,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return h(p.$locale(),f)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};e.localeData=function(){return v.bind(this)()},n.localeData=function(){var p=d();return{firstDayOfWeek:function(){return p.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(f){return h(p,f)},meridiem:p.meridiem,ordinal:p.ordinal}},n.months=function(){return i(d(),"months")},n.monthsShort=function(){return i(d(),"monthsShort","months",3)},n.weekdays=function(p){return i(d(),"weekdays",null,null,p)},n.weekdaysShort=function(p){return i(d(),"weekdaysShort","weekdays",3,p)},n.weekdaysMin=function(p){return i(d(),"weekdaysMin","weekdays",2,p)}}})}(Fe)),Fe.exports}var Sn=yn();const xn=ie(Sn);var _e={exports:{}},bn=_e.exports,dt;function Dn(){return dt||(dt=1,function(s,c){(function(t,r){s.exports=r()})(bn,function(){return function(t,r,n){var e=function(a,i){if(!i||!i.length||i.length===1&&!i[0]||i.length===1&&Array.isArray(i[0])&&!i[0].length)return null;var d;i.length===1&&i[0].length>0&&(i=i[0]),d=(i=i.filter(function(v){return v}))[0];for(var h=1;h<i.length;h+=1)i[h].isValid()&&!i[h][a](d)||(d=i[h]);return d};n.max=function(){var a=[].slice.call(arguments,0);return e("isAfter",a)},n.min=function(){var a=[].slice.call(arguments,0);return e("isBefore",a)}}})}(_e)),_e.exports}var wn=Dn();const Mn=ie(wn);var ze={exports:{}},En=ze.exports,ft;function In(){return ft||(ft=1,function(s,c){(function(t,r){s.exports=r()})(En,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(n,e,a){var i,d=function(f,g,$){$===void 0&&($={});var u=new Date(f),w=function(T,R){R===void 0&&(R={});var M=R.timeZoneName||"short",L=T+"|"+M,N=r[L];return N||(N=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:T,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:M}),r[L]=N),N}(g,$);return w.formatToParts(u)},h=function(f,g){for(var $=d(f,g),u=[],w=0;w<$.length;w+=1){var T=$[w],R=T.type,M=T.value,L=t[R];L>=0&&(u[L]=parseInt(M,10))}var N=u[3],j=N===24?0:N,E=u[0]+"-"+u[1]+"-"+u[2]+" "+j+":"+u[4]+":"+u[5]+":000",D=+f;return(a.utc(E).valueOf()-(D-=D%1e3))/6e4},v=e.prototype;v.tz=function(f,g){f===void 0&&(f=i);var $,u=this.utcOffset(),w=this.toDate(),T=w.toLocaleString("en-US",{timeZone:f}),R=Math.round((w-new Date(T))/1e3/60),M=15*-Math.round(w.getTimezoneOffset()/15)-R;if(!Number(M))$=this.utcOffset(0,g);else if($=a(T,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(M,!0),g){var L=$.utcOffset();$=$.add(u-L,"minute")}return $.$x.$timezone=f,$},v.offsetName=function(f){var g=this.$x.$timezone||a.tz.guess(),$=d(this.valueOf(),g,{timeZoneName:f}).find(function(u){return u.type.toLowerCase()==="timezonename"});return $&&$.value};var p=v.startOf;v.startOf=function(f,g){if(!this.$x||!this.$x.$timezone)return p.call(this,f,g);var $=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call($,f,g).tz(this.$x.$timezone,!0)},a.tz=function(f,g,$){var u=$&&g,w=$||g||i,T=h(+a(),w);if(typeof f!="string")return a(f).tz(w);var R=function(j,E,D){var l=j-60*E*1e3,m=h(l,D);if(E===m)return[l,E];var C=h(l-=60*(m-E)*1e3,D);return m===C?[l,m]:[j-60*Math.min(m,C)*1e3,Math.max(m,C)]}(a.utc(f,u).valueOf(),T,w),M=R[0],L=R[1],N=a(M).utcOffset(L);return N.$x.$timezone=w,N},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(f){i=f}}})}(ze)),ze.exports}var On=In();const kn=ie(On);var je={exports:{}},Tn=je.exports,ht;function Rn(){return ht||(ht=1,function(s,c){(function(t,r){s.exports=r()})(Tn,function(){return function(t,r,n){n.updateLocale=function(e,a){var i=n.Ls[e];if(i)return(a?Object.keys(a):[]).forEach(function(d){i[d]=a[d]}),i}}})}(je)),je.exports}var Cn=Rn();const Fn=ie(Cn);var Pe={exports:{}},_n=Pe.exports,mt;function zn(){return mt||(mt=1,function(s,c){(function(t,r){s.exports=r()})(_n,function(){var t="minute",r=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(e,a,i){var d=a.prototype;i.utc=function(u){var w={date:u,utc:!0,args:arguments};return new a(w)},d.utc=function(u){var w=i(this.toDate(),{locale:this.$L,utc:!0});return u?w.add(this.utcOffset(),t):w},d.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var h=d.parse;d.parse=function(u){u.utc&&(this.$u=!0),this.$utils().u(u.$offset)||(this.$offset=u.$offset),h.call(this,u)};var v=d.init;d.init=function(){if(this.$u){var u=this.$d;this.$y=u.getUTCFullYear(),this.$M=u.getUTCMonth(),this.$D=u.getUTCDate(),this.$W=u.getUTCDay(),this.$H=u.getUTCHours(),this.$m=u.getUTCMinutes(),this.$s=u.getUTCSeconds(),this.$ms=u.getUTCMilliseconds()}else v.call(this)};var p=d.utcOffset;d.utcOffset=function(u,w){var T=this.$utils().u;if(T(u))return this.$u?0:T(this.$offset)?p.call(this):this.$offset;if(typeof u=="string"&&(u=function(N){N===void 0&&(N="");var j=N.match(r);if(!j)return null;var E=(""+j[0]).match(n)||["-",0,0],D=E[0],l=60*+E[1]+ +E[2];return l===0?0:D==="+"?l:-l}(u),u===null))return this;var R=Math.abs(u)<=16?60*u:u,M=this;if(w)return M.$offset=R,M.$u=u===0,M;if(u!==0){var L=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(M=this.local().add(R+L,t)).$offset=R,M.$x.$localOffset=L}else M=this.utc();return M};var f=d.format;d.format=function(u){var w=u||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,w)},d.valueOf=function(){var u=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*u},d.isUTC=function(){return!!this.$u},d.toISOString=function(){return this.toDate().toISOString()},d.toString=function(){return this.toDate().toUTCString()};var g=d.toDate;d.toDate=function(u){return u==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var $=d.diff;d.diff=function(u,w,T){if(u&&this.$u===u.$u)return $.call(this,u,w,T);var R=this.local(),M=i(u).local();return $.call(R,M,w,T)}}})}(Pe)),Pe.exports}var jn=zn();const Pn=ie(jn);var Ae={exports:{}},An=Ae.exports,pt;function Ln(){return pt||(pt=1,function(s,c){(function(t,r){s.exports=r()})(An,function(){return function(t,r){r.prototype.weekday=function(n){var e=this.$locale().weekStart||0,a=this.$W,i=(a<e?a+7:a)-e;return this.$utils().u(n)?i:this.subtract(i,"day").add(n,"day")}}})}(Ae)),Ae.exports}var qn=Ln();const Nn=ie(qn);K.extend(Mn);K.extend(Zt);K.extend(Nn);K.extend(vn);K.extend(Pn);K.extend(kn);K.extend(cn);K.extend(hn);K.extend(en);K.extend(xn);K.extend(Fn);K.extend(sn);function Wn(s,c){const t=Q(g=>g.setCurrentTask),r=Q(g=>g.rawTasks),n=Q(g=>g.selectedScale),e=Q(g=>g.setDragOffset),a=Q(g=>g.clearDragOffset),i=Q(g=>g.setRawTasks),d=ee.useRef(null),h=ee.useRef(null),v=g=>{const $=g.target,u=$.closest('[data-mode="left"]')?"left":$.closest('[data-mode="right"]')?"right":"bar";d.current={mode:u,initialClientX:g.clientX,initialLeft:s.barLeft,initialWidth:s.barWidth,initialStartDate:s.startDate,initialEndDate:s.endDate,dragSteps:0},t(s),g.currentTarget.setPointerCapture(g.pointerId),h.current=g.pointerId,document.addEventListener("pointermove",p),document.addEventListener("pointerup",f),document.addEventListener("pointercancel",f)},p=g=>{const $=d.current;if(!$)return;const{basePxPerDragStep:u}=he[n],w=he[n],T=w.dragStepAmount*{minute:1,hour:60,day:60*24,week:60*24*7,month:60*24*30}[w.dragStepUnit]/w.basePxPerDragStep,R=u;let M=g.clientX-$.initialClientX;$.mode==="left"?(M=Math.min(M,$.initialWidth-R),M<0&&(M=Math.floor(M/u)*u)):$.mode==="right"&&(M=Math.max(M,-$.initialWidth+R),M>0&&(M=Math.ceil(M/u)*u));const L=Math.round(M/u);if(L===$.dragSteps)return;$.dragSteps=L;const N=$.dragSteps*u,j=N*T;let E=K($.initialStartDate),D=K($.initialEndDate);$.mode==="bar"?(E=E.add(j,"minute"),D=D.add(j,"minute")):$.mode==="left"?E=E.add(j,"minute"):$.mode==="right"&&(D=D.add(j,"minute"));const l=$.mode==="bar"?{offsetX:N,offsetWidth:0,offsetStartDate:E,offsetEndDate:D}:$.mode==="left"?{offsetX:N,offsetWidth:-N,offsetStartDate:E,offsetEndDate:D}:{offsetX:0,offsetWidth:N,offsetStartDate:E,offsetEndDate:D};e(s.id,l)},f=()=>{var M;document.removeEventListener("pointermove",p),document.removeEventListener("pointerup",f),document.removeEventListener("pointercancel",f);const g=d.current;if(!g)return;const{dragStepAmount:$,dragStepUnit:u}=he[n],w=L=>K(L).add(g.dragSteps*$,u).toISOString(),T=r.map(L=>{if(L.id!==s.id)return L;switch(g.mode){case"bar":return{...L,startDate:w(g.initialStartDate),endDate:w(g.initialEndDate)};case"left":return{...L,startDate:w(g.initialStartDate)};default:return{...L,endDate:w(g.initialEndDate)}}});t(null),a(s.id),i(T),c==null||c(T);const R=h.current;R!==null&&((M=document.getElementById(`task-${s.id}`))==null||M.releasePointerCapture(R)),h.current=null,d.current=null};return{onPointerDown:v}}const Hn=s=>Se.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...s},Se.createElement("path",{d:"M10.2 4L10.2 20L7.8 20L7.8 4L10.2 4ZM15 4L15 20L12.6 20L12.6 4L15 4ZM5.4 15.0999L5.4 7.8999L1.8 11.4999L5.4 15.0999ZM17.4 7.8999L17.4 15.0999L21 11.4999L17.4 7.8999Z"}));function gt({side:s,hoveredHandle:c,setHoveredHandle:t}){return W.jsx("button",{"data-mode":s,onMouseEnter:()=>t(s),onMouseLeave:()=>t("none"),style:{position:"absolute",top:0,[s]:-18.4,width:32,height:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"w-resize",background:"transparent",border:"none",padding:0},children:W.jsx(Hn,{style:{width:24,height:24,fill:"#919294",opacity:c===s?1:0}})})}function Un({currentTask:s,onTasksChange:c}){const t=ee.useRef(null),{onPointerDown:r}=Wn(s,c),n=Q(h=>h.dragOffsets[s.id]),e=(n==null?void 0:n.offsetX)??0,a=(n==null?void 0:n.offsetWidth)??0,[i,d]=ee.useState("none");return W.jsxs("div",{ref:t,id:`task-${s.id}`,onPointerDown:r,style:{position:"relative",display:"flex",alignItems:"center",background:"#D6D6D8",transform:`translateX(${s.barLeft+e}px)`,width:s.barWidth+a,height:Le/2,userSelect:"none"},children:[W.jsx(gt,{side:"left",hoveredHandle:i,setHoveredHandle:d}),W.jsx(gt,{side:"right",hoveredHandle:i,setHoveredHandle:d})]})}function Yn(s){return[...s].sort((c,t)=>{const r=c.sequence.split(".").map(Number),n=t.sequence.split(".").map(Number);for(let e=0;e<Math.max(r.length,n.length);e++){const a=r[e]||0,i=n[e]||0;if(a!==i)return a-i}return 0})}function Bn(s){return s.split(".").length-1}function Vn(s,c,t){const r=Yn(s);let n=0;return r.map(e=>{n++;const a=Bn(e.sequence),{barMarginLeftAmount:i,barWidthSize:d}=Gn(K(e.startDate),K(e.endDate),c,t);return{...e,barLeft:i,barWidth:d,depth:a,order:n,originalOrder:n}})}function Gn(s,c,t,r){if(!t.length)return{barMarginLeftAmount:0,barWidthSize:0};const{tickUnit:n,unitPerTick:e}=he[r];let a=0,i=0,d=!1;for(const h of t){const v=h.startDate,p=v.add(e,n),f=h.widthPx;if(p.isSameOrBefore(s)){a+=f;continue}if(v.isSameOrAfter(c))break;const g=s.isAfter(v)?s:v,$=c.isBefore(p)?c:p,u=p.diff(v),T=$.diff(g)/u;if(!d&&g.isAfter(v)){const R=g.diff(v)/u;a+=R*f}i+=T*f,d=!0}return{barMarginLeftAmount:a,barWidthSize:Math.max(i,1)}}function Xn(s){let c=1/0,t=-1/0;for(const{startDate:r,endDate:n}of Object.values(s)){const e=K(r).valueOf(),a=K(n).valueOf();Number.isNaN(e)||(c=Math.min(c,e)),Number.isNaN(a)||(t=Math.max(t,a))}return{minDate:K(c),maxDate:K(t)}}function Zn(s,c,t){const{tickUnit:r,unitPerTick:n}=he[t];return{paddedMinDate:s.subtract(tt*n,r),paddedMaxDate:c.add(tt*n,r)}}function Jn(s,c,t){const{tickUnit:r,unitPerTick:n,basePxPerDragStep:e,dragStepUnit:a,dragStepAmount:i}=he[t],d=[];let h=s.startOf(r);for(;h.isBefore(c);){const v=K(h).add(n,r).diff(h,a)/i;d.push({startDate:h,widthPx:v*e}),h=h.add(n,r)}return d}function yt(s,c){const{labelUnit:t,formatHeaderLabel:r}=he[c],n=[];let e=null,a="",i=0,d=null;return s.forEach((h,v)=>{const p=h.startDate.startOf(t),f=p.valueOf(),g=(r==null?void 0:r(p))??p.format();f===e?i+=h.widthPx:(e!==null&&n.push({label:a,widthPx:i,startDate:d}),e=f,a=g,i=h.widthPx,d=p),v===s.length-1&&n.push({label:a,widthPx:i,startDate:d})}),n}function Kn(s,c,t,r,n){const{minDate:e,maxDate:a}=Xn(Object.fromEntries(s.map(f=>[f.id,{startDate:f.startDate,endDate:f.endDate}]))),{paddedMinDate:i,paddedMaxDate:d}=Zn(e,a,c),h=Jn(i,d,c),v=yt(h,c),p=Vn(s,h,c);t(h),r(v),n(p)}const Qn=({bottomRowCells:s,selectedScale:c,width:t,scrollRef:r})=>{const n=he[c],[e,a]=ee.useState(0),i=Q(f=>f.currentTask),d=Q(f=>{if(!i)return"";const g=i.id;return f.dragOffsets[g]??""}),h=ee.useMemo(()=>yt(s,c),[s,c]),v=ee.useMemo(()=>{const f=[];for(const g of h){const $=f[f.length-1];$&&$.label===g.label?$.widthPx+=g.widthPx:f.push({...g})}return f},[h]),p=ee.useMemo(()=>{let f=0;return v.map(g=>{const $={...g,left:f};return f+=g.widthPx,$})},[v]);return ee.useEffect(()=>{const f=r.current;if(!f)return;const g=()=>{const $=f.scrollLeft;for(let u=p.length-1;u>=0;u--)if($>=p[u].left){a(u);break}};return f.addEventListener("scroll",g),g(),()=>f.removeEventListener("scroll",g)},[p]),W.jsx("div",{style:{width:`${t}px`,position:"sticky",top:0,zIndex:30,backgroundColor:"#F0F1F2"},children:W.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[W.jsx("div",{style:{position:"relative",display:"flex",height:"32px"},children:W.jsx("div",{style:{display:"flex"},children:p.map((f,g)=>{const $=g===e;return W.jsx("div",{style:{padding:"8px 0px",fontSize:"14px",fontWeight:"bold",textAlign:"left",width:`${f.widthPx}px`,zIndex:40,backgroundColor:"#F0F1F2",...$&&{position:"sticky",left:0}},children:W.jsx("p",{style:{margin:0,padding:"0 0px",whiteSpace:"nowrap"},children:f.label})},g)})})}),W.jsxs("div",{style:{borderTop:"1px solid #D6D6D8",display:"flex"},children:[W.jsx("div",{children:d&&i&&W.jsxs("div",{style:{position:"absolute",left:`${d.offsetX+((i==null?void 0:i.barLeft)??0)}px`,zIndex:60,backgroundColor:"#D6D6D8",width:`${d.offsetWidth+((i==null?void 0:i.barWidth)??0)}px`,height:"22px",display:"flex",alignItems:"center",borderRadius:"100px",opacity:.7,fontSize:"12px",overflow:"hidden",justifyContent:"space-between"},children:[c==="week"&&W.jsxs(W.Fragment,{children:[W.jsx("p",{children:d.offsetStartDate.format("h A")}),W.jsx("p",{children:d.offsetEndDate.format("h A")})]}),c==="year"&&W.jsxs(W.Fragment,{children:[W.jsx("p",{children:d.offsetStartDate.format("D")}),W.jsx("p",{children:d.offsetEndDate.format("D")})]})]})}),s.map((f,g)=>{var w;const $=((w=n.formatTickLabel)==null?void 0:w.call(n,f.startDate))||"",u=`bottom-row-${f.startDate}-${g}`;return W.jsx("div",{style:{position:"relative",lineHeight:"normal",padding:"4px 0",fontSize:"12px",width:`${f.widthPx}px`},children:$},u)})]})]})})};function er(s,c,t,r,n){if(t<0||n<0)return`M ${c} ${t} h ${(r-c)/2}`;const e=7,a=11,i=25,d=20,h=`M ${c} ${t}`,v=r-c,p=n-t,f=Math.abs(v),g=Math.abs(p),$=n<=t,u=n>=t,w=r>=c,T=r<=c,R=f>d,M=Math.abs(v/2),L=Math.abs(p/2);function N(){function l(){return(w||T)&&u&&!R?"downSmallHorizontal":(w||T)&&$&&!R?"upSmallHorizontal":u&&T?"downLeft":u&&w?"downRight":$&&T?"upLeft":$&&w?"upRight":""}let m=h;switch(l()){case"downRight":{m+=` h ${M-e}`,m+=` a ${e} ${e} 0 0 1 ${e} ${e}`,m+=` v ${p-e*2}`,m+=` a ${e} ${e} 0 0 0 ${e} ${e}`,m+=` h ${M-e}`;break}case"upRight":{m+=` h ${M-e}`,m+=` a ${e} ${e} 0 0 0 ${e} -${e}`,m+=` v -${g-e*2}`,m+=` a ${e} ${e} 0 0 1 ${e} -${e}`,m+=` h ${M-e}`;break}case"downLeft":case"downSmallHorizontal":{const Y=t+p/2;m+=` h ${a}`,m+=` a ${e} ${e} 0 0 1 ${e} ${e}`,m+=` v ${Y-t-e*2}`,m+=` a ${e} ${e} 0 0 1 -${e} ${e}`,m+=` h ${v-2*a}`,m+=` a ${e} ${e} 0 0 0 -${e} ${e}`,m+=` v ${Y-t-e*2}`,m+=` a ${e} ${e} 0 0 0 ${e} ${e}`,m+=` h ${a}`;break}case"upLeft":case"upSmallHorizontal":{const Y=t+p/2;m+=` h ${a}`,m+=` a ${e} ${e} 0 0 0 ${e} -${e}`,m+=` v -${t-Y-e*2}`,m+=` a ${e} ${e} 0 0 0 -${e} -${e}`,m+=` h ${v-2*a}`,m+=` a ${e} ${e} 0 0 1 -${e} -${e}`,m+=` v -${t-Y-e*2}`,m+=` a ${e} ${e} 0 0 1 ${e} -${e}`,m+=` h ${a}`;break}default:return m}return m}function j(){let l=h;return u&&T?(l+=` h ${i-a}`,l+=` a ${e} ${e} 0 0 1 ${e} ${e}`,l+=` v ${p-e*2}`,l+=` a ${e} ${e} 0 0 1 -${e} ${e}`,l+=` h ${v-e*2}`):u&&w?(l+=` h ${v+i-a}`,l+=` a ${e} ${e} 0 0 1 ${e} ${e}`,l+=` v ${p-e*2}`,l+=` a ${e} ${e} 0 0 1 -${e} ${e}`,l+=` h -${i-a}`):$&&T?(l+=` h ${i-a}`,l+=` a ${e} ${e} 0 0 0 ${e} -${e}`,l+=` v ${p+e*2}`,l+=` a ${e} ${e} 0 0 0 -${e} -${e}`,l+=` h ${v-i+a}`):$&&w&&(l+=` h ${v+i-a}`,l+=` a ${e} ${e} 0 0 0 ${e} -${e}`,l+=` v ${p+e*2}`,l+=` a ${e} ${e} 0 0 0 -${e} -${e}`,l+=` h -${i-a}`),l}function E(){function l(){return(w||T)&&u&&!R?"downSmallHorizontal":(w||T)&&$&&!R?"upSmallHorizontal":u&&T?"downLeft":u&&w?"downRight":$&&T?"upLeft":$&&w?"upRight":""}let m=h;switch(l()){case"downRight":case"downSmallHorizontal":{m+=" h -11",m+=` a ${e} ${e} 0 0 0 -${e} ${e}`,m+=` v ${L-e*2}`,m+=` a ${e} ${e} 0 0 0 ${e} ${e}`,m+=` h ${a*2+v}`,m+=` a ${e} ${e} 0 0 1 ${e} ${e}`,m+=` v ${L-e*2}`,m+=` a ${e} ${e} 0 0 1 -${e} ${e}`,m+=" h -11";break}case"upRight":case"upSmallHorizontal":{m+=" h -11",m+=` a ${e} ${e} 0 0 1 -${e} -${e}`,m+=` v ${-(L-e*2)}`,m+=` a ${e} ${e} 0 0 1 ${e} -${e}`,m+=` h ${a*2+v}`,m+=` a ${e} ${e} 0 0 0 ${e} -${e}`,m+=` v ${-(L-e*2)}`,m+=` a ${e} ${e} 0 0 0 -${e} -${e}`,m+=" h -11";break}case"downLeft":{m+=` h ${-M+e}`,m+=` a ${e} ${e} 0 0 0 -${e} ${e}`,m+=` v ${g-e*2}`,m+=` a ${e} ${e} 0 0 1 -${e} ${e}`,m+=` h ${-M+e}`;break}case"upLeft":{m+=` h ${-(M-e)}`,m+=` a ${e} ${e} 0 0 1 -${e} -${e}`,m+=` v ${-(g-e*2)}`,m+=` a ${e} ${e} 0 0 0 -${e} -${e}`,m+=` h ${-M+e}`;break}default:return m}return m}function D(){let l=h;return u&&T?(l+=` h ${v-i}`,l+=` a ${e} ${e} 0 0 0 -${e} ${e}`,l+=` v ${p-e*2}`,l+=` a ${e} ${e} 0 0 0 ${e} ${e}`,l+=` h ${i}`):u&&w?(l+=" h -25",l+=` a ${e} ${e} 0 0 0 -${e} ${e}`,l+=` v ${p-e*2}`,l+=` a ${e} ${e} 0 0 0 ${e} ${e}`,l+=` h ${v+i}`):$&&T?(l+=` h ${v-i}`,l+=` a ${e} ${e} 0 0 1 -${e} -${e}`,l+=` v ${p+e*2}`,l+=` a ${e} ${e} 0 0 1 ${e} -${e}`,l+=` h ${i}`):$&&w&&(l+=" h -25",l+=` a ${e} ${e} 0 0 1 -${e} -${e}`,l+=` v ${p+e*2}`,l+=` a ${e} ${e} 0 0 1 ${e} -${e}`,l+=` h ${v+i}`),l}switch(s){case"FS":return N();case"FF":return j();case"SF":return E();case"SS":return D();default:return`${h} L ${r} ${n}`}}function tr({transformedTasks:s,visibleRowIndexes:c}){const t=Q(e=>e.dragOffsets),r=new Set(c),n=[];for(const e of s){const a=e.order-1;if(!r.has(a))continue;const i=t[e.id],d=(i==null?void 0:i.offsetX)??0,h=(i==null?void 0:i.offsetWidth)??0;for(const v of e.dependencies??[]){const p=s.find(j=>j.id===v.targetId);if(!p)continue;const f=p.order-1,g=Le,$=f*g+g/2-4,u=a*g+g/2+4,w=p.barLeft,T=p.barLeft+p.barWidth,R=e.barLeft+d,M=R+e.barWidth+h,[L,N]={FS:[T,R],SS:[w,R],FF:[T,M],SF:[w,M]}[v.type];n.push({...v,fromX:L,fromY:$,toX:N,toY:u})}}return W.jsxs("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:`${s.length*Le}px`,pointerEvents:"none",zIndex:5},children:[W.jsx("defs",{children:W.jsx("marker",{id:"arrowhead",markerWidth:"6",markerHeight:"6",refX:"5.25",refY:"3",orient:"auto",children:W.jsx("polygon",{points:"0 0, 6 3, 0 6"})})}),n.map((e,a)=>W.jsx("path",{d:er(e.type,e.fromX,e.fromY,e.toX,e.toY),markerEnd:"url(#arrowhead)",fill:"none",style:{stroke:"#000",strokeWidth:.75}},a))]})}function S(s,c){const t=new Date(s);return t.setUTCDate(t.getUTCDate()+c),t}function y(s,c,t=0,r=0){const n=new Date(s);return n.setUTCHours(c,t,r,0),n}function x(s){return s.toISOString().split(".")[0]+"Z"}const nr=new Date,b=y(new Date(nr),0,0,0),rr=[{id:"1",name:"Project Kickoff",startDate:x(y(S(b,0),9)),endDate:x(y(S(b,0),11)),parentId:null,sequence:"1",dependencies:[]},{id:"2",name:"Requirement Gathering",startDate:x(y(S(b,1),9)),endDate:x(y(S(b,4),17)),parentId:null,sequence:"2",dependencies:[{targetId:"1",type:"FS"}]},{id:"3",name:"Design Kickoff Meeting",startDate:x(y(S(b,3),9)),endDate:x(y(S(b,3),17)),parentId:null,sequence:"2.1",dependencies:[{targetId:"2",type:"SS"}]},{id:"4",name:"Technical Design Review",startDate:x(y(S(b,5),9)),endDate:x(y(S(b,7),17)),parentId:null,sequence:"3",dependencies:[{targetId:"3",type:"FS"}]},{id:"5",name:"Frontend Architecture Planning",startDate:x(y(S(b,8),9)),endDate:x(y(S(b,10),17)),parentId:null,sequence:"4",dependencies:[{targetId:"4",type:"FS"}]},{id:"6",name:"Backend Architecture Planning",startDate:x(y(S(b,9),9)),endDate:x(y(S(b,11),17)),parentId:null,sequence:"5",dependencies:[{targetId:"4",type:"FS"}]},{id:"7",name:"Frontend UI Design",startDate:x(y(S(b,12),9)),endDate:x(y(S(b,17),17)),parentId:"5",sequence:"4.1",dependencies:[{targetId:"5",type:"FS"}]},{id:"8",name:"Backend Database Schema Design",startDate:x(y(S(b,14),9)),endDate:x(y(S(b,17),17)),parentId:"6",sequence:"5.1",dependencies:[{targetId:"6",type:"FS"}]},{id:"9",name:"User Authentication Development",startDate:x(y(S(b,18),9)),endDate:x(y(S(b,22),17)),parentId:"7",sequence:"6",dependencies:[{targetId:"7",type:"FS"}]},{id:"10",name:"Payment Integration Development",startDate:x(y(S(b,18),9)),endDate:x(y(S(b,22),17)),parentId:"8",sequence:"7",dependencies:[{targetId:"8",type:"FS"}]},{id:"11",name:"API Endpoints Development",startDate:x(y(S(b,23),9)),endDate:x(y(S(b,27),17)),parentId:"9",sequence:"6.1",dependencies:[{targetId:"9",type:"SS"}]},{id:"12",name:"Frontend Component Development",startDate:x(y(S(b,23),9)),endDate:x(y(S(b,28),17)),parentId:"7",sequence:"4.2",dependencies:[{targetId:"7",type:"SS"}]},{id:"13",name:"Integration of Frontend and Backend",startDate:x(y(S(b,28),9)),endDate:x(y(S(b,31),17)),parentId:null,sequence:"8",dependencies:[{targetId:"11",type:"FS"},{targetId:"12",type:"FS"}]},{id:"14",name:"Performance Optimization",startDate:x(y(S(b,32),9)),endDate:x(y(S(b,35),17)),parentId:null,sequence:"9",dependencies:[{targetId:"13",type:"FS"}]},{id:"15",name:"User Acceptance Testing (UAT)",startDate:x(y(S(b,36),9)),endDate:x(y(S(b,39),17)),parentId:null,sequence:"10",dependencies:[{targetId:"14",type:"FS"}]},{id:"16",name:"Bug Fixing and Refinement",startDate:x(y(S(b,40),9)),endDate:x(y(S(b,43),17)),parentId:null,sequence:"11",dependencies:[{targetId:"15",type:"FS"}]},{id:"17",name:"Pre-Release Demo",startDate:x(y(S(b,44),9)),endDate:x(y(S(b,46),17)),parentId:null,sequence:"12",dependencies:[{targetId:"16",type:"FS"}]},{id:"18",name:"Final Release and Deployment",startDate:x(y(S(b,47),9)),endDate:x(y(S(b,50),17)),parentId:null,sequence:"13",dependencies:[{targetId:"17",type:"FS"}]},{id:"19",name:"Post-Release Monitoring",startDate:x(y(S(b,51),9)),endDate:x(y(S(b,53),17)),parentId:null,sequence:"14",dependencies:[{targetId:"18",type:"FS"}]},{id:"20",name:"Community Engagement and Feedback Collection",startDate:x(y(S(b,54),9)),endDate:x(y(S(b,57),17)),parentId:null,sequence:"15",dependencies:[{targetId:"19",type:"FS"}]},{id:"21",name:"Feature Iteration and Updates",startDate:x(y(S(b,58),9)),endDate:x(y(S(b,60),17)),parentId:null,sequence:"16",dependencies:[{targetId:"20",type:"SS"}]},{id:"22",name:"Maintenance and Bug Fixing",startDate:x(y(S(b,61),9)),endDate:x(y(S(b,63),17)),parentId:null,sequence:"17",dependencies:[{targetId:"21",type:"FS"}]},{id:"23",name:"Database Optimization",startDate:x(y(S(b,64),9)),endDate:x(y(S(b,67),17)),parentId:null,sequence:"18",dependencies:[{targetId:"22",type:"FS"}]},{id:"24",name:"Scaling Infrastructure",startDate:x(y(S(b,68),9)),endDate:x(y(S(b,71),17)),parentId:null,sequence:"19",dependencies:[{targetId:"23",type:"FS"}]},{id:"25",name:"Security Patch Deployment",startDate:x(y(S(b,72),9)),endDate:x(y(S(b,74),17)),parentId:null,sequence:"20",dependencies:[{targetId:"24",type:"FS"}]},{id:"26",name:"Code Refactoring",startDate:x(y(S(b,75),9)),endDate:x(y(S(b,77),17)),parentId:null,sequence:"21",dependencies:[{targetId:"25",type:"FS"}]},{id:"27",name:"Mobile Optimization",startDate:x(y(S(b,78),9)),endDate:x(y(S(b,80),17)),parentId:null,sequence:"22",dependencies:[{targetId:"26",type:"FS"}]},{id:"28",name:"Testing Environment Setup",startDate:x(y(S(b,81),9)),endDate:x(y(S(b,83),17)),parentId:null,sequence:"23",dependencies:[{targetId:"27",type:"FS"}]},{id:"29",name:"Load Testing",startDate:x(y(S(b,84),9)),endDate:x(y(S(b,86),17)),parentId:null,sequence:"24",dependencies:[{targetId:"28",type:"FS"}]},{id:"30",name:"API Rate Limiting Implementation",startDate:x(y(S(b,87),9)),endDate:x(y(S(b,89),17)),parentId:null,sequence:"25",dependencies:[{targetId:"29",type:"FS"}]},{id:"31",name:"Security Audit",startDate:x(y(S(b,90),9)),endDate:x(y(S(b,92),17)),parentId:null,sequence:"26",dependencies:[{targetId:"30",type:"FS"}]},{id:"32",name:"Documentation Update",startDate:x(y(S(b,93),9)),endDate:x(y(S(b,96),17)),parentId:null,sequence:"27",dependencies:[{targetId:"31",type:"FS"}]},{id:"33",name:"Feature Freeze",startDate:x(y(S(b,97),9)),endDate:x(y(S(b,99),17)),parentId:null,sequence:"28",dependencies:[{targetId:"32",type:"FS"}]},{id:"34",name:"Release Candidate Preparation",startDate:x(y(S(b,100),9)),endDate:x(y(S(b,102),17)),parentId:null,sequence:"29",dependencies:[{targetId:"33",type:"FS"}]},{id:"35",name:"User Documentation",startDate:x(y(S(b,103),9)),endDate:x(y(S(b,105),17)),parentId:null,sequence:"30",dependencies:[{targetId:"32",type:"SS"}]},{id:"36",name:"Final Testing",startDate:x(y(S(b,106),9)),endDate:x(y(S(b,109),17)),parentId:null,sequence:"31",dependencies:[{targetId:"34",type:"FS"}]},{id:"37",name:"Code Deployment",startDate:x(y(S(b,110),9)),endDate:x(y(S(b,112),17)),parentId:null,sequence:"32",dependencies:[{targetId:"36",type:"FS"}]},{id:"38",name:"Monitoring Setup",startDate:x(y(S(b,113),9)),endDate:x(y(S(b,115),17)),parentId:null,sequence:"33",dependencies:[{targetId:"37",type:"FS"}]},{id:"39",name:"Post-Deployment Testing",startDate:x(y(S(b,116),9)),endDate:x(y(S(b,118),17)),parentId:null,sequence:"34",dependencies:[{targetId:"38",type:"FS"}]},{id:"40",name:"Bug Tracking and Resolution",startDate:x(y(S(b,119),9)),endDate:x(y(S(b,121),17)),parentId:null,sequence:"35",dependencies:[{targetId:"39",type:"FS"}]},{id:"41",name:"Feature Enhancement Planning",startDate:x(y(S(b,122),9)),endDate:x(y(S(b,124),17)),parentId:null,sequence:"36",dependencies:[{targetId:"40",type:"FS"}]},{id:"42",name:"New Feature Design",startDate:x(y(S(b,125),9)),endDate:x(y(S(b,128),17)),parentId:"41",sequence:"36.1",dependencies:[{targetId:"41",type:"FS"}]},{id:"43",name:"New Feature Development",startDate:x(y(S(b,129),9)),endDate:x(y(S(b,133),17)),parentId:"42",sequence:"36.2",dependencies:[{targetId:"42",type:"FS"}]},{id:"44",name:"Testing of New Feature",startDate:x(y(S(b,134),9)),endDate:x(y(S(b,136),17)),parentId:"43",sequence:"36.3",dependencies:[{targetId:"43",type:"FS"}]},{id:"45",name:"User Acceptance Testing (UAT) for New Feature",startDate:x(y(S(b,137),9)),endDate:x(y(S(b,140),17)),parentId:"44",sequence:"36.4",dependencies:[{targetId:"44",type:"FS"}]},{id:"46",name:"Feature Release",startDate:x(y(S(b,141),9)),endDate:x(y(S(b,143),17)),parentId:null,sequence:"37",dependencies:[{targetId:"45",type:"FS"}]},{id:"47",name:"Performance Testing for New Feature",startDate:x(y(S(b,144),9)),endDate:x(y(S(b,146),17)),parentId:null,sequence:"38",dependencies:[{targetId:"46",type:"FS"}]},{id:"48",name:"Final Code Review for New Feature",startDate:x(y(S(b,147),9)),endDate:x(y(S(b,149),17)),parentId:null,sequence:"39",dependencies:[{targetId:"47",type:"FS"}]},{id:"49",name:"Production Deployment",startDate:x(y(S(b,150),9)),endDate:x(y(S(b,152),17)),parentId:null,sequence:"40",dependencies:[{targetId:"48",type:"FS"}]},{id:"50",name:"Post-Deployment Support",startDate:x(y(S(b,153),9)),endDate:x(y(S(b,156),17)),parentId:null,sequence:"41",dependencies:[{targetId:"49",type:"FS"}]}];function sr({tasks:s,onTasksChange:c,ganttHeight:t,columnWidth:r}){var D;const n=Q(l=>l.rawTasks),e=Q(l=>l.setRawTasks),a=Q(l=>l.transformedTasks),i=Q(l=>l.setTransformedTasks),d=Q(l=>l.selectedScale),h=Q(l=>l.setSelectedScale),v=Q(l=>l.bottomRowCells),p=Q(l=>l.setBottomRowCells),f=Q(l=>l.topHeaderGroups),g=Q(l=>l.setTopHeaderGroups);ee.useEffect(()=>{s.length===0?e(rr):e(s)},[s]),ee.useEffect(()=>{n.length&&Kn(n,d,p,g,i)},[n,d]);const $=ee.useRef(null),u=et({count:a.length,getScrollElement:()=>$.current,estimateSize:()=>Le,overscan:5}),w=et({horizontal:!0,count:v.length,getScrollElement:()=>$.current,estimateSize:l=>{var m;return((m=v[l])==null?void 0:m.widthPx)??32},overscan:5}),T=w.getVirtualItems(),R=((D=T[0])==null?void 0:D.start)??0,M=T[T.length-1],L=M?M.start+M.size:0;function N(l,m,C,Y){return l+m>=C&&l<=Y}const j=ee.useMemo(()=>v.reduce((l,m)=>l+m.widthPx,0),[v]),E=u.getVirtualItems().map(l=>l.index);return ee.useEffect(()=>{if(!v.length)return;const l=requestAnimationFrame(()=>{w.measure()});return()=>cancelAnimationFrame(l)},[v,w]),W.jsx("section",{style:{position:"relative",overflow:"auto",height:typeof t=="number"?`${t}px`:t,width:typeof r=="number"?`${r}px`:r,backgroundColor:"#FFF",fontFamily:"Noto Sans, sans-serif"},children:W.jsx("div",{style:{width:"100%",height:"100%",overflow:"hidden",backgroundColor:"#FFF"},children:W.jsxs("section",{style:{position:"relative",display:"flex",height:"100%",width:"100%",flexDirection:"column"},children:[W.jsx("div",{style:{position:"absolute",top:"3px",right:"16px",zIndex:50,display:"flex",justifyContent:"flex-end",alignItems:"center"},children:W.jsx("select",{style:{padding:"4px 8px",fontSize:"14px",borderRadius:"6px",border:"1px solid #E6E7E9"},value:d,onChange:l=>{const m=l.target.value;h(m)},children:Object.keys(he).map(l=>W.jsx("option",{value:l,children:l},l))})}),W.jsxs("div",{ref:$,className:"List",style:{height:"100%",width:"100%",overflow:"auto"},children:[W.jsx(Qn,{topHeaderGroups:f,bottomRowCells:v,selectedScale:d,width:j,scrollRef:$}),W.jsxs("div",{style:{height:`${u.getTotalSize()}px`,width:`${j}px`,position:"relative"},children:[W.jsx(tr,{transformedTasks:a,visibleRowIndexes:E}),u.getVirtualItems().map(l=>{const m=a[l.index],C=m.barLeft??0,Y=m.barWidth??0,V=N(C,Y,R,L);return W.jsx("div",{style:{position:"absolute",top:0,left:0,height:`${l.size-1}px`,transform:`translateY(${l.start}px)`,display:"flex",width:"100%",alignItems:"center",borderBottom:"1px solid #E6E7E9"},children:V&&W.jsx(W.Fragment,{children:W.jsx(Un,{currentTask:m,onTasksChange:c})})},l.index)})]})]})]})})})}exports.ReactGanttChart=sr;
4
+ color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,e==null?void 0:e.key)}return(c=e==null?void 0:e.onChange)==null||c.call(e,s),s}return t.updateDeps=o=>{n=o},t}function Nt(r,a){if(r===void 0)throw new Error("Unexpected undefined");return r}const Cn=(r,a)=>Math.abs(r-a)<1.01,Ln=(r,a,e)=>{let n;return function(...s){r.clearTimeout(n),n=r.setTimeout(()=>a.apply(this,s),e)}},Ft=r=>{const{offsetWidth:a,offsetHeight:e}=r;return{width:a,height:e}},Rn=r=>r,_n=r=>{const a=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1),n=[];for(let s=a;s<=e;s++)n.push(s);return n},jn=(r,a)=>{const e=r.scrollElement;if(!e)return;const n=r.targetWindow;if(!n)return;const s=o=>{const{width:i,height:u}=o;a({width:Math.round(i),height:Math.round(u)})};if(s(Ft(e)),!n.ResizeObserver)return()=>{};const t=new n.ResizeObserver(o=>{const i=()=>{const u=o[0];if(u!=null&&u.borderBoxSize){const c=u.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(Ft(e))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return t.observe(e,{box:"border-box"}),()=>{t.unobserve(e)}},Ht={passive:!0},At=typeof window>"u"?!0:"onscrollend"in window,Pn=(r,a)=>{const e=r.scrollElement;if(!e)return;const n=r.targetWindow;if(!n)return;let s=0;const t=r.options.useScrollendEvent&&At?()=>{}:Ln(n,()=>{a(s,!1)},r.options.isScrollingResetDelay),o=d=>()=>{const{horizontal:l,isRtl:h}=r.options;s=l?e.scrollLeft*(h&&-1||1):e.scrollTop,t(),a(s,d)},i=o(!0),u=o(!1);u(),e.addEventListener("scroll",i,Ht);const c=r.options.useScrollendEvent&&At;return c&&e.addEventListener("scrollend",u,Ht),()=>{e.removeEventListener("scroll",i),c&&e.removeEventListener("scrollend",u)}},Wn=(r,a,e)=>{if(a!=null&&a.borderBoxSize){const n=a.borderBoxSize[0];if(n)return Math.round(n[e.options.horizontal?"inlineSize":"blockSize"])}return r[e.options.horizontal?"offsetWidth":"offsetHeight"]},Nn=(r,{adjustments:a=0,behavior:e},n)=>{var s,t;const o=r+a;(t=(s=n.scrollElement)==null?void 0:s.scrollTo)==null||t.call(s,{[n.options.horizontal?"left":"top"]:o,behavior:e})};class Fn{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const n=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(s=>{s.forEach(t=>{const o=()=>{this._measureElement(t.target,t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=n())==null||s.disconnect(),e=null},observe:s=>{var t;return(t=n())==null?void 0:t.observe(s,{box:"border-box"})},unobserve:s=>{var t;return(t=n())==null?void 0:t.unobserve(s)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([n,s])=>{typeof s>"u"&&delete e[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Rn,rangeExtractor:_n,onChange:()=>{},measureElement:Wn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var n,s;(s=(n=this.options).onChange)==null||s.call(n,this,e)},this.maybeNotify=K(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=t,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,n)=>{const s=new Map,t=new Map;for(let o=n-1;o>=0;o--){const i=e[o];if(s.has(i.lane))continue;const u=t.get(i.lane);if(u==null||i.end>u.end?t.set(i.lane,i):i.end<u.end&&s.set(i.lane,!0),s.size===this.options.lanes)break}return t.size===this.options.lanes?Array.from(t.values()).sort((o,i)=>o.end===i.end?o.index-i.index:o.end-i.end)[0]:void 0},this.getMeasurementOptions=K(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,n,s,t,o)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:s,getItemKey:t,enabled:o}),{key:!1}),this.getMeasurements=K(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:n,scrollMargin:s,getItemKey:t,enabled:o},i)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const u=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,u);for(let d=u;d<e;d++){const l=t(d),h=this.options.lanes===1?c[d-1]:this.getFurthestMeasurement(c,d),x=h?h.end+this.options.gap:n+s,y=i.get(l),f=typeof y=="number"?y:this.options.estimateSize(d),S=x+f,D=h?h.lane:d%this.options.lanes;c[d]={index:d,start:x,size:f,end:S,key:l,lane:D}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=K(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,n,s,t)=>this.range=e.length>0&&n>0?Hn({measurements:e,outerSize:n,scrollOffset:s,lanes:t}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=K(()=>{let e=null,n=null;const s=this.calculateRange();return s&&(e=s.startIndex,n=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,n]},(e,n,s,t,o)=>t===null||o===null?[]:e({startIndex:t,endIndex:o,overscan:n,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const n=this.options.indexAttribute,s=e.getAttribute(n);return s?parseInt(s,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(e,n)=>{const s=this.indexFromElement(e),t=this.measurementsCache[s];if(!t)return;const o=t.key,i=this.elementsCache.get(o);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(s,this.options.measureElement(e,n,this))},this.resizeItem=(e,n)=>{const s=this.measurementsCache[e];if(!s)return;const t=this.itemSizeCache.get(s.key)??s.size,o=n-t;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,o,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",o),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,n)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((n,s)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(s))});return}this._measureElement(e,void 0)},this.getVirtualItems=K(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,n)=>{const s=[];for(let t=0,o=e.length;t<o;t++){const i=e[t],u=n[i];s.push(u)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const n=this.getMeasurements();if(n.length!==0)return Nt(n[Vt(0,n.length-1,s=>Nt(n[s]).start,e)])},this.getOffsetForAlignment=(e,n,s=0)=>{const t=this.getSize(),o=this.getScrollOffset();n==="auto"&&(n=e>=o+t?"end":"start"),n==="center"?e+=(s-t)/2:n==="end"&&(e-=t);const i=this.getTotalSize()+this.options.scrollMargin-t;return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,n="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const s=this.measurementsCache[e];if(!s)return;const t=this.getSize(),o=this.getScrollOffset();if(n==="auto")if(s.end>=o+t-this.options.scrollPaddingEnd)n="end";else if(s.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];const i=n==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,n,s.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:n="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,n),{adjustments:void 0,behavior:s})},this.scrollToIndex=(e,{align:n="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let t=0;const o=10,i=c=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(e,c);if(!d){console.warn("Failed to get offset for index:",e);return}const[l,h]=d;this._scrollToOffset(l,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const x=this.getScrollOffset(),y=this.getOffsetForIndex(e,h);if(!y){console.warn("Failed to get offset for index:",e);return}Cn(y[0],x)||u(h)})},u=c=>{this.targetWindow&&(t++,t<o?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",t,o),this.targetWindow.requestAnimationFrame(()=>i(c))):console.warn(`Failed to scroll to index ${e} after ${o} attempts.`))};i(n)},this.scrollBy=(e,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var e;const n=this.getMeasurements();let s;if(n.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((e=n[n.length-1])==null?void 0:e.end)??0;else{const t=Array(this.options.lanes).fill(null);let o=n.length-1;for(;o>=0&&t.some(i=>i===null);){const i=n[o];t[i.lane]===null&&(t[i.lane]=i.end),o--}s=Math.max(...t.filter(i=>i!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:n,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(a)}}const Vt=(r,a,e,n)=>{for(;r<=a;){const s=(r+a)/2|0,t=e(s);if(t<n)r=s+1;else if(t>n)a=s-1;else return s}return r>0?r-1:0};function Hn({measurements:r,outerSize:a,scrollOffset:e,lanes:n}){const s=r.length-1,t=u=>r[u].start;if(r.length<=n)return{startIndex:0,endIndex:s};let o=Vt(0,s,t,e),i=o;if(n===1)for(;i<s&&r[i].end<e+a;)i++;else if(n>1){const u=Array(n).fill(0);for(;i<s&&u.some(d=>d<e+a);){const d=r[i];u[d.lane]=d.end,i++}const c=Array(n).fill(e+a);for(;o>=0&&c.some(d=>d>=e);){const d=r[o];c[d.lane]=d.start,o--}o=Math.max(0,o-o%n),i=Math.min(s,i+(n-1-i%n))}return{startIndex:o,endIndex:i}}const Yt=typeof document<"u"?gt.useLayoutEffect:gt.useEffect;function An(r){const a=gt.useReducer(()=>({}),{})[1],e={...r,onChange:(s,t)=>{var o;t?Gt.flushSync(a):a(),(o=r.onChange)==null||o.call(r,s,t)}},[n]=gt.useState(()=>new Fn(e));return n.setOptions(e),Yt(()=>n._didMount(),[]),Yt(()=>n._willUpdate()),n}function Ut(r){return An({observeElementRect:jn,observeElementOffset:Pn,scrollToFn:Nn,...r})}function Yn({transformedTasks:r,bottomRowCells:a,scrollRef:e}){var d;const n=Ut({count:r.length,getScrollElement:()=>e.current,estimateSize:()=>pt,overscan:5}),s=Ut({horizontal:!0,count:a.length,getScrollElement:()=>e.current,estimateSize:l=>{var h;return((h=a[l])==null?void 0:h.widthPx)??32},overscan:5}),t=s.getVirtualItems(),o=((d=t[0])==null?void 0:d.start)??0,i=t[t.length-1],u=i?i.start+i.size:0,c=N.useMemo(()=>(l,h)=>l+h>=o&&l<=u,[o,u]);return N.useEffect(()=>{if(!a.length)return;const l=requestAnimationFrame(()=>{s.measure()});return()=>cancelAnimationFrame(l)},[a,s]),{rowVirtualizer:n,columnVirtualizer:s,isBarVisible:c}}function Un(r,a="gantt-container"){const[e,n]=N.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");N.useEffect(()=>{if(typeof window>"u")return;const i=window.matchMedia("(prefers-color-scheme: dark)"),u=c=>{n(c.matches?"dark":"light")};return i.addEventListener("change",u),()=>i.removeEventListener("change",u)},[]);const s=N.useMemo(()=>!r||r==="system"?e:r,[r,e]),t=N.useMemo(()=>{const i=[a];return r&&i.push(s),i.join(" ")},[a,r,s]);return{resolvedTheme:s,containerClassName:t,dataTheme:r?s:void 0}}const qn=600,Bn="100%",Vn="month";function Gn({tasks:r=[],onTasksChange:a,height:e=qn,width:n=Bn,theme:s,defaultScale:t=Vn,className:o}){const{rawTasks:i,transformedTasks:u,bottomRowCells:c,selectedScale:d,setRawTasks:l,setTransformedTasks:h,setBottomRowCells:x,setSelectedScale:y,getTotalWidth:f}=Bt(),S=N.useRef(null),{rowVirtualizer:D,isBarVisible:b}=Yn({transformedTasks:u,bottomRowCells:c,scrollRef:S}),{containerClassName:g,dataTheme:z}=Un(s,o?`gantt-container ${o}`:"gantt-container");N.useEffect(()=>{t&&t!==d&&y(t)},[]),N.useEffect(()=>{r.length>0&&l(r)},[r,l]),N.useEffect(()=>{if(!i.length)return;const{bottomCells:p,transformedTasks:$}=wn(i,d);x(p),h($)},[i,d,x,h]);const R=p=>{y(p)},T=f(),v={height:typeof e=="number"?`${e}px`:e,width:typeof n=="number"?`${n}px`:n};return _.jsx("section",{className:g,"data-theme":z,style:v,children:_.jsx("div",{className:"gantt-inner",children:_.jsxs("section",{className:"gantt-section",children:[_.jsx(In,{selectedScale:d,onScaleChange:R}),_.jsxs("div",{ref:S,className:"gantt-list",children:[_.jsx(Dn,{bottomRowCells:c,selectedScale:d,width:T,scrollRef:S}),_.jsxs("div",{className:"gantt-content",style:{height:`${D.getTotalSize()}px`,width:`${T}px`},children:[_.jsx(zn,{bottomRowCells:c,height:D.getTotalSize()}),_.jsx(En,{transformedTasks:u}),D.getVirtualItems().map(p=>{const $=u[p.index],m=$.barLeft??0,k=$.barWidth??0;return _.jsx("div",{className:"gantt-task-row",style:{height:`${p.size-1}px`,transform:`translateY(${p.start}px)`},children:b(m,k)&&_.jsx(dn,{currentTask:$,onTasksChange:a})},$.id)})]})]})]})})})}exports.ReactGanttChart=Gn;