@wimi/vtable-gantt 1.0.0 → 1.0.1
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/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/ts-types/EVENT_TYPE.js +2 -1
- package/cjs/zoom-scale/ZoomScaleManager.js +1 -2
- package/dist/vtable-gantt.js +1 -1
- package/dist/vtable-gantt.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/ts-types/EVENT_TYPE.js +2 -1
- package/es/zoom-scale/ZoomScaleManager.js +1 -2
- package/package.json +3 -3
package/cjs/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ import * as tools from './tools';
|
|
|
6
6
|
import * as VRender from './vrender';
|
|
7
7
|
import * as VTable from './vtable';
|
|
8
8
|
import * as plugins from './plugins';
|
|
9
|
-
export declare const version = "1.0.
|
|
9
|
+
export declare const version = "1.0.1";
|
|
10
10
|
export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable, plugins };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,OAAO,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.0.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,OAAO,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.0.1\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
|
package/dist/vtable-gantt.js
CHANGED
|
@@ -76315,7 +76315,7 @@
|
|
|
76315
76315
|
PluginManager: PluginManager
|
|
76316
76316
|
});
|
|
76317
76317
|
|
|
76318
|
-
const version = "1.0.
|
|
76318
|
+
const version = "1.0.1";
|
|
76319
76319
|
|
|
76320
76320
|
exports.Gantt = Gantt;
|
|
76321
76321
|
exports.TYPES = index$4;
|
package/dist/vtable-gantt.min.js
CHANGED
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */let VD=class{time=Ii.beforeFillStroke;useStyle=!0;order=0;supportedAppName="vtable";drawShape(t,e,i,o,n,r,s,a,l,h,d,c,u){"date-header-cell"===t.name&&t.forEachChildren((t=>{if("date-header-cell-text"===t.name&&!0===t.attribute.textStick){const e=t;e.setAttribute("dx",0);const i=e.globalAABBBounds,o=e.stage.globalAABBBounds,n=e.parent.globalAABBBounds,r=o.intersect(n);o.intersect(n)&&(i.width()>=r.width()&&e.attribute.last_dx?e.setAttribute("dx",e.attribute.last_dx??0):o.x1>=i.x1?(e.setAttribute("dx",o.x1-i.x1),e.setAttribute("last_dx",o.x1-i.x1)):o.x2<=i.x2&&(e.setAttribute("dx",o.x2-i.x2),e.setAttribute("last_dx",o.x1-i.x1)))}}))}};VD=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s}([w()],VD);var XD=new l(((t,e,i,o)=>{t(VD).toSelf().inSingletonScope(),t(Nl).toService(VD)}));class YD{_scene;group;lineVertical;lineHorizontal;constructor(t){this._scene=t,this.createAddButton()}createAddButton(){this._scene._gantt.parsedOptions.taskBarCreationCustomLayout?this.group=new fl({x:0,y:0,width:100,height:100}):(this.group=new fl({x:0,y:0,width:100,height:100,lineDash:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineDash,cursor:"pointer",lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,cornerRadius:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.cornerRadius??0,fill:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.backgroundColor}),this.lineVertical=bh({pickable:!1,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,points:[{x:50,y:0},{x:50,y:100}]}),this.group.appendChild(this.lineVertical),this.lineHorizontal=bh({pickable:!1,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,points:[{x:0,y:50},{x:100,y:50}]}),this.group.appendChild(this.lineHorizontal)),this.group.name="task-creation-button",this._scene.taskBar.group.addChild(this.group)}show(t,e,i,o){if(this._scene._gantt.parsedOptions.taskBarCreationCustomLayout)this.group.appendChild(this._scene._gantt.parsedOptions.taskBarCreationCustomLayout({width:i,height:o,ganttInstance:this._scene._gantt}).rootContainer);else{const t=Math.min(i,o)/6;this.lineHorizontal.setAttribute("points",[{x:(i-4*t)/2,y:o/2},{x:(i-4*t)/2+4*t,y:o/2}]),this.lineVertical.setAttribute("points",[{x:i/2,y:(o-4*t)/2},{x:i/2,y:(o-4*t)/2+4*t}])}this.group.setAttribute("x",t),this.group.setAttribute("y",e),this.group.setAttribute("width",i),this.group.setAttribute("height",o),this.group.setAttribute("visibleAll",!0)}hide(){this.group.setAttribute("visibleAll",!1),this._scene._gantt.parsedOptions.taskBarCreationCustomLayout&&this.group.removeAllChild()}}class $D{_scene;group;constructor(t){this._scene=t,this.group=new vy({position:"top",content:"",contentStyle:{fill:"#fff"},visible:!1,panel:{background:"#14161c",cornerRadius:4}}),t.ganttGroup.addChild(this.group)}show(t){const e=this._scene._gantt.parsedOptions.markLineCreateOptions?.markLineCreationHoverToolTip||{},i=t.globalTransMatrix,o=t.attribute.width,n=t.attribute.height;let r,s;const a=e.position||"top";"top"===a?(r=i.e+o/2-2,s=i.f):"bottom"===a&&(r=i.e+o/2-2,s=i.f+n);const l=e.style?.contentStyle||{fill:"#fff"},h=e.style?.panelStyle||{background:"#14161c",cornerRadius:4};this.group.setAttributes({content:e.tipContent,position:a,visibleAll:!0,visible:!0,contentStyle:l,panel:{...h,visible:!0},x:r,y:s})}hide(){this.group.setAttributes({visibleAll:!1,visible:!1})}}class KD{group;linkLinesContainer;_scene;width;height;selectedEffectNodes;constructor(t){this._scene=t,this.width=t._gantt.tableNoFrameWidth,this.height=t._gantt.gridHeight,this.group=new fl({x:0,y:t._gantt.getAllHeaderRowsHeight(),width:this.width,height:this.height,pickable:!1,clip:!0}),this.group.name="dependency-link-container",t.ganttGroup.addChild(this.group),this.initLinkLines()}initLinkLines(){if(OS(this._scene._gantt.records),this.linkLinesContainer=new fl({x:0,y:0,width:this._scene._gantt.getAllDateColsWidth(),height:this._scene._gantt.getAllTaskBarsHeight(),pickable:!1,clip:!0}),this.group.appendChild(this.linkLinesContainer),this._scene._gantt.records?.length)for(let t=0;t<this._scene._gantt.parsedOptions.dependencyLinks.length;t++)this.initLinkLine(t)}initLinkLine(t){const{taskKeyField:e,dependencyLinks:r}=this._scene._gantt.parsedOptions,s=r[t],{linkedToTaskKey:a,linkedFromTaskKey:l,type:h}=s,d=ES(this._scene._gantt.records,e,a),c=ES(this._scene._gantt.records,e,l);if(!d||!c)return;let u,g,p,f,v,m,b,y;if(d.record.vtable_gantt_linkedTo||(d.record.vtable_gantt_linkedTo=[]),d.record.vtable_gantt_linkedTo.push(s),c.record.vtable_gantt_linkedFrom||(c.record.vtable_gantt_linkedFrom=[]),c.record.vtable_gantt_linkedFrom.push(s),this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline)y=c.index[0],b=d.index[0],({startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(d.index[0],d.index[1])),({startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(c.index[0],c.index[1]));else if(this._scene._gantt.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){const t=this._scene._gantt.getTaskShowIndexByRecordIndex(c.index.slice(0,-1)),e=this._scene._gantt.getTaskShowIndexByRecordIndex(d.index.slice(0,-1)),i=this._scene._gantt.getRecordByIndex(t),o=this._scene._gantt.getRecordByIndex(e);y=i.type===n.PROJECT&&"expand"!==i.hierarchyState&&!1!==this._scene._gantt.parsedOptions.projectSubTasksExpandable?t:this._scene._gantt.getTaskShowIndexByRecordIndex(c.index),b=o.type===n.PROJECT&&"expand"!==o.hierarchyState&&!1!==this._scene._gantt.parsedOptions.projectSubTasksExpandable?e:this._scene._gantt.getTaskShowIndexByRecordIndex(d.index),({startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(b,d.index)),({startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(y,c.index))}else if(this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){y=this._scene._gantt.getRowsHeightByIndex(0,c.index[0]-1)/this._scene._gantt.parsedOptions.rowHeight+(this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?c.record.vtable_gantt_showIndex:c.index[1]??0);b=this._scene._gantt.getRowsHeightByIndex(0,d.index[0]-1)/this._scene._gantt.parsedOptions.rowHeight+(this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?d.record.vtable_gantt_showIndex:d.index[1]??0),({startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(d.index[0],d.index[1])),({startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(c.index[0],c.index[1]))}else y=this._scene._gantt.getTaskShowIndexByRecordIndex(c.index),b=this._scene._gantt.getTaskShowIndexByRecordIndex(d.index),({startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(b)),({startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(y));if(!m||!p)return;dS(this._scene._gantt.parsedOptions.minDate);const{arrowPoints:C,linePoints:w}=function(t,e,o,n,r,s,a,l,h,d,c,u){const{unit:g,step:p}=u.parsedOptions.reverseSortedTimelineScales[0],{minDate:f,rowHeight:v,timelineColWidth:m}=u.parsedOptions,b=u.parsedOptions.taskBarMilestoneHypotenuse,y=u.parsedOptions.dependencyLinkDistanceToTaskBar??20,C=10,w=5;let x=[],_=[];if(t===i.FinishToStart){let t=mS(o,f,g,p,1)*m;s&&(t=mS(e,f,g,p,1)*m+b/2);let i=mS(a,f,g,p)*m;c&&(i-=b/2),x=[{x:t,y:v*(n+.5)},{x:t+y,y:v*(n+.5)},{x:t+y,y:v*(n+(n>h?0:1))},{x:i-y,y:v*(n+(n>h?0:1))},{x:i-y,y:v*(h+.5)},{x:i,y:v*(h+.5)}],t+y<=i-y&&x.splice(2,3,{x:t+y,y:v*(h+.5)});const r=x[x.length-1];_=[{x:r.x,y:r.y},{x:r.x-C,y:r.y-w},{x:r.x-C,y:r.y+w},{x:r.x,y:r.y}]}else if(t===i.StartToFinish){let t=mS(e,f,g,p)*m;s&&(t-=b/2);let i=mS(l,f,g,p,1)*m;c&&(i=mS(a,f,g,p,1)*m+b/2),x=[{x:t,y:v*(n+.5)},{x:t-y,y:v*(n+.5)},{x:t-y,y:v*(n+(n>h?0:1))},{x:i+y,y:v*(n+(n>h?0:1))},{x:i+y,y:v*(h+.5)},{x:i,y:v*(h+.5)}],t-y>=i+y&&x.splice(2,3,{x:t-y,y:v*(h+.5)});const o=x[x.length-1];_=[{x:o.x,y:o.y},{x:o.x+C,y:o.y-w},{x:o.x+C,y:o.y+w},{x:o.x,y:o.y}]}else if(t===i.StartToStart){let t=mS(e,f,g,p)*m;s&&(t-=b/2);let i=mS(a,f,g,p)*m;c&&(i-=b/2),x=[{x:t,y:v*(n+.5)},{x:(n===h?t:Math.min(t,i))-y,y:v*(n+.5)},{x:(n===h?t:Math.min(t,i))-y,y:v*(h+(n===h?1:.5))},{x:i-y,y:v*(h+(n===h?1:.5))},{x:(n===h?i:Math.min(t,i))-y,y:v*(h+.5)},{x:i,y:v*(h+.5)}];const o=x[x.length-1];_=[{x:o.x,y:o.y},{x:o.x-C,y:o.y-w},{x:o.x-C,y:o.y+w},{x:o.x,y:o.y}]}else if(t===i.FinishToFinish){let t=mS(o,f,g,p,1)*m;s&&(t=mS(e,f,g,p,1)*m+b/2);let i=mS(l,f,g,p,1)*m;c&&(i=mS(a,f,g,p,1)*m+b/2),x=[{x:t,y:v*(n+.5)},{x:(n===h?t:Math.max(t,i))+y,y:v*(n+.5)},{x:(n===h?t:Math.max(t,i))+y,y:v*(h+(n===h?1:.5))},{x:i+y,y:v*(h+(n===h?1:.5))},{x:i+y,y:v*(h+.5)},{x:i,y:v*(h+.5)}];const r=x[x.length-1];_=[{x:r.x,y:r.y},{x:r.x+C,y:r.y-w},{x:r.x+C,y:r.y+w},{x:r.x,y:r.y}]}return{linePoints:x,arrowPoints:_}}(h,f,v,y,0,c.record.type===n.MILESTONE,u,g,b,0,d.record.type===n.MILESTONE,this._scene._gantt),x=this._scene._gantt.parsedOptions.dependencyLinkLineStyle,_=bh({pickable:!0,stroke:s.linkLineStyle?.lineColor??x.lineColor,lineWidth:s.linkLineStyle?.lineWidth??x.lineWidth,lineDash:s.linkLineStyle?.lineDash??x.lineDash,points:w,pickStrokeBuffer:3,vtable_link:s});this.linkLinesContainer.appendChild(_),s.vtable_gantt_linkLineNode=_;const S=new Vh({fill:s.linkLineStyle?.lineColor??x.lineColor,points:C});this.linkLinesContainer.appendChild(S),s.vtable_gantt_linkArrowNode=S}setX(t){this.linkLinesContainer.setAttribute("x",t)}setY(t){this.linkLinesContainer.setAttribute("y",t)}refresh(){this.width=this._scene._gantt.tableNoFrameWidth,this.height=this._scene._gantt.gridHeight,this.group.setAttributes({height:this.height,width:this.width,y:this._scene._gantt.getAllHeaderRowsHeight()});const t=this.linkLinesContainer.attribute.x,e=this.linkLinesContainer.attribute.y;this.linkLinesContainer.removeAllChild(),this.group.removeChild(this.linkLinesContainer),this.initLinkLines(),this.setX(t),this.setY(e)}resize(){this.width=this._scene._gantt.tableNoFrameWidth,this.height=this._scene._gantt.gridHeight,this.group.setAttribute("width",this.width),this.group.setAttribute("height",this.height)}createSelectedLinkLine(t){const e=t.vtable_gantt_linkLineNode,i=t.vtable_gantt_linkArrowNode,o=e.clone(),n=i.clone();o.setAttribute("stroke",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineColor),o.setAttribute("lineWidth",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineWidth),o.setAttribute("shadowColor",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowColor),o.setAttribute("shadowOffsetX",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowOffset),o.setAttribute("shadowOffsetY",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowOffset),o.setAttribute("shadowBlur",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowBlur),this.linkLinesContainer.appendChild(o),n.setAttribute("fill",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineColor),this.linkLinesContainer.appendChild(n),this.selectedEffectNodes=[o,n]}removeSelectedLinkLine(){this.selectedEffectNodes?.forEach((t=>{t.delete()})),this.selectedEffectNodes=[]}deleteLink(t){const e=t.vtable_gantt_linkLineNode,i=t.vtable_gantt_linkArrowNode;e.delete(),i.delete()}}function ZD(t,e,o,n,r,s,a,l,h,d,c,u,g,p,f,v){const{unit:m,step:b}=v.parsedOptions.reverseSortedTimelineScales[0],{minDate:y,rowHeight:C,timelineColWidth:w}=v.parsedOptions,x=v.parsedOptions.taskBarMilestoneHypotenuse,_=v.parsedOptions.taskBarMilestoneStyle.width,S=v.parsedOptions.dependencyLinkDistanceToTaskBar??20,A=10;let T=[],B=[];if(t===i.FinishToStart){let t=a?a.attribute.x+a.attribute.width:mS(o,y,m,b,1)*w;s&&(t=a?a.attribute.x+a.attribute.width+(x-_)/2:mS(e,y,m,b,1)*w+x/2);let i=p?p.attribute.x:mS(h,y,m,b)*w;g&&(i-=(x-_)/2),T=[{x:t,y:C*(n+.5)+l},{x:t+S,y:C*(n+.5)+l},{x:t+S,y:C*(n+(n>c?0:1))+l},{x:i-S,y:C*(n+(n>c?0:1))+l},{x:i-S,y:C*(c+.5)+f},{x:i,y:C*(c+.5)+f}],t+S<=i-S&&T.splice(2,3,{x:t+S,y:C*(c+.5)+f});const r=T[T.length-1];B=[{x:r.x,y:r.y},{x:r.x-A,y:r.y-5},{x:r.x-A,y:r.y+5},{x:r.x,y:r.y}]}else if(t===i.StartToFinish){let t=a?a.attribute.x:mS(e,y,m,b)*w;s&&(t-=(x-_)/2);let i=p?p.attribute.x+p.attribute.width:mS(d,y,m,b,1)*w;g&&(i=p?p.attribute.x+p.attribute.width+(x-_)/2:mS(h,y,m,b,1)*w+x/2),T=[{x:t,y:C*(n+.5)+l},{x:t-S,y:C*(n+.5)+l},{x:t-S,y:C*(n+(n>c?0:1))+l},{x:i+S,y:C*(n+(n>c?0:1))+l},{x:i+S,y:C*(c+.5)+f},{x:i,y:C*(c+.5)+f}],t-S>=i+S&&T.splice(2,3,{x:t-S,y:C*(c+.5)+f});const o=T[T.length-1];B=[{x:o.x,y:o.y},{x:o.x+A,y:o.y-5},{x:o.x+A,y:o.y+5},{x:o.x,y:o.y}]}else if(t===i.StartToStart){let t=a?a.attribute.x:mS(e,y,m,b)*w;s&&(t-=(x-_)/2);let i=p?p.attribute.x:mS(h,y,m,b)*w;g&&(i-=(x-_)/2),T=[{x:t,y:C*(n+.5)+l},{x:(n===c?t:Math.min(t,i))-S,y:C*(n+.5)+l},{x:(n===c?t:Math.min(t,i))-S,y:C*(c+(n===c?1:.5))+f},{x:i-S,y:C*(c+(n===c?1:.5))+f},{x:(n===c?i:Math.min(t,i))-S,y:C*(c+.5)+f},{x:i,y:C*(c+.5)+f}];const o=T[T.length-1];B=[{x:o.x,y:o.y},{x:o.x-A,y:o.y-5},{x:o.x-A,y:o.y+5},{x:o.x,y:o.y}]}else if(t===i.FinishToFinish){let t=a?a.attribute.x+a.attribute.width:mS(o,y,m,b,1)*w;s&&(t=a?a.attribute.x+a.attribute.width+(x-_)/2:mS(e,y,m,b,1)*w+x/2);let i=p?p.attribute.x+p.attribute.width:mS(d,y,m,b,1)*w;g&&(i=p?p.attribute.x+p.attribute.width+(x-_)/2:mS(h,y,m,b,1)*w+x/2),T=[{x:t,y:C*(n+.5)+l},{x:(n===c?t:Math.max(t,i))+S,y:C*(n+.5)+l},{x:(n===c?t:Math.max(t,i))+S,y:C*(c+(n===c?1:.5))+f},{x:i+S,y:C*(c+(n===c?1:.5))+f},{x:i+S,y:C*(c+.5)+f},{x:i,y:C*(c+.5)+f}];const r=T[T.length-1];B=[{x:r.x,y:r.y},{x:r.x+A,y:r.y-5},{x:r.x+A,y:r.y+5},{x:r.x,y:r.y}]}return{linePoints:T,arrowPoints:B}}class qD{_scene;dragLineContainer;dragLine;constructor(t){this._scene=t,this.dragLineContainer=new fl({x:0,y:0,width:t._gantt.tableNoFrameWidth,height:Math.min(t._gantt.tableNoFrameHeight,t._gantt.drawHeight),pickable:!1,clip:!0,visible:!1}),this.dragLineContainer.name="drag-order-line-container",t.ganttGroup.addChild(this.dragLineContainer),this.initDragLine()}initDragLine(){if(this._scene._gantt.taskListTableInstance){const t=this._scene._gantt.taskListTableInstance.theme.dragHeaderSplitLine,e=bh({pickable:!1,stroke:"function"==typeof t.lineColor?t.lineColor({}):t.lineColor,lineWidth:t.lineWidth,points:[]});this.dragLine=e,this.dragLineContainer.appendChild(e)}}showDragLine(t){this.dragLineContainer.showAll(),this.dragLine.setAttribute("points",[{x:0,y:t},{x:this._scene._gantt.tableNoFrameWidth,y:t}])}hideDragLine(){this.dragLineContainer.hideAll()}}V.load(XD);class JD{dateStepWidth;rowHeight;_scales;timelineHeader;grid;dependencyLink;taskBar;_gantt;ganttGroup;scrollbarComponent;markLine;dragOrderLine;frameBorder;taskCreationButton;toolTip;stage;tableGroupWidth;tableGroupHeight;constructor(t){let e,i;this._gantt=t,this.tableGroupWidth=t.tableNoFrameWidth,this.tableGroupHeight=Math.min(t.tableNoFrameHeight,t.drawHeight),"node"===yS.mode||(ng.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Cg({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.parsedOptions.underlayBackgroundColor,enableLayout:!0,autoRender:!1,context:{appName:"vtable"},pluginList:["poptipForText"]}),this.stage.gantt=this._gantt,this.stage.table=this._gantt,this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph()}initSceneGraph(){const t=this;t.ganttGroup=new fl({x:t._gantt.tableX,y:t._gantt.tableY,width:this.tableGroupWidth,height:this.tableGroupHeight,clip:!0,pickable:!1}),t.stage.defaultLayer.add(t.ganttGroup),t.ganttGroup.name="table",t.timelineHeader=new NS(t),t.grid=new bS(t),t.dependencyLink=new KD(t),t.taskBar=new GD(t),t.markLine=new jD(t),t.toolTip=new $D(t),t.frameBorder=new UD(t),t.scrollbarComponent=new CS(t._gantt),t.stage.defaultLayer.addChild(t.scrollbarComponent.hScrollBar),t.stage.defaultLayer.addChild(t.scrollbarComponent.vScrollBar),t.dragOrderLine=new qD(t)}updateSceneGraph(){const t=this._gantt;let e,i;this.tableGroupWidth=t.tableNoFrameWidth,this.tableGroupHeight=Math.min(t.tableNoFrameHeight,t.drawHeight),"node"===yS.mode||(ng.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage.resize(e,i),this.refreshAll()}afterCreateSceneGraph(){this.scrollbarComponent.updateScrollBar(),function(t){const i=t._gantt,o=i.stateManager,n=i.scenegraph;n.scrollbarComponent.vScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.vScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0})),n.scrollbarComponent.vScrollBar.addEventListener("pointerup",(()=>{n._gantt.eventManager.isDraging=!1,o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1})),n.scrollbarComponent.hScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerup",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1}));const r=tS(o.updateVerticalScrollBar,20),s=tS(o.updateHorizontalScrollBar,20);n.scrollbarComponent.vScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(i,t)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.fastScrolling=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);s(i)}))}(this._gantt.eventManager)}refreshAll(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroupWidth=this._gantt.tableNoFrameWidth,this.ganttGroup.setAttribute("height",this.tableGroupHeight),this.ganttGroup.setAttribute("width",this.tableGroupWidth),this.timelineHeader.refresh(),this.grid.refresh(),this.taskBar.refresh(),this.dependencyLink.refresh(),this.markLine.refresh(),this.dependencyLink.refresh(),this.frameBorder.refresh(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}refreshTaskBars(){this.dependencyLink.refresh(),this.taskBar.refresh(),this.updateNextFrame()}refreshTaskBarsAndGrid(){this._gantt.verticalSplitResizeLine.style.height=this._gantt.drawHeight+"px",this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.ganttGroup.setAttribute("height",this.tableGroupHeight),this.grid.refresh(),this.taskBar.refresh(),this.dependencyLink.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}updateTableSize(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroupWidth=this._gantt.tableNoFrameWidth,this.ganttGroup.setAttributes({x:this._gantt.tableX,y:this._gantt.tableY,width:this._gantt.tableNoFrameWidth,height:this.tableGroupHeight}),this.grid.resize(),this.taskBar.resize(),this.dependencyLink.resize(),this.markLine.refresh(),this.frameBorder.resize()}updateStageBackground(){this.stage.background=this._gantt.parsedOptions.underlayBackgroundColor,this.updateNextFrame()}renderSceneGraph(){this.stage.render()}updateNextFrame(){this.stage.renderNextFrame()}get width(){return this.ganttGroup.attribute?.width??0}get height(){return this.ganttGroup.attribute?.height??0}get x(){return this.ganttGroup.attribute?.x??0}get y(){return this.ganttGroup.attribute?.y??0}setX(t,e=!1){this.timelineHeader.setX(t),this.grid.setX(t),this.taskBar.setX(t),this.dependencyLink.setX(t),this.markLine.setX(t),this.updateNextFrame()}setY(t,e=!1){this.grid.setY(t),this.taskBar.setY(t),this.dependencyLink.setY(t),this.updateNextFrame()}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}resize(){this.updateTableSize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}release(){this.stage.release()}showTaskCreationButton(t,e,i){this.taskCreationButton||(this.taskCreationButton=new YD(this._gantt.scenegraph));const o=this._gantt.parsedOptions.taskBarCreationMaxWidth,n=this._gantt.parsedOptions.taskBarCreationMinWidth,r=this._gantt.getDateColWidth(i),s=o?Math.min(o,n?Math.max(n,r):r):n?Math.max(n,r):r,a=t-(s-r)/2;this.taskCreationButton.show(a,e,s,this._gantt.parsedOptions.rowHeight),this.updateNextFrame()}hideTaskCreationButton(){this.taskCreationButton&&(this.taskCreationButton.hide(),this.updateNextFrame())}showToolTip(t){this.toolTip||(this.toolTip=new $D(this._gantt.scenegraph)),this.toolTip.show(t)}hideToolTip(){this.toolTip.hide()}refreshRecordLinkNodes(t,e,i,r=0){const s=this._gantt,a=s.getRecordByIndex(t,e),l=a.vtable_gantt_linkedTo,h=a.vtable_gantt_linkedFrom;for(let a=0;a<l?.length;a++){const h=l[a],d=h.vtable_gantt_linkLineNode,c=h.vtable_gantt_linkArrowNode,{linkedToTaskKey:u,linkedFromTaskKey:g,type:p}=h,{taskKeyField:f,minDate:v}=s.parsedOptions,m=ES(s.records,f,g),b=ES(s.records,f,u);let y,C,w,x,_,S,A,T,B;const R=this._gantt.getTaskBarStyle(t,e);if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline){const t=IS(i.attribute.y+r,s);T=m.index[0];A=s.getRowsHeightByIndex(0,t.task_index-1)/s.parsedOptions.rowHeight,({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(b.index[0],b.index[1])),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(m.index[0],m.index[1]));const e=R.width;B=i.attribute.y+e/2-(A+.5)*s.parsedOptions.rowHeight}else if(s.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){const t=s.getTaskShowIndexByRecordIndex(m.index.slice(0,-1)),e=s.getTaskShowIndexByRecordIndex(b.index.slice(0,-1)),i=s.getRecordByIndex(t),o=s.getRecordByIndex(e);T=i.type===n.PROJECT&&"expand"!==i.hierarchyState&&!1!==s.parsedOptions.projectSubTasksExpandable?t:s.getTaskShowIndexByRecordIndex(m.index),A=o.type===n.PROJECT&&"expand"!==o.hierarchyState&&!1!==s.parsedOptions.projectSubTasksExpandable?e:s.getTaskShowIndexByRecordIndex(b.index),({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(A,b.index)),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(T,m.index))}else if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){const t=IS(i.attribute.y+r,s);T=s.getRowsHeightByIndex(0,m.index[0]-1)/s.parsedOptions.rowHeight+(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?m.record.vtable_gantt_showIndex:m.index[1]);A=s.getRowsHeightByIndex(0,t.task_index-1)/s.parsedOptions.rowHeight+(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?b.record.vtable_gantt_showIndex:t.sub_task_index),({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(b.index[0],b.index[1])),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(m.index[0],m.index[1]));const e=R.width;B=i.attribute.y+e/2-(A+.5)*s.parsedOptions.rowHeight}else{if(T=s.getTaskShowIndexByRecordIndex(m.index),A=s.getTaskShowIndexByRecordIndex(b.index),-1===T||-1===A)continue;({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(A)),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(T))}if(!(x&&_&&y&&C&&d&&c))return;const{linePoints:M,arrowPoints:k}=ZD(p,x,_,T,0,m.record.type===n.MILESTONE,null,0,y,C,A,0,b.record.type===n.MILESTONE,i,B??0,this._gantt);d.setAttribute("points",M),c.setAttribute("points",k)}for(let a=0;a<h?.length;a++){const l=h[a],d=l.vtable_gantt_linkLineNode,c=l.vtable_gantt_linkArrowNode,{linkedToTaskKey:u,linkedFromTaskKey:g,type:p}=l,{taskKeyField:f,minDate:v}=s.parsedOptions,m=ES(s.records,f,u),b=ES(s.records,f,g);let y,C,w,x,_,S,A,T,B;const R=this._gantt.getTaskBarStyle(t,e);if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline){const t=IS(i.attribute.y+r,s);T=s.getRowsHeightByIndex(0,t.task_index-1)/s.parsedOptions.rowHeight,A=m.index[0],({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(m.index[0],m.index[1])),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(b.index[0],b.index[1]));const e=R.width;B=i.attribute.y+e/2-(T+.5)*s.parsedOptions.rowHeight}else if(s.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){const t=s.getTaskShowIndexByRecordIndex(b.index.slice(0,-1)),e=s.getTaskShowIndexByRecordIndex(m.index.slice(0,-1)),i=s.getRecordByIndex(t),o=s.getRecordByIndex(e);T=i.type===n.PROJECT&&"expand"!==i.hierarchyState&&!1!==s.parsedOptions.projectSubTasksExpandable?t:s.getTaskShowIndexByRecordIndex(b.index),A=o.type===n.PROJECT&&"expand"!==o.hierarchyState&&!1!==s.parsedOptions.projectSubTasksExpandable?e:s.getTaskShowIndexByRecordIndex(m.index),({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(A,m.index)),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(T,b.index))}else if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){const t=IS(i.attribute.y+r,s);T=s.getRowsHeightByIndex(0,t.task_index-1)/s.parsedOptions.rowHeight+(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?b.record.vtable_gantt_showIndex:t.sub_task_index);A=s.getRowsHeightByIndex(0,m.index[0]-1)/s.parsedOptions.rowHeight+(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?m.record.vtable_gantt_showIndex:m.index[1]),({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(m.index[0],m.index[1])),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(b.index[0],b.index[1]));const e=R.width;B=i.attribute.y+e/2-(T+.5)*s.parsedOptions.rowHeight}else{if(T=s.getTaskShowIndexByRecordIndex(b.index),A=s.getTaskShowIndexByRecordIndex(m.index),-1===T||-1===A)continue;({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(A)),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(T))}if(!(x&&_&&y&&C&&d&&c))return;const{linePoints:M,arrowPoints:k}=ZD(p,x,_,T,0,b.record.type===n.MILESTONE,i,B??0,y,C,A,0,m.record.type===n.MILESTONE,null,0,this._gantt);d.setAttribute("points",M),c.setAttribute("points",k)}}}const QD=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function tW(t,e,i){let o,n,r,s,a,l,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof ng.getRequestAnimationFrame();if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return n=void 0,o=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?ng.getRequestAnimationFrame()(t):setTimeout(t,e)}function v(t){const i=t-l;return void 0===l||i>=e||i<0||d&&t-h>=r}function m(){const t=Date.now();if(v(t))return function(t){return a=void 0,u&&o?p(t):(n=void 0,o=void 0,s)}(t);a=f(m,function(t){const i=t-h,o=e&&-(t-l);return d?Math.min(o,r-i):o}(t))}return e=+e||0,QD(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(r=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(...t){const i=Date.now(),r=v(i);if(o=t,n=this,l=i,r){if(void 0===a)return function(t){return h=t,a=f(m,e),c?p(t):s}(l);if(d)return a=f(m,e),p(l)}return void 0===a&&(a=f(m,e)),s}}let eW=1;class iW{resizeTime;listeners={};reseizeListeners={};on(t,e,i,...o){if("node"===yS.mode)return-1;const n=eW++;if(t?.addEventListener)if("resize"!==e||t===window)t?.addEventListener(e,i,...o);else{const e=new class{resizeTime=100;element;cb;observer;lastSize={width:0,height:0};callBackDebounce;constructor(t,e,i){if(this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=tW(this.callBack,this.resizeTime),window?.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),this.observer?.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}mutationResize=()=>{this.onResize()};disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb({...this.lastSize,windowSizeNotChange:e})};setSize(t){this.lastSize=t}onResize=()=>{this.callBackDebounce()};checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:{...this.lastSize}}}(t,i,this.resizeTime);this.reseizeListeners[n]=e}const r={target:t,type:e,listener:i,options:o};return this.listeners[n]=r,n}once(t,e,i,...o){if("node"===yS.mode)return-1;const n=this.on(t,e,((...t)=>{this.off(n),i(...t)}),...o);return n}off(t){if("node"===yS.mode)return;if(null==t)return;const e=this.listeners?.[t];e&&(delete this.listeners[t],e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options))}fire(t,e,...i){if("node"!==yS.mode)for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&n.listener.call(n.target,...i)}}hasListener(t,e){if("node"===yS.mode)return!1;let i=!1;for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&(i=!0)}return i}clear(){if("node"!==yS.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];e?.disConnect()}this.listeners={}}}release(){"node"!==yS.mode&&(this.clear(),this.listeners={})}}let oW=1;function nW(){return AS?oW=1:(oW=Math.ceil(window.devicePixelRatio||1),oW>1&&oW%2!=0&&(oW+=1)),oW}function rW(t){return!!t.changedTouches}nW();class sW{friction;lastTime;speedX;speedY;runingId;stopped;scrollHandle;constructor(){}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.stopped=!1,this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=ng.getRequestAnimationFrame()(this.inertia.bind(this)))}inertia(){if(this.stopped)return;const t=Date.now(),e=t-this.lastTime;let i=!0;const o=Math.pow(this.friction,e/16),n=o*this.speedX,r=o*this.speedY;let s=0,a=0;Math.abs(n)>.05&&(i=!1,s=(this.speedX+n)/2*e),Math.abs(r)>.05&&(i=!1,a=(this.speedY+r)/2*e),this.scrollHandle?.(s,a),i?this.runingId=null:(this.lastTime=t,this.speedX=n,this.speedY=r,this.runingId=ng.getRequestAnimationFrame()(this.inertia.bind(this)))}endInertia(){ng.getCancelAnimationFrame()(this.runingId),this.runingId=null,this.stopped=!0}isInertiaScrolling(){return!!this.runingId}}class aW{_gantt;_eventHandler;isDown=!1;isDraging=!1;lastDragPointerXYOnWindow;globalEventListeners=[];poniterState;isTouchdown;isTouchMove;isLongTouch;touchMovePoints;touchSetTimeout;touchEnd;_enableTableScroll=!0;inertiaScroll;constructor(t){this._gantt=t,this.inertiaScroll=new sW,this._eventHandler=new iW,this.bindEvent()}release(){this._eventHandler.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[],this.inertiaScroll.endInertia()}bindEvent(){!function(t){const i=t._gantt.scenegraph,s=t._gantt,a=s.stateManager;i.ganttGroup.addEventListener("pointerdown",(o=>{if(0!==o.button)return;let r,l,h;if(o.detailPath.find((t=>"task-bar"===t.name?(r=t,!0):"task-creation-button"===t.name||("task-bar-link-point-left"===t.name?(l=t,!0):"task-bar-link-point-right"===t.name?(h=t,!0):!!t.attribute.vtable_link&&(t.attribute.vtable_link,!0)))),r){const l=r.record;if(!(l?.type===n.PROJECT))if("task-bar-hover-shadow-left-icon"===o.target.name)a.startResizeTaskBar(r,o.nativeEvent.x,o.nativeEvent.y,o.offset.y,"left"),a.updateInteractionState(e.grabing);else if("task-bar-hover-shadow-right-icon"===o.target.name)a.startResizeTaskBar(r,o.nativeEvent.x,o.nativeEvent.y,o.offset.y,"right"),a.updateInteractionState(e.grabing);else if("task-bar-progress-handle"===o.target.name)a.startAdjustProgressBar(r,o.nativeEvent.x,o.nativeEvent.y),a.updateInteractionState(e.grabing);else if(s.parsedOptions.taskBarMoveable){const n=()=>{let t=!0;if("function"==typeof s.parsedOptions.taskBarMoveable){const{startDate:e,endDate:o,taskRecord:n}=i._gantt.getTaskInfoByTaskListIndex(r.task_index,r.sub_task_index),a={index:r.task_index,startDate:e,endDate:o,taskRecord:n,ganttInstance:i._gantt};t=s.parsedOptions.taskBarMoveable(a)}else t=s.parsedOptions.taskBarMoveable;t&&(a.startMoveTaskBar(r,o.nativeEvent.x,o.nativeEvent.y,o.offset.y),a.updateInteractionState(e.grabing))};"touch"===o.pointerType?(t.touchEnd=!1,t.touchSetTimeout=setTimeout((()=>{t.isTouchdown=!1,t.isLongTouch=!0,n()}),100)):n()}}else l?(a.startCreateDependencyLine(l,o.nativeEvent.x,o.nativeEvent.y,o.offset.y,"left"),a.updateInteractionState(e.grabing)):h&&(a.startCreateDependencyLine(h,o.nativeEvent.x,o.nativeEvent.y,o.offset.y,"right"),a.updateInteractionState(e.grabing))})),i.ganttGroup.addEventListener("pointermove",(l=>{if(t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0),a.interactionState===e.default){const t=l.detailPath.find((t=>"task-bar"===t.name)),e=l.detailPath.find((t=>"markline-hover-group"===t.name)),h=l.detailPath.find((t=>"mark-line-content"===t.name));if(s.parsedOptions.markLineCreateOptions?.markLineCreatable&&(e&&!function(t,e){const i=t.startDate.getTime(),o=t.endDate.getTime();return e.some((t=>{const e=new Date(t.date).getTime();return e>=i&&e<=o}))}(e.data,s.parsedOptions.markLine)?i._gantt.stateManager.marklineIcon.target!==e&&(i._gantt.stateManager.marklineIcon.target=e,a.showMarklineIconHover()):i._gantt.stateManager.marklineIcon.target&&a.hideMarklineIconHover()),t){const e=t;if(i._gantt.stateManager.hoverTaskBar.target!==e){i._gantt.stateManager.hoverTaskBar.target=e;const t=e.task_index,o=e.sub_task_index,s=e.record;s.type!==n.PROJECT&&a.showTaskBarHover(),i._gantt.hasListeners(r.MOUSEENTER_TASK_BAR)&&i._gantt.fireListeners(r.MOUSEENTER_TASK_BAR,{federatedEvent:l,event:l.nativeEvent,index:t,sub_task_index:o,record:s})}}else{if(i._gantt.stateManager.hoverTaskBar.target){if(i._gantt.hasListeners(r.MOUSELEAVE_TASK_BAR)){const t=i._gantt.stateManager.hoverTaskBar.target.task_index,e=i._gantt.stateManager.hoverTaskBar.target.sub_task_index,o=i._gantt.getRecordByIndex(t,e);i._gantt.fireListeners(r.MOUSELEAVE_TASK_BAR,{federatedEvent:l,event:l.nativeEvent,index:t,sub_task_index:e,record:o})}a.hideTaskBarHover(l)}if(s.parsedOptions.taskBarCreatable&&!h){const t=IS(l.offset.y-s.headerHeight+s.stateManager.scrollTop,s),e=s.getTaskInfoByTaskListIndex(t.task_index,t.sub_task_index);let i=!0;if("function"==typeof s.parsedOptions.taskBarCreatable){const{startDate:o,endDate:n,taskRecord:r}=e,a={index:t.task_index,sub_task_index:t.sub_task_index,startDate:o,endDate:n,taskRecord:r,ganttInstance:s};i=s.parsedOptions.taskBarCreatable(a)}else i=s.parsedOptions.taskBarCreatable;if(i){const i=function(t,e,i){const r=IS(e-i.headerHeight+i.stateManager.scrollTop,i),s=i.getRecordByIndex(r.task_index),a=BS(t,i),l=i.getDateRangeByIndex(a);if(s?.children){const t=IS(e-i.headerHeight+i.stateManager.scrollTop,i);for(let e=0;e<s.children.length;e++){const{startDate:r,endDate:a,taskDays:h,progress:d,taskRecord:c}=i.getTaskInfoByTaskListIndex(t.task_index,e);if(((i.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact||i.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange)&&c.vtable_gantt_showIndex===t.sub_task_index||i.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||i.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline&&s.type===n.PROJECT&&"expand"!==s.hierarchyState&&!1!==i.parsedOptions.projectSubTasksExpandable)&&r&&a&&l.startDate.getTime()>=r.getTime()&&l.endDate.getTime()<=a.getTime())return{startDate:r,endDate:a,taskDays:h,progress:d,taskRecord:c}}}}(l.offset.x,l.offset.y,s);if((s.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||s.parsedOptions.tasksShowMode===o.Tasks_Separate)&&!e.taskDays&&e.taskRecord&&!e.taskRecord.vtableMerge||(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact)&&!i){const e=BS(l.offset.x,s),i=(e>=1?s.getDateColsWidth(0,e-1):0)-s.stateManager.scroll.horizontalBarPos,o=s.taskListTableInstance.getRowsHeight(s.taskListTableInstance.columnHeaderLevelCount,t.task_index+s.taskListTableInstance.columnHeaderLevelCount-1)+(t.sub_task_index??0)*s.parsedOptions.rowHeight-s.stateManager.scroll.verticalBarPos;return void s.scenegraph.showTaskCreationButton(i,o,e)}}}}s.scenegraph.hideTaskCreationButton()}else if(a.interactionState===e.grabing){let t,e,o;l.detailPath.find((i=>"task-bar"===i.name?(t=i,!0):"task-creation-button"===i.name||("task-bar-link-point-left"===i.name?(e=i,!0):"task-bar-link-point-right"===i.name?(o=i,!0):!!i.attribute.vtable_link&&(i.attribute.vtable_link,!0)))),e&&e.parent&&(t=t??e.parent.attribute?.attachedToTaskBarNode),o&&o.parent&&(t=t??o.parent.attribute?.attachedToTaskBarNode),i._gantt.stateManager.isCreatingDependencyLine()&&!t?a.hideSecondTaskBarSelectedBorder():i._gantt.stateManager.isCreatingDependencyLine()&&e&&i._gantt.stateManager.selectedTaskBar.target!==t?(a.highlightLinkPointNode(e),a.creatingDenpendencyLink.lastHighLightLinkPoint=e,a.creatingDenpendencyLink.secondTaskBarPosition="left"):i._gantt.stateManager.isCreatingDependencyLine()&&o&&i._gantt.stateManager.selectedTaskBar.target!==t?(a.highlightLinkPointNode(o),a.creatingDenpendencyLink.lastHighLightLinkPoint=o,a.creatingDenpendencyLink.secondTaskBarPosition="right"):i._gantt.stateManager.isCreatingDependencyLine()&&t&&i._gantt.stateManager.selectedTaskBar.target!==t&&(a.unhighlightLinkPointNode(a.creatingDenpendencyLink.lastHighLightLinkPoint),a.creatingDenpendencyLink.secondTaskBarNode&&a.creatingDenpendencyLink.secondTaskBarNode===t||(a.creatingDenpendencyLink.secondTaskBarNode&&a.creatingDenpendencyLink.secondTaskBarNode!==t&&a.hideSecondTaskBarSelectedBorder(),a.creatingDenpendencyLink.secondTaskBarNode=t,a.showSecondTaskBarSelectedBorder()))}})),i.ganttGroup.addEventListener("pointerup",(e=>{if(t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0),0===e.button){let n,l,h,d=!1,c=!1,u=!1,g=!1,p=!1,f=!1,v=!1;const m=e.detailPath.find((t=>"task-bar"===t.name?(d=!0,!0):"task-creation-button"===t.name?(c=!0,!1):"task-bar-link-point-left"===t.name?(g=!0,!1):"task-bar-link-point-right"===t.name?(p=!0,!1):t.attribute.vtable_link?(u=!0,n=t.attribute.vtable_link,!1):"markline-hover-group"===t.name?(f=!0,h=t,!1):"mark-line-content"===t.name&&(v=!0,l=t,!1)));if(d&&i._gantt.parsedOptions.taskBarSelectable&&"down"===t.poniterState){a.hideDependencyLinkSelectedLine();const t=m;if(a.showTaskBarSelectedBorder(t),s.hasListeners(r.CLICK_TASK_BAR)){const i=t.task_index,o=t.sub_task_index,n=s.getRecordByIndex(i,o);s.fireListeners(r.CLICK_TASK_BAR,{federatedEvent:e,event:e.nativeEvent,index:i,sub_task_index:o,record:n})}}else if(c&&"down"===t.poniterState){a.hideDependencyLinkSelectedLine(),a.hideTaskBarSelectedBorder();const t=IS(e.offset.y-s.headerHeight+s.stateManager.scrollTop,s);if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){if(s.hasListeners(r.CREATE_TASK_SCHEDULE)){const i=BS(e.offset.x,s),o=s.getDateRangeByIndex(i),n=s.parsedOptions.dateFormat??(s.parsedOptions.timeScaleIncludeHour?"yyyy-mm-dd hh:mm:ss":"yyyy-mm-dd");s.fireListeners(r.CREATE_TASK_SCHEDULE,{federatedEvent:e,event:e.nativeEvent,index:t.task_index,sub_task_index:t.sub_task_index,startDate:eS(o.startDate,n),endDate:eS(o.endDate,n),record:void 0,parentRecord:s.getRecordByIndex(t.task_index)})}}else{const i=s.getTaskInfoByTaskListIndex(t.task_index,t.sub_task_index);if(i.taskRecord){const o=s.parsedOptions.dateFormat??(s.parsedOptions.timeScaleIncludeHour?"yyyy-mm-dd hh:mm:ss":"yyyy-mm-dd"),n=BS(e.offset.x,s),a=s.getDateRangeByIndex(n);i.taskRecord[s.parsedOptions.startDateField]=eS(a.startDate,o),i.taskRecord[s.parsedOptions.endDateField]=eS(a.endDate,o),s.scenegraph.hideTaskCreationButton(),s.updateTaskRecord(i.taskRecord,t.task_index,t.sub_task_index),s.hasListeners(r.CREATE_TASK_SCHEDULE)&&s.fireListeners(r.CREATE_TASK_SCHEDULE,{federatedEvent:e,event:e.nativeEvent,index:t.task_index,sub_task_index:t.sub_task_index,startDate:i.taskRecord[s.parsedOptions.startDateField],endDate:i.taskRecord[s.parsedOptions.endDateField],record:i.taskRecord})}}}else if(u&&i._gantt.parsedOptions.dependencyLinkSelectable&&"down"===t.poniterState)a.hideDependencyLinkSelectedLine(),a.hideTaskBarSelectedBorder(),i._gantt.stateManager.selectedDenpendencyLink.link=n,a.showDependencyLinkSelectedLine();else if((g||p)&&"down"===t.poniterState){if(s.hasListeners(r.CLICK_DEPENDENCY_LINK_POINT)){const t=IS(e.offset.y-s.headerHeight+s.stateManager.scrollTop,s),i=s.getRecordByIndex(t.task_index,t.sub_task_index);s.fireListeners(r.CLICK_DEPENDENCY_LINK_POINT,{event:e.nativeEvent,index:t.task_index,sub_task_index:t.sub_task_index,point:g?"start":"end",record:i})}a.hideTaskBarSelectedBorder()}else if(f&&"down"===t.poniterState)s.hasListeners(r.CLICK_MARKLINE_CREATE)&&s.fireListeners(r.CLICK_MARKLINE_CREATE,{event:e.nativeEvent,position:WS(h,i._gantt),data:i._gantt.stateManager.marklineIcon.target.data});else if(v&&"down"===t.poniterState)s.hasListeners(r.CLICK_MARKLINE_CONTENT)&&s.fireListeners(r.CLICK_MARKLINE_CONTENT,{event:e.nativeEvent,position:WS(l,i._gantt),data:l.data});else if(g&&"draging"===t.poniterState){if(a.isCreatingDependencyLine()){const t=a.endCreateDependencyLine(e.offset.y);s.hasListeners(r.CREATE_DEPENDENCY_LINK)&&s.fireListeners(r.CREATE_DEPENDENCY_LINK,{federatedEvent:e,event:e.nativeEvent,link:t})}}else if(p&&"draging"===t.poniterState){if(a.isCreatingDependencyLine()){const t=a.endCreateDependencyLine(e.offset.y);s.hasListeners(r.CREATE_DEPENDENCY_LINK)&&s.fireListeners(r.CREATE_DEPENDENCY_LINK,{federatedEvent:e,event:e.nativeEvent,link:t})}}else a.hideDependencyLinkSelectedLine(),a.hideTaskBarSelectedBorder()}})),i.ganttGroup.addEventListener("rightdown",(t=>{let e,i=!1,o=!1;const n=t.detailPath.find((t=>"task-bar"===t.name?(i=!0,!0):!!t.attribute.vtable_link&&(o=!0,e=t.attribute.vtable_link,!1)));if(i){if(s.hasListeners(r.CONTEXTMENU_TASK_BAR)){const e=n,i=e.task_index,o=e.sub_task_index,a=s.getRecordByIndex(i,o);s.fireListeners(r.CONTEXTMENU_TASK_BAR,{federatedEvent:t,event:t.nativeEvent,index:i,sub_task_index:o,record:a})}}else o&&s.hasListeners(r.CONTEXTMENU_DEPENDENCY_LINK)&&s.fireListeners(r.CONTEXTMENU_DEPENDENCY_LINK,{federatedEvent:t,event:t.nativeEvent,link:e})})),i.ganttGroup.addEventListener("pointerenter",(t=>{(s.parsedOptions.scrollStyle.horizontalVisible&&"focus"===s.parsedOptions.scrollStyle.horizontalVisible||!s.parsedOptions.scrollStyle.horizontalVisible&&"focus"===s.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showHorizontalScrollBar(),(s.parsedOptions.scrollStyle.verticalVisible&&"focus"===s.parsedOptions.scrollStyle.verticalVisible||!s.parsedOptions.scrollStyle.verticalVisible&&"focus"===s.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showVerticalScrollBar()})),i.ganttGroup.addEventListener("pointerleave",(t=>{if((s.parsedOptions.scrollStyle.horizontalVisible&&"focus"===s.parsedOptions.scrollStyle.horizontalVisible||!s.parsedOptions.scrollStyle.horizontalVisible&&"focus"===s.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideHorizontalScrollBar(),(s.parsedOptions.scrollStyle.verticalVisible&&"focus"===s.parsedOptions.scrollStyle.verticalVisible||!s.parsedOptions.scrollStyle.verticalVisible&&"focus"===s.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideVerticalScrollBar(),i._gantt.stateManager.hoverTaskBar.target){if(i._gantt.hasListeners(r.MOUSELEAVE_TASK_BAR)){const e=i._gantt.stateManager.hoverTaskBar.target.task_index,o=i._gantt.stateManager.hoverTaskBar.target.sub_task_index,n=i._gantt.getRecordByIndex(e,o);i._gantt.fireListeners(r.MOUSELEAVE_TASK_BAR,{federatedEvent:t,event:t.nativeEvent,index:e,sub_task_index:o,record:n})}a.hideTaskBarHover(t)}})),i.ganttGroup.addEventListener("wheel",(t=>{wS(t,a,s)}))}(this),function(t){const i=t._gantt;t._gantt.scenegraph;const o=i.stateManager,n=t._eventHandler;n.on(i.getElement(),"contextmenu",(t=>{!1!==i.parsedOptions.eventOptions?.preventDefaultContextMenu&&t.preventDefault()})),n.on(i.getContainer(),"resize",(t=>{0===t.width&&0===t.height||(pt(i.options.pixelRatio)||i.setPixelRatio(nW()),t.windowSizeNotChange||i._resize())})),i.taskListTableInstance&&i.parsedOptions.verticalSplitLineMoveable&&n.on(i.verticalSplitResizeLine,"mousedown",(t=>{o.updateInteractionState(e.grabing),o.startResizeTableWidth(t)}));i.parsedOptions.verticalSplitLineHighlight&&(i.verticalSplitResizeLine&&n.on(i.verticalSplitResizeLine,"mouseover",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="1"})),i.verticalSplitResizeLine&&n.on(i.verticalSplitResizeLine,"mouseout",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="0"})));const s=t=>{i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y},i.eventManager.poniterState="down"};t.globalEventListeners.push({name:"pointerdown",env:"document",callback:s}),ng.addEventListener("pointerdown",s);const a=t=>{if("down"===i.eventManager.poniterState){const e=i.eventManager.lastDragPointerXYOnWindow.x??t.x,o=t.x-e,n=i.eventManager.lastDragPointerXYOnWindow.y??t.y,r=t.y-n;(Math.abs(o)>=1||Math.abs(r)>=1)&&(i.eventManager.poniterState="draging")}if(o.interactionState===e.grabing&&"draging"===i.eventManager.poniterState){const e=i.eventManager.lastDragPointerXYOnWindow?.x??t.x,n=i.eventManager.lastDragPointerXYOnWindow?.y??t.y;(Math.abs(e-t.x)>=1||Math.abs(n-t.y)>=1)&&(o.isResizingTableWidth()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealResizeTableWidth(t)):o.isMoveingTaskBar()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealTaskBarMove(t)):o.isResizingTaskBar()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealTaskBarResize(t)):o.isAdjustingProgressBar()?o.dealAdjustProgressBar(t):o.isCreatingDependencyLine()&&o.dealCreateDependencyLine(t),i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y})}};t.globalEventListeners.push({name:"pointermove",env:"document",callback:a}),ng.addEventListener("pointermove",a);const l=t=>{"grabing"===o.interactionState&&(o.updateInteractionState(e.default),o.isResizingTableWidth()?o.endResizeTableWidth():o.isMoveingTaskBar()?o.endMoveTaskBar():o.isResizingTaskBar()?o.endResizeTaskBar(t.x):o.isAdjustingProgressBar()&&o.endAdjustProgressBar(t.x)),setTimeout((()=>{i.eventManager.lastDragPointerXYOnWindow=void 0,i.eventManager.poniterState="up"}),0)};t.globalEventListeners.push({name:"pointerup",env:"document",callback:l}),ng.addEventListener("pointerup",l);const h=t=>{if(i.parsedOptions.dependencyLinkDeletable&&("Delete"===t.key&&i.parsedOptions.keyboardOptions?.deleteLinkOnDel||"Backspace"===t.key&&i.parsedOptions.keyboardOptions?.deleteLinkOnBack)&&i.stateManager.selectedDenpendencyLink.link){const e=i.stateManager.selectedDenpendencyLink.link;i.deleteLink(i.stateManager.selectedDenpendencyLink.link),o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),i.hasListeners(r.DELETE_DEPENDENCY_LINK)&&i.fireListeners(r.DELETE_DEPENDENCY_LINK,{event:t,link:e})}};t.globalEventListeners.push({name:"keydown",env:"document",callback:h}),ng.addEventListener("keydown",h)}(this),function(t){const e=t._gantt,i=e.stateManager,o=e.scenegraph;if(!1===ng.envContribution.supportsTouchEvents)return;ng.addEventListener("contextmenu",(t=>{t.stopPropagation(),t.preventDefault()}),{capture:!0}),t.touchMovePoints=[],e.scenegraph.ganttGroup.addEventListener("touchstart",(e=>{e.target.isChildOf(o.scrollbarComponent.vScrollBar)||e.target.isChildOf(o.scrollbarComponent.hScrollBar)||(t.isTouchdown=!0,t.touchMovePoints.push({x:e.page.x,y:e.page.y,timestamp:Date.now()}))}));const n=o=>{if(t.isLongTouch&&o.preventDefault(),t.isTouchdown&&rW(o)&&(t.isTouchMove=!0,t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:o.changedTouches[0].pageX,y:o.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const n=-t.touchMovePoints[t.touchMovePoints.length-1].x+t.touchMovePoints[t.touchMovePoints.length-2].x,r=-t.touchMovePoints[t.touchMovePoints.length-1].y+t.touchMovePoints[t.touchMovePoints.length-2].y;wS(o,i,e),o.cancelable&&("none"===e.parsedOptions.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&xS(r,i)||Math.abs(r)<=Math.abs(n)&&0!==n&&_S(n,i))&&o.preventDefault()}};ng.addEventListener("touchmove",n,{passive:!1}),t.globalEventListeners.push({name:"touchmove",env:"vglobal",callback:n});const r=i=>{if(t.touchEnd=!0,t.isLongTouch=!1,t.isTouchdown&&rW(i)){if(t.touchMovePoints?.length&&(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:i.changedTouches[0].pageX,y:i.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const i=t.touchMovePoints[0],o=t.touchMovePoints[t.touchMovePoints?.length-1],n=(o.x-i.x)/(o.timestamp-i.timestamp),r=(o.y-i.y)/(o.timestamp-i.timestamp);t.inertiaScroll.startInertia(n,r,.95),e.eventManager.inertiaScroll.setScrollHandle(((t,i)=>{wS({deltaX:-t,deltaY:-i},e.stateManager,e)}))}t.isTouchdown=!1,t.isTouchMove=!1,t.isDraging=!1,t.touchMovePoints=[]}};ng.addEventListener("touchend",r),t.globalEventListeners.push({name:"touchend",env:"vglobal",callback:r});const s=e=>{t.touchEnd=!0,t.isLongTouch=!1,t.isTouchdown&&(t.isTouchdown=!1,t.isTouchMove=!1,t.touchMovePoints=[],t.isDraging=!1)};ng.addEventListener("touchcancel",s),t.globalEventListeners.push({name:"touchcancel",env:"vglobal",callback:s})}(this)}}function lW(t){const{scroll:e}=t.stateManager,{verticalBarPos:i}=e;t.taskListTableInstance.stateManager.setScrollTop(i,void 0,!1)}function hW(t){const e=t.taskTableWidth;t.taskTableWidth=t.taskListTableInstance.getAllColsWidth()+t.parsedOptions.outerFrameStyle.borderLineWidth,t.options?.taskListTable?.maxTableWidth&&(t.taskTableWidth=Math.min(t.options?.taskListTable?.maxTableWidth,t.taskTableWidth)),t.options?.taskListTable?.minTableWidth&&(t.taskTableWidth=Math.max(t.options?.taskListTable?.minTableWidth,t.taskTableWidth)),e!==t.taskTableWidth&&(t.element.style.left=t.taskTableWidth?`${t.taskTableWidth}px`:"0px",t.taskListTableInstance.setCanvasSize(t.taskTableWidth,t.tableNoFrameHeight+2*t.parsedOptions.outerFrameStyle.borderLineWidth),t._updateSize(),LS(t),t.zoomScaleManager&&t.zoomScaleManager.handleTableWidthChange())}class dW{_gantt;scroll;fastScrolling;interactionState=e.default;moveTaskBar;hoverTaskBar;resizeTaskBar;adjustProgressBar;selectedTaskBar;resizeTableWidth;selectedDenpendencyLink;creatingDenpendencyLink;marklineIcon;resetInteractionState=tW((()=>{this.updateInteractionState(e.default)}),100);constructor(t){this._gantt=t,this.scroll={horizontalBarPos:0,verticalBarPos:0},this.moveTaskBar={targetStartX:null,targetStartY:null,deltaX:0,deltaY:0,startOffsetY:null,startX:null,startY:null,moving:!1,target:null,moveTaskBarXSpeed:0,moveTaskBarXInertia:new sW},this.hoverTaskBar={targetStartX:null,startX:null,target:null},this.marklineIcon={target:null},this.selectedTaskBar={target:null},this.resizeTaskBar={startOffsetY:null,targetStartX:null,targetEndX:null,startX:null,startY:null,target:null,resizing:!1,onIconName:""},this.adjustProgressBar={startX:null,startY:null,target:null,adjusting:!1,originalProgress:0},this.resizeTableWidth={lastX:null,resizing:!1},this.selectedDenpendencyLink={link:null},this.creatingDenpendencyLink={startClickedPoint:null,startX:null,startY:null,startOffsetY:null,targetStartX:null,creating:!1,firstTaskBarPosition:"left",secondTaskBarPosition:"left",secondTaskBarNode:null,lastHighLightLinkPoint:null},this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this),function(t){t.taskListTableInstance&&t.taskListTableInstance?.on("scroll",(e=>{if("vertical"===e.scrollDirection){const{scroll:e}=t.taskListTableInstance.stateManager,{verticalBarPos:i}=e;t.stateManager.scroll.verticalBarPos!==i&&t.stateManager.setScrollTop(i,!1)}}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_cell_value",(e=>{const{col:i,row:o}=e;t.taskListTableInstance.isHeader(i,o)||t._refreshTaskBar(o-t.taskListTableInstance.columnHeaderLevelCount)}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_header_position",(e=>{t.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||t.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact||t.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||t.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline?t.scenegraph.refreshTaskBarsAndGrid():t.scenegraph.refreshTaskBars(),t.scenegraph.dragOrderLine.hideDragLine();const i=t.stateManager.scroll.horizontalBarPos,n=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-n)})),t.taskListTableInstance?.on("change_header_position_start",(e=>{const{col:i,row:o,x:n,y:r,backX:s,lineX:a,backY:l,lineY:h,event:d}=e;t.scenegraph.dragOrderLine.showDragLine(h),t.scenegraph.updateNextFrame()})),t.taskListTableInstance?.on("changing_header_position",(e=>{const{col:i,row:o,x:n,y:r,backX:s,lineX:a,backY:l,lineY:h,event:d}=e;t.scenegraph.dragOrderLine.showDragLine(h),t.scenegraph.updateNextFrame()})),t.taskListTableInstance?.on("change_header_position_fail",(e=>{t.scenegraph.dragOrderLine.hideDragLine(),t.scenegraph.updateNextFrame()}))}(this._gantt),function(t){t.taskListTableInstance?.on("tree_hierarchy_state_change",(e=>{const{row:i,hierarchyState:r}=e;if(t.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){const e=i-t.taskListTableInstance.columnHeaderLevelCount,o=t.getRecordByIndex(e);o&&o.type===n.PROJECT&&o.children?.length>0&&(o.hierarchyState=r)}t._syncPropsFromTable(),t.scenegraph.refreshTaskBarsAndGrid(),!t.taskListTableInstance.checkHasColumnAutoWidth()||"auto"!==t.options.taskListTable?.tableWidth&&-1!==t.taskTableWidth||hW(t);const s=t.stateManager.scroll.horizontalBarPos,a=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-s),t.scenegraph.setY(-a)}))}(this._gantt),function(t){t.taskListTableInstance?.on("after_sort",(e=>{t.scenegraph.refreshTaskBars();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt),"auto"!==this._gantt.options.taskListTable?.tableWidth&&-1!==this._gantt.taskTableWidth||function(t){t.taskListTableInstance?.on("resize_column",(e=>{hW(t)}))}(this._gantt)}setScrollTop(t,e=!0){const i=this._gantt.getAllRowsHeight();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.height)),t=Math.ceil(t);const o=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,pt(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-t);const n=t/(i-this._gantt.scenegraph.height);this._gantt.scenegraph.scrollbarComponent.updateVerticalScrollBarPos(n),o!==t&&e&&(lW(this._gantt),this._gantt.fireListeners(r.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:n}))}get scrollLeft(){return this.scroll.horizontalBarPos}get scrollTop(){return this.scroll.verticalBarPos}setScrollLeft(t,e=!0){const i=this._gantt.getAllDateColsWidth();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.width)),t=Math.ceil(t);const o=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,pt(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-t);const n=t/(i-this._gantt.scenegraph.width);this._gantt.scenegraph.scrollbarComponent.updateHorizontalScrollBarPos(n),o!==t&&e&&this._gantt.fireListeners(r.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioX:n})}updateInteractionState(t){if(this.interactionState===t)return;const i=this.interactionState;this.interactionState=t,i===e.scrolling&&e.default}updateVerticalScrollBar(t){const e=this._gantt.getAllRowsHeight();this.scroll.verticalBarPos,this.scroll.verticalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.height)),pt(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-this.scroll.verticalBarPos,1===t),lW(this._gantt),this._gantt.fireListeners(r.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:t})}updateHorizontalScrollBar(t){const e=this._gantt.getAllDateColsWidth();this.scroll.horizontalBarPos,this.scroll.horizontalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.width)),pt(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this._gantt.fireListeners(r.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioY:t})}startMoveTaskBar(t,e,i,o){"task-bar-hover-shadow"===t.name&&(t=t.parent),this.moveTaskBar.moving=!0,this.moveTaskBar.target=t,this.moveTaskBar.targetStartX=t.attribute.x,this.moveTaskBar.targetStartY=t.attribute.y,this.moveTaskBar.startX=e,this.moveTaskBar.startY=i,this.moveTaskBar.startOffsetY=o,t.setAttribute("zIndex",1e4)}isMoveingTaskBar(){return this.moveTaskBar.moving}endMoveTaskBar(){this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()&&this.moveTaskBar.moveTaskBarXInertia.endInertia();const t=this.moveTaskBar.deltaX,e=this.moveTaskBar.deltaY,i=this.moveTaskBar.target;if(Math.abs(t)>=1||Math.abs(e)>=1){const t=i.task_index,s=i.task_index,a=i.sub_task_index,{startDate:l,endDate:h}=this._gantt.getTaskInfoByTaskListIndex(s,a),d=this.moveTaskBar.targetStartY+this._gantt.parsedOptions.rowHeight*Math.round(e/this._gantt.parsedOptions.rowHeight),c=this._gantt.parsedOptions.taskBarMilestoneStyle.width,u=BS(this.moveTaskBar.target.attribute.x+(i.record.type===n.MILESTONE?c/2:0)-this._gantt.stateManager.scroll.horizontalBarPos,this._gantt),g=this._gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates[u];if(!g)return;const p=g.startDate,f=new Date(p.getTime()+(dS(h).getTime()-dS(l).getTime()));let v;if(dS(l).getTime()!==p.getTime()){v=dS(l).getTime()>p.getTime()?"left":"right",this._gantt._updateStartEndDateToTaskRecord(p,f,s,a);const e=this._gantt.getRecordByIndex(s,a);this._gantt.hasListeners(r.CHANGE_DATE_RANGE)&&this._gantt.fireListeners(r.CHANGE_DATE_RANGE,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:l,oldEndDate:h,index:s,record:e});const i=IS(d,this._gantt).task_index;this._gantt.hasListeners(r.MOVE_END_TASK_BAR)&&this._gantt.fireListeners(r.MOVE_END_TASK_BAR,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:l,oldEndDate:h,oldRowIndex:t,newRowIndex:i,index:s,record:e})}else{const e=this._gantt.getRecordByIndex(s,a),i=IS(d,this._gantt).task_index;this._gantt.hasListeners(r.MOVE_END_TASK_BAR)&&this._gantt.fireListeners(r.MOVE_END_TASK_BAR,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:l,oldEndDate:h,oldRowIndex:t,newRowIndex:i,index:i,record:e})}if(this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){const t=IS(d,this._gantt);this._gantt._dragOrderTaskRecord(i.task_index,i.sub_task_index,t.task_index,t.sub_task_index),HS(this._gantt.records),this._gantt.taskListTableInstance.renderWithRecreateCells(),this._gantt._syncPropsFromTable(),this._gantt.scenegraph.refreshTaskBarsAndGrid()}else if(this._gantt.parsedOptions.tasksShowMode!==o.Tasks_Separate&&Math.abs(Math.round(e/this._gantt.parsedOptions.rowHeight))>=1){const t=IS(d,this._gantt);this._gantt._dragOrderTaskRecord(i.task_index,i.sub_task_index,t.task_index,t.sub_task_index),this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate?(this._gantt.taskListTableInstance.renderWithRecreateCells(),this._gantt.scenegraph.refreshTaskBarsAndGrid()):(this._gantt.scenegraph.taskBar.refresh(),this._gantt.scenegraph.dependencyLink.refresh())}else{let t=u>=1?this._gantt.getDateColsWidth(0,u-1):0;if(i.record.type===n.MILESTONE){t-=this._gantt.parsedOptions.taskBarMilestoneStyle.width/2}if(uW(i,t-i.attribute.x,d-i.attribute.y,this),"right"===v){let t=i;for(;t.nextSibling&&t.nextSibling.attribute.y===i.attribute.y&&t.nextSibling.record[this._gantt.parsedOptions.startDateField]<=i.record[this._gantt.parsedOptions.startDateField];)t=t.nextSibling;t!==i&&t.parent.insertAfter(i,t)}else if("left"===v){let t=i;for(;t.previousSibling&&t.previousSibling.attribute.y===i.attribute.y&&t.previousSibling.record[this._gantt.parsedOptions.startDateField]>=i.record[this._gantt.parsedOptions.startDateField];)t=t.previousSibling;t!==i&&t.parent.insertBefore(i,t)}}this._gantt.scenegraph.updateNextFrame()}this.moveTaskBar.moving=!1,this.selectedTaskBar.target!==i&&i.setAttribute("zIndex",0),i.updateTextPosition(),this.moveTaskBar.target=null,this.moveTaskBar.deltaX=0,this.moveTaskBar.deltaY=0,this.moveTaskBar.moveTaskBarXSpeed=0}dealTaskBarMove(t){const e=this._gantt;let i=this.moveTaskBar.target;i.setAttribute("zIndex",1e4);const o=e.eventManager.lastDragPointerXYOnWindow.x,n=t.x-o,r=e.eventManager.lastDragPointerXYOnWindow.y,s=t.y-r;if(this.moveTaskBar.deltaX+=n,this.moveTaskBar.deltaY+=s,uW(i,n,s,this),i.attribute.x<=e.stateManager.scrollLeft&&n<0)if(e.parsedOptions.moveTaskBarToExtendDateRange&&0===e.stateManager.scrollLeft){this.moveTaskBar.moveTaskBarXInertia?.endInertia();const o=e.parsedOptions.reverseSortedTimelineScales[0].timelineDates[1].startDate.getTime()-e.parsedOptions.reverseSortedTimelineScales[0].timelineDates[0].startDate.getTime(),{unit:n,startOfWeek:r}=e.parsedOptions.reverseSortedTimelineScales[0];e.parsedOptions.minDate=vS(new Date(e.parsedOptions.reverseSortedTimelineScales[0].timelineDates[0].startDate.getTime()-o/2),n,r),e.parsedOptions._minDateTime=e.parsedOptions.minDate?.getTime(),e._generateTimeLineDateMap(),e._updateSize(),e.scenegraph.refreshAll(),i=this.moveTaskBar.target=e.scenegraph.taskBar.getTaskBarNodeByIndex(this.moveTaskBar.target.task_index,this.moveTaskBar.target.sub_task_index),e.scrollLeft=e.parsedOptions.timelineColWidth-1,e.eventManager.lastDragPointerXYOnWindow.x=t.x,"milestone"===i.record?.type?uW(i,e.scrollLeft-i.attribute.x,0,this):i.setAttribute("x",e.scrollLeft)}else this.moveTaskBar.moveTaskBarXSpeed=-e.parsedOptions.timelineColWidth/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,o)=>{this.moveTaskBar.deltaX+=t,this.moveTaskBar.deltaY+=o,uW(i,t,o,this),e.stateManager.setScrollLeft(i.attribute.x),0===e.stateManager.scrollLeft&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}));else if(i.attribute.x+i.attribute.width>=e.stateManager.scrollLeft+e.tableNoFrameWidth&&n>0)if(e.parsedOptions.moveTaskBarToExtendDateRange&&e.stateManager.scrollLeft+e.tableNoFrameWidth===e.getAllDateColsWidth()){this.moveTaskBar.moveTaskBarXInertia?.endInertia();const o=e.parsedOptions.reverseSortedTimelineScales[0].timelineDates,n=o[1].startDate.getTime()-o[0].startDate.getTime(),{unit:r,startOfWeek:s,step:a}=e.parsedOptions.reverseSortedTimelineScales[0];if(e.parsedOptions.maxDate=fS(e.parsedOptions.minDate,new Date(o[o.length-1].endDate.getTime()+n/2),r,a),e.parsedOptions._maxDateTime=e.parsedOptions.maxDate?.getTime(),e._generateTimeLineDateMap(),e._updateSize(),e.scenegraph.refreshAll(),i=this.moveTaskBar.target=e.scenegraph.taskBar.getTaskBarNodeByIndex(this.moveTaskBar.target.task_index,this.moveTaskBar.target.sub_task_index),e.scrollLeft+=1,e.eventManager.lastDragPointerXYOnWindow.x=t.x,"milestone"===i.record?.type){const t=e.scrollLeft+e.tableNoFrameWidth-i.attribute.width;uW(i,t-i.attribute.x,0,this)}else i.setAttribute("x",e.scrollLeft+e.tableNoFrameWidth-i.attribute.width)}else this.moveTaskBar.moveTaskBarXSpeed=e.parsedOptions.timelineColWidth/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,o)=>{this.moveTaskBar.deltaX+=t,this.moveTaskBar.deltaY+=o,uW(i,t,o,this),e.stateManager.setScrollLeft(i.attribute.x+i.attribute.width-e.tableNoFrameWidth),e.stateManager.scrollLeft===e.getAllDateColsWidth()-e.tableNoFrameWidth&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}));else this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()?this.moveTaskBar.moveTaskBarXInertia.endInertia():this.moveTaskBar.moveTaskBarXSpeed=0;e.scenegraph.updateNextFrame()}startResizeTaskBar(t,e,i,o,n){this.resizeTaskBar.onIconName=n,this.resizeTaskBar.resizing=!0,this.resizeTaskBar.target=t,this.resizeTaskBar.targetStartX=t.attribute.x,this.resizeTaskBar.targetEndX=t.attribute.x+t.attribute.width,this.resizeTaskBar.startX=e,this.resizeTaskBar.startY=i,this.resizeTaskBar.startOffsetY=o}isResizingTaskBar(){return this.resizeTaskBar.resizing}endResizeTaskBar(t){const e=this._gantt.stateManager.resizeTaskBar.onIconName,i=t-this.resizeTaskBar.startX;if(Math.abs(i)>=1){const t=BS(("left"===e?this.resizeTaskBar.target.attribute.x:this.resizeTaskBar.target.attribute.x+this.resizeTaskBar.target.attribute.width)-this._gantt.stateManager.scroll.horizontalBarPos,this._gantt),i=this._gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates[t];if(!i)return;const n="left"===e?i.startDate:i.endDate,s=this.resizeTaskBar.target,a=s.clipGroupBox,l=s.barRect,h=s.progressRect,d=s.textLabel,c=s.task_index,u=s.sub_task_index,{taskDays:g,progress:p,startDate:f,endDate:v}=this._gantt.getTaskInfoByTaskListIndex(c,u);let m=!1;if("left"===e?(this._gantt._updateStartDateToTaskRecord(n,c,u),n.getTime()!==new Date(f).getTime()&&(m=!0)):(this._gantt._updateEndDateToTaskRecord(n,c,u),n.getTime()!==new Date(v).getTime()&&(m=!0)),this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact)this._gantt.taskListTableInstance.renderWithRecreateCells(),this._gantt._syncPropsFromTable(),this._gantt.scenegraph.refreshTaskBarsAndGrid();else{if("left"===e){const e=t>=1?this._gantt.getDateColsWidth(0,t-1):0;s.setAttribute("x",e),s.setAttribute("width",this.resizeTaskBar.targetEndX-e)}else if("right"===e){const e=this._gantt.getDateColsWidth(0,t);s.setAttribute("width",e-this.resizeTaskBar.targetStartX)}if(a.setAttribute("width",s.attribute.width),l?.setAttribute("width",s.attribute.width),h?.setAttribute("width",p/100*s.attribute.width),d){const{textAlign:t,textBaseline:e,padding:i}=this._gantt.parsedOptions.taskBarLabelStyle,o=PS(lS(i),t,e,s.attribute.width,s.attribute.height);d.setAttribute("maxLineWidth",s.attribute.width-20),d.setAttribute("x",o.x)}this._gantt.scenegraph.refreshRecordLinkNodes(c,u,s,0),this.showTaskBarHover(),cW(this._gantt,s,c,u),s.setAttribute("zIndex",0)}if(s.updateTextPosition(),this.resizeTaskBar.resizing=!1,this.resizeTaskBar.target=null,m&&this._gantt.hasListeners(r.CHANGE_DATE_RANGE)){const t=this._gantt.getRecordByIndex(c,u);this._gantt.fireListeners(r.CHANGE_DATE_RANGE,{startDate:t[this._gantt.parsedOptions.startDateField],endDate:t[this._gantt.parsedOptions.endDateField],oldStartDate:f,oldEndDate:v,index:c,record:t})}this._gantt.scenegraph.updateNextFrame()}}dealTaskBarResize(t){const e=this._gantt.eventManager.lastDragPointerXYOnWindow.x,i=t.x-e,o=this._gantt.stateManager.resizeTaskBar.target;let r="left"===this._gantt.stateManager.resizeTaskBar.onIconName?-i:i;const s=Math.max(1,o.attribute.width+r);r=s-o.attribute.width,function(t,e,i,o){const r=o._gantt.parsedOptions.progressField,s=t.clipGroupBox,a=t.barRect,l=t.progressRect,h=t.textLabel,d=t.task_index,c=t.sub_task_index,u=t.record,g=u[r],p=u.type===n.MILESTONE;t.setAttribute("zIndex",1e4),e&&t.setAttribute("x",t.attribute.x+e);p&&t.setAttribute("anchor",[t.attribute.x+t.attribute.width/2,t.attribute.y+t.attribute.height/2]);i&&t.setAttribute("width",i);if(s.setAttribute("width",t.attribute.width),a?.setAttribute("width",t.attribute.width),l?.setAttribute("width",g/100*t.attribute.width),h){const{textAlign:e,textBaseline:n,padding:r}=o._gantt.parsedOptions.taskBarLabelStyle,s=PS(lS(r),e,n,i,t.attribute.height);h.setAttribute("maxLineWidth",i-20),h.setAttribute("x",s.x)}t.updateTextPosition(),o.showTaskBarHover(),cW(o._gantt,t,d,c),o._gantt.scenegraph.refreshRecordLinkNodes(d,c,t,0)}(o,"left"===this._gantt.stateManager.resizeTaskBar.onIconName?-r:0,s,this),this._gantt.scenegraph.updateNextFrame()}startAdjustProgressBar(t,e,i){if(!t||!t.record)return;const o=this._gantt.parsedOptions.progressField;if(!o||void 0===t.record[o]||null===t.record[o])return;const{progress:n}=this._gantt.getTaskInfoByTaskListIndex(t.task_index,t.sub_task_index);this.adjustProgressBar.target=t,this.adjustProgressBar.adjusting=!0,this.adjustProgressBar.startX=e,this.adjustProgressBar.startY=i,this.adjustProgressBar.originalProgress=n}isAdjustingProgressBar(){return this.adjustProgressBar.adjusting}endAdjustProgressBar(t){const e=this.adjustProgressBar.target;if(!e)return;const i=e.attribute.width,o=t-this.adjustProgressBar.startX,n=Math.max(0,Math.min(100,this.adjustProgressBar.originalProgress+o/i*100));if(Math.abs(n-this.adjustProgressBar.originalProgress)>=.1){const t=e.task_index,i=e.sub_task_index,o=this._gantt.parsedOptions.progressField;o&&e.record&&(e.record[o]=Math.round(10*n)/10),this.shouldSyncProgressToTable(t,i)&&this._gantt._updateProgressToTaskRecord(Math.round(10*n)/10,t,i),this._gantt.scenegraph.taskBar.updateTaskBarNode(t,i);const s=this._gantt.getRecordByIndex(t,i);this._gantt.hasListeners(r.PROGRESS_UPDATE)&&this._gantt.fireListeners(r.PROGRESS_UPDATE,{federatedEvent:null,event:null,index:t,sub_task_index:i,progress:Math.round(10*n)/10,oldProgress:Math.round(10*this.adjustProgressBar.originalProgress)/10,record:s})}this.adjustProgressBar.adjusting=!1,this.adjustProgressBar.target=null,this.adjustProgressBar.startX=null,this.adjustProgressBar.startY=null,this.adjustProgressBar.originalProgress=0}shouldSyncProgressToTable(t,e){const i=this._gantt.parsedOptions.tasksShowMode;if(i===o.Tasks_Separate)return!0;if(!pt(e))return!0;switch(i){case o.Sub_Tasks_Inline:case o.Sub_Tasks_Arrange:case o.Sub_Tasks_Compact:return!1;case o.Sub_Tasks_Separate:return!0;case o.Project_Sub_Tasks_Inline:const e=this._gantt.getRecordByIndex(t);return!(!e||e.type!==n.PROJECT)&&"expand"===e.hierarchyState;default:return!1}}dealAdjustProgressBar(t){const e=this.adjustProgressBar.target;if(!e||!this.adjustProgressBar.adjusting)return;const i=e.attribute.width;if(!i||i<=0)return;const o=t.x-this.adjustProgressBar.startX,n=Math.max(0,Math.min(100,this.adjustProgressBar.originalProgress+o/i*100));if(e.progressRect&&e.progressRect.setAttribute("width",i*n/100),this._gantt.scenegraph.taskBar.hoverBarProgressHandle&&this._gantt.scenegraph.taskBar.hoverBarProgressHandle.attribute.visibleAll&&this._gantt.scenegraph.taskBar.hoverBarProgressHandle.setAttribute("x",i*n/100-6),e.textLabel&&e.record&&this._gantt.parsedOptions.taskBarLabelText){const t=this._gantt.parsedOptions.progressField,i={...e.record,[t]:Math.round(10*n)/10},o=aS(this._gantt.parsedOptions.taskBarLabelText,i);e.textLabel.setAttribute("text",o)}this._gantt.scenegraph&&this._gantt.scenegraph.stage&&this._gantt.scenegraph.stage.renderNextFrame()}startCreateDependencyLine(t,e,i,o,n){this.resizeTaskBar.resizing=!1,this.creatingDenpendencyLink.creating=!0,this.creatingDenpendencyLink.startClickedPoint=t,this.creatingDenpendencyLink.startX=e,this.creatingDenpendencyLink.startY=i,this.creatingDenpendencyLink.startOffsetY=o,this.creatingDenpendencyLink.firstTaskBarPosition=n,this.highlightLinkPointNode(t)}isCreatingDependencyLine(){return this.creatingDenpendencyLink.creating}endCreateDependencyLine(t){const e=this._gantt.parsedOptions.taskKeyField,o=this.selectedTaskBar.target.task_index,n=this.selectedTaskBar.target.sub_task_index,r=this.creatingDenpendencyLink.secondTaskBarNode.task_index,s=this.creatingDenpendencyLink.secondTaskBarNode.sub_task_index,a={linkedFromTaskKey:this._gantt.getRecordByIndex(o,n)[e],linkedToTaskKey:this._gantt.getRecordByIndex(r,s)[e],type:"left"===this.creatingDenpendencyLink.firstTaskBarPosition&&"left"===this.creatingDenpendencyLink.secondTaskBarPosition?i.StartToStart:"right"===this.creatingDenpendencyLink.firstTaskBarPosition&&"left"===this.creatingDenpendencyLink.secondTaskBarPosition?i.FinishToStart:"right"===this.creatingDenpendencyLink.firstTaskBarPosition&&"right"===this.creatingDenpendencyLink.secondTaskBarPosition?i.FinishToFinish:i.StartToFinish};return this._gantt.addLink(a),this.hideTaskBarSelectedBorder(),this._gantt.scenegraph.updateNextFrame(),this.creatingDenpendencyLink.creating=!1,a}dealCreateDependencyLine(t){const e=this.creatingDenpendencyLink.startX,i=this.creatingDenpendencyLink.startY,o=t.x-e,n=t.y-i,r=this.creatingDenpendencyLink.startClickedPoint,s=r.attribute.x+r.attribute.width/2,a=r.attribute.y+r.attribute.height/2;this._gantt.scenegraph.taskBar.updateCreatingDependencyLine(s,a,s+o,a+n),this._gantt.scenegraph.updateNextFrame()}startResizeTableWidth(t){this.resizeTableWidth.resizing=!0,this.resizeTableWidth.lastX=t.pageX}isResizingTableWidth(){return this.resizeTableWidth.resizing}endResizeTableWidth(){this.resizeTableWidth.resizing=!1,this._gantt.zoomScaleManager&&this._gantt.zoomScaleManager.handleTableWidthChange()}dealResizeTableWidth(t){if(!this.resizeTableWidth.resizing)return;const e=t.pageX-this.resizeTableWidth.lastX;if(Math.abs(e)>=1){let i=this._gantt.taskTableWidth+e;const o=Math.min(this._gantt.taskListTableInstance.getAllColsWidth()+this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.maxTableWidth??1e5),n=Math.max(this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.minTableWidth??0);e>0&&i>o&&(i=o),e<0&&i<n&&(i=n),this._gantt.taskTableWidth=i,this._gantt.element.style.left=this._gantt.taskTableWidth?`${this._gantt.taskTableWidth}px`:"0px",this._gantt.verticalSplitResizeLine.style.left=this._gantt.taskTableWidth?this._gantt.taskTableWidth-7+"px":"0px",this._gantt._resize(),this.resizeTableWidth.lastX=t.pageX,this._gantt.zoomScaleManager&&!this.resizeTableWidth.updateTimeout&&(this.resizeTableWidth.updateTimeout=setTimeout((()=>{this._gantt.zoomScaleManager&&this._gantt.zoomScaleManager.handleTableWidthChange(),this.resizeTableWidth.updateTimeout=null}),50))}}showTaskBarHover(){const t=this._gantt.stateManager.hoverTaskBar.target;if(t){const e=t.attribute.x,i=t.attribute.y,o=t.attribute.width,n=t.attribute.height;this._gantt.scenegraph.taskBar.showHoverBar(e,i,o,n,t),this._gantt.scenegraph.updateNextFrame()}}hideTaskBarHover(t){this._gantt.stateManager.hoverTaskBar.target=null,this._gantt.scenegraph.taskBar.hideHoverBar(),this._gantt.scenegraph.updateNextFrame()}showTaskBarSelectedBorder(t){this._gantt.stateManager.selectedTaskBar.target?.setAttribute("zIndex",0),this._gantt.stateManager.selectedTaskBar.target=t;const e=this._gantt.parsedOptions.dependencyLinkCreatable;t.setAttribute("zIndex",1e4);const i=t.attribute.x,o=t.attribute.y,n=t.attribute.width,r=t.attribute.height;this._gantt.scenegraph.taskBar.createSelectedBorder(i,o,n,r,t,e),this._gantt.scenegraph.updateNextFrame()}hideTaskBarSelectedBorder(){this._gantt.stateManager.selectedTaskBar.target?.setAttribute("zIndex",0),this._gantt.stateManager.selectedTaskBar.target=null,this._gantt.scenegraph.taskBar.removeSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}showSecondTaskBarSelectedBorder(){const t=this._gantt.stateManager.creatingDenpendencyLink.secondTaskBarNode,e=t.attribute.x,i=t.attribute.y,o=t.attribute.width,n=t.attribute.height;this._gantt.scenegraph.taskBar.createSelectedBorder(e,i,o,n,t,!0),this._gantt.scenegraph.updateNextFrame()}hideSecondTaskBarSelectedBorder(){this._gantt.stateManager.creatingDenpendencyLink.secondTaskBarNode=null,this._gantt.scenegraph.taskBar.removeSecondSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}showDependencyLinkSelectedLine(){const t=this._gantt.stateManager.selectedDenpendencyLink.link;this._gantt.scenegraph.dependencyLink.createSelectedLinkLine(t);const{taskKeyField:e,dependencyLinks:i}=this._gantt.parsedOptions,{linkedToTaskKey:n,linkedFromTaskKey:r,type:s}=t;let a,l,h,d;const c=ES(this._gantt.records,e,n),u=ES(this._gantt.records,e,r);this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?(a=u.index[0],l=u.index[1],h=c.index[0],d=c.index[1]):(a=this._gantt.getTaskShowIndexByRecordIndex(u.index),h=this._gantt.getTaskShowIndexByRecordIndex(c.index));const g=this._gantt.scenegraph.taskBar.getTaskBarNodeByIndex(a,l);this._gantt.scenegraph.taskBar.createSelectedBorder(g.attribute.x,g.attribute.y,g.attribute.width,g.attribute.height,g,!1);const p=this._gantt.scenegraph.taskBar.getTaskBarNodeByIndex(h,d);this._gantt.scenegraph.taskBar.createSelectedBorder(p.attribute.x,p.attribute.y,p.attribute.width,p.attribute.height,p,!1),this._gantt.scenegraph.updateNextFrame()}hideDependencyLinkSelectedLine(){this._gantt.stateManager.selectedDenpendencyLink.link=null,this._gantt.scenegraph.dependencyLink.removeSelectedLinkLine(),this._gantt.scenegraph.taskBar.removeSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}highlightLinkPointNode(t){if(t?.children.length>0){const e=t.children[0];e.setAttribute("fill",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.fillColor),e.setAttribute("stroke",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.strokeColor),e.setAttribute("radius",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.radius),e.setAttribute("lineWidth",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.strokeWidth),this._gantt.scenegraph.updateNextFrame()}}unhighlightLinkPointNode(t){if(t?.children.length>0){const e=t.children[0];e.setAttribute("fill",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.fillColor),e.setAttribute("stroke",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeColor),e.setAttribute("radius",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.radius),e.setAttribute("lineWidth",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeWidth),this._gantt.scenegraph.updateNextFrame()}}showMarklineIconHover(){const t=this._gantt.stateManager.marklineIcon.target;if(t){const e=this._gantt.scenegraph.timelineHeader.showMarklineIcon(t.parent);e&&this._gantt.parsedOptions.markLineCreateOptions?.markLineCreationHoverToolTip?.tipContent&&this._gantt.scenegraph.showToolTip(e),this._gantt.scenegraph.updateNextFrame()}}hideMarklineIconHover(){this._gantt.scenegraph.timelineHeader.hideMarklineIconHover(this._gantt.stateManager.marklineIcon.target.parent),this._gantt.scenegraph.hideToolTip(),this._gantt.stateManager.marklineIcon.target=null,this._gantt.scenegraph.updateNextFrame()}updateProjectTaskTimes(t){if(!t||0===t.length||!this._gantt||!this._gantt.records)return;const e=this._gantt.parsedOptions.startDateField,i=this._gantt.parsedOptions.endDateField,o=[...t];for(;o.length>0;){const t=[...o],r=t.pop();let s=this._gantt.records;for(const e of t){if(!s[e]||!s[e].children)return;s=s[e].children}const a=0===t.length?this._gantt.records[r]:s[r];if(a&&a.type===n.PROJECT&&a.children&&a.children.length>0){let t=null,o=null;for(const n of a.children)if(n[e]&&n[i]){const r=new Date(n[e]),s=new Date(n[i]);(!t||r<t)&&(t=r),(!o||s>o)&&(o=s)}if(t&&o){const n=a[e]?new Date(a[e]):null,r=a[i]?new Date(a[i]):null;if(!n||!r||t.getTime()!==n.getTime()||o.getTime()!==r.getTime()){const n=this._gantt.parsedOptions.dateFormat??this._gantt.parseTimeFormat(a[e]||a.children[0][e]),r=t=>this._gantt.formatDate?this._gantt.formatDate(t,n):t.toISOString().split("T")[0];a[e]=r(t),a[i]=r(o)}}}o.pop()}this._gantt.scenegraph?.refreshAll()}}function cW(t,e,i,o){const n=t.parsedOptions.taskBarCustomLayout;if(n){let r;if("function"==typeof n){const{startDate:s,endDate:a,taskDays:l,progress:h,taskRecord:d}=t.getTaskInfoByTaskListIndex(i,o);r=n({width:e.attribute.width,height:e.attribute.height,index:i,startDate:s,endDate:a,taskDays:l,progress:h,taskRecord:d,ganttInstance:t})}else r=n;if(r){const t=r.rootContainer;t.name="task-bar-custom-render";const i=e.children.find((t=>"task-bar-group"===t.name));if(i){const e=i.children.findIndex((t=>"task-bar-custom-render"===t.name)),o=i.children[e];o&&(i.removeChild(o),i.insertInto(t,e))}}}}function uW(t,e,i,r){const s=t.task_index,a=t.sub_task_index,l=t.record.type===n.MILESTONE,h=t.attribute.x,d=t.attribute.y;if(e&&t.setAttribute("x",Math.max(0,t.attribute.x+e)),r._gantt.parsedOptions.tasksShowMode!==o.Tasks_Separate&&r._gantt.parsedOptions.tasksShowMode!==o.Project_Sub_Tasks_Inline?i&&t.setAttribute("y",t.attribute.y+i):i=0,l&&(t.setAttribute("anchor",[t.attribute.x+t.attribute.width/2,t.attribute.y+t.attribute.height/2]),t.milestoneTextContainer)){const e=t.attribute.x-h,i=t.attribute.y-d,o=t.milestoneTextContainer.attribute.x,n=t.milestoneTextContainer.attribute.y;t.milestoneTextContainer.setAttribute("x",o+e),t.milestoneTextContainer.setAttribute("y",n+i)}t.updateTextPosition(),r._gantt.scenegraph.refreshRecordLinkNodes(s,a,t,i)}let gW=1,pW=class{listenersData={listeners:{},listenerData:{}};on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=gW++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const n=i.indexOf(e);i.splice(n,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;this.listenersData.listenerData[e]?.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>pt(t))):[]}release(){delete this.listenersData}};class fW{records;_gantt;constructor(t){this._gantt=t,this.records=t.records,this.processRecords()}processRecords(){const t=!this._gantt.options.minDate,e=!this._gantt.options.maxDate;let i=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER;if((t||e||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact)&&this.records.length){for(let r=0;r<this.records.length;r++){const s=this.records[r];if(t&&s[this._gantt.parsedOptions.startDateField]){const t=dS(s[this._gantt.parsedOptions.startDateField]);i=Math.min(i,t.getTime())}if(e&&s[this._gantt.parsedOptions.endDateField]){const t=dS(s[this._gantt.parsedOptions.endDateField]);n=Math.max(n,t.getTime())}this._gantt.parsedOptions.tasksShowMode!==o.Sub_Tasks_Inline&&this._gantt.parsedOptions.tasksShowMode!==o.Sub_Tasks_Compact||s.children&&s.children.sort(((t,e)=>dS(t[this._gantt.parsedOptions.startDateField]).getTime()-dS(e[this._gantt.parsedOptions.startDateField]).getTime()))}const{unit:r,startOfWeek:s,step:a}=this._gantt.parsedOptions.reverseSortedTimelineScales[0];t&&(this._gantt.parsedOptions.minDate=vS(new Date(i),r,s),this._gantt.parsedOptions._minDateTime=this._gantt.parsedOptions.minDate.getTime()),t&&!e&&(this._gantt.parsedOptions.maxDate=fS(this._gantt.parsedOptions.minDate,new Date(this._gantt.options.maxDate),r,a),this._gantt.parsedOptions._maxDateTime=this._gantt.parsedOptions.maxDate.getTime()),e&&(this._gantt.parsedOptions.maxDate=fS(this._gantt.parsedOptions.minDate,new Date(n),r,a),this._gantt.parsedOptions._maxDateTime=this._gantt.parsedOptions.maxDate.getTime())}}adjustOrder(t,e,i,r){if((this._gantt.parsedOptions.tasksShowMode!==o.Sub_Tasks_Arrange&&this._gantt.parsedOptions.tasksShowMode!==o.Sub_Tasks_Compact||t!==i)&&!(i<0||r<0))if(this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline){if(pt(e)&&pt(r)&&pt(t)&&pt(i)){const o=this.records[t].children[e];this.records[t].children.splice(e,1),this.records[i]?.children||(this.records[i].children=[]),this.records[i].children.splice(r,0,o)}this.records[i]?.children?.sort(((t,e)=>dS(t[this._gantt.parsedOptions.startDateField]).getTime()-dS(e[this._gantt.parsedOptions.startDateField]).getTime()))}else if(this._gantt.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){if(pt(e)&&pt(r)&&pt(t)&&pt(i)){this.records[t].type,n.PROJECT;const o=this.records[i].type===n.PROJECT,s=this.records[t].children[e];this.records[t].children.splice(e,1),this.records[i]?.children||(this.records[i].children=[]),this.records[i].children.splice(r,0,s),o&&this.records[i]?.children?.sort(((t,e)=>dS(t[this._gantt.parsedOptions.startDateField]).getTime()-dS(e[this._gantt.parsedOptions.startDateField]).getTime()))}}else if(pt(e)&&pt(r)&&pt(t)&&pt(i)){const o=this.records[t].children[e];this.records[t].children.splice(e,1),this.records[i]?.children||(this.records[i].children=[]),this.records[i].children.splice(r,0,o)}}setRecords(t){this.records=t,this.processRecords()}}class vW{plugins=new Map;gantt;constructor(t,e){this.gantt=t,e.plugins?.forEach((t=>{this.register(t),this._initializePluginRun(t)}))}_initializePluginRun(t){if(void 0===t.runTime)try{t.run(this.gantt)}catch(t){}else this._bindGanttEventForPlugin(t)}register(t){this.plugins.set(t.id,t)}registerAll(t){t.forEach((t=>this.register(t)))}getPlugin(t){return this.plugins.get(t)}getPluginByName(t){return Array.from(this.plugins.values()).find((e=>e.name===t))}_bindGanttEventForPlugin(t){t.runTime&&t.runTime.forEach((e=>{this.gantt.on(e,((...i)=>{try{t.run?.(...i,e,this.gantt)}catch(t){}}))}))}updatePlugins(t){Array.from(this.plugins.values()).filter((e=>!t?.some((t=>t.id===e.id)))).forEach((t=>{this.release(),this.plugins.delete(t.id)})),this.plugins.forEach((t=>{t.update&&t.update()}));const e=t?.filter((t=>!this.plugins.has(t.id)));e?.forEach((t=>{this.register(t),this._initializePluginRun(t)}))}release(){this.plugins.forEach((t=>{try{t.release?.(this.gantt)}catch(t){}}))}}class mW{gantt;dataZoomAxis;stage;canvas;isUpdatingFromDataZoom=!1;isUpdatingFromGantt=!1;lastDataZoomState={start:.2,end:.5};cleanupCallbacks=[];resizeTimeout=null;isInitializing=!0;constructor(t,e){this.gantt=t,this.initializeDataZoom(e),this.setupEventListeners(),this.updateDataZoomLimits()}getContainerId(t){if(t)return t;const e=this.gantt.container;if(e?.id)return e.id;const i=document.querySelectorAll('[id*="gantt"], [id*="table"], [class*="gantt"], [class*="vtable"]');if(i.length>0){const t=i[0];if(t.id)return t.id}return"vTable"}initializeDataZoom(t){const e=this.getContainerId(t.containerId);if(!document.getElementById(e))throw new Error(`DataZoom container with ID "${e}" not found`);const i=this.gantt.container;if(!i)throw new Error("Gantt container not found");const o=this.gantt.taskTableWidth||0,n=(i.offsetWidth||1e3)-o,r=this.gantt.taskTableWidth||0,{start:s=.2,end:a=.5,width:l=n,height:h=30,x:d=r,y:c=0,delayTime:u=10}=t;"static"===window.getComputedStyle(i).position&&(i.style.position="relative");const g=document.createElement("div");g.id="dataZoomWrapper",g.style.cssText=`\n width: 100%;\n height: ${h}px;\n position: absolute;\n bottom: ${c}px;\n left: 0px;\n background: transparent;\n overflow: visible;\n pointer-events: none;\n z-index: 1000;\n `,this.canvas=document.createElement("canvas"),this.canvas.id="dataZoomCanvas",this.canvas.width=l,this.canvas.height=h,this.canvas.style.cssText=`\n width: ${l}px;\n height: ${h}px;\n position: absolute;\n top: 0px;\n left: ${d}px;\n pointer-events: auto;\n `,g.appendChild(this.canvas),i.appendChild(g),this.stage=Cg({canvas:this.canvas,width:l,height:h,autoRender:!0}),this.dataZoomAxis=new S_({start:s,end:a,position:{x:0,y:0},size:{width:l,height:h-1},showDetail:!1,delayTime:u,brushSelect:!1,backgroundChartStyle:{line:{visible:!0,stroke:"#ddd"},area:{visible:!0,fill:"#f5f5f5"}},startHandlerStyle:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:"#fff",size:t.width??30,stroke:"#c2c8cf",lineWidth:1},endHandlerStyle:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:"#fff",size:t.width??30,stroke:"#c2c8cf",lineWidth:1},middleHandlerStyle:{visible:!1}}),this.stage.defaultLayer.add(this.dataZoomAxis),ng.getRequestAnimationFrame()((()=>{if(this.isInitializing){const t=this.getGanttViewBoundaries();this.dataZoomAxis.setStartAndEnd(t.startRatio,t.endRatio),this.isInitializing=!1}this.stage.render()})),this.lastDataZoomState={start:s,end:a}}setupEventListeners(){const t=t=>{if(this.isUpdatingFromGantt)return;this.isUpdatingFromDataZoom=!0;let e=t.start??t.detail?.start??t.currentTarget?.attribute?.start,i=t.end??t.detail?.end??t.currentTarget?.attribute?.end;void 0!==e&&void 0!==i||(e=this.dataZoomAxis.attribute.start,i=this.dataZoomAxis.attribute.end),void 0===e||void 0===i||isNaN(e)||isNaN(i)||this.applyDataZoomRangeToGantt(e,i),setTimeout((()=>{this.isUpdatingFromDataZoom=!1}),50)};this.dataZoomAxis.addEventListener("change",t),this.cleanupCallbacks.push((()=>{this.dataZoomAxis.removeEventListener("change",t)}));const e=t=>{if(this.isUpdatingFromDataZoom)return;if("horizontal"!==t.scrollDirection)return;this.isUpdatingFromGantt=!0;const e=this.getGanttViewBoundaries();this.dataZoomAxis.setStartAndEnd(e.startRatio,e.endRatio),this.stage.render(),setTimeout((()=>{this.dataZoomAxis.setAttribute("disableTriggerEvent",!1),this.isUpdatingFromGantt=!1}),10)};this.gantt.addEventListener("scroll",e),this.cleanupCallbacks.push((()=>{this.gantt.removeEventListener("scroll",e)}));const i=()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{this.updateResponsive(),this.updateDataZoomLimits()}),50)};window.addEventListener("resize",i),this.cleanupCallbacks.push((()=>{window.removeEventListener("resize",i),this.resizeTimeout&&clearTimeout(this.resizeTimeout)}));const o=()=>{setTimeout((()=>{this.updateDataZoomLimits(),this.isUpdatingFromDataZoom||this.syncToDataZoom()}),50)};this.gantt.addEventListener("zoom",o),this.cleanupCallbacks.push((()=>{this.gantt.removeEventListener("zoom",o)}))}calculateDataZoomLimits(){let t,e;this.gantt.zoomScaleManager?(t=this.gantt.zoomScaleManager.getGlobalMinMillisecondsPerPixel?.()||1e3,e=this.gantt.zoomScaleManager.getGlobalMaxMillisecondsPerPixel?.()||6e6):(t=this.gantt.parsedOptions.zoom?.minMillisecondsPerPixel??1e3,e=this.gantt.parsedOptions.zoom?.maxMillisecondsPerPixel??6e6);const i=this.gantt.tableNoFrameWidth,o=this.gantt.parsedOptions._maxDateTime-this.gantt.parsedOptions._minDateTime,n=t*i,r=Math.min(1,n/o),s=e*i,a=Math.min(1,s/o);return{minRangeRatio:Math.min(r,a),maxRangeRatio:Math.max(r,a),minMillisecondsPerPixel:t,maxMillisecondsPerPixel:e}}updateDataZoomLimits(){const t=this.calculateDataZoomLimits();this.dataZoomAxis.setAttributes({minSpan:t.minRangeRatio,maxSpan:t.maxRangeRatio}),this.stage.render()}getGanttViewBoundaries(){const t=this.gantt.stateManager.scrollLeft,e=this.gantt.getAllDateColsWidth(),i=this.gantt.tableNoFrameWidth;return{scrollLeft:t,totalWidth:e,viewportWidth:i,startRatio:Math.max(0,Math.min(1,t/e)),endRatio:Math.max(0,Math.min(1,(t+i)/e))}}applyDataZoomRangeToGantt(t,e){if(void 0===t||void 0===e||isNaN(t)||isNaN(e))return;this.lastDataZoomState={start:t,end:e};const i=this.gantt.tableNoFrameWidth,o=this.gantt.getCurrentMillisecondsPerPixel(),n=e-t,r=(this.gantt.parsedOptions._maxDateTime-this.gantt.parsedOptions._minDateTime)*n/i;if(Math.abs(r-o)>.01*o)if(this.gantt.zoomScaleManager){const t=this.gantt.zoomScaleManager.findOptimalLevel(r);t!==this.gantt.zoomScaleManager.getCurrentLevel()&&this.gantt.zoomScaleManager.switchToLevel(t),this.gantt.setMillisecondsPerPixel(r)}else this.gantt.setMillisecondsPerPixel(r);const s=t*this.gantt.getAllDateColsWidth();this.gantt.stateManager.setScrollLeft(s)}syncInitialPosition(){setTimeout((()=>{const t=this.getGanttViewBoundaries();(t.startRatio>0||t.endRatio<1)&&this.dataZoomAxis.setStartAndEnd(t.startRatio,t.endRatio)}),100)}syncToGantt(){const t=this.dataZoomAxis.attribute.start||0,e=this.dataZoomAxis.attribute.end||1;this.applyDataZoomRangeToGantt(t,e)}syncToDataZoom(){const t=this.getGanttViewBoundaries();this.dataZoomAxis.setStartAndEnd(t.startRatio,t.endRatio)}syncToGanttWithState(t,e){this.isUpdatingFromDataZoom=!0,this.applyDataZoomRangeToGantt(t,e),setTimeout((()=>{this.isUpdatingFromDataZoom=!1}),50)}setRange(t,e){this.dataZoomAxis.setStartAndEnd(t,e)}getRange(){return{start:this.dataZoomAxis.attribute.start||0,end:this.dataZoomAxis.attribute.end||1}}resize(t,e){if(void 0===t){const e=this.gantt.container;if(e){const i=this.gantt.taskTableWidth||0;t=e.offsetWidth-i}else t=1e3}void 0===e&&(e=30),this.canvas.width=t,this.canvas.height=e,this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`,this.stage.resize(t,e),this.dataZoomAxis.setAttributes({size:{width:t,height:e-1}}),this.stage.render()}updateResponsive(){const t=this.gantt.container;if(!t)return;const e=this.gantt.taskTableWidth||0,i=t.offsetWidth-e;this.resize(i);const o=this.gantt.taskTableWidth||0;this.updatePosition(o,0),setTimeout((()=>{this.syncToDataZoom()}),10)}updatePosition(t,e){const i=t??this.gantt.taskTableWidth??0;this.canvas.style.left=`${i}px`}destroy(){if(this.cleanupCallbacks.forEach((t=>t())),this.cleanupCallbacks=[],this.canvas&&this.canvas.parentNode){const t=this.canvas.parentNode;t&&"dataZoomWrapper"===t.id&&t.parentNode?t.parentNode.removeChild(t):t.removeChild(this.canvas)}this.stage&&this.stage.release()}}class bW{gantt;config;currentLevelIndex=0;levelBoundaries=[];globalMinMillisecondsPerPixel=0;globalMaxMillisecondsPerPixel=0;dataZoomIntegration=null;constructor(t,e){this.gantt=t;const i={enabled:!0,levels:[],...e};if(this.config=i,this.initializeZoomLimits(),this.sortLevelsByCoarseness(),this.calculateGlobalMillisecondsPerPixelRange(),this.calculateLevelBoundaries(),this.updateZoomLimits(),this.config.levels.length>0){const t=this.calculateInitialMillisecondsPerPixel();this.initializeWithMillisecondsPerPixel(t)}this.initializeDataZoomIfNeeded()}initializeZoomLimits(){const t=this.gantt.parsedOptions.zoom,e=this.config;this.gantt.parsedOptions.zoom={minMillisecondsPerPixel:t?.minMillisecondsPerPixel??e.minMillisecondsPerPixel??1e3,maxMillisecondsPerPixel:t?.maxMillisecondsPerPixel??e.maxMillisecondsPerPixel??6e6,step:e.step??.015}}initializeDataZoomIfNeeded(){const t=this.config.dataZoomAxis;if(!t?.enabled)return;const e={containerId:t.containerId,width:t.width,height:t.height??30,x:t.x,y:t.y??0,delayTime:t.delayTime??10};try{this.dataZoomIntegration=new mW(this.gantt,e)}catch(t){}}handleTableWidthChange(){this.dataZoomIntegration&&this.dataZoomIntegration.updateResponsive()}sortLevelsByCoarseness(){this.config.levels.length<=1||this.config.levels.sort(((t,e)=>{const i=this.findMinTimeUnit(t),o=this.findMinTimeUnit(e),n=this.getUnitMilliseconds(i.unit,i.step);return this.getUnitMilliseconds(o.unit,o.step)-n}))}calculateGlobalMillisecondsPerPixelRange(){const t=this.config.levels;if(0===t.length)return;let e=null,i=0,o=null,n=1/0;for(const r of t){const t=this.findMinTimeUnit(r),s=this.getUnitMilliseconds(t.unit,t.step);s>i&&(i=s,e=t),s<n&&(n=s,o=t)}if(e&&o&&(this.globalMinMillisecondsPerPixel=n/120,this.globalMaxMillisecondsPerPixel=i/150,this.globalMinMillisecondsPerPixel>this.globalMaxMillisecondsPerPixel)){const t=this.globalMinMillisecondsPerPixel;this.globalMinMillisecondsPerPixel=this.globalMaxMillisecondsPerPixel,this.globalMaxMillisecondsPerPixel=t}}calculateLevelBoundaries(){const t=this.config.levels.length;if(0===t)return;this.levelBoundaries=[];const e=[];e[t]=this.globalMinMillisecondsPerPixel;for(let i=t-1;i>=1;i--){const t=this.config.levels[i],o=this.findMinTimeUnit(t),n=this.getUnitMilliseconds(o.unit,o.step)/this.getMinColWidthForUnit(o.unit,o.step);e[i]=n}e[0]=this.globalMaxMillisecondsPerPixel,this.levelBoundaries=[...e];for(let e=1;e<t;e++){if(this.levelBoundaries[e]>=this.levelBoundaries[e-1]){const t=this.levelBoundaries[e-1],i=this.levelBoundaries[e+1]||this.globalMinMillisecondsPerPixel;this.levelBoundaries[e]=(t+i)/2}this.levelBoundaries[e]=Math.max(this.globalMinMillisecondsPerPixel,Math.min(this.globalMaxMillisecondsPerPixel,this.levelBoundaries[e]))}}updateZoomLimits(){this.gantt.parsedOptions.zoom||(this.gantt.parsedOptions.zoom={}),this.gantt.parsedOptions.zoom.minMillisecondsPerPixel=this.globalMinMillisecondsPerPixel,this.gantt.parsedOptions.zoom.maxMillisecondsPerPixel=this.globalMaxMillisecondsPerPixel}getGlobalMinMillisecondsPerPixel(){return this.globalMinMillisecondsPerPixel}getGlobalMaxMillisecondsPerPixel(){return this.globalMaxMillisecondsPerPixel}calculateInitialMillisecondsPerPixel(){return this.globalMinMillisecondsPerPixel+.4*(this.globalMaxMillisecondsPerPixel-this.globalMinMillisecondsPerPixel)}initializeWithMillisecondsPerPixel(t){if(0===this.config.levels.length)return;const e=this.findOptimalLevel(t);this.setInitialLevel(e)}setInitialLevel(t){if(t<0||t>=this.config.levels.length)return;const e=this.config.levels[t];e&&0!==e.length&&(this.gantt.options.timelineHeader.scales=[...e],this.currentLevelIndex=t)}findOptimalLevel(t){const e=Math.max(this.globalMinMillisecondsPerPixel,Math.min(this.globalMaxMillisecondsPerPixel,t));for(let t=0;t<this.levelBoundaries.length-1;t++)if(e<=this.levelBoundaries[t]&&e>this.levelBoundaries[t+1])return t;return this.config.levels.length-1}switchToLevel(t){if(t<0||t>=this.config.levels.length)return!1;if(this.currentLevelIndex===t)return!0;const e=this.config.levels[t];if(!e||0===e.length)return!1;try{return this.gantt.updateScales([...e]),this.currentLevelIndex=t,this.gantt.recalculateTimeScale(),!0}catch(t){return!1}}findMinTimeUnit(t){let e=t[0],i=this.getUnitMilliseconds(e.unit,e.step);for(const o of t){const t=this.getUnitMilliseconds(o.unit,o.step);t<i&&(i=t,e=o)}return e}getUnitMilliseconds(t,e){const i={second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6};return(i[t]||i.day)*e}getMinColWidthForUnit(t,e){switch(t){case"hour":return e>1?120:60;case"minute":return 80;case"second":return 100;default:return 60}}getCurrentLevel(){return this.currentLevelIndex}getInitialMillisecondsPerPixel(){return this.calculateInitialMillisecondsPerPixel()}getCurrentZoomState(){if(0===this.config.levels.length)return null;const t=this.config.levels[this.currentLevelIndex],e=this.findMinTimeUnit(t),i=this.gantt.getCurrentMillisecondsPerPixel(),o=this.getUnitMilliseconds(e.unit,e.step)/i;return{minUnit:e.unit,step:e.step,levelNum:this.currentLevelIndex,currentColWidth:Math.round(10*o)/10}}setZoomPosition(t){if(0===this.config.levels.length)return!1;const{minUnit:e,step:i,levelNum:o,colWidth:n}=t;let r,s=null;if(void 0!==e&&void 0!==i){if(s=this.findLevelByMinUnit(e,i),null===s)return!1}else{if(void 0===o)return!1;if(o<0||o>=this.config.levels.length)return!1;s=o}if(void 0!==n){const t=this.config.levels[s],e=this.findMinTimeUnit(t);r=this.getUnitMilliseconds(e.unit,e.step)/n;const i=this.levelBoundaries[s],o=this.levelBoundaries[s+1];(r<o||r>i)&&(r=(i+o)/2)}else{r=(this.levelBoundaries[s]+this.levelBoundaries[s+1])/2}return s!==this.currentLevelIndex&&this.switchToLevel(s),this.gantt.setMillisecondsPerPixel(r),!0}findLevelByMinUnit(t,e){for(let i=0;i<this.config.levels.length;i++){const o=this.config.levels[i],n=this.findMinTimeUnit(o);if(n.unit===t&&n.step===e)return i}return null}zoomIn(t=1.1,e=!0,i){this.gantt.zoomByFactor(t,e,i)}zoomOut(t=.9,e=!0,i){this.gantt.zoomByFactor(t,e,i)}zoomByPercentage(t,e=!0,i){const o=this.gantt.getCurrentMillisecondsPerPixel(),n=o-(this.globalMaxMillisecondsPerPixel-this.globalMinMillisecondsPerPixel)*t/100;let r;e&&this.gantt.scenegraph&&(void 0===i&&(i=this.gantt.scenegraph.width/2),r=(this.gantt.stateManager.scroll.horizontalBarPos+i)*o);const s=this.findOptimalLevel(n);if(s!==this.getCurrentLevel()&&this.switchToLevel(s),this.gantt.setMillisecondsPerPixel(n),void 0!==r&&void 0!==i){const t=r/this.gantt.getCurrentMillisecondsPerPixel()-i;this.gantt.stateManager.setScrollLeft(t)}}getDataZoomIntegration(){return this.dataZoomIntegration}createDataZoomIntegration(t){return this.dataZoomIntegration&&this.dataZoomIntegration.destroy(),this.dataZoomIntegration=new mW(this.gantt,t),this.dataZoomIntegration}destroyDataZoomIntegration(){this.dataZoomIntegration&&(this.dataZoomIntegration.destroy(),this.dataZoomIntegration=null)}updateDataZoomResponsive(){this.dataZoomIntegration&&this.dataZoomIntegration.updateResponsive()}recalculateTimeScale(){const t=this.gantt.parsedOptions.reverseSortedTimelineScales[0];if(!t)return;let e;switch(t.unit){case"second":e=1e3*t.step;break;case"minute":e=6e4*t.step;break;case"hour":e=36e5*t.step;break;case"day":default:e=864e5*t.step;break;case"week":e=6048e5*t.step;break;case"month":e=2592e6*t.step;break;case"quarter":e=7776e6*t.step;break;case"year":e=31536e6*t.step}const i=e/this.gantt.getCurrentMillisecondsPerPixel();this.gantt.parsedOptions.timelineColWidth=i,this.gantt._generateTimeLineDateMap(),this.gantt.scenegraph&&(this.gantt._updateSize(),this.gantt.scenegraph.refreshAll())}zoomByFactor(t,e=!0,i){const o=this.gantt.parsedOptions.zoom?.minMillisecondsPerPixel??2e5,n=this.gantt.parsedOptions.zoom?.maxMillisecondsPerPixel??3e6,s=this.gantt.getCurrentMillisecondsPerPixel(),a=this.gantt.parsedOptions.timelineColWidth;let l;if(e){void 0===i&&(i=this.gantt.scenegraph.width/2);const t=(this.gantt.stateManager.scroll.horizontalBarPos+i)*s;l=this.gantt.parsedOptions._minDateTime+t}const h=this.gantt.getCurrentMillisecondsPerPixel();let d=t;const c=144e4,u=Math.log(h/c)/Math.log(2);if(h<c){const e=Math.pow(1.2,-u);d=Math.pow(t,e)}else{const e=Math.pow(.9,u);d=Math.pow(t,e)}const g=this.gantt.getCurrentMillisecondsPerPixel()/d,p=Math.max(o,Math.min(n,g));this.gantt.setMillisecondsPerPixel(p);const f=this.findOptimalLevel(p);if(f!==this.getCurrentLevel()?this.switchToLevel(f):this.recalculateTimeScale(),e&&void 0!==l&&void 0!==i){const t=this.gantt.getCurrentMillisecondsPerPixel(),e=(l-this.gantt.parsedOptions._minDateTime)/t-i;this.gantt.stateManager.setScrollLeft(e)}if(this.gantt.hasListeners(r.ZOOM)){const t=this.gantt.getCurrentMillisecondsPerPixel();this.gantt.fireListeners(r.ZOOM,{oldWidth:a,newWidth:this.gantt.parsedOptions.timelineColWidth,scale:s/t,oldMillisecondsPerPixel:s,newMillisecondsPerPixel:t})}}}var yW=Object.freeze({__proto__:null,formatDate:eS,getTodayNearDay:function(t,e){const i=(new Date).getTime(),o=new Date(i+864e5*t);if(e){const t=o.getFullYear().toString(),i=(o.getMonth()+1).toString().padStart(2,"0"),n=o.getDate().toString().padStart(2,"0");return e=(e=(e=e.replace("yyyy",t)).replace("mm",i)).replace("dd",n)}return o},getWeekNumber:hS,getWeekday:function(t,e="long"){const i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=new Date(t);return"short"===e?i[o.getDay()].substr(0,3):"long"===e?i[o.getDay()]:'Invalid format specified. Please use "short" or "long".'}}),CW=Object.freeze({__proto__:null,Arc:Gh,Area:Dh,Circle:nh,Group:fl,Image:Th,Line:mh,Path:Ih,Rect:Ch,RichText:Eh,Text:lh}),wW=Object.freeze({__proto__:null,CustomLayout:zD,TABLE_EVENT_TYPE:uT,TYPES:hA,register:ZF,themes:XT}),xW=Object.freeze({__proto__:null,PluginManager:vW});t.Gantt=class extends pW{options;container;tableNoFrameWidth;tableNoFrameHeight;tableX;tableY;scenegraph;stateManager;eventManager;taskListTableInstance;canvas;element;verticalSplitResizeLine;horizontalSplitLine;context;timeLineHeaderLevel;itemCount;drawHeight;headerHeight;gridHeight;pluginManager;parsedOptions={};millisecondsPerPixel;zoomScaleManager;recalculateTimeScale(){this.zoomScaleManager&&this.zoomScaleManager.recalculateTimeScale()}zoomByFactor(t,e=!0,i){this.zoomScaleManager&&this.zoomScaleManager.zoomByFactor(t,e,i)}taskTableWidth;taskTableColumns;records;data;constructor(t,e){super(),this.container=t,this.options=e,this.taskTableWidth="number"==typeof e?.taskListTable?.tableWidth?e?.taskListTable?.tableWidth:-1,this.taskTableColumns=e?.taskListTable?.columns??[],this.records=e?.records??[],e.timelineHeader?.zoomScale&&!1!==e.timelineHeader.zoomScale.enabled&&(this.zoomScaleManager=new bW(this,e.timelineHeader.zoomScale)),this._sortScales(),MS(this),this.zoomScaleManager?this.millisecondsPerPixel=this.zoomScaleManager.getInitialMillisecondsPerPixel():this.millisecondsPerPixel=144e4,function(t){if(!t.records||0===t.records.length)return;const e=t.parsedOptions.startDateField,i=t.parsedOptions.endDateField,o=(r,s,a)=>{let l=null,h=null;return r.forEach(((s,a)=>{if(!s)return;let d=null,c=null;if(s.children&&s.children.length>0&&s.type===n.PROJECT){const[l,h]=o(s.children);if(l&&h&&(d=l,c=h,s.type===n.PROJECT)){const o=t.parsedOptions.dateFormat??t.parseTimeFormat(s[e]||s.children[0][e]||""),n=e=>t.formatDate?t.formatDate(e,o):e.toISOString().split("T")[0],l={...s};l[e]=n(d),l[i]=n(c),r[a]=l}}else s[e]&&s[i]&&(d=new Date(s[e]),c=new Date(s[i]));d&&(!l||d<l)&&(l=d),c&&(!h||c>h)&&(h=c)})),[l,h]};o(t.records)}(this),this.data=new fW(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.element=function(t,e="vtable-gantt"){const i=document.createElement("div");i.setAttribute("tabindex","0"),i.classList.add(e),i.style.outline="none",i.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const o=(i.offsetWidth||i.parentElement?.offsetWidth||1)-1,n=(i.offsetHeight||i.parentElement?.offsetHeight||1)-1;return i.style.width=o&&o-t.left-t.right+"px"||"0px",i.style.height=n&&n-t.top-t.bottom+"px"||"0px",i}({top:0,right:0,left:0,bottom:0},"vtable-gantt"),this.element.style.left=-1!==this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.context=this.canvas.getContext("2d"),t?(t.appendChild(this.element),this._updateSize()):this._updateSize(),this._generateListTable(),this._syncPropsFromTable(),function(t){if(t.taskListTableInstance){t.verticalSplitResizeLine=document.createElement("div"),t.verticalSplitResizeLine.style.position="absolute",t.verticalSplitResizeLine.style.top=t.tableY+"px",t.verticalSplitResizeLine.style.left=(-1!==t.taskTableWidth?t.taskTableWidth-7+t.parsedOptions.verticalSplitLine.lineWidth/2:0)+"px",t.verticalSplitResizeLine.style.width="14px",t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.verticalSplitResizeLine.style.backgroundColor="rgba(0,0,0,0)",t.verticalSplitResizeLine.style.zIndex="100",t.parsedOptions.verticalSplitLineMoveable&&(t.verticalSplitResizeLine.style.cursor="col-resize"),t.verticalSplitResizeLine.style.userSelect="none",t.verticalSplitResizeLine.style.opacity="1";const e=document.createElement("div");if(e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLine.lineWidth)/2+"px",e.style.width=t.parsedOptions.verticalSplitLine.lineWidth+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLine.lineColor,e.style.zIndex="100",e.style.userSelect="none",e.style.pointerEvents="none",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e),t.parsedOptions.verticalSplitLineHighlight){const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLineHighlight.lineWidth)/2+"px",e.style.width=t.parsedOptions.verticalSplitLineHighlight.lineWidth+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLineHighlight.lineColor,e.style.zIndex="100",e.style.cursor="col-resize",e.style.userSelect="none",e.style.pointerEvents="none",e.style.opacity="0",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e)}t.container.appendChild(t.verticalSplitResizeLine)}}(this),this.scenegraph=new JD(this),this.stateManager=new dW(this),this.eventManager=new aW(this),this.scenegraph.afterCreateSceneGraph(),this._scrollToMarkLine(),this.pluginManager=new vW(this,e),this.recalculateTimeScale()}renderTaskBarsTable(){this.scenegraph.updateNextFrame()}_updateSize(){let t=0,e=0;if("browser"===yS.mode){const i=this.getElement();let o=0,n=0;if(i.parentElement){const t=i.parentElement.style||window.getComputedStyle(i.parentElement);o=i.parentElement.offsetWidth-parseInt(t.paddingLeft||"0px",10)-parseInt(t.paddingRight||"0px",10),n=i.parentElement.offsetHeight-parseInt(t.paddingTop||"0px",10)-parseInt(t.paddingBottom||"0px",20)}const r=(o??1)-1-this.taskTableWidth,s=(n??1)-1-this.getDataZoomHeight();i.style.width=r&&`${r}px`||"0px",i.style.height=s&&`${s}px`||"0px";const{canvas:a}=this;t=a.parentElement?.offsetWidth??1,e=a.parentElement?.offsetHeight??1,this?.scenegraph?.stage?this.scenegraph.stage.resize(t,e):(a.style.width="",a.style.height="",a.width=t,a.height=e,a.style.width=`${t}px`,a.style.height=`${e}px`)}const i=Math.floor(t-(o=this.parsedOptions.scrollStyle,o?.hoverOn||o?.verticalVisible&&"none"===o?.verticalVisible||!o?.verticalVisible&&"none"===o?.visible?0:o?.width??7));var o;const n=Math.floor(e-function(t){return t?.hoverOn||t?.horizontalVisible&&"none"===t?.horizontalVisible||!t?.horizontalVisible&&"none"===t?.visible?0:t?.width??7}(this.parsedOptions.scrollStyle));if(this.tableNoFrameWidth=t,this.tableNoFrameHeight=Math.floor(e),this.parsedOptions.outerFrameStyle){const[t,e,o,r]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);this.tableX=this.taskTableColumns.length>=1||this.options?.rowSeriesNumber?this.parsedOptions.verticalSplitLine.lineWidth??0:r,this.tableY=t,this.tableNoFrameWidth=Math.min(i-e-this.tableX,this.getAllDateColsWidth()),this.tableNoFrameHeight=n-t-o}}_updateListTableSize(t){if(t){if("auto"===this.options?.taskListTable?.tableWidth||-1===this.taskTableWidth){const[e,i,o,n]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);this.taskTableWidth=t.getAllColsWidth()+i,this.options?.taskListTable?.maxTableWidth&&(this.taskTableWidth=Math.min(this.options?.taskListTable?.maxTableWidth,this.taskTableWidth)),this.options?.taskListTable?.minTableWidth&&(this.taskTableWidth=Math.max(this.options?.taskListTable?.minTableWidth,this.taskTableWidth)),this.element.style.left=-1!==this.taskTableWidth?`${this.taskTableWidth}px`:"0px",t.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+e+o),this._updateSize()}if(t.columnHeaderLevelCount>1)if(t.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let e=0;e<t.columnHeaderLevelCount;e++)t.setRowHeight(e,this.parsedOptions.timeLineHeaderRowHeights[e]);else{const e=this.getAllHeaderRowsHeight()/t.columnHeaderLevelCount;for(let i=0;i<t.columnHeaderLevelCount;i++)t.setRowHeight(i,e)}}}_generateListTable(){if(this.taskTableColumns.length>=1||this.options?.rowSeriesNumber){const t=this._generateListTableOptions();this.taskListTableInstance=new ID(this.container,t),this._updateListTableSize(this.taskListTableInstance)}}_generateListTableOptions(){const t={},e=["container","records","rowSeriesNumber","overscrollBehavior","pixelRatio","eventOptions"];for(const i of e)i in this.options&&(t[i]=this.options[i]);if(t.defaultRowHeight=this.options.rowHeight,this.options.taskListTable)for(const e in this.options.taskListTable){if(t[e]=this.options.taskListTable[e],"columns"===e&&(t[e][t[e].length-1].disableColumnResize=!0,this.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||this.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||this.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact))for(let e=0;e<t.columns.length;e++)t.columns[e].tree&&(t.columns[e].tree=!1);"hierarchyExpandLevel"!==e||this.parsedOptions.tasksShowMode!==o.Sub_Tasks_Inline&&this.parsedOptions.tasksShowMode!==o.Sub_Tasks_Separate&&this.parsedOptions.tasksShowMode!==o.Sub_Tasks_Arrange&&this.parsedOptions.tasksShowMode!==o.Sub_Tasks_Compact||delete t[e]}if(this.options.taskListTable?.theme)if(t.theme=this.options.taskListTable?.theme,t.theme.bodyStyle&&!function(t,e){const i=Object.getOwnPropertyDescriptor(t,e);return!(!i||!i.set&&!0!==i.writable)}(t.theme,"bodyStyle")){t.theme=(this.options.taskListTable?.theme).extends((this.options.taskListTable?.theme).getExtendTheme());const e=t.theme.getExtendTheme();t.theme.clearBodyStyleCache(),t.theme.headerStyle?.bgColor||(e.headerStyle?e.headerStyle.bgColor||(e.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):e.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor}),e.bodyStyle?e.bodyStyle.frameStyle={borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}:e.bodyStyle={frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}},e.cellInnerBorder=!1;const[i,o,n,r]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);e.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{shadowBlur:0,cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[i,0,n,r]}),e.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),e.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},e?.columnResize),e.underlayBackgroundColor||(e.underlayBackgroundColor=this.parsedOptions.underlayBackgroundColor)}else{t.theme.headerStyle?t.theme.headerStyle.bgColor||(t.theme.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):t.theme.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor},t.theme.headerStyle=Object.assign({},DT.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),t.theme.bodyStyle=Object.assign({},DT.bodyStyle,this.options.taskListTable?.theme?.bodyStyle,{frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}}),t.theme.cellInnerBorder=!1;const[e,i,o,n]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);t.theme.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[e,0,o,n]}),t.theme.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),t.theme.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize),t.theme.underlayBackgroundColor||(t.theme.underlayBackgroundColor=this.parsedOptions.underlayBackgroundColor)}else{const[e,i,o,n]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);t.theme={scrollStyle:Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),headerStyle:Object.assign({},DT.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),bodyStyle:Object.assign({},DT.bodyStyle,this.options.taskListTable?.theme?.bodyStyle,{frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}}),cellInnerBorder:!1,frameStyle:Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[e,0,o,n]}),columnResize:Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize),underlayBackgroundColor:this.parsedOptions.underlayBackgroundColor}}return t.canvasWidth=this.taskTableWidth,t.canvasHeight=this.canvas.height,t.defaultHeaderRowHeight=this.getAllHeaderRowsHeight(),this.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate?(t.customComputeRowHeight=t=>{const{row:e,table:i}=t,o=i.getRecordByRowCol(0,e);return o?(o.children?.length||1)*this.parsedOptions.rowHeight:this.parsedOptions.rowHeight},t.defaultRowHeight="auto",t.customConfig={forceComputeAllRowHeight:!0}):this.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?(t.customComputeRowHeight=t=>{const{row:e,table:i}=t,o=i.getRecordByRowCol(0,e);return o?function(t,e){if(!e.children||e.children.length<=1)return 1===e.children?.length?e.children[0].vtable_gantt_showIndex=0:e.vtable_gantt_showIndex=0,1;const i=e.children.slice().sort(((e,i)=>{const{startDate:o}=zS(t,e),{startDate:n}=zS(t,i);return o.getTime()-n.getTime()})),o=[];for(let e=0;e<=i.length-1;e++){const n=i[e],{startDate:r,endDate:s}=zS(t,n);let a=!1;for(let t=0;t<o.length;t++)if(r.getTime()>o[t]){o[t]=s.getTime(),a=!0,n.vtable_gantt_showIndex=t;break}a||(o.push(s.getTime()),n.vtable_gantt_showIndex=o.length-1)}return o.length}(this,o)*this.parsedOptions.rowHeight:this.parsedOptions.rowHeight},t.defaultRowHeight="auto",t.customConfig={forceComputeAllRowHeight:!0}):this.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange?(t.customComputeRowHeight=t=>{const{row:e,table:i}=t,o=i.getRecordByRowCol(0,e);return o?function(t,e){if(!e.children||e.children.length<=1)return 1===e.children?.length?e.children[0].vtable_gantt_showIndex=0:e.vtable_gantt_showIndex=0,1;const i=[];for(let o=0;o<=e.children.length-1;o++){const n=e.children[o],{startDate:r,endDate:s}=zS(t,n);let a=!1;for(let o=0;o<i.length;o++)if(!FS(r,s,e.children.filter((t=>t!==n&&t.vtable_gantt_showIndex===o)),t)){i[o]=s.getTime(),a=!0,n.vtable_gantt_showIndex=o;break}a||(i.push(s.getTime()),n.vtable_gantt_showIndex=i.length-1)}return i.length}(this,o)*this.parsedOptions.rowHeight:this.parsedOptions.rowHeight},t.defaultRowHeight="auto",t.customConfig={forceComputeAllRowHeight:!0}):t.defaultRowHeight=this.options.rowHeight??40,t.clearDOM=!1,t}getElement(){return this.element}getContainer(){return this.element.parentElement}_sortScales(){const{timelineHeader:t}=this.options;if(t){const e=t.scales,i=["year","quarter","month","week","day","hour","minute","second"];1===e.length&&("hour"!==e[0].unit&&"minute"!==e[0].unit&&"second"!==e[0].unit||(this.parsedOptions.timeScaleIncludeHour=!0));const o=e.slice().sort(((t,e)=>{"hour"!==t.unit&&"minute"!==t.unit&&"second"!==t.unit||(this.parsedOptions.timeScaleIncludeHour=!0);const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:o-n})),n=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:n-o}));this.parsedOptions.sortedTimelineScales=o,this.parsedOptions.reverseSortedTimelineScales=n}}_generateTimeLineDateMap(){if(this.parsedOptions.minDate&&this.parsedOptions.maxDate)for(const t of this.parsedOptions.reverseSortedTimelineScales)t.timelineDates=kS(new Date(this.parsedOptions.minDate),this.parsedOptions.maxDate,t)}getRowHeightByIndex(t){return this.taskListTableInstance?this.taskListTableInstance.getRowHeight(t+this.taskListTableInstance.columnHeaderLevelCount):this.parsedOptions.rowHeight}getRowsHeightByIndex(t,e){return this.taskListTableInstance?this.taskListTableInstance.getRowsHeight(t+this.taskListTableInstance.columnHeaderLevelCount,e+this.taskListTableInstance.columnHeaderLevelCount):this.parsedOptions.rowHeight*(e-t+1)}getAllRowsHeight(){return this.taskListTableInstance?this.taskListTableInstance.getAllRowsHeight():this.getAllHeaderRowsHeight()+this.itemCount*this.parsedOptions.rowHeight}getAllHeaderRowsHeight(){return this.parsedOptions.timeLineHeaderRowHeights.reduce(((t,e,i)=>!1===this.parsedOptions.sortedTimelineScales[i].visible?t:t+e),0)}getAllDateColsWidth(){return this.parsedOptions.timelineColWidth*(this.parsedOptions.reverseSortedTimelineScales[0].timelineDates?.length??0)}getAllTaskBarsHeight(){return this.taskListTableInstance?this.taskListTableInstance.getRowsHeight(this.taskListTableInstance.columnHeaderLevelCount,this.taskListTableInstance.rowCount-1):this.itemCount*this.parsedOptions.rowHeight}getRecordIndexByTaskShowIndex(t){return this.taskListTableInstance?this.taskListTableInstance.getRecordIndexByCell(0,this.taskListTableInstance.columnHeaderLevelCount+t):t}getTaskShowIndexByRecordIndex(t){return this.taskListTableInstance.getBodyRowIndexByRecordIndex(t)}getRecordByIndex(t,e){if(this.taskListTableInstance){if(pt(e)){const i=this.taskListTableInstance.getRecordByCell(0,t+this.taskListTableInstance.columnHeaderLevelCount);if(Array.isArray(e)){const o=this.getRecordIndexByTaskShowIndex(t),n=Array.isArray(o)?o.length:1,r=[...e];r.splice(0,n);let s=i;for(;r.length>0;){const t=r.shift();s=s?.children?.[t]}return s}return i?.children?.[e]}return this.taskListTableInstance.getRecordByCell(0,t+this.taskListTableInstance.columnHeaderLevelCount)}return this.records[t]}_refreshTaskBar(t,e){this.scenegraph.taskBar.updateTaskBarNode(t,e),this.scenegraph.refreshRecordLinkNodes(t,void 0,this.scenegraph.taskBar.getTaskBarNodeByIndex(t,e)),this.scenegraph.updateNextFrame()}_updateRecordToListTable(t,e){this.taskListTableInstance.updateRecords([t],[e])}getTaskInfoByTaskListIndex(t,e){const i=this.getRecordByIndex(t,e),o=i?.type,n=this.parsedOptions.startDateField,r=this.parsedOptions.endDateField,s=this.parsedOptions.progressField,a=dS(i?.[n]).getTime(),l=dS(i?.[r]).getTime();if(o&&!i?.[n]||!o&&(l<this.parsedOptions._minDateTime||a>this.parsedOptions._maxDateTime||!i?.[n]||!i?.[r]))return{taskDays:0,progress:0,startDate:null,endDate:null,taskRecord:i};const h=function(t){return"string"==typeof t&&(t=t.replace("%",""),t=parseFloat(t)),isNaN(t)?0:Math.max(0,Math.min(100,Math.round(10*t)/10))}(i[s]);let d,c;if(this.parsedOptions.timeScaleIncludeHour){d=dS(Math.min(Math.max(this.parsedOptions._minDateTime,a),this.parsedOptions._maxDateTime));const t=i?.[r];let e=!1;"string"==typeof t&&(e=/:\d{2}\.\d+/.test(t));const o=!e;c=gS(Math.max(Math.min(this.parsedOptions._maxDateTime,l),this.parsedOptions._minDateTime),o)}else d=dS(Math.min(Math.max(this.parsedOptions._minDateTime,a),this.parsedOptions._maxDateTime),!0),c=pS(Math.max(Math.min(this.parsedOptions._maxDateTime,l),this.parsedOptions._minDateTime),!0);return{taskRecord:i,taskDays:(c.getTime()-d.getTime()+1)/864e5,startDate:d,endDate:c,progress:h}}_updateStartDateToTaskRecord(t,e,i){const o=this.getRecordByIndex(e,i),n=this.parsedOptions.startDateField,r=eS(t,this.parsedOptions.dateFormat??rS(o[n]));if(o[n]=r,pt(i))Array.isArray(i)&&this.stateManager.updateProjectTaskTimes(i);else{const t=this.getRecordIndexByTaskShowIndex(e);this._updateRecordToListTable(o,t),Array.isArray(t)&&this.stateManager.updateProjectTaskTimes(t)}}_updateEndDateToTaskRecord(t,e,i){const o=this.getRecordByIndex(e,i),n=this.parsedOptions.endDateField,r=eS(t,this.parsedOptions.dateFormat??rS(o[n]));if(o[n]=r,pt(i))Array.isArray(i)&&this.stateManager.updateProjectTaskTimes(i);else{const t=this.getRecordIndexByTaskShowIndex(e);this._updateRecordToListTable(o,t),Array.isArray(t)&&this.stateManager.updateProjectTaskTimes(t)}}_updateStartEndDateToTaskRecord(t,e,i,o){const n=this.getRecordByIndex(i,o),r=this.parsedOptions.startDateField,s=this.parsedOptions.endDateField,a=this.parsedOptions.dateFormat??rS(n[r]),l=eS(t,a);n[r]=l;const h=eS(e,a);if(n[s]=h,pt(o))Array.isArray(o)&&this.stateManager.updateProjectTaskTimes(o);else{const t=this.getRecordIndexByTaskShowIndex(i);this._updateRecordToListTable(n,t),Array.isArray(t)&&this.stateManager.updateProjectTaskTimes(t)}}_updateProgressToTaskRecord(t,e,i){const o=this.getRecordByIndex(e,i),n=this.parsedOptions.progressField;if(n){o[n]=t;const r=this.getRecordIndexByTaskShowIndex(e);this._updateRecordToListTable(o,r),this._refreshTaskBar(e,i)}}_dragOrderTaskRecord(t,e,i,o){this.data.adjustOrder(t,e,i,o)}updateTaskRecord(t,e,i){if(pt(i)){const o="number"==typeof e?e:e[0];return this._updateRecordToListTable(t,[o,i]),void this._refreshTaskBar(o,i)}if(Array.isArray(e)){const i=e[0],o=e[1];return this._updateRecordToListTable(t,e),void this._refreshTaskBar(i,o)}let o=e;"tree"===this.taskListTableInstance.rowHierarchyType&&(o=this.taskListTableInstance.getRecordIndexByCell(0,e+this.taskListTableInstance.columnHeaderLevelCount)),this._updateRecordToListTable(t,o),this._refreshTaskBar(e,void 0)}setPixelRatio(t){this.taskListTableInstance?.setPixelRatio(t),this.parsedOptions.pixelRatio=t,this.scenegraph.setPixelRatio(t)}updateTasksShowMode(t){this.options.tasksShowMode=t,this.updateOption(this.options)}_resize(){this._updateSize(),this.taskListTableInstance?.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0)[0]+oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0)[2]),this._syncPropsFromTable(),this.scenegraph.resize(),LS(this)}_syncPropsFromTable(){this.itemCount=this.taskListTableInstance?this.taskListTableInstance.rowCount-this.taskListTableInstance.columnHeaderLevelCount:this.records.length,this.headerHeight=this.getAllHeaderRowsHeight(),this.drawHeight=Math.min(this.getAllRowsHeight(),this.tableNoFrameHeight),this.gridHeight=this.drawHeight-this.headerHeight}hasDataZoom(){if(!this.zoomScaleManager)return!1;const t=this.zoomScaleManager.config?.dataZoomAxis;return!(!t||!1===t.enabled)&&null!==this.zoomScaleManager.getDataZoomIntegration()}getDataZoomHeight(){return this.hasDataZoom()?this.zoomScaleManager?.config?.dataZoomAxis?.height||30:0}getContext(){return this.context}release(){super.release?.(),this.eventManager.release(),this.taskListTableInstance?.release(),this.zoomScaleManager&&(this.zoomScaleManager.destroyDataZoomIntegration(),this.zoomScaleManager=null);const t=this.element?.parentElement;t&&(t.removeChild(this.element),this.verticalSplitResizeLine&&t.removeChild(this.verticalSplitResizeLine),this.horizontalSplitLine&&t.removeChild(this.horizontalSplitLine)),this.scenegraph=null,this.pluginManager.release()}updateOption(t){if(this.parsedOptions={},this.options=t,this.taskTableWidth="number"==typeof t?.taskListTable?.tableWidth?t?.taskListTable?.tableWidth:-1,this.taskTableColumns=t?.taskListTable?.columns??[],this.records=t?.records??[],this._sortScales(),MS(this),this.data.setRecords(this.records),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this._updateSize(),this.taskListTableInstance){const t=this._generateListTableOptions();this.taskListTableInstance.updateOption(t),this._updateListTableSize(this.taskListTableInstance)}this._syncPropsFromTable(),this.scenegraph.updateStageBackground(),this.element.style.left=-1!==this.taskTableWidth?`${this.taskTableWidth}px`:"0px",LS(this),this.scenegraph.updateSceneGraph(),this.scenegraph.afterCreateSceneGraph(),this._scrollToMarkLine()}setRecords(t){this.records=t,this.data.setRecords(t),function(t){const e=t.options,{unit:i,startOfWeek:o}=t.parsedOptions.reverseSortedTimelineScales[0];t.parsedOptions.markLine=RS(e?.markLine),t.parsedOptions.markLine?.length&&(t.parsedOptions.markLine?.every((t=>void 0===t.scrollToMarkLine))&&(t.parsedOptions.markLine[0].scrollToMarkLine=!0),t.parsedOptions.markLine?.find((t=>t.scrollToMarkLine))&&(t.parsedOptions.scrollToMarkLineDate=vS(new Date(t.parsedOptions.markLine?.find((t=>t.scrollToMarkLine)).date),i,o))),t.parsedOptions.dependencyLinks=e.dependency?.links??[]}(this),this.taskListTableInstance.setRecords(t),this._syncPropsFromTable(),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this._updateSize(),this.scenegraph.refreshAll(),this.verticalSplitResizeLine.style.height=this.drawHeight+"px";const e=this.stateManager.scroll.horizontalBarPos,i=this.stateManager.scroll.verticalBarPos;this.scenegraph.setX(-e),this.scenegraph.setY(-i)}updateScales(t){const e=this.parsedOptions.sortedTimelineScales.length;if(this.options.timelineHeader.scales=t,this._sortScales(),function(t){const e=t.options,{unit:i,startOfWeek:o,step:n}=t.parsedOptions.reverseSortedTimelineScales[0];t.parsedOptions.minDate=vS(new Date(t.parsedOptions.minDate),i,o),t.parsedOptions.maxDate=fS(t.parsedOptions.minDate,new Date(t.parsedOptions.maxDate),i,n),t.parsedOptions._minDateTime=t.parsedOptions.minDate?.getTime(),t.parsedOptions._maxDateTime=t.parsedOptions.maxDate?.getTime(),t.parsedOptions.timeLineHeaderRowHeights=[],t.parsedOptions.timelineHeaderStyles=[];for(let i=0;i<t.parsedOptions.sortedTimelineScales.length;i++){const o=t.parsedOptions.sortedTimelineScales[i].style;t.parsedOptions.timelineHeaderStyles.push(Object.assign({fontSize:20,fontWeight:"bold",textAlign:"center",textBaseline:"middle",color:"#000",backgroundColor:"#fff"},o)),t.parsedOptions.timeLineHeaderRowHeights.push(t.parsedOptions.sortedTimelineScales[i].rowHeight??e?.headerRowHeight??40)}}(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.scenegraph.refreshAll(),LS(this),this.taskListTableInstance)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}e!==t.length&&this._resize()}updateDateRange(t,e){this.options.minDate=t,this.options.maxDate=e,function(t){const e=t.options,{unit:i,startOfWeek:o,step:n}=t.parsedOptions.reverseSortedTimelineScales[0];t.parsedOptions.minDate=e?.minDate?vS(new Date(e.minDate),i,o):void 0,t.parsedOptions.maxDate=e?.maxDate?fS(t.parsedOptions.minDate,new Date(e.maxDate),i,n):void 0,t.parsedOptions._minDateTime=t.parsedOptions.minDate?.getTime(),t.parsedOptions._maxDateTime=t.parsedOptions.maxDate?.getTime()}(this),this._generateTimeLineDateMap(),this._updateSize(),this.scenegraph.refreshAll(),this._scrollToMarkLine()}updateMarkLine(t){this.options.markLine=t,DS(this),this.scenegraph.markLine.refresh(),this.scenegraph.renderSceneGraph()}addMarkLine(t){this.options.markLine=[...this.parsedOptions.markLine,t],DS(this),this.scenegraph.markLine.refresh(),this.scenegraph.renderSceneGraph(),this.scenegraph.updateNextFrame()}updateCurrentMarkLine(t){const e=this.parsedOptions.markLine.findIndex((e=>e.date===t.date));-1!==e&&(this.options.markLine=[...this.parsedOptions.markLine.slice(0,e),{...this.options.markLine[e],...t},...this.parsedOptions.markLine.slice(e+1)],DS(this),this.scenegraph.markLine.refresh(),this.scenegraph.renderSceneGraph(),this.scenegraph.updateNextFrame())}_scrollToMarkLine(){if(this.parsedOptions.scrollToMarkLineDate&&this.parsedOptions.minDate){const t=this.parsedOptions.minDate,{unit:e,step:i}=this.parsedOptions.reverseSortedTimelineScales[0],o=mS(this.parsedOptions.scrollToMarkLineDate,t,e,i)*this.parsedOptions.timelineColWidth-this.tableNoFrameWidth/2;this.stateManager.setScrollLeft(o)}}scrollToMarkLine(t){if(!t||!this.parsedOptions.minDate)return;const e=this.parsedOptions.minDate,{unit:i,step:o}=this.parsedOptions.reverseSortedTimelineScales[0],n=mS(t,e,i,o)*this.parsedOptions.timelineColWidth-this.tableNoFrameWidth/2;this.stateManager.setScrollLeft(n)}addLink(t){this.parsedOptions.dependencyLinks.push(t),this.scenegraph.dependencyLink.initLinkLine(this.parsedOptions.dependencyLinks.length-1),this.scenegraph.updateNextFrame()}deleteLink(t){if(this.parsedOptions.dependencyLinkDeletable){const e=this.parsedOptions.dependencyLinks.findIndex((e=>e.type===t.type&&e.linkedFromTaskKey===t.linkedFromTaskKey&&e.linkedToTaskKey===t.linkedToTaskKey));if(-1!==e){const t=this.parsedOptions.dependencyLinks[e];this.parsedOptions.dependencyLinks.splice(e,1),this.scenegraph.dependencyLink.deleteLink(t),this.scenegraph.updateNextFrame()}}}get scrollTop(){return this.stateManager.scrollTop}set scrollTop(t){this.stateManager.setScrollTop(t)}get scrollLeft(){return this.stateManager.scrollLeft}set scrollLeft(t){this.stateManager.setScrollLeft(t)}getTaskBarRelativeRect(t){const e=this.scenegraph.taskBar.getTaskBarNodeByIndex(t);return{left:e.attribute.x+this.taskListTableInstance.tableNoFrameWidth+this.taskListTableInstance.tableX+this.tableX-this.scrollLeft,top:e.attribute.y+this.tableY+this.headerHeight-this.scrollTop,width:e.attribute.width,height:e.attribute.height}}getDateColWidth(t){return this.parsedOptions.timelineColWidth}getDateColsWidth(t,e){return(e-t+1)*this.parsedOptions.timelineColWidth}getDateRangeByIndex(t){const e=this.parsedOptions.reverseSortedTimelineScales[0];if(t<e.timelineDates.length){return{startDate:e.timelineDates[t].startDate,endDate:e.timelineDates[t].endDate}}return null}parseTimeFormat(t){return rS(t)}getTaskBarStyle(t,e){const{startDate:i,endDate:o,taskRecord:r}=this.getTaskInfoByTaskListIndex(t,e);let s;if(s=r.type===n.PROJECT?this.parsedOptions.projectBarStyle:this.parsedOptions.taskBarStyle,"function"==typeof s){return s({index:t,startDate:i,endDate:o,taskRecord:r,ganttInstance:this})}return s}formatDate(t,e){return eS(t instanceof Date?t:new Date(t),e)}getCurrentMillisecondsPerPixel(){return this.millisecondsPerPixel}setMillisecondsPerPixel(t){const e=this.parsedOptions.zoom?.minMillisecondsPerPixel??2e5,i=this.parsedOptions.zoom?.maxMillisecondsPerPixel??3e6,o=this.millisecondsPerPixel,n=this.parsedOptions.timelineColWidth;this.millisecondsPerPixel=Math.max(e,Math.min(i,t)),this.recalculateTimeScale(),this._updateSize(),this.scenegraph.refreshAll();const s=this.parsedOptions.timelineColWidth,a=s/n;this.hasListeners(r.ZOOM)&&this.fireListeners(r.ZOOM,{oldWidth:n,newWidth:s,scale:a,oldMillisecondsPerPixel:o,newMillisecondsPerPixel:this.millisecondsPerPixel})}getCurrentZoomScaleLevel(){return this.zoomScaleManager?.getCurrentLevel()??-1}},t.TYPES=s,t.VRender=CW,t.VTable=wW,t.plugins=xW,t.tools=yW,t.version="1.0.0"}));
|
|
15
|
+
***************************************************************************** */let VD=class{time=Ii.beforeFillStroke;useStyle=!0;order=0;supportedAppName="vtable";drawShape(t,e,i,o,n,r,s,a,l,h,d,c,u){"date-header-cell"===t.name&&t.forEachChildren((t=>{if("date-header-cell-text"===t.name&&!0===t.attribute.textStick){const e=t;e.setAttribute("dx",0);const i=e.globalAABBBounds,o=e.stage.globalAABBBounds,n=e.parent.globalAABBBounds,r=o.intersect(n);o.intersect(n)&&(i.width()>=r.width()&&e.attribute.last_dx?e.setAttribute("dx",e.attribute.last_dx??0):o.x1>=i.x1?(e.setAttribute("dx",o.x1-i.x1),e.setAttribute("last_dx",o.x1-i.x1)):o.x2<=i.x2&&(e.setAttribute("dx",o.x2-i.x2),e.setAttribute("last_dx",o.x1-i.x1)))}}))}};VD=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s}([w()],VD);var XD=new l(((t,e,i,o)=>{t(VD).toSelf().inSingletonScope(),t(Nl).toService(VD)}));class YD{_scene;group;lineVertical;lineHorizontal;constructor(t){this._scene=t,this.createAddButton()}createAddButton(){this._scene._gantt.parsedOptions.taskBarCreationCustomLayout?this.group=new fl({x:0,y:0,width:100,height:100}):(this.group=new fl({x:0,y:0,width:100,height:100,lineDash:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineDash,cursor:"pointer",lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,cornerRadius:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.cornerRadius??0,fill:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.backgroundColor}),this.lineVertical=bh({pickable:!1,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,points:[{x:50,y:0},{x:50,y:100}]}),this.group.appendChild(this.lineVertical),this.lineHorizontal=bh({pickable:!1,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,points:[{x:0,y:50},{x:100,y:50}]}),this.group.appendChild(this.lineHorizontal)),this.group.name="task-creation-button",this._scene.taskBar.group.addChild(this.group)}show(t,e,i,o){if(this._scene._gantt.parsedOptions.taskBarCreationCustomLayout)this.group.appendChild(this._scene._gantt.parsedOptions.taskBarCreationCustomLayout({width:i,height:o,ganttInstance:this._scene._gantt}).rootContainer);else{const t=Math.min(i,o)/6;this.lineHorizontal.setAttribute("points",[{x:(i-4*t)/2,y:o/2},{x:(i-4*t)/2+4*t,y:o/2}]),this.lineVertical.setAttribute("points",[{x:i/2,y:(o-4*t)/2},{x:i/2,y:(o-4*t)/2+4*t}])}this.group.setAttribute("x",t),this.group.setAttribute("y",e),this.group.setAttribute("width",i),this.group.setAttribute("height",o),this.group.setAttribute("visibleAll",!0)}hide(){this.group.setAttribute("visibleAll",!1),this._scene._gantt.parsedOptions.taskBarCreationCustomLayout&&this.group.removeAllChild()}}class $D{_scene;group;constructor(t){this._scene=t,this.group=new vy({position:"top",content:"",contentStyle:{fill:"#fff"},visible:!1,panel:{background:"#14161c",cornerRadius:4}}),t.ganttGroup.addChild(this.group)}show(t){const e=this._scene._gantt.parsedOptions.markLineCreateOptions?.markLineCreationHoverToolTip||{},i=t.globalTransMatrix,o=t.attribute.width,n=t.attribute.height;let r,s;const a=e.position||"top";"top"===a?(r=i.e+o/2-2,s=i.f):"bottom"===a&&(r=i.e+o/2-2,s=i.f+n);const l=e.style?.contentStyle||{fill:"#fff"},h=e.style?.panelStyle||{background:"#14161c",cornerRadius:4};this.group.setAttributes({content:e.tipContent,position:a,visibleAll:!0,visible:!0,contentStyle:l,panel:{...h,visible:!0},x:r,y:s})}hide(){this.group.setAttributes({visibleAll:!1,visible:!1})}}class KD{group;linkLinesContainer;_scene;width;height;selectedEffectNodes;constructor(t){this._scene=t,this.width=t._gantt.tableNoFrameWidth,this.height=t._gantt.gridHeight,this.group=new fl({x:0,y:t._gantt.getAllHeaderRowsHeight(),width:this.width,height:this.height,pickable:!1,clip:!0}),this.group.name="dependency-link-container",t.ganttGroup.addChild(this.group),this.initLinkLines()}initLinkLines(){if(OS(this._scene._gantt.records),this.linkLinesContainer=new fl({x:0,y:0,width:this._scene._gantt.getAllDateColsWidth(),height:this._scene._gantt.getAllTaskBarsHeight(),pickable:!1,clip:!0}),this.group.appendChild(this.linkLinesContainer),this._scene._gantt.records?.length)for(let t=0;t<this._scene._gantt.parsedOptions.dependencyLinks.length;t++)this.initLinkLine(t)}initLinkLine(t){const{taskKeyField:e,dependencyLinks:r}=this._scene._gantt.parsedOptions,s=r[t],{linkedToTaskKey:a,linkedFromTaskKey:l,type:h}=s,d=ES(this._scene._gantt.records,e,a),c=ES(this._scene._gantt.records,e,l);if(!d||!c)return;let u,g,p,f,v,m,b,y;if(d.record.vtable_gantt_linkedTo||(d.record.vtable_gantt_linkedTo=[]),d.record.vtable_gantt_linkedTo.push(s),c.record.vtable_gantt_linkedFrom||(c.record.vtable_gantt_linkedFrom=[]),c.record.vtable_gantt_linkedFrom.push(s),this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline)y=c.index[0],b=d.index[0],({startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(d.index[0],d.index[1])),({startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(c.index[0],c.index[1]));else if(this._scene._gantt.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){const t=this._scene._gantt.getTaskShowIndexByRecordIndex(c.index.slice(0,-1)),e=this._scene._gantt.getTaskShowIndexByRecordIndex(d.index.slice(0,-1)),i=this._scene._gantt.getRecordByIndex(t),o=this._scene._gantt.getRecordByIndex(e);y=i.type===n.PROJECT&&"expand"!==i.hierarchyState&&!1!==this._scene._gantt.parsedOptions.projectSubTasksExpandable?t:this._scene._gantt.getTaskShowIndexByRecordIndex(c.index),b=o.type===n.PROJECT&&"expand"!==o.hierarchyState&&!1!==this._scene._gantt.parsedOptions.projectSubTasksExpandable?e:this._scene._gantt.getTaskShowIndexByRecordIndex(d.index),({startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(b,d.index)),({startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(y,c.index))}else if(this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){y=this._scene._gantt.getRowsHeightByIndex(0,c.index[0]-1)/this._scene._gantt.parsedOptions.rowHeight+(this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?c.record.vtable_gantt_showIndex:c.index[1]??0);b=this._scene._gantt.getRowsHeightByIndex(0,d.index[0]-1)/this._scene._gantt.parsedOptions.rowHeight+(this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._scene._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?d.record.vtable_gantt_showIndex:d.index[1]??0),({startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(d.index[0],d.index[1])),({startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(c.index[0],c.index[1]))}else y=this._scene._gantt.getTaskShowIndexByRecordIndex(c.index),b=this._scene._gantt.getTaskShowIndexByRecordIndex(d.index),({startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(b)),({startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(y));if(!m||!p)return;dS(this._scene._gantt.parsedOptions.minDate);const{arrowPoints:C,linePoints:w}=function(t,e,o,n,r,s,a,l,h,d,c,u){const{unit:g,step:p}=u.parsedOptions.reverseSortedTimelineScales[0],{minDate:f,rowHeight:v,timelineColWidth:m}=u.parsedOptions,b=u.parsedOptions.taskBarMilestoneHypotenuse,y=u.parsedOptions.dependencyLinkDistanceToTaskBar??20,C=10,w=5;let x=[],_=[];if(t===i.FinishToStart){let t=mS(o,f,g,p,1)*m;s&&(t=mS(e,f,g,p,1)*m+b/2);let i=mS(a,f,g,p)*m;c&&(i-=b/2),x=[{x:t,y:v*(n+.5)},{x:t+y,y:v*(n+.5)},{x:t+y,y:v*(n+(n>h?0:1))},{x:i-y,y:v*(n+(n>h?0:1))},{x:i-y,y:v*(h+.5)},{x:i,y:v*(h+.5)}],t+y<=i-y&&x.splice(2,3,{x:t+y,y:v*(h+.5)});const r=x[x.length-1];_=[{x:r.x,y:r.y},{x:r.x-C,y:r.y-w},{x:r.x-C,y:r.y+w},{x:r.x,y:r.y}]}else if(t===i.StartToFinish){let t=mS(e,f,g,p)*m;s&&(t-=b/2);let i=mS(l,f,g,p,1)*m;c&&(i=mS(a,f,g,p,1)*m+b/2),x=[{x:t,y:v*(n+.5)},{x:t-y,y:v*(n+.5)},{x:t-y,y:v*(n+(n>h?0:1))},{x:i+y,y:v*(n+(n>h?0:1))},{x:i+y,y:v*(h+.5)},{x:i,y:v*(h+.5)}],t-y>=i+y&&x.splice(2,3,{x:t-y,y:v*(h+.5)});const o=x[x.length-1];_=[{x:o.x,y:o.y},{x:o.x+C,y:o.y-w},{x:o.x+C,y:o.y+w},{x:o.x,y:o.y}]}else if(t===i.StartToStart){let t=mS(e,f,g,p)*m;s&&(t-=b/2);let i=mS(a,f,g,p)*m;c&&(i-=b/2),x=[{x:t,y:v*(n+.5)},{x:(n===h?t:Math.min(t,i))-y,y:v*(n+.5)},{x:(n===h?t:Math.min(t,i))-y,y:v*(h+(n===h?1:.5))},{x:i-y,y:v*(h+(n===h?1:.5))},{x:(n===h?i:Math.min(t,i))-y,y:v*(h+.5)},{x:i,y:v*(h+.5)}];const o=x[x.length-1];_=[{x:o.x,y:o.y},{x:o.x-C,y:o.y-w},{x:o.x-C,y:o.y+w},{x:o.x,y:o.y}]}else if(t===i.FinishToFinish){let t=mS(o,f,g,p,1)*m;s&&(t=mS(e,f,g,p,1)*m+b/2);let i=mS(l,f,g,p,1)*m;c&&(i=mS(a,f,g,p,1)*m+b/2),x=[{x:t,y:v*(n+.5)},{x:(n===h?t:Math.max(t,i))+y,y:v*(n+.5)},{x:(n===h?t:Math.max(t,i))+y,y:v*(h+(n===h?1:.5))},{x:i+y,y:v*(h+(n===h?1:.5))},{x:i+y,y:v*(h+.5)},{x:i,y:v*(h+.5)}];const r=x[x.length-1];_=[{x:r.x,y:r.y},{x:r.x+C,y:r.y-w},{x:r.x+C,y:r.y+w},{x:r.x,y:r.y}]}return{linePoints:x,arrowPoints:_}}(h,f,v,y,0,c.record.type===n.MILESTONE,u,g,b,0,d.record.type===n.MILESTONE,this._scene._gantt),x=this._scene._gantt.parsedOptions.dependencyLinkLineStyle,_=bh({pickable:!0,stroke:s.linkLineStyle?.lineColor??x.lineColor,lineWidth:s.linkLineStyle?.lineWidth??x.lineWidth,lineDash:s.linkLineStyle?.lineDash??x.lineDash,points:w,pickStrokeBuffer:3,vtable_link:s});this.linkLinesContainer.appendChild(_),s.vtable_gantt_linkLineNode=_;const S=new Vh({fill:s.linkLineStyle?.lineColor??x.lineColor,points:C});this.linkLinesContainer.appendChild(S),s.vtable_gantt_linkArrowNode=S}setX(t){this.linkLinesContainer.setAttribute("x",t)}setY(t){this.linkLinesContainer.setAttribute("y",t)}refresh(){this.width=this._scene._gantt.tableNoFrameWidth,this.height=this._scene._gantt.gridHeight,this.group.setAttributes({height:this.height,width:this.width,y:this._scene._gantt.getAllHeaderRowsHeight()});const t=this.linkLinesContainer.attribute.x,e=this.linkLinesContainer.attribute.y;this.linkLinesContainer.removeAllChild(),this.group.removeChild(this.linkLinesContainer),this.initLinkLines(),this.setX(t),this.setY(e)}resize(){this.width=this._scene._gantt.tableNoFrameWidth,this.height=this._scene._gantt.gridHeight,this.group.setAttribute("width",this.width),this.group.setAttribute("height",this.height)}createSelectedLinkLine(t){const e=t.vtable_gantt_linkLineNode,i=t.vtable_gantt_linkArrowNode,o=e.clone(),n=i.clone();o.setAttribute("stroke",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineColor),o.setAttribute("lineWidth",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineWidth),o.setAttribute("shadowColor",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowColor),o.setAttribute("shadowOffsetX",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowOffset),o.setAttribute("shadowOffsetY",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowOffset),o.setAttribute("shadowBlur",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowBlur),this.linkLinesContainer.appendChild(o),n.setAttribute("fill",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineColor),this.linkLinesContainer.appendChild(n),this.selectedEffectNodes=[o,n]}removeSelectedLinkLine(){this.selectedEffectNodes?.forEach((t=>{t.delete()})),this.selectedEffectNodes=[]}deleteLink(t){const e=t.vtable_gantt_linkLineNode,i=t.vtable_gantt_linkArrowNode;e.delete(),i.delete()}}function ZD(t,e,o,n,r,s,a,l,h,d,c,u,g,p,f,v){const{unit:m,step:b}=v.parsedOptions.reverseSortedTimelineScales[0],{minDate:y,rowHeight:C,timelineColWidth:w}=v.parsedOptions,x=v.parsedOptions.taskBarMilestoneHypotenuse,_=v.parsedOptions.taskBarMilestoneStyle.width,S=v.parsedOptions.dependencyLinkDistanceToTaskBar??20,A=10;let T=[],B=[];if(t===i.FinishToStart){let t=a?a.attribute.x+a.attribute.width:mS(o,y,m,b,1)*w;s&&(t=a?a.attribute.x+a.attribute.width+(x-_)/2:mS(e,y,m,b,1)*w+x/2);let i=p?p.attribute.x:mS(h,y,m,b)*w;g&&(i-=(x-_)/2),T=[{x:t,y:C*(n+.5)+l},{x:t+S,y:C*(n+.5)+l},{x:t+S,y:C*(n+(n>c?0:1))+l},{x:i-S,y:C*(n+(n>c?0:1))+l},{x:i-S,y:C*(c+.5)+f},{x:i,y:C*(c+.5)+f}],t+S<=i-S&&T.splice(2,3,{x:t+S,y:C*(c+.5)+f});const r=T[T.length-1];B=[{x:r.x,y:r.y},{x:r.x-A,y:r.y-5},{x:r.x-A,y:r.y+5},{x:r.x,y:r.y}]}else if(t===i.StartToFinish){let t=a?a.attribute.x:mS(e,y,m,b)*w;s&&(t-=(x-_)/2);let i=p?p.attribute.x+p.attribute.width:mS(d,y,m,b,1)*w;g&&(i=p?p.attribute.x+p.attribute.width+(x-_)/2:mS(h,y,m,b,1)*w+x/2),T=[{x:t,y:C*(n+.5)+l},{x:t-S,y:C*(n+.5)+l},{x:t-S,y:C*(n+(n>c?0:1))+l},{x:i+S,y:C*(n+(n>c?0:1))+l},{x:i+S,y:C*(c+.5)+f},{x:i,y:C*(c+.5)+f}],t-S>=i+S&&T.splice(2,3,{x:t-S,y:C*(c+.5)+f});const o=T[T.length-1];B=[{x:o.x,y:o.y},{x:o.x+A,y:o.y-5},{x:o.x+A,y:o.y+5},{x:o.x,y:o.y}]}else if(t===i.StartToStart){let t=a?a.attribute.x:mS(e,y,m,b)*w;s&&(t-=(x-_)/2);let i=p?p.attribute.x:mS(h,y,m,b)*w;g&&(i-=(x-_)/2),T=[{x:t,y:C*(n+.5)+l},{x:(n===c?t:Math.min(t,i))-S,y:C*(n+.5)+l},{x:(n===c?t:Math.min(t,i))-S,y:C*(c+(n===c?1:.5))+f},{x:i-S,y:C*(c+(n===c?1:.5))+f},{x:(n===c?i:Math.min(t,i))-S,y:C*(c+.5)+f},{x:i,y:C*(c+.5)+f}];const o=T[T.length-1];B=[{x:o.x,y:o.y},{x:o.x-A,y:o.y-5},{x:o.x-A,y:o.y+5},{x:o.x,y:o.y}]}else if(t===i.FinishToFinish){let t=a?a.attribute.x+a.attribute.width:mS(o,y,m,b,1)*w;s&&(t=a?a.attribute.x+a.attribute.width+(x-_)/2:mS(e,y,m,b,1)*w+x/2);let i=p?p.attribute.x+p.attribute.width:mS(d,y,m,b,1)*w;g&&(i=p?p.attribute.x+p.attribute.width+(x-_)/2:mS(h,y,m,b,1)*w+x/2),T=[{x:t,y:C*(n+.5)+l},{x:(n===c?t:Math.max(t,i))+S,y:C*(n+.5)+l},{x:(n===c?t:Math.max(t,i))+S,y:C*(c+(n===c?1:.5))+f},{x:i+S,y:C*(c+(n===c?1:.5))+f},{x:i+S,y:C*(c+.5)+f},{x:i,y:C*(c+.5)+f}];const r=T[T.length-1];B=[{x:r.x,y:r.y},{x:r.x+A,y:r.y-5},{x:r.x+A,y:r.y+5},{x:r.x,y:r.y}]}return{linePoints:T,arrowPoints:B}}class qD{_scene;dragLineContainer;dragLine;constructor(t){this._scene=t,this.dragLineContainer=new fl({x:0,y:0,width:t._gantt.tableNoFrameWidth,height:Math.min(t._gantt.tableNoFrameHeight,t._gantt.drawHeight),pickable:!1,clip:!0,visible:!1}),this.dragLineContainer.name="drag-order-line-container",t.ganttGroup.addChild(this.dragLineContainer),this.initDragLine()}initDragLine(){if(this._scene._gantt.taskListTableInstance){const t=this._scene._gantt.taskListTableInstance.theme.dragHeaderSplitLine,e=bh({pickable:!1,stroke:"function"==typeof t.lineColor?t.lineColor({}):t.lineColor,lineWidth:t.lineWidth,points:[]});this.dragLine=e,this.dragLineContainer.appendChild(e)}}showDragLine(t){this.dragLineContainer.showAll(),this.dragLine.setAttribute("points",[{x:0,y:t},{x:this._scene._gantt.tableNoFrameWidth,y:t}])}hideDragLine(){this.dragLineContainer.hideAll()}}V.load(XD);class JD{dateStepWidth;rowHeight;_scales;timelineHeader;grid;dependencyLink;taskBar;_gantt;ganttGroup;scrollbarComponent;markLine;dragOrderLine;frameBorder;taskCreationButton;toolTip;stage;tableGroupWidth;tableGroupHeight;constructor(t){let e,i;this._gantt=t,this.tableGroupWidth=t.tableNoFrameWidth,this.tableGroupHeight=Math.min(t.tableNoFrameHeight,t.drawHeight),"node"===yS.mode||(ng.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Cg({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.parsedOptions.underlayBackgroundColor,enableLayout:!0,autoRender:!1,context:{appName:"vtable"},pluginList:["poptipForText"]}),this.stage.gantt=this._gantt,this.stage.table=this._gantt,this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph()}initSceneGraph(){const t=this;t.ganttGroup=new fl({x:t._gantt.tableX,y:t._gantt.tableY,width:this.tableGroupWidth,height:this.tableGroupHeight,clip:!0,pickable:!1}),t.stage.defaultLayer.add(t.ganttGroup),t.ganttGroup.name="table",t.timelineHeader=new NS(t),t.grid=new bS(t),t.dependencyLink=new KD(t),t.taskBar=new GD(t),t.markLine=new jD(t),t.toolTip=new $D(t),t.frameBorder=new UD(t),t.scrollbarComponent=new CS(t._gantt),t.stage.defaultLayer.addChild(t.scrollbarComponent.hScrollBar),t.stage.defaultLayer.addChild(t.scrollbarComponent.vScrollBar),t.dragOrderLine=new qD(t)}updateSceneGraph(){const t=this._gantt;let e,i;this.tableGroupWidth=t.tableNoFrameWidth,this.tableGroupHeight=Math.min(t.tableNoFrameHeight,t.drawHeight),"node"===yS.mode||(ng.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage.resize(e,i),this.refreshAll()}afterCreateSceneGraph(){this.scrollbarComponent.updateScrollBar(),function(t){const i=t._gantt,o=i.stateManager,n=i.scenegraph;n.scrollbarComponent.vScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.vScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0})),n.scrollbarComponent.vScrollBar.addEventListener("pointerup",(()=>{n._gantt.eventManager.isDraging=!1,o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1})),n.scrollbarComponent.hScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerup",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1}));const r=tS(o.updateVerticalScrollBar,20),s=tS(o.updateHorizontalScrollBar,20);n.scrollbarComponent.vScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(i,t)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.fastScrolling=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);s(i)}))}(this._gantt.eventManager)}refreshAll(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroupWidth=this._gantt.tableNoFrameWidth,this.ganttGroup.setAttribute("height",this.tableGroupHeight),this.ganttGroup.setAttribute("width",this.tableGroupWidth),this.timelineHeader.refresh(),this.grid.refresh(),this.taskBar.refresh(),this.dependencyLink.refresh(),this.markLine.refresh(),this.dependencyLink.refresh(),this.frameBorder.refresh(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}refreshTaskBars(){this.dependencyLink.refresh(),this.taskBar.refresh(),this.updateNextFrame()}refreshTaskBarsAndGrid(){this._gantt.verticalSplitResizeLine.style.height=this._gantt.drawHeight+"px",this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.ganttGroup.setAttribute("height",this.tableGroupHeight),this.grid.refresh(),this.taskBar.refresh(),this.dependencyLink.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}updateTableSize(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroupWidth=this._gantt.tableNoFrameWidth,this.ganttGroup.setAttributes({x:this._gantt.tableX,y:this._gantt.tableY,width:this._gantt.tableNoFrameWidth,height:this.tableGroupHeight}),this.grid.resize(),this.taskBar.resize(),this.dependencyLink.resize(),this.markLine.refresh(),this.frameBorder.resize()}updateStageBackground(){this.stage.background=this._gantt.parsedOptions.underlayBackgroundColor,this.updateNextFrame()}renderSceneGraph(){this.stage.render()}updateNextFrame(){this.stage.renderNextFrame()}get width(){return this.ganttGroup.attribute?.width??0}get height(){return this.ganttGroup.attribute?.height??0}get x(){return this.ganttGroup.attribute?.x??0}get y(){return this.ganttGroup.attribute?.y??0}setX(t,e=!1){this.timelineHeader.setX(t),this.grid.setX(t),this.taskBar.setX(t),this.dependencyLink.setX(t),this.markLine.setX(t),this.updateNextFrame()}setY(t,e=!1){this.grid.setY(t),this.taskBar.setY(t),this.dependencyLink.setY(t),this.updateNextFrame()}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}resize(){this.updateTableSize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}release(){this.stage.release()}showTaskCreationButton(t,e,i){this.taskCreationButton||(this.taskCreationButton=new YD(this._gantt.scenegraph));const o=this._gantt.parsedOptions.taskBarCreationMaxWidth,n=this._gantt.parsedOptions.taskBarCreationMinWidth,r=this._gantt.getDateColWidth(i),s=o?Math.min(o,n?Math.max(n,r):r):n?Math.max(n,r):r,a=t-(s-r)/2;this.taskCreationButton.show(a,e,s,this._gantt.parsedOptions.rowHeight),this.updateNextFrame()}hideTaskCreationButton(){this.taskCreationButton&&(this.taskCreationButton.hide(),this.updateNextFrame())}showToolTip(t){this.toolTip||(this.toolTip=new $D(this._gantt.scenegraph)),this.toolTip.show(t)}hideToolTip(){this.toolTip.hide()}refreshRecordLinkNodes(t,e,i,r=0){const s=this._gantt,a=s.getRecordByIndex(t,e),l=a.vtable_gantt_linkedTo,h=a.vtable_gantt_linkedFrom;for(let a=0;a<l?.length;a++){const h=l[a],d=h.vtable_gantt_linkLineNode,c=h.vtable_gantt_linkArrowNode,{linkedToTaskKey:u,linkedFromTaskKey:g,type:p}=h,{taskKeyField:f,minDate:v}=s.parsedOptions,m=ES(s.records,f,g),b=ES(s.records,f,u);let y,C,w,x,_,S,A,T,B;const R=this._gantt.getTaskBarStyle(t,e);if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline){const t=IS(i.attribute.y+r,s);T=m.index[0];A=s.getRowsHeightByIndex(0,t.task_index-1)/s.parsedOptions.rowHeight,({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(b.index[0],b.index[1])),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(m.index[0],m.index[1]));const e=R.width;B=i.attribute.y+e/2-(A+.5)*s.parsedOptions.rowHeight}else if(s.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){const t=s.getTaskShowIndexByRecordIndex(m.index.slice(0,-1)),e=s.getTaskShowIndexByRecordIndex(b.index.slice(0,-1)),i=s.getRecordByIndex(t),o=s.getRecordByIndex(e);T=i.type===n.PROJECT&&"expand"!==i.hierarchyState&&!1!==s.parsedOptions.projectSubTasksExpandable?t:s.getTaskShowIndexByRecordIndex(m.index),A=o.type===n.PROJECT&&"expand"!==o.hierarchyState&&!1!==s.parsedOptions.projectSubTasksExpandable?e:s.getTaskShowIndexByRecordIndex(b.index),({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(A,b.index)),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(T,m.index))}else if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){const t=IS(i.attribute.y+r,s);T=s.getRowsHeightByIndex(0,m.index[0]-1)/s.parsedOptions.rowHeight+(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?m.record.vtable_gantt_showIndex:m.index[1]);A=s.getRowsHeightByIndex(0,t.task_index-1)/s.parsedOptions.rowHeight+(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?b.record.vtable_gantt_showIndex:t.sub_task_index),({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(b.index[0],b.index[1])),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(m.index[0],m.index[1]));const e=R.width;B=i.attribute.y+e/2-(A+.5)*s.parsedOptions.rowHeight}else{if(T=s.getTaskShowIndexByRecordIndex(m.index),A=s.getTaskShowIndexByRecordIndex(b.index),-1===T||-1===A)continue;({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(A)),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(T))}if(!(x&&_&&y&&C&&d&&c))return;const{linePoints:M,arrowPoints:k}=ZD(p,x,_,T,0,m.record.type===n.MILESTONE,null,0,y,C,A,0,b.record.type===n.MILESTONE,i,B??0,this._gantt);d.setAttribute("points",M),c.setAttribute("points",k)}for(let a=0;a<h?.length;a++){const l=h[a],d=l.vtable_gantt_linkLineNode,c=l.vtable_gantt_linkArrowNode,{linkedToTaskKey:u,linkedFromTaskKey:g,type:p}=l,{taskKeyField:f,minDate:v}=s.parsedOptions,m=ES(s.records,f,u),b=ES(s.records,f,g);let y,C,w,x,_,S,A,T,B;const R=this._gantt.getTaskBarStyle(t,e);if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline){const t=IS(i.attribute.y+r,s);T=s.getRowsHeightByIndex(0,t.task_index-1)/s.parsedOptions.rowHeight,A=m.index[0],({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(m.index[0],m.index[1])),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(b.index[0],b.index[1]));const e=R.width;B=i.attribute.y+e/2-(T+.5)*s.parsedOptions.rowHeight}else if(s.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){const t=s.getTaskShowIndexByRecordIndex(b.index.slice(0,-1)),e=s.getTaskShowIndexByRecordIndex(m.index.slice(0,-1)),i=s.getRecordByIndex(t),o=s.getRecordByIndex(e);T=i.type===n.PROJECT&&"expand"!==i.hierarchyState&&!1!==s.parsedOptions.projectSubTasksExpandable?t:s.getTaskShowIndexByRecordIndex(b.index),A=o.type===n.PROJECT&&"expand"!==o.hierarchyState&&!1!==s.parsedOptions.projectSubTasksExpandable?e:s.getTaskShowIndexByRecordIndex(m.index),({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(A,m.index)),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(T,b.index))}else if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){const t=IS(i.attribute.y+r,s);T=s.getRowsHeightByIndex(0,t.task_index-1)/s.parsedOptions.rowHeight+(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?b.record.vtable_gantt_showIndex:t.sub_task_index);A=s.getRowsHeightByIndex(0,m.index[0]-1)/s.parsedOptions.rowHeight+(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?m.record.vtable_gantt_showIndex:m.index[1]),({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(m.index[0],m.index[1])),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(b.index[0],b.index[1]));const e=R.width;B=i.attribute.y+e/2-(T+.5)*s.parsedOptions.rowHeight}else{if(T=s.getTaskShowIndexByRecordIndex(b.index),A=s.getTaskShowIndexByRecordIndex(m.index),-1===T||-1===A)continue;({startDate:y,endDate:C,taskDays:w}=s.getTaskInfoByTaskListIndex(A)),({startDate:x,endDate:_,taskDays:S}=s.getTaskInfoByTaskListIndex(T))}if(!(x&&_&&y&&C&&d&&c))return;const{linePoints:M,arrowPoints:k}=ZD(p,x,_,T,0,b.record.type===n.MILESTONE,i,B??0,y,C,A,0,m.record.type===n.MILESTONE,null,0,this._gantt);d.setAttribute("points",M),c.setAttribute("points",k)}}}const QD=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function tW(t,e,i){let o,n,r,s,a,l,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof ng.getRequestAnimationFrame();if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return n=void 0,o=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?ng.getRequestAnimationFrame()(t):setTimeout(t,e)}function v(t){const i=t-l;return void 0===l||i>=e||i<0||d&&t-h>=r}function m(){const t=Date.now();if(v(t))return function(t){return a=void 0,u&&o?p(t):(n=void 0,o=void 0,s)}(t);a=f(m,function(t){const i=t-h,o=e&&-(t-l);return d?Math.min(o,r-i):o}(t))}return e=+e||0,QD(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(r=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(...t){const i=Date.now(),r=v(i);if(o=t,n=this,l=i,r){if(void 0===a)return function(t){return h=t,a=f(m,e),c?p(t):s}(l);if(d)return a=f(m,e),p(l)}return void 0===a&&(a=f(m,e)),s}}let eW=1;class iW{resizeTime;listeners={};reseizeListeners={};on(t,e,i,...o){if("node"===yS.mode)return-1;const n=eW++;if(t?.addEventListener)if("resize"!==e||t===window)t?.addEventListener(e,i,...o);else{const e=new class{resizeTime=100;element;cb;observer;lastSize={width:0,height:0};callBackDebounce;constructor(t,e,i){if(this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=tW(this.callBack,this.resizeTime),window?.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),this.observer?.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}mutationResize=()=>{this.onResize()};disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb({...this.lastSize,windowSizeNotChange:e})};setSize(t){this.lastSize=t}onResize=()=>{this.callBackDebounce()};checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:{...this.lastSize}}}(t,i,this.resizeTime);this.reseizeListeners[n]=e}const r={target:t,type:e,listener:i,options:o};return this.listeners[n]=r,n}once(t,e,i,...o){if("node"===yS.mode)return-1;const n=this.on(t,e,((...t)=>{this.off(n),i(...t)}),...o);return n}off(t){if("node"===yS.mode)return;if(null==t)return;const e=this.listeners?.[t];e&&(delete this.listeners[t],e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options))}fire(t,e,...i){if("node"!==yS.mode)for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&n.listener.call(n.target,...i)}}hasListener(t,e){if("node"===yS.mode)return!1;let i=!1;for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&(i=!0)}return i}clear(){if("node"!==yS.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];e?.disConnect()}this.listeners={}}}release(){"node"!==yS.mode&&(this.clear(),this.listeners={})}}let oW=1;function nW(){return AS?oW=1:(oW=Math.ceil(window.devicePixelRatio||1),oW>1&&oW%2!=0&&(oW+=1)),oW}function rW(t){return!!t.changedTouches}nW();class sW{friction;lastTime;speedX;speedY;runingId;stopped;scrollHandle;constructor(){}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.stopped=!1,this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=ng.getRequestAnimationFrame()(this.inertia.bind(this)))}inertia(){if(this.stopped)return;const t=Date.now(),e=t-this.lastTime;let i=!0;const o=Math.pow(this.friction,e/16),n=o*this.speedX,r=o*this.speedY;let s=0,a=0;Math.abs(n)>.05&&(i=!1,s=(this.speedX+n)/2*e),Math.abs(r)>.05&&(i=!1,a=(this.speedY+r)/2*e),this.scrollHandle?.(s,a),i?this.runingId=null:(this.lastTime=t,this.speedX=n,this.speedY=r,this.runingId=ng.getRequestAnimationFrame()(this.inertia.bind(this)))}endInertia(){ng.getCancelAnimationFrame()(this.runingId),this.runingId=null,this.stopped=!0}isInertiaScrolling(){return!!this.runingId}}class aW{_gantt;_eventHandler;isDown=!1;isDraging=!1;lastDragPointerXYOnWindow;globalEventListeners=[];poniterState;isTouchdown;isTouchMove;isLongTouch;touchMovePoints;touchSetTimeout;touchEnd;_enableTableScroll=!0;inertiaScroll;constructor(t){this._gantt=t,this.inertiaScroll=new sW,this._eventHandler=new iW,this.bindEvent()}release(){this._eventHandler.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[],this.inertiaScroll.endInertia()}bindEvent(){!function(t){const i=t._gantt.scenegraph,s=t._gantt,a=s.stateManager;i.ganttGroup.addEventListener("pointerdown",(o=>{if(0!==o.button)return;let r,l,h;if(o.detailPath.find((t=>"task-bar"===t.name?(r=t,!0):"task-creation-button"===t.name||("task-bar-link-point-left"===t.name?(l=t,!0):"task-bar-link-point-right"===t.name?(h=t,!0):!!t.attribute.vtable_link&&(t.attribute.vtable_link,!0)))),r){const l=r.record;if(!(l?.type===n.PROJECT))if("task-bar-hover-shadow-left-icon"===o.target.name)a.startResizeTaskBar(r,o.nativeEvent.x,o.nativeEvent.y,o.offset.y,"left"),a.updateInteractionState(e.grabing);else if("task-bar-hover-shadow-right-icon"===o.target.name)a.startResizeTaskBar(r,o.nativeEvent.x,o.nativeEvent.y,o.offset.y,"right"),a.updateInteractionState(e.grabing);else if("task-bar-progress-handle"===o.target.name)a.startAdjustProgressBar(r,o.nativeEvent.x,o.nativeEvent.y),a.updateInteractionState(e.grabing);else if(s.parsedOptions.taskBarMoveable){const n=()=>{let t=!0;if("function"==typeof s.parsedOptions.taskBarMoveable){const{startDate:e,endDate:o,taskRecord:n}=i._gantt.getTaskInfoByTaskListIndex(r.task_index,r.sub_task_index),a={index:r.task_index,startDate:e,endDate:o,taskRecord:n,ganttInstance:i._gantt};t=s.parsedOptions.taskBarMoveable(a)}else t=s.parsedOptions.taskBarMoveable;t&&(a.startMoveTaskBar(r,o.nativeEvent.x,o.nativeEvent.y,o.offset.y),a.updateInteractionState(e.grabing))};"touch"===o.pointerType?(t.touchEnd=!1,t.touchSetTimeout=setTimeout((()=>{t.isTouchdown=!1,t.isLongTouch=!0,n()}),100)):n()}}else l?(a.startCreateDependencyLine(l,o.nativeEvent.x,o.nativeEvent.y,o.offset.y,"left"),a.updateInteractionState(e.grabing)):h&&(a.startCreateDependencyLine(h,o.nativeEvent.x,o.nativeEvent.y,o.offset.y,"right"),a.updateInteractionState(e.grabing))})),i.ganttGroup.addEventListener("pointermove",(l=>{if(t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0),a.interactionState===e.default){const t=l.detailPath.find((t=>"task-bar"===t.name)),e=l.detailPath.find((t=>"markline-hover-group"===t.name)),h=l.detailPath.find((t=>"mark-line-content"===t.name));if(s.parsedOptions.markLineCreateOptions?.markLineCreatable&&(e&&!function(t,e){const i=t.startDate.getTime(),o=t.endDate.getTime();return e.some((t=>{const e=new Date(t.date).getTime();return e>=i&&e<=o}))}(e.data,s.parsedOptions.markLine)?i._gantt.stateManager.marklineIcon.target!==e&&(i._gantt.stateManager.marklineIcon.target=e,a.showMarklineIconHover()):i._gantt.stateManager.marklineIcon.target&&a.hideMarklineIconHover()),t){const e=t;if(i._gantt.stateManager.hoverTaskBar.target!==e){i._gantt.stateManager.hoverTaskBar.target=e;const t=e.task_index,o=e.sub_task_index,s=e.record;s.type!==n.PROJECT&&a.showTaskBarHover(),i._gantt.hasListeners(r.MOUSEENTER_TASK_BAR)&&i._gantt.fireListeners(r.MOUSEENTER_TASK_BAR,{federatedEvent:l,event:l.nativeEvent,index:t,sub_task_index:o,record:s})}}else{if(i._gantt.stateManager.hoverTaskBar.target){if(i._gantt.hasListeners(r.MOUSELEAVE_TASK_BAR)){const t=i._gantt.stateManager.hoverTaskBar.target.task_index,e=i._gantt.stateManager.hoverTaskBar.target.sub_task_index,o=i._gantt.getRecordByIndex(t,e);i._gantt.fireListeners(r.MOUSELEAVE_TASK_BAR,{federatedEvent:l,event:l.nativeEvent,index:t,sub_task_index:e,record:o})}a.hideTaskBarHover(l)}if(s.parsedOptions.taskBarCreatable&&!h){const t=IS(l.offset.y-s.headerHeight+s.stateManager.scrollTop,s),e=s.getTaskInfoByTaskListIndex(t.task_index,t.sub_task_index);let i=!0;if("function"==typeof s.parsedOptions.taskBarCreatable){const{startDate:o,endDate:n,taskRecord:r}=e,a={index:t.task_index,sub_task_index:t.sub_task_index,startDate:o,endDate:n,taskRecord:r,ganttInstance:s};i=s.parsedOptions.taskBarCreatable(a)}else i=s.parsedOptions.taskBarCreatable;if(i){const i=function(t,e,i){const r=IS(e-i.headerHeight+i.stateManager.scrollTop,i),s=i.getRecordByIndex(r.task_index),a=BS(t,i),l=i.getDateRangeByIndex(a);if(s?.children){const t=IS(e-i.headerHeight+i.stateManager.scrollTop,i);for(let e=0;e<s.children.length;e++){const{startDate:r,endDate:a,taskDays:h,progress:d,taskRecord:c}=i.getTaskInfoByTaskListIndex(t.task_index,e);if(((i.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact||i.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange)&&c.vtable_gantt_showIndex===t.sub_task_index||i.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||i.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline&&s.type===n.PROJECT&&"expand"!==s.hierarchyState&&!1!==i.parsedOptions.projectSubTasksExpandable)&&r&&a&&l.startDate.getTime()>=r.getTime()&&l.endDate.getTime()<=a.getTime())return{startDate:r,endDate:a,taskDays:h,progress:d,taskRecord:c}}}}(l.offset.x,l.offset.y,s);if((s.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||s.parsedOptions.tasksShowMode===o.Tasks_Separate)&&!e.taskDays&&e.taskRecord&&!e.taskRecord.vtableMerge||(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact)&&!i){const e=BS(l.offset.x,s),i=(e>=1?s.getDateColsWidth(0,e-1):0)-s.stateManager.scroll.horizontalBarPos,o=s.taskListTableInstance.getRowsHeight(s.taskListTableInstance.columnHeaderLevelCount,t.task_index+s.taskListTableInstance.columnHeaderLevelCount-1)+(t.sub_task_index??0)*s.parsedOptions.rowHeight-s.stateManager.scroll.verticalBarPos;return void s.scenegraph.showTaskCreationButton(i,o,e)}}}}s.scenegraph.hideTaskCreationButton()}else if(a.interactionState===e.grabing){let t,e,o;l.detailPath.find((i=>"task-bar"===i.name?(t=i,!0):"task-creation-button"===i.name||("task-bar-link-point-left"===i.name?(e=i,!0):"task-bar-link-point-right"===i.name?(o=i,!0):!!i.attribute.vtable_link&&(i.attribute.vtable_link,!0)))),e&&e.parent&&(t=t??e.parent.attribute?.attachedToTaskBarNode),o&&o.parent&&(t=t??o.parent.attribute?.attachedToTaskBarNode),i._gantt.stateManager.isCreatingDependencyLine()&&!t?a.hideSecondTaskBarSelectedBorder():i._gantt.stateManager.isCreatingDependencyLine()&&e&&i._gantt.stateManager.selectedTaskBar.target!==t?(a.highlightLinkPointNode(e),a.creatingDenpendencyLink.lastHighLightLinkPoint=e,a.creatingDenpendencyLink.secondTaskBarPosition="left"):i._gantt.stateManager.isCreatingDependencyLine()&&o&&i._gantt.stateManager.selectedTaskBar.target!==t?(a.highlightLinkPointNode(o),a.creatingDenpendencyLink.lastHighLightLinkPoint=o,a.creatingDenpendencyLink.secondTaskBarPosition="right"):i._gantt.stateManager.isCreatingDependencyLine()&&t&&i._gantt.stateManager.selectedTaskBar.target!==t&&(a.unhighlightLinkPointNode(a.creatingDenpendencyLink.lastHighLightLinkPoint),a.creatingDenpendencyLink.secondTaskBarNode&&a.creatingDenpendencyLink.secondTaskBarNode===t||(a.creatingDenpendencyLink.secondTaskBarNode&&a.creatingDenpendencyLink.secondTaskBarNode!==t&&a.hideSecondTaskBarSelectedBorder(),a.creatingDenpendencyLink.secondTaskBarNode=t,a.showSecondTaskBarSelectedBorder()))}})),i.ganttGroup.addEventListener("pointerup",(e=>{if(t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0),0===e.button){let n,l,h,d=!1,c=!1,u=!1,g=!1,p=!1,f=!1,v=!1;const m=e.detailPath.find((t=>"task-bar"===t.name?(d=!0,!0):"task-creation-button"===t.name?(c=!0,!1):"task-bar-link-point-left"===t.name?(g=!0,!1):"task-bar-link-point-right"===t.name?(p=!0,!1):t.attribute.vtable_link?(u=!0,n=t.attribute.vtable_link,!1):"markline-hover-group"===t.name?(f=!0,h=t,!1):"mark-line-content"===t.name&&(v=!0,l=t,!1)));if(d&&i._gantt.parsedOptions.taskBarSelectable&&"down"===t.poniterState){a.hideDependencyLinkSelectedLine();const t=m;if(a.showTaskBarSelectedBorder(t),s.hasListeners(r.CLICK_TASK_BAR)){const i=t.task_index,o=t.sub_task_index,n=s.getRecordByIndex(i,o);s.fireListeners(r.CLICK_TASK_BAR,{federatedEvent:e,event:e.nativeEvent,index:i,sub_task_index:o,record:n})}}else if(c&&"down"===t.poniterState){a.hideDependencyLinkSelectedLine(),a.hideTaskBarSelectedBorder();const t=IS(e.offset.y-s.headerHeight+s.stateManager.scrollTop,s);if(s.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||s.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){if(s.hasListeners(r.CREATE_TASK_SCHEDULE)){const i=BS(e.offset.x,s),o=s.getDateRangeByIndex(i),n=s.parsedOptions.dateFormat??(s.parsedOptions.timeScaleIncludeHour?"yyyy-mm-dd hh:mm:ss":"yyyy-mm-dd");s.fireListeners(r.CREATE_TASK_SCHEDULE,{federatedEvent:e,event:e.nativeEvent,index:t.task_index,sub_task_index:t.sub_task_index,startDate:eS(o.startDate,n),endDate:eS(o.endDate,n),record:void 0,parentRecord:s.getRecordByIndex(t.task_index)})}}else{const i=s.getTaskInfoByTaskListIndex(t.task_index,t.sub_task_index);if(i.taskRecord){const o=s.parsedOptions.dateFormat??(s.parsedOptions.timeScaleIncludeHour?"yyyy-mm-dd hh:mm:ss":"yyyy-mm-dd"),n=BS(e.offset.x,s),a=s.getDateRangeByIndex(n);i.taskRecord[s.parsedOptions.startDateField]=eS(a.startDate,o),i.taskRecord[s.parsedOptions.endDateField]=eS(a.endDate,o),s.scenegraph.hideTaskCreationButton(),s.updateTaskRecord(i.taskRecord,t.task_index,t.sub_task_index),s.hasListeners(r.CREATE_TASK_SCHEDULE)&&s.fireListeners(r.CREATE_TASK_SCHEDULE,{federatedEvent:e,event:e.nativeEvent,index:t.task_index,sub_task_index:t.sub_task_index,startDate:i.taskRecord[s.parsedOptions.startDateField],endDate:i.taskRecord[s.parsedOptions.endDateField],record:i.taskRecord})}}}else if(u&&i._gantt.parsedOptions.dependencyLinkSelectable&&"down"===t.poniterState)a.hideDependencyLinkSelectedLine(),a.hideTaskBarSelectedBorder(),i._gantt.stateManager.selectedDenpendencyLink.link=n,a.showDependencyLinkSelectedLine();else if((g||p)&&"down"===t.poniterState){if(s.hasListeners(r.CLICK_DEPENDENCY_LINK_POINT)){const t=IS(e.offset.y-s.headerHeight+s.stateManager.scrollTop,s),i=s.getRecordByIndex(t.task_index,t.sub_task_index);s.fireListeners(r.CLICK_DEPENDENCY_LINK_POINT,{event:e.nativeEvent,index:t.task_index,sub_task_index:t.sub_task_index,point:g?"start":"end",record:i})}a.hideTaskBarSelectedBorder()}else if(f&&"down"===t.poniterState)s.hasListeners(r.CLICK_MARKLINE_CREATE)&&s.fireListeners(r.CLICK_MARKLINE_CREATE,{event:e.nativeEvent,position:WS(h,i._gantt),data:i._gantt.stateManager.marklineIcon.target.data});else if(v&&"down"===t.poniterState)s.hasListeners(r.CLICK_MARKLINE_CONTENT)&&s.fireListeners(r.CLICK_MARKLINE_CONTENT,{event:e.nativeEvent,position:WS(l,i._gantt),data:l.data});else if(g&&"draging"===t.poniterState){if(a.isCreatingDependencyLine()){const t=a.endCreateDependencyLine(e.offset.y);s.hasListeners(r.CREATE_DEPENDENCY_LINK)&&s.fireListeners(r.CREATE_DEPENDENCY_LINK,{federatedEvent:e,event:e.nativeEvent,link:t})}}else if(p&&"draging"===t.poniterState){if(a.isCreatingDependencyLine()){const t=a.endCreateDependencyLine(e.offset.y);s.hasListeners(r.CREATE_DEPENDENCY_LINK)&&s.fireListeners(r.CREATE_DEPENDENCY_LINK,{federatedEvent:e,event:e.nativeEvent,link:t})}}else a.hideDependencyLinkSelectedLine(),a.hideTaskBarSelectedBorder()}})),i.ganttGroup.addEventListener("rightdown",(t=>{let e,i=!1,o=!1;const n=t.detailPath.find((t=>"task-bar"===t.name?(i=!0,!0):!!t.attribute.vtable_link&&(o=!0,e=t.attribute.vtable_link,!1)));if(i){if(s.hasListeners(r.CONTEXTMENU_TASK_BAR)){const e=n,i=e.task_index,o=e.sub_task_index,a=s.getRecordByIndex(i,o);s.fireListeners(r.CONTEXTMENU_TASK_BAR,{federatedEvent:t,event:t.nativeEvent,index:i,sub_task_index:o,record:a})}}else o&&s.hasListeners(r.CONTEXTMENU_DEPENDENCY_LINK)&&s.fireListeners(r.CONTEXTMENU_DEPENDENCY_LINK,{federatedEvent:t,event:t.nativeEvent,link:e})})),i.ganttGroup.addEventListener("pointerenter",(t=>{(s.parsedOptions.scrollStyle.horizontalVisible&&"focus"===s.parsedOptions.scrollStyle.horizontalVisible||!s.parsedOptions.scrollStyle.horizontalVisible&&"focus"===s.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showHorizontalScrollBar(),(s.parsedOptions.scrollStyle.verticalVisible&&"focus"===s.parsedOptions.scrollStyle.verticalVisible||!s.parsedOptions.scrollStyle.verticalVisible&&"focus"===s.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showVerticalScrollBar()})),i.ganttGroup.addEventListener("pointerleave",(t=>{if((s.parsedOptions.scrollStyle.horizontalVisible&&"focus"===s.parsedOptions.scrollStyle.horizontalVisible||!s.parsedOptions.scrollStyle.horizontalVisible&&"focus"===s.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideHorizontalScrollBar(),(s.parsedOptions.scrollStyle.verticalVisible&&"focus"===s.parsedOptions.scrollStyle.verticalVisible||!s.parsedOptions.scrollStyle.verticalVisible&&"focus"===s.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideVerticalScrollBar(),i._gantt.stateManager.hoverTaskBar.target){if(i._gantt.hasListeners(r.MOUSELEAVE_TASK_BAR)){const e=i._gantt.stateManager.hoverTaskBar.target.task_index,o=i._gantt.stateManager.hoverTaskBar.target.sub_task_index,n=i._gantt.getRecordByIndex(e,o);i._gantt.fireListeners(r.MOUSELEAVE_TASK_BAR,{federatedEvent:t,event:t.nativeEvent,index:e,sub_task_index:o,record:n})}a.hideTaskBarHover(t)}})),i.ganttGroup.addEventListener("wheel",(t=>{wS(t,a,s)}))}(this),function(t){const i=t._gantt;t._gantt.scenegraph;const o=i.stateManager,n=t._eventHandler;n.on(i.getElement(),"contextmenu",(t=>{!1!==i.parsedOptions.eventOptions?.preventDefaultContextMenu&&t.preventDefault()})),n.on(i.getContainer(),"resize",(t=>{0===t.width&&0===t.height||(pt(i.options.pixelRatio)||i.setPixelRatio(nW()),t.windowSizeNotChange||i._resize())})),i.taskListTableInstance&&i.parsedOptions.verticalSplitLineMoveable&&n.on(i.verticalSplitResizeLine,"mousedown",(t=>{o.updateInteractionState(e.grabing),o.startResizeTableWidth(t)}));i.parsedOptions.verticalSplitLineHighlight&&(i.verticalSplitResizeLine&&n.on(i.verticalSplitResizeLine,"mouseover",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="1"})),i.verticalSplitResizeLine&&n.on(i.verticalSplitResizeLine,"mouseout",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="0"})));const s=t=>{i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y},i.eventManager.poniterState="down"};t.globalEventListeners.push({name:"pointerdown",env:"document",callback:s}),ng.addEventListener("pointerdown",s);const a=t=>{if("down"===i.eventManager.poniterState){const e=i.eventManager.lastDragPointerXYOnWindow.x??t.x,o=t.x-e,n=i.eventManager.lastDragPointerXYOnWindow.y??t.y,r=t.y-n;(Math.abs(o)>=1||Math.abs(r)>=1)&&(i.eventManager.poniterState="draging")}if(o.interactionState===e.grabing&&"draging"===i.eventManager.poniterState){const e=i.eventManager.lastDragPointerXYOnWindow?.x??t.x,n=i.eventManager.lastDragPointerXYOnWindow?.y??t.y;(Math.abs(e-t.x)>=1||Math.abs(n-t.y)>=1)&&(o.isResizingTableWidth()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealResizeTableWidth(t)):o.isMoveingTaskBar()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealTaskBarMove(t)):o.isResizingTaskBar()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealTaskBarResize(t)):o.isAdjustingProgressBar()?o.dealAdjustProgressBar(t):o.isCreatingDependencyLine()&&o.dealCreateDependencyLine(t),i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y})}};t.globalEventListeners.push({name:"pointermove",env:"document",callback:a}),ng.addEventListener("pointermove",a);const l=t=>{"grabing"===o.interactionState&&(o.updateInteractionState(e.default),o.isResizingTableWidth()?o.endResizeTableWidth():o.isMoveingTaskBar()?o.endMoveTaskBar():o.isResizingTaskBar()?o.endResizeTaskBar(t.x):o.isAdjustingProgressBar()&&o.endAdjustProgressBar(t.x)),setTimeout((()=>{i.eventManager.lastDragPointerXYOnWindow=void 0,i.eventManager.poniterState="up"}),0)};t.globalEventListeners.push({name:"pointerup",env:"document",callback:l}),ng.addEventListener("pointerup",l);const h=t=>{if(i.parsedOptions.dependencyLinkDeletable&&("Delete"===t.key&&i.parsedOptions.keyboardOptions?.deleteLinkOnDel||"Backspace"===t.key&&i.parsedOptions.keyboardOptions?.deleteLinkOnBack)&&i.stateManager.selectedDenpendencyLink.link){const e=i.stateManager.selectedDenpendencyLink.link;i.deleteLink(i.stateManager.selectedDenpendencyLink.link),o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),i.hasListeners(r.DELETE_DEPENDENCY_LINK)&&i.fireListeners(r.DELETE_DEPENDENCY_LINK,{event:t,link:e})}};t.globalEventListeners.push({name:"keydown",env:"document",callback:h}),ng.addEventListener("keydown",h)}(this),function(t){const e=t._gantt,i=e.stateManager,o=e.scenegraph;if(!1===ng.envContribution.supportsTouchEvents)return;ng.addEventListener("contextmenu",(t=>{t.stopPropagation(),t.preventDefault()}),{capture:!0}),t.touchMovePoints=[],e.scenegraph.ganttGroup.addEventListener("touchstart",(e=>{e.target.isChildOf(o.scrollbarComponent.vScrollBar)||e.target.isChildOf(o.scrollbarComponent.hScrollBar)||(t.isTouchdown=!0,t.touchMovePoints.push({x:e.page.x,y:e.page.y,timestamp:Date.now()}))}));const n=o=>{if(t.isLongTouch&&o.preventDefault(),t.isTouchdown&&rW(o)&&(t.isTouchMove=!0,t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:o.changedTouches[0].pageX,y:o.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const n=-t.touchMovePoints[t.touchMovePoints.length-1].x+t.touchMovePoints[t.touchMovePoints.length-2].x,r=-t.touchMovePoints[t.touchMovePoints.length-1].y+t.touchMovePoints[t.touchMovePoints.length-2].y;wS(o,i,e),o.cancelable&&("none"===e.parsedOptions.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&xS(r,i)||Math.abs(r)<=Math.abs(n)&&0!==n&&_S(n,i))&&o.preventDefault()}};ng.addEventListener("touchmove",n,{passive:!1}),t.globalEventListeners.push({name:"touchmove",env:"vglobal",callback:n});const r=i=>{if(t.touchEnd=!0,t.isLongTouch=!1,t.isTouchdown&&rW(i)){if(t.touchMovePoints?.length&&(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:i.changedTouches[0].pageX,y:i.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const i=t.touchMovePoints[0],o=t.touchMovePoints[t.touchMovePoints?.length-1],n=(o.x-i.x)/(o.timestamp-i.timestamp),r=(o.y-i.y)/(o.timestamp-i.timestamp);t.inertiaScroll.startInertia(n,r,.95),e.eventManager.inertiaScroll.setScrollHandle(((t,i)=>{wS({deltaX:-t,deltaY:-i},e.stateManager,e)}))}t.isTouchdown=!1,t.isTouchMove=!1,t.isDraging=!1,t.touchMovePoints=[]}};ng.addEventListener("touchend",r),t.globalEventListeners.push({name:"touchend",env:"vglobal",callback:r});const s=e=>{t.touchEnd=!0,t.isLongTouch=!1,t.isTouchdown&&(t.isTouchdown=!1,t.isTouchMove=!1,t.touchMovePoints=[],t.isDraging=!1)};ng.addEventListener("touchcancel",s),t.globalEventListeners.push({name:"touchcancel",env:"vglobal",callback:s})}(this)}}function lW(t){const{scroll:e}=t.stateManager,{verticalBarPos:i}=e;t.taskListTableInstance.stateManager.setScrollTop(i,void 0,!1)}function hW(t){const e=t.taskTableWidth;t.taskTableWidth=t.taskListTableInstance.getAllColsWidth()+t.parsedOptions.outerFrameStyle.borderLineWidth,t.options?.taskListTable?.maxTableWidth&&(t.taskTableWidth=Math.min(t.options?.taskListTable?.maxTableWidth,t.taskTableWidth)),t.options?.taskListTable?.minTableWidth&&(t.taskTableWidth=Math.max(t.options?.taskListTable?.minTableWidth,t.taskTableWidth)),e!==t.taskTableWidth&&(t.element.style.left=t.taskTableWidth?`${t.taskTableWidth}px`:"0px",t.taskListTableInstance.setCanvasSize(t.taskTableWidth,t.tableNoFrameHeight+2*t.parsedOptions.outerFrameStyle.borderLineWidth),t._updateSize(),LS(t),t.zoomScaleManager&&t.zoomScaleManager.handleTableWidthChange())}class dW{_gantt;scroll;fastScrolling;interactionState=e.default;moveTaskBar;hoverTaskBar;resizeTaskBar;adjustProgressBar;selectedTaskBar;resizeTableWidth;selectedDenpendencyLink;creatingDenpendencyLink;marklineIcon;resetInteractionState=tW((()=>{this.updateInteractionState(e.default)}),100);constructor(t){this._gantt=t,this.scroll={horizontalBarPos:0,verticalBarPos:0},this.moveTaskBar={targetStartX:null,targetStartY:null,deltaX:0,deltaY:0,startOffsetY:null,startX:null,startY:null,moving:!1,target:null,moveTaskBarXSpeed:0,moveTaskBarXInertia:new sW},this.hoverTaskBar={targetStartX:null,startX:null,target:null},this.marklineIcon={target:null},this.selectedTaskBar={target:null},this.resizeTaskBar={startOffsetY:null,targetStartX:null,targetEndX:null,startX:null,startY:null,target:null,resizing:!1,onIconName:""},this.adjustProgressBar={startX:null,startY:null,target:null,adjusting:!1,originalProgress:0},this.resizeTableWidth={lastX:null,resizing:!1},this.selectedDenpendencyLink={link:null},this.creatingDenpendencyLink={startClickedPoint:null,startX:null,startY:null,startOffsetY:null,targetStartX:null,creating:!1,firstTaskBarPosition:"left",secondTaskBarPosition:"left",secondTaskBarNode:null,lastHighLightLinkPoint:null},this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this),function(t){t.taskListTableInstance&&t.taskListTableInstance?.on("scroll",(e=>{if("vertical"===e.scrollDirection){const{scroll:e}=t.taskListTableInstance.stateManager,{verticalBarPos:i}=e;t.stateManager.scroll.verticalBarPos!==i&&t.stateManager.setScrollTop(i,!1)}}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_cell_value",(e=>{const{col:i,row:o}=e;t.taskListTableInstance.isHeader(i,o)||t._refreshTaskBar(o-t.taskListTableInstance.columnHeaderLevelCount)}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_header_position",(e=>{t.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||t.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact||t.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||t.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline?t.scenegraph.refreshTaskBarsAndGrid():t.scenegraph.refreshTaskBars(),t.scenegraph.dragOrderLine.hideDragLine();const i=t.stateManager.scroll.horizontalBarPos,n=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-n)})),t.taskListTableInstance?.on("change_header_position_start",(e=>{const{col:i,row:o,x:n,y:r,backX:s,lineX:a,backY:l,lineY:h,event:d}=e;t.scenegraph.dragOrderLine.showDragLine(h),t.scenegraph.updateNextFrame()})),t.taskListTableInstance?.on("changing_header_position",(e=>{const{col:i,row:o,x:n,y:r,backX:s,lineX:a,backY:l,lineY:h,event:d}=e;t.scenegraph.dragOrderLine.showDragLine(h),t.scenegraph.updateNextFrame()})),t.taskListTableInstance?.on("change_header_position_fail",(e=>{t.scenegraph.dragOrderLine.hideDragLine(),t.scenegraph.updateNextFrame()}))}(this._gantt),function(t){t.taskListTableInstance?.on("tree_hierarchy_state_change",(e=>{const{row:i,hierarchyState:r}=e;if(t.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){const e=i-t.taskListTableInstance.columnHeaderLevelCount,o=t.getRecordByIndex(e);o&&o.type===n.PROJECT&&o.children?.length>0&&(o.hierarchyState=r)}t._syncPropsFromTable(),t.scenegraph.refreshTaskBarsAndGrid(),!t.taskListTableInstance.checkHasColumnAutoWidth()||"auto"!==t.options.taskListTable?.tableWidth&&-1!==t.taskTableWidth||hW(t);const s=t.stateManager.scroll.horizontalBarPos,a=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-s),t.scenegraph.setY(-a)}))}(this._gantt),function(t){t.taskListTableInstance?.on("after_sort",(e=>{t.scenegraph.refreshTaskBars();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt),"auto"!==this._gantt.options.taskListTable?.tableWidth&&-1!==this._gantt.taskTableWidth||function(t){t.taskListTableInstance?.on("resize_column",(e=>{hW(t)}))}(this._gantt)}setScrollTop(t,e=!0){const i=this._gantt.getAllRowsHeight();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.height)),t=Math.ceil(t);const o=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,pt(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-t);const n=t/(i-this._gantt.scenegraph.height);this._gantt.scenegraph.scrollbarComponent.updateVerticalScrollBarPos(n),o!==t&&e&&(lW(this._gantt),this._gantt.fireListeners(r.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:n}))}get scrollLeft(){return this.scroll.horizontalBarPos}get scrollTop(){return this.scroll.verticalBarPos}setScrollLeft(t,e=!0){const i=this._gantt.getAllDateColsWidth();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.width)),t=Math.ceil(t);const o=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,pt(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-t);const n=t/(i-this._gantt.scenegraph.width);this._gantt.scenegraph.scrollbarComponent.updateHorizontalScrollBarPos(n),o!==t&&e&&this._gantt.fireListeners(r.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioX:n})}updateInteractionState(t){if(this.interactionState===t)return;const i=this.interactionState;this.interactionState=t,i===e.scrolling&&e.default}updateVerticalScrollBar(t){const e=this._gantt.getAllRowsHeight();this.scroll.verticalBarPos,this.scroll.verticalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.height)),pt(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-this.scroll.verticalBarPos,1===t),lW(this._gantt),this._gantt.fireListeners(r.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:t})}updateHorizontalScrollBar(t){const e=this._gantt.getAllDateColsWidth();this.scroll.horizontalBarPos,this.scroll.horizontalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.width)),pt(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this._gantt.fireListeners(r.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioY:t})}startMoveTaskBar(t,e,i,o){"task-bar-hover-shadow"===t.name&&(t=t.parent),this.moveTaskBar.moving=!0,this.moveTaskBar.target=t,this.moveTaskBar.targetStartX=t.attribute.x,this.moveTaskBar.targetStartY=t.attribute.y,this.moveTaskBar.startX=e,this.moveTaskBar.startY=i,this.moveTaskBar.startOffsetY=o,t.setAttribute("zIndex",1e4)}isMoveingTaskBar(){return this.moveTaskBar.moving}endMoveTaskBar(){this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()&&this.moveTaskBar.moveTaskBarXInertia.endInertia();const t=this.moveTaskBar.deltaX,e=this.moveTaskBar.deltaY,i=this.moveTaskBar.target;if(Math.abs(t)>=1||Math.abs(e)>=1){const t=i.task_index,s=i.task_index,a=i.sub_task_index,{startDate:l,endDate:h}=this._gantt.getTaskInfoByTaskListIndex(s,a),d=this.moveTaskBar.targetStartY+this._gantt.parsedOptions.rowHeight*Math.round(e/this._gantt.parsedOptions.rowHeight),c=this._gantt.parsedOptions.taskBarMilestoneStyle.width,u=BS(this.moveTaskBar.target.attribute.x+(i.record.type===n.MILESTONE?c/2:0)-this._gantt.stateManager.scroll.horizontalBarPos,this._gantt),g=this._gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates[u];if(!g)return;const p=g.startDate,f=new Date(p.getTime()+(dS(h).getTime()-dS(l).getTime()));let v;if(dS(l).getTime()!==p.getTime()){v=dS(l).getTime()>p.getTime()?"left":"right",this._gantt._updateStartEndDateToTaskRecord(p,f,s,a);const e=this._gantt.getRecordByIndex(s,a);this._gantt.hasListeners(r.CHANGE_DATE_RANGE)&&this._gantt.fireListeners(r.CHANGE_DATE_RANGE,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:l,oldEndDate:h,index:s,record:e});const i=IS(d,this._gantt).task_index;this._gantt.hasListeners(r.MOVE_END_TASK_BAR)&&this._gantt.fireListeners(r.MOVE_END_TASK_BAR,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:l,oldEndDate:h,oldRowIndex:t,newRowIndex:i,index:s,record:e})}else{const e=this._gantt.getRecordByIndex(s,a),i=IS(d,this._gantt).task_index;this._gantt.hasListeners(r.MOVE_END_TASK_BAR)&&this._gantt.fireListeners(r.MOVE_END_TASK_BAR,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:l,oldEndDate:h,oldRowIndex:t,newRowIndex:i,index:i,record:e})}if(this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact){const t=IS(d,this._gantt);this._gantt._dragOrderTaskRecord(i.task_index,i.sub_task_index,t.task_index,t.sub_task_index),HS(this._gantt.records),this._gantt.taskListTableInstance.renderWithRecreateCells(),this._gantt._syncPropsFromTable(),this._gantt.scenegraph.refreshTaskBarsAndGrid()}else if(this._gantt.parsedOptions.tasksShowMode!==o.Tasks_Separate&&Math.abs(Math.round(e/this._gantt.parsedOptions.rowHeight))>=1){const t=IS(d,this._gantt);this._gantt._dragOrderTaskRecord(i.task_index,i.sub_task_index,t.task_index,t.sub_task_index),this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate?(this._gantt.taskListTableInstance.renderWithRecreateCells(),this._gantt.scenegraph.refreshTaskBarsAndGrid()):(this._gantt.scenegraph.taskBar.refresh(),this._gantt.scenegraph.dependencyLink.refresh())}else{let t=u>=1?this._gantt.getDateColsWidth(0,u-1):0;if(i.record.type===n.MILESTONE){t-=this._gantt.parsedOptions.taskBarMilestoneStyle.width/2}if(uW(i,t-i.attribute.x,d-i.attribute.y,this),"right"===v){let t=i;for(;t.nextSibling&&t.nextSibling.attribute.y===i.attribute.y&&t.nextSibling.record[this._gantt.parsedOptions.startDateField]<=i.record[this._gantt.parsedOptions.startDateField];)t=t.nextSibling;t!==i&&t.parent.insertAfter(i,t)}else if("left"===v){let t=i;for(;t.previousSibling&&t.previousSibling.attribute.y===i.attribute.y&&t.previousSibling.record[this._gantt.parsedOptions.startDateField]>=i.record[this._gantt.parsedOptions.startDateField];)t=t.previousSibling;t!==i&&t.parent.insertBefore(i,t)}}this._gantt.scenegraph.updateNextFrame()}this.moveTaskBar.moving=!1,this.selectedTaskBar.target!==i&&i.setAttribute("zIndex",0),i.updateTextPosition(),this.moveTaskBar.target=null,this.moveTaskBar.deltaX=0,this.moveTaskBar.deltaY=0,this.moveTaskBar.moveTaskBarXSpeed=0}dealTaskBarMove(t){const e=this._gantt;let i=this.moveTaskBar.target;i.setAttribute("zIndex",1e4);const o=e.eventManager.lastDragPointerXYOnWindow.x,n=t.x-o,r=e.eventManager.lastDragPointerXYOnWindow.y,s=t.y-r;if(this.moveTaskBar.deltaX+=n,this.moveTaskBar.deltaY+=s,uW(i,n,s,this),i.attribute.x<=e.stateManager.scrollLeft&&n<0)if(e.parsedOptions.moveTaskBarToExtendDateRange&&0===e.stateManager.scrollLeft){this.moveTaskBar.moveTaskBarXInertia?.endInertia();const o=e.parsedOptions.reverseSortedTimelineScales[0].timelineDates[1].startDate.getTime()-e.parsedOptions.reverseSortedTimelineScales[0].timelineDates[0].startDate.getTime(),{unit:n,startOfWeek:r}=e.parsedOptions.reverseSortedTimelineScales[0];e.parsedOptions.minDate=vS(new Date(e.parsedOptions.reverseSortedTimelineScales[0].timelineDates[0].startDate.getTime()-o/2),n,r),e.parsedOptions._minDateTime=e.parsedOptions.minDate?.getTime(),e._generateTimeLineDateMap(),e._updateSize(),e.scenegraph.refreshAll(),i=this.moveTaskBar.target=e.scenegraph.taskBar.getTaskBarNodeByIndex(this.moveTaskBar.target.task_index,this.moveTaskBar.target.sub_task_index),e.scrollLeft=e.parsedOptions.timelineColWidth-1,e.eventManager.lastDragPointerXYOnWindow.x=t.x,"milestone"===i.record?.type?uW(i,e.scrollLeft-i.attribute.x,0,this):i.setAttribute("x",e.scrollLeft)}else this.moveTaskBar.moveTaskBarXSpeed=-e.parsedOptions.timelineColWidth/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,o)=>{this.moveTaskBar.deltaX+=t,this.moveTaskBar.deltaY+=o,uW(i,t,o,this),e.stateManager.setScrollLeft(i.attribute.x),0===e.stateManager.scrollLeft&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}));else if(i.attribute.x+i.attribute.width>=e.stateManager.scrollLeft+e.tableNoFrameWidth&&n>0)if(e.parsedOptions.moveTaskBarToExtendDateRange&&e.stateManager.scrollLeft+e.tableNoFrameWidth===e.getAllDateColsWidth()){this.moveTaskBar.moveTaskBarXInertia?.endInertia();const o=e.parsedOptions.reverseSortedTimelineScales[0].timelineDates,n=o[1].startDate.getTime()-o[0].startDate.getTime(),{unit:r,startOfWeek:s,step:a}=e.parsedOptions.reverseSortedTimelineScales[0];if(e.parsedOptions.maxDate=fS(e.parsedOptions.minDate,new Date(o[o.length-1].endDate.getTime()+n/2),r,a),e.parsedOptions._maxDateTime=e.parsedOptions.maxDate?.getTime(),e._generateTimeLineDateMap(),e._updateSize(),e.scenegraph.refreshAll(),i=this.moveTaskBar.target=e.scenegraph.taskBar.getTaskBarNodeByIndex(this.moveTaskBar.target.task_index,this.moveTaskBar.target.sub_task_index),e.scrollLeft+=1,e.eventManager.lastDragPointerXYOnWindow.x=t.x,"milestone"===i.record?.type){const t=e.scrollLeft+e.tableNoFrameWidth-i.attribute.width;uW(i,t-i.attribute.x,0,this)}else i.setAttribute("x",e.scrollLeft+e.tableNoFrameWidth-i.attribute.width)}else this.moveTaskBar.moveTaskBarXSpeed=e.parsedOptions.timelineColWidth/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,o)=>{this.moveTaskBar.deltaX+=t,this.moveTaskBar.deltaY+=o,uW(i,t,o,this),e.stateManager.setScrollLeft(i.attribute.x+i.attribute.width-e.tableNoFrameWidth),e.stateManager.scrollLeft===e.getAllDateColsWidth()-e.tableNoFrameWidth&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}));else this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()?this.moveTaskBar.moveTaskBarXInertia.endInertia():this.moveTaskBar.moveTaskBarXSpeed=0;e.scenegraph.updateNextFrame()}startResizeTaskBar(t,e,i,o,n){this.resizeTaskBar.onIconName=n,this.resizeTaskBar.resizing=!0,this.resizeTaskBar.target=t,this.resizeTaskBar.targetStartX=t.attribute.x,this.resizeTaskBar.targetEndX=t.attribute.x+t.attribute.width,this.resizeTaskBar.startX=e,this.resizeTaskBar.startY=i,this.resizeTaskBar.startOffsetY=o}isResizingTaskBar(){return this.resizeTaskBar.resizing}endResizeTaskBar(t){const e=this._gantt.stateManager.resizeTaskBar.onIconName,i=t-this.resizeTaskBar.startX;if(Math.abs(i)>=1){const t=BS(("left"===e?this.resizeTaskBar.target.attribute.x:this.resizeTaskBar.target.attribute.x+this.resizeTaskBar.target.attribute.width)-this._gantt.stateManager.scroll.horizontalBarPos,this._gantt),i=this._gantt.parsedOptions.reverseSortedTimelineScales[0].timelineDates[t];if(!i)return;const n="left"===e?i.startDate:i.endDate,s=this.resizeTaskBar.target,a=s.clipGroupBox,l=s.barRect,h=s.progressRect,d=s.textLabel,c=s.task_index,u=s.sub_task_index,{taskDays:g,progress:p,startDate:f,endDate:v}=this._gantt.getTaskInfoByTaskListIndex(c,u);let m=!1;if("left"===e?(this._gantt._updateStartDateToTaskRecord(n,c,u),n.getTime()!==new Date(f).getTime()&&(m=!0)):(this._gantt._updateEndDateToTaskRecord(n,c,u),n.getTime()!==new Date(v).getTime()&&(m=!0)),this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact)this._gantt.taskListTableInstance.renderWithRecreateCells(),this._gantt._syncPropsFromTable(),this._gantt.scenegraph.refreshTaskBarsAndGrid();else{if("left"===e){const e=t>=1?this._gantt.getDateColsWidth(0,t-1):0;s.setAttribute("x",e),s.setAttribute("width",this.resizeTaskBar.targetEndX-e)}else if("right"===e){const e=this._gantt.getDateColsWidth(0,t);s.setAttribute("width",e-this.resizeTaskBar.targetStartX)}if(a.setAttribute("width",s.attribute.width),l?.setAttribute("width",s.attribute.width),h?.setAttribute("width",p/100*s.attribute.width),d){const{textAlign:t,textBaseline:e,padding:i}=this._gantt.parsedOptions.taskBarLabelStyle,o=PS(lS(i),t,e,s.attribute.width,s.attribute.height);d.setAttribute("maxLineWidth",s.attribute.width-20),d.setAttribute("x",o.x)}this._gantt.scenegraph.refreshRecordLinkNodes(c,u,s,0),this.showTaskBarHover(),cW(this._gantt,s,c,u),s.setAttribute("zIndex",0)}if(s.updateTextPosition(),this.resizeTaskBar.resizing=!1,this.resizeTaskBar.target=null,m&&this._gantt.hasListeners(r.CHANGE_DATE_RANGE)){const t=this._gantt.getRecordByIndex(c,u);this._gantt.fireListeners(r.CHANGE_DATE_RANGE,{startDate:t[this._gantt.parsedOptions.startDateField],endDate:t[this._gantt.parsedOptions.endDateField],oldStartDate:f,oldEndDate:v,index:c,record:t})}this._gantt.scenegraph.updateNextFrame()}}dealTaskBarResize(t){const e=this._gantt.eventManager.lastDragPointerXYOnWindow.x,i=t.x-e,o=this._gantt.stateManager.resizeTaskBar.target;let r="left"===this._gantt.stateManager.resizeTaskBar.onIconName?-i:i;const s=Math.max(1,o.attribute.width+r);r=s-o.attribute.width,function(t,e,i,o){const r=o._gantt.parsedOptions.progressField,s=t.clipGroupBox,a=t.barRect,l=t.progressRect,h=t.textLabel,d=t.task_index,c=t.sub_task_index,u=t.record,g=u[r],p=u.type===n.MILESTONE;t.setAttribute("zIndex",1e4),e&&t.setAttribute("x",t.attribute.x+e);p&&t.setAttribute("anchor",[t.attribute.x+t.attribute.width/2,t.attribute.y+t.attribute.height/2]);i&&t.setAttribute("width",i);if(s.setAttribute("width",t.attribute.width),a?.setAttribute("width",t.attribute.width),l?.setAttribute("width",g/100*t.attribute.width),h){const{textAlign:e,textBaseline:n,padding:r}=o._gantt.parsedOptions.taskBarLabelStyle,s=PS(lS(r),e,n,i,t.attribute.height);h.setAttribute("maxLineWidth",i-20),h.setAttribute("x",s.x)}t.updateTextPosition(),o.showTaskBarHover(),cW(o._gantt,t,d,c),o._gantt.scenegraph.refreshRecordLinkNodes(d,c,t,0)}(o,"left"===this._gantt.stateManager.resizeTaskBar.onIconName?-r:0,s,this),this._gantt.scenegraph.updateNextFrame()}startAdjustProgressBar(t,e,i){if(!t||!t.record)return;const o=this._gantt.parsedOptions.progressField;if(!o||void 0===t.record[o]||null===t.record[o])return;const{progress:n}=this._gantt.getTaskInfoByTaskListIndex(t.task_index,t.sub_task_index);this.adjustProgressBar.target=t,this.adjustProgressBar.adjusting=!0,this.adjustProgressBar.startX=e,this.adjustProgressBar.startY=i,this.adjustProgressBar.originalProgress=n}isAdjustingProgressBar(){return this.adjustProgressBar.adjusting}endAdjustProgressBar(t){const e=this.adjustProgressBar.target;if(!e)return;const i=e.attribute.width,o=t-this.adjustProgressBar.startX,n=Math.max(0,Math.min(100,this.adjustProgressBar.originalProgress+o/i*100));if(Math.abs(n-this.adjustProgressBar.originalProgress)>=.1){const t=e.task_index,i=e.sub_task_index,o=this._gantt.parsedOptions.progressField;o&&e.record&&(e.record[o]=Math.round(10*n)/10),this.shouldSyncProgressToTable(t,i)&&this._gantt._updateProgressToTaskRecord(Math.round(10*n)/10,t,i),this._gantt.scenegraph.taskBar.updateTaskBarNode(t,i);const s=this._gantt.getRecordByIndex(t,i);this._gantt.hasListeners(r.PROGRESS_UPDATE)&&this._gantt.fireListeners(r.PROGRESS_UPDATE,{federatedEvent:null,event:null,index:t,sub_task_index:i,progress:Math.round(10*n)/10,oldProgress:Math.round(10*this.adjustProgressBar.originalProgress)/10,record:s})}this.adjustProgressBar.adjusting=!1,this.adjustProgressBar.target=null,this.adjustProgressBar.startX=null,this.adjustProgressBar.startY=null,this.adjustProgressBar.originalProgress=0}shouldSyncProgressToTable(t,e){const i=this._gantt.parsedOptions.tasksShowMode;if(i===o.Tasks_Separate)return!0;if(!pt(e))return!0;switch(i){case o.Sub_Tasks_Inline:case o.Sub_Tasks_Arrange:case o.Sub_Tasks_Compact:return!1;case o.Sub_Tasks_Separate:return!0;case o.Project_Sub_Tasks_Inline:const e=this._gantt.getRecordByIndex(t);return!(!e||e.type!==n.PROJECT)&&"expand"===e.hierarchyState;default:return!1}}dealAdjustProgressBar(t){const e=this.adjustProgressBar.target;if(!e||!this.adjustProgressBar.adjusting)return;const i=e.attribute.width;if(!i||i<=0)return;const o=t.x-this.adjustProgressBar.startX,n=Math.max(0,Math.min(100,this.adjustProgressBar.originalProgress+o/i*100));if(e.progressRect&&e.progressRect.setAttribute("width",i*n/100),this._gantt.scenegraph.taskBar.hoverBarProgressHandle&&this._gantt.scenegraph.taskBar.hoverBarProgressHandle.attribute.visibleAll&&this._gantt.scenegraph.taskBar.hoverBarProgressHandle.setAttribute("x",i*n/100-6),e.textLabel&&e.record&&this._gantt.parsedOptions.taskBarLabelText){const t=this._gantt.parsedOptions.progressField,i={...e.record,[t]:Math.round(10*n)/10},o=aS(this._gantt.parsedOptions.taskBarLabelText,i);e.textLabel.setAttribute("text",o)}this._gantt.scenegraph&&this._gantt.scenegraph.stage&&this._gantt.scenegraph.stage.renderNextFrame()}startCreateDependencyLine(t,e,i,o,n){this.resizeTaskBar.resizing=!1,this.creatingDenpendencyLink.creating=!0,this.creatingDenpendencyLink.startClickedPoint=t,this.creatingDenpendencyLink.startX=e,this.creatingDenpendencyLink.startY=i,this.creatingDenpendencyLink.startOffsetY=o,this.creatingDenpendencyLink.firstTaskBarPosition=n,this.highlightLinkPointNode(t)}isCreatingDependencyLine(){return this.creatingDenpendencyLink.creating}endCreateDependencyLine(t){const e=this._gantt.parsedOptions.taskKeyField,o=this.selectedTaskBar.target.task_index,n=this.selectedTaskBar.target.sub_task_index,r=this.creatingDenpendencyLink.secondTaskBarNode.task_index,s=this.creatingDenpendencyLink.secondTaskBarNode.sub_task_index,a={linkedFromTaskKey:this._gantt.getRecordByIndex(o,n)[e],linkedToTaskKey:this._gantt.getRecordByIndex(r,s)[e],type:"left"===this.creatingDenpendencyLink.firstTaskBarPosition&&"left"===this.creatingDenpendencyLink.secondTaskBarPosition?i.StartToStart:"right"===this.creatingDenpendencyLink.firstTaskBarPosition&&"left"===this.creatingDenpendencyLink.secondTaskBarPosition?i.FinishToStart:"right"===this.creatingDenpendencyLink.firstTaskBarPosition&&"right"===this.creatingDenpendencyLink.secondTaskBarPosition?i.FinishToFinish:i.StartToFinish};return this._gantt.addLink(a),this.hideTaskBarSelectedBorder(),this._gantt.scenegraph.updateNextFrame(),this.creatingDenpendencyLink.creating=!1,a}dealCreateDependencyLine(t){const e=this.creatingDenpendencyLink.startX,i=this.creatingDenpendencyLink.startY,o=t.x-e,n=t.y-i,r=this.creatingDenpendencyLink.startClickedPoint,s=r.attribute.x+r.attribute.width/2,a=r.attribute.y+r.attribute.height/2;this._gantt.scenegraph.taskBar.updateCreatingDependencyLine(s,a,s+o,a+n),this._gantt.scenegraph.updateNextFrame()}startResizeTableWidth(t){this.resizeTableWidth.resizing=!0,this.resizeTableWidth.lastX=t.pageX}isResizingTableWidth(){return this.resizeTableWidth.resizing}endResizeTableWidth(){this.resizeTableWidth.resizing=!1,this._gantt.zoomScaleManager&&this._gantt.zoomScaleManager.handleTableWidthChange()}dealResizeTableWidth(t){if(!this.resizeTableWidth.resizing)return;const e=t.pageX-this.resizeTableWidth.lastX;if(Math.abs(e)>=1){let i=this._gantt.taskTableWidth+e;const o=Math.min(this._gantt.taskListTableInstance.getAllColsWidth()+this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.maxTableWidth??1e5),n=Math.max(this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.minTableWidth??0);e>0&&i>o&&(i=o),e<0&&i<n&&(i=n),this._gantt.taskTableWidth=i,this._gantt.element.style.left=this._gantt.taskTableWidth?`${this._gantt.taskTableWidth}px`:"0px",this._gantt.verticalSplitResizeLine.style.left=this._gantt.taskTableWidth?this._gantt.taskTableWidth-7+"px":"0px",this._gantt._resize(),this.resizeTableWidth.lastX=t.pageX,this._gantt.zoomScaleManager&&!this.resizeTableWidth.updateTimeout&&(this.resizeTableWidth.updateTimeout=setTimeout((()=>{this._gantt.zoomScaleManager&&this._gantt.zoomScaleManager.handleTableWidthChange(),this.resizeTableWidth.updateTimeout=null}),50))}}showTaskBarHover(){const t=this._gantt.stateManager.hoverTaskBar.target;if(t){const e=t.attribute.x,i=t.attribute.y,o=t.attribute.width,n=t.attribute.height;this._gantt.scenegraph.taskBar.showHoverBar(e,i,o,n,t),this._gantt.scenegraph.updateNextFrame()}}hideTaskBarHover(t){this._gantt.stateManager.hoverTaskBar.target=null,this._gantt.scenegraph.taskBar.hideHoverBar(),this._gantt.scenegraph.updateNextFrame()}showTaskBarSelectedBorder(t){this._gantt.stateManager.selectedTaskBar.target?.setAttribute("zIndex",0),this._gantt.stateManager.selectedTaskBar.target=t;const e=this._gantt.parsedOptions.dependencyLinkCreatable;t.setAttribute("zIndex",1e4);const i=t.attribute.x,o=t.attribute.y,n=t.attribute.width,r=t.attribute.height;this._gantt.scenegraph.taskBar.createSelectedBorder(i,o,n,r,t,e),this._gantt.scenegraph.updateNextFrame()}hideTaskBarSelectedBorder(){this._gantt.stateManager.selectedTaskBar.target?.setAttribute("zIndex",0),this._gantt.stateManager.selectedTaskBar.target=null,this._gantt.scenegraph.taskBar.removeSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}showSecondTaskBarSelectedBorder(){const t=this._gantt.stateManager.creatingDenpendencyLink.secondTaskBarNode,e=t.attribute.x,i=t.attribute.y,o=t.attribute.width,n=t.attribute.height;this._gantt.scenegraph.taskBar.createSelectedBorder(e,i,o,n,t,!0),this._gantt.scenegraph.updateNextFrame()}hideSecondTaskBarSelectedBorder(){this._gantt.stateManager.creatingDenpendencyLink.secondTaskBarNode=null,this._gantt.scenegraph.taskBar.removeSecondSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}showDependencyLinkSelectedLine(){const t=this._gantt.stateManager.selectedDenpendencyLink.link;this._gantt.scenegraph.dependencyLink.createSelectedLinkLine(t);const{taskKeyField:e,dependencyLinks:i}=this._gantt.parsedOptions,{linkedToTaskKey:n,linkedFromTaskKey:r,type:s}=t;let a,l,h,d;const c=ES(this._gantt.records,e,n),u=ES(this._gantt.records,e,r);this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?(a=u.index[0],l=u.index[1],h=c.index[0],d=c.index[1]):(a=this._gantt.getTaskShowIndexByRecordIndex(u.index),h=this._gantt.getTaskShowIndexByRecordIndex(c.index));const g=this._gantt.scenegraph.taskBar.getTaskBarNodeByIndex(a,l);this._gantt.scenegraph.taskBar.createSelectedBorder(g.attribute.x,g.attribute.y,g.attribute.width,g.attribute.height,g,!1);const p=this._gantt.scenegraph.taskBar.getTaskBarNodeByIndex(h,d);this._gantt.scenegraph.taskBar.createSelectedBorder(p.attribute.x,p.attribute.y,p.attribute.width,p.attribute.height,p,!1),this._gantt.scenegraph.updateNextFrame()}hideDependencyLinkSelectedLine(){this._gantt.stateManager.selectedDenpendencyLink.link=null,this._gantt.scenegraph.dependencyLink.removeSelectedLinkLine(),this._gantt.scenegraph.taskBar.removeSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}highlightLinkPointNode(t){if(t?.children.length>0){const e=t.children[0];e.setAttribute("fill",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.fillColor),e.setAttribute("stroke",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.strokeColor),e.setAttribute("radius",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.radius),e.setAttribute("lineWidth",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.strokeWidth),this._gantt.scenegraph.updateNextFrame()}}unhighlightLinkPointNode(t){if(t?.children.length>0){const e=t.children[0];e.setAttribute("fill",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.fillColor),e.setAttribute("stroke",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeColor),e.setAttribute("radius",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.radius),e.setAttribute("lineWidth",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeWidth),this._gantt.scenegraph.updateNextFrame()}}showMarklineIconHover(){const t=this._gantt.stateManager.marklineIcon.target;if(t){const e=this._gantt.scenegraph.timelineHeader.showMarklineIcon(t.parent);e&&this._gantt.parsedOptions.markLineCreateOptions?.markLineCreationHoverToolTip?.tipContent&&this._gantt.scenegraph.showToolTip(e),this._gantt.scenegraph.updateNextFrame()}}hideMarklineIconHover(){this._gantt.scenegraph.timelineHeader.hideMarklineIconHover(this._gantt.stateManager.marklineIcon.target.parent),this._gantt.scenegraph.hideToolTip(),this._gantt.stateManager.marklineIcon.target=null,this._gantt.scenegraph.updateNextFrame()}updateProjectTaskTimes(t){if(!t||0===t.length||!this._gantt||!this._gantt.records)return;const e=this._gantt.parsedOptions.startDateField,i=this._gantt.parsedOptions.endDateField,o=[...t];for(;o.length>0;){const t=[...o],r=t.pop();let s=this._gantt.records;for(const e of t){if(!s[e]||!s[e].children)return;s=s[e].children}const a=0===t.length?this._gantt.records[r]:s[r];if(a&&a.type===n.PROJECT&&a.children&&a.children.length>0){let t=null,o=null;for(const n of a.children)if(n[e]&&n[i]){const r=new Date(n[e]),s=new Date(n[i]);(!t||r<t)&&(t=r),(!o||s>o)&&(o=s)}if(t&&o){const n=a[e]?new Date(a[e]):null,r=a[i]?new Date(a[i]):null;if(!n||!r||t.getTime()!==n.getTime()||o.getTime()!==r.getTime()){const n=this._gantt.parsedOptions.dateFormat??this._gantt.parseTimeFormat(a[e]||a.children[0][e]),r=t=>this._gantt.formatDate?this._gantt.formatDate(t,n):t.toISOString().split("T")[0];a[e]=r(t),a[i]=r(o)}}}o.pop()}this._gantt.scenegraph?.refreshAll()}}function cW(t,e,i,o){const n=t.parsedOptions.taskBarCustomLayout;if(n){let r;if("function"==typeof n){const{startDate:s,endDate:a,taskDays:l,progress:h,taskRecord:d}=t.getTaskInfoByTaskListIndex(i,o);r=n({width:e.attribute.width,height:e.attribute.height,index:i,startDate:s,endDate:a,taskDays:l,progress:h,taskRecord:d,ganttInstance:t})}else r=n;if(r){const t=r.rootContainer;t.name="task-bar-custom-render";const i=e.children.find((t=>"task-bar-group"===t.name));if(i){const e=i.children.findIndex((t=>"task-bar-custom-render"===t.name)),o=i.children[e];o&&(i.removeChild(o),i.insertInto(t,e))}}}}function uW(t,e,i,r){const s=t.task_index,a=t.sub_task_index,l=t.record.type===n.MILESTONE,h=t.attribute.x,d=t.attribute.y;if(e&&t.setAttribute("x",Math.max(0,t.attribute.x+e)),r._gantt.parsedOptions.tasksShowMode!==o.Tasks_Separate&&r._gantt.parsedOptions.tasksShowMode!==o.Project_Sub_Tasks_Inline?i&&t.setAttribute("y",t.attribute.y+i):i=0,l&&(t.setAttribute("anchor",[t.attribute.x+t.attribute.width/2,t.attribute.y+t.attribute.height/2]),t.milestoneTextContainer)){const e=t.attribute.x-h,i=t.attribute.y-d,o=t.milestoneTextContainer.attribute.x,n=t.milestoneTextContainer.attribute.y;t.milestoneTextContainer.setAttribute("x",o+e),t.milestoneTextContainer.setAttribute("y",n+i)}t.updateTextPosition(),r._gantt.scenegraph.refreshRecordLinkNodes(s,a,t,i)}let gW=1,pW=class{listenersData={listeners:{},listenerData:{}};on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=gW++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const n=i.indexOf(e);i.splice(n,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;this.listenersData.listenerData[e]?.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>pt(t))):[]}release(){delete this.listenersData}};class fW{records;_gantt;constructor(t){this._gantt=t,this.records=t.records,this.processRecords()}processRecords(){const t=!this._gantt.options.minDate,e=!this._gantt.options.maxDate;let i=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER;if((t||e||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact)&&this.records.length){for(let r=0;r<this.records.length;r++){const s=this.records[r];if(t&&s[this._gantt.parsedOptions.startDateField]){const t=dS(s[this._gantt.parsedOptions.startDateField]);i=Math.min(i,t.getTime())}if(e&&s[this._gantt.parsedOptions.endDateField]){const t=dS(s[this._gantt.parsedOptions.endDateField]);n=Math.max(n,t.getTime())}this._gantt.parsedOptions.tasksShowMode!==o.Sub_Tasks_Inline&&this._gantt.parsedOptions.tasksShowMode!==o.Sub_Tasks_Compact||s.children&&s.children.sort(((t,e)=>dS(t[this._gantt.parsedOptions.startDateField]).getTime()-dS(e[this._gantt.parsedOptions.startDateField]).getTime()))}const{unit:r,startOfWeek:s,step:a}=this._gantt.parsedOptions.reverseSortedTimelineScales[0];t&&(this._gantt.parsedOptions.minDate=vS(new Date(i),r,s),this._gantt.parsedOptions._minDateTime=this._gantt.parsedOptions.minDate.getTime()),t&&!e&&(this._gantt.parsedOptions.maxDate=fS(this._gantt.parsedOptions.minDate,new Date(this._gantt.options.maxDate),r,a),this._gantt.parsedOptions._maxDateTime=this._gantt.parsedOptions.maxDate.getTime()),e&&(this._gantt.parsedOptions.maxDate=fS(this._gantt.parsedOptions.minDate,new Date(n),r,a),this._gantt.parsedOptions._maxDateTime=this._gantt.parsedOptions.maxDate.getTime())}}adjustOrder(t,e,i,r){if((this._gantt.parsedOptions.tasksShowMode!==o.Sub_Tasks_Arrange&&this._gantt.parsedOptions.tasksShowMode!==o.Sub_Tasks_Compact||t!==i)&&!(i<0||r<0))if(this._gantt.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline){if(pt(e)&&pt(r)&&pt(t)&&pt(i)){const o=this.records[t].children[e];this.records[t].children.splice(e,1),this.records[i]?.children||(this.records[i].children=[]),this.records[i].children.splice(r,0,o)}this.records[i]?.children?.sort(((t,e)=>dS(t[this._gantt.parsedOptions.startDateField]).getTime()-dS(e[this._gantt.parsedOptions.startDateField]).getTime()))}else if(this._gantt.parsedOptions.tasksShowMode===o.Project_Sub_Tasks_Inline){if(pt(e)&&pt(r)&&pt(t)&&pt(i)){this.records[t].type,n.PROJECT;const o=this.records[i].type===n.PROJECT,s=this.records[t].children[e];this.records[t].children.splice(e,1),this.records[i]?.children||(this.records[i].children=[]),this.records[i].children.splice(r,0,s),o&&this.records[i]?.children?.sort(((t,e)=>dS(t[this._gantt.parsedOptions.startDateField]).getTime()-dS(e[this._gantt.parsedOptions.startDateField]).getTime()))}}else if(pt(e)&&pt(r)&&pt(t)&&pt(i)){const o=this.records[t].children[e];this.records[t].children.splice(e,1),this.records[i]?.children||(this.records[i].children=[]),this.records[i].children.splice(r,0,o)}}setRecords(t){this.records=t,this.processRecords()}}class vW{plugins=new Map;gantt;constructor(t,e){this.gantt=t,e.plugins?.forEach((t=>{this.register(t),this._initializePluginRun(t)}))}_initializePluginRun(t){if(void 0===t.runTime)try{t.run(this.gantt)}catch(t){}else this._bindGanttEventForPlugin(t)}register(t){this.plugins.set(t.id,t)}registerAll(t){t.forEach((t=>this.register(t)))}getPlugin(t){return this.plugins.get(t)}getPluginByName(t){return Array.from(this.plugins.values()).find((e=>e.name===t))}_bindGanttEventForPlugin(t){t.runTime&&t.runTime.forEach((e=>{this.gantt.on(e,((...i)=>{try{t.run?.(...i,e,this.gantt)}catch(t){}}))}))}updatePlugins(t){Array.from(this.plugins.values()).filter((e=>!t?.some((t=>t.id===e.id)))).forEach((t=>{this.release(),this.plugins.delete(t.id)})),this.plugins.forEach((t=>{t.update&&t.update()}));const e=t?.filter((t=>!this.plugins.has(t.id)));e?.forEach((t=>{this.register(t),this._initializePluginRun(t)}))}release(){this.plugins.forEach((t=>{try{t.release?.(this.gantt)}catch(t){}}))}}class mW{gantt;dataZoomAxis;stage;canvas;isUpdatingFromDataZoom=!1;isUpdatingFromGantt=!1;lastDataZoomState={start:.2,end:.5};cleanupCallbacks=[];resizeTimeout=null;isInitializing=!0;constructor(t,e){this.gantt=t,this.initializeDataZoom(e),this.setupEventListeners(),this.updateDataZoomLimits()}getContainerId(t){if(t)return t;const e=this.gantt.container;if(e?.id)return e.id;const i=document.querySelectorAll('[id*="gantt"], [id*="table"], [class*="gantt"], [class*="vtable"]');if(i.length>0){const t=i[0];if(t.id)return t.id}return"vTable"}initializeDataZoom(t){const e=this.getContainerId(t.containerId);if(!document.getElementById(e))throw new Error(`DataZoom container with ID "${e}" not found`);const i=this.gantt.container;if(!i)throw new Error("Gantt container not found");const o=this.gantt.taskTableWidth||0,n=(i.offsetWidth||1e3)-o,r=this.gantt.taskTableWidth||0,{start:s=.2,end:a=.5,width:l=n,height:h=30,x:d=r,y:c=0,delayTime:u=10}=t;"static"===window.getComputedStyle(i).position&&(i.style.position="relative");const g=document.createElement("div");g.id="dataZoomWrapper",g.style.cssText=`\n width: 100%;\n height: ${h}px;\n position: absolute;\n bottom: ${c}px;\n left: 0px;\n background: transparent;\n overflow: visible;\n pointer-events: none;\n z-index: 1000;\n `,this.canvas=document.createElement("canvas"),this.canvas.id="dataZoomCanvas",this.canvas.width=l,this.canvas.height=h,this.canvas.style.cssText=`\n width: ${l}px;\n height: ${h}px;\n position: absolute;\n top: 0px;\n left: ${d}px;\n pointer-events: auto;\n `,g.appendChild(this.canvas),i.appendChild(g),this.stage=Cg({canvas:this.canvas,width:l,height:h,autoRender:!0}),this.dataZoomAxis=new S_({start:s,end:a,position:{x:0,y:0},size:{width:l,height:h-1},showDetail:!1,delayTime:u,brushSelect:!1,backgroundChartStyle:{line:{visible:!0,stroke:"#ddd"},area:{visible:!0,fill:"#f5f5f5"}},startHandlerStyle:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:"#fff",size:t.width??30,stroke:"#c2c8cf",lineWidth:1},endHandlerStyle:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:"#fff",size:t.width??30,stroke:"#c2c8cf",lineWidth:1},middleHandlerStyle:{visible:!1}}),this.stage.defaultLayer.add(this.dataZoomAxis),ng.getRequestAnimationFrame()((()=>{if(this.isInitializing){const t=this.getGanttViewBoundaries();this.dataZoomAxis.setStartAndEnd(t.startRatio,t.endRatio),this.isInitializing=!1}this.stage.render()})),this.lastDataZoomState={start:s,end:a}}setupEventListeners(){const t=t=>{if(this.isUpdatingFromGantt)return;this.isUpdatingFromDataZoom=!0;let e=t.start??t.detail?.start??t.currentTarget?.attribute?.start,i=t.end??t.detail?.end??t.currentTarget?.attribute?.end;void 0!==e&&void 0!==i||(e=this.dataZoomAxis.attribute.start,i=this.dataZoomAxis.attribute.end),void 0===e||void 0===i||isNaN(e)||isNaN(i)||this.applyDataZoomRangeToGantt(e,i),setTimeout((()=>{this.isUpdatingFromDataZoom=!1}),50)};this.dataZoomAxis.addEventListener("change",t),this.cleanupCallbacks.push((()=>{this.dataZoomAxis.removeEventListener("change",t)}));const e=t=>{if(this.isUpdatingFromDataZoom)return;if("horizontal"!==t.scrollDirection)return;this.isUpdatingFromGantt=!0;const e=this.getGanttViewBoundaries();this.dataZoomAxis.setStartAndEnd(e.startRatio,e.endRatio),this.stage.render(),setTimeout((()=>{this.dataZoomAxis.setAttribute("disableTriggerEvent",!1),this.isUpdatingFromGantt=!1}),10)};this.gantt.addEventListener("scroll",e),this.cleanupCallbacks.push((()=>{this.gantt.removeEventListener("scroll",e)}));const i=()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{this.updateResponsive(),this.updateDataZoomLimits()}),50)};window.addEventListener("resize",i),this.cleanupCallbacks.push((()=>{window.removeEventListener("resize",i),this.resizeTimeout&&clearTimeout(this.resizeTimeout)}));const o=()=>{setTimeout((()=>{this.updateDataZoomLimits(),this.isUpdatingFromDataZoom||this.syncToDataZoom()}),50)};this.gantt.addEventListener("zoom",o),this.cleanupCallbacks.push((()=>{this.gantt.removeEventListener("zoom",o)}))}calculateDataZoomLimits(){let t,e;this.gantt.zoomScaleManager?(t=this.gantt.zoomScaleManager.getGlobalMinMillisecondsPerPixel?.()||1e3,e=this.gantt.zoomScaleManager.getGlobalMaxMillisecondsPerPixel?.()||6e6):(t=this.gantt.parsedOptions.zoom?.minMillisecondsPerPixel??1e3,e=this.gantt.parsedOptions.zoom?.maxMillisecondsPerPixel??6e6);const i=this.gantt.tableNoFrameWidth,o=this.gantt.parsedOptions._maxDateTime-this.gantt.parsedOptions._minDateTime,n=t*i,r=Math.min(1,n/o),s=e*i,a=Math.min(1,s/o);return{minRangeRatio:Math.min(r,a),maxRangeRatio:Math.max(r,a),minMillisecondsPerPixel:t,maxMillisecondsPerPixel:e}}updateDataZoomLimits(){const t=this.calculateDataZoomLimits();this.dataZoomAxis.setAttributes({minSpan:t.minRangeRatio,maxSpan:t.maxRangeRatio}),this.stage.render()}getGanttViewBoundaries(){const t=this.gantt.stateManager.scrollLeft,e=this.gantt.getAllDateColsWidth(),i=this.gantt.tableNoFrameWidth;return{scrollLeft:t,totalWidth:e,viewportWidth:i,startRatio:Math.max(0,Math.min(1,t/e)),endRatio:Math.max(0,Math.min(1,(t+i)/e))}}applyDataZoomRangeToGantt(t,e){if(void 0===t||void 0===e||isNaN(t)||isNaN(e))return;this.lastDataZoomState={start:t,end:e};const i=this.gantt.tableNoFrameWidth,o=this.gantt.getCurrentMillisecondsPerPixel(),n=e-t,r=(this.gantt.parsedOptions._maxDateTime-this.gantt.parsedOptions._minDateTime)*n/i;if(Math.abs(r-o)>.01*o)if(this.gantt.zoomScaleManager){const t=this.gantt.zoomScaleManager.findOptimalLevel(r);t!==this.gantt.zoomScaleManager.getCurrentLevel()&&this.gantt.zoomScaleManager.switchToLevel(t),this.gantt.setMillisecondsPerPixel(r)}else this.gantt.setMillisecondsPerPixel(r);const s=t*this.gantt.getAllDateColsWidth();this.gantt.stateManager.setScrollLeft(s)}syncInitialPosition(){setTimeout((()=>{const t=this.getGanttViewBoundaries();(t.startRatio>0||t.endRatio<1)&&this.dataZoomAxis.setStartAndEnd(t.startRatio,t.endRatio)}),100)}syncToGantt(){const t=this.dataZoomAxis.attribute.start||0,e=this.dataZoomAxis.attribute.end||1;this.applyDataZoomRangeToGantt(t,e)}syncToDataZoom(){const t=this.getGanttViewBoundaries();this.dataZoomAxis.setStartAndEnd(t.startRatio,t.endRatio)}syncToGanttWithState(t,e){this.isUpdatingFromDataZoom=!0,this.applyDataZoomRangeToGantt(t,e),setTimeout((()=>{this.isUpdatingFromDataZoom=!1}),50)}setRange(t,e){this.dataZoomAxis.setStartAndEnd(t,e)}getRange(){return{start:this.dataZoomAxis.attribute.start||0,end:this.dataZoomAxis.attribute.end||1}}resize(t,e){if(void 0===t){const e=this.gantt.container;if(e){const i=this.gantt.taskTableWidth||0;t=e.offsetWidth-i}else t=1e3}void 0===e&&(e=30),this.canvas.width=t,this.canvas.height=e,this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`,this.stage.resize(t,e),this.dataZoomAxis.setAttributes({size:{width:t,height:e-1}}),this.stage.render()}updateResponsive(){const t=this.gantt.container;if(!t)return;const e=this.gantt.taskTableWidth||0,i=t.offsetWidth-e;this.resize(i);const o=this.gantt.taskTableWidth||0;this.updatePosition(o,0),setTimeout((()=>{this.syncToDataZoom()}),10)}updatePosition(t,e){const i=t??this.gantt.taskTableWidth??0;this.canvas.style.left=`${i}px`}destroy(){if(this.cleanupCallbacks.forEach((t=>t())),this.cleanupCallbacks=[],this.canvas&&this.canvas.parentNode){const t=this.canvas.parentNode;t&&"dataZoomWrapper"===t.id&&t.parentNode?t.parentNode.removeChild(t):t.removeChild(this.canvas)}this.stage&&this.stage.release()}}class bW{gantt;config;currentLevelIndex=0;levelBoundaries=[];globalMinMillisecondsPerPixel=0;globalMaxMillisecondsPerPixel=0;dataZoomIntegration=null;constructor(t,e){this.gantt=t;const i={enabled:!0,levels:[],...e};if(this.config=i,this.initializeZoomLimits(),this.sortLevelsByCoarseness(),this.calculateGlobalMillisecondsPerPixelRange(),this.calculateLevelBoundaries(),this.updateZoomLimits(),this.config.levels.length>0){const t=this.calculateInitialMillisecondsPerPixel();this.initializeWithMillisecondsPerPixel(t)}this.initializeDataZoomIfNeeded()}initializeZoomLimits(){const t=this.gantt.parsedOptions.zoom,e=this.config;this.gantt.parsedOptions.zoom={minMillisecondsPerPixel:t?.minMillisecondsPerPixel??e.minMillisecondsPerPixel??1e3,maxMillisecondsPerPixel:t?.maxMillisecondsPerPixel??e.maxMillisecondsPerPixel??6e6,step:e.step??.015}}initializeDataZoomIfNeeded(){const t=this.config.dataZoomAxis;if(!t?.enabled)return;const e={containerId:t.containerId,width:t.width,height:t.height??30,x:t.x,y:t.y??0,delayTime:t.delayTime??10};try{this.dataZoomIntegration=new mW(this.gantt,e)}catch(t){}}handleTableWidthChange(){this.dataZoomIntegration&&this.dataZoomIntegration.updateResponsive()}sortLevelsByCoarseness(){this.config.levels.length<=1||this.config.levels.sort(((t,e)=>{const i=this.findMinTimeUnit(t),o=this.findMinTimeUnit(e),n=this.getUnitMilliseconds(i.unit,i.step);return this.getUnitMilliseconds(o.unit,o.step)-n}))}calculateGlobalMillisecondsPerPixelRange(){const t=this.config.levels;if(0===t.length)return;let e=null,i=0,o=null,n=1/0;for(const r of t){const t=this.findMinTimeUnit(r),s=this.getUnitMilliseconds(t.unit,t.step);s>i&&(i=s,e=t),s<n&&(n=s,o=t)}if(e&&o&&(this.globalMinMillisecondsPerPixel=n/120,this.globalMaxMillisecondsPerPixel=i/150,this.globalMinMillisecondsPerPixel>this.globalMaxMillisecondsPerPixel)){const t=this.globalMinMillisecondsPerPixel;this.globalMinMillisecondsPerPixel=this.globalMaxMillisecondsPerPixel,this.globalMaxMillisecondsPerPixel=t}}calculateLevelBoundaries(){const t=this.config.levels.length;if(0===t)return;this.levelBoundaries=[];const e=[];e[t]=this.globalMinMillisecondsPerPixel;for(let i=t-1;i>=1;i--){const t=this.config.levels[i],o=this.findMinTimeUnit(t),n=this.getUnitMilliseconds(o.unit,o.step)/this.getMinColWidthForUnit(o.unit,o.step);e[i]=n}e[0]=this.globalMaxMillisecondsPerPixel,this.levelBoundaries=[...e];for(let e=1;e<t;e++){if(this.levelBoundaries[e]>=this.levelBoundaries[e-1]){const t=this.levelBoundaries[e-1],i=this.levelBoundaries[e+1]||this.globalMinMillisecondsPerPixel;this.levelBoundaries[e]=(t+i)/2}this.levelBoundaries[e]=Math.max(this.globalMinMillisecondsPerPixel,Math.min(this.globalMaxMillisecondsPerPixel,this.levelBoundaries[e]))}}updateZoomLimits(){this.gantt.parsedOptions.zoom||(this.gantt.parsedOptions.zoom={}),this.gantt.parsedOptions.zoom.minMillisecondsPerPixel=this.globalMinMillisecondsPerPixel,this.gantt.parsedOptions.zoom.maxMillisecondsPerPixel=this.globalMaxMillisecondsPerPixel}getGlobalMinMillisecondsPerPixel(){return this.globalMinMillisecondsPerPixel}getGlobalMaxMillisecondsPerPixel(){return this.globalMaxMillisecondsPerPixel}calculateInitialMillisecondsPerPixel(){return this.globalMinMillisecondsPerPixel+.4*(this.globalMaxMillisecondsPerPixel-this.globalMinMillisecondsPerPixel)}initializeWithMillisecondsPerPixel(t){if(0===this.config.levels.length)return;const e=this.findOptimalLevel(t);this.setInitialLevel(e)}setInitialLevel(t){if(t<0||t>=this.config.levels.length)return;const e=this.config.levels[t];e&&0!==e.length&&(this.gantt.options.timelineHeader.scales=[...e],this.currentLevelIndex=t)}findOptimalLevel(t){const e=Math.max(this.globalMinMillisecondsPerPixel,Math.min(this.globalMaxMillisecondsPerPixel,t));for(let t=0;t<this.levelBoundaries.length-1;t++)if(e<=this.levelBoundaries[t]&&e>this.levelBoundaries[t+1])return t;return this.config.levels.length-1}switchToLevel(t){if(t<0||t>=this.config.levels.length)return!1;if(this.currentLevelIndex===t)return!0;const e=this.config.levels[t];if(!e||0===e.length)return!1;try{return this.gantt.updateScales([...e]),this.currentLevelIndex=t,this.gantt.recalculateTimeScale(),!0}catch(t){return!1}}findMinTimeUnit(t){let e=t[0],i=this.getUnitMilliseconds(e.unit,e.step);for(const o of t){const t=this.getUnitMilliseconds(o.unit,o.step);t<i&&(i=t,e=o)}return e}getUnitMilliseconds(t,e){const i={second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6};return(i[t]||i.day)*e}getMinColWidthForUnit(t,e){switch(t){case"hour":return e>1?120:60;case"minute":return 80;case"second":return 100;default:return 60}}getCurrentLevel(){return this.currentLevelIndex}getInitialMillisecondsPerPixel(){return this.calculateInitialMillisecondsPerPixel()}getCurrentZoomState(){if(0===this.config.levels.length)return null;const t=this.config.levels[this.currentLevelIndex],e=this.findMinTimeUnit(t),i=this.gantt.getCurrentMillisecondsPerPixel(),o=this.getUnitMilliseconds(e.unit,e.step)/i;return{minUnit:e.unit,step:e.step,levelNum:this.currentLevelIndex,currentColWidth:Math.round(10*o)/10}}setZoomPosition(t){if(0===this.config.levels.length)return!1;const{minUnit:e,step:i,levelNum:o,colWidth:n}=t;let r,s=null;if(void 0!==e&&void 0!==i){if(s=this.findLevelByMinUnit(e,i),null===s)return!1}else{if(void 0===o)return!1;if(o<0||o>=this.config.levels.length)return!1;s=o}if(void 0!==n){const t=this.config.levels[s],e=this.findMinTimeUnit(t);r=this.getUnitMilliseconds(e.unit,e.step)/n;const i=this.levelBoundaries[s],o=this.levelBoundaries[s+1];(r<o||r>i)&&(r=(i+o)/2)}else{r=(this.levelBoundaries[s]+this.levelBoundaries[s+1])/2}return s!==this.currentLevelIndex&&this.switchToLevel(s),this.gantt.setMillisecondsPerPixel(r),!0}findLevelByMinUnit(t,e){for(let i=0;i<this.config.levels.length;i++){const o=this.config.levels[i],n=this.findMinTimeUnit(o);if(n.unit===t&&n.step===e)return i}return null}zoomIn(t=1.1,e=!0,i){this.gantt.zoomByFactor(t,e,i)}zoomOut(t=.9,e=!0,i){this.gantt.zoomByFactor(t,e,i)}zoomByPercentage(t,e=!0,i){const o=this.gantt.getCurrentMillisecondsPerPixel(),n=o-(this.globalMaxMillisecondsPerPixel-this.globalMinMillisecondsPerPixel)*t/100;let r;e&&this.gantt.scenegraph&&(void 0===i&&(i=this.gantt.scenegraph.width/2),r=(this.gantt.stateManager.scroll.horizontalBarPos+i)*o);const s=this.findOptimalLevel(n);if(s!==this.getCurrentLevel()&&this.switchToLevel(s),this.gantt.setMillisecondsPerPixel(n),void 0!==r&&void 0!==i){const t=r/this.gantt.getCurrentMillisecondsPerPixel()-i;this.gantt.stateManager.setScrollLeft(t)}}getDataZoomIntegration(){return this.dataZoomIntegration}createDataZoomIntegration(t){return this.dataZoomIntegration&&this.dataZoomIntegration.destroy(),this.dataZoomIntegration=new mW(this.gantt,t),this.dataZoomIntegration}destroyDataZoomIntegration(){this.dataZoomIntegration&&(this.dataZoomIntegration.destroy(),this.dataZoomIntegration=null)}updateDataZoomResponsive(){this.dataZoomIntegration&&this.dataZoomIntegration.updateResponsive()}recalculateTimeScale(){const t=this.gantt.parsedOptions.reverseSortedTimelineScales[0];if(!t)return;let e;switch(t.unit){case"second":e=1e3*t.step;break;case"minute":e=6e4*t.step;break;case"hour":e=36e5*t.step;break;case"day":default:e=864e5*t.step;break;case"week":e=6048e5*t.step;break;case"month":e=2592e6*t.step;break;case"quarter":e=7776e6*t.step;break;case"year":e=31536e6*t.step}const i=e/this.gantt.getCurrentMillisecondsPerPixel();this.gantt.parsedOptions.timelineColWidth=i,this.gantt._generateTimeLineDateMap(),this.gantt.scenegraph&&(this.gantt._updateSize(),this.gantt.scenegraph.refreshAll())}zoomByFactor(t,e=!0,i){const o=this.gantt.parsedOptions.zoom?.minMillisecondsPerPixel??2e5,n=this.gantt.parsedOptions.zoom?.maxMillisecondsPerPixel??3e6,s=this.gantt.getCurrentMillisecondsPerPixel(),a=this.gantt.parsedOptions.timelineColWidth;let l;if(e){void 0===i&&(i=this.gantt.scenegraph.width/2);const t=(this.gantt.stateManager.scroll.horizontalBarPos+i)*s;l=this.gantt.parsedOptions._minDateTime+t}const h=this.gantt.getCurrentMillisecondsPerPixel();let d=t;const c=144e4,u=Math.log(h/c)/Math.log(2);if(h<c){const e=Math.pow(1.2,-u);d=Math.pow(t,e)}else{const e=Math.pow(.9,u);d=Math.pow(t,e)}const g=this.gantt.getCurrentMillisecondsPerPixel()/d,p=Math.max(o,Math.min(n,g));this.gantt.setMillisecondsPerPixel(p);const f=this.findOptimalLevel(p);if(f!==this.getCurrentLevel()?this.switchToLevel(f):this.recalculateTimeScale(),e&&void 0!==l&&void 0!==i){const t=this.gantt.getCurrentMillisecondsPerPixel(),e=(l-this.gantt.parsedOptions._minDateTime)/t-i;this.gantt.stateManager.setScrollLeft(e)}if(this.gantt.hasListeners(r.ZOOM)){const t=this.gantt.getCurrentMillisecondsPerPixel();this.gantt.fireListeners(r.ZOOM,{oldWidth:a,newWidth:this.gantt.parsedOptions.timelineColWidth,scale:s/t,oldMillisecondsPerPixel:s,newMillisecondsPerPixel:t})}}}var yW=Object.freeze({__proto__:null,formatDate:eS,getTodayNearDay:function(t,e){const i=(new Date).getTime(),o=new Date(i+864e5*t);if(e){const t=o.getFullYear().toString(),i=(o.getMonth()+1).toString().padStart(2,"0"),n=o.getDate().toString().padStart(2,"0");return e=(e=(e=e.replace("yyyy",t)).replace("mm",i)).replace("dd",n)}return o},getWeekNumber:hS,getWeekday:function(t,e="long"){const i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=new Date(t);return"short"===e?i[o.getDay()].substr(0,3):"long"===e?i[o.getDay()]:'Invalid format specified. Please use "short" or "long".'}}),CW=Object.freeze({__proto__:null,Arc:Gh,Area:Dh,Circle:nh,Group:fl,Image:Th,Line:mh,Path:Ih,Rect:Ch,RichText:Eh,Text:lh}),wW=Object.freeze({__proto__:null,CustomLayout:zD,TABLE_EVENT_TYPE:uT,TYPES:hA,register:ZF,themes:XT}),xW=Object.freeze({__proto__:null,PluginManager:vW});t.Gantt=class extends pW{options;container;tableNoFrameWidth;tableNoFrameHeight;tableX;tableY;scenegraph;stateManager;eventManager;taskListTableInstance;canvas;element;verticalSplitResizeLine;horizontalSplitLine;context;timeLineHeaderLevel;itemCount;drawHeight;headerHeight;gridHeight;pluginManager;parsedOptions={};millisecondsPerPixel;zoomScaleManager;recalculateTimeScale(){this.zoomScaleManager&&this.zoomScaleManager.recalculateTimeScale()}zoomByFactor(t,e=!0,i){this.zoomScaleManager&&this.zoomScaleManager.zoomByFactor(t,e,i)}taskTableWidth;taskTableColumns;records;data;constructor(t,e){super(),this.container=t,this.options=e,this.taskTableWidth="number"==typeof e?.taskListTable?.tableWidth?e?.taskListTable?.tableWidth:-1,this.taskTableColumns=e?.taskListTable?.columns??[],this.records=e?.records??[],e.timelineHeader?.zoomScale&&!1!==e.timelineHeader.zoomScale.enabled&&(this.zoomScaleManager=new bW(this,e.timelineHeader.zoomScale)),this._sortScales(),MS(this),this.zoomScaleManager?this.millisecondsPerPixel=this.zoomScaleManager.getInitialMillisecondsPerPixel():this.millisecondsPerPixel=144e4,function(t){if(!t.records||0===t.records.length)return;const e=t.parsedOptions.startDateField,i=t.parsedOptions.endDateField,o=(r,s,a)=>{let l=null,h=null;return r.forEach(((s,a)=>{if(!s)return;let d=null,c=null;if(s.children&&s.children.length>0&&s.type===n.PROJECT){const[l,h]=o(s.children);if(l&&h&&(d=l,c=h,s.type===n.PROJECT)){const o=t.parsedOptions.dateFormat??t.parseTimeFormat(s[e]||s.children[0][e]||""),n=e=>t.formatDate?t.formatDate(e,o):e.toISOString().split("T")[0],l={...s};l[e]=n(d),l[i]=n(c),r[a]=l}}else s[e]&&s[i]&&(d=new Date(s[e]),c=new Date(s[i]));d&&(!l||d<l)&&(l=d),c&&(!h||c>h)&&(h=c)})),[l,h]};o(t.records)}(this),this.data=new fW(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.element=function(t,e="vtable-gantt"){const i=document.createElement("div");i.setAttribute("tabindex","0"),i.classList.add(e),i.style.outline="none",i.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const o=(i.offsetWidth||i.parentElement?.offsetWidth||1)-1,n=(i.offsetHeight||i.parentElement?.offsetHeight||1)-1;return i.style.width=o&&o-t.left-t.right+"px"||"0px",i.style.height=n&&n-t.top-t.bottom+"px"||"0px",i}({top:0,right:0,left:0,bottom:0},"vtable-gantt"),this.element.style.left=-1!==this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.context=this.canvas.getContext("2d"),t?(t.appendChild(this.element),this._updateSize()):this._updateSize(),this._generateListTable(),this._syncPropsFromTable(),function(t){if(t.taskListTableInstance){t.verticalSplitResizeLine=document.createElement("div"),t.verticalSplitResizeLine.style.position="absolute",t.verticalSplitResizeLine.style.top=t.tableY+"px",t.verticalSplitResizeLine.style.left=(-1!==t.taskTableWidth?t.taskTableWidth-7+t.parsedOptions.verticalSplitLine.lineWidth/2:0)+"px",t.verticalSplitResizeLine.style.width="14px",t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.verticalSplitResizeLine.style.backgroundColor="rgba(0,0,0,0)",t.verticalSplitResizeLine.style.zIndex="100",t.parsedOptions.verticalSplitLineMoveable&&(t.verticalSplitResizeLine.style.cursor="col-resize"),t.verticalSplitResizeLine.style.userSelect="none",t.verticalSplitResizeLine.style.opacity="1";const e=document.createElement("div");if(e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLine.lineWidth)/2+"px",e.style.width=t.parsedOptions.verticalSplitLine.lineWidth+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLine.lineColor,e.style.zIndex="100",e.style.userSelect="none",e.style.pointerEvents="none",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e),t.parsedOptions.verticalSplitLineHighlight){const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLineHighlight.lineWidth)/2+"px",e.style.width=t.parsedOptions.verticalSplitLineHighlight.lineWidth+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLineHighlight.lineColor,e.style.zIndex="100",e.style.cursor="col-resize",e.style.userSelect="none",e.style.pointerEvents="none",e.style.opacity="0",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e)}t.container.appendChild(t.verticalSplitResizeLine)}}(this),this.scenegraph=new JD(this),this.stateManager=new dW(this),this.eventManager=new aW(this),this.scenegraph.afterCreateSceneGraph(),this._scrollToMarkLine(),this.pluginManager=new vW(this,e),this.recalculateTimeScale()}renderTaskBarsTable(){this.scenegraph.updateNextFrame()}_updateSize(){let t=0,e=0;if("browser"===yS.mode){const i=this.getElement();let o=0,n=0;if(i.parentElement){const t=i.parentElement.style||window.getComputedStyle(i.parentElement);o=i.parentElement.offsetWidth-parseInt(t.paddingLeft||"0px",10)-parseInt(t.paddingRight||"0px",10),n=i.parentElement.offsetHeight-parseInt(t.paddingTop||"0px",10)-parseInt(t.paddingBottom||"0px",20)}const r=(o??1)-1-this.taskTableWidth,s=(n??1)-1-this.getDataZoomHeight();i.style.width=r&&`${r}px`||"0px",i.style.height=s&&`${s}px`||"0px";const{canvas:a}=this;t=a.parentElement?.offsetWidth??1,e=a.parentElement?.offsetHeight??1,this?.scenegraph?.stage?this.scenegraph.stage.resize(t,e):(a.style.width="",a.style.height="",a.width=t,a.height=e,a.style.width=`${t}px`,a.style.height=`${e}px`)}const i=Math.floor(t-(o=this.parsedOptions.scrollStyle,o?.hoverOn||o?.verticalVisible&&"none"===o?.verticalVisible||!o?.verticalVisible&&"none"===o?.visible?0:o?.width??7));var o;const n=Math.floor(e-function(t){return t?.hoverOn||t?.horizontalVisible&&"none"===t?.horizontalVisible||!t?.horizontalVisible&&"none"===t?.visible?0:t?.width??7}(this.parsedOptions.scrollStyle));if(this.tableNoFrameWidth=t,this.tableNoFrameHeight=Math.floor(e),this.parsedOptions.outerFrameStyle){const[t,e,o,r]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);this.tableX=this.taskTableColumns.length>=1||this.options?.rowSeriesNumber?this.parsedOptions.verticalSplitLine.lineWidth??0:r,this.tableY=t,this.tableNoFrameWidth=Math.min(i-e-this.tableX,this.getAllDateColsWidth()),this.tableNoFrameHeight=n-t-o}}_updateListTableSize(t){if(t){if("auto"===this.options?.taskListTable?.tableWidth||-1===this.taskTableWidth){const[e,i,o,n]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);this.taskTableWidth=t.getAllColsWidth()+i,this.options?.taskListTable?.maxTableWidth&&(this.taskTableWidth=Math.min(this.options?.taskListTable?.maxTableWidth,this.taskTableWidth)),this.options?.taskListTable?.minTableWidth&&(this.taskTableWidth=Math.max(this.options?.taskListTable?.minTableWidth,this.taskTableWidth)),this.element.style.left=-1!==this.taskTableWidth?`${this.taskTableWidth}px`:"0px",t.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+e+o),this._updateSize()}if(t.columnHeaderLevelCount>1)if(t.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let e=0;e<t.columnHeaderLevelCount;e++)t.setRowHeight(e,this.parsedOptions.timeLineHeaderRowHeights[e]);else{const e=this.getAllHeaderRowsHeight()/t.columnHeaderLevelCount;for(let i=0;i<t.columnHeaderLevelCount;i++)t.setRowHeight(i,e)}}}_generateListTable(){if(this.taskTableColumns.length>=1||this.options?.rowSeriesNumber){const t=this._generateListTableOptions();this.taskListTableInstance=new ID(this.container,t),this._updateListTableSize(this.taskListTableInstance)}}_generateListTableOptions(){const t={},e=["container","records","rowSeriesNumber","overscrollBehavior","pixelRatio","eventOptions"];for(const i of e)i in this.options&&(t[i]=this.options[i]);if(t.defaultRowHeight=this.options.rowHeight,this.options.taskListTable)for(const e in this.options.taskListTable){if(t[e]=this.options.taskListTable[e],"columns"===e&&(t[e][t[e].length-1].disableColumnResize=!0,this.parsedOptions.tasksShowMode===o.Sub_Tasks_Inline||this.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate||this.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange||this.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact))for(let e=0;e<t.columns.length;e++)t.columns[e].tree&&(t.columns[e].tree=!1);"hierarchyExpandLevel"!==e||this.parsedOptions.tasksShowMode!==o.Sub_Tasks_Inline&&this.parsedOptions.tasksShowMode!==o.Sub_Tasks_Separate&&this.parsedOptions.tasksShowMode!==o.Sub_Tasks_Arrange&&this.parsedOptions.tasksShowMode!==o.Sub_Tasks_Compact||delete t[e]}if(this.options.taskListTable?.theme)if(t.theme=this.options.taskListTable?.theme,t.theme.bodyStyle&&!function(t,e){const i=Object.getOwnPropertyDescriptor(t,e);return!(!i||!i.set&&!0!==i.writable)}(t.theme,"bodyStyle")){t.theme=(this.options.taskListTable?.theme).extends((this.options.taskListTable?.theme).getExtendTheme());const e=t.theme.getExtendTheme();t.theme.clearBodyStyleCache(),t.theme.headerStyle?.bgColor||(e.headerStyle?e.headerStyle.bgColor||(e.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):e.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor}),e.bodyStyle?e.bodyStyle.frameStyle={borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}:e.bodyStyle={frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}},e.cellInnerBorder=!1;const[i,o,n,r]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);e.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{shadowBlur:0,cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[i,0,n,r]}),e.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),e.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},e?.columnResize),e.underlayBackgroundColor||(e.underlayBackgroundColor=this.parsedOptions.underlayBackgroundColor)}else{t.theme.headerStyle?t.theme.headerStyle.bgColor||(t.theme.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):t.theme.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor},t.theme.headerStyle=Object.assign({},DT.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),t.theme.bodyStyle=Object.assign({},DT.bodyStyle,this.options.taskListTable?.theme?.bodyStyle,{frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}}),t.theme.cellInnerBorder=!1;const[e,i,o,n]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);t.theme.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[e,0,o,n]}),t.theme.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),t.theme.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize),t.theme.underlayBackgroundColor||(t.theme.underlayBackgroundColor=this.parsedOptions.underlayBackgroundColor)}else{const[e,i,o,n]=oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0);t.theme={scrollStyle:Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),headerStyle:Object.assign({},DT.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),bodyStyle:Object.assign({},DT.bodyStyle,this.options.taskListTable?.theme?.bodyStyle,{frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}}),cellInnerBorder:!1,frameStyle:Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[e,0,o,n]}),columnResize:Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize),underlayBackgroundColor:this.parsedOptions.underlayBackgroundColor}}return t.canvasWidth=this.taskTableWidth,t.canvasHeight=this.canvas.height,t.defaultHeaderRowHeight=this.getAllHeaderRowsHeight(),this.parsedOptions.tasksShowMode===o.Sub_Tasks_Separate?(t.customComputeRowHeight=t=>{const{row:e,table:i}=t,o=i.getRecordByRowCol(0,e);return o?(o.children?.length||1)*this.parsedOptions.rowHeight:this.parsedOptions.rowHeight},t.defaultRowHeight="auto",t.customConfig={forceComputeAllRowHeight:!0}):this.parsedOptions.tasksShowMode===o.Sub_Tasks_Compact?(t.customComputeRowHeight=t=>{const{row:e,table:i}=t,o=i.getRecordByRowCol(0,e);return o?function(t,e){if(!e.children||e.children.length<=1)return 1===e.children?.length?e.children[0].vtable_gantt_showIndex=0:e.vtable_gantt_showIndex=0,1;const i=e.children.slice().sort(((e,i)=>{const{startDate:o}=zS(t,e),{startDate:n}=zS(t,i);return o.getTime()-n.getTime()})),o=[];for(let e=0;e<=i.length-1;e++){const n=i[e],{startDate:r,endDate:s}=zS(t,n);let a=!1;for(let t=0;t<o.length;t++)if(r.getTime()>o[t]){o[t]=s.getTime(),a=!0,n.vtable_gantt_showIndex=t;break}a||(o.push(s.getTime()),n.vtable_gantt_showIndex=o.length-1)}return o.length}(this,o)*this.parsedOptions.rowHeight:this.parsedOptions.rowHeight},t.defaultRowHeight="auto",t.customConfig={forceComputeAllRowHeight:!0}):this.parsedOptions.tasksShowMode===o.Sub_Tasks_Arrange?(t.customComputeRowHeight=t=>{const{row:e,table:i}=t,o=i.getRecordByRowCol(0,e);return o?function(t,e){if(!e.children||e.children.length<=1)return 1===e.children?.length?e.children[0].vtable_gantt_showIndex=0:e.vtable_gantt_showIndex=0,1;const i=[];for(let o=0;o<=e.children.length-1;o++){const n=e.children[o],{startDate:r,endDate:s}=zS(t,n);let a=!1;for(let o=0;o<i.length;o++)if(!FS(r,s,e.children.filter((t=>t!==n&&t.vtable_gantt_showIndex===o)),t)){i[o]=s.getTime(),a=!0,n.vtable_gantt_showIndex=o;break}a||(i.push(s.getTime()),n.vtable_gantt_showIndex=i.length-1)}return i.length}(this,o)*this.parsedOptions.rowHeight:this.parsedOptions.rowHeight},t.defaultRowHeight="auto",t.customConfig={forceComputeAllRowHeight:!0}):t.defaultRowHeight=this.options.rowHeight??40,t.clearDOM=!1,t}getElement(){return this.element}getContainer(){return this.element.parentElement}_sortScales(){const{timelineHeader:t}=this.options;if(t){const e=t.scales,i=["year","quarter","month","week","day","hour","minute","second"];1===e.length&&("hour"!==e[0].unit&&"minute"!==e[0].unit&&"second"!==e[0].unit||(this.parsedOptions.timeScaleIncludeHour=!0));const o=e.slice().sort(((t,e)=>{"hour"!==t.unit&&"minute"!==t.unit&&"second"!==t.unit||(this.parsedOptions.timeScaleIncludeHour=!0);const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:o-n})),n=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:n-o}));this.parsedOptions.sortedTimelineScales=o,this.parsedOptions.reverseSortedTimelineScales=n}}_generateTimeLineDateMap(){if(this.parsedOptions.minDate&&this.parsedOptions.maxDate)for(const t of this.parsedOptions.reverseSortedTimelineScales)t.timelineDates=kS(new Date(this.parsedOptions.minDate),this.parsedOptions.maxDate,t)}getRowHeightByIndex(t){return this.taskListTableInstance?this.taskListTableInstance.getRowHeight(t+this.taskListTableInstance.columnHeaderLevelCount):this.parsedOptions.rowHeight}getRowsHeightByIndex(t,e){return this.taskListTableInstance?this.taskListTableInstance.getRowsHeight(t+this.taskListTableInstance.columnHeaderLevelCount,e+this.taskListTableInstance.columnHeaderLevelCount):this.parsedOptions.rowHeight*(e-t+1)}getAllRowsHeight(){return this.taskListTableInstance?this.taskListTableInstance.getAllRowsHeight():this.getAllHeaderRowsHeight()+this.itemCount*this.parsedOptions.rowHeight}getAllHeaderRowsHeight(){return this.parsedOptions.timeLineHeaderRowHeights.reduce(((t,e,i)=>!1===this.parsedOptions.sortedTimelineScales[i].visible?t:t+e),0)}getAllDateColsWidth(){return this.parsedOptions.timelineColWidth*(this.parsedOptions.reverseSortedTimelineScales[0].timelineDates?.length??0)}getAllTaskBarsHeight(){return this.taskListTableInstance?this.taskListTableInstance.getRowsHeight(this.taskListTableInstance.columnHeaderLevelCount,this.taskListTableInstance.rowCount-1):this.itemCount*this.parsedOptions.rowHeight}getRecordIndexByTaskShowIndex(t){return this.taskListTableInstance?this.taskListTableInstance.getRecordIndexByCell(0,this.taskListTableInstance.columnHeaderLevelCount+t):t}getTaskShowIndexByRecordIndex(t){return this.taskListTableInstance.getBodyRowIndexByRecordIndex(t)}getRecordByIndex(t,e){if(this.taskListTableInstance){if(pt(e)){const i=this.taskListTableInstance.getRecordByCell(0,t+this.taskListTableInstance.columnHeaderLevelCount);if(Array.isArray(e)){const o=this.getRecordIndexByTaskShowIndex(t),n=Array.isArray(o)?o.length:1,r=[...e];r.splice(0,n);let s=i;for(;r.length>0;){const t=r.shift();s=s?.children?.[t]}return s}return i?.children?.[e]}return this.taskListTableInstance.getRecordByCell(0,t+this.taskListTableInstance.columnHeaderLevelCount)}return this.records[t]}_refreshTaskBar(t,e){this.scenegraph.taskBar.updateTaskBarNode(t,e),this.scenegraph.refreshRecordLinkNodes(t,void 0,this.scenegraph.taskBar.getTaskBarNodeByIndex(t,e)),this.scenegraph.updateNextFrame()}_updateRecordToListTable(t,e){this.taskListTableInstance.updateRecords([t],[e])}getTaskInfoByTaskListIndex(t,e){const i=this.getRecordByIndex(t,e),o=i?.type,n=this.parsedOptions.startDateField,r=this.parsedOptions.endDateField,s=this.parsedOptions.progressField,a=dS(i?.[n]).getTime(),l=dS(i?.[r]).getTime();if(o&&!i?.[n]||!o&&(l<this.parsedOptions._minDateTime||a>this.parsedOptions._maxDateTime||!i?.[n]||!i?.[r]))return{taskDays:0,progress:0,startDate:null,endDate:null,taskRecord:i};const h=function(t){return"string"==typeof t&&(t=t.replace("%",""),t=parseFloat(t)),isNaN(t)?0:Math.max(0,Math.min(100,Math.round(10*t)/10))}(i[s]);let d,c;if(this.parsedOptions.timeScaleIncludeHour){d=dS(Math.min(Math.max(this.parsedOptions._minDateTime,a),this.parsedOptions._maxDateTime));const t=i?.[r];let e=!1;"string"==typeof t&&(e=/:\d{2}\.\d+/.test(t));const o=!e;c=gS(Math.max(Math.min(this.parsedOptions._maxDateTime,l),this.parsedOptions._minDateTime),o)}else d=dS(Math.min(Math.max(this.parsedOptions._minDateTime,a),this.parsedOptions._maxDateTime),!0),c=pS(Math.max(Math.min(this.parsedOptions._maxDateTime,l),this.parsedOptions._minDateTime),!0);return{taskRecord:i,taskDays:(c.getTime()-d.getTime()+1)/864e5,startDate:d,endDate:c,progress:h}}_updateStartDateToTaskRecord(t,e,i){const o=this.getRecordByIndex(e,i),n=this.parsedOptions.startDateField,r=eS(t,this.parsedOptions.dateFormat??rS(o[n]));if(o[n]=r,pt(i))Array.isArray(i)&&this.stateManager.updateProjectTaskTimes(i);else{const t=this.getRecordIndexByTaskShowIndex(e);this._updateRecordToListTable(o,t),Array.isArray(t)&&this.stateManager.updateProjectTaskTimes(t)}}_updateEndDateToTaskRecord(t,e,i){const o=this.getRecordByIndex(e,i),n=this.parsedOptions.endDateField,r=eS(t,this.parsedOptions.dateFormat??rS(o[n]));if(o[n]=r,pt(i))Array.isArray(i)&&this.stateManager.updateProjectTaskTimes(i);else{const t=this.getRecordIndexByTaskShowIndex(e);this._updateRecordToListTable(o,t),Array.isArray(t)&&this.stateManager.updateProjectTaskTimes(t)}}_updateStartEndDateToTaskRecord(t,e,i,o){const n=this.getRecordByIndex(i,o),r=this.parsedOptions.startDateField,s=this.parsedOptions.endDateField,a=this.parsedOptions.dateFormat??rS(n[r]),l=eS(t,a);n[r]=l;const h=eS(e,a);if(n[s]=h,pt(o))Array.isArray(o)&&this.stateManager.updateProjectTaskTimes(o);else{const t=this.getRecordIndexByTaskShowIndex(i);this._updateRecordToListTable(n,t),Array.isArray(t)&&this.stateManager.updateProjectTaskTimes(t)}}_updateProgressToTaskRecord(t,e,i){const o=this.getRecordByIndex(e,i),n=this.parsedOptions.progressField;if(n){o[n]=t;const r=this.getRecordIndexByTaskShowIndex(e);this._updateRecordToListTable(o,r),this._refreshTaskBar(e,i)}}_dragOrderTaskRecord(t,e,i,o){this.data.adjustOrder(t,e,i,o)}updateTaskRecord(t,e,i){if(pt(i)){const o="number"==typeof e?e:e[0];return this._updateRecordToListTable(t,[o,i]),void this._refreshTaskBar(o,i)}if(Array.isArray(e)){const i=e[0],o=e[1];return this._updateRecordToListTable(t,e),void this._refreshTaskBar(i,o)}let o=e;"tree"===this.taskListTableInstance.rowHierarchyType&&(o=this.taskListTableInstance.getRecordIndexByCell(0,e+this.taskListTableInstance.columnHeaderLevelCount)),this._updateRecordToListTable(t,o),this._refreshTaskBar(e,void 0)}setPixelRatio(t){this.taskListTableInstance?.setPixelRatio(t),this.parsedOptions.pixelRatio=t,this.scenegraph.setPixelRatio(t)}updateTasksShowMode(t){this.options.tasksShowMode=t,this.updateOption(this.options)}_resize(){this._updateSize(),this.taskListTableInstance?.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0)[0]+oT(this.parsedOptions.outerFrameStyle?.borderLineWidth??0)[2]),this._syncPropsFromTable(),this.scenegraph.resize(),LS(this)}_syncPropsFromTable(){this.itemCount=this.taskListTableInstance?this.taskListTableInstance.rowCount-this.taskListTableInstance.columnHeaderLevelCount:this.records.length,this.headerHeight=this.getAllHeaderRowsHeight(),this.drawHeight=Math.min(this.getAllRowsHeight(),this.tableNoFrameHeight),this.gridHeight=this.drawHeight-this.headerHeight}hasDataZoom(){if(!this.zoomScaleManager)return!1;const t=this.zoomScaleManager.config?.dataZoomAxis;return!(!t||!1===t.enabled)&&null!==this.zoomScaleManager.getDataZoomIntegration()}getDataZoomHeight(){return this.hasDataZoom()?this.zoomScaleManager?.config?.dataZoomAxis?.height||30:0}getContext(){return this.context}release(){super.release?.(),this.eventManager.release(),this.taskListTableInstance?.release(),this.zoomScaleManager&&(this.zoomScaleManager.destroyDataZoomIntegration(),this.zoomScaleManager=null);const t=this.element?.parentElement;t&&(t.removeChild(this.element),this.verticalSplitResizeLine&&t.removeChild(this.verticalSplitResizeLine),this.horizontalSplitLine&&t.removeChild(this.horizontalSplitLine)),this.scenegraph=null,this.pluginManager.release()}updateOption(t){if(this.parsedOptions={},this.options=t,this.taskTableWidth="number"==typeof t?.taskListTable?.tableWidth?t?.taskListTable?.tableWidth:-1,this.taskTableColumns=t?.taskListTable?.columns??[],this.records=t?.records??[],this._sortScales(),MS(this),this.data.setRecords(this.records),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this._updateSize(),this.taskListTableInstance){const t=this._generateListTableOptions();this.taskListTableInstance.updateOption(t),this._updateListTableSize(this.taskListTableInstance)}this._syncPropsFromTable(),this.scenegraph.updateStageBackground(),this.element.style.left=-1!==this.taskTableWidth?`${this.taskTableWidth}px`:"0px",LS(this),this.scenegraph.updateSceneGraph(),this.scenegraph.afterCreateSceneGraph(),this._scrollToMarkLine()}setRecords(t){this.records=t,this.data.setRecords(t),function(t){const e=t.options,{unit:i,startOfWeek:o}=t.parsedOptions.reverseSortedTimelineScales[0];t.parsedOptions.markLine=RS(e?.markLine),t.parsedOptions.markLine?.length&&(t.parsedOptions.markLine?.every((t=>void 0===t.scrollToMarkLine))&&(t.parsedOptions.markLine[0].scrollToMarkLine=!0),t.parsedOptions.markLine?.find((t=>t.scrollToMarkLine))&&(t.parsedOptions.scrollToMarkLineDate=vS(new Date(t.parsedOptions.markLine?.find((t=>t.scrollToMarkLine)).date),i,o))),t.parsedOptions.dependencyLinks=e.dependency?.links??[]}(this),this.taskListTableInstance.setRecords(t),this._syncPropsFromTable(),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this._updateSize(),this.scenegraph.refreshAll(),this.verticalSplitResizeLine.style.height=this.drawHeight+"px";const e=this.stateManager.scroll.horizontalBarPos,i=this.stateManager.scroll.verticalBarPos;this.scenegraph.setX(-e),this.scenegraph.setY(-i)}updateScales(t){const e=this.parsedOptions.sortedTimelineScales.length;if(this.options.timelineHeader.scales=t,this._sortScales(),function(t){const e=t.options,{unit:i,startOfWeek:o,step:n}=t.parsedOptions.reverseSortedTimelineScales[0];t.parsedOptions.minDate=vS(new Date(t.parsedOptions.minDate),i,o),t.parsedOptions.maxDate=fS(t.parsedOptions.minDate,new Date(t.parsedOptions.maxDate),i,n),t.parsedOptions._minDateTime=t.parsedOptions.minDate?.getTime(),t.parsedOptions._maxDateTime=t.parsedOptions.maxDate?.getTime(),t.parsedOptions.timeLineHeaderRowHeights=[],t.parsedOptions.timelineHeaderStyles=[];for(let i=0;i<t.parsedOptions.sortedTimelineScales.length;i++){const o=t.parsedOptions.sortedTimelineScales[i].style;t.parsedOptions.timelineHeaderStyles.push(Object.assign({fontSize:20,fontWeight:"bold",textAlign:"center",textBaseline:"middle",color:"#000",backgroundColor:"#fff"},o)),t.parsedOptions.timeLineHeaderRowHeights.push(t.parsedOptions.sortedTimelineScales[i].rowHeight??e?.headerRowHeight??40)}}(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.scenegraph.refreshAll(),LS(this),this.taskListTableInstance)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}e!==t.length&&this._resize()}updateDateRange(t,e){this.options.minDate=t,this.options.maxDate=e,function(t){const e=t.options,{unit:i,startOfWeek:o,step:n}=t.parsedOptions.reverseSortedTimelineScales[0];t.parsedOptions.minDate=e?.minDate?vS(new Date(e.minDate),i,o):void 0,t.parsedOptions.maxDate=e?.maxDate?fS(t.parsedOptions.minDate,new Date(e.maxDate),i,n):void 0,t.parsedOptions._minDateTime=t.parsedOptions.minDate?.getTime(),t.parsedOptions._maxDateTime=t.parsedOptions.maxDate?.getTime()}(this),this._generateTimeLineDateMap(),this._updateSize(),this.scenegraph.refreshAll(),this._scrollToMarkLine()}updateMarkLine(t){this.options.markLine=t,DS(this),this.scenegraph.markLine.refresh(),this.scenegraph.renderSceneGraph()}addMarkLine(t){this.options.markLine=[...this.parsedOptions.markLine,t],DS(this),this.scenegraph.markLine.refresh(),this.scenegraph.renderSceneGraph(),this.scenegraph.updateNextFrame()}updateCurrentMarkLine(t){const e=this.parsedOptions.markLine.findIndex((e=>e.date===t.date));-1!==e&&(this.options.markLine=[...this.parsedOptions.markLine.slice(0,e),{...this.options.markLine[e],...t},...this.parsedOptions.markLine.slice(e+1)],DS(this),this.scenegraph.markLine.refresh(),this.scenegraph.renderSceneGraph(),this.scenegraph.updateNextFrame())}_scrollToMarkLine(){if(this.parsedOptions.scrollToMarkLineDate&&this.parsedOptions.minDate){const t=this.parsedOptions.minDate,{unit:e,step:i}=this.parsedOptions.reverseSortedTimelineScales[0],o=mS(this.parsedOptions.scrollToMarkLineDate,t,e,i)*this.parsedOptions.timelineColWidth-this.tableNoFrameWidth/2;this.stateManager.setScrollLeft(o)}}scrollToMarkLine(t){if(!t||!this.parsedOptions.minDate)return;const e=this.parsedOptions.minDate,{unit:i,step:o}=this.parsedOptions.reverseSortedTimelineScales[0],n=mS(t,e,i,o)*this.parsedOptions.timelineColWidth-this.tableNoFrameWidth/2;this.stateManager.setScrollLeft(n)}addLink(t){this.parsedOptions.dependencyLinks.push(t),this.scenegraph.dependencyLink.initLinkLine(this.parsedOptions.dependencyLinks.length-1),this.scenegraph.updateNextFrame()}deleteLink(t){if(this.parsedOptions.dependencyLinkDeletable){const e=this.parsedOptions.dependencyLinks.findIndex((e=>e.type===t.type&&e.linkedFromTaskKey===t.linkedFromTaskKey&&e.linkedToTaskKey===t.linkedToTaskKey));if(-1!==e){const t=this.parsedOptions.dependencyLinks[e];this.parsedOptions.dependencyLinks.splice(e,1),this.scenegraph.dependencyLink.deleteLink(t),this.scenegraph.updateNextFrame()}}}get scrollTop(){return this.stateManager.scrollTop}set scrollTop(t){this.stateManager.setScrollTop(t)}get scrollLeft(){return this.stateManager.scrollLeft}set scrollLeft(t){this.stateManager.setScrollLeft(t)}getTaskBarRelativeRect(t){const e=this.scenegraph.taskBar.getTaskBarNodeByIndex(t);return{left:e.attribute.x+this.taskListTableInstance.tableNoFrameWidth+this.taskListTableInstance.tableX+this.tableX-this.scrollLeft,top:e.attribute.y+this.tableY+this.headerHeight-this.scrollTop,width:e.attribute.width,height:e.attribute.height}}getDateColWidth(t){return this.parsedOptions.timelineColWidth}getDateColsWidth(t,e){return(e-t+1)*this.parsedOptions.timelineColWidth}getDateRangeByIndex(t){const e=this.parsedOptions.reverseSortedTimelineScales[0];if(t<e.timelineDates.length){return{startDate:e.timelineDates[t].startDate,endDate:e.timelineDates[t].endDate}}return null}parseTimeFormat(t){return rS(t)}getTaskBarStyle(t,e){const{startDate:i,endDate:o,taskRecord:r}=this.getTaskInfoByTaskListIndex(t,e);let s;if(s=r.type===n.PROJECT?this.parsedOptions.projectBarStyle:this.parsedOptions.taskBarStyle,"function"==typeof s){return s({index:t,startDate:i,endDate:o,taskRecord:r,ganttInstance:this})}return s}formatDate(t,e){return eS(t instanceof Date?t:new Date(t),e)}getCurrentMillisecondsPerPixel(){return this.millisecondsPerPixel}setMillisecondsPerPixel(t){const e=this.parsedOptions.zoom?.minMillisecondsPerPixel??2e5,i=this.parsedOptions.zoom?.maxMillisecondsPerPixel??3e6,o=this.millisecondsPerPixel,n=this.parsedOptions.timelineColWidth;this.millisecondsPerPixel=Math.max(e,Math.min(i,t)),this.recalculateTimeScale(),this._updateSize(),this.scenegraph.refreshAll();const s=this.parsedOptions.timelineColWidth,a=s/n;this.hasListeners(r.ZOOM)&&this.fireListeners(r.ZOOM,{oldWidth:n,newWidth:s,scale:a,oldMillisecondsPerPixel:o,newMillisecondsPerPixel:this.millisecondsPerPixel})}getCurrentZoomScaleLevel(){return this.zoomScaleManager?.getCurrentLevel()??-1}},t.TYPES=s,t.VRender=CW,t.VTable=wW,t.plugins=xW,t.tools=yW,t.version="1.0.1"}));
|
package/es/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ import * as tools from './tools';
|
|
|
6
6
|
import * as VRender from './vrender';
|
|
7
7
|
import * as VTable from './vtable';
|
|
8
8
|
import * as plugins from './plugins';
|
|
9
|
-
export declare const version = "1.0.
|
|
9
|
+
export declare const version = "1.0.1";
|
|
10
10
|
export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable, plugins };
|
package/es/index.js
CHANGED
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAcpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAI/B,OAAO,EACL,KAAK,EAEL,KAAK,EAYL,KAAK,EACL,OAAO,EACP,MAAM,EACN,OAAO,EACR,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.0.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAcpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAI/B,OAAO,EACL,KAAK,EAEL,KAAK,EAYL,KAAK,EACL,OAAO,EACP,MAAM,EACN,OAAO,EACR,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.0.1\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wimi/vtable-gantt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "canvas table width high performance",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vtable-gantt",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"fix-memory-limit": "cross-env LIMIT=10240 increase-memory-limit"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@visactor/vtable": "
|
|
52
|
-
"@visactor/vtable-editors": "
|
|
51
|
+
"@visactor/vtable": "workspace:*",
|
|
52
|
+
"@visactor/vtable-editors": "workspace:*",
|
|
53
53
|
"@visactor/vutils": "~1.0.17",
|
|
54
54
|
"@visactor/vscale": "~1.0.17",
|
|
55
55
|
"@visactor/vdataset": "~1.0.17",
|