@syncfusion/ej2-gantt 23.1.36 → 23.1.38
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/CHANGELOG.md +17 -0
- package/dist/ej2-gantt.min.js +3 -3
- package/dist/ej2-gantt.umd.min.js +3 -3
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +130 -41
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +130 -41
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +3 -3
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +11 -11
- package/src/gantt/actions/connector-line-edit.js +48 -6
- package/src/gantt/actions/critical-path.js +0 -2
- package/src/gantt/actions/dependency.js +49 -6
- package/src/gantt/actions/dialog-edit.js +1 -1
- package/src/gantt/actions/edit.js +3 -0
- package/src/gantt/actions/taskbar-edit.js +7 -2
- package/src/gantt/base/gantt-chart.js +6 -0
- package/src/gantt/base/gantt.js +5 -5
- package/src/gantt/base/splitter.js +1 -0
- package/src/gantt/renderer/chart-rows.js +8 -17
- package/src/gantt/renderer/connector-line.js +3 -2
package/dist/ej2-gantt.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-gantt.min.js
|
|
3
|
-
* version : 23.1.
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 -
|
|
3
|
+
* version : 23.1.38
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionPdfExport"),require("SyncfusionData"),require("SyncfusionGrids"),require("SyncfusionTreegrid"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionNavigations"),require("SyncfusionCalendars"),require("SyncfusionDropdowns"),require("SyncfusionButtons"),require("SyncfusionLayouts"),require("SyncfusionRichtexteditor"),require("SyncfusionSvgBase")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionPdfExport","SyncfusionData","SyncfusionGrids","SyncfusionTreegrid","SyncfusionPopups","SyncfusionInputs","SyncfusionNavigations","SyncfusionCalendars","SyncfusionDropdowns","SyncfusionButtons","SyncfusionLayouts","SyncfusionRichtexteditor","SyncfusionSvgBase"],t):"object"==typeof exports?exports.SyncfusionGantt=t(require("SyncfusionBase"),require("SyncfusionPdfExport"),require("SyncfusionData"),require("SyncfusionGrids"),require("SyncfusionTreegrid"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionNavigations"),require("SyncfusionCalendars"),require("SyncfusionDropdowns"),require("SyncfusionButtons"),require("SyncfusionLayouts"),require("SyncfusionRichtexteditor"),require("SyncfusionSvgBase")):e.SyncfusionGantt=t(e.SyncfusionBase,e.SyncfusionPdfExport,e.SyncfusionData,e.SyncfusionGrids,e.SyncfusionTreegrid,e.SyncfusionPopups,e.SyncfusionInputs,e.SyncfusionNavigations,e.SyncfusionCalendars,e.SyncfusionDropdowns,e.SyncfusionButtons,e.SyncfusionLayouts,e.SyncfusionRichtexteditor,e.SyncfusionSvgBase)}(this,function(e,t,i,r,n,a,s,o,l,d,h,p,u,c){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=85)}([function(t,i){t.exports=e},function(e,t,i){"use strict";function r(e,t,i){for(var r=e;r&&(i?r.id!==t:!r.classList.contains(t));)r=r.parentElement;return r}function n(e){return i.i(f.isNullOrUndefined)(e.startDate)&&i.i(f.isNullOrUndefined)(e.endDate)&&i.i(f.isNullOrUndefined)(e.duration)?null:!(i.i(f.isNullOrUndefined)(e.startDate)||i.i(f.isNullOrUndefined)(e.endDate)||i.i(f.isNullOrUndefined)(e.duration))}function a(e){return!(!e.dataSource||e.dataSource instanceof m.DataManager||!("result"in e.dataSource))}function s(e){for(var t={},i=0,r=Object.keys(e);i<r.length;i++){var n=r[i];t[e[n]]=n}return t}function o(e){if(e instanceof m.DataManager){var t=e.adaptor;return t instanceof m.ODataAdaptor||t instanceof m.ODataV4Adaptor||t instanceof m.WebApiAdaptor||t instanceof m.WebMethodAdaptor||t instanceof m.CacheAdaptor||t instanceof m.RemoteSaveAdaptor||t instanceof m.UrlAdaptor}return!1}function l(e,t,r,n){if(r){for(var a=void 0,s=0;s<e.length;s++){var o=void 0;o=t?e[s].taskData:i.i(f.extend)({},e[s].taskData,{},!0),a=o}return a}for(var a=[],s=0;s<e.length;s++){var o=void 0;!i.i(f.isNullOrUndefined)(n)&&n.timezone&&d(e[s],n),o=t?e[s].taskData:i.i(f.extend)({},e[s].taskData,{},!0),a.push(o)}return a}function d(e,t){return e.taskData[t.taskFields.startDate]=t.dateValidationModule.remove(e.ganttProperties.startDate,t.timezone),null!=t.taskFields.endDate&&(e.taskData[t.taskFields.endDate]=t.dateValidationModule.remove(e.ganttProperties.endDate,t.timezone)),(t.taskFields.baselineEndDate||t.taskFields.baselineStartDate)&&(e.taskData[t.taskFields.baselineStartDate]=t.dateValidationModule.remove(e.ganttProperties.baselineStartDate,t.timezone),e.taskData[t.taskFields.baselineEndDate]=t.dateValidationModule.remove(e.ganttProperties.baselineEndDate,t.timezone)),null}function h(e,t){for(var i,r=0;r<t.length;r++)i=new RegExp("\\{"+r+"\\}","gm"),e=e.replace(i,t[r].toString());return e}function p(e,t,r,n){for(var a=-1,s=0;s<r.length;s++)if(i.i(f.getValue)(t,r[s])===i.i(f.getValue)(t,e)&&i.i(f.isNullOrUndefined)(n)||!i.i(f.isNullOrUndefined)(n)&&i.i(f.getValue)(t,r[s])===i.i(f.getValue)(t,e)&&i.i(f.getValue)(n,r[s])===i.i(f.getValue)(n,e)){a=s;break}return a}function u(e){return 76*e/92}function c(e){return 92*e/76}function g(){return y++}t.j=r,t.c=n,t.i=a,t.d=s,t.f=o,t.e=l,t.g=d,t.l=h,t.h=p,t.b=u,t.a=c,t.k=g;var f=i(0),m=(i.n(f),i(4)),y=(i.n(m),0)},function(e,i){e.exports=t},function(e,t,i){"use strict";i.d(t,"_11",function(){return r}),i.d(t,"_23",function(){return n}),i.d(t,"_22",function(){return a}),i.d(t,"_21",function(){return s}),i.d(t,"_62",function(){return o}),i.d(t,"_16",function(){return l}),i.d(t,"C",function(){return d}),i.d(t,"_64",function(){return h}),i.d(t,"_15",function(){return p}),i.d(t,"_65",function(){return u}),i.d(t,"_12",function(){return c}),i.d(t,"a",function(){return g}),i.d(t,"_25",function(){return f}),i.d(t,"_26",function(){return m}),i.d(t,"_14",function(){return y}),i.d(t,"_13",function(){return D}),i.d(t,"_57",function(){return v}),i.d(t,"_59",function(){return w}),i.d(t,"_61",function(){return k}),i.d(t,"_60",function(){return b}),i.d(t,"_58",function(){return T}),i.d(t,"_17",function(){return S}),i.d(t,"_50",function(){return P}),i.d(t,"_49",function(){return C}),i.d(t,"_43",function(){return M}),i.d(t,"_52",function(){return R}),i.d(t,"_51",function(){return x}),i.d(t,"_44",function(){return O}),i.d(t,"D",function(){return I}),i.d(t,"_46",function(){return E}),i.d(t,"_47",function(){return N}),i.d(t,"_32",function(){return F}),i.d(t,"N",function(){return U}),i.d(t,"_30",function(){return V}),i.d(t,"n",function(){return L}),i.d(t,"p",function(){return B}),i.d(t,"q",function(){return A}),i.d(t,"_41",function(){return H}),i.d(t,"_42",function(){return j}),i.d(t,"_20",function(){return W}),i.d(t,"Z",function(){return _}),i.d(t,"_54",function(){return q}),i.d(t,"_55",function(){return G}),i.d(t,"_56",function(){return z}),i.d(t,"O",function(){return X}),i.d(t,"Q",function(){return Y}),i.d(t,"S",function(){return Z}),i.d(t,"_37",function(){return Q}),i.d(t,"_38",function(){return K}),i.d(t,"_39",function(){return J}),i.d(t,"_36",function(){return $}),i.d(t,"_40",function(){return ee}),i.d(t,"_48",function(){return te}),i.d(t,"_1",function(){return ie}),i.d(t,"_0",function(){return re}),i.d(t,"K",function(){return ne}),i.d(t,"L",function(){return ae}),i.d(t,"M",function(){return se}),i.d(t,"_29",function(){return oe}),i.d(t,"_31",function(){return le}),i.d(t,"J",function(){return de}),i.d(t,"_5",function(){return he}),i.d(t,"_45",function(){return pe}),i.d(t,"_2",function(){return ue}),i.d(t,"_3",function(){return ce}),i.d(t,"_19",function(){return ge}),i.d(t,"o",function(){return fe}),i.d(t,"_28",function(){return me}),i.d(t,"P",function(){return ye}),i.d(t,"R",function(){return De}),i.d(t,"T",function(){return ve}),i.d(t,"_27",function(){return we}),i.d(t,"t",function(){return ke}),i.d(t,"u",function(){return be}),i.d(t,"v",function(){return Te}),i.d(t,"w",function(){return Se}),i.d(t,"x",function(){return Pe}),i.d(t,"y",function(){return Ce}),i.d(t,"z",function(){return Me}),i.d(t,"A",function(){return Re}),i.d(t,"B",function(){return xe}),i.d(t,"_33",function(){return Oe}),i.d(t,"_34",function(){return Ie}),i.d(t,"_35",function(){return Ee}),i.d(t,"_24",function(){return Ne}),i.d(t,"V",function(){return Fe}),i.d(t,"_9",function(){return Ue}),i.d(t,"r",function(){return Ve}),i.d(t,"s",function(){return Le}),i.d(t,"_10",function(){return Be}),i.d(t,"W",function(){return Ae}),i.d(t,"X",function(){return He}),i.d(t,"Y",function(){return je}),i.d(t,"E",function(){return We}),i.d(t,"F",function(){return _e}),i.d(t,"_6",function(){return qe}),i.d(t,"_4",function(){return Ge}),i.d(t,"_53",function(){return ze}),i.d(t,"_7",function(){return Xe}),i.d(t,"_8",function(){return Ye}),i.d(t,"d",function(){return Ze}),i.d(t,"c",function(){return Qe}),i.d(t,"b",function(){return Ke}),i.d(t,"m",function(){return Je}),i.d(t,"h",function(){return $e}),i.d(t,"i",function(){return et}),i.d(t,"e",function(){return tt}),i.d(t,"f",function(){return it}),i.d(t,"g",function(){return rt}),i.d(t,"j",function(){return nt}),i.d(t,"k",function(){return at}),i.d(t,"l",function(){return st}),i.d(t,"U",function(){return ot}),i.d(t,"G",function(){return lt}),i.d(t,"I",function(){return dt}),i.d(t,"H",function(){return ht}),i.d(t,"_18",function(){return pt}),i.d(t,"_63",function(){return ut});var r="e-gantt",n="e-gantt-chart-pane",a="e-gantt-tree-grid-pane",s="e-gantt-splitter",o="e-gantt-chart",l="e-chart-root-container",d="e-gantt-toolbar",h="e-chart-scroll-container",p="e-chart-rows-container",u="e-content",c="e-device",g="e-grid",f="e-task-table",m="e-zero-spacing",y="e-timeline-header-container",D="e-timeline-header-table-container",v="e-timeline-header-table-body",w="e-timeline-top-header-cell",k="e-header-cell-label",b="e-weekend-header-cell",T="e-timeline-single-header-cell",S="e-timeline-single-header-outer-div",P="e-left-label-container",C="e-left-label-container e-left-label-temp-container",M="e-left-label-inner-div",R="e-right-label-container",x="e-right-label-container e-right-label-temp-container",O="e-right-label-inner-div",I="e-taskbar-main-container",E="e-gantt-parent-taskbar-inner-div",N="e-gantt-parent-progressbar-inner-div",F="e-task-label",U="e-gantt-child-taskbar-inner-div",V="e-gantt-child-progressbar-inner-div",L="e-gantt-child-critical-taskbar-inner-div",B="e-gantt-child-critical-progressbar-inner-div",A="e-critical-milestone",H="e-baseline-bar",j="e-baseline-gantt-milestone-container",W="e-chart-row-cell",_="e-chart-row",q="e-row-expand",G="e-row-collapse",z="e-collapse-parent",X="e-taskbar-left-resizer",Y="e-taskbar-right-resizer",Z="e-child-progress-resizer",Q="e-progressbar-handler",K="e-progressbar-handler-element",J="e-progressbar-handler-after",$="e-icon",ee="e-gantt-milestone",te="e-gantt-parent-milestone",ie="e-gantt-child-taskbar",re="e-gantt-child-progressbar",ne="e-manualparent-main-container",ae="e-gantt-manualparenttaskbar",se="e-gantt-manualparent-milestone",oe="e-gantt-child-manualtaskbar",le="e-gantt-child-manualprogressbar",de="e-gantt-manualparenttaskbar-right",he="e-gantt-manualparenttaskbar-left",pe="e-gantt-unscheduled-manualtask",ue="e-gantt-parent-taskbar",ce="e-gantt-parent-progressbar",ge="e-gantt-unscheduled-task",fe="e-gantt-critical-unscheduled-taskbar",me="e-indicator-span",ye="e-left-resize-gripper",De="e-right-resize-gripper",ve="e-progress-resize-gripper",we="e-label",ke="e-event-markers-container",be="e-event-markers",Te="e-span-label",Se="e-nonworking-day-container",Pe="e-holiday-container",Ce="e-holiday",Me="e-span",Re="e-weekend-container",xe="e-weekend",Oe="e-gantt-unscheduled-taskbar-left",Ie="e-gantt-unscheduled-taskbar-right",Ee="e-gantt-unscheduled-taskbar",Ne="e-gantt-dependency-view-container",Fe="e-connector-line-container",Ue="e-connector-line",Ve="e-critical-line",Le="e-critical-line-arrow",Be="e-connector-line-arrow",Ae="e-connector-line-z-index",He="e-connectorpoint-left",je="e-connectorpoint-right",We="e-connectorpoint-left-hover",_e="e-connectorpoint-right-hover",qe="e-gantt-false-line",Ge="e-right-connectorpoint-outer-div",ze="e-left-connectorpoint-outer-div",Xe="e-connectorpoint-allow-block",Ye="e-gantt-tooltip",Ze=".e-gridheader",Qe=".e-content",Ke=".e-gridform",Je="e-delete",$e="e-save",et="e-cancel",tt="e-edit",it="e-indent",rt="e-outdent",nt="e-add",at="e-add-above",st="e-add-below",ot="e-active-parent-task",lt="e-active-child-task",dt="e-active-connected-task",ht="e-predecessor-touch-mode",pt="e-rangecontainer",ut="e-rg-rangdiv"},function(e,t){e.exports=i},function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t,i){"use strict";var r=i(51);i.d(t,"a",function(){return r.a});var n=i(52);i.d(t,"b",function(){return n.a}),i.d(t,"c",function(){return n.b});var a=i(54);i.d(t,"d",function(){return a.a}),i.d(t,"e",function(){return a.b});var s=i(17);i.d(t,"f",function(){return s.a});var o=i(55);i.d(t,"g",function(){return o.a}),i.d(t,"h",function(){return o.b}),i.d(t,"i",function(){return o.c});var l=i(53);i.d(t,"j",function(){return l.a}),i.d(t,"k",function(){return l.b}),i.d(t,"l",function(){return l.c}),i.d(t,"m",function(){return l.d}),i.d(t,"n",function(){return l.e}),i.d(t,"o",function(){return l.f}),i.d(t,"p",function(){return l.g})},function(e,t,i){"use strict";var r=i(19);i.d(t,"a",function(){return r.a});var n=i(61);i.d(t,"b",function(){return n.a});var a=i(60);i.d(t,"c",function(){return a.a});var s=i(62);i.d(t,"d",function(){return s.a});var o=i(63);i.d(t,"e",function(){return o.a});var l=i(64);i.d(t,"f",function(){return l.a});var d=i(65);i.d(t,"g",function(){return d.a});var h=i(70);i.d(t,"h",function(){return h.a});var p=i(66);i.d(t,"i",function(){return p.a});var u=i(67);i.d(t,"j",function(){return u.a});var c=i(71);i.d(t,"k",function(){return c.a});var g=i(73);i.d(t,"l",function(){return g.a});var f=i(74);i.d(t,"m",function(){return f.a});var m=i(75);i.d(t,"n",function(){return m.a}),i.d(t,"o",function(){return m.b});var y=i(76);i.d(t,"p",function(){return y.a});var D=i(72);i.d(t,"q",function(){return D.a}),i.d(t,"r",function(){return D.b});var v=i(69);i.d(t,"s",function(){return v.a});var w=i(68);i.d(t,"t",function(){return w.a})},function(e,t){e.exports=a},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.parent=e}return e.prototype.isValidateNonWorkDays=function(e){return!i.i(r.isNullOrUndefined)(e)&&e.isAutoSchedule&&(!this.parent.includeWeekend||this.parent.totalHolidayDates.length>0)||i.i(r.isNullOrUndefined)(e)&&(!this.parent.includeWeekend||this.parent.totalHolidayDates.length>0)},e.prototype.checkStartDate=function(e,t,n,a){if(i.i(r.isNullOrUndefined)(e))return null;var s=new Date(e.getTime()),o=this.getSecondsInDecimal(s);if(n=i.i(r.isNullOrUndefined)(n)?!i.i(r.isNullOrUndefined)(t)&&t.isMilestone:n,o<this.parent.defaultStartTime&&(!n||a))this.setTime(this.parent.defaultStartTime,s);else if(o<this.parent.defaultStartTime&&n)this.setTime(this.parent.defaultStartTime,s);else if(o===this.parent.defaultEndTime&&(!t||!n)||o>this.parent.defaultEndTime)s.setDate(s.getDate()+1),this.setTime(this.parent.defaultStartTime,s);else if(o>this.parent.defaultStartTime&&o<this.parent.defaultEndTime)for(var l=0;l<this.parent.workingTimeRanges.length;l++){var d=this.parent.workingTimeRanges[l];if(o>=d.to&&this.parent.workingTimeRanges[l+1]&&o<this.parent.workingTimeRanges[l+1].from){(o!==d.to||t&&n)&&o===d.to||this.setTime(this.parent.workingTimeRanges[l+1].from,s);break}}var h;if(this.parent.autoCalculateDateScheduling){do{h=new Date(s.getTime());var p=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(t)){var u=!n||a?this.parent.defaultStartTime:this.parent.defaultEndTime;if(!this.parent.includeWeekend){var c=new Date(s.getTime());s=this.getNextWorkingDay(s),c.getTime()!==s.getTime()&&this.setTime(u,s)}for(var g=0;g<p;g++){var f=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[g])),m=new Date(f.getTime());f.setHours(0,0,0,0),m.setHours(23,59,59,59),s.getTime()>=f.getTime()&&s.getTime()<m.getTime()&&(s.setDate(s.getDate()+1),this.setTime(u,s))}}}while(h.getTime()!==s.getTime());return new Date(s.getTime())}return new Date(s.getTime())},e.prototype.checkEndDate=function(e,t,n){if(i.i(r.isNullOrUndefined)(e))return null;var a=new Date(e.getTime()),s=this.getSecondsInDecimal(a);if(s>this.parent.defaultEndTime)this.setTime(this.parent.defaultEndTime,a);else if(s<=this.parent.defaultStartTime&&!n)a.setDate(a.getDate()-1),this.setTime(this.parent.defaultEndTime,a);else if(s>this.parent.defaultStartTime&&s<this.parent.defaultEndTime)for(var o=0;o<this.parent.workingTimeRanges.length;o++){var l=this.parent.workingTimeRanges[o];if(s>l.to&&this.parent.workingTimeRanges[o+1]&&s<=this.parent.workingTimeRanges[o+1].from){this.setTime(this.parent.workingTimeRanges[o].to,a);break}}var d;if(this.parent.autoCalculateDateScheduling){do{d=new Date(a.getTime());var h=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(t)){if(!this.parent.includeWeekend){var p=new Date(a.getTime());a=this.getPreviousWorkingDay(a),p.getTime()!==a.getTime()&&this.setTime(this.parent.defaultEndTime,a)}for(var u=0;u<h;u++){var c=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[u])),g=new Date(c.getTime()),f=new Date(a.getTime());f.setMinutes(a.getMilliseconds()-2),c.setHours(0,0,0,0),g.setHours(23,59,59,59),(a.getTime()>=c.getTime()&&a.getTime()<g.getTime()||f.getTime()>=c.getTime()&&f.getTime()<g.getTime())&&(a.setDate(a.getDate()-1),a.getTime()===c.getTime()&&86400===this.parent.defaultEndTime&&0===this.getSecondsInDecimal(a)||this.setTime(this.parent.defaultEndTime,a))}}}while(d.getTime()!==a.getTime());return new Date(a.getTime())}return i.i(r.isNullOrUndefined)(a)||this.setTime(this.parent.defaultEndTime,a),new Date(a.getTime())},e.prototype.checkBaselineStartDate=function(e){if(i.i(r.isNullOrUndefined)(e))return null;var t=new Date(e.getTime()),n=this.getSecondsInDecimal(t);if(n<this.parent.defaultStartTime)this.setTime(this.parent.defaultStartTime,t);else if(n>this.parent.defaultEndTime)t.setDate(t.getDate()+1),this.setTime(this.parent.defaultStartTime,t);else if(n>this.parent.defaultStartTime&&n<this.parent.defaultEndTime)for(var a=0;a<this.parent.workingTimeRanges.length;a++){var s=this.parent.workingTimeRanges[a];if(n>s.to&&this.parent.workingTimeRanges[a+1]&&n<this.parent.workingTimeRanges[a+1].from){this.setTime(this.parent.workingTimeRanges[a+1].from,t);break}}return t},e.prototype.checkBaselineEndDate=function(e,t){if(i.i(r.isNullOrUndefined)(e))return null;var n=new Date(e.getTime()),a=this.getSecondsInDecimal(n);if(a>this.parent.defaultEndTime)this.setTime(this.parent.defaultEndTime,n);else if(a<this.parent.defaultStartTime&&!i.i(r.isNullOrUndefined)(t)&&!t.isMilestone)n.setDate(n.getDate()-1),this.setTime(this.parent.defaultEndTime,n);else if(a>this.parent.defaultStartTime&&a<this.parent.defaultEndTime)for(var s=0;s<this.parent.workingTimeRanges.length;s++){var o=this.parent.workingTimeRanges[s];if(a>o.to&&this.parent.workingTimeRanges[s+1]&&a<=this.parent.workingTimeRanges[s+1].from){this.setTime(this.parent.workingTimeRanges[s].to,n);break}}return t&&t.baselineStartDate&&n&&t.baselineStartDate.getTime()>n.getTime()&&n.setDate(n.getDate()+1),n},e.prototype.calculateStartDate=function(e){var t=e.ganttProperties,n=null;i.i(r.isNullOrUndefined)(t.endDate)||i.i(r.isNullOrUndefined)(t.duration)||(n=this.getStartDate(t.endDate,t.duration,t.durationUnit,t)),this.parent.setRecordValue("startDate",n,t,!0),this.parent.taskFields.startDate&&this.parent.dataOperation.updateMappingData(e,"startDate")},e.prototype.calculateEndDate=function(e){var t=e.ganttProperties,n=null;if(i.i(r.isNullOrUndefined)(t.startDate))n=e[this.parent.taskFields.endDate],i.i(r.isNullOrUndefined)(n)||this.setTime(this.parent.defaultEndTime,n),this.parent.setRecordValue("endDate",n,t,!0);else{if(!i.i(r.isNullOrUndefined)(t.endDate)&&i.i(r.isNullOrUndefined)(t.duration)&&(1===this.compareDates(t.startDate,t.endDate)&&(this.parent.setRecordValue("startDate",new Date(t.endDate.getTime()),t,!0),this.setTime(this.parent.defaultStartTime,t.startDate)),this.calculateDuration(e)),!i.i(r.isNullOrUndefined)(t.duration)){var a=!i.i(r.isNullOrUndefined)(t.segments)&&t.segments.length>0?this.totalDuration(t.segments):t.duration;n=this.getEndDate(t.startDate,a,t.durationUnit,t,!1)}this.parent.setRecordValue("endDate",n,t,!0)}this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(e,"endDate")},e.prototype.totalDuration=function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].duration+e[i].offsetDuration;return t},e.prototype.calculateDuration=function(e){var t,n=e.ganttProperties;t=!i.i(r.isNullOrUndefined)(n.segments)&&n.segments.length>0&&!i.i(r.isNullOrUndefined)(this.parent.editModule.taskbarEditModule)?this.parent.editModule.taskbarEditModule.sumOfDuration(n.segments):i.i(r.isNullOrUndefined)(this.parent.taskFields.milestone)||i.i(r.isNullOrUndefined)(n.startDate)||i.i(r.isNullOrUndefined)(n.endDate)||n.startDate.getTime()!==n.endDate.getTime()||!1!==e.taskData[this.parent.taskFields.milestone]?this.getDuration(n.startDate,n.endDate,n.durationUnit,n.isAutoSchedule,n.isMilestone):1,this.parent.setRecordValue("duration",t,n,!0);var a=this.parent.columnByField[this.parent.columnMapping.duration];if(!(i.i(r.isNullOrUndefined)(this.parent.editModule)||i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isCellEdit||i.i(r.isNullOrUndefined)(a))){if(!i.i(r.isNullOrUndefined)(a.edit)&&!i.i(r.isNullOrUndefined)(a.edit.read)){var s=this.parent.editModule.dialogModule.dialog;if(!i.i(r.isNullOrUndefined)(s)){var o=s.querySelector("#"+this.parent.element.id+"Duration").ej2_instances[0];i.i(r.isNullOrUndefined)(o)||o.value===t.toString()||(o.value=t.toString(),o.dataBind())}}this.parent.taskFields.duration&&(this.parent.dataOperation.updateMappingData(e,"duration"),this.parent.taskFields.durationUnit&&this.parent.dataOperation.updateMappingData(e,"durationUnit"))}},e.prototype.getNonworkingTime=function(e,t,n,a){a=!!i.i(r.isNullOrUndefined)(a)||a;var s=!this.parent.includeWeekend&&this.parent.autoCalculateDateScheduling&&n?this.getWeekendCount(e,t):0,o=this.getNumberOfSeconds(e,t,a),l=n&&this.parent.autoCalculateDateScheduling?this.getHolidaysCount(e,t):0,d=(o-86400*s-86400*l)/86400,h=this.getNonWorkingSecondsOnDate(e,t,n);return d*(86400-this.parent.secondsPerDay)+86400*s+86400*l+h},e.prototype.getDuration=function(e,t,n,a,s,o){if(i.i(r.isNullOrUndefined)(e)||i.i(r.isNullOrUndefined)(t))return null;o=!!i.i(r.isNullOrUndefined)(o)||o;var l=0,d=this.getTimeDifference(e,t,o)/1e3,h=this.getNonworkingTime(e,t,a,o),p=d-h;return l=s&&this.parent.getFormatedDate(e)===this.parent.getFormatedDate(t)?0:n&&"day"!==n?"minute"===n?p/60:p/3600:p/this.parent.secondsPerDay,parseFloat(l.toString())},e.prototype.getDurationAsSeconds=function(e,t){return t&&"day"!==t.toLocaleLowerCase()?"hour"===t.toLocaleLowerCase()?3600*e:60*e:this.parent.secondsPerDay*e},e.prototype.getEndDate=function(e,t,i,r,n){for(var a=new Date(e.getTime()),s=new Date(e.getTime()),o=this.getDurationAsSeconds(t,i),l=0,d=0;o>0;)s.setSeconds(s.getSeconds()+o),l=this.getNonworkingTime(a,s,r.isAutoSchedule,!0),d=o-l,o-=d,o>0&&(s=this.checkStartDate(s,r,n)),a=new Date(s.getTime());return s},e.prototype.getStartDate=function(e,t,i,r,n){for(var a=new Date(e.getTime()),s=new Date(e.getTime()),o=this.getDurationAsSeconds(t,i),l=0,d=0;o>0;)s.setSeconds(s.getSeconds()-o),l=this.getNonworkingTime(s,a,r.isAutoSchedule,!0),d=o-l,o-=d,o>0&&(a=this.checkEndDate(s,r)),a=new Date(s.getTime());return n&&r.isMilestone&&(s.setDate(s.getDate()-1),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,s),s=this.parent.dateValidationModule.checkStartDate(s,r,!0)),s},e.prototype.getProjectStartDate=function(e,t){if(!i.i(r.isNullOrUndefined)(this.parent.cloneProjectStartDate)){"string"==typeof this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate));var n=this.checkStartDate(this.parent.cloneProjectStartDate);return this.parent.cloneProjectStartDate=n,new Date(n.getTime())}if(i.i(r.isNullOrUndefined)(this.parent.projectStartDate)){if(i.i(r.isNullOrUndefined)(t))return null;var a=this.parent.flatData,s=void 0;a.length>0?s=a[0].ganttProperties.startDate:(s=new Date,s.setHours(0,0,0,0));for(var o=1;o<a.length;o++){var l=a[o].ganttProperties.startDate;i.i(r.isNullOrUndefined)(l)||-1!==this.compareDates(l,s)||(s=l)}this.parent.cloneProjectStartDate=this.checkStartDate(s,e)}else{var n=this.getDateFromFormat(this.parent.projectStartDate);this.parent.cloneProjectStartDate=this.checkStartDate(n)}return new Date(this.parent.cloneProjectStartDate.getTime())},e.prototype.getValidStartDate=function(e,t){var n=null,a=t?e.autoStartDate:e.startDate,s=t?e.autoEndDate:e.endDate,o=!e.isAutoSchedule&&e.autoDuration?e.autoDuration:e.duration;return i.i(r.isNullOrUndefined)(a)?i.i(r.isNullOrUndefined)(s)?i.i(r.isNullOrUndefined)(o)||(n=this.getProjectStartDate(e)):(n=new Date(s.getTime()),this.setTime(this.parent.defaultStartTime,n)):n=new Date(a.getTime()),n},e.prototype.getValidEndDate=function(e,t){var n=null,a=t?e.autoStartDate:e.startDate,s=t?e.autoEndDate:e.endDate,o=t?e.autoDuration:e.duration;if(i.i(r.isNullOrUndefined)(s))if(i.i(r.isNullOrUndefined)(a)){if(!i.i(r.isNullOrUndefined)(o)){var l=this.getValidStartDate(e);l&&(n=this.getEndDate(l,o,e.durationUnit,e,!1))}}else e.isMilestone?n=this.checkStartDate(a):(n=new Date(a.getTime()),this.setTime(this.parent.defaultEndTime,n));else n=new Date(s.getTime());return n},e.prototype.getSecondsPerDay=function(){var e=this.parent.dayWorkingTime,t=e.length,n=0,a=new Date("10/11/2018");this.parent.nonWorkingHours=[];var s=this.parent.nonWorkingHours;this.parent.workingTimeRanges=[];var o=this.parent.workingTimeRanges;this.parent.nonWorkingTimeRanges=[];for(var l=this.parent.nonWorkingTimeRanges,d=0;d<t;d++){var h=e[d];if(!i.i(r.isNullOrUndefined)(h.from)&&!i.i(r.isNullOrUndefined)(h.to)){a.setHours(0,0,0,0);var p=new Date(a.getTime());a.setTime(a.getTime()+36e5*h.from);var u=new Date(a.getTime());p.setTime(p.getTime()+36e5*h.to);var c=new Date(p.getTime()),g=c.getTime()-u.getTime(),f=this.getSecondsInDecimal(u),m=this.getSecondsInDecimal(c);0===m&&(m=86400),n+=g/1e3,0===d&&(this.parent.defaultStartTime=f),d===t-1&&(this.parent.defaultEndTime=m),d>0?(s.push(s[s.length-1]+f-o[d-1].to),o[d-1].to<f&&l.push({from:o[d-1].to,to:f,isWorking:!1,interval:f-o[d-1].to})):(s.push(0),l.push({from:0,to:f,isWorking:!1,interval:f})),o.push({from:f,to:m}),l.push({from:f,to:m,isWorking:!0,interval:m-f})}}return this.parent.defaultEndTime/3600!=24&&l.push({from:this.parent.defaultEndTime,to:86400,isWorking:!1,interval:86400-this.parent.defaultEndTime}),n},e.prototype.getDurationValue=function(e,t){var n=null,a=null;if("string"==typeof e){var s=e.match(/(\d*\.*\d+|.+$)/g);if(s&&s.length<=2){a=parseFloat(s[0].toString().trim());var o=s[1]?s[1].toString().trim().toLowerCase():null;-1!==i.i(r.getValue)("minute",this.parent.durationUnitEditText).indexOf(o)?n="minute":-1!==i.i(r.getValue)("hour",this.parent.durationUnitEditText).indexOf(o)?n="hour":-1!==i.i(r.getValue)("day",this.parent.durationUnitEditText).indexOf(o)&&(n="day")}}else a=e,n=null;return{duration:a,durationUnit:n}},e.prototype.getNextWorkingDay=function(e){var t=e.getDay();return-1!==this.parent.nonWorkingDayIndex.indexOf(t)?(e.setDate(e.getDate()+1),e=this.getNextWorkingDay(e)):e},e.prototype.getWeekendCount=function(e,t){var i=0,r=new Date(e.getTime()),n=new Date(t.getTime());for(r.setHours(0,0,0,0),r.setDate(r.getDate()+1),n.setHours(0,0,0,0);r.getTime()<n.getTime();)-1!==this.parent.nonWorkingDayIndex.indexOf(r.getDay())&&(i+=1),r.setDate(r.getDate()+1);return i},e.prototype.getNumberOfSeconds=function(e,t,i){var r=new Date(e.getTime()),n=new Date(t.getTime()),a=0;return r.setDate(r.getDate()+1),r.setHours(0,0,0,0),n.setHours(0,0,0,0),r.getTime()<n.getTime()&&(a=this.getTimeDifference(r,n,i)/1e3),a%86400!=0&&(a=a-a%86400+86400),a},e.prototype.getHolidaysCount=function(e,t){var i=0,r=this.parent.totalHolidayDates,n=new Date(e.getTime()),a=new Date(t.getTime());if(n.setDate(n.getDate()+1),n.setHours(0,0,0,0),a.setHours(0,0,0,0),n.getTime()<a.getTime())for(var s=0;s<r.length;s++){var o=this.getDateFromFormat(new Date(r[s]));n.getTime()<=o.getTime()&&a.getTime()>o.getTime()&&(!this.parent.includeWeekend&&-1===this.parent.nonWorkingDayIndex.indexOf(o.getDay())||this.parent.includeWeekend)&&(i+=1)}return i},e.prototype.getHolidayDates=function(){for(var e=this.parent.holidays,t=[],n=0;n<e.length;n++){var a=this.getDateFromFormat(e[n].from),s=this.getDateFromFormat(e[n].to);if(!i.i(r.isNullOrUndefined)(a)||!i.i(r.isNullOrUndefined)(s))if(i.i(r.isNullOrUndefined)(a)||i.i(r.isNullOrUndefined)(s)){var o=a||s;o.setHours(0,0,0,0),-1===t.indexOf(o.getTime())&&t.push(o.getTime())}else for(;a<=s;)a.setHours(0,0,0,0),-1===t.indexOf(a.getTime())&&t.push(a.getTime()),a.setDate(a.getDate()+1)}return t},e.prototype.isOnHolidayOrWeekEnd=function(e,t){if(t=i.i(r.isNullOrUndefined)(t)?this.parent.includeWeekend:t,this.parent.autoCalculateDateScheduling||(t=!0),!t&&-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay()))return!0;for(var n=this.parent.totalHolidayDates,a=0;a<n.length;a++){var s=this.getDateFromFormat(new Date(n[a])),o=new Date(s.getTime());if(s.setHours(0,0,0,0),o.setHours(23,59,59,59),e.getTime()>=s.getTime()&&e.getTime()<o.getTime())return!0}return!1},e.prototype.getNonWorkingSecondsOnDate=function(e,t,i){for(var r=this.getSecondsInDecimal(e),n=this.getSecondsInDecimal(t),a=-1,s=-1,o=0,l=!(!i||!this.parent.autoCalculateDateScheduling)&&this.isOnHolidayOrWeekEnd(e,null),d=!(!i||!this.parent.autoCalculateDateScheduling)&&this.isOnHolidayOrWeekEnd(t,null),h=0;h<this.parent.nonWorkingTimeRanges.length;h++){var p=this.parent.nonWorkingTimeRanges[h];r>=p.from&&r<=p.to&&(a=h),n>=p.from&&n<=p.to&&(s=h)}if(e.getDate()!==t.getDate()||e.getMonth()!==t.getMonth()||e.getFullYear()!==t.getFullYear()){if(l)o+=86400-r;else for(var h=a;h<this.parent.nonWorkingTimeRanges.length;h++)this.parent.nonWorkingTimeRanges[h].isWorking||(o+=h===a?this.parent.nonWorkingTimeRanges[h].to-r:this.parent.nonWorkingTimeRanges[h].interval);if(d)o+=n;else for(var h=0;h<=s;h++)this.parent.nonWorkingTimeRanges[h].isWorking||(o+=h===s?n-this.parent.nonWorkingTimeRanges[h].from:this.parent.nonWorkingTimeRanges[h].interval)}else if(a!==s)if(d)o+=n-r;else for(var h=a;h<=s;h++)this.parent.nonWorkingTimeRanges[h].isWorking||(o+=h===a?this.parent.nonWorkingTimeRanges[h].to-r:h===s?n-this.parent.nonWorkingTimeRanges[h].from:this.parent.nonWorkingTimeRanges[h].interval);else if(d)o+=n-r;else{var u=this.parent.nonWorkingTimeRanges[a];u.isWorking||(o=n-r)}return o},e.prototype.getPreviousWorkingDay=function(e){var t=e.getDay(),i=0===t?6:t-1;return-1!==this.parent.nonWorkingDayIndex.indexOf(t)||-1!==this.parent.nonWorkingDayIndex.indexOf(i)&&86400===this.parent.defaultEndTime&&0===this.getSecondsInDecimal(e)?(e.setDate(e.getDate()-1),-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay())&&(e=this.getPreviousWorkingDay(e)),e):e},e.prototype.getNonWorkingDayIndex=function(){var e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],t=e.length;0===this.parent.workWeek.length&&(this.parent.workWeek=["Monday","Tuesday","Wednesday","Thursday","Friday"]);for(var i=this.parent.workWeek.slice(),r=i.length,n=0;n<r;n++)i[n]=i[n].toLowerCase();this.parent.nonWorkingDayIndex=[];for(var n=0;n<t;n++)-1===i.indexOf(e[n])&&this.parent.nonWorkingDayIndex.push(n)},e.prototype.setTime=function(e,t){var i=e/3600;i=parseInt(i,10);var r=(e-3600*i)/60;r=parseInt(r,10);var n=e-3600*i-60*r;t.setHours(i,r,n)},e.prototype.getTimeDifference=function(e,t,i){var r=new Date(e.getTime()),n=new Date(t.getTime());return i&&this.updateDateWithTimeZone(r,n),n.getTime()-r.getTime()},e.prototype.updateDateWithTimeZone=function(e,t){var i,r,n=e.getTimezoneOffset(),a=t.getTimezoneOffset();if(n!==a){var s=new Date((new Date).getFullYear(),0,1).getTimezoneOffset();if(s!==n?(r=e,i=n):s!==a&&(r=t,i=a),s<0){var o=s-i;r.setTime(r.getTime()+60*o*1e3)}else if(s>=0){var o=i-s;r.setTime(r.getTime()-60*o*1e3)}}},e.prototype.getSecondsInDecimal=function(e){return 60*e.getHours()*60+60*e.getMinutes()+e.getSeconds()+e.getMilliseconds()/1e3},e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var r=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(r.getTime())?0:(e.getTime()-r.getTime())/6e4+i}catch(e){return 0}},e.prototype.remove=function(e,t){return i.i(r.isNullOrUndefined)(e)||(e=this.reverse(e,t,e.getTimezoneOffset())),e},e.prototype.reverse=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var r=e.getTimezoneOffset();e=new Date(e.getTime()+6e4*(t-i));var n=e.getTimezoneOffset();return new Date(e.getTime()+6e4*(n-r))},e.prototype.convert=function(e,t){var i=e.getTimezoneOffset(),r=this.offset(e,t);e=new Date(e.getTime()+6e4*(i-r));var n=e.getTimezoneOffset();return new Date(e.getTime()+6e4*(n-i))},e.prototype.getDateFromFormat=function(e,t){var n;if(i.i(r.isNullOrUndefined)(e))return null;if(e instanceof Date)n=new Date(e.getTime());else{var a=this.parent.globalize.parseDate(e,{format:this.parent.getDateFormat(),type:"dateTime"});n=i.i(r.isNullOrUndefined)(a)&&!isNaN(new Date(e).getTime())?new Date(e):a}if(!i.i(r.isNullOrUndefined)(this.parent.timezone)&&t){return this.convert(n,this.parent.timezone)}return n},e.prototype.compareDates=function(e,t){return i.i(r.isNullOrUndefined)(e)||i.i(r.isNullOrUndefined)(t)?!i.i(r.isNullOrUndefined)(e)&&i.i(r.isNullOrUndefined)(t)?1:i.i(r.isNullOrUndefined)(e)&&!i.i(r.isNullOrUndefined)(t)?-1:null:e.getTime()>t.getTime()?1:e.getTime()<t.getTime()?-1:0},e.prototype.getDurationString=function(e,t){var n="";if(!i.i(r.isNullOrUndefined)(e)&&(n+=parseFloat(e.toFixed(2))+" ",!i.i(r.isNullOrUndefined)(t))){var a=1!==e;"day"===t?n+=a?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===t?n+=a?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===t&&(n+=a?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return n},e.prototype.getWorkString=function(e,t){var n="";if(!i.i(r.isNullOrUndefined)(e)&&(n+=parseFloat(e).toFixed(2)+" ",!i.i(r.isNullOrUndefined)(t))){var a=1!==e;"day"===t?n+=a?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===t?n+=a?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===t&&(n+=a?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return n},e.prototype.calculateProjectDatesForValidatedTasks=function(e){var t=this,n="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,a="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,s=null,o=null,l=i.i(r.getValue)("dataOperation.dataArray",this.parent);if(n&&a||!l||0!==l.length){if(l.length>0){var d=l.slice().sort(function(e,i){return new Date(e[t.parent.taskFields.startDate]).getTime()-new Date(i[t.parent.taskFields.startDate]).getTime()}),h=l.slice().sort(function(e,i){return new Date(i[t.parent.taskFields.endDate]).getTime()-new Date(e[t.parent.taskFields.endDate]).getTime()});s=d[0][this.parent.taskFields.startDate],o=h[h.length-1][this.parent.taskFields.endDate]}}else s=this.getDateFromFormat(new Date),o=this.getDateFromFormat(new Date(s.getTime()));this.parent.cloneProjectStartDate=n?new Date(n.getTime()):"string"==typeof s?new Date(s):s,this.parent.cloneProjectEndDate=a?new Date(a.getTime()):"string"==typeof o?new Date(o):o},e.prototype.calculateProjectDates=function(e){var t=this;if(this.parent.isLoad&&this.parent.enablePersistence&&this.parent.cloneProjectStartDate&&this.parent.cloneProjectEndDate)return this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate),void(this.parent.cloneProjectEndDate=this.getDateFromFormat(this.parent.cloneProjectEndDate));var n="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,a="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,s=this.parent.timelineModule.isZooming&&this.parent.cloneProjectStartDate?this.getDateFromFormat(this.parent.cloneProjectStartDate):this.getDateFromFormat(n),o=this.parent.timelineModule.isZooming&&this.parent.cloneProjectEndDate?this.getDateFromFormat(this.parent.cloneProjectEndDate):this.getDateFromFormat(a),l=null,d=null,h=this.parent.flatData,p=this.parent.currentViewData,u=[],c=function(e){i.i(r.isNullOrUndefined)(e)||u.push(e)},g=function(e){e.length>0&&(e.sort(function(e,t){return e.getTime()-t.getTime()}),l=new Date(e[0].getTime()),d=e.length>1?new Date(e[e.length-1].getTime()):null)};if((!s||!o)&&h.length>0||e||this.parent.timelineModule.isZoomToFit){var f=void 0;if(f=p.length>0&&this.parent.timelineModule.isZoomToFit&&this.parent.treeGrid.filterModule&&this.parent.treeGrid.filterModule.filteredResult.length>0?p:h,f.forEach(function(e){u=[];var n,a,s=e.ganttProperties;i.i(r.isNullOrUndefined)(s.startDate)&&i.i(r.isNullOrUndefined)(s.endDate)?(n=null,a=null):(n=t.getValidStartDate(s),a=t.getValidEndDate(s)),c(l),c(d),c(n),c(a),t.parent.renderBaseline&&!t.parent.timelineModule.isZoomToFit&&(c(s.baselineStartDate),c(s.baselineEndDate)),s.indicators&&s.indicators.length>0&&!t.parent.timelineModule.isZoomToFit&&s.indicators.forEach(function(e){c(t.getDateFromFormat(e.date))}),g(u)}),u=[],c(l),c(d),this.parent.eventMarkers.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.eventMarkers.forEach(function(e,i){c(t.getDateFromFormat(e.day))})}if(this.parent.totalHolidayDates.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.totalHolidayDates.forEach(function(e,t){c(new Date(e))})}g(u),l&&d||(l?l=i.i(r.isNullOrUndefined)(l)?this.getDateFromFormat(new Date):l:(l=i.i(r.isNullOrUndefined)(l)?this.getDateFromFormat(new Date):l,l.setHours(0,0,0,0)),d=this.getDateFromFormat(new Date(l.getTime())),d.setDate(d.getDate()+20))}else s&&o||0!==h.length||(l=this.getDateFromFormat(new Date),d=this.getDateFromFormat(new Date(l.getTime())));e?(i.i(r.setValue)("minStartDate",l,e),i.i(r.setValue)("maxEndDate",d,e)):(this.prevProjectStartDate=this.parent.cloneProjectStartDate,this.parent.cloneProjectStartDate=l?this.parent.timelineModule.isZoomToFit?l:i.i(r.isNullOrUndefined)(s)?l:new Date(s.getTime()):new Date(s.getTime()),this.parent.cloneProjectEndDate=d?this.parent.timelineModule.isZoomToFit?d:i.i(r.isNullOrUndefined)(o)?d:new Date(o.getTime()):new Date(o.getTime())),this.parent.isProjectDateUpdated=!0},e.prototype.splitTasksDuration=function(e){for(var t=0,i=0;i<e.length;i++){var r=e[i],n=r.startDate,a=r.endDate;"Hour"===this.parent.timelineModule.bottomTier?t+=Math.ceil(this.getTimeDifference(n,a)/36e5):"Minutes"===this.parent.timelineModule.bottomTier?t+=Math.ceil(this.getTimeDifference(n,a)/6e4):t+=Math.ceil(this.getTimeDifference(n,a)/864e5)}return t},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r;!function(e){e[e.NextPage=0]="NextPage",e[e.LastPage=1]="LastPage"}(r||(r={}))},function(e,t){e.exports=s},function(e,t){e.exports=o},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=i(0),a=(i.n(n),function(){function e(e){this.parentRecord=[],this.parentIds=[],this.parentPredecessors=[],this.validatedParentIds=[],this.parent=e,this.dateValidateModule=this.parent.dateValidationModule}return e.prototype.ensurePredecessorCollection=function(){for(var e=this.parent.predecessorsCollection,t=e.length-1,i=t;i>=0;i--){var r=e[i],n=r.ganttProperties;(!r.hasChildRecords&&!this.parent.allowParentDependency||this.parent.allowParentDependency)&&this.ensurePredecessorCollectionHelper(r,n)}},e.prototype.ensurePredecessorCollectionHelper=function(e,t){var r=t.predecessorsName;if(!r||"string"!=typeof r&&"number"!=typeof r){if(r&&"object"==typeof r&&r.length){for(var a=[],s=0;s<r.length;s++){var o=r[s],l={};l.from=i.i(n.getValue)("from",o),l.to=i.i(n.getValue)("to",o)?i.i(n.getValue)("to",o):t.rowUniqueID,l.type=i.i(n.getValue)("type",o)?i.i(n.getValue)("type",o):"FS";var d=i.i(n.getValue)("offset",o);if(i.i(n.isNullOrUndefined)(d))l.offset=0,l.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();else if("string"==typeof d){var h=this.getOffsetDurationUnit(i.i(n.getValue)("offset",o));l.offset=h.duration,l.offsetUnit=h.durationUnit}else l.offset=parseFloat(d.toString()),l.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();var p=this.checkIsParent(l.from.toString());p||a.push(l)}this.parent.setRecordValue("predecessor",a,t,!0)}}else this.parent.setRecordValue("predecessor",this.calculatePredecessor(r,e),t,!0);this.parent.setRecordValue("predecessorsName",this.getPredecessorStringValue(e),t,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,t.predecessorsName,e),this.parent.setRecordValue(this.parent.taskFields.dependency,t.predecessorsName,e)},e.prototype.updateUnscheduledDependency=function(e){for(var t=this.parent.taskFields,r=i.i(n.isNullOrUndefined)(e[t.dependency])?[]:e[t.dependency].toString().split(","),a=0;a<r.length;a++){var s=parseInt(r[a],10);if(!isNaN(s)){var o=this.parent.getRecordByID(s.toString()),l=i.i(n.isNullOrUndefined)(o)?null:i.i(n.extend)({},{},o.taskData,!0);!i.i(n.isNullOrUndefined)(l)&&i.i(n.isNullOrUndefined)(l[t.startDate])&&i.i(n.isNullOrUndefined)(l[t.duration])&&i.i(n.isNullOrUndefined)(l[t.endDate])&&(l[t.duration]=1,l[t.startDate]=this.parent.projectStartDate,this.parent.updateRecordByID(l))}}},e.prototype.checkIsParent=function(e){var t=!1;return this.parent.connectorLineModule.getRecordByID(e).hasChildRecords&&(t=!0),t},e.prototype.calculatePredecessor=function(e,t){var i,r,n,a,s=this,o=e.toString(),l=[];return o.split(",").forEach(function(e){r=e.split("+"),n="+",e.indexOf("-")>=0&&(r=e.split("-"),n="-"),i=[];var o="ResourceView"===s.parent.viewType?s.parent.getTaskIds():s.parent.ids;-1!==("ResourceView"===s.parent.viewType?o.indexOf("T"+r[0]):o.indexOf(r[0]))?i[0]=r[0]:-1===o.indexOf(r[0])?(i=r[0].split(" "),1===i.length&&(-1!=i[0].indexOf(" ")?i=r[0].match(/(\d+|[A-z]+)/g):(i[0]=r[0].slice(0,-2),i[1]=r[0].slice(-2)))):i[0]=r[0];var d="ResourceView"===s.parent.viewType?o.indexOf("T"+i[0]):o.indexOf(i[0]);if(i[0]&&-1!==d){if(i.length>1){var h=i[1].toUpperCase();a="FS"===h||"FF"===h||"SF"===h||"SS"===h?h:"FS"}else a="FS";var p=r.length>1?n+""+r[1]:"0",u=s.getOffsetDurationUnit(p),c={from:i[0],type:a,isDrawn:!1,to:"ResourceView"===s.parent.viewType?t.ganttProperties.taskId.toString():t.ganttProperties.rowUniqueID.toString(),offsetUnit:u.durationUnit,offset:u.duration},g=s.checkIsParent(i[0]);if(s.parent.allowParentDependency){var f=s.parent.connectorLineModule.getRecordByID(c.to),m=s.parent.connectorLineModule.getRecordByID(c.from);s.parent.connectorLineEditModule&&m&&f?s.parent.connectorLineEditModule.validateParentPredecessor(m,f)&&l.push(c):l.push(c),i.splice(0)}else g||l.push(c)}}),l},e.prototype.getPredecessorStringValue=function(e){var t,r,a=e.ganttProperties.predecessor,s=this.parent.durationUnitTexts,o="";if(r=[],a)for(var l=a.length,d=0;d<l;d++){var h=a[d],p="",u="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(h.from!==u.toString()){if(p=h.from+h.type,"string"==typeof e.ganttProperties.taskId?(r[0]=p.slice(0,-2),r[1]=p.slice(-2),t=r[0]+" "+r[1]):t=p,p=t,0!==h.offset){p+=h.offset>0?"+"+h.offset+" ":h.offset+" ";var c=1!==h.offset;"day"===h.offsetUnit?p+=c?i.i(n.getValue)("days",s):i.i(n.getValue)("day",s):"hour"===h.offsetUnit?p+=c?i.i(n.getValue)("hours",s):i.i(n.getValue)("hour",s):p+=c?i.i(n.getValue)("minutes",s):i.i(n.getValue)("minute",s)}o=o.length>0?o+","+p:p}}return o},e.prototype.getOffsetDurationUnit=function(e){var t=0,r=this.parent.durationUnit.toLocaleLowerCase(),a=this.parent.durationUnitEditText;if("string"==typeof e){for(var s=e.match(/[^0-9]+|[0-9]+/g),o=0;o<s.length;o++)s[o]=s[o].trim();"-"===s[0]&&s[1]?(s[1]=s[0]+s[1],s.shift()):"+"===s[0]&&s.shift(),"."!==s[1]||isNaN(parseInt(s[2],10))||(s[0]+=s[1]+s[2],s.splice(1,2)),s&&s.length<=2&&(t=parseFloat(s[0]),r=s[1]?s[1].toLowerCase().trim():"",r=-1!==i.i(n.getValue)("minute",a).indexOf(r)?"minute":-1!==i.i(n.getValue)("hour",a).indexOf(r)?"hour":-1!==i.i(n.getValue)("day",a).indexOf(r)?"day":this.parent.durationUnit.toLocaleLowerCase())}else t=e,r=this.parent.durationUnit.toLocaleLowerCase();return isNaN(t)&&(t=0,r=this.parent.durationUnit.toLocaleLowerCase()),{duration:t,durationUnit:r}},e.prototype.updatePredecessors=function(){for(var e,t=this.parent.predecessorsCollection,i=t.length,r=0;r<i;r++)e=t[r],(!e.hasChildRecords&&!this.parent.allowParentDependency||this.parent.allowParentDependency)&&(this.updatePredecessorHelper(e,t),!e.ganttProperties.isAutoSchedule&&this.parent.editSettings.allowEditing&&this.parent.connectorLineEditModule.calculateOffset(e))},e.prototype.updatePredecessorHelper=function(e,t){var r,a=e.ganttProperties.predecessor,s=a.length;t=i.i(n.isNullOrUndefined)(t)?[]:t;for(var o=0;o<s;o++){var l=a[o];r=this.parent.connectorLineModule.getRecordByID(l.from);var d="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(l.from!==d.toString()&&r){var h=void 0;r.ganttProperties.predecessor?(h=i.i(n.extend)([],r.ganttProperties.predecessor,[],!0),h.push(l),this.parent.setRecordValue("predecessor",h,r.ganttProperties,!0)):(h=[],h.push(l),this.parent.setRecordValue("predecessor",h,r.ganttProperties,!0),t.push(r))}}},e.prototype.updatedRecordsDateByPredecessor=function(){if(this.parent.autoCalculateDateScheduling)for(var e=this.parent.flatData,t=this.parent.flatData.length,i=0;i<t;i++)if(e[i].ganttProperties.predecessorsName){this.validatePredecessorDates(e[i]);var r=e[i].ganttProperties.predecessor;if(r&&r.length>1)for(var n=0;n<r.length;n++){var a=this.parent.getRecordByID(r[n].to);a&&this.validatePredecessorDates(a)}e[i].hasChildRecords&&this.parent.editModule&&!this.parent.allowUnscheduledTasks&&this.parent.allowParentDependency&&this.parent.editModule.updateChildItems(e[i])}},e.prototype.updateParentPredecessor=function(){if(this.parent.enablePredecessorValidation)for(var e=this.parentPredecessors.length,t=e-1;t>=0;t--){var i=this.parentPredecessors[t];this.validatePredecessorDates(i),i.ganttProperties.startDate&&this.parent.editModule.updateChildItems(i)}},e.prototype.validatePredecessorDates=function(e){if(e.ganttProperties.predecessor){var t=e.ganttProperties.predecessor,i=void 0,r=void 0,n=null,a="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),s=t.filter(function(e){return e.to===a?e:null});for(i=0;i<s.length;i++){var o=s[i];r=this.parent.connectorLineModule.getRecordByID(o.from),n=this.parent.connectorLineModule.getRecordByID(o.to),this.parent.allowParentDependency&&this.parent.isLoad&&-1==this.parentPredecessors.indexOf(e)&&(e.hasChildRecords||n.hasChildRecords)&&this.parentPredecessors.push(e),(n.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)&&this.validateChildGanttRecord(r,n)}}},e.prototype.validateChildGanttRecord=function(e,t){if(this.parent.editedTaskBarItem!==t&&!i.i(n.isNullOrUndefined)(i.i(r.c)(e.ganttProperties))&&!i.i(n.isNullOrUndefined)(i.i(r.c)(t.ganttProperties))&&this.parent.isInPredecessorValidation&&(t.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)){var a=t.ganttProperties,s="ResourceView"===this.parent.viewType?a.taskId.toString():a.rowUniqueID.toString(),o=a.predecessor,l=o.filter(function(e){return e.to===s?e:null}),d=this.getPredecessorDate(t,l);this.parent.setRecordValue("startDate",d,a,!0),this.parent.dataOperation.updateMappingData(t,"startDate");var h=t.ganttProperties.segments;i.i(n.isNullOrUndefined)(h)&&this.dateValidateModule.calculateEndDate(t),this.parent.dataOperation.updateWidthLeft(t),!this.parent.isLoad&&!this.parent.isFromOnPropertyChange&&t.parentItem&&this.parent.isInPredecessorValidation&&this.parent.getParentTask(t.parentItem).ganttProperties.isAutoSchedule&&-1===this.parentIds.indexOf(t.parentItem.uniqueID)&&(this.parentIds.push(t.parentItem.uniqueID),this.parentRecord.push(t.parentItem))}},e.prototype.getPredecessorDate=function(e,t){var i,r,n,a,s=this,o=t.filter(function(t){var i="ResourceView"===s.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;return t.to===i.toString()?t:null});if(o)for(var l=o.length,d=0;d<l;d++){var h=o[d];n=this.parent.connectorLineModule.getRecordByID(h.from),a=this.parent.connectorLineModule.getRecordByID(h.to),r=this.getValidatedStartDate(a.ganttProperties,n.ganttProperties,h),null!=i&&1!==this.dateValidateModule.compareDates(r,i)||(i=r)}return i},e.prototype.getValidatedStartDate=function(e,t,i){var r,n,a=i.type,s=i.offset;switch(a){case"FS":r=this.dateValidateModule.getValidEndDate(t),e.isMilestone&&0===s||(r=this.dateValidateModule.checkStartDate(r,e)),0!==s&&(r=this.updateDateByOffset(r,i,e)),n=e.isMilestone?r:this.dateValidateModule.checkStartDate(r,e);break;case"FF":case"SF":r="FF"===a?this.dateValidateModule.getValidEndDate(t):this.dateValidateModule.getValidStartDate(t),0!==s&&(r=this.updateDateByOffset(r,i,e)),e.isMilestone||(r=this.dateValidateModule.checkEndDate(r,e)),n=this.dateValidateModule.getStartDate(r,e.duration,e.durationUnit,e);break;case"SS":r=this.dateValidateModule.getValidStartDate(t),0!==s&&(r=this.updateDateByOffset(r,i,e)),n=e.isMilestone?r:this.dateValidateModule.checkStartDate(r,e)}return n},e.prototype.updateDateByOffset=function(e,t,i){var r,n=t.offset,a=t.offsetUnit;return n<0?r=this.dateValidateModule.getStartDate(this.dateValidateModule.checkEndDate(e,i),-1*n,a,i,!0):(r=this.dateValidateModule.getEndDate(e,n,a,i,!1),i.isMilestone||(r=this.dateValidateModule.checkStartDate(r,i))),r},e.prototype.createConnectorLinesCollection=function(e){var t=e||this.parent.currentViewData;this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport&&(t=this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneCurrentViewData);var i,r,n,a=t.length;for(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport?this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData):this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.getExpandedRecords(this.parent.updatedRecords),i=0;i<a;i++){if(this.parent.editModule&&this.parent.editModule.deletedTaskDetails.length>0){if(t[i].parentItem){var s=this.parent.getRecordByID(t[i].parentItem.taskId.toString());this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(s),t[i])}t[i].index=i}r=t[i],n=r.ganttProperties.predecessor,n&&this.addPredecessorsCollection(n)}},e.prototype.addPredecessorsCollection=function(e){var t,i,r,n,a;if(e)for(t=e.length,i=0;i<t;i++){r=e[i];n=this.parent.connectorLineModule.getRecordByID(r.from),a=this.parent.connectorLineModule.getRecordByID(r.to),this.parent.connectorLineModule.expandedRecords&&-1!==this.parent.connectorLineModule.expandedRecords.indexOf(n)&&-1!==this.parent.connectorLineModule.expandedRecords.indexOf(a)&&this.updateConnectorLineObject(n,a,r)}},e.prototype.updateConnectorLineObject=function(e,t,i){var r=this.parent.connectorLineModule.createConnectorLineObject(e,t,i);if(r){if(t.isCritical&&e.isCritical&&(r.isCritical=!0),this.parent.connectorLineIds.length>0&&-1===this.parent.connectorLineIds.indexOf(r.connectorLineId)||0===this.parent.connectorLineIds.length)this.parent.updatedConnectorLineCollection.push(r),this.parent.connectorLineIds.push(r.connectorLineId);else if(-1!==this.parent.connectorLineIds.indexOf(r.connectorLineId)){var n=this.parent.connectorLineIds.indexOf(r.connectorLineId);this.parent.updatedConnectorLineCollection[n]=r}i.isDrawn=!0}return r},e.prototype.validatePredecessor=function(e,t,i){if(this.parent.isInPredecessorValidation&&e.ganttProperties.predecessor){var r=this.parent.editModule.taskbarEditModule,n=void 0;r&&(n=r.taskBarEditRecord);for(var a=e.ganttProperties.predecessor,s=void 0,o=null,l=void 0,d=void 0,h="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),p=a.filter(function(e){return e.to===h?e:null}),u=a.filter(function(e){return e.from===h?e:null}),c=0;c<p.length;c++){l=p[c],s=this.parent.connectorLineModule.getRecordByID(l.from),o=this.parent.connectorLineModule.getRecordByID(l.to),this.parent.isInPredecessorValidation&&o.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1;var g="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;g.toString()!==l.to&&g.toString()!==l.from||i&&"predecessor"!==i||this.validateChildGanttRecord(s,o)}for(var c=0;c<u.length;c++)d=u[c],s=this.parent.connectorLineModule.getRecordByID(d.from),o=this.parent.connectorLineModule.getRecordByID(d.to),this.parent.isInPredecessorValidation&&o.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1,"predecessor"!==i&&this.parent.isValidationEnabled?this.validateChildGanttRecord(s,o):!o.ganttProperties.isAutoSchedule&&this.parent.UpdateOffsetOnTaskbarEdit&&this.parent.connectorLineEditModule.calculateOffset(o),!1!==s.expanded&&o.expanded,o&&this.validatePredecessor(o,void 0,"successor");o&&!o.hasChildRecords&&o.parentItem&&-1==this.validatedParentIds.indexOf(o.parentItem.taskId)&&this.validatedParentIds.push(o.parentItem.taskId);var f=!0;o&&o.hasChildRecords&&-1!==this.validatedParentIds.indexOf(o.ganttProperties.taskId.toString())&&(f=!1),f&&(o&&o.ganttProperties.taskId!==this.isValidatedParentTaskID&&n?("ParentDrag"!==r.taskBarEditAction&&"ChildDrag"!==r.taskBarEditAction?!n.hasChildRecords&&o.hasChildRecords&&(this.parent.editModule.updateChildItems(o),this.isValidatedParentTaskID=o.ganttProperties.taskId):(!o.hasChildRecords&&"ChildDrag"==r.taskBarEditAction||o.hasChildRecords&&"ParentDrag"==r.taskBarEditAction)&&(this.parent.editModule.updateChildItems(o),this.isValidatedParentTaskID=o.ganttProperties.taskId),n.hasChildRecords||this.parent.dataOperation.updateParentItems(o,!0)):o&&o.hasChildRecords&&!n&&this.parent.editModule.updateChildItems(o))}},e.prototype.getValidPredecessor=function(e){var t=this,r=[];if(!i.i(n.isNullOrUndefined)(e)){var a=e.ganttProperties.predecessor;a&&a.length>0&&(r=a.filter(function(i){var r="ResourceView"===t.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;return i.from!==r.toString()}))}return r},e}())},function(e,t,i){"use strict";var r=i(46);i.d(t,"a",function(){return r.a});var n=i(11);i.d(t,"b",function(){return n.a});var a=i(1);i.d(t,"c",function(){return a.j}),i.d(t,"d",function(){return a.c}),i.d(t,"e",function(){return a.i}),i.d(t,"f",function(){return a.d}),i.d(t,"g",function(){return a.f}),i.d(t,"h",function(){return a.e}),i.d(t,"i",function(){return a.g}),i.d(t,"j",function(){return a.l}),i.d(t,"k",function(){return a.h}),i.d(t,"l",function(){return a.b}),i.d(t,"m",function(){return a.a}),i.d(t,"n",function(){return a.k});var s=i(16);i.d(t,"o",function(){return s.b}),i.d(t,"p",function(){return s.c}),i.d(t,"q",function(){return s.d}),i.d(t,"r",function(){return s.a}),i.d(t,"s",function(){return s.e})},function(e,t,i){"use strict";i.d(t,"b",function(){return r}),i.d(t,"c",function(){return n}),i.d(t,"d",function(){return a}),i.d(t,"a",function(){return s}),i.d(t,"e",function(){return o});var r="load",n="rowDataBound",a="queryCellInfo",s="toolbarClick",o="key-pressed"},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(2),n=(i.n(r),function(){function e(e){this.theme=e,this.ganttStyle={},this.setTheme(this.ganttStyle,this.theme)}return Object.defineProperty(e.prototype,"style",{get:function(){return this.ganttStyle?this.ganttStyle:(this.setTheme(this.ganttStyle,"Material"),this.ganttStyle)},enumerable:!0,configurable:!0}),e.prototype.setTheme=function(e,t){switch(this.initStyles(e),e.columnHeader.fontSize=9.5,e.columnHeader.fontColor=new r.PdfColor(0,0,0),e.columnHeader.fontColor.gray=.2,e.columnHeader.backgroundColor=new r.PdfColor(255,255,255),e.columnHeader.borderColor=new r.PdfColor(234,234,234),e.columnHeader.format.lineAlignment=1,e.columnHeader.format.alignment=0,e.fontFamily=r.PdfFontFamily.Helvetica,e.cell.fontSize=9.5,e.cell.backgroundColor=new r.PdfColor(255,255,255),e.cell.borderColor=new r.PdfColor(234,234,234),e.cell.fontColor=new r.PdfColor(0,0,0),e.cell.fontColor.gray=.2,e.cell.format.lineAlignment=1,e.cell.format.alignment=0,e.footer.fontSize=9.5,e.footer.fontStyle=0,e.footer.format.alignment=1,e.footer.format.lineAlignment=1,e.timeline.fontSize=9.5,e.timeline.fontStyle=0,e.timeline.backgroundColor=new r.PdfColor(252,252,252),e.timeline.fontColor=new r.PdfColor(40,40,39),e.chartGridLineColor=new r.PdfColor(206,206,206),e.timeline.borderColor=new r.PdfColor(206,206,206),t){case"Bootstrap":e.taskbar.taskColor=new r.PdfColor(49,122,185),e.taskbar.progressColor=new r.PdfColor(33,82,125),e.taskbar.criticalTaskColor=new r.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new r.PdfColor(255,85,85),e.taskbar.baselineColor=new r.PdfColor(240,173,78),e.taskbar.baselineBorderColor=new r.PdfColor(240,173,78),e.criticalConnectorLineColor=new r.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new r.PdfColor(255,85,85),e.taskbar.parentTaskColor=new r.PdfColor(119,119,119),e.taskbar.parentProgressColor=new r.PdfColor(85,85,85),e.taskbar.taskBorderColor=new r.PdfColor(33,82,125),e.taskbar.parentTaskBorderColor=new r.PdfColor(85,85,85),e.taskbar.milestoneColor=new r.PdfColor(85,85,85),e.footer.fontColor=new r.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new r.PdfColor(33,82,125),e.footer.backgroundColor=new r.PdfColor(255,255,255),e.taskbar.progressFontColor=new r.PdfColor(255,255,255),e.label.fontColor=new r.PdfColor(0,0,0);break;case"Bootstrap 4":e.taskbar.taskColor=new r.PdfColor(0,123,255),e.taskbar.progressColor=new r.PdfColor(0,86,179),e.taskbar.criticalTaskColor=new r.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new r.PdfColor(255,85,85),e.taskbar.baselineColor=new r.PdfColor(255,193,7),e.taskbar.baselineBorderColor=new r.PdfColor(255,193,7),e.criticalConnectorLineColor=new r.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new r.PdfColor(255,85,85),e.taskbar.parentTaskColor=new r.PdfColor(108,117,125),e.taskbar.parentProgressColor=new r.PdfColor(73,80,87),e.taskbar.taskBorderColor=new r.PdfColor(0,86,179),e.taskbar.parentTaskBorderColor=new r.PdfColor(73,80,87),e.taskbar.milestoneColor=new r.PdfColor(73,80,87),e.footer.fontColor=new r.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new r.PdfColor(0,86,179),e.footer.backgroundColor=new r.PdfColor(255,255,255),e.taskbar.progressFontColor=new r.PdfColor(255,255,255),e.label.fontColor=new r.PdfColor(33,37,41);break;case"Fabric":e.columnHeader.fontColor=new r.PdfColor(102,102,102),e.cell.fontColor=new r.PdfColor(51,51,51),e.taskbar.taskColor=new r.PdfColor(0,120,214),e.taskbar.progressColor=new r.PdfColor(0,91,163),e.taskbar.criticalTaskColor=new r.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new r.PdfColor(255,85,85),e.taskbar.baselineColor=new r.PdfColor(216,59,1),e.taskbar.baselineBorderColor=new r.PdfColor(216,59,1),e.criticalConnectorLineColor=new r.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new r.PdfColor(255,85,85),e.taskbar.parentTaskColor=new r.PdfColor(118,118,118),e.taskbar.parentProgressColor=new r.PdfColor(80,80,80),e.taskbar.taskBorderColor=new r.PdfColor(0,91,163),e.taskbar.parentTaskBorderColor=new r.PdfColor(80,80,80),e.taskbar.milestoneColor=new r.PdfColor(80,80,80),e.footer.fontColor=new r.PdfColor(51,51,51),e.footer.fontColor.gray=.2,e.connectorLineColor=new r.PdfColor(0,69,122),e.footer.backgroundColor=new r.PdfColor(255,255,255),e.taskbar.progressFontColor=new r.PdfColor(255,255,255),e.label.fontColor=new r.PdfColor(51,51,51);break;default:e.taskbar.taskColor=new r.PdfColor(88,105,197),e.taskbar.progressColor=new r.PdfColor(63,81,181),e.taskbar.criticalTaskColor=new r.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new r.PdfColor(255,85,85),e.taskbar.baselineColor=new r.PdfColor(193,87,0),e.taskbar.baselineBorderColor=new r.PdfColor(193,87,0),e.criticalConnectorLineColor=new r.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new r.PdfColor(255,85,85),e.taskbar.parentTaskColor=new r.PdfColor(132,132,132),e.taskbar.parentProgressColor=new r.PdfColor(97,97,97),e.taskbar.taskBorderColor=new r.PdfColor(63,81,181),e.taskbar.parentTaskBorderColor=new r.PdfColor(51,51,51),e.taskbar.milestoneColor=new r.PdfColor(97,97,97),e.footer.fontColor=new r.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new r.PdfColor(63,81,181),e.footer.backgroundColor=new r.PdfColor(255,255,255),e.taskbar.progressFontColor=new r.PdfColor(255,255,255),e.label.fontColor=new r.PdfColor(51,51,51)}},e.prototype.initStyles=function(e){e.columnHeader={},e.columnHeader.format=new r.PdfStringFormat,e.cell={},e.cell.format=new r.PdfStringFormat,e.timeline={},e.footer={},e.footer.format=new r.PdfStringFormat,e.label={},e.taskbar={}},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(7),n=i(2),a=(i.n(n),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),s=function(e){function t(){var t=e.call(this)||this;return t.treeGridSize=new n.SizeF(0,0),t.treeColumnIndex=0,t.allowRowBreakAcrossPages=!0,t.enableHeader=!0,t.isFitToWidth=!1,t.columns=new r.p(t),t.rows=new r.m(t),t.headers=new r.n(t),t.style=new r.e,t.rowHeight=0,t}return a(t,e),Object.defineProperty(t.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return 0===this.treeGridSize.width&&0===this.treeGridSize.height&&(this.treeGridSize=this.calculateTreeGridSize()),this.treeGridSize},set:function(e){this.treeGridSize=e},enumerable:!0,configurable:!0}),t.prototype.draw=function(e,t,i,r){if(t instanceof n.PointF&&void 0===t.width&&void 0===i)return this.drawHelper(e,t.x,t.y);if("number"==typeof t&&"number"==typeof i&&void 0===r)return this.drawHelper(e,t,i,null);if(t instanceof n.RectangleF&&void 0!==t.width&&void 0===i)return this.drawHelper(e,t,null);if(t instanceof n.PointF&&void 0===t.width&&i instanceof n.PdfLayoutFormat)return this.drawHelper(e,t.x,t.y,i);if("number"==typeof t&&"number"==typeof i&&(r instanceof n.PdfLayoutFormat||null==r)){var a=e.graphics.clientSize.width-t,s=new n.RectangleF(t,i,a,0);return this.drawHelper(e,s,r)}return t instanceof n.RectangleF&&void 0!==t.width&&"boolean"==typeof i?this.drawHelper(e,t,null):this.drawHelper(e,t,i)},t.prototype.measureColumnsWidth=function(e){if(void 0!==e)for(var t=this.columns.getDefaultWidths(e.width-e.x),i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i]);else{for(var t=[],r=0,n=0,a=0,s=this.columns.count,i=0;i<s;i++){for(var o=this.rows.count,l=0;l<o;l++){var d=this.rows.getRow(l).cells.getCell(i).width,h=this.initialWidth>0?Math.min(this.initialWidth,d):d;r=Math.max(r,h),r=Math.max(this.columns.getColumn(i).width,r),this.columns.getColumn(i).isTreeColumn&&(a=Math.max(a,this.rows.getRow(l).level))}this.columns.getColumn(i).isTreeColumn?t.push(r+10*a):t.push(r),n+=r,r=0}for(var i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i])}},t.prototype.calculateTreeGridSize=function(){for(var e=0,t=this.columns.width,i=0;i<this.headers.count;i++){var r=this.headers.getHeader(i);e+=r.height}for(var i=0;i<this.rows.count;i++){var r=this.rows.getRow(i);e+=r.height}return new n.SizeF(t,e)},t.prototype.drawGrid=function(e,t,i,r){this.initialWidth=e.graphics.clientSize.width;var a=new n.RectangleF(0,0,e.getClientSize().height,0);return this.draw(e,a,r)},t.prototype.layout=function(e){if(0!==this.rows.count){var t=this.rows.getRow(0).cells.getCell(0).style;if(1!==t.borders.left.width){var i=t.borders.left.width/2,a=t.borders.top.width/2;if(e.bounds.x===r.b.default.right.width/2&&e.bounds.y===r.b.default.right.width/2){var s=new n.RectangleF(new n.PointF(i,a),new n.SizeF(this.size.width,this.size.height));e.bounds=s}}}return this.setSpan(),this.layouter=new r.g(this),this.layouter.layoutInternal(e)},t.prototype.onBeginCellDraw=function(e){this.raiseBeginCellDraw&&this.beginCellDraw(this,e)},t.prototype.onEndCellDraw=function(e){this.raiseEndCellDraw&&this.endCellDraw(this,e)},t.prototype.setSpan=function(){for(var e=1,t=1,i=0,r=0,n=0,a=this.headers.count,s=0;s<a;s++){var o=this.headers.getHeader(s);n=0;for(var l=o.cells.count,d=0;d<l;d++){var h=o.cells.getCell(d);if(n=Math.max(n,h.rowSpan),!h.isCellMergeContinue&&!h.isRowMergeContinue&&(h.columnSpan>1||h.rowSpan>1)){if(h.columnSpan+d>o.cells.count)throw new Error("Invalid span specified at row "+d.toString()+" column "+s.toString());if(h.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+d.toString()+" column "+s.toString());if(h.columnSpan>1&&h.rowSpan>1){for(e=h.columnSpan,t=h.rowSpan,i=d,r=s,h.isCellMergeStart=!0,h.isRowMergeStart=!0;e>1;)i++,o.cells.getCell(i).isCellMergeContinue=!0,o.cells.getCell(i).isRowMergeContinue=!0,o.cells.getCell(i).rowSpan=t,e--;for(i=d,e=h.columnSpan;t>1;){for(r++,this.headers.getHeader(r).cells.getCell(d).isRowMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,t--;e>1;)i++,this.headers.getHeader(r).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,e--;e=h.columnSpan,i=d}}else if(h.columnSpan>1&&1===h.rowSpan){e=h.columnSpan,i=d,h.isCellMergeStart=!0;for(var p=this.columns.columns[i].width;e>1;)i++,o.cells.getCell(i).isCellMergeContinue=!0,e--,p+=this.columns.columns[i].width;h.width=p}else if(1===h.columnSpan&&h.rowSpan>1)for(t=h.rowSpan,r=s;t>1;)r++,this.headers.getHeader(r).cells.getCell(d).isRowMergeContinue=!0,t--}}o.maximumRowSpan=n}e=t=1,i=r=0,a=this.rows.count;for(var s=0;s<a;s++)for(var o=this.rows.getRow(s),u=o.cells.count,d=0;d<u;d++){var h=o.cells.getCell(d);if(!h.isCellMergeContinue&&!h.isRowMergeContinue&&(h.columnSpan>1||h.rowSpan>1)){if(h.columnSpan+d>o.cells.count)throw new Error("Invalid span specified at row {0} column {1} "+d.toString());if(h.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row {0} column {1} "+d.toString());if(h.columnSpan>1&&h.rowSpan>1){for(e=h.columnSpan,t=h.rowSpan,i=d,r=s,h.isCellMergeStart=!0,h.isRowMergeStart=!0;e>1;)i++,o.cells.getCell(i).isCellMergeContinue=!0,e--;for(i=d,e=h.columnSpan;t>1;){for(r++,this.rows.getRow(r).cells.getCell(d).isRowMergeContinue=!0,t--;e>1;)i++,this.rows.getRow(r).cells.getCell(i).isCellMergeContinue=!0,e--;e=h.columnSpan,i=d}}else if(h.columnSpan>1&&1===h.rowSpan)for(e=h.columnSpan,i=d,h.isCellMergeStart=!0;e>1;)i++,o.cells.getCell(i).isCellMergeContinue=!0,e--;else if(1===h.columnSpan&&h.rowSpan>1)for(t=h.rowSpan,r=s;t>1;)r++,this.rows.getRow(r).cells.getCell(d).isRowMergeContinue=!0,t--}}},t}(n.PdfLayoutElement)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.allowEditing=!0,this.allowReordering=!0,this.allowResizing=!0,this.allowSorting=!0,this.allowFiltering=!0,this.edit={},i.i(r.merge)(this,e)}return e}())},function(e,t){e.exports=l},function(e,t){e.exports=d},function(e,t,i){"use strict";var r=i(15);i.d(t,"a",function(){return r.a}),i.d(t,"b",function(){return r.b}),i.d(t,"c",function(){return r.c}),i.d(t,"d",function(){return r.d}),i.d(t,"e",function(){return r.e}),i.d(t,"f",function(){return r.f}),i.d(t,"g",function(){return r.g}),i.d(t,"h",function(){return r.h}),i.d(t,"i",function(){return r.i}),i.d(t,"j",function(){return r.j}),i.d(t,"k",function(){return r.k}),i.d(t,"l",function(){return r.l}),i.d(t,"m",function(){return r.m}),i.d(t,"n",function(){return r.n}),i.d(t,"o",function(){return r.o}),i.d(t,"p",function(){return r.p}),i.d(t,"q",function(){return r.q}),i.d(t,"r",function(){return r.r}),i.d(t,"s",function(){return r.s});var n=i(23);i.d(t,"t",function(){return n.a}),i.d(t,"u",function(){return n.b}),i.d(t,"v",function(){return n.c}),i.d(t,"w",function(){return n.d}),i.d(t,"x",function(){return n.e}),i.d(t,"y",function(){return n.f}),i.d(t,"z",function(){return n.g}),i.d(t,"A",function(){return n.h}),i.d(t,"B",function(){return n.i}),i.d(t,"C",function(){return n.j}),i.d(t,"D",function(){return n.k}),i.d(t,"E",function(){return n.l}),i.d(t,"F",function(){return n.m}),i.d(t,"G",function(){return n.n}),i.d(t,"H",function(){return n.o}),i.d(t,"I",function(){return n.p});var a=i(8);i.d(t,"J",function(){return a.a}),i.d(t,"K",function(){return a.b}),i.d(t,"L",function(){return a.c}),i.d(t,"M",function(){return a.d}),i.d(t,"N",function(){return a.e}),i.d(t,"O",function(){return a.f}),i.d(t,"P",function(){return a.g}),i.d(t,"Q",function(){return a.h}),i.d(t,"R",function(){return a.i}),i.d(t,"S",function(){return a.j}),i.d(t,"T",function(){return a.k}),i.d(t,"U",function(){return a.l}),i.d(t,"V",function(){return a.m}),i.d(t,"W",function(){return a.n}),i.d(t,"X",function(){return a.o}),i.d(t,"Y",function(){return a.p}),i.d(t,"Z",function(){return a.q}),i.d(t,"_0",function(){return a.r}),i.d(t,"_1",function(){return a.s}),i.d(t,"_2",function(){return a.t});var s=i(7);i.d(t,"_3",function(){return s.a}),i.d(t,"_4",function(){return s.b}),i.d(t,"_5",function(){return s.c}),i.d(t,"_6",function(){return s.d}),i.d(t,"_7",function(){return s.e}),i.d(t,"_8",function(){return s.f}),i.d(t,"_9",function(){return s.g}),i.d(t,"_10",function(){return s.h}),i.d(t,"_11",function(){return s.i}),i.d(t,"_12",function(){return s.j}),i.d(t,"_13",function(){return s.k}),i.d(t,"_14",function(){return s.l}),i.d(t,"_15",function(){return s.m}),i.d(t,"_16",function(){return s.n}),i.d(t,"_17",function(){return s.o}),i.d(t,"_18",function(){return s.p})},function(e,t,i){"use strict";var r=i(34);i.d(t,"a",function(){return r.a});var n=i(27);i.d(t,"b",function(){return n.a});var a=i(28);i.d(t,"c",function(){return a.a});var s=i(36);i.d(t,"d",function(){return s.a});var o=i(41);i.d(t,"e",function(){return o.a});var l=i(14);i.d(t,"f",function(){return l.a});var d=i(40);i.d(t,"g",function(){return d.a});var h=i(43);i.d(t,"h",function(){return h.a});var p=i(32);i.d(t,"i",function(){return p.a});var u=i(31);i.d(t,"j",function(){return u.a});var c=i(30);i.d(t,"k",function(){return c.a});var g=i(35);i.d(t,"l",function(){return g.a});var f=i(26);i.d(t,"m",function(){return f.a});var m=i(39);i.d(t,"n",function(){return m.a});var y=i(38);i.d(t,"o",function(){return y.a});var D=i(44);i.d(t,"p",function(){return D.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),i(6)),a=(i.n(n),i(4)),s=(i.n(a),function(){function e(e){this.isCellEdit=!1,this.isResourceCellEdited=!1,this.parent=e,this.bindTreeGridProperties()}return e.prototype.bindTreeGridProperties=function(){this.parent.treeGrid.editSettings.allowEditing=this.parent.editSettings.allowEditing,this.parent.treeGrid.editSettings.allowNextRowEdit=this.parent.editSettings.allowNextRowEdit,this.parent.treeGrid.editSettings.mode="Cell",this.parent.treeGrid.cellEdit=this.ensureEditCell.bind(this),this.parent.editSettings.allowEditing&&n.TreeGrid.Inject(n.Edit)},e.prototype.ensureEditCell=function(e){var t=this,n=e.rowData,s=e.columnName;this.editedColumn=this.parent.getColumnByField(s,this.parent.ganttColumns);var o=this.parent.taskFields;if(this.parent.readOnly)return void(e.cancel=!0);if("Dialog"===this.parent.editSettings.mode)return void(e.cancel=!0);if(!n.hasChildRecords||this.parent.allowParentDependency||(s!==o.endDate||(i.i(r.isNullOrUndefined)(n.isManual)||!1!==n.isManual)&&"Auto"!==this.parent.taskMode)&&s!==o.duration&&s!==o.dependency&&s!==o.progress&&s!==o.work&&"taskType"!==s){var l=new a.Deferred;return this.parent.trigger("cellEdit",e,function(e){0===n.level&&"ResourceView"===t.parent.viewType&&(e.cancel=!0),l.resolve(e),e.cancel||(e.columnName===t.parent.taskFields.notes?t.openNotesEditor(e):(t.isCellEdit=!0,i.i(r.isNullOrUndefined)(t.parent.toolbarModule)||t.parent.toolbarModule.refreshToolbarItems()))}),l}(s===o.dependency&&!this.parent.allowParentDependency||s!==o.dependency)&&(e.cancel=!0)},e.prototype.openNotesEditor=function(e){var t=this.parent.taskFields,i=e.rowData,r=e.columnName;if(r===t.notes&&!this.parent.showInlineNotes){e.cancel=!0;var n=this.parent.editModule.dialogModule.updatedEditFields.map(function(e){return e.type}),a=n.indexOf("Notes");if(-1!==a){this.parent.editModule.dialogModule.openEditDialog(i.ganttProperties.rowUniqueID);document.getElementById(this.parent.element.id+"_Tab").ej2_instances[0].selectedItem=a}}r===t.notes&&!0===this.parent.showInlineNotes&&(this.isCellEdit=!0)},e.prototype.isValueChange=function(e,t){var n=i.i(r.getValue)("data",e),a=n[""+t],s=i.i(r.getValue)("previousData",e);if(i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(s)||!i.i(r.isNullOrUndefined)(a)&&i.i(r.isNullOrUndefined)(s))return!0;if(!i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(s)){if(a instanceof Date)return a.getTime()!==n.taskData[t].getTime();if(t===this.parent.taskFields.resourceInfo)return a!==s;if(a!==n.taskData[t])return!0}return!1},e.prototype.initiateCellEdit=function(e,t){var n=i.i(r.getValue)("column",e),a=i.i(r.getValue)("data",e),s={};s.action="CellEditing",s.data=this.parent.getTaskByUniqueID(a.uniqueID);var o=i.i(r.getValue)("previousData",e),l=this.parent.allowUnscheduledTasks?a[n.field]:!i.i(r.isNullOrUndefined)(a[n.field])&&""!==a[n.field]||this.parent.taskFields.duration!==n.field&&this.parent.taskFields.startDate!==n.field&&this.parent.taskFields.endDate!==n.field?a[n.field]:o;i.i(r.isNullOrUndefined)(a)?this.parent.editModule.endEditAction(e):(a[n.field]=o,s.data[n.field]=o,this.parent.initiateEditAction(!0),this.parent.setRecordValue(n.field,l,s.data),n.field===this.parent.taskFields.name?this.taskNameEdited(s):n.field===this.parent.taskFields.startDate?this.startDateEdited(s):n.field===this.parent.taskFields.endDate?this.endDateEdited(s):n.field===this.parent.taskFields.duration?this.durationEdited(s):n.field===this.parent.taskFields.resourceInfo?this.resourceEdited(s,t,a):n.field===this.parent.taskFields.progress?this.progressEdited(s):n.field===this.parent.taskFields.baselineStartDate||n.field===this.parent.taskFields.baselineEndDate?this.baselineEdited(s):n.field===this.parent.taskFields.dependency?this.dependencyEdited(s,o):n.field===this.parent.taskFields.notes?this.notedEdited(s):n.field===this.parent.taskFields.work?this.workEdited(s):"taskType"!==n.field||i.i(r.isNullOrUndefined)(this.parent.taskFields.work)?n.field===this.parent.taskFields.manual?this.taskmodeEdited(s):(this.parent.setRecordValue("taskData."+n.field,s.data[n.field],s.data),this.parent.editModule.initiateSaveAction(s)):this.typeEdited(s,t)),this.isCellEdit=!1,i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule.editedColumn)||(this.parent.editModule.cellEditModule.editedColumn=null),i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.taskNameEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.name,e.data[this.parent.taskFields.name],e.data),this.parent.setRecordValue("taskName",e.data[this.parent.taskFields.name],e.data.ganttProperties,!0),this.updateEditedRecord(e)},e.prototype.notedEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.notes,e.data[this.parent.taskFields.notes],e.data),this.parent.setRecordValue("notes",e.data[this.parent.taskFields.notes],e.data.ganttProperties,!0),this.updateEditedRecord(e)},e.prototype.taskmodeEdited=function(e){this.parent.setRecordValue("isAutoSchedule",!e.data[this.parent.taskFields.manual],e.data.ganttProperties,!0),this.parent.editModule.updateTaskScheduleModes(e.data),this.updateEditedRecord(e)},e.prototype.startDateEdited=function(e){var t=e.data,n=e.data.ganttProperties,a=e.data[this.parent.taskFields.startDate];a=a?new Date(a.getTime()):null,a=this.parent.dateValidationModule.checkStartDate(a,t.ganttProperties,t.ganttProperties.isMilestone),i.i(r.isNullOrUndefined)(a)?t.hasChildRecords||(this.parent.setRecordValue("startDate",null,n,!0),this.parent.setRecordValue("duration",null,n,!0),this.parent.setRecordValue("isMilestone",!1,n,!0),this.parent.allowUnscheduledTasks&&i.i(r.isNullOrUndefined)(this.parent.taskFields.endDate)&&this.parent.setRecordValue("endDate",null,n,!0)):n.endDate||!i.i(r.isNullOrUndefined)(n.duration)?(this.parent.setRecordValue("startDate",new Date(a.getTime()),n,!0),this.parent.dateValidationModule.calculateEndDate(t)):i.i(r.isNullOrUndefined)(n.endDate)&&i.i(r.isNullOrUndefined)(n.duration)&&this.parent.setRecordValue("startDate",new Date(a.getTime()),n,!0),this.parent.setRecordValue("isMilestone",0===n.duration,n,!0),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(t,"startDate"),this.parent.dataOperation.updateMappingData(t,"endDate"),this.parent.dataOperation.updateMappingData(t,"duration"),this.updateEditedRecord(e)},e.prototype.validateEndDateWithSegments=function(e){for(var t=[],n=e.segments,a=0;a<n.length;a++){var s=n[parseInt(a.toString(),10)],o=s.endDate;o=!i.i(r.isNullOrUndefined)(e.endDate)&&o.getTime()<e.endDate.getTime()&&a!==n.length-1?o:e.endDate,s.duration=this.parent.dataOperation.getDuration(s.startDate,o,e.durationUnit,e.isAutoSchedule,e.isMilestone),n.length>0&&o.getTime()<s.startDate.getTime()&&o.getTime()<=e.endDate.getTime()?n[a-1].duration=this.parent.dataOperation.getDuration(n[a-1].startDate,e.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone):t.push(s)}return t},e.prototype.endDateEdited=function(e){var t=e.data.ganttProperties,n=e.data[this.parent.taskFields.endDate];n=n?new Date(n.getTime()):null,i.i(r.isNullOrUndefined)(n)?(this.parent.setRecordValue("endDate",n,t,!0),this.parent.setRecordValue("duration",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0)):(0===n.getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,n),n=this.parent.dateValidationModule.checkEndDate(n,t),this.parent.setRecordValue("endDate",n,t,!0),!i.i(r.isNullOrUndefined)(t.startDate)&&i.i(r.isNullOrUndefined)(t.duration)?-1===this.parent.dateValidationModule.compareDates(t.endDate,t.startDate)&&(this.parent.setRecordValue("endDate",new Date(t.startDate.getTime()),t,!0),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,t.endDate)):!i.i(r.isNullOrUndefined)(t.duration)&&i.i(r.isNullOrUndefined)(t.startDate)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(t.endDate,t.duration,t.durationUnit,t),t,!0),i.i(r.isNullOrUndefined)(t.segments)||(t.segments=this.validateEndDateWithSegments(t)),-1===this.compareDatesFromRecord(t)?this.parent.dateValidationModule.calculateDuration(e.data):this.parent.editModule.revertCellEdit(e),this.parent.setRecordValue("isMilestone",0===t.duration,t,!0),t.isMilestone&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(t.startDate,t),t,!0)),!i.i(r.isNullOrUndefined)(e.data.ganttProperties.segments)&&e.data.ganttProperties.segments.length>0&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),e.data.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"startDate"),this.parent.dataOperation.updateMappingData(e.data,"endDate"),this.parent.dataOperation.updateMappingData(e.data,"duration"),this.parent.editModule.updateResourceRelatedFields(e.data,"endDate"),this.updateEditedRecord(e)},e.prototype.durationEdited=function(e){parseInt(e.data[this.parent.taskFields.duration])<0&&(e.data[this.parent.taskFields.duration]=0);var t=e.data.ganttProperties,i=e.data[this.parent.taskFields.duration];this.parent.dataOperation.updateDurationValue(i,t),this.updateDates(e),this.parent.editModule.updateResourceRelatedFields(e.data,"duration"),this.updateEditedRecord(e)},e.prototype.updateDates=function(e){var t=e.data.ganttProperties,n=this.parent.dateValidationModule.getDateFromFormat(t.endDate),a=this.parent.dateValidationModule.getDateFromFormat(t.startDate),s=t.duration;i.i(r.isNullOrUndefined)(s)?(this.parent.setRecordValue("isMilestone",!1,t,!0),null!=e.data[this.parent.taskFields.duration]&&this.parent.setRecordValue("endDate",null,t,!0)):(i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(n)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(n,s,t.durationUnit,t),t,!0),0!==s&&t.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,t,!0),this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(t.startDate,t),t,!0)),!i.i(r.isNullOrUndefined)(t.segments)&&t.segments.length>0&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),t,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),this.parent.setRecordValue("isMilestone",0===t.duration,t,!0),this.parent.dateValidationModule.calculateEndDate(e.data)),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"endDate"),this.parent.dataOperation.updateMappingData(e.data,"startDate"),this.parent.dataOperation.updateMappingData(e.data,"duration")},e.prototype.progressEdited=function(e){var t=e.data;if(this.parent.setRecordValue("progress",t[this.parent.taskFields.progress]>100?100:t[this.parent.taskFields.progress],t.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.progress,t[this.parent.taskFields.progress]>100?100:t[this.parent.taskFields.progress],e.data),t.ganttProperties.isAutoSchedule||this.parent.setRecordValue("autoWidth",this.parent.dataOperation.calculateWidth(t,!1),t.ganttProperties,!0),!i.i(r.isNullOrUndefined)(e.data.ganttProperties.segments)&&e.data.ganttProperties.segments.length>0&&!i.i(r.isNullOrUndefined)(this.parent.editModule.taskbarEditModule)&&this.parent.editModule.taskbarEditModule.updateSegmentProgress(e.data.ganttProperties),!e.data.hasChildRecords){var n=t.ganttProperties.isAutoSchedule?t.ganttProperties.width:t.ganttProperties.autoWidth;this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(n,t.ganttProperties.progress),t.ganttProperties,!0)}this.updateEditedRecord(e)},e.prototype.baselineEdited=function(e){var t=e.data.ganttProperties,i=e.data[this.parent.taskFields.baselineStartDate],r=e.data[this.parent.taskFields.baselineEndDate];r&&0===r.getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,r),this.parent.setRecordValue("baselineStartDate",this.parent.dateValidationModule.checkBaselineStartDate(i),t,!0),this.parent.setRecordValue("baselineEndDate",this.parent.dateValidationModule.checkBaselineEndDate(r),t,!0),t.baselineStartDate&&t.baselineEndDate&&(this.parent.setRecordValue("baselineLeft",this.parent.dataOperation.calculateBaselineLeft(t),t,!0),this.parent.setRecordValue("baselineWidth",this.parent.dataOperation.calculateBaselineWidth(t),t,!0)),this.updateEditedRecord(e)},e.prototype.resourceEdited=function(e,t,n){var a=this.parent.resourceFields,s=t[this.parent.taskFields.resourceInfo];if(s){this.isResourceCellEdited=!0;for(var o=this.parent.dataOperation.setResourceInfo(t),l=o.length,d=n.ganttProperties.resourceInfo,h=void 0,p=[],u=this.parent.resources,c=void 0,g=0;g<l;g++)!function(e){if(d){var t=d.length;for(c=0;c<t;c++){if(d[c][a.id]===s[e]){h=c;break}h=-1}}if(i.i(r.isNullOrUndefined)(h)||-1===h){var n=u.filter(function(t){return s[e]===t[a.id]}),o=i.i(r.extend)({},n[0]);o[a.unit]=100,p.push(o)}else p.push(d[parseInt(h.toString(),10)])}(g);e.data.ganttProperties.resourceInfo=p,this.parent.dataOperation.updateMappingData(e.data,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(e.data,"resource"),"ResourceView"===this.parent.viewType&&(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=d),this.updateDates(e),this.updateEditedRecord(e)}},e.prototype.dependencyEdited=function(e,t){this.parent.predecessorModule.updateUnscheduledDependency(e.data),this.parent.connectorLineEditModule.updatePredecessor(e.data,e.data[this.parent.taskFields.dependency],e)||this.parent.editModule.revertCellEdit(t)},e.prototype.workEdited=function(e){var t=e.data.ganttProperties,i=e.data[this.parent.taskFields.work];this.parent.setRecordValue("work",i,t,!0),this.parent.editModule.updateResourceRelatedFields(e.data,"work"),this.updateDates(e),this.updateEditedRecord(e)},e.prototype.typeEdited=function(e,t){var i=e.data.ganttProperties,r=t.taskType;this.parent.setRecordValue("taskType",r,i,!0),this.updateEditedRecord(e)},e.prototype.compareDatesFromRecord=function(e){var t=this.parent.dateValidationModule.getValidStartDate(e),i=this.parent.dateValidationModule.getValidEndDate(e);return this.parent.dateValidationModule.compareDates(t,i)},e.prototype.updateEditedRecord=function(e){this.parent.editModule.initiateUpdateAction(e)},e.prototype.destroy=function(){this.parent.editModule.cellEditModule=void 0},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.previousScroll={top:0,left:0},this.parent=e,this.element=this.parent.ganttChartModule.scrollElement,this.addEventListeners()}return e.prototype.addEventListeners=function(){this.parent.on("grid-scroll",this.gridScrollHandler,this),r.EventHandler.add(this.element,"scroll",this.onScroll,this),this.parent.treeGrid.grid.on("showGanttShimmer",this.updateShimmer,this),this.parent.treeGrid.grid.on("removeGanttShimmer",this.removeShimmer,this)},e.prototype.removeEventListeners=function(){r.EventHandler.remove(this.element,"scroll",this.onScroll),this.parent.off("grid-scroll",this.gridScrollHandler),this.parent.treeGrid.grid.off("showGanttShimmer",this.updateShimmer),this.parent.treeGrid.grid.off("removeGanttShimmer",this.removeShimmer)},e.prototype.gridScrollHandler=function(e){this.element.scrollTop=i.i(r.getValue)("top",e),this.isFromTreeGrid=!0},e.prototype.updateTopPosition=function(){var e,t=this.parent.treeGrid.element.querySelector(".e-content"),n=t.scrollTop;if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){e=n-this.parent.virtualScrollModule.getTopPosition()}else e=n;if(!i.i(r.isNullOrUndefined)(this.parent.dayMarkersModule)){var a=i.i(r.getValue)("nonworkingDayRender.holidayContainer",this.parent.dayMarkersModule),s=i.i(r.getValue)("nonworkingDayRender.weekendContainer",this.parent.dayMarkersModule),o=i.i(r.getValue)("eventMarkerRender.eventMarkersContainer",this.parent.dayMarkersModule);a&&(a.style.top=i.i(r.formatUnit)(e)),s&&(s.style.top=i.i(r.formatUnit)(e)),o&&(o.style.top=i.i(r.formatUnit)(e))}this.parent.chartVerticalLineContainer&&(this.parent.chartVerticalLineContainer.style.top=i.i(r.formatUnit)(e))},e.prototype.removeShimmer=function(){var e=this.parent;setTimeout(function(){if(e.hideMaskRow(),"ResourceView"===e.viewType&&!e.allowTaskbarOverlap&&e.showOverAllocation){for(var t=0;t<e.currentViewData.length;t++){var i=e.chartRowsModule.ganttChartTableBody.childNodes[t];"none"!==i.style.display&&e.currentViewData[t].hasChildRecords&&!e.currentViewData[t].expanded&&(e.treeGrid.getRowByIndex(t).style.height=i.style.height)}e.contentHeight=e.enableRtl?e.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:e.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=e.contentHeight+"px"}},0)},e.prototype.updateShimmer=function(){var e=this.parent;setTimeout(function(){e.showMaskRow()},0)},e.prototype.updateSpinner=function(){var e=this.parent;this.parent.showSpinner(),window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(function(){e.hideSpinner()},200)},e.prototype.onScroll=function(){var e={};this.element.scrollTop!==this.previousScroll.top&&(this.isFromTreeGrid?this.isFromTreeGrid=!1:this.parent.notify("chartScroll",{top:this.element.scrollTop}),e.previousScrollTop=this.previousScroll.top,this.previousScroll.top=this.element.scrollTop,e.scrollTop=this.element.scrollTop,e.scrollDirection="Vertical",e.action="VerticalScroll",this.updateTopPosition()),this.element.scrollLeft!==this.previousScroll.left&&(this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,e.previousScrollLeft=this.previousScroll.left,this.previousScroll.left=this.element.scrollLeft,e.scrollLeft=this.element.scrollLeft,e.scrollDirection="Horizontal",e.action="HorizontalScroll"),"Horizontal"===e.scrollDirection||i.i(r.isNullOrUndefined)(e.scrollDirection)||!0!==this.parent.enableVirtualization||!this.parent.isToolBarClick&&!i.i(r.isNullOrUndefined)(this.parent.isToolBarClick)||(this.parent.isVirtualScroll=!0,(this.parent.showIndicator||i.i(r.isNullOrUndefined)(this.parent.showIndicator))&&!this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization&&"Spinner"===this.parent.loadingIndicator.indicatorType&&this.updateSpinner()),this.parent.isToolBarClick=!0,e.requestType="scroll",this.parent.trigger("actionComplete",e)},e.prototype.setHeight=function(e){this.element.style.height=i.i(r.formatUnit)(e)},e.prototype.setWidth=function(e){this.element.style.width=i.i(r.formatUnit)(e)},e.prototype.setScrollTop=function(e){this.element.scrollTop=e,this.parent.treeGrid.element.querySelector(".e-content").scrollTop=e},e.prototype.setScrollLeft=function(e,t){t&&(e=-1===t&&this.parent.enableRtl?-e:e),this.element.scrollLeft=e,this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,this.previousScroll.left=this.element.scrollLeft},e.prototype.destroy=function(){this.removeEventListeners()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(6),n=(i.n(r),function(){function e(e){r.TreeGrid.Inject(r.ColumnMenu),this.parent=e}return e.prototype.getColumnMenu=function(){return this.parent.treeGrid.columnMenuModule.getColumnMenu()},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"columnMenu"},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(6),n=(i.n(r),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.Reorder),this.parent.treeGrid.allowReordering=this.parent.allowReordering,this.bindEvents()}return e.prototype.getModuleName=function(){return"reorder"},e.prototype.bindEvents=function(){var e=this;this.parent.treeGrid.columnDragStart=function(t){e.parent.trigger("columnDragStart",t)},this.parent.treeGrid.columnDrag=function(t){e.parent.trigger("columnDrag",t)},this.parent.treeGrid.columnDrop=function(t){e.parent.trigger("columnDrop",t)}},e.prototype.destroy=function(){},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(6),n=(i.n(r),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.Resize),this.parent.treeGrid.allowResizing=this.parent.allowResizing,this.bindEvents()}return e.prototype.getModuleName=function(){return"resize"},e.prototype.bindEvents=function(){var e=this;this.parent.treeGrid.resizeStart=function(t){e.parent.trigger("resizeStart",t)},this.parent.treeGrid.resizing=function(t){e.parent.trigger("resizing",t)},this.parent.treeGrid.resizeStop=function(t){e.parent.trigger("resizeStop",t)}},e.prototype.destroy=function(){},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(3)),a=i(1),s=i(9),o=(i.n(s),function(){function e(e){this.validationPredecessor=null,this.confirmPredecessorDialog=null,this.predecessorIndex=null,this.childRecord=null,this.parent=e,this.dateValidateModule=this.parent.dateValidationModule,this.parent.on("initPredessorDialog",this.initPredecessorValidationDialog,this)}return e.prototype.updateConnectorLineEditElement=function(e){var t=this.getConnectorLineHoverElement(e.target);i.i(r.getValue)("editModule.taskbarEditModule.taskBarEditAction",this.parent)||this.highlightConnectorLineElements(t)},e.prototype.getConnectorLineHoverElement=function(e){var t=i.i(a.j)(e,n._9),r=i.i(a.j)(e,n._10),s=i.i(a.j)(e,n.r),o=i.i(a.j)(e,n.s);return t||r||s||o?i.i(a.j)(e,n.V):null},e.prototype.highlightConnectorLineElements=function(e){e?e!==this.connectorLineElement&&(this.removeHighlight(),this.addHighlight(e)):this.removeHighlight()},e.prototype.addHighlight=function(e){this.connectorLineElement=e;var t=e.querySelector("."+n._9),i=e.querySelector("."+n.r);t?t.setAttribute("stroke-width","2"):i.setAttribute("stroke-width","2")},e.prototype.removeHighlight=function(){if(this.connectorLineElement){var e=this.connectorLineElement.querySelector("."+n._9),t=this.connectorLineElement.querySelector("."+n.r);e?e.setAttribute("stroke-width","1"):t.setAttribute("stroke-width","1"),this.connectorLineElement=null}},e.prototype.getEditedConnectorLineString=function(e){for(var t,n,a,s,o,l,d=[],h=[],p="",u=0;u<e.length;u++)if(t=e[u],n=t.ganttProperties.predecessor){for(var c=0;c<n.length;c++){a=n[c];if(this.parent.connectorLineModule.removeConnectorLineById("parent"+a.from+"child"+a.to),s=this.parent.connectorLineModule.getRecordByID(a.from),o=this.parent.connectorLineModule.getRecordByID(a.to),(!this.parent.allowParentDependency&&s&&!0===s.expanded||o&&!0===o.expanded||this.parent.allowParentDependency&&(s||o))&&(l=this.parent.predecessorModule.updateConnectorLineObject(s,o,a),!i.i(r.isNullOrUndefined)(l))){var g=d.indexOf(l.connectorLineId),f=this.parent.connectorLineModule.getConnectorLineTemplate(l);-1!==g?h[g]=f:(d.push(l.connectorLineId),h.push(f))}}p=h.join("")}return p},e.prototype.refreshEditedRecordConnectorLine=function(e){this.parent.connectorLineModule.removePreviousConnectorLines(this.parent.previousRecords),this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.getExpandedRecords(this.parent.updatedRecords);var t=this.getEditedConnectorLineString(e);this.parent.connectorLineModule.svgObject.innerHTML=this.parent.connectorLineModule.svgObject.innerHTML+t},e.prototype.idFromPredecessor=function(e){for(var t,n=e.split(","),a=[],s=[],o=0;o<n.length;o++){var l=[];if(t=n[o].split("+"),"+",n[o].indexOf("-")>=0&&(t=n[o].split("-"),"-"),!i.i(r.isNullOrUndefined)(t[0])){-1===("ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids).indexOf(t[0])?-1!==t[0].indexOf(" ")?(s=t[0].split(" "),1===s.length&&(s=t[0].match(/(\d+|[A-z]+)/g)),l.push(s[0])):1===t[0].length||2===t[0].length?l.push(t[0]):l.push(t[0].slice(0,-2)):l.push(t[0])}a.push(l.join(""))}return a},e.prototype.predecessorValidation=function(e,t){for(var n,a,s=t.rowUniqueID,o=0;o<e.length;o++){n=e[o];var l=[];e.slice(0).splice(o,1);for(var d=this;null!==n;){var h=function(){var e=[];return-1!==l.indexOf(n)?"break":i.i(r.isNullOrUndefined)(d.parent.connectorLineModule.getRecordByID(n))?{value:!1}:(a=d.parent.connectorLineModule.getRecordByID(n).ganttProperties,!i.i(r.isNullOrUndefined)(a.predecessor)&&a.predecessor.length>0&&a.predecessor.forEach(function(t){a.rowUniqueID.toString()!==t.from&&e.push(t.from.toString())}),s.toString()===a.rowUniqueID.toString()||-1!==e.indexOf(s.toString())?{value:!1}:(l.push(n),!i.i(r.isNullOrUndefined)(a.predecessor)&&a.predecessor.length>0?void(n=a.predecessor[0].from):"break"))}();if("object"==typeof h)return h.value;if("break"===h)break}}return!0},e.prototype.getRootParent=function(e){var t=e;return e.parentItem?(t=this.parent.flatData.filter(function(t){return t.uniqueID===e.parentUniqueID})[0],t.parentItem&&(t=this.getRootParent(t)),t):t},e.prototype.validateParentPredecessor=function(e,t){if(t.hasChildRecords&&!e.hasChildRecords){if(e.parentUniqueID===t.uniqueID)return!1;do{if(e.parentItem&&(e=this.parent.flatData[this.parent.ids.indexOf(e.parentItem.taskId)],e.uniqueID===t.uniqueID))return!1}while(e.parentItem)}else if(!t.hasChildRecords&&e.hasChildRecords){if(t.parentUniqueID===e.uniqueID)return!1;do{if(t.parentItem&&(t=this.parent.flatData[this.parent.ids.indexOf(t.parentItem.taskId)],t.uniqueID===e.uniqueID))return!1}while(t.parentItem)}else if(t.hasChildRecords&&e.hasChildRecords)if(t.parentItem&&e.parentItem){if(e.parentUniqueID===t.uniqueID||e.uniqueID===t.parentUniqueID)return!1}else if(!t.parentItem&&e.parentItem){var i=this.parent.connectorLineEditModule.getRootParent(e);if(i.uniqueID===t.uniqueID)return!1}else if(t.parentItem&&!e.parentItem){var r=this.parent.connectorLineEditModule.getRootParent(t);if(r.uniqueID===e.uniqueID)return!1}return!0},e.prototype.validatePredecessorRelation=function(e,t){var n,a,s=!0,o="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(!i.i(r.isNullOrUndefined)(t)&&t.length>0){n=this.idFromPredecessor(t);for(var l=this,d=0;d<n.length;d++){var h=function(t){if(l.parent.allowParentDependency){if(parseInt(n[n.length-1])!==e[l.parent.taskFields.id]){var d=l.parent.ids.indexOf(n[n.length-1]),h=l.parent.currentViewData[d];h&&e&&(s=l.validateParentPredecessor(h,e))}}else{if(!l.checkParentRelation(e,n))return{value:!1}}var p=n.slice(0),u=[],c=!0;if(p.forEach(function(e){-1===u.indexOf(e)?u.push(e):c=!1}),!c)return{value:!1};a=n[t];var g=[];n.slice(0).splice(t,1);for(;null!==a;){var f=function(){var t,n,s=[];if(-1!==g.indexOf(a))return"break";if(i.i(r.isNullOrUndefined)(l.parent.connectorLineModule.getRecordByID(a.toString())))return{value:!1};if(n=l.parent.connectorLineModule.getRecordByID(a.toString()).ganttProperties,!i.i(r.isNullOrUndefined)(n.predecessor)&&n.predecessor.length>0&&n.predecessor.forEach(function(e,i){n.rowUniqueID.toString()!==e.from&&(s.push(e.from.toString()),t=i)}),o.toString()===n.rowUniqueID.toString()||-1!==s.indexOf(o.toString()))return{value:!1};if(g.push(a),i.i(r.isNullOrUndefined)(n.predecessor)||!(n.predecessor.length>0))return"break";var d=void 0;return s.length>1?d=l.predecessorValidation(s,e.ganttProperties):1===s.length&&(a=n.predecessor[t].from),!1===d?{value:!1}:void 0}();if("object"==typeof f)return f;if("break"===f)break}}(d);if("object"==typeof h)return h.value}}return s},e.prototype.addPredecessor=function(e,t){var n=i.i(r.isNullOrUndefined)(e.ganttProperties.predecessorsName)||""===e.ganttProperties.predecessorsName?t:e.ganttProperties.predecessorsName+","+t;this.updatePredecessorHelper(e,n)},e.prototype.removePredecessor=function(e){this.updatePredecessorHelper(e,null)},e.prototype.updatePredecessor=function(e,t,i){return this.updatePredecessorHelper(e,t,i)},e.prototype.updatePredecessorHelper=function(e,t,n){if(i.i(r.isUndefined)(t)||this.validatePredecessorRelation(e,t)){this.parent.isOnEdit=!0;var a=[];i.i(r.isNullOrUndefined)(t)||""===t||(a=this.parent.predecessorModule.calculatePredecessor(t,e)),this.parent.setRecordValue("predecessor",a,e.ganttProperties,!0);var s=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",s,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,s,e),this.parent.setRecordValue(this.parent.taskFields.dependency,s,e);var o={};return o.action=n&&n.action&&"CellEditing"===n.action?n.action:"DrawConnectorLine",o.data=e,this.parent.editModule.initiateUpdateAction(o),!0}return!1},e.prototype.checkParentRelation=function(e,t){var i=e;if(i&&i.parentItem&&-1!==t.indexOf(i.parentItem.taskId.toString()))return!1;for(var r=this,n=0;n<t.length;n++){var a=function(e){var i=r.parent.currentViewData.filter(function(i){return i&&i.ganttProperties.rowUniqueID.toString()===t[e].toString()});if(i[0]&&i[0].hasChildRecords)return{value:!1}}(n);if("object"==typeof a)return a.value}return!0},e.prototype.initPredecessorValidationDialog=function(){if(this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation){var e=i.i(r.createElement)("div",{id:this.parent.element.id+"_dialogValidationRule"});this.parent.element.appendChild(e),this.renderValidationDialog()}},e.prototype.renderValidationDialog=function(){var e=new s.Dialog({header:"Validate Editing",isModal:!0,enableRtl:this.parent.enableRtl,visible:!1,width:"50%",showCloseIcon:!0,close:this.validationDialogClose.bind(this),content:"",buttons:[{click:this.validationDialogOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.validationDialogCancelButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});document.getElementById(this.parent.element.id+"_dialogValidationRule").innerHTML="",e.isStringTemplate=!0,e.appendTo("#"+this.parent.element.id+"_dialogValidationRule"),this.parent.validationDialogElement=e},e.prototype.validationDialogOkButton=function(){var e=this.parent.currentEditedArgs;e.validateMode.preserveLinkWithEditing=document.getElementById(this.parent.element.id+"_ValidationAddlineOffset").checked,e.validateMode.removeLink=document.getElementById(this.parent.element.id+"_ValidationRemoveline").checked,e.validateMode.respectLink=document.getElementById(this.parent.element.id+"_ValidationCancel").checked,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogCancelButton=function(){this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogClose=function(e){i.i(r.getValue)("isInteraction",e)&&(this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption())},e.prototype.applyPredecessorOption=function(){var e=this.parent.currentEditedArgs,t=e.data;e.validateMode.respectLink?(this.parent.editModule.reUpdatePreviousRecords(),this.parent.chartRowsModule.refreshRecords([e.data])):e.validateMode.removeLink?(this.checkChildRecords(t),this.parent.editModule.updateEditedTask(e.editEventArgs)):e.validateMode.preserveLinkWithEditing&&(this.parent.UpdateOffsetOnTaskbarEdit&&this.calculateOffset(t),this.parent.editModule.updateEditedTask(e.editEventArgs))},e.prototype.checkChildRecords=function(e){if(this.validationPredecessor=e.ganttProperties.predecessor,i.i(r.isNullOrUndefined)(this.validationPredecessor)||this.removePredecessors(e,this.validationPredecessor),e.childRecords.length>0)for(var t=0;t<e.childRecords.length;t++){var n=e.childRecords[t];this.validationPredecessor=n.ganttProperties.predecessor,i.i(r.isNullOrUndefined)(this.validationPredecessor)||this.removePredecessors(n,this.validationPredecessor),n.childRecords.length>0&&this.checkChildRecords(n)}else if(!i.i(r.isNullOrUndefined)(e.parentItem)){var a=this.parent.getRecordByID(e.parentItem.taskId);this.validationPredecessor=a.ganttProperties.predecessor,this.removePredecessors(a,this.validationPredecessor)}},e.prototype.calculateOffset=function(e){for(var t=i.i(r.extend)([],e.ganttProperties.predecessor,[],!0),n=this.parent.predecessorModule.getValidPredecessor(e),s=0;s<n.length;s++){var o=n[parseInt(s.toString(),10)],l=this.parent.connectorLineModule.getRecordByID(o.from),d=void 0;if(i.i(a.c)(l.ganttProperties)&&i.i(a.c)(e.ganttProperties)){var h=void 0,p=void 0,u=void 0,c=void 0;switch(o.type){case"FS":h=new Date(l.ganttProperties.endDate.getTime()),p=new Date(e.ganttProperties.startDate.getTime());break;case"SS":h=new Date(l.ganttProperties.startDate.getTime()),p=new Date(e.ganttProperties.startDate.getTime());break;case"SF":h=new Date(l.ganttProperties.startDate.getTime()),p=new Date(e.ganttProperties.endDate.getTime());break;case"FF":h=new Date(l.ganttProperties.endDate.getTime()),p=new Date(e.ganttProperties.endDate.getTime())}if(h.getTime()<p.getTime())h=this.dateValidateModule.checkStartDate(h),p=this.dateValidateModule.checkEndDate(p,null),c=!1;else{var g=new Date(h.getTime());h=this.dateValidateModule.checkStartDate(p),p=this.dateValidateModule.checkEndDate(g,null),c=!0}h.getTime()<p.getTime()?(u=this.dateValidateModule.getDuration(h,p,o.offsetUnit,!0,!1),d=c?-1*u:u):d=0}else d=0;t[i.i(a.h)(o,"from",t,"to")].offset=d;var f=i.i(r.extend)([],l.ganttProperties.predecessor,[],!0);f[i.i(a.h)(o,"from",f,"to")].offset=d,this.parent.setRecordValue("predecessor",f,l.ganttProperties,!0)}this.parent.setRecordValue("predecessor",t,e.ganttProperties,!0);var m=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,m,e),this.parent.setRecordValue(this.parent.taskFields.dependency,m,e),this.parent.setRecordValue("predecessorsName",m,e.ganttProperties,!0)},e.prototype.removePredecessors=function(e,t){var n=i.i(r.extend)([],[],e.ganttProperties.predecessor,!0);if(!i.i(r.isNullOrUndefined)(t)){for(var s=t.length,o=0;o<s;o++){var l=this.parent.connectorLineModule.getRecordByID(t[o].from),d=i.i(r.extend)([],[],l.ganttProperties.predecessor,!0),h=i.i(a.h)(t[o],"from",n,"to");n.splice(h,1);var p=i.i(a.h)(t[parseInt(o.toString(),10)],"from",d,"to");d.splice(p,1),this.parent.setRecordValue("predecessor",d,l.ganttProperties,!0)}if(n.length!==e.ganttProperties.predecessor.length){this.parent.setRecordValue("predecessor",n,e.ganttProperties,!0);var u=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",u,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,u,e),this.parent.setRecordValue(this.parent.taskFields.dependency,u,e)}}},e.prototype.openValidationDialog=function(e){var t=this.validationDialogTemplate(e);this.parent.validationDialogElement.setProperties({content:t}),this.parent.validationDialogElement.show()},e.prototype.validationDialogTemplate=function(e){var t,n=this.parent.element.id,s=i.i(r.createElement)("div",{className:"e-ValidationContent"}),o=i.i(r.getValue)("task",e),l=i.i(r.getValue)("parentTask",e),d=i.i(r.getValue)("violationType",e),h=o.ganttProperties.taskName,p=this.parent.getFormatedDate(o.ganttProperties.startDate,"MM/dd/yyyy"),u=l.ganttProperties.taskName,c=[h,u];"taskBeforePredecessor_FS"===d?t=this.parent.localeObj.getConstant("taskBeforePredecessor_FS"):"taskAfterPredecessor_FS"===d?t=this.parent.localeObj.getConstant("taskAfterPredecessor_FS"):"taskBeforePredecessor_SS"===d?t=this.parent.localeObj.getConstant("taskBeforePredecessor_SS"):"taskAfterPredecessor_SS"===d?t=this.parent.localeObj.getConstant("taskAfterPredecessor_SS"):"taskBeforePredecessor_FF"===d?t=this.parent.localeObj.getConstant("taskBeforePredecessor_FF"):"taskAfterPredecessor_FF"===d?t=this.parent.localeObj.getConstant("taskAfterPredecessor_FF"):"taskBeforePredecessor_SF"===d?t=this.parent.localeObj.getConstant("taskBeforePredecessor_SF"):"taskAfterPredecessor_SF"===d&&(t=this.parent.localeObj.getConstant("taskAfterPredecessor_SF")),t=i.i(a.l)(t,c);var g='<div id="'+n+'_ValidationText">'+t+"<div>",f='<table><tr><td><input type="radio" id="'+n+'_ValidationCancel" name="ValidationRule" checked/><label for="'+n+'_ValidationCancel" id= "'+n+'_cancelLink">Cancel, keep the existing link</label></td></tr><tr><td><input type="radio" id="'+n+'_ValidationRemoveline" name="ValidationRule"/><label for="'+n+'_ValidationRemoveline" id="'+n+'_removeLink">Remove the link and move <b>'+h+"</b> to start on <b>"+p+'</b>.</label></td></tr><tr><td><input type="radio" id="'+n+'_ValidationAddlineOffset" name="ValidationRule"/><label for="'+n+'_ValidationAddlineOffset" id="'+n+'_preserveLink">Move the <b>'+h+"</b> to start on <b>"+p+"</b> and keep the link.</label></td></tr></table>";return s.innerHTML=g+f,s},e.prototype.validateTypes=function(e,t){var n,a=this.parent.predecessorModule.getValidPredecessor(e);this.validationPredecessor=[];var s,o,l,d=this.parent.predecessorModule.getPredecessorDate(e,a);o=t?t.ganttProperties:e.ganttProperties;for(var h=this.parent.allowUnscheduledTasks&&i.i(r.isNullOrUndefined)(d)?o.endDate:this.dateValidateModule.getEndDate(d,o.duration,o.durationUnit,o,!1),p=0;p<a.length;p++){n=this.parent.connectorLineModule.getRecordByID(a[p].from);var u=null;"FS"===a[p].type?o.startDate<d?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskBeforePredecessor_FS"):o.startDate>d&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskAfterPredecessor_FS"):"SS"===a[p].type?o.startDate<d?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskBeforePredecessor_SS"):o.startDate>d&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskAfterPredecessor_SS"):"FF"===a[p].type?h<=n.ganttProperties.endDate?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskBeforePredecessor_FF"):h>n.ganttProperties.endDate&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskAfterPredecessor_FF"):"SF"===a[p].type&&(h<n.ganttProperties.startDate?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskBeforePredecessor_SF"):h>=n.ganttProperties.startDate&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskAfterPredecessor_SF")),!i.i(r.isNullOrUndefined)(u)&&i.i(r.isNullOrUndefined)(l)&&(s=n,l=u)}return{parentTask:s,task:e,violationType:l}},e.prototype.addRemovePredecessor=function(e){var t=this.parent.previousRecords[e.uniqueID],n=e.ganttProperties.predecessor.slice();if(t&&t.ganttProperties&&t.ganttProperties.hasOwnProperty("predecessor")){var s=t.ganttProperties.predecessor;if(!i.i(r.isNullOrUndefined)(s))for(var o=0;o<s.length;o++){var l=this.parent.connectorLineModule.getRecordByID(s[parseInt(o.toString(),10)].from);if(l===e)e.ganttProperties.predecessor.push(s[parseInt(o.toString(),10)]);else{var d=i.i(r.extend)([],[],l.ganttProperties.predecessor,!0),h=i.i(a.h)(s[parseInt(o.toString(),10)],"from",d,"to");-1!==h&&(d.splice(h,1),this.parent.setRecordValue("predecessor",d,l.ganttProperties,!0))}}if(!i.i(r.isNullOrUndefined)(n))for(var p=0;p<n.length;p++){var l=this.parent.connectorLineModule.getRecordByID(n[parseInt(p.toString(),10)].from),d=i.i(r.extend)([],[],l.ganttProperties.predecessor,!0);d.push(n[parseInt(p.toString(),10)]),this.parent.setRecordValue("predecessor",d,l.ganttProperties,!0)}}},e.prototype.removePredecessorByIndex=function(e,t){var r=e.ganttProperties.predecessor,n=r.splice(t,1),s=this.parent.connectorLineModule.getRecordByID(n[0].from),o=s.ganttProperties.predecessor,l=i.i(a.h)(n[0],"from",o,"to");o.splice(l,1);var d=this.parent.predecessorModule.getPredecessorStringValue(e);r.push(n[0]),this.parent.connectorLineEditModule.updatePredecessor(e,d)},e.prototype.renderPredecessorDeleteConfirmDialog=function(){this.confirmPredecessorDialog=new s.Dialog({width:"320px",isModal:!0,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmPredecessorDelete"),buttons:[{click:this.confirmOkDeleteButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.confirmCloseDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});var e=i.i(r.createElement)("div",{id:this.parent.element.id+"_deletePredecessorConfirmDialog"});this.parent.element.appendChild(e),this.confirmPredecessorDialog.isStringTemplate=!0,this.confirmPredecessorDialog.appendTo(e)},e.prototype.confirmCloseDialog=function(){this.confirmPredecessorDialog.destroy()},e.prototype.confirmOkDeleteButton=function(){this.removePredecessorByIndex(this.childRecord,this.predecessorIndex),this.confirmPredecessorDialog.destroy()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(3),n=i(6),a=(i.n(n),i(0)),s=(i.n(a),i(4)),o=(i.n(s),i(13)),l=(i.n(o),function(){function e(e){var t=this;this.segmentIndex=-1,this.headerContextMenuClick=function(e){var r=i.i(a.closest)(e.event.target,".e-row"),n=i.i(a.closest)(e.event.target,".e-chart-row");i.i(a.isNullOrUndefined)(r)&&i.i(a.isNullOrUndefined)(n)&&(e.type="Header",t.parent.trigger("contextMenuClick",e))},this.headerContextMenuOpen=function(e){var r=i.i(a.closest)(e.event.target,".e-row"),n=i.i(a.closest)(e.event.target,".e-chart-row");i.i(a.isNullOrUndefined)(r)&&i.i(a.isNullOrUndefined)(n)?(e.type="Header",t.parent.trigger("contextMenuOpen",e)):e.cancel=!0},this.parent=e,this.ganttID=e.element.id,n.TreeGrid.Inject(n.ContextMenu),this.parent.treeGrid.contextMenuClick=this.headerContextMenuClick.bind(this),this.parent.treeGrid.contextMenuOpen=this.headerContextMenuOpen.bind(this),this.addEventListener(),this.resetItems()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("initiate-contextMenu",this.render,this),this.parent.on("reRender-contextMenu",this.reRenderContextMenu,this),this.parent.on("contextMenuClick",this.contextMenuItemClick,this),this.parent.on("contextMenuOpen",this.contextMenuBeforeOpen,this))},e.prototype.reRenderContextMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),i.i(a.remove)(this.element)),this.resetItems(),this.render())},e.prototype.render=function(){this.element=this.parent.createElement("ul",{id:this.ganttID+"_contextmenu",className:r.a}),this.parent.element.appendChild(this.element);var e="#"+this.ganttID;this.contextMenu=new o.ContextMenu({items:this.getMenuItems(),locale:this.parent.locale,enableRtl:this.parent.enableRtl,target:e,animationSettings:{effect:"None"},select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-gantt"}),this.contextMenu.appendTo(this.element),this.parent.treeGrid.contextMenuItems=this.headerMenuItems},e.prototype.contextMenuItemClick=function(e){this.item=this.getKeyFromId(e.item.id);var t,r,n,s=i.i(a.getValue)("parentObj",e.item),o=-1;switch(s&&!i.i(a.isNullOrUndefined)(s.id)&&"DeleteDependency"===this.getKeyFromId(s.id)&&(o=s.items.indexOf(e.item)),this.parent.isAdaptive&&("TaskInformation"!==this.item&&"Above"!==this.item&&"Below"!==this.item&&"Child"!==this.item&&"DeleteTask"!==this.item||this.parent.selectionModule&&"Multiple"===this.parent.selectionSettings.type&&(this.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),this.item){case"TaskInformation":i.i(a.isNullOrUndefined)(this.rowData)||("string"==typeof this.rowData.ganttProperties.taskId?this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID):this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID)));break;case"Above":case"Below":case"Child":if(i.i(a.isNullOrUndefined)(this.rowData))0===this.parent.flatData.length&&this.parent.addRecord();else if(t=this.item,r=i.i(a.extend)({},{},this.rowData.taskData,!0),n=this.parent.taskFields,r[n.startDate]&&this.parent.setRecordValue(n.startDate,this.rowData.ganttProperties.startDate,r,!0),r[n.endDate]&&this.parent.setRecordValue(n.endDate,this.rowData.ganttProperties.endDate,r,!0),i.i(a.isNullOrUndefined)(n.dependency)||(r[n.dependency]=null),!i.i(a.isNullOrUndefined)(n.child)&&r[n.child]&&delete r[n.child],!i.i(a.isNullOrUndefined)(n.parentID)&&r[n.parentID]&&(r[n.parentID]=null),this.rowData){var l=this.parent.updatedRecords.indexOf(this.rowData);this.parent.addRecord(r,t,l)}break;case"Milestone":case"ToMilestone":i.i(a.isNullOrUndefined)(this.rowData)?0===this.parent.flatData.length&&this.parent.addRecord():this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);break;case"DeleteTask":"Cell"!==this.parent.selectionSettings.mode&&this.parent.selectionModule.selectedRowIndexes.length>1||"Cell"===this.parent.selectionSettings.mode&&this.parent.selectionModule.getSelectedRowCellIndexes().length?this.parent.editModule.startDeleteAction():this.parent.editModule.deleteRecord(this.rowData);break;case"ToTask":if(!i.i(a.isNullOrUndefined)(this.rowData)){if(r=i.i(a.extend)({},{},this.rowData.taskData,!0),n=this.parent.taskFields,i.i(a.isNullOrUndefined)(n.duration)){r[n.startDate]=new Date(this.rowData.taskData[n.startDate]);var d=new Date(this.rowData.taskData[n.startDate]);d.setDate(d.getDate()+1),r[n.endDate]=d}else{this.rowData.ganttProperties;r[n.duration]=r[n.duration]<=0?1:r[n.duration]}i.i(a.isNullOrUndefined)(r[n.milestone])||!0===r[n.milestone]&&(r[n.milestone]=!1),r[n.startDate]&&this.parent.setRecordValue(n.startDate,this.rowData.ganttProperties.startDate,r,!0),this.parent.updateRecordByID(r)}break;case"Cancel":this.parent.cancelEdit();break;case"Save":this.parent.editModule.cellEditModule.isCellEdit=!1,this.parent.treeGrid.grid.saveCell();break;case"Dependency"+o:this.parent.connectorLineEditModule.removePredecessorByIndex(this.rowData,o);break;case"Auto":case"Manual":this.parent.changeTaskMode(this.rowData);break;case"Indent":this.parent.indent();break;case"Outdent":this.parent.outdent();break;case"Left":case"Right":this.mergeCall(this.item);break;case"SplitTask":this.splitTaskCall(e)}e.type="Content",e.rowData=this.rowData,this.parent.trigger("contextMenuClick",e)},e.prototype.splitTaskCall=function(e){var t=this;this.isEdit=!0;var r=this.parent.taskFields,n=this.getClickedDate(e.element);i.i(a.isNullOrUndefined)(this.parent.timelineSettings.bottomTier)&&"Hour"!==this.parent.timelineSettings.bottomTier.unit&&n.setHours(0,0,0,0);var s={rowData:this.rowData,requestType:"splitTaskbar",splitDate:n,cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",s,function(e){i.i(a.isNullOrUndefined)(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),t.parent.chartRowsModule.splitTask(t.rowData[r.id],n)})},e.prototype.mergeCall=function(e){var t=this;this.isEdit=!0;var r=this.parent.taskFields,n=this.rowData.ganttProperties.segments,s="Right"===e?this.segmentIndex:n[this.segmentIndex-1].segmentIndex,o="Left"===e?this.segmentIndex:n[this.segmentIndex+1].segmentIndex,l=[{firstSegmentIndex:s,secondSegmentIndex:o}],d={rowData:this.rowData,mergeSegmentIndexes:l,requestType:"mergeSegment",cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",d,function(e){i.i(a.isNullOrUndefined)(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),!1===e.cancel&&t.parent.chartRowsModule.mergeTask(t.rowData[r.id],l)})},e.prototype.getClickedDate=function(e){var t;if(this.parent.enableRtl){var r=this.parent.element.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,s=document.documentElement.clientLeft||document.body.clientLeft||0;t=r.left+n-s}else t=this.parent.getOffsetRect(this.parent.element).left;var o,l;this.parent.enableRtl?(o=Math.abs(t+this.parent.ganttChartModule.chartElement.offsetWidth-this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft),l=Math.abs(this.clickedPosition-o)):(o=t+this.parent.ganttChartModule.chartElement.offsetLeft+this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft,l=this.clickedPosition-o);var d=Math.ceil(l/this.parent.perDayWidth),h=this.rowData.ganttProperties.startDate;return i.i(a.isNullOrUndefined)(this.parent.timelineSettings.bottomTier)||"Hour"!==this.parent.timelineSettings.bottomTier.unit||(d=Math.ceil(l/this.parent.timelineSettings.timelineUnitSize),d-=1),this.parent.dataOperation.getEndDate(h,d,"None"!==this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.bottomTier.unit.toLocaleLowerCase():this.parent.timelineModule.customTimelineSettings.topTier.unit.toLocaleLowerCase(),this.rowData,!1)},e.prototype.contextMenuBeforeOpen=function(e){var t=this,n=e.event?e.event.target:this.parent.focusModule?this.parent.ganttChartModule.targetElement:this.parent.focusModule.getActiveElement();(!i.i(a.isNullOrUndefined)(this.parent.editModule)&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&n.parentElement.classList.contains("e-row")||n.parentElement.classList.contains("e-treecolumn-container"))&&this.parent.treeGrid.closeEdit(),i.i(a.isNullOrUndefined)(e.element)||e.element.id!==this.parent.element.id+"_contextmenu"||(this.clickedPosition=i.i(a.getValue)("event",e).clientX);var o=i.i(a.closest)(n,".e-gantt-child-taskbar");o&&(this.targetElement=e.target=o),e.gridRow=i.i(a.closest)(n,".e-row"),e.chartRow=i.i(a.closest)(n,".e-chart-row");var l=i.i(a.closest)(n,".e-gantt");if(!i.i(a.closest)(n,r.b)&&this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&this.parent.editModule.dialogModule.dialogObj&&!this.parent.editModule.dialogModule.dialogObj.open&&(this.parent.treeGrid.grid.saveCell(),this.parent.editModule.cellEditModule.isCellEdit=!1),this.parent.readOnly&&this.contextMenu.enableItems(["Add","Save","Convert","Delete Dependency","Delete Task","TaskMode","Indent","Outdent","SplitTask","MergeTask"],!1),(i.i(a.isNullOrUndefined)(e.gridRow)&&i.i(a.isNullOrUndefined)(e.chartRow)||0===this.contentMenuItems.length)&&((i.i(a.isNullOrUndefined)(e.parentItem)||i.i(a.isNullOrUndefined)(l))&&i.i(a.isNullOrUndefined)(i.i(a.closest)(n,".e-content"))?e.cancel=!0:e.cancel=!1),!e.cancel){var d=-1;e.gridRow?d=parseInt(e.gridRow.getAttribute("data-rowindex"),0):e.chartRow&&(d=parseInt(e.chartRow.getAttribute("aria-rowindex"),0)),this.parent.selectionModule&&this.parent.allowSelection&&!e.parentItem&&!i.i(a.isNullOrUndefined)(e.chartRow)&&this.parent.selectionModule.selectRow(d),e.parentItem||(this.rowData=this.parent.updatedRecords[parseInt(d.toString(),10)]);for(var h=0,p=e.items;h<p.length;h++){var u=p[h];u.separator||(!n.classList.contains("e-gantt-unscheduled-taskbar")||u.text!==this.getLocale("splitTask")&&u.text!==this.getLocale("mergeTask")?this.updateItemStatus(u,n,d):this.hideItems.push(u.text))}if(e.rowData=this.rowData,e.type="Content",e.disableItems=this.disableItems,e.hideItems=this.hideItems,e.hideChildItems=[],!i.i(a.isNullOrUndefined)(e.rowData)&&0===e.rowData.level&&"ResourceView"===this.parent.viewType)return void(e.cancel=!0);var c=new s.Deferred;return this.parent.trigger("contextMenuOpen",e,function(i){c.resolve(i),t.hideItems=i.hideItems,t.disableItems=i.disableItems,i.parentItem||i.hideItems.length!==i.items.length||(t.revertItemStatus(),i.cancel=!0),t.hideItems.length>0&&t.contextMenu.hideItems(t.hideItems),t.disableItems.length>0&&t.contextMenu.enableItems(t.disableItems,!1),e.hideChildItems.length>0&&t.contextMenu.hideItems(e.hideChildItems)}),c}},e.prototype.updateItemStatus=function(e,t,n){var s=this.getKeyFromId(e.id),o=i.i(a.closest)(t,r.b),l=[],d=i.i(a.closest)(t,".e-gantt-child-taskbar");if(o)"Save"!==s&&"Cancel"!==s&&this.hideItems.push(e.text);else switch(s){case"TaskInformation":this.parent.editSettings.allowEditing&&this.parent.editModule||this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"Add":this.parent.editSettings.allowAdding&&this.parent.editModule||this.updateItemVisibility(e.text);break;case"Save":case"Cancel":this.hideItems.push(e.text);break;case"Convert":!i.i(a.isNullOrUndefined)(this.rowData)&&this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowEditing&&this.parent.editModule?(i.i(a.isNullOrUndefined)(this.rowData)||this.rowData.ganttProperties.isMilestone?l.push(this.createItemModel(r.c,"ToTask",this.getLocale("toTask"))):l.push(this.createItemModel(r.c,"ToMilestone",this.getLocale("toMilestone"))),e.items=l):this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"DeleteDependency":var h=this.getPredecessorsItems();!i.i(a.isNullOrUndefined)(this.rowData)&&this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowDeleting&&0!==h.length&&this.parent.editModule?h.length>0&&(e.items=h):this.updateItemVisibility(e.text);break;case"DeleteTask":this.parent.editSettings.allowDeleting&&this.parent.editModule||this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"TaskMode":"Custom"!==this.parent.taskMode?this.updateItemVisibility(e.text):(this.rowData.ganttProperties.isAutoSchedule?l.push(this.createItemModel(r.c,"Manual",this.getLocale("manual"))):l.push(this.createItemModel(r.c,"Auto",this.getLocale("auto"))),e.items=l);break;case"Indent":if(this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings){var p=this.parent.selectedRowIndex,u=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),c=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1];this.parent.editSettings.allowEditing&&0!==p&&-1!==p&&u&&"ResourceView"!==this.parent.viewType&&this.parent.updatedRecords[parseInt(p.toString(),10)].level-c.level!=1||this.updateItemVisibility(e.text)}else this.hideItems.push(e.text);break;case"Outdent":if(this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings){var g=this.parent.selectionModule.getSelectedRowIndexes()[0],f=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length);this.parent.editSettings.allowEditing&&-1!==g&&0!==g&&f&&"ResourceView"!==this.parent.viewType&&0!==this.parent.updatedRecords[parseInt(g.toString(),10)].level||this.updateItemVisibility(e.text)}else this.hideItems.push(e.text);break;case"SplitTask":var m=this.parent.taskFields;(this.parent.readOnly||!d||i.i(a.isNullOrUndefined)(m.segments)||this.parent.currentViewData[parseInt(n.toString(),10)].hasChildRecords)&&this.updateItemVisibility(e.text);break;case"MergeTask":this.parent.readOnly||!d?this.updateItemVisibility(e.text):this.mergeItemVisiblity(t,e)}},e.prototype.mergeItemVisiblity=function(e,t){var n=[],s=this.parent.taskFields,o=this.getClickedDate(e);this.segmentIndex=this.parent.chartRowsModule.getSegmentIndex(o,this.rowData);var l=this.rowData.ganttProperties.segments;!i.i(a.isNullOrUndefined)(l)&&l.length>0?i.i(a.isNullOrUndefined)(s.segments)&&-1===this.segmentIndex?this.updateItemVisibility(t.text):(0===this.segmentIndex?n.push(this.createItemModel(r.c,"Right",this.getLocale("right"))):this.segmentIndex===l.length-1?n.push(this.createItemModel(r.c,"Left",this.getLocale("left"))):(n.push(this.createItemModel(r.c,"Right",this.getLocale("right"))),n.push(this.createItemModel(r.c,"Left",this.getLocale("left")))),t.items=n):this.hideItems.push(t.text)},e.prototype.updateItemVisibility=function(e){!i.i(a.isNullOrUndefined)(this.parent.contextMenuItems)?this.disableItems.push(e):this.hideItems.push(e)},e.prototype.contextMenuOpen=function(e){this.isOpen=!0;var t=e.element.querySelectorAll("li:not(.e-menu-hide):not(.e-disabled)")[0];i.i(a.isNullOrUndefined)(t)||i.i(a.addClass)([t],"e-focused")},e.prototype.getMenuItems=function(){for(var e=i.i(a.isNullOrUndefined)(this.parent.contextMenuItems)?this.getDefaultItems():this.parent.contextMenuItems,t=0,n=e;t<n.length;t++){var s=n[t];"string"==typeof s&&-1!==this.getDefaultItems().indexOf(s)?this.buildDefaultItems(s):"string"!=typeof s&&(-1!==this.getDefaultItems().indexOf(s.text)?this.buildDefaultItems(s.text,s.iconCss):s.target===r.d?this.headerMenuItems.push(s):this.contentMenuItems.push(s))}return this.contentMenuItems},e.prototype.createItemModel=function(e,t,i,r){return{text:i,id:this.generateID(t),target:e,iconCss:r?"e-icons "+r:null}},e.prototype.getLocale=function(e){return this.parent.localeObj.getConstant(e)},e.prototype.buildDefaultItems=function(e,t){var i;switch(e){case"AutoFitAll":case"AutoFit":case"SortAscending":case"SortDescending":this.headerMenuItems.push(e);break;case"TaskInformation":i=this.createItemModel(r.c,e,this.getLocale("taskInformation"),this.getIconCSS(r.e,t));break;case"Indent":i=this.createItemModel(r.c,e,this.getLocale("indent"),this.getIconCSS(r.f,t));break;case"Outdent":i=this.createItemModel(r.c,e,this.getLocale("outdent"),this.getIconCSS(r.g,t));break;case"Save":i=this.createItemModel(r.e,e,this.getLocale("save"),this.getIconCSS(r.h,t));break;case"Cancel":i=this.createItemModel(r.e,e,this.getLocale("cancel"),this.getIconCSS(r.i,t));break;case"Add":i=this.createItemModel(r.c,e,this.getLocale("add"),this.getIconCSS(r.j,t)),i.items=[],i.items.push(this.createItemModel(r.c,"Above",this.getLocale("above"),this.getIconCSS(r.k,t))),i.items.push(this.createItemModel(r.c,"Below",this.getLocale("below"),this.getIconCSS(r.l,t))),"ResourceView"!==this.parent.viewType&&i.items.push(this.createItemModel(r.c,"Child",this.getLocale("child"))),i.items.push(this.createItemModel(r.c,"Milestone",this.getLocale("milestone")));break;case"DeleteTask":i=this.createItemModel(r.c,e,this.getLocale("deleteTask"),this.getIconCSS(r.m,t));break;case"DeleteDependency":i=this.createItemModel(r.c,e,this.getLocale("deleteDependency")),i.items=[],i.items.push({});break;case"Convert":i=this.createItemModel(r.c,e,this.getLocale("convert")),i.items=[],i.items.push({});break;case"TaskMode":i=this.createItemModel(r.c,e,this.getLocale("changeScheduleMode")),i.items=[],i.items.push({});break;case"SplitTask":i=this.createItemModel(r.c,e,this.getLocale("splitTask"));break;case"MergeTask":i=this.createItemModel(r.c,e,this.getLocale("mergeTask")),i.items=[],i.items.push({})}i&&this.contentMenuItems.push(i)},e.prototype.getIconCSS=function(e,t){return i.i(a.isNullOrUndefined)(t)?e:t},e.prototype.getPredecessorsItems=function(){this.predecessors=this.parent.predecessorModule.getValidPredecessor(this.rowData);for(var e,t=[],i=0,n=0,a=this.predecessors;n<a.length;n++){var s=a[n],o=this.parent.getRecordByID(s.from),l=o.ganttProperties,d=l.rowUniqueID+" - "+l.taskName,h="Dependency"+i++;e=this.createItemModel(r.c,h,d),t.push(e)}return t},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","TaskInformation","DeleteTask","Save","Cancel","SortAscending","SortDescending","Add","DeleteDependency","Convert","TaskMode","Indent","Outdent","SplitTask","MergeTask"]},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("initiate-contextMenu",this.render),this.parent.off("reRender-contextMenu",this.reRenderContextMenu),this.parent.off("contextMenuClick",this.contextMenuItemClick),this.parent.off("contextMenuOpen",this.contextMenuOpen))},e.prototype.contextMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof o.ContextMenu&&this.revertItemStatus()},e.prototype.revertItemStatus=function(){this.contextMenu.showItems(this.hideItems),this.contextMenu.enableItems(this.disableItems),this.hideItems=[],this.disableItems=[],this.isOpen=!1},e.prototype.resetItems=function(){this.hideItems=[],this.disableItems=[],this.headerMenuItems=[],this.contentMenuItems=[],this.item=null},e.prototype.generateID=function(e){return this.ganttID+"_contextMenu_"+e},e.prototype.getKeyFromId=function(e){var t=this.ganttID+"_contextMenu_";return e.indexOf(t)>-1?e.replace(t,""):"Custom"},e.prototype.destroy=function(){this.contextMenu.destroy(),i.i(a.remove)(this.element),this.removeEventListener(),this.contextMenu=null,this.element=null},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(0),n=(i.n(r),i(3)),a=function(){function e(e){this.validatedids=[],this.resourceCollectionIds=[],this.criticalTasks=[],this.parent=e}return e.prototype.getCriticalTasks=function(){return this.criticalTasks},e.prototype.showCriticalPath=function(e){var t=this.parent.ids,i=this.parent.flatData;if(e&&this.parent.flatData.length>0){this.parent.enableCriticalPath=!0;var r=this.parent.treeGrid.parentData,n=r[0].ganttProperties.endDate,a=0,s=[],o=[],l=[],d=0,h=[],p=[],u=[],c=[],g=[],f=[];this.criticalTasks=[],r[0].ganttProperties.autoEndDate>r[0].ganttProperties.endDate&&!r[0].ganttProperties.isAutoSchedule&&(n=r[0].ganttProperties.autoEndDate),r[0].ganttProperties.taskId;for(var m=1;m<r.length;m++)r[m].ganttProperties.endDate>=n&&(n=r[m].ganttProperties.endDate,r[m].ganttProperties.taskId),r[m].ganttProperties.isAutoSchedule||r[m].ganttProperties.autoEndDate>=n&&(n=r[m].ganttProperties.autoEndDate,r[m].ganttProperties.taskId);this.maxEndDate=n;for(var y=0;y<i.length;y++)i[y].isCritical=!1,i[y].ganttProperties.isCritical=!1,a=this.parent.dataOperation.getDuration(i[y].ganttProperties.endDate,n,i[y].ganttProperties.durationUnit,i[y].ganttProperties.isAutoSchedule,i[y].ganttProperties.isMilestone),i[y].slack=a+" "+i[y].ganttProperties.durationUnit,i[y].ganttProperties.slack=a+" "+i[y].ganttProperties.durationUnit,i[y].ganttProperties.endDate>=n&&s.push(i[y].ganttProperties.taskId),i[y].ganttProperties.predecessor&&0!==i[y].ganttProperties.predecessor.length&&(o.push(i[y]),l.push(i[y].ganttProperties.taskId));if("ResourceView"===this.parent.viewType)for(var m=0;m<this.parent.taskIds.length;m++)this.resourceCollectionIds[m]=this.parent.taskIds[m].slice(1);for(var D=this,v=0;v<s.length;v++)!function(e){if(-1===l.indexOf(s[e])){if("ProjectView"===D.parent.viewType)d=t.indexOf(s[e].toString());else for(var r=D.parent.currentViewData.filter(function(t){return parseInt(t.ganttProperties.taskId)===s[e]}),n=0;n<r.length;n++)!r[n].hasChildRecords&&r[n].ganttProperties.endDate>=D.maxEndDate&&(d=r[n].index);i[d].ganttProperties.progress<100&&(i[d].isCritical=!0,i[d].ganttProperties.isCritical=!0),i[d].slack="0 "+i[d].ganttProperties.durationUnit,h.push(s[e])}else p.push(s[e])}(v);for(var w=o.length,k=[],b=0;b<w;b++){for(var T=-1,S=-1,P=-1,C=-1,M=void 0,R=b,x=o[b].ganttProperties.predecessor,O=o[b].ganttProperties.predecessor.length,I=o[b].ganttProperties.taskId,E=0;E<O;E++)M=isNaN(Number(x[E].from))||"string"==typeof I?(isNaN(Number(x[E].from)),x[E].from):parseInt(x[E].from,10),M===I&&(-1===T?x[E].offset?(T=x[E].to+":"+x[E].offset+x[E].offsetUnit,P=x[E].type):(T=x[E].to,P=x[E].type):x[E].offset?(T=T+","+x[E].to+":"+x[E].offset+x[E].offsetUnit,P=P+","+x[E].type):(T=T+","+x[E].to,P=P+","+x[E].type)),(M=isNaN(Number(x[E].to))||"string"==typeof I?(isNaN(Number(x[E].to)),x[E].to):parseInt(x[E].to,10))===I&&(-1===S?x[E].offset?(S=x[E].from+":"+x[E].offset+x[E].offsetUnit,C=x[E].type):(S=x[E].from,C=x[E].type):x[E].offset?(S=S+","+x[E].from+":"+x[E].offset+x[E].offsetUnit,C=C+","+x[E].type):(S=S+","+x[E].from,C=C+","+x[E].type));-1===S&&(S=null,C=null),-1===T&&(T=null,P=null),u.push({from:S,fromPredecessor:C,taskid:I,to:T,toPredecessor:P,currentIndex:R,slack:null,enddate:null}),c.push(I)}for(var N=u.length,F=0,U=void 0,V=0;V<N;V++)if(!u[V].to){U=u[V].taskid,F="ProjectView"===this.parent.viewType?t.indexOf(U.toString()):this.resourceCollectionIds.indexOf(U.toString());var L=i[F].ganttProperties;a=this.parent.dataOperation.getDuration(L.endDate,n,"minute",L.isAutoSchedule,L.isMilestone),u[V].slack=a,u[V].fs=-1,u[V].enddate=L.endDate,k.push({fromdata:u[V].from,todateID:u[V].taskid,fromDataPredecessor:u[V].fromPredecessor})}for(var v=0;v<k.length;v++)g.push(k[v]),this.slackCalculation(g,u,c,n,i,t);f=this.finalCriticalPath(u,h,i,t,n),this.validatedids=[],this.criticalPathCollection=f,this.detailPredecessorCollection=u,this.predecessorCollectionTaskIds=c}if(!1===e&&this.parent.flatData.length>0){var B=void 0;this.parent.enableCriticalPath=!1;for(var V=0;V<this.criticalPathCollection.length;V++)B=t.indexOf(this.criticalPathCollection[V].toString()),i[B].isCritical=!1;this.criticalPathCollection=[],this.detailPredecessorCollection=[],this.predecessorCollectionTaskIds=[]}},e.prototype.slackCalculation=function(e,t,n,a,s,o){var l=e[0].fromdata.split(","),d=e[0].fromDataPredecessor.split(",");n=n.toString(),n=n.split(",");for(var h,p,u,c,g,f,m,y,D=[],v=0;v<l.length;v++){D=l[v].split(":"),h=n.indexOf(D[0].toString()),c=n.indexOf(e[0].todateID.toString()),"ProjectView"===this.parent.viewType?(p=o.indexOf(D[0].toString()),u=o.indexOf(e[0].todateID.toString())):(p=this.resourceCollectionIds.indexOf(D[0].toString()),u=this.resourceCollectionIds.indexOf(e[0].todateID.toString()));var w=s[p].ganttProperties,k=s[u].ganttProperties;D.length>1&&(m=-1!==D[1].indexOf("hour")?60*parseFloat(D[1]):-1!==D[1].indexOf("day")?parseFloat(D[1])*(this.parent.secondsPerDay/3600)*60:parseFloat(D[1])),"FS"===d[v]&&(g=w.endDate>k.startDate?-this.parent.dataOperation.getDuration(k.startDate,w.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.parent.dataOperation.getDuration(w.endDate,k.startDate,"minute",w.isAutoSchedule,w.isMilestone),i.i(r.isNullOrUndefined)(t[h].slack)?D.length<=1&&(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g):t[h].slack>g&&0!==t[h].slack&&D.length<=1&&(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g),D.length>1&&(t[h].slack=t[c].slack+g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0)),t[h].fs=1,t[h].fsslack=t[h].slack,t[h].enddate=w.startDate,w.endDate>=a&&w.endDate<=a&&(t[h].slack=0)),"SS"===d[v]&&(w.isAutoSchedule?(g=w.startDate>k.startDate?-this.parent.dataOperation.getDuration(k.endDate,w.startDate,"minute",w.isAutoSchedule,w.isMilestone):this.parent.dataOperation.getDuration(w.startDate,k.startDate,"minute",w.isAutoSchedule,w.isMilestone),i.i(r.isNullOrUndefined)(t[h].slack)?D.length<=1&&(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g):t[h].slack>g&&0!==t[h].slack&&D.length<=1&&(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g),D.length>1&&(t[h].slack=t[c].slack+g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0)),t[h].fs=1,t[h].fsslack=t[h].slack,t[h].enddate=w.startDate):w.isAutoSchedule||(g=this.getSlackDuration(w.endDate,a,"minute",s[p]),i.i(r.isNullOrUndefined)(t[h].slack)?t[h].slack=g:t[h].slack>g&&0!==t[h].slack&&(t[h].slack=g)),w.endDate>=a&&w.endDate<=a&&(t[h].slack=0)),"FF"===d[v]&&(1!==t[c].fs&&1!==t[c].ff&&-1!==t[c].fs||(1!==t[c].fs&&1!==t[c].ff||(f=k.endDate,y=t[c].slack),-1===t[c].fs&&(f=t[c].enddate,y=t[c].slack),g=f>w.endDate?-this.getSlackDuration(w.endDate,f,"minute",s[p]):this.getSlackDuration(f,w.endDate,"minute",s[p]),i.i(r.isNullOrUndefined)(t[h].slack)?D.length<=1&&(t[h].slack=y-g<0?0:y-g):t[h].slack>g&&0!==t[h].slack&&D.length<=1&&(t[h].slack=y-g<0?0:y-g),D.length>1&&(t[h].slack=t[c].slack-g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0)),t[h].ff=1,t[h].enddate=f,t[h].fsslack=y),w.endDate>=a&&w.endDate<=a&&(t[h].slack=0)),"SF"===d[v]&&(w.isAutoSchedule?i.i(r.isNullOrUndefined)(t[h].slack)?(D.length<=1?i.i(r.isNullOrUndefined)(t[c].to)?(g=this.getSlackDuration(w.endDate,a,"minute",s[p]),t[h].slack=g):i.i(r.isNullOrUndefined)(t[c].to)||(g=k.endDate>w.startDate?-this.parent.dataOperation.getDuration(w.startDate,k.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.getSlackDuration(k.endDate,w.startDate,"minute",s[p]),t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g):D.length>1&&(g=k.endDate>=w.endDate?w.startDate>k.endDate?-this.getSlackDuration(k.endDate,w.startDate,"minute",s[p]):this.parent.dataOperation.getDuration(w.startDate,k.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.getSlackDuration(w.endDate,a,"minute",s[p]),t[h].slack=t[c].slack+g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0)),t[h].fs=1,t[h].fsslack=t[h].slack,t[h].enddate=w.startDate):(D.length<=1?(i.i(r.isNullOrUndefined)(t[c].to)?g=this.getSlackDuration(w.endDate,a,"minute",s[p]):i.i(r.isNullOrUndefined)(t[c].to)||(g=k.endDate>w.startDate?-this.parent.dataOperation.getDuration(w.startDate,k.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.getSlackDuration(k.endDate,w.startDate,"minute",s[p])),t[h].slack>g&&0!==t[h].slack&&(i.i(r.isNullOrUndefined)(t[c].to)?t[h].slack=g:i.i(r.isNullOrUndefined)(t[c].to)||(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g))):D.length>1&&(g=k.endDate>w.endDate?w.startDate>k.endDate?-this.getSlackDuration(k.endDate,w.startDate,"minute",s[p]):this.parent.dataOperation.getDuration(w.startDate,k.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.getSlackDuration(w.endDate,a,"minute",s[p]),t[h].slack>g&&0!==t[h].slack&&(t[h].slack=t[c].slack+g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0))),t[h].fs=1,t[h].fsslack=t[h].slack,t[h].enddate=w.startDate):w.isAutoSchedule||(g=this.getSlackDuration(w.endDate,a,"minute",s[p]),i.i(r.isNullOrUndefined)(t[h].slack)?t[h].slack=g:t[h].slack>g&&0!==t[h].slack&&(t[h].slack=g)),w.endDate>=a&&w.endDate<=a&&(t[h].slack=0)),t[h].from&&e.push({fromdata:t[h].from,todateID:t[h].taskid,fromDataPredecessor:t[h].fromPredecessor})}e&&(e.splice(0,1),e.length>0&&this.slackCalculation(e,t,n,a,s,o))},e.prototype.getSlackDuration=function(e,t,i,r){var n=this.parent.dateValidationModule.checkStartDate(new Date(e)),a=this.parent.dateValidationModule.checkEndDate(new Date(t));return this.parent.dataOperation.getTimeDifference(n,a,!0)<=0?0:this.parent.dataOperation.getDuration(n,a,i,r.ganttProperties.isAutoSchedule,!0)},e.prototype.updateCriticalTasks=function(e,t){for(var i=0;i<e.ganttProperties.predecessor.length;i++){var r=void 0;if("ProjectView"===this.parent.viewType)r=this.parent.getRecordByID(e.ganttProperties.predecessor[i].from);else{var n=this.resourceCollectionIds.indexOf(e.ganttProperties.predecessor[i].from.toString());r=this.parent.flatData[n]}var a=void 0;e.ganttProperties.endDate.getTime()>=this.maxEndDate.getTime()&&(e.ganttProperties.slack=e.slack="0 "+e.ganttProperties.durationUnit,e.ganttProperties.progress<100&&(e.isCritical=!0,e.ganttProperties.isCritical=!0,-1==t.indexOf(parseInt(e.ganttProperties.taskId))&&t.push(parseInt(e.ganttProperties.taskId)))),r&&("FS"==e.ganttProperties.predecessor[i].type?a=this.parent.dataOperation.getDuration(r.ganttProperties.endDate,e.ganttProperties.startDate,r.ganttProperties.durationUnit,r.ganttProperties.isAutoSchedule,!0):"SS"==e.ganttProperties.predecessor[i].type?a=this.parent.dataOperation.getDuration(r.ganttProperties.startDate,e.ganttProperties.startDate,r.ganttProperties.durationUnit,r.ganttProperties.isAutoSchedule,!0):"FF"==e.ganttProperties.predecessor[i].type?a=this.parent.dataOperation.getDuration(r.ganttProperties.endDate,e.ganttProperties.endDate,r.ganttProperties.durationUnit,r.ganttProperties.isAutoSchedule,!0):"SF"==e.ganttProperties.predecessor[i].type&&(a=this.parent.dataOperation.getDuration(e.ganttProperties.endDate,r.ganttProperties.startDate,r.ganttProperties.durationUnit,r.ganttProperties.isAutoSchedule,!0)),0==a&&-1==this.validatedids.indexOf(parseInt(r.ganttProperties.taskId))&&r.ganttProperties.taskId!=e.ganttProperties.taskId&&(r.ganttProperties.slack=e.ganttProperties.slack,r.slack=e.slack,r.isCritical=e.ganttProperties.isCritical,r.ganttProperties.isCritical=e.ganttProperties.isCritical,-1==t.indexOf(parseInt(r.ganttProperties.taskId))&&r.ganttProperties.isCritical&&r.ganttProperties.progress<100&&(this.validatedids.push(parseInt(r.ganttProperties.taskId)),t.push(parseInt(r.ganttProperties.taskId))),r.ganttProperties.predecessorsName&&this.updateCriticalTasks(r,t)))}},e.prototype.finalCriticalPath=function(e,t,i,r,n){for(var a,s,o=[],l=e.length-1;l>=0;l--){a="ProjectView"===this.parent.viewType?r.indexOf(e[l].taskid.toString()):this.resourceCollectionIds.indexOf(e[l].taskid.toString());for(var d=i[a].ganttProperties.predecessor,h="0 "+i[a].ganttProperties.durationUnit,p=d.length-1;p>=0;p--){var u=void 0;u="ProjectView"===this.parent.viewType?this.parent.ids.indexOf(d[p].to):this.resourceCollectionIds.indexOf(d[p].to);var c=void 0,g=i[a].ganttProperties;"FS"===d[p].type?(d[p].to!=g.taskId.toString()||"ResourceView"===this.parent.viewType?c=this.parent.dataOperation.getDuration(g.endDate,i[u].ganttProperties.startDate,g.durationUnit,g.isAutoSchedule,g.isMilestone):(u=this.parent.ids.indexOf(d[p].from),0===(c=this.parent.dataOperation.getDuration(i[u].ganttProperties.endDate,g.startDate,g.durationUnit,g.isAutoSchedule,g.isMilestone))&&a!==u&&i[a].slack==h&&(i[u].slack=i[a].slack,i[u].ganttProperties.slack=i[a].slack)),0===c&&a!==u&&i[a].slack!==h?(i[a].slack=i[u].slack,i[a].ganttProperties.slack=i[u].slack):0!==c&&a!==u&&i[u].isCritical&&(i[a].slack=c+" "+i[a].ganttProperties.durationUnit,i[a].ganttProperties.slack=c+" "+i[a].ganttProperties.durationUnit)):c="SF"===d[p].type?this.parent.dataOperation.getDuration(g.startDate,i[u].ganttProperties.endDate,g.durationUnit,g.isAutoSchedule,g.isMilestone):"SS"===d[p].type?this.parent.dataOperation.getDuration(g.startDate,i[u].ganttProperties.startDate,g.durationUnit,g.isAutoSchedule,g.isMilestone):this.parent.dataOperation.getDuration(g.endDate,i[u].ganttProperties.endDate,g.durationUnit,g.isAutoSchedule,g.isMilestone),s="number"==typeof i[a][this.parent.taskFields.id]?parseInt(d[p].from,10):d[p].from,s===i[a][this.parent.taskFields.id]&&i[u].slack===h&&c<=0&&(i[a].slack=h,i[a].ganttProperties.slack=h)}i[a].slack===h&&i[a].ganttProperties.progress<100&&(i[a].isCritical=!0,i[a].ganttProperties.isCritical=!0,this.criticalTasks.push(i[a]),-1===o.indexOf(e[l].taskid)&&o.push(e[l].taskid)),i[a].ganttProperties.predecessor.length>0&&this.updateCriticalTasks(i[a],o)}if(t.length>0)for(var p=0;p<t.length;p++)-1!==(a="ProjectView"===this.parent.viewType?r.indexOf(t[p].toString()):this.resourceCollectionIds.indexOf(t[p].toString()))&&i[a].ganttProperties.progress<100&&(this.criticalTasks.push(i[a]),-1===o.indexOf(t[p])&&(o=o.concat(t[p])));return o},e.prototype.criticalConnectorLine=function(e,t,a,s){this.parent.ganttChartModule.chartElement;this.parent.removeCriticalPathStyles();for(var o=this,l=0;l<e.length;l++)!function(t){var a;if("ProjectView"===o.parent.viewType)a=o.parent.flatData[o.parent.ids.indexOf(e[t].toString())];else for(var s=o.parent.flatData.filter(function(i){return i.ganttProperties.taskId.toString()===e[t].toString()}),l=0;l<s.length;l++)(s[l].ganttProperties.isCritical||s[l].ganttProperties.endDate>=o.maxEndDate)&&(a=s[l]);var d=o.parent.currentViewData.indexOf(a),h=o.parent.getRowByIndex(d),p=void 0,u=o.parent.taskFields;if(a&&a.parentItem){var c=o.parent.currentViewData.filter(function(e){return a.parentItem.uniqueID===e.uniqueID}),g=o.parent.flatData.indexOf(c[0]),f=o.parent.getRowByIndex(g);if(f)for(var m=f.querySelectorAll(".e-taskbar-main-container"),y=0;y<m.length;y++)m[y].getAttribute("rowuniqueid")===a.rowUniqueID&&i.i(r.addClass)(m[y].querySelectorAll(".e-gantt-child-taskbar-inner-div"),n.n)}if(p=o.parent.allowUnscheduledTasks&&a&&!a[u.startDate]&&!a[u.endDate]&&a[u.duration]?n.o:n.p,h&&("ProjectView"===o.parent.viewType||"ResourceView"===o.parent.viewType&&!a.hasChildRecords)){if(h.getElementsByClassName("e-gantt-milestone")[0]&&i.i(r.addClass)(h.querySelectorAll(".e-gantt-milestone"),n.q),h.getElementsByClassName("e-gantt-child-taskbar-inner-div").length>0){i.i(r.addClass)(h.querySelectorAll(".e-gantt-child-taskbar-inner-div"),n.n);document.querySelector(".e-gantt-child-taskbar-inner-div").style.outlineColor=""}h.getElementsByClassName("e-gantt-child-progressbar-inner-div").length>0&&i.i(r.addClass)(h.querySelectorAll(".e-gantt-child-progressbar-inner-div"),p)}}(l);if(0!==t.length)for(var d=0,h=void 0,p=[],u=void 0,c=void 0,l=0;l<this.criticalPathCollection.length;l++)if(d=s.indexOf(this.criticalPathCollection[l]),h=t[d],-1!==d&&h.to){p=h.to.split(",");for(var g=0;g<p.length;g++)if(c=p[g].split("+"),"+",p[g].indexOf("-")>=0&&(c=p[g].split("-"),"-"),u=c[0].replace(":",""),"number"==typeof e[g]&&(u=parseInt(c[0],10)),-1!==e.indexOf(u)){var f=this.parent.element.querySelectorAll("#ConnectorLineparent"+h.taskid+"child"+u);f.length>0&&(i.i(r.addClass)(this.parent.element.querySelectorAll("#ConnectorLineparent"+h.taskid+"child"+u)[0].querySelectorAll(".e-connector-line"),n.r),i.i(r.addClass)(this.parent.element.querySelectorAll("#ConnectorLineparent"+h.taskid+"child"+u)[0].querySelectorAll(".e-connector-line-arrow"),n.s))}}},e.prototype.getModuleName=function(){return"criticalPath"},e.prototype.destroy=function(){!this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(this.parent.criticalPathModule=void 0)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(81),n=i(80),a=i(0),s=(i.n(a),function(){function e(e){this.parent=e,this.nonworkingDayRender=new r.a(this.parent),this.eventMarkerRender=new n.a(this.parent),this.wireEvents()}return e.prototype.wireEvents=function(){this.parent.on("refreshDayMarkers",this.refreshMarkers,this),this.parent.on("updateHeight",this.updateHeight,this),this.parent.on("ui-update",this.propertyChanged,this)},e.prototype.propertyChanged=function(e){for(var t=Object.keys(i.i(a.getValue)("properties",e)),r=0;r<t.length;r++){switch(t[r]){case"eventMarkers":this.eventMarkerRender.renderEventMarkers(),this.updateHeight();break;case"highlightWeekends":this.nonworkingDayRender.renderWeekends(),this.updateHeight();break;case"holidays":this.nonworkingDayRender.renderHolidays(),this.updateHeight()}}},e.prototype.refreshMarkers=function(){this.nonworkingDayRender.renderWeekends(),this.nonworkingDayRender.renderHolidays(),"Vertical"!==this.parent.gridLines&&"Both"!==this.parent.gridLines||this.parent.renderChartVerticalLines(),this.eventMarkerRender.renderEventMarkers()},e.prototype.updateHeight=function(){this.nonworkingDayRender.updateContainerHeight(),this.eventMarkerRender.updateContainerHeight()},e.prototype.getModuleName=function(){return"dayMarkers"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.nonworkingDayRender.removeContainers(),this.eventMarkerRender.removeContainer(),this.parent.off("refreshDayMarkers",this.refreshMarkers),this.parent.off("updateHeight",this.updateHeight),this.parent.off("ui-update",this.propertyChanged))},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return f});var r=i(0),n=(i.n(r),i(4)),a=(i.n(n),i(9)),s=(i.n(a),i(13)),o=(i.n(s),i(5)),l=(i.n(o),i(88)),d=(i.n(l),i(12)),h=(i.n(d),i(86)),p=(i.n(h),i(20)),u=(i.n(p),i(21)),c=(i.n(u),i(1)),g=i(6),f=(i.n(g),function(){function e(e){this.updatedEditFields=null,this.updatedAddFields=null,this.addedRecord=null,this.dialogEditValidationFlag=!1,this.ganttResources=[],this.isValidData=!0,this.previousResource=[],this.isResourceUpdate=!1,this.parent=e,this.localeObj=this.parent.localeObj,this.beforeOpenArgs={cancel:!1},this.types=this.getPredecessorType(),this.rowData={},this.editedRecord={},this.inputs={booleanedit:h.CheckBox,dropdownedit:u.DropDownList,datepickeredit:p.DatePicker,datetimepickeredit:p.DateTimePicker,maskededit:d.MaskedTextBox,numericedit:d.NumericTextBox,stringedit:d.TextBox,defaultedit:d.TextBox},this.processDialogFields(),this.wireEvents()}return e.prototype.wireEvents=function(){this.parent.on("chartDblClick",this.dblClickHandler,this)},e.prototype.dblClickHandler=function(e){var t=this.parent.ganttChartModule.getRecordByTarget(e);!i.i(r.isNullOrUndefined)(t)&&this.parent.editModule&&this.parent.editSettings.allowEditing&&this.openEditDialog(t)},e.prototype.processDialogFields=function(){i.i(r.isNullOrUndefined)(this.parent.editDialogFields)||this.parent.editDialogFields&&0===this.parent.editDialogFields.length?(this.updatedEditFields=this.getDefaultDialogFields(),this.updatedEditFields=this.validateDialogFields(this.updatedEditFields)):this.updatedEditFields=this.validateDialogFields(this.parent.editDialogFields),i.i(r.isNullOrUndefined)(this.parent.addDialogFields)||this.parent.addDialogFields&&0===this.parent.addDialogFields.length?(this.updatedAddFields=this.getDefaultDialogFields(),this.updatedAddFields=this.validateDialogFields(this.updatedAddFields)):this.updatedAddFields=this.validateDialogFields(this.parent.addDialogFields)},e.prototype.validateDialogFields=function(e){for(var t=[],n=0,a=0;a<e.length;a++){var s=i.i(o.getActualProperties)(e[a]);"General"!==s.type||!i.i(r.isNullOrUndefined)(s.fields)&&0!==s.fields.length||(s.fields=this.getGeneralColumnFields()),"Dependency"===s.type&&i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)||"Resources"===s.type&&i.i(r.isNullOrUndefined)(this.parent.taskFields.resourceInfo)||"Notes"===s.type&&i.i(r.isNullOrUndefined)(this.parent.taskFields.notes)||("Custom"!==s.type||!i.i(r.isNullOrUndefined)(s.fields)&&0!==s.fields.length||(n+=1,s.fields=this.getCustomColumnFields()),n>1||t.push(s))}return t},e.prototype.getGeneralColumnFields=function(){for(var e=[],t=0,i=Object.keys(this.parent.columnMapping);t<i.length;t++){var r=i[t];"dependency"!==r&&"resourceInfo"!==r&&"notes"!==r&&e.push(this.parent.columnMapping[r])}return e},e.prototype.getCustomColumnFields=function(){for(var e=[],t=0;t<this.parent.customColumns.length;t++)e.push(this.parent.customColumns[t]);return e},e.prototype.getDefaultDialogFields=function(){var e=[],t={},n=this.parent.taskFields,a=this.parent.columnMapping;return 0!==Object.keys(a).length&&(t.type="General",e.push(t)),i.i(r.isNullOrUndefined)(i.i(r.getValue)("dependency",a))||(t={},!1!==this.parent.columnByField[a.dependency.valueOf()].visible&&(t.type="Dependency"),e.push(t)),i.i(r.isNullOrUndefined)(i.i(r.getValue)("resourceInfo",a))||(t={},!1!==this.parent.columnByField[a.resourceInfo.valueOf()].visible&&(t.type="Resources"),e.push(t)),i.i(r.isNullOrUndefined)(i.i(r.getValue)("notes",a))||(t={},!1!==this.parent.columnByField[a.notes.valueOf()].visible&&(t.type="Notes"),e.push(t)),i.i(r.isNullOrUndefined)(i.i(r.getValue)("segments",n))||(t={},t.type="Segments",e.push(t)),this.parent.customColumns.length>0&&(t={},t.type="Custom",e.push(t)),e},e.prototype.openAddDialog=function(){this.isEdit=!1,this.editedRecord=this.composeAddRecord(),this.createDialog()},e.prototype.getMinimumStartDate=function(){var e=n.DataUtil.aggregates.min(this.parent.flatData,"ganttProperties.startDate");return e=i.i(r.isNullOrUndefined)(e)?new Date(this.parent.timelineModule.timelineStartDate.getTime()):new Date(e.getTime()),e=this.parent.dateValidationModule.checkStartDate(e),new Date(e.getTime())},e.prototype.composeAddRecord=function(){var e={};e.ganttProperties={};for(var t=this.parent.ganttColumns,n=this.parent.taskFields,a=this.parent.editModule.getNewTaskId(),s=0;s<t.length;s++){var o=t[s].field;o===n.id?(e[o]=a,e.ganttProperties.rowUniqueID=e[o]):t[s].field===n.startDate?(i.i(r.isNullOrUndefined)(e[n.endDate])?e[o]=this.getMinimumStartDate():e[o]=new Date(e[n.endDate]),this.parent.timezone&&(e[o]=this.parent.dateValidationModule.remove(e[o],this.parent.timezone)),e.ganttProperties.startDate=new Date(e[o])):t[s].field===n.endDate?(i.i(r.isNullOrUndefined)(e[n.startDate])?e[o]=this.getMinimumStartDate():e[o]=new Date(e[n.startDate]),this.parent.timezone&&(e[o]=this.parent.dateValidationModule.remove(e[o],this.parent.timezone)),e.ganttProperties.endDate=new Date(e[o])):t[s].field===n.duration?(e[o]=1,e.ganttProperties.duration=e[o],e.ganttProperties.durationUnit=this.parent.durationUnit.toLocaleLowerCase()):t[s].field===n.name?(e[o]=this.localeObj.getConstant("addDialogTitle")+" "+a,e.ganttProperties.taskName=e[o]):t[s].field===n.progress?(e[o]=0,e.ganttProperties.progress=e[o]):t[s].field===n.work?(e[o]=0,e.ganttProperties.work=e[o]):t[s].field===n.type?(e[o]=this.parent.taskType,e.ganttProperties.taskType=e[o]):e[this.parent.ganttColumns[s].field]=""}return e.ganttProperties.isAutoSchedule="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[n.manual],e},e.prototype.openToolbarEditDialog=function(){var e=this.parent;if(e.editModule&&e.editSettings.allowEditing){this.parent.ganttChartModule.focusedRowIndex>-1&&e.selectionModule&&e.selectionModule.selectRow(this.parent.ganttChartModule.focusedRowIndex,!1,!1);var t=e.selectionModule?"Row"!==e.selectionSettings.mode&&"Both"!==e.selectionSettings.mode||1!==e.selectionModule.selectedRowIndexes.length?"Cell"===e.selectionSettings.mode&&1===e.selectionModule.getSelectedRowCellIndexes().length?e.updatedRecords[e.selectionModule.getSelectedRowCellIndexes()[0].rowIndex].ganttProperties.rowUniqueID:null:e.updatedRecords[e.selectionModule.selectedRowIndexes[0]].ganttProperties.rowUniqueID:null;i.i(r.isNullOrUndefined)(t)||this.openEditDialog(t)}},e.prototype.openEditDialog=function(e){var t=this.parent;i.i(r.isNullOrUndefined)(e)||(i.i(r.isNullOrUndefined)(e.ganttProperties)||("string"==typeof e.ganttProperties.taskId?this.numericOrString="stringedit":this.numericOrString="numericedit"),i.i(r.isNullOrUndefined)(e.ganttProperties)&&!i.i(r.isNullOrUndefined)(e)&&(isNaN(Number(e))||"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?this.numericOrString="stringedit":this.numericOrString="numericedit")),"object"!=typeof e||i.i(r.isNullOrUndefined)(e)?i.i(r.isNullOrUndefined)(e)?t.selectedRowIndex>-1&&(this.rowData=t.currentViewData[t.selectedRowIndex],this.rowIndex=t.selectedRowIndex):(this.rowIndex=t.ids.indexOf(e.toString()),this.rowIndex>-1&&(this.rowData=t.flatData[this.rowIndex])):(this.rowIndex=this.parent.currentViewData.indexOf(e),this.rowIndex>-1&&(this.rowData=e)),this.isEdit=!0,"ResourceView"===this.parent.viewType&&0===this.rowData.level||0!==Object.keys(this.rowData).length&&(this.editedRecord=i.i(r.extend)({},{},this.rowData,!0),this.createDialog())},e.prototype.createDialog=function(){var e=this,t=this.parent,n={};this.beforeOpenArgs.dialogModel=n,this.beforeOpenArgs.rowData=this.editedRecord,this.beforeOpenArgs.rowIndex=this.rowIndex;var a=this.parent.isAdaptive?"":"600px",s=this.parent.createElement("div",{id:t.element.id+"_dialog",styles:"max-width:"+a});s.classList.add("e-gantt-dialog"),t.element.appendChild(s),n.animationSettings={effect:"None"},n.header=this.localeObj.getConstant(this.isEdit?"editDialogTitle":"addDialogTitle"),n.isModal=!0,n.enableRtl=this.parent.enableRtl,n.allowDragging=!this.parent.isAdaptive,n.showCloseIcon=!0;var o=this.parent.isAdaptive?{X:"top",Y:"left"}:{X:"center",Y:"center"};n.position=o,n.height=this.parent.isAdaptive?"100%":"auto",n.target=document.body,n.close=this.dialogClose.bind(this),n.closeOnEscape=!0,n.beforeClose=function(e){"escape"===e.closedBy&&"key-pressed"===e.event.name&&"INPUT"===e.event.target.nodeName&&(e.cancel=!0)},n.open=function(t){var n=i.i(r.getValue)("element",t),a=n.querySelector("#"+e.parent.element.id+"GeneralTabContainer");a&&a.scrollHeight>a.offsetHeight&&a.classList.add("e-scroll"),0===e.tabObj.selectedItem&&e.tabObj.select(0),e.parent.isAdaptive&&(n.style.maxHeight="none"),e.parent.focusModule&&e.parent.focusModule.setActiveElement(n)},n.locale=this.parent.locale,n.buttons=[{buttonModel:{content:this.localeObj.getConstant("saveButton"),cssClass:"e-primary"},click:this.buttonClick.bind(this)},{buttonModel:{cssClass:"e-flat",content:this.localeObj.getConstant("cancel")},click:this.buttonClick.bind(this)}],this.createTab(n,s)},e.prototype.buttonClick=function(e){var t=e.target;t.style.pointerEvents="none",this.localeObj.getConstant("cancel").toLowerCase()===e.target.innerText.trim().toLowerCase()?this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.hide(),this.dialogClose()):(this.initiateDialogSave(),t.style.pointerEvents="auto")},e.prototype.dialogClose=function(){this.dialog&&this.resetValues(),i.i(r.isNullOrUndefined)(this.parent.focusModule)||i.i(r.isNullOrUndefined)(this.parent.focusModule.getActiveElement(!0))||this.parent.focusModule.getActiveElement(!0).focus()},e.prototype.resetValues=function(){this.isEdit=!1,this.isAddNewResource=!1,this.editedRecord={},this.rowData={},this.rowIndex=-1,this.addedRecord=null,this.ganttResources=[],this.dialogEditValidationFlag=!1,this.dialog&&!this.dialogObj.isDestroyed&&(this.destroyDialogInnerElements(),this.dialogObj.destroy(),i.i(r.remove)(this.dialog))},e.prototype.destroyDialogInnerElements=function(){for(var e=this.parent,t=this.beforeOpenArgs.tabModel,n=t.items,a=0;a<n.length;a++){var s=n[a].content,o=s.id;if(!i.i(r.isNullOrUndefined)(o)||""!==o)if(o=o.replace(e.element.id,""),"General"===(o=o.replace("TabContainer","")))this.destroyCustomField(s);else if("Dependency"===o){var l=s.ej2_instances[0];l.destroy()}else if("Notes"===o){var d=s.ej2_instances[0];d.destroy()}else if("Resources"===o){var h=s.ej2_instances[0];h.destroy()}else-1!==o.indexOf("Custom")&&this.destroyCustomField(s)}},e.prototype.destroyCustomField=function(e){for(var t=e.childNodes,n=this.parent,a=0;a<t.length;a++){var s=t[a],l=s.querySelector('input[id^="'+n.element.id+'"]');if(l){var d=l.id.replace(n.element.id,""),h=s.querySelector("#"+n.element.id+d).ej2_instances[0];if(!i.i(r.isNullOrUndefined)(h)){var p=n.columnByField[d];if(!i.i(r.isNullOrUndefined)(p.edit)&&i.i(r.isNullOrUndefined)(p.edit.params)){var u=p.edit.destroy;"string"==typeof u?(u=i.i(o.getObject)(u,window))():p.edit.destroy()}else h.destroy()}}}},e.prototype.destroy=function(){this.resetValues(),this.parent.isDestroyed||(this.parent.off("chartDblClick",this.dblClickHandler),this.parent.editModule.dialogModule=void 0)},e.prototype.getEditFields=function(){return this.isEdit?this.updatedEditFields:this.updatedAddFields},e.prototype.createTab=function(e,t){var n,o=this,l=this.parent,d={},h=[],p=this.getEditFields(),u=l.taskFields,c=p.length;d.items=h,d.locale=this.parent.locale,d.enableRtl=this.parent.enableRtl,this.beforeOpenArgs.tabModel=d;var g=0,f=0;if(c>0)for(var m=0;m<c;m++){var y=p[m],D={};if("General"===y.type){if(0===Object.keys(l.columnMapping).length)continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("generalTab")),D.content="General",this.beforeOpenArgs[D.content]=this.getFieldsModel(y.fields)}else if("Segments"===y.type){if(i.i(r.isNullOrUndefined)(u.segments))continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("segments")),D.content="Segments",this.beforeOpenArgs[D.content]=this.getSegmentsModel(y.fields)}else if("Dependency"===y.type){if(i.i(r.isNullOrUndefined)(u.dependency))continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("dependency")),D.content="Dependency",this.beforeOpenArgs[D.content]=this.getPredecessorModel(y.fields)}else if("Resources"===y.type){if(i.i(r.isNullOrUndefined)(u.resourceInfo))continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("resourceName")),D.content="Resources",this.beforeOpenArgs[D.content]=this.getResourcesModel(y.fields)}else if("Notes"===y.type){if(i.i(r.isNullOrUndefined)(u.notes))continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("notes")),D.content="Notes",this.beforeOpenArgs[D.content]=this.getNotesModel(y.fields)}else{if(i.i(r.isNullOrUndefined)(y.fields)||0===y.fields.length)continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("customTab"),g++),D.content="Custom"+f++,this.beforeOpenArgs[D.content]=this.getFieldsModel(y.fields)}D.header={text:y.headerText},h.push(D)}this.beforeOpenArgs.requestType=this.isEdit?"beforeOpenEditDialog":"beforeOpenAddDialog";this.beforeOpenArgs.rowData,this.beforeOpenArgs.name,this.beforeOpenArgs.requestType,this.beforeOpenArgs.cancel;this.parent.trigger("actionBegin",this.beforeOpenArgs,function(h){if(i.i(r.isNullOrUndefined)(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.showSpinner():o.parent.showMaskRow(),o.renderTabItems(),!h.cancel){d.selected=o.tabSelectedEvent.bind(o),d.height=o.parent.isAdaptive?"100%":"auto",d.overflowMode="Scrollable",o.tabObj=new s.Tab(d),o.tabObj.isStringTemplate=!0,n=o.parent.createElement("div",{id:l.element.id+"_Tab"}),o.tabObj.appendTo(n),e.content=n,o.dialog=t,o.dialogObj=new a.Dialog(e),o.dialogObj.isStringTemplate=!0,o.dialogObj.appendTo(o.dialog);var p={action:"OpenDialog",requestType:o.isEdit?"openEditDialog":"openAddDialog",data:o.beforeOpenArgs.rowData,element:o.dialog,cancel:!1};o.parent.trigger("actionComplete",p,function(e){i.i(r.isNullOrUndefined)(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.hideSpinner():o.parent.hideMaskRow(),e.cancel&&o.resetValues()})}})},e.prototype.tabSelectedEvent=function(e){var t=this.parent,n=e.selectedContent.childNodes[0].id;if(this.parent.isAdaptive&&this.responsiveTabContent(n,t),n===t.element.id+"ResourcesTabContainer")this.resourceSelection(n);else if(n===t.element.id+"NotesTabContainer"){document.getElementById(n).ej2_instances[0].refresh();var a=document.querySelector("#"+this.parent.element.id+"NotesTabContainer");a.style.overflow="scroll"}else n===t.element.id+"SegmentsTabContainer"&&(i.i(r.isNullOrUndefined)(this.beforeOpenArgs.rowData.ganttProperties.startDate)?document.getElementById(n).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!1):document.getElementById(n).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!0))},e.prototype.responsiveTabContent=function(e,t){var i=document.getElementById(t.element.id+"_dialog_dialog-content"),r=i.clientHeight;r-=i.querySelector(".e-tab-header").offsetHeight;var n=document.querySelector("#"+e);if(n.classList.contains("e-grid")){r-=n.ej2_instances[0].getHeaderContent().offsetHeight;var a=n.querySelector(".e-toolbar");a&&(r-=a.offsetHeight)}n.parentElement.style.height=r+"px"},e.prototype.getFieldsModel=function(e){for(var t={},n=this.parent.columnByField,a=0;a<e.length;a++)if(e[a]!==this.parent.taskFields.dependency&&e[a]!==this.parent.taskFields.resourceInfo&&e[a]!==this.parent.taskFields.notes&&!i.i(r.isNullOrUndefined)(n[e[a]])){var s=e[a];this.createInputModel(n[s],t)}return t},e.prototype.createInputModel=function(e,t){var n=this,a=this.parent,s=this.parent.locale,o=this.parent.taskFields,l={placeholder:e.headerText,floatLabelType:"Auto"};switch(i.i(r.isNullOrUndefined)(this.parent.taskFields.id)||i.i(r.isNullOrUndefined)(this.parent.columnMapping.id)||i.i(r.isNullOrUndefined)(this.numericOrString)||o.id===e.field&&(e.editType=this.numericOrString),e.editType){case"booleanedit":var d={label:e.headerText,locale:s,enableRtl:this.parent.enableRtl};t[e.field]=d;break;case"defaultedit":case"stringedit":var h=l;h.enableRtl=this.parent.enableRtl,e.field!==a.columnMapping.duration&&e.field!==a.columnMapping.id&&e.field!==a.columnMapping.startDate&&e.field!==a.columnMapping.endDate||(h.change=function(t){n.validateScheduleFields(t,e,a)}),t[e.field]=l;break;case"numericedit":var p=l;p.enableRtl=this.parent.enableRtl,o.progress===e.field&&(p.min=0,p.max=100),o.work===e.field&&(p.change=function(t){n.validateScheduleFields(t,e,a)}),t[e.field]=p;break;case"datepickeredit":var u=l;u.format=this.parent.getDateFormat(),u.enableRtl=this.parent.enableRtl,u.strictMode=!0,u.firstDayOfWeek=a.timelineModule.customTimelineSettings.weekStartDay,e.field!==a.columnMapping.startDate&&e.field!==a.columnMapping.endDate||(u.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),u.change=function(t){n.validateScheduleFields(t,e,a)}),t[e.field]=u;break;case"datetimepickeredit":var c=l;c.format=this.parent.getDateFormat(),c.enableRtl=this.parent.enableRtl,c.strictMode=!0,c.firstDayOfWeek=a.timelineModule.customTimelineSettings.weekStartDay,e.field!==a.columnMapping.startDate&&e.field!==a.columnMapping.endDate||(c.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),c.change=function(t){n.validateScheduleFields(t,e,a)}),t[e.field]=c;break;case"dropdownedit":if(e.field===a.columnMapping.type||e.field===a.columnMapping.manual){var g=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];l.dataSource=g,l.fields={value:"Value"};var f=l;f.enableRtl=this.parent.enableRtl,f.change=function(t){e.field===o.manual&&(n.editedRecord.ganttProperties.isAutoSchedule=!t.value),n.validateScheduleFields(t,e,a)}}t[e.field]=l;break;case"maskededit":t[e.field]=l}return i.i(r.isNullOrUndefined)(e.edit)||i.i(r.isNullOrUndefined)(e.edit.params)||i.i(r.extend)(t[e.field],e.edit.params),t},e.prototype.validateScheduleFields=function(e,t,n){var a,s;i.i(r.isNullOrUndefined)(n.editModule.dialogModule.dialog)||(s=n.editModule.dialogModule.dialog);var o,l=null,h=n.editModule.dialogModule.editedRecord,p=null,u=null,c="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,g=this.parent.viewType;if(i.i(r.isNullOrUndefined)(e.element)?i.i(r.isNullOrUndefined)(e.container)?i.i(r.isNullOrUndefined)(e.event)||i.i(r.isNullOrUndefined)(e.event.path)||i.i(r.isNullOrUndefined)(e.event.path)[1]||(o=e.event.path[1],l=o.querySelector("input").getAttribute("id"),o=o.querySelector("#"+l)):(o=e.container,l=o.querySelector("input").getAttribute("id"),o=o.querySelector("#"+l)):(o=e.element,l=o.getAttribute("id")),i.i(r.isNullOrUndefined)(o))p=e.value,u=t.field;else if(p=o.value,u=l.replace(n.element.id,""),"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType){var f=function(e){return"ResourceView"===g?-1===c.indexOf("T"+e.value)&&-1===c.indexOf("R"+e.value):-1===c.indexOf(e.value)},m={rules:(a={},a[this.parent.taskFields.id]={required:!0,minLength:[f,"ID is already present, please enter new value"]},a)};new d.FormValidator("#"+this.parent.element.id+"GeneralTabContainer",m)}if(0===u.search("Segments"))return u=u.replace("SegmentsTabContainer",""),this.validateSegmentFields(n,u,p,e),!0;this.validateScheduleValuesByCurrentField(u,p,this.editedRecord);var y=h.ganttProperties,D=n.taskFields;return i.i(r.isNullOrUndefined)(D.startDate)||D.startDate===u||this.updateScheduleFields(s,y,"startDate"),D.endDate===u&&!i.i(r.isNullOrUndefined)(y.startDate)&&!i.i(r.isNullOrUndefined)(e.value)&&y.startDate.getTime()>e.value&&this.updateScheduleFields(s,y,"endDate"),i.i(r.isNullOrUndefined)(D.endDate)||D.endDate===u||this.updateScheduleFields(s,y,"endDate"),(!i.i(r.isNullOrUndefined)(D.duration)&&D.duration!==u||y.duration>=0)&&this.updateScheduleFields(s,y,"duration"),i.i(r.isNullOrUndefined)(D.work)||D.work===u||this.updateScheduleFields(s,y,"work"),this.dialogEditValidationFlag=!1,!0},e.prototype.updateScheduleFields=function(e,t,n){var a,s=this.parent,o=s.element.id,l=i.i(r.getValue)(n,s.columnMapping),d=s.columnByField[l],h=this.parent.taskFields;if("stringedit"===d.editType){var p=e.querySelector("#"+o+l).ej2_instances[0];a=i.i(r.isNullOrUndefined)(d.edit)||i.i(r.isNullOrUndefined)(d.edit.read)?i.i(r.isNullOrUndefined)(d.valueAccessor)?this.parent.dataOperation.getDurationString(t.duration,t.durationUnit):d.valueAccessor(l,s.editModule.dialogModule.editedRecord,d):d.edit.read(),p.value!==a.toString()&&h.duration===l?(p.value=a,p.dataBind()):h.startDate!==l&&h.endDate!==l||(p.value=h.startDate===l?t.startDate.toString():t.endDate.toString(),p.dataBind())}else if("datepickeredit"===d.editType||"datetimepickeredit"===d.editType){var u=(d.editType,e.querySelector("#"+o+l).ej2_instances[0]);a=t[n],(i.i(r.isNullOrUndefined)(u.value)&&!i.i(r.isNullOrUndefined)(a)||i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(u.value)||u.value!==a&&!i.i(r.isNullOrUndefined)(u.value)&&!i.i(r.isNullOrUndefined)(a)&&u.value.toString()!==a.toString())&&(u.value=a,u.dataBind())}else if("numericedit"===d.editType){var c=e.querySelector("#"+o+l).ej2_instances[0];a=t[n],i.i(r.isNullOrUndefined)(a)||c.value===a||(c.value=a,c.dataBind())}},e.prototype.validateDuration=function(e){var t=e.ganttProperties;if(!this.dialogEditValidationFlag){i.i(r.isNullOrUndefined)(t.duration)?(this.parent.setRecordValue("endDate",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0)):i.i(c.c)(t)||!i.i(r.isNullOrUndefined)(t.startDate)?(e.ganttProperties.isMilestone&&0!==e.ganttProperties.duration&&this.parent.dateValidationModule.checkStartDate(t.startDate),this.parent.dateValidationModule.calculateEndDate(e)):i.i(c.c)(t)||i.i(r.isNullOrUndefined)(t.endDate)||this.parent.dateValidationModule.calculateStartDate(e);var n=0===t.duration;this.parent.setRecordValue("isMilestone",n,t,!0),this.dialogEditValidationFlag=!0}},e.prototype.validateStartDate=function(e){var t=e.ganttProperties,n=this.parent.taskFields;this.dialogEditValidationFlag||(i.i(r.isNullOrUndefined)(t.startDate)?(this.parent.setRecordValue("duration",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0),this.parent.allowUnscheduledTasks&&i.i(r.isNullOrUndefined)(n.endDate)&&this.parent.setRecordValue("endDate",null,t,!0)):i.i(c.c)(t)?i.i(r.isNullOrUndefined)(n.duration)?this.parent.dateValidationModule.calculateDuration(e):(i.i(r.isNullOrUndefined)(n.endDate),this.parent.dateValidationModule.calculateEndDate(e)):i.i(r.isNullOrUndefined)(t.endDate)?i.i(r.isNullOrUndefined)(t.duration)||this.parent.dateValidationModule.calculateEndDate(e):this.parent.dateValidationModule.calculateDuration(e),this.dialogEditValidationFlag=!0)},e.prototype.validateEndDate=function(e){var t=e.ganttProperties,n=this.parent.taskFields;this.dialogEditValidationFlag||(i.i(r.isNullOrUndefined)(t.endDate)?(this.parent.setRecordValue("duration",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0)):i.i(c.c)(t)?i.i(r.isNullOrUndefined)(n.duration)?this.parent.dateValidationModule.calculateDuration(e):i.i(r.isNullOrUndefined)(t.startDate)?this.parent.dateValidationModule.calculateStartDate(e):(!i.i(r.isNullOrUndefined)(t.segments)&&t.segments.length>0&&(t.segments=this.parent.editModule.cellEditModule.validateEndDateWithSegments(t)),this.parent.dateValidationModule.calculateDuration(e)):i.i(r.isNullOrUndefined)(t.duration)?i.i(r.isNullOrUndefined)(t.startDate)||this.parent.dateValidationModule.calculateDuration(e):this.parent.dateValidationModule.calculateStartDate(e),this.dialogEditValidationFlag=!0)},e.prototype.validateScheduleValuesByCurrentField=function(e,t,n){var a=this.parent,s=n.ganttProperties,o=a.taskFields;if(o.duration===e&&(!i.i(r.isNullOrUndefined)(t)&&""!==t&&parseInt(t)>=0?(a.dataOperation.updateDurationValue(t,s),this.parent.setRecordValue(o.duration,t,n),this.parent.setRecordValue("taskData."+o.duration,s.duration,n),this.validateDuration(n)):a.allowUnscheduledTasks&&(s.startDate&&s.endDate&&s.startDate.getTime()>s.endDate.getTime()||-1!==t.indexOf("-")?(this.parent.setRecordValue("duration",0,s,!0),s.endDate&&this.parent.setRecordValue("startDate",s.endDate,s,!0)):""===t?(this.parent.setRecordValue("duration",null,s,!0),s.endDate&&this.parent.setRecordValue("endDate",null,s,!0)):this.parent.setRecordValue("duration",s.duration,s,!0)),this.parent.editModule.updateResourceRelatedFields(n,"duration")),o.startDate===e)if(""!==t){var l=this.parent.dateValidationModule.getDateFromFormat(t);l=this.parent.dateValidationModule.checkStartDate(l,s),this.parent.setRecordValue("startDate",l,s,!0),this.validateStartDate(n)}else a.allowUnscheduledTasks&&!n.hasChildRecords&&(this.parent.setRecordValue("startDate",null,s,!0),this.parent.setRecordValue("duration",null,s,!0),this.parent.setRecordValue("isMilestone",!1,s,!0));if(o.endDate===e)if(""!==t){var d=this.parent.dateValidationModule.getDateFromFormat(t);i.i(r.isNullOrUndefined)(s.startDate)&&i.i(r.isNullOrUndefined)(d)&&s.startDate.getTime()>d.getTime()&&(d=s.endDate),0===d.getHours()&&86400!==a.defaultEndTime&&this.parent.dateValidationModule.setTime(a.defaultEndTime,d),d=this.parent.dateValidationModule.checkEndDate(d,s),(i.i(r.isNullOrUndefined)(s.startDate)||d.getTime()>s.startDate.getTime())&&this.parent.setRecordValue("endDate",d,s,!0),this.validateEndDate(n)}else a.allowUnscheduledTasks&&(this.parent.setRecordValue("endDate",null,s,!0),this.parent.setRecordValue("duration",null,s,!0),this.parent.setRecordValue("isMilestone",!1,s,!0));return o.work===e&&(i.i(r.isNullOrUndefined)(t)||""===t||(this.parent.setRecordValue("work",t,s,!0),this.parent.editModule.updateResourceRelatedFields(n,"work"),this.validateDuration(n))),e===o.type&&this.parent.setRecordValue("taskType",t,s,!0),o.manual===e&&this.parent.editModule.updateTaskScheduleModes(n),!0},e.prototype.getSegmentsModel=function(e){var t=this,n=this.parent.taskFields;(i.i(r.isNullOrUndefined)(e)||0===e.length)&&(e=[],i.i(r.isNullOrUndefined)(n.startDate)||e.push("startDate"),i.i(r.isNullOrUndefined)(n.endDate)||e.push("endDate"),i.i(r.isNullOrUndefined)(n.duration)||e.push("duration"));var a={};a.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal",newRowPosition:"Bottom"},a.locale=this.parent.locale,a.dataSource=[],a.rowHeight=this.parent.isAdaptive?48:null,a.toolbar=[{id:this.parent.element.id+"SegmentsTabContainer_add",prefixIcon:"e-add",tooltipText:this.localeObj.getConstant("add"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("add")},{id:this.parent.element.id+"SegmentsTabContainer_delete",prefixIcon:"e-delete",tooltipText:this.localeObj.getConstant("delete"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("delete")}];for(var s=[],o=this,l=0;l<e.length;l++)!function(n){var a={};switch(e[n]){case"startDate":case"endDate":a={field:e[n],headerText:o.localeObj.getConstant(e[n]),editType:"stringedit",width:"200px",edit:{write:function(a){var s;if(i.i(r.isNullOrUndefined)(t.beforeOpenArgs.General)){var o=t.getGeneralColumnFields();s=t.getFieldsModel(o)[t.parent.taskFields[e[n]]]}else s=t.beforeOpenArgs.General[t.parent.taskFields[e[n]]];var l=a.rowData[a.column.field];i.i(r.setValue)("value",l,s),new t.inputs[t.parent.columnByField[t.parent.taskFields[e[n]]].editType](s).appendTo(a.element)},read:function(e){return e.ej2_instances[0].value}},format:o.parent.getDateFormat()},"startDate"===e[n]&&(a.validationRules={required:!0}),s.push(a);break;case"duration":a={field:e[n],headerText:o.localeObj.getConstant(e[n]),editType:"stringedit",width:"100px",edit:{write:function(a){var s;if(i.i(r.isNullOrUndefined)(t.beforeOpenArgs.General)){var o=t.getGeneralColumnFields();s=t.getFieldsModel(o)[t.parent.taskFields[e[n]]]}else s=t.beforeOpenArgs.General[t.parent.taskFields[e[n]]];s.floatLabelType="Never";var l=a.rowData[a.column.field];i.i(r.isNullOrUndefined)(l)?i.i(r.setValue)("value",null,s):i.i(r.setValue)("value",l,s),i.i(r.setValue)("value",l,s),new d.TextBox(s).appendTo(a.element)},read:function(e){return e.ej2_instances[0].value.toString()}}},s.push(a)}}(l);return a.columns=s,a.height=this.parent.isAdaptive?"100%":"153px",a},e.prototype.getGridColumnByField=function(e,t){for(var i,r=0;r<t.length;r++)t[r].field===e&&(i=t[r]);return i},e.prototype.updateSegmentField=function(e,t,n){var a,s=this.parent.editModule.dialogModule.dialog,o=i.i(r.getValue)("Segments",this.beforeOpenArgs),l=this.getGridColumnByField(e,o.columns),d=this.parent.element.id,h=n[e];"stringedit"===l.editType?a=s.querySelector("#"+d+"SegmentsTabContainer"+e).ej2_instances[0]:"datepickeredit"===l.editType&&(a=s.querySelector("#"+d+"SegmentsTabContainer"+e).ej2_instances[0]),i.i(r.isNullOrUndefined)(a.value)||a.value.toString()===h.toString()||(a.value=h,a.dataBind())},e.prototype.validateSegmentFields=function(e,t,n,a){var s=this.parent.taskFields;if(!i.i(r.isNullOrUndefined)(s.duration)&&s.duration.toLowerCase()===t.toLowerCase()&&!i.i(r.isNullOrUndefined)(n)&&""!==n){this.selectedSegment.duration=Number(n);var o=e.dataOperation.getEndDate(this.selectedSegment.startDate,Number(n),this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1);o=e.dataOperation.checkEndDate(o,this.editedRecord.ganttProperties,!1),this.selectedSegment.endDate=o}if(!i.i(r.isNullOrUndefined)(s.startDate)&&s.startDate.toLowerCase()===t.toLowerCase()&&""!==n){var l=this.parent.dateValidationModule.getDateFromFormat(n);l=this.parent.dateValidationModule.checkStartDate(l),this.selectedSegment.startDate=l,i.i(r.isNullOrUndefined)(s.endDate)||(this.selectedSegment.endDate=this.parent.dataOperation.getEndDate(l,this.selectedSegment.duration,this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1))}if(!i.i(r.isNullOrUndefined)(s.endDate)&&s.endDate.toLowerCase()===t.toLowerCase()&&""!==n){var o=this.parent.dateValidationModule.getDateFromFormat(n);0===o.getHours()&&86400!==e.defaultEndTime&&this.parent.dateValidationModule.setTime(e.defaultEndTime,o),o=this.parent.dateValidationModule.checkEndDate(o,this.editedRecord.ganttProperties),this.selectedSegment.endDate=o,this.selectedSegment.duration=this.parent.dataOperation.getDuration(this.selectedSegment.startDate,this.selectedSegment.endDate,this.editedRecord.ganttProperties.durationUnit,!0,!1,!0)}i.i(r.isNullOrUndefined)(s.startDate)||this.updateSegmentField("startDate",a,this.selectedSegment),i.i(r.isNullOrUndefined)(s.endDate)||this.updateSegmentField("endDate",a,this.selectedSegment),i.i(r.isNullOrUndefined)(s.duration)||this.updateSegmentField("duration",a,this.selectedSegment)},e.prototype.getPredecessorModel=function(e){(i.i(r.isNullOrUndefined)(e)||0===e.length)&&(e=["ID","Name","Type","Offset","UniqueId"]);var t={};t.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal"},t.locale=this.parent.locale,t.dataSource=[],t.rowHeight=this.parent.isAdaptive?48:null,t.toolbar=[{id:this.parent.element.id+"DependencyTabContainer_add",prefixIcon:"e-add",tooltipText:this.localeObj.getConstant("add"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("add")},{id:this.parent.element.id+"DependencyTabContainer_delete",prefixIcon:"e-delete",tooltipText:this.localeObj.getConstant("delete"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("delete")}];for(var n=[],a=0;a<e.length;a++){var s={};"id"===e[a].toLowerCase()?(s={field:"id",headerText:this.localeObj.getConstant("id"),allowEditing:!1,width:"70px"},n.push(s)):"name"===e[a].toLowerCase()?(s={field:"name",headerText:this.localeObj.getConstant("name"),editType:"stringedit",width:"250px",validationRules:{required:!0}},n.push(s)):"type"===e[a].toLowerCase()?(s={field:"type",headerText:this.localeObj.getConstant("type"),editType:"dropdownedit",dataSource:this.types,foreignKeyField:"id",foreignKeyValue:"text",defaultValue:"FS",validationRules:{required:!0},width:"150px"},n.push(s)):"offset"===e[a].toLowerCase()?(s={field:"offset",headerText:this.localeObj.getConstant("offset"),editType:"stringedit",defaultValue:this.parent.dataOperation.getDurationString(0,this.beforeOpenArgs.rowData.ganttProperties.durationUnit),validationRules:{required:!0},width:"100px"},n.push(s)):"uniqueid"===e[a].toLowerCase()&&(s={field:"uniqueId",isPrimaryKey:!0,visible:!1,defaultValue:i.i(c.k)().toString()},n.push(s))}return t.columns=n,t.height=this.parent.isAdaptive?"100%":"153px",t},e.prototype.getResourcesModel=function(e){var t=this.parent,n=t.resourceFields;(i.i(r.isNullOrUndefined)(e)||0===e.length)&&(e=[n.id,n.name,n.unit,n.group]);for(var a={allowFiltering:!0,treeColumnIndex:-1,childMapping:"",editSettings:{allowEditing:!0,mode:"Cell"},locale:this.parent.locale,allowSelection:!0,rowHeight:this.parent.isAdaptive?48:null,filterSettings:{type:"Menu"},selectionSettings:{checkboxOnly:!0,checkboxMode:"Default",persistSelection:!0,type:"Multiple"}},s=[{type:"checkbox",allowEditing:!1,allowSorting:!1,allowFiltering:!1,width:60}],o=0;o<e.length;o++){var l={};e[o]===n.id?(l={field:n.id,headerText:this.localeObj.getConstant("id"),isPrimaryKey:!0,width:"100px",allowEditing:!1},s.push(l)):e[o]===n.name?(l={field:n.name,headerText:this.localeObj.getConstant("name"),allowEditing:!1},s.push(l)):e[o]===n.unit?(l={field:n.unit,headerText:this.localeObj.getConstant("unit"),editType:"numericedit",edit:{params:{min:0}}},s.push(l)):e[o]!==n.group||i.i(r.isNullOrUndefined)(n.group)||(l={field:n.group,headerText:this.localeObj.getConstant("group"),allowEditing:!1},s.push(l))}return a.columns=s,a.height=this.parent.isAdaptive?"100%":"196px",a},e.prototype.getNotesModel=function(e){return(i.i(r.isNullOrUndefined)(e)||0===e.length)&&(e=["Bold","Italic","Underline","StrikeThrough","FontName","FontSize","FontColor","BackgroundColor","LowerCase","UpperCase","|","Alignments","OrderedList","UnorderedList","Outdent","Indent","|","CreateTable","CreateLink","|","ClearFormat","Print","|","Undo","Redo"]),{placeholder:this.localeObj.getConstant("writeNotes"),toolbarSettings:{items:e},height:this.parent.isAdaptive?"100%":"auto",locale:this.parent.locale}},e.prototype.createDivElement=function(e,t){return i.i(r.createElement)("div",{className:e,id:t})},e.prototype.createInputElement=function(e,t,n,a){return i.i(r.createElement)(a||"input",{className:e,attrs:{type:"text",id:t,name:n,title:n}})},e.prototype.renderTabItems=function(){for(var e=this.beforeOpenArgs.tabModel,t=e.items,i=0,r=0;r<t.length;r++){var n=t[r];n.content instanceof HTMLElement||("General"===n.content?n.content=this.renderGeneralTab(n.content):"Dependency"===n.content?(this.editedRecord.hasChildRecords&&!this.parent.allowParentDependency&&(n.disabled=!0),n.content=this.renderPredecessorTab(n.content)):"Resources"===n.content?n.content=this.renderResourceTab(n.content):n.content==="Custom"+i?(n.content=this.renderCustomTab(n.content),i++):"Notes"===n.content?n.content=this.renderNotesTab(n.content):"Segments"===n.content&&(this.editedRecord.hasChildRecords&&(n.disabled=!0),n.content=this.renderSegmentsTab(n.content)))}},e.prototype.segmentGridActionBegin=function(e){var t=this.parent.taskFields,n=this.beforeOpenArgs.Segments;if("add"===e.requestType||"beginEdit"===e.requestType||"save"===e.requestType){var a=n.dataSource,s=i.i(r.getValue)("rowData",e),o=this.beforeOpenArgs.rowData.ganttProperties.startDate;if(!i.i(r.isNullOrUndefined)(o)&&"add"===e.requestType){var l={},d=i.i(r.getValue)("startDate",s),h=i.i(r.getValue)("endDate",s),p=i.i(r.getValue)("duration",s),u=!i.i(r.isNullOrUndefined)(a)&&a.length>0?i.i(r.isNullOrUndefined)(t.endDate)||i.i(r.isNullOrUndefined)(a[0].endDate)?new Date(i.i(r.getValue)("startDate",a[0]).getTime()):new Date(i.i(r.getValue)("endDate",a[0]).getTime()):!i.i(r.isNullOrUndefined)(this.beforeOpenArgs.rowData.ganttProperties.startDate)&&new Date(this.beforeOpenArgs.rowData.ganttProperties.startDate.getTime());u.setHours(0,0,0,0),!i.i(r.isNullOrUndefined)(a)&&a.length>0&&u.setDate(u.getDate()+2),d=this.parent.dataOperation.checkStartDate(u),h=this.parent.dateValidationModule.getDateFromFormat(d),0===h.getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,h),h=!i.i(r.isNullOrUndefined)(t.endDate)&&!i.i(r.isNullOrUndefined)(a)&&a.length<=0?this.beforeOpenArgs.rowData.ganttProperties.endDate:h,p=!i.i(r.isNullOrUndefined)(t.duration)&&!i.i(r.isNullOrUndefined)(a)&&a.length<=0?this.beforeOpenArgs.rowData.ganttProperties.duration:1,l={startDate:d,endDate:h,duration:p},e.rowData=l}this.selectedSegment=e.rowData}},e.prototype.renderSegmentsTab=function(e){var t=this.parent,n=this.beforeOpenArgs[e],a=this.beforeOpenArgs.rowData,s=[];this.isEdit&&(s=i.i(r.isNullOrUndefined)(a.ganttProperties.segments)?[]:a.ganttProperties.segments),n.dataSource=s,n.actionBegin=this.segmentGridActionBegin.bind(this),o.Grid.Inject(o.Edit,o.Page,o.Toolbar,o.ForeignKey);var l=new o.Grid(n),d=this.createDivElement("",t.element.id+""+e+"TabContainer");return l.appendTo(d),d},e.prototype.renderGeneralTab=function(e){for(var t=this.parent,i=this.beforeOpenArgs[e],r=this.createDivElement("e-edit-form-row",t.element.id+""+e+"TabContainer"),n=0,a=Object.keys(i);n<a.length;n++){var s=a[n];if(!1!==this.parent.columnByField[s].visible){var o=this.parent.columnByField[s],l=i[s];r.appendChild(this.renderInputElements(l,o))}}return r},e.prototype.isCheckIsDisabled=function(e){var t,n=!1;if(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)if(-1!==this.parent.customColumns.indexOf(e.field))n=!0;else if(e.field===this.parent.taskFields.id||e.field===this.parent.taskFields.name||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.startDate||e.field===this.parent.taskFields.endDate||e.field===this.parent.taskFields.baselineStartDate||e.field===this.parent.taskFields.baselineEndDate||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type){for(var a=0;a<this.parent.currentViewData.length;a++)if(!i.i(r.isNullOrUndefined)(this.parent.currentViewData[a].ganttProperties.taskId)){t=this.parent.currentViewData[a].ganttProperties.taskId;break}n="string"!=typeof t}return this.isEdit&&(e.field===this.parent.taskFields.id&&(n=!0),this.editedRecord.hasChildRecords&&(e.field===this.parent.taskFields.endDate&&(!i.i(r.isNullOrUndefined)(this.editedRecord.isManual)&&!1===this.editedRecord.isManual||"Auto"===this.parent.taskMode)||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type)&&(n=!0)),n},e.prototype.isParentValid=function(e){if(e.length>0)for(var t=0;t<e.length;t++){if(e[t].uniqueID==this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}if(e[t].hasChildRecords&&this.isParentValid(e[t].childRecords),!this.isValidData)break}return this.isValidData},e.prototype.renderPredecessorTab=function(e){var t=this,a=this.parent,s=this.beforeOpenArgs[e],l=this.parent.columnByField[this.parent.taskFields.dependency];(!1===l.allowEditing||l.isPrimaryKey||this.parent.readOnly)&&(s.editSettings.allowEditing=!1,s.editSettings.allowAdding=!1,s.editSettings.allowDeleting=!1);var d=this.beforeOpenArgs.rowData,h=[];this.taskNameCollection(),this.isEdit&&(h=this.predecessorEditCollection(d),this.updatePredecessorDropDownData(d)),s.dataSource=h,s.actionBegin=this.gridActionBegin.bind(this),s.columns[1].edit={write:function(e){"add"===i.i(r.getValue)("requestType",e)&&i.i(r.setValue)("rowData.uniqueId",i.i(c.k)(),e),new u.ComboBox({dataSource:new n.DataManager(t.idCollection),popupHeight:"180px",allowCustom:!1,enableRtl:t.parent.enableRtl,fields:{value:"text"},value:e.rowData.name,change:function(e){var n=i.i(r.closest)(e.element,"tr"),a=n.querySelector("#"+t.parent.element.id+"DependencyTabContainerid");a&&(i.i(r.isNullOrUndefined)(e.itemData)||i.i(r.isNullOrUndefined)(e.item)?a.value="":a.value=e.itemData.id)},autofill:!0}).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value}},o.Grid.Inject(o.Edit,o.Page,o.Toolbar,o.ForeignKey);var p=new o.Grid(s),g=this.createDivElement("e-dependent-div",a.element.id+""+e+"TabContainer");return p.appendTo(g),g},e.prototype.gridActionBegin=function(e){var t=this,n=this.beforeOpenArgs.Dependency;if("add"===e.requestType||"beginEdit"===e.requestType){var a="add"!==e.requestType;this.idCollection=i.i(r.extend)([],[],this.preTableCollection,!0);for(var s=n.dataSource,o=this,l=0;l<=s.length;l++)!function(n){o.idCollection.forEach(function(o,l){if(o.id===i.i(r.getValue)("id",s[n])){var d=i.i(r.getValue)("rowData",e);if(a&&i.i(r.getValue)("id",d)===o.id)return;t.idCollection.splice(t.idCollection.indexOf(o),1)}})}(l)}},e.prototype.updateResourceCollection=function(e,t){if(!i.i(r.isNullOrUndefined)(e.data)&&Object.keys(e.data).length){var n=(this.parent,document.querySelector("#"+t)),a=n.ej2_instances[0];if(!i.i(r.isNullOrUndefined)(a)&&a.getSelectedRecords().length>0){var s=a.getSelectedRecords(),o=void 0,l=[];for(o=0;o<s.length;o++)l.push(s[o].taskData);this.ganttResources=i.i(r.extend)([],l)}else this.ganttResources=[]}else this.ganttResources=[]},e.prototype.renderResourceTab=function(e){var t=this,n=this.parent,a=n.resourceFields,s=this.beforeOpenArgs.rowData,o=s.ganttProperties.resourceInfo,l=this.beforeOpenArgs[e],d=n.element.id+""+e+"TabContainer",h=[];if("ResourceView"===this.parent.viewType)for(var p=0;p<n.currentViewData.length;p++)for(var u=0;u<n.resources.length;u++)n.currentViewData[p][n.taskFields.id]===n.resources[u][a.id]&&(n.currentViewData[p].hasChildRecords||i.i(r.isNullOrUndefined)(n.currentViewData[p].parentItem))&&h.push(n.resources[u]);else h=i.i(r.extend)([],[],n.resources,!0);if(this.parent.dataOperation.updateResourceUnit(h),!i.i(r.isNullOrUndefined)(o)){var c=void 0,f=o.length,m=void 0,y=h.length;for(c=0;c<f;c++)for(m=0;m<y;m++)o[c][a.id]===h[m][a.id]&&(h[m][a.unit]=o[c][a.unit])}l.dataSource=h;var D=s.ganttProperties.resourceInfo;if(this.isEdit&&!i.i(r.isNullOrUndefined)(D))for(var p=0;p<D.length;p++)this.ganttResources.push(D[p]);l.rowSelected=function(e){t.updateResourceCollection(e,d)},l.rowDeselected=function(e){t.updateResourceCollection(e,d)};var v=this.createDivElement("e-resource-div",d);g.TreeGrid.Inject(g.Selection,g.Filter,g.Edit,g.VirtualScroll);var w=new g.TreeGrid(l),k=this.parent.columnByField[this.parent.taskFields.resourceInfo];return(!1===k.allowEditing||k.isPrimaryKey||this.parent.readOnly)&&(w.allowSelection=!1,w.allowFiltering=!1,w.editSettings.allowEditing=!1),w.dataBound=function(){if(t.parent.editDialogFields.length>=1&&"Resources"===t.parent.editDialogFields[0].type){var e=t.parent.element.id+"ResourcesTabContainer";t.resourceSelection(e)}},w.appendTo(v),v},e.prototype.resourceSelection=function(e){var t=this,n=document.querySelector("#"+e).ej2_instances[0],a=n.getCurrentViewRecords(),s=this.ganttResources;s&&s.length>0&&a.forEach(function(e,a){for(var o=0;o<s.length;o++)e.taskData[t.parent.resourceFields.id]!==s[o][t.parent.resourceFields.id]||i.i(r.isNullOrUndefined)(n.selectionModule)||-1!==n.getSelectedRowIndexes().indexOf(a)||n.selectRow(a)})},e.prototype.renderCustomTab=function(e){return this.renderGeneralTab(e)},e.prototype.renderNotesTab=function(e){var t=this.parent,i=this.beforeOpenArgs[e];i.enableHtmlSanitizer=this.parent.enableHtmlSanitizer;var r=this.editedRecord.ganttProperties,n=this.createDivElement("",t.element.id+""+e+"TabContainer");l.RichTextEditor.Inject(l.Toolbar,l.Link,l.HtmlEditor,l.QuickToolbar,l.Count),i.value=r.notes;var a=this.parent.columnByField[this.parent.taskFields.notes];return(!1===a.allowEditing||a.isPrimaryKey||this.parent.readOnly)&&(i.enabled=!1),new l.RichTextEditor(i).appendTo(n),n},e.prototype.renderInputElements=function(e,t){var n,a=this,s=this.parent.element.id,l=this.editedRecord,d=this.createDivElement("e-edit-form-column"),h={column:t,data:l};if(!i.i(r.isNullOrUndefined)(t.edit)&&i.i(r.isNullOrUndefined)(t.edit.params)){var p=t.edit.create;"string"==typeof p?(p=i.i(o.getObject)(p,window),n=p(h)):n=t.edit.create(h),n.className="",n.setAttribute("type","text"),n.setAttribute("id",s+""+t.field),n.setAttribute("name",t.field),n.setAttribute("title",t.field),d.appendChild(n)}else n=this.createInputElement("",s+""+t.field,t.field),d.appendChild(n);if(e.enabled=i.i(r.isNullOrUndefined)(e.enabled)?!this.isCheckIsDisabled(t):e.enabled,t.field===this.parent.taskFields.duration)if(i.i(r.isNullOrUndefined)(t.valueAccessor)){if(i.i(r.isNullOrUndefined)(t.edit)){var u=l.ganttProperties;e.value=this.parent.dataOperation.getDurationString(u.duration,u.durationUnit)}}else if("string"==typeof t.valueAccessor){var c=i.i(o.getObject)(t.valueAccessor,window);e.value=c(t.field,l,t)}else e.value=t.valueAccessor(t.field,l,t);else"booleanedit"===t.editType?!0===l[t.field]?e.checked=!0:e.checked=!1:e.value=l[t.field];if(!i.i(r.isNullOrUndefined)(t.edit)&&i.i(r.isNullOrUndefined)(t.edit.params)){var g=t.edit.write,f=void 0;"string"==typeof g?(g=i.i(o.getObject)(g,window),f=g({column:t,rowData:l,element:n})):f=t.edit.write({column:t,rowData:l,element:n}),t.field===this.parent.taskFields.duration&&(f.change=function(e){a.validateScheduleFields(e,t,a.parent)})}else{var f=new this.inputs[t.editType](e);f.appendTo(n)}return d},e.prototype.taskNameCollection=function(){var e=this.parent.flatData;this.preTaskIds=[],this.preTableCollection=[];for(var t=0;t<e.length;t++){var i=e[t];if(this.parent.allowParentDependency){var r=i;if(i.parentUniqueID===this.beforeOpenArgs.rowData.uniqueID)this.isValidData=!1;else do{if(r.parentItem&&(r=this.parent.flatData[this.parent.ids.indexOf(r.parentItem.taskId)],r.uniqueID===this.beforeOpenArgs.rowData.uniqueID)){this.isValidData=!1;break}}while(r.parentItem);if(i.hasChildRecords&&this.isValidData&&(this.isValidData=this.isParentValid(i.childRecords)),!this.isValidData){this.isValidData=!0;continue}}else if(i.hasChildRecords)continue;var n="ResourceView"===this.parent.viewType?i.ganttProperties.taskId.toString():i.ganttProperties.rowUniqueID.toString(),a={id:n,text:n+"-"+i.ganttProperties.taskName,value:n};this.preTaskIds.push(a.id),this.preTableCollection.push(a)}},e.prototype.predecessorEditCollection=function(e){var t=[],n=e.ganttProperties;if(this.isEdit&&!i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)&&!i.i(r.isNullOrUndefined)(e)&&!i.i(r.isNullOrUndefined)(n.predecessor))for(var a=n.predecessor,s=this.preTableCollection,o=0;o<a.length;o++){var l=a[o].from.toString(),d={},h="ResourceView"===this.parent.viewType?n.taskId:n.rowUniqueID;if(h.toString()!==l){d.id=l;for(var p=0;p<s.length;p++)if(s[p].value===l){d.name=s[p].text;break}d.type=a[o].type;var u=a[o].offset,g=a[o].offsetUnit;d.offset=this.parent.dataOperation.getDurationString(u,g),d.uniqueId=i.i(c.k)(),t.push(d)}}return t},e.prototype.updatePredecessorDropDownData=function(e){var t=-1,i="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString();t=this.preTaskIds.indexOf(i),this.preTableCollection.splice(t,1),this.preTaskIds.splice(t,1),this.validSuccessorTasks(e,this.preTaskIds,this.preTableCollection)},e.prototype.validSuccessorTasks=function(e,t,i){var r=this,n=e.ganttProperties;if(n.predecessor&&n.predecessor.length>0){var a=n.predecessor,s="ResourceView"===this.parent.viewType?n.taskId.toString():n.rowUniqueID.toString();a.forEach(function(e){if(e.from.toString()===s){var n=e.to,a=-1;a=t.indexOf(n),a>-1&&(t.splice(a,1),i.splice(a,1));var o=r.parent.connectorLineModule.getRecordByID(n);r.validSuccessorTasks(o,t,i)}})}},e.prototype.getPredecessorType=function(){var e=[this.parent.getPredecessorTextValue("SS"),this.parent.getPredecessorTextValue("SF"),this.parent.getPredecessorTextValue("FS"),this.parent.getPredecessorTextValue("FF")];return[{id:"FS",text:e[2],value:e[2]},{id:"FF",text:e[3],value:e[3]},{id:"SS",text:e[0],value:e[0]},{id:"SF",text:e[1],value:e[1]}]},e.prototype.initiateDialogSave=function(){this.isEdit?this.parent.initiateEditAction(!0):this.addedRecord={};for(var e=this.parent,t=this.beforeOpenArgs.tabModel,n=t.items,a=0;a<n.length;a++){var s=n[a].content,o=s.id;i.i(r.isNullOrUndefined)(o)&&""===o||(o=o.replace(e.element.id,""),o=o.replace("TabContainer",""),"General"===o?this.updateGeneralTab(s,!1):"Dependency"===o?this.updatePredecessorTab(s):"Notes"===o?this.updateNotesTab(s):"Resources"===o?this.updateResourceTab(s):-1!==o.indexOf("Custom")?this.updateCustomTab(s):"Segments"===o&&this.updateSegmentsData(s,this.beforeOpenArgs.rowData))}if(this.isEdit){this.parent.dataOperation.updateWidthLeft(this.rowData);var l={data:this.rowData,action:"DialogEditing"};this.parent.editModule.initiateUpdateAction(l)}else if("ResourceView"===this.parent.viewType){var d=i.i(r.extend)({},this.addedRecord,!0);if(d[this.parent.taskFields.resourceInfo].length)for(var a=0;a<d[this.parent.taskFields.resourceInfo].length;a++){var o=d[this.parent.taskFields.resourceInfo][a].toString(),h=this.parent.getTaskIds().indexOf("R"+o.toString());if(-1!==h){this.parent.editModule.addRecord(this.addedRecord,"Child",h);break}}else this.parent.editModule.addRecord(this.addedRecord,"Bottom")}else this.parent.editModule.addRecord(this.addedRecord,this.parent.editSettings.newRowPosition,this.parent.selectedRowIndex);return!0},e.prototype.updateSegmentTaskData=function(e){for(var t=[],n=this.parent.taskFields,a=0;a<e.length;a++){var s={};i.i(r.isNullOrUndefined)(n.startDate)||(s[this.parent.taskFields.startDate]=e[a].startDate),i.i(r.isNullOrUndefined)(n.endDate)||(s[this.parent.taskFields.endDate]=e[a].endDate),i.i(r.isNullOrUndefined)(n.duration)||(s[this.parent.taskFields.duration]=Number(e[a].duration),e[a].duration=s[this.parent.taskFields.duration]),t.push(s)}this.isEdit?(this.rowData.ganttProperties.segments=e,this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(this.rowData,!1),this.rowData.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,t,this.rowData),e.length<=0&&this.validateDuration(this.rowData)):this.addedRecord[n.segments]=t},e.prototype.updateSegmentsData=function(e,t){var i,r=e.ej2_instances[0],n=r.isEdit;r.isEdit&&r.endEdit(),i=n&&r.currentViewData.length!=r.dataSource.length?r.dataSource:r.currentViewData,this.updateSegmentTaskData(i)},e.prototype.updateGeneralTab=function(e,t){var n=this.parent,a=e.childNodes,s={};this.isEdit||(s=this.addedRecord);for(var l=0;l<a.length;l++){var d=a[l],h=d.querySelector('input[id^="'+n.element.id+'"]')||d.querySelector('textarea[id^="'+n.element.id+'"]');if(h){var p=h.id.replace(n.element.id,""),u=d.querySelector("#"+n.element.id+p).ej2_instances[0];if("stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType&&p===this.parent.taskFields.id){var c=u.value.toString();u.value=c}var g=n.columnByField[p];if(!i.i(r.isNullOrUndefined)(g.edit)&&i.i(r.isNullOrUndefined)(g.edit.params)){var f=g.edit.read;"string"==typeof f?(f=i.i(o.getObject)(f,window),s[p]=f(h,u.value)):s[p]=g.edit.read(h,u.value)}else t&&"booleanedit"===g.editType?h instanceof HTMLInputElement&&!0===h.checked?s[p]=!0:s[p]=!1:(s[p]=u.value,this.parent.enableHtmlSanitizer&&"string"==typeof u.value&&(u.value=r.SanitizeHtmlHelper.sanitize(u.value),s[p]=u.value))}}this.isEdit&&(t||this.updateScheduleProperties(this.editedRecord,this.rowData),n.editModule.validateUpdateValues(s,this.rowData,!0))},e.prototype.updateScheduleProperties=function(e,t){this.parent.setRecordValue("startDate",e.ganttProperties.startDate,t.ganttProperties,!0),this.parent.setRecordValue("endDate",e.ganttProperties.endDate,t.ganttProperties,!0),this.parent.setRecordValue("duration",e.ganttProperties.duration,t.ganttProperties,!0),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,t.ganttProperties,!0),this.parent.setRecordValue("work",e.ganttProperties.work,t.ganttProperties,!0),this.parent.setRecordValue("type",e.ganttProperties.taskType,t.ganttProperties,!0),this.parent.setRecordValue("resourceNames",e.ganttProperties.resourceNames,t.ganttProperties,!0),this.parent.setRecordValue("resourceInfo",e.ganttProperties.resourceInfo,t.ganttProperties,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.startDate)||this.parent.dataOperation.updateMappingData(t,this.parent.taskFields.startDate),i.i(r.isNullOrUndefined)(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(t,this.parent.taskFields.endDate),i.i(r.isNullOrUndefined)(this.parent.taskFields.duration)||(this.parent.dataOperation.updateMappingData(t,this.parent.taskFields.duration),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,this.rowData,!0),0===this.rowData.ganttProperties.duration?this.parent.setRecordValue("isMilestone",!0,t.ganttProperties,!0):this.parent.setRecordValue("isMilestone",!1,this.rowData.ganttProperties,!0)),i.i(r.isNullOrUndefined)(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.work),i.i(r.isNullOrUndefined)(this.parent.taskFields.manual)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.manual),i.i(r.isNullOrUndefined)(this.parent.taskFields.type)||this.parent.dataOperation.updateMappingData(this.rowData,"type"),i.i(r.isNullOrUndefined)(this.parent.taskFields.resourceInfo)||this.parent.dataOperation.updateMappingData(this.rowData,"resourceInfo")},e.prototype.updatePredecessorTab=function(e){var t=e.ej2_instances[0];t.isEdit&&t.endEdit();for(var i=t.dataSource,r=[],n=[],a="",s=[],o=0;o<i.length;o++){var l=i[o];if(-1===s.indexOf(l.id)){var d=l.id+l.type;l.offset&&-1!==l.offset.indexOf("-")?d+=l.offset:d+="+"+l.offset,r.push(d),s.push(l.id)}}this.isEdit?(r.length>0?(n=this.parent.predecessorModule.calculatePredecessor(r.join(","),this.rowData),this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=this.parent.predecessorModule.getPredecessorStringValue(this.rowData)):(n=[],this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=""),this.parent.setRecordValue("predecessorsName",a,this.rowData.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,this.rowData),this.parent.setRecordValue(this.parent.taskFields.dependency,a,this.rowData),this.parent.predecessorModule.updateUnscheduledDependency(this.rowData)):this.addedRecord[this.parent.taskFields.dependency]=r.length>0?r.join(","):""},e.prototype.updateResourceTab=function(e){var t=e.ej2_instances[0];t&&t.grid.endEdit();var n=this.ganttResources;"ResourceView"!==this.parent.viewType||i.i(r.isNullOrUndefined)(this.rowData.ganttProperties)||(JSON.stringify(this.ganttResources)!==JSON.stringify(this.rowData.ganttProperties.resourceInfo)?(this.isResourceUpdate=!0,this.previousResource=i.i(r.isNullOrUndefined)(this.rowData.ganttProperties.resourceInfo)?[]:this.rowData.ganttProperties.resourceInfo.slice()):this.isResourceUpdate=!1);var a=[];if(this.isEdit)this.parent.setRecordValue("resourceInfo",n,this.editedRecord.ganttProperties,!0),this.parent.dataOperation.updateMappingData(this.editedRecord,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(this.editedRecord,"resource"),this.validateDuration(this.editedRecord),this.updateScheduleProperties(this.editedRecord,this.rowData);else{for(var s=0;s<n.length;s++)a.push(n[s][this.parent.resourceFields.id]),this.isAddNewResource=!0;this.addedRecord[this.parent.taskFields.resourceInfo]=a}},e.prototype.updateNotesTab=function(e){var t=this.parent,i=e.ej2_instances[0];this.isEdit?(!1===t.columnByField[t.taskFields.notes].disableHtmlEncode?this.parent.setRecordValue("notes",i.getHtml(),this.rowData.ganttProperties,!0):this.parent.setRecordValue("notes",i.getText(),this.rowData.ganttProperties,!0),t.dataOperation.updateMappingData(this.rowData,"notes")):this.addedRecord[this.parent.taskFields.notes]=i.getHtml()},e.prototype.updateCustomTab=function(e){this.updateGeneralTab(e,!0)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var r=i(0),n=(i.n(r),i(4)),a=(i.n(n),i(5)),s=(i.n(a),i(1)),o=i(24),l=i(42),d=i(33),h=i(9),p=(i.n(h),i(21)),u=(i.n(p),i(29)),c=function(){function e(e){if(this.isFromDeleteMethod=!1,this.targetedRecords=[],this.isNewRecordAdded=!1,this.isValidatedEditedRecord=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.confirmDialog=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,this.isBreakLoop=!1,this.isResourceTaskDeleted=!1,this.deletedTaskDetails=[],this.parent=e,this.validatedChildItems=[],this.parent.editSettings.allowEditing&&"Auto"===this.parent.editSettings.mode&&(this.cellEditModule=new o.a(this.parent)),this.parent.taskFields.dependency&&(this.parent.connectorLineEditModule=new u.a(this.parent)),(this.parent.editSettings.allowAdding||this.parent.editSettings.allowEditing&&("Dialog"===this.parent.editSettings.mode||"Auto"===this.parent.editSettings.mode))&&(this.dialogModule=new d.a(this.parent)),this.parent.editSettings.allowTaskbarEditing&&(this.taskbarEditModule=new l.a(this.parent)),this.parent.editSettings.allowDeleting){var t=i.i(r.createElement)("div",{id:this.parent.element.id+"_deleteConfirmDialog"});this.parent.element.appendChild(t),this.renderDeleteConfirmDialog()}this.parent.treeGrid.recordDoubleClick=this.recordDoubleClick.bind(this),this.parent.treeGrid.editSettings.allowAdding=this.parent.editSettings.allowAdding,this.parent.treeGrid.editSettings.allowDeleting=this.parent.editSettings.allowDeleting,this.parent.treeGrid.editSettings.showDeleteConfirmDialog=this.parent.editSettings.showDeleteConfirmDialog,this.parent.treeGrid.editSettings.allowNextRowEdit=this.parent.editSettings.allowNextRowEdit,this.updateDefaultColumnEditors()}return e.prototype.getModuleName=function(){return"edit"},e.prototype.updateDefaultColumnEditors=function(){for(var e=[this.parent.taskFields.id,this.parent.taskFields.progress,this.parent.taskFields.resourceInfo,"taskType"],t=0;t<e.length;t++)if(!i.i(r.isNullOrUndefined)(e[t])&&e[t].length>0){var n=this.parent.getColumnByField(e[t],this.parent.treeGridModule.treeGridColumns);n&&(n.field===this.parent.taskFields.id?this.updateIDColumnEditParams(n):n.field===this.parent.taskFields.progress&&i.i(r.isNullOrUndefined)(n.edit)?this.updateProgessColumnEditParams(n):n.field===this.parent.taskFields.resourceInfo?this.updateResourceColumnEditor(n):"taskType"===n.field&&this.updateTaskTypeColumnEditor(n))}},e.prototype.updateIDColumnEditParams=function(e){var t={min:0,decimals:0,enableRtl:this.parent.enableRtl,validateDecimalOnType:!0,format:"n0",showSpinButton:!1};this.updateEditParams(e,t)},e.prototype.updateProgessColumnEditParams=function(e){var t={min:0,enableRtl:this.parent.enableRtl,decimals:0,validateDecimalOnType:!0,max:100,format:"n0"};this.updateEditParams(e,t)},e.prototype.updateEditParams=function(e,t){i.i(r.isNullOrUndefined)(e.edit)?(e.edit={},e.edit.params={}):i.i(r.isNullOrUndefined)(e.edit.params)&&(e.edit.params={}),i.i(r.extend)(t,e.edit.params),e.edit.params=t,this.parent.getColumnByField(e.field,this.parent.ganttColumns).edit=e.edit},e.prototype.updateResourceColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&i.i(r.isNullOrUndefined)(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getResourceEditor();var t=this.parent.getColumnByField(e.field,this.parent.ganttColumns);t.editType="dropdownedit",t.edit=e.edit}},e.prototype.getResourceEditor=function(){var e,t=this,a=this.parent.resourceFields,s={};return p.MultiSelect.Inject(p.CheckBoxSelection),s.write=function(i){t.parent.treeGridModule.currentEditRow={},e=new p.MultiSelect({dataSource:new n.DataManager(t.parent.resources),fields:{text:a.name,value:a.id},enableRtl:t.parent.enableRtl,mode:"CheckBox",showDropDownIcon:!0,popupHeight:"350px",delimiterChar:",",value:t.parent.treeGridModule.getResourceIds(i.rowData)}),e.appendTo(i.element)},s.read=function(e){var n=e.ej2_instances[0].value,s=[];i.i(r.isNullOrUndefined)(n)&&(n=[]);for(var o=0;o<n.length;o++)for(var l=0;l<t.parent.resources.length;l++)if(t.parent.resources[l][a.id]===n[o]){s.push(t.parent.resources[l][a.name]);break}return t.parent.treeGridModule.currentEditRow[t.parent.taskFields.resourceInfo]=n,s.join(",")},s.destroy=function(){e&&e.destroy()},s},e.prototype.updateTaskTypeColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&i.i(r.isNullOrUndefined)(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getTaskTypeEditor();var t=this.parent.getColumnByField(e.field,this.parent.ganttColumns);t.editType="dropdownedit",t.edit=e.edit}},e.prototype.getTaskTypeEditor=function(){var e,t=this,a={},s=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];return a.write=function(a){t.parent.treeGridModule.currentEditRow={},e=new p.DropDownList({dataSource:new n.DataManager(s),enableRtl:t.parent.enableRtl,fields:{value:"Value"},popupHeight:"350px",value:i.i(r.getValue)("taskType",a.rowData.ganttProperties)}),e.appendTo(a.element)},a.read=function(e){var i=e.ej2_instances[0].value;return t.parent.treeGridModule.currentEditRow.taskType=i,i},a.destroy=function(){e&&e.destroy()},a},e.prototype.reUpdateEditModules=function(){var e=this.parent.editSettings;if(e.allowEditing?(this.parent.editModule.cellEditModule&&"Dialog"===e.mode?(this.cellEditModule.destroy(),this.parent.treeGrid.recordDoubleClick=this.recordDoubleClick.bind(this)):i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule)&&"Auto"===e.mode&&(this.cellEditModule=new o.a(this.parent)),this.parent.editModule.dialogModule&&"Auto"===e.mode?this.parent.treeGrid.recordDoubleClick=void 0:i.i(r.isNullOrUndefined)(this.parent.editModule.dialogModule)&&(this.dialogModule=new d.a(this.parent))):(this.cellEditModule&&this.cellEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy()),e.allowDeleting&&e.showDeleteConfirmDialog){if(i.i(r.isNullOrUndefined)(this.confirmDialog)){var t=i.i(r.createElement)("div",{id:this.parent.element.id+"_deleteConfirmDialog"});this.parent.element.appendChild(t),this.renderDeleteConfirmDialog()}}else e.allowDeleting&&e.showDeleteConfirmDialog||this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy();e.allowTaskbarEditing?i.i(r.isNullOrUndefined)(this.parent.editModule.taskbarEditModule)&&(this.taskbarEditModule=new l.a(this.parent)):this.taskbarEditModule&&this.taskbarEditModule.destroy()},e.prototype.recordDoubleClick=function(e){if(this.parent.editSettings.allowEditing&&"Dialog"===this.parent.editSettings.mode){var t=void 0;if(e.row){var n=i.i(r.getValue)("rowIndex",e.row);t=this.parent.currentViewData[n]}i.i(r.isNullOrUndefined)(t)||this.dialogModule.openEditDialog(t)}this.parent.ganttChartModule.recordDoubleClick(e)},e.prototype.destroy=function(){this.cellEditModule&&this.cellEditModule.destroy(),this.taskbarEditModule&&this.taskbarEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy(),this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy()},e.prototype.updateRecordByID=function(e){if(!this.parent.readOnly){var t=this.parent.taskFields;if(i.i(r.isNullOrUndefined)(e)||i.i(r.isNullOrUndefined)(e[t.id]))return;var n="ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf("T"+e[t.id])]:this.parent.getRecordByID(e[t.id]);if(!i.i(r.isNullOrUndefined)(this.parent.editModule)&&n){this.parent.isOnEdit=!0,this.validateUpdateValues(e,n,!0),e[this.parent.taskFields.resourceInfo]&&(0===n.ganttProperties.duration&&this.parent.dataOperation.updateWorkWithDuration(n),this.updateResourceRelatedFields(n,"resource"),this.parent.dateValidationModule.calculateEndDate(n));var a=Object.keys(e);if(-1===a.indexOf(t.startDate)&&-1===a.indexOf(t.endDate)&&-1===a.indexOf(t.duration)||this.parent.dataOperation.calculateScheduledValues(n,n.taskData,!1),this.parent.dataOperation.updateWidthLeft(n),i.i(r.isUndefined)(e[this.parent.taskFields.dependency])||e[this.parent.taskFields.dependency]===n.ganttProperties.predecessorsName){var s={};s.data=n,"ResourceView"===this.parent.viewType&&(s.action="methodUpdate"),this.parent.editModule.initiateUpdateAction(s)}else this.parent.connectorLineEditModule.updatePredecessor(n,e[this.parent.taskFields.dependency])}}},e.prototype.validateUpdateValues=function(e,t,n){var a=this.parent,o=a.taskFields,l=i.i(s.d)(a.columnMapping),d=[],h=!1;i.i(r.isNullOrUndefined)(t[o.milestone])||!0===t[o.milestone]&&(t[o.milestone]=!1);for(var p=0,u=Object.keys(e);p<u.length;p++){var c=u[p];if(-1!==[o.startDate,o.endDate,o.duration].indexOf(c)){if(i.i(r.isNullOrUndefined)(e[""+c])&&!a.allowUnscheduledTasks)continue;if(n)if(o.duration===c)a.dataOperation.updateDurationValue(e[c],t.ganttProperties),t.ganttProperties.duration>0&&t.ganttProperties.isMilestone&&this.parent.setRecordValue("isMilestone",!1,t.ganttProperties,!0),a.dataOperation.updateMappingData(t,l[c]);else{var g="string"==typeof e[c]?new Date(e[c]):e[c];a.setRecordValue(l[c],g,t.ganttProperties,!0),a.dataOperation.updateMappingData(t,l[c])}else d.push(c),h=!0}else if(o.resourceInfo===c){var f=a.dataOperation.setResourceInfo(e);"ResourceView"===this.parent.viewType&&(JSON.stringify(f)!==JSON.stringify(t.ganttProperties.resourceInfo)?(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=i.i(r.isNullOrUndefined)(t.ganttProperties.resourceInfo)?[]:t.ganttProperties.resourceInfo.slice()):this.parent.editModule.dialogModule.isResourceUpdate=!1),t.ganttProperties.resourceInfo=f,a.dataOperation.updateMappingData(t,"resourceInfo")}else if(o.dependency===c);else if(-1!==[o.progress,o.notes,o.durationUnit,o.expandState,o.milestone,o.name,o.baselineStartDate,o.baselineEndDate,o.id,o.segments,o.cssClass].indexOf(c)){var m=a.columnByField[c],y=e[c];i.i(r.isNullOrUndefined)(m)||"datepickeredit"!==m.editType&&"datetimepickeredit"!==m.editType||(y=a.dataOperation.getDateFromFormat(y));var D=l[c];if(c===o.id)D="taskId";else if(c===o.name)D="taskName";else if(c===o.cssClass)D="cssClass";else if(c===o.milestone){if(D="isMilestone",!i.i(r.isNullOrUndefined)(o.duration)){var v=t.ganttProperties,w=e[o.duration];w=y?0:w<=0?1:w,a.setRecordValue(o.duration,w,t,!0),a.setRecordValue("duration",w,v,!0),a.setRecordValue("taskData."+o.duration,w,t)}}else if(c===o.segments&&!i.i(r.isNullOrUndefined)(t.ganttProperties.segments)&&(D="segments",e&&!i.i(r.isNullOrUndefined)(e[this.parent.taskFields.segments])&&e[this.parent.taskFields.segments].length>0)){for(var k=0,b=0;b<t.ganttProperties.segments.length;b++)k+=t.ganttProperties.segments[b].duration;var T=t.ganttProperties.startDate,S=this.parent.dataOperation.getEndDate(T,k,t.ganttProperties.durationUnit,t.ganttProperties,!1);a.setRecordValue("endDate",a.dataOperation.getDateFromFormat(S),t.ganttProperties,!0)}i.i(r.isNullOrUndefined)(D)||a.setRecordValue(D,y,t.ganttProperties,!0),(c===o.baselineStartDate||c===o.baselineEndDate)&&t.ganttProperties.baselineStartDate&&t.ganttProperties.baselineEndDate&&(a.setRecordValue("baselineStartDate",a.dataOperation.checkBaselineStartDate(t.ganttProperties.baselineStartDate),t.ganttProperties,!0),t.ganttProperties.baselineEndDate&&0===t.ganttProperties.baselineEndDate.getHours()&&86400!==this.parent.defaultEndTime&&a.dataOperation.setTime(this.parent.defaultEndTime,t.ganttProperties.baselineEndDate),a.setRecordValue("baselineEndDate",a.dataOperation.checkBaselineEndDate(t.ganttProperties.baselineEndDate),t.ganttProperties,!0),a.setRecordValue("baselineLeft",a.dataOperation.calculateBaselineLeft(t.ganttProperties),t.ganttProperties,!0),a.setRecordValue("baselineWidth",a.dataOperation.calculateBaselineWidth(t.ganttProperties),t.ganttProperties,!0)),a.setRecordValue("taskData."+c,y,t),c===o.segments&&e&&!i.i(r.isNullOrUndefined)(e[this.parent.taskFields.segments])&&e[this.parent.taskFields.segments].length>0&&a.dataOperation.setSegmentsInfo(t,!0),a.setRecordValue(c,y,t)}else if(o.indicators===c){var y=e[c];a.setRecordValue("indicators",y,t.ganttProperties,!0),a.setRecordValue("taskData."+c,y,t),a.setRecordValue(c,y,t)}else if(o.work===c)a.setRecordValue("work",e[c],t.ganttProperties,!0),this.parent.dataOperation.updateMappingData(t,"work"),this.parent.dataOperation.updateMappingData(t,"duration"),this.parent.dataOperation.updateMappingData(t,"endDate");else if(c===o.type)a.setRecordValue("taskType",e[c],t.ganttProperties,!0);else if(-1!==a.customColumns.indexOf(c)){var m=a.columnByField[c],y=e[c];i.i(r.isNullOrUndefined)(m.edit)&&("datepickeredit"!==m.editType&&"datetimepickeredit"!==m.editType||(y=a.dataOperation.getDateFromFormat(y))),a.setRecordValue("taskData."+c,y,t),a.setRecordValue(c,y,t)}else o.manual===c&&(a.setRecordValue("isAutoSchedule",!e[c],t.ganttProperties,!0),this.parent.setRecordValue(c,e[c],t),this.updateTaskScheduleModes(t))}h&&this.validateScheduleValues(d,t,e)},e.prototype.updateResourceRelatedFields=function(e,t){var n=e.ganttProperties,a=n.taskType,s=n.isAutoSchedule;if(!i.i(r.isNullOrUndefined)(n.resourceInfo))if(n.work>0||"work"===t)switch(a){case"FixedUnit":if(0===n.resourceInfo.length)return;s&&n.resourceInfo.length&&("work"===t||"resource"===t)?this.parent.dataOperation.updateDurationWithWork(e):s||"work"!==t?this.parent.dataOperation.updateWorkWithDuration(e):this.parent.dataOperation.updateUnitWithWork(e);break;case"FixedWork":if(0===n.resourceInfo.length)return;s?"duration"===t||"endDate"===t?(this.parent.dataOperation.updateUnitWithWork(e),0===n.duration&&(this.parent.setRecordValue("work",0,n,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(e,"work"))):this.parent.dataOperation.updateDurationWithWork(e):"work"===t?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e);break;case"FixedDuration":n.resourceInfo.length&&"work"===t?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e)}else this.parent.dataOperation.updateWorkWithDuration(e)},e.prototype.validateScheduleValues=function(e,t,i){var r=this.parent;e.length>2?r.dataOperation.calculateScheduledValues(t,i,!1):e.length>1?this.validateScheduleByTwoValues(i,e,t):this.dialogModule.validateScheduleValuesByCurrentField(e[0],i[e[0]],t)},e.prototype.validateScheduleByTwoValues=function(e,t,i){var r,n,a,s=this.parent,o=s.taskFields,l=i.ganttProperties,d=s.allowUnscheduledTasks;-1!==t.indexOf(o.startDate)&&(r=e[o.startDate]),-1!==t.indexOf(o.endDate)&&(n=e[o.endDate]),-1!==t.indexOf(o.duration)&&(a=e[o.duration]),r&&n||d&&-1!==t.indexOf(o.startDate)&&-1!==t.indexOf(o.endDate)?(s.setRecordValue("startDate",s.dataOperation.getDateFromFormat(r),l,!0),s.setRecordValue("endDate",s.dataOperation.getDateFromFormat(n),l,!0),s.dataOperation.calculateDuration(i)):n&&a||d&&-1!==t.indexOf(o.endDate)&&-1!==t.indexOf(o.duration)?(s.setRecordValue("endDate",s.dataOperation.getDateFromFormat(n),l,!0),s.dataOperation.updateDurationValue(a,l)):(r&&a||d&&-1!==t.indexOf(o.startDate)&&-1!==t.indexOf(o.duration))&&(s.setRecordValue("startDate",s.dataOperation.getDateFromFormat(r),l,!0),s.dataOperation.updateDurationValue(a,l))},e.prototype.isTaskbarMoved=function(e){var t=!1,n=e.ganttProperties,a=this.parent.previousRecords&&this.parent.previousRecords[e.uniqueID];if(a&&a.ganttProperties){var s=i.i(r.getValue)("ganttProperties.startDate",a),o=i.i(r.getValue)("ganttProperties.endDate",a),l=i.i(r.getValue)("ganttProperties.duration",a),d=i.i(r.getValue)("ganttProperties.durationUnit",a),h=Object.keys(a.ganttProperties);-1===h.indexOf("startDate")&&-1===h.indexOf("endDate")&&-1===h.indexOf("duration")&&-1===h.indexOf("durationUnit")||(i.i(r.isNullOrUndefined)(s)&&!i.i(r.isNullOrUndefined)(n.startDate)||i.i(r.isNullOrUndefined)(o)&&!i.i(r.isNullOrUndefined)(n.endDate)||i.i(r.isNullOrUndefined)(n.startDate)&&!i.i(r.isNullOrUndefined)(s)||i.i(r.isNullOrUndefined)(n.endDate)&&!i.i(r.isNullOrUndefined)(o)||s&&s.getTime()!==n.startDate.getTime()||o&&o.getTime()!==n.endDate.getTime()||!i.i(r.isNullOrUndefined)(l)&&l!==n.duration||!i.i(r.isNullOrUndefined)(l)&&l===n.duration&&d!==n.durationUnit)&&(t=!0)}return t},e.prototype.isPredecessorUpdated=function(e){var t=!1,i=this.parent.previousRecords[e.uniqueID];return i&&i.ganttProperties&&i.ganttProperties.hasOwnProperty("predecessor")&&(e.ganttProperties.predecessorsName!==i.ganttProperties.predecessorsName?t=!0:this.parent.setRecordValue("predecessor",i.ganttProperties.predecessor,e.ganttProperties,!0)),t},e.prototype.isCheckPredecessor=function(e){var t=!1;return this.parent.previousRecords[e.uniqueID]&&this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation&&this.parent.predecessorModule.getValidPredecessor(e).length>0&&this.isTaskbarMoved(e)&&(t=!0),t},e.prototype.updateGanttProperties=function(e,t){var i=["taskId","uniqueID","rowUniqueID","parentId"];Object.keys(e.ganttProperties).forEach(function(r){-1===i.indexOf(r)&&(t.ganttProperties[r]=e.ganttProperties[r])})},e.prototype.initiateUpdateAction=function(e){var t,n,a=this.isCheckPredecessor(e.data);if(i.i(r.isNullOrUndefined)(e.data.parentItem)||a){if(e.data.childRecords.length>0&&!a&&!(a=this.isCheckPredecessor(e.data))&&this.isTaskbarMoved(e.data))for(var s=0;s<e.data.childRecords.length;s++)this.parent.predecessorModule.getValidPredecessor(e.data.childRecords[s]).length>0&&(n=s,a=!0)}else t=this.parent.getRecordByID(e.data.parentItem.taskId),a=!!(this.isTaskbarMoved(e.data)&&this.parent.predecessorModule.getValidPredecessor(t).length>0&&this.parent.isInPredecessorValidation);this.taskbarMoved=this.isTaskbarMoved(e.data),this.predecessorUpdated=this.isPredecessorUpdated(e.data),this.predecessorUpdated&&(this.parent.isConnectorLineUpdate=!0,this.parent.connectorLineEditModule.addRemovePredecessor(e.data));var o={};if(a)if(o=i.i(r.isNullOrUndefined)(t)?i.i(r.isNullOrUndefined)(n)?this.parent.connectorLineEditModule.validateTypes(e.data):this.parent.connectorLineEditModule.validateTypes(e.data.childRecords[n],e.data):this.parent.connectorLineEditModule.validateTypes(t,e.data),this.parent.isConnectorLineUpdate=!0,i.i(r.isNullOrUndefined)(i.i(r.getValue)("violationType",o)))this.updateEditedTask(e);else{var l=this.validateTaskEvent(e);!1===l.validateMode.preserveLinkWithEditing&&!1===l.validateMode.removeLink&&!1===l.validateMode.respectLink?this.parent.connectorLineEditModule.openValidationDialog(o):(this.parent.editModule&&this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.isEdit&&this.predecessorUpdated&&(this.isValidatedEditedRecord=!0,this.parent.predecessorModule.validatePredecessor(e.data,[],"")),this.parent.connectorLineEditModule.applyPredecessorOption())}else this.taskbarMoved&&(this.parent.isConnectorLineUpdate=!0),this.updateEditedTask(e)},e.prototype.validateTaskEvent=function(e){var t={};return this.resetValidateArgs(),this.parent.currentEditedArgs=t,t.cancel=!1,t.data=e.data,t.requestType="validateLinkedTask",t.validateMode=this.parent.dialogValidateMode,t.editEventArgs=e,this.parent.actionBeginTask(t),t},e.prototype.resetValidateArgs=function(){this.parent.dialogValidateMode.preserveLinkWithEditing=!0,this.parent.dialogValidateMode.removeLink=!1,this.parent.dialogValidateMode.respectLink=!1},e.prototype.updateEditedTask=function(e){var t=e.data;if(this.parent.autoCalculateDateScheduling&&this.updateParentChildRecord(t),this.parent.isConnectorLineUpdate&&this.parent.autoCalculateDateScheduling){for(var i=0;i<this.validatedChildItems.length;i++){var r=this.validatedChildItems[i];r.ganttProperties.predecessor&&r.ganttProperties.predecessor.length>0&&(this.parent.editedTaskBarItem=r,this.parent.predecessorModule.validatePredecessor(r,[],""))}this.parent.predecessorModule.isValidatedParentTaskID="",t.ganttProperties.predecessor&&(this.parent.isMileStoneEdited=t.ganttProperties.isMilestone,this.taskbarMoved&&(this.parent.editedTaskBarItem=t),this.isValidatedEditedRecord||this.parent.predecessorModule.validatePredecessor(t,[],""),this.isValidatedEditedRecord=!1,this.parent.predecessorModule.isValidatedParentTaskID=""),this.parent.allowParentDependency&&t.hasChildRecords&&this.parent.previousRecords[t.uniqueID].ganttProperties.startDate&&"DrawConnectorLine"===e.action&&this.updateChildItems(t),this.updateParentItemOnEditing(),this.parent.dataOperation.updateParentItems(t,!0)}if(t.parentItem){this.parent.autoCalculateDateScheduling&&this.parent.dataOperation.updateParentItems(t,!0);var n=this.parent.getRecordByID(t.parentItem.taskId);n.ganttProperties.predecessorsName||(this.parent.predecessorModule.validatePredecessor(n,[],""),this.updateParentItemOnEditing())}this.parent.UpdateOffsetOnTaskbarEdit&&this.parent.connectorLineEditModule&&e.data&&this.parent.connectorLineEditModule.calculateOffset(e.data),this.parent.predecessorModule.validatedParentIds=[],this.initiateSaveAction(e)},e.prototype.updateParentItemOnEditing=function(){for(var e=i.i(r.getValue)("parentRecord",this.parent.predecessorModule),t=0;t<e.length;t++)this.parent.dataOperation.updateParentItems(e[t]);i.i(r.setValue)("parentRecord",[],this.parent.predecessorModule),i.i(r.setValue)("parentIds",[],this.parent.predecessorModule)},e.prototype.updateParentChildRecord=function(e){var t=e;!t.hasChildRecords||!this.taskbarMoved||!1!==t[this.parent.taskFields.manual]&&"Auto"!==this.parent.taskMode||i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isResourceCellEdited||this.updateChildItems(t),i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule)||(this.parent.editModule.cellEditModule.isResourceCellEdited=!1)},e.prototype.updateTaskScheduleModes=function(e){var t=e[this.parent.taskFields.startDate],i=e.ganttProperties;if(e.hasChildRecords&&i.isAutoSchedule)this.parent.setRecordValue("startDate",i.autoStartDate,i,!0),this.parent.setRecordValue("endDate",i.autoEndDate,i,!0),this.parent.setRecordValue("StartDate",i.autoStartDate,e,!0),this.parent.setRecordValue("EndDate",i.autoEndDate,e,!0),this.parent.setRecordValue("taskData.StartDate",i.autoStartDate,e,!0),this.parent.setRecordValue("taskData.EndDate",i.autoEndDate,e,!0),this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e,!0),i,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(i,!0),i,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(i.width,i.progress),i,!0),this.parent.dataOperation.calculateDuration(e);else if(e.hasChildRecords&&!i.isAutoSchedule)this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.calculateDuration(e),this.parent.setRecordValue("autoStartDate",i.autoStartDate,i,!0),this.parent.setRecordValue("autoEndDate",i.autoEndDate,i,!0),this.parent.setRecordValue("autoDuration",this.parent.dataOperation.calculateAutoDuration(e),i,!0),this.parent.dataOperation.updateAutoWidthLeft(e);else{var r=this.parent.dateValidationModule.checkStartDate(t,e.ganttProperties);this.parent.setRecordValue("startDate",r,e.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e,"startDate"),this.parent.dateValidationModule.calculateEndDate(e),this.parent.setRecordValue("taskData."+this.parent.taskFields.manual,e[this.parent.taskFields.manual],e),this.parent.dataOperation.updateWidthLeft(e)}},e.prototype.calculateDateByRoundOffDuration=function(e,t){var n=e,a=n.ganttProperties,s=new Date(t.getTime());if(!i.i(r.isNullOrUndefined)(a.endDate)&&i.i(r.isNullOrUndefined)(a.startDate)){var o=this.parent.dateValidationModule.checkStartDate(s,a,null);this.parent.setRecordValue("endDate",this.parent.dateValidationModule.checkEndDate(o,n.ganttProperties),a,!0)}else this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(s,a,!1),a,!0),i.i(r.isNullOrUndefined)(a.duration)||this.parent.dateValidationModule.calculateEndDate(n);this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(n)},e.prototype.updateParentProgress=function(e){var t=0,n=this.parent.getParentTask(e),a=n.childRecords,o=a?a.length:0,l=0,d=0,h=0,p=0,u={};if(a){for(var c=0;c<o;c++)a[c].ganttProperties.isMilestone&&!a[c].hasChildRecords||!i.i(s.c)(a[c].ganttProperties)?d+=1:(u=this.parent.dataOperation.getParentProgress(a[c]),l+=i.i(r.getValue)("totalProgress",u),p+=i.i(r.getValue)("totalDuration",u));h=o-d,t=h>0?Math.round(l/p):0,isNaN(t)&&(t=0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(n.ganttProperties.isAutoSchedule?n.ganttProperties.width:n.ganttProperties.autoWidth,t),n.ganttProperties,!0),this.parent.setRecordValue("progress",Math.floor(t),n.ganttProperties,!0),this.parent.setRecordValue("totalProgress",l,n.ganttProperties,!0),this.parent.setRecordValue("totalDuration",p,n.ganttProperties,!0)}this.parent.dataOperation.updateTaskData(n),n.parentItem&&this.updateParentProgress(n.parentItem)},e.prototype.revertCellEdit=function(e){this.parent.editModule.reUpdatePreviousRecords(!1,!0),this.resetEditProperties()},e.prototype.reUpdatePreviousRecords=function(e,t){for(var i=this.parent.previousRecords,r=Object.keys(i),n=0;n<r.length;n++){var a=r[n],s=i[a],o=this.parent.getTaskByUniqueID(a);this.copyTaskData(o.taskData,s.taskData),delete s.taskData,this.copyTaskData(o.ganttProperties,s.ganttProperties),delete s.ganttProperties,this.copyTaskData(o,s);var l=this.parent.currentViewData.indexOf(o);if(e&&this.parent.chartRowsModule.refreshRow(l),t){var d="ProjectView"===this.parent.viewType?o.ganttProperties.taskId:o.ganttProperties.rowUniqueID;this.parent.treeGrid.grid.setRowData(d,o);this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[l].getAttribute("data-uid")).data=o}}},e.prototype.copyTaskData=function(e,t){i.i(r.isNullOrUndefined)(t)||i.i(r.extend)(e,t)},e.prototype.updateScheduleDatesOnEditing=function(e){},e.prototype.updateChildItems=function(e){var t,n=this.parent.previousRecords[e.uniqueID];i.i(r.isNullOrUndefined)(n)||i.i(r.isNullOrUndefined)(n)&&!i.i(r.isNullOrUndefined)(n.ganttProperties)?t=new Date(e.ganttProperties.startDate.getTime()):i.i(r.isNullOrUndefined)(n.ganttProperties.startDate)||(t=new Date(n.ganttProperties.startDate.getTime()));var a,o,l,d,h,p=e.ganttProperties.startDate,u=[];if(this.getUpdatableChildRecords(e,u),0!==u.length){!i.i(r.isNullOrUndefined)(t)&&!i.i(r.isNullOrUndefined)(p)&&t.getTime()>p.getTime()?(a=this.parent.dateValidationModule.checkStartDate(p),o=this.parent.dateValidationModule.checkEndDate(t,e.ganttProperties),d=!1):(a=this.parent.dateValidationModule.checkStartDate(t),o=this.parent.dateValidationModule.checkEndDate(p,e.ganttProperties),d=!0),h=!i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(o)&&a.getTime()>=o.getTime()?0:this.parent.dateValidationModule.getDuration(a,o,"minute",!0,!1);for(var c=0;c<u.length;c++)if(u[c].ganttProperties.isAutoSchedule)if(h>0){var g=i.i(s.c)(u[c].ganttProperties)?u[c].ganttProperties.startDate:u[c].ganttProperties.startDate?u[c].ganttProperties.startDate:u[c].ganttProperties.endDate?u[c].ganttProperties.endDate:new Date(t.toString());l=d?this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(g,u[c].ganttProperties,u[c].ganttProperties.isMilestone),h,"minute",u[c].ganttProperties,!1):this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(g,u[c].ganttProperties),h,"minute",u[c].ganttProperties),this.calculateDateByRoundOffDuration(u[c],l),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(u[c])&&this.validatedChildItems.push(u[c])}else if(i.i(r.isNullOrUndefined)(n)){l=t;var f=this.parent.initialLoadData[u[c].index];this.parent.isLoad?this.calculateDateByRoundOffDuration(f,l):this.calculateDateByRoundOffDuration(u[c],l),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(u[c])&&this.validatedChildItems.push(u[c])}u.length&&this.parent.dataOperation.updateParentItems(e,!0)}},e.prototype.getUpdatableChildRecords=function(e,t){for(var i=e.childRecords,r=0;r<i.length;r++)i[r].ganttProperties.isAutoSchedule&&(t.push(i[r]),i[r].hasChildRecords&&this.getUpdatableChildRecords(i[r],t))},e.prototype.initiateSaveAction=function(e){var t=this,a={};a.requestType="beforeSave",a.data=e.data,a.cancel=!1,a.modifiedRecords=this.parent.editedRecords,i.i(r.isNullOrUndefined)(e.target)||(a.target=e.target),a.modifiedTaskData=i.i(s.e)(this.parent.editedRecords,!0),e.action&&"DrawConnectorLine"===e.action&&(a.action="DrawConnectorLine"),this.parent.trigger("actionBegin",a,function(o){if(i.i(r.isNullOrUndefined)(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),o.cancel)t.reUpdatePreviousRecords(),t.parent.chartRowsModule.refreshRecords([e.data]),t.resetEditProperties(a);else if(o.modifiedTaskData=i.i(s.e)(o.modifiedRecords,null,null,t.parent),i.i(s.f)(t.parent.dataSource)){var l=t.parent.dataSource,d={changedRecords:o.modifiedTaskData},h=t.parent.query instanceof n.Query?t.parent.query:new n.Query,p=null,u=l.adaptor;if(u instanceof n.WebApiAdaptor&&u instanceof n.ODataAdaptor&&!l.dataSource.batchUrl){p=l.update(t.parent.taskFields.id,d.changedRecords,null,h)}else p=l.saveChanges(d,t.parent.taskFields.id,null,h);p.then(function(i){return t.dmSuccess(i,e)}).catch(function(i){return t.dmFailure(i,e)})}else t.saveSuccess(e)})},e.prototype.dmSuccess=function(e,t){var i,r;i=e.changedRecords?e.changedRecords.length:e.length;for(var n=0;n<i;n++){r=e.changedRecords?e.changedRecords[parseInt(n.toString(),10)]:e[parseInt(n.toString(),10)];for(var a=Object.keys(r).length,s=0,o=Object.keys(r);s<a;s++){var l=o[parseInt(s.toString(),10)];this.parent.editedRecords[parseInt(n.toString(),10)][""+l]=r[""+l],this.parent.editedRecords[parseInt(n.toString(),10)].taskData[""+l]=r[""+l]}null!==this.parent.taskFields.id&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.taskId=r[this.parent.taskFields.id]),null!==this.parent.taskFields.name&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.taskName=r[this.parent.taskFields.name]),null!==this.parent.taskFields.startDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.startDate=r[this.parent.taskFields.startDate]),null!==this.parent.taskFields.endDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.endDate=r[this.parent.taskFields.endDate]),null!==this.parent.taskFields.duration&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.duration=parseInt(r[this.parent.taskFields.duration])),null!==this.parent.taskFields.durationUnit&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.durationUnit=r[this.parent.taskFields.durationUnit]),null!==this.parent.taskFields.progress&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.progress=r[this.parent.taskFields.progress]),null!==this.parent.taskFields.dependency&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.dependency=r[this.parent.taskFields.dependency]),null!==this.parent.taskFields.parentID&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.parentID=r[this.parent.taskFields.parentID]),null!==this.parent.taskFields.baselineEndDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.baselineEndDate=r[this.parent.taskFields.baselineEndDate]),null!==this.parent.taskFields.baselineStartDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.baselineStartDate=r[this.parent.taskFields.baselineStartDate]),null!==this.parent.taskFields.resourceInfo&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.resources=r[this.parent.taskFields.resourceInfo])}this.saveSuccess(t)},e.prototype.dmFailure=function(e,t){if(this.deletedTaskDetails.length){for(var i=this.deletedTaskDetails,r=0;r<i.length;r++)i[r].isDelete=!1;this.deletedTaskDetails=[]}this.reUpdatePreviousRecords(!0,!0),this.resetEditProperties(),this.parent.trigger("actionFailure",{error:e})},e.prototype.updateSharedTask=function(e){for(var t=e.ganttProperties.sharedTaskUniqueIds,n=0;n<t.length;n++){var a=this.parent.flatData[this.parent.ids.indexOf(t[n].toString())];a&&a.uniqueID!==e.uniqueID&&(this.updateGanttProperties(e,a),this.parent.setRecordValue("taskData",e.taskData,a,!0),this.parent.dataOperation.updateTaskData(a),this.parent.dataOperation.updateResourceName(a),i.i(r.isNullOrUndefined)(a.parentItem)||this.parent.dataOperation.updateParentItems(a.parentItem))}},e.prototype.saveSuccess=function(e){var t={};if(this.parent.timelineSettings.updateTimescaleView){var n=this.parent.editedRecords;this.parent.timelineModule.updateTimeLineOnEditing([n],e.action)}if("ResourceView"===this.parent.viewType){"TaskbarEditing"===e.action||"DrawConnectorLine"===e.action?this.updateSharedTask(e.data):"DialogEditing"!==e.action&&"CellEditing"!==e.action&&"methodUpdate"!==e.action||(this.parent.editModule.dialogModule.isResourceUpdate?(this.updateResoures(this.parent.editModule.dialogModule.previousResource,e.data.ganttProperties.resourceInfo,e.data),this.updateSharedTask(e.data),this.isTreeGridRefresh=!0):this.updateSharedTask(e.data));for(var a=0;a<this.updateParentRecords.length;a++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[a]);this.updateParentRecords=[],this.parent.editModule.dialogModule.isResourceUpdate=!1,this.parent.editModule.dialogModule.previousResource=[]}if(this.isTreeGridRefresh||(this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation&&(this.parent.contentHeight=this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,this.parent.ganttChartModule.chartBodyContent.style.height=this.parent.contentHeight+"px",this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData),this.parent.taskFields.dependency&&this.parent.ganttChartModule.reRenderConnectorLines()),this.parent.isConnectorLineUpdate&&!i.i(r.isNullOrUndefined)(this.parent.connectorLineEditModule)&&(this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.editedRecords),this.updateScheduleDatesOnEditing(e))),this.parent.enableCriticalPath){var o=this.parent.criticalPathModule;o.showCriticalPath(!0),o.criticalConnectorLine(o.criticalPathCollection,o.detailPredecessorCollection,!0,o.predecessorCollectionTaskIds)}!this.parent.editSettings.allowTaskbarEditing||this.parent.editSettings.allowTaskbarEditing&&!this.taskbarEditModule.dependencyCancel?(t.requestType="save",t.data=e.data,t.modifiedRecords=this.parent.editedRecords,t.modifiedTaskData=i.i(s.e)(this.parent.editedRecords,null,null,this.parent),i.i(r.isNullOrUndefined)(e.action)||i.i(r.setValue)("action",e.action,t),"TaskbarEditing"===e.action&&(t.taskBarEditAction=e.taskBarEditAction),this.endEditAction(e),this.parent.trigger("actionComplete",t),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()):(this.taskbarEditModule.dependencyCancel=!1,this.resetEditProperties()),"ResourceView"===this.parent.viewType&&this.isTreeGridRefresh&&(this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.isTreeGridRefresh=!1)},e.prototype.updateResoures=function(e,t,i){var r=this.parent.flatData,n=t?t.length:0,a=e?e.length:0;if(0!==n||0!==a){for(var s=0;s<n;s++){var o=[],l=parseInt(t[s][this.parent.resourceFields.id],10).toString();"NaN"===l&&(l=t[s][this.parent.resourceFields.id]);for(var d=0;d<e.length;d++){var h=parseInt(e[d][this.parent.resourceFields.id],10).toString();if("NaN"===h&&(h=e[d][this.parent.resourceFields.id]),h===l){o.push(d);break}}if(0===o.length){var p=r[this.parent.getTaskIds().indexOf("R"+l)];p&&this.addNewRecord(i,p)}else{var u=parseInt(o[0].toString(),10);"NaN"===u.toString()&&(u=o[0].toString()),e.splice(u,1)}}for(var c=e?e.length:0,s=0;s<c;s++)for(var g=i.ganttProperties.taskId,l=e[s][this.parent.resourceFields.id],f=r[this.parent.getTaskIds().indexOf("R"+l)],m=0;m<f.childRecords.length;m++)f.childRecords[m].ganttProperties.taskId===g&&this.removeChildRecord(f.childRecords[m]);if(n>0){var y=this.parent.getParentTask(i.parentItem);y&&y.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.removeChildRecord(i)}0===n&&this.checkWithUnassignedTask(i)}},e.prototype.checkWithUnassignedTask=function(e){for(var t=null,n=0;n<this.parent.flatData.length;n++)this.parent.flatData[n].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&(t=this.parent.flatData[n]);if(i.i(r.isNullOrUndefined)(t)){var a={};a[this.parent.taskFields.id]=0,a[this.parent.taskFields.name]=this.parent.localeObj.getConstant("unassignedTask");var s=this.parent.isOnEdit;this.parent.isOnEdit=!1;var o=this.parent.dataOperation.createRecord(a,0);this.parent.isOnEdit=s,this.addRecordAsBottom(o);var l=this.parent.flatData[this.parent.flatData.length-1];this.addNewRecord(e,l);this.parent.dataSource.push(e.taskData)}else this.addNewRecord(e,t);var d=this.parent.currentViewData.filter(function(t){return t.ganttProperties.taskId===e.ganttProperties.taskId&&t.hasChildRecords===e.hasChildRecords})[0];e.parentItem=d.parentItem,e.parentUniqueID=d.parentUniqueID},e.prototype.addRecordAsBottom=function(e){var t=this.parent.flatData.length;this.parent.currentViewData.splice(t+1,0,e),this.parent.flatData.splice(t+1,0,e),this.parent.ids.splice(t+1,0,e.ganttProperties.rowUniqueID.toString());var i=0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId;this.parent.getTaskIds().splice(t+1,0,i),this.updateTreeGridUniqueID(e,"add")},e.prototype.addNewRecord=function(e,t){var n=null;n=i.i(r.extend)({},{},e,!0),this.parent.setRecordValue("uniqueID",i.i(a.getUid)(this.parent.element.id+"_data_"),n),this.parent.setRecordValue("uniqueID",n.uniqueID,n.ganttProperties,!0);var s=n.uniqueID.replace(this.parent.element.id+"_data_","");this.parent.setRecordValue("rowUniqueID",s,n),this.parent.setRecordValue("rowUniqueID",s,n.ganttProperties,!0),this.parent.setRecordValue("level",1,n),this.parent.taskFields.parentID&&this.parent.setRecordValue("parentId",t.ganttProperties.taskId,n.ganttProperties,!0),this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(t),n);var o=n.parentItem?n.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",o,n),e.ganttProperties.sharedTaskUniqueIds.push(s),n.ganttProperties.sharedTaskUniqueIds=e.ganttProperties.sharedTaskUniqueIds,this.addRecordAsChild(t,n)},e.prototype.removeChildRecord=function(e){var t=this.parent,i=[];i=this.parent.dataSource instanceof n.DataManager&&this.parent.dataSource.dataSource.json.length>0?this.parent.dataSource.dataSource.json:this.parent.currentViewData;var r=this.parent.dataSource,a=e,s=this.parent.getParentTask(a.parentItem);if(a){if(a.parentItem){var o=s?s.childRecords:[],l=0;o&&o.length>0&&(1===o.length&&(this.parent.isOnDelete=!0,o[0].isDelete=!0,this.parent.dataOperation.updateParentItems(s),this.parent.isOnDelete=!1,o[0].isDelete=!1),l=o.indexOf(a),s.childRecords.splice(l,1),this.updateParentRecords.push(s))}if(a.ganttProperties.sharedTaskUniqueIds.length){var d=a.ganttProperties.sharedTaskUniqueIds.indexOf(a.ganttProperties.rowUniqueID);a.ganttProperties.sharedTaskUniqueIds.splice(d,1)}if(this.updateTreeGridUniqueID(a,"delete"),!this.parent.taskFields.parentID){var h=[];h.push(a.ganttProperties.rowUniqueID.toString()),"ProjectView"===this.parent.viewType&&this.parent.editModule.removeFromDataSource(h)}var p=this.parent.flatData.indexOf(a);if(t.taskFields.parentID){for(var u=void 0,c=this.parent.currentViewData,g=0;g<c.length;g++)c[g].ganttProperties.rowUniqueID===a.ganttProperties.rowUniqueID&&(u=g);-1!==u&&(r.length>0&&r.splice(u,1),i.splice(u,1),this.parent.flatData.splice(p,1),this.parent.ids.splice(p,1),this.parent.getTaskIds().splice(p,1))}var f=i.indexOf(a);if(!t.taskFields.parentID){var m=this.parent.editModule.getChildCount(a,0);i.splice(f,m+1),this.parent.flatData.splice(p,m+1),this.parent.ids.splice(p,m+1),this.parent.getTaskIds().splice(p,m+1)}a.parentItem&&s&&s.childRecords&&!s.childRecords.length&&(this.parent.setRecordValue("expanded",!1,s),this.parent.setRecordValue("hasChildRecords",!1,s))}},e.prototype.addRecordAsChild=function(e,t){var n,a=this.parent,s=this.parent.flatData.indexOf(e),o=this.parent.editModule.getChildCount(e,0);if(!i.i(r.isNullOrUndefined)(this.addRowIndex)&&this.addRowPosition&&e.childRecords&&"Child"!==this.addRowPosition){var l=e.childRecords[this.addRowIndex],d="Above"===this.addRowPosition||"Below"===this.addRowPosition?this.addRowPosition:"Child";n=l?this.addRowIndex+s+1:o+s+1,n="Above"===d?n:n+1}else n=i.i(r.isNullOrUndefined)(o)||0===o?s+1:o+s+1;this.parent.currentViewData.splice(n,0,t),this.parent.flatData.splice(n,0,t),this.parent.ids.splice(n,0,t.ganttProperties.rowUniqueID.toString()),this.updateTreeGridUniqueID(t,"add");var h=0===t.level?"R"+t.ganttProperties.taskId:"T"+t.ganttProperties.taskId;this.parent.getTaskIds().splice(n,0,h),e.hasChildRecords||(this.parent.setRecordValue("hasChildRecords",!0,e),this.parent.setRecordValue("expanded",!0,e),e.childRecords.length||(e.childRecords=[],!a.taskFields.parentID&&i.i(r.isNullOrUndefined)(e.taskData[this.parent.taskFields.child])&&(e.taskData[this.parent.taskFields.child]=[]))),e.childRecords.splice(e.childRecords.length,0,t),i.i(r.isNullOrUndefined)(t)||this.parent.taskFields.parentID||i.i(r.isNullOrUndefined)(e.taskData[this.parent.taskFields.child])||e.taskData[this.parent.taskFields.child].splice(e.childRecords.length,0,t.taskData),i.i(r.isNullOrUndefined)(t.parentItem)||this.updateParentRecords.push(e)},e.prototype.resetEditProperties=function(e){this.parent.currentEditedArgs={},this.resetValidateArgs(),this.parent.editedTaskBarItem=null,this.parent.isOnEdit=!1,this.validatedChildItems=[],this.parent.isConnectorLineUpdate=!1,this.parent.editedTaskBarItem=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,i.i(r.isNullOrUndefined)(this.dialogModule)||!i.i(r.isNullOrUndefined)(e)&&(i.i(r.isNullOrUndefined)(e)||"beforeSave"!==e.requestType||e.cancel)||(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose()),this.parent.hideSpinner(),this.parent.initiateEditAction(!1)},e.prototype.endEditAction=function(e){this.resetEditProperties(),"TaskbarEditing"===e.action?this.parent.trigger("taskbarEdited",e):"CellEditing"===e.action?this.parent.trigger("endEdit",e):"DialogEditing"===e.action&&(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose())},e.prototype.saveFailed=function(e){this.reUpdatePreviousRecords(),this.parent.hideSpinner()},e.prototype.renderDeleteConfirmDialog=function(){var e=new h.Dialog({width:"320px",isModal:!0,visible:!1,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmDelete"),buttons:[{click:this.confirmDeleteOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.closeConfirmDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});e.appendTo("#"+this.parent.element.id+"_deleteConfirmDialog"),this.confirmDialog=e},e.prototype.closeConfirmDialog=function(){this.confirmDialog.hide()},e.prototype.confirmDeleteOkButton=function(){this.deleteSelectedItems(),this.confirmDialog.hide(),this.parent.element.querySelector(".e-treegrid").focus()},e.prototype.startDeleteAction=function(){if(this.parent.editSettings.allowDeleting&&!this.parent.readOnly)if(this.parent.editSettings.showDeleteConfirmDialog)this.confirmDialog.show();else{this.deleteSelectedItems();var e=this.parent.element.querySelector(".e-treegrid");e.focus()}},e.prototype.deleteResourceRecords=function(e){for(var t=[],i=this,r=0;r<e.length;r++)!function(r){if(e[r].parentItem){if(1===e[r].ganttProperties.sharedTaskUniqueIds.length){for(var n=e[r],a=n.ganttProperties.sharedTaskUniqueIds,s=0;s<a.length;s++)-1!==i.parent.ids.indexOf(a[s].toString())&&t.push(i.parent.flatData[i.parent.ids.indexOf(a[s].toString())]);-1!==i.parent.ids.indexOf(n.ganttProperties.rowUniqueID)&&t.push(i.parent.flatData[i.parent.ids.indexOf(n.ganttProperties.rowUniqueID)])}}else{var o=i.parent.flatData.filter(function(t){return t.ganttProperties.taskId===e[r].ganttProperties.taskId&&t.hasChildRecords})[0];t.push(o)}}(r);this.deleteRow(t)},e.prototype.deleteSelectedItems=function(){if(this.isFromDeleteMethod)this.targetedRecords.length&&("ResourceView"===this.parent.viewType?this.deleteResourceRecords(this.targetedRecords):this.deleteRow(this.targetedRecords)),this.isFromDeleteMethod=!1;else{var e=[];"Cell"!==this.parent.selectionSettings.mode?e=this.parent.selectionModule.getSelectedRecords():"Cell"===this.parent.selectionSettings.mode&&(e=this.parent.selectionModule.getCellSelectedRecords()),"ResourceView"===this.parent.viewType?this.deleteResourceRecords(e):this.deleteRow(e)}},e.prototype.deleteRecord=function(e){this.isFromDeleteMethod=!0;var t=typeof e;switch(this.targetedRecords=[],t){case"number":case"string":var n=e.toString();"ResourceView"===this.parent.viewType?i.i(r.isNullOrUndefined)(n)||-1===this.parent.getTaskIds().indexOf("T"+n)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+n)]):i.i(r.isNullOrUndefined)(n)||-1===this.parent.ids.indexOf(n)||this.targetedRecords.push(this.parent.getRecordByID(n));break;case"object":Array.isArray(e)?this.updateTargetedRecords(e):this.targetedRecords.push(e.valueOf())}this.startDeleteAction()},e.prototype.updateTargetedRecords=function(e){if(e.length){if("object"===typeof e[0])this.targetedRecords=e;else for(var t=0;t<e.length;t++){var n=e[t].toString();"ResourceView"===this.parent.viewType?i.i(r.isNullOrUndefined)(n)||-1===this.parent.getTaskIds().indexOf("T"+n)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+n)]):i.i(r.isNullOrUndefined)(n)||-1===this.parent.ids.indexOf(n)||this.targetedRecords.push(this.parent.getRecordByID(n))}}},e.prototype.deleteRow=function(e){var t=e&&e.length?e:this.parent.selectionModule.getSelectedRecords();if(this.parent.addDeleteRecord=!0,t.length){this.parent.isOnDelete=!0,t.forEach(function(e){e.isDelete=!0}),"ResourceView"!==this.parent.viewType||e.length||(t=[]);for(var n=0;n<t.length;n++){var a=t[n];if(-1===this.deletedTaskDetails.indexOf(a)){var s=this.parent.getParentTask(a.parentItem);if(a.parentItem){var o=s.childRecords;(1===o.length?o:o.filter(function(e){return!e.isDelete})).length>0&&this.parent.dataOperation.updateParentItems(a.parentItem)}var l=a.ganttProperties.predecessor,d=!0;"ResourceView"===this.parent.viewType&&s&&s.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(d=!1),l&&l.length&&d&&this.removePredecessorOnDelete(a),this.deletedTaskDetails.push(a),a.hasChildRecords&&this.deleteChildRecords(a)}}this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.clearSelection();var h={};h.deletedRecordCollection=this.deletedTaskDetails,h.updatedRecordCollection=this.parent.editedRecords,h.cancel=!1,h.action="delete",this.initiateDeleteAction(h),this.parent.isOnDelete=!1}i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.removePredecessorOnDelete=function(e){for(var t=e.ganttProperties.predecessor,n=0;n<t.length;n++){var a=t[n],s="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(a.from.toString()===s.toString()){var o=this.parent.connectorLineModule.getRecordByID(a.to.toString());if(!i.i(r.isNullOrUndefined)(o)){for(var l=i.i(r.extend)([],[],o.ganttProperties.predecessor,!0),d=void 0,h=0;h<l.length;h++){var p="ResourceView"===this.parent.viewType?o.ganttProperties.taskId:o.ganttProperties.rowUniqueID;if(l[h].to.toString()===p.toString()&&l[h].from.toString()===s.toString()){d=h;break}}l.splice(d,1),this.updatePredecessorValues(o,l)}}else if(a.to.toString()===s.toString()){var u=this.parent.connectorLineModule.getRecordByID(a.from.toString());if(!i.i(r.isNullOrUndefined)(u)){for(var c=i.i(r.extend)([],[],u.ganttProperties.predecessor,!0),d=void 0,h=0;h<c.length;h++){var g="ResourceView"===this.parent.viewType?u.ganttProperties.taskId:u.ganttProperties.rowUniqueID;if(c[h].from.toString()===g.toString()&&c[h].to.toString()===s.toString()){d=h;break}}c.splice(d,1),this.updatePredecessorValues(u,c)}}}},e.prototype.updatePredecessorValues=function(e,t){this.parent.setRecordValue("predecessor",t,e.ganttProperties,!0);var i=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",i,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,i,e),this.parent.setRecordValue(this.parent.taskFields.dependency,i,e)},e.prototype.updateTaskId=function(e,t){if(!this.parent.readOnly){var n="number"==typeof e?e.toString():e,a="number"==typeof t?t.toString():t,s=this.parent.ids;if(!i.i(r.isNullOrUndefined)(n)&&!i.i(r.isNullOrUndefined)(a)){var o=s.indexOf(n),l=s.indexOf(a);if(-1===o||l>-1)return;var d=this.parent.flatData[o];if(d.ganttProperties.taskId=d.ganttProperties.rowUniqueID=a,d.taskData[this.parent.taskFields.id]=a,d[this.parent.taskFields.id]=a,s[o]=a,d.hasChildRecords&&this.parent.taskFields.parentID)for(var h=d.childRecords,p=0;p<h.length;p++){var u=h[p];u[this.parent.taskFields.parentID]=t,this.parent.chartRowsModule.refreshRecords([u])}if(this.parent.taskFields.dependency&&!i.i(r.isNullOrUndefined)(d.ganttProperties.predecessor))for(var c=d.ganttProperties.predecessor,g=void 0,f=0;f<c.length;f++){var m=c[f];m.to===n?g=this.parent.flatData[s.indexOf(m.from)]:m.from===n&&(g=this.parent.flatData[s.indexOf(m.to)]),this.updatePredecessorOnUpdateId(g,n,a)}this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh()}}},e.prototype.updatePredecessorOnUpdateId=function(e,t,i){if(this.parent.flatData.indexOf(e)>-1)for(var r=e.ganttProperties.predecessor,n=0;n<r.length;n++){var a=r[n];a.to===t?a.to=i:a.from===t&&(a.from=i)}this.updatePredecessorValues(e,e.ganttProperties.predecessor)},e.prototype.deleteChildRecords=function(e){for(var t=e.childRecords,i=0;i<t.length;i++){var r=t[i];if(-1===this.deletedTaskDetails.indexOf(r)){var n=r.ganttProperties.predecessor,a=!0,s=this.parent.getParentTask(r.parentItem);"ResourceView"===this.parent.viewType&&s&&s.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(a=!1),n&&n.length&&a&&this.removePredecessorOnDelete(r),this.deletedTaskDetails.push(r),r.hasChildRecords&&this.deleteChildRecords(r)}}},e.prototype.removeFromDataSource=function(e){var t;t=this.parent.dataSource instanceof n.DataManager?this.parent.dataSource.dataSource.json:this.parent.dataSource,this.removeData(t,e),this.isBreakLoop=!1},e.prototype.removeData=function(e,t){for(var n=0;n<e.length&&!this.isBreakLoop;n++)if(-1!==t.indexOf(i.i(r.getValue)(this.parent.taskFields.id,e[n]).toString())){if(e[n][this.parent.taskFields.child]){var a=e[n][this.parent.taskFields.child];this.removeData(a,t)}if(t.splice(t.indexOf(i.i(r.getValue)(this.parent.taskFields.id,e[n]).toString()),1),e.splice(n,1),0===t.length){this.isBreakLoop=!0;break}}else if(e[n][this.parent.taskFields.child]){var a=e[n][this.parent.taskFields.child];this.removeData(a,t)}},e.prototype.initiateDeleteAction=function(e){var t=this;this.parent.showSpinner();var a={};a.requestType="beforeDelete",a.data=e.deletedRecordCollection,a.modifiedRecords=e.updatedRecordCollection,a.modifiedTaskData=i.i(s.e)(e.updatedRecordCollection,null,null,this.parent),this.parent.trigger("actionBegin",a,function(a){if(i.i(r.isNullOrUndefined)(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),a.cancel){for(var o=t.deletedTaskDetails,l=0;l<o.length;l++)o[l].isDelete=!1;t.deletedTaskDetails=[],t.reUpdatePreviousRecords(),t.parent.initiateEditAction(!1),t.parent.hideSpinner()}else if(i.i(s.f)(t.parent.dataSource)){var d=t.parent.dataSource;t.parent.timezone&&i.i(s.g)(a.modifiedTaskData,t.parent);var h={deletedRecords:i.i(s.e)(a.data,null,null,t.parent),changedRecords:a.modifiedTaskData},p=d.adaptor,u=t.parent.query instanceof n.Query?t.parent.query:new n.Query;if(p instanceof n.WebApiAdaptor&&p instanceof n.ODataAdaptor&&!d.dataSource.batchUrl){for(var c=null,g=0;g<h.deletedRecords.length;g++)c=d.remove(t.parent.taskFields.id,h.deletedRecords[g],null,u);c.then(function(){d.update(t.parent.taskFields.id,h.changedRecords,null,u).then(function(){return t.deleteSuccess(e)}).catch(function(i){return t.dmFailure(i,e)})}).catch(function(i){return t.dmFailure(i,e)})}else{var f=d.saveChanges(h,t.parent.taskFields.id,null,u);f.then(function(){return t.deleteSuccess(e)}).catch(function(i){return t.dmFailure(i,e)})}}else t.deleteSuccess(e)})},e.prototype.deleteSuccess=function(e){var t=this,n=this.parent.flatData,a=this.parent.currentViewData,o=this.parent.getRecordFromFlatdata(e.deletedRecordCollection),l=[];o.length>0&&(this.parent.selectedRowIndex=o[o.length-1].index);for(var d=0;d<o.length;d++){var h=o[d],p=a.indexOf(h),u=n.indexOf(h),c=this.parent.treeGrid.parentData.indexOf(h),g=i.i(r.getValue)("dataOperation.dataArray",this.parent),f=g.indexOf(h.taskData),m=void 0;if(-1!==p&&a.splice(p,1),-1!==u&&n.splice(u,1),-1!==f&&g.splice(f,1),!i.i(r.isNullOrUndefined)(h)){if(l.push(h.ganttProperties.taskId.toString()),-1!==u&&(this.parent.ids.splice(u,1),"ResourceView"===this.parent.viewType&&(this.parent.getTaskIds().splice(u,1),this.isResourceTaskDeleted=!0,h.hasChildRecords||(h.ganttProperties.resourceInfo=null,delete h.ganttProperties.resourceNames,h[this.parent.taskFields.resourceInfo]=null,h.ganttProperties.sharedTaskUniqueIds=[],delete h.taskData[this.parent.taskFields.resourceInfo]))),0===h.level&&-1!==c&&this.parent.treeGrid.parentData.splice(c,1),h.parentItem){var y=this.parent.getParentTask(h.parentItem);if(y){var D=y.childRecords;m=D.indexOf(h),-1!==m&&D.splice(m,1),D.length||this.parent.setRecordValue("hasChildRecords",!1,y)}}this.updateTreeGridUniqueID(h,"delete")}}l.length>0&&this.removeFromDataSource(l);var v={};if(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(),v.requestType="delete",v.data=e.deletedRecordCollection,v.modifiedRecords=e.updatedRecordCollection,v.modifiedTaskData=i.i(s.e)(e.updatedRecordCollection,null,null,this.parent),i.i(r.setValue)("action",e.action,v),this.parent.isOnDelete=!1,"ResourceView"===this.parent.viewType)for(var w=v.data.filter(function(e){return!e.hasChildRecords}),k=this,d=0;d<w.length;d++)!function(e){var i=k.parent.flatData.filter(function(e){return e.ganttProperties.taskName===t.parent.localeObj.getConstant("unassignedTask")})[0],r=[];i&&(r=i.childRecords.filter(function(t){return t.ganttProperties.taskId===w[e].ganttProperties.taskId}));var n=k.parent.getParentTask(w[e].parentItem);n&&n.ganttProperties.taskName!==k.parent.localeObj.getConstant("unassignedTask")&&0===r.length?k.checkWithUnassignedTask(w[e]):n||r&&0!==r.length||k.checkWithUnassignedTask(w[e]),i=k.parent.flatData.filter(function(e){return e.ganttProperties.taskName===t.parent.localeObj.getConstant("unassignedTask")})[0];var a=k.parent.currentViewData.filter(function(t){return t.ganttProperties.taskId==w[e].ganttProperties.taskId&&!t.hasChildRecords&&t.parentItem&&i.uniqueID===t.parentItem.uniqueID?t:null});a[0]&&k.parent.dataOperation.updateParentItems(a[0])}(d);this.parent.trigger("actionComplete",v),this.deletedTaskDetails=[],this.parent.initiateEditAction(!1),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.getNewTaskId=function(){var e="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,t=e.length,i=t+1;if("ResourceView"===this.parent.viewType){if((-1!==e.indexOf("T"+i)||-1!==e.indexOf("R"+i))&&(i+=1,-1!==e.indexOf("T"+i)||-1!==e.indexOf("R"+i)))do{i+=1}while(-1!==e.indexOf("T"+i)||-1!==e.indexOf("R"+i))}else if(-1!=e.indexOf(i.toString())&&(i+=1,-1!=e.indexOf(i.toString())))do{i+=1}while(-1!=e.indexOf(i.toString()));return"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?i=i.toString():i},e.prototype.prepareNewlyAddedData=function(e,t){var n,a,s=this.parent.taskFields,o=this.parent.ids;if(e[s.id]&&(-1!==o.indexOf(e[s.id].toString())?e[s.id]=null:(a="string"==typeof e[s.id]?e[s.id]:parseInt(e[s.id],10),e[s.id]=i.i(r.isNullOrUndefined)(a)?null:a)),e[s.id]||(n=this.getNewTaskId(),e[s.id]=n),this.parent.allowUnscheduledTasks||e[s.startDate]||(e[s.startDate]=this.parent.projectStartDate),!this.parent.allowUnscheduledTasks&&s.duration&&i.i(r.isNullOrUndefined)(e[s.duration])&&(e[s.endDate]||(e[s.duration]="5")),s.progress&&(e[s.progress]=e[s.progress]?e[s.progress]>100?100:e[s.progress]:0),!this.parent.allowUnscheduledTasks&&!e[s.endDate]&&s.endDate&&!e[s.duration]){var l=this.parent.dataOperation.getDateFromFormat(this.parent.projectStartDate);l.setDate(l.getDate()+4),e[s.endDate]=this.parent.getFormatedDate(l,this.parent.getDateFormat())}},e.prototype.updateNewlyAddedDataBeforeAjax=function(e,t,n,a){var s=this.parent.dataOperation.createRecord(e,t);if(s.index=parseInt(s.ganttProperties.rowUniqueID.toString(),10)-1,!i.i(r.isNullOrUndefined)(a)){this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(a),s);var o=s.parentItem?s.parentItem.index:null;this.parent.setRecordValue("parentIndex",o,s);var l=s.parentItem?s.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",l,s),i.i(r.isNullOrUndefined)(this.parent.taskFields.id)||i.i(r.isNullOrUndefined)(this.parent.taskFields.parentID)||!s.parentItem||("ProjectView"===this.parent.viewType&&this.parent.setRecordValue(this.parent.taskFields.parentID,s.parentItem.taskId,s.taskData,!0),this.parent.setRecordValue("parentId",s.parentItem.taskId,s.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.parentID,s.parentItem.taskId,s,!0))}return this.parent.isOnEdit=!0,this.backUpAndPushNewlyAddedRecord(s,n,a),this.parent.taskFields.dependency&&s.ganttProperties.predecessorsName&&(this.parent.predecessorModule.ensurePredecessorCollectionHelper(s,s.ganttProperties),this.parent.predecessorModule.updatePredecessorHelper(s),this.parent.predecessorModule.validatePredecessorDates(s)),s.parentItem&&this.parent.getParentTask(s.parentItem).ganttProperties.isAutoSchedule&&this.parent.dataOperation.updateParentItems(s.parentItem),this.parent.isOnEdit=!1,s},e.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)i=e.childRecords[r],t++,i.hasChildRecords&&(t=this.getChildCount(i,t));return t},e.prototype.getVisibleChildRecordCount=function(e,t,i){var r,n;if(e.hasChildRecords){r=e.childRecords,n=r.length;for(var a=0;a<n;a++)-1!==i.indexOf(r[a])&&t++,r[a].hasChildRecords&&(t=this.getVisibleChildRecordCount(r[a],t,i))}else-1!==i.indexOf(e)&&t++;return t},e.prototype.updatePredecessorOnIndentOutdent=function(e){for(var t,n,a=e.ganttProperties.predecessor.length,o=e.ganttProperties,l=o.predecessor,d=[],h=0;h<a;h++)if(l[h].to===o.rowUniqueID.toString()){t=this.parent.getRecordByID(l[h].from),n=i.i(s.h)(l[h],"from",t.ganttProperties.predecessor,"to");var p=i.i(r.extend)([],t.ganttProperties.predecessor,[],!0);p.splice(n,1),this.parent.setRecordValue("predecessor",p,t.ganttProperties,!0)}else if(l[h].from===o.rowUniqueID.toString()){t=this.parent.getRecordByID(l[h].to);var u=t.ganttProperties.predecessorsName.toString().split(","),c=l[h].from+l[h].type,g=u.indexOf(c);u.splice(g,1),this.parent.setRecordValue("predecessorsName",u.join(","),t.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.dependency,u.join(","),t),n=i.i(s.h)(l[h],"from",t.ganttProperties.predecessor,"to");var f=i.i(r.extend)([],t.ganttProperties.predecessor,[],!0);f.splice(n,1),this.parent.setRecordValue("predecessor",f,t.ganttProperties,!0),this.parent.predecessorModule.validatePredecessorDates(t)}this.parent.setRecordValue("predecessor",d,e.ganttProperties,!0),this.parent.setRecordValue("predecessorsName","",e.ganttProperties,!0)},e.prototype.predecessorToString=function(e,t){var i=[],r=0,n=e.length;for(r;r<n;r++)if(t.ganttProperties.rowUniqueID.toString()!==e[r].from){var a=e[r].from+e[r].type;e[r].offset=isNaN(e[r].offset)?0:e[r].offset,0!==e[r].offset&&(e[r].offset<0?a+=e[r].offset.toString()+"d":e[r].offset>0&&(a+="+"+e[r].offset.toString()+"d")),i.push(a)}return i.join(",")},e.prototype.backUpAndPushNewlyAddedRecord=function(e,t,n){var a,s,o,l=this.parent.flatData,d=this.parent.currentViewData,h=this.parent.ids;switch(t){case"Top":l.splice(0,0,e),d.splice(0,0,e),h.splice(0,0,e.ganttProperties.rowUniqueID.toString());break;case"Bottom":if(l.push(e),d.push(e),h.push(e.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var p=0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId;this.parent.getTaskIds().push(p)}break;case"Above":s=l.indexOf(this.addRowSelectedItem),o=d.indexOf(this.addRowSelectedItem),this.recordCollectionUpdate(void 0,s,o,e,n,t);break;case"Below":if(a=l.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){var u=this.getChildCount(this.addRowSelectedItem,0);s=a+u+1,o=d.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,d)+1}else s=a+1,o=d.indexOf(this.addRowSelectedItem)+1;this.recordCollectionUpdate(NaN,s,o,e,n,t);break;case"Child":if(a=l.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){var u=this.getChildCount(this.addRowSelectedItem,0);s=a+u+1,this.addRowSelectedItem.expanded||this.parent.enableMultiTaskbar||this.parent.expandByID(this.addRowSelectedItem.ganttProperties.rowUniqueID),o=d.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,d)+1}else this.parent.setRecordValue("hasChildRecords",!0,this.addRowSelectedItem),this.parent.setRecordValue("isMilestone",!1,this.addRowSelectedItem.ganttProperties,!0),this.parent.setRecordValue("expanded",!0,this.addRowSelectedItem),this.parent.setRecordValue("childRecords",[],this.addRowSelectedItem),s=a+1,o=d.indexOf(this.addRowSelectedItem)+1,this.addRowSelectedItem.ganttProperties.predecessor&&this.updatePredecessorOnIndentOutdent(this.addRowSelectedItem),i.i(r.isNullOrUndefined)(this.addRowSelectedItem.ganttProperties.segments)||(this.addRowSelectedItem.ganttProperties.segments=null);this.recordCollectionUpdate(NaN,s,o,e,n,t)}this.newlyAddedRecordBackup=e},e.prototype.recordCollectionUpdate=function(e,t,a,s,o,l){var d=this.parent.flatData,h=this.parent.currentViewData,p=this.parent.ids;if(d.splice(t,0,s),h.splice(a,0,s),"ResourceView"===this.parent.viewType&&"number"==typeof s.ganttProperties.taskId){var u=s.ganttProperties.taskId;p.push(u.toString())}if(p.splice(t,0,s.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var c=0===s.level?"R"+s.ganttProperties.taskId:"T"+s.ganttProperties.taskId;this.parent.getTaskIds().splice(t,0,c)}if(!i.i(r.isNullOrUndefined)(o)&&(e="Above"==l?o.childRecords.indexOf(this.addRowSelectedItem):"Below"==l?o.childRecords.indexOf(this.addRowSelectedItem)+1:o.childRecords.length,o.childRecords.splice(e,0,s),this.parent.taskFields.child||(this.parent.taskFields.child="Children"),this.parent.dataSource instanceof n.DataManager&&i.i(r.isNullOrUndefined)(o.taskData[this.parent.taskFields.parentID])||!i.i(r.isNullOrUndefined)(this.parent.dataSource))){var g=this.parent.taskFields.child;o.taskData[g]&&o.taskData[g].length>0?"Above"===l||"Below"===l?o.taskData[g].splice(e,0,s.taskData):o.taskData[g].push(s.taskData):(o.taskData[g]=[],o.taskData[g].push(s.taskData)),this.isNewRecordAdded=!0}},e.prototype.constructTaskAddedEventArgs=function(e,t,r){var n={};if(n.action=n.requestType=r,e.length>1){n.data=[],n.newTaskData=[],n.recordIndex=[];for(var a=0;a<e.length;a++)n.data[a]=e[a],n.newTaskData[a]=i.i(s.e)([e[a]],n.data[a],n,this.parent),n.recordIndex[a]=e[a].index}else if(1===e.length)for(var a=0;a<e.length;a++)n.data=e[a],n.newTaskData=i.i(s.e)([e[a]],n.data,n,this.parent),n.recordIndex=e[a].index;return n.modifiedRecords=t,n.modifiedTaskData=i.i(s.e)(t,null,null,this.parent),n},e.prototype.addSuccess=function(e){this.parent.treeGrid.parentData=[],this.parent.addDeleteRecord=!0,this.parent.selectedRowIndex=0,this.parent.treeGrid.isAddedFromGantt=!0,this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&(this.parent.modifiedRecords=e.modifiedRecords,this.parent.modifiedRecords.push(e.data),this.refreshRecordInImmutableMode())},e.prototype.refreshRecordInImmutableMode=function(e,t){if(!t&&!i.i(r.isNullOrUndefined)(e))for(var n=e[0].index+1;n<this.parent.currentViewData.length&&e[0].level<this.parent.currentViewData[n].level;n++)this.parent.modifiedRecords.push(this.parent.currentViewData[n]);for(var a=this,n=0;n<this.parent.modifiedRecords.length;n++)!function(e){var t=a.parent.modifiedRecords[e],i=a.parent.allowRowDragAndDrop?1:0,r=a.parent.taskFields.id,n=a.parent.currentViewData.findIndex(function(e){return e[r]===t[r]});a.parent.treeGrid.getRows()[n]&&(a.parent.treeGrid.renderModule.cellRender({data:t,cell:a.parent.treeGrid.getRows()[n].cells[a.parent.treeColumnIndex+i],column:a.parent.treeGrid.grid.getColumns()[a.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),a.parent.treeGrid.renderModule.RowModifier({data:t,row:a.parent.treeGrid.getRows()[n],rowHeight:a.parent.rowHeight}))}(n)},e.prototype.updateRealDataSource=function(e,t){var a=this.parent.taskFields,o=i.i(s.i)(this.parent)?i.i(r.getValue)("result",this.parent.dataSource):this.parent.dataSource;this.parent.dataSource instanceof n.DataManager&&(o=this.parent.dataSource.dataSource.json);for(var l=0;l<e.length;l++)(i.i(r.isNullOrUndefined)(t)||i.i(r.isNullOrUndefined)(this.addRowSelectedItem))&&(t="Bottom"===t?"Bottom":"Top"),"Top"===t?o.splice(0,0,e[l].taskData):"Bottom"===t?o.push(e[l].taskData):i.i(r.isNullOrUndefined)(a.id)||i.i(r.isNullOrUndefined)(a.parentID)?(this.isNewRecordAdded||this.addDataInRealDataSource(o,e[l].taskData,t),this.isNewRecordAdded=!1):o.push(e[l].taskData),this.isBreakLoop=!1},e.prototype.addDataInRealDataSource=function(e,t,n){for(var a=0;a<e.length;a++){var s=this.parent.taskFields.child;if(this.isBreakLoop)break;if(i.i(r.getValue)(this.parent.taskFields.id,e[a]).toString()===this.addRowSelectedItem.ganttProperties.rowUniqueID.toString()){"Above"===n?e.splice(a,0,t):"Below"===n?e.splice(a+1,0,t):"Child"===n&&(e[a][s]&&e[a][s].length>0?e[a][s].push(t):(e[a][s]=[],e[a][s].push(t))),this.isBreakLoop=!0;break}if(e[a][s]){var o=e[a][s];this.addDataInRealDataSource(o,t,n)}}},e.prototype.updateClientDataFromServer=function(e,t){for(var i=e.addedRecords[0],r=Object.keys(i).length,n=0,a=Object.keys(i);n<r;n++){var s=a[parseInt(n.toString(),10)];t.data[""+s]=i[""+s]}null!==this.parent.taskFields.id&&(t.data.ganttProperties.taskId=i[this.parent.taskFields.id]),null!==this.parent.taskFields.name&&(t.data.ganttProperties.taskName=i[this.parent.taskFields.name]),null!==this.parent.taskFields.startDate&&(t.data.ganttProperties.startDate=i[this.parent.taskFields.startDate]),null!==this.parent.taskFields.endDate&&(t.data.ganttProperties.endDate=i[this.parent.taskFields.endDate]),null!==this.parent.taskFields.duration&&(t.data.ganttProperties.duration=parseInt(i[this.parent.taskFields.duration])),null!==this.parent.taskFields.durationUnit&&(t.data.ganttProperties.durationUnit=i[this.parent.taskFields.durationUnit]),null!==this.parent.taskFields.progress&&(t.data.ganttProperties.progress=i[this.parent.taskFields.progress]),null!==this.parent.taskFields.dependency&&(t.data.ganttProperties.dependency=i[this.parent.taskFields.dependency]),null!==this.parent.taskFields.parentID&&(t.data.ganttProperties.parentID=i[this.parent.taskFields.parentID]),null!==this.parent.taskFields.baselineEndDate&&(t.data.ganttProperties.baselineEndDate=i[this.parent.taskFields.baselineEndDate]),null!==this.parent.taskFields.baselineStartDate&&(t.data.ganttProperties.baselineStartDate=i[this.parent.taskFields.baselineStartDate]),null!==this.parent.taskFields.resourceInfo&&(t.data.ganttProperties.resources=i[this.parent.taskFields.resourceInfo])},e.prototype.addRecord=function(e,t,a){var o=this,l=this.parent.taskFields.id;if(this.parent.editModule&&this.parent.editSettings.allowAdding){this.parent.isDynamicData=!0;var d=[];if(i.i(r.isNullOrUndefined)(e))this.validateTaskPosition(e,t,a,d);else if(e instanceof Array)for(var h=0;h<e.length;h++)this.validateTaskPosition(e[h],t,a,d);else{if("object"!=typeof e)return;this.validateTaskPosition(e,t,a,d)}var p={};p=this.constructTaskAddedEventArgs(d,this.parent.editedRecords,"beforeAdd"),this.parent.trigger("actionBegin",p,function(e){i.i(r.isNullOrUndefined)(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.showSpinner():o.parent.showMaskRow();var a=o.parent.taskFields,h="ResourceView"===o.parent.viewType?o.parent.flatData[o.parent.getTaskIds().indexOf("T"+e.data[a.id])]:o.parent.getRecordByID(e.data[a.id]);if(i.i(r.isNullOrUndefined)(h)||o.validateUpdateValues(e.newTaskData,h,!0),i.i(r.isNullOrUndefined)(e.data[""+l])||e.data[l]!=e.data.ganttProperties.taskId&&(e.data.ganttProperties.taskId=e.data[l],e.newTaskData[l]=e.data[l]),e.cancel)e=e,o.removeAddedRecord(),o.reUpdatePreviousRecords(),o._resetProperties();else if(i.i(s.f)(o.parent.dataSource)){var p=o.parent.dataSource,u={addedRecords:[e.newTaskData],changedRecords:e.modifiedTaskData},c=e.data.ganttProperties.taskId.toString(),g=o.parent.query instanceof n.Query?o.parent.query:new n.Query,f=p.adaptor,m=f.getModuleName();if("WebApiAdaptor"!=m&&"ODataAdaptor"!=m&&"ODataV4Adaptor"!=m||p.dataSource.batchUrl){var y=p.saveChanges(u,o.parent.taskFields.id,null,g);y.then(function(t){if(o.parent.taskFields.id&&!i.i(r.isNullOrUndefined)(t.addedRecords[0][o.parent.taskFields.id])&&t.addedRecords[0][o.parent.taskFields.id].toString()==c){o.parent.setRecordValue("taskId",t.addedRecords[0][o.parent.taskFields.id],e.data.ganttProperties,!0),o.parent.setRecordValue("taskData",t.addedRecords[0],e.data),o.parent.setRecordValue(o.parent.taskFields.id,t.addedRecords[0][o.parent.taskFields.id],e.data),o.parent.setRecordValue("rowUniqueID",t.addedRecords[0][o.parent.taskFields.id].toString(),e.data.ganttProperties,!0),o.updateClientDataFromServer(t,e);var n=o.parent.ids.indexOf(c);-1!==n&&(o.parent.ids[n]=t.addedRecords[0][o.parent.taskFields.id].toString())}o.updateNewRecord(d,e)}).catch(function(t){o.removeAddedRecord(),o.dmFailure(t,e),o._resetProperties()})}else{var D=p.insert(u.addedRecords,null,g);D.then(function(t){i.i(r.isNullOrUndefined)(t[0])?u.addedRecords[0]:t[0],o.updateNewRecord(d,e)}).catch(function(t){o.removeAddedRecord(),o.dmFailure(t,e),o._resetProperties()})}}else{if("ProjectView"===o.parent.viewType){if("Top"===t||"Bottom"===t||"Above"===t||"Below"===t||"Child"===t||i.i(r.isNullOrUndefined)(t)&&!e.data.parentItem)if(e.data instanceof Array)o.updateRealDataSource(e.data,t);else{var v=[];v.push(e.data),o.updateRealDataSource(v,t),o.parent.currentSelection=d[0].ganttProperties}}else{var w=i.i(s.i)(o.parent)?i.i(r.getValue)("result",o.parent.dataSource):o.parent.dataSource;w.push(e.data.taskData)}0===d.level&&o.parent.treeGrid.parentData.splice(0,0,d),o.updateTreeGridUniqueID(d,"add"),o.refreshNewlyAddedRecord(e,d),o._resetProperties()}})}},e.prototype.createNewRecord=function(){for(var e={},t=this.parent.ganttColumns,n=this.parent.taskFields,a=this.parent.editModule.getNewTaskId(),s=0;s<t.length;s++){var o=t[s].field;o===n.id?e[o]=a:t[s].field===n.startDate?(i.i(r.isNullOrUndefined)(e[n.endDate])?e[o]=this.parent.editModule.dialogModule.getMinimumStartDate():e[o]=new Date(e[n.endDate]),this.parent.timezone&&(e[o]=this.parent.dateValidationModule.remove(e[o],this.parent.timezone))):t[s].field===n.endDate?(i.i(r.isNullOrUndefined)(e[n.startDate])?e[o]=this.parent.editModule.dialogModule.getMinimumStartDate():e[o]=new Date(e[n.startDate]),this.parent.timezone&&(e[o]=this.parent.dateValidationModule.remove(e[o],this.parent.timezone))):t[s].field===n.duration?e[o]=1:t[s].field===n.name?e[o]=this.parent.editModule.dialogModule.localeObj.getConstant("addDialogTitle")+" "+a:t[s].field===n.progress?e[o]=0:t[s].field===n.work?e[o]=0:"taskType"===t[s].field?e[o]=this.parent.taskType:t[s].field===n.milestone?e[o]=null:e[this.parent.ganttColumns[s].field]=""}return e},e.prototype.validateTaskPosition=function(e,t,n,a){var s=i.i(r.isNullOrUndefined)(n)||isNaN(parseInt(n.toString(),10))?this.parent.selectionModule?"Row"!==this.parent.selectionSettings.mode&&"Both"!==this.parent.selectionSettings.mode||1!==this.parent.selectionModule.selectedRowIndexes.length?"Cell"===this.parent.selectionSettings.mode&&1===this.parent.selectionModule.getSelectedRowCellIndexes().length?this.parent.selectionModule.getSelectedRowCellIndexes()[0].rowIndex:null:this.parent.selectionModule.selectedRowIndexes[0]:null:n;this.addRowSelectedItem=i.i(r.isNullOrUndefined)(s)?null:this.parent.updatedRecords[s],t=i.i(r.isNullOrUndefined)(t)?this.parent.editSettings.newRowPosition:t,e=i.i(r.isNullOrUndefined)(e)?this.createNewRecord():e,((i.i(r.isNullOrUndefined)(s)||s<0||i.i(r.isNullOrUndefined)(this.addRowSelectedItem))&&("Above"===t||"Below"===t||"Child"===t)||!t||"Above"!==t&&"Below"!==t&&"Child"!==t&&"Top"!==t&&"Bottom"!==t)&&(t="Top");var o,l=0;switch(t){case"Top":case"Bottom":l="ResourceView"===this.parent.viewType?1:0;break;case"Above":case"Below":l=this.addRowSelectedItem.level,o=this.parent.getParentTask(this.addRowSelectedItem.parentItem);break;case"Child":l=this.addRowSelectedItem.level+1,o=this.addRowSelectedItem}this.prepareNewlyAddedData(e,t);var d=this.updateNewlyAddedDataBeforeAjax(e,l,t,o);a.push(d)},e.prototype.updateNewRecord=function(e,t){if(0===e.level){this.parent.treeGrid.parentData.splice(0,0,e);i.i(r.getValue)("dataOperation.dataArray",this.parent).splice(0,0,e.taskData)}this.updateTreeGridUniqueID(e,"add"),this.refreshNewlyAddedRecord(t,e),this._resetProperties()},e.prototype._resetProperties=function(){this.parent.isOnEdit=!1,this.parent.hideSpinner(),this.addRowSelectedItem=null,this.newlyAddedRecordBackup=null,this.isBreakLoop=!1,this.parent.element.tabIndex=0,this.parent.initiateEditAction(!1)},e.prototype.updateTreeGridUniqueID=function(e,t){"add"===t?i.i(r.setValue)("uniqueIDCollection."+e.uniqueID,e,this.parent.treeGrid):"delete"===t&&i.i(r.deleteObject)(i.i(r.getValue)("uniqueIDCollection",this.parent.treeGrid),e.uniqueID)},e.prototype.refreshNewlyAddedRecord=function(e,t){if(this.parent.selectionModule&&this.parent.allowSelection&&("Row"===this.parent.selectionSettings.mode||"Both"===this.parent.selectionSettings.mode)&&(this.parent.staticSelectedRowIndex=this.parent.currentViewData.indexOf(e.data)),this.parent.timelineSettings.updateTimescaleView){var n=[];e.modifiedRecords.length>0?(n=e.data.length>0?e.data:[e.data],n.push.apply(n,e.modifiedRecords)):n=e.data.length>0?e.data:[e.data],this.parent.timelineModule.updateTimeLineOnEditing([n],e.action)}if(this.addSuccess(e),e=this.constructTaskAddedEventArgs(t,e.modifiedRecords,"add"),this.dialogModule.isAddNewResource&&!this.parent.isEdit&&this.parent.taskFields.work&&this.parent.dataOperation.updateWorkWithDuration(t[0]),this.parent.trigger("actionComplete",e),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose(),"ResourceView"===this.parent.viewType)if(t.length>1)for(var a=0;a<t.length;a++){if(e.data[a].ganttProperties.sharedTaskUniqueIds.push(e.data[a].ganttProperties.rowUniqueID),e.data[a].ganttProperties.resourceInfo){var s=i.i(r.extend)([],[],e.data[a].ganttProperties.resourceInfo,!0);s.splice(0,1),this.updateResoures([],s,e.data[a])}else this.removeChildRecord(e.data[a]),this.parent.editModule.checkWithUnassignedTask(e.data[a]);for(var o=0;o<this.updateParentRecords.length;o++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[o]);this.updateParentRecords=[]}else{if(e.data.ganttProperties.sharedTaskUniqueIds.push(e.data.ganttProperties.rowUniqueID),e.data.ganttProperties.resourceInfo&&e.data.ganttProperties.resourceInfo.length){if(e.data.ganttProperties.resourceInfo.length>1){var s=i.i(r.extend)([],[],e.data.ganttProperties.resourceInfo,!0);s.splice(0,1),this.updateResoures([],s,e.data)}}else this.removeChildRecord(e.data),this.parent.editModule.checkWithUnassignedTask(e.data);for(var o=0;o<this.updateParentRecords.length;o++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[o]);this.updateParentRecords=[]}},e.prototype.removeAddedRecord=function(){var e=this.parent.flatData,t=this.parent.currentViewData,n=this.parent.ids,a=e.indexOf(this.newlyAddedRecordBackup),s=t.indexOf(this.newlyAddedRecordBackup),o=n.indexOf(this.newlyAddedRecordBackup.ganttProperties.rowUniqueID.toString());if(i.i(r.deleteObject)(this.parent.previousRecords,e[a].uniqueID),this.newlyAddedRecordBackup.parentItem){var l=this.parent.getParentTask(this.newlyAddedRecordBackup.parentItem),d=l.childRecords.indexOf(this.newlyAddedRecordBackup);l.childRecords.splice(d,1)}e.splice(a,1),t.splice(s,1),n.splice(o,1)},e.prototype.getPrevRecordIndex=function(){var e=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1],t=this.parent.selectionModule.getSelectedRecords()[0],i=this.parent.getRootParent(e,t.level);return this.parent.updatedRecords.indexOf(i)},e.prototype.indent=function(){var e,t=this.parent.selectedRowIndex,i=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),r=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1],n=this.parent.selectionModule.getSelectedRecords()[0];this.parent.editSettings.allowEditing&&0!==t&&-1!==t&&i&&"ResourceView"!==this.parent.viewType&&this.parent.updatedRecords[t].level-r.level!=1&&(e=r.level-n.level==0?this.parent.selectionModule.getSelectedRowIndexes()[0]-1:this.getPrevRecordIndex(),this.indentOutdentRow([this.parent.selectionModule.getSelectedRowIndexes()[0]],e,"child"))},e.prototype.outdent=function(){var e,t=this.parent.selectionModule.getSelectedRowIndexes()[0],i=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length);if(this.parent.editSettings.allowEditing&&-1!==t&&0!==t&&i&&"ResourceView"!==this.parent.viewType&&0!==this.parent.updatedRecords[t].level){var r=this.parent.getTaskByUniqueID(this.parent.selectionModule.getSelectedRecords()[0].parentItem.uniqueID);e=this.parent.updatedRecords.indexOf(r),this.indentOutdentRow([t],e,"below")}},e.prototype.indentOutdentRow=function(e,t,n){var a=this;if(e[0],!0){"above"===n&&(this.dropPosition="topSegment"),"below"===n&&(this.dropPosition="bottomSegment"),"child"===n&&(this.dropPosition="middleSegment");for(var s=void 0,o=[],l=0;l<e.length;l++)o[l]=this.parent.updatedRecords[e[l]];var d={data:o,dropIndex:t,dropPosition:this.dropPosition};"middleSegment"===this.dropPosition?s="indenting":"bottomSegment"===this.dropPosition&&(s="outdenting");var h={action:s,data:o[0],cancel:!1};this.parent.trigger("actionBegin",h,function(e){i.i(r.isNullOrUndefined)(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.showSpinner():a.parent.showMaskRow(),e.cancel||a.reArrangeRows(d,!0)})}},e.prototype.reArrangeRows=function(e,t){if(this.dropPosition=e.dropPosition,"Invalid"!==e.dropPosition&&this.parent.editModule){var n=this.parent,a=void 0;this.droppedRecord=n.updatedRecords[e.dropIndex];var s=[],o=this.droppedRecord;e.data[0]?s=e.data:s.push(e.data);for(var l=0,d=s.length,h=0;h<d;h++){if(this.parent.isOnEdit=!0,a=s[h],this.draggedRecord=a,"Invalid"!==this.dropPosition){t&&this.deleteDragRow();var p=this.treeGridData.indexOf(o);if("bottomSegment"===this.dropPosition){if(o.hasChildRecords){l=this.parent.editModule.getChildCount(o,0),this.parent.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(p+l+1,0,this.draggedRecord.taskData),this.treeGridData.splice(p+l+1,0,this.draggedRecord),this.parent.ids.splice(p+l+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString());var u=this.parent.ids.indexOf(this.draggedRecord[this.parent.taskFields.id].toString());u!==p+l+1&&(this.parent.ids.splice(u,1),this.parent.ids.splice(p+l+1,0,this.draggedRecord[this.parent.taskFields.id].toString()))}else this.parent.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(p+1,0,this.draggedRecord.taskData),this.treeGridData.splice(p+1,0,this.draggedRecord),this.parent.ids.splice(p+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString());if(this.parent.setRecordValue("parentItem",this.treeGridData[p].parentItem,a),this.parent.setRecordValue("parentUniqueID",this.treeGridData[p].parentUniqueID,a),this.parent.setRecordValue("level",this.treeGridData[p].level,a),a.hasChildRecords){this.updateChildRecordLevel(a,1),this.updateChildRecord(a,p+l+1)}if(o.parentItem){var c=this.parent.getParentTask(o.parentItem).childRecords,g=c,f=g.indexOf(o)+1;g.splice(f,0,a)}}"middleSegment"===this.dropPosition&&this.dropMiddle(p),i.i(r.isNullOrUndefined)(a.parentItem&&-1!==this.updateParentRecords.indexOf(a.parentItem))||this.updateParentRecords.push(a.parentItem)}if(i.i(r.isNullOrUndefined)(a.parentItem)){var m=this.parent.treeGrid.parentData,y=m.indexOf(this.droppedRecord);"bottomSegment"===this.dropPosition&&m.splice(y+1,0,a)}this.refreshDataSource()}"middleSegment"===this.dropPosition&&(o.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(o),o.ganttProperties.predecessor=null,o.ganttProperties.predecessorsName=null,o[this.parent.taskFields.dependency]=null,o.taskData[this.parent.taskFields.dependency]=null),o.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,o.ganttProperties,!0),i.i(r.isNullOrUndefined)(o.taskData[this.parent.taskFields.milestone])||!0===o.taskData[this.parent.taskFields.milestone]&&(o.taskData[this.parent.taskFields.milestone]=!1)));for(var D=0;D<this.updateParentRecords.length;D++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[D]);this.updateParentRecords=[],this.parent.isOnEdit=!1}this.refreshRecord(e)},e.prototype.refreshRecord=function(e,t){var r=this;if(i.i(s.f)(this.parent.dataSource)){var a=this.parent.dataSource,o={changedRecords:i.i(s.e)(this.parent.editedRecords,null,null,this.parent)},l=this.parent.query instanceof n.Query?this.parent.query:new n.Query,d=null,h=a.adaptor;if(h instanceof n.WebApiAdaptor&&h instanceof n.ODataAdaptor&&!a.dataSource.batchUrl){d=a.update(this.parent.taskFields.id,o.changedRecords,null,l)}else d=a.saveChanges(o,this.parent.taskFields.id,null,l);d.then(function(i){return r.indentSuccess(i,e,t)}).catch(function(e){return r.indentFailure(e)})}else this.indentOutdentSuccess(e,t)},e.prototype.indentSuccess=function(e,t,i){this.indentOutdentSuccess(t,i)},e.prototype.indentFailure=function(e){this.parent.trigger("actionFailure",{error:e})},e.prototype.indentOutdentSuccess=function(e,t){if(this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(e.data,t),t?e.requestType="rowDropped":"middleSegment"===this.dropPosition?e.requestType="indented":"bottomSegment"===this.dropPosition&&(e.requestType="outdented"),e.modifiedRecords=this.parent.editedRecords,this.parent.timezone)for(var n=0;n<e.modifiedRecords.length;n++)i.i(s.g)(e.modifiedRecords[n],this.parent);this.parent.trigger("actionComplete",e),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.editedRecords=[]},e.prototype.refreshDataSource=function(){var e,t,a=this.draggedRecord,s=this.droppedRecord,o=this.parent;if(e=this.parent.dataSource instanceof n.DataManager?i.i(r.getValue)("dataOperation.dataArray",this.parent):o.dataSource,e.length>0&&!i.i(r.isNullOrUndefined)(s)&&!s.parentItem){for(var l=0;l<Object.keys(e).length;l++)e[l][this.parent.taskFields.child]===s.taskData[this.parent.taskFields.child]&&(t=l);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(t,0,a.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(t+1,0,a.taskData))}else if(!this.parent.taskFields.parentID&&!i.i(r.isNullOrUndefined)(s)&&s.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var d="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=s;var h=[];Array.isArray(a)?h=a:h[0]=a,this.parent.editModule.updateRealDataSource(h,d),delete this.parent.editModule.addRowSelectedItem}this.parent.taskFields.parentID&&(a.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(a[this.parent.taskFields.parentID]=s[this.parent.taskFields.parentID],a.taskData[this.parent.taskFields.parentID]=s[this.parent.taskFields.parentID],a.ganttProperties.parentId=s[this.parent.taskFields.parentID]):(a[this.parent.taskFields.parentID]=s[this.parent.taskFields.id],a.taskData[this.parent.taskFields.parentID]=s[this.parent.taskFields.id],a.ganttProperties.parentId=s[this.parent.taskFields.id]):(a[this.parent.taskFields.parentID]=null,a.taskData[this.parent.taskFields.parentID]=null,a.ganttProperties.parentId=null))},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof n.DataManager?this.ganttData=i.i(r.getValue)("dataOperation.dataArray",this.parent):this.ganttData=i.i(s.i)(this.parent)?i.i(r.getValue)("result",this.parent.dataSource):this.parent.dataSource,this.treeGridData=i.i(s.i)(this.parent)?i.i(r.getValue)("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource;var e=this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);this.removeRecords(e)},e.prototype.updateIndentedChildRecords=function(e){for(var t={uniqueID:e.uniqueID,expanded:e.expanded,level:e.level,index:e.index,taskId:e.ganttProperties.rowUniqueID},i=0;i<e.childRecords.length;i++)this.parent.setRecordValue("parentItem",t,e.childRecords[i]),this.parent.setRecordValue("parentUniqueID",e.uniqueID,e.childRecords[i]);if(e.hasChildRecords){e=e.childRecords;for(var r=0;r<e.length;r++)this.updateIndentedChildRecords(e[r])}},e.prototype.dropMiddle=function(e){var t=this.parent,n=this.parent.editModule.getChildCount(this.droppedRecord,0),a=i.i(r.isNullOrUndefined)(n)||0===n?e+1:n+e+1;if("middleSegment"===this.dropPosition){if(t.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(a,0,this.draggedRecord.taskData),this.treeGridData.splice(a,0,this.draggedRecord),this.parent.ids.splice(a,0,this.draggedRecord[this.parent.taskFields.id].toString()),this.recordLevel(),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,a,this.droppedRecord.expanded),this.parent.enableImmutableMode)){var s=this.draggedRecord;this.updateIndentedChildRecords(s)}i.i(r.isNullOrUndefined)(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem))&&this.updateParentRecords.push(this.draggedRecord.parentItem)}},e.prototype.updateChildRecordLevel=function(e,t){var i,r=0;if(t++,!e.hasChildRecords)return 0;r=e.childRecords.length;for(var n=0;n<r;n++){i=e.childRecords[n];var a=void 0;if(e.parentItem){a=this.parent.treeGrid.uniqueIDCollection[e.parentItem.uniqueID]}i.level=e.parentItem?a.level+t:e.level+1,i.hasChildRecords&&(t--,t=this.updateChildRecordLevel(i,t))}return t},e.prototype.updateChildRecord=function(e,t,i){var r,n=this.parent,a=0;if(!e.hasChildRecords)return 0;a=e.childRecords.length;for(var s=0;s<a;s++)r=e.childRecords[s],t++,n.flatData.splice(t,0,r),this.parent.ids.splice(t,0,r.ganttProperties.rowUniqueID.toString()),n.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(t,0,r.taskData),r.hasChildRecords&&(t=this.updateChildRecord(r,t));return t},e.prototype.removeRecords=function(e){var t,a=this.parent;t=this.parent.dataSource instanceof n.DataManager?i.i(r.getValue)("dataOperation.dataArray",this.parent):this.parent.dataSource;var s=e,o=this.parent.getParentTask(s.parentItem);if(s){if(s.parentItem){var l=o?o.childRecords:[],d=0;l&&l.length>0&&(d=l.indexOf(s),o.childRecords.splice(d,1),this.parent.taskFields.parentID||o.taskData[this.parent.taskFields.child].splice(d,1),this.updateParentRecords.push(o))}if(a.taskFields.parentID){s.hasChildRecords&&s.childRecords.length>0&&this.removeChildItem(s);for(var h=void 0,p=t.length>0?t:this.parent.currentViewData,u=0;u<p.length;u++)p[u][this.parent.taskFields.id]===s.taskData[this.parent.taskFields.id]&&(h=u);if(-1!==h){t.length>0&&t.splice(h,1);for(var c=void 0,u=0;u<this.treeGridData.length;u++)this.treeGridData[u][this.parent.taskFields.id]===s.taskData[this.parent.taskFields.id]&&(c=u);this.treeGridData.splice(c,1),this.parent.ids.splice(c,1),-1!==this.parent.treeGrid.parentData.indexOf(s)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(s),1)}}var g=this.treeGridData.indexOf(s);if(!a.taskFields.parentID){var f=this.getChildCount(s,0);this.treeGridData.splice(g,f+1),this.parent.ids.splice(g,f+1);var m=this.ganttData.indexOf(s.taskData);-1!==m&&(this.ganttData.splice(m,1),this.parent.treeGrid.parentData.splice(m,1))}s.parentItem&&o&&o.childRecords&&!o.childRecords.length&&(this.parent.setRecordValue("expanded",!1,o),this.parent.setRecordValue("hasChildRecords",!1,o))}},e.prototype.removeChildItem=function(e){for(var t,a,s=0;s<e.childRecords.length;s++){t=e.childRecords[s];var o=void 0;o=this.parent.dataSource instanceof n.DataManager?i.i(r.getValue)("dataOperation.dataArray",this.parent):this.parent.dataSource;for(var l=0;l<o.length;l++)o[l][this.parent.taskFields.id]===t.taskData[this.parent.taskFields.id]&&(a=l);if(-1!==a){o.length>0&&o.splice(a,1);for(var d=void 0,h=0;h<this.treeGridData.length;h++)this.treeGridData[h][this.parent.taskFields.id]===t.taskData[this.parent.taskFields.id]&&(d=h);this.treeGridData.splice(d,1),this.parent.ids.splice(d,1)}t.hasChildRecords&&this.removeChildItem(t)}},e.prototype.recordLevel=function(){var e=this.parent,t=this.draggedRecord,n=this.droppedRecord,a=e.taskFields.child;if(n.hasChildRecords||(n.hasChildRecords=!0,n.childRecords.length||(n.childRecords=[],!e.taskFields.parentID&&i.i(r.isNullOrUndefined)(n.taskData[a])&&(n.taskData[a]=[]))),"middleSegment"===this.dropPosition){var s=i.i(r.extend)({},n);delete s.childRecords;var o={uniqueID:s.uniqueID,expanded:s.expanded,level:s.level,index:s.index,taskId:s.ganttProperties.rowUniqueID};if(this.parent.setRecordValue("parentItem",o,t),this.parent.setRecordValue("parentUniqueID",n.uniqueID,t),n.childRecords.splice(n.childRecords.length,0,t),i.i(r.isNullOrUndefined)(t)||e.taskFields.parentID||i.i(r.isNullOrUndefined)(n.taskData[a])||n.taskData[e.taskFields.child].splice(n.childRecords.length,0,t.taskData),!i.i(r.isNullOrUndefined)(n.ganttProperties.segments)&&n.ganttProperties.segments.length>0&&(n.ganttProperties.segments=null,n.taskData[e.taskFields.segments]=null),t.hasChildRecords){t.level=n.level+1,this.updateChildRecordLevel(t,1)}else t.level=n.level+1;n.expanded=!0}},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(6),n=(i.n(r),i(0)),a=(i.n(n),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.ExcelExport),this.parent.treeGrid.allowExcelExport=this.parent.allowExcelExport,this.bindEvents()}return e.prototype.getModuleName=function(){return"excelExport"},e.prototype.destroy=function(){},e.prototype.bindEvents=function(){var e=this;this.parent.treeGrid.beforeExcelExport=function(t){e.parent.trigger("beforeExcelExport",t),i.i(n.isNullOrUndefined)(e.parent.loadingIndicator)||"Shimmer"!==e.parent.loadingIndicator.indicatorType?e.parent.showSpinner():e.parent.showMaskRow()},this.parent.treeGrid.excelQueryCellInfo=function(t){e.parent.trigger("excelQueryCellInfo",t)},this.parent.treeGrid.excelHeaderQueryCellInfo=function(t){e.parent.trigger("excelHeaderQueryCellInfo",t)},this.parent.treeGrid.excelExportComplete=function(t){e.parent.trigger("excelExportComplete",t),i.i(n.isNullOrUndefined)(e.parent.loadingIndicator)||"Shimmer"!==e.parent.loadingIndicator.indicatorType?e.parent.hideSpinner():e.parent.hideMaskRow()}},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(6),n=(i.n(r),i(5)),a=(i.n(n),i(0)),s=(i.n(a),i(12)),o=(i.n(s),i(20)),l=(i.n(o),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.Filter),this.parent.treeGrid.allowFiltering=this.parent.allowFiltering,this.updateCustomFilters(),this.parent.treeGrid.filterSettings=i.i(n.getActualProperties)(this.parent.filterSettings),this.addEventListener()}return e.prototype.getModuleName=function(){return"filter"},e.prototype.updateCustomFilters=function(){for(var e=this.parent.taskFields,t=0;t<this.parent.ganttColumns.length;t++){var i=this.parent.ganttColumns[t];("datepickeredit"!==i.editType&&"datetimepickeredit"!==i.editType||i.field!==e.startDate&&i.field!==e.endDate&&i.field!==e.baselineStartDate&&i.field!==e.baselineEndDate)&&(i.field!==e.duration||"stringedit"!==i.editType)||this.initiateFiltering(this.parent.ganttColumns[t])}},e.prototype.updateModel=function(){this.parent.filterSettings=this.parent.treeGrid.filterSettings},e.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("actionBegin",this.actionBegin,this),this.parent.on("actionComplete",this.actionComplete,this),this.parent.on("columnMenuOpen",this.columnMenuOpen,this)},e.prototype.wireEvents=function(e){a.EventHandler.add(document.getElementById(e),"click",this.mouseClickHandler,this)},e.prototype.initiateFiltering=function(e){var t=this.parent.getColumnByField(e.field,this.parent.treeGridModule.treeGridColumns);e.allowFiltering=!1!==e.allowFiltering,!e.allowFiltering||"Menu"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||e.filter||(e.filter={ui:this.getCustomFilterUi(e)}),t&&(t.allowFiltering=e.allowFiltering,t.filter=e.allowFiltering?e.filter:{})},e.prototype.getCustomFilterUi=function(e){var t=this.parent.taskFields,i={};return"datepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?"datetimepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?e.field===t.duration&&"stringedit"===e.editType&&(i=this.getDurationFilter()):i=this.getDateTimePickerFilter():i=this.getDatePickerFilter(e.field),i},e.prototype.mouseClickHandler=function(e){i.i(a.closest)(e.target,".e-excelfilter")&&this.parent.treeGrid.grid.notify("click",e)},e.prototype.unWireEvents=function(){a.EventHandler.remove(this.parent.element,"click",this.mouseClickHandler)},e.prototype.getDatePickerFilter=function(e){var t,r=this,s=this.parent,l=e===s.taskFields.startDate||e===s.taskFields.baselineStartDate?s.defaultStartTime:s.defaultEndTime;return{create:function(e){var s=i.i(n.getCustomDateFormat)(e.column.format,e.column.type),l=i.i(a.createElement)("input",{className:"flm-input"});e.target.appendChild(l),t=new o.DatePicker({placeholder:r.parent.localeObj.getConstant("enterValue"),format:s}),t.enableRtl=r.parent.enableRtl,t.appendTo(l)},write:function(e){t.value=e.filteredValue},read:function(e){t.value&&t.value.setSeconds(l),e.fltrObj.filterByColumn(e.column.field,e.operator,t.value)}}},e.prototype.getDateTimePickerFilter=function(){var e,t=this;return{create:function(r){var s=i.i(n.getCustomDateFormat)(r.column.format,r.column.type),l=i.i(a.createElement)("input",{className:"flm-input"});r.target.appendChild(l),e=new o.DateTimePicker({placeholder:t.parent.localeObj.getConstant("enterValue"),format:s}),e.enableRtl=t.parent.enableRtl,e.appendTo(l)},write:function(t){e.value=t.filteredValue},read:function(t){t.fltrObj.filterByColumn(t.column.field,t.operator,e.value)}}},e.prototype.getDurationFilter=function(){var e,t=this,r=this.parent,n="";return{create:function(r){var n=i.i(a.createElement)("input",{className:"e-input"});n.setAttribute("placeholder",t.parent.localeObj.getConstant("enterValue")),r.target.appendChild(n),e=new s.TextBox,e.enableRtl=t.parent.enableRtl,e.appendTo(n)},write:function(t){e.value=t.filteredValue?n:""},read:function(s){var o=t.parent.dataOperation.getDurationValue(e.value),l=i.i(a.getValue)("duration",o),d=i.i(a.getValue)("durationUnit",o);if(l>=0){var h=void 0;"minute"===d?h=60*l/r.secondsPerDay:"hour"===d?h=60*l*60/r.secondsPerDay:(h=l,d="day"),s.fltrObj.filterByColumn(s.column.field,s.operator,h),n=t.parent.dataOperation.getDurationString(l,d)}else s.fltrObj.filterByColumn(s.column.field,s.operator,null),n=null}}},e.prototype.columnMenuOpen=function(e){this.filterMenuElement&&document.body.contains(this.filterMenuElement)&&i.i(a.remove)(this.filterMenuElement),this.filterMenuElement=null},e.prototype.actionBegin=function(e){},e.prototype.closeFilterOnContextClick=function(e){var t=document.querySelector("body > div.e-datepicker"),r=document.querySelector("body > div.e-datetimepicker");if(this.filterMenuElement&&document.body.contains(this.filterMenuElement)){var n=i.i(a.closest)(e,"#"+this.parent.element.id)||e.querySelector("#"+this.parent.element.id);(!this.filterMenuElement.contains(e)&&!i.i(a.isNullOrUndefined)(n)||!this.filterMenuElement.contains(e)&&i.i(a.isNullOrUndefined)(t)&&i.i(a.isNullOrUndefined)(r)&&("DIV"===e.nodeName||"HTML"===e.nodeName||"SPAN"===e.nodeName||"BUTTON"===e.nodeName))&&(i.i(a.remove)(this.filterMenuElement),this.parent.treeGrid.grid.notify("filter-menu-close",{isOpen:!1}),this.filterMenuElement=null)}},e.prototype.actionComplete=function(e){if(i.i(a.isNullOrUndefined)(e.filterModel)||i.i(a.isNullOrUndefined)(e.filterModel.dialogObj)||i.i(a.isNullOrUndefined)(e.filterModel.dialogObj.element)||"Excel"===this.parent.filterSettings.type&&this.wireEvents(e.filterModel.dialogObj.element.id),e.requestType===n.filterAfterOpen){"Menu"===this.parent.treeGrid.filterSettings.type?this.filterMenuElement=i.i(a.getValue)("filterModel.dlgObj.element",e):this.filterMenuElement=i.i(a.getValue)("filterModel.dialogObj.element",e),this.updateFilterMenuPosition(this.filterMenuElement,e);var t=this.parent.taskFields.id,r=this.parent.taskFields.dependency,s=this.parent.taskFields.resourceInfo,o=this.parent.treeGrid.grid.filterModule,l=i.i(a.getValue)("values",o);if(e.columnName===r&&i.i(a.isNullOrUndefined)(i.i(a.getValue)(r,l))||e.columnName===s&&i.i(a.isNullOrUndefined)(i.i(a.getValue)(s,l))){var d=this.filterMenuElement.querySelector(".e-dropdownlist"),h=void 0;i.i(a.isNullOrUndefined)(d)||(h=i.i(a.getValue)("ej2_instances[0]",d),h.index=2,h.dataBind())}else if(e.columnName===t&&i.i(a.isNullOrUndefined)(i.i(a.getValue)(t,l))&&"Menu"===this.parent.treeGrid.filterSettings.type){var d=this.filterMenuElement.querySelector(".e-flmenu-input"),h=i.i(a.getValue)("ej2_instances[0]",d);!i.i(a.isNullOrUndefined)(h)&&i.i(a.isNullOrUndefined)(this.parent.columnByField[e.columnName].format)&&(h.format="n")}}},e.prototype.setPosition=function(e,t){var r,n,s,o,l,d,h,p=this.parent.element.getBoundingClientRect(),u=p.top,c=p.left;if(!i.i(a.isNullOrUndefined)(this.parent.element.parentNode)&&"BODY"!=this.parent.element.parentNode.tagName){for(r=this.parent.element.parentNode,n=r.getBoundingClientRect().top,d=r.style.marginTop;;){if(Math.abs(u)>Math.abs(n)){o=u-n;break}if(!i.i(a.isNullOrUndefined)(this.parent.element.parentNode)){if(r.parentNode instanceof HTMLDocument)break;r=r.parentNode,r.parentNode&&r.parentNode.style&&(d=r.parentNode.style.marginTop)}n=r.getBoundingClientRect().top}for(s=r.getBoundingClientRect().left,h=r.style.marginLeft;;){if(Math.abs(c)>Math.abs(s)){l=c-s;break}if(!i.i(a.isNullOrUndefined)(this.parent.element.parentNode)){if(r.parentNode instanceof HTMLDocument)break;r=r.parentNode,h=r.style.marginLeft}s=r.getBoundingClientRect().left}}var g=e.getBoundingClientRect(),f=g.right+window.scrollX,m=g.top+window.scrollY;p.right<f+t.offsetWidth?g.left-t.offsetWidth>p.left?f=g.left-t.offsetWidth:f-=f+t.offsetWidth-p.right:i.i(a.isNullOrUndefined)(o)||i.i(a.isNullOrUndefined)(l)||(f=Math.abs(g.right-p.left),m=Math.abs(g.top-p.top)),i.i(a.isNullOrUndefined)(o)||i.i(a.isNullOrUndefined)(l)?(t.style.top=m+"px",t.style.left=f+"px"):(t.style.top="string"==typeof parseInt(d)?m+o+parseInt(d)+"px":m+o+"px",t.style.left="string"==typeof parseInt(h)?f+l+parseInt(h)+8+"px":f+l+"px")},e.prototype.updateFilterMenuPosition=function(e,t){i.i(a.addClass)([e],"e-gantt"),document.querySelector("#"+this.parent.controlId).appendChild(e);var r;this.parent.showColumnMenu?(r=document.querySelector("#treeGrid"+this.parent.controlId+"_gridcontrol_colmenu_Filter"),e.style.zIndex=r.parentElement.style.zIndex,"Menu"===this.parent.treeGrid.filterSettings.type?this.setPosition(r,i.i(a.getValue)("filterModel.dlgObj.element",t)):this.setPosition(r,i.i(a.getValue)("filterModel.dialogObj.element",t))):(r=this.parent.treeGrid.grid.getColumnHeaderByField(t.columnName).querySelector(".e-filtermenudiv"),"Menu"===this.parent.treeGrid.filterSettings.type?i.i(n.getFilterMenuPostion)(r,i.i(a.getValue)("filterModel.dlgObj",t)):i.i(n.getFilterMenuPostion)(r,i.i(a.getValue)("filterModel.dialogObj",t))),"Menu"===this.parent.treeGrid.filterSettings.type&&e.querySelector(".e-valid-input").focus()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("actionBegin",this.actionBegin),this.parent.off("actionComplete",this.actionComplete),this.parent.off("columnMenuOpen",this.columnMenuOpen))},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.parent=e,this.activeElement=null,this.previousActiveElement=null}return e.prototype.getActiveElement=function(e){return e?this.previousActiveElement:this.activeElement},e.prototype.setActiveElement=function(e){this.previousActiveElement=this.activeElement,this.activeElement=e},e.prototype.onKeyPress=function(e){var t=this.parent,n=t.getExpandedRecords(t.currentViewData);if(i.i(r.isNullOrUndefined)(this.parent.focusModule.getActiveElement())&&("expandAll"===e.action||"collapseAll"===e.action)){var a=this.parent.element.querySelector(".e-treegrid");a.focus()}var s=this.parent.focusModule.getActiveElement();if("home"!==e.action&&"end"!==e.action&&"downArrow"!==e.action&&"upArrow"!==e.action&&"delete"!==e.action&&"rightArrow"!==e.action&&"leftArrow"!==e.action&&"focusTask"!==e.action&&"focusSearch"!==e.action&&"expandAll"!==e.action&&"collapseAll"!==e.action||i.i(r.isNullOrUndefined)(t.editModule)||i.i(r.isNullOrUndefined)(t.editModule.cellEditModule)||!0!==t.editModule.cellEditModule.isCellEdit)switch(t.isAdaptive&&("addRowDialog"!==e.action&&"editRowDialog"!==e.action&&"delete"!==e.action&&"addRow"!==e.action||t.selectionModule&&"Multiple"===t.selectionSettings.type&&(t.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),e.action){case"home":if(t.selectionModule&&"Cell"!==t.selectionSettings.mode){if(0===t.selectedRowIndex)return;t.selectionModule.selectRow(0,!1,!0)}break;case"end":if(t.selectionModule&&"Cell"!==t.selectionSettings.mode){var o=n[n.length-1];if(t.selectedRowIndex===t.flatData.indexOf(o))return;t.selectionModule.selectRow(t.flatData.indexOf(o),!1,!0)}break;case"downArrow":case"upArrow":var l=t.element.querySelector("#"+t.element.id+"_searchbar");l&&l.parentElement.classList.contains("e-input-focus")&&t.selectionModule.clearSelection(),t.element.classList.contains("e-scroll-disabled")||(this.upDownKeyNavigate(e),i.i(r.isNullOrUndefined)(s)||i.i(r.isNullOrUndefined)(s.closest(".e-chart-row"))||t.ganttChartModule.manageFocus(this.getActiveElement(),"remove",!0));break;case"expandAll":t.ganttChartModule.expandCollapseAll("expand");break;case"collapseAll":t.ganttChartModule.expandCollapseAll("collapse");break;case"expandRow":case"collapseRow":this.expandCollapseKey(e);break;case"saveRequest":if(!i.i(r.isNullOrUndefined)(t.editModule)&&!i.i(r.isNullOrUndefined)(t.editModule.cellEditModule)&&t.editModule.cellEditModule.isCellEdit){var d=t.editModule.cellEditModule.editedColumn;if(d.field===t.columnMapping.duration&&!i.i(r.isNullOrUndefined)(d.edit)&&!i.i(r.isNullOrUndefined)(d.edit.read)){var h=e.target.ej2_instances[0],p=e.target.value,u=t.currentViewData[t.selectedRowIndex].ganttProperties,c=void 0;d.field===t.columnMapping.duration&&(c=i.i(r.isNullOrUndefined)(d.edit)||i.i(r.isNullOrUndefined)(d.edit.read)?i.i(r.isNullOrUndefined)(d.valueAccessor)?t.dataOperation.getDurationString(u.duration,u.durationUnit):d.valueAccessor(t.columnMapping.duration,t.editedRecords,d):d.edit.read(),p!==c.toString()&&(h.value=p,h.dataBind()))}if(t.editModule.dialogModule.dialogObj&&i.i(r.getValue)("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.treeGrid.grid.saveCell();var a=t.element.querySelector(".e-treegrid");a.focus()}if(!i.i(r.isNullOrUndefined)(this.parent.onTaskbarClick)&&!i.i(r.isNullOrUndefined)(s)&&!i.i(r.isNullOrUndefined)(s.closest(".e-chart-row"))){var g=e.target,f=s.querySelector(".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");f&&this.parent.ganttChartModule.onTaskbarClick(e,g,f)}break;case"cancelRequest":i.i(r.isNullOrUndefined)(t.editModule)||i.i(r.isNullOrUndefined)(t.editModule.cellEditModule)||(t.editModule.cellEditModule.isCellEdit=!1,i.i(r.isNullOrUndefined)(t.toolbarModule)||t.toolbarModule.refreshToolbarItems());break;case"addRow":if(t.editModule&&t.editModule.cellEditModule&&t.editModule.cellEditModule.isCellEdit)e.stopPropagation();else if(i.i(r.isNullOrUndefined)(document.getElementById(this.parent.element.id+"_dialog"))){e.preventDefault(),t.addRecord(void 0,this.parent.editSettings.newRowPosition,this.parent.selectedRowIndex);var a=t.element;a.focus()}break;case"addRowDialog":if(e.preventDefault(),t.editModule&&t.editModule.dialogModule&&t.editSettings.allowAdding){if(t.editModule.dialogModule.dialogObj&&i.i(r.getValue)("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.editModule.dialogModule.openAddDialog()}break;case"editRowDialog":e.preventDefault();if(t.element.querySelector(".e-treegrid").focus(),t.editModule&&t.editModule.dialogModule&&t.editSettings.allowEditing){if(t.editModule.dialogModule.dialogObj&&i.i(r.getValue)("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.editModule.dialogModule.openToolbarEditDialog()}break;case"delete":t.selectionModule&&t.editModule&&t.editModule.dialogModule&&(!t.editModule.dialogModule.dialogObj||t.editModule.dialogModule.dialogObj&&!t.editModule.dialogModule.dialogObj.visible)&&(!t.editSettings.allowTaskbarEditing||t.editSettings.allowTaskbarEditing&&!t.editModule.taskbarEditModule.touchEdit)&&("Cell"!==t.selectionSettings.mode&&t.selectionModule.selectedRowIndexes.length||"Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length)&&(i.i(r.isNullOrUndefined)(e.target)?t.editModule.startDeleteAction():"INPUT"!==e.target.tagName&&t.editModule.startDeleteAction());break;case"focusTask":e.preventDefault();var m=void 0;if(t.selectionModule){var y=t.currentViewData;if("Cell"===t.selectionSettings.mode||i.i(r.isNullOrUndefined)(y[t.selectedRowIndex])){if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var D=t.selectionModule.getSelectedRowCellIndexes();m=y[D[D.length-1].rowIndex].ganttProperties.rowUniqueID}}else m=t.currentViewData[t.selectedRowIndex].ganttProperties.rowUniqueID}m&&t.scrollToTask(m.toString());break;case"focusSearch":if(t.element.querySelector("#"+t.element.id+"_searchbar")){var l=t.element.querySelector("#"+t.element.id+"_searchbar");l.setAttribute("tabIndex","-1"),l.focus()}break;case"tab":case"shiftTab":t.element.classList.contains("e-scroll-disabled")||t.ganttChartModule.onTabAction(e);break;case"contextMenu":var v=document.getElementById(this.parent.element.id+"_contextmenu").ej2_instances[0],w=this.parent.getOffsetRect(e.target),k=w.top+w.height/2,b=w.left+w.width/2;this.setActiveElement(e.target),v.open(k,b),e.preventDefault();break;default:var T={requestType:"keyPressed",action:e.action,keyEvent:e};t.trigger("actionComplete",T)}},e.prototype.upDownKeyNavigate=function(e){e.preventDefault();var t=this.parent,i=t.getExpandedRecords(t.currentViewData);if(t.selectionModule){if("Cell"!==t.selectionSettings.mode&&-1!==t.selectedRowIndex){var r=t.currentViewData[t.selectedRowIndex],n=(this.parent.ganttChartModule.focusedRowIndex,i.indexOf(r)),a="downArrow"===e.action?i[n+1]:i[n-1];t.selectionModule.selectRow(t.currentViewData.indexOf(a),!1,!0)}else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var s=t.selectionModule.getSelectedRowCellIndexes(),o=s[s.length-1],l=o.cellIndexes[o.cellIndexes.length-1],r=t.currentViewData[o.rowIndex],n=i.indexOf(r),a="downArrow"===e.action?i[n+1]:i[n-1],d={rowIndex:t.currentViewData.indexOf(a),cellIndex:l};t.selectionModule.selectCell(d)}this.parent.ganttChartModule.focusedRowIndex=this.parent.selectedRowIndex}},e.prototype.expandCollapseKey=function(e){var t=this.parent;if(t.selectionModule&&-1!==t.selectedRowIndex){var i=void 0;if("Cell"!==t.selectionSettings.mode)i=t.selectedRowIndex;else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var r=t.selectionModule.getSelectedRowCellIndexes();i=r[r.length-1].rowIndex}"expandRow"===e.action?t.expandByIndex(i):t.collapseByIndex(i)}},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(17),n=i(7),a=i(0),s=(i.n(a),i(50)),o=i(2),l=(i.n(o),i(57)),d=function(){function e(e){this.isPdfExport=!1,this.parent=e,this.helper=new s.a(this.parent),this.pdfDocument=void 0}return e.prototype.getModuleName=function(){return"pdfExport"},e.prototype.destroy=function(){},e.prototype.initGantt=function(){this.pdfDocument=void 0,this.gantt=new l.a(this.parent)},e.prototype.export=function(e,t,r,n){var s=this;this.isBlob=n;var o={requestType:"beforePdfExport",ganttObject:this.parent,cancel:!1};return this.parent.trigger("beforePdfExport",o),i.i(a.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),i.i(a.getValue)("cancel",o)?new Promise(function(e,t){return e()}):new Promise(function(i,n){s.exportWithData(r,i,e,t)})},e.prototype.exportWithData=function(e,t,r,n){var s=this,l=[];i.i(a.isNullOrUndefined)(r)&&(r={}),r.fitToWidthSettings&&r.fitToWidthSettings.isFitToWidth?("CurrentViewData"===r.exportType?this.helper.beforeSinglePageExport.cloneFlatData=i.i(a.extend)([],this.parent.currentViewData,null,!0):this.helper.beforeSinglePageExport.cloneFlatData=i.i(a.extend)([],this.parent.flatData,null,!0),this.helper.beforeSinglePageExport.cloneCurrentViewData=i.i(a.extend)([],this.parent.currentViewData,null,!0),l=this.helper.beforeSinglePageExport.cloneFlatData):l="CurrentViewData"===r.exportType?this.parent.currentViewData:this.parent.flatData,this.initGantt(),i.i(a.isNullOrUndefined)(e)?this.pdfDocument=new o.PdfDocument:this.pdfDocument=e,this.processExport(l,r,n).then(function(){s.parent.trigger("pdfExportComplete",s.isBlob?{promise:s.blobPromise}:{}),i.i(a.isNullOrUndefined)(s.parent.loadingIndicator)||"Shimmer"!==s.parent.loadingIndicator.indicatorType?s.parent.hideSpinner():s.parent.hideMaskRow(),t(s.pdfDocument)})},e.prototype.processExport=function(e,t,r){var s=this,l=this.pdfDocument.sections.add();this.processSectionExportProperties(l,t);var d=l.pages.add();return this.pdfPageDimensions=d.getClientSize(),new Promise(function(i,r){s.helper.processGridExport(e,s.gantt,t),s.helper.initializePdf(s.pdfDocument),i()}).then(function(){var e=new n.i;e.break=o.PdfLayoutBreakType.FitElement;var l=s.gantt.drawGrid(d,0,0,e);return s.gantt.drawChart(l),s.helper.exportProps&&s.helper.exportProps.fitToWidthSettings&&s.helper.exportProps.fitToWidthSettings.isFitToWidth&&(s.parent.zoomingProjectStartDate=s.helper.beforeSinglePageExport.zoomingProjectStartDate,s.parent.zoomingProjectEndDate=s.helper.beforeSinglePageExport.zoomingProjectEndDate,s.parent.cloneProjectStartDate=s.helper.beforeSinglePageExport.cloneProjectStartDate,s.parent.cloneProjectEndDate=s.helper.beforeSinglePageExport.cloneProjectEndDate,s.parent.timelineModule.customTimelineSettings=s.helper.beforeSinglePageExport.customTimelineSettings,s.parent.isTimelineRoundOff=s.helper.beforeSinglePageExport.isTimelineRoundOff,s.parent.timelineModule.topTier=s.helper.beforeSinglePageExport.topTier,s.parent.timelineModule.topTierCellWidth=s.helper.beforeSinglePageExport.topTierCellWidth,s.parent.timelineModule.topTierCollection=s.helper.beforeSinglePageExport.topTierCollection,s.parent.timelineModule.bottomTier=s.helper.beforeSinglePageExport.bottomTier,s.parent.timelineModule.bottomTierCellWidth=s.helper.beforeSinglePageExport.bottomTierCellWidth,s.parent.timelineModule.bottomTierCollection=s.helper.beforeSinglePageExport.bottomTierCollection,s.parent.timelineModule.totalTimelineWidth=s.helper.beforeSinglePageExport.totalTimelineWidth,s.parent.timelineModule.timelineStartDate=s.helper.beforeSinglePageExport.timelineStartDate,s.parent.timelineModule.timelineEndDate=s.helper.beforeSinglePageExport.timelineEndDate,s.parent.timelineModule.timelineRoundOffEndDate=s.helper.beforeSinglePageExport.timelineRoundOffEndDate,s.parent.perDayWidth=s.helper.beforeSinglePageExport.perDayWidth,s.parent.updatedConnectorLineCollection=s.helper.beforeSinglePageExport.updatedConnectorLineCollection),r||(s.isBlob?s.blobPromise=s.pdfDocument.save():!i.i(a.isNullOrUndefined)(t)&&t.fileName?s.pdfDocument.save(t.fileName):s.pdfDocument.save("Export.pdf"),s.pdfDocument.destroy()),s.pdfDocument})},e.prototype.processSectionExportProperties=function(e,t){if(i.i(a.isNullOrUndefined)(t))this.gantt.ganttStyle=new r.a(t.theme).style;else{var n=new o.PdfPageSettings;if(i.i(a.isNullOrUndefined)(t.pageOrientation)||"Portrait"!==t.pageOrientation?n.orientation=o.PdfPageOrientation.Landscape:n.orientation=o.PdfPageOrientation.Portrait,i.i(a.isNullOrUndefined)(t.pageSize)||(n.size=this.getPageSize(t.pageSize)),e.setPageSettings(n),i.i(a.isNullOrUndefined)(t.ganttStyle))this.gantt.ganttStyle=new r.a(t.theme).style;else{var s=new r.a(t.theme).style;this.gantt.ganttStyle=i.i(a.extend)({},s,t.ganttStyle,!0)}}},e.prototype.getPageSize=function(e){switch(e){case"Letter":return new o.SizeF(612,792);case"Note":return new o.SizeF(540,720);case"Legal":return new o.SizeF(612,1008);case"A0":return new o.SizeF(2380,3368);case"A1":return new o.SizeF(1684,2380);case"A2":return new o.SizeF(1190,1684);case"A3":return new o.SizeF(842,1190);case"A5":return new o.SizeF(421,595);case"A6":return new o.SizeF(297,421);case"A7":return new o.SizeF(210,297);case"A8":return new o.SizeF(148,210);case"A9":return new o.SizeF(105,148);case"B0":return new o.SizeF(2836,4008);case"B1":return new o.SizeF(2004,2836);case"B2":return new o.SizeF(1418,2004);case"B3":return new o.SizeF(1002,1418);case"B4":return new o.SizeF(709,1002);case"B5":return new o.SizeF(501,709);case"Archa":return new o.SizeF(648,864);case"Archb":return new o.SizeF(864,1296);case"Archc":return new o.SizeF(1296,1728);case"Archd":return new o.SizeF(1728,2592);case"Arche":return new o.SizeF(2592,3456);case"Flsa":return new o.SizeF(612,936);case"HalfLetter":return new o.SizeF(396,612);case"Letter11x17":return new o.SizeF(792,1224);case"Ledger":return new o.SizeF(1224,792);default:return new o.SizeF(595,842)}},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(6),n=(i.n(r),i(0)),a=(i.n(n),i(4)),s=(i.n(a),i(15)),o=function(){function e(e){this.isTest=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.isSharedTask=!1,this.canDrop=!0,this.parent=e,r.TreeGrid.Inject(r.RowDD),this.parent.treeGrid.allowRowDragAndDrop=this.parent.allowRowDragAndDrop,this.bindEvents()}return e.prototype.getModuleName=function(){return"rowDragAndDrop"},e.prototype.destroy=function(){},e.prototype.bindEvents=function(){this.parent.treeGrid.rowDragStart=this.rowDragStart.bind(this),this.parent.treeGrid.rowDragStartHelper=this.rowDragStartHelper.bind(this),this.parent.treeGrid.rowDrag=this.rowDrag.bind(this),this.parent.treeGrid.rowDrop=this.rowDrop.bind(this)},e.prototype.rowDragStart=function(e){this.parent.trigger("rowDragStart",e),this.parent.element.style.position="relative"},e.prototype.addErrorElem=function(){var e=document.getElementsByClassName("e-ganttdrag")[0];if(!e.querySelectorAll(".e-errorelem").length){var t=document.createElement("div");i.i(n.classList)(t,["e-errorcontainer"],[]),i.i(n.classList)(t,["e-icons","e-errorelem"],[]);var r=e.querySelector(".errorValue"),a=e.querySelector(".e-rowcell").innerHTML;r&&(a=r.innerHTML,r.parentNode.removeChild(r)),e.querySelector(".e-rowcell").innerHTML="";var s=document.createElement("span");s.className="errorValue",s.style.paddingLeft="16px",s.innerHTML=a,e.querySelector(".e-rowcell").appendChild(t),e.querySelector(".e-rowcell").appendChild(s)}},e.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem");e&&e.remove()},e.prototype.rowDrag=function(e){var t=this.parent.element.querySelector(".e-cloneproperties");t.style.display="none";var r=t.cloneNode(!0);r.classList.add("e-ganttdrag"),r.style.display="",this.parent.element.querySelectorAll(".e-cloneproperties").length<=1?this.parent.element.appendChild(r):document.getElementsByClassName("e-cloneproperties")[0].querySelectorAll(".e-errorelem").length?this.addErrorElem():this.removeErrorElem(),"Both"===this.parent.gridLines&&i.i(n.addClass)(this.parent.element.querySelectorAll(".e-ganttdrag .e-rowcell"),["e-bothganttlines"]);var a,s,o=this.parent.element.querySelector(".e-ganttdrag"),l=this.parent.element.getClientRects()[0].top,d=this.parent.element.getClientRects()[0].left;this.parent.isAdaptive?(a=e.originalEvent.event.touches[0].clientX-d,s=e.originalEvent.event.touches[0].clientY-l):(a=i.i(n.getValue)("event",e.originalEvent).clientX-d,s=i.i(n.getValue)("event",e.originalEvent).clientY-l),o.style.left=a+20+"px",o.style.top=s+20+"px",this.parent.trigger("rowDrag",e)},e.prototype.rowDragStartHelper=function(e){this.parent.trigger("rowDragStartHelper",e),this.parent.readOnly&&(e.cancel=!0),"ResourceView"===this.parent.viewType&&0===i.i(n.getValue)("level",e.data[0])&&(e.cancel=!0)},e.prototype.rowDrop=function(e){var t=document.querySelector(".e-ganttdrag");t&&t.remove();var r=i.i(n.closest)(e.target,".e-row"),a=r?parseInt(r.getAttribute("data-rowindex"),10):e.dropIndex;e.dropIndex=a,e.dropRecord=this.parent.updatedRecords[e.dropIndex],this.parent.trigger("rowDrop",e),"ResourceView"===this.parent.viewType&&("middleSegment"===e.dropPosition&&(1!==e.dropRecord.level&&e.dropRecord.uniqueID!==i.i(n.getValue)("parentItem",e.data[0]).uniqueID||(e.cancel=!0)),"middleSegment"!==e.dropPosition&&(0!==e.dropRecord.level&&i.i(n.getValue)("parentItem",e.data[0]).uniqueID!==e.dropRecord.parentItem.uniqueID||(e.cancel=!0))),e.cancel||(e.requestType="beforeDrop",this.parent.trigger("actionBegin",e),i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),e.cancel||(this.dropRows(e,!0),e.cancel=!0))},e.prototype.dropRows=function(e,t){if(!this.parent.readOnly){if(this.dropPosition=e.dropPosition,"Invalid"!==e.dropPosition&&this.parent.editModule){var r=this.parent,a=void 0;this.droppedRecord=r.updatedRecords[e.dropIndex];var s=[],o=this.droppedRecord;e.data[0]?s=e.data:s.push(e.data);for(var l=0,d=s.length,h=this,p=0;p<d;p++){var u=function(e){if(h.parent.isOnEdit=!0,a=s[e],h.draggedRecord=a,"Invalid"!==h.dropPosition){if("ResourceView"===h.parent.viewType&&(h.checkisSharedTask(),h.previousParent=h.draggedRecord.parentItem.uniqueID),h.isSharedTask)return{value:void 0};t&&h.deleteDragRow();var d=h.treeGridData.indexOf(o);if("topSegment"===h.dropPosition&&h.dropAtTop(d),"bottomSegment"===h.dropPosition&&!h.isSharedTask){if(o.hasChildRecords){if(l=h.parent.editModule.getChildCount(o,0),h.parent.taskFields.parentID&&h.ganttData.length>0&&h.ganttData.splice(d+l+1,0,h.draggedRecord.taskData),h.treeGridData.splice(d+l+1,0,h.draggedRecord),h.parent.ids.splice(d+l+1,0,h.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===h.parent.viewType){var p=0===h.draggedRecord.level?"R"+h.draggedRecord.ganttProperties.taskId:"T"+h.draggedRecord.ganttProperties.taskId;h.parent.getTaskIds().splice(d+l+1,0,p)}}else if(h.parent.taskFields.parentID&&h.ganttData.length>0&&h.ganttData.splice(d+1,0,h.draggedRecord.taskData),h.treeGridData.splice(d+1,0,h.draggedRecord),h.parent.ids.splice(d+1,0,h.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===h.parent.viewType){var u=0===h.draggedRecord.level?"R"+h.draggedRecord.ganttProperties.taskId:"T"+h.draggedRecord.ganttProperties.taskId;h.parent.getTaskIds().splice(d+1,0,u)}if(h.parent.setRecordValue("parentItem",h.treeGridData[d].parentItem,a),h.parent.setRecordValue("parentUniqueID",h.treeGridData[d].parentUniqueID,a),h.parent.setRecordValue("level",h.treeGridData[d].level,a),a.hasChildRecords){h.updateChildRecordLevel(a,1),h.updateChildRecord(a,d+l+1)}if(o.parentItem){var c=h.parent.getParentTask(o.parentItem).childRecords,g=c,f=g.indexOf(o)+1;g.splice(f,0,a)}}if("middleSegment"===h.dropPosition&&(h.dropMiddle(d),o.childRecords.length>0&&(delete o.ganttProperties.segments,delete o.taskData[h.parent.taskFields.segments])),0!=h.treeGridData.length)for(var m=0;m<h.treeGridData.length;m++)if(h.treeGridData[parseInt(m.toString(),10)].index=m,!i.i(n.isNullOrUndefined)(h.treeGridData[parseInt(m.toString(),10)].parentItem)){var y=i.i(n.getValue)("uniqueIDCollection."+h.treeGridData[parseInt(m.toString(),10)].parentUniqueID,h.parent.treeGrid);h.treeGridData[parseInt(m.toString(),10)].parentItem.index=y.index}i.i(n.isNullOrUndefined)(a.parentItem&&-1!==h.updateParentRecords.indexOf(a.parentItem))||h.updateParentRecords.push(a.parentItem)}if(!h.parent.enableVirtualization){var D=r.flatData,v=void 0,w=void 0,k=h.parent.dataSource,b=h.parent.taskFields.id;if(a.index<o.index){v=a.index;for(var T=0;T<k.length;T++){if("break"===function(e){var t=h.parent.currentViewData.filter(function(t){return t[b]===k[e][b]})[0];if(t&&t.index>o.index)return w=t.index,"break"}(T))break}}else{v=o.index;for(var S=0;S<k.length;S++){if("break"===function(e){var t=h.parent.currentViewData.filter(function(t){return t[b]===k[e][b]})[0];if(t&&t.index>a.index)return w=t.index,"break"}(S))break}}for(var P=v;P<=w;P++)!function(e){if(!i.i(n.isNullOrUndefined)(D[e])&&(D[e].index=e,!i.i(n.isNullOrUndefined)(D[e].parentItem))){var t=D.filter(function(t){return t.uniqueID===D[e].parentUniqueID})[0];D[e].parentItem.index=t.index}}(P)}r.rowDragAndDropModule.refreshDataSource()}(p);if("object"==typeof u)return u.value}if("middleSegment"===this.dropPosition&&(o.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(o),o.ganttProperties.predecessor=null,o.ganttProperties.predecessorsName=null,o[this.parent.taskFields.dependency]=null,o.taskData[this.parent.taskFields.dependency]=null),o.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,o.ganttProperties,!0),i.i(n.isNullOrUndefined)(o.taskData[this.parent.taskFields.milestone])||!0===o.taskData[this.parent.taskFields.milestone]&&(o.taskData[this.parent.taskFields.milestone]=!1))),"ResourceView"===this.parent.viewType&&!this.isSharedTask){var c=void 0;c="middleSegment"===this.dropPosition?this.droppedRecord.uniqueID:this.droppedRecord.parentItem?this.droppedRecord.parentItem.uniqueID:this.droppedRecord.uniqueID;var g=this.parent.getTaskByUniqueID(c),f={};f[this.parent.taskFields.resourceInfo]=[],f[this.parent.taskFields.resourceInfo].push(g.ganttProperties.taskId),this.removeExistingResources();var m=this.parent.dataOperation.setResourceInfo(f),y=this.draggedRecord;i.i(n.isNullOrUndefined)(y.ganttProperties.resourceInfo)&&(y.ganttProperties.resourceInfo=[]),"Unassigned Task"===g.ganttProperties.taskName?(y.ganttProperties.resourceInfo=[],y.ganttProperties.sharedTaskUniqueIds=[y.ganttProperties.rowUniqueID]):y.ganttProperties.resourceInfo.push(m[0]),this.updateCurrentTask(y),"Unassigned Task"===g.ganttProperties.taskName?this.deleteSharedResourceTask():this.updateSharedResourceTask()}if(this.parent.taskFields.dependency&&this.parent.allowParentDependency){var D,v=!0,w=void 0;w=a.parentItem?this.parent.flatData[this.parent.ids.indexOf(a.parentItem.taskId)]:a,D=o.parentItem?this.parent.flatData[this.parent.ids.indexOf(o.parentItem.taskId)]:o;var k=void 0;if(D.uniqueID===w.uniqueID||w.parentItem&&D.uniqueID===this.parent.flatData[this.parent.ids.indexOf(w.parentItem.taskId)].uniqueID){k=this.parent.currentViewData.filter(function(e){if(e.ganttProperties.predecessor&&e.ganttProperties.predecessor.length>0)for(var t=0;t<e.ganttProperties.predecessor.length;t++)return parseInt(e.ganttProperties.predecessor[t].to)===parseInt(D.ganttProperties.taskId)||parseInt(e.ganttProperties.predecessor[t].from)===parseInt(D.ganttProperties.taskId);return null});for(var b=[],p=0;p<k.length;p++){if(b=[],k[p].ganttProperties.predecessor)for(var T=0;T<k[p].ganttProperties.predecessor.length;T++)parseInt(k[p].ganttProperties.taskId)!==parseInt(k[p].ganttProperties.predecessor[T].from)?b.push(k[p].ganttProperties.predecessor[T].from):b.push(k[p].ganttProperties.predecessor[T].to);for(var S=this,P=0;P<b.length;P++)!function(e){var t=b[e].replace(/\D/g,""),i=S.parent.currentViewData.filter(function(e){return parseInt(e.ganttProperties.taskId)==parseInt(t)});(v=S.parent.connectorLineEditModule.validateParentPredecessor(k[p],i[0]))||(S.parent.dataOperation.resetDependency(k[p]),S.parent.dataOperation.resetDependency(i[0]))}(P)}}}for(var P=0;P<this.updateParentRecords.length;P++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[P]);this.updateParentRecords=[],this.parent.isOnEdit=!1}i.i(n.isNullOrUndefined)(this.parent.editModule)||this.parent.editModule.refreshRecord(e,!0)}},e.prototype.updateCurrentTask=function(e){this.parent.dataOperation.updateMappingData(e,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(e,"resource"),this.parent.editModule.dialogModule.dialogEditValidationFlag=!1,this.parent.editModule.dialogModule.validateDuration(e),this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(e)},e.prototype.deleteSharedResourceTask=function(){for(var e=0;e<this.parent.getTaskIds().length;e++)this.parent.getTaskIds()[e]==="T"+this.draggedRecord.ganttProperties.taskId&&("Unassigned Task"!==this.parent.getTaskByUniqueID(this.parent.currentViewData[e].parentItem.uniqueID).ganttProperties.taskName&&this.removeRecords(this.parent.currentViewData[e]),i.i(n.isNullOrUndefined)(this.parent.currentViewData[e].parentItem&&-1!==this.updateParentRecords.indexOf(this.parent.currentViewData[e].parentItem))||this.updateParentRecords.push(this.parent.currentViewData[e].parentItem))},e.prototype.removeExistingResources=function(){var e=this.parent.getTaskByUniqueID(this.previousParent);if(this.draggedRecord.ganttProperties.resourceInfo)for(var t=0;t<this.draggedRecord.ganttProperties.resourceInfo.length;t++)if(this.draggedRecord.ganttProperties.resourceInfo[t][this.parent.resourceFields.id]===e.ganttProperties.taskId){this.draggedRecord.ganttProperties.resourceInfo.splice(t,1);break}},e.prototype.updateSharedResourceTask=function(){for(var e=0;e<this.parent.getTaskIds().length;e++)this.parent.getTaskIds()[e]==="T"+this.draggedRecord.ganttProperties.taskId&&(this.parent.editModule.updateGanttProperties(this.draggedRecord,this.parent.flatData[e]),this.parent.dataOperation.updateTaskData(this.parent.flatData[e]),i.i(n.isNullOrUndefined)(this.parent.flatData[e].parentItem&&-1!==this.updateParentRecords.indexOf(this.parent.currentViewData[e].parentItem))||this.updateParentRecords.push(this.parent.flatData[e].parentItem))},e.prototype._getExistingTaskWithID=function(e){for(var t=[],i=0;i<this.parent.getTaskIds().length;i++)this.parent.getTaskIds()[i]==="T"+e.ganttProperties.taskId&&t.push(this.parent.flatData[i]);return t},e.prototype.removeResourceInfo=function(e){var t=this.parent.getTaskByUniqueID(this.draggedRecord.parentItem.uniqueID);if(e.ganttProperties.resourceInfo&&e.ganttProperties.resourceInfo.length>1){var r=this._getExistingTaskWithID(e),a=void 0;if(null==r)return;for(var s=0;s<r.length;s++){a=r[s];for(var o=a.ganttProperties.resourceInfo,l=0;l<o.length;l++)if(o[l][this.parent.resourceFields.id]===t.ganttProperties.taskId){o.splice(l,1),this.parent.setRecordValue("resourceInfo",o,a.ganttProperties,!0),this.updateCurrentTask(a),i.i(n.isNullOrUndefined)(a.parentItem&&-1!==this.updateParentRecords.indexOf(a.parentItem))||this.updateParentRecords.push(a.parentItem);break}}}},e.prototype.refreshDataSource=function(){var e,t,r=this.draggedRecord,s=this.droppedRecord,o=this.parent,l=this.parent.taskFields;if(e=this.parent.dataSource instanceof a.DataManager?i.i(n.getValue)("dataOperation.dataArray",this.parent):o.dataSource,e.length>0&&!i.i(n.isNullOrUndefined)(s)&&!s.parentItem){for(var d=0;d<Object.keys(e).length;d++)i.i(n.isNullOrUndefined)(s.taskData[l.child])||e[d][l.child]!==s.taskData[l.child]?i.i(n.isNullOrUndefined)(s.taskData[l.child])&&s.taskData[l.id]===e[d][l.id]&&(t=d):t=d;"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(t,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(t+1,0,r.taskData))}else if(!this.parent.taskFields.parentID&&!i.i(n.isNullOrUndefined)(s)&&s.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var h="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=s,this.parent.editModule.updateRealDataSource([r],h),delete this.parent.editModule.addRowSelectedItem}if(this.parent.taskFields.parentID)if(r.parentItem){var p="middleSegment"===this.dropPosition?this.parent.taskFields.id:this.parent.taskFields.parentID;r[this.parent.taskFields.parentID]=s[p],r.ganttProperties.parentId=s[p],("ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition||"ProjectView"===this.parent.viewType)&&(r.taskData[this.parent.taskFields.parentID]=s.taskData[p])}else r[this.parent.taskFields.parentID]=null,r.taskData[this.parent.taskFields.parentID]=null,r.ganttProperties.parentId=null},e.prototype.dropMiddle=function(e){var t=this.parent,r=this.parent.editModule.getChildCount(this.droppedRecord,0),a=i.i(n.isNullOrUndefined)(r)||0===r?e+1:r+e+1;if("middleSegment"===this.dropPosition&&!this.isSharedTask){if(t.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(a,0,this.draggedRecord.taskData),this.treeGridData.splice(a,0,this.draggedRecord),this.parent.ids.splice(a,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var s=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId;this.parent.getTaskIds().splice(a,0,s)}this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,a,this.droppedRecord.expanded),this.recordLevel(),i.i(n.isNullOrUndefined)(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem))&&this.updateParentRecords.push(this.draggedRecord.parentItem)}},e.prototype.recordLevel=function(){var e=this.parent,t=this.draggedRecord,r=this.droppedRecord,a=e.taskFields.child;if(r.hasChildRecords||(r.hasChildRecords=!0,r.childRecords.length||(r.childRecords=[],!e.taskFields.parentID&&i.i(n.isNullOrUndefined)(r.taskData[a])&&(r.taskData[a]=[]))),"middleSegment"===this.dropPosition){var s=i.i(n.extend)({},r);delete s.childRecords;var o={uniqueID:s.uniqueID,expanded:s.expanded,level:s.level,index:s.index,taskId:s.ganttProperties.rowUniqueID};if(this.parent.setRecordValue("parentItem",o,t),this.parent.setRecordValue("parentUniqueID",r.uniqueID,t),r.childRecords.splice(r.childRecords.length,0,t),i.i(n.isNullOrUndefined)(t)||e.taskFields.parentID||i.i(n.isNullOrUndefined)(r.taskData[a])||r.taskData[e.taskFields.child].splice(r.childRecords.length,0,t.taskData),t.hasChildRecords){t.level=r.level+1,this.parent.setRecordValue("level",this.draggedRecord.level,this.draggedRecord),this.updateChildRecordLevel(t,1)}else t.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.treeGridData=i.i(s.e)(this.parent)?i.i(n.getValue)("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource,this.parent.dataSource instanceof a.DataManager?this.ganttData=i.i(n.getValue)("dataOperation.dataArray",this.parent):this.ganttData=i.i(s.e)(this.parent)?i.i(n.getValue)("result",this.parent.dataSource):this.parent.dataSource;var e=this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);this.removeRecords(e)},e.prototype.checkisSharedTask=function(){this.isSharedTask=!1;for(var e=null,t=0===this.droppedRecord.level?this.droppedRecord.uniqueID:this.droppedRecord.parentItem.uniqueID,i=this.parent.getTaskByUniqueID(t),r=i.childRecords,n=0;n<r.length;n++)"T"+this.draggedRecord.ganttProperties.taskId=="T"+r[n].ganttProperties.taskId&&(this.isSharedTask=!0,e=r[n]);this.isSharedTask&&this.removeResourceInfo(e)},e.prototype.dropAtTop=function(e){var t=this.parent;if(!this.isSharedTask){if(t.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(e,0,this.draggedRecord.taskData),this.treeGridData.splice(e,0,this.draggedRecord),this.parent.ids.splice(e,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),this.parent.setRecordValue("parentItem",this.droppedRecord.parentItem,this.draggedRecord),this.parent.setRecordValue("parentUniqueID",this.droppedRecord.parentUniqueID,this.draggedRecord),this.parent.setRecordValue("level",this.droppedRecord.level,this.draggedRecord),"ResourceView"===this.parent.viewType){var r=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId;this.parent.getTaskIds().splice(e,0,r)}if(this.draggedRecord.hasChildRecords){this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)}if(this.droppedRecord.parentItem){var a=this.parent.getParentTask(this.droppedRecord.parentItem).childRecords,s=a,o=s.indexOf(this.droppedRecord);s.splice(o,0,this.draggedRecord)}i.i(n.isNullOrUndefined)(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem))||this.updateParentRecords.push(this.draggedRecord.parentItem)}},e.prototype.updateChildRecordLevel=function(e,t){var i,r=0;if(t++,!e.hasChildRecords)return 0;r=e.childRecords.length;for(var n=0;n<r;n++){i=e.childRecords[n];var a=void 0;if(e.parentItem){a=this.parent.treeGrid.uniqueIDCollection[e.parentItem.uniqueID]}i.level=e.parentItem?a.level+t:e.level+1,this.parent.setRecordValue("level",i.level,i),i.hasChildRecords&&(t--,t=this.updateChildRecordLevel(i,t))}return t},e.prototype.updateChildRecord=function(e,t,i){var r,n=this.parent,a=0;if(!e.hasChildRecords)return 0;a=e.childRecords.length;for(var s=0;s<a;s++)r=e.childRecords[s],t++,n.flatData.splice(t,0,r),this.parent.ids.splice(t,0,r.ganttProperties.rowUniqueID.toString()),n.taskFields.parentID&&n.dataSource.length>0&&this.ganttData.splice(t,0,r.taskData),r.hasChildRecords&&(t=this.updateChildRecord(r,t));return t},e.prototype.removeRecords=function(e){var t,r=this.parent;t=this.parent.dataSource instanceof a.DataManager?i.i(n.getValue)("dataOperation.dataArray",this.parent):this.parent.dataSource;var s=e,o=this.parent.getParentTask(s.parentItem);if(s){if(s.parentItem){var l=o?o.childRecords:[],d=0;l&&l.length>0&&("ResourceView"===this.parent.viewType&&1===l.length&&(this.parent.isOnDelete=!0,l[0].isDelete=!0,this.parent.dataOperation.updateParentItems(o),this.parent.isOnDelete=!1,l[0].isDelete=!1),d=l.indexOf(s),o.childRecords.splice(d,1),!this.parent.taskFields.parentID&&o.taskData[this.parent.taskFields.child]&&o.taskData[this.parent.taskFields.child].splice(d,1),this.updateParentRecords.push(o))}if(!this.parent.taskFields.parentID){var h=[];h.push(s.ganttProperties.taskId.toString()),("ProjectView"===this.parent.viewType||"ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition)&&this.parent.editModule.removeFromDataSource(h)}if(r.taskFields.parentID){s.hasChildRecords&&s.childRecords.length>0&&this.removeChildItem(s);for(var p=void 0,u=t.length>0&&"ResourceView"!==this.parent.viewType?t:this.parent.updatedRecords,c=0;c<u.length;c++)"ResourceView"===this.parent.viewType?u[c].ganttProperties.rowUniqueID===s.ganttProperties.rowUniqueID&&(p=c):u[c][this.parent.taskFields.id]===s.taskData[this.parent.taskFields.id]&&(p=c);if(-1!==p){t.length>0&&t.splice(p,1);var g=this.treeGridData.indexOf(s);this.treeGridData.splice(g,1),this.parent.ids.splice(g,1),-1!==this.parent.treeGrid.parentData.indexOf(s)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(s),1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(p,1)}}var f=this.treeGridData.indexOf(s);if(!r.taskFields.parentID){var m=this.parent.editModule.getChildCount(s,0);this.treeGridData.splice(f,m+1),this.parent.ids.splice(f,m+1);var y=this.ganttData.indexOf(s.taskData);-1!==y&&(this.ganttData.splice(y,1),this.parent.treeGrid.parentData.splice(y,1)),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(f,m+1)}s.parentItem&&o&&o.childRecords&&!o.childRecords.length&&(o.expanded=!1,o.hasChildRecords=!1)}},e.prototype.removeChildItem=function(e){for(var t,r,s=0;s<e.childRecords.length;s++){t=e.childRecords[s];var o=void 0;o=this.parent.dataSource instanceof a.DataManager?i.i(n.getValue)("dataOperation.dataArray",this.parent):this.parent.dataSource;for(var l=0;l<o.length;l++)o[l][this.parent.taskFields.id]===t.taskData[this.parent.taskFields.id]&&(r=l);if(-1!==r){o.length>0&&o.splice(r,1);var d=this.treeGridData.indexOf(t);this.treeGridData.splice(d,1),this.parent.ids.splice(d,1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(r,1)}t.hasChildRecords&&this.removeChildItem(t)}},e.prototype.reorderRows=function(e,t,i){if(!this.parent.readOnly){if(e[0],0)return;"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var r=[],n=0;n<e.length;n++)r[n]=this.parent.updatedRecords[e[n]];var a={data:r,dropIndex:t,dropPosition:this.dropPosition};this.dropRows(a,!0)}},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(5),n=(i.n(r),i(0)),a=(i.n(n),i(4)),s=(i.n(a),function(){function e(e){this.isSelectionFromChart=!1,this.multipleIndexes=[],this.selectedRowIndexes=[],this.enableSelectMultiTouch=!1,this.openPopup=!1,this.parent=e,this.bindEvents(),this.parent.treeGrid.selectedRowIndex=this.parent.selectedRowIndex,this.parent.treeGrid.allowSelection=this.parent.allowSelection,this.parent.treeGrid.grid.selectionSettings.enableToggle=this.parent.selectionSettings.enableToggle,this.parent.treeGrid.selectionSettings=i.i(r.getActualProperties)(this.parent.selectionSettings),this.wireEvents()}return e.prototype.getModuleName=function(){return"selection"},e.prototype.wireEvents=function(){this.parent.on("selectRowByIndex",this.selectRowByIndex,this),this.parent.isAdaptive?(this.parent.on("chartMouseClick",this.mouseUpHandler,this),this.parent.on("treeGridClick",this.popUpClickHandler,this)):this.parent.on("chartMouseUp",this.mouseUpHandler,this)},e.prototype.selectRowByIndex=function(){-1===this.parent.selectedRowIndex&&-1===this.parent.staticSelectedRowIndex||!this.parent.isLoad||(this.selectRow(-1!==this.parent.staticSelectedRowIndex?this.parent.staticSelectedRowIndex:this.parent.selectedRowIndex),this.parent.staticSelectedRowIndex=-1)},e.prototype.bindEvents=function(){this.parent.treeGrid.rowSelecting=this.rowSelecting.bind(this),this.parent.treeGrid.rowSelected=this.rowSelected.bind(this),this.parent.treeGrid.rowDeselecting=this.rowDeselecting.bind(this),this.parent.treeGrid.rowDeselected=this.rowDeselected.bind(this),this.parent.treeGrid.cellSelecting=this.cellSelecting.bind(this),this.parent.treeGrid.cellSelected=this.cellSelected.bind(this),this.parent.treeGrid.cellDeselecting=this.cellDeselecting.bind(this),this.parent.treeGrid.cellDeselected=this.cellDeselected.bind(this)},e.prototype.rowSelecting=function(e){if(!this.parent.isGanttChartRendered)return void(e.cancel=!0);e.isCtrlPressed=this.isMultiCtrlRequest,e.isShiftPressed=this.isMultiShiftRequest,e.target=this.actualTarget,i.i(n.isNullOrUndefined)(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.parent.trigger("rowSelecting",e)},e.prototype.rowSelected=function(e){var t="Multiple"!==this.parent.selectionSettings.type||i.i(n.isNullOrUndefined)(e.rowIndexes)?[e.rowIndex]:e.rowIndexes;this.addRemoveClass(t),this.selectedRowIndexes=i.i(n.extend)([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:this.parent.treeGrid.grid.selectedRowIndex},!0),this.isMultiShiftRequest&&(this.selectedRowIndexes=t),this.parent.autoFocusTasks&&this.parent.ganttChartModule.updateScrollLeft(i.i(n.getValue)("data.ganttProperties.left",e)),e.target=this.actualTarget,i.i(n.isNullOrUndefined)(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.prevRowIndex=e.rowIndex,i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(e),this.parent.trigger("rowSelected",e)},e.prototype.rowDeselecting=function(e){e.target=this.actualTarget,e.isInteracted=this.isInteracted,this.parent.trigger("rowDeselecting",e)},e.prototype.rowDeselected=function(e){var t,r;if(0!==this.multipleIndexes.length)t=this.multipleIndexes;else if(i.i(n.isNullOrUndefined)(e.rowIndexes))t=[e.rowIndex];else{for(var a=0;a<e.rowIndexes.length;a++)e.rowIndexes[a]===e.rowIndex&&(r=!0);t=r?e.rowIndexes:[e.rowIndex]}this.addRemoveClass(t),this.selectedRowIndexes=i.i(n.extend)([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:-1},!0),1===this.selectedRowIndexes.length&&this.parent.setProperties({selectedRowIndex:this.selectedRowIndexes[0]},!0),i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&0===this.selectedRowIndexes.length&&this.hidePopUp(),e.target=this.actualTarget,e.isInteracted=this.isInteracted,this.parent.trigger("rowDeselected",e),this.isInteracted=!1,this.multipleIndexes=[]},e.prototype.cellSelecting=function(e){var t=new a.Deferred;return this.parent.trigger("cellSelecting",e,function(e){t.resolve(e)}),t},e.prototype.cellSelected=function(e){this.parent.trigger("cellSelected",e),i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.cellDeselecting=function(e){this.parent.trigger("cellDeselecting",e)},e.prototype.cellDeselected=function(e){this.parent.trigger("cellDeselected",e),i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.selectCell=function(e,t){this.parent.treeGrid.selectCell(e,t)},e.prototype.selectCells=function(e){this.parent.treeGrid.grid.selectCells(e)},e.prototype.selectRow=function(e,t,r){var a=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children);this.parent.enableVirtualization&&this.parent.treeGridModule.addedRecord&&(e=this.parent.flatData.indexOf(this.parent.currentViewData[e]),this.parent.treeGridModule.addedRecord=!1);var s,o=a.filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e})[0];-1===e||i.i(n.isNullOrUndefined)(o)||"Cell"===this.parent.selectionSettings.mode||(this.parent.showActiveElement&&!r?this.parent.treeGrid.grid.selectionModule.preventFocus=!0:this.parent.treeGrid.grid.selectionModule.preventFocus=!1,i.i(n.isNullOrUndefined)(this.selectedClass)||this.selectedClass!==o||t||(s=!0),!0!==s&&this.parent.treeGrid.selectRow(e,t),this.parent.treeGrid.grid.selectionModule.preventFocus=!0!==this.parent.treeGrid.grid.selectionModule.preventFocus&&this.parent.treeGrid.grid.selectionModule.preventFocus,this.prevRowIndex=e,this.selectedClass=o)},e.prototype.selectRows=function(e){!i.i(n.isNullOrUndefined)(e)&&e.length>0&&this.parent.treeGrid.selectRows(e)},e.prototype.getSelectedRowIndexes=function(){return this.parent.treeGrid.getSelectedRowIndexes()},e.prototype.getSelectedRowCellIndexes=function(){return this.parent.treeGrid.getSelectedRowCellIndexes()},e.prototype.getSelectedRecords=function(){if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){for(var e=[],t=this.parent.selectionModule.getSelectedRowIndexes(),i=this,r=0;r<t.length;r++)!function(r){var n=i.parent.currentViewData.filter(function(e){return e.index==t[r]})[0];e.push(n)}(r);return e}return this.parent.treeGrid.getSelectedRecords()},e.prototype.getCellSelectedRecords=function(){for(var e=this.parent.selectionModule.getSelectedRowCellIndexes(),t=[],i=0;i<e.length;i++)t.push(this.parent.currentViewData[e[i].rowIndex]);return t},e.prototype.getSelectedRows=function(){return this.parent.treeGrid.getSelectedRows()},e.prototype.clearSelection=function(){this.addRemoveClass(this.selectedRowIndexes),this.parent.treeGrid.clearSelection(),this.parent.selectedRowIndex=-1,this.selectedRowIndexes=[],this.selectedClass=null,i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.isInteracted=!1},e.prototype.highlightSelectedRows=function(e,t){if(this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch,this.isMultiShiftRequest=e.shiftKey,this.actualTarget=e.target,this.isInteracted=!0,this.isSelectionFromChart=t,t){var r=i.i(n.closest)(e.target,"tr.e-chart-row"),a=parseInt(r.getAttribute("aria-rowindex"),10),s=this.parent.selectionSettings.enableToggle;if("Single"===this.parent.selectionSettings.type||!this.isMultiCtrlRequest&&!this.isMultiShiftRequest)(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&!this.parent.rowDragAndDropModule.draggedRecord)&&this.selectRow(a,s);else if(this.isMultiShiftRequest)this.selectRowsByRange(i.i(n.isNullOrUndefined)(this.prevRowIndex)?a:this.prevRowIndex,a);else{i.i(n.setValue)("isMultiCtrlRequest",!0,this.parent.treeGrid.grid.selectionModule),this.parent.treeGrid.grid.selectionModule.addRowsToSelection([a]);var o=this.selectedRowIndexes.indexOf(a)>-1;o&&this.addRemoveClass([a])}}},e.prototype.getselectedrowsIndex=function(e,t){for(var i=[],r=e<t?{i:e,max:t}:{i:t,max:e},n=r.i,a=r.max;n<=a;n++)i.push(n);e>t&&i.reverse(),this.selectedRowIndexes=i},e.prototype.selectRowsByRange=function(e,t){this.isSelectionFromChart=!0,this.getselectedrowsIndex(e,t),this.selectRows(this.selectedRowIndexes)},e.prototype.addRemoveClass=function(e){"number"==typeof e&&(e=[e]);for(var t=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),r=this,a=0;a<e.length;a++)!function(a){var s=t.filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e[a]})[0];i.i(n.isNullOrUndefined)(s)||(r.getSelectedRowIndexes().indexOf(e[a])>-1?r.addClass(s):r.removeClass(s))}(a)},e.prototype.addClass=function(e){i.i(n.addClass)([e],"e-active"),e.setAttribute("aria-selected","true")},e.prototype.removeClass=function(e){i.i(n.removeClass)([e],"e-active"),e.removeAttribute("aria-selected")},e.prototype.showPopup=function(e){this.isSelectionFromChart?(i.i(r.setCssInGridPopUp)(this.parent.element.querySelector(".e-ganttpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(this.enableSelectMultiTouch&&(this.getSelectedRecords().length>1||this.getSelectedRowCellIndexes().length>1)?" e-spanclicked":"")),document.getElementsByClassName("e-gridpopup")[0].style.display="none",this.openPopup=!0):0===this.selectedRowIndexes.length&&this.hidePopUp()},e.prototype.hidePopUp=function(){this.openPopup?(document.getElementsByClassName("e-ganttpopup")[0].style.display="none",this.openPopup=!1):document.getElementsByClassName("e-gridpopup")[0].style.display="none"},e.prototype.popUpClickHandler=function(e){var t=e.target,r=this.parent.treeGrid.grid,a=i.i(n.closest)(t,".e-ganttpopup")?i.i(n.closest)(t,".e-ganttpopup"):i.i(n.closest)(t,".e-gridpopup");if(a){var s=a.querySelector(".e-rowselect");i.i(n.closest)(t,".e-ganttpopup")&&!s.classList.contains("e-spanclicked")?(this.enableSelectMultiTouch=!0,s.classList.add("e-spanclicked")):i.i(n.closest)(t,".e-gridpopup")&&s.classList.contains("e-spanclicked")?(this.openPopup=!0,this.enableSelectMultiTouch=!0):(this.hidePopUp(),this.enableSelectMultiTouch=!1,i.i(n.closest)(t,".e-ganttpopup")&&s.classList.remove("e-spanclicked"))}else if("Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive){var o=i.i(n.closest)(t,".e-rowcell");o&&0===this.selectedRowIndexes.length&&this.hidePopUp()}r&&i.i(n.setValue)("enableSelectMultiTouch",this.enableSelectMultiTouch,r.selectionModule)},e.prototype.mouseUpHandler=function(e){var t=!1,a=document.querySelectorAll(".e-drag-item"),s=null;if(e.target.closest(".e-rowcell")?s=e.target:e.target.closest(".e-chart-row")&&(s=e.target.closest(".e-left-label-container")||e.target.closest(".e-taskbar-main-container")||e.target.closest(".e-right-label-container")),this.parent.focusModule&&this.parent.focusModule.setActiveElement(s),this.parent.editModule&&this.parent.editSettings.allowTaskbarEditing&&this.parent.editModule.taskbarEditModule){var o=this.parent.editModule.taskbarEditModule;(o.isMouseDragged||o.tapPointOnFocus)&&(t=!0)}if(!t&&this.parent.element.contains(e.target)&&1!==a.length){var l=i.i(r.parentsUntil)(e.target,"e-chart-row"),d=e.target.classList.contains("e-rowcell")||e.target.classList.contains("e-row")||e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||!i.i(n.isNullOrUndefined)(l);this.popUpClickHandler(e),"Cell"!==this.parent.selectionSettings.mode&&d?(i.i(n.closest)(e.target,"tr.e-chart-row")?(this.parent.enableVirtualization&&(this.parent.treeGrid.grid.selectionModule.isInteracted=!0),this.highlightSelectedRows(e,!0)):this.highlightSelectedRows(e,!1),"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&(this.selectedRowIndexes.length>0?this.showPopup(e):this.hidePopUp())):this.isSelectionFromChart=!1}},e.prototype.maintainSelectedRecords=function(e){this.parent.selectionModule.getSelectedRowIndexes().indexOf(e)>-1&&this.addRemoveClass([e])},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off("selectRowByIndex",this.selectRowByIndex),this.parent.isAdaptive?(this.parent.off("chartMouseClick",this.mouseUpHandler),this.parent.off("treeGridClick",this.popUpClickHandler)):this.parent.off("chartMouseUp",this.mouseUpHandler))},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(6),n=(i.n(r),i(5)),a=(i.n(n),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.Sort),this.parent.treeGrid.allowSorting=this.parent.allowSorting,this.parent.treeGrid.sortSettings=i.i(n.getActualProperties)(this.parent.sortSettings),this.addEventListener()}return e.prototype.getModuleName=function(){return"sort"},e.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("updateModel",this.updateModel)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.sortColumn=function(e,t,i){this.parent.treeGrid.sortByColumn(e,t,i)},e.prototype.clearSorting=function(){this.parent.treeGrid.clearSorting()},e.prototype.updateModel=function(){this.parent.sortSettings=this.parent.treeGrid.sortSettings},e.prototype.removeSortColumn=function(e){this.parent.treeGrid.grid.removeSortColumn(e)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return h});var r=i(0),n=(i.n(r),i(1)),a=i(10),s=i(3),o=i(79),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),d=this&&this.__assign||function(){return d=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},d.apply(this,arguments)},h=function(e){function t(t){var i=e.call(this,t)||this;return i.isMouseDragged=!1,i.dependencyCancel=!1,i.editElement=null,i.elementOffsetLeft=0,i.elementOffsetTop=0,i.elementOffsetWidth=0,i.elementOffsetHeight=0,i.segmentIndex=-1,i.currentItemTop=0,i.currentItemPrevTop=0,i.topValue=0,i.draggedRecordMarginTop=0,i.parent=t,i.initPublicProp(),i.wireEvents(),i.editTooltip=new o.a(i.parent,i),i}return l(t,e),t.prototype.wireEvents=function(){this.parent.on("chartMouseDown",this.mouseDownHandler,this),this.parent.on("chartMouseUp",this.mouseUpHandler,this),this.parent.on("chartMouseLeave",this.mouseLeaveHandler,this),this.parent.on("chartMouseMove",this.mouseMoveAction,this),this.parent.on("chartMouseClick",this.mouseClickHandler,this)},t.prototype.initPublicProp=function(){this.taskBarEditElement=null,this.taskBarEditRecord=null,this.taskBarEditAction=null,this.connectorSecondElement=null,this.connectorSecondRecord=null,this.connectorSecondAction=null,this.highlightedSecondElement=null,this.fromPredecessorText=null,this.toPredecessorText=null,this.finalPredecessor=null,this.drawPredecessor=!1,this.roundOffDuration=!0,this.dragMouseLeave=!1,this.isMouseDragged=!1,this.previousItemProperty=["left","progress","duration","isMilestone","startDate","endDate","width","progressWidth","autoLeft","autoDuration","autoStartDate","autoEndDate","autoWidth","segments"],this.tapPointOnFocus=!1,this.touchEdit=!1},t.prototype.mouseDownHandler=function(e){if(this.parent.editSettings.allowTaskbarEditing&&!this.parent.readOnly)if(this.canDrag=!1,this.taskBarEditElement){var t=this.getElementByPosition(e),r=i.i(n.j)(t,s.D);(r&&r.innerHTML===this.taskBarEditElement.innerHTML||this.taskBarEditElement.classList.contains("e-segmented-taskbar")||this.taskBarEditElement.classList.contains("collpse-parent-border"))&&(this.updateTaskBarEditElement(e),this.canDrag=!0,e.preventDefault())}else this.parent.isAdaptive||this.updateTaskBarEditElement(e)},t.prototype.mouseClickHandler=function(e){if(this.parent.editSettings.allowTaskbarEditing){var t=this.getElementByPosition(e),a=i.i(n.j)(t,s.D);if(this.parent.selectionModule&&this.parent.selectionModule.enableSelectMultiTouch)return void(this.tapPointOnFocus&&this.updateTaskBarEditElement(e));this.tapPointOnFocus&&!i.i(r.isNullOrUndefined)(this.taskBarEditElement)&&a&&a.innerHTML!==this.taskBarEditElement.innerHTML?(this.connectorSecondRecord=this.parent.ganttChartModule.getRecordByTaskBar(a),this.connectorSecondAction="ConnectorPointLeftDrag",this.connectorSecondElement=a,this.fromPredecessorText="Finish",this.validateConnectorPoint()&&this.taskBarEditingAction(e,!0),this.showHideActivePredecessors(!1),this.initPublicProp()):t.classList.contains(s.E)?(this.canDrag=!1,this.multipleSelectionEnabled(),this.showHideTaskBarEditingElements(t,this.taskBarEditElement),this.tapPointOnFocus=!0,this.taskBarEditAction="ConnectorPointLeftDrag",this.connectorSecondRecord=this.taskBarEditRecord,this.taskBarEditingAction(e,!1)):t.classList.contains(s.F)?(this.canDrag=!1,this.multipleSelectionEnabled(),this.showHideTaskBarEditingElements(t,this.taskBarEditElement),this.tapPointOnFocus=!0,this.taskBarEditAction="ConnectorPointRightDrag",this.connectorSecondRecord=this.taskBarEditRecord,this.taskBarEditingAction(e,!1)):(this.tapPointOnFocus&&(this.showHideActivePredecessors(!1),this.showHideTaskBarEditingElements(a,this.taskBarEditElement)),this.updateTaskBarEditElement(e))}},t.prototype.showHideActivePredecessors=function(e){var t=this.taskBarEditRecord.ganttProperties,n=t.predecessor,a="ResourceView"===this.parent.viewType?t.taskId:t.rowUniqueID;if(n)for(var o=0;o<n.length;o++){var l=n[o];a.toString()!==l.from&&a.toString()!==l.to||this.applyActiveColor(l.from,l.to,e)}var d=this.parent.ganttChartModule.chartBodyContainer;e?(i.i(r.addClass)([this.taskBarEditElement],[s.G]),i.i(r.addClass)([d],[s.H])):(i.i(r.removeClass)([this.taskBarEditElement],[s.G]),i.i(r.removeClass)([d],[s.H])),this.touchEdit=e,i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},t.prototype.applyActiveColor=function(e,t,n){var a="ProjectView"===this.parent.viewType?this.taskBarEditRecord.ganttProperties.taskId.toString():this.taskBarEditRecord.ganttProperties.rowUniqueID.toString(),o=a===e?this.parent.connectorLineModule.getRecordByID(t):this.parent.connectorLineModule.getRecordByID(e),l=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(o)];if(!i.i(r.isNullOrUndefined)(l)){var d=l.querySelector("."+s.D),h=this.parent.element.querySelector("#ConnectorLineparent"+e+"child"+t);n?(i.i(r.addClass)([d],[s.I]),h&&i.i(r.addClass)([h],[s.I])):(i.i(r.removeClass)([d],[s.I]),h&&i.i(r.removeClass)([h],[s.I]))}},t.prototype.validateConnectorPoint=function(){var e=this.taskBarEditRecord.ganttProperties,t=this.connectorSecondRecord.ganttProperties,i=!0,r="ResourceView"===this.parent.viewType?e.taskId:e.rowUniqueID,n="ResourceView"===this.parent.viewType?t.taskId:t.rowUniqueID;if(this.connectorSecondRecord.hasChildRecords)i=!1;else if(t.predecessor)for(var a=0;a<t.predecessor.length;a++){var s=t.predecessor[a];if(s.from===r.toString()&&s.to===n.toString()){this.parent.connectorLineEditModule.childRecord=this.connectorSecondRecord,this.parent.connectorLineEditModule.predecessorIndex=a,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}if(s.from===n.toString()&&s.to===r.toString()){this.parent.connectorLineEditModule.childRecord=this.taskBarEditRecord,this.parent.connectorLineEditModule.predecessorIndex=a,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}}return i},t.prototype.mouseLeaveHandler=function(e){this.dragMouseLeave=!0},t.prototype.updateTaskBarEditElement=function(e){var t,a=this.getElementByPosition(e);if(a.classList.contains(s.J)||a.classList.contains(s.K)||a.classList.contains(s.L))t=i.i(n.j)(a,s.K);else if(a.classList.contains(s.M))t=i.i(n.j)(a,s.M);else if(t=i.i(n.j)(a,s.D),!i.i(r.isNullOrUndefined)(t)&&!a.classList.contains("e-connectorpoint-left")&&!a.classList.contains("e-connectorpoint-right")){var o=this.parent.ganttChartModule.getRecordByTaskBar(t);!i.i(r.isNullOrUndefined)(o.ganttProperties.segments)&&o.ganttProperties.segments.length>0&&(t=i.i(n.j)(a,s.N))}if(this.parent.editSettings.allowTaskbarEditing&&t){this.showHideTaskBarEditingElements(t,this.editElement),this.editElement=t,this.realTaskbarElement=this.editElement;var l=this.editElement.getAttribute("data-segment-index");if(i.i(r.isNullOrUndefined)(l)?this.segmentIndex=-1:this.segmentIndex=Number(l),this.taskBarEditRecord=this.parent.ganttChartModule.getRecordByTaskBar(this.editElement),"mousedown"===e.type||"touchstart"===e.type||"click"===e.type){this.taskBarEditAction=this.getTaskBarAction(e);var d=this.editElement.getAttribute("data-segment-index"),o=this.parent.ganttChartModule.getRecordByTaskBar(t),h=o.ganttProperties,p=this.editElement.parentElement.offsetLeft;this.currentData=o;var u=i.i(r.createElement)("div",{styles:"height:100%;border-style:dashed;border-bottom:none;border-top:none;border-width:1px;position:absolute;z-index:10000"});i.i(r.addClass)([u],"e-taskbar-resize-div"),u.style.setProperty("width",h.width+"px");var c=this.editElement.getAttribute("data-segment-index");u.style.setProperty("left",i.i(r.isNullOrUndefined)(h.segments)?h.left+"px":p+h.segments[Number(c)].left+"px");var g=this.parent.createElement("table"),f=this.parent.createElement("tbody");f.appendChild(u),g.appendChild(f);var m=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar"),y=null;if("ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||i.i(r.isNullOrUndefined)(d)||i.i(r.isNullOrUndefined)(d)||0!==Number(d))var D=this.editElement.cloneNode(!0);else var D=this.editElement.parentElement.cloneNode(!0);if(!m){i.i(r.addClass)([D],"e-clone-taskbar"),D.style.setProperty("position","absolute"),D.style.setProperty("top","0px"),y=this.parent.createElement("table");var v=this.parent.createElement("tbody");v.appendChild(D),y.appendChild(v)}if("ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||i.i(r.isNullOrUndefined)(d)||i.i(r.isNullOrUndefined)(d)||0!==Number(d))this.cloneTaskbarElement=D;else{var w=D.getElementsByClassName("e-segmented-taskbar");this.cloneTaskbarElement=w[Number(d)]}if(this.taskBarEditElement=this.cloneTaskbarElement,this.taskbarElement=y,this.taskbarResizer=g,this.currentIndex=d,this.roundOffDuration=!0,"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||!i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)||(this.taskBarEditAction=null),this.updateMouseDownProperties(e),"ResourceView"===this.parent.viewType){if(0===this.taskBarEditRecord.level)return;if(this.parent.enableMultiTaskbar){var k=this.parent.getTaskByUniqueID(this.taskBarEditRecord.parentItem.uniqueID);i.i(r.isNullOrUndefined)(k)||k.expanded||(this.prevZIndex=this.taskBarEditElement.style.zIndex,this.taskBarEditElement.style.zIndex="1000",this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")&&i.i(r.addClass)([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"))}}}}else this.parent.isAdaptive?(this.taskBarEditElement&&this.showHideTaskBarEditingElements(t,this.editElement),this.initPublicProp()):this.showHideTaskBarEditingElements(t,this.editElement)},t.prototype.showHideTaskBarEditingElements=function(e,t,n){t=t||this.editElement;var a=!!this.parent.taskFields.progress,o=!0;if(!this.parent.readOnly){if("ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar&&e){var l=this.parent.ganttChartModule.getRecordByTaskBar(e),d=this.parent.getParentTask(l.parentItem);i.i(r.isNullOrUndefined)(d)||d.expanded||(a=!1,o=!1)}if(e){if(e.querySelector("."+s.O)){if(i.i(r.addClass)([e.querySelector("."+s.O)],[s.P]),i.i(r.addClass)([e.querySelector("."+s.Q)],[s.R]),a){var h=e.querySelector("."+s.S);i.i(r.isNullOrUndefined)(h)||(i.i(r.addClass)([h],[s.T]),h.style.top="3px")}}else if(this.parent.isAdaptive&&a){var l=this.parent.ganttChartModule.getRecordByTaskBar(e);l.hasChildRecords&&i.i(r.addClass)([e],[s.U])}if(i.i(r.addClass)(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+s.V),[s.W]),!i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)&&(e.querySelector("."+s.X)||e.parentElement.querySelector("."+s.X))&&o){var p=i.i(r.isNullOrUndefined)(e.querySelector("."+s.X))?e.parentElement:e;i.i(r.isNullOrUndefined)(p.querySelector("."+s.X))||i.i(r.addClass)([p.querySelector("."+s.X)],[s.E]),i.i(r.isNullOrUndefined)(p.querySelector("."+s.Y))||i.i(r.addClass)([p.querySelector("."+s.Y)],[s.F])}}else n||i.i(r.removeClass)(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+s.V),[s.W]);if(t&&e!==t){if(t.querySelector("."+s.O)&&(i.i(r.removeClass)([t.querySelector("."+s.O)],[s.P]),i.i(r.removeClass)([t.querySelector("."+s.Q)],[s.R]),t.querySelector("."+s.S)&&i.i(r.removeClass)([t.querySelector("."+s.S)],[s.T])),i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)||!t.querySelector("."+s.X)&&!t.parentElement.querySelector("."+s.X)){if(this.parent.isAdaptive){var l=this.parent.ganttChartModule.getRecordByTaskBar(t);l&&l.hasChildRecords&&i.i(r.removeClass)([t],[s.U])}}else{var p=i.i(r.isNullOrUndefined)(t.querySelector("."+s.X))?t.parentElement:t;i.i(r.removeClass)([p.querySelector("."+s.X)],[s.E]),i.i(r.removeClass)([p.querySelector("."+s.Y)],[s.F])}this.editElement=null}}},t.prototype.getTaskBarAction=function(e){var t=this.getElementByPosition(e),n=this.taskBarEditRecord,a="";return t.classList.contains(s.O)?a="LeftResizing":t.classList.contains(s.Q)?a="RightResizing":(t.classList.contains(s.S)||i.i(r.closest)(t,"."+s.S))&&this.parent.taskFields.progress?a="ProgressResizing":t.classList.contains(s.X)?a="ConnectorPointLeftDrag":t.classList.contains(s.Y)?a="ConnectorPointRightDrag":t.classList.contains(s.J)?a="ParentResizing":t.classList.contains(s.L)||t.classList.contains(s.K)||t.classList.contains(s.M)?a="ManualParentDrag":n&&(a=n.hasChildRecords?"Auto"===this.parent.taskMode?"ParentDrag":"":n.ganttProperties.isMilestone?"MilestoneDrag":"ChildDrag"),a},t.prototype.updateMouseDownProperties=function(e){var t=this.getCoordinate(e),n=this.parent.element.closest('[style*="zoom"]');if(n){var a=parseFloat(getComputedStyle(n).zoom);t.pageX=t.pageX/a,t.pageY=t.pageY/a}if(t.pageX||t.pageY){var s=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.parent.enableRtl?this.mouseDownX=Math.abs(t.pageX-(s.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseDownX=t.pageX-s.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseDownX,this.mouseDownY=this.dragMoveY=t.pageY-s.top+this.parent.ganttChartModule.scrollObject.previousScroll.top}if("ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop){var o=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(o=this.parent.toolbarModule.element.offsetHeight),this.topValue=this.parent.getOffsetRect(e.target).top-this.parent.getOffsetRect(this.parent.element).top-parseInt(i.i(r.closest)(e.target,".e-taskbar-main-container").style.marginTop)-this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight-o+document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollTop,this.currentItemPrevTop=this.currentItemTop=this.topValue}"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.fromPredecessorText="ConnectorPointLeftDrag"===this.taskBarEditAction?"start":"finish",this.parent.connectorLineModule.tooltipTable.innerHTML=this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName,this.fromPredecessorText,"",""))},t.prototype.isMouseDragCheck=function(){if(!this.isMouseDragged&&this.taskBarEditAction&&(this.mouseDownX!==this.mouseMoveX&&(this.mouseDownX+3<this.mouseMoveX||this.mouseDownX-3>this.mouseMoveX)||this.mouseDownY!==this.mouseMoveY&&(this.mouseDownY+3<this.mouseMoveY||this.mouseDownY-3>this.mouseMoveY))){this.isMouseDragged=!0,this.parent.initiateEditAction(!0);var e=this.taskBarEditRecord.ganttProperties;this.previousItem=this.parent.timelineModule.extendFunction(e,this.previousItemProperty),"ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction||"ResourceView"==this.parent.viewType&&"ParentDrag"==this.taskBarEditAction||this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),this.taskBarEditElement.setAttribute("aria-grabbed","true")}},t.prototype.mouseMoveAction=function(e){var t=this;if(this.parent.isAdaptive){if(!this.canDrag)return;this.multipleSelectionEnabled()}var n=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),a=this.getCoordinate(e);if(this.parent.enableRtl?this.mouseMoveX=Math.abs(a.pageX-(n.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=a.pageX-n.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.mouseMoveY=a.pageY-n.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.dragMouseLeave=!1,this.isMouseDragCheck(),this.isMouseDragged&&this.taskBarEditAction){if(e.preventDefault(),!(i.i(r.isNullOrUndefined)(this.taskbarElement)||i.i(r.isNullOrUndefined)(this.editElement)||"ConnectorPointRightDrag"===this.taskBarEditAction||"ConnectorPointLeftDrag"===this.taskBarEditAction||"ResourceView"===this.parent.viewType&&this.currentData.hasChildRecords)){var s=this.editElement.parentElement;if(s.style.setProperty("position","absolute"),"ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||i.i(r.isNullOrUndefined)(this.currentIndex)||i.i(r.isNullOrUndefined)(this.currentIndex)||0!==Number(this.currentIndex)?s.appendChild(this.taskbarElement):(this.taskbarElement.childNodes[0].childNodes[0].style.setProperty("top",s.parentElement.offsetTop+"px"),s.parentElement.appendChild(this.taskbarElement)),"ProgressResizing"!==this.taskBarEditAction){this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-rows-container")[0].appendChild(this.taskbarResizer)}}var o={cancel:!1,requestType:"taskbarediting",taskBarEditAction:this.taskBarEditAction,data:this.taskBarEditRecord};-1!==this.segmentIndex&&(o.requestType="mergeSegment"),this.parent.trigger("actionBegin",o,function(n){"ConnectorPointRightDrag"!==o.taskBarEditAction&&"ConnectorPointLeftDrag"!==o.taskBarEditAction&&"LeftResizing"!==o.taskBarEditAction&&"RightResizing"!==o.taskBarEditAction&&"ProgressResizing"!==o.taskBarEditAction&&"ChildDrag"!==o.taskBarEditAction&&"ParentDrag"!==o.taskBarEditAction&&"MilestoneDrag"!==o.taskBarEditAction&&"ManualParentDrag"!==o.taskBarEditAction||(t.parent.showIndicator=!1),!i.i(r.isNullOrUndefined)(t.parent.loadingIndicator)&&"Shimmer"===t.parent.loadingIndicator.indicatorType&&t.parent.showIndicator?t.parent.showMaskRow():t.parent.showIndicator&&t.parent.showSpinner(),!1===n.cancel&&t.taskBarEditingAction(e,!1)})}else this.parent.isAdaptive||this.taskBarEditAction||this.updateTaskBarEditElement(e)},t.prototype.taskBarEditingAction=function(e,t){var n=this,a={},s=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement);if(null!==this.taskBarEditRecord){if(a.editingFields=this.taskBarEditRecord.ganttProperties,a.data=this.taskBarEditRecord,"ResourceView"===this.parent.viewType&&0===a.data.level)return;if(a.recordIndex=s,a.taskBarEditAction=this.taskBarEditAction,a.roundOffDuration=this.roundOffDuration,a.cancel=!1,a.previousData=this.previousItem,a.segmentIndex=this.segmentIndex,this.roundOffDuration=a.roundOffDuration,this.targetElement=a.target=i.i(r.closest)(e.target,".e-gantt-child-taskbar"),this.updateMouseMoveProperties(e),"ProgressResizing"===this.taskBarEditAction?this.performProgressResize(e):"LeftResizing"===this.taskBarEditAction?this.enableLeftResizing(e):"RightResizing"===this.taskBarEditAction||"ParentResizing"===this.taskBarEditAction?this.enableRightResizing(e):"ParentDrag"===this.taskBarEditAction||"ChildDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction||"ManualParentDrag"===this.taskBarEditAction?this.enableDragging(e):"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.updateConnectorLineSecondProperties(e),this.triggerDependencyEvent(e),this.drawFalseLine()),"ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop){this.dragMoveY>this.mouseMoveY?(this.mouseMoveY=this.dragMoveY-this.mouseMoveY,this.currentItemTop=this.currentItemTop-this.mouseMoveY):(this.mouseMoveY-=this.dragMoveY,this.currentItemTop=this.currentItemTop+this.mouseMoveY);var o=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.parent.isAdaptive||e.touches?this.dragMoveY=e.touches[0].pageY-o.top+this.parent.ganttChartModule.scrollObject.previousScroll.top:this.dragMoveY=e.pageY-o.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.topValue=this.currentItemTop,this.currentItemPrevTop=0===this.currentItemPrevTop||this.topValue==this.currentItemTop?this.topValue:this.currentItemPrevTop}this.setItemPosition(),this.updateEditedItem(),this.editTooltip.updateTooltip(this.segmentIndex),t&&this.taskBarEditedAction(e),this.parent.trigger("taskbarEditing",a,function(e){e.cancel&&null!==n.taskBarEditRecord&&(n.tapPointOnFocus=!1,i.i(r.merge)(n.taskBarEditRecord.ganttProperties,e.previousData))})}},t.prototype.updateMouseMoveProperties=function(e){var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),i=this.getCoordinate(e),r=this.parent.element.closest('[style*="zoom"]');if(r){var n=parseFloat(getComputedStyle(r).zoom);i.pageX=i.pageX/n,i.pageY=i.pageY/n}(i.pageX||i.pageY)&&(this.parent.enableRtl?this.mouseMoveX=Math.abs(i.pageX-(t.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=i.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseMoveX,this.mouseMoveY=i.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top);var a="ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction;if(this.taskBarEditRecord.ganttProperties.width>3&&("ProgressResizing"!==this.taskBarEditAction||0!==this.taskBarEditRecord.ganttProperties.progress&&100!==this.taskBarEditRecord.ganttProperties.progress)||a){var s=0;s=this.parent.enableRtl?Math.abs(Math.abs(this.mouseMoveX)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left)+t.left):this.mouseMoveX-this.parent.ganttChartModule.scrollObject.previousScroll.left+t.left;var o=this.mouseMoveY-this.parent.ganttChartModule.scrollObject.previousScroll.top+t.top;s+20>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):s+40>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth&&this.parent.enableRtl&&0==this.parent.ganttChartModule.scrollObject.previousScroll.left?(this.parent.ganttChartModule.scrollObject.previousScroll.left=-1,this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):s-20<t.left?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("left")):o+80>t.top+this.parent.ganttChartModule.chartBodyContainer.offsetHeight?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("bottom")):o-20<t.top?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("top")):this.stopScrollTimer()}else this.stopScrollTimer()},t.prototype.startScrollTimer=function(e){var t=this;this.stopScrollTimer();var i=0;this.scrollTimer=window.setInterval(function(){-1==Math.sign(t.timerCount)&&(i=-1,t.timerCount=Math.abs(t.timerCount)),t.timerCount="right"===e?t.timerCount+1>=t.parent.timelineModule.totalTimelineWidth?t.parent.timelineModule.totalTimelineWidth:t.timerCount+1:"bottom"===e?t.timerCount+1:t.timerCount-1<0?0:t.timerCount-1,"bottom"===e||"top"===e?t.parent.ganttChartModule.scrollObject.setScrollTop(t.timerCount):t.parent.ganttChartModule.scrollObject.setScrollLeft(t.timerCount,i),"ConnectorPointLeftDrag"!==t.taskBarEditAction&&"ConnectorPointRightDrag"!==t.taskBarEditAction||t.drawFalseLine()},0)},t.prototype.stopScrollTimer=function(){window.clearInterval(this.scrollTimer),this.scrollTimer=null},t.prototype.enableDragging=function(e){var t=this.taskBarEditRecord.ganttProperties,n=0;if(this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&!this.taskBarEditElement.classList.contains("e-segment-first")){var a=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return d({},e)}),s=a[this.segmentIndex];this.mouseDownX>this.mouseMoveX?(n=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,s.left=s.left-n):(n=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,s.left=s.left+n);var o=a[this.segmentIndex-1],l=a[this.segmentIndex+1],h=void 0;h=this.taskBarEditElement.classList.contains("e-segment-inprogress")?s.left<o.left+o.width?o.left+o.width:s.width+s.left>l.left?l.left-s.width:s.left:s.left<o.left+o.width?o.left+o.width:t.left+s.width+s.left>=this.parent.timelineModule.totalTimelineWidth?this.parent.timelineModule.totalTimelineWidth-s.width:s.left,s.left=h,this.parent.setRecordValue("segments",a,t,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")}else{this.mouseDownX>this.mouseMoveX?(n=this.mouseDownX-this.mouseMoveX)>0&&this.parent.setRecordValue("left",this.previousItem.left-n,t,!0):(n=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+n,t,!0));var h=t.left<0?0:t.left+t.width>=this.parent.timelineModule.totalTimelineWidth?this.parent.timelineModule.totalTimelineWidth-t.width:t.left;this.parent.setRecordValue("left",h,t,!0)}},t.prototype.performProgressResize=function(e){var t=this.taskBarEditRecord.ganttProperties,i=0;this.mouseDownX>this.mouseMoveX?this.mouseMoveX>t.left&&this.mouseMoveX<t.left+t.width&&t.left>0?(i=this.mouseMoveX-t.left,this.parent.setRecordValue("progressWidth",i,t,!0)):this.mouseMoveX>=t.left+t.width?this.parent.setRecordValue("progressWidth",t.width,t,!0):this.parent.setRecordValue("progressWidth",0,t,!0):this.mouseMoveX>t.left&&this.mouseMoveX<t.left+t.width?(i=this.mouseMoveX-t.left,this.parent.setRecordValue("progressWidth",i,t,!0)):this.mouseMoveX<=t.left?this.parent.setRecordValue("progressWidth",0,t,!0):this.parent.setRecordValue("progressWidth",t.width,t,!0);var r=t.progressWidth>t.width?t.width:t.progressWidth;r=t.progressWidth<0?0:t.progressWidth,this.parent.setRecordValue("progressWidth",r,t,!0);var n=t.width-t.progressWidth;this.progressBorderRadius=n<=4?4-n:0},t.prototype.enableLeftResizing=function(e){var t=this.taskBarEditRecord.ganttProperties,i=0;this.taskBarEditElement.classList.contains("e-segmented-taskbar")?this.enableSplitTaskLeftResize(t):(this.mouseDownX>this.mouseMoveX?this.mouseMoveX<t.left+t.width?(i=this.mouseDownX-this.mouseMoveX,t.left>0&&(this.parent.setRecordValue("left",this.previousItem.left-i,t,!0),this.parent.setRecordValue("width",this.previousItem.width+i,t,!0))):this.mouseMoveX>t.left+t.width&&(i=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("left",this.previousItem.left-i,t,!0),this.parent.setRecordValue("width",3,t,!0)):this.mouseMoveX<t.left+t.width?(i=this.mouseMoveX-this.mouseDownX,t.left<t.left+t.width&&this.previousItem.left+i<=this.previousItem.left+this.previousItem.width&&(this.parent.setRecordValue("left",this.previousItem.left+i,t,!0),this.parent.setRecordValue("width",this.previousItem.width-i,t,!0))):(i=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+i,t,!0),this.parent.setRecordValue("width",3,t,!0)),this.updateEditPosition(e,t),this.parent.setRecordValue("left",this.previousItem.left+this.previousItem.width-t.width,t,!0))},t.prototype.enableSplitTaskLeftResize=function(e){var t=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return d({},e)}),n=t[this.segmentIndex],a=0;if(this.mouseDownX>this.mouseMoveX)if(this.mouseMoveX<e.left+n.width+n.left){if(a=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,n.left>0){if(n.left=n.left-a,n.width=n.width+a,0!==this.segmentIndex){var s=t[this.segmentIndex-1];if(e.left+n.left<e.left+s.left+s.width){var o=e.left+s.left+s.width-(e.left+n.left);n.width-=o,n.left=n.left+o}}}else if(n.left<=0&&0===this.segmentIndex){this.parent.setRecordValue("left",e.left-a,e,!0),this.parent.setRecordValue("width",e.width+a,e,!0),n.width=n.width+a;for(var l=1;l<e.segments.length;l++){var h=t[l];h.left=h.left+a}}}else this.mouseMoveX>e.left+n.width+n.left&&(a=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,n.left=n.left-a,n.width=this.parent.perDayWidth);else if(this.mouseMoveX<e.left+n.width+n.left-this.parent.perDayWidth)if(a=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,0===this.segmentIndex&&n.left<=0){this.parent.setRecordValue("left",e.left+a,e,!0),this.parent.setRecordValue("width",e.width-a,e,!0),n.width=n.width-a;for(var l=1;l<e.segments.length;l++){var p=t[l];p.left=p.left-a}}else n.left<n.left+n.width&&n.left+a<=n.left+n.width&&(n.left=n.left+a,n.width=n.width-a);else if(this.mouseMoveX<e.left+n.left+n.width&&n.width>this.parent.perDayWidth){a=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX;var u=n.width-a<this.parent.perDayWidth?this.parent.perDayWidth>n.width?this.parent.perDayWidth-n.width:n.width-this.parent.perDayWidth:0;if(a-=u,0===this.segmentIndex){this.parent.setRecordValue("width",e.width-a,e,!0),this.parent.setRecordValue("left",e.left+a,e,!0),n.width=n.width-a;for(var l=1;l<e.segments.length;l++){var c=t[l];c.left=c.left-a}}else n.left=n.left+a,n.width=n.width-a}this.parent.setRecordValue("segments",t,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},t.prototype.updateEditPosition=function(e,t){this.updateIsMilestone(t),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.width,t.progress),t,!0)},t.prototype.updateIsMilestone=function(e){e.width<=3?(this.parent.setRecordValue("width",3,e,!0),this.parent.setRecordValue("isMilestone",!0,e,!0)):(this.parent.setRecordValue("width",e.width,e,!0),this.parent.setRecordValue("isMilestone",!1,e,!0))},t.prototype.enableRightResizing=function(e){var t=this.taskBarEditRecord.ganttProperties,n=0;if(this.taskBarEditElement.classList.contains("e-segmented-taskbar")){var a=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return d({},e)}),s=a[this.segmentIndex];if(this.mouseDownX>this.mouseMoveX){if(this.mouseMoveX>t.left+s.left&&this.mouseDownX-this.mouseMoveX>3)n=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,s.width=s.width-n;else if(this.mouseMoveX<t.left+s.left){var o=this.parent.timelineModule.isSingleTier&&("Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Hour"===this.parent.timelineModule.customTimelineSettings.topTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.topTier.unit)||"Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.timelineUnitSize:this.parent.perDayWidth;s.width=o}}else this.mouseMoveX>s.left&&(n=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,s.width=s.width+n);var l=void 0,h=this.segmentIndex!==a.length-1?a[this.segmentIndex+1]:null;i.i(r.isNullOrUndefined)(h)||(this.taskBarEditElement.classList.contains("e-segment-last")||(l=s.left+s.width>h.left?h.left-s.left:s.width),s.width=l),this.segmentIndex===t.segments.length-1&&0===this.segmentIndex&&this.parent.setRecordValue("width",s.width,t,!0),this.parent.setRecordValue("segments",a,t,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")}else this.mouseDownX>this.mouseMoveX?this.mouseMoveX>t.left&&this.mouseDownX-this.mouseMoveX>3?(n=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("width",this.previousItem.width-n,t,!0)):this.mouseMoveX<t.left&&this.parent.setRecordValue("width",3,t,!0):this.mouseMoveX>t.left&&(n=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("width",this.previousItem.width+n,t,!0)),this.updateEditPosition(e,t)},t.prototype.updateEditedItem=function(){var e,t,n,a,s=this.taskBarEditRecord.ganttProperties;switch(this.taskBarEditAction){case"ProgressResizing":this.parent.setRecordValue("progress",this.getProgressPercent(s.width,s.progressWidth),s,!0);break;case"LeftResizing":-1===this.segmentIndex?(e=this.getRoundOffStartLeft(s,this.roundOffDuration),t=this.getDateByLeft(e),i.i(r.isNullOrUndefined)(s.endDate)&&(n=this.parent.dateValidationModule.getValidEndDate(s),this.parent.setRecordValue("endDate",n,s,!0)),a=this.parent.dateValidationModule.checkStartDate(t,s,null),this.parent.setRecordValue("startDate",new Date(a.getTime()),s,!0),0===this.parent.dateValidationModule.compareDates(s.startDate,s.endDate)&&i.i(r.isNullOrUndefined)(s.isMilestone)&&!1===s.isMilestone&&0===s.duration&&this.parent.setRecordValue("duration",1,s,!0),s.isMilestone&&this.parent.setRecordValue("endDate",new Date(a.getTime()),s,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")):this.updateSplitLeftResize(s);break;case"RightResizing":case"ParentResizing":if(-1===this.segmentIndex){e=this.getRoundOffEndLeft(s,this.roundOffDuration);var o=this.getDateByLeft(e);i.i(r.isNullOrUndefined)(s.startDate)&&(a=this.parent.dateValidationModule.getValidStartDate(s),this.parent.setRecordValue("startDate",a,s,!0));var l=i.i(r.isNullOrUndefined)(s.startDate)?a:s.startDate;n=s.isMilestone?l:this.parent.dateValidationModule.checkEndDate(o,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",new Date(n.getTime()),s,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")}else this.updateSplitRightResizing(s);break;case"ParentDrag":case"ChildDrag":case"MilestoneDrag":case"ManualParentDrag":-1===this.segmentIndex||0===this.segmentIndex?this.updateChildDrag(s):this.setSplitTaskDrag(s)}},t.prototype.updateChildDrag=function(e){var t,n=this.getRoundOffStartLeft(e,this.roundOffDuration),a=this.getDateByLeft(n,e.isMilestone,e);0===this.segmentIndex?(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(a,e,null),e,!0),e.segments[0].startDate=a,e.segments[0].endDate=this.parent.dataOperation.getEndDate(e.segments[0].startDate,e.segments[0].duration,e.durationUnit,e,!1),this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments"),this.parent.chartRowsModule.incrementSegments(e.segments,0,this.taskBarEditRecord),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0)):!i.i(r.isNullOrUndefined)(e.endDate)&&i.i(r.isNullOrUndefined)(e.startDate)?(t=this.parent.dateValidationModule.checkStartDate(a,e,null),t=this.parent.dateValidationModule.checkEndDate(t,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",t,e,!0)):(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(a,e,null),e,!0),i.i(r.isNullOrUndefined)(e.duration)||this.parent.dateValidationModule.calculateEndDate(this.taskBarEditRecord))},t.prototype.updateSplitLeftResize=function(e){var t=e.segments[this.segmentIndex],n=0===this.segmentIndex?this.getRoundOffStartLeft(e,this.roundOffDuration):this.getRoundOffStartLeft(t,this.roundOffDuration),a=0===this.segmentIndex?this.getDateByLeft(n):this.getDateByLeft(e.left+n),s=this.parent.dataOperation.checkStartDate(a,e,!1),o=this.parent.dataOperation.getDuration(s,t.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);if(t.startDate=new Date(s.getTime()),t.duration=o,this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),0===this.segmentIndex&&this.parent.setRecordValue("startDate",t.startDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration"),!i.i(r.isNullOrUndefined)(e.segments[this.segmentIndex-1])){var l=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);t.offsetDuration=l}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},t.prototype.updateSplitRightResizing=function(e){var t=e.segments[this.segmentIndex],n=this.getRoundOffEndLeft(e,this.roundOffDuration),a=this.getDateByLeft(n),s=this.parent.dataOperation.checkEndDate(a,e,!1),o=this.parent.dataOperation.getDuration(t.startDate,s,e.durationUnit,e.isAutoSchedule,e.isMilestone);if(t.endDate=new Date(s.getTime()),t.duration=o,!i.i(r.isNullOrUndefined)(e.segments[this.segmentIndex+1])){var l=e.segments[this.segmentIndex+1],d=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,l.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);t.offsetDuration=d}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments"),this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")},t.prototype.sumOfDuration=function(e){for(var t=0,i=0;i<e.length;i++){t+=e[i].duration}return t},t.prototype.setSplitTaskDrag=function(e){var t=e.segments[this.segmentIndex],n=this.getRoundOffStartLeft(t,this.roundOffDuration),a=this.getDateByLeft(e.left+n);if(a=this.parent.dateValidationModule.checkStartDate(a,e,null),t.startDate=a,t.endDate=this.parent.dataOperation.getEndDate(t.startDate,t.duration,e.durationUnit,e,!1),t.duration=this.parent.dataOperation.getDuration(t.startDate,t.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone),this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"endDate"),!i.i(r.isNullOrUndefined)(e.segments[this.segmentIndex-1])){var s=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==t.startDate.getDay()||0!==s||this.parent.includeWeekend||(s=1),t.offsetDuration=s}if(!i.i(r.isNullOrUndefined)(e.segments[this.segmentIndex+1])){var o=e.segments[this.segmentIndex+1],s=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,o.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==o.startDate.getDay()||0!==s||this.parent.includeWeekend||(s=1),o.offsetDuration=s}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},t.prototype.getRoundOffEndLeft=function(e,t){var i="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,r=e.width+e.left;if(-1!==this.segmentIndex){var n=e.segments[this.segmentIndex];r=r-e.width+n.width+n.left}var a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Day")/864e5),s=this.parent.perDayWidth-this.parent.perDayWidth/a,o=s/this.parent.perDayWidth;if(void 0===t&&(t=!1),t){if(t)if("Hour"===i){var l=this.parent.perDayWidth/24;a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Hour")/36e5),s=this.parent.perDayWidth/24-this.parent.perDayWidth/24/a,0!==s&&(r=r-s+l)}else if("Minutes"===i){var d=this.parent.perDayWidth/1440;a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Minutes")/6e4),s=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/a,0!==s&&(r=r-s+d)}else 0!==s&&(r=r-s+this.parent.perDayWidth)}else"Hour"!==i&&"Minutes"!==i&&(o>.5?r=r-s+this.parent.perDayWidth:o<.5&&(r=r-s+this.parent.perDayWidth/2));return r},t.prototype.getRoundOffStartLeft=function(e,t){var n=(i.i(r.isNullOrUndefined)(e),e.left),a="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,s=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(n,i.i(r.isNullOrUndefined)(e)?e.isMilestone:null,e),1,"Day")/864e5),o=this.parent.perDayWidth-this.parent.perDayWidth/s,l=o/this.parent.perDayWidth;return void 0===t&&(t=!1),t?t&&("Hour"===a?(s=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(n),1,"Hour")/36e5),o=this.parent.perDayWidth/24-this.parent.perDayWidth/24/s,n-=o):"Minutes"===a?(s=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(n),1,"Minutes")/6e4),o=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/s,n-=o):n-=o):"Hour"!==a&&"Minutes"!==a&&(l<=.5?n-=o:l>.5&&(n=n-o+this.parent.perDayWidth/2)),n},t.prototype.getDateByLeft=function(e,t,n){var a=new Date(this.parent.timelineModule.timelineStartDate.toString()),s=864e5/this.parent.perDayWidth;a.setTime(a.getTime()+e*s),t&&!i.i(r.isNullOrUndefined)(n.predecessor)&&n.predecessor.length>0&&(a.setDate(a.getDate()-1),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,a),a=this.parent.dateValidationModule.checkStartDate(a,n,!0));var o="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier;return"Hour"!==o&&"Minutes"!==o&&(this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&!this.parent.isInDst(a)?a.setTime(a.getTime()+36e5):!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&this.parent.isInDst(a)&&a.setTime(a.getTime()-36e5)),a},t.prototype.setItemPosition=function(){if(!i.i(r.isNullOrUndefined)(this.editElement)){var e=this.editElement.parentElement;"ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&"ChildDrag"===this.taskBarEditAction?e.style.position=null:e.style.setProperty("position","absolute")}var t=this.taskBarEditRecord.ganttProperties,n=this.parent.enableRtl?"right":"left",a=i.i(r.isNullOrUndefined)(t.segments)?null:t.segments[this.segmentIndex],o="MilestoneDrag"===this.taskBarEditAction||t.isMilestone?this.parent.chartRowsModule.milestoneHeight:t.width,l=this.parent.isAdaptive?o-2:o-10;i.i(r.isNullOrUndefined)(a)||(l=this.parent.isAdaptive?a.width-2:a.width-10),this.taskBarEditElement.style.setProperty("opacity",".75");var d=this.taskBarEditElement.classList.contains(s.D)?this.taskBarEditElement:"ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||0!==this.segmentIndex?i.i(r.closest)(this.taskBarEditElement,"tr."+s.Z).querySelector("."+s.D):this.taskBarEditElement.parentElement,h=this.taskBarEditElement.classList.contains("e-segmented-taskbar"),p=this.taskBarEditElement.querySelector("."+s._0),u=this.taskBarEditElement.querySelector("."+s._1),c=this.taskBarEditElement.querySelector("."+s.S),g=this.taskBarEditElement.querySelector("."+s.Q),f=this.taskBarEditElement.querySelector("."+s._2),m=this.taskBarEditElement.querySelector("."+s._3),y=this.taskBarEditElement.querySelector("."+s._4),D=d.querySelector("."+s._4),v=this.taskBarEditElement,w=this.taskBarEditElement.querySelector("."+s.L),k=this.taskBarEditElement.querySelector("."+s.J),b=this.taskBarEditElement.querySelector("."+s._5),T=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div");if("ConnectorPointRightDrag"!==this.taskBarEditAction&&"ConnectorPointLeftDrag"!==this.taskBarEditAction){if("ParentResizing"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction){if(!h||i.i(r.isNullOrUndefined)(t.segments)||"RightResizing"!==this.taskBarEditAction&&0===this.segmentIndex||(i.i(r.isNullOrUndefined)(T)||(T.style.width=a.width+"px"),this.taskBarEditElement.style.width=a.width+"px",this.parent.enableRtl?this.taskBarEditElement.style.right=a.left+"px":(this.taskBarEditElement.style.left=a.left+"px",i.i(r.isNullOrUndefined)(T)||(T.style.left=a.left+this.editElement.parentElement.offsetLeft+"px"))),d.style.setProperty(n,t.left+"px"),d.style.width=o+"px",h&&D&&(D.style.left=(this.parent.isAdaptive?o+10:o+2)+"px"),"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&("ChildDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction)&&(d.style.setProperty("top",this.topValue+"px"),d.style.zIndex="4"),"LeftResizing"===this.taskBarEditAction&&0===this.segmentIndex){this.taskBarEditElement.style.setProperty("opacity",".75");for(var S=this.taskBarEditElement.parentElement,P=S.getElementsByClassName("e-segmented-taskbar"),C=0;C<t.segments.length;C++){var M=t.segments[C],R=P[C];R.style.width=M.width+"px",0===C&&(T.style.width=M.width+"px",T.style.left=M.left+t.left+"px"),this.parent.enableRtl?R.style.right=M.left+"px":R.style.left=M.left+"px"}}"ChildDrag"===this.taskBarEditAction&&0===this.segmentIndex&&(T.style.width=o+"px",T.style.left=t.left+"px",d.style.setProperty("opacity",".75"))}if(y&&(this.parent.enableRtl?y.style.left=(this.parent.isAdaptive?o+10:o-2)+"px":y.style.left=(this.parent.isAdaptive?o+10:o+2)+"px"),"MilestoneDrag"===this.taskBarEditAction||t.isMilestone)d.style.setProperty(n,t.left-o/2+"px"),T.style.left=t.left-o/2+"px",T.style.width=o+"px";else if("ProgressResizing"===this.taskBarEditAction)if(-1===this.segmentIndex){if(u.style.setProperty(n,t.left+t.progressWidth-10+"px"),!i.i(r.isNullOrUndefined)(p)){p.style.width=t.progressWidth+"px",p.style.borderBottomRightRadius=this.progressBorderRadius+"px",p.style.borderTopRightRadius=this.progressBorderRadius+"px";var x=this.parent.enableRtl?t.progressWidth+8:t.progressWidth-8;c.style.setProperty(n,x+"px")}}else{this.updateSegmentProgress(this.taskBarEditRecord.ganttProperties),p.style.width=t.segments[this.segmentIndex].progressWidth+"px",p.style.borderBottomRightRadius=this.progressBorderRadius+"px",p.style.borderTopRightRadius=this.progressBorderRadius+"px";var O=this.parent.enableRtl?t.segments[this.segmentIndex].progressWidth+8:t.segments[this.segmentIndex].progressWidth-8;c.style.setProperty(n,O+"px")}else"RightResizing"!==this.taskBarEditAction||i.i(r.isNullOrUndefined)(u)?"ParentDrag"===this.taskBarEditAction?(T.style.left=t.left+"px",T.style.width=o+"px",T.style.width=t.width+"px",i.i(r.isNullOrUndefined)(f)||(f.style.width=o+"px",T.style.width=t.width+"px"),i.i(r.isNullOrUndefined)(p)||(m.style.width=t.progressWidth+"px")):"ParentResizing"===this.taskBarEditAction?(T.style.width=t.width+"px",T.style.left=t.left+"px",v.style.width=w.style.width=t.width+"px",k.style.setProperty(n,t.width-b.offsetLeft+"px")):"ManualParentDrag"===this.taskBarEditAction?(T.style.width=t.width+"px",T.style.left=t.left+"px",v.style.setProperty(n,t.left-t.autoLeft+"px")):(i.i(r.isNullOrUndefined)(u)||h||(u.style.width=t.width+"px",u.style.left=t.left+"px",this.taskBarEditElement.style.width=t.width+"px",this.taskBarEditElement.style.left=t.left+"px",T.style.left=t.left+"px",T.style.width=t.width+"px"),i.i(r.isNullOrUndefined)(p)||(g.style.setProperty(n,l+"px"),p.style.width=t.progressWidth+"px",i.i(r.isNullOrUndefined)(c)||c.style.setProperty(n,t.progressWidth-10+"px")),h&&(g.style.setProperty(n,l+"px"),p.style.width=a.width+"px",i.i(r.isNullOrUndefined)(c)||c.style.setProperty(n,a.width-10+"px"))):(T.style.width=o+"px",u.style.width=o+"px",i.i(r.isNullOrUndefined)(p)||(p.style.width=t.progressWidth+"px",g.style.setProperty(n,l+"px"),i.i(r.isNullOrUndefined)(c)||c.style.setProperty(n,t.progressWidth-10+"px")))}},t.prototype.mouseUpHandler=function(e){var t=this.isMouseDragged;if(this.previousMouseMove=null,this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),this.taskBarEditAction&&this.isMouseDragged)if(!this.dragMouseLeave&&this.taskBarEditedAction||"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop)this.taskBarEditedAction(e),this.isMouseDragged=!1;else if(this.parent.isOnEdit=!1,this.cancelTaskbarEditActionInMouseLeave(),this.parent.enableCriticalPath&&this.parent.criticalPathModule){var n=this.parent.criticalPathModule;n.criticalConnectorLine(n.criticalPathCollection,n.detailPredecessorCollection,!0,n.predecessorCollectionTaskIds)}"ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar&&!i.i(r.isNullOrUndefined)(this.taskBarEditElement)&&(i.i(r.isNullOrUndefined)(this.taskBarEditElement.querySelector(".e-gantt-child-taskbar"))||this.taskBarEditElement.querySelector(".e-gantt-child-taskbar").classList.contains("e-collapsed-taskbar-drag")&&(i.i(r.removeClass)([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"),this.taskBarEditElement.style.zIndex=this.prevZIndex,this.prevZIndex="")),this.parent.isAdaptive&&!t||this.initPublicProp(),this.stopScrollTimer()},t.prototype.taskBarEditedAction=function(e){var t={},i=this.mouseDownX,r=this.mouseDownY,n=this.taskBarEditRecord,a=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement),s=this.mouseMoveX,o=this.getCoordinate(e),l=o.pageY-this.parent.ganttChartModule.chartBodyContainer.offsetTop;"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||this.drawPredecessor||(this.dependencyCancel=!0),("ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction)&&this.drawPredecessor&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)?this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord,this.finalPredecessor):(i!==s||Math.abs(r-l)>=(this.parent.rowHeight-this.parent.taskbarHeight)/2)&&null!==n&&(t.editingFields=n.ganttProperties,t.data=n,t.recordIndex=a,t.previousData=this.previousItem,t.taskBarEditAction=this.taskBarEditAction,t.action="TaskbarEditing",t.roundOffDuration=this.roundOffDuration,t.target=this.targetElement,this.taskbarEditedArgs=t,this.taskbarEdited(t)),this.parent.isProjectDateUpdated=!1},t.prototype.cancelTaskbarEditActionInMouseLeave=function(){this.parent.editModule.reUpdatePreviousRecords(!0)},t.prototype.updateSegmentProgress=function(e){for(var t=e.segments,i=!0,r=this.splitTasksDuration(t)*this.parent.perDayWidth,n=this.parent.dataOperation.getProgressWidth(r,e.progress),a=0;a<t.length;a++){var s=t[a];delete s.progressWidth,n>0&&n>s.width?(n-=s.width,s.progressWidth=s.width,s.showProgress=!1):i&&(s.progressWidth=n,s.showProgress=!0,n-=s.width,i=!1)}},t.prototype.taskbarEdited=function(e){var t=i.i(r.extend)({},e),n=t.data,a=n.ganttProperties,s=this.parent.currentViewData.indexOf(n);if(("MilestoneDrag"===t.taskBarEditAction||"ChildDrag"===t.taskBarEditAction)&&"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&this.dragMoveY>0){if(this.parent.rowDragAndDropModule){var o=this.parent.currentViewData;o[this.taskBarEditRecord.parentItem.index]&&-1===this.parent.editedRecords.indexOf(o[this.taskBarEditRecord.parentItem.index])&&this.parent.editedRecords.push(o[this.taskBarEditRecord.parentItem.index]);for(var l,d=0,h=0,p=void 0,u=this.parent.treeGrid.getRows().length,c=0;c<u;c++)d<this.dragMoveY&&"none"!==this.parent.getRowByIndex(c).style.display&&(h=c,d+=parseInt(this.parent.getRowByIndex(c).style.height),o[c].parentItem?this.parent.getRecordByID(o[c].parentItem.taskId):o[c]);for(var g=this.parent.getRowByIndex(s).getElementsByClassName("e-taskbar-main-container"),f=this.parent.getRowByIndex(h).getElementsByClassName("e-taskbar-main-container"),m=0;m<f.length;m++)f[m].offsetTop<this.dragMoveY&&g[0].getAttribute("rowuniqueid")!==f[m].getAttribute("rowuniqueid")&&(this.draggedRecordMarginTop=f[m].style.marginTop,l=f[m].getAttribute("rowuniqueid"));if(l&&(p=this.parent.currentViewData.filter(function(e){return e.rowUniqueID===l?e:null})),p){var y=this.parent.currentViewData.indexOf(p[0]),D=p[0].hasChildRecords||!p[0].parentItem&&0==p[0].childRecords.length?"child":"below";this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.reorderRows([s],y,D),this.dragMoveY=0}}"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.parent.ganttChartModule.renderOverAllocationContainer()}if("ProgressResizing"===t.taskBarEditAction)t.previousData.progress!==a.progress&&(this.parent.setRecordValue("progress",this.getProgressPercent(a.width,a.progressWidth),a,!0),n.parentItem&&this.parent.editModule.updateParentProgress(n.parentItem),i.i(r.isNullOrUndefined)(a.segments)||this.updateSegmentProgress(a));else{var v=t.data.ganttProperties.segments;if(!i.i(r.isNullOrUndefined)(v)&&v.length>0&&("LeftResizing"===this.taskBarEditAction&&0!==this.segmentIndex||"ChildDrag"===this.taskBarEditAction&&0!==this.segmentIndex||"RightResizing"===this.taskBarEditAction)){var w=v[this.segmentIndex],k=this.taskBarEditRecord.ganttProperties,b=0===this.segmentIndex?null:v[this.segmentIndex-1],T=this.segmentIndex===v.length-1?null:v[this.segmentIndex+1],S=i.i(r.isNullOrUndefined)(T)?this.parent.cloneProjectEndDate:new Date(T.startDate.getTime()),P=i.i(r.isNullOrUndefined)(b)?this.parent.cloneProjectStartDate:new Date(b.endDate.getTime()),C=new Date(w.startDate.getTime()),M=new Date(w.endDate.getTime());if("Day"===this.parent.timelineModule.topTier&&"Hour"===this.parent.timelineModule.bottomTier?(C.setHours(C.getHours()-1),M.setHours(M.getHours()+1)):(S.setHours(0,0,0,0),P.setHours(0,0,0,0),C.setDate(C.getDate()-1),M.setDate(M.getDate()+1),C.setHours(0,0,0,0),M.setHours(0,0,0,0)),C.getTime()<=P.getTime()&&!i.i(r.isNullOrUndefined)(b)&&!i.i(r.isNullOrUndefined)(w)){var R=[{firstSegmentIndex:b.segmentIndex,secondSegmentIndex:w.segmentIndex}];this.parent.chartRowsModule.mergeTask(k.taskId,R)}else if(M.getTime()>=S.getTime()&&this.segmentIndex!==v.length-1){var R=[{firstSegmentIndex:w.segmentIndex,secondSegmentIndex:T.segmentIndex}];this.parent.chartRowsModule.mergeTask(k.taskId,R)}else if(M.getTime()>=S.getTime()){w.endDate.setDate(this.parent.cloneProjectEndDate.getDate()-1),w.startDate=this.parent.dataOperation.getStartDate(w.endDate,w.duration,k.durationUnit,k);for(var c=v.length-2;c>=0;c++){var x=v[c],O=x.endDate;O.setDate(O.getDate()-x.offsetDuration),x.endDate=O,x.startDate=this.parent.dataOperation.getStartDate(x.endDate,x.duration,k.durationUnit,k)}}}this.parent.dataOperation.updateWidthLeft(t.data)}this.parent.dataOperation.updateTaskData(n),this.parent.editModule.initiateUpdateAction(t)},t.prototype.getProgressPercent=function(e,t){return Math.ceil(t/e*100)},t.prototype.drawFalseLine=function(){var e,t=this.mouseDownX,n=this.mouseDownY,a=this.mouseMoveX,o=this.mouseMoveY,l=Math.sqrt((t-a)*(t-a)+(n-o)*(n-o)),d=180*Math.atan2(o-n,a-t)/Math.PI,h="rotate("+(this.parent.enableRtl?-d:d)+"deg)",p=0;i.i(r.isNullOrUndefined)(document.querySelectorAll(".e-chart-row")[0])||(p=document.querySelectorAll(".e-chart-row")[0].offsetWidth),"ConnectorPointLeftDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?p-(this.elementOffsetLeft+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft-this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),"ConnectorPointRightDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?p-(this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left));var u=this.elementOffsetTop+this.elementOffsetHeight/2+this.parent.ganttChartModule.chartBodyContainer.offsetTop-this.parent.ganttChartModule.scrollObject.previousScroll.top;this.removeFalseLine(!1),this.falseLine=i.i(r.createElement)("div",{className:s._6,id:"ganttfalseline"+this.parent.element.id,styles:"position: absolute;transform:"+h+";border-top-width: 1px;border-top-style: dashed;z-index: 5;width:"+(l-3)+"px;top:"+u+"px;"}),this.parent.enableRtl?(this.falseLine.style.left="auto",this.falseLine.style.right=e+"px",this.falseLine.style.transformOrigin="100% 0%"):(this.falseLine.style.right="auto",this.falseLine.style.left=e+"px",this.falseLine.style.transformOrigin="0% 100%"),this.parent.ganttChartModule.chartBodyContainer.appendChild(this.falseLine)},t.prototype.removeFalseLine=function(e){this.falseLine&&(i.i(r.remove)(this.falseLine),this.falseLine=null,e&&(this.elementOffsetLeft=0,this.elementOffsetTop=0,this.elementOffsetWidth=0,this.elementOffsetHeight=0,i.i(r.removeClass)(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+s.V),[s.W])))},t.prototype.updateConnectorLineSecondProperties=function(e){var t=this.getElementByPosition(e),a=i.i(n.j)(t,s.D),o=document.body.className.includes("e-bigger");this.connectorSecondAction=null;var l=0;if(i.i(n.j)(t,s.X)?(this.connectorSecondAction="ConnectorPointLeftDrag",this.toPredecessorText="Start"):i.i(n.j)(t,s.Y)?(this.connectorSecondAction="ConnectorPointRightDrag",this.toPredecessorText="Finish"):(this.connectorSecondAction=null,this.toPredecessorText=null),this.taskBarEditElement!==a&&this.taskBarEditElement!==this.highlightedSecondElement){if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){l=this.parent.virtualScrollModule.getTopPosition()}(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&!this.elementOffsetLeft||!this.parent.enableVirtualization)&&(this.parent.allowParentDependency&&this.taskBarEditElement.children[0].classList.contains("e-manualparent-main-container")?(this.elementOffsetLeft=this.realTaskbarElement.children[0].offsetLeft+this.realTaskbarElement.offsetLeft-(o?10:0),this.elementOffsetTop=this.realTaskbarElement.parentElement.offsetTop+this.realTaskbarElement.offsetHeight/3-5+this.taskBarEditElement.children[0].offsetTop+l):(this.elementOffsetLeft=this.realTaskbarElement.offsetLeft-(o?10:0),this.elementOffsetTop=this.realTaskbarElement.parentElement.offsetTop+this.realTaskbarElement.offsetHeight/3+l),this.elementOffsetWidth=this.realTaskbarElement.offsetWidth+(o?20:0),this.elementOffsetHeight=this.realTaskbarElement.offsetHeight),this.showHideTaskBarEditingElements(a,this.highlightedSecondElement,!0)}i.i(r.isNullOrUndefined)(this.connectorSecondAction)&&!i.i(r.isNullOrUndefined)(this.connectorSecondElement)&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)&&(this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),i.i(r.removeClass)([this.connectorSecondElement.querySelector("."+s.X)],[s._7]),i.i(r.removeClass)([this.connectorSecondElement.querySelector("."+s.Y)],[s._7])),this.connectorSecondElement=this.connectorSecondAction?a:null,this.highlightedSecondElement=a,this.connectorSecondRecord=i.i(r.isNullOrUndefined)(this.connectorSecondElement)?null:this.parent.ganttChartModule.getRecordByTaskBar(this.connectorSecondElement)},t.prototype.triggerDependencyEvent=function(e,t){var n,a=this.parent.element.closest('[style*="zoom"]');if(a){var o=parseFloat(getComputedStyle(a).zoom);n=e.pageY/o}var l,d,h=this.taskBarEditRecord.ganttProperties,p=this.connectorSecondRecord?this.connectorSecondRecord.ganttProperties:null,u=this.getElementByPosition(e),c=u,g="ResourceView"===this.parent.viewType?h.taskId:h.rowUniqueID;if("ConnectorPointLeftDrag"===this.taskBarEditAction?l=g+(this.parent.enableRtl?"F":"S"):"ConnectorPointRightDrag"===this.taskBarEditAction&&(l=g+(this.parent.enableRtl?"S":"F")),this.connectorSecondAction&&("ConnectorPointLeftDrag"===this.connectorSecondAction?(l+=this.parent.enableRtl?"F":"S",d=this.parent.enableRtl?"finish":"start"):"ConnectorPointRightDrag"===this.connectorSecondAction&&(l+=this.parent.enableRtl?"S":"F",d=this.parent.enableRtl?"start":"finish")),i.i(r.isNullOrUndefined)(p))return void(this.drawPredecessor=!1);p.predecessorsName?this.finalPredecessor=p.predecessorsName+","+l:this.finalPredecessor=l;var f=this.parent.connectorLineEditModule.validatePredecessorRelation(this.connectorSecondRecord,this.finalPredecessor),m=this.parent.predecessorModule.calculatePredecessor(l,this.connectorSecondRecord),y={};if(y.fromItem=h,y.toItem=p,y.newPredecessorString=this.finalPredecessor,y.predecessor=m&&m[0],y.isValidLink=f,y.requestType="ValidateDependency",this.parent.trigger("actionBegin",y),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||"ValidateDependency"==y.requestType?"ValidateDependency"!=y.requestType&&this.parent.showSpinner():this.parent.showMaskRow(),y.isValidLink=!(!f&&y.isValidLink)&&y.isValidLink,y.isValidLink){if(this.editTooltip.toolTipObj||this.parent.isAdaptive||this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),this.editTooltip.toolTipObj){this.parent.connectorLineModule.tooltipTable.innerHTML=this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.taskName,this.parent.editModule.taskbarEditModule.fromPredecessorText,"","");var D=this.parent.connectorLineModule.tooltipTable.querySelector("#toPredecessor").querySelectorAll("td");D[1].innerText=p.taskName,D[2].innerText=this.parent.localeObj.getConstant(d);var v=this.parent.connectorLineModule.tooltipTable.parentElement.parentElement;v.offsetTop+v.offsetHeight>n&&(v.style.top=e.pageY-v.offsetHeight-20+"px")}this.drawPredecessor=!0}else this.parent.isAdaptive?(u.classList.contains(s.X)||u.classList.contains(s.Y))&&this.showHideActivePredecessors(!0):i.i(r.addClass)([c],[s._7]),this.drawPredecessor=!1},t.prototype.getCoordinate=function(e){var t={},i=e;if(t.pageX=i.pageX,t.pageY=i.pageY,e&&"click"!==e.type){var r=e;"touchmove"!==r.type&&"touchstart"!==r.type&&"touchend"!==r.type||(t.pageX=r.changedTouches[0].pageX,t.pageY=r.changedTouches[0].pageY)}return t},t.prototype.getElementByPosition=function(e){if(this.parent.isAdaptive){var t=this.getCoordinate(e);return document.elementFromPoint(t.pageX-window.pageXOffset,t.pageY-window.pageYOffset)}return e.target},t.prototype.multipleSelectionEnabled=function(){this.parent.selectionModule&&"Cell"!==this.parent.selectionSettings.mode&&"Multiple"===this.parent.selectionSettings.type&&this.parent.selectionModule.hidePopUp()},t.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.parent.off("chartMouseDown",this.mouseDownHandler),this.parent.off("chartMouseUp",this.mouseUpHandler),this.parent.off("chartMouseLeave",this.mouseLeaveHandler),this.parent.off("chartMouseMove",this.mouseMoveAction),this.parent.off("chartMouseClick",this.mouseClickHandler))},t.prototype.destroy=function(){this.unWireEvents(),this.stopScrollTimer(),this.parent.editModule.taskbarEditModule=void 0},t}(a.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(13),n=(i.n(r),i(0)),a=(i.n(n),i(3)),s=i(16),o=i(12),l=(i.n(o),function(){function e(e){this.predefinedItems={},this.items=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","Search","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath"],this.parent=e,this.id=this.parent.element.id,this.parent.on("ui-toolbarupdate",this.propertyChanged,this)}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.renderToolbar=function(){if((this.parent.toolbar||[]).length>0){this.element=i.i(n.createElement)("div",{id:this.parent.controlId+"_Gantt_Toolbar",className:a.C}),this.parent.treeGrid.grid.headerModule?this.parent.element.insertBefore(this.element,this.parent.treeGridPane.offsetParent):this.parent.element.appendChild(this.element);for(var e=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath"],t=0,r=e;t<r.length;t++){var s=r[t],o=void 0,l=void 0;"CriticalPath"===s?(o="critical-path",l="criticalPath"):(o=s.toLowerCase(),l=s[0].toLowerCase()+s.slice(1)),this.predefinedItems[s]={id:this.parent.element.id+"_"+o,prefixIcon:"e-"+o,text:this.parent.isAdaptive?"":this.parent.localeObj.getConstant(l),tooltipText:this.parent.localeObj.getConstant(l)+("add"===l||"edit"===l||"delete"===l?this.parent.localeObj.getConstant("task"):"expandAll"===l||"collapseAll"===l?this.parent.localeObj.getConstant("tasks"):""),align:this.parent.isAdaptive?"Right":"Left"},this.parent.enableRtl&&("PrevTimeSpan"===s&&(this.predefinedItems[s].prefixIcon="e-nexttimespan"),"NextTimeSpan"===s&&(this.predefinedItems[s].prefixIcon="e-prevtimespan"))}var d=this.parent.localeObj.getConstant("search");this.parent.isAdaptive?this.predefinedItems.Search={id:this.id+"_searchbutton",prefixIcon:"e-search-icon",tooltipText:d,align:"Right"}:this.predefinedItems.Search={id:this.id+"_search",template:'<div class="e-input-group e-search" role="search"><input id="'+this.id+'_searchbar" class="e-input" name="input" type="search"placeholder= "'+d+'"/><span id="'+this.id+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"tabindex="-1" title="'+d+'" aria-label= "search"></span></div>',tooltipText:d,align:"Right",cssClass:"e-search-wrapper"},this.createToolbar()}},e.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},e.prototype.createToolbar=function(){var e=this.getItems();this.toolbar=new r.Toolbar({items:e,enableRtl:this.parent.enableRtl,clicked:this.toolbarClickHandler.bind(this),height:this.parent.isAdaptive?48:"auto"}),this.toolbar.isStringTemplate=!0,this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this),this.toolbar.appendTo(this.element);var t=this.element.querySelector("#"+this.parent.element.id+"_cancel"),s=this.element.querySelector("#"+this.parent.element.id+"_update");if(t&&i.i(n.addClass)([t],a.a),s&&i.i(n.addClass)([s],a.a),this.parent.isAdaptive){this.element.insertBefore(this.getSearchBarElement(),this.element.childNodes[0]),this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar");new o.TextBox({placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,floatLabelType:"Never",showClearButton:!0}).appendTo(this.searchElement)}else this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar");this.parent.filterModule&&(this.wireEvent(),this.parent.searchSettings&&this.updateSearchTextBox()),this.parent.readOnly&&this.enableItems([this.parent.element.id+"_add",this.parent.element.id+"_update",this.parent.element.id+"_delete",this.parent.element.id+"_cancel",this.parent.element.id+"_indent",this.parent.element.id+"_outdent"],!1)},e.prototype.getSearchBarElement=function(){var e=this,t=i.i(n.createElement)("div",{className:"e-adaptive-searchbar",styles:"display: none"}),r=i.i(n.createElement)("input",{attrs:{type:"text"},id:this.parent.element.id+"_searchbar"}),a=i.i(n.createElement)("span",{className:"e-backarrowspan e-icons"});return a.onclick=function(){t.style.display="none",e.element.childNodes[1].style.display="block"},t.appendChild(a),t.appendChild(r),t},e.prototype.wireEvent=function(){this.searchElement&&(n.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),n.EventHandler.add(this.searchElement,"focus",this.focusHandler,this),n.EventHandler.add(this.searchElement,"blur",this.blurHandler,this))},e.prototype.propertyChanged=function(e){i.i(n.getValue)("module",e)===this.getModuleName()&&this.parent.toolbar&&(this.element&&this.element.parentNode&&i.i(n.remove)(this.element),this.renderToolbar(),this.refreshToolbarItems())},e.prototype.unWireEvent=function(){this.searchElement&&(n.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),n.EventHandler.remove(this.searchElement,"focus",this.focusHandler),n.EventHandler.remove(this.searchElement,"blur",this.blurHandler),this.searchElement=null),this.parent.off("ui-toolbarupdate",this.propertyChanged)},e.prototype.keyUpHandler=function(e){13===e.keyCode&&this.parent.searchSettings.key!==this.searchElement.value&&(this.parent.searchSettings.key=this.searchElement.value,this.parent.dataBind())},e.prototype.focusHandler=function(e){e.target.parentElement.classList.add("e-input-focus")},e.prototype.blurHandler=function(e){e.target.parentElement.classList.remove("e-input-focus")},e.prototype.updateSearchTextBox=function(){this.searchElement&&this.searchElement.value!==this.parent.searchSettings.key&&(this.searchElement.value=this.parent.searchSettings.key)},e.prototype.getItems=function(){var e=[],t=this.parent.toolbar,i=-1;if(t.forEach(function(e,t){("string"==typeof e&&"Search"===e||"object"==typeof e&&"Search"===e.text)&&(i=t)}),i>-1){var r=t.splice(i,1);t.push(r[0])}for(var n=0,a=t;n<a.length;n++){var s=a[n];"string"==typeof s?e.push(this.getItemObject(s)):e.push(this.getItem(s))}return e},e.prototype.getItem=function(e){var t=this.predefinedItems[e.text];return t?i.i(n.extend)(t,t,e):e},e.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.id+"_"+e}},e.prototype.toolbarClickHandler=function(e){var t=this,r=this.parent,a=this.id;this.parent.isToolBarClick=!1,i.i(n.extend)(e,{cancel:!1}),e.item.properties.id!==this.parent.element.id+"_pdfexport"&&e.item.properties.id!==this.parent.element.id+"_critical-path"||(i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow()),r.trigger(s.a,e,function(e){if(!e.cancel)switch(!0===t.parent.isAdaptive&&(e.item.id!==a+"_edit"&&e.item.id!==a+"_add"&&e.item.id!==a+"_delete"&&e.item.id!==a+"_searchbutton"&&e.item.id!==a+"_expandall"&&e.item.id!==a+"_collapseall"||t.parent.selectionModule&&"Multiple"===t.parent.selectionSettings.type&&(t.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),!i.i(n.isNullOrUndefined)(e.item)&&e.item.id){case a+"_edit":r.editModule&&r.editSettings.allowEditing&&r.editModule.dialogModule.openToolbarEditDialog();break;case a+"_indent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.indent();break;case a+"_critical-path":r.enableCriticalPath?r.enableCriticalPath=!1:r.enableCriticalPath=!0;break;case a+"_outdent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.outdent();break;case a+"_update":r.editModule.cellEditModule.isCellEdit=!1,r.treeGrid.grid.saveCell();break;case a+"_cancel":r.cancelEdit();break;case a+"_add":r.editModule&&r.editSettings.allowAdding&&r.editModule.dialogModule.openAddDialog();break;case a+"_delete":t.parent.selectionModule&&t.parent.editModule&&("Cell"!==t.parent.selectionSettings.mode&&t.parent.selectionModule.selectedRowIndexes.length||"Cell"===t.parent.selectionSettings.mode&&t.parent.selectionModule.getSelectedRowCellIndexes().length)&&t.parent.editModule.startDeleteAction();break;case a+"_search":if(i.i(n.getValue)("originalEvent.target.id",e)===t.parent.element.id+"_searchbutton"&&t.parent.filterModule){var s=t.element.querySelector("#"+t.parent.element.id+"_searchbar").value;t.parent.searchSettings.key!==s&&(t.parent.searchSettings.key=s,t.parent.dataBind())}break;case a+"_searchbutton":var o=t.element.querySelector(".e-adaptive-searchbar");o.parentElement.childNodes[1].style.display="none",o.style.display="block";break;case a+"_expandall":t.parent.ganttChartModule.expandCollapseAll("expand");break;case a+"_collapseall":t.parent.ganttChartModule.expandCollapseAll("collapse");break;case a+"_prevtimespan":t.parent.previousTimeSpan();break;case a+"_nexttimespan":t.parent.nextTimeSpan();break;case a+"_zoomin":t.zoomIn();break;case a+"_zoomout":t.zoomOut();break;case a+"_zoomtofit":t.zoomToFit()}})},e.prototype.zoomIn=function(){this.parent.timelineModule.processZooming(!0)},e.prototype.zoomToFit=function(){this.parent.timelineModule.isZoomIn&&(this.parent.timelineModule.isZoomIn=!1),this.parent.timelineModule.processZoomToFit(),this.parent.ganttChartModule.updateScrollLeft(0)},e.prototype.zoomOut=function(){this.parent.timelineModule.processZooming(!1)},e.prototype.refreshToolbarItems=function(e){var t=this.parent,r=[],a=[],s=t.editSettings,o=this.id,l=t.selectedRowIndex;if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)for(var d=0;d<t.updatedRecords.length;d++)if(t.updatedRecords[d].index===l){l=d;break}var h,p=!!t.selectionModule&&(1===t.selectionModule.selectedRowIndexes.length||1===t.selectionModule.getSelectedRowCellIndexes().length),u=this.toolbar?this.toolbar.items:[],c=[o+"_add",o+"_edit",o+"_delete",o+"_update",o+"_cancel",o+"_indent",o+"_outdent"],g="ResourceView"===this.parent.viewType&&0!==i.i(n.getValue)("data.level",e)||"ProjectView"===this.parent.viewType;if(i.i(n.isNullOrUndefined)(this.parent.editModule))a.push(o+"_delete"),a.push(o+"_add"),a.push(o+"_edit"),a.push(o+"_update"),a.push(o+"_cancel"),a.push(o+"_indent"),a.push(o+"_outdent");else{var f=!!t.editModule.taskbarEditModule&&t.editModule.taskbarEditModule.touchEdit,m=t.flatData&&t.flatData.length;s.allowAdding&&!f?r.push(o+"_add"):a.push(o+"_add"),s.allowEditing&&g&&m&&p&&!f?r.push(o+"_edit"):a.push(o+"_edit"),s.allowEditing&&0!==l&&-1!==l&&m&&p&&"ResourceView"!==this.parent.viewType?0===t.updatedRecords[l].level&&m&&!f?(r.push(o+"_indent"),a.push(o+"_outdent")):(h=t.updatedRecords[l-1],t.updatedRecords[l].level-h.level==1&&-1!==l?(a.push(o+"_indent"),r.push(o+"_outdent")):-1!==l&&(r.push(o+"_indent"),r.push(o+"_outdent"))):(a.push(o+"_indent"),a.push(o+"_outdent"));var y=!!t.selectionModule&&(t.selectionModule.selectedRowIndexes.length>0||t.selectionModule.getSelectedRowCellIndexes().length>0);if(s.allowDeleting&&m&&y&&!f?r.push(o+"_delete"):a.push(o+"_delete"),"Auto"===t.editSettings.mode&&!i.i(n.isNullOrUndefined)(t.editModule.cellEditModule)&&t.editModule.cellEditModule.isCellEdit){r=[],r.push(o+"_update",o+"_cancel"),a=[];for(var D=0;D<u.length;D++)u[D].id!==o+"_update"&&u[D].id!==o+"_cancel"&&-1!==c.indexOf(u[D].id)&&a.push(u[D].id)}else{a.push(o+"_update",o+"_cancel");for(var D=0;D<u.length;D++)-1===r.indexOf(u[D].id)&&-1===a.indexOf(u[D].id)&&r.push(u[D].id)}}for(var v=0;v<r.length;v++){for(var w=void 0,D=0;D<u.length;D++)if(u[D].id===r[v]){w=D;break}u.length>0&&this.toolbar.hideItem(w,!1)}for(var k=0;k<a.length;k++){for(var w=void 0,D=0;D<u.length;D++)if(u[D].id===a[k]){w=D;break}u.length>0&&this.toolbar.hideItem(w,!0)}},e.prototype.enableItems=function(e,t){for(var i=0,r=e;i<r.length;i++){var n=r[i],a=this.element.querySelector("#"+n);a&&this.toolbar.enableItems(a.parentElement,t)}},e.prototype.destroy=function(){this.parent.isDestroyed||(this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.toolbar.destroy(),this.parent.filterModule&&this.unWireEvent(),i.i(n.remove)(this.element))},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(6),n=(i.n(r),function(){function e(e){this.parent=e,this.bindTreeGridProperties()}return e.prototype.getModuleName=function(){return"virtualScroll"},e.prototype.bindTreeGridProperties=function(){this.parent.treeGrid.enableVirtualization=this.parent.enableVirtualization,r.TreeGrid.Inject(r.VirtualScroll)},e.prototype.getTopPosition=function(){var e,t=this.parent.ganttChartModule.scrollElement.querySelector(".e-virtualtable"),i=t.style.transform.split(",");if(i.length>1)e=i[1].trim().split(")")[0];else{var r=t.style.transform;e=r.substring(r.lastIndexOf("(")+1,r.lastIndexOf(")"))}return parseFloat(e)},e.prototype.destroy=function(){},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(0),n=(i.n(r),i(3)),a=i(25),s=i(5),o=(i.n(s),i(84)),l=function(){function e(e){this.isExpandCollapseFromChart=!1,this.isExpandAll=!1,this.isCollapseAll=!1,this.isGanttElement=!1,this.parent=e,this.chartTimelineContainer=null,this.rangeViewContainer=i.i(r.createElement)("div",{className:n._18}),this.rangeViewContainer.setAttribute("role","RangeContainer"),this.virtualRender=new o.a(this.parent),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("renderPanels",this.renderChartContainer,this),this.parent.on("recordsUpdated",this.renderChartElements,this),this.parent.on("dataReady",this.renderInitialContents,this),this.parent.on("tree-grid-created",this.renderChartContents,this),this.parent.on("destroy",this.destroy,this)},e.prototype.renderChartContents=function(){this.parent.notify("refreshDayMarkers",{}),this.wireEvents()},e.prototype.renderChartContainer=function(){this.chartElement=i.i(r.createElement)("div",{id:this.parent.element.id+"GanttChart",className:n._62}),this.parent.chartPane.appendChild(this.chartElement),this.renderTimelineContainer(),this.renderBodyContainers()},e.prototype.renderInitialContents=function(){this.parent.timelineModule.createTimelineSeries()},e.prototype.renderOverAllocationContainer=function(){for(var e=0;e<this.parent.flatData.length;e++){var t=this.parent.flatData[e];t.childRecords.length>0&&this.parent.dataOperation.updateOverlappingValues(t)}var i=this.parent.element.querySelector("."+n._18);i&&(i.innerHTML=""),0===this.parent.treeGrid.grid.filterSettings.columns.length&&this.renderRangeContainer(this.parent.currentViewData)},e.prototype.renderChartElements=function(){if(this.parent.isFromOnPropertyChange)this.rangeViewContainer.innerHTML="",this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff),this.parent.isFromOnPropertyChange=!1;else{this.parent.chartRowsModule.renderChartRows(),this.parent.predecessorModule&&this.parent.taskFields.dependency&&(this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection()),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);for(var e=0;e<this.parent.chartRowsModule.ganttChartTableBody.children.length;e++)this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4]?(this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[2].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4].setAttribute("tabindex","-1")):"ProjectView"===this.parent.viewType?i.i(r.isNullOrUndefined)(this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[1])||this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"):this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[0]&&this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[0].setAttribute("tabindex","-1");var t=this.parent.criticalPathModule;this.parent.enableCriticalPath&&t&&t.criticalPathCollection&&this.parent.criticalPathModule.criticalConnectorLine(t.criticalPathCollection,t.detailPredecessorCollection,this.parent.enableCriticalPath,t.predecessorCollectionTaskIds),"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.renderOverAllocationContainer()}this.updateWidthAndHeight(),this.parent.notify("selectRowByIndex",{}),this.parent.timelineModule.isZoomToFit&&this.parent.timelineModule.processZoomToFit()},e.prototype.renderRangeContainer=function(e){var t,i,r,n=e.length;if(0===this.parent.treeGrid.grid.filterSettings.columns.length)for(t=0;t<n;t++)i=e[t],(r=i.ganttProperties.workTimelineRanges)&&this.renderRange(r,i)},e.prototype.getTopValue=function(e){var t=this.parent.getExpandedRecords(this.parent.currentViewData),i=t.indexOf(e);return e.expanded?(i+1)*this.parent.rowHeight:i*this.parent.rowHeight},e.prototype.getRangeHeight=function(e){return!e.expanded&&e.hasChildRecords?this.parent.rowHeight-Math.floor(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight):e.childRecords.length*this.parent.rowHeight-Math.floor(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)},e.prototype.renderRange=function(e,t){var a=0,s=this.parent.currentViewData.indexOf(t);a=!this.parent.allowTaskbarOverlap&&this.parent.enableMultiTaskbar?t.expanded?this.parent.getRowByIndex(s).offsetTop+this.parent.rowHeight:this.parent.getRowByIndex(s).offsetTop:this.getTopValue(t);var o=this.rangeViewContainer.querySelector(".rangeContainer"+t.ganttProperties.rowUniqueID);o&&o.remove();var l=i.i(r.createElement)("div",{className:"rangeContainer"+t.ganttProperties.rowUniqueID,styles:"top:"+a+"px; position: absolute;"});if(0!==t.level||t.expanded||!i.i(r.isNullOrUndefined)(t.parentItem)||this.parent.enableMultiTaskbar){for(var d=0;d<e.length;d++){var h=void 0;h=this.parent.allowTaskbarOverlap||t.expanded||!this.parent.enableMultiTaskbar?this.getRangeHeight(t):parseInt(this.parent.chartRowsModule.ganttChartTableBody.childNodes[s].style.height)-(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight);var p=i.i(r.createElement)("div",{className:n._63+" e-leftarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[d].left+e[d].width-5:e[d].left)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px;\n height: "+(h+1)+"px; border-right: 0px"}),u=i.i(r.createElement)("div",{className:n._63+" e-rightarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[d].left:e[d].left+e[d].width-5)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px; height: "+(h+1)+"px;\n border-left: 0px"});l.appendChild(p),l.appendChild(u),this.rangeViewContainer.appendChild(l)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.rangeViewContainer)}},e.prototype.renderTimelineContainer=function(){this.chartTimelineContainer=i.i(r.createElement)("div",{className:n._14}),this.parent.enableRtl&&(this.chartTimelineContainer.style.borderLeftWidth="1px",this.chartTimelineContainer.style.borderRightWidth="0px"),this.chartTimelineContainer.setAttribute("role","presentation"),this.chartElement.appendChild(this.chartTimelineContainer)},e.prototype.renderBodyContainers=function(){this.chartBodyContainer=i.i(r.createElement)("div",{className:n._16}),this.chartElement.appendChild(this.chartBodyContainer),this.scrollElement=i.i(r.createElement)("div",{className:n._64+" "+n._65,styles:"position:relative;"}),this.chartBodyContainer.appendChild(this.scrollElement),this.chartBodyContent=i.i(r.createElement)("div",{className:n._15,styles:"position:relative; overflow:hidden "}),this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.ganttChartModule.virtualRender.renderWrapper():this.scrollElement.appendChild(this.chartBodyContent),this.scrollObject=new a.a(this.parent);var e=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(e=this.parent.toolbarModule.element.offsetHeight),this.scrollObject.setHeight(this.parent.ganttHeight-this.chartTimelineContainer.offsetHeight-e)},e.prototype.updateWidthAndHeight=function(){var e=0===this.parent.contentHeight?this.parent.flatData.length>1?36:0:this.parent.contentHeight,t=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];if(e>=t.offsetHeight||"auto"===this.parent.height)this.chartBodyContent.style.height=i.i(r.formatUnit)(e);else{var n=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;t.offsetHeight>=n?this.chartBodyContent.style.height=t.offsetHeight-17+"px":this.chartBodyContent.style.height=t.offsetHeight+"px"}this.chartBodyContent.style.width=i.i(r.formatUnit)(this.parent.timelineModule.totalTimelineWidth),this.setVirtualHeight(),this.parent.notify("updateHeight",{}),this.parent.updateGridLineContainerHeight(),this.updateLastRowBottomWidth()},e.prototype.setVirtualHeight=function(){if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){i.i(r.getValue)("virtualTrack",this.parent.ganttChartModule.virtualRender).style.height=this.parent.treeGrid.element.getElementsByClassName("e-virtualtrack")[0].style.height;var e=i.i(r.getValue)("wrapper",this.parent.ganttChartModule.virtualRender),t=this.parent.treeGrid.element.getElementsByClassName("e-virtualtable")[0].style.transform;e.style.transform=t}},e.prototype.updateLastRowBottomWidth=function(){if(this.parent.currentViewData.length>0&&"auto"!==this.parent.height){var e=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.getExpandedRecords(this.parent.currentViewData),t=e[e.length-1],n=this.parent.currentViewData.indexOf(t),a=this.parent.getRowByIndex(n),s=this.parent.chartRowsModule.ganttChartTableBody;if(s.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow")&&i.i(r.removeClass)(s.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow"),"e-lastrow"),this.chartBodyContent.clientHeight<this.chartBodyContainer.clientHeight&&a){i.i(r.addClass)(a.querySelectorAll("td"),"e-lastrow");var o=0===this.parent.contentHeight?this.parent.flatData.length>1?36:0:this.parent.contentHeight,l=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];if(o>=l.offsetHeight)this.chartBodyContent.style.height=i.i(r.formatUnit)(o);else{var d=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;l.offsetHeight>=d?this.chartBodyContent.style.height=l.offsetHeight-17+"px":this.chartBodyContent.style.height=l.offsetHeight+"px"}}}},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("renderPanels",this.renderChartContainer),this.parent.off("recordsUpdated",this.renderChartElements),this.parent.off("dataReady",this.renderInitialContents),this.parent.off("tree-grid-created",this.renderChartContents),this.parent.off("destroy",this.destroy))},e.prototype.ganttChartMouseDown=function(e){3!==e.which&&this.parent.editSettings.allowTaskbarEditing&&(this.parent.notify("chartMouseDown",e),this.parent.element.tabIndex=0),this.parent.editSettings.allowEditing&&this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length>0&&this.parent.treeGrid.endEdit()},e.prototype.ganttChartMouseClick=function(e){this.parent.autoFocusTasks&&this.scrollToTarget(e),this.parent.notify("chartMouseClick",e)},e.prototype.ganttChartMouseUp=function(e){if(this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseUp",e),!this.parent.editSettings.allowEditing){var t=!1;if(this.parent.editSettings.allowTaskbarEditing&&i.i(r.getValue)("editModule.taskbarEditModule.isMouseDragged",this.parent)&&i.i(r.getValue)("editModule.taskbarEditModule.taskBarEditAction",this.parent)&&(t=!0),!t){var a=e.target,s=e.target.classList.contains(n.D)||i.i(r.closest)(e.target,"."+n.D);i.i(r.closest)(a,".e-gantt-parent-taskbar")&&!this.parent.editSettings.allowEditing?this.chartExpandCollapseRequest(e):!s&&this.parent.autoFocusTasks&&this.scrollToTarget(e)}}if("touchend"===e.type){var o=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div");i.i(r.isNullOrUndefined)(o)||o.remove();var l=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar");if(!i.i(r.isNullOrUndefined)(l)){l.parentElement.parentElement.remove()}var d=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-gantt-false-line");i.i(r.isNullOrUndefined)(d)||this.parent.editModule.taskbarEditModule.removeFalseLine(!0)}},e.prototype.scrollToTarget=function(e){var t=i.i(r.closest)(e.target,"tr");if(t&&this.parent.element.contains(t)&&(this.parent.element.querySelectorAll(".e-chart-rows-container")[0].contains(e.target)||this.parent.element.querySelectorAll(".e-gridcontent")[0].contains(e.target))&&this.parent.currentViewData.length>0){var n=i.i(r.getValue)("rowIndex",i.i(r.closest)(e.target,"tr")),a=this.parent.currentViewData[n].ganttProperties.startDate;if(!i.i(r.isNullOrUndefined)(a)){var s=this.parent.dataOperation.getTaskLeft(a,!1);this.parent.autoFocusTasks&&this.updateScrollLeft(s)}}},e.prototype.updateScrollLeft=function(e){e=e>0?e:0,e=this.scrollElement.scrollWidth<=e?this.scrollElement.scrollWidth:e,(this.scrollElement.offsetWidth+this.parent.ganttChartModule.scrollElement.scrollLeft<e||this.scrollElement.scrollLeft>e)&&this.scrollObject.setScrollLeft(e-50,this.parent.enableRtl?-1:0)},e.prototype.mouseUp=function(e){i.i(r.isNullOrUndefined)(this.parent.editModule)||i.i(r.isNullOrUndefined)(this.parent.editModule.taskbarEditModule)||this.parent.editModule.taskbarEditModule.removeFalseLine(!1);var t=this.parent.element.querySelector(".e-taskbar-resize-div");if(i.i(r.isNullOrUndefined)(t)||t.remove(),this.parent.allowRowDragAndDrop){var n=this.parent.element.querySelector(".e-ganttdrag");n&&n.remove()}this.isGanttElement||this.parent.notify("chartMouseUp",e),this.isGanttElement=!1},e.prototype.documentMouseUp=function(e){if(this.isGanttElement=!0,(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse"))&&!0===i.i(r.getValue)("isEditCollapse",this.parent.treeGrid)&&i.i(r.setValue)("isEditCollapse",!1,this.parent.treeGrid),this.parent.allowRowDragAndDrop){var t=this.parent.element.querySelector(".e-ganttdrag");t&&t.remove()}if(!this.parent.isDestroyed&&3!==e.which){var a=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div");i.i(r.isNullOrUndefined)(a)||a.remove();var s=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar");if(!i.i(r.isNullOrUndefined)(s)){s.parentElement.parentElement.remove()}var o=!1;if(this.parent.editSettings.allowTaskbarEditing&&i.i(r.getValue)("editModule.taskbarEditModule.isMouseDragged",this.parent)&&i.i(r.getValue)("editModule.taskbarEditModule.taskBarEditAction",this.parent)&&(o=!0),this.parent.notify("chartMouseUp",e),this.parent.showActiveElement&&(this.parent.showIndicator=!0,i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.focusedElement&&!e.target.classList.contains("e-split-bar")&&(this.focusedElement.tabIndex=0===this.focusedElement.tabIndex?-1:this.focusedElement.tabIndex,i.i(r.removeClass)([this.focusedElement],"e-active-container"))),!o){var l=e.target,d=e.target.classList.contains(n.D)||i.i(r.closest)(e.target,"."+n.D);i.i(r.closest)(l,".e-gantt-parent-taskbar")&&!this.parent.editSettings.allowEditing?this.chartExpandCollapseRequest(e):!d&&this.parent.autoFocusTasks&&this.scrollToTarget(e)}if(this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.removeFalseLine(!0),!i.i(r.isNullOrUndefined)(this.parent.onTaskbarClick)&&!o){var l=e.target,h=i.i(r.closest)(l,".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");h&&this.onTaskbarClick(e,l,h)}}},e.prototype.onTaskbarClick=function(e,t,n){var a=i.i(r.closest)(t,"tr"),s=i.i(r.getValue)("rowIndex",a),o=this.getRecordByTarget(e),l={data:o,taskbarElement:n,rowIndex:s,target:t};this.parent.trigger("onTaskbarClick",l)},e.prototype.ganttChartLeave=function(e){this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseLeave",e)},e.prototype.ganttChartMove=function(e){this.parent.editSettings.allowTaskbarEditing&&(this.parent.notify("chartMouseMove",e),!i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)&&this.parent.connectorLineEditModule&&this.parent.connectorLineEditModule.updateConnectorLineEditElement(e))},e.prototype.contextClick=function(e){this.parent.allowFiltering&&this.parent.filterModule&&this.parent.filterModule.closeFilterOnContextClick(e.srcElement)},e.prototype.mouseMoveHandler=function(e){if(!i.i(r.isNullOrUndefined)(this.parent.onMouseMove)&&(this.parent.flatData.length||e.target.classList.contains("e-header-cell-label")||e.target.classList.contains("e-headercell"))){var t=e.target,n={originalEvent:e},a=i.i(r.closest)(t,".e-chart-row-cell,.e-connector-line-container,.e-event-markers,.e-header-cell-label,.e-rowcell,.e-headercell,.e-indicator-span");if(a){var s=void 0,o=i.i(r.closest)(t,".e-rowcell,.e-chart-row-cell"),l=i.i(r.closest)(t,".e-rowcell,.e-headercell");if(o&&(s=this.parent.ganttChartModule.getRecordByTarget(e),n.data=s),l){var d=i.i(r.getValue)("cellIndex",l);n.column=this.parent.treeGrid.columns[d]}if(i.i(r.closest)(t,".e-indicator-span")){var h=0,p=s.ganttProperties.indicators;if(p.length>1)for(h=0;h<p.length&&p[h].name!==a.innerText.trim();h++);n.indicator=p[h]}if(i.i(r.closest)(t,".e-connector-line-container")){var u={};u.target=a,n.predecessor=this.parent.tooltipModule.getPredecessorTooltipData(u)}if(i.i(r.closest)(t,".e-event-markers")){var u={};u.target=a,n.eventMarkers=this.parent.tooltipModule.getMarkerTooltipData(u)}t.classList.contains("e-header-cell-label")&&(n.date=new Date(t.dataset.content))}this.parent.trigger("onMouseMove",n)}},e.prototype.doubleClickHandler=function(e){this.parent.notify("chartDblClick",e);var t=e.target,n=i.i(r.closest)(t,"tr"),a=i.i(r.getValue)("rowIndex",n),s=this.parent.ganttChartModule.getRecordByTarget(e),o={row:n,rowData:s,rowIndex:a,target:t};this.recordDoubleClick(o)},e.prototype.recordDoubleClick=function(e){this.parent.trigger("recordDoubleClick",e)},e.prototype.getRecordByTarget=function(e){var t,a=i.i(r.closest)(e.target,"div."+n.D);if(i.i(r.isNullOrUndefined)(a)){if(a=i.i(r.closest)(e.target,"tr")){var s=i.i(r.getValue)("rowIndex",i.i(r.closest)(e.target,"tr"));t=this.parent.currentViewData[s]}}else{var o=a.getAttribute("rowUniqueId");t=this.parent.getRecordByID(o)}return t},e.prototype.getChartRows=function(){return null!=document.getElementById(this.parent.element.id+"GanttTaskTableBody")?document.getElementById(this.parent.element.id+"GanttTaskTableBody").querySelectorAll(".e-chart-row"):null},e.prototype.chartExpandCollapseRequest=function(e){if(!this.parent.enableMultiTaskbar){var t=e.target,n=i.i(r.closest)(t,".e-gantt-parent-taskbar"),a=this.getRecordByTarget(e),s=i.i(r.closest)(t,"tr"),o=i.i(r.getValue)("rowIndex",s),l=this.parent.treeGrid.getRows()[o],d={data:a,gridRow:l,chartRow:s,cancel:!1};this.isExpandCollapseFromChart=!0,n.classList.contains("e-row-expand")?this.collapseGanttRow(d):n.classList.contains("e-row-collapse")&&this.expandGanttRow(d)}},e.prototype.reRenderConnectorLines=function(){this.parent.connectorLineModule.dependencyViewContainer.innerHTML="",this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);var e=this.parent.criticalPathModule;this.parent.enableCriticalPath&&e&&e.criticalPathCollection&&e.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds)},e.prototype.collapseGanttRow=function(e,t){var n=this;t?this.collapsedGanttRow(e):this.parent.trigger("collapsing",e,function(e){n.isExpandCollapseFromChart&&!i.i(r.getValue)("cancel",e)&&n.collapsedGanttRow(e),n.isExpandCollapseFromChart=!1})},e.prototype.collapsedGanttRow=function(e){var t=this;if(!(i.i(r.isNullOrUndefined)(e.gridRow)&&this.parent.enableVirtualization||i.i(r.isNullOrUndefined)(e.chartRow))){var n;if(n=!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.currentViewData.filter(function(i){return i.ganttProperties[t.parent.taskFields.id]===e.data[t.parent.taskFields.id]})[0]:i.i(r.getValue)("data",e),this.isExpandCollapseFromChart){this.expandCollapseChartRows("collapse",i.i(r.getValue)("chartRow",e),n,null);var a=this.parent.taskFields.id;if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){var s=this.parent.treeGrid.getCurrentViewRecords().filter(function(t){return t[a]==e.data[a]})[0];this.parent.treeGrid.collapseRow(i.i(r.getValue)("gridRow",e),s)}else this.parent.treeGrid.collapseRow(i.i(r.getValue)("gridRow",e),n);this.isExpandCollapseFromChart=!1}else this.expandCollapseChartRows("collapse",i.i(r.getValue)("chartRow",e),n,null);"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(n),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),i.i(r.getValue)("chartRow",e).setAttribute("aria-expanded","false")}},e.prototype.expandGanttRow=function(e,t){var n=this;t?this.expandedGanttRow(e):this.parent.trigger("expanding",e,function(e){n.isExpandCollapseFromChart&&!i.i(r.getValue)("cancel",e)&&n.expandedGanttRow(e),n.isExpandCollapseFromChart=!1})},e.prototype.expandedGanttRow=function(e){var t=this;if(!(i.i(r.isNullOrUndefined)(e.gridRow)&&this.parent.enableVirtualization||i.i(r.isNullOrUndefined)(e.chartRow))){var n;if(n=!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.currentViewData.filter(function(i){return i.ganttProperties.taskId==e.data[t.parent.taskFields.id]})[0]:i.i(r.getValue)("data",e),this.isExpandCollapseFromChart){this.expandCollapseChartRows("expand",i.i(r.getValue)("chartRow",e),n,null);var a=this.parent.taskFields.id;if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){var s=this.parent.treeGrid.getCurrentViewRecords().filter(function(t){return t[a]==e.data[a]})[0];this.parent.treeGrid.expandRow(i.i(r.getValue)("gridRow",e),s)}else this.parent.treeGrid.expandRow(i.i(r.getValue)("gridRow",e),n);this.isExpandCollapseFromChart=!1}else this.parent.isExpandCollapseLevelMethod||this.expandCollapseChartRows("expand",i.i(r.getValue)("chartRow",e),n,null),this.parent.isExpandCollapseLevelMethod=!1;"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(n),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),i.i(r.getValue)("chartRow",e).setAttribute("aria-expanded","true")}},e.prototype.renderMultiTaskbar=function(e){this.parent.enableMultiTaskbar?this.parent.chartRowsModule.refreshRecords([e],!0):this.parent.showOverAllocation&&this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)},e.prototype.expandCollapseChartRows=function(e,t,n,a){var s;if("expand"===e){s="table-row",a||(n.expanded=!0);for(var o=t.querySelectorAll(".e-row-collapse"),l=0;l<o.length;l++)i.i(r.addClass)([o[l]],"e-row-expand"),i.i(r.removeClass)([o[l]],"e-row-collapse")}else if("collapse"===e){s="none",a||(n.expanded=!1);for(var o=t.querySelectorAll(".e-row-expand"),l=0;l<o.length;l++)i.i(r.addClass)([o[l]],"e-row-collapse"),i.i(r.removeClass)([o[l]],"e-row-expand")}if(!this.parent.enableVirtualization){for(var d=n.childRecords,h=this.getChartRows(),p=[],u=0;u<h.length;u++)h[u].classList.contains("gridrowtaskId"+n.ganttProperties.rowUniqueID+"level"+(n.level+1))&&p.push(h[u]);for(var u=0;u<p.length;u++)p[u].style.display=s,d[u].childRecords&&d[u].childRecords.length&&("collapse"===e||d[u].expanded||this.isExpandAll)&&this.expandCollapseChartRows(e,p[u],d[u],!0)}},e.prototype.expandCollapseAll=function(e){"expand"===e?(this.isExpandAll=!0,this.parent.treeGrid.expandAll()):(this.isCollapseAll=!0,this.parent.treeGrid.collapseAll()),this.isExpandAll=!1,this.isCollapseAll=!1},e.prototype.expandAtLevel=function(e){this.parent.treeGrid.expandAtLevel(e)},e.prototype.collapseAtLevel=function(e){this.parent.enableVirtualization&&(this.parent.isExpandCollapseLevelMethod=!0),this.parent.treeGrid.collapseAtLevel(e)},e.prototype.wireEvents=function(){var e=r.Browser.isPointer,t=r.Browser.touchStartEvent,i=r.Browser.touchEndEvent,n=r.Browser.touchMoveEvent,a=e?"pointerleave":"mouseleave";r.EventHandler.add(this.parent.chartPane,t,this.ganttChartMouseDown,this),r.EventHandler.add(this.parent.chartPane,a,this.ganttChartLeave,this),r.EventHandler.add(this.parent.chartPane,n,this.ganttChartMove,this),this.parent.isAdaptive&&(r.EventHandler.add(this.parent.chartPane,s.click,this.ganttChartMouseClick,this),r.EventHandler.add(this.parent.chartPane,i,this.ganttChartMouseUp,this)),this.parent.isAdaptive||(r.EventHandler.add(this.parent.element,i,this.documentMouseUp,this),r.EventHandler.add(document,i,this.mouseUp,this)),r.EventHandler.add(this.parent.element,"mousemove",this.mouseMoveHandler,this),r.EventHandler.add(document.body,"contextmenu",this.contextClick,this),r.EventHandler.add(document,"mouseup",this.contextClick,this),r.EventHandler.add(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler,this)},e.prototype.unWireEvents=function(){var e=r.Browser.isPointer,t=r.Browser.touchStartEvent,i=r.Browser.touchEndEvent,n=r.Browser.touchMoveEvent,a=e?"pointerleave":"mouseleave";r.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,t,this.ganttChartMouseDown),r.EventHandler.remove(this.parent.chartPane,a,this.ganttChartLeave),r.EventHandler.remove(this.parent.chartPane,n,this.ganttChartMove),this.parent.isAdaptive&&(r.EventHandler.remove(this.parent.chartPane,s.click,this.ganttChartMouseClick),r.EventHandler.remove(this.parent.chartPane,i,this.ganttChartMouseUp)),this.parent.isAdaptive||(r.EventHandler.remove(this.parent.element,i,this.documentMouseUp),r.EventHandler.remove(document,i,this.mouseUp)),r.EventHandler.remove(this.parent.element,"mousemove",this.mouseMoveHandler),r.EventHandler.remove(document.body,"contextmenu",this.contextClick),r.EventHandler.remove(document,"mouseup",this.contextClick),r.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler)},e.prototype.getRecordByTaskBar=function(e){return this.parent.enableVirtualization&&this.parent.enableMultiTaskbar?this.parent.flatData[this.getIndexByTaskBar(e)]:this.parent.currentViewData[this.getIndexByTaskBar(e)]},e.prototype.onTabAction=function(e){this.parent.treeGrid.grid.enableHeaderFocus=this.parent.enableHeaderFocus;var t=this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit;if(this.parent.showActiveElement||t){var n=t?e.target.closest(".e-rowcell"):e.target;(n.closest(".e-rowcell")||n.closest(".e-chart-row"))&&this.parent.focusModule.setActiveElement(n),this.focusedRowIndex=n.closest(".e-rowcell")?n.parentElement.rowIndex:n.closest(".e-chart-row")?n.closest(".e-chart-row").rowIndex:-1;var a="tab"===e.action,s=this.getNextElement(n,a,t);if(s&&n.classList.contains("e-headercell")){var o=parseInt(s.getAttribute("data-colindex"));if("shiftTab"===e.action){for(;-1!=o&&!this.parent.treeGrid.columns[o].visible;)o-=1;if(-1!=o)s=document.getElementsByClassName("e-columnheader")[0].childNodes[o];else for(var l=document.getElementsByClassName("e-toolbar-item"),d=l.length-1;d>0;d--)if(!document.getElementsByClassName("e-toolbar-item")[d].classList.contains("e-hidden")){s=document.getElementsByClassName("e-toolbar-item")[d];break}}else{for(;!this.parent.treeGrid.columns[o].visible;)o+=1;s=document.getElementsByClassName("e-columnheader")[0].childNodes[o]}}if(!s&&"shiftTab"===e.action&&n.classList.contains("e-headercell"))for(var l=document.getElementsByClassName("e-toolbar-item"),d=l.length-1;d>0;d--)if(!document.getElementsByClassName("e-toolbar-item")[d].classList.contains("e-hidden")){s=document.getElementsByClassName("e-toolbar-item")[d];break}if(n.classList.contains("e-treegrid")&&!s)for(var d=0;d<this.parent.treeGrid.columns.length;d++)if(this.parent.treeGrid.columns[d].visible){s=document.getElementsByClassName("e-columnheader")[0].childNodes[d];break}if(!s&&n.classList.contains("e-headercell")&&(s=document.getElementsByClassName("e-timeline-header-container")[0]),"shiftTab"!==e.action&&n.classList.contains("e-timeline-header-container"))for(var d=0;d<this.parent.treeGrid.columns.length;d++)if(this.parent.treeGrid.columns[d].visible){s=document.getElementsByClassName("e-row")[0].childNodes[d];break}if("shiftTab"!==e.action||s||(s=document.getElementsByClassName("e-timeline-header-container")[0]),"shiftTab"===e.action&&n.classList.contains("e-timeline-header-container"))for(var d=this.parent.treeGrid.columns.length-1;d>0;d--)if(this.parent.treeGrid.columns[d].visible){s=document.getElementsByClassName("e-columnheader")[0].childNodes[d];break}if(this.tempNextElement=s,i.i(r.isNullOrUndefined)(s)||i.i(r.isNullOrUndefined)(s.cellIndex)||(this.parent.allowRowDragAndDrop?(this.childrenIndex=s.cellIndex,this.nextElementIndex=s.cellIndex-1):(this.childrenIndex=s.cellIndex,this.nextElementIndex=s.cellIndex),this.parent.ganttColumns[this.nextElementIndex].allowEditing||this.parent.ganttColumns[this.nextElementIndex].field===this.parent.taskFields.id?this.isEditableElement=!1:this.isEditableElement=!0),"noNextRow"===s)return void this.manageFocus(n,"remove",!0);if("string"!=typeof s){if((n.classList.contains("e-rowcell")||n.closest(".e-chart-row-cell")||n.classList.contains("e-headercell")||n.closest(".e-segmented-taskbar")||n.classList.contains("e-timeline-header-container"))&&e.preventDefault(),a&&n.classList.contains("e-rowdragdrop"))return void this.parent.treeGrid.grid.notify("key-pressed",e);if(n.classList.contains("e-rowcell")&&s&&s.classList.contains("e-rowcell")||n.classList.contains("e-headercell"))if(a)if(this.parent.editSettings.allowNextRowEdit){var h=this.parent.currentViewData[this.focusedRowIndex],p=this.parent.ganttColumns[s.getAttribute("data-colindex")].field;h.hasChildRecords?p===this.parent.taskFields.endDate||p===this.parent.taskFields.duration||p===this.parent.taskFields.dependency||p===this.parent.taskFields.progress||p===this.parent.taskFields.work||"taskType"===p?(this.parent.treeGrid.grid.endEdit(),this.parent.treeGrid.grid.notify("key-pressed",e)):p===this.parent.taskFields.name||p===this.parent.taskFields.startDate?this.parent.treeGrid.grid.notify("key-pressed",e):(this.parent.treeGrid.grid.notify("key-pressed",e),t&&this.parent.treeGrid.editCell(this.focusedRowIndex,p)):this.parent.treeGrid.grid.notify("key-pressed",e)}else(!s||s&&!s.classList.contains("e-headercell"))&&(n.classList.contains("e-headercell")&&this.manageFocus(n,"remove",!1),s&&!n.classList.contains("e-editedbatchcell")||this.parent.treeGrid.grid.notify("key-pressed",e));else s.classList.contains("e-headercell")||s.classList.contains("e-rowcell")||s.classList.contains("e-toolbar-item")||this.parent.treeGrid.grid.notify("key-pressed",e);if((!this.parent.editModule||!this.parent.editModule.cellEditModule||i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule.editedColumn))&&s){if(n.classList.contains("e-rowcell")?this.manageFocus(n,"remove",!1):this.manageFocus(n,"remove",!0),s.classList.contains("e-rowcell")&&n.nextElementSibling&&!n.classList.contains("e-timeline-header-container")||n.classList.contains("e-right-label-container")){if(!n.classList.contains("e-rowcell")){this.parent.treeGrid.grid.notify("key-pressed",e);var u=i.i(r.getValue)("focusModule",this.parent.treeGrid.grid);u.currentInfo.element=s,u.currentInfo.elementToFocus=s,u.content.matrix.current=[s.parentElement.rowIndex,s.cellIndex]}this.manageFocus(s,"add",!1)}else s&&(s.classList.contains("e-toolbar-item")||s.classList.contains("e-headercell")||s.classList.contains("e-rowcell"))?(this.manageFocus(n,"remove",!1),this.manageFocus(s,"add",!1),n.classList.contains("e-treegrid")&&e.preventDefault()):this.manageFocus(s,"add",!0);this.parent.focusModule.setActiveElement(s)}}}},e.prototype.getNextElement=function(e,t,n){for(var a=t?e.nextElementSibling:e.previousElementSibling;a&&a.parentElement.classList.contains("e-row");){if(!a.matches(".e-hide")&&!a.matches(".e-rowdragdrop"))return a;a=t?a.nextElementSibling:a.previousElementSibling}if(!i.i(r.isNullOrUndefined)(a)&&(a.classList.contains("e-taskbar-main-container")||a.classList.contains("e-right-connectorpoint-outer-div"))){var s=this.parent.currentViewData[this.focusedRowIndex];!i.i(r.isNullOrUndefined)(s.ganttProperties.segments)&&s.ganttProperties.segments.length>0&&(a=a.classList.contains("e-right-connectorpoint-outer-div")?a.parentElement.nextElementSibling:a.getElementsByClassName("e-gantt-child-taskbar-inner-div")[0])}if(this.validateNextElement(a))return a;var o=-1,l=null;if(e.classList.contains("e-rowcell")&&n&&this.parent.editSettings.allowNextRowEdit)return o=e.parentElement.rowIndex,l=this.getNextRowElement(o,t,!0),this.getChildElement(l,t);if(e.classList.contains("e-rowcell"))if(o=e.parentElement.rowIndex,t){if(l=this.parent.getRowByIndex(o),this.validateNextElement(l,"e-left-label-container"))return l.getElementsByClassName("e-left-label-container")[0];if(this.validateNextElement(l,"e-taskbar-main-container"))return l.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(l,"e-right-label-container"))return l.getElementsByClassName("e-right-label-container")[0]}else{if(l=this.getNextRowElement(o,t,!1),this.validateNextElement(l,"e-right-label-container"))return l.getElementsByClassName("e-right-label-container")[0];if(this.validateNextElement(l,"e-taskbar-main-container"))return l.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(l,"e-left-label-container"))return l.getElementsByClassName("e-left-label-container")[0]}else if(e.parentElement.classList.contains("e-chart-row-cell")||e.parentElement.parentElement.classList.contains("e-chart-row-cell")){o=i.i(r.closest)(e,".e-chart-row").rowIndex,l=t?this.getNextRowElement(o,t,!0):this.parent.treeGrid.grid.getRowByIndex(o);var d=this.getChildElement(l,t);return d}if((a=e)&&a.parentElement.classList.contains("e-toolbar-item")&&this.parent.toolbarModule)for(;a&&a.parentElement.classList.contains("e-toolbar-item")&&a.parentElement.nextElementSibling.classList.contains("e-toolbar-item");){if(!a.parentElement.nextElementSibling.classList.contains("e-hidden"))return a.parentElement.nextElementSibling;a=a.parentElement.nextElementSibling.childNodes[0]}return null},e.prototype.getNextRowElement=function(e,t,i){var r=this.parent.getExpandedRecords(this.parent.currentViewData),n=this.parent.currentViewData[e],a=r.indexOf(n),s=t?r[a+1]:r[a-1],o=this.parent.currentViewData.indexOf(s);return s?i?this.parent.treeGrid.grid.getRowByIndex(o):this.parent.getRowByIndex(o):null},e.prototype.validateNextElement=function(e,t){if(e&&e.classList.contains("e-rowcell"))return!0;if(e&&t){var n=e.getElementsByClassName(t)[0];return!(!n||!n.hasChildNodes())}return!!e&&!(i.i(r.isNullOrUndefined)(e)||!e.hasChildNodes())},e.prototype.getChildElement=function(e,t){var i;if(!e)return"noNextRow";for(i=t?e.children[0]:e.children[e.children.length-1];i;){if(!i.matches(".e-hide")&&!i.matches(".e-rowdragdrop"))return i;i=t?i.nextElementSibling:i.previousElementSibling}return i},e.prototype.manageFocus=function(e,t,n){if(n){var a=null;if(e.classList.contains("e-left-label-container")||e.classList.contains("e-right-label-container"))a=e.getElementsByTagName("span")[0];else if(e.classList.contains("e-taskbar-main-container")||e.classList.contains("e-gantt-child-taskbar-inner-div")){var s=i.i(r.closest)(e,".e-chart-row").rowIndex,o=this.parent.currentViewData[s],l=o.hasChildRecords?o.ganttProperties.isAutoSchedule?"e-gantt-parent-taskbar":"e-manualparent-main-container":o.ganttProperties.isMilestone?"e-gantt-milestone":!i.i(r.isNullOrUndefined)(o.ganttProperties.segments)&&o.ganttProperties.segments.length>0?"e-segmented-taskbar":"e-gantt-child-taskbar";a=e.getElementsByClassName(l)[0],i.i(r.isNullOrUndefined)(a)&&(a=e)}(e.classList.contains("e-right-label-temp-container")||e.classList.contains("e-left-label-temp-container")||e.classList.contains("e-indicator-span")||e.classList.contains("e-timeline-header-container"))&&("add"===t?(e.setAttribute("tabIndex","0"),i.i(r.addClass)([e],"e-active-container"),e.focus()):(i.i(r.removeClass)([e],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur())),"add"!==t||i.i(r.isNullOrUndefined)(a)?i.i(r.isNullOrUndefined)(a)||(i.i(r.removeClass)([a],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur()):(e.setAttribute("tabIndex","0"),i.i(r.addClass)([a],"e-active-container"),e.focus(),this.focusedElement=a)}else"add"===t?(e.setAttribute("tabIndex","0"),i.i(r.addClass)([e],["e-focused","e-focus"]),e.focus()):(e.setAttribute("tabIndex","-1"),i.i(r.removeClass)([e],["e-focused","e-focus"]),e.blur())},e.prototype.getIndexByTaskBar=function(e){var t,a;if(t=e.classList.contains(n.D)?e:i.i(r.closest)(e,"div."+n.D),i.i(r.isNullOrUndefined)(t))t=i.i(r.closest)(e,"tr."+n.Z),a=[].slice.call(this.parent.chartRowsModule.ganttChartTableBody.childNodes).indexOf(t);else{var s=t.getAttribute("rowUniqueId"),o=this.parent.getRecordByID(s);a=this.parent.enableVirtualization&&this.parent.enableMultiTaskbar?this.parent.flatData.indexOf(o):this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport?this.parent.ids.indexOf(o.ganttProperties.taskId.toString()):this.parent.currentViewData.indexOf(o)}return a},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.scrollObject.destroy(),this.scrollObject=null},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return T});var r=i(0),n=(i.n(r),i(9)),a=(i.n(n),i(48)),s=i(45),o=i(82),l=i(49),d=i(8),h=i(10),p=i(77),u=i(14),c=i(3),g=i(6),f=(i.n(g),i(5)),m=(i.n(f),i(78)),y=i(47),D=i(83),v=i(37),w=i(1),k=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),b=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},T=function(e){function t(t,n){var a=e.call(this,t,n)||this;return a.showIndicator=!0,a.singleTier=0,a.isLocaleChanged=!1,a.isCancelled=!1,a.previousRecords={},a.editedRecords=[],a.modifiedRecords=[],a.isOnEdit=!1,a.isOnDelete=!1,a.isExpandCollapseLevelMethod=!1,a.isDynamicData=!1,a.isConnectorLineUpdate=!1,a.staticSelectedRowIndex=-1,a.needsID=!0,a.showActiveElement=!0,a.addDeleteRecord=!1,a.enableHeaderFocus=!0,a.enableValidation=!0,a.isTreeGridRendered=!1,a.isFromOnPropertyChange=!1,a.isFromRenderBaseline=!1,a.isGanttChartRendered=!1,a.isEdit=!1,i.i(r.setValue)("mergePersistData",a.mergePersistGanttData,a),a}return k(t,e),t.prototype.getModuleName=function(){return"gantt"},t.prototype.preRender=function(){this.initProperties()},t.prototype.initProperties=function(){this.globalize=new r.Internationalization(this.locale),this.isAdaptive=r.Browser.isDevice,this.flatData=[],this.currentViewData=[],this.updatedRecords=[],this.ids=[],this.ganttColumns=[],this.localeObj=new r.L10n(this.getModuleName(),this.getDefaultLocale(),this.locale),this.dataOperation=new a.a(this),this.nonWorkingHours=[],this.nonWorkingTimeRanges=[],this.workingTimeRanges=[],this.defaultEndTime=null,this.defaultStartTime=null,this.durationUnitTexts={days:"days",hours:"hours",minutes:"minutes",day:"day",hour:"hour",minute:"minute"},this.durationUnitEditText={minute:["m","min","minute","minutes"],hour:["h","hr","hour","hours"],day:["d","dy","day","days"]},this.perDayWidth=null,this.isMileStoneEdited=!1,this.chartVerticalLineContainer=null,this.updatedConnectorLineCollection=[],this.connectorLineIds=[],this.predecessorsCollection=[],this.isInPredecessorValidation=this.enablePredecessorValidation,this.isValidationEnabled=!0,this.isLoad=!0,this.editedTaskBarItem=null,this.validationDialogElement=null,this.currentEditedArgs={},this.dialogValidateMode={respectLink:!1,removeLink:!1,preserveLinkWithEditing:!0},this.secondsPerDay=this.dataOperation.getSecondsPerDay(),this.nonWorkingDayIndex=[],this.dataOperation.getNonWorkingDayIndex(),this.columnMapping={},this.controlId=this.element.id,this.cloneProjectStartDate=this.enablePersistence&&this.cloneProjectStartDate?this.cloneProjectStartDate:null,this.cloneProjectEndDate=this.enablePersistence&&this.cloneProjectEndDate?this.cloneProjectEndDate:null,this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.ganttChartModule=new s.a(this),this.timelineModule=new o.a(this),this.chartRowsModule=new p.a(this),this.treeGridModule=new l.a(this),this.dateValidationModule=new h.a(this),this.predecessorModule=new u.a(this),this.connectorLineModule=new m.a(this),this.splitterModule=new y.a(this),this.tooltipModule=new D.a(this),this.keyConfig={home:"home",end:"end",downArrow:"downarrow",upArrow:"uparrow",collapseAll:"ctrl+uparrow",expandAll:"ctrl+downarrow",collapseRow:"ctrl+shift+uparrow",expandRow:"ctrl+shift+downarrow",saveRequest:"13",cancelRequest:"27",addRow:"insert",addRowDialog:"ctrl+insert",editRowDialog:"ctrl+f2",delete:"delete",tab:"tab",shiftTab:"shift+tab",focusTask:"shift+f5",indentLevel:"shift+leftarrow",outdentLevel:"shift+rightarrow",focusSearch:"ctrl+shift+70",contextMenu:"shift+F10"},this.focusModule=new v.a(this),0===this.zoomingLevels.length&&this.setProperties({zoomingLevels:this.getZoomingLevels()},!0),this.resourceFieldsMapping(),i.i(r.isNullOrUndefined)(this.resourceFields.unit)&&this.setProperties({resourceFields:{unit:"unit"}},!0),i.i(r.isNullOrUndefined)(this.taskFields.work)||this.setProperties({taskType:"FixedWork"},!0),this.taskIds=[]},t.prototype.getDateFormat=function(){if(i.i(r.isNullOrUndefined)(this.dateFormat)){return this.globalize.getDatePattern({skeleton:"yMd"})}return this.dateFormat},t.prototype.getDefaultTZOffset=function(){var e=new Date((new Date).getFullYear(),0,1),t=new Date((new Date).getFullYear(),6,1);return Math.max(e.getTimezoneOffset(),t.getTimezoneOffset())},t.prototype.isInDst=function(e){return e.getTimezoneOffset()<this.getDefaultTZOffset()},t.prototype.resourceFieldsMapping=function(){var e=this.resourceFields;e.id=i.i(r.isNullOrUndefined)(e.id)?this.resourceIDMapping:e.id,e.name=i.i(r.isNullOrUndefined)(e.name)?this.resourceNameMapping:e.name},t.prototype.validateDimentionValue=function(e){return i.i(r.isNullOrUndefined)(e)?null:"string"==typeof e&&"auto"!==e&&-1===e.indexOf("%")?-1===e.indexOf("px")?e+"px":e:"number"==typeof e?e+"px":e.toString()},t.prototype.calculateDimensions=function(){var e=this.validateDimentionValue(this.height),t=this.validateDimentionValue(this.width);i.i(r.isNullOrUndefined)(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(t=this.width);var n=this.element.style.height,a=this.element.style.width;t&&(this.element.style.width=t),e&&(this.element.style.height=e),e||n||(this.element.style.height="auto"),t||a||(this.element.style.width="auto"),this.ganttHeight=this.element.offsetHeight,this.ganttWidth=this.element.offsetWidth},t.prototype.render=function(){this.isReact&&(this.treeGrid.isReact=!0,this.treeGrid.grid.isReact=!0),this.isVue&&(this.treeGrid.isVue=!0,this.treeGrid.grid.isVue=!0,this.treeGrid.vueInstance=this.vueInstance,this.treeGrid.grid.vueInstance=this.vueInstance),i.i(n.createSpinner)({target:this.element},this.createElement),this.trigger("load",{}),this.element.classList.add(c._11),this.rowHeight=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")&&36===this.rowHeight?46:this.rowHeight,this.isAdaptive?this.element.classList.add(c._12):this.element.classList.remove(c._12),this.calculateDimensions(),i.i(r.isNullOrUndefined)(this.toolbarModule)||this.renderToolbar(),this.splitterModule.renderSplitter(),this.notify("renderPanels",null),i.i(r.isNullOrUndefined)(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow(),this.dataOperation.checkDataBinding()},t.prototype.hideMaskRow=function(){var e=this.element.querySelectorAll(".e-masked-table").length;if(!i.i(r.isNullOrUndefined)(this.contentMaskTable)&&(0!=e||this.contentMaskTable)){var t=this.contentMaskTable;i.i(r.remove)(t),this.contentMaskTable=null}if(e=this.element.querySelectorAll(".e-masked-table").length,!i.i(r.isNullOrUndefined)(this.headerMaskTable)&&(0!=e||this.headerMaskTable)){var t=this.headerMaskTable;i.i(r.remove)(t),this.headerMaskTable=null}for(;0!=this.element.querySelectorAll(".e-table-background").length;)this.element.querySelectorAll(".e-table-background")[0].remove();for(;0!=this.element.querySelectorAll(".e-temp-timeline").length;)this.element.querySelectorAll(".e-temp-timeline")[0].remove();if(0!=this.element.querySelectorAll("."+c._13).length)for(var n=0;n<this.singleTier;n++)i.i(r.isNullOrUndefined)(this.element.querySelectorAll("."+c._13)[parseInt(n.toString(),10)])||(this.element.querySelectorAll("."+c._13)[parseInt(n.toString(),10)].style.visibility="visible");i.i(r.isNullOrUndefined)(this.element.querySelector("."+c._14))||(this.element.querySelector("."+c._14).style.position="relative"),i.i(r.isNullOrUndefined)(this.element.getElementsByClassName(c._15)[0])||(this.element.getElementsByClassName(c._15)[0].style.visibility="visible")},t.prototype.showMaskRow=function(){var e=this.chartPane.childNodes[0].childNodes[0];this.scrollLeftValue=this.chartPane.childNodes[0].childNodes[0].scrollLeft;var t=this.chartPane.childNodes[0].childNodes[1];if(this.treeGrid.element&&this.ganttChartModule.setVirtualHeight(),!this.contentMaskTable){if(t){var i=t;if(this.renderBackGround(i),0!=this.element.querySelectorAll("."+c._13).length){this.singleTier=this.timelineModule.isSingleTier?1:2;for(var r=0;r<this.singleTier;r++)this.element.querySelectorAll("."+c._13)[parseInt(r.toString(),10)].style.visibility="hidden"}0===this.singleTier&&(this.singleTier=2),this.element.getElementsByClassName(c._15)[0].style.visibility="hidden",this.contentMaskTable=this.contentMaskTable=this.createMaskTable(i)}if(e){this.element.querySelector("."+c._14).style.position="static";var i=e;this.renderHeaderBackground(i),this.headerMaskTable=this.headerMaskTable=this.createMaskTable(i)}}},t.prototype.renderHeaderBackground=function(e){var t=e,n=e.getBoundingClientRect().height;if(!!i.i(r.closest)(t,"."+c._14)){for(var a=this.createElement("div",{className:"e-table-background"}),s=(this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+n+"px;"}}),0),o=Math.round(e.getBoundingClientRect().width),l=0;l<3;l++)this.enableRtl?a.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(o-=160)+"px; top:0px;"}})):a.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(s+=160)+"px; top:0px;"}}));t.insertBefore(a,t.firstChild)}},t.prototype.renderBackGround=function(e){var t=e,n=e.getBoundingClientRect().height;if(!!i.i(r.closest)(t,"."+c._16)){for(var a=this.createElement("div",{className:"e-table-background"}),s=(this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+n+"px;"}}),0),o=Math.round(e.getBoundingClientRect().width),l=0;l<3;l++)this.enableRtl?a.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(o-=160)+"px;z-index:1;"}})):a.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(s+=160)+"px;z-index:1;"}}));t.insertBefore(a,t.firstChild)}},t.prototype.createMaskTable=function(e){var t,n=e,a=e.getBoundingClientRect().height,s=!!i.i(r.closest)(n,"."+c._14);if(s?(t=this.createEmptyTimeLineTable(a),t.style.position="sticky",t.style.left="0px",this.enableRtl&&t.style.removeProperty("left")):(t=this.createEmptyMaskTable(a),t.style.position="absolute",t.style.zIndex=1),s){t.style.height=e.getBoundingClientRect().height+"px";var o=this.createElement("div",{className:"e-temp-timeline"});o.style.width="614px",o.style.position="sticky",this.enableRtl?o.style["margin-right"]=Math.abs(this.scrollLeftValue)+"px":o.style["margin-left"]=this.scrollLeftValue+"px",o.appendChild(t),n.insertBefore(o,n.firstChild)}else t.style.height=e.getBoundingClientRect().height+"px",n.insertBefore(t,n.firstChild);return t},t.prototype.createEmptyTimeLineTable=function(e){for(var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),r=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/2+"px;"}}),a=0;a<this.singleTier;a++)r.push(n.cloneNode(!0));this.topBottomHeader=0;for(var a=0;a<r.length;a++)i.appendChild(this.applyTimelineMaskRow(r[parseInt(a.toString(),10)])),this.topBottomHeader=this.topBottomHeader+1;return t.appendChild(i),t.style.width="100%",t},t.prototype.applyTimelineMaskRow=function(e){var t=e;t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(var i=0;i<t.childNodes.length-1;i++)t.childNodes[parseInt(i.toString(),10)].style.width="166px";for(var r=[].slice.call(t.childNodes),i=0;i<r.length;i++){var n=r[parseInt(i.toString(),10)];switch(this.topBottomHeader){case 0:this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>',n.children[0].style.left="-20px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>';break;case 1:n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(var a=[].slice.call(n.childNodes),s=0;s<a.length;s++){var o=a[parseInt(s.toString(),10)];0===s?this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>',o.children[0].style.left="-14px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>':1===s?this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>',o.children[0].style.left="-30px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>':this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>',o.children[0].style.left="-60px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>'}}}return t},t.prototype.createEmptyMaskTable=function(e){var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),r=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/7+"px;"}});this.columnLoop=0;for(var a=0;a<6;a++)r.push(n.cloneNode(!0));for(var s=0;s<r.length;s++)this.columnLoop<4?this.columnLoop=this.columnLoop+1:4===this.columnLoop&&(this.columnLoop=1),i.appendChild(this.applyMaskRow(r[parseInt(s.toString(),10)]));t.appendChild(i),t.style.width="100%";var o=this.createElement("div",{className:"e-temp-container"});return o.style.width="calc(100% - 17px)",o.style.overflow="hidden",o.appendChild(t),o},t.prototype.applyMaskRow=function(e){var t=e;this.columnLoop<4?(t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"})),t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}))):t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}));for(var i=[].slice.call(t.childNodes),r=0;r<i.length;r++){var n=i[parseInt(r.toString(),10)];switch(this.columnLoop){case 1:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>',n.children[0].style.left="-14px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>':n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell02"></span>';break;case 2:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>',n.children[0].style.left="-14px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>':n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell04"></span>';break;case 3:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>',n.children[0].style.left="-64px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>':this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>',n.children[0].style.left="-192px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>';break;case 4:this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>',n.children[0].style.left="-388px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>'}}return t},t.prototype.showSpinner=function(){i.i(n.showSpinner)(this.element)},t.prototype.hideSpinner=function(){i.i(n.hideSpinner)(this.element)},t.prototype.processTimeline=function(){this.timelineModule.processTimelineUnit(),this.timelineModule.calculateZoomingLevelsPerDayWidth()},t.prototype.renderGantt=function(e){if(e&&(this.isFromOnPropertyChange=e),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors(),this.isInPredecessorValidation&&this.enableValidation&&this.autoCalculateDateScheduling&&this.predecessorModule.updatedRecordsDateByPredecessor()),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp()),e)if(this.enableValidation&&this.dataOperation.updateGanttData(),this.allowParentDependency&&this.predecessorModule.updateParentPredecessor(),this.dataSource instanceof Object&&i.i(w.i)(this)){var t=i.i(r.getValue)("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:t}}else this.treeGrid.setProperties({dataSource:this.flatData},!1);else this.enableValidation&&this.dataOperation.updateGanttData(),this.allowParentDependency&&this.predecessorModule.updateParentPredecessor(),this.treeGridPane.classList.remove("e-temp-content"),i.i(r.remove)(this.treeGridPane.querySelector(".e-gantt-temp-header")),this.notify("dataReady",{}),this.enableContextMenu&&this.notify("initiate-contextMenu",{}),this.renderTreeGrid(),this.wireEvents(),this.notify("initPredessorDialog",{});this.isFromOnPropertyChange||this.splitterModule.updateSplitterPosition()},t.prototype.removeCriticalPathStyles=function(){var e=this.ganttChartModule.chartElement;i.i(r.removeClass)(e.querySelectorAll(".e-gantt-child-taskbar-inner-div"),c.n),i.i(r.removeClass)(e.querySelectorAll(".e-gantt-child-progressbar-inner-div"),c.p),i.i(r.removeClass)(e.querySelectorAll(".e-critical-milestone"),c.q),i.i(r.removeClass)(this.element.querySelectorAll(".e-connector-line"),c.r),i.i(r.removeClass)(this.element.querySelectorAll(".e-connector-line-arrow"),c.s),document.querySelector(".e-gantt-child-taskbar-inner-div").style.outlineColor=""},t.prototype.wireEvents=function(){this.allowKeyboard&&(this.keyboardModule=new r.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfig,eventName:"keydown"})),r.EventHandler.add(window,"resize",this.windowResize,this),r.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)},t.prototype.keyDownHandler=function(e){e.altKey&&74===e.keyCode&&(this.ganttChartModule.manageFocus(this.treeGrid.element.childNodes[1],"remove",!1),this.ganttChartModule.manageFocus(this.element,"add",!1))},t.prototype.windowResize=function(){if(!i.i(r.isNullOrUndefined)(this.element)){this.updateContentHeight(),this.ganttChartModule.updateWidthAndHeight(),this.treeGridModule.ensureScrollBar(),this.predecessorModule&&this.taskFields.dependency&&(this.updateRowHeightInConnectorLine(this.updatedConnectorLineCollection),this.connectorLineModule.renderConnectorLines(this.updatedConnectorLineCollection));var e=this.criticalPathModule;this.enableCriticalPath&&e&&e.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds),this.calculateDimensions();var t=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[0],n=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[1];this.splitterModule.splitterPreviousPositionGrid=t.scrollWidth+1+"px",this.splitterModule.splitterPreviousPositionChart=n.scrollWidth+1+"px",this.splitterModule.splitterObject.paneSettings[0].size=this.splitterModule.getSpliterPositionInPercentage(this.splitterModule.splitterPreviousPositionGrid),this.splitterModule.splitterObject.paneSettings[1].size=this.splitterModule.splitterPreviousPositionChart,this.timelineModule.isZoomToFit&&this.timelineModule.processZoomToFit()}},t.prototype.keyActionHandler=function(e){this.focusModule.onKeyPress(e)},t.prototype.updateRowHeightInConnectorLine=function(e){if(e&&e.length){var t=this.ganttChartModule.getChartRows()[0]&&this.ganttChartModule.getChartRows()[0].getBoundingClientRect().height;if(t&&!isNaN(t))for(var i=0;i<e.length;i++)e[i].rowHeight=t}},t.prototype.renderToolbar=function(){i.i(r.isNullOrUndefined)(this.toolbarModule)||(this.toolbarModule.renderToolbar(),this.toolbarModule.refreshToolbarItems())},t.prototype.renderTreeGrid=function(){this.treeGridModule.renderTreeGrid()},t.prototype.updateCurrentViewData=function(){var e=this;if(this.currentViewData=this.treeGrid.getCurrentViewRecords().slice(),!this.loadChildOnDemand&&this.taskFields.hasChildMapping&&this.currentViewData.length>0){this.autoCalculateDateScheduling=!1,this.flatData=[],this.dataOperation.taskIds=[],this.ids=[],this.dataOperation.recordIndex=0,this.dataOperation.dataArray=this.currentViewData,this.dataOperation.cloneDataSource(),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors());for(var t=this.treeGrid.grid.contentModule.rows,n=t.filter(function(t){if(t.data[e.taskFields.id]===e.flatData[0].ganttProperties.taskId)return t})[0],a=n.index,s=0;s<this.flatData.length;s++)this.flatData[s].index=a,a++;this.currentViewData=this.flatData,this.treeGrid.grid.currentViewData=this.flatData,i.i(r.isNullOrUndefined)(this.treeGrid.virtualScrollModule)||(this.treeGrid.virtualScrollModule.visualData=this.flatData,this.updatedRecords=this.flatData)}},t.prototype.getRecordFromFlatdata=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getTaskByUniqueID(e[i].uniqueID));return t},t.prototype.updateContentHeight=function(e){if(this.allowTaskbarOverlap||this.ganttChartModule.isCollapseAll||this.ganttChartModule.isExpandAll||"ResourceView"!==this.viewType||this.isLoad)if(this.virtualScrollModule&&this.enableVirtualization&&!i.i(r.isNullOrUndefined)(e)){var t=i.i(r.getValue)("result.length",e);this.contentHeight=t*this.rowHeight}else{var n=this.virtualScrollModule&&this.enableVirtualization?this.currentViewData:this.getExpandedRecords(this.currentViewData),a=void 0,s=i.i(r.isNullOrUndefined)(this.ganttChartModule.getChartRows())?null:this.ganttChartModule.getChartRows()[0];a=!i.i(r.isNullOrUndefined)(s)&&s.getBoundingClientRect().height>0?s.getBoundingClientRect().height:this.rowHeight,this.contentHeight=n.length*a}},t.prototype.getExpandStatus=function(e){var t=this.getParentTask(e.parentItem);if(i.i(r.isNullOrUndefined)(t))return!0;if(!1===t.expanded)return!1;if(t.parentItem){return!1!==this.getParentTask(t.parentItem).expanded&&this.getExpandStatus(this.getParentTask(t.parentItem))}return!0},t.prototype.getExpandedRecords=function(e){var t=this;return i.i(r.isNullOrUndefined)(e)?[]:e.filter(function(e){return!0===t.getExpandStatus(e)})},t.prototype.getZoomingLevels=function(){var e=this.timelineSettings.weekStartDay;return[{topTier:{unit:"Year",format:"yyyy",count:50},bottomTier:{unit:"Year",format:"yyyy",count:10},timelineUnitSize:99,level:0,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:20},bottomTier:{unit:"Year",format:"yyyy",count:5},timelineUnitSize:99,level:1,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:5},bottomTier:{unit:"Year",format:"yyyy",count:1},timelineUnitSize:99,level:2,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:66,level:3,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:99,level:4,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:66,level:5,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:99,level:6,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",format:"MMM yyyy",count:1},timelineUnitSize:99,level:7,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yy",count:1},bottomTier:{unit:"Week",format:"dd",count:1},timelineUnitSize:33,level:8,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:66,level:9,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:99,level:10,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:33,level:11,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:66,level:12,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:99,level:13,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:66,level:14,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:99,level:15,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:66,level:16,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:99,level:17,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:66,level:18,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:99,level:19,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:66,level:20,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:99,level:21,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:30},timelineUnitSize:66,level:22,timelineViewMode:"Hour",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:15},timelineUnitSize:66,level:23,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:1},timelineUnitSize:66,level:24,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0}]},t.prototype.displayQuarterValue=function(e){var t=e.getMonth();return t>=0&&t<=2?"Q1":t>=3&&t<=5?"Q2":t>=6&&t<=8?"Q3":"Q4"},t.prototype.displayHalfValue=function(e){var t=e.getMonth();return t>=0&&t<=5?"H1":"H2"},t.prototype.getFormatedDate=function(e,t){return i.i(r.isNullOrUndefined)(e)?null:(i.i(r.isNullOrUndefined)(t)&&(t=this.getDateFormat()),this.globalize.formatDate(e,{format:t}))},t.prototype.getDurationString=function(e,t){return this.dateValidationModule.getDurationString(e,t)},t.prototype.getWorkString=function(e,t){return this.dateValidationModule.getWorkString(e,t)},t.prototype.updateTreeColumns=function(){var e,t=this.treeGrid.grid.getColumns();-1!==this.treeColumnIndex&&this.columns[this.treeColumnIndex]&&!i.i(r.isNullOrUndefined)(this.columns[this.treeColumnIndex].template)&&(e=this.columns[this.treeColumnIndex].template,this.columns[this.treeColumnIndex].field);for(var n,a=0;a<t.length;a++){n={};for(var s=0;s<this.columns.length;s++)if(this.columns[s].field==t[a].field){for(var o=0,l=Object.keys(this.columns[s]);o<l.length;o++){var d=l[o];i.i(r.isUndefined)(this.columns[s][d])||(n[d]=t[a][d]),n.visible=t[a].visible,n.width=t[a].width}this.columns[s]=n,"checkbox"===this.columns[s].type||i.i(r.isNullOrUndefined)(e)||""===e||(this.columns[s].template=e)}}this.columns.length>0&&this.treeGrid.setProperties({columns:this.columns},!0)},t.prototype.treeDataBound=function(e){this.element.getElementsByClassName("e-chart-root-container")[0].style.height="100%";var t=(this.element.getElementsByClassName("e-gridcontent")[0].style.height,this.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight);if("calc(100% - "+t+"px)",this.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+t+"px)",i.i(r.isNullOrUndefined)(this.toolbarModule)||i.i(r.isNullOrUndefined)(this.toolbarModule.element)?this.splitterElement.style.height="100%":this.splitterElement.style.height="calc(100% - "+this.toolbarModule.element.offsetHeight+"px)",this.isLoad){if(this.enablePersistence&&this.updateTreeColumns(),this.updateCurrentViewData(),this.enableVirtualization||this.updateContentHeight(),!this.isTreeGridRendered){this.isTreeGridRendered=!0;i.i(r.isNullOrUndefined)(this.toolbarModule)||i.i(r.isNullOrUndefined)(this.toolbarModule.element)||this.toolbarModule.element.offsetHeight,this.timelineModule.isSingleTier?(i.i(r.addClass)(this.treeGrid.element.querySelectorAll(".e-headercell"),c._17),i.i(r.addClass)(this.treeGrid.element.querySelectorAll(".e-columnheader"),c._17)):(i.i(r.removeClass)(this.treeGrid.element.querySelectorAll(".e-headercell"),c._17),i.i(r.removeClass)(this.treeGrid.element.querySelectorAll(".e-columnheader"),c._17)),this.treeGrid.height="100%",this.notify("tree-grid-created",{}),this.createGanttPopUpElement(),i.i(r.isNullOrUndefined)(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),i.i(r.setValue)("isGanttCreated",!0,e),this.renderComplete()}}else this.getCurrentRecords(e);!this.loadChildOnDemand&&this.taskFields.hasChildMapping&&this.updateContentHeight(),this.enableCriticalPath&&this.criticalPathModule&&this.criticalPathModule.showCriticalPath(this.enableCriticalPath),this.notify("recordsUpdated",{});for(var n=0;n<document.getElementsByClassName("e-timeline-header-table-container").length;n++)for(var a=0;a<document.getElementsByClassName("e-timeline-header-table-container")[n].children[0].children[0].children.length;a++)document.getElementsByClassName("e-timeline-header-table-container")[n].children[0].children[0].children[a].children[0].setAttribute("tabindex","-1");var s=this.criticalPathModule;this.enableCriticalPath&&s&&s.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(s.criticalPathCollection,s.detailPredecessorCollection,!0,s.predecessorCollectionTaskIds),this.initialChartRowElements=this.ganttChartModule.getChartRows(),this.isLoad=!1,!this.loadChildOnDemand&&this.taskFields.hasChildMapping&&(this.autoCalculateDateScheduling=!0),this.trigger("dataBound",e)},t.prototype.getCurrentRecords=function(e){this.predecessorModule&&this.taskFields.dependency&&this.connectorLineModule.removePreviousConnectorLines(this.currentViewData),this.updateCurrentViewData(),this.enableVirtualization||this.updateContentHeight(),this.virtualScrollModule&&this.enableVirtualization&&(this.ganttChartModule.virtualRender.adjustTable(),this.ganttChartModule.scrollObject.updateTopPosition())},t.prototype.onPropertyChanged=function(e,t){for(var n=!1,a=0,s=Object.keys(e);a<s.length;a++){var o=s[a];switch(o){case"allowSelection":case"allowRowDragAndDrop":case"allowFiltering":case"showColumnMenu":case"allowResizing":case"allowReordering":case"enableImmutableMode":this.treeGrid[o]=this[o],this.treeGrid.dataBind();break;case"workWeek":this.dataOperation.getNonWorkingDayIndex(),this.dataOperation.reUpdateGanttData(),this.chartRowsModule.initiateTemplates(),this.taskFields.dependency&&this.predecessorModule.updatedRecordsDateByPredecessor(),this.chartRowsModule.refreshGanttRows(),this.treeGrid.refreshColumns(),this.timelineModule.refreshTimeline();break;case"toolbar":this.notify("ui-toolbarupdate",{module:"toolbar",properties:e});break;case"columnMenuItems":this.treeGrid.grid.columnMenuItems=i.i(f.getActualProperties)(this.columnMenuItems);break;case"eventMarkers":case"highlightWeekends":this.notify("ui-update",{module:"day-markers",properties:e});break;case"sortSettings":this.treeGrid.sortSettings=i.i(f.getActualProperties)(this.sortSettings),this.treeGrid.dataBind();break;case"timelineSettings":this.timelineModule.refreshTimeline();break;case"rowHeight":case"taskbarHeight":this.treeGrid.rowHeight=this.rowHeight,this.treeGrid.dataBind(),this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines();break;case"timezone":this.dataOperation.checkDataBinding(!0);break;case"enableCriticalPath":if(i.i(r.isNullOrUndefined)(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),this.enableCriticalPath&&this.criticalPathModule){this.criticalPathModule.showCriticalPath(this.enableCriticalPath);var l=this.criticalPathModule;l.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(l.criticalPathCollection,l.detailPredecessorCollection,!0,l.predecessorCollectionTaskIds)}else this.removeCriticalPathStyles();break;case"filterSettings":this.treeGrid.filterSettings=i.i(f.getActualProperties)(this.filterSettings),this.treeGrid.dataBind();break;case"gridLines":this.treeGrid.gridLines=this.gridLines,this.treeGrid.dataBind(),this.renderChartGridLines();break;case"tooltipSettings":this.tooltipModule.toolTipObj&&this.tooltipModule.toolTipObj.destroy(),this.tooltipModule.createTooltip();break;case"splitterSettings":this.splitterModule.updateSplitterPosition();break;case"selectionSettings":this.treeGrid.selectionSettings=i.i(f.getActualProperties)(this.selectionSettings),this.treeGrid.grid.selectionSettings.enableToggle=this.selectionSettings.enableToggle,this.treeGrid.dataBind();break;case"searchSettings":void 0!==e.searchSettings.key&&(this.treeGrid.grid.searchSettings=i.i(f.getActualProperties)(this.searchSettings),this.treeGrid.grid.dataBind()),this.treeGrid.searchSettings=i.i(f.getActualProperties)(this.searchSettings),this.treeGrid.dataBind(),this.toolbarModule&&this.toolbarModule.updateSearchTextBox();break;case"labelSettings":case"renderBaseline":case"baselineColor":this.isFromRenderBaseline=!0,this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isFromRenderBaseline=!1;break;case"resourceIDMapping":case"resourceNameMapping":case"resources":this.dataOperation.reUpdateResources(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"includeWeekend":case"allowUnscheduledTasks":case"holidays":this.isLoad=!0,"holidays"===o&&(this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.notify("ui-update",{module:"day-markers",properties:e})),this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1;break;case"dayWorkingTime":this.isLoad=!0,this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1;break;case"addDialogFields":case"editDialogFields":this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.processDialogFields();break;case"columns":this.treeGridModule.treeGridColumns=[],this.treeGridModule.validateGanttColumns(),this.treeGrid.columns=this.treeGridModule.treeGridColumns,this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline();break;case"width":case"height":this.reUpdateDimention();break;case"editSettings":this.treeGrid.editSettings.allowAdding=this.editSettings.allowAdding,this.treeGrid.editSettings.allowDeleting=this.editSettings.allowDeleting,this.treeGrid.editSettings.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,this.treeGrid.editSettings.allowEditing=this.editSettings.allowEditing,this.treeGrid.editSettings.allowNextRowEdit=this.editSettings.allowNextRowEdit,i.i(r.isNullOrUndefined)(this.editModule)||this.editModule.reUpdateEditModules(),i.i(r.isNullOrUndefined)(this.toolbarModule)||this.toolbarModule.refreshToolbarItems();break;case"connectorLineBackground":case"connectorLineWidth":this.taskFields.dependency&&(this.connectorLineModule.initPublicProp(),this.ganttChartModule.reRenderConnectorLines());break;case"treeColumnIndex":this.treeGrid.treeColumnIndex=this.treeColumnIndex;break;case"projectStartDate":case"projectEndDate":this.timelineModule.isZoomToFit=!1,this.dataOperation.calculateProjectDates(),this.updateProjectDates(this.cloneProjectStartDate,this.cloneProjectEndDate,this.isTimelineRoundOff);break;case"selectedRowIndex":i.i(r.isNullOrUndefined)(this.selectionModule)||this.selectionModule.selectRowByIndex();break;case"dataSource":if(this.closeGanttActions(),this.dataSource instanceof Object&&i.i(w.i)(this)){this.treeGrid.hasChildMapping="isParent";var d=i.i(r.getValue)("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:d}}else this.treeGrid.hasChildMapping=null;this.dataOperation.checkDataBinding(!0);break;case"enableContextMenu":case"contextMenuItems":this.enableContextMenu||"contextMenuItems"===o?this.notify("reRender-contextMenu",{module:"contextMenu",enable:this.contextMenuItems}):this.treeGrid.contextMenuItems=[],this.treeGrid.dataBind();break;case"currencyCode":case"locale":case"enableRtl":case"readOnly":case"viewType":case"taskFields":case"allowTaskbarDragAndDrop":case"allowTaskbarOverlap":case"allowParentDependency":if("locale"===o&&(this.isLocaleChanged=!0),"taskFields"===o&&!i.i(r.isNullOrUndefined)(e.taskFields.child))return;"allowTaskbarDragAndDrop"!==o&&(n=!0);break;case"validateManualTasksOnLinking":this.validateManualTasksOnLinking=e.validateManualTasksOnLinking;break;case"showOverAllocation":this.updateOverAllocationCotainer()}}n&&(this.isLoad&&this.contentMaskTable&&(this.contentMaskTable=null),this.refresh())},t.prototype.updateOverAllocationCotainer=function(){if(this.showOverAllocation&&"ResourceView"===this.viewType)this.ganttChartModule.renderOverAllocationContainer();else{var e=this.element.querySelector("."+c._18);e&&(e.innerHTML="")}},t.prototype.getPersistData=function(){for(var e=["sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","currentZoomingLevel","cloneProjectStartDate","cloneProjectEndDate"],t={filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[]},n=["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],a=0;a<e.length;a++)for(var s=this[e[a]],o=0,l=t[e[a]];!i.i(r.isNullOrUndefined)(l)&&o<l.length;o++){var d=l[o];delete s[d]}return this.ignoreInArrays(n,this.columns),this.addOnPersist(e)},t.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)this.ignoreInColumn(e,t[i])},t.prototype.ignoreInColumn=function(e,t){for(var i=0;i<e.length;i++)delete t[e[i]],t.filter={}},t.prototype.destroy=function(){this.notify("destroy",{}),i.i(r.isNullOrUndefined)(this.validationDialogElement)||this.validationDialogElement.isDestroyed||this.validationDialogElement.destroy();for(var t=["ganttChartModule","timelineModule","chartRowsModule","treeGridModule","ganttDataUpdatesModule","dateValidationModule","tooltipModule"],n=0;n<t.length;n++)this[t[n]]&&(this[t[n]]=null);this.keyboardModule&&this.keyboardModule.destroy(),this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.destroy(),e.prototype.destroy.call(this),this.chartVerticalLineContainer=null,this.element.innerHTML="",i.i(r.removeClass)([this.element],c._11),this.element.innerHTML="",this.isTreeGridRendered=!1,this.resetTemplates(),r.EventHandler.remove(window,"resize",this.windowResize)},t.prototype.getTaskbarHeight=function(){return this.chartRowsModule.taskBarHeight},t.prototype.requiredModules=function(){var e=[];return this.isDestroyed?e:(this.allowSorting&&e.push({member:"sort",args:[this]}),(this.allowFiltering||this.toolbar&&-1!==this.toolbar.indexOf("Search"))&&e.push({member:"filter",args:[this]}),this.allowReordering&&e.push({member:"reorder",args:[this]}),this.allowExcelExport&&e.push({member:"excelExport",args:[this]}),(this.allowRowDragAndDrop||this.allowTaskbarDragAndDrop)&&e.push({member:"rowDragAndDrop",args:[this]}),this.enableCriticalPath&&e.push({member:"criticalPath",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),this.toolbar&&this.toolbar.length>0&&e.push({member:"toolbar",args:[this]}),(this.editSettings.allowAdding||this.editSettings.allowEditing||this.editSettings.allowDeleting||this.editSettings.allowTaskbarEditing||this.allowRowDragAndDrop)&&e.push({member:"edit",args:[this]}),this.allowSelection&&e.push({member:"selection",args:[this]}),this.tooltipSettings.showTooltip&&e.push({member:"tooltip",args:[this]}),(this.highlightWeekends||this.holidays&&this.holidays.length>0||this.eventMarkers&&this.eventMarkers.length>0)&&e.push({member:"dayMarkers",args:[this]}),this.enableContextMenu&&e.push({member:"contextMenu",args:[this]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this]}),this.allowPdfExport&&e.push({member:"pdfExport",args:[this]}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this]}),e)},t.prototype.sortColumn=function(e,t,i){this.sortModule&&this.allowSorting&&this.sortModule.sortColumn(e,t,i)},t.prototype.mergePersistGanttData=function(){this.treeGrid||(this.treeGrid=new g.TreeGrid);this.treeGrid.grid.mergePersistGridData.apply(this)},t.prototype.mergeColumns=function(e,t){this.treeGrid.grid.mergeColumns.apply(this,[e,t])},t.prototype.clearSorting=function(){this.sortModule.clearSorting()},t.prototype.renderChartGridLines=function(){var e="e-chart-row-border",t=this.chartVerticalLineContainer,n=document.getElementById(this.element.id+"GanttTaskTableBody").querySelectorAll("td");if("Vertical"===this.gridLines){if(i.i(r.isNullOrUndefined)(t)?this.renderChartVerticalLines():"none"===t.style.display&&(t.style.display="block"),n[0].classList.contains(e))for(var a=0;a<n.length;a++)i.i(r.removeClass)([n[a]],e)}else if("Horizontal"===this.gridLines){if(i.i(r.isNullOrUndefined)(t)||(t.style.display="none"),!n[0].classList.contains(e))for(var a=0;a<n.length;a++)i.i(r.addClass)([n[a]],e)}else if("Both"===this.gridLines){if(i.i(r.isNullOrUndefined)(t)?this.renderChartVerticalLines():"none"===t.style.display&&(t.style.display="block"),!n[0].classList.contains(e))for(var a=0;a<n.length;a++)i.i(r.addClass)([n[a]],e)}else if("None"===this.gridLines&&(i.i(r.isNullOrUndefined)(t)||"none"===t.style.display||(t.style.display="none"),n[0].classList.contains(e)))for(var a=0;a<n.length;a++)i.i(r.removeClass)([n[a]],e)},t.prototype.updateGridLineContainerHeight=function(){this.chartVerticalLineContainer&&(this.chartVerticalLineContainer.style.height=i.i(r.formatUnit)(this.getContentHeight()))},t.prototype.getContentHeight=function(){var e=this.ganttChartModule.scrollElement.offsetHeight-16,t=this.ganttChartModule.chartBodyContent.offsetHeight;return t<e?t:e},t.prototype.reUpdateDimention=function(){var e=0;if(this.calculateDimensions(),i.i(r.isNullOrUndefined)(this.toolbarModule)||i.i(r.isNullOrUndefined)(this.toolbarModule.element)||(this.toolbarModule.toolbar.refresh(),this.toolbarModule.refreshToolbarItems(),e=this.toolbarModule.element.offsetHeight),this.treeGrid.height=this.ganttHeight-e-this.treeGrid.grid.getHeaderContent().offsetHeight,this.splitterModule.splitterObject.height=(this.ganttHeight-e).toString(),i.i(r.isNullOrUndefined)(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer.style.height=this.ganttHeight+"px"),!i.i(r.isNullOrUndefined)(this.dayMarkersModule)){var t=i.i(r.getValue)("nonworkingDayRender.holidayContainer",this.dayMarkersModule),n=i.i(r.getValue)("nonworkingDayRender.weekendContainer",this.dayMarkersModule),a=i.i(r.getValue)("eventMarkerRender.eventMarkersContainer",this.dayMarkersModule);t&&(t.style.height=this.ganttHeight+"px"),n&&(n.style.height=this.ganttHeight+"px"),a&&(a.style.height=this.ganttHeight+"px")}this.splitterModule.splitterObject.width=this.ganttWidth.toString(),this.ganttChartModule.scrollObject.setHeight(this.ganttHeight-this.ganttChartModule.chartTimelineContainer.offsetHeight-e)},t.prototype.renderChartVerticalLines=function(){this.element.contains(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer=i.i(r.createElement)("div",{id:this.element.id+"line-container",styles:"position:absolute;height:100%;"}),this.ganttChartModule.chartBodyContent.insertBefore(this.chartVerticalLineContainer,this.ganttChartModule.chartBodyContent.lastChild)),this.chartVerticalLineContainer.innerHTML="";var e=this.element.getElementsByClassName("e-timeline-header-table-container")[1];i.i(r.isNullOrUndefined)(e)&&(e=this.element.getElementsByClassName("e-timeline-header-table-container")[0]);for(var t,n=e.getElementsByTagName("th"),a=n.length,s=0,o=i.i(r.createElement)("div"),l=0;l<a;l++){s=0===l?-1:s+parseFloat(t),t=n[l].style.width;var d=i.i(r.createElement)("div",{className:"e-line-container-cell",styles:(this.enableRtl?"right:"+(s+1):"left:"+s)+"px"});o.appendChild(d)}this.chartVerticalLineContainer.innerHTML=o.innerHTML},t.prototype.getDefaultLocale=function(){return{emptyRecord:"No records to display",id:"ID",name:"Name",startDate:"Start Date",endDate:"End Date",duration:"Duration",progress:"Progress",dependency:"Dependency",notes:"Notes",criticalPath:"Critical Path",baselineStartDate:"Baseline Start Date",baselineEndDate:"Baseline End Date",taskMode:"Task Mode",changeScheduleMode:"Change Schedule Mode",subTasksStartDate:"SubTasks Start Date",subTasksEndDate:"SubTasks End Date",scheduleStartDate:"Schedule Start Date",scheduleEndDate:"Schedule End Date",auto:"Auto",manual:"Manual",type:"Type",offset:"Offset",resourceName:"Resources",resourceID:"Resource ID",day:"day",hour:"hour",minute:"minute",days:"days",hours:"hours",minutes:"minutes",generalTab:"General",customTab:"Custom Columns",writeNotes:"Write Notes",addDialogTitle:"New Task",editDialogTitle:"Task Information",add:"Add",edit:"Edit",update:"Update",delete:"Delete",cancel:"Cancel",search:"Search",task:" task",tasks:" tasks",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomToFit:"Zoom to fit",excelExport:"Excel export",csvExport:"CSV export",pdfExport:"Pdf export",expandAll:"Expand all",collapseAll:"Collapse all",nextTimeSpan:"Next timespan",prevTimeSpan:"Previous timespan",saveButton:"Save",taskBeforePredecessorFS:'You moved "{0}" to start before "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorFS:'You moved "{0}" away from "{1}" and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorSS:'You moved "{0}" to start before "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorSS:'You moved "{0}" to start after "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorFF:'You moved "{0}" to finish before "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorFF:'You moved "{0}" to finish after "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorSF:'You moved "{0}" away from "{1}" to starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorSF:'You moved "{0}" to finish after "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',okText:"Ok",confirmDelete:"Are you sure you want to Delete Record?",from:"From",to:"To",taskLink:"Task Link",lag:"Lag",start:"Start",finish:"Finish",enterValue:"Enter the value",taskInformation:"Task Information",deleteTask:"Delete Task",deleteDependency:"Delete Dependency",convert:"Convert",save:"Save",above:"Above",below:"Below",child:"Child",milestone:"Milestone",toTask:"To Task",toMilestone:"To Milestone",eventMarkers:"Event markers",leftTaskLabel:"Left task label",rightTaskLabel:"Right task label",timelineCell:"Timeline cell",confirmPredecessorDelete:"Are you sure you want to remove dependency link?",unit:"Unit",work:"Work",taskType:"Task Type",unassignedTask:"Unassigned Task",group:"Group",indent:"Indent",outdent:"Outdent",segments:"Segments",splitTask:"Split Task",mergeTask:"Merge Task",left:"Left",right:"Right"}},t.prototype.removeSortColumn=function(e){this.sortModule.removeSortColumn(e)},t.prototype.actionBeginTask=function(e){this.trigger("actionBegin",e),i.i(r.isNullOrUndefined)(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow()},t.prototype.scrollToDate=function(e){var t=this.dateValidationModule.getDateFromFormat(e),i=this.dataOperation.getTaskLeft(t,!1);this.ganttChartModule.updateScrollLeft(i)},t.prototype.scrollToTask=function(e){if(-1!==this.ids.indexOf(e)){var t=this.flatData[this.ids.indexOf(e)].ganttProperties.left;this.ganttChartModule.updateScrollLeft(t)}},t.prototype.updateChartScrollOffset=function(e,t){i.i(r.isNullOrUndefined)(e)||(e=this.ganttChartModule.scrollElement.scrollWidth<=e?this.ganttChartModule.scrollElement.scrollWidth:e,this.ganttChartModule.scrollObject.setScrollLeft(e,this.enableRtl?-1:0)),i.i(r.isNullOrUndefined)(t)||(t=this.ganttChartModule.scrollElement.scrollHeight<=t?this.ganttChartModule.scrollElement.scrollHeight:t,this.ganttChartModule.scrollObject.setScrollTop(t))},t.prototype.getParentTask=function(e){if(i.i(r.isNullOrUndefined)(e))return null;var t=this.flatData.filter(function(t){return e.uniqueID===t.uniqueID});return t.length>0?t[0]:null},t.prototype.getRootParent=function(e,t){return e.level===t?e:this.getRootParent(this.getParentTask(e.parentItem),t)},t.prototype.filterByColumn=function(e,t,i,r,n,a){this.treeGrid.filterByColumn(e,t,i,r,n,a)},t.prototype.excelExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.excelExport(e,t,i,r):null},t.prototype.csvExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.csvExport(e,t,i,r):null},t.prototype.pdfExport=function(e,t,i,r){return e&&e.fitToWidthSettings&&e.fitToWidthSettings.isFitToWidth&&e.pageOrientation,this.pdfExportModule?this.pdfExportModule.export(e,t,i,r):null},t.prototype.clearFiltering=function(e){this.treeGrid.grid.clearFiltering(e)},t.prototype.removeFilteredColsByField=function(e){this.treeGrid.removeFilteredColsByField(e,!1)},t.prototype.renderWorkingDayCell=function(e){var t="Auto"!==this.taskMode||!(!this.includeWeekend&&this.autoCalculateDateScheduling),i=t?[]:this.nonWorkingDayIndex,r=this.totalHolidayDates;if(i.length>0&&-1!==i.indexOf(e.date.getDay()))e.isDisabled=!0;else if(r.length>0){var n=new Date(e.date.getTime());n.setHours(0,0,0),-1!==r.indexOf(n.getTime())&&(this.autoCalculateDateScheduling?e.isDisabled=!0:e.isDisabled=!1)}},t.prototype.previousTimeSpan=function(e){this.timelineModule.performTimeSpanAction("prevTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},t.prototype.nextTimeSpan=function(e){this.timelineModule.performTimeSpanAction("nextTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},t.prototype.updateProjectDates=function(e,t,n,a){this.timelineModule.totalTimelineWidth=0,this.cloneProjectStartDate=e,this.cloneProjectEndDate=t,this.isTimelineRoundOff=n,this.timelineModule.refreshTimelineByTimeSpan(),this.dataOperation.reUpdateGanttDataPosition(),(!this.pdfExportModule||this.pdfExportModule&&!this.pdfExportModule.isPdfExport||this.pdfExportModule&&this.pdfExportModule.isPdfExport&&this.pdfExportModule.helper.exportProps&&this.pdfExportModule.helper.exportProps.fitToWidthSettings&&!this.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(this.timelineModule.updateChartByNewTimeline(),this.ganttChartModule.chartBodyContent.style.width=i.i(r.formatUnit)(this.timelineModule.totalTimelineWidth),this.ganttChartModule.updateLastRowBottomWidth(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines(),"beforeAdd"!==a&&this.notify("selectRowByIndex",{}))},t.prototype.splitTask=function(e,t){this.isEdit=!0,this.chartRowsModule.splitTask(e,t)},t.prototype.mergeTask=function(e,t){this.chartRowsModule.mergeTask(e,t)},t.prototype.reorderColumns=function(e,t){this.treeGrid.reorderColumns(e,t)},t.prototype.initiateEditAction=function(e){this.isOnEdit=e,this.previousRecords={},this.editedRecords=[]},t.prototype.setRecordValue=function(e,t,n,a){if(t=i.i(r.isUndefined)(t)?null:t,this.isOnEdit||this.isOnDelete){this.makeCloneData(e,n,a);var s=a?n:n.ganttProperties,o=s.rowUniqueID,l=this.getRecordByID(o),d=!1;(i.i(r.isNullOrUndefined)(t)||!i.i(r.isNullOrUndefined)(t)&&!i.i(r.isNullOrUndefined)(n[""+e])&&(t instanceof Date?t.getTime()!==n[""+e].getTime():n[""+e]!==t))&&(d=!0),l&&(-1===this.editedRecords.indexOf(l)&&d||0===this.editedRecords.length)&&(this.editModule.draggedRecord&&this.editModule.draggedRecord.ganttProperties.taskId===s.taskId?this.editedRecords.splice(0,0,l):this.editedRecords.push(l),this.enableImmutableMode&&this.modifiedRecords.push(l))}i.i(r.setValue)(e,t,n)},t.prototype.makeCloneData=function(e,t,n){var a,s,o,l=i.i(r.getValue)(e,t);if(n&&(e="ganttProperties."+e),i.i(r.isNullOrUndefined)(this.previousRecords[t.uniqueID])){var d={};this.previousRecords[t.uniqueID]=d}a=this.previousRecords[t.uniqueID],s=i.i(r.getValue)(e,a),i.i(r.isUndefined)(s)&&(o=l instanceof Date?new Date(l.getTime()):i.i(r.isObjectArray)(l)?i.i(r.extend)([],l,[],!0):i.i(r.isObject)(l)?i.i(r.extend)({},{},l,!0):l,i.i(r.isUndefined)(o)?i.i(r.setValue)(e,null,a):i.i(r.setValue)(e,o,a))},t.prototype.closeGanttActions=function(){this.editModule&&(this.editModule.cellEditModule&&this.editModule.cellEditModule.isCellEdit?(this.treeGrid.closeEdit(),this.editModule.cellEditModule.isCellEdit=!1,i.i(r.isNullOrUndefined)(this.toolbarModule)||this.toolbarModule.refreshToolbarItems()):this.editModule.dialogModule&&this.editModule.dialogModule.dialogObj&&this.editModule.dialogModule.dialogObj.visible&&(this.editModule.dialogModule.dialogObj.hide(),this.editModule.dialogModule.dialogClose()))},t.prototype.getTaskByUniqueID=function(e){var t=this.flatData.filter(function(t){return t.uniqueID===e});return t.length>0?t[0]:null},t.prototype.getRecordByID=function(e){return i.i(r.isNullOrUndefined)(e)?null:this.flatData[this.ids.indexOf(e.toString())]},t.prototype.setSplitterPosition=function(e,t){var i={};i[t]=e;var r=this.splitterModule.calculateSplitterPosition(i),n=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[0],a=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[1];this.splitterModule.splitterPreviousPositionGrid=n.scrollWidth+1+"px",this.splitterModule.splitterPreviousPositionChart=a.scrollWidth+1+"px",this.splitterModule.splitterObject.paneSettings[0].size=r,this.splitterModule.triggerCustomResizedEvent()},t.prototype.expandByIndex=function(e){if("number"==typeof e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)}else for(var i=0;i<e.length;i++)if("number"==typeof e[i]){var r=e[i],t=this.contructExpandCollapseArgs(null,r);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)}},t.prototype.expandByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)},t.prototype.collapseByIndex=function(e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},t.prototype.collapseByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},t.prototype.addRecord=function(e,t,n){if(this.editModule&&this.editSettings.allowAdding)if("ResourceView"===this.viewType){this.editModule.addRowPosition=t,this.editModule.addRowIndex=n;var a=void 0;i.i(r.isNullOrUndefined)(e)||(a=e[this.taskFields.resourceInfo]);var s=void 0,o=void 0;if(!i.i(r.isNullOrUndefined)(a)&&a.length){for(var l=0;l<a.length&&(s="object"==typeof a[l]?a[l][this.resourceFields.id]:a[0],!(o=this.flatData[this.getTaskIds().indexOf("R"+s)]));l++);if(o&&o.childRecords.length||0===o.level){var d=o.childRecords[n];if(d){var h="Above"===t||"Below"===t?t:"Child";"Child"===h?this.editModule.addRecord(e,h,this.getTaskIds().indexOf("R"+s)):this.editModule.addRecord(e,h,this.flatData.indexOf(d))}else this.editModule.addRecord(e,"Child",this.getTaskIds().indexOf("R"+s))}else this.editModule.addRecord(e,"Bottom")}else this.editModule.addRecord(e,"Bottom");this.editModule.addRowPosition=null,this.editModule.addRowIndex=null}else this.editModule.addRecord(e,t,n),"Bottom"===t&&(this.selectedRowIndex=n),"Above"!==t&&"Below"!==t&&"Child"!==t||(this.currentSelection=i.i(r.isNullOrUndefined)(e)?this.currentSelection:e)},t.prototype.updateRecordByID=function(e){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateRecordByID(e)},t.prototype.updateTaskId=function(e,t){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateTaskId(e,t)},t.prototype.expandAtLevel=function(e){this.enableVirtualization&&(this.isExpandCollapseLevelMethod=!0),this.ganttChartModule.expandAtLevel(e)},t.prototype.indent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.indent()},t.prototype.outdent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.outdent()},t.prototype.showCriticalPath=function(e){if(this.criticalPathModule){this.criticalPathModule.showCriticalPath(e);var t=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(t.criticalPathCollection,t.detailPredecessorCollection,!0,t.predecessorCollectionTaskIds)}},t.prototype.getCriticalTasks=function(){return!i.i(r.isNullOrUndefined)(this.criticalPathModule)&&this.enableCriticalPath?this.criticalPathModule.getCriticalTasks():null},t.prototype.zoomIn=function(){this.timelineModule.processZooming(!0)},t.prototype.zoomOut=function(){this.timelineModule.processZooming(!1)},t.prototype.fitToProject=function(){this.timelineModule.processZoomToFit(),this.ganttChartModule.updateScrollLeft(0)},t.prototype.reorderRows=function(e,t,i){this.rowDragAndDropModule.reorderRows(e,t,i)},t.prototype.updateRecordByIndex=function(e,t){if(this.editModule&&this.editSettings.allowEditing){var n=this.taskFields,a=this.updatedRecords.length>0?i.i(r.isNullOrUndefined)(this.updatedRecords[e])?null:this.updatedRecords[e]:null;i.i(r.isNullOrUndefined)(a)||(t[n.id]=a[n.id],this.editModule.updateRecordByID(t))}},t.prototype.addPredecessor=function(e,t){var n=this.getRecordByID(e.toString());this.editModule&&!i.i(r.isNullOrUndefined)(n)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.addPredecessor(n,t)},t.prototype.removePredecessor=function(e){var t=this.getRecordByID(e.toString());this.editModule&&!i.i(r.isNullOrUndefined)(t)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.removePredecessor(t)},t.prototype.updatePredecessor=function(e,t){var n=this.getRecordByID(e.toString());this.editModule&&!i.i(r.isNullOrUndefined)(n)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.updatePredecessor(n,t)},t.prototype.openAddDialog=function(){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowAdding&&this.editModule.dialogModule.openAddDialog()},t.prototype.openEditDialog=function(e){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowEditing&&this.editModule.dialogModule.openEditDialog(e)},t.prototype.contructExpandCollapseArgs=function(e,t){var n,a,s;return i.i(r.isNullOrUndefined)(t)?(a=this.getRecordByID(e.toString()),n=this.getRowByID(e),i.i(r.isNullOrUndefined)(n)||(s=i.i(r.getValue)("rowIndex",n))):i.i(r.isNullOrUndefined)(t)||(n=this.getRowByIndex(t),s=i.i(r.getValue)("rowIndex",n),a=this.currentViewData[s]),{data:a,gridRow:this.treeGrid.getRows()[s],chartRow:n,cancel:!1}},t.prototype.getRowByIndex=function(e){try{var t=this.element.querySelectorAll(".e-chart-row");return i.i(r.isNullOrUndefined)(e)?null:t[e]}catch(e){return null}},t.prototype.getRowByID=function(e){var t,i=this,r=this.getRecordByID(e.toString());return t=!this.loadChildOnDemand&&this.taskFields.hasChildMapping?this.updatedRecords.map(function(e){return e[i.taskFields.id]}).indexOf(r.ganttProperties.taskId):this.updatedRecords.indexOf(r),-1!==t?this.getRowByIndex(t):null},t.prototype.getUnscheduledTaskClass=function(e){return i.i(r.isNullOrUndefined)(e.startDate)&&i.i(r.isNullOrUndefined)(e.endDate)&&i.i(r.isNullOrUndefined)(e.duration)?" "+c._19:i.i(r.isNullOrUndefined)(e.startDate)||i.i(r.isNullOrUndefined)(e.endDate)||i.i(r.isNullOrUndefined)(e.duration)?" "+c._19:""},t.prototype.isUnscheduledTask=function(e){return!!(i.i(r.isNullOrUndefined)(e.startDate)||i.i(r.isNullOrUndefined)(e.endDate)||i.i(r.isNullOrUndefined)(e.duration))},t.prototype.createGanttPopUpElement=function(){var e=this.createElement("div",{className:"e-ganttpopup",styles:"display:none;"}),t=this.createElement("div",{className:"e-content",attrs:{tabIndex:"-1"}});i.i(r.append)([t,this.createElement("div",{className:"e-uptail e-tail"})],e),t.appendChild(this.createElement("span")),i.i(r.append)([t,this.createElement("div",{className:"e-downtail e-tail"})],e),document.getElementById(this.element.id+"GanttChart").appendChild(e)},t.prototype.getPredecessorTextValue=function(e){var t;switch(e){case"SS":t=this.localeObj.getConstant("start")+"-"+this.localeObj.getConstant("start");break;case"FF":t=this.localeObj.getConstant("finish")+"-"+this.localeObj.getConstant("finish");break;case"SF":t=this.localeObj.getConstant("start")+"-"+this.localeObj.getConstant("finish");break;case"FS":t=this.localeObj.getConstant("finish")+"-"+this.localeObj.getConstant("start")}return t},t.prototype.search=function(e){this.filterModule&&(this.searchSettings.key=e,this.dataBind())},t.prototype.getOffsetRect=function(e){var t=e.getBoundingClientRect(),i=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,r=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.clientTop||document.body.clientTop||0,a=document.documentElement.clientLeft||document.body.clientLeft||0,s=t.top+i-n,o=this.enableRtl?t.right+r-a:t.left+r-a;return{top:Math.round(s),left:Math.round(o),width:t.width,height:t.height}},t.prototype.expandAll=function(){this.ganttChartModule.expandCollapseAll("expand")},t.prototype.updateDataSource=function(e,t){if(this.isDynamicData=!0,!i.i(r.isNullOrUndefined)(t))for(var n=0,a=Object.keys(t);n<a.length;n++){var s=a[n];switch(s){case"projectStartDate":this.setProperties({projectStartDate:t[s]},!0);break;case"projectEndDate":this.setProperties({projectEndDate:t[s]},!0)}}this.dataSource=e},t.prototype.collapseAll=function(){this.ganttChartModule.expandCollapseAll("collapse")},t.prototype.getGridColumns=function(){return this.treeGrid.getColumns()},t.prototype.getColumnByField=function(e,t){var i=t.filter(function(t){return t.field===e});return i.length>0?i[0]:null},t.prototype.getGanttColumns=function(){return this.ganttColumns},t.prototype.showColumn=function(e,t){this.treeGrid.showColumns(e,t),this.updateTreeColumns()},t.prototype.hideColumn=function(e,t){this.treeGrid.hideColumns(e,t),this.updateTreeColumns()},t.prototype.setScrollTop=function(e){this.ganttChartModule.scrollObject.setScrollTop(e)},t.prototype.cancelEdit=function(){this.isCancelled=!0,this.closeGanttActions()},t.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},t.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},t.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},t.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},t.prototype.deleteRecord=function(e){this.editModule&&this.editModule.deleteRecord(e)},t.prototype.enableItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},t.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},t.prototype.updateDataArgs=function(e){if(!Array.isArray(e.data)){var t=[];t.push(e.data),i.i(r.setValue)("data",t,e)}return e},t.prototype.convertToMilestone=function(e){var t=this.getRecordByID(e);if(!i.i(r.isNullOrUndefined)(t)){var n=i.i(r.extend)({},{},t.taskData,!0),a=this.taskFields;if(n[a.startDate]&&this.setRecordValue(a.startDate,t.ganttProperties.startDate,n,!0),i.i(r.isNullOrUndefined)(a.duration)?(n[a.startDate]=new Date(t.ganttProperties.startDate),n[a.endDate]=new Date(t.ganttProperties.endDate)):n[a.duration]=0,i.i(r.isNullOrUndefined)(a.milestone)||!1===n[a.milestone]&&(n[a.milestone]=!0),i.i(r.isNullOrUndefined)(a.progress)||(n[a.progress]=0),!i.i(r.isNullOrUndefined)(a.child)&&n[a.child]&&(n[a.child]=[]),!i.i(r.isNullOrUndefined)(a.parentID)&&n[a.parentID]&&(n[a.parentID]=null),i.i(r.isNullOrUndefined)(a.segments)||(n[a.segments]=null),!i.i(r.isNullOrUndefined)(this.contextMenuModule)&&this.contextMenuModule.isOpen&&"Milestone"===this.contextMenuModule.item){i.i(r.isNullOrUndefined)(a.dependency)||(n[a.dependency]=null);var s=this.editSettings.newRowPosition;this.addRecord(n,s,this.selectedRowIndex)}else t.hasChildRecords||t.ganttProperties.isMilestone||this.updateRecordByID(n)}},t.prototype.changeTaskMode=function(e){var t=this.taskFields,n=this.getRecordByID(e[t.id]),a=n.ganttProperties;this.isOnEdit=!0,this.setRecordValue("isAutoSchedule",!a.isAutoSchedule,a,!0),i.i(r.isNullOrUndefined)(this.taskFields.manual)||(this.setRecordValue("taskData."+t.manual,!a.isAutoSchedule,n),this.setRecordValue(t.manual,!a.isAutoSchedule,n)),this.editModule.updateTaskScheduleModes(n);var s={data:n};this.editModule.initiateUpdateAction(s)},t.prototype.getTaskIds=function(){return this.taskIds},t.prototype.setTaskIds=function(e){if("ProjectView"!==this.viewType){var t=e.ganttProperties.taskId;t=0===e.level?"R"+t:"T"+t,this.taskIds.push(t)}},t.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},t.prototype.resetTemplates=function(){this.isReact&&this.clearTemplate()},b([i.i(r.Property)(!0)],t.prototype,"allowKeyboard",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableImmutableMode",void 0),b([i.i(r.Property)(!0)],t.prototype,"allowParentDependency",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableHtmlSanitizer",void 0),b([i.i(r.Property)(!0)],t.prototype,"disableHtmlEncode",void 0),b([i.i(r.Complex)({},d.t)],t.prototype,"loadingIndicator",void 0),b([i.i(r.Property)(!0)],t.prototype,"enableVirtualMaskRow",void 0),b([i.i(r.Property)(!1)],t.prototype,"loadChildOnDemand",void 0),b([i.i(r.Property)(!0)],t.prototype,"UpdateOffsetOnTaskbarEdit",void 0),b([i.i(r.Property)(!0)],t.prototype,"autoCalculateDateScheduling",void 0),b([i.i(r.Property)(!0)],t.prototype,"autoFocusTasks",void 0),b([i.i(r.Property)(!0)],t.prototype,"allowSelection",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowSorting",void 0),b([i.i(r.Property)(!0)],t.prototype,"enablePredecessorValidation",void 0),b([i.i(r.Property)(!1)],t.prototype,"showColumnMenu",void 0),b([i.i(r.Property)()],t.prototype,"columnMenuItems",void 0),b([i.i(r.Property)()],t.prototype,"timezone",void 0),b([i.i(r.Property)(!1)],t.prototype,"collapseAllParentTasks",void 0),b([i.i(r.Property)(!1)],t.prototype,"highlightWeekends",void 0),b([i.i(r.Property)(0)],t.prototype,"treeColumnIndex",void 0),b([i.i(r.Property)([])],t.prototype,"dataSource",void 0),b([i.i(r.Property)("day")],t.prototype,"durationUnit",void 0),b([i.i(r.Property)(null)],t.prototype,"query",void 0),b([i.i(r.Property)(null)],t.prototype,"dateFormat",void 0),b([i.i(r.Property)("auto")],t.prototype,"height",void 0),b([i.i(r.Property)(!1)],t.prototype,"renderBaseline",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowTaskbarDragAndDrop",void 0),b([i.i(r.Property)(!0)],t.prototype,"allowTaskbarOverlap",void 0),b([i.i(r.Property)("Horizontal")],t.prototype,"gridLines",void 0),b([i.i(r.Complex)({},d.j)],t.prototype,"labelSettings",void 0),b([i.i(r.Property)(null)],t.prototype,"taskbarTemplate",void 0),b([i.i(r.Property)(null)],t.prototype,"parentTaskbarTemplate",void 0),b([i.i(r.Property)(null)],t.prototype,"milestoneTemplate",void 0),b([i.i(r.Property)()],t.prototype,"baselineColor",void 0),b([i.i(r.Property)("auto")],t.prototype,"width",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableVirtualization",void 0),b([i.i(r.Property)()],t.prototype,"toolbar",void 0),b([i.i(r.Property)(["Monday","Tuesday","Wednesday","Thursday","Friday"])],t.prototype,"workWeek",void 0),b([i.i(r.Property)(!1)],t.prototype,"includeWeekend",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowUnscheduledTasks",void 0),b([i.i(r.Property)(!1)],t.prototype,"showInlineNotes",void 0),b([i.i(r.Property)(36)],t.prototype,"rowHeight",void 0),b([i.i(r.Property)(null)],t.prototype,"taskbarHeight",void 0),b([i.i(r.Property)(null)],t.prototype,"projectStartDate",void 0),b([i.i(r.Property)(null)],t.prototype,"projectEndDate",void 0),b([i.i(r.Property)(null)],t.prototype,"resourceIDMapping",void 0),b([i.i(r.Property)(null)],t.prototype,"resourceNameMapping",void 0),b([i.i(r.Property)([])],t.prototype,"resources",void 0),b([i.i(r.Property)([])],t.prototype,"segmentData",void 0),b([i.i(r.Property)(null)],t.prototype,"connectorLineBackground",void 0),b([i.i(r.Property)(1)],t.prototype,"connectorLineWidth",void 0),b([i.i(r.Property)([])],t.prototype,"columns",void 0),b([i.i(r.Property)([])],t.prototype,"addDialogFields",void 0),b([i.i(r.Property)([])],t.prototype,"editDialogFields",void 0),b([i.i(r.Property)(-1)],t.prototype,"selectedRowIndex",void 0),b([i.i(r.Property)("hour")],t.prototype,"workUnit",void 0),b([i.i(r.Property)("FixedUnit")],t.prototype,"taskType",void 0),b([i.i(r.Property)("ProjectView")],t.prototype,"viewType",void 0),b([i.i(r.Collection)([{from:8,to:12},{from:13,to:17}],d.b)],t.prototype,"dayWorkingTime",void 0),b([i.i(r.Collection)([],d.i)],t.prototype,"holidays",void 0),b([i.i(r.Collection)([],d.f)],t.prototype,"eventMarkers",void 0),b([i.i(r.Complex)({},d.m)],t.prototype,"taskFields",void 0),b([i.i(r.Complex)({},d.s)],t.prototype,"resourceFields",void 0),b([i.i(r.Complex)({},d.o)],t.prototype,"timelineSettings",void 0),b([i.i(r.Property)([])],t.prototype,"zoomingLevels",void 0),b([i.i(r.Complex)({},d.r)],t.prototype,"sortSettings",void 0),b([i.i(r.Complex)({},d.e)],t.prototype,"editSettings",void 0),b([i.i(r.Complex)({},d.p)],t.prototype,"tooltipSettings",void 0),b([i.i(r.Complex)({},d.k)],t.prototype,"selectionSettings",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowFiltering",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowExcelExport",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowRowDragAndDrop",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowReordering",void 0),b([i.i(r.Property)(!1)],t.prototype,"readOnly",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowResizing",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableContextMenu",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableCriticalPath",void 0),b([i.i(r.Property)()],t.prototype,"contextMenuItems",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowPdfExport",void 0),b([i.i(r.Property)(!1)],t.prototype,"validateManualTasksOnLinking",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableMultiTaskbar",void 0),b([i.i(r.Property)(!1)],t.prototype,"showOverAllocation",void 0),b([i.i(r.Property)("Auto")],t.prototype,"taskMode",void 0),b([i.i(r.Complex)({},d.g)],t.prototype,"filterSettings",void 0),b([i.i(r.Complex)({},d.h)],t.prototype,"searchSettings",void 0),b([i.i(r.Complex)({},d.l)],t.prototype,"splitterSettings",void 0),b([i.i(r.Event)()],t.prototype,"queryTaskbarInfo",void 0),b([i.i(r.Event)()],t.prototype,"beforeExcelExport",void 0),b([i.i(r.Event)()],t.prototype,"excelExportComplete",void 0),b([i.i(r.Event)()],t.prototype,"excelQueryCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"excelHeaderQueryCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"rowDrag",void 0),b([i.i(r.Event)()],t.prototype,"rowDragStart",void 0),b([i.i(r.Event)()],t.prototype,"rowDragStartHelper",void 0),b([i.i(r.Event)()],t.prototype,"rowDrop",void 0),b([i.i(r.Event)()],t.prototype,"collapsing",void 0),b([i.i(r.Event)()],t.prototype,"collapsed",void 0),b([i.i(r.Event)()],t.prototype,"expanding",void 0),b([i.i(r.Event)()],t.prototype,"expanded",void 0),b([i.i(r.Event)()],t.prototype,"actionBegin",void 0),b([i.i(r.Event)()],t.prototype,"actionComplete",void 0),b([i.i(r.Event)()],t.prototype,"actionFailure",void 0),b([i.i(r.Event)()],t.prototype,"dataStateChange",void 0),b([i.i(r.Event)()],t.prototype,"taskbarEdited",void 0),b([i.i(r.Event)()],t.prototype,"endEdit",void 0),b([i.i(r.Event)()],t.prototype,"cellEdit",void 0),b([i.i(r.Event)()],t.prototype,"load",void 0),b([i.i(r.Event)()],t.prototype,"created",void 0),b([i.i(r.Event)()],t.prototype,"destroyed",void 0),b([i.i(r.Event)()],t.prototype,"taskbarEditing",void 0),b([i.i(r.Event)()],t.prototype,"dataBound",void 0),b([i.i(r.Event)()],t.prototype,"resizeStart",void 0),b([i.i(r.Event)()],t.prototype,"resizing",void 0),b([i.i(r.Event)()],t.prototype,"resizeStop",void 0),b([i.i(r.Event)()],t.prototype,"splitterResizeStart",void 0),b([i.i(r.Event)()],t.prototype,"splitterResizing",void 0),b([i.i(r.Event)()],t.prototype,"splitterResized",void 0),b([i.i(r.Event)()],t.prototype,"columnDragStart",void 0),b([i.i(r.Event)()],t.prototype,"columnDrag",void 0),b([i.i(r.Event)()],t.prototype,"columnDrop",void 0),b([i.i(r.Event)()],t.prototype,"beforeTooltipRender",void 0),b([i.i(r.Event)()],t.prototype,"rowSelecting",void 0),b([i.i(r.Event)()],t.prototype,"rowSelected",void 0),b([i.i(r.Event)()],t.prototype,"rowDeselecting",void 0),b([i.i(r.Event)()],t.prototype,"rowDeselected",void 0),b([i.i(r.Event)()],t.prototype,"cellSelecting",void 0),b([i.i(r.Event)()],t.prototype,"cellSelected",void 0),b([i.i(r.Event)()],t.prototype,"cellDeselecting",void 0),b([i.i(r.Event)()],t.prototype,"cellDeselected",void 0),b([i.i(r.Event)()],t.prototype,"queryCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"headerCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"rowDataBound",void 0),b([i.i(r.Event)()],t.prototype,"columnMenuOpen",void 0),b([i.i(r.Event)()],t.prototype,"toolbarClick",void 0),b([i.i(r.Event)()],t.prototype,"columnMenuClick",void 0),b([i.i(r.Event)()],t.prototype,"contextMenuOpen",void 0),b([i.i(r.Event)()],t.prototype,"contextMenuClick",void 0),b([i.i(r.Event)()],t.prototype,"onTaskbarClick",void 0),b([i.i(r.Event)()],t.prototype,"recordDoubleClick",void 0),b([i.i(r.Event)()],t.prototype,"onMouseMove",void 0),b([i.i(r.Event)()],t.prototype,"beforePdfExport",void 0),b([i.i(r.Event)()],t.prototype,"pdfExportComplete",void 0),b([i.i(r.Event)()],t.prototype,"pdfQueryCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"pdfQueryTaskbarInfo",void 0),b([i.i(r.Event)()],t.prototype,"pdfQueryTimelineCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"pdfColumnHeaderQueryCellInfo",void 0),t=b([r.NotifyPropertyChanges],t)}(r.Component)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(3)),a=i(87),s=(i.n(a),i(4)),o=(i.n(s),function(){function e(e){this.parent=e,this.parent.on("destroy",this.destroy,this)}return e.prototype.renderSplitter=function(){var e=this,t=this.calculateSplitterPosition(this.parent.splitterSettings);this.parent.splitterElement=i.i(r.createElement)("div",{className:n._21}),this.parent.treeGridPane=i.i(r.createElement)("div",{className:n._22}),this.parent.chartPane=i.i(r.createElement)("div",{className:n._23}),i.i(r.addClass)([this.parent.chartPane],"e-droppable"),this.parent.enableRtl?(this.parent.splitterElement.appendChild(this.parent.chartPane),this.parent.splitterElement.appendChild(this.parent.treeGridPane)):(this.parent.splitterElement.appendChild(this.parent.treeGridPane),this.parent.splitterElement.appendChild(this.parent.chartPane)),this.splitterObject=new a.Splitter({height:null,width:this.parent.ganttWidth.toString(),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,separatorSize:this.parent.splitterSettings.separatorSize,paneSettings:[{resizable:!0,size:t,min:this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum)},{resizable:!0}],orientation:"Horizontal",resizeStart:function(t){e.parent.contextMenuModule&&e.parent.contextMenuModule.isOpen&&e.parent.contextMenuModule.contextMenu.close();var i=t.pane[0],r=t.pane[1];e.splitterPreviousPositionGrid=i.scrollWidth+1+"px",e.splitterPreviousPositionChart=r.scrollWidth+1+"px";var n=new s.Deferred;return e.parent.trigger("splitterResizeStart",t,function(e){n.resolve(e)}),n},resizing:function(t){e.parent.trigger("splitterResizing",t),e.parent.timelineModule.isZoomToFit&&e.parent.timelineModule.updateTimelineAfterZooming(e.parent.timelineModule.timelineEndDate,!0)},resizeStop:function(t){e.parent.calculateDimensions();var n=t.pane[0];e.splitterPreviousPositionGrid=n.scrollWidth+1+"px",e.splitterObject.paneSettings[0].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionGrid);var a=new s.Deferred;return e.parent.trigger("splitterResized",t,function(t){!0===t.cancel&&(e.splitterObject.paneSettings[0].size=null,e.splitterObject.paneSettings[0].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionGrid),e.splitterObject.paneSettings[1].size=null,e.splitterObject.paneSettings[1].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionChart)),i.i(r.isNullOrUndefined)(e.parent.projectEndDate)&&e.parent.timelineModule.updateTimelineAfterZooming(e.parent.timelineModule.timelineEndDate,!0),a.resolve(t)}),a}}),this.parent.element.appendChild(this.parent.splitterElement),this.splitterObject.appendTo(this.parent.splitterElement)},e.prototype.calculateSplitterPosition=function(e){return!i.i(r.isNullOrUndefined)(this.splitterObject)&&this.parent.enablePersistence?this.splitterObject.paneSettings[0].size:"Grid"===e.view?"100%":"Chart"===e.view?"0%":i.i(r.isNullOrUndefined)(e.position)||""===e.position?!i.i(r.isNullOrUndefined)(e.columnIndex)&&e.columnIndex>=0?150*e.columnIndex<this.parent.ganttWidth||!this.parent.element.classList.contains("e-device")?this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(e.columnIndex).toString()+"px"):this.getSpliterPositionInPercentage(130*e.columnIndex+"px"):this.getSpliterPositionInPercentage("250px"):this.getSpliterPositionInPercentage(e.position)},e.prototype.getSpliterPositionInPercentage=function(e){var t=i.i(r.isNullOrUndefined)(e)||""===e?null:e;if(!i.i(r.isNullOrUndefined)(t))if(-1!==e.indexOf("px")){var n=parseInt(e,10);t=n/this.parent.ganttWidth*100<=100?n/this.parent.ganttWidth*100+"%":"25%"}else t=-1===e.indexOf("%")?e+"%":e;return t},e.prototype.getTotalColumnWidthByIndex=function(e){var t=0,i=this.parent.ganttColumns;e=i.length>e?e:i.length;for(var r=0;r<e;r++)t+=parseInt(i[r].width);return t},e.prototype.updateSplitterPosition=function(){this.splitterObject.separatorSize=this.parent.splitterSettings.separatorSize>=4?this.parent.splitterSettings.separatorSize:4;var e=this.calculateSplitterPosition(this.parent.splitterSettings);this.splitterObject.paneSettings[0].min=this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum),this.splitterObject.dataBind(),this.splitterObject.paneSettings[0].size=e},e.prototype.triggerCustomResizedEvent=function(){var e=this.splitterObject.element.querySelectorAll(".e-pane")[0],t=this.splitterObject.element.querySelectorAll(".e-pane")[1],i={event:null,element:this.splitterObject.element,pane:[e,t],index:[0,1],separator:this.splitterObject.element.querySelector(".e-split-bar"),paneSize:[e.offsetWidth,t.offsetWidth]};this.parent.trigger("splitterResized",i),!0===i.cancel&&(this.splitterObject.paneSettings[0].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionGrid),this.splitterObject.paneSettings[1].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionChart))},e.prototype.destroy=function(){this.splitterObject.destroy(),this.parent.off("destroy",this.destroy)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(0),n=(i.n(r),i(5)),a=(i.n(n),i(4)),s=(i.n(a),i(1)),o=i(10),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),d=function(e){function t(t){var i=e.call(this,t)||this;return i.recordIndex=0,i.taskIds=[],i.hierarchyData=[],i.addEventListener(),i}return l(t,e),t.prototype.addEventListener=function(){this.parent.on("beforeDataManipulate",this.checkDataBinding.bind(this))},t.prototype.checkDataBinding=function(e){if(e&&(this.parent.flatData=[],this.parent.currentViewData=[],this.parent.updatedRecords=[],this.dataArray=[],this.taskIds=[],this.parent.ids=[],this.recordIndex=0,this.hierarchyData=[],this.parent.predecessorsCollection=[],this.parent.treeGrid.parentData=[],this.parent.taskIds=[]),i.i(r.isNullOrUndefined)(this.parent.dataSource))this.parent.dataSource=[],this.parent.processTimeline(),this.parent.renderGantt(e);else if(this.parent.dataSource instanceof a.DataManager)this.initDataSource(e);else{if(this.parent.dataSource instanceof Object&&i.i(s.i)(this.parent)){var t=i.i(r.getValue)("result",this.parent.dataSource);this.dataArray=t}else this.dataArray=this.parent.dataSource;this.processTimeline(),this.cloneDataSource(),this.parent.renderGantt(e)}},t.prototype.processTimeline=function(){this.parent.processTimeline(),this.parent.enableValidation||(this.parent.dataOperation.calculateProjectDatesForValidatedTasks(),this.parent.timelineModule.validateTimelineProp())},t.prototype.initDataSource=function(e){var t=this,i=this.parent.query instanceof a.Query?this.parent.query:new a.Query;i.requiresCount(),this.parent.dataSource.executeQuery(i).then(function(i){t.dataArray=i.result,t.processTimeline(),(t.parent.loadChildOnDemand||!t.parent.loadChildOnDemand&&!t.parent.taskFields.hasChildMapping)&&t.cloneDataSource(),t.parent.renderGantt(e)}).catch(function(i){t.parent.processTimeline(),t.parent.renderGantt(e),t.parent.trigger("actionFailure",{error:i})})},t.prototype.constructDataSource=function(e){for(var t,n=new a.DataManager(e).executeLocal((new a.Query).group(this.parent.taskFields.parentID)),s=[],o=0;o<n.length;o++){var l=n[o];!i.i(r.isNullOrUndefined)(l.key)&&(t=this.taskIds.indexOf(l.key.toString()))>-1&&!i.i(r.isNullOrUndefined)(l.key)?e[t][this.parent.taskFields.child]=l.items:-1!==t&&s.push.apply(s,l.items)}this.hierarchyData=this.dataReorder(e,s)},t.prototype.cloneDataSource=function(){var e=this.parent.taskFields.id,t=this.parent.taskFields.parentID,n=[];if(i.i(r.isNullOrUndefined)(e)||i.i(r.isNullOrUndefined)(t))n=this.dataArray;else{for(var s=[],o=0;o<this.dataArray.length;o++){var l=this.dataArray[o];l.parentItem&&delete l.parentItem,s.push(i.i(r.extend)({},{},l,!0)),i.i(r.isNullOrUndefined)(l[e])||this.taskIds.push(l[e].toString())}this.parent.taskFields.child||this.parent.setProperties({taskFields:{child:"Children"}},!0),this.constructDataSource(s),n=!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping&&0===this.hierarchyData.length?this.dataArray:this.hierarchyData}if(this.parent.taskFields.segmentId&&(this.segmentCollection=new a.DataManager(this.parent.segmentData).executeLocal((new a.Query).group(this.parent.taskFields.segmentId)),this.parent.taskFields.segments||(this.parent.taskFields.segments="Segments")),"ProjectView"!==this.parent.viewType){var d=i.i(r.extend)([],[],this.parent.resources,!0),h=[];if(this.constructResourceViewDataSource(d,n,h),h.length>0){var p={};p[this.parent.resourceFields.id]=0,p[this.parent.resourceFields.name]=this.parent.localeObj.getConstant("unassignedTask"),p[this.parent.taskFields.child]=h,d.push(p)}n=d}this.prepareDataSource(n)},t.prototype.constructResourceViewDataSource=function(e,t,i){for(var r=this,n=0;n<t.length;n++)!function(n){var a=t[n],s=null!=r.parent.taskFields.child?r.parent.taskFields.child:r.parent.taskFields.child="Children",o=a&&a[r.parent.taskFields.resourceInfo],l=r.parent.resourceFields.id;a[s]&&0!==a[s].length||!o||!o.length?(!a[s]||a[s]&&0===a[s].length)&&i.push(a):o.forEach(function(t){for(var i="object"==typeof t?t[l]:t,r=0;r<e.length;r++)if(e[r][l].toString()===i.toString()){e[r][s]?e[r][s].push(a):e[r][s]=[a];break}}),a[r.parent.taskFields.child]&&a[r.parent.taskFields.child].length&&r.constructResourceViewDataSource(e,a[r.parent.taskFields.child],i)}(n)},t.prototype.prepareDataSource=function(e){this.prepareRecordCollection(e,0),this.parent.initialLoadData=i.i(r.extend)({},{},this.parent.flatData,!0),"ResourceView"===this.parent.viewType&&this.calculateSharedTaskUniqueIds(),this.parent.taskFields.dependency&&this.parent.predecessorModule&&this.parent.predecessorModule.ensurePredecessorCollection()},t.prototype.calculateSharedTaskUniqueIds=function(){for(var e=this,t=0;t<this.parent.getTaskIds().length;t++)!function(t){var i=[];if(i[0]=e.parent.getTaskIds()[t][0],i[1]=e.parent.getTaskIds()[t].slice(1),"R"!==i[0]){var r=[],n=[];e.parent.flatData.filter(function(e){e.ganttProperties.taskId.toString()===i[1]&&0!==e.level&&(n.push(e.ganttProperties.rowUniqueID),r.push(e))});for(var a=0;a<r.length;a++)r[a].ganttProperties.sharedTaskUniqueIds=n}}(t)},t.prototype.prepareRecordCollection=function(e,t,n){for(var a=this,s=e.length,o=this,l=0;l<s;l++)!function(s){var l=e[s];if(!i.i(r.isNullOrUndefined)(o.parent.taskFields.segmentId)){var d=o.segmentCollection.filter(function(e){return e.key===l[a.parent.taskFields.id]});d.length>0&&(l[o.parent.taskFields.segments]=d[0].items)}var h=o.createRecord(l,t,n,!0);o.parent.enableValidation&&o.parent.autoCalculateDateScheduling||o.updateTaskLeftWidth(h),h.index=o.recordIndex++,o.parent.ids[h.index]=h.ganttProperties.rowUniqueID,o.parent.flatData.push(h),o.parent.setTaskIds(h);var p=l[o.parent.taskFields.child];if("ResourceView"===o.parent.viewType&&i.i(r.isNullOrUndefined)(p)&&i.i(r.isNullOrUndefined)(h.parentItem)&&0===h.level){var u=h.ganttProperties,c=h;o.parent.setRecordValue(u.isAutoSchedule?"startDate":"autoStartDate",null,c.ganttProperties,!0),o.parent.setRecordValue(u.isAutoSchedule?"endDate":"autoEndDate",null,c.ganttProperties,!0);var g=c.ganttProperties;o.parent.setRecordValue("isMilestone",!1,g,!0),g.isAutoSchedule&&o.calculateDuration(c),o.updateWorkWithDuration(c);var f=g.work;o.parent.setRecordValue("work",f,g,!0),o.parent.setRecordValue("taskType","FixedDuration",g,!0),i.i(r.isNullOrUndefined)(o.parent.taskFields.type)||o.updateMappingData(c,"type"),o.parent.setRecordValue("progress",Math.floor(0),g,!0),o.parent.setRecordValue("totalProgress",0,g,!0),o.parent.setRecordValue("totalDuration",0,g,!0),g.isAutoSchedule||(o.parent.setRecordValue("autoDuration",o.calculateAutoDuration(g),g,!0),o.updateAutoWidthLeft(c)),o.parent.allowParentDependency||o.resetDependency(c),o.updateWidthLeft(c),o.updateTaskData(c)}!i.i(r.isNullOrUndefined)(p)&&p.length>0&&o.prepareRecordCollection(p,h.level+1,h)}(l)},t.prototype.addCustomFieldValue=function(e,t){var i=this.parent.ganttColumns,r=i.length;if(r)for(var n=0;n<r;n++){var a=t[i[n].field];void 0===a&&this.parent.setRecordValue(i[n].field,e[i[n].field],t)}},t.prototype.createRecord=function(e,t,a,o){var l=this.parent.taskFields,d=this.parent.resourceFields,h=e[l.progress],p=null,u=null,c=e[l.notes];h=h&&parseFloat(h.toString())?parseFloat(h.toString()):0;var g=e[l.dependency],f=this.getDateFromFormat(e[l.baselineStartDate],!0),m=this.getDateFromFormat(e[l.baselineEndDate],!0),y={},D={},v="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[l.manual];this.parent.setRecordValue("ganttProperties",D,y),i.i(r.isNullOrUndefined)(e[l.id])?i.i(r.isNullOrUndefined)(e[d.id])||(p=e[d.id],u=e[d.name],this.addTaskData(y,e,!1)):(p=e[l.id],u=e[l.name],!this.parent.loadChildOnDemand&&l.hasChildMapping&&e.taskData?y.taskData=e.taskData:this.addTaskData(y,e,o)),this.parent.setRecordValue("taskId",p,D,!0),this.parent.setRecordValue("taskName",u,D,!0),l.parentID&&this.parent.setRecordValue("parentId",e[l.parentID],D,!0),this.addCustomFieldValue(e,y),this.parent.setRecordValue("isAutoSchedule",v,D,!0),this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),D,!0),this.parent.setRecordValue("isMilestone",!1,D,!0),this.parent.setRecordValue("indicators",e[l.indicators],D,!0),this.updateResourceName(y),this.calculateScheduledValues(y,e,o),this.parent.setRecordValue("baselineStartDate",this.checkBaselineStartDate(f),D,!0),m&&0===m.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,m),(D.baselineStartDate&&m&&D.baselineStartDate.getTime()>m.getTime()||!i.i(r.isNullOrUndefined)(D.baselineStartDate)&&!i.i(r.isNullOrUndefined)(D.startDate)&&D.baselineStartDate.getTime()===D.startDate.getTime()&&!i.i(r.isNullOrUndefined)(m)&&!i.i(r.isNullOrUndefined)(D.endDate)&&m.toLocaleDateString()===D.endDate.toLocaleDateString()&&D.isMilestone)&&(m=D.baselineStartDate),this.parent.setRecordValue("baselineEndDate",this.checkBaselineEndDate(m,D),D,!0),this.parent.setRecordValue("progress",h,D,!0),this.parent.setRecordValue("totalProgress",h,D,!0),this.parent.setRecordValue("predecessorsName",g,D,!0),this.parent.setRecordValue("notes",c,D,!0),this.parent.setRecordValue("cssClass",e[l.cssClass],D,!0),this.parent.setRecordValue("parentItem",this.getCloneParent(a),y),!this.parent.loadChildOnDemand&&l.hasChildMapping&&this.parent.currentViewData.length>0&&this.parent.setRecordValue("parentItem",y.parentItem,this.parent.currentViewData[this.taskIds.indexOf(e[l.id].toString())]);var w=y.parentItem?y.parentItem.uniqueID:null;if(this.parent.setRecordValue("parentUniqueID",w,y),"ResourceView"!==this.parent.viewType||i.i(r.isNullOrUndefined)(l.parentID)||i.i(r.isNullOrUndefined)(y.parentItem)||this.parent.setRecordValue("parentId",y.parentItem.taskId,D,!0),this.parent.setRecordValue("level",t,y),!this.parent.loadChildOnDemand&&l.hasChildMapping&&e.uniqueID?this.parent.setRecordValue("uniqueID",e.uniqueID,y):this.parent.setRecordValue("uniqueID",i.i(n.getUid)(this.parent.element.id+"_data_"),y),this.parent.setRecordValue("uniqueID",y.uniqueID,D,!0),this.parent.setRecordValue("childRecords",[],y),this.parent.dataSource instanceof Object&&i.i(s.i)(this.parent)&&!i.i(r.isNullOrUndefined)(l.child)&&this.parent.setRecordValue(l.child,[],y),!i.i(r.isNullOrUndefined)(e[l.child])&&e[l.child].length>0?(this.parent.setRecordValue("hasChildRecords",!0,y),this.parent.setRecordValue("isMilestone",!1,D,!0),this.parent.allowParentDependency||this.resetDependency(y)):!this.parent.loadChildOnDemand&&l.hasChildMapping&&y.taskData[l.hasChildMapping]?this.parent.setRecordValue("hasChildRecords",!0,y):this.parent.setRecordValue("hasChildRecords",!1,y),y.hasChildRecords&&(this.parent.setRecordValue("autoStartDate",y.ganttProperties.startDate,D),this.parent.setRecordValue("autoEndDate",y.ganttProperties.endDate,D),this.parent.setRecordValue("autoDuration",y.ganttProperties.duration,D)),this.parent.setRecordValue("expanded",!y.hasChildRecords||!this.parent.collapseAllParentTasks,y),this.updateExpandStateMappingValue(y,e),o||(this.parent.setRecordValue("width",this.calculateWidth(y),D,!0),this.parent.setRecordValue("left",this.calculateLeft(D),D,!0),this.parent.setRecordValue("progressWidth",this.getProgressWidth(D.width,h),D,!0),D.baselineEndDate&&D.baselineStartDate&&(this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(D),D,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(D),D,!0))),i.i(r.isNullOrUndefined)(l.work)&&this.updateWorkWithDuration(y),i.i(r.isNullOrUndefined)(l.manual)||this.parent.dataOperation.updateMappingData(y,"manual"),this.updateTaskData(y),g&&this.parent.predecessorsCollection.push(y),i.i(r.isNullOrUndefined)(a)||(a.childRecords.push(y),this.parent.dataSource instanceof Object&&i.i(s.i)(this.parent)&&!i.i(r.isNullOrUndefined)(this.parent.taskFields.child)&&a[this.parent.taskFields.child].push(y.taskData)),"ProjectView"===this.parent.viewType)this.parent.setRecordValue("rowUniqueID",D.taskId.toString(),D,!0);else{var k=y.uniqueID.replace(this.parent.element.id+"_data_","");this.parent.setRecordValue("rowUniqueID",k,y),this.parent.setRecordValue("rowUniqueID",k,D,!0),this.parent.setRecordValue("sharedTaskUniqueIds",[],D,!0)}return this.parent.allowUnscheduledTasks&&y.ganttProperties.startDate&&(y.ganttProperties.endDate||y.ganttProperties.duration)&&(this.parent.setRecordValue("segments",this.setSegmentsInfo(y,!0),D,!0),this.parent.dataOperation.updateMappingData(y,"segments"),o||this.updateWidthLeft(y)),y},t.prototype.sortSegmentsData=function(e,t,i){var r=this;return t?e.sort(function(e,t){var i=r.parent.taskFields.startDate;return r.getDateFromFormat(e[i]).getTime()-r.getDateFromFormat(t[i]).getTime()}):e.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),e},t.prototype.setSegmentsInfo=function(e,t){var n,a=this.parent.taskFields,s=[],o=0,l=0,d=[];if(!i.i(r.isNullOrUndefined)(this.parent.taskFields.segments)&&(n=t?e.taskData[this.parent.taskFields.segments]:e.ganttProperties.segments,!i.i(r.isNullOrUndefined)(n)&&n.length>1)){this.sortSegmentsData(n,t,e.ganttProperties);for(var h=0;h<n.length;h++){var p=n[h],u=t?p[a.startDate]:p.startDate,c=t?p[a.endDate]:p.endDate,g=t?p[a.duration]:p.duration;if(u=this.getDateFromFormat(u),u=this.checkStartDate(u,e.ganttProperties,!1),i.i(r.isNullOrUndefined)(g)){if(c=this.getDateFromFormat(c),c&&(i.i(r.isNullOrUndefined)(g)||""===String(g))&&0===c.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,c),c=this.checkEndDate(c,e.ganttProperties,!1),g=this.getDuration(u,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),a.duration){if((l=e.ganttProperties.duration-o-1)<=0)continue;g=h===n.length-1?l:l>0&&g>l?l:g,c=this.getEndDate(u,g,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!a.duration&&a.endDate&&(c=!i.i(r.isNullOrUndefined)(e.ganttProperties.endDate)&&c.getTime()<e.ganttProperties.endDate.getTime()&&h!==n.length-1?c:e.ganttProperties.endDate,g=this.getDuration(u,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),s.length>0&&c.getTime()<u.getTime()&&c.getTime()<=e.ganttProperties.endDate.getTime())){s[h-1].duration=this.getDuration(s[h-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);continue}}else if(c=this.getEndDate(u,g,e.ganttProperties.durationUnit,e.ganttProperties,!1),a.duration){if((l=e.ganttProperties.duration-o)<=0)continue;g=h===n.length-1?l:l>0&&g>l?l:g,c=this.getEndDate(u,g,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!a.duration&&a.endDate&&(c=!i.i(r.isNullOrUndefined)(e.ganttProperties.endDate)&&c.getTime()>e.ganttProperties.endDate.getTime()&&h!==n.length-1?c:e.ganttProperties.endDate,g=this.getDuration(u,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),s.length>0&&c.getTime()<u.getTime()&&c.getTime()<=e.ganttProperties.endDate.getTime())){s[h-1].duration=this.getDuration(s[h-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);continue}if(p={},!(u&&c&&u&&g))break;if(o+=g,p.startDate=u,p.endDate=c,p.duration=g,p.width=0,p.left=0,p.segmentIndex=h,s.push(p),i.i(r.isNullOrUndefined)(s[h-1]))p.offsetDuration=0;else{var f=this.getDuration(s[h-1].endDate,s[h].startDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);p.offsetDuration=f,f<1&&(p.startDate=this.getEndDate(s[h-1].endDate,1,e.ganttProperties.durationUnit,e.ganttProperties,!1),p.startDate=this.checkStartDate(p.startDate,e.ganttProperties,!1),p.endDate=this.getEndDate(p.startDate,p.duration,e.ganttProperties.durationUnit,e.ganttProperties,!1),p.endDate=!a.duration&&a.endDate&&p.endDate>e.ganttProperties.endDate?e.ganttProperties.endDate:p.endDate,p.offsetDuration=1,p.duration=this.getDuration(p.startDate,p.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone))}d.push(this.setSegmentTaskData(p,n[h]))}this.parent.setRecordValue("duration",o,e.ganttProperties,!0),i.i(r.isNullOrUndefined)(s[s.length-1])||this.parent.setRecordValue("endDate",s[s.length-1].endDate,e.ganttProperties,!0),i.i(r.isNullOrUndefined)(a.endDate)||i.i(r.isNullOrUndefined)(s[s.length-1])||this.parent.setRecordValue(this.parent.taskFields.endDate,s[s.length-1].endDate,e,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,d,e)}return s.length>1?this.parent.setRecordValue("segments",s,e.ganttProperties,!0):s=null,s},t.prototype.setSegmentTaskData=function(e,t){var n=this.parent.taskFields,a=i.i(r.extend)({},{},t,!0);return i.i(r.isNullOrUndefined)(n.startDate)||(a[this.parent.taskFields.startDate]=e.startDate),i.i(r.isNullOrUndefined)(n.endDate)||(a[this.parent.taskFields.endDate]=e.endDate),i.i(r.isNullOrUndefined)(n.duration)||(a[this.parent.taskFields.duration]=Number(e.duration)),a},t.prototype.updateWorkWithDuration=function(e){var t=e.ganttProperties.resourceInfo,n=0;if(!i.i(r.isNullOrUndefined)(t)){var a=t.length,s=void 0,o=void 0,l=void 0,d=this.parent.secondsPerDay/3600,h=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit);for(s=0;s<a;s++)o=t[s][this.parent.resourceFields.unit],l=o>0?d*o/100:d,n+=l*h;"minute"===e.ganttProperties.workUnit&&(n*=60),"day"===e.ganttProperties.workUnit&&(n/=d),n%1!=0&&(n=parseFloat(n.toFixed(2)))}if(e.childRecords.length>0&&this.parent.isOnEdit){for(var p=0,u=0;u<e.childRecords.length;u++)p+=e.childRecords[u].ganttProperties.work;n+=p}this.parent.setRecordValue("work",n,e.ganttProperties,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(e,"work")},t.prototype.getCloneParent=function(e){if(i.i(r.isNullOrUndefined)(e))return null;var t={};return t.uniqueID=e.uniqueID,t.expanded=e.expanded,t.level=e.level,t.index=e.index,t.taskId=e.ganttProperties.rowUniqueID,t},t.prototype.reUpdateResources=function(){if(this.parent.flatData.length>0)for(var e=void 0,t=void 0,i=void 0,r=0;r<this.parent.flatData.length;r++)e=this.parent.flatData[r].taskData,t=this.parent.flatData[r].ganttProperties,i=this.parent.flatData[r],this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),t,!0),this.updateResourceName(i)},t.prototype.addTaskData=function(e,t,n){var s=this,o=this.parent.taskFields,l=this.parent.dataSource;if(n)if(o.parentID||l instanceof a.DataManager&&l.dataSource.json&&l.dataSource.offline)if(o.parentID){var d=t[o.id],h=this.taskIds.indexOf(d.toString()),p=h>-1?this.dataArray[h]:{};if(!i.i(r.isNullOrUndefined)(this.parent.taskFields.segmentId)){var u=this.segmentCollection.filter(function(e){return e.key===p[s.parent.taskFields.id]});u.length>0&&(p[this.parent.taskFields.segments]=u[0].items)}this.parent.setRecordValue("taskData",p,e)}else this.parent.setRecordValue("taskData",t,e);else this.parent.setRecordValue("taskData",t,e);else this.parent.setRecordValue("taskData",t,e)},t.prototype.updateExpandStateMappingValue=function(e,t){var n,a=this.parent.taskFields.expandState,s=t[a];a&&e.hasChildRecords&&(i.i(r.isNullOrUndefined)(s)?i.i(r.isNullOrUndefined)(s)&&!this.parent.collapseAllParentTasks?n=!0:i.i(r.isNullOrUndefined)(s)&&this.parent.collapseAllParentTasks&&(n=!1):n="true"===s.toString(),this.parent.setRecordValue("taskData."+a,n,e),this.parent.setRecordValue(a,n,e),this.parent.setRecordValue("expanded",n,e))},t.prototype.setValidatedDates=function(e,t){var n=e.ganttProperties,a=this.parent.taskFields,s=t[a.duration],o=this.getDateFromFormat(t[a.startDate],!0),l=this.getDateFromFormat(t[a.endDate],!0);s=i.i(r.isNullOrUndefined)(s)||""===s?null:s,this.parent.setRecordValue("startDate",new Date(o.getTime()),n,!0),i.i(r.isNullOrUndefined)(s)||""===s?this.calculateDuration(e):this.updateDurationValue(s,n),this.parent.setRecordValue("endDate",new Date(l.getTime()),n,!0)},t.prototype.calculateScheduledValues=function(e,t,n){var a=this.parent.taskFields,s=e.ganttProperties,o=t[a.duration];o=i.i(r.isNullOrUndefined)(o)||""===o?null:o;var l,d;s.startDate&&s.endDate?(l=this.getDateFromFormat(s.startDate,!0),d=this.getDateFromFormat(s.endDate,!0)):(l=this.getDateFromFormat(t[a.startDate],!0),d=this.getDateFromFormat(t[a.endDate],!0));var h=a.segments?t[a.segments]||e.taskData[a.segments]:null,p=!!a.milestone&&!!t[a.milestone],u=t[a.durationUnit]?t[a.durationUnit]:"";this.parent.setRecordValue("durationUnit",this.validateDurationUnitMapping(u),s,!0);var c=i.i(r.isNullOrUndefined)(t[a.work])?0:parseFloat(t[a.work]);this.parent.setRecordValue("workUnit",this.validateWorkUnitMapping(this.parent.workUnit),s,!0);var g=t[a.type]?t[a.type]:"",f=this.validateTaskTypeMapping(g);if(this.parent.setRecordValue("taskType",f,s,!0),n&&!this.parent.enableValidation&&l&&d)this.setValidatedDates(e,t);else if(d||l||!i.i(r.isNullOrUndefined)(o)&&""!==o)l?this.calculateDateFromStartDate(l,d,o,e,n):d?this.calculateDateFromEndDate(d,o,e):i.i(r.isNullOrUndefined)(o)||""===o||(this.updateDurationValue(o,s),this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,s,!0),this.parent.setRecordValue("endDate",null,s,!0)):(this.parent.setRecordValue("startDate",this.getProjectStartDate(s,n),s,!0),this.calculateEndDate(e)));else{if(this.parent.allowUnscheduledTasks)return;this.parent.setRecordValue("duration",1,s,!0),this.parent.setRecordValue("startDate",this.getProjectStartDate(s,n),s,!0),this.calculateEndDate(e)}if(this.parent.autoCalculateDateScheduling||(i.i(r.isNullOrUndefined)(e.ganttProperties.startDate)||(e[this.parent.taskFields.startDate]=e.ganttProperties.startDate,e.taskData[this.parent.taskFields.startDate]=e.ganttProperties.startDate),i.i(r.isNullOrUndefined)(e.ganttProperties.endDate)||(e[this.parent.taskFields.endDate]=e.ganttProperties.endDate,e.taskData[this.parent.taskFields.endDate]=e.ganttProperties.endDate)),i.i(r.isNullOrUndefined)(h)||this.parent.setRecordValue("segments",this.setSegmentsInfo(e,!0),s,!0),0===s.duration&&(this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0)),!i.i(r.isNullOrUndefined)(p)&&p&&(this.parent.setRecordValue("duration",0,s,!0),this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0)),i.i(r.isNullOrUndefined)(a.work))a.type&&s.taskType&&this.parent.dataOperation.updateMappingData(e,"type");else{if(this.parent.setRecordValue("durationUnit",this.parent.durationUnit,s,!0),isNaN(c)||i.i(r.isNullOrUndefined)(c))this.parent.setRecordValue("work",0,s,!0),this.parent.setRecordValue("duration",0,s,!0),this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0);else{switch(this.parent.setRecordValue("work",c,s,!0),f){case"FixedDuration":case"FixedWork":this.updateUnitWithWork(e);break;case"FixedUnit":this.updateDurationWithWork(e)}i.i(r.isNullOrUndefined)(a.type)||this.parent.dataOperation.updateMappingData(e,"type"),0===s.duration?(this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0)):i.i(r.isNullOrUndefined)(s.startDate)||i.i(r.isNullOrUndefined)(s.duration)||(this.parent.setRecordValue("isMilestone",!1,s,!0),this.calculateEndDate(e))}this.parent.dataOperation.updateMappingData(e,"work")}},t.prototype.updateDurationWithWork=function(e){var t=e.ganttProperties,n=t.resourceInfo;if(!i.i(r.isNullOrUndefined)(n)){var a=i.i(r.isNullOrUndefined)(n)?0:n.length,s=0,o=this.parent.secondsPerDay/3600,l=0,d=void 0,h=void 0;for(h=0;h<a;h++)d=n[h][this.parent.resourceFields.unit],s+=d>0?o*d/100:o;var p=this.getWorkInHour(t.work,t.workUnit);a>0&&(l+=p/s),"minute"===t.durationUnit&&(l=l*o*60),"hour"===t.durationUnit&&(l*=o),l%1!=0&&(l=parseFloat(l.toFixed(2))),i.i(r.isNullOrUndefined)(t.duration)||this.parent.setRecordValue("duration",l,t,!0),this.parent.dataOperation.updateMappingData(e,"duration")}},t.prototype.updateUnitWithWork=function(e){var t=e.ganttProperties,n=t.resourceInfo,a=i.i(r.isNullOrUndefined)(n)?0:n.length,s=this.parent.secondsPerDay/3600;if(0!==a){var o=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit),l=this.getWorkInHour(t.work,t.workUnit),d=o>0?l/(o*s)*100:0,h=d>0?d/a:100;h%1!=0&&(h=parseFloat(h.toFixed(2)));for(var p=0;p<a;p++)n[p][this.parent.resourceFields.unit]=h;this.updateResourceName(e)}},t.prototype.calculateDateFromEndDate=function(e,t,n){var a=n.ganttProperties;0===e.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,e);var s=0===parseInt(t,10)||null;this.parent.setRecordValue("endDate",this.checkEndDate(e,n.ganttProperties,s),a,!0),i.i(r.isNullOrUndefined)(t)||""===t?this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,a,!0),this.parent.setRecordValue("duration",null,a,!0)):(this.parent.setRecordValue("duration",1,a,!0),this.parent.setRecordValue("startDate",this.getStartDate(a.endDate,a.duration,a.durationUnit,a),a,!0)):i.i(r.isNullOrUndefined)(t)||""===t||(this.updateDurationValue(t,a),this.parent.setRecordValue("startDate",this.getStartDate(a.endDate,a.duration,a.durationUnit,a),a,!0))},t.prototype.calculateDateFromStartDate=function(e,t,n,a,s){var o=a.ganttProperties,l=!!(0===parseInt(n,10)||e&&t&&new Date(e.getTime())===new Date(t.getTime()))||null;this.parent.setRecordValue("startDate",this.checkStartDate(e,o,l,s),o,!0),this.parent.isTreeGridRendered&&a&&this.updateTaskData(a),t||!i.i(r.isNullOrUndefined)(n)&&""!==n?i.i(r.isNullOrUndefined)(n)||t?t&&(i.i(r.isNullOrUndefined)(n)||""===n)?(0===t.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,t),this.parent.setRecordValue("endDate",this.checkEndDate(t,a.ganttProperties),o,!0),1===this.compareDates(o.startDate,o.endDate)?(this.parent.setRecordValue("endDate",o.startDate,o,!0),this.parent.setRecordValue("isMilestone",!0,o,!0),this.parent.setRecordValue("duration",0,o,!0)):this.calculateDuration(a)):(this.updateDurationValue(n,o),this.parent.autoCalculateDateScheduling?this.calculateEndDate(a):this.parent.setRecordValue("endDate",t,o,!0)):(this.updateDurationValue(n,o),this.calculateEndDate(a)):this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("endDate",null,o,!0),this.parent.setRecordValue("duration",null,o,!0)):(this.parent.setRecordValue("duration",1,o,!0),this.calculateEndDate(a))},t.prototype.getProgressWidth=function(e,t){return e*t/100},t.prototype.calculateWidth=function(e,t){var n=e.ganttProperties,a=t?n.autoStartDate:n.startDate,s=t?n.autoEndDate:n.endDate;return i.i(r.isNullOrUndefined)(a)&&i.i(r.isNullOrUndefined)(s)&&(a=this.getValidStartDate(n,t),s=this.getValidEndDate(n,t)),i.i(r.isNullOrUndefined)(a)||i.i(r.isNullOrUndefined)(s)?3:!n.isMilestone||e.hasChildRecords&&!n.isAutoSchedule?this.getTaskWidth(a,s,n):0},t.prototype.getTaskbarHeight=function(){var e=this.parent.rowHeight,t=this.parent.taskbarHeight;return t<e?t:e},t.prototype.calculateLeft=function(e,t){var n=null,a=-300,s=t?e.autoStartDate:e.startDate,o=t?e.autoEndDate:e.endDate,l=(t?e.autoDuration:e.duration,e.isMilestone);return s?n=new Date(s.getTime()):o?(n=new Date(o.getTime()),l=!i.i(r.isNullOrUndefined)(s)||!this.parent.allowUnscheduledTasks):n=this.getValidStartDate(e),i.i(r.isNullOrUndefined)(n)||(a=this.getTaskLeft(n,l)),a},t.prototype.calculateAutoLeft=function(e){return this.getTaskLeft(e.autoStartDate,e.isMilestone)},t.prototype.calculateAutoDuration=function(e){return this.getDuration(e.autoStartDate,e.autoEndDate,e.durationUnit,!1,e.isMilestone)},t.prototype.calculateAutoWidth=function(e){return this.getTaskWidth(e.autoStartDate,e.autoEndDate)},t.prototype.calculateBaselineLeft=function(e){var t=this.getDateFromFormat(e.baselineStartDate),i=this.getDateFromFormat(e.baselineEndDate);return t&&i?this.getTaskLeft(t,e.isMilestone):0},t.prototype.calculateBaselineWidth=function(e){var t=this.getDateFromFormat(e.baselineStartDate),i=this.getDateFromFormat(e.baselineEndDate);return t&&i&&t.getTime()!==i.getTime()?this.getTaskWidth(t,i):0},t.prototype.getTaskWidth=function(e,t,n){var a=new Date(e.getTime()),s=new Date(t.getTime()),o="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,l=!1,d=new Date(e.getTime()),h=0;i.i(r.isNullOrUndefined)(n)||"hour"!=n.durationUnit||(d=new Date(d.getTime()+60*n.duration*60*1e3)),(!i.i(r.isNullOrUndefined)(n)&&"minute"==n.durationUnit||!i.i(r.isNullOrUndefined)(n)&&"day"==n.durationUnit&&n.duration<1)&&(d=new Date(d.getTime()+60*n.duration*1e3));for(var p=0;p<this.parent.dayWorkingTime.length;p++)h=h+this.parent.dayWorkingTime[p].to-this.parent.dayWorkingTime[p].from;var u=d.getTime()-a.getTime();return!i.i(r.isNullOrUndefined)(n)&&"minute"==n.durationUnit&&n.duration<60*h||!i.i(r.isNullOrUndefined)(n)&&"day"==n.durationUnit&&n.duration<1?("Day"===o?((Math.floor(u/36e5%24)>=h||0===u)&&(l=!0),this.getSecondsInDecimal(a)===this.parent.defaultStartTime&&l&&a.setHours(0,0,0,0),this.getSecondsInDecimal(s)===this.parent.defaultEndTime&&s.setHours(24),this.getSecondsInDecimal(s)===this.parent.defaultStartTime&&s.setHours(0,0,0,0)):l=!0,a.getTime()===s.getTime()?this.parent.perDayWidth:l?this.getTimeDifference(a,s)/864e5*this.parent.perDayWidth:this.getTimeDifference(a,s)/(36e5*h)*this.parent.perDayWidth):("Day"===o&&(this.getSecondsInDecimal(a)===this.parent.defaultStartTime&&a.setHours(0,0,0,0),this.getSecondsInDecimal(s)===this.parent.defaultEndTime&&s.setHours(24),this.getSecondsInDecimal(s)===this.parent.defaultStartTime&&s.setHours(0,0,0,0)),a.getTime()===s.getTime()?this.parent.perDayWidth:this.getTimeDifference(a,s)/864e5*this.parent.perDayWidth)},t.prototype.getTaskLeft=function(e,t){var i=new Date(e.getTime());"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(this.getSecondsInDecimal(i)===this.parent.defaultStartTime?i.setHours(0,0,0,0):t&&this.getSecondsInDecimal(i)===this.parent.defaultEndTime?i.setHours(24):this.getSecondsInDecimal(i)===this.parent.defaultEndTime&&this.parent.allowUnscheduledTasks&&i.setHours(22));var r=this.parent.timelineModule.timelineStartDate;return r?(i.getTime()-r.getTime())/864e5*this.parent.perDayWidth:0},t.prototype.getSplitTaskWidth=function(e,t,i){var r=new Date(e.getTime()),n=new Date(this.getEndDate(r,t,i.ganttProperties.durationUnit,i.ganttProperties,!1).getTime());return"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(this.getSecondsInDecimal(r)===this.parent.defaultStartTime&&r.setHours(0,0,0,0),this.getSecondsInDecimal(n)===this.parent.defaultEndTime&&n.setHours(24),this.getSecondsInDecimal(n)===this.parent.defaultStartTime&&n.setHours(0,0,0,0)),this.getTimeDifference(r,n)/864e5*this.parent.perDayWidth},t.prototype.getSplitTaskLeft=function(e,t){var i=new Date(e.getTime());return"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(this.getSecondsInDecimal(i)===this.parent.defaultStartTime&&i.setHours(0,0,0,0),this.getSecondsInDecimal(t)===this.parent.defaultStartTime&&t.setHours(0,0,0,0)),t?(i.getTime()-t.getTime())/864e5*this.parent.perDayWidth:0},t.prototype.updateMappingData=function(e,t){var n=this.parent.columnMapping,a=e.ganttProperties;if(!i.i(r.isNullOrUndefined)(n[t])||"taskType"===t||"segments"===t)if("predecessorName"===t);else if("resourceInfo"===t){var s=a.resourceInfo,o=this.parent.resourceFields,l=[],d=[];if(!i.i(r.isNullOrUndefined)(s))for(var h=0;h<s.length;h++){l.push(s[h][o.id]);var p=s[h][o.name],u=s[h][o.unit];100!==u&&(p+="["+u+"%]"),d.push(p)}this.parent.setRecordValue("resourceNames",d.join(","),a,!0),this.updateTaskDataResource(e),this.parent.setRecordValue(n[t],d.join(","),e)}else"startDate"===t||"endDate"===t?this.setRecordDate(e,a[t],n[t]):"duration"===t?this.setRecordDuration(e,n[t]):"work"===t?(this.parent.setRecordValue("taskData."+n[t],this.getWorkString(a.work,a.workUnit),e),this.parent.setRecordValue(n[t],a[t],e)):"type"===t?(this.parent.setRecordValue("taskData."+n[t],a[t],e),this.parent.setRecordValue(n[t],a[t],e)):"manual"===t?(this.parent.setRecordValue("taskData."+n[t],!a.isAutoSchedule,e),this.parent.setRecordValue(n[t],!a.isAutoSchedule,e)):"segments"===t?this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,this.segmentTaskData(e),e):(this.parent.setRecordValue("taskData."+n[t],a[t],e),this.parent.setRecordValue(n[t],a[t],e))},t.prototype.segmentTaskData=function(e){var t=e.ganttProperties.segments,n=this.parent.taskFields;if(i.i(r.isNullOrUndefined)(t))return null;for(var a=i.i(r.extend)([],[],e.taskData[n.segments],!0),s=0;s<t.length;s++)(this.parent.isEdit||this.parent.editModule&&this.parent.editModule.dialogModule&&i.i(r.getValue)("isEdit",this.parent.editModule.dialogModule)||this.parent.contextMenuModule&&i.i(r.getValue)("isEdit",this.parent.contextMenuModule))&&(a[s]={}),i.i(r.isNullOrUndefined)(n.startDate)||(a[s][this.parent.taskFields.startDate]=t[s].startDate),i.i(r.isNullOrUndefined)(n.endDate)||(a[s][this.parent.taskFields.endDate]=t[s].endDate),i.i(r.isNullOrUndefined)(n.duration)||(a[s][this.parent.taskFields.duration]=Number(t[s].duration));return a},t.prototype.updateTaskDataResource=function(e){var t=e.ganttProperties.resourceInfo,n=e.taskData[this.parent.taskFields.resourceInfo],a=this.parent.resourceFields;if(i.i(r.isNullOrUndefined)(n))e.taskData[this.parent.taskFields.resourceInfo]=t;else if(t.length){for(var s=0;s<t.length;s++){for(var o=!1,l=0;l<n.length;l++)if("number"==typeof n[l]||"string"==typeof n[l]){if(parseInt(n[l],10)===parseInt(t[s][a.id],10)){n[l]=t[s],o=!0;break}}else if(n[l][a.id]===t[s][a.id]&&"number"!=typeof n[l]){n[l]=i.i(r.extend)({},n[l],t[s],!0),o=!0;break}o||n.push(t[s])}for(var d=[],h=0;h<n.length;h++)!function(e){t.filter(function(t){t[a.id]===n[e][a.id]&&-1===d.indexOf(n[e])&&d.push(n[e])})}(h);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,d,e)}else this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e)},t.prototype.setRecordDate=function(e,t,n){var a="string"==typeof t?new Date(t):t;i.i(r.isNullOrUndefined)(t)||(t=new Date(a.getTime())),this.parent.setRecordValue(n,t,e),i.i(r.isNullOrUndefined)(t)||(t=new Date(a.getTime())),this.parent.isLoad||this.parent.isDynamicData||this.parent.setRecordValue("taskData."+n,t,e),this.parent.isDynamicData=!1},t.prototype.getDurationInDay=function(e,t){return"day"===t?e:"hour"===t?e/(this.parent.secondsPerDay/3600):e/(this.parent.secondsPerDay/60)},t.prototype.setRecordDuration=function(e,t){var n=e.ganttProperties.duration,a=e.ganttProperties.durationUnit;if(i.i(r.isNullOrUndefined)(n))this.parent.setRecordValue(t,n,e),this.parent.setRecordValue("taskData."+t,n,e);else{this.parent.setRecordValue(t,e.ganttProperties.duration,e);var s=i.i(r.getValue)(t,e.taskData);isNaN(s)&&i.i(r.isNullOrUndefined)(this.parent.taskFields.durationUnit)&&!i.i(r.isNullOrUndefined)(s)?this.parent.setRecordValue("taskData."+t,this.getDurationString(n,a),e):"string"==typeof s?this.parent.setRecordValue("taskData."+t,n.toString(),e):this.parent.setRecordValue("taskData."+t,n,e)}this.parent.taskFields.durationUnit&&(e.taskData[this.parent.taskFields.durationUnit]=e.ganttProperties.durationUnit)},t.prototype.setDataSource=function(e){for(var t=[],n=e.length,a=0;a<n;a++){var s=e[a];t.push(s),i.i(r.isNullOrUndefined)(e[a][this.parent.taskFields.child])||this.setDataSource(e[a][this.parent.taskFields.child])}return t},t.prototype.setStartDate=function(e){var t=this,n=[];n=i.i(r.isNullOrUndefined)(this.parent.taskFields.parentID)||i.i(r.isNullOrUndefined)(this.parent.taskFields.id)?this.parent.dataSource:this.setDataSource(this.parent.dataSource),n.map(function(n){e.ganttProperties.taskId===n[t.parent.taskFields.id]&&(i.i(r.isNullOrUndefined)(t.parent.taskFields.startDate)||(e[t.parent.taskFields.startDate]=n[t.parent.taskFields.startDate]),i.i(r.isNullOrUndefined)(t.parent.taskFields.endDate)||(e[t.parent.taskFields.endDate]=n[t.parent.taskFields.endDate]))})},t.prototype.getWorkInHour=function(e,t){return"day"===t?e*(this.parent.secondsPerDay/3600):"minute"===t?e/60:e},t.prototype.updateTaskData=function(e){var t=this.parent.taskFields,n=e.ganttProperties;if(!i.i(r.isNullOrUndefined)(e.taskData)){var a=e.taskData;if(t.id&&(this.parent.setRecordValue("taskData."+t.id,n.taskId,e),this.parent.setRecordValue(t.id,n.taskId,e)),t.name&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.name,n.taskName,e),this.parent.setRecordValue(t.name,n.taskName,e)),t.startDate&&this.setRecordDate(e,n.startDate,t.startDate),t.endDate&&this.setRecordDate(e,n.endDate,t.endDate),t.duration&&(i.i(r.isNullOrUndefined)(t.milestone)||e.taskData[t.milestone]||this.setRecordDuration(e,t.duration)),t.durationUnit&&(a[t.durationUnit]=n.durationUnit),t.progress&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.progress,n.progress,e),this.parent.setRecordValue(t.progress,n.progress,e)),t.baselineStartDate&&this.setRecordDate(e,n.baselineStartDate,t.baselineStartDate),t.baselineEndDate&&this.setRecordDate(e,n.baselineEndDate,t.baselineEndDate),t.notes&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.notes,n.notes,e),this.parent.setRecordValue(t.notes,n.notes,e)),t.cssClass&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.cssClass,n.cssClass,e),this.parent.setRecordValue(t.cssClass,n.cssClass,e)),t.indicators&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.indicators,n.indicators,e),this.parent.setRecordValue(t.indicators,n.indicators,e)),t.parentID){var s="ProjectView"===this.parent.viewType?n.parentId:a[t.parentID];this.parent.setRecordValue("taskData."+t.parentID,s,e),this.parent.setRecordValue(t.parentID,n.parentId,e)}t.work&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.work,this.getWorkString(n.work,n.workUnit),e),this.parent.setRecordValue(t.work,n.work,e)),t.type&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.type,n.taskType,e),this.parent.setRecordValue(t.type,n.taskType,e))}},t.prototype.setResourceInfo=function(e){var t;if(i.i(r.isNullOrUndefined)(e[this.parent.taskFields.resourceInfo]))return t;t=e[this.parent.taskFields.resourceInfo];var n;n=i.i(r.isNullOrUndefined)(this.parent.editModule)||i.i(r.isNullOrUndefined)(this.parent.editModule.dialogModule)||!this.parent.editModule.dialogModule.isAddNewResource?this.parent.resources:this.parent.editModule.dialogModule.ganttResources;for(var a=this.parent.resourceFields.id,s=this.parent.resourceFields.unit,o=this.parent.resourceFields.group,l=[],d=0;d<t.length;d++)!function(e){var d=n.filter(function(i){return"object"==typeof t[e]&&t[e][a]===i[a]||t[e]===i[a]}),h=i.i(r.extend)({},d[0]);l.push(h),i.i(r.isNullOrUndefined)(s)||i.i(r.isNullOrUndefined)(t[e][s])||(h[s]=t[e][s]),i.i(r.isNullOrUndefined)(o)||i.i(r.isNullOrUndefined)(t[e][o])||(h[o]=t[e][o])}(d);return this.updateResourceUnit(l),l},t.prototype.updateResourceUnit=function(e){var t=this.parent.resourceFields.unit;if(!i.i(r.isNullOrUndefined)(t)){var n=e.length,a=void 0;for(a=0;a<n;a++)i.i(r.isNullOrUndefined)(e[a][t])&&(e[a][t]=100)}},t.prototype.updateResourceName=function(e){var t=e.ganttProperties.resourceInfo,n=[],a=this.parent.taskFields;if(t){var s=t.length,o=i.i(r.extend)([],[],e.taskData[this.parent.taskFields.resourceInfo],!0);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e);for(var l=0;l<s;l++){var d=t[l],h=d[this.parent.resourceFields.name],p=d[this.parent.resourceFields.unit];if(100!==p&&(h+="["+p+"%]"),i.i(r.isNullOrUndefined)(h)||n.push(h),e.taskData){var u=a.resourceInfo;o[l],e.taskData[u].push(o[l])}}this.parent.setRecordValue("resourceNames",n.join(","),e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.resourceInfo,n.join(","),e,!0),this.updateTaskDataResource(e)}},t.prototype.dataReorder=function(e,t){for(var i=[];e.length>0&&t.length>0;){var r=t.indexOf(e[0]);-1===r?e.shift():(i.push(e.shift()),t.splice(r,1))}return i},t.prototype.validateDurationUnitMapping=function(e){var t=e;return t="minute"===t||"minutes"===t||"m"===t||"min"===t?"minute":"hour"===t||"hours"===t||"h"===t||"hr"===t?"hour":"day"===t||"days"===t||"d"===t?"day":this.parent.durationUnit.toLocaleLowerCase()},t.prototype.validateTaskTypeMapping=function(e){var t=e;return t="FixedDuration"===t?"FixedDuration":"FixedUnit"===t?"FixedUnit":"FixedWork"===t?"FixedWork":this.parent.taskType},t.prototype.validateWorkUnitMapping=function(e){var t=e;return t="minute"===t?"minute":"hour"===t?"hour":"day"===t?"day":this.parent.workUnit.toLocaleLowerCase()},t.prototype.updateDurationValue=function(e,t){var n=this.getDurationValue(e);isNaN(i.i(r.getValue)("duration",n))||"ResourceView"===this.parent.viewType&&0===n.duration||this.parent.setRecordValue("duration",i.i(r.getValue)("duration",n),t,!0),i.i(r.isNullOrUndefined)(i.i(r.getValue)("durationUnit",n))||this.parent.setRecordValue("durationUnit",i.i(r.getValue)("durationUnit",n),t,!0)},t.prototype.reUpdateGanttData=function(){if(this.parent.flatData.length>0){var e=void 0,t=void 0;this.parent.secondsPerDay=this.getSecondsPerDay();for(var n=0;n<this.parent.flatData.length;n++)e=this.parent.flatData[n].taskData,t=this.parent.flatData[n],i.i(r.isNullOrUndefined)(this.parent.taskFields.duration)||this.setRecordDuration(t,this.parent.taskFields.duration),this.parent.isLoad&&this.setStartDate(t),this.calculateScheduledValues(t,e,!1);this.updateGanttData()}},t.prototype._isInStartDateRange=function(e,t,i){var r=!1;return e.getTime()>=t.getTime()&&e.getTime()<i.getTime()&&(r=!0),r},t.prototype._isInEndDateRange=function(e,t,i){var r=!1;return e.getTime()>t.getTime()&&e.getTime()<=i.getTime()&&(r=!0),r},t.prototype.updateOverlappingValues=function(e){var t,i=e.childRecords,r=[];if(i.length<=1)return void(e.ganttProperties.workTimelineRanges=[]);i=this.setSortedChildTasks(e),this.updateOverlappingIndex(i);for(var n=1;n<i.length;n++){t=i[n];for(var a=new Date(t.ganttProperties.startDate.getTime()),s=new Date(t.ganttProperties.endDate.getTime()),o=[],l=0;l<n;l++){var d=i[l].ganttProperties.startDate,h=i[l].ganttProperties.endDate,p={};(this._isInStartDateRange(a,d,h)||this._isInEndDateRange(s,d,h))&&(d.getTime()>a.getTime()&&d.getTime()<s.getTime()&&h.getTime()>a.getTime()&&h.getTime()>=s.getTime()||a.getTime()===d.getTime()&&s.getTime()<=h.getTime()?(p.from=d,p.to=s):a.getTime()===d.getTime()&&s.getTime()>h.getTime()?(p.from=d,p.to=h):a.getTime()>d.getTime()&&s.getTime()>=h.getTime()?(p.from=a,p.to=h):a.getTime()>d.getTime()&&s.getTime()<h.getTime()&&(p.from=a,p.to=s),o.push(p))}r.push.apply(r,this.mergeRangeCollections(o))}this.parent.setRecordValue("workTimelineRanges",this.mergeRangeCollections(r,!0),e.ganttProperties,!0),this.calculateRangeLeftWidth(e.ganttProperties.workTimelineRanges)},t.prototype.updateOverlappingIndex=function(e){for(var t=0;t<e.length;t++)e[t].ganttProperties.eOverlapIndex=t},t.prototype.calculateRangeLeftWidth=function(e){for(var t=0;t<e.length;t++)e[t].left=this.getTaskLeft(e[t].from,!1),e[t].width=this.getTaskWidth(e[t].from,e[t].to)},t.prototype.mergeRangeCollections=function(e,t){for(var i,r,n,s,o=[],l={},d={},h=new a.DataManager(e).executeLocal((new a.Query).sortBy(this.parent.taskFields.startDate,"Ascending")),p=0;p<h.length;p++)0!==o.length||0!==p?(l=o[o.length-1],i=l.from,r=l.to,d=h[p],n=d.from,s=d.to,i.getTime()===n.getTime()&&r.getTime()>=s.getTime()||i.getTime()<n.getTime()&&r.getTime()>=s.getTime()||(i.getTime()<=n.getTime()&&r.getTime()>=n.getTime()&&r.getTime()<s.getTime()||r.getTime()<n.getTime()&&this.checkStartDate(r).getTime()===n.getTime()?l.to=s:r.getTime()<n.getTime()&&this.checkStartDate(r).getTime()!==n.getTime()&&o.push(h[p]))):o.push(h[p]);return t&&(o=this.splitRangeCollection(o)),o},t.prototype.setSortedChildTasks=function(e){return new a.DataManager(e.childRecords).executeLocal((new a.Query).sortBy(this.parent.taskFields.startDate,"Ascending"))},t.prototype.splitRangeCollection=function(e,t,i){var r;return r=this.parent.timelineModule.isSingleTier?"None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier,"Week"===r||"Month"===r||"Year"===r?e:"Day"===r?this.getRangeWithWeek(e,t,i):0===this.parent.workingTimeRanges[0].from&&86400===this.parent.workingTimeRanges[0].to?this.getRangeWithWeek(e,t,i):this.getRangeWithDay(e,t,i)},t.prototype.getRangeWithDay=function(e,t,i){for(var r=[],n=0;n<e.length;n++)r.push.apply(r,this.splitRangeForDayMode(e[n],t,i));return r},t.prototype.splitRangeForDayMode=function(e,t,n){var a=t||"from",s=n||"to",o=new Date(e[a]),l=new Date(e[s]),d=[],h={};if(o.getTime()<l.getTime())do{for(var p=new Date(o.getTime()),u=new Date(o.getTime()),c=0,g=this.parent.dataOperation.getSecondsInDecimal(o),f=-1,m=0;m<this.parent.workingTimeRanges.length;m++){var y=this.parent.workingTimeRanges[m];if(g>=y.from&&g<=y.to){f=m;break}}-1!==f&&(c=Math.round(this.parent.workingTimeRanges[f].to-g),u.setSeconds(u.getSeconds()+c));u.getTime()<l.getTime()?(h={},e.task&&(h.task=i.i(r.extend)([],e.task)),h[a]=p,h[s]=u,h.isSplit=!0,d.push(h)):(h={},e.task&&(h.task=i.i(r.extend)([],e.task)),h[a]=p,h[s]=l,h.isSplit=!0,d.push(h)),o=this.checkStartDate(u)}while(o.getTime()<l.getTime());else d.push(e);return d},t.prototype.getRangeWithWeek=function(e,t,i){for(var r=[],n=0;n<e.length;n++)r.push.apply(r,this.splitRangeForWeekMode(e[n],t,i));return r},t.prototype.splitRangeForWeekMode=function(e,t,n){var a=t||"from",s=n||"to",o=new Date(e[a]),l=new Date(e[a]),d=new Date(e[s]),h=!1,p=[],u={};if(l.setDate(l.getDate()+1),l.getTime()<d.getTime()){do{if(this.parent.dataOperation.isOnHolidayOrWeekEnd(l,null)){var c=new Date(l.getTime());c.setDate(l.getDate()-1),this.setTime(this.parent.defaultEndTime,c),u={},u[a]=o,u.isSplit=!0,u[s]=c,e.task&&(u.task=i.i(r.extend)([],e.task,!0)),o.getTime()!==c.getTime()&&p.push(u),o=this.checkStartDate(c),l=new Date(o.getTime()),h=!0}else l.setDate(l.getDate()+1)}while(l.getTime()<d.getTime());h?o.getTime()!==d.getTime()&&(u={},e.task&&(u.task=i.i(r.extend)([],e.task,!0)),u[a]=o,u[s]=d,u.isSplit=!0,p.push(u)):p.push(e)}else p.push(e);return p},t.prototype.updateGanttData=function(){for(var e=this.parent.flatData,t=e.length,i=0;i<t;i++){var r=e[i];this.updateTaskLeftWidth(r)}},t.prototype.updateTaskLeftWidth=function(e){var t=e.ganttProperties;e.hasChildRecords&&this.parent.autoCalculateDateScheduling||this.updateWidthLeft(e),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(t),t,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(t),t,!0);var i,r=[];e.parentItem&&(i=this.parent.getParentTask(e.parentItem),r=i.childRecords),i&&r.indexOf(e)===r.length-1&&!e.hasChildRecords&&this.parent.enableValidation?((this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType)&&this.updateParentItems(i),this.parent.autoCalculateDateScheduling||this.updateWidthLeft(i)):i&&!this.parent.enableValidation&&this.updateWidthLeft(i)},t.prototype.reUpdateGanttDataPosition=function(){var e;e=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.flatData;for(var t=e.length,i=0;i<t;i++){var r=e[i],n=r.ganttProperties;this.updateWidthLeft(r),"Auto"!==this.parent.taskMode&&r.hasChildRecords&&this.updateAutoWidthLeft(r),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(n),n,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(n),n,!0),this.parent.dataOperation.updateTaskData(r)}},t.prototype.updateWidthLeft=function(e){var t=e.ganttProperties;if(!i.i(r.isNullOrUndefined)(t.segments)&&t.segments.length>0){for(var n=t.segments,a=!0,s=this.splitTasksDuration(n)*("Hour"===this.parent.timelineModule.bottomTier||"Minutes"===this.parent.timelineModule.bottomTier?this.parent.timelineSettings.timelineUnitSize:this.parent.perDayWidth),o=this.parent.dataOperation.getProgressWidth(s,t.progress),l=0;l<n.length;l++){var d=n[l];if(0===l&&!i.i(r.isNullOrUndefined)(t.startDate)&&d.startDate.getTime()!==t.startDate.getTime()){d.startDate=t.startDate;var h=this.parent.dataOperation.getEndDate(d.startDate,d.duration,t.durationUnit,t,!1);d.endDate=this.parent.dataOperation.checkEndDate(h,t,!1),this.parent.chartRowsModule.incrementSegments(n,0,e)}if(d.width=this.getSplitTaskWidth(d.startDate,d.duration,e),d.showProgress=!1,d.progressWidth=-1,0!==l){var p=new Date(t.startDate.getTime());d.left=this.getSplitTaskLeft(d.startDate,p)}o>0&&o>d.width?(o-=d.width,d.progressWidth=d.width,d.showProgress=!1):a&&(d.progressWidth=o,d.showProgress=!0,o-=d.width,a=!1)}this.parent.setRecordValue("segments",t.segments,t,!0),this.parent.dataOperation.updateMappingData(e,"segments")}this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e),t,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(t),t,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.isAutoSchedule||!e.hasChildRecords?t.width:t.autoWidth,t.progress),t,!0)},t.prototype.updateAutoWidthLeft=function(e){var t=e.ganttProperties;this.parent.setRecordValue("autoWidth",this.calculateWidth(e,!0),t,!0),this.parent.setRecordValue("autoLeft",this.calculateLeft(t,!0),t,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.isAutoSchedule||!e.hasChildRecords?t.width:t.autoWidth,t.progress),t,!0)},t.prototype.getParentProgress=function(e){var t=0,n={};switch(e.ganttProperties.durationUnit){case"hour":t=e.ganttProperties.duration/(this.parent.secondsPerDay/3600);break;case"minute":t=e.ganttProperties.duration/(this.parent.secondsPerDay/60);break;default:t=e.ganttProperties.duration}return e.hasChildRecords?(i.i(r.setValue)("totalProgress",e.ganttProperties.totalProgress,n),i.i(r.setValue)("totalDuration",e.ganttProperties.totalDuration?e.ganttProperties.totalDuration:0,n)):(i.i(r.setValue)("totalProgress",e.ganttProperties.progress*t,n),i.i(r.setValue)("totalDuration",t,n)),n},t.prototype.resetDependency=function(e){var t=this.parent.taskFields.dependency;if(!i.i(r.isNullOrUndefined)(t)){var n=e.ganttProperties;this.parent.setRecordValue("predecessor",[],n,!0),this.parent.setRecordValue("predecessorsName",null,n,!0),this.parent.setRecordValue("taskData."+t,null,e),this.parent.setRecordValue(t,null,e)}},t.prototype.updateParentItems=function(e,t){var n=this,a=t?e:this.parent.getParentTask(e),o=!1,l=a.ganttProperties;if(this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType){if(a.childRecords.length>0){for(var d=l.isAutoSchedule?l.startDate:l.autoStartDate,h=l.isAutoSchedule?l.endDate:l.autoEndDate,p=a.childRecords,u=p.length,c=0,g={},f=null,m=null,y=0,D=0,v=0,w=void 0,k=this,b=0;b<u;b++)!function(e){if(w=!k.parent.loadChildOnDemand&&k.parent.taskFields.hasChildMapping?k.parent.currentViewData.filter(function(t){return t.ganttProperties.taskId===p[e][n.parent.taskFields.id]})[0]:p[e],k.parent.isOnDelete&&w.isDelete)return 1===u&&"ProjectView"===k.parent.viewType&&(o=!0),"continue";var t=k.getValidStartDate(w.ganttProperties);!a.hasChildRecords||l.isAutoSchedule||i.i(r.isNullOrUndefined)(w.ganttProperties.autoStartDate)||(t=w.ganttProperties.autoStartDate);var d=k.getValidEndDate(w.ganttProperties);!a.hasChildRecords||l.isAutoSchedule||i.i(r.isNullOrUndefined)(w.ganttProperties.autoEndDate)||(d=w.ganttProperties.autoEndDate),i.i(r.isNullOrUndefined)(f)&&(f=k.getDateFromFormat(t)),i.i(r.isNullOrUndefined)(m)&&(m=k.getDateFromFormat(d)),i.i(r.isNullOrUndefined)(d)||1!==k.compareDates(d,m)||(m=k.getDateFromFormat(d)),i.i(r.isNullOrUndefined)(t)||-1!==k.compareDates(t,f)||(f=k.getDateFromFormat(t)),!w.ganttProperties.isMilestone&&i.i(s.c)(w.ganttProperties)?(g=k.getParentProgress(w),D+=i.i(r.getValue)("totalProgress",g),w[k.parent.taskFields.duration]<1?(c+=i.i(r.getValue)("totalDuration",g),c=Number(c.toFixed(4))):c+=i.i(r.getValue)("totalDuration",g)):y++,v+=w.ganttProperties.work}(b);if(!o){var T=void 0;T=this.parent.isOnDelete&&w.isDelete?u-y-1:u-y;var S=T>0&&c>0?Number((D/c).toFixed(2)):0,P=a.ganttProperties,C=!(0!==T||!f||!m||f.getTime()!==m.getTime());0!==this.compareDates(d,f)&&(this.parent.setRecordValue(l.isAutoSchedule?"startDate":"autoStartDate",f,a.ganttProperties,!0),(i.i(r.isNullOrUndefined)(l.autoDuration)?0===l.duration:0===l.autoDuration)&&a.isManual&&C&&a.hasChildRecords&&a.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("startDate",f,a.ganttProperties,!0)),0!==this.compareDates(h,m)&&(this.parent.setRecordValue(l.isAutoSchedule?"endDate":"autoEndDate",m,a.ganttProperties,!0),(i.i(r.isNullOrUndefined)(l.autoDuration)?0===l.duration:0===l.autoDuration)&&a.isManual&&C&&a.hasChildRecords&&a.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("endDate",m,a.ganttProperties,!0)),this.parent.setRecordValue("isMilestone",C,P,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.milestone)||this.updateMappingData(a,"milestone"),P.isAutoSchedule&&this.calculateDuration(a),this.updateWorkWithDuration(a);var M=P.work;M=this.parent.isOnEdit?M:M+v,this.parent.setRecordValue("work",M,P,!0),this.parent.setRecordValue("taskType","FixedDuration",P,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.type)||this.updateMappingData(a,"type"),this.parent.setRecordValue("progress",Math.floor(S),P,!0),this.parent.setRecordValue("totalProgress",D,P,!0),this.parent.setRecordValue("totalDuration",c,P,!0),this.parent.setRecordValue("autoDuration",P.duration,P,!0),P.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(P),P,!0),this.updateAutoWidthLeft(a)),this.parent.allowParentDependency||this.resetDependency(a),this.updateWidthLeft(a),this.updateTaskData(a)}}}else a.ganttProperties.endDate=a.taskData[this.parent.taskFields.endDate];o&&1===a.childRecords.length&&0===a.ganttProperties.duration&&(this.parent.setRecordValue("isMilestone",!0,a.ganttProperties,!0),this.updateWidthLeft(a),this.updateTaskData(a));var R=this.parent.getParentTask(a.parentItem);R&&(this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType)&&this.updateParentItems(R),o=!1},t}(o.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(6),n=(i.n(r),i(0)),a=(i.n(n),i(4)),s=(i.n(a),i(19)),o=i(1),l=function(){function e(e){var t=this;this.previousScroll={top:0,left:0},this.queryCellInfo=function(e){t.parent.trigger("queryCellInfo",e)},this.headerCellInfo=function(e){t.parent.trigger("headerCellInfo",e)},this.rowDataBound=function(e){t.parent.trigger("rowDataBound",e)},this.columnMenuOpen=function(e){t.parent.notify("columnMenuOpen",e),t.parent.trigger("columnMenuOpen",e),document.querySelector(".e-colmenu").addEventListener("mousemove",function(e){var r=document.querySelector(".e-filter-popup"),a=document.querySelector(".e-filter-item");i.i(n.isNullOrUndefined)(r)||a.classList.contains("e-focused")||i.i(n.remove)(t.parent.filterModule.filterMenuElement)})},this.columnMenuClick=function(e){t.parent.trigger("columnMenuClick",e)},this.objectEqualityChecker=function(e,i){if(e){for(var r=Object.keys(e),n=!0,a=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","ganttProperties"],s=0;s<r.length;s++){if((e[r[s]]instanceof Date?new Date(e[r[s]]).getTime():e[r[s]])!==(i[r[s]]instanceof Date?new Date(i[r[s]]).getTime():i[r[s]])&&-1===a.indexOf(r[s])){t.parent.modifiedRecords.push(i),n=!1;break}}return n}return!1},this.parent=e,this.parent.treeGrid=new r.TreeGrid,this.parent.treeGrid.allowSelection=!1,this.parent.treeGrid.allowKeyboard=this.parent.allowKeyboard,this.parent.treeGrid["${enableHtmlSanitizer}"]=this.parent.enableHtmlSanitizer,this.parent.treeGrid.enableImmutableMode=this.parent.enableImmutableMode,this.treeGridColumns=[],!this.parent.isLocaleChanged&&this.parent.isLoad&&(this.parent.previousGanttColumns=i.i(n.extend)([],[],this.parent.columns,!0)),this.validateGanttColumns(),this.parent.isLocaleChanged&&(this.parent.isLocaleChanged=!1),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createContainer,this),this.parent.on("chartScroll",this.updateScrollTop,this),this.parent.on("destroy",this.destroy,this),this.parent.treeGrid.on("renderReactTemplate",this.renderReactTemplate,this)},e.prototype.renderReactTemplate=function(e){this.parent.portals=e,this.parent.renderTemplates()},e.prototype.createContainer=function(){this.treeGridElement=i.i(n.createElement)("div",{id:"treeGrid"+this.parent.element.id,className:"e-gantt-tree-grid"});var e=i.i(n.createElement)("div",{className:"e-gantt-temp-header"});this.parent.treeGridPane.appendChild(this.treeGridElement),this.treeGridElement.appendChild(e),this.parent.treeGridPane.classList.add("e-temp-content")},e.prototype.renderTreeGrid=function(){this.composeProperties(),this.bindEvents();this.parent.treeGrid.root=this.parent.root?this.parent.root:this.parent,this.parent.treeGrid.appendTo(this.treeGridElement),this.parent.treeGrid.grid&&this.parent.toolbarModule&&this.parent.isReact&&(this.parent.treeGrid.grid.portals=this.parent.portals),this.wireEvents()},e.prototype.composeProperties=function(){if(this.parent.treeGrid.hasChildMapping=this.parent.taskFields.hasChildMapping,this.parent.treeGrid.loadChildOnDemand=this.parent.loadChildOnDemand,this.parent.treeGrid.isFromGantt=!0,this.parent.treeGrid.parentIdMapping=this.parent.taskFields.parentID,this.parent.treeGrid.idMapping=this.parent.taskFields.id,this.parent.treeGrid.showColumnMenu=this.parent.showColumnMenu,this.parent.treeGrid.enableCollapseAll=this.parent.collapseAllParentTasks,this.parent.treeGrid.columnMenuItems=this.parent.columnMenuItems,this.parent.treeGrid.enableRtl=this.parent.enableRtl,this.parent.treeGrid.childMapping=i.i(n.isNullOrUndefined)(this.parent.taskFields.child)?"":this.parent.taskFields.child,this.parent.treeGrid.treeColumnIndex=this.parent.treeColumnIndex,this.parent.treeGrid.columns=this.treeGridColumns,this.parent.treeGrid.loadingIndicator=this.parent.loadingIndicator,this.parent.treeGrid.enableVirtualMaskRow=this.parent.enableVirtualMaskRow,this.parent.dataSource instanceof Object&&i.i(o.i)(this.parent)){this.parent.treeGrid.hasChildMapping="isParent";var e=i.i(n.getValue)("count",this.parent.dataSource);this.parent.treeGrid.dataSource={result:this.parent.flatData,count:e}}else!this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(this.parent.autoCalculateDateScheduling=!1,this.parent.treeGrid.dataSource=this.parent.dataSource):(this.parent.treeGrid.hasChildMapping=null,this.parent.treeGrid.dataSource=this.parent.flatData);this.parent.treeGrid.expandStateMapping=this.parent.taskFields.expandState;this.parent.treeGrid.isGantt=!0,this.parent.treeGrid.rowHeight=this.parent.rowHeight,this.parent.treeGrid.gridLines=this.parent.gridLines,0===this.parent.searchSettings.fields.length&&""===this.parent.searchSettings.key||(this.parent.treeGrid.searchSettings=this.parent.searchSettings);this.parent.treeGrid.isJsComponent=!0;i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||i.i(n.isNullOrUndefined)(this.parent.toolbarModule.element)||this.parent.toolbarModule.element.offsetHeight,this.parent.treeGrid.height=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].offsetHeight-19},e.prototype.getContentDiv=function(){return this.treeGridElement.querySelector(".e-content")},e.prototype.getHeaderDiv=function(){return this.treeGridElement.querySelector(".e-headercontent")},e.prototype.getScrollbarWidth=function(){var e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar";var t=document.createElement("div");e.appendChild(t),this.parent.element.appendChild(e);var i=e.offsetWidth-t.offsetWidth;return e.parentNode.removeChild(e),i},e.prototype.ensureScrollBar=function(){var e=this.getContentDiv(),t=this.getHeaderDiv(),i=this.getScrollbarWidth(),r=/Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);0!==i?e.style.cssText+="width: calc(100% + "+(i+1)+"px);":e.classList.add("e-gantt-scroll-padding"),0===i&&r&&(t.style.cssText+="width: calc(100% + 17px);")},e.prototype.bindEvents=function(){this.parent.treeGrid.dataBound=this.dataBound.bind(this),this.parent.treeGrid.collapsing=this.collapsing.bind(this),this.parent.treeGrid.collapsed=this.collapsed.bind(this),this.parent.treeGrid.expanding=this.expanding.bind(this),this.parent.treeGrid.expanded=this.expanded.bind(this),this.parent.treeGrid.actionBegin=this.actionBegin.bind(this),this.parent.treeGrid.actionComplete=this.treeActionComplete.bind(this),this.parent.treeGrid.created=this.created.bind(this),this.parent.treeGrid.actionFailure=this.actionFailure.bind(this),this.parent.treeGrid.queryCellInfo=this.queryCellInfo.bind(this),this.parent.treeGrid.headerCellInfo=this.headerCellInfo.bind(this),this.parent.treeGrid.rowDataBound=this.rowDataBound.bind(this),this.parent.treeGrid.columnMenuOpen=this.columnMenuOpen.bind(this),this.parent.treeGrid.columnMenuClick=this.columnMenuClick.bind(this),this.parent.treeGrid.beforeDataBound=this.beforeDataBound.bind(this),this.parent.treeGrid.dataStateChange=this.dataStateChange.bind(this)},e.prototype.beforeDataBound=function(e){this.parent.updatedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?i.i(n.getValue)("virtualScrollModule.visualData",this.parent.treeGrid):i.i(n.getValue)("result",e),this.parent.virtualScrollModule&&this.parent.enableVirtualization&&this.parent.updateContentHeight(e),i.i(n.setValue)("contentModule.objectEqualityChecker",this.objectEqualityChecker,this.parent.treeGrid.grid)},e.prototype.dataBound=function(e){this.ensureScrollBar(),this.parent.treeDataBound(e),this.parent.isVirtualScroll&&((this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization||this.parent.enableVirtualization&&!this.parent.enableVirtualMaskRow&&"Shimmer"===this.parent.loadingIndicator.indicatorType||"Shimmer"===this.parent.loadingIndicator.indicatorType)&&this.parent.hideMaskRow(),this.parent.isVirtualScroll=!1),this.prevCurrentView=i.i(n.extend)([],[],this.parent.currentViewData,!0)},e.prototype.dataStateChange=function(e){e.action&&"refresh"===e.action.requestType&&(this.parent.treeGrid.dataSource={result:i.i(n.getValue)("result",this.parent.treeGrid.dataSource),count:i.i(n.getValue)("count",this.parent.treeGrid.dataSource)}),this.parent.trigger("dataStateChange",e)},e.prototype.collapsing=function(e){var t,r=(new a.Deferred,i.i(n.getValue)("data",e)),s=r.length;if(!this.parent.ganttChartModule.isExpandCollapseFromChart)if(i.i(n.isNullOrUndefined)(s))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.collapseGanttRow(t),i.i(n.setValue)("cancel",i.i(n.getValue)("cancel",t),e);else{for(var o=0;o<s;o++)t=this.createExpandCollapseArgs(e,r[o]),this.parent.ganttChartModule.collapseGanttRow(t);i.i(n.setValue)("cancel",i.i(n.getValue)("cancel",t),e)}},e.prototype.expanding=function(e){var t,r=(new a.Deferred,i.i(n.getValue)("data",e)),s=r.length;if(!this.parent.ganttChartModule.isExpandCollapseFromChart)if(i.i(n.isNullOrUndefined)(s))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.expandGanttRow(t),i.i(n.setValue)("cancel",i.i(n.getValue)("cancel",t),e);else{for(var o=0;o<s;o++)t=this.createExpandCollapseArgs(e,r[o]),this.parent.ganttChartModule.expandGanttRow(t);i.i(n.setValue)("cancel",i.i(n.getValue)("cancel",t),e)}},e.prototype.collapsed=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var t=void 0,r=i.i(n.getValue)("data",e),a=r.length;if(i.i(n.isNullOrUndefined)(a))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.collapsedGanttRow(t);else for(var s=0;s<a;s++)t=this.createExpandCollapseArgs(e,r[s]),this.parent.ganttChartModule.collapsedGanttRow(t);"ResourceView"!==this.parent.viewType||this.parent.allowTaskbarOverlap||this.parent.ganttChartModule.isCollapseAll||!t.gridRow||(t.gridRow.style.height=t.chartRow.style.height,this.parent.contentHeight=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.trigger("collapsed",e)},e.prototype.expanded=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var t=void 0,r=i.i(n.getValue)("data",e),a=r.length;if(i.i(n.isNullOrUndefined)(a))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.expandedGanttRow(t);else for(var s=0;s<a;s++)t=this.createExpandCollapseArgs(e,r[s]),this.parent.ganttChartModule.expandedGanttRow(t);"ResourceView"!==this.parent.viewType||this.parent.allowTaskbarOverlap||this.parent.ganttChartModule.isExpandAll||!e.row||(e.row.style.height=this.parent.rowHeight+"px",this.parent.contentHeight=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.trigger("expanded",e)},e.prototype.actionBegin=function(e){this.parent.notify("actionBegin",e),null!==i.i(n.getValue)("doubleClickTarget",this.parent.treeGrid.editModule)&&i.i(n.setValue)("doubleClickTarget",null,this.parent.treeGrid.editModule),this.parent.trigger("actionBegin",e),"virtualscroll"!=e.requestType&&"edit"!=e.type&&"beginEdit"!=e.requestType&&(i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow())},e.prototype.created=function(e){this.updateKeyConfigSettings()},e.prototype.actionFailure=function(e){this.parent.trigger("actionFailure",e)},e.prototype.createExpandCollapseArgs=function(e,t){var r,a=i.i(n.getValue)("data",e),s=a.length;if(i.i(n.isNullOrUndefined)(s)){var o=i.i(n.getValue)("data",e),l=i.i(n.getValue)("row",e);r=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(o)];var d={data:o,gridRow:l,chartRow:r,cancel:!1};return d}var l=i.i(n.getValue)("row",e);r=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(t)];var d={data:t,gridRow:l,chartRow:r,cancel:!1};return d},e.prototype.treeActionComplete=function(e){var t=this,r=i.i(n.extend)({},e);if("sorting"===i.i(n.getValue)("requestType",e))this.parent.notify("updateModel",{}),i.i(n.deleteObject)(r,"isFrozen");else if("filtering"===i.i(n.getValue)("requestType",e)){this.parent.notify("updateModel",{});var a=this.parent.element.querySelector(".e-treegrid");a.focus()}else if("save"===i.i(n.getValue)("type",e)&&this.parent.editModule&&this.parent.editModule.cellEditModule){var s=i.i(n.getValue)("data",e);i.i(n.isNullOrUndefined)(s)||i.i(n.isNullOrUndefined)(this.parent.getTaskByUniqueID(s.uniqueID))||(this.parent.getTaskByUniqueID(s.uniqueID).taskData[this.parent.taskFields.duration]=s.taskData[this.parent.taskFields.duration],i.i(n.isNullOrUndefined)(s.taskData[this.parent.taskFields.resourceInfo])||(this.parent.getTaskByUniqueID(s.uniqueID).taskData[this.parent.taskFields.resourceInfo]=s.taskData[this.parent.taskFields.resourceInfo])),this.parent.editModule.cellEditModule.initiateCellEdit(e,this.currentEditRow),this.parent.editModule.cellEditModule.isCellEdit=!1,this.currentEditRow={}}if("filterafteropen"===i.i(n.getValue)("requestType",e)&&this.parent.notify("actionComplete",e),"searching"===i.i(n.getValue)("requestType",e)&&this.parent.notify("actionComplete",e),i.i(n.isNullOrUndefined)(i.i(n.getValue)("batchChanges",e))||i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.parent.isCancelled&&(i.i(n.setValue)("requestType","cancel",r),i.i(n.setValue)("action","CellEditing",r),this.parent.isCancelled=!1),"refresh"===i.i(n.getValue)("requestType",e)&&i.i(n.isNullOrUndefined)(i.i(n.getValue)("type",e))&&this.parent.addDeleteRecord){if(-1!=this.parent.selectedRowIndex)this.parent.selectRow(this.parent.selectedRowIndex),this.parent.selectedRowIndex>this.parent.currentViewData.length-1&&(this.parent.selectedRowIndex=-1);else{var o=0;this.parent.currentViewData.map(function(e,r){(!i.i(n.isNullOrUndefined)(t.parent.currentSelection)&&e.ganttProperties.taskId===t.parent.currentSelection[t.parent.taskFields.id]||!i.i(n.isNullOrUndefined)(t.parent.currentSelection)&&e.ganttProperties.taskId===t.parent.currentSelection.taskId)&&(o=r)}),this.addedRecord=!0,this.parent.selectRow(i.i(n.isNullOrUndefined)(o)?0:o)}this.parent.addDeleteRecord=!1}if(this.parent.trigger("actionComplete",r),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation){for(var l=0;l<this.parent.currentViewData.length;l++)this.parent.currentViewData[l].hasChildRecords&&!this.parent.currentViewData[l].expanded&&this.parent.chartRowsModule.updateDragDropRecords(this.parent.currentViewData[l]);this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.updateKeyConfigSettings=function(){delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.delete,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.insert,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlHome,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlEnd,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.shiftTab,delete this.parent.treeGrid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.keyboardModule.keyConfigs.shiftTab},e.prototype.wireEvents=function(){var e=this.parent.treeGrid.element.querySelector(".e-content");e&&n.EventHandler.add(e,"scroll",this.scrollHandler,this),this.parent.isAdaptive&&n.EventHandler.add(this.parent.treeGridPane,"click",this.treeGridClickHandler,this)},e.prototype.unWireEvents=function(){var e=this.parent.treeGrid.element&&this.parent.treeGrid.element.querySelector(".e-content");e&&n.EventHandler.remove(e,"scroll",this.scrollHandler),this.parent.isAdaptive&&n.EventHandler.remove(this.parent.treeGridPane,"click",this.treeGridClickHandler)},e.prototype.scrollHandler=function(e){var t=this.parent.treeGrid.element.querySelector(".e-content");t.scrollTop!==this.previousScroll.top&&this.parent.notify("grid-scroll",{top:t.scrollTop}),this.previousScroll.top=t.scrollTop,this.parent.contextMenuModule&&this.parent.contextMenuModule.isOpen&&this.parent.contextMenuModule.contextMenu.close()},e.prototype.validateGanttColumns=function(){var e=this.parent,t=e.columns.length,r=this.parent.taskFields;this.parent.columnMapping={},this.parent.columnByField={},this.parent.customColumns=[];for(var a=["id","name","startDate","endDate","duration","dependency","progress","baselineStartDate","baselineEndDate","resourceInfo","notes","work","manual","type","milestone"],s=this,o=0;o<t;o++)!function(t){var i={};"string"==typeof e.columns[t]?i.field=e.columns[t]:i=e.columns[t];var n=[];if(a.length>0&&(n=a.filter(function(e){return i.field===r[e]})),0===n.length)return i.field===s.parent.resourceFields.group?"continue":(s.parent.customColumns.push(i.field),i.headerText=i.headerText?i.headerText:i.field,i.width=i.width?i.width:150,i.editType=i.editType?i.editType:"stringedit",i.type=i.type?i.type:"string",s.bindTreeGridColumnProperties(i,!0),"continue");var o=a.indexOf(n[0]);a.splice(o,1),s.createTreeGridColumn(i,!0),s.parent.columnMapping[n[0]]=i.field}(o);for(var l=0;l<a.length;l++){var d={};i.i(n.isNullOrUndefined)(r[a[l]])||(d.field=r[a[l]],this.createTreeGridColumn(d,0===t),this.parent.columnMapping[a[l]]=d.field)}if("ProjectView"!==this.parent.viewType){var d={};this.composeUniqueIDColumn(d),this.createTreeGridColumn(d,!0)}},e.prototype.createTreeGridColumn=function(e,t){var r=this.parent.taskFields,s=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];if(e.disableHtmlEncode=i.i(n.isNullOrUndefined)(e.disableHtmlEncode)?this.parent.disableHtmlEncode:e.disableHtmlEncode,r.id!==e.field&&(e.clipMode=e.clipMode?e.clipMode:"EllipsisWithTooltip"),r.id===e.field)this.composeIDColumn(e);else if(r.name===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("name"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("name"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type=e.type?e.type:"string";else if(r.startDate===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("startDate"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("startDate"),e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.width=e.width?e.width:150,e.edit&&e.edit.params?e.edit.params.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent):e.edit?e.edit.params={renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}:e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.endDate===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("endDate"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("endDate"),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.width=e.width?e.width:150,e.edit&&e.edit.params?e.edit.params.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent):e.edit?e.edit.params={renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}:e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.duration===e.field)e.width=e.width?e.width:150,this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("duration"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("duration"),e.valueAccessor=e.valueAccessor?e.valueAccessor:i.i(n.isNullOrUndefined)(e.edit)?this.durationValueAccessor.bind(this):null,e.editType=e.editType?e.editType:"stringedit",e.type=e.type?e.type:"string";else if(r.progress===e.field)this.composeProgressColumn(e);else if(r.dependency===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("dependency"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("dependency"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type="string",e.allowFiltering=!1!==e.allowFiltering;else if(r.resourceInfo===e.field)this.composeResourceColumn(e);else if(r.notes===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("notes"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("notes"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",this.parent.showInlineNotes||e.template||(e.template='<div class="e-ganttnotes-info"><span class="e-icons e-notes-info"></span></div>');else if(r.baselineStartDate===e.field||r.baselineEndDate===e.field){var o=r.baselineEndDate===e.field?"baselineEndDate":"baselineStartDate";e.width=e.width?e.width:150,this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant(o):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant(o),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"}else r.work===e.field?(this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("work"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("work"),e.width=e.width?e.width:150,e.valueAccessor=e.valueAccessor?e.valueAccessor:this.workValueAccessor.bind(this),e.editType=e.editType?e.editType:"numericedit"):r.type===e.field?(this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("taskType"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskType"),e.width=e.width?e.width:150,e.editType="dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.taskTypeValueAccessor.bind(this)):r.manual===e.field&&"Custom"===this.parent.taskMode&&(this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("taskMode"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskMode"),e.width=e.width?e.width:120,e.editType=e.editType?e.editType:"dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.modeValueAccessor.bind(this),e.edit={params:{query:new a.Query,dataSource:[{id:1,text:this.parent.localeObj.getConstant("manual"),value:!0},{id:2,text:this.parent.localeObj.getConstant("auto"),value:!1}],fields:{text:"text",value:"value"}}});this.bindTreeGridColumnProperties(e,t)},e.prototype.composeResourceColumn=function(e){var t=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];this.parent.isLocaleChanged&&t?e.headerText=t.headerText?t.headerText:this.parent.localeObj.getConstant("resourceName"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("resourceName"),e.width=e.width?e.width:150,e.type="string",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.resourceValueAccessor.bind(this),e.allowFiltering=!1!==e.allowFiltering},e.prototype.getResourceIds=function(e){var t=i.i(n.getValue)(this.parent.taskFields.resourceInfo,e.taskData),r=[];if(i.i(n.isNullOrUndefined)(t))return t;for(var a=0;a<t.length;a++)r.push("object"==typeof t[a]?t[a][this.parent.resourceFields.id]:t[a]);return r},e.prototype.composeIDColumn=function(e){var t,r="ProjectView"===this.parent.viewType,a=this.parent.dataSource.length;if(e.isPrimaryKey=!!r,this.parent.isLocaleChanged){var s=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];s&&(e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("id"))}else e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("id");e.width=e.width?e.width:100;for(var o=0;o<a;o++)if(!i.i(n.isNullOrUndefined)(this.parent.dataSource[o][this.parent.taskFields.id])){t=this.parent.dataSource[o][this.parent.taskFields.id];break}"string"==typeof t||i.i(n.isNullOrUndefined)(t)?("ResourceView"===this.parent.viewType?e.allowEditing=!!e.allowEditing&&e.allowEditing:e.allowEditing=!e.allowEditing||e.allowEditing,e.editType=e.editType?e.editType:"stringedit"):(e.allowEditing=!!e.allowEditing&&e.allowEditing,e.editType=e.editType?e.editType:"numericedit"),e.valueAccessor=r?null:this.idValueAccessor.bind(this)},e.prototype.composeUniqueIDColumn=function(e){e.field="rowUniqueID",e.isPrimaryKey=!0,e.headerText="UniqueID",e.allowEditing=!1,e.visible=!1},e.prototype.composeProgressColumn=function(e){var t=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];this.parent.isLocaleChanged&&t?e.headerText=t.headerText?t.headerText:this.parent.localeObj.getConstant("progress"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("progress"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"numericedit"},e.prototype.bindTreeGridColumnProperties=function(e,t){for(var i={},r={},n=0,a=Object.keys(e);n<a.length;n++){var o=a[n];i[o]=r[o]=e[o]}this.parent.columnByField[r.field]=r,this.parent.ganttColumns.push(new s.a(r)),t&&this.treeGridColumns.push(i)},e.prototype.durationValueAccessor=function(e,t,r){var a=t.ganttProperties;return i.i(n.isNullOrUndefined)(a)?!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.dataOperation.getDurationString(parseInt(t[this.parent.taskFields.duration]),this.parent.durationUnit):"":this.parent.dataOperation.getDurationString(a.duration,a.durationUnit)},e.prototype.resourceValueAccessor=function(e,t,r){var a=t.ganttProperties;return i.i(n.isNullOrUndefined)(a)?"":a.resourceNames},e.prototype.workValueAccessor=function(e,t,r){var a=t.ganttProperties;return i.i(n.isNullOrUndefined)(a)?"":this.parent.dataOperation.getWorkString(a.work,a.workUnit)},e.prototype.taskTypeValueAccessor=function(e,t,r){var a=t.ganttProperties;return i.i(n.isNullOrUndefined)(a)?"":a.taskType},e.prototype.modeValueAccessor=function(e,t,i){return t[e]?"Manual":"Auto"},e.prototype.idValueAccessor=function(e,t,i){return 0===t.level?"R-"+t.ganttProperties.taskId:"T-"+t.ganttProperties.taskId},e.prototype.updateScrollTop=function(e){var t;t=i.i(n.getValue)("top",e),this.treeGridElement.querySelector(".e-content").scrollTop=t,this.previousScroll.top=this.treeGridElement.querySelector(".e-content").scrollTop},e.prototype.treeGridClickHandler=function(e){this.parent.notify("treeGridClick",e)},e.prototype.removeEventListener=function(){this.parent.off("renderPanels",this.createContainer),this.parent.off("chartScroll",this.updateScrollTop),this.parent.off("destroy",this.destroy),this.parent.treeGrid.off("reactTemplateRender",this.renderReactTemplate)},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.parent.treeGrid.element&&this.parent.treeGrid.destroy()},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(2),n=(i.n(r),i(7)),a=i(0),s=(i.n(a),i(5)),o=(i.n(s),i(1)),l=function(){function e(e){this.totalColumnWidth=0,this.beforeSinglePageExport={},this.baselineHeight=8,this.parent=e}return e.prototype.processToFit=function(){this.beforeSinglePageExport.zoomingProjectStartDate=this.parent.zoomingProjectStartDate,this.beforeSinglePageExport.zoomingProjectEndDate=this.parent.zoomingProjectEndDate,this.beforeSinglePageExport.cloneProjectStartDate=this.parent.cloneProjectStartDate,this.beforeSinglePageExport.cloneProjectEndDate=this.parent.cloneProjectEndDate,this.beforeSinglePageExport.customTimelineSettings=i.i(a.extend)({},this.parent.timelineModule.customTimelineSettings,null,!0),this.beforeSinglePageExport.isTimelineRoundOff=this.parent.isTimelineRoundOff,this.beforeSinglePageExport.topTier=this.parent.timelineModule.topTier,this.beforeSinglePageExport.topTierCellWidth=this.parent.timelineModule.topTierCellWidth,this.beforeSinglePageExport.topTierCollection=this.parent.timelineModule.topTierCollection,this.beforeSinglePageExport.bottomTier=this.parent.timelineModule.bottomTier,this.beforeSinglePageExport.bottomTierCellWidth=this.parent.timelineModule.bottomTierCellWidth,this.beforeSinglePageExport.bottomTierCollection=this.parent.timelineModule.bottomTierCollection,this.beforeSinglePageExport.totalTimelineWidth=this.parent.timelineModule.totalTimelineWidth,this.beforeSinglePageExport.timelineStartDate=this.parent.timelineModule.timelineStartDate,this.beforeSinglePageExport.timelineEndDate=this.parent.timelineModule.timelineEndDate,this.beforeSinglePageExport.timelineRoundOffEndDate=this.parent.timelineModule.timelineRoundOffEndDate,this.beforeSinglePageExport.perDayWidth=this.parent.perDayWidth,this.beforeSinglePageExport.updatedConnectorLineCollection=i.i(a.extend)([],this.parent.updatedConnectorLineCollection,null,!0),this.parent.timelineModule.isZoomToFit=!0,this.parent.timelineModule.isZooming=!1,this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.zoomingProjectStartDate>this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=new Date(this.parent.allowUnscheduledTasks?this.parent.zoomingProjectStartDate:this.parent.cloneProjectStartDate)),this.parent.dataOperation.calculateProjectDates();var e,t,r=this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime(),n=r/864e5;this.exportProps.fitToWidthSettings.gridWidth&&(t=parseInt(this.exportProps.fitToWidthSettings.gridWidth.split("%")[0])),e=this.exportProps.fitToWidthSettings.chartWidth?parseInt(this.exportProps.fitToWidthSettings.chartWidth.split("%")[0]):this.exportProps.fitToWidthSettings.gridWidth?100-t:70;var s,o,l,d=this.parent.pdfExportModule.pdfPageDimensions.width*e/100,h=d,p=h/n,u=this.parent.zoomingLevels.slice(),c=u.sort(function(e,t){return e.perDayWidth||t.perDayWidth?e.perDayWidth<t.perDayWidth?1:-1:0});if(0!==p){for(var g=0;g<c.length;g++){if(o=c[g],g===c.length-1){s=c[g];break}if(l=c[g+1],p>=o.perDayWidth){s=c[g];break}if(p<o.perDayWidth&&p>l.perDayWidth){s=c[g+1];break}}var f=i.i(a.extend)({},{},s,!0);this.parent.timelineModule.roundOffDateToZoom(this.parent.cloneProjectStartDate,!0,p,f.bottomTier.unit,s),this.parent.timelineModule.roundOffDateToZoom(this.parent.cloneProjectEndDate,!1,p,f.bottomTier.unit,s);var m=this.parent.timelineModule.calculateNumberOfTimelineCells(f),y=this.parent.pdfExportModule.pdfPageDimensions.height,D=this.parent.pdfExportModule.pdfPageDimensions.height,v=D<=y?0:17;f.timelineUnitSize=Math.abs(h-v)/m,this.parent.timelineModule.changeTimelineSettings(f),this.parent.timelineModule.isZoomToFit=!1,this.parent.timelineModule.isZooming=!1}},e.prototype.processGridExport=function(e,t,r){this.flatData=e,this.gantt=t,this.exportValueFormatter=new d(this.parent.locale),this.exportProps=r,this.rowIndex=0,this.colIndex=0,this.columns=this.parent.treeGrid.columns,this.gantt.treeColumnIndex=this.parent.treeColumnIndex,this.gantt.rowHeight=i.i(o.b)(this.parent.rowHeight),this.gantt.style.cellPadding.left=0,this.gantt.style.cellPadding.right=0,this.ganttStyle=this.gantt.ganttStyle,this.gantt.borderColor=this.ganttStyle.chartGridLineColor,this.parent.pdfExportModule.isPdfExport=!0,this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth&&this.processToFit(),this.processHeaderContent(),this.processGanttContent(),this.processTimeline(),this.processTaskbar(),this.processPredecessor(),this.parent.pdfExportModule.isPdfExport=!1},e.prototype.processHeaderContent=function(){var e=this;this.rowIndex++,this.row=this.gantt.rows.addRow();var t=0;this.columns.forEach(function(i){e.isColumnVisible(i)&&(e.processColumnHeader(i,t),t++)})},e.prototype.processColumnHeader=function(e,t){this.gantt.columns.add(1);var n=this.gantt.columns.getColumn(t);this.parent.treeColumnIndex===t&&(n.isTreeColumn=!0);var a=parseInt(e.width,10);n.width=i.i(o.b)(a),this.totalColumnWidth+=n.width,n.headerText=e.headerText,n.field=e.field;var s=this.row.cells.getCell(t);s.value=e.headerText,s.isHeaderCell=!0;var l=this.parent.timelineModule.isSingleTier?45:60;this.copyStyles(this.ganttStyle.columnHeader,s,!1),this.row.height=i.i(o.b)(l),e.headerTextAlign&&(s.style.format.alignment=r.PdfTextAlignment[e.headerTextAlign]);var d={cell:s,style:s.style,value:s.value,column:e};this.parent.pdfColumnHeaderQueryCellInfo&&this.parent.trigger("pdfColumnHeaderQueryCellInfo",d),s.value=d.value},e.prototype.isColumnVisible=function(e){var t=e.visible||this.exportProps.includeHiddenColumn,r=!!i.i(a.isNullOrUndefined)(e.template);return t&&r},e.prototype.processGanttContent=function(){var e=this;if(0===this.flatData.length)this.renderEmptyGantt();else{var t=void 0;t=this.flatData,t.forEach(function(t){e.row=e.gantt.rows.addRow(),t.hasChildRecords?(e.gantt.rows.getRow(e.rowIndex).isParentRow=!0,e.processRecordRow(t)):e.processRecordRow(t),e.exportProps.fitToWidthSettings&&e.exportProps.fitToWidthSettings.isFitToWidth&&(e.row.height=33.33),e.rowIndex++})}},e.prototype.processTimeline=function(){var e=this.parent.timelineModule;this.gantt.chartHeader.topTierHeight=this.gantt.chartHeader.bottomTierHeight=this.parent.timelineModule.isSingleTier?45:30,this.gantt.chartHeader.topTierCellWidth=e.topTierCellWidth,this.gantt.chartHeader.bottomTierCellWidth=e.bottomTierCellWidth,this.gantt.chartHeader.topTier=i.i(a.extend)([],[],e.topTierCollection,!0),this.gantt.chartHeader.bottomTier=i.i(a.extend)([],[],e.bottomTierCollection,!0),this.gantt.chartHeader.width=e.totalTimelineWidth,this.gantt.chartHeader.height=this.gantt.rows.getRow(0).height,this.gantt.timelineStartDate=new Date(e.timelineStartDate.getTime())},e.prototype.processPredecessor=function(){var e=this;(i.i(a.isNullOrUndefined)(this.exportProps.showPredecessorLines)||this.exportProps.showPredecessorLines)&&(this.parent.pdfExportModule.isPdfExport=!0,this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.updatedConnectorLineCollection.forEach(function(t){var r=e.gantt.predecessor.add();r.parentLeft=t.parentLeft,r.childLeft=t.childLeft,r.parentWidth=t.parentWidth,r.childWidth=t.childWidth,r.parentIndex=t.parentIndex,r.childIndex=t.childIndex,r.rowHeight=t.rowHeight,r.type=t.type,r.milestoneParent=t.milestoneParent,r.milestoneChild=t.milestoneChild,r.parentEndPoint=t.parentEndPoint,r.lineWidth=e.parent.connectorLineWidth>5?i.i(o.b)(5):i.i(o.b)(e.parent.connectorLineWidth),t.isCritical?r.connectorLineColor=e.ganttStyle.criticalConnectorLineColor:r.connectorLineColor=e.ganttStyle.connectorLineColor,e.ganttStyle.connectorLineColor=r.connectorLineColor,e.gantt.predecessorCollection.push(r)}),this.parent.pdfExportModule.isPdfExport=!1)},e.prototype.processRecordRow=function(e){var t=this;this.colIndex=0,this.row.level=e.level,this.columns.forEach(function(i){t.isColumnVisible(i)&&(t.processRecordCell(e,i,t.row),t.colIndex++)})},e.prototype.processRecordCell=function(e,t,s){var o=s.cells.getCell(this.colIndex),l=this.parent.taskFields,d=e.ganttProperties;"datepickeredit"===t.editType||"datetimepickeredit"===t.editType?o.value=e[t.field]:t.field===l.duration?o.value=this.parent.getDurationString(d.duration,d.durationUnit):t.field===l.resourceInfo?o.value=d.resourceNames:t.field===l.work?o.value=this.parent.getWorkString(d.work,d.workUnit):o.value=i.i(a.isNullOrUndefined)(e[t.field])?"":e[t.field].toString(),o.isHeaderCell=!1,o.style.padding=new n.c,this.copyStyles(this.ganttStyle.cell,o,s.isParentRow),this.colIndex!==this.parent.treeColumnIndex?o.style.format.alignment=r.PdfTextAlignment[t.textAlign]:o.style.format.paragraphIndent=10*o.row.level;var h={data:e,value:o.value,column:t,style:o.style,cell:o};h.value=this.exportValueFormatter.formatCellValue(h),this.parent.pdfQueryCellInfo&&this.parent.trigger("pdfQueryCellInfo",h),o.value=h.value},e.prototype.processTaskbar=function(){var e,t=this;e=this.flatData,e.forEach(function(e){var n=t.gantt.taskbar.add(),s=e.ganttProperties;if(n.left=s.left,n.width=s.width,n.left<0&&(n.width=n.width+n.left,n.left=0),n.progress=s.progress,n.isScheduledTask=i.i(o.c)(s),o.c?i.i(a.isNullOrUndefined)(s.endDate)&&i.i(a.isNullOrUndefined)(s.duration)?n.unscheduledTaskBy="startDate":i.i(a.isNullOrUndefined)(s.startDate)&&i.i(a.isNullOrUndefined)(s.duration)?n.unscheduledTaskBy="endDate":(n.unscheduledTaskBy="duration",n.unscheduleStarteDate=t.parent.dateValidationModule.getValidStartDate(e.ganttProperties),n.unscheduleEndDate=t.parent.dateValidationModule.getValidEndDate(e.ganttProperties)):(n.unscheduleStarteDate=null,n.unscheduleEndDate=null),n.startDate=s.startDate,n.endDate=s.endDate,n.height=t.parent.chartRowsModule.taskBarHeight,t.parent.renderBaseline){var l=void 0;l=n.height+t.baselineHeight<=t.parent.rowHeight?n.height:n.height-(t.baselineHeight+1),n.height=l}n.baselineTop=t.parent.chartRowsModule.baselineTop,n.isMilestone=s.isMilestone,n.baselineStartDate=s.baselineStartDate,n.baselineEndDate=s.baselineEndDate,n.baselineLeft=s.baselineLeft,n.baselineWidth=s.baselineWidth,n.milestoneColor=new r.PdfColor(t.ganttStyle.taskbar.milestoneColor),n.isParentTask=e.hasChildRecords,s.isMilestone&&(n.height=s.width),e[t.parent.labelSettings.leftLabel]&&(n.leftTaskLabel.value=e[t.parent.labelSettings.leftLabel].toString()),e[t.parent.labelSettings.rightLabel]&&(n.rightTaskLabel.value=e[t.parent.labelSettings.rightLabel].toString()),e[t.parent.labelSettings.taskLabel]&&(n.taskLabel=e[t.parent.labelSettings.taskLabel].toString());var d=s.isMilestone?Math.floor(t.parent.chartRowsModule.taskBarHeight/2)+33:33;n.rightTaskLabel.left=s.left+s.width+d,n.fontFamily=t.ganttStyle.fontFamily,n.progressWidth=s.progressWidth,n.labelColor=new r.PdfColor(t.ganttStyle.label.fontColor),n.progressFontColor=new r.PdfColor(t.ganttStyle.taskbar.progressFontColor),n.isParentTask?(n.taskColor=new r.PdfColor(t.ganttStyle.taskbar.parentTaskColor),n.taskBorderColor=new r.PdfColor(t.ganttStyle.taskbar.parentTaskBorderColor),n.progressColor=new r.PdfColor(t.ganttStyle.taskbar.parentProgressColor)):e.isCritical?(n.taskColor=new r.PdfColor(t.ganttStyle.taskbar.criticalTaskColor),n.progressColor=new r.PdfColor(t.ganttStyle.taskbar.criticalProgressColor),n.taskBorderColor=new r.PdfColor(t.ganttStyle.taskbar.criticalTaskBorderColor),n.milestoneColor=new r.PdfColor(t.ganttStyle.taskbar.criticalTaskColor)):(n.taskColor=new r.PdfColor(t.ganttStyle.taskbar.taskColor),n.progressColor=new r.PdfColor(t.ganttStyle.taskbar.progressColor),n.taskBorderColor=new r.PdfColor(t.ganttStyle.taskbar.taskBorderColor)),n.baselineColor=new r.PdfColor(t.ganttStyle.taskbar.baselineColor),n.baselineBorderColor=new r.PdfColor(t.ganttStyle.taskbar.baselineBorderColor),n.gridLineColor=new r.PdfColor(t.ganttStyle.chartGridLineColor),t.gantt.taskbarCollection.push(n);var h={};h.progressFontColor=n.progressFontColor,h.taskColor=n.taskColor,h.taskBorderColor=n.taskBorderColor,h.progressColor=n.progressColor,h.milestoneColor=n.milestoneColor,h.baselineColor=n.baselineColor,h.baselineBorderColor=n.baselineBorderColor;var p={taskbar:h,data:e};t.parent.pdfQueryTaskbarInfo&&(t.parent.trigger("pdfQueryTaskbarInfo",p),n.progressFontColor=p.taskbar.progressFontColor,n.taskColor=p.taskbar.taskColor,n.taskBorderColor=p.taskbar.taskBorderColor,n.progressColor=p.taskbar.progressColor,n.milestoneColor=p.taskbar.milestoneColor,n.baselineColor=p.taskbar.baselineColor,n.baselineBorderColor=p.taskbar.baselineBorderColor)})},e.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new r.PdfStringFormat),e){case"Right":t.alignment=r.PdfTextAlignment.Right;break;case"Center":t.alignment=r.PdfTextAlignment.Center;break;case"Justify":t.alignment=r.PdfTextAlignment.Justify;break;case"Left":t.alignment=r.PdfTextAlignment.Left}return t},e.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new r.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=r.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=r.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=r.PdfVerticalAlignment.Top}return t},e.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},e.prototype.getFont=function(e){if(e.font)return e.font;var t=i.i(a.isNullOrUndefined)(e.style.fontSize)?9.75:.75*e.style.fontSize,n=i.i(a.isNullOrUndefined)(e.style.fontFamily)?r.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),s=r.PdfFontStyle.Regular;return!i.i(a.isNullOrUndefined)(e.style.bold)&&e.style.bold&&(s|=r.PdfFontStyle.Bold),!i.i(a.isNullOrUndefined)(e.style.italic)&&e.style.italic&&(s|=r.PdfFontStyle.Italic),!i.i(a.isNullOrUndefined)(e.style.underline)&&e.style.underline&&(s|=r.PdfFontStyle.Underline),!i.i(a.isNullOrUndefined)(e.style.strikeout)&&e.style.strikeout&&(s|=r.PdfFontStyle.Strikeout),new r.PdfStandardFont(n,t,s)},e.prototype.renderEmptyGantt=function(){var e=this.gantt.rows.addRow();e.cells.getCell(0).isHeaderCell=!1,e.height=i.i(o.b)(this.parent.rowHeight),this.copyStyles(this.ganttStyle.columnHeader,e.cells.getCell(0),e.isParentRow);var t=this.columns.length;e.cells.getCell(0).value=this.parent.localeObj.getConstant("emptyRecord"),this.mergeCells(1,0,t)},e.prototype.mergeCells=function(e,t,i){this.gantt.rows.getRow(e).cells.getCell(t).columnSpan=i},e.prototype.copyStyles=function(e,t,i){t.style.fontColor=new r.PdfColor(e.fontColor),t.style.backgroundColor=new r.PdfColor(e.backgroundColor),t.style.borderColor=new r.PdfColor(e.borderColor),t.style.fontSize=e.fontSize,t.style.fontStyle=e.fontStyle,t.style.format=Object.assign(new r.PdfStringFormat,e.format),t.style.borders=new n.b,t.style.borders.all=new r.PdfPen(t.style.borderColor),t.style.padding=new n.c;var a=0;a=t.isHeaderCell?this.parent.timelineModule.isSingleTier?22.5:30:this.parent.rowHeight/2,t.style.padding.top=a-e.fontSize,t.style.padding.bottom=a-e.fontSize,t.style.padding.left=10,t.style.padding.right=10,e.padding&&(t.style.padding=e.padding),e.borders&&(t.style.borders=e.borders)},e.prototype.initializePdf=function(e){this.pdfDoc=e;var t=[],n=this.pdfDoc.pageSettings.width-82;if(this.exportProps&&this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth){var s=void 0;if(this.exportProps.fitToWidthSettings.gridWidth)s=parseInt(this.exportProps.fitToWidthSettings.gridWidth.split("%")[0]);else if(this.exportProps.fitToWidthSettings.chartWidth){var o=parseInt(this.exportProps.fitToWidthSettings.chartWidth.split("%")[0]);s=100-o}else s=30;for(var l=this.parent.pdfExportModule.pdfPageDimensions.width*s/100,d=l/this.gantt.columns.columns.length,h=0;h<this.gantt.columns.columns.length;h++)this.gantt.columns.getColumn(h).width=d}if(this.totalColumnWidth>this.pdfDoc.pageSettings.width-82?this.gantt.style.allowHorizontalOverflow=!0:n/this.columns.length<t[0]&&(this.gantt.columns.getColumn(0).width=t[0]),this.exportProps.enableFooter||i.i(a.isNullOrUndefined)(this.exportProps.enableFooter)){var p=new r.RectangleF(0,0,e.pageSettings.width,35),u=new r.PdfPen(this.ganttStyle.chartGridLineColor),c=new r.PdfPageTemplateElement(p),g=new r.PdfSolidBrush(this.ganttStyle.footer.backgroundColor);c.graphics.drawRectangle(u,g,0,0,e.pageSettings.width,35);var f=new r.PdfStandardFont(this.ganttStyle.fontFamily,this.ganttStyle.footer.fontSize,this.ganttStyle.footer.fontStyle);this.ganttStyle.font&&(f=this.ganttStyle.font);var m=new r.PdfSolidBrush(this.ganttStyle.footer.fontColor),y=new r.PdfPageNumberField(f),D=new r.PdfPageCountField(f,m),v=new r.PdfCompositeField(f,m,"Page {0}",y,D);v.stringFormat=this.ganttStyle.footer.format,v.bounds=p,v.draw(c.graphics,new r.PointF(0,0)),e.template.bottom=c}},e}(),d=function(){function e(e){this.valueFormatter=new s.ValueFormatter(e),this.internationalization=new a.Internationalization(e)}return e.prototype.returnFormattedValue=function(e,t){return!i.i(a.isNullOrUndefined)(e.value)&&e.value?this.valueFormatter.getFormatFunction(t)(e.value):""},e.prototype.formatCellValue=function(e){if(e.isForeignKey&&(e.value=i.i(a.getValue)(e.column.foreignKeyValue,i.i(s.getForeignData)(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format)return e.value?this.internationalization.getNumberFormat({format:e.column.format})(e.value):"";if("boolean"===e.column.type)return e.value?"true":"false";if("date"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format)return(i.i(a.isNullOrUndefined)(e.column.type)||i.i(a.isNullOrUndefined)(e.value))&&i.i(a.isNullOrUndefined)(e.value)?"":e.value.toString();if("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format){var t=void 0;return t="date"===e.column.type?{type:"date",format:e.column.format}:"time"===e.column.type?{type:"time",format:e.column.format}:{type:"dateTime",format:e.column.format},this.returnFormattedValue(e,t)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var r=void 0;return r="date"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,r)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){this.mKeys=[],this.mValues=[]}return e.prototype.size=function(){return this.mKeys.length},e.prototype.add=function(e,t){if(void 0===e||null===e||void 0===t||null===t)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(e)<0)return this.mKeys.push(e),this.mValues.push(t),1;throw new RangeError("An item with the same key has already been added.")},e.prototype.keys=function(){return this.mKeys},e.prototype.values=function(){return this.mValues},e.prototype.getValue=function(e){if(void 0===e||null===e)throw new ReferenceError("Provided key is not valid.");var t=this.mKeys.indexOf(e);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[t]},e.prototype.setValue=function(e,t){if(void 0===e||null===e)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(e);i<0?(this.mKeys.push(e),this.mValues.push(t)):this.mValues[i]=t},e.prototype.remove=function(e){if(void 0===e||null===e)throw new ReferenceError("Provided key is not valid.");var t=this.mKeys.indexOf(e);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(t,1),this.mValues.splice(t,1),!0},e.prototype.containsKey=function(e){if(void 0===e||null===e)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(e)<0)},e.prototype.clear=function(){this.mKeys=[],this.mValues=[]},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var r=i(2),n=(i.n(r),function(){function e(){var e=new r.PdfPen(new r.PdfColor(0,0,0));e.dashStyle=r.PdfDashStyle.Solid;var t=new r.PdfPen(new r.PdfColor(0,0,0));t.dashStyle=r.PdfDashStyle.Solid;var i=new r.PdfPen(new r.PdfColor(0,0,0));i.dashStyle=r.PdfDashStyle.Solid;var n=new r.PdfPen(new r.PdfColor(0,0,0));n.dashStyle=r.PdfDashStyle.Solid,this.leftPen=e,this.rightPen=t,this.topPen=i,this.bottomPen=n}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftPen},set:function(e){this.leftPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightPen},set:function(e){this.rightPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topPen},set:function(e){this.topPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomPen},set:function(e){this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"all",{set:function(e){this.leftPen=this.rightPen=this.topPen=this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(e,"default",{get:function(){return new e},enumerable:!0,configurable:!0}),e}()),a=function(){function e(e,t,i,r){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===e?(this.leftPad=this.rightPad=5.76,this.bottomPad=this.topPad=.5):(this.leftPad=e,this.rightPad=t,this.topPad=i,this.bottomPad=r,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftPad},set:function(e){this.leftPad=e,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightPad},set:function(e){this.rightPad=e,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topPad},set:function(e){this.topPad=e,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomPad},set:function(e){this.bottomPad=e,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"all",{set:function(e){this.leftPad=this.rightPad=this.topPad=this.bottomPad=e,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return o}),i.d(t,"c",function(){return l}),i.d(t,"d",function(){return d}),i.d(t,"e",function(){return h}),i.d(t,"f",function(){return p}),i.d(t,"g",function(){return u});var r=i(18),n=i(0),a=(i.n(n),i(2)),s=(i.n(a),function(){function e(e){this.cellWidth=0,this.cellHeight=0,this.finishedDrawingCell=!0,i.i(n.isNullOrUndefined)(e)?(this.rowSpan=1,this.columnSpan=1):this.row=e,this.style={}}return Object.defineProperty(e.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(e){this.cellHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return 0===this.cellWidth&&(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(e){this.cellWidth=e},enumerable:!0,configurable:!0}),e.prototype.measureWidth=function(){var e=0,t=new a.PdfStringLayouter;if("string"==typeof this.value){var i=new a.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);this.row.treegrid.ganttStyle.font&&(i=this.row.treegrid.ganttStyle.font);e+=t.layout(this.value,i,this.style.format,new a.SizeF(Number.MAX_VALUE,Number.MAX_VALUE),!1,new a.SizeF(0,0)).actualSize.width,e+=2*(this.style.borders.left.width+this.style.borders.right.width)}return void 0!==this.row.treegrid.style.cellPadding.left&&this.row.treegrid.style.cellPadding.hasLeftPad&&(e+=this.row.treegrid.style.cellPadding.left),void 0!==this.row.treegrid.style.cellPadding.right&&this.row.treegrid.style.cellPadding.hasRightPad&&(e+=this.row.treegrid.style.cellPadding.right),e+=this.row.treegrid.style.cellSpacing},e.prototype.measureHeight=function(){var e=this.row.treegrid.rowHeight,t=0,r=this.calculateWidth();r-=this.row.treegrid.style.cellPadding.right+this.row.treegrid.style.cellPadding.left,r-=this.style.borders.left.width+this.style.borders.right.width;var s=new a.PdfStringLayouter;if("string"==typeof this.value||"string"==typeof this.remainingString){var o=this.value;this.finishedDrawingCell||(o=i.i(n.isNullOrUndefined)(this.remainingString)||""===this.remainingString?this.value:this.remainingString);var l=new a.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);this.row.treegrid.ganttStyle.font&&(l=this.row.treegrid.ganttStyle.font);t+=s.layout(o,l,this.style.format,new a.SizeF(r,0),!1,new a.SizeF(0,0)).actualSize.height,t+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}return t+=this.row.treegrid.style.cellPadding.top+this.row.treegrid.style.cellPadding.bottom,t+=this.row.treegrid.style.cellSpacing,t>e?t:e},e.prototype.calculateWidth=function(){for(var e=this.row.cells.indexOf(this),t=this.columnSpan,i=0,r=0;r<t;r++)i+=this.row.treegrid.columns.getColumn(e+r).width;return this.row.treegrid.columns.getColumn(e).isTreeColumn&&(i-=10*this.row.level),i},e.prototype.draw=function(e,t,i,r){var n=null;if(i){for(var s=this.row.cells.indexOf(this),o=s+1;o<=s+this.columnSpan;o++)this.row.cells.getCell(o).isCellMergeContinue=!1,this.row.cells.getCell(o).isRowMergeContinue=!1;this.columnSpan=1}if((this.isCellMergeContinue||this.isRowMergeContinue)&&this.isCellMergeContinue&&this.row.treegrid.style.allowHorizontalOverflow)return this.row.rowOverflowIndex>0&&this.row.cells.indexOf(this)!==this.row.rowOverflowIndex+1||0===this.row.rowOverflowIndex&&this.isCellMergeContinue,n;this.drawCellBackground(e,t);var l=new a.PdfSolidBrush(this.style.fontColor),d=null;d=this.row.isParentRow?new a.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,a.PdfFontStyle.Bold):new a.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),this.row.treegrid.ganttStyle.font&&(d=this.row.treegrid.ganttStyle.font);var h=t;if(this.isHeaderCell||(h.x=h.x,h.width=h.width),h.height>=e.clientSize.height&&(this.row.treegrid.allowRowBreakAcrossPages?(h.height-=h.y,t.height-=t.y):(h.height=e.clientSize.height,t.height=e.clientSize.height)),h=this.adjustContentLayoutArea(h),"string"==typeof this.value||"string"==typeof this.remainingString){var p=null;this.finishedDrawingCell?(p=""===this.remainingString?this.remainingString:this.value,e.drawString(p,d,null,l,h.x+r,this.isHeaderCell?h.y-16:h.y,h.width-r-10,h.height-10,this.style.format)):e.drawString(this.remainingString,d,null,l,h.x+r,this.isHeaderCell?h.y-16:h.y,this.style.format),n=e.stringLayoutResult}return null!=this.style.borders&&this.drawCellBorder(e,t),n},e.prototype.drawCellBackground=function(e,t){var i=new a.PdfSolidBrush(this.style.backgroundColor);null!=i&&(e.save(),e.drawRectangle(i,t.x,t.y,t.width,t.height),e.restore())},e.prototype.adjustContentLayoutArea=function(e){var t=new a.RectangleF(new a.PointF(e.x,e.y),new a.SizeF(e.width,e.height)),i=this.style.padding;if(this.value instanceof r.a){var n=this.value.size;this.style.format.alignment===a.PdfTextAlignment.Center?(t.x+=i.left+(t.width-n.width)/2,t.y+=i.top+(t.height-n.height)/2):this.style.format.alignment===a.PdfTextAlignment.Left?(t.x+=i.left,t.y+=i.top):this.style.format.alignment===a.PdfTextAlignment.Right&&(t.x+=i.left+(t.width-n.width),t.y+=i.top)}else t.x+=i.left,t.y+=i.top;return t},e.prototype.drawCellBorder=function(e,t){if(this.row.treegrid.style.borderOverlapStyle===a.PdfBorderOverlapStyle.Inside&&(t.x+=this.style.borders.left.width,t.y+=this.style.borders.top.width,t.width-=this.style.borders.right.width,t.height-=this.style.borders.bottom.width),this.style.borders.isAll&&this.isHeaderCell)return e.drawRectangle(this.style.borders.left,t.x,t.y,t.width,t.height),void e.restore();var i=new a.PointF(t.x,t.y+t.height),r=new a.PointF(t.x,t.y),n=this.style.borders.left;this.style.borders.left.dashStyle===a.PdfDashStyle.Solid&&(n.lineCap=a.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new a.PointF(t.x+t.width,t.y),r=new a.PointF(t.x+t.width,t.y+t.height),n=this.style.borders.right,t.x+t.width>e.clientSize.width-n.width/2&&(i=new a.PointF(e.clientSize.width-n.width/2,t.y),r=new a.PointF(e.clientSize.width-n.width/2,t.y+t.height)),this.style.borders.right.dashStyle===a.PdfDashStyle.Solid&&(n.lineCap=a.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new a.PointF(t.x,t.y),r=new a.PointF(t.x+t.width,t.y),n=this.style.borders.top,this.style.borders.top.dashStyle===a.PdfDashStyle.Solid&&(n.lineCap=a.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new a.PointF(t.x+t.width,t.y+t.height),r=new a.PointF(t.x,t.y+t.height),n=this.style.borders.bottom,t.y+t.height>e.clientSize.height-n.width/2&&(i=new a.PointF(t.x+t.width,e.clientSize.height-n.width/2),r=new a.PointF(t.x,e.clientSize.height-n.width/2)),this.style.borders.bottom.dashStyle===a.PdfDashStyle.Solid&&(n.lineCap=a.PdfLineCap.Square),e.drawLine(n,i,r),e.restore()},e}()),o=function(){function e(e){this.treegridRow=e,this.cells=[]}return e.prototype.getCell=function(e){if(e<0||e>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[e]},Object.defineProperty(e.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),e.prototype.add=function(e){if(void 0===e){var t=new s;return this.add(t),e}e.row=this.treegridRow,this.cells.push(e)},e.prototype.indexOf=function(e){return this.cells.indexOf(e)},e}(),l=function(){function e(e){this.treegridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this._isParentRow=!1,this.intendLevel=0,this.pdfTreeGrid=e}return Object.defineProperty(e.prototype,"cells",{get:function(){return i.i(n.isNullOrUndefined)(this.treegridCells)&&(this.treegridCells=new o(this)),this.treegridCells},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isParentRow",{get:function(){return this._isParentRow},set:function(e){this._isParentRow=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"treegrid",{get:function(){return this.pdfTreeGrid},set:function(e){this.pdfTreeGrid=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowBreakHeight",{get:function(){return void 0===this.treegridRowBreakHeight&&(this.treegridRowBreakHeight=0),this.treegridRowBreakHeight},set:function(e){this.treegridRowBreakHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowOverflowIndex",{get:function(){return this.treegridRowOverflowIndex},set:function(e){this.treegridRowOverflowIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"level",{get:function(){return this.intendLevel},set:function(e){this.intendLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 0===this.rowHeight&&(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(e){this.rowHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return 0===this.rowWidth&&(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowIndex",{get:function(){return this.treegrid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),e.prototype.measureWidth=function(){for(var e=this.treegrid.columns.columns,t=0,i=0;i<e.length;i++){t+=e[i].width}return t},e.prototype.measureHeight=function(){for(var e=this.cells.getCell(0).height,t=0;t<this.cells.count;t++){var i=this.cells.getCell(t);e=1===i.columnSpan||1===i.rowSpan?Math.max(e,i.height):Math.min(e,i.height),i.height=e}return e},e}(),d=function(){function e(e){this.rows=[],this.treegrid=e}return Object.defineProperty(e.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),e.prototype.addRow=function(e){if(void 0===e){var t=new l(this.treegrid);return this.addRow(t),t}if(0===e.cells.count)for(var i=0;i<this.treegrid.columns.count;i++)e.cells.add(new s);this.rows.push(e)},e.prototype.getRow=function(e){return this.rows[e]},e}(),h=function(){function e(e){this.rows=[],this.treegrid=e,this.rows=[]}return e.prototype.getHeader=function(e){return this.rows[e]},Object.defineProperty(e.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),e.prototype.add=function(e){this.rows.push(e)},e.prototype.indexOf=function(e){return this.rows.indexOf(e)},e}(),p=function(){function e(e){this.columnWidth=0,this.treeColumnIndex=!1,this._headerText="",this._field="",this.treegrid=e}return Object.defineProperty(e.prototype,"headerText",{get:function(){return this._headerText},set:function(e){this._headerText=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"field",{get:function(){return this._field},set:function(e){this._field=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.columnWidth},set:function(e){this.columnWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isTreeColumn",{get:function(){return this.treeColumnIndex},set:function(e){this.treeColumnIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new a.PdfStringFormat),this.stringFormat},set:function(e){this.stringFormat=e},enumerable:!0,configurable:!0}),e}(),u=function(){function e(e){this.internalColumns=[],this.columnWidth=0,this.treegrid=e,this.internalColumns=[]}return e.prototype.add=function(e){for(var t=0;t<e;t++){this.internalColumns.push(new p(this.treegrid));for(var i=0;i<this.treegrid.rows.count;i++){var r=this.treegrid.rows.getRow(i),n=new s;n.value="",r.cells.add(n)}}},Object.defineProperty(e.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),e.prototype.getColumn=function(e){if(e>=0&&e<=this.columns.length)return this.columns[e];throw Error("can not get the column from the index: "+e)},e.prototype.measureColumnsWidth=function(){var e=0;this.treegrid.measureColumnsWidth();for(var t=0,i=this.internalColumns.length;t<i;t++)e+=this.internalColumns[t].width;return e},e.prototype.getDefaultWidths=function(e){for(var t=[],i=this.count,r=0;r<this.count;r++)t[r]=this.internalColumns[r].width,this.internalColumns[r].width>0?(e-=this.internalColumns[r].width,i--):t[r]=0;for(var r=0;r<this.count;r++){var n=e/i;t[r]<=0&&(t[r]=n)}return t},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return o});var r=i(2),n=(i.n(r),i(7)),a=i(11),s=function(){function e(){}return e}(),o=function(){function e(){this.cellSpacing=0,this.borderOverlapStyle=r.PdfBorderOverlapStyle.Overlap,this.allowHorizontalOverflow=!1,this.horizontalOverflowType=a.a.LastPage,this.cellPadding=new n.c}return e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return d}),i.d(t,"b",function(){return h}),i.d(t,"c",function(){return p});var r=i(0),n=(i.n(r),i(7)),a=i(11),s=i(2),o=(i.n(s),i(1)),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),d=function(e){function t(t){var i=e.call(this,t)||this;return i.columnRanges=[],i.repeatRowIndex=-1,i.currentBounds=new s.RectangleF(0,0,0,0),i}return l(t,e),Object.defineProperty(t.prototype,"treegrid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),t.prototype.layoutInternal=function(e){if(i.i(r.isNullOrUndefined)(e))throw Error("Argument Null Expection");this.currentPage=e.page;var t=e.format;if(null!==this.currentPage&&(this.currentPageBounds=this.currentPage.getClientSize()),this.currentGraphics=this.currentPage.graphics,null!==t&&t.break===s.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new s.RectangleF(new s.PointF(e.bounds.x,e.bounds.y),new s.SizeF(this.treegrid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new s.RectangleF(new s.PointF(e.bounds.x,e.bounds.y),this.currentGraphics.clientSize),0===this.treegrid.rows.count)throw Error("Please add row or header into grid");return this.currentBounds.width=e.bounds.width>0?e.bounds.width:this.currentBounds.width-this.treegrid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2,this.startLocation=new s.PointF(e.bounds.x,e.bounds.y),e.bounds.height>0&&(this.currentBounds.height=e.bounds.height),this.treegrid.style.allowHorizontalOverflow||this.treegrid.isFitToWidth?(this.treegrid.measureColumnsWidth(this.currentBounds),this.columnRanges.push([0,this.treegrid.columns.count-1])):(this.treegrid.measureColumnsWidth(),this.determineColumnDrawRanges()),this.layoutOnPage(e)},t.prototype.determineColumnDrawRanges=function(){for(var e=0,t=0,r=0,n=i.i(o.a)(this.currentGraphics.clientSize.width)-this.currentBounds.x,a=0;a<this.treegrid.columns.count;a++)if((r+=this.treegrid.columns.getColumn(a).width)>=n){for(var s=0,l=e;l<=a&&!((s+=this.treegrid.columns.getColumn(l).width)>n);l++)t=l;this.columnRanges.push([e,t]),e=t+1,r=t<=a?this.treegrid.columns.getColumn(a).width:0}this.columnRanges.push([e,this.treegrid.columns.count-1])},t.prototype.getFormat=function(e){return e},t.prototype.layoutOnPage=function(e){for(var t=this.getFormat(e.format),i=null,r=new n.a,o=e.page,l=0;l<this.columnRanges.length;l++){var d=this.columnRanges[l];this.cellStartIndex=d[0],this.cellEndIndex=d[1];for(var h=this.treegrid.rows.count,p=0,u=!1,c=0;c<h;c++){var g=this.treegrid.rows.getRow(c);p++;var f=this.currentBounds.y;null===this.currentPage||r.containsKey(this.currentPage)||r.add(this.currentPage,d);var m=this.drawRow(g);for(f===this.currentBounds.y?(u=!0,this.repeatRowIndex=this.treegrid.rows.rowCollection.indexOf(g)):(u=!1,this.repeatRowIndex=-1);!m.isFinish&&null!==o;)if(this.treegrid.allowRowBreakAcrossPages)this.currentPage=this.getNextPageFormat(t),this.treegrid.enableHeader&&this.drawHeader(),this.checkBounds(t),m=this.drawRow(g);else{if(!this.treegrid.allowRowBreakAcrossPages&&p<length){this.currentPage=this.getNextPageFormat(t),this.treegrid.enableHeader&&this.drawHeader();break}if(p>=length)break}!m.isFinish&&null!==o&&t.layout!==s.PdfLayoutType.OnePage&&u&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageFormat(t),this.treegrid.enableHeader&&this.drawHeader(),this.startLocation.y=this.currentBounds.y,t.paginateBounds===new s.RectangleF(0,0,0,0)&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===n.b.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.drawRow(g),null===this.currentPage||r.containsKey(this.currentPage)||r.add(this.currentPage,d))}this.columnRanges.indexOf(d)<this.columnRanges.length-1&&null!==o&&t.layout!==s.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageFormat(t),this.checkBounds(t))}return i=this.getLayoutResult(),this.treegrid.style.allowHorizontalOverflow&&this.treegrid.style.horizontalOverflowType===a.a.NextPage&&this.reArrangePages(r),i},t.prototype.checkBounds=function(e){var t=new s.PointF(n.b.default.right.width/2,n.b.default.top.width/2);e.paginateBounds===new s.RectangleF(0,0,0,0)&&this.startLocation===t&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)},t.prototype.drawHeader=function(){this.drawRow(this.treegrid.rows.getRow(0))},t.prototype.reArrangePages=function(e){for(var t=this.currentPage.document,i=[],r=e.keys(),n=0;n<r.length;n++){var a=r[n];a.section=null,i.push(a),t.pages.remove(a)}for(var n=0;n<e.size();n++)for(var s=e.size()/this.columnRanges.length,o=n;o<e.size();o+=s){var a=i[o];-1===t.pages.indexOf(a)&&t.pages.add(a)}},t.prototype.getNextPageFormat=function(e){var t=this.currentPage.section,i=null,r=t.indexOf(this.currentPage);return i=r===t.count-1?t.add():t.getPages()[r+1],this.currentGraphics=i.graphics,this.currentBounds=new s.RectangleF(new s.PointF(0,0),i.getClientSize()),i},t.prototype.getLayoutResult=function(){var e=new s.RectangleF(this.startLocation,new s.SizeF(this.currentBounds.width,this.currentBounds.y-this.startLocation.y));return new h(this.currentPage,e)},t.prototype.checkIfDefaultFormat=function(e){var t=new s.PdfStringFormat;return e.alignment===t.alignment&&e.characterSpacing===t.characterSpacing&&e.clipPath===t.clipPath&&e.firstLineIndent===t.firstLineIndent&&e.horizontalScalingFactor===t.horizontalScalingFactor&&e.lineAlignment===t.lineAlignment&&e.lineLimit===t.lineLimit&&e.lineSpacing===t.lineSpacing&&e.measureTrailingSpaces===t.measureTrailingSpaces&&e.noClip===t.noClip&&e.paragraphIndent===t.paragraphIndent&&e.rightToLeft===t.rightToLeft&&e.subSuperScript===t.subSuperScript&&e.wordSpacing===t.wordSpacing&&e.wordWrap===t.wordWrap},t.prototype.drawRow=function(e,t,n){if(i.i(r.isNullOrUndefined)(t)){var a=new s.RowLayoutResult;return n=e.rowBreakHeight>0?e.rowBreakHeight:e.height,n>this.currentPageBounds.height?this.treegrid.allowRowBreakAcrossPages?(a.isFinish=!0,this.drawRowWithBreak(a,e,n)):(a.isFinish=!1,this.drawRow(e,a,n)):this.currentBounds.y+n>this.currentPageBounds.height||this.currentBounds.y+n>this.currentBounds.height?this.repeatRowIndex>-1&&this.repeatRowIndex===e.rowIndex?this.treegrid.allowRowBreakAcrossPages?(a.isFinish=!0,this.drawRowWithBreak(a,e,n)):(a.isFinish=!1,this.drawRow(e,a,n)):a.isFinish=!1:(a.isFinish=!0,this.drawRow(e,a,n)),a}var o=new s.PointF(this.currentBounds.x,this.currentBounds.y);t.bounds=new s.RectangleF(o,new s.SizeF(0,0));var l=0;n=this.reCalculateHeight(e,n);for(var d=this.cellStartIndex;d<=this.cellEndIndex;d++){var h=e.cells.getCell(d),p=this.treegrid.columns.getColumn(d);p.isTreeColumn&&(l=10*e.level);var u=d>this.cellEndIndex+1&&h.columnSpan>1;if(!u)for(var c=1;c<h.columnSpan;c++)e.cells.getCell(d+c).isCellMergeContinue=!0;var g=new s.SizeF(p.width,n);h.columnSpan>1&&(g=new s.SizeF(h.width,n),d+=h.columnSpan),!this.checkIfDefaultFormat(p.format)&&this.checkIfDefaultFormat(h.style.format)&&(h.style.format=p.format),h.draw(this.currentGraphics,new s.RectangleF(o,g),u,l),e.treegrid.style.allowHorizontalOverflow&&(h.columnSpan>this.cellEndIndex||d+h.columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),o.x+=p.width,l=0}return this.currentBounds.y+=n,t.bounds=new s.RectangleF(new s.PointF(t.bounds.x,t.bounds.y),new s.SizeF(o.x,o.y)),null},t.prototype.drawRowWithBreak=function(e,t,i){var r=new s.PointF(this.currentBounds.x,this.currentBounds.y);e.bounds=new s.RectangleF(r,new s.SizeF(0,0));var n=0;this.treegridHeight=this.currentBounds.height,t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height;for(var a=0;a<t.cells.count;a++){var o=t.cells.getCell(a);o.measureHeight()===i&&null===o.value&&(t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height)}for(var l=this.cellStartIndex;l<=this.cellEndIndex;l++){var d=this.treegrid.columns.getColumn(l);d.isTreeColumn&&(n=10*t.level);var o=t.cells.getCell(l),h=o.columnSpan+l>this.cellEndIndex+1&&o.columnSpan>1;if(!h)for(var p=1;p<o.columnSpan;p++)t.cells.getCell(l+p).isCellMergeContinue=!0;var u=this.treegridHeight>0?this.treegridHeight:this.currentBounds.height,c=new s.SizeF(d.width,u);!this.checkIfDefaultFormat(d.format)&&this.checkIfDefaultFormat(o.style.format)&&(o.style.format=d.format),o.draw(this.currentGraphics,new s.RectangleF(r,c),h,n),e.isFinish=e.isFinish?o.finishedDrawingCell:e.isFinish,r.x+=d.width,n=0,this.currentBounds.y+=this.treegridHeight>0?this.treegridHeight:i,e.bounds=new s.RectangleF(new s.PointF(e.bounds.x,e.bounds.y),new s.SizeF(r.x,r.y))}},t.prototype.reCalculateHeight=function(e,t){for(var n=0,a=this.cellStartIndex;a<=this.cellEndIndex;a++)i.i(r.isNullOrUndefined)(e.cells.getCell(a).remainingString)&&""!==e.cells.getCell(a).remainingString||(n=Math.max(n,e.cells.getCell(a).measureHeight()));return Math.max(t,n)},t}(s.ElementLayouter),h=function(e){function t(t,i){return e.call(this,t,i)||this}return l(t,e),t}(s.PdfLayoutResult),p=function(e){function t(t){return void 0===t?e.call(this)||this:e.call(this,t)||this}return l(t,e),t}(s.PdfLayoutFormat)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(2),n=(i.n(r),i(1)),a=i(0),s=(i.n(a),this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},s.apply(this,arguments)}),o=function(){function e(e,t){this.parent=e,this.pdfGantt=t}return e.prototype.add=function(){return new e(this.parent)},e.prototype.findindex=function(e){var t;return this.parent.currentViewData.map(function(i,r){i.index==e&&(t=r)}),t},e.prototype.drawPredecessor=function(e){this.pdfGantt=e;var t,a,o=e.result.page.section.getPages(),l=e.taskbarCollection[this.findindex(this.parentIndex)],d=e.taskbarCollection[this.findindex(this.childIndex)],h=new r.PdfPage,p=new r.PdfPage,u="",c=0,g=0;switch(this.type){case"FS":if(!(d.startPage>-1&&l.endPage>-1))return;h=o[l.endPage],p=o[d.startPage],t=e.pdfPageDetail[l.endPage-e.chartPageIndex],a=e.pdfPageDetail[d.startPage-e.chartPageIndex],u=this.parentIndex<this.childIndex?this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType1":"FSType2":this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType3":"FSType4";break;case"SF":if(!(d.endPage>-1&&l.startPage>-1))return;h=o[l.startPage],p=o[d.endPage],t=e.pdfPageDetail[l.endPage-e.chartPageIndex],a=e.pdfPageDetail[d.startPage-e.chartPageIndex],u=this.parentIndex<this.childIndex?this.parentLeft>this.childLeft+this.childWidth?"SFType1":"SFType2":this.parentLeft>this.childLeft+this.childWidth?"SFType3":"SFType4";break;case"FF":if(!(d.endPage>-1&&l.endPage>-1))return;h=o[l.endPage],p=o[d.endPage],t=e.pdfPageDetail[l.endPage-e.chartPageIndex],a=e.pdfPageDetail[d.endPage-e.chartPageIndex],u=this.parentIndex<this.childIndex?this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType1":"FFType2":this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType3":"FFType4";break;case"SS":if(!(d.startPage>-1&&l.startPage>-1))return;h=o[l.startPage],p=o[d.startPage],t=e.pdfPageDetail[l.startPage-e.chartPageIndex],a=e.pdfPageDetail[d.startPage-e.chartPageIndex],u=this.parentIndex<this.childIndex?this.parentLeft>=this.childLeft?"SSType1":"SSType2":this.parentLeft>=this.childLeft?"SSType3":"SSType4"}var f=Math.round((this.parent.rowHeight-1)/2),m=Math.round((this.parent.rowHeight-10)/2),y=this.parent.renderBaseline?m:f;y=i.i(n.b)(y);var D,v,w,k,b,T;D=v=w=k=b=T=new r.PointF;var S=s({},l.taskStartPoint),P=s({},d.taskStartPoint);c=S.y+t.startPoint.y,g=P.y+a.startPoint.y;var C=new r.PointF(i.i(n.b)(this.parentLeft+this.parentWidth),c+y),M=new r.PointF(i.i(n.b)(this.parentLeft)-1,c+y),R=new r.PointF(i.i(n.b)(this.childLeft-20),g+y),x=new r.PointF(i.i(n.b)(this.childLeft-6-this.lineWidth)-1,g+y),O=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+6+this.lineWidth)+1,g+y);switch(u){case"FSType1":case"FSType3":D=C,v=new r.PointF(i.i(n.b)(this.childLeft-20),c+y),w=R,k=x,this.connectLines(h,p,D,v,w,k,d,y);break;case"FSType2":D=C,v=new r.PointF(D.x+10,c+y),w=new r.PointF(D.x+10,g+2),k=new r.PointF(i.i(n.b)(this.childLeft-20),g+2),b=R,T=x,this.connectLines(h,p,D,v,w,k,d,y,b,T);break;case"FSType4":D=C,v=new r.PointF(D.x+10,c+y),w=new r.PointF(D.x+10,c+2),k=new r.PointF(i.i(n.b)(this.childLeft-20),c+2),b=R,T=x,this.connectLines(h,p,D,v,w,k,d,y,b,T);break;case"FFType1":case"FFType3":D=new r.PointF(i.i(n.b)(this.parentLeft+this.parentWidth)+1,c+y),v=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+20),c+y),w=new r.PointF(v.x,g+y),k=O,this.connectLines(h,p,D,v,w,k,d,y);break;case"FFType2":case"FFType4":D=new r.PointF(i.i(n.b)(this.parentLeft+this.parentWidth)+1,c+y),v=new r.PointF(i.i(n.b)(this.parentLeft+this.parentWidth+20),c+y),w=new r.PointF(v.x,g+y),k=O,this.connectLines(h,p,D,v,w,k,d,y);break;case"SSType1":case"SSType3":D=M,v=new r.PointF(i.i(n.b)(this.childLeft-20),c+y),w=new r.PointF(v.x,g+y),k=x,this.connectLines(h,p,D,v,w,k,d,y);break;case"SSType2":case"SSType4":D=M,v=new r.PointF(i.i(n.b)(this.parentLeft-20),c+y),w=new r.PointF(v.x,g+y),k=x,this.connectLines(h,p,D,v,w,k,d,y);break;case"SFType1":case"SFType3":D=M,v=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+20),c+y),w=new r.PointF(v.x,g+y),k=O,this.connectLines(h,p,D,v,w,k,d,y);break;case"SFType2":D=M,v=new r.PointF(i.i(n.b)(this.parentLeft-20),c+y),w=new r.PointF(v.x,g+2),k=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+20),g+2),b=new r.PointF(k.x,g+y),T=O,this.connectLines(h,p,D,v,w,k,d,y,b,T);break;case"SFType4":D=M,v=new r.PointF(i.i(n.b)(this.parentLeft-20),c+y),w=new r.PointF(v.x,c+2),k=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+20),c+2),b=new r.PointF(k.x,g+y),T=O,this.connectLines(h,p,D,v,w,k,d,y,b,T)}},e.prototype.connectLines=function(e,t,r,n,s,o,l,d,h,p){this.drawLine(e,r,n),this.drawLine(e,n,s),this.drawLine(e,s,o),i.i(a.isNullOrUndefined)(h)||i.i(a.isNullOrUndefined)(p)||(this.drawLine(e,o,h),this.drawLine(e,h,p)),this.drawArrow(t,l,d)},e.prototype.contains=function(e,t,i){return e.x<=t&&t<e.x+e.width&&e.y<=i&&i<e.y+e.height},e.prototype.findPageIndex=function(e){for(var t=-1,i=0;i<this.pdfGantt.pdfPageDetail.length;i++){var n=this.pdfGantt.pdfPageDetail[i],a=new r.RectangleF(n.startPoint.x,n.startPoint.y,n.width,n.height);if(this.contains(a,e.x,e.y)){t=i;break}}return t},e.prototype.drawLine=function(e,t,a){var o=this.pdfGantt.result.page.section.getPages(),l=e.graphics,d=s({},a),h=s({},a),p=s({},a),u=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],c=new r.RectangleF(u.startPoint.x,u.startPoint.y,u.width,u.height),g=this.contains(c,t.x,t.y),f=this.contains(c,a.x,a.y),m=-1;if(t=new r.PointF(t.x,t.y),a=new r.PointF(a.x,a.y),!g&&!f||f&&!g)(m=this.findPageIndex(t))>-1&&(u=this.pdfGantt.pdfPageDetail[m],h=t,d=a,this.drawLine(o[m+this.pdfGantt.chartPageIndex],h,d));else if(!f&&g){var y=c.x,D=c.x+c.width,v=c.y+c.height,w=c.y;y>a.x?(p.x=a.x=y-1,h.x=y-1):D<a.x?(p.x=a.x=D,h.x=D,p.x+=1):v<a.y?(p.y=a.y=v,h.y=v,p.y+=1,this.pdfGantt.enableHeader&&(h.y+=this.parent.timelineModule.isSingleTier?i.i(n.b)(45):i.i(n.b)(62))):w>a.y&&(h.y=p.y=w-1,a.y=w,this.pdfGantt.enableHeader&&(p.y+=this.parent.timelineModule.isSingleTier?i.i(n.b)(45):i.i(n.b)(62),a.y+=this.parent.timelineModule.isSingleTier?i.i(n.b)(45):i.i(n.b)(62))),m=this.findPageIndex(p),-1!==m&&this.drawLine(o[m+this.pdfGantt.chartPageIndex],h,d)}if(g){t=new r.PointF(t.x,t.y),a=new r.PointF(a.x,a.y),t.x=t.x+u.pageStartX-u.startPoint.x,t.y=t.y-u.startPoint.y,a.x=a.x+u.pageStartX-u.startPoint.x,a.y=a.y-u.startPoint.y;var k=new r.PdfSolidBrush(this.connectorLineColor),b=new r.PdfPen(k,i.i(n.b)(this.lineWidth));l.drawLine(b,t,a)}},e.prototype.drawArrow=function(e,t,a){var s,o=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],l=new r.RectangleF(new r.PointF(o.startPoint.x,o.startPoint.y),new r.SizeF(o.width,o.height)),d=new r.PointF,h=e.section.getPages(),p=6+this.lineWidth;if(d="FS"===this.type||"SS"===this.type?new r.PointF(i.i(n.b)(this.childLeft)-1,t.taskStartPoint.y+o.startPoint.y):new r.PointF(i.i(n.b)(this.childLeft+this.childWidth)+1,t.taskStartPoint.y+o.startPoint.y),!this.contains(l,d.x,d.y)){var u=this.findPageIndex(d);u>-1&&(o=this.pdfGantt.pdfPageDetail[u],e=h[u+this.pdfGantt.chartPageIndex])}var c=e.graphics;d.x=d.x-o.startPoint.x+o.pageStartX,d.y=d.y-o.startPoint.y;var g=new r.PointF(d.x,d.y+a);s="FS"===this.type||"SS"===this.type?new r.PointF(g.x-i.i(n.b)(p),g.y-i.i(n.b)(p)):new r.PointF(g.x+i.i(n.b)(p),g.y-i.i(n.b)(p));var f=new r.PointF(s.x,s.y+i.i(n.b)(2*p)),m=new r.PdfSolidBrush(this.connectorLineColor),y=new r.PdfPen(m,i.i(n.b)(this.lineWidth));c.drawLine(y,g,s),c.drawLine(y,s,f),c.drawLine(y,f,g)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return u});var r=i(58),n=i(0),a=(i.n(n),i(2)),s=(i.n(a),i(18)),o=i(59),l=i(1),d=i(56),h=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),p=this&&this.__assign||function(){return p=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},p.apply(this,arguments)},u=function(e){function t(t){var i=e.call(this)||this;return i.exportProps={},i.parent=t,i.chartHeader=new o.a(i),i.predecessor=new d.a(t,i),i.headerDetails=[],i.pdfPageDetail=[],i.taskbarCollection=[],i.predecessorCollection=[],i}return h(t,e),Object.defineProperty(t.prototype,"taskbar",{get:function(){return i.i(n.isNullOrUndefined)(this.taskbars)&&(this.taskbars=new r.a(this.parent)),this.taskbars},enumerable:!0,configurable:!0}),t.prototype.drawChart=function(e){this.result=e,this.totalPages=this.result.page.section.count,this.perColumnPages=this.totalPages/this.layouter.columnRanges.length,this.calculateRange(),this.drawGantttChart(),this.drawPageBorder()},t.prototype.calculateRange=function(){for(var e=this.layouter.columnRanges[this.layouter.columnRanges.length-1],t=0,r=!0,s=0,o=0,d=0,h=i.i(l.b)(this.chartHeader.width),p=this.parent.timelineModule,u=e[0];u<=e[1];u++)t+=this.layouter.treegrid.columns.getColumn(u).width;for(t+=.5,t+100<this.result.page.getClientSize().width?(o=this.result.page.getClientSize().width-t,this.chartPageIndex=this.startPageIndex=this.totalPages-this.perColumnPages,r=!1,this.startPoint=new a.PointF(t,0)):(this.result.page.section.add(),this.chartPageIndex=this.startPageIndex=this.totalPages,r=!0,this.startPoint=new a.PointF(d,0));Math.round(d)<Math.round(h);){r?s=this.result.page.getClientSize().width:(s=o,r=!0);var c={},g=[],f=i.i(l.b)(this.chartHeader.bottomTierCellWidth),m=0;0!==this.chartHeader.bottomTierCellWidth&&(m=Math.floor(s/f)*f),g[0]=d,h-d<=m?(g[1]=h,c.totalWidth=i.i(l.a)(h-d)):(g[1]=d+m,c.totalWidth=i.i(l.a)(m)),c.startPoint=g[0],c.endPoint=g[1],0===this.parent.cloneProjectStartDate.getHours()&&0===this.parent.cloneProjectStartDate.getMinutes()&&0===this.parent.cloneProjectStartDate.getSeconds()&&this.parent.cloneProjectStartDate.setHours(8);var y=this.parent.dataOperation.getDateFromFormat(this.parent.timelineModule.timelineStartDate),D=i.i(n.isNullOrUndefined)(p.customTimelineSettings.bottomTier.count)?p.customTimelineSettings.topTier.count:p.customTimelineSettings.bottomTier.count;switch("None"===p.customTimelineSettings.bottomTier.unit?p.customTimelineSettings.topTier.unit:p.customTimelineSettings.bottomTier.unit){case"Minutes":c.startDate=new Date(y.getTime());var v=Math.floor(i.i(l.a)(c.startPoint)/this.chartHeader.bottomTierCellWidth);c.startDate.setMinutes(c.startDate.getMinutes()+v*D),c.startDate.setSeconds(c.startDate.getSeconds()+1),c.endDate=new Date(c.startDate.getTime());var w=Math.floor(i.i(l.a)(c.endPoint-c.startPoint)/this.chartHeader.bottomTierCellWidth);c.endDate.setMinutes(c.endDate.getMinutes()+w*D);break;case"Hour":c.startDate=new Date(y.getTime());var k=Math.floor(i.i(l.a)(c.startPoint)/this.chartHeader.bottomTierCellWidth);c.startDate.setHours(c.startDate.getHours()+k*D),c.startDate.setMinutes(c.startDate.getMinutes()+1),c.endDate=new Date(c.startDate.getTime());var b=Math.floor(i.i(l.a)(c.endPoint-c.startPoint)/this.chartHeader.bottomTierCellWidth);c.endDate.setHours(c.endDate.getHours()+b*D);break;case"Day":c.startDate=new Date(y.getTime());var T=Math.round(c.startPoint/i.i(l.b)(this.chartHeader.bottomTierCellWidth));c.startDate.setDate(c.startDate.getDate()+T*D);var S=Math.round((c.endPoint-c.startPoint)/i.i(l.b)(this.chartHeader.bottomTierCellWidth))-1;c.endDate=new Date(c.startDate.getTime()),c.endDate.setDate(c.startDate.getDate()+S*D);break;case"Week":c.startDate=new Date(y.getTime());var P=c.startPoint/i.i(l.b)(this.chartHeader.bottomTierCellWidth)*7;c.startDate.setDate(c.startDate.getDate()+P*D);var C=7*Math.round((c.endPoint-c.startPoint)/i.i(l.b)(this.chartHeader.bottomTierCellWidth))-1;c.endDate=new Date(c.startDate.getTime()),c.endDate.setDate(c.startDate.getDate()+C*D);break;case"Month":c.startDate=new Date(y.getTime());var M=c.startPoint/i.i(l.b)(this.chartHeader.bottomTierCellWidth)*31;c.startDate.setDate(c.startDate.getDate()+M*D);var R=31*Math.round((c.endPoint-c.startPoint)/i.i(l.b)(this.chartHeader.bottomTierCellWidth))-1;c.endDate=new Date(c.startDate.getTime()),c.endDate.setDate(c.startDate.getDate()+R*D);break;case"Year":c.startDate=new Date(y.getTime());var x=c.startPoint/i.i(l.b)(this.chartHeader.bottomTierCellWidth)*365;c.startDate.setDate(c.startDate.getDate()+x*D);var O=365*Math.round((c.endPoint-c.startPoint)/i.i(l.b)(this.chartHeader.bottomTierCellWidth))-1;c.endDate=new Date(c.startDate.getTime()),c.endDate.setDate(c.startDate.getDate()+O*D)}this.headerDetails.push(c),d+=m}},t.prototype.drawPageBorder=function(){for(var e=this.result.page.section.getPages(),t=0;t<e.length;t++){var i=e[t],r=i.graphics,n=i.getClientSize(),s=new a.PdfPen(new a.PdfColor(206,206,206));r.drawRectangle(s,0,0,n.width,n.height)}},t.prototype.drawGantttChart=function(){var e,t=this,r=this.startPoint,n=new a.PointF,s=0,o=0,d=0,h=0;this.headerDetails.forEach(function(u,c){var g=t.result.page.section.getPages()[t.startPageIndex];g.contentWidth=i.i(l.a)(t.headerDetails[c].endPoint-t.headerDetails[c].startPoint),t.chartHeader.drawTimeline(g,t.startPoint,u),r.y=r.y+i.i(l.b)(t.parent.timelineModule.isSingleTier?45:60),s=r.x,d=i.i(l.b)(t.parent.timelineModule.isSingleTier?45:60),t.headerDetails[t.headerDetails.indexOf(u)].startIndex=t.startPageIndex,t.headerDetails[t.headerDetails.indexOf(u)].pageStartPoint=r;for(var f=0;f<t.taskbarCollection.length;f++){var m=t.taskbarCollection[f],y=t.rows.getRow(f+1).height,D=t.result.page.section.getPages()[t.startPageIndex],v=D.graphics,w=new a.PdfPen(new a.PdfColor(206,206,206));!g.contentWidth||"Both"!=t.parent.gridLines&&"Horizontal"!=t.parent.gridLines||v.drawRectangle(w,s,r.y,g.contentWidth+.5,y);m.drawTaskbar(D,r,u,o,y,t.taskbarCollection[f])&&(t.enableHeader?r.y=i.i(l.b)(t.parent.timelineModule.isSingleTier?45:60):r.y=0,t.startPageIndex++,e={},e.height=d,e.pageStartX=s,e.startPoint=p({},n),e.width=i.i(l.b)(u.totalWidth),t.pdfPageDetail.push(e),n.y+=e.height,t.enableHeader?d=t.chartHeader.height:(r.y=0,d=0)),r.y+=y,d+=y,h+=y}t.headerDetails[c].endIndex=t.startPageIndex,o+=u.totalWidth,e={},e.height=d,e.pageStartX=s,e.startPoint=p({},n),e.width=i.i(l.b)(u.totalWidth),t.pdfPageDetail.push(e),n.x+=e.width,n.y=0,t.enableHeader?d=t.chartHeader.height:r.y=0,t.headerDetails.indexOf(u)!==t.headerDetails.length-1&&(t.result.page.section.add(),t.startPageIndex=t.result.page.section.count-1,r=t.startPoint=new a.PointF(0,0))});for(var u=0;u<this.predecessorCollection.length;u++){this.predecessorCollection[u].drawPredecessor(this)}},t}(s.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(2),n=(i.n(r),i(1)),a=i(0),s=(i.n(a),this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},s.apply(this,arguments)}),o=function(){function e(e){this.baselineHeight=8,this.leftTaskLabel={},this.rightTaskLabel={},this.startPage=-1,this.endPage=-1,this.parent=e}return e.prototype.add=function(){return new e(this.parent)},e.prototype.GetNextPage=function(e){var t=e.section,i=t.indexOf(e);return i===t.count-1?t.add():t.getPages()[i+1]},e.prototype.drawTaskbar=function(e,t,o,l,d,h){var p=e.graphics,u=!1,c=e.getClientSize();if(t.y+d>c.height){e=this.GetNextPage(e),e.contentWidth=i.i(n.a)(o.endPoint-o.startPoint),p=e.graphics,t.y=0,this.parent.pdfExportModule.gantt.enableHeader&&(this.parent.pdfExportModule.gantt.chartHeader.drawPageTimeline(e,t,o),t.y=i.i(n.b)(this.parent.timelineModule.isSingleTier?45:60)),u=!0;var g=e.graphics,f=new r.PdfPen(new r.PdfColor(206,206,206));!e.contentWidth||"Both"!=this.parent.gridLines&&"Horizontal"!=this.parent.gridLines||g.drawRectangle(f,t.x,t.y,e.contentWidth+.5,d)}this.drawLeftLabel(e,t,o,l);var m=new r.PdfStandardFont(this.fontFamily,9,r.PdfFontStyle.Regular);!i.i(a.isNullOrUndefined)(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(m=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var y=new r.PdfSolidBrush(this.progressFontColor),D=new r.PdfStringFormat;D.lineAlignment=r.PdfVerticalAlignment.Middle,D.alignment=r.PdfTextAlignment.Right;var v,w=!1;/^[a-zA-Z]/.test(this.taskLabel)&&(w=!0,D.alignment=r.PdfTextAlignment.Left);var k=-1;if(h.isMilestone)this.drawMilestone(e,t,o,l),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&this.drawMilestone(e,t,o,l);else{var b=new r.PdfPen(h.taskBorderColor),T=new r.PdfSolidBrush(h.taskColor),S=new r.PdfPen(h.baselineBorderColor),P=new r.PdfSolidBrush(h.baselineColor),C=new r.PdfPen(h.progressColor),M=new r.PdfSolidBrush(h.progressColor),R=i.i(n.b)((this.parent.rowHeight-this.height)/2),x=i.i(n.b)((this.parent.rowHeight-this.height)/4.5),O=this.parent.renderBaseline?x:R;k=e.section.indexOf(e);var I=i.i(a.isNullOrUndefined)(this.unscheduleStarteDate)?this.startDate:this.unscheduleStarteDate,E=i.i(a.isNullOrUndefined)(this.unscheduleEndDate)?this.endDate:this.unscheduleEndDate;if(o.startDate<=I&&E<=o.endDate)this.isStartPoint||(this.taskStartPoint=s({},t),this.isStartPoint=!0),this.isScheduledTask||"duration"===this.unscheduledTaskBy?(this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&p.drawRectangle(S,P,t.x+i.i(n.b)(h.baselineLeft-l)+.5,t.y+O+i.i(n.b)(h.height+3),i.i(n.b)(this.baselineWidth),i.i(n.b)(this.baselineHeight)),p.drawRectangle(b,T,t.x+i.i(n.b)(this.left-l)+.5,t.y+O,i.i(n.b)(h.width),i.i(n.b)(h.height)),this.isScheduledTask&&(p.drawRectangle(C,M,t.x+i.i(n.b)(this.left-l)+.5,t.y+O,i.i(n.b)(h.progressWidth),i.i(n.b)(h.height)),i.i(a.isNullOrUndefined)(this.parent.labelSettings.taskLabel)||i.i(a.isNullOrUndefined)(this.taskLabel)||(v=this.progressWidth,w&&(v=this.width),p.drawString(this.taskLabel.toString(),m,null,y,t.x+i.i(n.b)(this.left-l),t.y+O,i.i(n.b)(v),i.i(n.b)(this.height),D)))):this.drawUnscheduledTask(p,t,l,O),this.isCompleted=!0,this.startPage=k,this.endPage=k;else if(o.startDate<=I&&o.endDate>=I&&E>=o.endDate){this.isStartPoint||(this.taskStartPoint=s({},t),this.isStartPoint=!0);var N=0;if(w||(this.width=this.width-(o.totalWidth-(this.left-l))),N=o.totalWidth-(this.left-l),this.isScheduledTask||"duration"===this.unscheduledTaskBy){if(this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&p.drawRectangle(S,P,t.x+i.i(n.b)(h.baselineLeft-l)+.5,t.y+O+i.i(n.b)(h.height+3),i.i(n.b)(this.baselineWidth),i.i(n.b)(this.baselineHeight)),p.drawRectangle(b,T,t.x+i.i(n.b)(this.left-l)+.5,t.y+O,i.i(n.b)(N),i.i(n.b)(h.height)),h.width=h.width-N,this.isScheduledTask){var F=0;F=this.progressWidth<=N?this.progressWidth:N,p.drawRectangle(C,M,t.x+i.i(n.b)(this.left-l)+.5,t.y+O,i.i(n.b)(F),i.i(n.b)(h.height)),this.progressWidth-=F,this.parent.labelSettings.taskLabel&&!i.i(a.isNullOrUndefined)(this.taskLabel)&&(v=F,w&&(v=this.width),p.drawString(this.taskLabel.toString(),m,null,y,t.x+i.i(n.b)(this.left-l),t.y+O,i.i(n.b)(v),i.i(n.b)(this.height),D))}}else this.drawUnscheduledTask(p,t,l,O);this.left=0,this.isCompleted=!1,this.startPage=k}else if(E<=o.endDate&&o.startDate<=E&&!this.isCompleted)this.isStartPoint||(this.taskStartPoint=s({},t),this.isStartPoint=!0),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&p.drawRectangle(S,P,t.x+i.i(n.b)(h.baselineLeft-l)+.5,t.y+O+i.i(n.b)(h.height+3),i.i(n.b)(this.baselineWidth),i.i(n.b)(this.baselineHeight)),p.drawRectangle(b,T,t.x+i.i(n.b)(h.left+.5),t.y+O,i.i(n.b)(h.width),i.i(n.b)(h.height)),this.isScheduledTask&&(p.drawRectangle(C,M,t.x+i.i(n.b)(h.left+.5),t.y+O,i.i(n.b)(h.progressWidth),i.i(n.b)(h.height)),i.i(a.isNullOrUndefined)(this.taskLabel)||(v=this.progressWidth,w&&(v=this.width),p.drawString(this.taskLabel.toString(),m,null,y,t.x+i.i(n.b)(this.left),t.y+O,i.i(n.b)(v),i.i(n.b)(this.height),D))),this.isCompleted=!0,this.endPage=k;else if(I<o.startDate&&E>o.endDate){if(this.isStartPoint||(this.taskStartPoint=s({},t),this.isStartPoint=!0),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&p.drawRectangle(S,P,t.x+i.i(n.b)(h.baselineLeft-l)+.5,t.y+O+i.i(n.b)(h.height+3),i.i(n.b)(this.baselineWidth),i.i(n.b)(this.baselineHeight)),p.drawRectangle(b,T,t.x+i.i(n.b)(h.left)+.5,t.y+O,i.i(n.b)(o.totalWidth),i.i(n.b)(h.height)),this.isScheduledTask){var F=0;F=this.progressWidth<=o.totalWidth?this.progressWidth:o.totalWidth,p.drawRectangle(C,M,t.x+i.i(n.b)(h.left)+.5,t.y+O,i.i(n.b)(F),i.i(n.b)(h.height)),this.progressWidth-=F,i.i(a.isNullOrUndefined)(this.taskLabel)||(v=F,w&&(v=this.width),p.drawString(this.taskLabel.toString(),m,null,y,t.x+i.i(n.b)(this.left),t.y+O,i.i(n.b)(v),i.i(n.b)(this.height),D))}this.isCompleted=!1,this.width-=o.totalWidth}}return this.drawRightLabel(e,t,o,l),u},e.prototype.drawRightLabel=function(e,t,s,o){var l,d=e.graphics;l=this.rightTaskLabel.isLeftCalculated?this.rightTaskLabel.left:i.i(n.b)(this.rightTaskLabel.left);var h=l-i.i(n.b)(o)+t.x;if(s.startPoint<=l&&l<s.endPoint&&!i.i(a.isNullOrUndefined)(this.rightTaskLabel.value)&&!this.rightTaskLabel.isCompleted){var p=this.getWidth(this.rightTaskLabel.value,s.endPoint-l,15),u=new r.PdfStandardFont(this.fontFamily,9);!i.i(a.isNullOrUndefined)(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(u=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var c=(i.i(n.b)(this.parent.rowHeight)-p.actualSize.height)/2,g=new r.PointF(h,t.y+c),f=new r.SizeF(p.actualSize.width,p.actualSize.height),m=new r.RectangleF(g,f),y=new r.PdfStringFormat;if(y.alignment=r.PdfTextAlignment.Right,y.lineAlignment=r.PdfVerticalAlignment.Middle,p.actualSize.width>0){var D=new r.PdfSolidBrush(this.labelColor);d.drawString(p.lines[0].text,u,null,D,m.x,m.y,p.actualSize.width,p.actualSize.height,y),null!==p.remainder?(this.rightTaskLabel.value=p.remainder,this.rightTaskLabel.left=s.endPoint,this.rightTaskLabel.isLeftCalculated=!0):this.rightTaskLabel.isCompleted=!0}else this.rightTaskLabel.left=s.endPoint}},e.prototype.drawLeftLabel=function(e,t,s,o){var l,d=e.graphics;if(!i.i(a.isNullOrUndefined)(this.leftTaskLabel.value)){var h=0;if(h=this.left,this.leftTaskLabel.isLeftCalculated)l=this.leftTaskLabel.left;else{var p=this.getWidth(this.leftTaskLabel.value,Number.MAX_VALUE,15),u=this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33;l=i.i(n.b)(h-u)-p.actualSize.width,this.leftTaskLabel.left=l,this.leftTaskLabel.isLeftCalculated=!0}var c=l-i.i(n.b)(o)+t.x;if(s.startPoint<=l&&l<s.endPoint&&!i.i(a.isNullOrUndefined)(this.leftTaskLabel.value)&&!this.leftTaskLabel.isCompleted){var p=this.getWidth(this.leftTaskLabel.value,s.endPoint-l,15),g=new r.PdfStandardFont(this.fontFamily,9);!i.i(a.isNullOrUndefined)(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(g=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var f=(i.i(n.b)(this.parent.rowHeight)-p.actualSize.height)/2,m=new r.PointF(c,t.y+f),y=new r.SizeF(p.actualSize.width,p.actualSize.height),D=new r.RectangleF(m,y),v=new r.PdfStringFormat;if(v.alignment=r.PdfTextAlignment.Right,v.lineAlignment=r.PdfVerticalAlignment.Middle,p.actualSize.width>0){var w=new r.PdfSolidBrush(this.labelColor);d.drawString(p.lines[0].text,g,null,w,D.x,D.y,p.actualSize.width,p.actualSize.height,v),null!==p.remainder?(this.leftTaskLabel.value=p.remainder,this.leftTaskLabel.left=s.endPoint):this.leftTaskLabel.isCompleted=!0}else this.leftTaskLabel.left=s.endPoint}}},e.prototype.getWidth=function(e,t,n){var s=new r.PdfStandardFont(this.fontFamily,9);!i.i(a.isNullOrUndefined)(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(s=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var o=new r.PdfStringLayouter,l=new r.PdfStringFormat;return l.alignment=r.PdfTextAlignment.Left,l.wordWrap=r.PdfWordWrapType.Character,l.lineAlignment=r.PdfVerticalAlignment.Middle,o.layout(e,s,l,new r.SizeF(t,n),!1,new r.SizeF(t,n))},e.prototype.drawUnscheduledTask=function(e,t,a,s){var o=new r.PdfSolidBrush(this.taskColor);e.drawRectangle(o,t.x+i.i(n.b)(this.left-a),t.y+s,i.i(n.b)(3),i.i(n.b)(this.height))},e.prototype.drawMilestone=function(e,t,a,o){if(a.startDate<=this.startDate&&this.startDate<=a.endDate){var l=e.graphics,d=e.section.indexOf(e);this.taskStartPoint=s({},t);var h=new r.PdfPen(this.milestoneColor),p=i.i(n.b)((this.parent.rowHeight-this.height)/3),u=i.i(n.b)((this.parent.rowHeight-this.height)/2),c=this.parent.renderBaseline?p:u,g=new r.PdfSolidBrush(this.milestoneColor),f=new r.PdfPen(this.baselineBorderColor),m=new r.PdfSolidBrush(this.baselineColor);l.save();var y=Math.floor(.8*this.parent.chartRowsModule.taskBarHeight);l.translateTransform(t.x+i.i(n.b)(this.left-o),t.y+c-.7*this.parent.chartRowsModule.taskBarHeight/2),l.rotateTransform(45),this.parent.renderBaseline&&this.baselineStartDate&&this.baselineEndDate&&l.drawRectangle(f,m,2,2,i.i(n.b)(y),i.i(n.b)(y)),l.drawRectangle(h,g,0,0,i.i(n.b)(y),i.i(n.b)(y)),l.restore(),this.endPage=this.startPage=d}},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(2),n=(i.n(r),i(0)),a=(i.n(n),i(1)),s=function(){function e(e){this.width=0,this.gantt=e,this.parent=e.parent,this.topTierPoint=new r.PointF,this.bottomTierPoint=new r.PointF,this.topTierIndex=0,this.bottomTierIndex=0,this.prevTopTierIndex=0,this.prevBottomTierIndex=0}return e.prototype.drawTimeline=function(e,t,n){var s=i.i(a.a)(Math.floor(n.totalWidth)),o=0;for(this.topTierPoint.x=t.x,this.topTierPoint.y=t.y,this.prevTopTierIndex=this.topTierIndex,this.prevBottomTierIndex=this.bottomTierIndex;s>0;){var l=this.topTier[this.topTierIndex];if(this.topTier.length>this.topTierIndex){var d=!1;this.topTier[this.topTierIndex].isFinished||(s>=l.width?(o=l.width,l.isFinished=!0,l.completedWidth=o,d=!0):(o=s,d=!1,l.isFinished=!1,l.width=l.width-s,l.completedWidth=o)),this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,o,l.value,!0),this.topTierPoint.x+=o,s-=o,d&&this.topTierIndex++}else s=0}s=Math.floor(n.totalWidth);var h=this.parent.timelineModule.isSingleTier?0:this.topTierHeight;for(this.bottomTierPoint=new r.PointF(t.x,i.i(a.b)(t.y+h));s>0;){var p=this.bottomTier[this.bottomTierIndex];if(this.bottomTier.length>this.bottomTierIndex){var d=!0,u=p.width;s<u&&(u=s,d=!1,p.completedWidth=u),this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,u,p.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+u,s-=u,p.completedWidth=u,d&&this.bottomTierIndex++}else s=0}},e.prototype.drawPageTimeline=function(e,t,r){this.topTierPoint=i.i(n.extend)({},{},t,!0);for(var s=this.prevTopTierIndex;s<=this.topTierIndex;s++)if(this.topTier.length>s){var o=this.topTier[s];o.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,o.completedWidth,o.value,!0),this.topTierPoint.x+=o.completedWidth)}this.bottomTierPoint.x=t.x,this.bottomTierPoint.y=i.i(a.b)(t.y+this.topTierHeight);for(var s=this.prevBottomTierIndex;s<=this.bottomTierIndex;s++)if(this.bottomTier.length>s){var l=this.bottomTier[s];l.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,l.width,l.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+l.width)}},e.prototype.triggerQueryTimelinecell=function(e,t,s,o,l,d,h){var p=e.graphics,u={},c=this.gantt.ganttStyle;u.borderColor=new r.PdfColor(c.timeline.borderColor),u.fontColor=new r.PdfColor(c.timeline.fontColor),u.fontSize=c.timeline.fontSize,u.fontStyle=c.timeline.fontStyle,u.backgroundColor=new r.PdfColor(c.timeline.backgroundColor),c.timeline.padding&&(u.padding=c.timeline.padding);var g=new r.PdfStringFormat;i.i(n.isNullOrUndefined)(c.timeline.format)?h?(g.lineAlignment=r.PdfVerticalAlignment.Middle,g.alignment=r.PdfTextAlignment.Left):(g.lineAlignment=r.PdfVerticalAlignment.Middle,g.alignment=r.PdfTextAlignment.Center,g.wordWrap=r.PdfWordWrapType.Character):g=c.timeline.format,u.format=g;var f={timelineCell:u,value:d};this.parent.pdfQueryTimelineCellInfo&&this.parent.trigger("pdfQueryTimelineCellInfo",f);var m=f.timelineCell,y=new r.PdfPen(f.timelineCell.borderColor),D=new r.PdfSolidBrush(f.timelineCell.backgroundColor);p.drawRectangle(y,D,t,s,l,i.i(a.b)(o)),h||"Both"!=this.parent.gridLines&&"Vertical"!=this.parent.gridLines||p.drawRectangle(y,D,t,s+i.i(a.b)(o),l,e.getClientSize().height);var v=new r.PdfStandardFont(c.fontFamily,m.fontSize,m.fontStyle);c.font&&(v=c.font);var w=new r.PdfSolidBrush(f.timelineCell.fontColor),k=c.timeline.padding?f.timelineCell.padding.left:0,b=c.timeline.padding?f.timelineCell.padding.top:0;h?t=t+k+4:t+=k,p.drawString(f.value,v,null,w,t,s+b,i.i(a.b)(l),i.i(a.b)(o),m.format)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"type",void 0),a([i.i(r.Property)(null)],t.prototype,"headerText",void 0),a([i.i(r.Property)([])],t.prototype,"fields",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"from",void 0),a([i.i(r.Property)(null)],t.prototype,"to",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"type",void 0),a([i.i(r.Property)(null)],t.prototype,"headerText",void 0),a([i.i(r.Property)([])],t.prototype,"fields",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(!1)],t.prototype,"allowEditing",void 0),a([i.i(r.Property)(!1)],t.prototype,"allowAdding",void 0),a([i.i(r.Property)(!1)],t.prototype,"allowDeleting",void 0),a([i.i(r.Property)("Auto")],t.prototype,"mode",void 0),a([i.i(r.Property)("Top")],t.prototype,"newRowPosition",void 0),a([i.i(r.Property)(!1)],t.prototype,"showDeleteConfirmDialog",void 0),a([i.i(r.Property)(!1)],t.prototype,"allowTaskbarEditing",void 0),a([i.i(r.Property)(!1)],t.prototype,"allowNextRowEdit",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"day",void 0),a([i.i(r.Property)(null)],t.prototype,"label",void 0),a([i.i(r.Property)(null)],t.prototype,"cssClass",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(5)),a=(i.n(n),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),s=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),s([i.i(r.Collection)([],n.Predicate)],t.prototype,"columns",void 0),s([i.i(r.Property)("Menu")],t.prototype,"type",void 0),s([i.i(r.Property)()],t.prototype,"operators",void 0),s([i.i(r.Property)(!1)],t.prototype,"ignoreAccent",void 0),s([i.i(r.Property)("Parent")],t.prototype,"hierarchyMode",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"from",void 0),a([i.i(r.Property)(null)],t.prototype,"to",void 0),a([i.i(r.Property)(null)],t.prototype,"label",void 0),a([i.i(r.Property)(null)],t.prototype,"cssClass",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"rightLabel",void 0),a([i.i(r.Property)(null)],t.prototype,"leftLabel",void 0),a([i.i(r.Property)(null)],t.prototype,"taskLabel",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)("Spinner")],t.prototype,"indicatorType",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"id",void 0),a([i.i(r.Property)(null)],t.prototype,"name",void 0),a([i.i(r.Property)(null)],t.prototype,"unit",void 0),a([i.i(r.Property)(null)],t.prototype,"group",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)([])],t.prototype,"fields",void 0),a([i.i(r.Property)(!1)],t.prototype,"ignoreCase",void 0),a([i.i(r.Property)("contains")],t.prototype,"operator",void 0),a([i.i(r.Property)("")],t.prototype,"key",void 0),a([i.i(r.Property)("Parent")],t.prototype,"hierarchyMode",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)("Row")],t.prototype,"mode",void 0),a([i.i(r.Property)("Flow")],t.prototype,"cellSelectionMode",void 0),a([i.i(r.Property)("Single")],t.prototype,"type",void 0),a([i.i(r.Property)(!1)],t.prototype,"persistSelection",void 0),a([i.i(r.Property)(!1)],t.prototype,"enableToggle",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return o});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)()],t.prototype,"field",void 0),a([i.i(r.Property)()],t.prototype,"direction",void 0),t}(r.ChildProperty),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Collection)([],s)],t.prototype,"columns",void 0),a([i.i(r.Property)(!0)],t.prototype,"allowUnsort",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"position",void 0),a([i.i(r.Property)(-1)],t.prototype,"columnIndex",void 0),a([i.i(r.Property)(4)],t.prototype,"separatorSize",void 0),a([i.i(r.Property)(null)],t.prototype,"minimum",void 0),a([i.i(r.Property)("Default")],t.prototype,"view",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"id",void 0),a([i.i(r.Property)(null)],t.prototype,"name",void 0),a([i.i(r.Property)(null)],t.prototype,"parentID",void 0),a([i.i(r.Property)(null)],t.prototype,"hasChildMapping",void 0),a([i.i(r.Property)(null)],t.prototype,"startDate",void 0),a([i.i(r.Property)(null)],t.prototype,"endDate",void 0),a([i.i(r.Property)(null)],t.prototype,"dependency",void 0),a([i.i(r.Property)(null)],t.prototype,"progress",void 0),a([i.i(r.Property)(null)],t.prototype,"child",void 0),a([i.i(r.Property)(null)],t.prototype,"milestone",void 0),a([i.i(r.Property)(null)],t.prototype,"duration",void 0),a([i.i(r.Property)(null)],t.prototype,"durationUnit",void 0),a([i.i(r.Property)(null)],t.prototype,"cssClass",void 0),a([i.i(r.Property)(null)],t.prototype,"baselineStartDate",void 0),a([i.i(r.Property)(null)],t.prototype,"baselineEndDate",void 0),a([i.i(r.Property)(null)],t.prototype,"resourceInfo",void 0),a([i.i(r.Property)(null)],t.prototype,"expandState",void 0),a([i.i(r.Property)(null)],t.prototype,"indicators",void 0),a([i.i(r.Property)(null)],t.prototype,"notes",void 0),a([i.i(r.Property)(null)],t.prototype,"work",void 0),a([i.i(r.Property)(null)],t.prototype,"manual",void 0),a([i.i(r.Property)(null)],t.prototype,"type",void 0),a([i.i(r.Property)(null)],t.prototype,"segments",void 0),a([i.i(r.Property)(null)],t.prototype,"segmentId",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return o});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)("")],t.prototype,"format",void 0),a([i.i(r.Property)("None")],t.prototype,"unit",void 0),a([i.i(r.Property)(1)],t.prototype,"count",void 0),a([i.i(r.Property)(null)],t.prototype,"formatter",void 0),t}(r.ChildProperty),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)("Week")],t.prototype,"timelineViewMode",void 0),a([i.i(r.Complex)({},s)],t.prototype,"topTier",void 0),a([i.i(r.Complex)({},s)],t.prototype,"bottomTier",void 0),a([i.i(r.Property)(33)],t.prototype,"timelineUnitSize",void 0),a([i.i(r.Property)(0)],t.prototype,"weekStartDay",void 0),a([i.i(r.Property)(null)],t.prototype,"weekendBackground",void 0),a([i.i(r.Property)(!0)],t.prototype,"showTooltip",void 0),a([i.i(r.Property)(!0)],t.prototype,"updateTimescaleView",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(!0)],t.prototype,"showTooltip",void 0),a([i.i(r.Property)()],t.prototype,"taskbar",void 0),a([i.i(r.Property)()],t.prototype,"baseline",void 0),a([i.i(r.Property)()],t.prototype,"connectorLine",void 0),a([i.i(r.Property)()],t.prototype,"editing",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(0),n=(i.n(r),i(1)),a=i(4),s=(i.n(a),i(3)),o=i(10),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),d=function(e){function t(t){var i=e.call(this,t)||this;return i.taskBarHeight=0,i.milestoneHeight=0,i.milesStoneRadius=0,i.baselineTop=0,i.baselineHeight=8,i.touchLeftConnectorpoint="",i.touchRightConnectorpoint="",i.dropSplit=!1,i.refreshedTr=[],i.refreshedData=[],i.isUpdated=!0,i.parent=t,i.initPublicProp(),i.addEventListener(),i}return l(t,e),t.prototype.initPublicProp=function(){this.ganttChartTableBody=null},t.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createChartTable,this),this.parent.on("dataReady",this.initiateTemplates,this),this.parent.on("destroy",this.destroy,this)},t.prototype.refreshChartByTimeline=function(){this.taskTable.style.width=i.i(r.formatUnit)(this.parent.timelineModule.totalTimelineWidth);var e=i.i(r.getValue)("prevProjectStartDate",this.parent.dataOperation),t=!1;e&&(t=e.getTime()===this.parent.cloneProjectStartDate.getTime()),this.isUpdated=!!(this.parent.isFromOnPropertyChange&&t&&i.i(r.getValue)("mutableData",this.parent.treeGrid.grid.contentModule)),this.refreshGanttRows(),this.isUpdated=!0},t.prototype.createChartTable=function(){this.taskTable=i.i(r.createElement)("table",{className:s._25+" "+s._26,id:"GanttTaskTable"+this.parent.element.id,styles:"position: absolute;width:"+this.parent.timelineModule.totalTimelineWidth+"px;",attrs:{cellspacing:"0.25px"}});var e=i.i(r.createElement)("colgroup"),t=i.i(r.createElement)("col",{styles:"width:"+this.parent.timelineModule.totalTimelineWidth+"px;"});e.appendChild(t),this.taskTable.appendChild(e),this.ganttChartTableBody=i.i(r.createElement)("tbody",{id:this.parent.element.id+"GanttTaskTableBody"}),this.taskTable.appendChild(this.ganttChartTableBody),this.parent.ganttChartModule.chartBodyContent.appendChild(this.taskTable)},t.prototype.initiateTemplates=function(){this.taskTable.style.width=i.i(r.formatUnit)(this.parent.timelineModule.totalTimelineWidth),this.initChartHelperPrivateVariable(),this.initializeChartTemplate()},t.prototype.renderChartRows=function(){this.createTaskbarTemplate(),this.parent.isGanttChartRendered=!0},t.prototype.getIndicatorNode=function(e){var t='<label class="'+s._27+" "+s._28+'"style="line-height:'+this.parent.rowHeight+"px;"+(this.parent.enableRtl?"right:":"left:")+this.getIndicatorleft(e.date)+'px;"><i class="'+e.iconClass+'"></i> </label>';return this.createDivElement(t)},t.prototype.getIndicatorleft=function(e){return e=this.parent.dateValidationModule.getDateFromFormat(e),this.parent.dataOperation.getTaskLeft(e,!1)},t.prototype.getChildTaskbarNode=function(e,t){var n,a=null,o=this.templateData;if(n=this.parent.enableRtl?"right:":"left:",this.childTaskbarTemplateFunction)a=this.childTaskbarTemplateFunction(i.i(r.extend)({index:e},o),this.parent,"TaskbarTemplate",this.getTemplateID("TaskbarTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var l="",d="",h=void 0,p=void 0;o.ganttProperties.startDate&&o.ganttProperties.endDate&&o.ganttProperties.duration&&(h=this.createDivElement('<div class="'+s.N+" "+s._1+" "+(o.ganttProperties.isAutoSchedule?"":s._29)+'"style="width:'+o.ganttProperties.width+"px;height:"+this.taskBarHeight+'px; margin-top :-1px"></div>'),p=this.createDivElement('<div class="'+s._30+" "+s._0+" "+(o.ganttProperties.isAutoSchedule?"":s._31)+'" style="border-style:'+(o.ganttProperties.progressWidth?"solid;":"none;")+"width:"+o.ganttProperties.progressWidth+"px;height:100%;border-top-right-radius:"+this.getBorderRadius(o.ganttProperties)+"px;border-bottom-right-radius:"+this.getBorderRadius(o.ganttProperties)+'px;"></div>'));var u=i.i(r.createElement)("div");if(this.taskLabelTemplateFunction&&!i.i(r.isNullOrUndefined)(p)&&p.length>0){var c=this.taskLabelTemplateFunction(i.i(r.extend)({index:e},o),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,p[0]);c&&c.length>0&&(i.i(r.append)(c,u),l=u.innerHTML)}else{var g=this.parent.labelSettings.taskLabel;l=this.getTaskLabel(g),l="isCustomTemplate"===l?this.parent.labelSettings.taskLabel:l,this.parent.enableHtmlSanitizer&&"string"==typeof l&&(l=r.SanitizeHtmlHelper.sanitize(l))}-1===l.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(l=""),d=isNaN(parseInt(l))?'<span class="'+s._32+'" style="line-height:'+(this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(o.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="'+s._32+'" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"text-align:"+(this.parent.enableRtl?"right;":"left;"):"")+ +("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+ +("ResourceView"===this.parent.viewType?o.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;"></span>');var f=!i.i(r.isNullOrUndefined)(o.ganttProperties.segments)&&o.ganttProperties.segments.length>0?this.splitTaskbar(o,l):o.ganttProperties.startDate&&o.ganttProperties.endDate&&o.ganttProperties.duration?d:!o.ganttProperties.startDate||o.ganttProperties.endDate||o.ganttProperties.duration?!o.ganttProperties.endDate||o.ganttProperties.startDate||o.ganttProperties.duration?!o.ganttProperties.duration||o.ganttProperties.startDate||o.ganttProperties.endDate?"":'<div class="'+s._30+" "+s._1+" "+s._35+" "+(o.ganttProperties.isAutoSchedule?"":s._29)+'"style="'+n+o.ganttProperties.left+"px; width:"+o.ganttProperties.width+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+s._30+" "+s._1+" "+s._34+" "+(o.ganttProperties.isAutoSchedule?"":s._29)+'"style="'+n+o.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+s._30+" "+s._1+" "+s._33+" "+(o.ganttProperties.isAutoSchedule?"":s._29)+'"style="'+n+o.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>';if(o.ganttProperties.startDate&&o.ganttProperties.endDate&&o.ganttProperties.duration&&(i.i(r.isNullOrUndefined)(o.ganttProperties.segments)||!i.i(r.isNullOrUndefined)(o.ganttProperties.segments)&&0===o.ganttProperties.segments.length)){if(""!==f&&!i.i(r.isNullOrUndefined)(p)&&p.length>0){var m=this.createDivElement(f)[0];this.parent.disableHtmlEncode?m.innerText=l:m.innerHTML=l;var y=this.parent.labelSettings.taskLabel;y&&y.elementRef&&m.appendChild(u),p[0].appendChild(m),""!==p[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(y)&&p[0].querySelectorAll(".e-task-label")[0].children[0]&&p[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""===p[0].querySelectorAll(".e-task-label")[0].textContent&&y&&!y.elementRef&&""!==u.innerHTML&&(p[0].querySelectorAll(".e-task-label")[0].textContent=y)}!i.i(r.isNullOrUndefined)(h)&&h.length>0&&h[0].appendChild([].slice.call(p)[0]),a=h}else a=this.createDivElement(f)}return this.parent.enableRtl&&!i.i(r.isNullOrUndefined)(a)&&a[0]&&a[0].querySelector(".e-task-label")&&(a[0].querySelector(".e-task-label").style.marginLeft="15px",a[0].querySelector(".e-task-label").style.marginRight="8px",a[0].querySelector(".e-gantt-child-progressbar")&&(a[0].querySelector(".e-gantt-child-progressbar").style.textAlign="left")),a},t.prototype.splitTaskbar=function(e,t){for(var i="",r=0;r<e.ganttProperties.segments.length;r++){var n=e.ganttProperties.segments[r],a=void 0;a=n.showProgress?"initial":"hidden";var o=0===r?"e-segment-first":r===e.ganttProperties.segments.length-1?"e-segment-last":"e-segment-inprogress";i+='<div class="'+s.N+" "+o+" "+s._1+' e-segmented-taskbar"style="width:'+n.width+"px;position: absolute;"+(this.parent.enableRtl?"right:":"left:")+n.left+"px;height:"+this.taskBarHeight+"px; overflow:"+a+';" data-segment-index = "'+r+'" aria-label = "'+this.generateSpiltTaskAriaLabel(n,e.ganttProperties)+'"> '+this.getSplitTaskbarLeftResizerNode()+'<div class="'+s._30+" "+s._0+' " style="border-style:'+(n.progressWidth?"solid;":"none;")+"display:"+(n.progressWidth>=0?"block;":"none;")+"width:"+n.progressWidth+"px;height:100%;text-align:"+(this.parent.enableRtl?"left;":"right;")+"border-top-right-radius:"+this.getSplitTaskBorderRadius(n)+"px;border-bottom-right-radius:"+this.getSplitTaskBorderRadius(n)+'px;"><span class="'+s._32+'" style="line-height:'+(this.taskBarHeight-1)+"px;display:"+(n.showProgress?"inline;":"none;")+"height:"+this.taskBarHeight+'px;">'+t+"</span></div>"+this.getSplitTaskbarRightResizerNode(n)+(n.showProgress?this.getSplitProgressResizerNode(n):"")+"</div></div>"}return i},t.prototype.getSplitTaskbarLeftResizerNode=function(){var e=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?5:-2;return'<div class="'+s.O+" "+s._36+'" style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>'},t.prototype.getSplitTaskbarRightResizerNode=function(e){var t=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?-17:-10;return'<div class="'+s.Q+" "+s._36+'" style="'+(this.parent.enableRtl?"right:":"left:")+(e.width+t)+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>'},t.prototype.getSplitProgressResizerNode=function(e){var t=this.parent.enableRtl?e.progressWidth+8:e.progressWidth-6;return'<div class="'+s.S+'" style="'+(this.parent.enableRtl?"right:":"left:")+t+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+s._37+'"><div class="'+s._38+'"></div><div class="'+s._39+'"></div></div>'},t.prototype.getSegmentIndex=function(e,t){var n=-1,a=t.ganttProperties,s=a.segments;if(!i.i(r.isNullOrUndefined)(s)){s.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()});for(var o=s.length,l=0;l<o;l++){var d=s[l];if(e.getTime()===a.startDate.getTime())this.dropSplit=!0,n=0;else if(e.getTime()===d.startDate.getTime()){this.dropSplit=!0;var h=d.startDate;h.setDate(h.getDate()+1),h=d.startDate=this.parent.dataOperation.checkStartDate(h,a,!1),d.startDate=h;var p=d.endDate;p=this.parent.dataOperation.getEndDate(h,d.duration,a.durationUnit,a,!1),d.endDate=p,l===s.length-1&&this.parent.setRecordValue("endDate",p,a,!0),this.incrementSegments(s,l,t),n=d.segmentIndex}else d.endDate=this.parent.dataOperation.getEndDate(d.startDate,d.duration,a.durationUnit,a,!1),e.getTime()>=d.startDate.getTime()&&e.getTime()<=d.endDate.getTime()&&(n=d.segmentIndex);this.parent.setRecordValue("segments",a.segments,a,!0)}}return-1===n&&(this.dropSplit=!0),n},t.prototype.mergeTask=function(e,t){var i=t.length,r=this.parent.taskFields,n=this.parent.flatData.filter(function(t){return t[r.id]===e?t:null})[0],a=n.ganttProperties.segments;t=t.sort(function(e,t){return t.firstSegmentIndex-e.firstSegmentIndex});for(var s=0;s<i;s++){var o=a[t[s].firstSegmentIndex],l=a[t[s].secondSegmentIndex],d=o.duration+l.duration,h=this.parent.dataOperation.getEndDate(o.startDate,d,n.ganttProperties.durationUnit,n.ganttProperties,!1),p={startDate:o.startDate,endDate:h,duration:d},u=t[s].firstSegmentIndex;a.splice(u,2,p),this.parent.setRecordValue("segments",a,n.ganttProperties,!0),this.parent.dataOperation.updateMappingData(n,"segments"),1===a.length?(this.parent.setRecordValue("endDate",h,n.ganttProperties,!0),this.parent.setRecordValue("EndDate",h,n,!0),this.parent.setRecordValue("segments",null,n.ganttProperties,!0),this.parent.dataOperation.updateMappingData(n,"segments")):n.ganttProperties.endDate!==a[a.length-1].endDate&&this.parent.setRecordValue("endDate",a[a.length-1].endDate,n.ganttProperties,!0)}this.refreshChartAfterSegment(n,"mergeSegment")},t.prototype.refreshChartAfterSegment=function(e,t){this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e,!1),e.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e,"segments"),this.parent.dataOperation.updateWidthLeft(e),this.parent.predecessorModule&&this.parent.taskFields.dependency?(this.parent.predecessorModule.updatedRecordsDateByPredecessor(),this.parent.connectorLineModule.removePreviousConnectorLines(this.parent.flatData),this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.flatData),e.parentItem&&this.parent.getParentTask(e.parentItem).ganttProperties.isAutoSchedule&&this.parent.isInPredecessorValidation&&this.parent.dataOperation.updateParentItems(e.parentItem),this.refreshRecords(this.parent.currentViewData)):this.refreshRow(this.parent.currentViewData.indexOf(e));var n=this.ganttChartTableBody.querySelectorAll("tr")[this.parent.currentViewData.indexOf(e)],a={requestType:t,rowData:e};this.triggerQueryTaskbarInfoByIndex(n,e),this.parent.selectionModule.clearSelection();var s=a.rowData.taskData[this.parent.taskFields.segments];if(this.parent.timezone&&null!=s)for(var o=0;o<s.length;o++)s[o][this.parent.taskFields.startDate]=this.parent.dateValidationModule.remove(a.rowData.ganttProperties.segments[o].startDate,this.parent.timezone),this.parent.taskFields.endDate&&(s[o][this.parent.taskFields.endDate]=this.parent.dateValidationModule.remove(a.rowData.ganttProperties.segments[o].endDate,this.parent.timezone));this.parent.trigger("actionComplete",a),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),i.i(r.setValue)("isEdit",!1,this.parent.contextMenuModule),i.i(r.setValue)("isEdit",!1,this.parent)},t.prototype.splitTask=function(e,t){var n=this.parent.taskFields,a=t,s=this.parent.flatData.filter(function(t){return t[n.id]===e?t:null})[0],o=s.ganttProperties;this.dropSplit=!1;var l=-1,d=o.segments;if(i.i(r.isNullOrUndefined)(t.length)||t.length<0){var h=this.parent.dataOperation.checkStartDate(a,o,!1);if(h.getTime()!==o.startDate.getTime()&&o.isAutoSchedule){if(!i.i(r.isNullOrUndefined)(d)&&d.length>0&&(l=this.getSegmentIndex(h,s)),!1===this.dropSplit&&a.getTime()>o.startDate.getTime()&&a.getTime()<o.endDate.getTime()){d=-1!==l?d:[];var p=-1!==l?d[l].startDate:new Date(o.startDate.getTime()),u=-1!==l?d[l].endDate:new Date(o.endDate.getTime()),c=this.parent.dataOperation.getDuration(p,u,o.durationUnit,o.isAutoSchedule,o.isMilestone);this.parent.setRecordValue("segments",this.splitSegmentedTaskbar(p,u,a,l,d,s,c),o,!0),-1!==l&&this.incrementSegments(d,l+1,s),this.parent.setRecordValue("endDate",d[d.length-1].endDate,o,!0),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(s,"endDate")}this.refreshChartAfterSegment(s,"splitTaskbar")}}else t.sort(function(e,t){return e.getTime()-t.getTime()}),this.parent.setRecordValue("segments",this.constructSegments(t,s.ganttProperties),s.ganttProperties,!0),this.refreshChartAfterSegment(s,"splitTask")},t.prototype.constructSegments=function(e,t){for(var i,r,n,a=[],s=new Date,o=0;o<e.length+1&&(s=0===o?t.startDate:s,s=this.parent.dataOperation.checkStartDate(s,t,!1),r=o!==e.length?new Date(e[o].getTime())>t.endDate?t.endDate:new Date(e[o].getTime()):t.endDate,r=this.parent.dataOperation.checkEndDate(r,t,!1),n=this.parent.dataOperation.getDuration(s,r,t.durationUnit,t.isAutoSchedule,t.isMilestone),r.getTime()>=s.getTime()&&(i={startDate:s,endDate:r,duration:n},a.push(i)),o!==e.length);o++)s=new Date(e[o].getTime()),s.setDate(e[o].getDate()+1);return a},t.prototype.splitSegmentedTaskbar=function(e,t,i,r,n,a,s){var o=a.ganttProperties,l=this.parent.nonWorkingDayIndex.indexOf(i.getDay()),d=-1===l?0:0===l?1:2;e=this.parent.dataOperation.checkStartDate(e,o,!1);var h=new Date(i.getTime());h=this.parent.dataOperation.checkEndDate(h,o,!1);for(var p=0;p<2;p++){var u={startDate:e,endDate:h,duration:this.parent.dataOperation.getDuration(e,h,o.durationUnit,o.isAutoSchedule,o.isMilestone),offsetDuration:1},c=this.parent.nonWorkingDayIndex.indexOf(h.getDay());-1!==r&&(n.splice(r,1),r=-1),n.push(u);var g=this.parent.timelineModule.customTimelineSettings.bottomTier.unit;if("Hour"===g||"Minutes"===g){e=new Date(i.getTime()),e=this.parent.dataOperation.checkStartDate(e,o,!1);var f=this.parent.timelineModule.customTimelineSettings.bottomTier.count,m=this.parent.timelineModule.customTimelineSettings.bottomTier.unit,y=this.parent.timelineModule.getIncrement(e,f,m),D=e.getTime()+y;e.setTime(D+d),h=new Date(t.getTime()),y=this.parent.timelineModule.getIncrement(h,f,m),D=h.getTime()+y,h.setTime(D+d)}else e=new Date(i.getTime()),e.setDate(e.getDate()+1+d),this.setTime(this.parent.defaultStartTime,e),e=this.parent.dataOperation.checkStartDate(e,o,!1),h=new Date(t.getTime()),h.setDate(h.getDate()+1);if(-1!==c){var v=s-u.duration;h=this.parent.dataOperation.getEndDate(e,v,o.durationUnit,o,!1)}else h=this.parent.dataOperation.checkEndDate(h,o,!1)}return n.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),n},t.prototype.incrementSegments=function(e,t,i){for(var r=i.ganttProperties,n=t+1;n<e.length;n++){var a=e[n],s=0!==n?new Date(e[n-1].endDate.getTime()):new Date(a.startDate.getTime());s=this.parent.dataOperation.getEndDate(s,a.offsetDuration,r.durationUnit,r,!1),s=this.parent.dataOperation.checkStartDate(s,r,!1),a.startDate=s;var o=a.endDate=this.parent.dataOperation.getEndDate(s,a.duration,r.durationUnit,r,!1);a.endDate=o,n===e.length-1&&(this.parent.setRecordValue("endDate",o,r,!0),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(i,"endDate"))}e.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),this.parent.setRecordValue("segments",e,r,!0),this.parent.dataOperation.updateMappingData(i,"segments")},t.prototype.getMilestoneNode=function(e,t){var n=null,a=this.templateData;if(this.milestoneTemplateFunction)n=this.milestoneTemplateFunction(i.i(r.extend)({index:e},a),this.parent,"MilestoneTemplate",this.getTemplateID("MilestoneTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var o='<div class="'+s._40+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6)+'px;position:absolute;transform: rotate(45deg);left:1px;"> </div>';n=this.createDivElement(o)}return n},t.prototype.getTaskBaselineNode=function(){var e=this.templateData,t='<div class="'+s._41+' " role="term" style="margin-top:'+this.baselineTop+"px;"+(this.parent.enableRtl?"right:":"left:")+e.ganttProperties.baselineLeft+"px;width:"+e.ganttProperties.baselineWidth+"px;height:"+this.baselineHeight+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+'"></div>';return this.createDivElement(t)},t.prototype.getMilestoneBaselineNode=function(){var e=this.templateData,t=this.parent.renderBaseline?5:2,i='<div class="'+s._42+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-10)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-10)+"px;position:absolute;transform:rotate(45deg);"+(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e.ganttProperties.left-this.milestoneHeight/2+3:e.ganttProperties.left-this.milestoneHeight/2+1)+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+"margin-top:"+(-Math.floor(this.parent.rowHeight-this.milestoneMarginTop)+t+2)+'px"> </div>';return this.createDivElement(i)},t.prototype.getLeftLabelNode=function(e){var t=this.leftLabelContainer();""!==this.generateTaskLabelAriaLabel("left")&&t[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("left"));var n=null;if(this.leftTaskLabelTemplateFunction)n=this.leftTaskLabelTemplateFunction(i.i(r.extend)({index:e},this.templateData),this.parent,"LeftLabelTemplate",this.getTemplateID("LeftLabelTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var a=this.parent.labelSettings.leftLabel,o=this.getTaskLabel(a);o&&(o="isCustomTemplate"===o?a:o,n=this.getLableText(o,s._43),this.parent.enableHtmlSanitizer&&"string"==typeof o&&(o=r.SanitizeHtmlHelper.sanitize(o),o="isCustomTemplate"===o?a:o,n=this.getLableText(o,s._43)))}return n&&n.length>0&&("null"===n[0].data&&(n[0].data=""),i.i(r.append)(n,t[0])),this.parent.enableRtl&&(t[0].style.paddingLeft="25px",t[0].style.paddingRight="0px"),t},t.prototype.getLableText=function(e,t){var n=this.parent.renderBaseline?(this.parent.rowHeight-this.taskBarHeight)/2:this.taskBarMarginTop,a=i.i(r.createElement)("div",{className:t,styles:"height:"+this.taskBarHeight+"px;margin-top:"+n+"px;"}),o=i.i(r.createElement)("span",{className:s._27});o[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=e,a.appendChild(o);var l=i.i(r.createElement)("div");return l.appendChild(a),l.childNodes},t.prototype.getRightLabelNode=function(e){var t=this.rightLabelContainer();""!==this.generateTaskLabelAriaLabel("right")&&t[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("right"));var n=null;if(this.rightTaskLabelTemplateFunction)n=this.rightTaskLabelTemplateFunction(i.i(r.extend)({index:e},this.templateData),this.parent,"RightLabelTemplate",this.getTemplateID("RightLabelTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var a=this.parent.labelSettings.rightLabel,o=this.getTaskLabel(a);o&&(o="isCustomTemplate"===o?a:o,n=this.getLableText(o,s._44),this.parent.enableHtmlSanitizer&&"string"==typeof o&&(o=r.SanitizeHtmlHelper.sanitize(o),o="isCustomTemplate"===o?a:o,n=this.getLableText(o,s._44)))}return n&&n.length>0&&("null"===n[0].data&&(n[0].data=""),i.i(r.append)(n,t[0])),this.parent.enableRtl&&(t[0].style.marginLeft="0px",t[0].style.paddingRight="25px"),t},t.prototype.getManualTaskbar=function(){var e=this.templateData,t=this.taskBarHeight/2-1,i=e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration?'<div class="'+s.L+'" style="width:'+e.ganttProperties.width+"px;height:"+t/5+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>':e.ganttProperties.startDate||e.ganttProperties.endDate||!e.ganttProperties.duration?'<div class="'+s.L+" "+(e.ganttProperties.startDate?s._33:s._34)+'" style="width:'+e.ganttProperties.width+"px;height:"+2*t+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>':'<div class="'+s.L+" "+s._45+'" style="width:'+e.ganttProperties.width+"px;height:"+(t/5+1)+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>',r='<div class="'+s.K+'"style='+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-e.ganttProperties.autoLeft)+"px;width:"+e.ganttProperties.width+"px;height:"+t+"px;>"+i+(e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration||e.ganttProperties.duration?'<div class="e-gantt-manualparenttaskbar-left" style='+(this.parent.enableRtl?"margin-right:0px;":"")+'"height:'+(t/5+8)+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div><div class="e-gantt-manualparenttaskbar-right" style='+(this.parent.enableRtl?"margin-right:-8px;":"")+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.width-Math.floor((t/5+8)/5))+"px;height:"+(t/5+8)+"px;border-right-width:"+t/5+"px;border-bottom:"+t/5+"px solid transparent;></div></div>":""),n='<div class="'+s.M+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;position:absolute;transform: rotate(45deg);top:"+(this.parent.rowHeight>40?0:2)+"px;left:"+(this.parent.renderBaseline?2:1)+'px;"> </div>';return this.createDivElement(0!==e.ganttProperties.duration?r:n)},t.prototype.getParentTaskbarNode=function(e,t){var n=null,a=this.templateData;if(this.parentTaskbarTemplateFunction)n=this.parentTaskbarTemplateFunction(i.i(r.extend)({index:e},a),this.parent,"ParentTaskbarTemplate",this.getTemplateID("ParentTaskbarTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var o="",l=void 0,d=this.taskBarHeight/5,h=this.createDivElement('<div class="'+s._46+" "+this.getExpandClass(a)+" "+s._2+'" style="width:'+(a.ganttProperties.isAutoSchedule?a.ganttProperties.width:a.ganttProperties.autoWidth)+"px;height:"+(a.ganttProperties.isAutoSchedule?this.taskBarHeight:3*d)+"px;margin-top:"+(a.ganttProperties.isAutoSchedule?-1:2*d)+'px; "></div>'),p=this.createDivElement('<div class="'+s._47+" "+this.getExpandClass(a)+" "+s._3+'" style="border-style:'+(a.ganttProperties.progressWidth?"solid;":"none;")+"width:"+a.ganttProperties.progressWidth+"px;border-top-right-radius:"+this.getBorderRadius(a)+"px;border-bottom-right-radius:"+this.getBorderRadius(a)+'px;height:100%;"></div>'),u=i.i(r.createElement)("div");if(this.taskLabelTemplateFunction){var c=this.taskLabelTemplateFunction(i.i(r.extend)({index:e},a),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,p[0]);c&&c.length>0&&(i.i(r.append)(c,u),o=u.innerHTML)}else o=this.getTaskLabel(this.parent.labelSettings.taskLabel),o="isCustomTemplate"===o?this.parent.labelSettings.taskLabel:o,this.parent.enableHtmlSanitizer&&"string"==typeof o&&(o=r.SanitizeHtmlHelper.sanitize(o));if(-1===o.indexOf("null")){"isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(o=""),l=isNaN(parseInt(o))?'<span class="'+s._32+'" style="line-height:'+(a.isManual&&a.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(a.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="'+s._32+'" style="line-height:'+(a.isManual&&a.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(a.ganttProperties.width-10):"")+"px; height:"+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display: inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(a.ganttProperties.width-10):"")+"px; height:"+this.taskBarHeight+'px;"></span>';var g=this.createDivElement(l)[0];this.parent.disableHtmlEncode?g.innerText=o:g.innerHTML=o;var f=this.parent.labelSettings.taskLabel;f&&f.elementRef&&g.appendChild(u),p[0].appendChild(g),""!==p[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(f)&&p[0].querySelectorAll(".e-task-label")[0].children[0]&&p[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""===p[0].querySelectorAll(".e-task-label")[0].textContent&&f&&!f.elementRef&&""!==u.innerHTML&&(p[0].querySelectorAll(".e-task-label")[0].textContent=f)}var m='<div class="'+s._48+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;position:absolute;transform: rotate(45deg);top:"+(this.parent.rowHeight>40?0:2)+"px;left:"+(this.parent.renderBaseline?2:1)+'px;"> </div>';h[0].appendChild([].slice.call(p)[0]),n=a.ganttProperties.isMilestone?this.createDivElement(a.ganttProperties.isAutoSchedule?m:""):h}return this.parent.enableRtl&&n[0]&&n[0].querySelector(".e-task-label")&&(n[0].querySelector(".e-task-label").style.marginLeft="15px",n[0].querySelector(".e-task-label").style.marginRight="8px",n[0].querySelector(".e-gantt-parent-progressbar")&&(n[0].querySelector(".e-gantt-parent-progressbar").style.textAlign="left")),n},t.prototype.getTableTrNode=function(e){var t,n=i.i(r.createElement)("table"),a="Horizontal"===this.parent.gridLines||"Both"===this.parent.gridLines?"e-chart-row-border":"",o=this.parent.treeGrid.grid.contentModule.getRows()[e];return t=o&&o.isSelected?"e-active":"",n.innerHTML='<tr class="'+this.getRowClassName(this.templateData)+" "+s.Z+" "+t+'"style="display:'+this.getExpandDisplayProp(this.templateData)+";height:"+this.parent.rowHeight+'px;"><td class="'+s._20+" "+a+'"style="width:'+this.parent.timelineModule.totalTimelineWidth+'px;"></td></tr>',n.childNodes},t.prototype.initializeChartTemplate=function(){i.i(r.isNullOrUndefined)(this.parent.parentTaskbarTemplate)||(this.parentTaskbarTemplateFunction=this.templateCompiler(this.parent.parentTaskbarTemplate)),!i.i(r.isNullOrUndefined)(this.parent.labelSettings.leftLabel)&&this.isTemplate(this.parent.labelSettings.leftLabel)&&(this.leftTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.leftLabel)),!i.i(r.isNullOrUndefined)(this.parent.labelSettings.rightLabel)&&this.isTemplate(this.parent.labelSettings.rightLabel)&&(this.rightTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.rightLabel)),!i.i(r.isNullOrUndefined)(this.parent.labelSettings.taskLabel)&&this.isTemplate(this.parent.labelSettings.taskLabel)&&(this.taskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.taskLabel)),i.i(r.isNullOrUndefined)(this.parent.taskbarTemplate)||(this.childTaskbarTemplateFunction=this.templateCompiler(this.parent.taskbarTemplate)),i.i(r.isNullOrUndefined)(this.parent.milestoneTemplate)||(this.milestoneTemplateFunction=this.templateCompiler(this.parent.milestoneTemplate))},t.prototype.createDivElement=function(e){var t=i.i(r.createElement)("div");return t.innerHTML=e,t.childNodes},t.prototype.isTemplate=function(e){for(var t=!1,i=0;i<this.parent.ganttColumns.length;i++)if(e===this.parent.ganttColumns[i].field){t=!0;break}return t="string"!=typeof e||0===e.indexOf("#")||e.indexOf("<")>-1||e.indexOf("$")>-1||!t},t.prototype.getTemplateID=function(e){return this.parent.element.id+e},t.prototype.leftLabelContainer=function(){var e='<div class="'+(this.leftTaskLabelTemplateFunction?s._49:s._50)+' " tabindex="-1" role="term" style="height:'+(this.parent.rowHeight-2)+"px;width:"+this.taskNameWidth(this.templateData)+'"></div>';return this.createDivElement(e)},t.prototype.taskbarContainer=function(){var e=this.templateData,t=!(!this.parent.editModule||!this.parent.editSettings.allowTaskbarEditing||"ParentResizing"!==this.parent.editModule.taskbarEditModule.taskBarEditAction),i='<div class="'+s.D+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+" "+(e.ganttProperties.cssClass?e.ganttProperties.cssClass:"")+'" tabindex="-1" role="term" style="'+(!e.ganttProperties.isMilestone||t||e.hasChildRecords&&!e.ganttProperties.isAutoSchedule?"width:"+e.ganttProperties.width+"px;margin-top:"+this.taskBarMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(!e.hasChildRecords||e.ganttProperties.isAutoSchedule?e.ganttProperties.left:e.ganttProperties.autoLeft)+"px;height:"+this.taskBarHeight+"px;cursor:"+(e.ganttProperties.isAutoSchedule?"move;":"auto;"):"width:"+this.milestoneHeight+"px;height:"+this.milestoneHeight+"px;margin-top:"+this.milestoneMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-this.milestoneHeight/2)+"px;")+'"></div>';return this.createDivElement(i)},t.prototype.rightLabelContainer=function(){var e='<div class="'+(this.rightTaskLabelTemplateFunction?s._51:s._52)+'" tabindex="-1" role="term" style="'+(this.parent.enableRtl?"right:":"left:")+this.getRightLabelLeft(this.templateData)+"px; height:"+(this.parent.rowHeight-2)+'px;"></div>';return this.createDivElement(e)},t.prototype.childTaskbarLeftResizer=function(){var e=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?5:-2,t='<div class="'+s.O+" "+s._36+'"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>';return this.createDivElement(t)},t.prototype.childTaskbarRightResizer=function(){var e=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?-17:-10,t='<div class="'+s.Q+" "+s._36+'"style="'+(this.parent.enableRtl?"right:":"left:")+(this.templateData.ganttProperties.width+e)+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>';return this.createDivElement(t)},t.prototype.childTaskbarProgressResizer=function(){var e=this.parent.enableRtl?this.templateData.ganttProperties.progressWidth+8:this.templateData.ganttProperties.progressWidth-6,t='<div class="'+s.S+'"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+s._37+'"><div class="'+s._38+'"></div><div class="'+s._39+'"></div></div>';return this.createDivElement(t)},t.prototype.getLeftPointNode=function(){var e,t=this.templateData,n=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?12:0,a=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?6:3,o=-(3+this.connectorPointWidth+n),l=-(this.connectorPointWidth+4+a),d=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2);e=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px";var h='<div class="'+s._53+'" style="'+(t.ganttProperties.isMilestone?"margin-top:"+d+"px;left:"+l+"px;":e+";left:"+o+"px;")+'"><div class="'+s.X+" "+this.parent.getUnscheduledTaskClass(t.ganttProperties)+'" style="width: '+this.connectorPointWidth+"px;"+(this.parent.enableRtl?"margin-right:2px;":"")+"height: "+this.connectorPointWidth+'px;">'+this.touchLeftConnectorpoint+"</div></div>";return this.createDivElement(h)},t.prototype.getRightPointNode=function(){var e,t=this.templateData,n=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?-12:0,a=-(3+n),o=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2);e=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px";var l='<div class="'+s._4+'" style="'+(t.ganttProperties.isMilestone?"left:"+(!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?this.milestoneHeight+5:this.milestoneHeight-2)+"px;margin-top:"+o+"px;":"left:"+(t.ganttProperties.width+a)+"px;"+e+";")+'"><div class="'+s.Y+" "+this.parent.getUnscheduledTaskClass(t.ganttProperties)+'" style="width:'+this.connectorPointWidth+"px;height:"+this.connectorPointWidth+'px;">'+this.touchRightConnectorpoint+"</div></div>";return this.createDivElement(l)},t.prototype.getTaskLabel=function(e){var t=this.parent.ganttColumns.length,n=null;if(i.i(r.isNullOrUndefined)(e)||""===e)n="";else if(e===this.parent.taskFields.resourceInfo)n=this.getResourceName(this.templateData);else{for(var a=0;a<t;a++)if(e===this.parent.ganttColumns[a].field){n=this.getFieldValue(this.templateData[e]).toString();break}if(i.i(r.isNullOrUndefined)(n))return"isCustomTemplate"}return n},t.prototype.getExpandDisplayProp=function(e){return e=this.templateData,this.parent.getExpandStatus(e)?"table-row":"none"},t.prototype.getRowClassName=function(e){e=this.templateData;var t="gridrowtaskId",i=e.parentItem;return i&&(t+=i.taskId.toString()),t+="level",t+=e.level.toString()},t.prototype.getBorderRadius=function(e){e=this.templateData;var t=e.ganttProperties.width-e.ganttProperties.progressWidth;return t<=4?4-t:0},t.prototype.getSplitTaskBorderRadius=function(e){var t=e.width-e.progressWidth;return t<=4?4-t:0},t.prototype.taskNameWidth=function(e){e=this.templateData;var t,i=e.ganttProperties;return t=e.ganttProperties.isMilestone?e.ganttProperties.left-this.parent.getTaskbarHeight()/2:e.hasChildRecords&&!i.isAutoSchedule?this.parent.allowUnscheduledTasks?i.left<i.autoLeft?i.left:i.autoLeft:i.autoStartDate.getTime()<i.startDate.getTime()?i.autoLeft:i.left:e.ganttProperties.left,t<0&&(t=0),t+"px"},t.prototype.getRightLabelLeft=function(e){e=this.templateData;var t,i,r,n=e.ganttProperties;return e.ganttProperties.isMilestone?e.ganttProperties.left+this.parent.getTaskbarHeight()/2:e.hasChildRecords&&!n.isAutoSchedule?(this.parent.allowUnscheduledTasks?(t=n.left<n.autoLeft?n.autoLeft:n.left,r=n.autoWidth):(t=n.autoStartDate.getTime()<n.startDate.getTime()?n.autoLeft:n.left,i=n.autoEndDate.getTime()<n.endDate.getTime()?this.parent.dataOperation.getTaskLeft(n.endDate,n.isMilestone):this.parent.dataOperation.getTaskLeft(n.autoEndDate,n.isMilestone),r=i-t),t+r):e.ganttProperties.left+e.ganttProperties.width},t.prototype.getExpandClass=function(e){return e=this.templateData,e.expanded?s._54:!e.expanded&&e.hasChildRecords?s._55:""},t.prototype.getFieldValue=function(e){return i.i(r.isNullOrUndefined)(e)?"":e},t.prototype.getResourceName=function(e){e=this.templateData;var t=null;if(!i.i(r.isNullOrUndefined)(e.ganttProperties.resourceInfo)){var n=e.ganttProperties.resourceInfo.length;if(n>0){for(var a=0;a<n;a++){var s=e.ganttProperties.resourceInfo[a][this.parent.resourceFields.name],o=e.ganttProperties.resourceInfo[a][this.parent.resourceFields.unit];100!==o&&(s+="["+o+"%]"),i.i(r.isNullOrUndefined)(t)?t=s:t+=" , "+s}return t}return""}return""},t.prototype.initChartHelperPrivateVariable=function(){var e=this.parent.renderBaseline?.45:!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?.7:.62,t=this.parent.renderBaseline?4:2,n=this.parent.renderBaseline?1.13:.82;if(this.baselineColor=i.i(r.isNullOrUndefined)(this.parent.baselineColor)||""===this.parent.baselineColor?null:this.parent.baselineColor,this.taskBarHeight=i.i(r.isNullOrUndefined)(this.parent.taskbarHeight)||this.parent.taskbarHeight>=this.parent.rowHeight?Math.floor(this.parent.rowHeight*e):this.parent.taskbarHeight,this.parent.renderBaseline){var a=void 0;a=this.taskBarHeight+this.baselineHeight<=this.parent.rowHeight?this.taskBarHeight:this.taskBarHeight-(this.baselineHeight+1),this.taskBarHeight=a}this.milestoneHeight=Math.floor(this.taskBarHeight*n),this.taskBarMarginTop=Math.floor((this.parent.rowHeight-this.taskBarHeight)/t),this.milestoneMarginTop=Math.floor((this.parent.rowHeight-this.milestoneHeight)/2),this.milesStoneRadius=Math.floor(this.milestoneHeight/2),this.baselineTop=-(Math.floor(this.parent.rowHeight-(this.taskBarHeight+this.taskBarMarginTop))-4),this.connectorPointWidth=this.parent.isAdaptive?Math.round(this.taskBarHeight/2):8,this.connectorPointMargin=Math.floor(this.taskBarHeight/2-this.connectorPointWidth/2)},t.prototype.refreshGanttRows=function(){if(this.parent.currentViewData=this.parent.treeGrid.getCurrentViewRecords().slice(),this.createTaskbarTemplate(),"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation){for(var e=0;e<this.parent.currentViewData.length;e++){var t=this.parent.currentViewData[e];t.childRecords.length>0&&(this.parent.setRecordValue("workTimelineRanges",this.parent.dataOperation.mergeRangeCollections(t.ganttProperties.workTimelineRanges,!0),t.ganttProperties,!0),this.parent.dataOperation.calculateRangeLeftWidth(t.ganttProperties.workTimelineRanges))}this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}this.parent.ganttChartModule.updateLastRowBottomWidth()},t.prototype.createTaskbarTemplate=function(){var e,t=[].slice.call(this.ganttChartTableBody.querySelectorAll("tr"));this.ganttChartTableBody.innerHTML="";var n=[],a=this.parent.treeGridModule.prevCurrentView;if(this.refreshedTr=[],this.refreshedData=[],this.parent.enableImmutableMode&&a&&a.length>0&&this.isUpdated){for(var s={},o=[],l=this.parent.treeGrid.getPrimaryKeyFieldNames()[0],d=0;d<a.length;d++)o[d]=t[d],s[a[d][l]]=d;for(var h=0;h<this.parent.currentViewData.length;h++){var p=s[this.parent.currentViewData[h][l]],u=this.parent.modifiedRecords.indexOf(this.parent.currentViewData[h]);if(i.i(r.isNullOrUndefined)(p)||-1!==u||this.parent.isFromRenderBaseline){var c=this.getGanttChartRow(h,this.parent.currentViewData[h]);this.ganttChartTableBody.appendChild(c),this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[h]),this.refreshedData.push(this.parent.currentViewData[h])}else this.ganttChartTableBody.appendChild(o[p]);this.ganttChartTableBody.querySelectorAll("tr")[h].setAttribute("aria-rowindex",h.toString())}}else{var g=void 0;g=i.i(r.createElement)("tbody",{id:this.parent.element.id+"GanttTaskTableBody"});for(var d=0;d<this.parent.currentViewData.length;d++){var f=this.parent.currentViewData[d];"ResourceView"===this.parent.viewType&&((this.parent.editModule&&this.parent.editModule.isResourceTaskDeleted||this.parent.isFromOnPropertyChange)&&(this.parent.editModule.isResourceTaskDeleted=!1),!f.expanded&&this.parent.enableMultiTaskbar&&n.push(f));var c=this.getGanttChartRow(d,f);g.appendChild(c),this.parent.enableImmutableMode&&(this.refreshedTr.push(g.querySelectorAll("tr")[d]),this.refreshedData.push(this.parent.currentViewData[d])),this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.maintainSelectedRecords(parseInt(c.getAttribute("aria-rowindex"),10))}(e=this.ganttChartTableBody).replaceChildren.apply(e,g.childNodes),this.parent.initialChartRowElements=this.parent.ganttChartModule.getChartRows()}if(this.parent.enableCriticalPath&&this.parent.criticalPathModule){var m=this.parent.criticalPathModule;m.criticalPathCollection&&this.parent.criticalPathModule.criticalConnectorLine(m.criticalPathCollection,m.detailPredecessorCollection,!0,m.predecessorCollectionTaskIds)}if(this.parent.renderTemplates(),this.triggerQueryTaskbarInfo(),this.parent.modifiedRecords=[],"ResourceView"==this.parent.viewType&&this.parent.showOverAllocation&&this.updateOverlapped(),n.length)for(var y=0;y<n.length;y++)n[y].hasChildRecords&&(this.parent.isGanttChartRendered=!0,this.parent.chartRowsModule.refreshRecords([n[y]]));this.parent.isGanttChartRendered=!0,this.parent.renderTemplates()},t.prototype.getGanttChartRow=function(e,t){this.templateData=t;var a=null,s=this.getTableTrNode(e),o=this.getLeftLabelNode(e),l=this.taskbarContainer();l[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),l[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID);var d;if(this.templateData.hasChildRecords||this.parent.allowParentDependency)this.parent.allowParentDependency&&(d=this.getLeftPointNode(),(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)&&l[0].appendChild([].slice.call(d)[0]));else{var h=this.getLeftPointNode();l[0].appendChild([].slice.call(h)[0])}if(this.templateData.hasChildRecords){var p=this.getParentTaskbarNode(e,l);if(!this.templateData.ganttProperties.isAutoSchedule){var u=this.getManualTaskbar();if(!i.i(r.isNullOrUndefined)(u[0])){if(this.parent.allowParentDependency){u[0].appendChild([].slice.call(d)[0]);var c=this.getRightPointNode();u[0].appendChild([].slice.call(c)[0])}l[0].appendChild([].slice.call(u)[0])}}if(0!==this.templateData.ganttProperties.autoDuration&&!this.templateData.ganttProperties.isMilestone&&p&&p.length>0)i.i(r.append)(p,l[0]);else if(0===this.templateData.ganttProperties.duration&&this.templateData.ganttProperties.isMilestone&&this.templateData.ganttProperties.isAutoSchedule){var g=this.getMilestoneNode(e,l);g&&g.length>0&&i.i(r.append)(g,l[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(a=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineStartDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineEndDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}else if(this.templateData.ganttProperties.isMilestone){var g=this.getMilestoneNode(e,l);g&&g.length>0&&i.i(r.append)(g,l[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(a=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineStartDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineEndDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}else{var f=i.i(n.c)(this.templateData.ganttProperties),m=null,y=null,D=null;if(!i.i(r.isNullOrUndefined)(f)){(f||this.templateData.ganttProperties.duration)&&f&&(i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.segments)||this.templateData.ganttProperties.segments.length<=0)&&(m=this.childTaskbarProgressResizer(),D=this.childTaskbarLeftResizer(),y=this.childTaskbarRightResizer());var v=this.getChildTaskbarNode(e,l);if(D&&l[0].appendChild([].slice.call(D)[0]),v&&v.length>0)if(this.templateData.ganttProperties.segments&&this.templateData.ganttProperties.segments.length>0){var w=this.templateData.ganttProperties.segments.length,k=null;k=this.createDivElement('<div class="e-gantt-split-container-line"></div>'),l[0].appendChild([].slice.call(k)[0]);for(var b=0;b<w;b++)l[0].appendChild([].slice.call(v)[0])}else i.i(r.append)(v,l[0]);m&&l[0].appendChild([].slice.call(m)[0]),y&&l[0].appendChild([].slice.call(y)[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(a=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineStartDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineEndDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}var T;this.parent.allowParentDependency&&(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)?(T=this.getRightPointNode(),l[0].appendChild([].slice.call(T)[0])):this.parent.allowParentDependency||(T=this.getRightPointNode(),l[0].appendChild([].slice.call(T)[0]));var S=this.getRightLabelNode(e);if(s[0].childNodes[0].childNodes[0].appendChild([].slice.call(o)[0]),s[0].childNodes[0].childNodes[0].appendChild([].slice.call(l)[0]),this.templateData.ganttProperties.indicators&&this.templateData.ganttProperties.indicators.length>0)for(var P=void 0,C=void 0,M=void 0,R=this.templateData.ganttProperties.indicators,x=0;x<R.length;x++){if(P=this.getIndicatorNode(R[x]),P[0].setAttribute("aria-label",R[x].name),R[x].name.indexOf("$")>-1||R[x].name.indexOf("#")>-1)C=this.templateCompiler(R[x].name),M=C(i.i(r.extend)({index:e},this.templateData),this.parent,"indicatorLabelText");else{var O=i.i(r.createElement)("Text");O.innerHTML=R[x].name,this.parent.enableHtmlSanitizer&&"string"==typeof R[x].name&&(R[x].name=r.SanitizeHtmlHelper.sanitize(R[x].name),O.innerText=R[x].name),M=O.childNodes}P[0].appendChild([].slice.call(M)[0]),P[0].title=i.i(r.isNullOrUndefined)(R[x].tooltip)?"":R[x].tooltip,s[0].childNodes[0].childNodes[0].appendChild([].slice.call(P)[0])}S&&S.length>0&&s[0].childNodes[0].childNodes[0].appendChild([].slice.call(S)[0]),i.i(r.isNullOrUndefined)(a)||s[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[0]);var I=s[0].childNodes[0];return this.setAriaRowIndex(t,I),I},t.prototype.setAriaRowIndex=function(e,t){var n,a=this,s=this.parent.treeGrid.getCurrentViewRecords(),o=this.parent.virtualScrollModule&&this.parent.enableVirtualization?i.i(r.getValue)("virtualScrollModule.visualData",this.parent.treeGrid):s;if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){var l=this.parent.treeGrid.grid.contentModule.rows,d=l.filter(function(t){if(t.data[a.parent.taskFields.id]===e.ganttProperties.taskId)return t})[0];t.setAttribute("aria-rowindex",d.index.toString())}else n=o.indexOf(e),t.setAttribute("aria-rowindex",n.toString())},t.prototype.triggerQueryTaskbarInfo=function(){if(this.parent.queryTaskbarInfo)for(var e,t,n=this.parent.enableImmutableMode?this.refreshedTr.length:this.ganttChartTableBody.querySelectorAll("tr").length,a=0;a<n;a++){e=this.parent.enableImmutableMode?this.refreshedTr[a]:this.ganttChartTableBody.querySelectorAll("tr")[a],t=this.refreshedData.length>0?this.refreshedData[a]:this.parent.currentViewData[a];var s=!i.i(r.isNullOrUndefined)(t.ganttProperties.segments)&&t.ganttProperties.segments.length;if(s>0)for(var o=0;o<s;o++){var l=e.getElementsByClassName("e-segmented-taskbar"),d=l[o];this.triggerQueryTaskbarInfoByIndex(d,t)}else e&&this.triggerQueryTaskbarInfoByIndex(e,t)}},t.prototype.triggerQueryTaskbarInfoByIndex=function(e,t){var n,a=this,o=!i.i(r.isNullOrUndefined)(t.ganttProperties.segments)&&t.ganttProperties.segments.length>0?e:e.querySelector("."+s.D);t.ganttProperties.segments&&t.ganttProperties.segments.length>0&&(n=e.parentElement.parentElement.parentElement);var l={data:t,rowElement:e,taskbarElement:o,taskbarType:t.hasChildRecords?"ParentTask":t.ganttProperties.isMilestone?"Milestone":"ChildTask"},d=this.getClassName(l);if("Milestone"===l.taskbarType)l.milestoneColor=o.querySelector(d[0])?getComputedStyle(o.querySelector(d[0])).backgroundColor:null,l.baselineColor=e.querySelector(d[1])?getComputedStyle(e.querySelector(d[1])).backgroundColor:e.querySelector("."+s._41)?getComputedStyle(e.querySelector("."+s._41)).backgroundColor:null;else if(o){var h=o.querySelector(d[0]),p=o.querySelector(d[1]);l.taskbarBgColor=i.i(r.isNullOrUndefined)(h)?null:o.classList.contains(s._1)?getComputedStyle(o).backgroundColor:getComputedStyle(o.querySelector(d[0])).backgroundColor,l.taskbarBorderColor=i.i(r.isNullOrUndefined)(h)?null:o.classList.contains(s._1)?getComputedStyle(o).backgroundColor:getComputedStyle(o.querySelector(d[0])).borderColor,l.progressBarBgColor=i.i(r.isNullOrUndefined)(p)?null:o.classList.contains(s._0)?getComputedStyle(o).backgroundColor:getComputedStyle(o.querySelector(d[1])).backgroundColor,l.baselineColor=n?n.querySelector("."+s._41)?getComputedStyle(n.querySelector("."+s._41)).backgroundColor:null:e.querySelector("."+s._41)?getComputedStyle(e.querySelector("."+s._41)).backgroundColor:null,l.taskLabelColor=o.querySelector("."+s._32)?getComputedStyle(o.querySelector("."+s._32)).color:null}n?(l.rightLabelColor=n.querySelector("."+s._52)&&n.querySelector("."+s._52).querySelector("."+s._27)?getComputedStyle(n.querySelector("."+s._52).querySelector("."+s._27)).color:null,l.leftLabelColor=n.querySelector("."+s._50)&&n.querySelector("."+s._50).querySelector("."+s._27)?getComputedStyle(n.querySelector("."+s._50).querySelector("."+s._27)).color:null):(l.rightLabelColor=e.querySelector("."+s._52)&&e.querySelector("."+s._52).querySelector("."+s._27)?getComputedStyle(e.querySelector("."+s._52).querySelector("."+s._27)).color:null,l.leftLabelColor=e.querySelector("."+s._50)&&e.querySelector("."+s._50).querySelector("."+s._27)?getComputedStyle(e.querySelector("."+s._50).querySelector("."+s._27)).color:null),this.parent.trigger("queryTaskbarInfo",l,function(e){a.updateQueryTaskbarInfoArgs(e,void 0,void 0)})},t.prototype.updateQueryTaskbarInfoArgs=function(e,t,i){var r,n=e.rowElement,a=e.taskbarElement,o=this.getClassName(e);if(e.data.ganttProperties.segments&&e.data.ganttProperties.segments.length>0&&(r=n.parentElement.parentElement.parentElement),"Milestone"===e.taskbarType)a.querySelector(o[0])&&getComputedStyle(a.querySelector(o[0])).backgroundColor!==e.milestoneColor&&(a.querySelector(o[0]).style.backgroundColor=e.milestoneColor),n.querySelector(o[1])&&getComputedStyle(n.querySelector(o[1])).backgroundColor!==e.baselineColor&&(n.querySelector(o[1]).style.backgroundColor=e.baselineColor),n.querySelector("."+s._41)&&getComputedStyle(n.querySelector("."+s._41)).borderTopColor!==e.baselineColor&&(n.querySelector("."+s._41).style.backgroundColor=e.baselineColor);else if(a){if(a&&this.parent.enableVirtualization&&!e.data.expanded){var l=n.querySelector("."+s._56);if(l)for(var d=0;d<l.childNodes.length;d++){var h=l.childNodes[d],p=h.querySelector("."+s._1);p&&(p.style.backgroundColor=e.taskbarBgColor)}}a.querySelector(o[0])&&getComputedStyle(a.querySelector(o[0])).backgroundColor!==e.taskbarBgColor&&(a.querySelector(o[0]).style.backgroundColor=e.taskbarBgColor),a.querySelector(o[0])&&getComputedStyle(a.querySelector(o[0])).outlineColor!==e.taskbarBorderColor&&(a.querySelector(o[0]).style.outlineColor=e.taskbarBorderColor),a.querySelector(o[1])&&getComputedStyle(a.querySelector(o[1])).backgroundColor!==e.progressBarBgColor&&(a.querySelector(o[1]).style.backgroundColor=e.progressBarBgColor),a.classList.contains(s._1)&&getComputedStyle(a).backgroundColor!==e.taskbarBgColor&&(a.style.backgroundColor=e.taskbarBgColor),a.classList.contains(s._1)&&getComputedStyle(a).outlineColor!==e.taskbarBorderColor&&(a.style.outlineColor=e.taskbarBorderColor),a.classList.contains(s._0)&&getComputedStyle(a).backgroundColor!==e.progressBarBgColor&&(a.style.backgroundColor=e.progressBarBgColor),a.querySelector("."+s._32)&&getComputedStyle(a.querySelector("."+s._32)).color!==e.taskLabelColor&&(a.querySelector("."+s._32).style.color=e.taskLabelColor),r?r.querySelector("."+s._41)&&getComputedStyle(r.querySelector("."+s._41)).backgroundColor!==e.baselineColor&&(r.querySelector("."+s._41).style.backgroundColor=e.baselineColor):n.querySelector("."+s._41)&&getComputedStyle(n.querySelector("."+s._41)).backgroundColor!==e.baselineColor&&(n.querySelector("."+s._41).style.backgroundColor=e.baselineColor)}r?(r.querySelector("."+s._50)&&r.querySelector("."+s._50).querySelector("."+s._27)&&getComputedStyle(r.querySelector("."+s._50).querySelector("."+s._27)).color!==e.leftLabelColor&&(r.querySelector("."+s._50).querySelector("."+s._27).style.color=e.leftLabelColor),r.querySelector("."+s._52)&&r.querySelector("."+s._52).querySelector("."+s._27)&&getComputedStyle(r.querySelector("."+s._52).querySelector("."+s._27)).color!==e.rightLabelColor&&(r.querySelector("."+s._52).querySelector("."+s._27).style.color=e.rightLabelColor)):(n.querySelector("."+s._50)&&n.querySelector("."+s._50).querySelector("."+s._27)&&getComputedStyle(n.querySelector("."+s._50).querySelector("."+s._27)).color!==e.leftLabelColor&&(n.querySelector("."+s._50).querySelector("."+s._27).style.color=e.leftLabelColor),n.querySelector("."+s._52)&&n.querySelector("."+s._52).querySelector("."+s._27)&&getComputedStyle(n.querySelector("."+s._52).querySelector("."+s._27)).color!==e.rightLabelColor&&(n.querySelector("."+s._52).querySelector("."+s._27).style.color=e.rightLabelColor))},t.prototype.getClassName=function(e){var t=[];return t.push("."+("ParentTask"===e.taskbarType?s._2:"ChildTask"===e.taskbarType?s._1:s._40)),t.push("."+("ParentTask"===e.taskbarType?s._3:"ChildTask"===e.taskbarType?s._0:s._42)),t},t.prototype.templateCompiler=function(e){if(!i.i(r.isNullOrUndefined)(e)&&""!==e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?i.i(r.compile)(document.querySelector(e).innerHTML.trim(),this.parent):i.i(r.compile)(e,this.parent)}catch(t){return i.i(r.compile)(e,this.parent)}return null},t.prototype.updateOverlapped=function(){for(var e=0;e<this.parent.treeGrid.parentData.length;e++)for(var t=this.parent.treeGrid.parentData[e].childRecords,n=0;n<t.length;n++){t[n+1]&&(t[n].ganttProperties.eOverlapped=void 0);for(var a=n+1;a<t.length;a++)t[a].ganttProperties.eOverlapped=void 0,t[n].ganttProperties.startDate.getTime()<t[a].ganttProperties.endDate.getTime()&&t[n].ganttProperties.endDate.getTime()>t[a].ganttProperties.startDate.getTime()?(t[a].ganttProperties.eOverlapped=!0,t[n].ganttProperties.eOverlapped=!0):(i.i(r.isNullOrUndefined)(t[a].ganttProperties.eOverlapped)&&(t[a].ganttProperties.eOverlapped=!1),i.i(r.isNullOrUndefined)(t[n].ganttProperties.eOverlapped)&&(t[n].ganttProperties.eOverlapped=!1))}},t.prototype.updateDragDropRecords=function(e,t){var i=e.childRecords,r=this.parent.currentViewData.indexOf(e),n=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight;t||(t=this.ganttChartTableBody.childNodes[r]),t.style.height=this.parent.treeGrid.getRowByIndex(r).style.height=this.parent.rowHeight+"px",this.parent.contentHeight=n;var a=[],s=0;if(e){for(var o=0;o<i.length;o++)for(var l=o+1;l<i.length;l++)for(var d=t.getElementsByClassName("e-taskbar-main-container"),h=0;h<d.length;h++)i[o].ganttProperties.startDate.getTime()<i[l].ganttProperties.endDate.getTime()&&i[o].ganttProperties.endDate.getTime()>i[l].ganttProperties.startDate.getTime()?d[h].getAttribute("rowuniqueid")===i[l].rowUniqueID&&-1==a.indexOf(i[l].rowUniqueID)&&(a.push(i[l].rowUniqueID),s++,t.children[0].style.verticalAlign="baseline",t.getElementsByClassName("e-taskbar-main-container")[h].style.marginTop=s*this.parent.rowHeight+this.taskBarMarginTop+"px",t.style.height=this.parent.treeGrid.getRowByIndex(r).style.height=parseInt(t.style.height)+this.parent.rowHeight+"px"):d[h].getAttribute("rowuniqueid")===i[l].rowUniqueID&&-1==a.indexOf(i[l].rowUniqueID)&&this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.draggedRecord&&d[h].getAttribute("rowuniqueid")===this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID&&this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID===i[l].rowUniqueID&&(t.getElementsByClassName("e-taskbar-main-container")[h].style.marginTop=this.parent.editModule.taskbarEditModule.draggedRecordMarginTop);this.parent.contentHeight=n,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px"}},t.prototype.refreshRow=function(e,t){var n=this.ganttChartTableBody.childNodes[e],a=this.parent.currentViewData[e];if(-1!==e&&a){var s=a;!this.parent.allowTaskbarOverlap&&"ResourceView"===this.parent.viewType&&s.expanded&&(n.style.height=this.parent.treeGrid.getRowByIndex(e).style.height=this.parent.rowHeight+"px"),"ResourceView"===this.parent.viewType&&s.hasChildRecords&&!s.expanded&&this.parent.enableMultiTaskbar?n.replaceChild(this.getResourceParent(s).childNodes[0],n.childNodes[0]):"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&!s.expanded?n.replaceWith(this.getGanttChartRow(e,s)):n.replaceChild(this.getGanttChartRow(e,s).childNodes[0],n.childNodes[0]),this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&s.hasChildRecords&&this.parent.showOverAllocation&&this.parent.allowTaskbarOverlap&&(t?this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData):(this.parent.dataOperation.updateOverlappingValues(s),this.parent.ganttChartModule.renderRangeContainer([s])));var o=!i.i(r.isNullOrUndefined)(s.ganttProperties.segments)&&s.ganttProperties.segments.length;if(o>0)for(var l=0;l<o;l++){var d=n.getElementsByClassName("e-segmented-taskbar"),h=d[l];this.triggerQueryTaskbarInfoByIndex(h,s)}else this.triggerQueryTaskbarInfoByIndex(n,s);var p="ProjectView"===this.parent.viewType?s.ganttProperties.taskId:s.ganttProperties.rowUniqueID;this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll||this.parent.treeGrid.grid.setRowData(p,s),"ResourceView"!==this.parent.viewType||!s.hasChildRecords||s.expanded||!this.parent.enableMultiTaskbar||this.parent.allowTaskbarOverlap||this.parent.ganttChartModule.isCollapseAll||this.parent.ganttChartModule.isExpandAll||this.updateDragDropRecords(a,n),"ResourceView"===this.parent.viewType&&s.hasChildRecords&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap&&this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);var u=this.parent.ganttChartModule.tempNextElement;this.parent.ganttChartModule.isEditableElement&&u&&(this.parent.treeGrid.grid.focusModule.focus(),i.i(r.addClass)([this.parent.treeGrid.getRows()[n.ariaRowIndex].children[this.parent.ganttChartModule.childrenIndex]],"e-focused"),this.parent.ganttChartModule.tempNextElement=null);var c=this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[e].getAttribute("data-uid"));i.i(r.isNullOrUndefined)(c)||(c.data=s)}},t.prototype.updateResourceTaskbarElement=function(e,t){var n=e.querySelector(".e-taskbar-main-container");i.i(r.addClass)([n],"collpse-parent-border");var a=e.querySelector("."+s.D).getAttribute("rowUniqueId"),o=this.parent.getRecordByID(a),l="";o&&!i.i(r.isNullOrUndefined)(o.ganttProperties.eOverlapIndex)&&(l=o.ganttProperties.eOverlapIndex.toString());var d=n.cloneNode(!0);d.style.zIndex=l,t[0].childNodes[0].childNodes[0].childNodes[0].appendChild(d)},t.prototype.getResourceParent=function(e){var t=this.parent.ganttChartModule.getChartRows();if(this.parent.initialChartRowElements&&!this.parent.allowTaskbarDragAndDrop&&this.parent.allowTaskbarOverlap)for(var n=0;n<this.parent.initialChartRowElements.length;n++)i.i(r.isNullOrUndefined)(t[n])||i.i(r.isNullOrUndefined)(t[n].childNodes[0].childNodes[1].childNodes[2])||i.i(r.isNullOrUndefined)(this.parent.initialChartRowElements[n].childNodes[0].childNodes[1].childNodes[2])||(t[n].childNodes[0].childNodes[1].childNodes[2].innerHTML=this.parent.initialChartRowElements[n].childNodes[0].childNodes[1].childNodes[2].innerHTML);this.templateData=e;var a=this.getTableTrNode(),s=this.leftLabelContainer(),o=i.i(r.createElement)("div",{className:"e-collapse-parent"});a[0].childNodes[0].childNodes[0].appendChild(o);var l=this.parent.dataOperation.setSortedChildTasks(e);this.parent.dataOperation.updateOverlappingIndex(l);var d;if(this.parent.enableVirtualization)for(var h=0;h<e.childRecords.length;h++)d=this.getGanttChartRow(e.childRecords[h].index,this.parent.flatData[e.childRecords[h].index]),this.updateResourceTaskbarElement(d,a);else for(var h=0;h<t.length;h++)t[h].classList.contains("gridrowtaskId"+e.ganttProperties.rowUniqueID+"level"+(e.level+1))&&this.updateResourceTaskbarElement(t[h],a);return a[0].childNodes[0].childNodes[0].appendChild([].slice.call(s)[0]),a[0].childNodes[0]},t.prototype.refreshRecords=function(e,t){if(this.parent.isGanttChartRendered){if(this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar){var i=[];i=new a.DataManager(e).executeLocal((new a.Query).sortBy("expanded","Descending")),e=i}for(var r=0;r<e.length;r++){var n=this.parent.currentViewData.indexOf(e[r]);this.refreshRow(n,t)}this.parent.ganttChartModule.updateLastRowBottomWidth()}},t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("renderPanels",this.createChartTable),this.parent.off("dataReady",this.initiateTemplates),this.parent.off("destroy",this.destroy))},t.prototype.destroy=function(){this.removeEventListener()},t.prototype.generateAriaLabel=function(e){e=this.templateData;var t="",i=this.parent.localeObj.getConstant("name"),r=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),a=this.parent.localeObj.getConstant("duration"),s=e.ganttProperties.taskName,o=e.ganttProperties.startDate,l=e.ganttProperties.endDate,d=e.ganttProperties.duration;return e.ganttProperties.isMilestone?t=i+" "+s+" "+r+" "+this.parent.getFormatedDate(o):(s&&(t+=i+" "+s+" "),o&&(t+=r+" "+this.parent.getFormatedDate(o)+" "),l&&(t+=n+" "+this.parent.getFormatedDate(l)+" "),d&&(t+=a+" "+this.parent.getDurationString(d,e.ganttProperties.durationUnit))),t},t.prototype.generateBaselineAriaLabel=function(e){e=this.templateData;var t="",i=this.parent.localeObj.getConstant("name"),r=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),a=e.ganttProperties.taskName,s=e.ganttProperties.baselineStartDate,o=e.ganttProperties.baselineEndDate;return t+="Baseline ",t+=i+" "+a+" ",t+=r+" "+this.parent.getFormatedDate(s)+" ",t+=n+" "+this.parent.getFormatedDate(o)+" "},t.prototype.generateSpiltTaskAriaLabel=function(e,t){var i="",r=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),a=this.parent.localeObj.getConstant("duration"),s=e.startDate,o=e.endDate,l=e.duration;return s&&(i+=r+" "+this.parent.getFormatedDate(s)+" "),o&&(i+=n+" "+this.parent.getFormatedDate(o)+" "),l&&(i+=a+" "+this.parent.getDurationString(l,t.durationUnit)),i},t.prototype.generateTaskLabelAriaLabel=function(e){var t="";return"left"===e&&this.parent.labelSettings.leftLabel&&!this.leftTaskLabelTemplateFunction?t+=this.parent.localeObj.getConstant("leftTaskLabel")+" "+this.getTaskLabel(this.parent.labelSettings.leftLabel):"right"===e&&this.parent.labelSettings.rightLabel&&!this.rightTaskLabelTemplateFunction&&(t+=this.parent.localeObj.getConstant("rightTaskLabel")+" "+this.getTaskLabel(this.parent.labelSettings.rightLabel)),t},t}(o.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(3)),a=i(1),s=i(89),o=(i.n(s),function(){function e(e){this.transform="",this.connectorLinePath="",this.arrowPath="",this.expandedRecords=[],this.parent=e,this.dependencyViewContainer=i.i(r.createElement)("div",{className:n._24}),Object.assign(this.dependencyViewContainer.style,{width:"100%",height:"100%",zIndex:2,position:"absolute",pointerEvents:"none"}),this.renderer=new s.SvgRenderer(this.parent.element.id),this.initPublicProp(),this.svgObject=this.renderer.createSvg({id:this.parent.element.id+"_svg"}),this.svgObject.setAttribute("height","100%"),this.svgObject.setAttribute("width","100%")}return e.prototype.getconnectorLineGap=function(e){return e.milestoneChild?this.parent.chartRowsModule.milestoneMarginTop/2+this.parent.chartRowsModule.milestoneHeight/2:this.parent.chartRowsModule.taskBarMarginTop/2+this.parent.chartRowsModule.taskBarHeight/2},e.prototype.initPublicProp=function(){this.lineColor=this.parent.connectorLineBackground,this.lineStroke=this.parent.connectorLineWidth>4?4:this.parent.connectorLineWidth,this.createConnectorLineTooltipTable()},e.prototype.getTaskbarMidpoint=function(e){return Math.floor(e?this.parent.chartRowsModule.milestoneMarginTop+this.parent.chartRowsModule.milestoneHeight/2:this.parent.chartRowsModule.taskBarMarginTop+this.parent.chartRowsModule.taskBarHeight/2)+1},e.prototype.createConnectorLineObject=function(e,t,n){var s,o={};s=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.expandedRecords:this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport?this.parent.flatData:this.expandedRecords;var l,d;if(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth){var h=this.parent.flatData.filter(function(t){return t.ganttProperties.taskId.toString()==e.ganttProperties.taskId.toString()})[0],p=this.parent.flatData.filter(function(e){return e.ganttProperties.taskId.toString()==t.ganttProperties.taskId.toString()})[0];l=h.index,d=p.index}else l=s.indexOf(e),d=s.indexOf(t);var u,c=e.ganttProperties,g=t.ganttProperties;if(u=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData):this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.getExpandedRecords(this.parent.currentViewData),o.parentIndexInCurrentView=u.indexOf(e),o.childIndexInCurrentView=u.indexOf(t),!(this.parent.virtualScrollModule&&this.parent.enableVirtualization)&&(-1===o.parentIndexInCurrentView||-1===o.childIndexInCurrentView)||-1===o.parentIndexInCurrentView&&-1===o.childIndexInCurrentView)return null;o.parentLeft=c.isMilestone?c.left-this.parent.chartRowsModule.milestoneHeight/2:c.left,o.childLeft=g.isMilestone?g.left-this.parent.chartRowsModule.milestoneHeight/2:g.left,o.parentWidth=0===c.width||c.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):c.width,o.childWidth=0===g.width||g.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):g.width,o.parentIndex=l,o.childIndex=d;var f=!i.i(r.isNullOrUndefined)(this.parent.ganttChartModule.getChartRows())&&this.parent.ganttChartModule.getChartRows()[0]&&this.parent.ganttChartModule.getChartRows()[0].getBoundingClientRect().height;o.rowHeight=f&&!isNaN(f)?f:this.parent.rowHeight,o.type=n.type;var m="ResourceView"===this.parent.viewType?c.taskId:c.rowUniqueID,y="ResourceView"===this.parent.viewType?g.taskId:g.rowUniqueID;return o.connectorLineId="parent"+m+"child"+y,o.milestoneParent=!!c.isMilestone,o.milestoneChild=!!g.isMilestone,o.parentEndPoint=o.parentLeft+o.parentWidth,o.childEndPoint=o.childLeft+o.childWidth,i.i(r.isNullOrUndefined)(i.i(a.c)(c))||i.i(r.isNullOrUndefined)(i.i(a.c)(g))?null:o},e.prototype.renderConnectorLines=function(e){for(var t="",i=[],r=0;r<e.length;r++)t+=this.getConnectorLineTemplate(e[r]),i.push(e[r]);this.svgObject.innerHTML=t;for(var n=this.parent.connectorLineModule.svgObject.childNodes,a=0;a<n.length;a++)for(var s=n[a].childNodes,o=0;o<s.length;o++){var l="Connector Line "+this.parent.connectorLineModule.generateAriaLabel(i[a]);s[o].setAttribute("aria-label",l)}this.parent.ganttChartModule.chartBodyContent.insertBefore(this.dependencyViewContainer,this.parent.ganttChartModule.chartBodyContent.lastChild),this.dependencyViewContainer.appendChild(this.svgObject);for(var a=0;a<this.svgObject.children.length;a++)this.svgObject.children[a].children[0].setAttribute("tabindex","-1")},e.prototype.getParentPosition=function(e){if(e.parentIndex<e.childIndex){if("FF"===e.type)return e.childLeft+e.childWidth>=e.parentLeft+e.parentWidth?"FFType2":"FFType1";if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth+25){if("FS"===e.type)return"FSType1";if("SF"===e.type)return"SFType1";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType2"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.parentLeft>e.childLeft+e.childWidth+25&&"SF"===e.type)return"SFType2";if(e.parentLeft>e.childLeft){if("SS"===e.type)return"SSType1";if("SF"===e.type)return"SFType1";if("FF"===e.type)return"FFType1"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType2";if("FS"===e.type)return"FSType2";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType1";if("SF"===e.type)return"SFType1"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType2";if("FF"===e.type)return"FFType2";if("SS"===e.type)return"SSType2";if("SF"===e.type)return"SFType1"}}else if(e.parentIndex>e.childIndex)if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth){if("FS"===e.type)return 30>=e.childLeft-(e.milestoneParent?e.parentLeft+e.parentWidth+4:e.parentLeft+e.parentWidth)?"FSType3":"FSType4";if(e.parentLeft<e.childLeft||e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType4"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.childLeft+e.childWidth<=e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType3";if("SF"===e.type)return e.childLeft+e.childWidth+25<e.parentLeft?"SFType3":"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}if("FS"===e.type)return"FSType3"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType3";if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}return null},e.prototype.getHeightValue=function(e){return"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap?e.parentIndex*this.parent.rowHeight>e.childIndex*this.parent.rowHeight?e.parentIndex*this.parent.rowHeight-e.childIndex*this.parent.rowHeight:e.childIndex*this.parent.rowHeight-e.parentIndex*this.parent.rowHeight:e.parentIndex*e.rowHeight>e.childIndex*e.rowHeight?e.parentIndex*e.rowHeight-e.childIndex*e.rowHeight:e.childIndex*e.rowHeight-e.parentIndex*e.rowHeight},e.prototype.getInnerElementWidthSSType2=function(e){return e.parentLeft===e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getInnerElementLeftSSType2=function(e){return e.parentLeft===e.childLeft?e.parentLeft-20:e.parentLeft-10},e.prototype.getInnerChildWidthSSType2=function(e){return e.parentLeft+e.parentWidth<e.childLeft?10:e.parentLeft===e.childLeft?20:e.parentLeft+e.parentWidth>=e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getBorderStyles=function(e,t){return"border-"+e+"-width:"+t+"px;border-"+e+"-style:solid;"+(i.i(r.isNullOrUndefined)(this.lineColor)?"":"border-"+e+"-color:"+this.lineColor+";")},e.prototype.getConnectorLineTemplate=function(e){var t=this.getInnerChildWidthSSType2(e),i=this.getInnerElementWidthSSType2(e),r=this.getInnerElementLeftSSType2(e),a=this.getHeightValue(e),s=!!e.milestoneParent,o=!!e.milestoneChild,l=this.parent.virtualScrollModule&&this.parent.enableVirtualization,d=this.getPosition(e,this.getParentPosition(e),a),h=this.getPosition(e,this.getParentPosition(e),a),p=h.top,u=0;this.parent.renderBaseline&&(u=e.milestoneParent&&e.milestoneChild?0:e.milestoneParent?-5:e.milestoneChild?5:0);var c=l?d.height:a+u,g=0,f=0,m=0,y=0,D=0;if("ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap){for(var v=0;v<this.parent.currentViewData.length;v++)"none"!=this.parent.getRowByIndex(v).style.display&&D<e.parentIndex&&(D++,m+=this.parent.getRowByIndex(v).offsetHeight);D=0;for(var w=0;w<this.parent.currentViewData.length;w++)"none"!=this.parent.getRowByIndex(w).style.display&&D<e.childIndex&&(D++,y+=this.parent.getRowByIndex(w).offsetHeight);c=Math.abs(m-y)}if(this.parent.currentViewData[e.parentIndex]&&this.parent.currentViewData[e.childIndex]&&this.parent.allowParentDependency){var k=this.parent.currentViewData[e.parentIndex].hasChildRecords,b=this.parent.currentViewData[e.childIndex].hasChildRecords,T=this.parent.currentViewData[e.parentIndex].ganttProperties.isAutoSchedule,S=this.parent.currentViewData[e.childIndex].ganttProperties.isAutoSchedule,P=!0;(k&&T&&!b||b&&S&&!k||k&&T&&S&&b||!k&&!b)&&(P=!1),P&&(k&&!T&&b&&!S?f=-11:k&&!T&&b&&!S||(e.childIndex>e.parentIndex?!k&&b?g=-11:(g=11,f=-11):k&&!b?g=-11:(g=11,f=-11)),this.parent.currentViewData[e.parentIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(f=-11,g=12):"SS"!==e.type&&"FF"!==e.type||(f=-5):this.parent.currentViewData[e.childIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(f=5,g=-10):e.parentIndex<e.childIndex&&("SS"!==e.type&&"FF"!==e.type||(f=-10)):e.parentIndex<e.childIndex&&T&&!S?(f=0,g=-11):e.childIndex<e.parentIndex&&!T&&S&&(f=0,g=-11))}return this.getParentPosition(e)&&(this.transform=this.parent.enableRtl?"translate("+this.parent.timelineModule.totalTimelineWidth+", 0) scale(-1, 1)":"",this.connectorId="ConnectorLine"+e.connectorLineId,this.groupObject=this.renderer.createGroup({id:this.connectorId,transform:this.transform,style:"pointer-events: stroke",class:n.V}),this.connectorPath=this.renderer.drawPath({class:n._9,d:this.connectorLinePath,fill:"transparent","stroke-width":1}),this.arrowlinePath=this.renderer.drawPath({d:this.arrowPath,class:n._10}),this.groupObject.appendChild(this.connectorPath),this.groupObject.appendChild(this.arrowlinePath),"FSType1"===this.getParentPosition(e)&&(this.taskLineValue=e.milestoneChild?1:0,this.x1=e.parentEndPoint+(e.milestoneParent?-1:e.milestoneChild?-1:0),this.x2=e.milestoneParent?e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10+1:e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-u,this.y2=c+this.taskLineValue+g-this.lineStroke,this.connectorLinePath="M "+this.x1+" "+this.y1+" L "+(this.x1+this.x2)+" "+this.y1+" L "+(this.x1+this.x2)+" "+(this.y1+this.y2)+" L "+(this.x1+this.x2+12)+" "+(this.y1+this.y2),this.arrowPath="M "+(this.x1+this.x2+20)+" "+(this.y1+this.y2)+" L "+(this.x1+this.x2+12)+" "+(this.y1+this.y2-(4+this.lineStroke))+" L "+(this.x1+this.x2+12)+" "+(this.y1+this.y2+4)+" Z"),"FSType2"===this.getParentPosition(e)&&(this.x1=e.parentLeft,this.x2=e.parentWidth+(e.milestoneParent?-1:0),this.x3=this.x2+(e.milestoneParent?11:10),this.x4=e.parentWidth-(e.parentEndPoint-e.childLeft+20),this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-u,this.y2=c+g-this.getconnectorLineGap(e)-this.lineStroke,this.y3=this.getconnectorLineGap(e),this.y4=this.parent.allowTaskbarOverlap?this.y1+this.y2-(this.y1+this.y2)%e.rowHeight:y,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+(this.x1+this.x3)+" "+this.y1+" L "+(this.x1+this.x3)+" "+this.y4+" L "+(this.x1+this.x4)+" "+this.y4+" L "+(this.x1+this.x4)+" "+(this.y1+this.y2+this.y3)+" L "+(this.x1+this.x4+12)+" "+(this.y1+this.y2+this.y3),this.arrowPath="M "+(this.x1+this.x4+20)+" "+(this.y1+this.y2+this.y3)+" L "+(this.x1+this.x4+12)+" "+(this.y1+this.y2+this.y3-(4+this.lineStroke))+" L "+(this.x1+this.x4+12)+" "+(this.y1+this.y2+this.y3+4+this.lineStroke)+" Z"),"FSType3"===this.getParentPosition(e)&&(this.taskLineValue=e.milestoneChild?1:0,this.point1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-u,this.x1=e.childLeft+(e.milestoneChild?-1:0)+(e.milestoneParent?1:0)-20,this.x2=e.parentEndPoint-e.childLeft+30,this.y1=this.point1+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?11:e.milestoneParent&&!e.milestoneChild?-12:0:0),this.y2=this.point1+c+g-this.getconnectorLineGap(e)-this.lineStroke+this.taskLineValue,this.y3=this.getconnectorLineGap(e),this.y4=this.y2-this.y2%e.rowHeight,this.connectorLinePath="M "+(this.x1+12)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y4+" L "+(this.x1+this.x2)+" "+this.y4+" L "+(this.x1+this.x2)+" "+(this.y2+this.y3)+" L "+(this.x1+this.x2-12)+" "+(this.y2+this.y3),this.arrowPath="M "+(this.x1+20)+" "+this.y1+" L "+(this.x1+12)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+12)+" "+(this.y1+4+this.lineStroke)+" Z"),"FSType4"===this.getParentPosition(e)&&(this.point1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.parentEndPoint+(e.milestoneChild?-1:0)+(e.milestoneParent?1:0),this.x2=e.childLeft-e.parentEndPoint-20,this.y1=this.point1+(e.milestoneChild?-1:0),this.y2=this.point1+c+g-this.lineStroke+1+this.taskLineValue+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?-12:e.milestoneParent&&!e.milestoneChild?11:0:0),this.connectorLinePath="M "+(this.x1+this.x2+12)+" "+this.y1+" L "+(this.x1+this.x2)+" "+this.y1+" L "+(this.x1+this.x2)+" "+this.y2+" L "+this.x1+" "+this.y2,this.arrowPath="M "+(this.x1+this.x2+20)+" "+this.y1+" L "+(this.x1+this.x2+12)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+this.x2+12)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType4"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.point1=c+this.taskLineValue+g,this.point2=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.x1=e.parentLeft-10,this.x2=e.childLeft-e.parentLeft,this.y1=this.point2+(e.milestoneChild?1:0),this.y2=this.y1+this.point1+(this.parent.renderBaseline?e.milestoneParent&&!e.milestoneChild?10:e.milestoneChild&&!e.milestoneParent?-13:0:0),this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y2+" L "+(this.x1+10)+" "+this.y2,this.arrowPath="M "+(this.x1+this.x2+8)+" "+this.y1+" L "+(this.x1+this.x2)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+this.x2)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType3"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=c+this.taskLineValue+g-(this.lineStroke-1),this.x1=e.childLeft-20,this.y1=(e.milestoneChild?1:0)+(this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)),this.x2=e.parentLeft-e.childLeft+21,this.y2=this.y1+this.point1+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?-11:e.milestoneParent&&!e.milestoneChild?10:0:0),this.connectorLinePath="M "+(this.x1+12)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y2+" L "+(this.x1+this.x2)+" "+this.y2,this.arrowPath="M "+(this.x1+20)+" "+this.y1+" L "+(this.x1+12)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+12)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType2"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=c+this.taskLineValue+g-this.lineStroke,this.x1=r,this.x2=t+1,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1),this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y2+" L "+(this.x1+i)+" "+this.y2,this.arrowPath="M "+(this.x1+i+8)+" "+this.y2+" L "+(this.x1+i)+" "+(this.y2-(4+this.lineStroke))+" L "+(this.x1+i)+" "+(this.y2+4+this.lineStroke)+" Z"),"SSType1"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=c+this.taskLineValue+g-this.lineStroke,this.x1=e.childLeft-20,this.x2=e.parentLeft-e.childLeft+21,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1),this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y2+" L "+(this.x1+12)+" "+this.y2,this.arrowPath="M "+(this.x1+20)+" "+this.y2+" L "+(this.x1+12)+" "+(this.y2-(4+this.lineStroke))+" L "+(this.x1+12)+" "+(this.y2+4+this.lineStroke)+" Z"),"FFType1"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.x1=e.childEndPoint,this.x2=e.parentEndPoint+(e.milestoneParent?-1:0),this.x3=e.milestoneParent?22:21,this.x4=e.milestoneChild?4:8,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1),this.y2=c+this.taskLineValue+g-this.lineStroke,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+(this.x2+this.x3)+" "+this.y1+" L "+(this.x2+this.x3)+" "+(this.y1+this.y2)+" L "+(this.x1+this.x4)+" "+(this.y1+this.y2),this.arrowPath="M "+this.x1+" "+(this.y1+this.y2)+" L "+(this.x1+8)+" "+(this.y1+this.y2-(4+this.lineStroke))+" L "+(this.x1+8)+" "+(this.y1+this.y2+4+this.lineStroke)+" Z"),"FFType2"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.x1=e.parentEndPoint,this.x2=e.childEndPoint+(e.milestoneParent?22:21),this.x3=e.childEndPoint+(e.milestoneChild?9:8),this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(e.milestoneParent)-(this.lineStroke-1),this.y2=c+this.taskLineValue+g-this.lineStroke,this.connectorLinePath="M "+this.x1+" "+this.y1+" L "+this.x2+" "+this.y1+" L "+this.x2+" "+(this.y1+this.y2)+" L "+this.x3+" "+(this.y1+this.y2),this.arrowPath="M "+(this.x3-8)+" "+(this.y1+this.y2)+" L "+this.x3+" "+(this.y1+this.y2-(4+this.lineStroke))+" L "+this.x3+" "+(this.y1+this.y2+4+this.lineStroke)+" Z"),"FFType3"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.childEndPoint,this.x2=this.x1+(e.milestoneChild?4:8),this.x3=e.parentEndPoint-e.childEndPoint+(e.milestoneChild?16:10),this.x4=e.parentEndPoint+(e.milestoneParent?-1:0),this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.y2=c+this.taskLineValue+g-this.lineStroke+(this.parent.renderBaseline?e.milestoneParent&&!e.milestoneChild?10:e.milestoneChild&&!e.milestoneParent?-11:0:0),this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+(this.x2+this.x3)+" "+this.y1+" L "+(this.x2+this.x3)+" "+(this.y1+this.y2)+" L "+this.x4+" "+(this.y1+this.y2),this.arrowPath="M "+this.x1+" "+this.y1+" L "+(this.x1+8)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+8)+" "+(this.y1+4+this.lineStroke)+" Z"),"FFType4"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.parentEndPoint,this.x2=e.childEndPoint+(e.milestoneChild?7:8),this.x3=this.x2+(e.milestoneChild?12:11),this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.y2=c+this.taskLineValue+g+(this.parent.renderBaseline?e.milestoneParent&&!e.milestoneChild?10:e.milestoneChild&&!e.milestoneParent?-12:0:0)-this.lineStroke+1,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+(this.y1+this.y2)+" L "+this.x1+" "+(this.y1+this.y2),this.arrowPath="M "+(this.x2-8)+" "+this.y1+" L "+this.x2+" "+(this.y1-(4+this.lineStroke))+" L "+this.x2+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType4"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?-1:0,this.point1=this.taskLineValue+c+g-this.getconnectorLineGap(e)-(this.lineStroke-1),this.point2=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-u,this.x1=e.parentLeft-10,this.x2=this.x1+(e.childEndPoint-e.parentLeft+18),this.x3=this.x2+(e.milestoneChild?16:11),this.y1=this.point2+(e.milestoneChild?2:0)+(this.parent.renderBaseline&&e.milestoneParent?-5:0),this.y2=this.y1+this.point1+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?-9:e.milestoneParent&&!e.milestoneChild?9:0:0),this.y3=this.getconnectorLineGap(e),this.y4=this.y2-this.y2%e.rowHeight,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+this.y4+" L "+this.x1+" "+this.y4+" L "+this.x1+" "+(this.y2+this.y3)+" L "+(this.x1+11)+" "+(this.y2+this.y3),this.arrowPath="M "+(this.x2-8)+" "+this.y1+" L "+this.x2+" "+(this.y1-(4+this.lineStroke))+" L "+this.x2+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType3"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.point1=e.parentLeft-(e.childEndPoint+(e.milestoneParent?23:20))+1,this.point2=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.x1=e.childEndPoint,this.x2=this.x1+(e.milestoneChild?9:8),this.x3=this.x2+(e.milestoneChild?17:11),this.y1=this.point2,this.y2=this.y1+c+g-(this.lineStroke-1)+this.taskLineValue+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?-12:e.milestoneParent&&!e.milestoneChild?10:0:0),this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+this.y2+" L "+(this.x3+this.point1)+" "+this.y2,this.arrowPath="M "+(this.x2-8)+" "+this.y1+" L "+this.x2+" "+(this.y1-(4+this.lineStroke))+" L "+this.x2+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType1"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=c+g-this.getconnectorLineGap(e)+this.taskLineValue-this.lineStroke,this.point2=this.getconnectorLineGap(e),this.x1=e.parentLeft-10,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-u,this.x2=e.childEndPoint-e.parentLeft+31,this.y2=this.y1+this.point1,this.x3=e.childEndPoint-e.parentLeft+18,this.y3=this.y2-this.y2%e.rowHeight,this.connectorLinePath="M "+(this.x1+11)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y3+" L "+(this.x1+this.x2)+" "+this.y3+" L "+(this.x1+this.x2)+" "+(this.y2+this.point2)+" L "+(this.x1+this.x3)+" "+(this.y2+this.point2),this.arrowPath="M "+(this.x1+this.x3-8)+" "+(this.y2+this.point2)+" L "+(this.x1+this.x3)+" "+(this.y2+this.point2-(4+this.lineStroke))+" L "+(this.x1+this.x3)+" "+(this.y2+this.point2+4+this.lineStroke)+" Z"),"SFType2"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.childEndPoint,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1),this.x2=e.parentLeft-e.childEndPoint,this.y2=this.y1+c+this.taskLineValue+g-this.lineStroke,this.connectorLinePath="M "+(this.x1+this.x2+1)+" "+this.y1+" L "+(this.x1+this.x2-10)+" "+this.y1+" L "+(this.x1+this.x2-10)+" "+this.y2+" L "+(this.x1+8)+" "+this.y2,this.arrowPath="M "+this.x1+" "+this.y2+" L "+(this.x1+8)+" "+(this.y2-(4+this.lineStroke))+" L "+(this.x1+8)+" "+(this.y2+4+this.lineStroke)+" Z"),this.connectorPath.setAttribute("d",this.connectorLinePath),this.arrowlinePath.setAttribute("d",this.arrowPath)),this.groupObject.outerHTML},e.prototype.getPosition=function(e,t,i){var r=0,n=0;if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){var a=!!e.milestoneParent,s=!!e.milestoneChild,o=this.getTaskbarMidpoint(a)-(this.lineStroke-1),l=this.getTaskbarMidpoint(s)-(this.lineStroke-1),d=-1!==e.parentIndexInCurrentView,h=-1!==e.childIndexInCurrentView,p=this.parent.currentViewData.length-1;"SSType1"===t||"SSType2"===t||"FFType1"===t||"FFType2"===t||"SFType2"===t?(r=d?e.parentIndexInCurrentView*e.rowHeight+o:0,n=d&&h?i:h?e.childIndexInCurrentView*e.rowHeight+o:p*e.rowHeight+o):"SSType3"===t||"SSType4"===t||"FSType4"===t||"FFType3"===t||"FFType4"===t||"SFType4"===t||"SFType3"===t?(r=h?e.childIndexInCurrentView*e.rowHeight+l:0,n=d&&h?i:d?e.parentIndexInCurrentView*e.rowHeight+l:p*e.rowHeight+l):"FSType3"===t?(r=h?e.childIndexInCurrentView*e.rowHeight+o:0,n=d&&h?i:d?e.parentIndexInCurrentView*e.rowHeight+l:p*e.rowHeight+o):"SFType1"!==t&&"FSType1"!==t&&"FSType2"!==t||(r=d?e.parentIndexInCurrentView*e.rowHeight+l:0,n=d&&h?i:h?e.childIndexInCurrentView*e.rowHeight+l:p*e.rowHeight+l)}return{top:r,height:n}},e.prototype.createConnectorLineTooltipTable=function(){this.tooltipTable=i.i(r.createElement)("table",{className:".e-tooltiptable",styles:"margin-top:0px",attrs:{cellspacing:"2px",cellpadding:"2px"}});var e=i.i(r.createElement)("tbody");e.innerHTML="",this.tooltipTable.appendChild(e)},e.prototype.getConnectorLineTooltipInnerTd=function(e,t,i,r){var n='<tr id="fromPredecessor"><td style="padding: 4px;">'+this.parent.localeObj.getConstant("from")+"</td><td> ";return n=n+e+' </td><td style="padding: 2px;"> '+this.parent.localeObj.getConstant(t)+" </td> </tr>",n=n+'<tr id="toPredecessor"><td style="padding: 4px;">'+this.parent.localeObj.getConstant("to")+"</td><td> "+i,n=n+' </td><td style="padding: 2px;"> '+this.parent.localeObj.getConstant(r)+" </td></tr></tbody><table>"},e.prototype.generateAriaLabel=function(e){var t=e.type,i=this.expandedRecords,r=i[e.parentIndex].ganttProperties.taskName,n=i[e.childIndex].ganttProperties.taskName,a=this.parent.localeObj.getConstant("start"),s=this.parent.localeObj.getConstant("finish");return"FS"===t?r+" "+s+" to "+n+" "+a:"FF"===t?r+" "+s+" to "+n+" "+s:"SS"===t?r+" "+a+" to "+n+" "+a:r+" "+a+" to "+n+" "+s},e.prototype.getRecordByID=function(e){if(i.i(r.isNullOrUndefined)(e))return null;if(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth){return this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData.filter(function(t){return t.ganttProperties.taskId.toString()===e.toString()})[0]}return"ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf("T"+e.toString())]:this.parent.flatData[this.parent.ids.indexOf(e.toString())]},e.prototype.removePreviousConnectorLines=function(e){var t;t=!0===i.i(r.isObject)(e);for(var n=t?Object.keys(e).length:e.length,a=Object.keys(e),s=0;s<n;s++){var o=void 0;if(t){o=e[a[s]]}else o=e[s];var l=o.ganttProperties&&o.ganttProperties.predecessor;if(l&&l.length>0)for(var d=0;d<l.length;d++){var h="parent"+l[d].from+"child"+l[d].to;this.removeConnectorLineById(h)}}},e.prototype.removeConnectorLineById=function(e){var t=this.parent.connectorLineModule.dependencyViewContainer.querySelector("#ConnectorLine"+e);i.i(r.isNullOrUndefined)(t)||i.i(r.remove)(t)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),i(9)),a=(i.n(n),i(3)),s=function(){function e(e,t){this.parent=e,this.taskbarEdit=t}return e.prototype.createTooltip=function(e,t,i){var r=this;this.toolTipObj=new n.Tooltip({opensOn:e,position:"TopRight",enableRtl:this.parent.enableRtl,mouseTrail:t,cssClass:a._8,target:i||null,animation:{open:{effect:"None"},close:{effect:"None"}}}),this.toolTipObj.beforeRender=function(e){var t={data:r.taskbarEdit.taskBarEditRecord,args:e,content:r.toolTipObj.content};r.parent.trigger("beforeTooltipRender",t)},this.toolTipObj.afterOpen=function(e){r.updateTooltipPosition(e)},this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.chartPane)},e.prototype.updateTooltipPosition=function(e){e.element.style.visibility="visible";var t=this.parent.element.closest('[style*="zoom"]');if(i.i(r.isNullOrUndefined)(t)){var n=this.parent.getOffsetRect(this.parent.chartPane),a=n.left+this.parent.chartPane.offsetWidth,s=e.element.offsetLeft;a<s+e.element.offsetWidth&&(s+=a-(s+e.element.offsetWidth)),e.element.style.left=s+"px",e.element.style.visibility="visible"}},e.prototype.showHideTaskbarEditTooltip=function(e,t){e&&this.parent.tooltipSettings.showTooltip?(this.createTooltip("Custom",!1),this.parent.tooltipModule.toolTipObj.close(),this.updateTooltip(t),"ConnectorPointLeftDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+a.X)):"ConnectorPointRightDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+a.Y)):this.toolTipObj.open(this.taskbarEdit.taskBarEditElement)):i.i(r.isNullOrUndefined)(this.toolTipObj)||(this.toolTipObj.destroy(),this.toolTipObj=null)},e.prototype.updateTooltip=function(e){var t=this.taskbarEdit.taskBarEditRecord.ganttProperties,n=-1===e?t.width:t.segments[e].width,a=-1===e?t.progressWidth:t.segments[e].progressWidth,s=-1===e?t.left:t.left+t.segments[e].left;i.i(r.isNullOrUndefined)(this.toolTipObj)||("ConnectorPointLeftDrag"===this.taskbarEdit.taskBarEditAction||"ConnectorPointRightDrag"===this.taskbarEdit.taskBarEditAction?(this.toolTipObj.content=this.getTooltipText(e),this.toolTipObj.offsetY=-3):(this.toolTipObj.content=this.getTooltipText(e),this.toolTipObj.refresh(this.taskbarEdit.taskBarEditElement),"LeftResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=0:this.toolTipObj.offsetX=-n:"RightResizing"===this.taskbarEdit.taskBarEditAction||"ParentResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-n:this.toolTipObj.offsetX=0:"ProgressResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-a:this.toolTipObj.offsetX=-(n-a):"MilestoneDrag"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-this.parent.chartRowsModule.milestoneHeight/2:n>5&&(this.toolTipObj.offsetX=-(n+s-this.taskbarEdit.tooltipPositionX))))},e.prototype.getTooltipText=function(e){var t="",n=this.parent.globalize,a=this.taskbarEdit.taskBarEditRecord.ganttProperties;if(!i.i(r.isNullOrUndefined)(a.segments)&&a.segments.length>0&&-1!==e&&"ProgressResizing"!==this.taskbarEdit.taskBarEditAction&&(a=a.segments[e]),this.parent.tooltipSettings.editing){var s=this.parent.tooltipModule.templateCompiler(this.parent.tooltipSettings.editing,this.parent,this.taskbarEdit.taskBarEditRecord,"TooltipEditingTemplate");i.i(r.getValue)("tooltipEle",this.toolTipObj)&&this.parent.renderTemplates(),t=s[0]}else{var o=void 0,l=void 0,d=void 0;switch(i.i(r.isNullOrUndefined)(a.startDate)||(o='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+n.formatDate(a.startDate,{format:this.parent.getDateFormat()})+"</td></tr>"),i.i(r.isNullOrUndefined)(a.endDate)||(l='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+n.formatDate(a.endDate,{format:this.parent.getDateFormat()})+"</td></tr>"),i.i(r.isNullOrUndefined)(a.duration)||(d='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+this.parent.getDurationString(a.duration,a.durationUnit)+"</td></tr>"),this.taskbarEdit.taskBarEditAction){case"ProgressResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+('<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+a.progress+"</td></tr>")+"</tbody></table>";break;case"LeftResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+o+d+"</tbody></table>";break;case"RightResizing":case"ParentResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+l+d+"</tbody></table>";break;case"ChildDrag":case"ParentDrag":case"MilestoneDrag":case"ManualParentDrag":var h="",p="";i.i(r.isNullOrUndefined)(this.taskbarEdit.taskBarEditRecord.ganttProperties.startDate)||(h=o),i.i(r.isNullOrUndefined)(this.taskbarEdit.taskBarEditRecord.ganttProperties.endDate)||(p=l),t='<table class = "e-gantt-tooltiptable"><tbody>'+h+p+"</tbody></table>";break;case"ConnectorPointLeftDrag":case"ConnectorPointRightDrag":t=this.parent.connectorLineModule.tooltipTable,i.i(r.isNullOrUndefined)(this.toolTipObj)&&(this.parent.connectorLineModule.tooltipTable.innerHTML=this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.taskName,this.parent.editModule.taskbarEditModule.fromPredecessorText,"",""))}}return t},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(0),n=(i.n(r),i(3)),a=function(){function e(e){this.parent=e,this.eventMarkersContainer=null}return e.prototype.renderEventMarkers=function(){this.parent.eventMarkers&&this.parent.eventMarkers.length>0?(this.parent.ganttChartModule.chartBodyContent.contains(this.eventMarkersContainer)||(this.eventMarkersContainer=i.i(r.createElement)("div",{className:n.t}),this.eventMarkersContainer.setAttribute("role","term"),this.parent.ganttChartModule.chartBodyContent.appendChild(this.eventMarkersContainer)),this.eventMarkersContainer.innerHTML="",this.getEventMarkersElements(this.eventMarkersContainer)):this.removeContainer()},e.prototype.removeContainer=function(){this.eventMarkersContainer&&(i.i(r.remove)(this.eventMarkersContainer),this.eventMarkersContainer=null)},e.prototype.getEventMarkersElements=function(e){for(var t,a,s,o,l=0;l<this.parent.eventMarkers.length;l++){t=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(this.parent.eventMarkers[l].day,!0),!1);var d=void 0;if(d=this.parent.enableRtl?"right:"+t+"px;":"left:"+t+"px;",a=i.i(r.createElement)("div",{className:n.u,styles:d+" height:100%;",id:"stripline"+l}),this.parent.eventMarkers[l].label){s=i.i(r.createElement)("div",{className:n.v});var h=this.parent.disableHtmlEncode?"textContent":"innerHTML";s[h]=this.parent.eventMarkers[l].label,this.parent.enableHtmlSanitizer&&"string"==typeof s[h]&&(s[h]=r.SanitizeHtmlHelper.sanitize(s[h])),this.parent.enableRtl?s.style.right="5px":s.style.left="5px",a.appendChild(s),o=i.i(r.createElement)("div",{className:"e-gantt-right-arrow"}),a.appendChild(o)}this.parent.eventMarkers[l].cssClass&&a.classList.add(this.parent.eventMarkers[l].cssClass),a.setAttribute("tabindex","-1"),i.i(r.isNullOrUndefined)(this.parent.eventMarkers[l].day)||a.setAttribute("aria-label",this.parent.localeObj.getConstant("eventMarkers")+" "+("string"==typeof this.parent.eventMarkers[l].day?this.parent.eventMarkers[l].day:this.parent.getFormatedDate(this.parent.eventMarkers[l].day))+" "+this.parent.eventMarkers[l].label),e.appendChild(a)}},e.prototype.updateContainerHeight=function(){this.eventMarkersContainer&&(this.eventMarkersContainer.style.height=i.i(r.formatUnit)(this.parent.getContentHeight()))},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(0),n=(i.n(r),i(3)),a=function(){function e(e){this.weekendWidthUpdated=!1,this.parent=e,this.nonworkingContainer=null,this.holidayContainer=null,this.weekendContainer=null}return e.prototype.createNonworkingContainer=function(){this.parent.ganttChartModule.chartBodyContent.contains(this.nonworkingContainer)||(this.nonworkingContainer=i.i(r.createElement)("div",{className:n.w}),this.parent.ganttChartModule.chartBodyContent.insertBefore(this.nonworkingContainer,this.parent.ganttChartModule.chartBodyContent.lastChild))},e.prototype.renderHolidays=function(){this.parent.holidays&&this.parent.holidays.length>0?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.holidayContainer)||(this.holidayContainer=i.i(r.createElement)("div",{className:n.x}),this.nonworkingContainer.appendChild(this.holidayContainer)),this.holidayContainer.innerHTML=this.getHolidaysElement().innerHTML):this.holidayContainer&&this.holidayContainer.parentNode&&(i.i(r.remove)(this.holidayContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&i.i(r.remove)(this.nonworkingContainer))},e.prototype.getHolidaysElement=function(){var e,t,a=i.i(r.createElement)("div"),s=this.parent.contentHeight,o=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(o=this.parent.toolbarModule.element.offsetHeight);for(var l=this.parent.ganttHeight-o-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,d=0;d<this.parent.holidays.length;d++){this.parent.holidays[d].from&&this.parent.holidays[d].to?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[d].from),t=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[d].to),t.setDate(t.getDate()+1),e.setHours(0,0,0,0),t.setHours(0,0,0,0)):this.parent.holidays[d].from?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[d].from),e.setHours(0,0,0,0)):this.parent.holidays[d].to&&(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[d].to),e.setHours(0,0,0,0));var h=this.parent.holidays[d].from&&this.parent.holidays[d].to?this.parent.dataOperation.getTaskWidth(e,t):this.parent.perDayWidth,p=this.parent.dataOperation.getTaskLeft(e,!1),u=this.parent.enableRtl?"right:"+p+"px;":"left:"+p+"px;",c=i.i(r.createElement)("div",{className:n.y,styles:u+" width:"+h+"px; height:100%;"}),g=l<s?l/2:s/2,f=i.i(r.createElement)("span",{className:n.z,styles:"top:"+g+"px;left:"+h/2+"px;"}),m=this.parent.disableHtmlEncode?"textContent":"innerHTML";f[m]=this.parent.holidays[d].label?this.parent.holidays[d].label:"",this.parent.enableHtmlSanitizer&&"string"==typeof f[m]&&(f[m]=r.SanitizeHtmlHelper.sanitize(f[m])),c.appendChild(f),this.parent.holidays[d].cssClass&&c.classList.add(this.parent.holidays[d].cssClass),a.appendChild(c)}return a},e.prototype.renderWeekends=function(){this.parent.highlightWeekends?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.weekendContainer)||(this.weekendContainer=i.i(r.createElement)("div",{className:n.A}),this.nonworkingContainer.appendChild(this.weekendContainer)),this.weekendContainer.innerHTML=this.getWeekendElements().innerHTML):this.weekendContainer&&(i.i(r.remove)(this.weekendContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&i.i(r.remove)(this.nonworkingContainer))},e.prototype.getWeekendElements=function(){var e=i.i(r.createElement)("div"),t=new Date(this.parent.timelineModule.timelineStartDate.getTime()),a=new Date(this.parent.timelineModule.timelineEndDate.getTime()),s=this.parent.nonWorkingDayIndex,o=!0;do{if(-1!==s.indexOf(t.getDay())){var l=this.parent.dataOperation.getTaskLeft(t,!1),d=this.parent.perDayWidth;if(o){var h=new Date(t.getTime()),p=new Date(h.getTime());p.setDate(p.getDate()+1),p.setHours(0,0,0,0),d=this.parent.dataOperation.getTaskWidth(h,p),o=!1}var u=new Date(t);u.setDate(u.getDate()+1),u.getTimezoneOffset()==this.parent.timelineModule.timelineStartDate.getTimezoneOffset()||this.weekendWidthUpdated||"Hour"==this.parent.timelineModule.bottomTier&&1===this.parent.timelineSettings.bottomTier.count&&(d-=this.parent.timelineSettings.timelineUnitSize,this.weekendWidthUpdated=!0);var c=this.parent.enableRtl?"right:"+l+"px;":"left:"+l+"px;",g=i.i(r.createElement)("div",{className:n.B,styles:c+" width:"+d+"px;height:100%;"});e.appendChild(g)}t.setDate(t.getDate()+1),t.setHours(0,0,0,0)}while(t<a);return e},e.prototype.updateHolidayLabelHeight=function(){var e=this.parent.getContentHeight(),t=document.getElementById("ganttContainer"),a=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(a=this.parent.toolbarModule.element.offsetHeight);for(var s="auto"===this.parent.height?t.offsetHeight-a-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight:this.parent.ganttHeight-a-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,o=s<e?s/2:e/2,l=this.holidayContainer.querySelectorAll("."+n.z),d=0;d<l.length;d++)l[d].style.top=i.i(r.formatUnit)(o)},e.prototype.updateContainerHeight=function(){var e=this.parent.getContentHeight();this.holidayContainer&&(this.holidayContainer.style.height=i.i(r.formatUnit)(e),this.updateHolidayLabelHeight()),this.weekendContainer&&(this.weekendContainer.style.height=i.i(r.formatUnit)(e))},e.prototype.removeContainers=function(){this.holidayContainer&&i.i(r.remove)(this.holidayContainer),this.weekendContainer&&i.i(r.remove)(this.weekendContainer),this.nonworkingContainer&&i.i(r.remove)(this.nonworkingContainer)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(3)),a=i(4),s=(i.n(a),this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},s.apply(this,arguments)}),o=function(){function e(e){this.isZoomIn=!1,this.isZooming=!1,this.isZoomToFit=!1,this.topTierCollection=[],this.bottomTierCollection=[],this.parent=e,this.initProperties()}return e.prototype.initProperties=function(){this.timelineStartDate=null,this.timelineEndDate=null,this.totalTimelineWidth=0,this.customTimelineSettings=null,this.parent.isTimelineRoundOff=!this.isZoomToFit&&!!i.i(r.isNullOrUndefined)(this.parent.projectStartDate),this.parent.enablePersistence&&this.parent.isLoad&&(this.parent.timelineSettings=this.parent.currentZoomingLevel)},e.prototype.validateTimelineProp=function(){this.roundOffDays(),this.processTimelineProperty(),this.timelineWidthCalculation()},e.prototype.refreshTimeline=function(){this.initProperties(),this.processTimelineUnit(),this.parent.dataOperation.calculateProjectDates(),this.parent.isFromOnPropertyChange||this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff)},e.prototype.refreshTimelineByTimeSpan=function(){this.validateTimelineProp(),(!this.parent.pdfExportModule||this.parent.pdfExportModule&&!this.parent.pdfExportModule.isPdfExport||this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&!this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(this.parent.ganttChartModule.chartTimelineContainer.innerHTML=""),this.createTimelineSeries()},e.prototype.updateChartByNewTimeline=function(){this.parent.chartRowsModule.refreshChartByTimeline(),this.parent.notify("refreshDayMarkers",{})},e.prototype.processZooming=function(e){this.isZoomToFit=!1,this.parent.isProjectDateUpdated||this.parent.dateValidationModule.calculateProjectDates(),i.i(r.isNullOrUndefined)(this.parent.zoomingProjectStartDate)||(this.parent.cloneProjectStartDate=this.parent.cloneProjectStartDate.getTime()<this.parent.zoomingProjectStartDate.getTime()?this.parent.cloneProjectStartDate:this.parent.zoomingProjectStartDate,this.parent.cloneProjectEndDate=this.parent.cloneProjectEndDate.getTime()>this.parent.zoomingProjectEndDate.getTime()?this.parent.cloneProjectEndDate:this.parent.zoomingProjectEndDate),this.parent.zoomingProjectStartDate=null,this.parent.zoomingProjectEndDate=null;var t=this.checkCurrentZoomingLevel();this.isZoomIn=e,this.isZooming=!0;var n=e?t+1:t-1;this.parent.toolbarModule&&(e?n===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?(this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1),this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!0)):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!0):n===this.parent.zoomingLevels[0].level?(this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1),this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!0)):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!0)),n=this.parent.zoomingLevels.findIndex(function(e){return e.level===n});var a=this.parent.zoomingLevels[n],s={requestType:e?"beforeZoomIn":"beforeZoomOut",timeline:a,cancel:!1};this.parent.trigger("actionBegin",s),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),s.cancel||(a=s.timeline,this.changeTimelineSettings(a))},e.prototype.changeTimelineSettings=function(e){var t=this;this.isZoomToFit?this.isSingleTier="None"===this.customTimelineSettings.topTier.unit||"None"===this.customTimelineSettings.bottomTier.unit:this.isZoomIn||(this.isSingleTier="None"===e.topTier.unit||"None"===e.bottomTier.unit);var n=this.isSingleTier?"None"===this.customTimelineSettings.topTier.unit?"topTier":"bottomTier":null;Object.keys(this.customTimelineSettings).forEach(function(a){if(a!==n)t.customTimelineSettings[a]="object"!=typeof e[a]||i.i(r.isNullOrUndefined)(e[a])?e[a]:s({},e[a]);else{var o="topTier"===a?"bottomTier":"topTier";"None"!=e.bottomTier.unit&&(t.customTimelineSettings[o]=s({},e.bottomTier))}}),this.parent.isTimelineRoundOff=!this.isZoomToFit&&!!i.i(r.isNullOrUndefined)(this.parent.projectStartDate),this.processTimelineUnit(),this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff);var a=this.parent.criticalPathModule;if(this.parent.enableCriticalPath&&a&&a.criticalConnectorLine(a.criticalPathCollection,a.detailPredecessorCollection,!0,a.predecessorCollectionTaskIds),this.isZooming||this.isZoomToFit){var o={requestType:this.isZoomIn?"AfterZoomIn":this.isZoomToFit?"AfterZoomToProject":"AfterZoomOut",timeline:this.parent.currentZoomingLevel};this.parent.trigger("actionComplete",o),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()}},e.prototype.processZoomToFit=function(){this.isZoomToFit=!0,this.isZooming=!1,this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.zoomingProjectStartDate>this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=new Date(this.parent.allowUnscheduledTasks?this.parent.zoomingProjectStartDate:this.parent.cloneProjectStartDate)),this.parent.dataOperation.calculateProjectDates();var e,t,n,a=this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime(),s=a/864e5,o=this.parent.ganttChartModule.chartElement.offsetWidth,l=o/s,d=this.parent.zoomingLevels.slice(),h=d.sort(function(e,t){return e.perDayWidth||t.perDayWidth?e.perDayWidth<t.perDayWidth?1:-1:0});if(0!==l){for(var p=0;p<h.length;p++){if(t=h[p],p===h.length-1){e=h[p];break}if(n=h[p+1],l>=t.perDayWidth){e=h[p];break}if(l<t.perDayWidth&&l>n.perDayWidth){e=h[p+1];break}}var u=i.i(r.extend)({},{},e,!0);this.roundOffDateToZoom(this.parent.cloneProjectStartDate,!0,l,u.bottomTier.unit,e),this.roundOffDateToZoom(this.parent.cloneProjectEndDate,!1,l,u.bottomTier.unit,e);var c=this.calculateNumberOfTimelineCells(u),g=this.parent.ganttChartModule.scrollElement.offsetHeight-17,f=this.parent.ganttChartModule.chartBodyContent.offsetHeight,m=f<=g?0:17;u.timelineUnitSize=Math.abs(o-m)/c;var y={requestType:"beforeZoomToProject",timeline:u};this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin",this.parent.controlId+"_zoomout"],!0),this.parent.trigger("actionBegin",y),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),this.changeTimelineSettings(u),this.parent.isTimelineRoundOff=!!i.i(r.isNullOrUndefined)(this.parent.projectStartDate)}},e.prototype.bottomTierCellWidthCalc=function(e,t,i){var r;switch(e){case"Minutes":r=6e4*t.bottomTier.count;break;case"Hour":r=36e5*t.bottomTier.count;break;case"Week":r=6048e5*t.bottomTier.count;break;case"Day":r=864e5*t.bottomTier.count;break;case"Month":var n=new Date(i.getFullYear(),i.getMonth()+1,0).getDate();r=t.bottomTier.count*(86400*n*1e3);break;case"Year":var a=i.getFullYear()%400==0||i.getFullYear()%100!=0&&i.getFullYear()%4==0?366:365;r=t.bottomTier.count*(86400*a*1e3)}return r},e.prototype.roundOffDateToZoom=function(e,t,i,r,n){var a=this.bottomTierCellWidthCalc(r,n,e);t?e.setTime(e.getTime()-a):e.setTime(e.getTime()+a)},e.prototype.calculateNumberOfTimelineCells=function(e){var t=Math.abs((this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime())/864e5),i=e.bottomTier.count,r=e.bottomTier.unit;return"Day"===r?t/i:"Week"===r?t/i/7:"Month"===r?t/i/28:"Year"===r?t/i/336:"Hour"===r?t*(24/i):t*(1440/i)},e.prototype.processTimelineUnit=function(){var e=["timelineViewMode","timelineUnitSize","weekStartDay","weekendBackground"],t={topTier:["unit","format","count","formatter"],bottomTier:["unit","format","count","formatter"]},i=["Year","Month","Week","Day","Hour","Minutes"];this.customTimelineSettings=this.customTimelineSettings?this.customTimelineSettings:this.extendFunction(this.parent.timelineSettings,e,t),-1===i.indexOf(this.customTimelineSettings.topTier.unit)&&-1===i.indexOf(this.customTimelineSettings.bottomTier.unit)?(this.customTimelineSettings.topTier.unit=-1!==i.indexOf(this.customTimelineSettings.timelineViewMode)?this.customTimelineSettings.timelineViewMode:"Week",this.customTimelineSettings.bottomTier.unit=5!==i.indexOf(this.customTimelineSettings.topTier.unit)?i[i.indexOf(this.customTimelineSettings.topTier.unit)+1]:"None"):-1!==i.indexOf(this.customTimelineSettings.topTier.unit)&&-1!==i.indexOf(this.customTimelineSettings.bottomTier.unit)&&i.indexOf(this.customTimelineSettings.topTier.unit)>i.indexOf(this.customTimelineSettings.bottomTier.unit)?this.customTimelineSettings.bottomTier.unit=this.customTimelineSettings.topTier.unit:(this.customTimelineSettings.topTier.unit=-1===i.indexOf(this.customTimelineSettings.topTier.unit)?"None":this.customTimelineSettings.topTier.unit,this.customTimelineSettings.bottomTier.unit=-1===i.indexOf(this.customTimelineSettings.bottomTier.unit)?"None":this.customTimelineSettings.bottomTier.unit),this.topTier=this.customTimelineSettings.topTier.unit,this.bottomTier=this.customTimelineSettings.bottomTier.unit,this.previousIsSingleTier=this.isSingleTier,this.isSingleTier="None"===this.topTier||"None"===this.bottomTier},e.prototype.processTimelineProperty=function(){this.customTimelineSettings.topTier.count="None"===this.topTier?1:this.validateCount(this.customTimelineSettings.topTier.unit,this.customTimelineSettings.topTier.count,"topTier"),this.customTimelineSettings.bottomTier.count="None"===this.customTimelineSettings.bottomTier.unit?1:this.validateCount(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.count,"bottomTier"),this.customTimelineSettings.bottomTier.format=this.validateFormat(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.format),this.customTimelineSettings.topTier.format=this.validateFormat(this.topTier,this.customTimelineSettings.topTier.format),this.customTimelineSettings.weekStartDay=this.customTimelineSettings.weekStartDay>=0&&this.customTimelineSettings.weekStartDay<=6?this.customTimelineSettings.weekStartDay:0,this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth||this.checkCurrentZoomingLevel()},e.prototype.calculateZoomingLevelsPerDayWidth=function(){for(var e=this.parent.zoomingLevels,t=0;t<e.length;t++){var i=this.getPerDayWidth(e[t].timelineUnitSize,e[t].bottomTier.count,e[t].bottomTier.unit);e[t].perDayWidth=i}},e.prototype.checkCurrentZoomingLevel=function(){var e="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.count:this.customTimelineSettings.topTier.count,t="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.unit:this.customTimelineSettings.topTier.unit,i="None"!==this.customTimelineSettings.bottomTier.unit?"bottomTier":"topTier",r=this.getCurrentZoomingLevel(t,e,i);return this.parent.toolbarModule&&(r===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):r===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),this.parent.currentZoomingLevel=this.parent.zoomingLevels[r],r},e.prototype.getCurrentZoomingLevel=function(e,t,i){var r,n,a,s,o;this.parent.zoomingLevels.length||(this.parent.zoomingLevels=this.parent.getZoomingLevels());var l=this.parent.zoomingLevels.filter(function(t){return"bottomTier"===i?t.bottomTier.unit===e:t.topTier.unit===e});if(0===l.length){var d=this.getClosestUnit(e,"",!1);l=this.parent.zoomingLevels.filter(function(e){return"bottomTier"===i?e.bottomTier.unit===d:e.topTier.unit===d})}for(var h=l.sort(function(e,t){return"bottomTier"===i?e.bottomTier.count&&t.bottomTier.count?e.bottomTier.count<t.bottomTier.count?1:-1:0:e.topTier.count&&t.topTier.count?e.topTier.count<t.topTier.count?1:-1:0}),p=0;p<h.length;p++){if(o=h[p],p===h.length-1){r=h[p].level;break}if(s=h[p+1],t>=o[""+i].count){n=h[p],a=h.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count}),r=a.length>1?this.checkCollectionsWidth(a):a[0].level;break}if(t<o[""+i].count&&t>s[""+i].count){n=h[p+1],a=h.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count}),r=a.length>1?this.checkCollectionsWidth(a):a[0].level;break}}return r},e.prototype.getClosestUnit=function(e,t,i){var r=["Year","Month","Week","Day","Hour","Minutes"],n=r.indexOf(e);return 0===n&&(i=!0),e=this.isZoomIn||i?r[n+1]:r[n-1],0===this.parent.zoomingLevels.filter(function(t){return t.bottomTier.unit===e}).length?("Year"===e&&(i=!0),t=e,this.getClosestUnit(e,t,i)):e},e.prototype.checkCollectionsWidth=function(e){for(var t,i,r,n=e,a=this.customTimelineSettings.timelineUnitSize,s=n.sort(function(e,t){return e.timelineUnitSize<t.timelineUnitSize?1:-1}),o=0;o<s.length;o++){if(r=s[o],o===s.length-1){t=s[o].level;break}if(i=s[o+1],a>=r.timelineUnitSize){t=s[o].level;break}if(a<r.timelineUnitSize&&a>i.timelineUnitSize){t=s[o+1].level;break}}return t},e.prototype.updateTimelineHeaderHeight=function(){if(this.parent.timelineModule.isSingleTier?(i.i(r.addClass)([this.parent.ganttChartModule.chartTimelineContainer],n._17),this.parent.treeGrid.element&&(i.i(r.addClass)(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),n._17),i.i(r.addClass)(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),n._17))):(i.i(r.removeClass)([this.parent.ganttChartModule.chartTimelineContainer],n._17),this.parent.treeGrid.element&&(i.i(r.removeClass)(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),n._17),i.i(r.removeClass)(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),n._17))),this.previousIsSingleTier!==this.isSingleTier){var e=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(e=this.parent.toolbarModule.element.offsetHeight),this.parent.ganttChartModule.scrollObject.setHeight(this.parent.ganttHeight-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight-e),this.parent.treeGrid.height=this.parent.ganttHeight-e-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight}},e.prototype.createTimelineSeries=function(){var e,t,a,s,o,l=this.isSingleTier?1:2,d="None"===this.topTier?"bottomTier":"topTier";this.updateTimelineHeaderHeight(),this.topTierCollection=[],this.bottomTierCollection=[];for(var h=0;h<l;h++)s=i.i(r.createElement)("table",{className:n._13,styles:"display: block;"}),o=i.i(r.createElement)("thead",{className:n._57,styles:"display:block; border-collapse:collapse"}),e=i.i(r.createElement)("tr",{innerHTML:this.createTimelineTemplate(d)}),(!this.parent.pdfExportModule||this.parent.pdfExportModule&&!this.parent.pdfExportModule.isPdfExport||this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&!this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(t=i.i(r.createElement)("th"),a=i.i(r.createElement)("div",{styles:"width: 20px"}),t.appendChild(a),e.appendChild(t),o.appendChild(e),s.appendChild(o),this.parent.ganttChartModule.chartTimelineContainer.appendChild(s)),d="bottomTier",e=null;if("Auto"===this.parent.height||this.parent.timelineModule.isSingleTier){var p=this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight;this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+p+"px)",i.i(r.isNullOrUndefined)(this.parent.element.getElementsByClassName("e-gridcontent")[0])||(this.parent.treeGrid.element.getElementsByClassName("e-gridcontent")[0].style.height="calc(100% - "+p+"px)")}},e.prototype.validateCount=function(e,t,n){var a,s=!i.i(r.isNullOrUndefined)(t)&&parseInt(t.toString(),10)>0?parseInt(t.toString(),10):1,o=Math.abs(this.timelineRoundOffEndDate.getTime()-this.timelineStartDate.getTime());switch(e){case"Year":a=Math.round(o/864e5/336),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Month":a=Math.round(o/864e5/28),s=s<=a?s:a>0?a+1:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Week":a=Math.round(o/864e5/7),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Day":a=Math.round(o/864e5),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Hour":a=Math.round(o/36e5),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Minutes":a=Math.round(o/6e4),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s))}return t!==s&&this.isZooming&&this.parent.toolbarModule&&("bottomTier"===n||this.isSingleTier)&&(this.isZoomIn?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),s},e.prototype.validateBottomTierCount=function(e,t){var i;switch(e){case"Year":i=t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Month":i="Year"===this.topTier?t<=12*this.customTimelineSettings.topTier.count?t:12*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Week":i="Year"===this.topTier?t<=48*this.customTimelineSettings.topTier.count?t:48*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=4*this.customTimelineSettings.topTier.count?t:4*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Day":i="Year"===this.topTier?t<=336*this.customTimelineSettings.topTier.count?t:336*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=28*this.customTimelineSettings.topTier.count?t:28*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count?t:7*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Hour":i="Year"===this.topTier?t<=8064*this.customTimelineSettings.topTier.count?t:8064*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=672*this.customTimelineSettings.topTier.count?t:672*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count*24?t:7*this.customTimelineSettings.topTier.count*24:"Day"===this.topTier?t<=24*this.customTimelineSettings.topTier.count?t:24*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Minutes":i="Year"===this.topTier?t<=483840*this.customTimelineSettings.topTier.count?t:483840*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=40320*this.customTimelineSettings.topTier.count?t:40320*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count*24*60?t:7*this.customTimelineSettings.topTier.count*24*60:"Day"===this.topTier?t<=24*this.customTimelineSettings.topTier.count*60?t:24*this.customTimelineSettings.topTier.count*60:"Hour"===this.topTier?t<=60*this.customTimelineSettings.topTier.count?t:60*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count}return i},e.prototype.validateFormat=function(e,t){var i;switch(e){case"Week":i=t||"MMM dd, yyyy";break;case"Day":case"None":i=t||"";break;case"Hour":i=t||"H";break;case"Month":i=t||"MMM yyyy";break;case"Year":i=t||"yyyy";break;case"Minutes":i=t||"m"}return i},e.prototype.extendFunction=function(e,t,i){for(var r=this,n={},a=0;a<t.length;a++)n[t[a]]=e[t[a]];return i&&Object.keys(i).forEach(function(t){n[t]=r.extendFunction(e[t],i[t],null)}),n},e.prototype.formatDateHeader=function(e,t){var i,r=new Date(t.getTime());return""===e?(i=this.parent.globalize.formatDate(r,{format:"E"}),i="zh"===this.parent.locale?i.slice(1):i.slice(0,1)):i=this.parent.globalize.formatDate(r,{format:e}),i},e.prototype.customFormat=function(e,t,n,a,s){return(s="string"==typeof s?i.i(r.getValue)(s,window):s)(e,t,n,a)},e.prototype.createTimelineTemplate=function(e){var t,i,r=!1,n=this.parent,a="",s="",o="topTier"===e?n.timelineModule.customTimelineSettings.topTier.unit:n.timelineModule.customTimelineSettings.bottomTier.unit,l="topTier"===e?n.timelineModule.customTimelineSettings.topTier.count:n.timelineModule.customTimelineSettings.bottomTier.count,d=new Date(this.parent.timelineModule.timelineStartDate.toString()),h=new Date(this.timelineRoundOffEndDate.toString()),p=[];do{var u={};u.startDate=new Date(d.getTime()),"Month"===o&&"bottomTier"===e&&1!=l&&0===p.length&&(r=!0),s=this.getHeaterTemplateString(new Date(d.toString()),o,e,!1,l,u,r),p.push(new Date(d.toString())),r?i=this.calculateQuarterEndDate(d,l).getTime():(t=this.getIncrement(d,l,o),i=d.getTime()+t),r=!1,d.setTime(i),5===d.getHours()&&2===l&&"bottomTier"===e&&"Hour"===this.parent.timelineSettings.bottomTier.unit&&d.setTime(d.getTime()-36e5),d>=h&&(s=this.getHeaterTemplateString(p[p.length-1],o,e,!0,l,u)),a+=s;var c="topTier"===e?this.topTierCollection:this.bottomTierCollection;u.endDate=new Date(d.getTime()),c.push(u)}while(d<h);return a},e.prototype.updateTimelineAfterZooming=function(e,t){var n,a,s,o=document.getElementsByClassName("e-chart-scroll-container e-content")[0];if(!i.i(r.isNullOrUndefined)(o)){var l=o.offsetWidth,d=o.offsetHeight,h=document.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;if(n=Math.abs(this.timelineStartDate.getTime()-e.getTime()),n/=864e5,a="None"===this.bottomTier?this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize,this.customTimelineSettings.topTier.count,this.topTier):this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize,this.customTimelineSettings.bottomTier.count,this.bottomTier),s=d<h?a*n+17:a*n,l>=s){var p=l-s;p=Math.round(p/a),e.setDate(e.getDate()+p),this.parent.timelineModule.timelineEndDate=e,t&&this.parent.updateProjectDates(this.timelineStartDate,this.timelineEndDate,this.parent.isTimelineRoundOff)}}},e.prototype.getTimelineRoundOffEndDate=function(e){var t="None"===this.topTier?this.bottomTier:this.topTier,n=new Date(e.toString());return this.parent.isTimelineRoundOff&&("Hour"===t?n.setMinutes(60):"Minutes"===t?n.setSeconds(60):n.setHours(24,0,0,0)),i.i(r.isNullOrUndefined)(this.parent.projectEndDate)&&this.updateTimelineAfterZooming(n,!1),n},e.prototype.getIncrement=function(e,t,i){var r,n=new Date(e.getTime()),a=new Date(e.getTime());switch(i){case"Year":n=e,a=new Date(e.getFullYear()+(t-1),11,31),r=a.getTime()-n.getTime()+864e5;break;case"Month":n=e,a=new Date(e.getFullYear(),e.getMonth()+t,1),r=a.getTime()-n.getTime();break;case"Week":var s=this.parent.timelineModule.customTimelineSettings.weekStartDay,o=e.getDay()<s?s-e.getDay():6-e.getDay()+s;t=o>0?t-1:0,a.setHours(24,0,0,0),o=e.getDay()<s&&o>0?o-1:o,a.setDate(a.getDate()+(o+7*t)),r=a.getTime()-n.getTime();break;case"Day":a.setHours(24,0,0,0),r=a.getTime()-n.getTime()+864e5*(t-1);break;case"Hour":a.setMinutes(60),a.setSeconds(0),r=a.getTime()-n.getTime()+36e5*(t-1),r=this.checkDate(n,a,r,t);break;case"Minutes":a.setSeconds(60),r=a.getTime()-n.getTime()+6e4*(t-1)}return r},e.prototype.checkDate=function(e,t,i,r){var n=new Date(e.getTime());if(n.setTime(n.getTime()+i),1!==r&&(n.getTime()-t.getTime())/36e5!=r&&e.getTimezoneOffset()!==n.getTimezoneOffset()){var a=r-(n.getTime()-t.getTime())/36e5;this.parent.isInDst(n)?this.parent.isInDst(n)&&2!==r&&(i-=36e5*a):i+=36e5*a}return i},e.prototype.isWeekendHeaderCell=function(e,t,i){return!("Day"!==e&&"Hour"!==e&&"Minutes"!==e||1!==this.customTimelineSettings[t].count&&"Hour"!==e&&"Minutes"!==e||-1===this.parent.nonWorkingDayIndex.indexOf(i.getDay()))},e.prototype.calculateQuarterEndDate=function(e,t){var i=e.getMonth();return 3===t?i>=0&&i<=2?new Date(e.getFullYear(),3,1):i>=3&&i<=5?new Date(e.getFullYear(),6,1):i>=6&&i<=8?new Date(e.getFullYear(),9,1):new Date(e.getFullYear()+1,0,1):i>=0&&i<=5?new Date(e.getFullYear(),6,1):new Date(e.getFullYear()+1,0,1)},e.prototype.getHeaterTemplateString=function(e,t,a,s,o,l,d){var h,p="",u="",c="topTier"===a?this.parent.timelineModule.customTimelineSettings.topTier.format:this.parent.timelineModule.customTimelineSettings.bottomTier.format,g="topTier"===a?this.parent.timelineModule.customTimelineSettings.topTier.formatter:this.parent.timelineModule.customTimelineSettings.bottomTier.formatter,f=i.i(r.isNullOrUndefined)(g)?this.parent.globalize.formatDate(e,{format:this.parent.getDateFormat()}):this.customFormat(e,c,a,t,g);h=this.getIncrement(e,o,t)/864e5*this.parent.perDayWidth;var m=h;h=s||d?s?this.calculateWidthBetweenTwoDate(t,e,this.timelineRoundOffEndDate):this.calculateWidthBetweenTwoDate(t,e,this.calculateQuarterEndDate(e,o)):h;var y=this.isWeekendHeaderCell(t,a,e),D="topTier"===a?" e-gantt-top-cell-text":"",v=i.i(r.isNullOrUndefined)(g)?this.formatDateHeader(c,e):this.customFormat(e,c,a,t,g);return u+=this.parent.timelineModule.isSingleTier?'<th class="'+n._58+" ":'<th class="'+n._59,u+=y?" "+n._60:"",u+='" tabindex="-1" aria-label= "'+this.parent.localeObj.getConstant("timelineCell")+" "+f,u+='" style="width:'+h+"px;",u+=y&&this.customTimelineSettings.weekendBackground?"background-color:"+this.customTimelineSettings.weekendBackground+";":"",u+='"><div class="'+n._61+D+'" style="width:'+(h-1)+"px;"+(this.parent.timelineSettings.showTooltip?'"title="'+f:""),u+='">'+v+"</div>",p+=u,p+="</th>",!this.isSingleTier&&"topTier"!==a||s?(this.isSingleTier||"topTier"===a)&&s&&(this.totalTimelineWidth=this.totalTimelineWidth-m+h):this.totalTimelineWidth=this.totalTimelineWidth+h,l.value=v,l.isWeekend=y,l.width=h,p},e.prototype.calculateWidthBetweenTwoDate=function(e,t,i){return(i.getTime()-t.getTime())/864e5*this.parent.perDayWidth},e.prototype.timelineWidthCalculation=function(){var e=this.customTimelineSettings.timelineUnitSize,t=this.customTimelineSettings.bottomTier.count,i=this.customTimelineSettings.topTier.count;this.bottomTierCellWidth=e,"None"===this.bottomTier?this.parent.perDayWidth=this.getPerDayWidth(e,i,this.topTier):this.parent.perDayWidth=this.getPerDayWidth(e,t,this.bottomTier),this.topTierCellWidth="None"!==this.bottomTier?"Week"===this.topTier?7*this.parent.perDayWidth:"Hour"===this.topTier?this.parent.perDayWidth/24:"Minutes"===this.topTier?this.parent.perDayWidth/1440:this.parent.perDayWidth:e,this.topTierCellWidth=this.isSingleTier?this.topTierCellWidth:this.topTierCellWidth*i},e.prototype.getPerDayWidth=function(e,t,i){var r;switch(i){case"Year":r=e/t/336;break;case"Month":r=e/t/28;break;case"Week":r=e/t/7;break;case"Day":r=e/t;break;case"Hour":r=24/t*e;break;case"Minutes":r=1440/t*e}return r},e.prototype.roundOffDays=function(){var e=this.parent.cloneProjectStartDate,t=this.parent.cloneProjectEndDate,i="None"===this.topTier?this.bottomTier:this.topTier;if(this.parent.isTimelineRoundOff){if("Year"===i)e=new Date(e.getFullYear(),0,1),t=new Date(t.getFullYear(),11,31);else if("Month"===i)e=new Date(e.getFullYear(),e.getMonth(),1),t=new Date(t.getFullYear(),t.getMonth()+1,0);else if("Week"===i){var r=this.parent.timelineModule.customTimelineSettings.weekStartDay,n=e.getDay()<r?e.getDate()-(7-r+e.getDay()):e.getDate()-e.getDay()+r;e.setDate(n);var a=t.getDate()-t.getDay(),s=a+6+r;t.setDate(s)}"Hour"===i?e.setMinutes(0):"Minutes"===i?e.setSeconds(0):e.setHours(0,0,0,0)}this.timelineStartDate=e,this.timelineEndDate=t,this.timelineRoundOffEndDate=this.getTimelineRoundOffEndDate(this.timelineEndDate)},e.prototype.updateScheduleDatesByToolBar=function(e,t,i,r){if("Year"===e&&("prevTimeSpan"===t?i=0===i.getMonth()?new Date(i.getFullYear()-1,0,1):new Date(i.getFullYear(),0,1):r=11===r.getMonth()?new Date(r.getFullYear()+1,0,1):new Date(r.getFullYear(),12,1)),"Month"===e&&("prevTimeSpan"===t?i=1===i.getDate()?new Date(i.getFullYear(),i.getMonth()-1,1):new Date(i.getFullYear(),i.getMonth(),1):r=new Date(r.getFullYear(),r.getMonth()+1,1)),"Week"===e){var n=this.parent.timelineModule.customTimelineSettings.weekStartDay,a=void 0;"prevTimeSpan"===t?(a=i.getDay()<n?7-(n-i.getDay()):i.getDay()-n,i.setHours(0,0,0,0),0===a?i.setDate(i.getDate()-7):i.setDate(i.getDate()-a)):(a=r.getDay()<n?n-r.getDay():7-r.getDay()+n,r.setHours(0,0,0,0),0===a?r.setDate(r.getDate()+6):r.setDate(r.getDate()+a))}"Day"===e&&("prevTimeSpan"===t?0===i.getHours()?i.setTime(i.getTime()-864e5):i.setHours(0):0===r.getHours()?r.setTime(r.getTime()+864e5):r.setHours(24)),"Hour"===e&&("prevTimeSpan"===t?0===i.getMinutes()?i.setTime(i.getTime()-36e5):i.setMinutes(0):0===r.getMinutes()?r.setTime(r.getTime()+36e5):r.setMinutes(60)),"Minutes"===e&&("prevTimeSpan"===t?0===i.getSeconds()?i.setTime(i.getTime()-6e4):i.setSeconds(0):0===r.getSeconds()?r.setTime(r.getTime()+6e4):r.setSeconds(60)),this.parent.cloneProjectStartDate=i,this.parent.cloneProjectEndDate=r},e.prototype.updateTimeLineOnEditing=function(e,t){if(e[0].length>=1)for(var n=0;n<e.length;n++){var s=e[n],o=s.filter(function(e){return!i.i(r.isNullOrUndefined)(e.ganttProperties.startDate)}),l=s.filter(function(e){return!i.i(r.isNullOrUndefined)(e.ganttProperties.endDate)}),d=o.length>0?new Date(a.DataUtil.aggregates.min(o,"ganttProperties.startDate")):null,h=l.length>0?new Date(a.DataUtil.aggregates.max(l,"ganttProperties.endDate")):null,p=new Date(this.parent.dataOperation.checkStartDate(this.timelineStartDate).getTime()),u=new Date(this.parent.dataOperation.checkEndDate(this.timelineEndDate).getTime()),c=i.i(r.isNullOrUndefined)(d)?null:this.parent.dataOperation.getTaskLeft(d,!1),g=i.i(r.isNullOrUndefined)(h)?null:this.parent.dataOperation.getTaskLeft(h,!1),f=this.parent.dataOperation.getTaskLeft(p,!1),m=this.parent.dataOperation.getTaskLeft(u,!1),y=void 0,D=this.parent.editModule.taskbarEditModule;!i.i(r.isNullOrUndefined)(c)&&(d<this.timelineStartDate||!i.i(r.isNullOrUndefined)(D)&&!i.i(r.isNullOrUndefined)(D.taskBarEditAction)&&"ProgressResizing"!==D.taskBarEditAction&&"RightResizing"!==D.taskBarEditAction)&&(c<this.bottomTierCellWidth||c<=f)?(y="prevTimeSpan",d=d>this.timelineStartDate?this.timelineStartDate:d):d=this.timelineStartDate,!i.i(r.isNullOrUndefined)(g)&&(g>=this.totalTimelineWidth-this.bottomTierCellWidth||g>=m)?(y="prevTimeSpan"===y?"both":"nextTimeSpan",h=h<this.timelineEndDate?this.timelineEndDate:h):h=this.timelineEndDate,y?this.performTimeSpanAction(y,t,d,h):i.i(r.isNullOrUndefined)(s[0].ganttProperties.segments)||this.parent.dataOperation.updateWidthLeft(s[0]);break}},e.prototype.performTimeSpanAction=function(e,t,n,a,s){s=i.i(r.isNullOrUndefined)(s)?"None"===this.parent.timelineModule.topTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier:s;var o=new Date(this.parent.cloneProjectStartDate.getTime()),l=new Date(this.parent.cloneProjectEndDate.getTime());"publicMethod"!==t&&"both"===e?(this.updateScheduleDatesByToolBar(s,"prevTimeSpan",n,a),this.updateScheduleDatesByToolBar(s,"nextTimeSpan",new Date(this.parent.cloneProjectStartDate.getTime()),a)):this.updateScheduleDatesByToolBar(s,e,n,a);var d=this.timeSpanActionEvent("actionBegin",e,t);if(d.cancel)this.parent.cloneProjectStartDate=o,this.parent.cloneProjectEndDate=l;else{if(this.parent.updateProjectDates(d.projectStartDate,d.ProjectEndDate,d.isTimelineRoundOff,t),"prevTimeSpan"===e&&"publicMethod"===t)this.parent.ganttChartModule.updateScrollLeft(0),this.parent.timelineModule.isZoomToFit=!1;else if("nextTimeSpan"===e&&"publicMethod"===t)this.parent.ganttChartModule.updateScrollLeft(this.parent.timelineModule.totalTimelineWidth),this.parent.timelineModule.isZoomToFit=!1;else if("nextTimeSpan"===e&&"TaskbarEditing"===t){var h=document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollLeft;this.parent.element.querySelector(".e-timeline-header-container").scrollLeft=h,this.parent.timelineModule.isZoomToFit=!1}this.parent.timelineModule.timeSpanActionEvent("actionComplete",e,t)}},e.prototype.timeSpanActionEvent=function(e,t,i){var r={};return r.projectStartDate=new Date(this.parent.cloneProjectStartDate.getTime()),r.ProjectEndDate=new Date(this.parent.cloneProjectEndDate.getTime()),r.requestType="publicMethod"===i?t:"beforeAdd"===i?"TimelineRefreshOnAdd":"TaskbarEditing"===i?"TimelineRefreshOnEdit":t,"actionBegin"===e&&(r.isTimelineRoundOff=this.parent.isTimelineRoundOff,r.cancel=!1),r.action="TimescaleUpdate",this.parent.trigger(e,r),r},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(9),n=(i.n(r),i(1)),a=i(3),s=i(0),o=(i.n(s),i(4)),l=(i.n(o),function(){function e(e){this.parent=e,this.createTooltip(),this.parent.on("destroy",this.destroy,this)}return e.prototype.createTooltip=function(){this.toolTipObj=new r.Tooltip,this.toolTipObj.target=".e-header-cell-label, .e-gantt-child-taskbar,.e-gantt-parent-taskbar, .e-gantt-milestone, .e-gantt-unscheduled-taskbar.e-event-markers, .e-baseline-bar, .e-event-markers,.e-connector-line-container, .e-indicator-span, .e-notes-info, .e-gantt-manualparent-milestone,.e-taskbar-left-resizer, .e-taskbar-right-resizer, .e-baseline-gantt-milestone, .e-gantt-manualparenttaskbar",this.toolTipObj.position="BottomCenter",this.toolTipObj.openDelay=700,this.toolTipObj.enableRtl=this.parent.enableRtl,this.toolTipObj.enableHtmlSanitizer=this.parent.enableHtmlSanitizer,this.toolTipObj.cssClass=a._8,this.toolTipObj.animation={open:{effect:"None",delay:0},close:{effect:"None",delay:0}},this.toolTipObj.afterOpen=this.updateTooltipPosition.bind(this),this.toolTipObj.showTipPointer=!1,this.toolTipObj.beforeRender=this.tooltipBeforeRender.bind(this),this.toolTipObj.afterClose=this.tooltipCloseHandler.bind(this),this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.element)},e.prototype.tooltipBeforeRender=function(e){var t=this.parent;if(t.isOnEdit)return void(e.cancel=!0);var r,l=i.i(s.closest)(e.target,"div."+a.D);r=i.i(s.isNullOrUndefined)(l)?i.i(n.j)(e.target,a._20):e.target;var d,h={data:{},args:e,cancel:!1,content:""};if(e.target.classList.contains("e-header-cell-label"))t.timelineSettings.showTooltip?h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("timeline",d,t,e):e.cancel=!0;else if(t.tooltipSettings.showTooltip)if(r&&(h.data=t.ganttChartModule.getRecordByTaskBar(r),d=h.data),e.target.classList.contains("e-gantt-child-taskbar")||e.target.classList.contains("e-gantt-parent-taskbar")||e.target.classList.contains("e-gantt-milestone")||e.target.classList.contains("e-gantt-unscheduled-taskbar")||e.target.classList.contains("e-taskbar-left-resizer")||e.target.classList.contains("e-taskbar-right-resizer")||e.target.classList.contains("e-gantt-manualparenttaskbar")&&t.tooltipSettings.taskbar){var p=void 0;t.tooltipSettings.taskbar&&(p=t.tooltipModule.templateCompiler(t.tooltipSettings.taskbar,t,d,"TooltipTaskbarTemplate"));var u=document.createElement("div");p&&i.i(s.append)(p,u),h.content=this.toolTipObj.content=p?u:d?t.tooltipModule.getTooltipContent(d.ganttProperties.isMilestone?"milestone":"taskbar",d,t,e):""}else if(e.target.classList.contains("e-baseline-bar")||e.target.classList.contains("e-baseline-gantt-milestone")){var c=void 0;t.tooltipSettings.baseline&&(c=t.tooltipModule.templateCompiler(t.tooltipSettings.baseline,t,d,"TooltipBaselineTemplate"));var g=document.createElement("div");c&&i.i(s.append)(c,g),h.content=this.toolTipObj.content=c?g:d?t.tooltipModule.getTooltipContent(d.ganttProperties.isMilestone?"milestone":"baseline",d,t,e):""}else if(e.target.classList.contains("e-event-markers"))h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("marker",d,t,e);else if(e.target.classList.contains("e-connector-line-container")){var f=void 0;t.tooltipModule.predecessorTooltipData=t.tooltipModule.getPredecessorTooltipData(e),h.data=this.predecessorTooltipData,t.tooltipSettings.connectorLine&&(f=t.tooltipModule.templateCompiler(t.tooltipSettings.connectorLine,t,t.tooltipModule.predecessorTooltipData,"TooltipConnectorLineTemplate")),h.content=this.toolTipObj.content=f?f[0]:t.tooltipModule.getTooltipContent("connectorLine",d,t,e)}else if(e.target.classList.contains("e-indicator-span"))h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("indicator",d,t,e),i.i(s.isNullOrUndefined)(h.content)&&(e.cancel=!0);else if(e.target.classList.contains("e-notes-info")){var m=this.parent.ganttChartModule.getRecordByTarget(e.event);h.content=this.toolTipObj.content=m.ganttProperties.notes,i.i(s.isNullOrUndefined)(h.content)&&(e.cancel=!0)}else e.target.classList.contains("e-gantt-manualparenttaskbar")?(h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("manualtaskbar",d,t,e),i.i(s.isNullOrUndefined)(h.content)&&(e.cancel=!0)):e.target.classList.contains("e-gantt-manualparent-milestone")&&(h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("manualmilestone",d,t,e),i.i(s.isNullOrUndefined)(h.content)&&(e.cancel=!0));else e.cancel=!0;if(!1===e.cancel){var y=new o.Deferred;return t.trigger("beforeTooltipRender",h,function(t){y.resolve(t),t.cancel&&(e.cancel=!0)}),this.toolTipObj.content=h.content,this.parent.isAdaptive||"mouseover"!==e.event.type||(this.currentTarget=e.target,s.EventHandler.add(this.currentTarget,"mousemove",this.mouseMoveHandler.bind(this))),this.parent.renderTemplates(),y}},e.prototype.tooltipCloseHandler=function(e){this.tooltipMouseEvent=null,this.parent.isAdaptive||i.i(s.isNullOrUndefined)(this.currentTarget)||s.EventHandler.remove(this.currentTarget,"mousemove",this.mouseMoveHandler),this.currentTarget=null},e.prototype.mouseMoveHandler=function(e){this.tooltipMouseEvent=e},e.prototype.updateTooltipPosition=function(e){e.element.style.visibility="visible";var t=this.parent.element.closest('[style*="zoom"]');if(i.i(s.isNullOrUndefined)(t)){if(i.i(s.isNullOrUndefined)(this.tooltipMouseEvent)||e.target.classList.contains("e-notes-info"))return;var r=this.getPointorPosition(this.tooltipMouseEvent),n=this.parent.getOffsetRect(this.parent.chartPane),a=n.top+this.parent.chartPane.offsetHeight,o=n.left+this.parent.chartPane.offsetWidth,l=r.x,d=r.y;if(o<l+e.element.offsetWidth+10)for(;o<l+e.element.offsetWidth+10;)l=o-e.element.offsetWidth-10,e.element.style.left=l+"px";else l+=10,e.element.style.left=l+"px";window.innerHeight<e.element.offsetHeight+d&&(d=d-e.element.offsetHeight-10),a<d+e.element.offsetHeight+20?d=d-e.element.offsetHeight-10:d+=10,e.element.style.top=d+"px"}},e.prototype.getPointorPosition=function(e){var t,r;return i.i(s.isNullOrUndefined)(i.i(s.getValue)("pageX",e))&&i.i(s.isNullOrUndefined)(i.i(s.getValue)("pageY",e))?i.i(s.isNullOrUndefined)(i.i(s.getValue)("clientX",e))&&i.i(s.isNullOrUndefined)(i.i(s.getValue)("clientY",e))||(t=i.i(s.getValue)("clientX",e)+document.body.scrollLeft+document.documentElement.scrollLeft,r=i.i(s.getValue)("clientY",e)+document.body.scrollTop+document.documentElement.scrollTop):(t=i.i(s.getValue)("pageX",e),r=i.i(s.getValue)("pageY",e)),{x:t,y:r}},e.prototype.getTooltipContent=function(e,t,r,n){var a,o,l;if(t){o=t.ganttProperties;var d=o.taskName;this.parent.enableHtmlSanitizer&&"string"==typeof d&&(d=s.SanitizeHtmlHelper.sanitize(d)),l=i.i(s.isNullOrUndefined)(d)?"":'<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">'+(this.parent.disableHtmlEncode?d.replace(/</g,"<").replace(/>/g,">"):d)+"</td></tr>"}switch(e){case"milestone":var h=void 0;n.target.className.includes("e-baseline-gantt-milestone")&&!i.i(s.isNullOrUndefined)(o.baselineStartDate)?h=o.baselineStartDate:i.i(s.isNullOrUndefined)(o.startDate)||(h=o.startDate);var p=this.parent.getFormatedDate(h,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&"string"==typeof p&&(p=s.SanitizeHtmlHelper.sanitize(p));var u=i.i(s.isNullOrUndefined)(h)?"":'<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+p+"</td></tr>",c=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+u+"</tbody></table>"};a=i.i(s.initializeCSPTemplate)(c);break;case"taskbar":var g=!(t.hasChildRecords&&!o.isAutoSchedule),f=this.parent.getFormatedDate(g?o.startDate:o.autoStartDate,this.parent.getDateFormat()),m=this.parent.getFormatedDate(g?o.endDate:o.autoEndDate,this.parent.getDateFormat()),y=this.parent.getDurationString(g?o.duration:o.autoDuration,o.durationUnit),D=o.progress;this.parent.enableHtmlSanitizer&&(f="string"==typeof f?s.SanitizeHtmlHelper.sanitize(f):f,m="string"==typeof m?s.SanitizeHtmlHelper.sanitize(m):m,y="string"==typeof y?s.SanitizeHtmlHelper.sanitize(y):y,D="string"==typeof D?s.SanitizeHtmlHelper.sanitize(D):D);var v=o.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(g?"startDate":"subTasksStartDate")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value"> '+f+"</td></tr>":"",w=o.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(g?"endDate":"subTasksEndDate")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+m+"</td></tr>":"",k=i.i(s.isNullOrUndefined)(o.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value"> '+y+"</td></tr>",b=i.i(s.isNullOrUndefined)(o.progress)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+'</td><td style="padding: 2px;">:</td><td>'+D+"</td></tr>",T=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+v+w+k+b+"</tbody></table>"};a=i.i(s.initializeCSPTemplate)(T);break;case"baseline":var S=this.parent.getFormatedDate(o.baselineStartDate,this.parent.getDateFormat()),P=this.parent.getFormatedDate(o.baselineEndDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(S="string"==typeof S?s.SanitizeHtmlHelper.sanitize(S):S,P="string"==typeof P?s.SanitizeHtmlHelper.sanitize(P):P);var C=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+S+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+P+"</td></tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(C,this);break;case"marker":var M=r.tooltipModule.getMarkerTooltipData(n),R=this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(M.day),this.parent.getDateFormat()),x=M.label?M.label:"";this.parent.enableHtmlSanitizer&&(x="string"==typeof x?s.SanitizeHtmlHelper.sanitize(x):x,R="string"==typeof R?s.SanitizeHtmlHelper.sanitize(R):R);var O=function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr><td>'+R+"</td></tr><tr><td>"+(this.parent.disableHtmlEncode?x.replace(/</g,"<").replace(/>/g,">"):x)+"</td></tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(O,this);break;case"connectorLine":var I=r.tooltipModule.predecessorTooltipData.fromName,E=r.tooltipModule.predecessorTooltipData.fromId,N=r.tooltipModule.predecessorTooltipData.toName,F=r.tooltipModule.predecessorTooltipData.toId,U=r.tooltipModule.predecessorTooltipData.linkText,V=r.tooltipModule.predecessorTooltipData.offsetString;this.parent.enableHtmlSanitizer&&(I="string"==typeof I?s.SanitizeHtmlHelper.sanitize(I):I,E="string"==typeof E?s.SanitizeHtmlHelper.sanitize(E):E,N="string"==typeof N?s.SanitizeHtmlHelper.sanitize(N):N,F="string"==typeof F?s.SanitizeHtmlHelper.sanitize(F):F,U="string"==typeof U?s.SanitizeHtmlHelper.sanitize(U):U,V="string"==typeof V?s.SanitizeHtmlHelper.sanitize(V):V);var L=function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("from")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?I.replace(/</g,"<").replace(/>/g,">"):I)+" ("+(this.parent.disableHtmlEncode&&"string"==typeof E?E.replace(/</g,"<").replace(/>/g,">"):E)+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("to")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?N.replace(/</g,"<").replace(/>/g,">"):N)+" ("+F+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("taskLink")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+U+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("lag")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+V+"</td></tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(L,this);break;case"indicator":if(n.target.title.length){var B=n.target.title;this.parent.enableHtmlSanitizer&&"string"==typeof B&&(B=s.SanitizeHtmlHelper.sanitize(B));var A=function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr>'+B+"</tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(A)}break;case"timeline":var H=n.target.title;this.parent.enableHtmlSanitizer&&"string"==typeof H&&(H=s.SanitizeHtmlHelper.sanitize(H));var j=function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr>'+H+"</tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(j);break;case"manualtaskbar":var W=this.parent.getFormatedDate(o.autoStartDate,this.parent.getDateFormat()),_=this.parent.getFormatedDate(o.autoEndDate,this.parent.getDateFormat()),q=this.parent.getDurationString(o.duration,o.durationUnit),G=this.parent.getFormatedDate(o.startDate,this.parent.getDateFormat()),z=this.parent.getFormatedDate(o.endDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(W="string"==typeof W?s.SanitizeHtmlHelper.sanitize(W):W,_="string"==typeof _?s.SanitizeHtmlHelper.sanitize(_):_,q="string"==typeof q?s.SanitizeHtmlHelper.sanitize(q):q,G="string"==typeof G?s.SanitizeHtmlHelper.sanitize(G):G,z="string"==typeof z?s.SanitizeHtmlHelper.sanitize(z):z);var X=o.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+W+"</td></tr>":"",Y=o.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+_+"</td></tr>":"",Z=i.i(s.isNullOrUndefined)(o.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+q+"</td></tr>",Q=o.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+G+"</td></tr>":"",K=o.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+z+"</td></tr>":"",J=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+Q+X+K+Y+Z+"</tbody></table>"};a=i.i(s.initializeCSPTemplate)(J);break;case"manualmilestone":var $=this.parent.getFormatedDate(o.autoStartDate,this.parent.getDateFormat()),ee=this.parent.getFormatedDate(o.autoEndDate,this.parent.getDateFormat()),te=this.parent.getFormatedDate(o.startDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&($="string"==typeof $?s.SanitizeHtmlHelper.sanitize($):$,ee="string"==typeof ee?s.SanitizeHtmlHelper.sanitize(ee):ee,te="string"==typeof te?s.SanitizeHtmlHelper.sanitize(te):te);var ie=o.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+$+"</td></tr>":"",re=o.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+ee+"</td></tr>":"",ne='<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+te+"</tr>",ae=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+ne+ie+re+"</tbody></table>"};a=i.i(s.initializeCSPTemplate)(ae)}return a},e.prototype.getMarkerTooltipData=function(e){var t=e.target.id.match(/\d+/g);return this.parent.eventMarkers[Number(t)]},e.prototype.getPredecessorTooltipData=function(e){var t=e.target.id;this.parent.enableHtmlSanitizer&&"string"==typeof t&&(t=s.SanitizeHtmlHelper.sanitize(t));var i=t.match(/ConnectorLineparent(.*)child(.*)/);i.shift();var r,n;"ResourceView"===this.parent.viewType?(r=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i[0])],n=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i[1])]):(r=this.parent.flatData[this.parent.ids.indexOf(i[0])],n=this.parent.flatData[this.parent.ids.indexOf(i[1])]);var a=r.ganttProperties.predecessor.filter(function(e){return e.to===i[1]});return{fromId:"ResourceView"===this.parent.viewType?r.ganttProperties.taskId:r.ganttProperties.rowUniqueID,toId:"ResourceView"===this.parent.viewType?n.ganttProperties.taskId:n.ganttProperties.rowUniqueID,fromName:r.ganttProperties.taskName,toName:n.ganttProperties.taskName,linkType:a[0].type,linkText:this.parent.getPredecessorTextValue(a[0].type),offset:a[0].offset,offsetUnit:a[0].offsetUnit,offsetString:this.parent.getDurationString(a[0].offset,a[0].offsetUnit)}},e.prototype.templateCompiler=function(e,t,r,n){var a=t.chartRowsModule.templateCompiler(e),o=t.chartRowsModule.getTemplateID(n);return a(i.i(s.extend)({index:0},r),t,n,o,!0)},e.prototype.destroy=function(){this.toolTipObj.destroy()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.parent=e}return e.prototype.renderWrapper=function(){this.wrapper=i.i(r.createElement)("div",{className:"e-virtualtable",styles:"position: absolute; transform: translate(0px, 0px);"}),this.parent.ganttChartModule.scrollElement.appendChild(this.wrapper),this.virtualTrack=i.i(r.createElement)("div",{className:"e-virtualtrack",styles:"position: relative; pointer-events: none; width: 100%;"}),this.parent.ganttChartModule.scrollElement.appendChild(this.virtualTrack),this.wrapper.appendChild(this.parent.ganttChartModule.chartBodyContent)},e.prototype.appendChildElements=function(e){this.wrapper.appendChild(e)},e.prototype.adjustTable=function(){var e=this.parent.treeGrid.getContent().querySelector(".e-content").querySelector(".e-virtualtable");this.parent.ganttChartModule.virtualRender.wrapper.style.transform=e.style.transform},e}())},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(22);i.d(t,"Gantt",function(){return r.a}),i.d(t,"PdfHorizontalOverflowType",function(){return r.b}),i.d(t,"parentsUntil",function(){return r.c}),i.d(t,"isScheduledTask",function(){return r.d}),i.d(t,"isCountRequired",function(){return r.e}),i.d(t,"getSwapKey",function(){return r.f}),i.d(t,"isRemoteData",function(){return r.g}),i.d(t,"getTaskData",function(){return r.h}),i.d(t,"updateDates",function(){return r.i}),i.d(t,"formatString",function(){return r.j}),i.d(t,"getIndex",function(){return r.k}),i.d(t,"pixelToPoint",function(){return r.l}),i.d(t,"pointToPixel",function(){return r.m}),i.d(t,"getUid",function(){return r.n}),i.d(t,"load",function(){return r.o}),i.d(t,"rowDataBound",function(){return r.p}),i.d(t,"queryCellInfo",function(){return r.q}),i.d(t,"toolbarClick",function(){return r.r}),i.d(t,"keyPressed",function(){return r.s}),i.d(t,"Edit",function(){return r.t}),i.d(t,"Reorder",function(){return r.u}),i.d(t,"Resize",function(){return r.v}),i.d(t,"Filter",function(){return r.w}),i.d(t,"Sort",function(){return r.x}),i.d(t,"Dependency",function(){return r.y}),i.d(t,"Selection",function(){return r.z}),i.d(t,"Toolbar",function(){return r.A}),i.d(t,"DayMarkers",function(){return r.B}),i.d(t,"CriticalPath",function(){return r.C}),i.d(t,"ContextMenu",function(){return r.D}),i.d(t,"ExcelExport",function(){return r.E}),i.d(t,"ColumnMenu",function(){return r.F}),i.d(t,"RowDD",function(){return r.G}),i.d(t,"PdfExport",function(){return r.H}),i.d(t,"VirtualScroll",function(){return r.I}),i.d(t,"Column",function(){return r.J}),i.d(t,"DayWorkingTime",function(){return r.K}),i.d(t,"AddDialogFieldSettings",function(){return r.L}),i.d(t,"EditDialogFieldSettings",function(){return r.M}),i.d(t,"EditSettings",function(){return r.N}),i.d(t,"EventMarker",function(){return r.O}),i.d(t,"FilterSettings",function(){return r.P}),i.d(t,"SearchSettings",function(){return r.Q}),i.d(t,"Holiday",function(){return r.R}),i.d(t,"LabelSettings",function(){return r.S}),i.d(t,"SelectionSettings",function(){return r.T}),i.d(t,"SplitterSettings",function(){return r.U}),i.d(t,"TaskFields",function(){return r.V}),i.d(t,"TimelineTierSettings",function(){return r.W}),i.d(t,"TimelineSettings",function(){return r.X}),i.d(t,"TooltipSettings",function(){return r.Y}),i.d(t,"SortDescriptor",function(){return r.Z}),i.d(t,"SortSettings",function(){return r._0}),i.d(t,"ResourceFields",function(){return r._1}),i.d(t,"LoadingIndicator",function(){return r._2}),i.d(t,"TemporaryDictionary",function(){return r._3}),i.d(t,"PdfBorders",function(){return r._4}),i.d(t,"PdfPaddings",function(){return r._5}),i.d(t,"PdfTreeGridStyleBase",function(){return r._6}),i.d(t,"PdfTreeGridStyle",function(){return r._7}),i.d(t,"PdfGanttTheme",function(){return r._8}),i.d(t,"PdfTreeGridLayouter",function(){return r._9}),i.d(t,"PdfTreeGridLayoutResult",function(){return r._10}),i.d(t,"PdfTreeGridLayoutFormat",function(){return r._11}),i.d(t,"PdfTreeGridCell",function(){return r._12}),i.d(t,"PdfTreeGridCellCollection",function(){return r._13}),i.d(t,"PdfTreeGridRow",function(){return r._14}),i.d(t,"PdfTreeGridRowCollection",function(){return r._15}),i.d(t,"PdfTreeGridHeaderCollection",function(){return r._16}),i.d(t,"PdfTreeGridColumn",function(){return r._17}),i.d(t,"PdfTreeGridColumnCollection",function(){return r._18})},function(e,t){e.exports=h},function(e,t){e.exports=p},function(e,t){e.exports=u},function(e,t){e.exports=c}])});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionPdfExport"),require("SyncfusionData"),require("SyncfusionGrids"),require("SyncfusionTreegrid"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionNavigations"),require("SyncfusionCalendars"),require("SyncfusionDropdowns"),require("SyncfusionButtons"),require("SyncfusionLayouts"),require("SyncfusionRichtexteditor"),require("SyncfusionSvgBase")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionPdfExport","SyncfusionData","SyncfusionGrids","SyncfusionTreegrid","SyncfusionPopups","SyncfusionInputs","SyncfusionNavigations","SyncfusionCalendars","SyncfusionDropdowns","SyncfusionButtons","SyncfusionLayouts","SyncfusionRichtexteditor","SyncfusionSvgBase"],t):"object"==typeof exports?exports.SyncfusionGantt=t(require("SyncfusionBase"),require("SyncfusionPdfExport"),require("SyncfusionData"),require("SyncfusionGrids"),require("SyncfusionTreegrid"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionNavigations"),require("SyncfusionCalendars"),require("SyncfusionDropdowns"),require("SyncfusionButtons"),require("SyncfusionLayouts"),require("SyncfusionRichtexteditor"),require("SyncfusionSvgBase")):e.SyncfusionGantt=t(e.SyncfusionBase,e.SyncfusionPdfExport,e.SyncfusionData,e.SyncfusionGrids,e.SyncfusionTreegrid,e.SyncfusionPopups,e.SyncfusionInputs,e.SyncfusionNavigations,e.SyncfusionCalendars,e.SyncfusionDropdowns,e.SyncfusionButtons,e.SyncfusionLayouts,e.SyncfusionRichtexteditor,e.SyncfusionSvgBase)}(this,function(e,t,i,r,n,a,s,o,l,d,h,p,u,c){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=85)}([function(t,i){t.exports=e},function(e,t,i){"use strict";function r(e,t,i){for(var r=e;r&&(i?r.id!==t:!r.classList.contains(t));)r=r.parentElement;return r}function n(e){return i.i(f.isNullOrUndefined)(e.startDate)&&i.i(f.isNullOrUndefined)(e.endDate)&&i.i(f.isNullOrUndefined)(e.duration)?null:!(i.i(f.isNullOrUndefined)(e.startDate)||i.i(f.isNullOrUndefined)(e.endDate)||i.i(f.isNullOrUndefined)(e.duration))}function a(e){return!(!e.dataSource||e.dataSource instanceof m.DataManager||!("result"in e.dataSource))}function s(e){for(var t={},i=0,r=Object.keys(e);i<r.length;i++){var n=r[i];t[e[n]]=n}return t}function o(e){if(e instanceof m.DataManager){var t=e.adaptor;return t instanceof m.ODataAdaptor||t instanceof m.ODataV4Adaptor||t instanceof m.WebApiAdaptor||t instanceof m.WebMethodAdaptor||t instanceof m.CacheAdaptor||t instanceof m.RemoteSaveAdaptor||t instanceof m.UrlAdaptor}return!1}function l(e,t,r,n){if(r){for(var a=void 0,s=0;s<e.length;s++){var o=void 0;o=t?e[s].taskData:i.i(f.extend)({},e[s].taskData,{},!0),a=o}return a}for(var a=[],s=0;s<e.length;s++){var o=void 0;!i.i(f.isNullOrUndefined)(n)&&n.timezone&&d(e[s],n),o=t?e[s].taskData:i.i(f.extend)({},e[s].taskData,{},!0),a.push(o)}return a}function d(e,t){return e.taskData[t.taskFields.startDate]=t.dateValidationModule.remove(e.ganttProperties.startDate,t.timezone),null!=t.taskFields.endDate&&(e.taskData[t.taskFields.endDate]=t.dateValidationModule.remove(e.ganttProperties.endDate,t.timezone)),(t.taskFields.baselineEndDate||t.taskFields.baselineStartDate)&&(e.taskData[t.taskFields.baselineStartDate]=t.dateValidationModule.remove(e.ganttProperties.baselineStartDate,t.timezone),e.taskData[t.taskFields.baselineEndDate]=t.dateValidationModule.remove(e.ganttProperties.baselineEndDate,t.timezone)),null}function h(e,t){for(var i,r=0;r<t.length;r++)i=new RegExp("\\{"+r+"\\}","gm"),e=e.replace(i,t[r].toString());return e}function p(e,t,r,n){for(var a=-1,s=0;s<r.length;s++)if(i.i(f.getValue)(t,r[s])===i.i(f.getValue)(t,e)&&i.i(f.isNullOrUndefined)(n)||!i.i(f.isNullOrUndefined)(n)&&i.i(f.getValue)(t,r[s])===i.i(f.getValue)(t,e)&&i.i(f.getValue)(n,r[s])===i.i(f.getValue)(n,e)){a=s;break}return a}function u(e){return 76*e/92}function c(e){return 92*e/76}function g(){return y++}t.j=r,t.c=n,t.i=a,t.d=s,t.f=o,t.e=l,t.g=d,t.l=h,t.h=p,t.b=u,t.a=c,t.k=g;var f=i(0),m=(i.n(f),i(4)),y=(i.n(m),0)},function(e,i){e.exports=t},function(e,t,i){"use strict";i.d(t,"_11",function(){return r}),i.d(t,"_23",function(){return n}),i.d(t,"_22",function(){return a}),i.d(t,"_21",function(){return s}),i.d(t,"_61",function(){return o}),i.d(t,"_16",function(){return l}),i.d(t,"C",function(){return d}),i.d(t,"_63",function(){return h}),i.d(t,"_15",function(){return p}),i.d(t,"_64",function(){return u}),i.d(t,"_12",function(){return c}),i.d(t,"a",function(){return g}),i.d(t,"_25",function(){return f}),i.d(t,"_26",function(){return m}),i.d(t,"_14",function(){return y}),i.d(t,"_13",function(){return D}),i.d(t,"_56",function(){return v}),i.d(t,"_58",function(){return w}),i.d(t,"_60",function(){return k}),i.d(t,"_59",function(){return b}),i.d(t,"_57",function(){return T}),i.d(t,"_17",function(){return S}),i.d(t,"_50",function(){return P}),i.d(t,"_49",function(){return C}),i.d(t,"_43",function(){return M}),i.d(t,"_52",function(){return R}),i.d(t,"_51",function(){return x}),i.d(t,"_44",function(){return O}),i.d(t,"D",function(){return I}),i.d(t,"_46",function(){return E}),i.d(t,"_47",function(){return F}),i.d(t,"_32",function(){return N}),i.d(t,"N",function(){return U}),i.d(t,"_30",function(){return V}),i.d(t,"n",function(){return L}),i.d(t,"p",function(){return B}),i.d(t,"q",function(){return A}),i.d(t,"_41",function(){return H}),i.d(t,"_42",function(){return j}),i.d(t,"_20",function(){return W}),i.d(t,"Z",function(){return _}),i.d(t,"_54",function(){return q}),i.d(t,"_55",function(){return G}),i.d(t,"O",function(){return z}),i.d(t,"Q",function(){return X}),i.d(t,"S",function(){return Y}),i.d(t,"_37",function(){return Z}),i.d(t,"_38",function(){return Q}),i.d(t,"_39",function(){return K}),i.d(t,"_36",function(){return J}),i.d(t,"_40",function(){return $}),i.d(t,"_48",function(){return ee}),i.d(t,"_1",function(){return te}),i.d(t,"_0",function(){return ie}),i.d(t,"K",function(){return re}),i.d(t,"L",function(){return ne}),i.d(t,"M",function(){return ae}),i.d(t,"_29",function(){return se}),i.d(t,"_31",function(){return oe}),i.d(t,"J",function(){return le}),i.d(t,"_5",function(){return de}),i.d(t,"_45",function(){return he}),i.d(t,"_2",function(){return pe}),i.d(t,"_3",function(){return ue}),i.d(t,"_19",function(){return ce}),i.d(t,"o",function(){return ge}),i.d(t,"_28",function(){return fe}),i.d(t,"P",function(){return me}),i.d(t,"R",function(){return ye}),i.d(t,"T",function(){return De}),i.d(t,"_27",function(){return ve}),i.d(t,"t",function(){return we}),i.d(t,"u",function(){return ke}),i.d(t,"v",function(){return be}),i.d(t,"w",function(){return Te}),i.d(t,"x",function(){return Se}),i.d(t,"y",function(){return Pe}),i.d(t,"z",function(){return Ce}),i.d(t,"A",function(){return Me}),i.d(t,"B",function(){return Re}),i.d(t,"_33",function(){return xe}),i.d(t,"_34",function(){return Oe}),i.d(t,"_35",function(){return Ie}),i.d(t,"_24",function(){return Ee}),i.d(t,"V",function(){return Fe}),i.d(t,"_9",function(){return Ne}),i.d(t,"r",function(){return Ue}),i.d(t,"s",function(){return Ve}),i.d(t,"_10",function(){return Le}),i.d(t,"W",function(){return Be}),i.d(t,"X",function(){return Ae}),i.d(t,"Y",function(){return He}),i.d(t,"E",function(){return je}),i.d(t,"F",function(){return We}),i.d(t,"_6",function(){return _e}),i.d(t,"_4",function(){return qe}),i.d(t,"_53",function(){return Ge}),i.d(t,"_7",function(){return ze}),i.d(t,"_8",function(){return Xe}),i.d(t,"d",function(){return Ye}),i.d(t,"c",function(){return Ze}),i.d(t,"b",function(){return Qe}),i.d(t,"m",function(){return Ke}),i.d(t,"h",function(){return Je}),i.d(t,"i",function(){return $e}),i.d(t,"e",function(){return et}),i.d(t,"f",function(){return tt}),i.d(t,"g",function(){return it}),i.d(t,"j",function(){return rt}),i.d(t,"k",function(){return nt}),i.d(t,"l",function(){return at}),i.d(t,"U",function(){return st}),i.d(t,"G",function(){return ot}),i.d(t,"I",function(){return lt}),i.d(t,"H",function(){return dt}),i.d(t,"_18",function(){return ht}),i.d(t,"_62",function(){return pt});var r="e-gantt",n="e-gantt-chart-pane",a="e-gantt-tree-grid-pane",s="e-gantt-splitter",o="e-gantt-chart",l="e-chart-root-container",d="e-gantt-toolbar",h="e-chart-scroll-container",p="e-chart-rows-container",u="e-content",c="e-device",g="e-grid",f="e-task-table",m="e-zero-spacing",y="e-timeline-header-container",D="e-timeline-header-table-container",v="e-timeline-header-table-body",w="e-timeline-top-header-cell",k="e-header-cell-label",b="e-weekend-header-cell",T="e-timeline-single-header-cell",S="e-timeline-single-header-outer-div",P="e-left-label-container",C="e-left-label-container e-left-label-temp-container",M="e-left-label-inner-div",R="e-right-label-container",x="e-right-label-container e-right-label-temp-container",O="e-right-label-inner-div",I="e-taskbar-main-container",E="e-gantt-parent-taskbar-inner-div",F="e-gantt-parent-progressbar-inner-div",N="e-task-label",U="e-gantt-child-taskbar-inner-div",V="e-gantt-child-progressbar-inner-div",L="e-gantt-child-critical-taskbar-inner-div",B="e-gantt-child-critical-progressbar-inner-div",A="e-critical-milestone",H="e-baseline-bar",j="e-baseline-gantt-milestone-container",W="e-chart-row-cell",_="e-chart-row",q="e-row-expand",G="e-row-collapse",z="e-taskbar-left-resizer",X="e-taskbar-right-resizer",Y="e-child-progress-resizer",Z="e-progressbar-handler",Q="e-progressbar-handler-element",K="e-progressbar-handler-after",J="e-icon",$="e-gantt-milestone",ee="e-gantt-parent-milestone",te="e-gantt-child-taskbar",ie="e-gantt-child-progressbar",re="e-manualparent-main-container",ne="e-gantt-manualparenttaskbar",ae="e-gantt-manualparent-milestone",se="e-gantt-child-manualtaskbar",oe="e-gantt-child-manualprogressbar",le="e-gantt-manualparenttaskbar-right",de="e-gantt-manualparenttaskbar-left",he="e-gantt-unscheduled-manualtask",pe="e-gantt-parent-taskbar",ue="e-gantt-parent-progressbar",ce="e-gantt-unscheduled-task",ge="e-gantt-critical-unscheduled-taskbar",fe="e-indicator-span",me="e-left-resize-gripper",ye="e-right-resize-gripper",De="e-progress-resize-gripper",ve="e-label",we="e-event-markers-container",ke="e-event-markers",be="e-span-label",Te="e-nonworking-day-container",Se="e-holiday-container",Pe="e-holiday",Ce="e-span",Me="e-weekend-container",Re="e-weekend",xe="e-gantt-unscheduled-taskbar-left",Oe="e-gantt-unscheduled-taskbar-right",Ie="e-gantt-unscheduled-taskbar",Ee="e-gantt-dependency-view-container",Fe="e-connector-line-container",Ne="e-connector-line",Ue="e-critical-line",Ve="e-critical-line-arrow",Le="e-connector-line-arrow",Be="e-connector-line-z-index",Ae="e-connectorpoint-left",He="e-connectorpoint-right",je="e-connectorpoint-left-hover",We="e-connectorpoint-right-hover",_e="e-gantt-false-line",qe="e-right-connectorpoint-outer-div",Ge="e-left-connectorpoint-outer-div",ze="e-connectorpoint-allow-block",Xe="e-gantt-tooltip",Ye=".e-gridheader",Ze=".e-content",Qe=".e-gridform",Ke="e-delete",Je="e-save",$e="e-cancel",et="e-edit",tt="e-indent",it="e-outdent",rt="e-add",nt="e-add-above",at="e-add-below",st="e-active-parent-task",ot="e-active-child-task",lt="e-active-connected-task",dt="e-predecessor-touch-mode",ht="e-rangecontainer",pt="e-rg-rangdiv"},function(e,t){e.exports=i},function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t,i){"use strict";var r=i(51);i.d(t,"a",function(){return r.a});var n=i(52);i.d(t,"b",function(){return n.a}),i.d(t,"c",function(){return n.b});var a=i(54);i.d(t,"d",function(){return a.a}),i.d(t,"e",function(){return a.b});var s=i(17);i.d(t,"f",function(){return s.a});var o=i(55);i.d(t,"g",function(){return o.a}),i.d(t,"h",function(){return o.b}),i.d(t,"i",function(){return o.c});var l=i(53);i.d(t,"j",function(){return l.a}),i.d(t,"k",function(){return l.b}),i.d(t,"l",function(){return l.c}),i.d(t,"m",function(){return l.d}),i.d(t,"n",function(){return l.e}),i.d(t,"o",function(){return l.f}),i.d(t,"p",function(){return l.g})},function(e,t,i){"use strict";var r=i(19);i.d(t,"a",function(){return r.a});var n=i(61);i.d(t,"b",function(){return n.a});var a=i(60);i.d(t,"c",function(){return a.a});var s=i(62);i.d(t,"d",function(){return s.a});var o=i(63);i.d(t,"e",function(){return o.a});var l=i(64);i.d(t,"f",function(){return l.a});var d=i(65);i.d(t,"g",function(){return d.a});var h=i(70);i.d(t,"h",function(){return h.a});var p=i(66);i.d(t,"i",function(){return p.a});var u=i(67);i.d(t,"j",function(){return u.a});var c=i(71);i.d(t,"k",function(){return c.a});var g=i(73);i.d(t,"l",function(){return g.a});var f=i(74);i.d(t,"m",function(){return f.a});var m=i(75);i.d(t,"n",function(){return m.a}),i.d(t,"o",function(){return m.b});var y=i(76);i.d(t,"p",function(){return y.a});var D=i(72);i.d(t,"q",function(){return D.a}),i.d(t,"r",function(){return D.b});var v=i(69);i.d(t,"s",function(){return v.a});var w=i(68);i.d(t,"t",function(){return w.a})},function(e,t){e.exports=a},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.parent=e}return e.prototype.isValidateNonWorkDays=function(e){return!i.i(r.isNullOrUndefined)(e)&&e.isAutoSchedule&&(!this.parent.includeWeekend||this.parent.totalHolidayDates.length>0)||i.i(r.isNullOrUndefined)(e)&&(!this.parent.includeWeekend||this.parent.totalHolidayDates.length>0)},e.prototype.checkStartDate=function(e,t,n,a){if(i.i(r.isNullOrUndefined)(e))return null;var s=new Date(e.getTime()),o=this.getSecondsInDecimal(s);if(n=i.i(r.isNullOrUndefined)(n)?!i.i(r.isNullOrUndefined)(t)&&t.isMilestone:n,o<this.parent.defaultStartTime&&(!n||a))this.setTime(this.parent.defaultStartTime,s);else if(o<this.parent.defaultStartTime&&n)this.setTime(this.parent.defaultStartTime,s);else if(o===this.parent.defaultEndTime&&(!t||!n)||o>this.parent.defaultEndTime)s.setDate(s.getDate()+1),this.setTime(this.parent.defaultStartTime,s);else if(o>this.parent.defaultStartTime&&o<this.parent.defaultEndTime)for(var l=0;l<this.parent.workingTimeRanges.length;l++){var d=this.parent.workingTimeRanges[l];if(o>=d.to&&this.parent.workingTimeRanges[l+1]&&o<this.parent.workingTimeRanges[l+1].from){(o!==d.to||t&&n)&&o===d.to||this.setTime(this.parent.workingTimeRanges[l+1].from,s);break}}var h;if(this.parent.autoCalculateDateScheduling){do{h=new Date(s.getTime());var p=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(t)){var u=!n||a?this.parent.defaultStartTime:this.parent.defaultEndTime;if(!this.parent.includeWeekend){var c=new Date(s.getTime());s=this.getNextWorkingDay(s),c.getTime()!==s.getTime()&&this.setTime(u,s)}for(var g=0;g<p;g++){var f=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[g])),m=new Date(f.getTime());f.setHours(0,0,0,0),m.setHours(23,59,59,59),s.getTime()>=f.getTime()&&s.getTime()<m.getTime()&&(s.setDate(s.getDate()+1),this.setTime(u,s))}}}while(h.getTime()!==s.getTime());return new Date(s.getTime())}return new Date(s.getTime())},e.prototype.checkEndDate=function(e,t,n){if(i.i(r.isNullOrUndefined)(e))return null;var a=new Date(e.getTime()),s=this.getSecondsInDecimal(a);if(s>this.parent.defaultEndTime)this.setTime(this.parent.defaultEndTime,a);else if(s<=this.parent.defaultStartTime&&!n)a.setDate(a.getDate()-1),this.setTime(this.parent.defaultEndTime,a);else if(s>this.parent.defaultStartTime&&s<this.parent.defaultEndTime)for(var o=0;o<this.parent.workingTimeRanges.length;o++){var l=this.parent.workingTimeRanges[o];if(s>l.to&&this.parent.workingTimeRanges[o+1]&&s<=this.parent.workingTimeRanges[o+1].from){this.setTime(this.parent.workingTimeRanges[o].to,a);break}}var d;if(this.parent.autoCalculateDateScheduling){do{d=new Date(a.getTime());var h=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(t)){if(!this.parent.includeWeekend){var p=new Date(a.getTime());a=this.getPreviousWorkingDay(a),p.getTime()!==a.getTime()&&this.setTime(this.parent.defaultEndTime,a)}for(var u=0;u<h;u++){var c=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[u])),g=new Date(c.getTime()),f=new Date(a.getTime());f.setMinutes(a.getMilliseconds()-2),c.setHours(0,0,0,0),g.setHours(23,59,59,59),(a.getTime()>=c.getTime()&&a.getTime()<g.getTime()||f.getTime()>=c.getTime()&&f.getTime()<g.getTime())&&(a.setDate(a.getDate()-1),a.getTime()===c.getTime()&&86400===this.parent.defaultEndTime&&0===this.getSecondsInDecimal(a)||this.setTime(this.parent.defaultEndTime,a))}}}while(d.getTime()!==a.getTime());return new Date(a.getTime())}return i.i(r.isNullOrUndefined)(a)||this.setTime(this.parent.defaultEndTime,a),new Date(a.getTime())},e.prototype.checkBaselineStartDate=function(e){if(i.i(r.isNullOrUndefined)(e))return null;var t=new Date(e.getTime()),n=this.getSecondsInDecimal(t);if(n<this.parent.defaultStartTime)this.setTime(this.parent.defaultStartTime,t);else if(n>this.parent.defaultEndTime)t.setDate(t.getDate()+1),this.setTime(this.parent.defaultStartTime,t);else if(n>this.parent.defaultStartTime&&n<this.parent.defaultEndTime)for(var a=0;a<this.parent.workingTimeRanges.length;a++){var s=this.parent.workingTimeRanges[a];if(n>s.to&&this.parent.workingTimeRanges[a+1]&&n<this.parent.workingTimeRanges[a+1].from){this.setTime(this.parent.workingTimeRanges[a+1].from,t);break}}return t},e.prototype.checkBaselineEndDate=function(e,t){if(i.i(r.isNullOrUndefined)(e))return null;var n=new Date(e.getTime()),a=this.getSecondsInDecimal(n);if(a>this.parent.defaultEndTime)this.setTime(this.parent.defaultEndTime,n);else if(a<this.parent.defaultStartTime&&!i.i(r.isNullOrUndefined)(t)&&!t.isMilestone)n.setDate(n.getDate()-1),this.setTime(this.parent.defaultEndTime,n);else if(a>this.parent.defaultStartTime&&a<this.parent.defaultEndTime)for(var s=0;s<this.parent.workingTimeRanges.length;s++){var o=this.parent.workingTimeRanges[s];if(a>o.to&&this.parent.workingTimeRanges[s+1]&&a<=this.parent.workingTimeRanges[s+1].from){this.setTime(this.parent.workingTimeRanges[s].to,n);break}}return t&&t.baselineStartDate&&n&&t.baselineStartDate.getTime()>n.getTime()&&n.setDate(n.getDate()+1),n},e.prototype.calculateStartDate=function(e){var t=e.ganttProperties,n=null;i.i(r.isNullOrUndefined)(t.endDate)||i.i(r.isNullOrUndefined)(t.duration)||(n=this.getStartDate(t.endDate,t.duration,t.durationUnit,t)),this.parent.setRecordValue("startDate",n,t,!0),this.parent.taskFields.startDate&&this.parent.dataOperation.updateMappingData(e,"startDate")},e.prototype.calculateEndDate=function(e){var t=e.ganttProperties,n=null;if(i.i(r.isNullOrUndefined)(t.startDate))n=e[this.parent.taskFields.endDate],i.i(r.isNullOrUndefined)(n)||this.setTime(this.parent.defaultEndTime,n),this.parent.setRecordValue("endDate",n,t,!0);else{if(!i.i(r.isNullOrUndefined)(t.endDate)&&i.i(r.isNullOrUndefined)(t.duration)&&(1===this.compareDates(t.startDate,t.endDate)&&(this.parent.setRecordValue("startDate",new Date(t.endDate.getTime()),t,!0),this.setTime(this.parent.defaultStartTime,t.startDate)),this.calculateDuration(e)),!i.i(r.isNullOrUndefined)(t.duration)){var a=!i.i(r.isNullOrUndefined)(t.segments)&&t.segments.length>0?this.totalDuration(t.segments):t.duration;n=this.getEndDate(t.startDate,a,t.durationUnit,t,!1)}this.parent.setRecordValue("endDate",n,t,!0)}this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(e,"endDate")},e.prototype.totalDuration=function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].duration+e[i].offsetDuration;return t},e.prototype.calculateDuration=function(e){var t,n=e.ganttProperties;t=!i.i(r.isNullOrUndefined)(n.segments)&&n.segments.length>0&&!i.i(r.isNullOrUndefined)(this.parent.editModule.taskbarEditModule)?this.parent.editModule.taskbarEditModule.sumOfDuration(n.segments):i.i(r.isNullOrUndefined)(this.parent.taskFields.milestone)||i.i(r.isNullOrUndefined)(n.startDate)||i.i(r.isNullOrUndefined)(n.endDate)||n.startDate.getTime()!==n.endDate.getTime()||!1!==e.taskData[this.parent.taskFields.milestone]?this.getDuration(n.startDate,n.endDate,n.durationUnit,n.isAutoSchedule,n.isMilestone):1,this.parent.setRecordValue("duration",t,n,!0);var a=this.parent.columnByField[this.parent.columnMapping.duration];if(!(i.i(r.isNullOrUndefined)(this.parent.editModule)||i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isCellEdit||i.i(r.isNullOrUndefined)(a))){if(!i.i(r.isNullOrUndefined)(a.edit)&&!i.i(r.isNullOrUndefined)(a.edit.read)){var s=this.parent.editModule.dialogModule.dialog;if(!i.i(r.isNullOrUndefined)(s)){var o=s.querySelector("#"+this.parent.element.id+"Duration").ej2_instances[0];i.i(r.isNullOrUndefined)(o)||o.value===t.toString()||(o.value=t.toString(),o.dataBind())}}this.parent.taskFields.duration&&(this.parent.dataOperation.updateMappingData(e,"duration"),this.parent.taskFields.durationUnit&&this.parent.dataOperation.updateMappingData(e,"durationUnit"))}},e.prototype.getNonworkingTime=function(e,t,n,a){a=!!i.i(r.isNullOrUndefined)(a)||a;var s=!this.parent.includeWeekend&&this.parent.autoCalculateDateScheduling&&n?this.getWeekendCount(e,t):0,o=this.getNumberOfSeconds(e,t,a),l=n&&this.parent.autoCalculateDateScheduling?this.getHolidaysCount(e,t):0,d=(o-86400*s-86400*l)/86400,h=this.getNonWorkingSecondsOnDate(e,t,n);return d*(86400-this.parent.secondsPerDay)+86400*s+86400*l+h},e.prototype.getDuration=function(e,t,n,a,s,o){if(i.i(r.isNullOrUndefined)(e)||i.i(r.isNullOrUndefined)(t))return null;o=!!i.i(r.isNullOrUndefined)(o)||o;var l=0,d=this.getTimeDifference(e,t,o)/1e3,h=this.getNonworkingTime(e,t,a,o),p=d-h;return l=s&&this.parent.getFormatedDate(e)===this.parent.getFormatedDate(t)?0:n&&"day"!==n?"minute"===n?p/60:p/3600:p/this.parent.secondsPerDay,parseFloat(l.toString())},e.prototype.getDurationAsSeconds=function(e,t){return t&&"day"!==t.toLocaleLowerCase()?"hour"===t.toLocaleLowerCase()?3600*e:60*e:this.parent.secondsPerDay*e},e.prototype.getEndDate=function(e,t,i,r,n){for(var a=new Date(e.getTime()),s=new Date(e.getTime()),o=this.getDurationAsSeconds(t,i),l=0,d=0;o>0;)s.setSeconds(s.getSeconds()+o),l=this.getNonworkingTime(a,s,r.isAutoSchedule,!0),d=o-l,o-=d,o>0&&(s=this.checkStartDate(s,r,n)),a=new Date(s.getTime());return s},e.prototype.getStartDate=function(e,t,i,r,n){for(var a=new Date(e.getTime()),s=new Date(e.getTime()),o=this.getDurationAsSeconds(t,i),l=0,d=0;o>0;)s.setSeconds(s.getSeconds()-o),l=this.getNonworkingTime(s,a,r.isAutoSchedule,!0),d=o-l,o-=d,o>0&&(a=this.checkEndDate(s,r)),a=new Date(s.getTime());return n&&r.isMilestone&&(s.setDate(s.getDate()-1),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,s),s=this.parent.dateValidationModule.checkStartDate(s,r,!0)),s},e.prototype.getProjectStartDate=function(e,t){if(!i.i(r.isNullOrUndefined)(this.parent.cloneProjectStartDate)){"string"==typeof this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate));var n=this.checkStartDate(this.parent.cloneProjectStartDate);return this.parent.cloneProjectStartDate=n,new Date(n.getTime())}if(i.i(r.isNullOrUndefined)(this.parent.projectStartDate)){if(i.i(r.isNullOrUndefined)(t))return null;var a=this.parent.flatData,s=void 0;a.length>0?s=a[0].ganttProperties.startDate:(s=new Date,s.setHours(0,0,0,0));for(var o=1;o<a.length;o++){var l=a[o].ganttProperties.startDate;i.i(r.isNullOrUndefined)(l)||-1!==this.compareDates(l,s)||(s=l)}this.parent.cloneProjectStartDate=this.checkStartDate(s,e)}else{var n=this.getDateFromFormat(this.parent.projectStartDate);this.parent.cloneProjectStartDate=this.checkStartDate(n)}return new Date(this.parent.cloneProjectStartDate.getTime())},e.prototype.getValidStartDate=function(e,t){var n=null,a=t?e.autoStartDate:e.startDate,s=t?e.autoEndDate:e.endDate,o=!e.isAutoSchedule&&e.autoDuration?e.autoDuration:e.duration;return i.i(r.isNullOrUndefined)(a)?i.i(r.isNullOrUndefined)(s)?i.i(r.isNullOrUndefined)(o)||(n=this.getProjectStartDate(e)):(n=new Date(s.getTime()),this.setTime(this.parent.defaultStartTime,n)):n=new Date(a.getTime()),n},e.prototype.getValidEndDate=function(e,t){var n=null,a=t?e.autoStartDate:e.startDate,s=t?e.autoEndDate:e.endDate,o=t?e.autoDuration:e.duration;if(i.i(r.isNullOrUndefined)(s))if(i.i(r.isNullOrUndefined)(a)){if(!i.i(r.isNullOrUndefined)(o)){var l=this.getValidStartDate(e);l&&(n=this.getEndDate(l,o,e.durationUnit,e,!1))}}else e.isMilestone?n=this.checkStartDate(a):(n=new Date(a.getTime()),this.setTime(this.parent.defaultEndTime,n));else n=new Date(s.getTime());return n},e.prototype.getSecondsPerDay=function(){var e=this.parent.dayWorkingTime,t=e.length,n=0,a=new Date("10/11/2018");this.parent.nonWorkingHours=[];var s=this.parent.nonWorkingHours;this.parent.workingTimeRanges=[];var o=this.parent.workingTimeRanges;this.parent.nonWorkingTimeRanges=[];for(var l=this.parent.nonWorkingTimeRanges,d=0;d<t;d++){var h=e[d];if(!i.i(r.isNullOrUndefined)(h.from)&&!i.i(r.isNullOrUndefined)(h.to)){a.setHours(0,0,0,0);var p=new Date(a.getTime());a.setTime(a.getTime()+36e5*h.from);var u=new Date(a.getTime());p.setTime(p.getTime()+36e5*h.to);var c=new Date(p.getTime()),g=c.getTime()-u.getTime(),f=this.getSecondsInDecimal(u),m=this.getSecondsInDecimal(c);0===m&&(m=86400),n+=g/1e3,0===d&&(this.parent.defaultStartTime=f),d===t-1&&(this.parent.defaultEndTime=m),d>0?(s.push(s[s.length-1]+f-o[d-1].to),o[d-1].to<f&&l.push({from:o[d-1].to,to:f,isWorking:!1,interval:f-o[d-1].to})):(s.push(0),l.push({from:0,to:f,isWorking:!1,interval:f})),o.push({from:f,to:m}),l.push({from:f,to:m,isWorking:!0,interval:m-f})}}return this.parent.defaultEndTime/3600!=24&&l.push({from:this.parent.defaultEndTime,to:86400,isWorking:!1,interval:86400-this.parent.defaultEndTime}),n},e.prototype.getDurationValue=function(e,t){var n=null,a=null;if("string"==typeof e){var s=e.match(/(\d*\.*\d+|.+$)/g);if(s&&s.length<=2){a=parseFloat(s[0].toString().trim());var o=s[1]?s[1].toString().trim().toLowerCase():null;-1!==i.i(r.getValue)("minute",this.parent.durationUnitEditText).indexOf(o)?n="minute":-1!==i.i(r.getValue)("hour",this.parent.durationUnitEditText).indexOf(o)?n="hour":-1!==i.i(r.getValue)("day",this.parent.durationUnitEditText).indexOf(o)&&(n="day")}}else a=e,n=null;return{duration:a,durationUnit:n}},e.prototype.getNextWorkingDay=function(e){var t=e.getDay();return-1!==this.parent.nonWorkingDayIndex.indexOf(t)?(e.setDate(e.getDate()+1),e=this.getNextWorkingDay(e)):e},e.prototype.getWeekendCount=function(e,t){var i=0,r=new Date(e.getTime()),n=new Date(t.getTime());for(r.setHours(0,0,0,0),r.setDate(r.getDate()+1),n.setHours(0,0,0,0);r.getTime()<n.getTime();)-1!==this.parent.nonWorkingDayIndex.indexOf(r.getDay())&&(i+=1),r.setDate(r.getDate()+1);return i},e.prototype.getNumberOfSeconds=function(e,t,i){var r=new Date(e.getTime()),n=new Date(t.getTime()),a=0;return r.setDate(r.getDate()+1),r.setHours(0,0,0,0),n.setHours(0,0,0,0),r.getTime()<n.getTime()&&(a=this.getTimeDifference(r,n,i)/1e3),a%86400!=0&&(a=a-a%86400+86400),a},e.prototype.getHolidaysCount=function(e,t){var i=0,r=this.parent.totalHolidayDates,n=new Date(e.getTime()),a=new Date(t.getTime());if(n.setDate(n.getDate()+1),n.setHours(0,0,0,0),a.setHours(0,0,0,0),n.getTime()<a.getTime())for(var s=0;s<r.length;s++){var o=this.getDateFromFormat(new Date(r[s]));n.getTime()<=o.getTime()&&a.getTime()>o.getTime()&&(!this.parent.includeWeekend&&-1===this.parent.nonWorkingDayIndex.indexOf(o.getDay())||this.parent.includeWeekend)&&(i+=1)}return i},e.prototype.getHolidayDates=function(){for(var e=this.parent.holidays,t=[],n=0;n<e.length;n++){var a=this.getDateFromFormat(e[n].from),s=this.getDateFromFormat(e[n].to);if(!i.i(r.isNullOrUndefined)(a)||!i.i(r.isNullOrUndefined)(s))if(i.i(r.isNullOrUndefined)(a)||i.i(r.isNullOrUndefined)(s)){var o=a||s;o.setHours(0,0,0,0),-1===t.indexOf(o.getTime())&&t.push(o.getTime())}else for(;a<=s;)a.setHours(0,0,0,0),-1===t.indexOf(a.getTime())&&t.push(a.getTime()),a.setDate(a.getDate()+1)}return t},e.prototype.isOnHolidayOrWeekEnd=function(e,t){if(t=i.i(r.isNullOrUndefined)(t)?this.parent.includeWeekend:t,this.parent.autoCalculateDateScheduling||(t=!0),!t&&-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay()))return!0;for(var n=this.parent.totalHolidayDates,a=0;a<n.length;a++){var s=this.getDateFromFormat(new Date(n[a])),o=new Date(s.getTime());if(s.setHours(0,0,0,0),o.setHours(23,59,59,59),e.getTime()>=s.getTime()&&e.getTime()<o.getTime())return!0}return!1},e.prototype.getNonWorkingSecondsOnDate=function(e,t,i){for(var r=this.getSecondsInDecimal(e),n=this.getSecondsInDecimal(t),a=-1,s=-1,o=0,l=!(!i||!this.parent.autoCalculateDateScheduling)&&this.isOnHolidayOrWeekEnd(e,null),d=!(!i||!this.parent.autoCalculateDateScheduling)&&this.isOnHolidayOrWeekEnd(t,null),h=0;h<this.parent.nonWorkingTimeRanges.length;h++){var p=this.parent.nonWorkingTimeRanges[h];r>=p.from&&r<=p.to&&(a=h),n>=p.from&&n<=p.to&&(s=h)}if(e.getDate()!==t.getDate()||e.getMonth()!==t.getMonth()||e.getFullYear()!==t.getFullYear()){if(l)o+=86400-r;else for(var h=a;h<this.parent.nonWorkingTimeRanges.length;h++)this.parent.nonWorkingTimeRanges[h].isWorking||(o+=h===a?this.parent.nonWorkingTimeRanges[h].to-r:this.parent.nonWorkingTimeRanges[h].interval);if(d)o+=n;else for(var h=0;h<=s;h++)this.parent.nonWorkingTimeRanges[h].isWorking||(o+=h===s?n-this.parent.nonWorkingTimeRanges[h].from:this.parent.nonWorkingTimeRanges[h].interval)}else if(a!==s)if(d)o+=n-r;else for(var h=a;h<=s;h++)this.parent.nonWorkingTimeRanges[h].isWorking||(o+=h===a?this.parent.nonWorkingTimeRanges[h].to-r:h===s?n-this.parent.nonWorkingTimeRanges[h].from:this.parent.nonWorkingTimeRanges[h].interval);else if(d)o+=n-r;else{var u=this.parent.nonWorkingTimeRanges[a];u.isWorking||(o=n-r)}return o},e.prototype.getPreviousWorkingDay=function(e){var t=e.getDay(),i=0===t?6:t-1;return-1!==this.parent.nonWorkingDayIndex.indexOf(t)||-1!==this.parent.nonWorkingDayIndex.indexOf(i)&&86400===this.parent.defaultEndTime&&0===this.getSecondsInDecimal(e)?(e.setDate(e.getDate()-1),-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay())&&(e=this.getPreviousWorkingDay(e)),e):e},e.prototype.getNonWorkingDayIndex=function(){var e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],t=e.length;0===this.parent.workWeek.length&&(this.parent.workWeek=["Monday","Tuesday","Wednesday","Thursday","Friday"]);for(var i=this.parent.workWeek.slice(),r=i.length,n=0;n<r;n++)i[n]=i[n].toLowerCase();this.parent.nonWorkingDayIndex=[];for(var n=0;n<t;n++)-1===i.indexOf(e[n])&&this.parent.nonWorkingDayIndex.push(n)},e.prototype.setTime=function(e,t){var i=e/3600;i=parseInt(i,10);var r=(e-3600*i)/60;r=parseInt(r,10);var n=e-3600*i-60*r;t.setHours(i,r,n)},e.prototype.getTimeDifference=function(e,t,i){var r=new Date(e.getTime()),n=new Date(t.getTime());return i&&this.updateDateWithTimeZone(r,n),n.getTime()-r.getTime()},e.prototype.updateDateWithTimeZone=function(e,t){var i,r,n=e.getTimezoneOffset(),a=t.getTimezoneOffset();if(n!==a){var s=new Date((new Date).getFullYear(),0,1).getTimezoneOffset();if(s!==n?(r=e,i=n):s!==a&&(r=t,i=a),s<0){var o=s-i;r.setTime(r.getTime()+60*o*1e3)}else if(s>=0){var o=i-s;r.setTime(r.getTime()-60*o*1e3)}}},e.prototype.getSecondsInDecimal=function(e){return 60*e.getHours()*60+60*e.getMinutes()+e.getSeconds()+e.getMilliseconds()/1e3},e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var r=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(r.getTime())?0:(e.getTime()-r.getTime())/6e4+i}catch(e){return 0}},e.prototype.remove=function(e,t){return i.i(r.isNullOrUndefined)(e)||(e=this.reverse(e,t,e.getTimezoneOffset())),e},e.prototype.reverse=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var r=e.getTimezoneOffset();e=new Date(e.getTime()+6e4*(t-i));var n=e.getTimezoneOffset();return new Date(e.getTime()+6e4*(n-r))},e.prototype.convert=function(e,t){var i=e.getTimezoneOffset(),r=this.offset(e,t);e=new Date(e.getTime()+6e4*(i-r));var n=e.getTimezoneOffset();return new Date(e.getTime()+6e4*(n-i))},e.prototype.getDateFromFormat=function(e,t){var n;if(i.i(r.isNullOrUndefined)(e))return null;if(e instanceof Date)n=new Date(e.getTime());else{var a=this.parent.globalize.parseDate(e,{format:this.parent.getDateFormat(),type:"dateTime"});n=i.i(r.isNullOrUndefined)(a)&&!isNaN(new Date(e).getTime())?new Date(e):a}if(!i.i(r.isNullOrUndefined)(this.parent.timezone)&&t){return this.convert(n,this.parent.timezone)}return n},e.prototype.compareDates=function(e,t){return i.i(r.isNullOrUndefined)(e)||i.i(r.isNullOrUndefined)(t)?!i.i(r.isNullOrUndefined)(e)&&i.i(r.isNullOrUndefined)(t)?1:i.i(r.isNullOrUndefined)(e)&&!i.i(r.isNullOrUndefined)(t)?-1:null:e.getTime()>t.getTime()?1:e.getTime()<t.getTime()?-1:0},e.prototype.getDurationString=function(e,t){var n="";if(!i.i(r.isNullOrUndefined)(e)&&(n+=parseFloat(e.toFixed(2))+" ",!i.i(r.isNullOrUndefined)(t))){var a=1!==e;"day"===t?n+=a?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===t?n+=a?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===t&&(n+=a?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return n},e.prototype.getWorkString=function(e,t){var n="";if(!i.i(r.isNullOrUndefined)(e)&&(n+=parseFloat(e).toFixed(2)+" ",!i.i(r.isNullOrUndefined)(t))){var a=1!==e;"day"===t?n+=a?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===t?n+=a?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===t&&(n+=a?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return n},e.prototype.calculateProjectDatesForValidatedTasks=function(e){var t=this,n="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,a="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,s=null,o=null,l=i.i(r.getValue)("dataOperation.dataArray",this.parent);if(n&&a||!l||0!==l.length){if(l.length>0){var d=l.slice().sort(function(e,i){return new Date(e[t.parent.taskFields.startDate]).getTime()-new Date(i[t.parent.taskFields.startDate]).getTime()}),h=l.slice().sort(function(e,i){return new Date(i[t.parent.taskFields.endDate]).getTime()-new Date(e[t.parent.taskFields.endDate]).getTime()});s=d[0][this.parent.taskFields.startDate],o=h[h.length-1][this.parent.taskFields.endDate]}}else s=this.getDateFromFormat(new Date),o=this.getDateFromFormat(new Date(s.getTime()));this.parent.cloneProjectStartDate=n?new Date(n.getTime()):"string"==typeof s?new Date(s):s,this.parent.cloneProjectEndDate=a?new Date(a.getTime()):"string"==typeof o?new Date(o):o},e.prototype.calculateProjectDates=function(e){var t=this;if(this.parent.isLoad&&this.parent.enablePersistence&&this.parent.cloneProjectStartDate&&this.parent.cloneProjectEndDate)return this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate),void(this.parent.cloneProjectEndDate=this.getDateFromFormat(this.parent.cloneProjectEndDate));var n="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,a="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,s=this.parent.timelineModule.isZooming&&this.parent.cloneProjectStartDate?this.getDateFromFormat(this.parent.cloneProjectStartDate):this.getDateFromFormat(n),o=this.parent.timelineModule.isZooming&&this.parent.cloneProjectEndDate?this.getDateFromFormat(this.parent.cloneProjectEndDate):this.getDateFromFormat(a),l=null,d=null,h=this.parent.flatData,p=this.parent.currentViewData,u=[],c=function(e){i.i(r.isNullOrUndefined)(e)||u.push(e)},g=function(e){e.length>0&&(e.sort(function(e,t){return e.getTime()-t.getTime()}),l=new Date(e[0].getTime()),d=e.length>1?new Date(e[e.length-1].getTime()):null)};if((!s||!o)&&h.length>0||e||this.parent.timelineModule.isZoomToFit){var f=void 0;if(f=p.length>0&&this.parent.timelineModule.isZoomToFit&&this.parent.treeGrid.filterModule&&this.parent.treeGrid.filterModule.filteredResult.length>0?p:h,f.forEach(function(e){u=[];var n,a,s=e.ganttProperties;i.i(r.isNullOrUndefined)(s.startDate)&&i.i(r.isNullOrUndefined)(s.endDate)?(n=null,a=null):(n=t.getValidStartDate(s),a=t.getValidEndDate(s)),c(l),c(d),c(n),c(a),t.parent.renderBaseline&&!t.parent.timelineModule.isZoomToFit&&(c(s.baselineStartDate),c(s.baselineEndDate)),s.indicators&&s.indicators.length>0&&!t.parent.timelineModule.isZoomToFit&&s.indicators.forEach(function(e){c(t.getDateFromFormat(e.date))}),g(u)}),u=[],c(l),c(d),this.parent.eventMarkers.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.eventMarkers.forEach(function(e,i){c(t.getDateFromFormat(e.day))})}if(this.parent.totalHolidayDates.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.totalHolidayDates.forEach(function(e,t){c(new Date(e))})}g(u),l&&d||(l?l=i.i(r.isNullOrUndefined)(l)?this.getDateFromFormat(new Date):l:(l=i.i(r.isNullOrUndefined)(l)?this.getDateFromFormat(new Date):l,l.setHours(0,0,0,0)),d=this.getDateFromFormat(new Date(l.getTime())),d.setDate(d.getDate()+20))}else s&&o||0!==h.length||(l=this.getDateFromFormat(new Date),d=this.getDateFromFormat(new Date(l.getTime())));e?(i.i(r.setValue)("minStartDate",l,e),i.i(r.setValue)("maxEndDate",d,e)):(this.prevProjectStartDate=this.parent.cloneProjectStartDate,this.parent.cloneProjectStartDate=l?this.parent.timelineModule.isZoomToFit?l:i.i(r.isNullOrUndefined)(s)?l:new Date(s.getTime()):new Date(s.getTime()),this.parent.cloneProjectEndDate=d?this.parent.timelineModule.isZoomToFit?d:i.i(r.isNullOrUndefined)(o)?d:new Date(o.getTime()):new Date(o.getTime())),this.parent.isProjectDateUpdated=!0},e.prototype.splitTasksDuration=function(e){for(var t=0,i=0;i<e.length;i++){var r=e[i],n=r.startDate,a=r.endDate;"Hour"===this.parent.timelineModule.bottomTier?t+=Math.ceil(this.getTimeDifference(n,a)/36e5):"Minutes"===this.parent.timelineModule.bottomTier?t+=Math.ceil(this.getTimeDifference(n,a)/6e4):t+=Math.ceil(this.getTimeDifference(n,a)/864e5)}return t},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r;!function(e){e[e.NextPage=0]="NextPage",e[e.LastPage=1]="LastPage"}(r||(r={}))},function(e,t){e.exports=s},function(e,t){e.exports=o},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=i(0),a=(i.n(n),function(){function e(e){this.parentRecord=[],this.parentIds=[],this.parentPredecessors=[],this.validatedParentIds=[],this.parent=e,this.dateValidateModule=this.parent.dateValidationModule}return e.prototype.ensurePredecessorCollection=function(){for(var e=this.parent.predecessorsCollection,t=e.length-1,i=t;i>=0;i--){var r=e[i],n=r.ganttProperties;(!r.hasChildRecords&&!this.parent.allowParentDependency||this.parent.allowParentDependency)&&this.ensurePredecessorCollectionHelper(r,n)}},e.prototype.ensurePredecessorCollectionHelper=function(e,t){var r=t.predecessorsName;if(!r||"string"!=typeof r&&"number"!=typeof r){if(r&&"object"==typeof r&&r.length){for(var a=[],s=0;s<r.length;s++){var o=r[s],l={};l.from=i.i(n.getValue)("from",o),l.to=i.i(n.getValue)("to",o)?i.i(n.getValue)("to",o):t.rowUniqueID,l.type=i.i(n.getValue)("type",o)?i.i(n.getValue)("type",o):"FS";var d=i.i(n.getValue)("offset",o);if(i.i(n.isNullOrUndefined)(d))l.offset=0,l.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();else if("string"==typeof d){var h=this.getOffsetDurationUnit(i.i(n.getValue)("offset",o));l.offset=h.duration,l.offsetUnit=h.durationUnit}else l.offset=parseFloat(d.toString()),l.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();var p=this.checkIsParent(l.from.toString());p||a.push(l)}this.parent.setRecordValue("predecessor",a,t,!0)}}else this.parent.setRecordValue("predecessor",this.calculatePredecessor(r,e),t,!0);this.parent.setRecordValue("predecessorsName",this.getPredecessorStringValue(e),t,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,t.predecessorsName,e),this.parent.setRecordValue(this.parent.taskFields.dependency,t.predecessorsName,e)},e.prototype.updateUnscheduledDependency=function(e){for(var t=this.parent.taskFields,r=i.i(n.isNullOrUndefined)(e[t.dependency])?[]:e[t.dependency].toString().split(","),a=0;a<r.length;a++){var s=parseInt(r[a],10);if(!isNaN(s)){var o=this.parent.getRecordByID(s.toString()),l=i.i(n.isNullOrUndefined)(o)?null:i.i(n.extend)({},{},o.taskData,!0);!i.i(n.isNullOrUndefined)(l)&&i.i(n.isNullOrUndefined)(l[t.startDate])&&i.i(n.isNullOrUndefined)(l[t.duration])&&i.i(n.isNullOrUndefined)(l[t.endDate])&&(l[t.duration]=1,l[t.startDate]=this.parent.projectStartDate,this.parent.updateRecordByID(l))}}},e.prototype.checkIsParent=function(e){var t=!1;return this.parent.connectorLineModule.getRecordByID(e).hasChildRecords&&(t=!0),t},e.prototype.calculatePredecessor=function(e,t){var i,r,n,a=this,s=e.toString(),o=[],l=[];return s.split(",").forEach(function(e){var s,d=!1,h=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,p=e.split("-");if(6===p.length&&(p[4]=p[4]+"-"+p[5],p.pop()),5===p.length&&p[4].length>12&&(s=e.substring(0,36),h.test(s)&&(d=!0)),d){var u=void 0;u=p[4].split("+");var c=void 0;1===u.length?l[0]=e:(c=u[1].length,l[0]=e.slice(0,-(c+1)),l[1]=u[1]),r="+",p[4].indexOf("-")>=0&&(u=p[4].split("-"),1===u.length?l[0]=e:(c=u[1].length,l[0]=e.slice(0,-(c+1)),l[1]=u[1]),r="-")}else l=e.split("+"),r="+",e.indexOf("-")>=0&&(l=e.split("-"),r="-");i=[];var g="ResourceView"===a.parent.viewType?a.parent.getTaskIds():a.parent.ids;-1!==("ResourceView"===a.parent.viewType?g.indexOf("T"+l[0]):g.indexOf(l[0]))?i[0]=l[0]:-1===g.indexOf(l[0])?(i=l[0].split(" "),1===i.length&&(-1!=i[0].indexOf(" ")?i=l[0].match(/(\d+|[A-z]+)/g):(i[0]=l[0].slice(0,-2),i[1]=l[0].slice(-2)))):i[0]=l[0];var f="ResourceView"===a.parent.viewType?g.indexOf("T"+i[0]):g.indexOf(i[0]);if(i[0]&&-1!==f){if(i.length>1){var m=i[1].toUpperCase();n="FS"===m||"FF"===m||"SF"===m||"SS"===m?m:"FS"}else n="FS";var y=l.length>1?r+""+l[1]:"0",D=a.getOffsetDurationUnit(y),v={from:i[0],type:n,isDrawn:!1,to:"ResourceView"===a.parent.viewType?t.ganttProperties.taskId.toString():t.ganttProperties.rowUniqueID.toString(),offsetUnit:D.durationUnit,offset:D.duration},w=a.checkIsParent(i[0]);if(a.parent.allowParentDependency){var k=a.parent.connectorLineModule.getRecordByID(v.to),b=a.parent.connectorLineModule.getRecordByID(v.from);a.parent.connectorLineEditModule&&b&&k?a.parent.connectorLineEditModule.validateParentPredecessor(b,k)&&o.push(v):o.push(v),i.splice(0)}else w||o.push(v)}}),o},e.prototype.getPredecessorStringValue=function(e){var t,r,a=e.ganttProperties.predecessor,s=this.parent.durationUnitTexts,o="";if(r=[],a)for(var l=a.length,d=0;d<l;d++){var h=a[d],p="",u="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(h.from!==u.toString()){if(p=h.from+h.type,"string"==typeof e.ganttProperties.taskId?(r[0]=p.slice(0,-2),r[1]=p.slice(-2),t=r[0]+" "+r[1]):t=p,p=t,0!==h.offset){p+=h.offset>0?"+"+h.offset+" ":h.offset+" ";var c=1!==h.offset;"day"===h.offsetUnit?p+=c?i.i(n.getValue)("days",s):i.i(n.getValue)("day",s):"hour"===h.offsetUnit?p+=c?i.i(n.getValue)("hours",s):i.i(n.getValue)("hour",s):p+=c?i.i(n.getValue)("minutes",s):i.i(n.getValue)("minute",s)}o=o.length>0?o+","+p:p}}return o},e.prototype.getOffsetDurationUnit=function(e){var t=0,r=this.parent.durationUnit.toLocaleLowerCase(),a=this.parent.durationUnitEditText;if("string"==typeof e){for(var s=e.match(/[^0-9]+|[0-9]+/g),o=0;o<s.length;o++)s[o]=s[o].trim();"-"===s[0]&&s[1]?(s[1]=s[0]+s[1],s.shift()):"+"===s[0]&&s.shift(),"."!==s[1]||isNaN(parseInt(s[2],10))||(s[0]+=s[1]+s[2],s.splice(1,2)),s&&s.length<=2&&(t=parseFloat(s[0]),r=s[1]?s[1].toLowerCase().trim():"",r=-1!==i.i(n.getValue)("minute",a).indexOf(r)?"minute":-1!==i.i(n.getValue)("hour",a).indexOf(r)?"hour":-1!==i.i(n.getValue)("day",a).indexOf(r)?"day":this.parent.durationUnit.toLocaleLowerCase())}else t=e,r=this.parent.durationUnit.toLocaleLowerCase();return isNaN(t)&&(t=0,r=this.parent.durationUnit.toLocaleLowerCase()),{duration:t,durationUnit:r}},e.prototype.updatePredecessors=function(){for(var e,t=this.parent.predecessorsCollection,i=t.length,r=0;r<i;r++)e=t[r],(!e.hasChildRecords&&!this.parent.allowParentDependency||this.parent.allowParentDependency)&&(this.updatePredecessorHelper(e,t),!e.ganttProperties.isAutoSchedule&&this.parent.editSettings.allowEditing&&this.parent.connectorLineEditModule.calculateOffset(e))},e.prototype.updatePredecessorHelper=function(e,t){var r,a=e.ganttProperties.predecessor,s=a.length;t=i.i(n.isNullOrUndefined)(t)?[]:t;for(var o=0;o<s;o++){var l=a[o];r=this.parent.connectorLineModule.getRecordByID(l.from);var d="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(l.from!==d.toString()&&r){var h=void 0;r.ganttProperties.predecessor?(h=i.i(n.extend)([],r.ganttProperties.predecessor,[],!0),h.push(l),this.parent.setRecordValue("predecessor",h,r.ganttProperties,!0)):(h=[],h.push(l),this.parent.setRecordValue("predecessor",h,r.ganttProperties,!0),t.push(r))}}},e.prototype.updatedRecordsDateByPredecessor=function(){if(this.parent.autoCalculateDateScheduling)for(var e=this.parent.flatData,t=this.parent.flatData.length,i=0;i<t;i++)if(e[i].ganttProperties.predecessorsName){this.validatePredecessorDates(e[i]);var r=e[i].ganttProperties.predecessor;if(r&&r.length>1)for(var n=0;n<r.length;n++){var a=this.parent.getRecordByID(r[n].to);a&&this.validatePredecessorDates(a)}e[i].hasChildRecords&&this.parent.editModule&&!this.parent.allowUnscheduledTasks&&this.parent.allowParentDependency&&this.parent.editModule.updateChildItems(e[i])}},e.prototype.updateParentPredecessor=function(){if(this.parent.enablePredecessorValidation)for(var e=this.parentPredecessors.length,t=e-1;t>=0;t--){var i=this.parentPredecessors[t];this.validatePredecessorDates(i),i.ganttProperties.startDate&&this.parent.editModule.updateChildItems(i)}},e.prototype.validatePredecessorDates=function(e){if(e.ganttProperties.predecessor){var t=e.ganttProperties.predecessor,i=void 0,r=void 0,n=null,a="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),s=t.filter(function(e){return e.to===a?e:null});for(i=0;i<s.length;i++){var o=s[i];r=this.parent.connectorLineModule.getRecordByID(o.from),n=this.parent.connectorLineModule.getRecordByID(o.to),this.parent.allowParentDependency&&this.parent.isLoad&&-1==this.parentPredecessors.indexOf(e)&&(e.hasChildRecords||n.hasChildRecords)&&this.parentPredecessors.push(e),(n.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)&&this.validateChildGanttRecord(r,n)}}},e.prototype.validateChildGanttRecord=function(e,t){if(this.parent.editedTaskBarItem!==t&&!i.i(n.isNullOrUndefined)(i.i(r.c)(e.ganttProperties))&&!i.i(n.isNullOrUndefined)(i.i(r.c)(t.ganttProperties))&&this.parent.isInPredecessorValidation&&(t.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)){var a=t.ganttProperties,s="ResourceView"===this.parent.viewType?a.taskId.toString():a.rowUniqueID.toString(),o=a.predecessor,l=o.filter(function(e){return e.to===s?e:null}),d=this.getPredecessorDate(t,l);this.parent.setRecordValue("startDate",d,a,!0),this.parent.dataOperation.updateMappingData(t,"startDate");var h=t.ganttProperties.segments;i.i(n.isNullOrUndefined)(h)&&this.dateValidateModule.calculateEndDate(t),this.parent.dataOperation.updateWidthLeft(t),!this.parent.isLoad&&!this.parent.isFromOnPropertyChange&&t.parentItem&&this.parent.isInPredecessorValidation&&this.parent.getParentTask(t.parentItem).ganttProperties.isAutoSchedule&&-1===this.parentIds.indexOf(t.parentItem.uniqueID)&&(this.parentIds.push(t.parentItem.uniqueID),this.parentRecord.push(t.parentItem))}},e.prototype.getPredecessorDate=function(e,t){var i,r,n,a,s=this,o=t.filter(function(t){var i="ResourceView"===s.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;return t.to===i.toString()?t:null});if(o)for(var l=o.length,d=0;d<l;d++){var h=o[d];n=this.parent.connectorLineModule.getRecordByID(h.from),a=this.parent.connectorLineModule.getRecordByID(h.to),r=this.getValidatedStartDate(a.ganttProperties,n.ganttProperties,h),null!=i&&1!==this.dateValidateModule.compareDates(r,i)||(i=r)}return i},e.prototype.getValidatedStartDate=function(e,t,i){var r,n,a=i.type,s=i.offset;switch(a){case"FS":r=this.dateValidateModule.getValidEndDate(t),e.isMilestone&&0===s||(r=this.dateValidateModule.checkStartDate(r,e)),0!==s&&(r=this.updateDateByOffset(r,i,e)),n=e.isMilestone?r:this.dateValidateModule.checkStartDate(r,e);break;case"FF":case"SF":r="FF"===a?this.dateValidateModule.getValidEndDate(t):this.dateValidateModule.getValidStartDate(t),0!==s&&(r=this.updateDateByOffset(r,i,e)),e.isMilestone||(r=this.dateValidateModule.checkEndDate(r,e)),n=this.dateValidateModule.getStartDate(r,e.duration,e.durationUnit,e);break;case"SS":r=this.dateValidateModule.getValidStartDate(t),0!==s&&(r=this.updateDateByOffset(r,i,e)),n=e.isMilestone?r:this.dateValidateModule.checkStartDate(r,e)}return n},e.prototype.updateDateByOffset=function(e,t,i){var r,n=t.offset,a=t.offsetUnit;return n<0?r=this.dateValidateModule.getStartDate(this.dateValidateModule.checkEndDate(e,i),-1*n,a,i,!0):(r=this.dateValidateModule.getEndDate(e,n,a,i,!1),i.isMilestone||(r=this.dateValidateModule.checkStartDate(r,i))),r},e.prototype.createConnectorLinesCollection=function(e){var t=e||this.parent.currentViewData;this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport&&(t=this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneCurrentViewData);var i,r,n,a=t.length;for(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport?this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData):this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.getExpandedRecords(this.parent.updatedRecords),i=0;i<a;i++){if(this.parent.editModule&&this.parent.editModule.deletedTaskDetails.length>0){if(t[i].parentItem){var s=this.parent.getRecordByID(t[i].parentItem.taskId.toString());this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(s),t[i])}t[i].index=i}r=t[i],n=r.ganttProperties.predecessor,n&&this.addPredecessorsCollection(n)}},e.prototype.addPredecessorsCollection=function(e){var t,i,r,n,a;if(e)for(t=e.length,i=0;i<t;i++){r=e[i];n=this.parent.connectorLineModule.getRecordByID(r.from),a=this.parent.connectorLineModule.getRecordByID(r.to),this.parent.connectorLineModule.expandedRecords&&-1!==this.parent.connectorLineModule.expandedRecords.indexOf(n)&&-1!==this.parent.connectorLineModule.expandedRecords.indexOf(a)&&this.updateConnectorLineObject(n,a,r)}},e.prototype.updateConnectorLineObject=function(e,t,i){var r=this.parent.connectorLineModule.createConnectorLineObject(e,t,i);if(r){if(t.isCritical&&e.isCritical&&(r.isCritical=!0),this.parent.connectorLineIds.length>0&&-1===this.parent.connectorLineIds.indexOf(r.connectorLineId)||0===this.parent.connectorLineIds.length)this.parent.updatedConnectorLineCollection.push(r),this.parent.connectorLineIds.push(r.connectorLineId);else if(-1!==this.parent.connectorLineIds.indexOf(r.connectorLineId)){var n=this.parent.connectorLineIds.indexOf(r.connectorLineId);this.parent.updatedConnectorLineCollection[n]=r}i.isDrawn=!0}return r},e.prototype.validatePredecessor=function(e,t,i){if(this.parent.isInPredecessorValidation&&e.ganttProperties.predecessor){var r=this.parent.editModule.taskbarEditModule,n=void 0;r&&(n=r.taskBarEditRecord);for(var a=e.ganttProperties.predecessor,s=void 0,o=null,l=void 0,d=void 0,h="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),p=a.filter(function(e){return e.to===h?e:null}),u=a.filter(function(e){return e.from===h?e:null}),c=0;c<p.length;c++){l=p[c],s=this.parent.connectorLineModule.getRecordByID(l.from),o=this.parent.connectorLineModule.getRecordByID(l.to),this.parent.isInPredecessorValidation&&o.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1;var g="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;g.toString()!==l.to&&g.toString()!==l.from||i&&"predecessor"!==i||this.validateChildGanttRecord(s,o)}for(var c=0;c<u.length;c++)d=u[c],s=this.parent.connectorLineModule.getRecordByID(d.from),o=this.parent.connectorLineModule.getRecordByID(d.to),this.parent.isInPredecessorValidation&&o.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1,"predecessor"!==i&&this.parent.isValidationEnabled?this.validateChildGanttRecord(s,o):!o.ganttProperties.isAutoSchedule&&this.parent.UpdateOffsetOnTaskbarEdit&&this.parent.connectorLineEditModule.calculateOffset(o),!1!==s.expanded&&o.expanded,o&&this.validatePredecessor(o,void 0,"successor");o&&!o.hasChildRecords&&o.parentItem&&-1==this.validatedParentIds.indexOf(o.parentItem.taskId)&&this.validatedParentIds.push(o.parentItem.taskId);var f=!0;o&&o.hasChildRecords&&-1!==this.validatedParentIds.indexOf(o.ganttProperties.taskId.toString())&&(f=!1),f&&(o&&o.ganttProperties.taskId!==this.isValidatedParentTaskID&&n?("ParentDrag"!==r.taskBarEditAction&&"ChildDrag"!==r.taskBarEditAction?!n.hasChildRecords&&o.hasChildRecords&&(this.parent.editModule.updateChildItems(o),this.isValidatedParentTaskID=o.ganttProperties.taskId):(!o.hasChildRecords&&"ChildDrag"==r.taskBarEditAction||o.hasChildRecords&&"ParentDrag"==r.taskBarEditAction)&&(this.parent.editModule.updateChildItems(o),this.isValidatedParentTaskID=o.ganttProperties.taskId),n.hasChildRecords||this.parent.dataOperation.updateParentItems(o,!0)):o&&o.hasChildRecords&&!n&&this.parent.editModule.updateChildItems(o))}},e.prototype.getValidPredecessor=function(e){var t=this,r=[];if(!i.i(n.isNullOrUndefined)(e)){var a=e.ganttProperties.predecessor;a&&a.length>0&&(r=a.filter(function(i){var r="ResourceView"===t.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;return i.from!==r.toString()}))}return r},e}())},function(e,t,i){"use strict";var r=i(46);i.d(t,"a",function(){return r.a});var n=i(11);i.d(t,"b",function(){return n.a});var a=i(1);i.d(t,"c",function(){return a.j}),i.d(t,"d",function(){return a.c}),i.d(t,"e",function(){return a.i}),i.d(t,"f",function(){return a.d}),i.d(t,"g",function(){return a.f}),i.d(t,"h",function(){return a.e}),i.d(t,"i",function(){return a.g}),i.d(t,"j",function(){return a.l}),i.d(t,"k",function(){return a.h}),i.d(t,"l",function(){return a.b}),i.d(t,"m",function(){return a.a}),i.d(t,"n",function(){return a.k});var s=i(16);i.d(t,"o",function(){return s.b}),i.d(t,"p",function(){return s.c}),i.d(t,"q",function(){return s.d}),i.d(t,"r",function(){return s.a}),i.d(t,"s",function(){return s.e})},function(e,t,i){"use strict";i.d(t,"b",function(){return r}),i.d(t,"c",function(){return n}),i.d(t,"d",function(){return a}),i.d(t,"a",function(){return s}),i.d(t,"e",function(){return o});var r="load",n="rowDataBound",a="queryCellInfo",s="toolbarClick",o="key-pressed"},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(2),n=(i.n(r),function(){function e(e){this.theme=e,this.ganttStyle={},this.setTheme(this.ganttStyle,this.theme)}return Object.defineProperty(e.prototype,"style",{get:function(){return this.ganttStyle?this.ganttStyle:(this.setTheme(this.ganttStyle,"Material"),this.ganttStyle)},enumerable:!0,configurable:!0}),e.prototype.setTheme=function(e,t){switch(this.initStyles(e),e.columnHeader.fontSize=9.5,e.columnHeader.fontColor=new r.PdfColor(0,0,0),e.columnHeader.fontColor.gray=.2,e.columnHeader.backgroundColor=new r.PdfColor(255,255,255),e.columnHeader.borderColor=new r.PdfColor(234,234,234),e.columnHeader.format.lineAlignment=1,e.columnHeader.format.alignment=0,e.fontFamily=r.PdfFontFamily.Helvetica,e.cell.fontSize=9.5,e.cell.backgroundColor=new r.PdfColor(255,255,255),e.cell.borderColor=new r.PdfColor(234,234,234),e.cell.fontColor=new r.PdfColor(0,0,0),e.cell.fontColor.gray=.2,e.cell.format.lineAlignment=1,e.cell.format.alignment=0,e.footer.fontSize=9.5,e.footer.fontStyle=0,e.footer.format.alignment=1,e.footer.format.lineAlignment=1,e.timeline.fontSize=9.5,e.timeline.fontStyle=0,e.timeline.backgroundColor=new r.PdfColor(252,252,252),e.timeline.fontColor=new r.PdfColor(40,40,39),e.chartGridLineColor=new r.PdfColor(206,206,206),e.timeline.borderColor=new r.PdfColor(206,206,206),t){case"Bootstrap":e.taskbar.taskColor=new r.PdfColor(49,122,185),e.taskbar.progressColor=new r.PdfColor(33,82,125),e.taskbar.criticalTaskColor=new r.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new r.PdfColor(255,85,85),e.taskbar.baselineColor=new r.PdfColor(240,173,78),e.taskbar.baselineBorderColor=new r.PdfColor(240,173,78),e.criticalConnectorLineColor=new r.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new r.PdfColor(255,85,85),e.taskbar.parentTaskColor=new r.PdfColor(119,119,119),e.taskbar.parentProgressColor=new r.PdfColor(85,85,85),e.taskbar.taskBorderColor=new r.PdfColor(33,82,125),e.taskbar.parentTaskBorderColor=new r.PdfColor(85,85,85),e.taskbar.milestoneColor=new r.PdfColor(85,85,85),e.footer.fontColor=new r.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new r.PdfColor(33,82,125),e.footer.backgroundColor=new r.PdfColor(255,255,255),e.taskbar.progressFontColor=new r.PdfColor(255,255,255),e.label.fontColor=new r.PdfColor(0,0,0);break;case"Bootstrap 4":e.taskbar.taskColor=new r.PdfColor(0,123,255),e.taskbar.progressColor=new r.PdfColor(0,86,179),e.taskbar.criticalTaskColor=new r.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new r.PdfColor(255,85,85),e.taskbar.baselineColor=new r.PdfColor(255,193,7),e.taskbar.baselineBorderColor=new r.PdfColor(255,193,7),e.criticalConnectorLineColor=new r.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new r.PdfColor(255,85,85),e.taskbar.parentTaskColor=new r.PdfColor(108,117,125),e.taskbar.parentProgressColor=new r.PdfColor(73,80,87),e.taskbar.taskBorderColor=new r.PdfColor(0,86,179),e.taskbar.parentTaskBorderColor=new r.PdfColor(73,80,87),e.taskbar.milestoneColor=new r.PdfColor(73,80,87),e.footer.fontColor=new r.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new r.PdfColor(0,86,179),e.footer.backgroundColor=new r.PdfColor(255,255,255),e.taskbar.progressFontColor=new r.PdfColor(255,255,255),e.label.fontColor=new r.PdfColor(33,37,41);break;case"Fabric":e.columnHeader.fontColor=new r.PdfColor(102,102,102),e.cell.fontColor=new r.PdfColor(51,51,51),e.taskbar.taskColor=new r.PdfColor(0,120,214),e.taskbar.progressColor=new r.PdfColor(0,91,163),e.taskbar.criticalTaskColor=new r.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new r.PdfColor(255,85,85),e.taskbar.baselineColor=new r.PdfColor(216,59,1),e.taskbar.baselineBorderColor=new r.PdfColor(216,59,1),e.criticalConnectorLineColor=new r.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new r.PdfColor(255,85,85),e.taskbar.parentTaskColor=new r.PdfColor(118,118,118),e.taskbar.parentProgressColor=new r.PdfColor(80,80,80),e.taskbar.taskBorderColor=new r.PdfColor(0,91,163),e.taskbar.parentTaskBorderColor=new r.PdfColor(80,80,80),e.taskbar.milestoneColor=new r.PdfColor(80,80,80),e.footer.fontColor=new r.PdfColor(51,51,51),e.footer.fontColor.gray=.2,e.connectorLineColor=new r.PdfColor(0,69,122),e.footer.backgroundColor=new r.PdfColor(255,255,255),e.taskbar.progressFontColor=new r.PdfColor(255,255,255),e.label.fontColor=new r.PdfColor(51,51,51);break;default:e.taskbar.taskColor=new r.PdfColor(88,105,197),e.taskbar.progressColor=new r.PdfColor(63,81,181),e.taskbar.criticalTaskColor=new r.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new r.PdfColor(255,85,85),e.taskbar.baselineColor=new r.PdfColor(193,87,0),e.taskbar.baselineBorderColor=new r.PdfColor(193,87,0),e.criticalConnectorLineColor=new r.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new r.PdfColor(255,85,85),e.taskbar.parentTaskColor=new r.PdfColor(132,132,132),e.taskbar.parentProgressColor=new r.PdfColor(97,97,97),e.taskbar.taskBorderColor=new r.PdfColor(63,81,181),e.taskbar.parentTaskBorderColor=new r.PdfColor(51,51,51),e.taskbar.milestoneColor=new r.PdfColor(97,97,97),e.footer.fontColor=new r.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new r.PdfColor(63,81,181),e.footer.backgroundColor=new r.PdfColor(255,255,255),e.taskbar.progressFontColor=new r.PdfColor(255,255,255),e.label.fontColor=new r.PdfColor(51,51,51)}},e.prototype.initStyles=function(e){e.columnHeader={},e.columnHeader.format=new r.PdfStringFormat,e.cell={},e.cell.format=new r.PdfStringFormat,e.timeline={},e.footer={},e.footer.format=new r.PdfStringFormat,e.label={},e.taskbar={}},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(7),n=i(2),a=(i.n(n),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),s=function(e){function t(){var t=e.call(this)||this;return t.treeGridSize=new n.SizeF(0,0),t.treeColumnIndex=0,t.allowRowBreakAcrossPages=!0,t.enableHeader=!0,t.isFitToWidth=!1,t.columns=new r.p(t),t.rows=new r.m(t),t.headers=new r.n(t),t.style=new r.e,t.rowHeight=0,t}return a(t,e),Object.defineProperty(t.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return 0===this.treeGridSize.width&&0===this.treeGridSize.height&&(this.treeGridSize=this.calculateTreeGridSize()),this.treeGridSize},set:function(e){this.treeGridSize=e},enumerable:!0,configurable:!0}),t.prototype.draw=function(e,t,i,r){if(t instanceof n.PointF&&void 0===t.width&&void 0===i)return this.drawHelper(e,t.x,t.y);if("number"==typeof t&&"number"==typeof i&&void 0===r)return this.drawHelper(e,t,i,null);if(t instanceof n.RectangleF&&void 0!==t.width&&void 0===i)return this.drawHelper(e,t,null);if(t instanceof n.PointF&&void 0===t.width&&i instanceof n.PdfLayoutFormat)return this.drawHelper(e,t.x,t.y,i);if("number"==typeof t&&"number"==typeof i&&(r instanceof n.PdfLayoutFormat||null==r)){var a=e.graphics.clientSize.width-t,s=new n.RectangleF(t,i,a,0);return this.drawHelper(e,s,r)}return t instanceof n.RectangleF&&void 0!==t.width&&"boolean"==typeof i?this.drawHelper(e,t,null):this.drawHelper(e,t,i)},t.prototype.measureColumnsWidth=function(e){if(void 0!==e)for(var t=this.columns.getDefaultWidths(e.width-e.x),i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i]);else{for(var t=[],r=0,n=0,a=0,s=this.columns.count,i=0;i<s;i++){for(var o=this.rows.count,l=0;l<o;l++){var d=this.rows.getRow(l).cells.getCell(i).width,h=this.initialWidth>0?Math.min(this.initialWidth,d):d;r=Math.max(r,h),r=Math.max(this.columns.getColumn(i).width,r),this.columns.getColumn(i).isTreeColumn&&(a=Math.max(a,this.rows.getRow(l).level))}this.columns.getColumn(i).isTreeColumn?t.push(r+10*a):t.push(r),n+=r,r=0}for(var i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i])}},t.prototype.calculateTreeGridSize=function(){for(var e=0,t=this.columns.width,i=0;i<this.headers.count;i++){var r=this.headers.getHeader(i);e+=r.height}for(var i=0;i<this.rows.count;i++){var r=this.rows.getRow(i);e+=r.height}return new n.SizeF(t,e)},t.prototype.drawGrid=function(e,t,i,r){this.initialWidth=e.graphics.clientSize.width;var a=new n.RectangleF(0,0,e.getClientSize().height,0);return this.draw(e,a,r)},t.prototype.layout=function(e){if(0!==this.rows.count){var t=this.rows.getRow(0).cells.getCell(0).style;if(1!==t.borders.left.width){var i=t.borders.left.width/2,a=t.borders.top.width/2;if(e.bounds.x===r.b.default.right.width/2&&e.bounds.y===r.b.default.right.width/2){var s=new n.RectangleF(new n.PointF(i,a),new n.SizeF(this.size.width,this.size.height));e.bounds=s}}}return this.setSpan(),this.layouter=new r.g(this),this.layouter.layoutInternal(e)},t.prototype.onBeginCellDraw=function(e){this.raiseBeginCellDraw&&this.beginCellDraw(this,e)},t.prototype.onEndCellDraw=function(e){this.raiseEndCellDraw&&this.endCellDraw(this,e)},t.prototype.setSpan=function(){for(var e=1,t=1,i=0,r=0,n=0,a=this.headers.count,s=0;s<a;s++){var o=this.headers.getHeader(s);n=0;for(var l=o.cells.count,d=0;d<l;d++){var h=o.cells.getCell(d);if(n=Math.max(n,h.rowSpan),!h.isCellMergeContinue&&!h.isRowMergeContinue&&(h.columnSpan>1||h.rowSpan>1)){if(h.columnSpan+d>o.cells.count)throw new Error("Invalid span specified at row "+d.toString()+" column "+s.toString());if(h.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+d.toString()+" column "+s.toString());if(h.columnSpan>1&&h.rowSpan>1){for(e=h.columnSpan,t=h.rowSpan,i=d,r=s,h.isCellMergeStart=!0,h.isRowMergeStart=!0;e>1;)i++,o.cells.getCell(i).isCellMergeContinue=!0,o.cells.getCell(i).isRowMergeContinue=!0,o.cells.getCell(i).rowSpan=t,e--;for(i=d,e=h.columnSpan;t>1;){for(r++,this.headers.getHeader(r).cells.getCell(d).isRowMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,t--;e>1;)i++,this.headers.getHeader(r).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,e--;e=h.columnSpan,i=d}}else if(h.columnSpan>1&&1===h.rowSpan){e=h.columnSpan,i=d,h.isCellMergeStart=!0;for(var p=this.columns.columns[i].width;e>1;)i++,o.cells.getCell(i).isCellMergeContinue=!0,e--,p+=this.columns.columns[i].width;h.width=p}else if(1===h.columnSpan&&h.rowSpan>1)for(t=h.rowSpan,r=s;t>1;)r++,this.headers.getHeader(r).cells.getCell(d).isRowMergeContinue=!0,t--}}o.maximumRowSpan=n}e=t=1,i=r=0,a=this.rows.count;for(var s=0;s<a;s++)for(var o=this.rows.getRow(s),u=o.cells.count,d=0;d<u;d++){var h=o.cells.getCell(d);if(!h.isCellMergeContinue&&!h.isRowMergeContinue&&(h.columnSpan>1||h.rowSpan>1)){if(h.columnSpan+d>o.cells.count)throw new Error("Invalid span specified at row {0} column {1} "+d.toString());if(h.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row {0} column {1} "+d.toString());if(h.columnSpan>1&&h.rowSpan>1){for(e=h.columnSpan,t=h.rowSpan,i=d,r=s,h.isCellMergeStart=!0,h.isRowMergeStart=!0;e>1;)i++,o.cells.getCell(i).isCellMergeContinue=!0,e--;for(i=d,e=h.columnSpan;t>1;){for(r++,this.rows.getRow(r).cells.getCell(d).isRowMergeContinue=!0,t--;e>1;)i++,this.rows.getRow(r).cells.getCell(i).isCellMergeContinue=!0,e--;e=h.columnSpan,i=d}}else if(h.columnSpan>1&&1===h.rowSpan)for(e=h.columnSpan,i=d,h.isCellMergeStart=!0;e>1;)i++,o.cells.getCell(i).isCellMergeContinue=!0,e--;else if(1===h.columnSpan&&h.rowSpan>1)for(t=h.rowSpan,r=s;t>1;)r++,this.rows.getRow(r).cells.getCell(d).isRowMergeContinue=!0,t--}}},t}(n.PdfLayoutElement)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.allowEditing=!0,this.allowReordering=!0,this.allowResizing=!0,this.allowSorting=!0,this.allowFiltering=!0,this.edit={},i.i(r.merge)(this,e)}return e}())},function(e,t){e.exports=l},function(e,t){e.exports=d},function(e,t,i){"use strict";var r=i(15);i.d(t,"a",function(){return r.a}),i.d(t,"b",function(){return r.b}),i.d(t,"c",function(){return r.c}),i.d(t,"d",function(){return r.d}),i.d(t,"e",function(){return r.e}),i.d(t,"f",function(){return r.f}),i.d(t,"g",function(){return r.g}),i.d(t,"h",function(){return r.h}),i.d(t,"i",function(){return r.i}),i.d(t,"j",function(){return r.j}),i.d(t,"k",function(){return r.k}),i.d(t,"l",function(){return r.l}),i.d(t,"m",function(){return r.m}),i.d(t,"n",function(){return r.n}),i.d(t,"o",function(){return r.o}),i.d(t,"p",function(){return r.p}),i.d(t,"q",function(){return r.q}),i.d(t,"r",function(){return r.r}),i.d(t,"s",function(){return r.s});var n=i(23);i.d(t,"t",function(){return n.a}),i.d(t,"u",function(){return n.b}),i.d(t,"v",function(){return n.c}),i.d(t,"w",function(){return n.d}),i.d(t,"x",function(){return n.e}),i.d(t,"y",function(){return n.f}),i.d(t,"z",function(){return n.g}),i.d(t,"A",function(){return n.h}),i.d(t,"B",function(){return n.i}),i.d(t,"C",function(){return n.j}),i.d(t,"D",function(){return n.k}),i.d(t,"E",function(){return n.l}),i.d(t,"F",function(){return n.m}),i.d(t,"G",function(){return n.n}),i.d(t,"H",function(){return n.o}),i.d(t,"I",function(){return n.p});var a=i(8);i.d(t,"J",function(){return a.a}),i.d(t,"K",function(){return a.b}),i.d(t,"L",function(){return a.c}),i.d(t,"M",function(){return a.d}),i.d(t,"N",function(){return a.e}),i.d(t,"O",function(){return a.f}),i.d(t,"P",function(){return a.g}),i.d(t,"Q",function(){return a.h}),i.d(t,"R",function(){return a.i}),i.d(t,"S",function(){return a.j}),i.d(t,"T",function(){return a.k}),i.d(t,"U",function(){return a.l}),i.d(t,"V",function(){return a.m}),i.d(t,"W",function(){return a.n}),i.d(t,"X",function(){return a.o}),i.d(t,"Y",function(){return a.p}),i.d(t,"Z",function(){return a.q}),i.d(t,"_0",function(){return a.r}),i.d(t,"_1",function(){return a.s}),i.d(t,"_2",function(){return a.t});var s=i(7);i.d(t,"_3",function(){return s.a}),i.d(t,"_4",function(){return s.b}),i.d(t,"_5",function(){return s.c}),i.d(t,"_6",function(){return s.d}),i.d(t,"_7",function(){return s.e}),i.d(t,"_8",function(){return s.f}),i.d(t,"_9",function(){return s.g}),i.d(t,"_10",function(){return s.h}),i.d(t,"_11",function(){return s.i}),i.d(t,"_12",function(){return s.j}),i.d(t,"_13",function(){return s.k}),i.d(t,"_14",function(){return s.l}),i.d(t,"_15",function(){return s.m}),i.d(t,"_16",function(){return s.n}),i.d(t,"_17",function(){return s.o}),i.d(t,"_18",function(){return s.p})},function(e,t,i){"use strict";var r=i(34);i.d(t,"a",function(){return r.a});var n=i(27);i.d(t,"b",function(){return n.a});var a=i(28);i.d(t,"c",function(){return a.a});var s=i(36);i.d(t,"d",function(){return s.a});var o=i(41);i.d(t,"e",function(){return o.a});var l=i(14);i.d(t,"f",function(){return l.a});var d=i(40);i.d(t,"g",function(){return d.a});var h=i(43);i.d(t,"h",function(){return h.a});var p=i(32);i.d(t,"i",function(){return p.a});var u=i(31);i.d(t,"j",function(){return u.a});var c=i(30);i.d(t,"k",function(){return c.a});var g=i(35);i.d(t,"l",function(){return g.a});var f=i(26);i.d(t,"m",function(){return f.a});var m=i(39);i.d(t,"n",function(){return m.a});var y=i(38);i.d(t,"o",function(){return y.a});var D=i(44);i.d(t,"p",function(){return D.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),i(6)),a=(i.n(n),i(4)),s=(i.n(a),function(){function e(e){this.isCellEdit=!1,this.isResourceCellEdited=!1,this.parent=e,this.bindTreeGridProperties()}return e.prototype.bindTreeGridProperties=function(){this.parent.treeGrid.editSettings.allowEditing=this.parent.editSettings.allowEditing,this.parent.treeGrid.editSettings.allowNextRowEdit=this.parent.editSettings.allowNextRowEdit,this.parent.treeGrid.editSettings.mode="Cell",this.parent.treeGrid.cellEdit=this.ensureEditCell.bind(this),this.parent.editSettings.allowEditing&&n.TreeGrid.Inject(n.Edit)},e.prototype.ensureEditCell=function(e){var t=this,n=e.rowData,s=e.columnName;this.editedColumn=this.parent.getColumnByField(s,this.parent.ganttColumns);var o=this.parent.taskFields;if(this.parent.readOnly)return void(e.cancel=!0);if("Dialog"===this.parent.editSettings.mode)return void(e.cancel=!0);if(!n.hasChildRecords||this.parent.allowParentDependency||(s!==o.endDate||(i.i(r.isNullOrUndefined)(n.isManual)||!1!==n.isManual)&&"Auto"!==this.parent.taskMode)&&s!==o.duration&&s!==o.dependency&&s!==o.progress&&s!==o.work&&"taskType"!==s){var l=new a.Deferred;return this.parent.trigger("cellEdit",e,function(e){0===n.level&&"ResourceView"===t.parent.viewType&&(e.cancel=!0),l.resolve(e),e.cancel||(e.columnName===t.parent.taskFields.notes?t.openNotesEditor(e):(t.isCellEdit=!0,i.i(r.isNullOrUndefined)(t.parent.toolbarModule)||t.parent.toolbarModule.refreshToolbarItems()))}),l}(s===o.dependency&&!this.parent.allowParentDependency||s!==o.dependency)&&(e.cancel=!0)},e.prototype.openNotesEditor=function(e){var t=this.parent.taskFields,i=e.rowData,r=e.columnName;if(r===t.notes&&!this.parent.showInlineNotes){e.cancel=!0;var n=this.parent.editModule.dialogModule.updatedEditFields.map(function(e){return e.type}),a=n.indexOf("Notes");if(-1!==a){this.parent.editModule.dialogModule.openEditDialog(i.ganttProperties.rowUniqueID);document.getElementById(this.parent.element.id+"_Tab").ej2_instances[0].selectedItem=a}}r===t.notes&&!0===this.parent.showInlineNotes&&(this.isCellEdit=!0)},e.prototype.isValueChange=function(e,t){var n=i.i(r.getValue)("data",e),a=n[""+t],s=i.i(r.getValue)("previousData",e);if(i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(s)||!i.i(r.isNullOrUndefined)(a)&&i.i(r.isNullOrUndefined)(s))return!0;if(!i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(s)){if(a instanceof Date)return a.getTime()!==n.taskData[t].getTime();if(t===this.parent.taskFields.resourceInfo)return a!==s;if(a!==n.taskData[t])return!0}return!1},e.prototype.initiateCellEdit=function(e,t){var n=i.i(r.getValue)("column",e),a=i.i(r.getValue)("data",e),s={};s.action="CellEditing",s.data=this.parent.getTaskByUniqueID(a.uniqueID);var o=i.i(r.getValue)("previousData",e),l=this.parent.allowUnscheduledTasks?a[n.field]:!i.i(r.isNullOrUndefined)(a[n.field])&&""!==a[n.field]||this.parent.taskFields.duration!==n.field&&this.parent.taskFields.startDate!==n.field&&this.parent.taskFields.endDate!==n.field?a[n.field]:o;i.i(r.isNullOrUndefined)(a)?this.parent.editModule.endEditAction(e):(a[n.field]=o,s.data[n.field]=o,this.parent.initiateEditAction(!0),this.parent.setRecordValue(n.field,l,s.data),n.field===this.parent.taskFields.name?this.taskNameEdited(s):n.field===this.parent.taskFields.startDate?this.startDateEdited(s):n.field===this.parent.taskFields.endDate?this.endDateEdited(s):n.field===this.parent.taskFields.duration?this.durationEdited(s):n.field===this.parent.taskFields.resourceInfo?this.resourceEdited(s,t,a):n.field===this.parent.taskFields.progress?this.progressEdited(s):n.field===this.parent.taskFields.baselineStartDate||n.field===this.parent.taskFields.baselineEndDate?this.baselineEdited(s):n.field===this.parent.taskFields.dependency?this.dependencyEdited(s,o):n.field===this.parent.taskFields.notes?this.notedEdited(s):n.field===this.parent.taskFields.work?this.workEdited(s):"taskType"!==n.field||i.i(r.isNullOrUndefined)(this.parent.taskFields.work)?n.field===this.parent.taskFields.manual?this.taskmodeEdited(s):(this.parent.setRecordValue("taskData."+n.field,s.data[n.field],s.data),this.parent.editModule.initiateSaveAction(s)):this.typeEdited(s,t)),this.isCellEdit=!1,i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule.editedColumn)||(this.parent.editModule.cellEditModule.editedColumn=null),i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.taskNameEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.name,e.data[this.parent.taskFields.name],e.data),this.parent.setRecordValue("taskName",e.data[this.parent.taskFields.name],e.data.ganttProperties,!0),this.updateEditedRecord(e)},e.prototype.notedEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.notes,e.data[this.parent.taskFields.notes],e.data),this.parent.setRecordValue("notes",e.data[this.parent.taskFields.notes],e.data.ganttProperties,!0),this.updateEditedRecord(e)},e.prototype.taskmodeEdited=function(e){this.parent.setRecordValue("isAutoSchedule",!e.data[this.parent.taskFields.manual],e.data.ganttProperties,!0),this.parent.editModule.updateTaskScheduleModes(e.data),this.updateEditedRecord(e)},e.prototype.startDateEdited=function(e){var t=e.data,n=e.data.ganttProperties,a=e.data[this.parent.taskFields.startDate];a=a?new Date(a.getTime()):null,a=this.parent.dateValidationModule.checkStartDate(a,t.ganttProperties,t.ganttProperties.isMilestone),i.i(r.isNullOrUndefined)(a)?t.hasChildRecords||(this.parent.setRecordValue("startDate",null,n,!0),this.parent.setRecordValue("duration",null,n,!0),this.parent.setRecordValue("isMilestone",!1,n,!0),this.parent.allowUnscheduledTasks&&i.i(r.isNullOrUndefined)(this.parent.taskFields.endDate)&&this.parent.setRecordValue("endDate",null,n,!0)):n.endDate||!i.i(r.isNullOrUndefined)(n.duration)?(this.parent.setRecordValue("startDate",new Date(a.getTime()),n,!0),this.parent.dateValidationModule.calculateEndDate(t)):i.i(r.isNullOrUndefined)(n.endDate)&&i.i(r.isNullOrUndefined)(n.duration)&&this.parent.setRecordValue("startDate",new Date(a.getTime()),n,!0),this.parent.setRecordValue("isMilestone",0===n.duration,n,!0),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(t,"startDate"),this.parent.dataOperation.updateMappingData(t,"endDate"),this.parent.dataOperation.updateMappingData(t,"duration"),this.updateEditedRecord(e)},e.prototype.validateEndDateWithSegments=function(e){for(var t=[],n=e.segments,a=0;a<n.length;a++){var s=n[parseInt(a.toString(),10)],o=s.endDate;o=!i.i(r.isNullOrUndefined)(e.endDate)&&o.getTime()<e.endDate.getTime()&&a!==n.length-1?o:e.endDate,s.duration=this.parent.dataOperation.getDuration(s.startDate,o,e.durationUnit,e.isAutoSchedule,e.isMilestone),n.length>0&&o.getTime()<s.startDate.getTime()&&o.getTime()<=e.endDate.getTime()?n[a-1].duration=this.parent.dataOperation.getDuration(n[a-1].startDate,e.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone):t.push(s)}return t},e.prototype.endDateEdited=function(e){var t=e.data.ganttProperties,n=e.data[this.parent.taskFields.endDate];n=n?new Date(n.getTime()):null,i.i(r.isNullOrUndefined)(n)?(this.parent.setRecordValue("endDate",n,t,!0),this.parent.setRecordValue("duration",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0)):(0===n.getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,n),n=this.parent.dateValidationModule.checkEndDate(n,t),this.parent.setRecordValue("endDate",n,t,!0),!i.i(r.isNullOrUndefined)(t.startDate)&&i.i(r.isNullOrUndefined)(t.duration)?-1===this.parent.dateValidationModule.compareDates(t.endDate,t.startDate)&&(this.parent.setRecordValue("endDate",new Date(t.startDate.getTime()),t,!0),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,t.endDate)):!i.i(r.isNullOrUndefined)(t.duration)&&i.i(r.isNullOrUndefined)(t.startDate)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(t.endDate,t.duration,t.durationUnit,t),t,!0),i.i(r.isNullOrUndefined)(t.segments)||(t.segments=this.validateEndDateWithSegments(t)),-1===this.compareDatesFromRecord(t)?this.parent.dateValidationModule.calculateDuration(e.data):this.parent.editModule.revertCellEdit(e),this.parent.setRecordValue("isMilestone",0===t.duration,t,!0),t.isMilestone&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(t.startDate,t),t,!0)),!i.i(r.isNullOrUndefined)(e.data.ganttProperties.segments)&&e.data.ganttProperties.segments.length>0&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),e.data.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"startDate"),this.parent.dataOperation.updateMappingData(e.data,"endDate"),this.parent.dataOperation.updateMappingData(e.data,"duration"),this.parent.editModule.updateResourceRelatedFields(e.data,"endDate"),this.updateEditedRecord(e)},e.prototype.durationEdited=function(e){parseInt(e.data[this.parent.taskFields.duration])<0&&(e.data[this.parent.taskFields.duration]=0);var t=e.data.ganttProperties,i=e.data[this.parent.taskFields.duration];this.parent.dataOperation.updateDurationValue(i,t),this.updateDates(e),this.parent.editModule.updateResourceRelatedFields(e.data,"duration"),this.updateEditedRecord(e)},e.prototype.updateDates=function(e){var t=e.data.ganttProperties,n=this.parent.dateValidationModule.getDateFromFormat(t.endDate),a=this.parent.dateValidationModule.getDateFromFormat(t.startDate),s=t.duration;i.i(r.isNullOrUndefined)(s)?(this.parent.setRecordValue("isMilestone",!1,t,!0),null!=e.data[this.parent.taskFields.duration]&&this.parent.setRecordValue("endDate",null,t,!0)):(i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(n)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(n,s,t.durationUnit,t),t,!0),0!==s&&t.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,t,!0),this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(t.startDate,t),t,!0)),!i.i(r.isNullOrUndefined)(t.segments)&&t.segments.length>0&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),t,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),this.parent.setRecordValue("isMilestone",0===t.duration,t,!0),this.parent.dateValidationModule.calculateEndDate(e.data)),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"endDate"),this.parent.dataOperation.updateMappingData(e.data,"startDate"),this.parent.dataOperation.updateMappingData(e.data,"duration")},e.prototype.progressEdited=function(e){var t=e.data;if(this.parent.setRecordValue("progress",t[this.parent.taskFields.progress]>100?100:t[this.parent.taskFields.progress],t.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.progress,t[this.parent.taskFields.progress]>100?100:t[this.parent.taskFields.progress],e.data),t.ganttProperties.isAutoSchedule||this.parent.setRecordValue("autoWidth",this.parent.dataOperation.calculateWidth(t,!1),t.ganttProperties,!0),!i.i(r.isNullOrUndefined)(e.data.ganttProperties.segments)&&e.data.ganttProperties.segments.length>0&&!i.i(r.isNullOrUndefined)(this.parent.editModule.taskbarEditModule)&&this.parent.editModule.taskbarEditModule.updateSegmentProgress(e.data.ganttProperties),!e.data.hasChildRecords){var n=t.ganttProperties.isAutoSchedule?t.ganttProperties.width:t.ganttProperties.autoWidth;this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(n,t.ganttProperties.progress),t.ganttProperties,!0)}this.updateEditedRecord(e)},e.prototype.baselineEdited=function(e){var t=e.data.ganttProperties,i=e.data[this.parent.taskFields.baselineStartDate],r=e.data[this.parent.taskFields.baselineEndDate];r&&0===r.getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,r),this.parent.setRecordValue("baselineStartDate",this.parent.dateValidationModule.checkBaselineStartDate(i),t,!0),this.parent.setRecordValue("baselineEndDate",this.parent.dateValidationModule.checkBaselineEndDate(r),t,!0),t.baselineStartDate&&t.baselineEndDate&&(this.parent.setRecordValue("baselineLeft",this.parent.dataOperation.calculateBaselineLeft(t),t,!0),this.parent.setRecordValue("baselineWidth",this.parent.dataOperation.calculateBaselineWidth(t),t,!0)),this.updateEditedRecord(e)},e.prototype.resourceEdited=function(e,t,n){var a=this.parent.resourceFields,s=t[this.parent.taskFields.resourceInfo];if(s){this.isResourceCellEdited=!0;for(var o=this.parent.dataOperation.setResourceInfo(t),l=o.length,d=n.ganttProperties.resourceInfo,h=void 0,p=[],u=this.parent.resources,c=void 0,g=0;g<l;g++)!function(e){if(d){var t=d.length;for(c=0;c<t;c++){if(d[c][a.id]===s[e]){h=c;break}h=-1}}if(i.i(r.isNullOrUndefined)(h)||-1===h){var n=u.filter(function(t){return s[e]===t[a.id]}),o=i.i(r.extend)({},n[0]);o[a.unit]=100,p.push(o)}else p.push(d[parseInt(h.toString(),10)])}(g);e.data.ganttProperties.resourceInfo=p,this.parent.dataOperation.updateMappingData(e.data,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(e.data,"resource"),"ResourceView"===this.parent.viewType&&(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=d),this.updateDates(e),this.updateEditedRecord(e)}},e.prototype.dependencyEdited=function(e,t){this.parent.predecessorModule.updateUnscheduledDependency(e.data),this.parent.connectorLineEditModule.updatePredecessor(e.data,e.data[this.parent.taskFields.dependency],e)||this.parent.editModule.revertCellEdit(t)},e.prototype.workEdited=function(e){var t=e.data.ganttProperties,i=e.data[this.parent.taskFields.work];this.parent.setRecordValue("work",i,t,!0),this.parent.editModule.updateResourceRelatedFields(e.data,"work"),this.updateDates(e),this.updateEditedRecord(e)},e.prototype.typeEdited=function(e,t){var i=e.data.ganttProperties,r=t.taskType;this.parent.setRecordValue("taskType",r,i,!0),this.updateEditedRecord(e)},e.prototype.compareDatesFromRecord=function(e){var t=this.parent.dateValidationModule.getValidStartDate(e),i=this.parent.dateValidationModule.getValidEndDate(e);return this.parent.dateValidationModule.compareDates(t,i)},e.prototype.updateEditedRecord=function(e){this.parent.editModule.initiateUpdateAction(e)},e.prototype.destroy=function(){this.parent.editModule.cellEditModule=void 0},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.previousScroll={top:0,left:0},this.parent=e,this.element=this.parent.ganttChartModule.scrollElement,this.addEventListeners()}return e.prototype.addEventListeners=function(){this.parent.on("grid-scroll",this.gridScrollHandler,this),r.EventHandler.add(this.element,"scroll",this.onScroll,this),this.parent.treeGrid.grid.on("showGanttShimmer",this.updateShimmer,this),this.parent.treeGrid.grid.on("removeGanttShimmer",this.removeShimmer,this)},e.prototype.removeEventListeners=function(){r.EventHandler.remove(this.element,"scroll",this.onScroll),this.parent.off("grid-scroll",this.gridScrollHandler),this.parent.treeGrid.grid.off("showGanttShimmer",this.updateShimmer),this.parent.treeGrid.grid.off("removeGanttShimmer",this.removeShimmer)},e.prototype.gridScrollHandler=function(e){this.element.scrollTop=i.i(r.getValue)("top",e),this.isFromTreeGrid=!0},e.prototype.updateTopPosition=function(){var e,t=this.parent.treeGrid.element.querySelector(".e-content"),n=t.scrollTop;if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){e=n-this.parent.virtualScrollModule.getTopPosition()}else e=n;if(!i.i(r.isNullOrUndefined)(this.parent.dayMarkersModule)){var a=i.i(r.getValue)("nonworkingDayRender.holidayContainer",this.parent.dayMarkersModule),s=i.i(r.getValue)("nonworkingDayRender.weekendContainer",this.parent.dayMarkersModule),o=i.i(r.getValue)("eventMarkerRender.eventMarkersContainer",this.parent.dayMarkersModule);a&&(a.style.top=i.i(r.formatUnit)(e)),s&&(s.style.top=i.i(r.formatUnit)(e)),o&&(o.style.top=i.i(r.formatUnit)(e))}this.parent.chartVerticalLineContainer&&(this.parent.chartVerticalLineContainer.style.top=i.i(r.formatUnit)(e))},e.prototype.removeShimmer=function(){var e=this.parent;setTimeout(function(){if(e.hideMaskRow(),"ResourceView"===e.viewType&&!e.allowTaskbarOverlap&&e.showOverAllocation){for(var t=0;t<e.currentViewData.length;t++){var i=e.chartRowsModule.ganttChartTableBody.childNodes[t];"none"!==i.style.display&&e.currentViewData[t].hasChildRecords&&!e.currentViewData[t].expanded&&(e.treeGrid.getRowByIndex(t).style.height=i.style.height)}e.contentHeight=e.enableRtl?e.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:e.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=e.contentHeight+"px"}},0)},e.prototype.updateShimmer=function(){var e=this.parent;setTimeout(function(){e.showMaskRow()},0)},e.prototype.updateSpinner=function(){var e=this.parent;this.parent.showSpinner(),window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(function(){e.hideSpinner()},200)},e.prototype.onScroll=function(){var e={};this.element.scrollTop!==this.previousScroll.top&&(this.isFromTreeGrid?this.isFromTreeGrid=!1:this.parent.notify("chartScroll",{top:this.element.scrollTop}),e.previousScrollTop=this.previousScroll.top,this.previousScroll.top=this.element.scrollTop,e.scrollTop=this.element.scrollTop,e.scrollDirection="Vertical",e.action="VerticalScroll",this.updateTopPosition()),this.element.scrollLeft!==this.previousScroll.left&&(this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,e.previousScrollLeft=this.previousScroll.left,this.previousScroll.left=this.element.scrollLeft,e.scrollLeft=this.element.scrollLeft,e.scrollDirection="Horizontal",e.action="HorizontalScroll"),"Horizontal"===e.scrollDirection||i.i(r.isNullOrUndefined)(e.scrollDirection)||!0!==this.parent.enableVirtualization||!this.parent.isToolBarClick&&!i.i(r.isNullOrUndefined)(this.parent.isToolBarClick)||(this.parent.isVirtualScroll=!0,(this.parent.showIndicator||i.i(r.isNullOrUndefined)(this.parent.showIndicator))&&!this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization&&"Spinner"===this.parent.loadingIndicator.indicatorType&&this.updateSpinner()),this.parent.isToolBarClick=!0,e.requestType="scroll",this.parent.trigger("actionComplete",e)},e.prototype.setHeight=function(e){this.element.style.height=i.i(r.formatUnit)(e)},e.prototype.setWidth=function(e){this.element.style.width=i.i(r.formatUnit)(e)},e.prototype.setScrollTop=function(e){this.element.scrollTop=e,this.parent.treeGrid.element.querySelector(".e-content").scrollTop=e},e.prototype.setScrollLeft=function(e,t){t&&(e=-1===t&&this.parent.enableRtl?-e:e),this.element.scrollLeft=e,this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,this.previousScroll.left=this.element.scrollLeft},e.prototype.destroy=function(){this.removeEventListeners()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(6),n=(i.n(r),function(){function e(e){r.TreeGrid.Inject(r.ColumnMenu),this.parent=e}return e.prototype.getColumnMenu=function(){return this.parent.treeGrid.columnMenuModule.getColumnMenu()},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"columnMenu"},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(6),n=(i.n(r),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.Reorder),this.parent.treeGrid.allowReordering=this.parent.allowReordering,this.bindEvents()}return e.prototype.getModuleName=function(){return"reorder"},e.prototype.bindEvents=function(){var e=this;this.parent.treeGrid.columnDragStart=function(t){e.parent.trigger("columnDragStart",t)},this.parent.treeGrid.columnDrag=function(t){e.parent.trigger("columnDrag",t)},this.parent.treeGrid.columnDrop=function(t){e.parent.trigger("columnDrop",t)}},e.prototype.destroy=function(){},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(6),n=(i.n(r),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.Resize),this.parent.treeGrid.allowResizing=this.parent.allowResizing,this.bindEvents()}return e.prototype.getModuleName=function(){return"resize"},e.prototype.bindEvents=function(){var e=this;this.parent.treeGrid.resizeStart=function(t){e.parent.trigger("resizeStart",t)},this.parent.treeGrid.resizing=function(t){e.parent.trigger("resizing",t)},this.parent.treeGrid.resizeStop=function(t){e.parent.trigger("resizeStop",t)}},e.prototype.destroy=function(){},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(3)),a=i(1),s=i(9),o=(i.n(s),function(){function e(e){this.validationPredecessor=null,this.confirmPredecessorDialog=null,this.predecessorIndex=null,this.childRecord=null,this.parent=e,this.dateValidateModule=this.parent.dateValidationModule,this.parent.on("initPredessorDialog",this.initPredecessorValidationDialog,this)}return e.prototype.updateConnectorLineEditElement=function(e){var t=this.getConnectorLineHoverElement(e.target);i.i(r.getValue)("editModule.taskbarEditModule.taskBarEditAction",this.parent)||this.highlightConnectorLineElements(t)},e.prototype.getConnectorLineHoverElement=function(e){var t=i.i(a.j)(e,n._9),r=i.i(a.j)(e,n._10),s=i.i(a.j)(e,n.r),o=i.i(a.j)(e,n.s);return t||r||s||o?i.i(a.j)(e,n.V):null},e.prototype.highlightConnectorLineElements=function(e){e?e!==this.connectorLineElement&&(this.removeHighlight(),this.addHighlight(e)):this.removeHighlight()},e.prototype.addHighlight=function(e){this.connectorLineElement=e;var t=e.querySelector("."+n._9),i=e.querySelector("."+n.r);t?t.setAttribute("stroke-width","2"):i.setAttribute("stroke-width","2")},e.prototype.removeHighlight=function(){if(this.connectorLineElement){var e=this.connectorLineElement.querySelector("."+n._9),t=this.connectorLineElement.querySelector("."+n.r);e?e.setAttribute("stroke-width","1"):t.setAttribute("stroke-width","1"),this.connectorLineElement=null}},e.prototype.getEditedConnectorLineString=function(e){for(var t,n,a,s,o,l,d=[],h=[],p="",u=0;u<e.length;u++)if(t=e[u],n=t.ganttProperties.predecessor){for(var c=0;c<n.length;c++){a=n[c];if(this.parent.connectorLineModule.removeConnectorLineById("parent"+a.from+"child"+a.to),s=this.parent.connectorLineModule.getRecordByID(a.from),o=this.parent.connectorLineModule.getRecordByID(a.to),(!this.parent.allowParentDependency&&s&&!0===s.expanded||o&&!0===o.expanded||this.parent.allowParentDependency&&(s||o))&&(l=this.parent.predecessorModule.updateConnectorLineObject(s,o,a),!i.i(r.isNullOrUndefined)(l))){var g=d.indexOf(l.connectorLineId),f=this.parent.connectorLineModule.getConnectorLineTemplate(l);-1!==g?h[g]=f:(d.push(l.connectorLineId),h.push(f))}}p=h.join("")}return p},e.prototype.refreshEditedRecordConnectorLine=function(e){this.parent.connectorLineModule.removePreviousConnectorLines(this.parent.previousRecords),this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.getExpandedRecords(this.parent.updatedRecords);var t=this.getEditedConnectorLineString(e);this.parent.connectorLineModule.svgObject.innerHTML=this.parent.connectorLineModule.svgObject.innerHTML+t},e.prototype.idFromPredecessor=function(e){for(var t=e.split(","),n=[],a=[],s=[],o=0;o<t.length;o++){var l=[],d=!1,h=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,p=t[o].split("-"),u=void 0;if(6===p.length&&(p[4]=p[4]+"-"+p[5],p.pop()),5===p.length&&p[4].length>12&&(u=t[o].substring(0,36),h.test(u)&&(d=!0)),d){var c=void 0;c=p[4].split("+");var g=void 0;1===c.length?a[0]=t[o]:(g=c[1].length,a[0]=t[o].slice(0,-(g+1)),a[1]=c[1]),"+",p[4].indexOf("-")>=0&&(c=p[4].split("-"),1===c.length?a[0]=t[o]:(g=c[1].length,a[0]=t[o].slice(0,-(g+1)),a[1]=c[1]),"-")}else a=t[o].split("+"),"+",t[o].indexOf("-")>=0&&(a=t[o].split("-"),"-");if(!i.i(r.isNullOrUndefined)(a[0])){-1===("ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids).indexOf(a[0])?-1!==a[0].indexOf(" ")?(s=a[0].split(" "),1===s.length&&(s=a[0].match(/(\d+|[A-z]+)/g)),l.push(s[0])):1===a[0].length||2===a[0].length?l.push(a[0]):l.push(a[0].slice(0,-2)):l.push(a[0])}n.push(l.join(""))}return n},e.prototype.predecessorValidation=function(e,t){for(var n,a,s=t.rowUniqueID,o=0;o<e.length;o++){n=e[o];var l=[];e.slice(0).splice(o,1);for(var d=this;null!==n;){var h=function(){var e=[];return-1!==l.indexOf(n)?"break":i.i(r.isNullOrUndefined)(d.parent.connectorLineModule.getRecordByID(n))?{value:!1}:(a=d.parent.connectorLineModule.getRecordByID(n).ganttProperties,!i.i(r.isNullOrUndefined)(a.predecessor)&&a.predecessor.length>0&&a.predecessor.forEach(function(t){a.rowUniqueID.toString()!==t.from&&e.push(t.from.toString())}),s.toString()===a.rowUniqueID.toString()||-1!==e.indexOf(s.toString())?{value:!1}:(l.push(n),!i.i(r.isNullOrUndefined)(a.predecessor)&&a.predecessor.length>0?void(n=a.predecessor[0].from):"break"))}();if("object"==typeof h)return h.value;if("break"===h)break}}return!0},e.prototype.getRootParent=function(e){var t=e;return e.parentItem?(t=this.parent.flatData.filter(function(t){return t.uniqueID===e.parentUniqueID})[0],t.parentItem&&(t=this.getRootParent(t)),t):t},e.prototype.validateParentPredecessor=function(e,t){if(t.hasChildRecords&&!e.hasChildRecords){if(e.parentUniqueID===t.uniqueID)return!1;do{if(e.parentItem&&(e=this.parent.flatData[this.parent.ids.indexOf(e.parentItem.taskId)],e.uniqueID===t.uniqueID))return!1}while(e.parentItem)}else if(!t.hasChildRecords&&e.hasChildRecords){if(t.parentUniqueID===e.uniqueID)return!1;do{if(t.parentItem&&(t=this.parent.flatData[this.parent.ids.indexOf(t.parentItem.taskId)],t.uniqueID===e.uniqueID))return!1}while(t.parentItem)}else if(t.hasChildRecords&&e.hasChildRecords)if(t.parentItem&&e.parentItem){if(e.parentUniqueID===t.uniqueID||e.uniqueID===t.parentUniqueID)return!1}else if(!t.parentItem&&e.parentItem){var i=this.parent.connectorLineEditModule.getRootParent(e);if(i.uniqueID===t.uniqueID)return!1}else if(t.parentItem&&!e.parentItem){var r=this.parent.connectorLineEditModule.getRootParent(t);if(r.uniqueID===e.uniqueID)return!1}return!0},e.prototype.validatePredecessorRelation=function(e,t){var n,a,s=!0,o="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(!i.i(r.isNullOrUndefined)(t)&&t.length>0){n=this.idFromPredecessor(t);for(var l=this,d=0;d<n.length;d++){var h=function(t){if(l.parent.allowParentDependency){if(parseInt(n[n.length-1])!==e[l.parent.taskFields.id]){var d=l.parent.ids.indexOf(n[n.length-1]),h=l.parent.currentViewData[d];h&&e&&(s=l.validateParentPredecessor(h,e))}}else{if(!l.checkParentRelation(e,n))return{value:!1}}var p=n.slice(0),u=[],c=!0;if(p.forEach(function(e){-1===u.indexOf(e)?u.push(e):c=!1}),!c)return{value:!1};a=n[t];var g=[];n.slice(0).splice(t,1);for(;null!==a;){var f=function(){var t,n,s=[];if(-1!==g.indexOf(a))return"break";if(i.i(r.isNullOrUndefined)(l.parent.connectorLineModule.getRecordByID(a.toString())))return{value:!1};if(n=l.parent.connectorLineModule.getRecordByID(a.toString()).ganttProperties,!i.i(r.isNullOrUndefined)(n.predecessor)&&n.predecessor.length>0&&n.predecessor.forEach(function(e,i){n.rowUniqueID.toString()!==e.from&&(s.push(e.from.toString()),t=i)}),o.toString()===n.rowUniqueID.toString()||-1!==s.indexOf(o.toString()))return{value:!1};if(g.push(a),i.i(r.isNullOrUndefined)(n.predecessor)||!(n.predecessor.length>0))return"break";var d=void 0;return s.length>1?d=l.predecessorValidation(s,e.ganttProperties):1===s.length&&(a=n.predecessor[t].from),!1===d?{value:!1}:void 0}();if("object"==typeof f)return f;if("break"===f)break}}(d);if("object"==typeof h)return h.value}}return s},e.prototype.addPredecessor=function(e,t){var n=i.i(r.isNullOrUndefined)(e.ganttProperties.predecessorsName)||""===e.ganttProperties.predecessorsName?t:e.ganttProperties.predecessorsName+","+t;this.updatePredecessorHelper(e,n)},e.prototype.removePredecessor=function(e){this.updatePredecessorHelper(e,null)},e.prototype.updatePredecessor=function(e,t,i){return this.updatePredecessorHelper(e,t,i)},e.prototype.updatePredecessorHelper=function(e,t,n){if(i.i(r.isUndefined)(t)||this.validatePredecessorRelation(e,t)){this.parent.isOnEdit=!0;var a=[];i.i(r.isNullOrUndefined)(t)||""===t||(a=this.parent.predecessorModule.calculatePredecessor(t,e)),this.parent.setRecordValue("predecessor",a,e.ganttProperties,!0);var s=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",s,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,s,e),this.parent.setRecordValue(this.parent.taskFields.dependency,s,e);var o={};return o.action=n&&n.action&&"CellEditing"===n.action?n.action:"DrawConnectorLine",o.data=e,this.parent.editModule.initiateUpdateAction(o),!0}return!1},e.prototype.checkParentRelation=function(e,t){var i=e;if(i&&i.parentItem&&-1!==t.indexOf(i.parentItem.taskId.toString()))return!1;for(var r=this,n=0;n<t.length;n++){var a=function(e){var i=r.parent.currentViewData.filter(function(i){return i&&i.ganttProperties.rowUniqueID.toString()===t[e].toString()});if(i[0]&&i[0].hasChildRecords)return{value:!1}}(n);if("object"==typeof a)return a.value}return!0},e.prototype.initPredecessorValidationDialog=function(){if(this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation){var e=i.i(r.createElement)("div",{id:this.parent.element.id+"_dialogValidationRule"});this.parent.element.appendChild(e),this.renderValidationDialog()}},e.prototype.renderValidationDialog=function(){var e=new s.Dialog({header:"Validate Editing",isModal:!0,enableRtl:this.parent.enableRtl,visible:!1,width:"50%",showCloseIcon:!0,close:this.validationDialogClose.bind(this),content:"",buttons:[{click:this.validationDialogOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.validationDialogCancelButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});document.getElementById(this.parent.element.id+"_dialogValidationRule").innerHTML="",e.isStringTemplate=!0,e.appendTo("#"+this.parent.element.id+"_dialogValidationRule"),this.parent.validationDialogElement=e},e.prototype.validationDialogOkButton=function(){var e=this.parent.currentEditedArgs;e.validateMode.preserveLinkWithEditing=document.getElementById(this.parent.element.id+"_ValidationAddlineOffset").checked,e.validateMode.removeLink=document.getElementById(this.parent.element.id+"_ValidationRemoveline").checked,e.validateMode.respectLink=document.getElementById(this.parent.element.id+"_ValidationCancel").checked,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogCancelButton=function(){this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogClose=function(e){i.i(r.getValue)("isInteraction",e)&&(this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption())},e.prototype.applyPredecessorOption=function(){var e=this.parent.currentEditedArgs,t=e.data;e.validateMode.respectLink?(this.parent.editModule.reUpdatePreviousRecords(),this.parent.chartRowsModule.refreshRecords([e.data])):e.validateMode.removeLink?(this.checkChildRecords(t),this.parent.editModule.updateEditedTask(e.editEventArgs)):e.validateMode.preserveLinkWithEditing&&(this.parent.UpdateOffsetOnTaskbarEdit&&this.calculateOffset(t),this.parent.editModule.updateEditedTask(e.editEventArgs))},e.prototype.checkChildRecords=function(e){if(this.validationPredecessor=e.ganttProperties.predecessor,i.i(r.isNullOrUndefined)(this.validationPredecessor)||this.removePredecessors(e,this.validationPredecessor),e.childRecords.length>0)for(var t=0;t<e.childRecords.length;t++){var n=e.childRecords[t];this.validationPredecessor=n.ganttProperties.predecessor,i.i(r.isNullOrUndefined)(this.validationPredecessor)||this.removePredecessors(n,this.validationPredecessor),n.childRecords.length>0&&this.checkChildRecords(n)}else if(!i.i(r.isNullOrUndefined)(e.parentItem)){var a=this.parent.getRecordByID(e.parentItem.taskId);this.validationPredecessor=a.ganttProperties.predecessor,this.removePredecessors(a,this.validationPredecessor)}},e.prototype.calculateOffset=function(e){for(var t=i.i(r.extend)([],e.ganttProperties.predecessor,[],!0),n=this.parent.predecessorModule.getValidPredecessor(e),s=0;s<n.length;s++){var o=n[parseInt(s.toString(),10)],l=this.parent.connectorLineModule.getRecordByID(o.from),d=void 0;if(i.i(a.c)(l.ganttProperties)&&i.i(a.c)(e.ganttProperties)){var h=void 0,p=void 0,u=void 0,c=void 0;switch(o.type){case"FS":h=new Date(l.ganttProperties.endDate.getTime()),p=new Date(e.ganttProperties.startDate.getTime());break;case"SS":h=new Date(l.ganttProperties.startDate.getTime()),p=new Date(e.ganttProperties.startDate.getTime());break;case"SF":h=new Date(l.ganttProperties.startDate.getTime()),p=new Date(e.ganttProperties.endDate.getTime());break;case"FF":h=new Date(l.ganttProperties.endDate.getTime()),p=new Date(e.ganttProperties.endDate.getTime())}if(h.getTime()<p.getTime())h=this.dateValidateModule.checkStartDate(h),p=this.dateValidateModule.checkEndDate(p,null),c=!1;else{var g=new Date(h.getTime());h=this.dateValidateModule.checkStartDate(p),p=this.dateValidateModule.checkEndDate(g,null),c=!0}h.getTime()<p.getTime()?(u=this.dateValidateModule.getDuration(h,p,o.offsetUnit,!0,!1),d=c?-1*u:u):d=0}else d=0;t[i.i(a.h)(o,"from",t,"to")].offset=d;var f=i.i(r.extend)([],l.ganttProperties.predecessor,[],!0);f[i.i(a.h)(o,"from",f,"to")].offset=d,this.parent.setRecordValue("predecessor",f,l.ganttProperties,!0)}this.parent.setRecordValue("predecessor",t,e.ganttProperties,!0);var m=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,m,e),this.parent.setRecordValue(this.parent.taskFields.dependency,m,e),this.parent.setRecordValue("predecessorsName",m,e.ganttProperties,!0)},e.prototype.removePredecessors=function(e,t){var n=i.i(r.extend)([],[],e.ganttProperties.predecessor,!0);if(!i.i(r.isNullOrUndefined)(t)){for(var s=t.length,o=0;o<s;o++){var l=this.parent.connectorLineModule.getRecordByID(t[o].from),d=i.i(r.extend)([],[],l.ganttProperties.predecessor,!0),h=i.i(a.h)(t[o],"from",n,"to");n.splice(h,1);var p=i.i(a.h)(t[parseInt(o.toString(),10)],"from",d,"to");d.splice(p,1),this.parent.setRecordValue("predecessor",d,l.ganttProperties,!0)}if(n.length!==e.ganttProperties.predecessor.length){this.parent.setRecordValue("predecessor",n,e.ganttProperties,!0);var u=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",u,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,u,e),this.parent.setRecordValue(this.parent.taskFields.dependency,u,e)}}},e.prototype.openValidationDialog=function(e){var t=this.validationDialogTemplate(e);this.parent.validationDialogElement.setProperties({content:t}),this.parent.validationDialogElement.show()},e.prototype.validationDialogTemplate=function(e){var t,n=this.parent.element.id,s=i.i(r.createElement)("div",{className:"e-ValidationContent"}),o=i.i(r.getValue)("task",e),l=i.i(r.getValue)("parentTask",e),d=i.i(r.getValue)("violationType",e),h=o.ganttProperties.taskName,p=this.parent.getFormatedDate(o.ganttProperties.startDate,"MM/dd/yyyy"),u=l.ganttProperties.taskName,c=[h,u];"taskBeforePredecessor_FS"===d?t=this.parent.localeObj.getConstant("taskBeforePredecessor_FS"):"taskAfterPredecessor_FS"===d?t=this.parent.localeObj.getConstant("taskAfterPredecessor_FS"):"taskBeforePredecessor_SS"===d?t=this.parent.localeObj.getConstant("taskBeforePredecessor_SS"):"taskAfterPredecessor_SS"===d?t=this.parent.localeObj.getConstant("taskAfterPredecessor_SS"):"taskBeforePredecessor_FF"===d?t=this.parent.localeObj.getConstant("taskBeforePredecessor_FF"):"taskAfterPredecessor_FF"===d?t=this.parent.localeObj.getConstant("taskAfterPredecessor_FF"):"taskBeforePredecessor_SF"===d?t=this.parent.localeObj.getConstant("taskBeforePredecessor_SF"):"taskAfterPredecessor_SF"===d&&(t=this.parent.localeObj.getConstant("taskAfterPredecessor_SF")),t=i.i(a.l)(t,c);var g='<div id="'+n+'_ValidationText">'+t+"<div>",f='<table><tr><td><input type="radio" id="'+n+'_ValidationCancel" name="ValidationRule" checked/><label for="'+n+'_ValidationCancel" id= "'+n+'_cancelLink">Cancel, keep the existing link</label></td></tr><tr><td><input type="radio" id="'+n+'_ValidationRemoveline" name="ValidationRule"/><label for="'+n+'_ValidationRemoveline" id="'+n+'_removeLink">Remove the link and move <b>'+h+"</b> to start on <b>"+p+'</b>.</label></td></tr><tr><td><input type="radio" id="'+n+'_ValidationAddlineOffset" name="ValidationRule"/><label for="'+n+'_ValidationAddlineOffset" id="'+n+'_preserveLink">Move the <b>'+h+"</b> to start on <b>"+p+"</b> and keep the link.</label></td></tr></table>";return s.innerHTML=g+f,s},e.prototype.validateTypes=function(e,t){var n,a=this.parent.predecessorModule.getValidPredecessor(e);this.validationPredecessor=[];var s,o,l,d=this.parent.predecessorModule.getPredecessorDate(e,a);o=t?t.ganttProperties:e.ganttProperties;for(var h=this.parent.allowUnscheduledTasks&&i.i(r.isNullOrUndefined)(d)?o.endDate:this.dateValidateModule.getEndDate(d,o.duration,o.durationUnit,o,!1),p=0;p<a.length;p++){n=this.parent.connectorLineModule.getRecordByID(a[p].from);var u=null;"FS"===a[p].type?o.startDate<d?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskBeforePredecessor_FS"):o.startDate>d&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskAfterPredecessor_FS"):"SS"===a[p].type?o.startDate<d?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskBeforePredecessor_SS"):o.startDate>d&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskAfterPredecessor_SS"):"FF"===a[p].type?h<=n.ganttProperties.endDate?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskBeforePredecessor_FF"):h>n.ganttProperties.endDate&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskAfterPredecessor_FF"):"SF"===a[p].type&&(h<n.ganttProperties.startDate?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskBeforePredecessor_SF"):h>=n.ganttProperties.startDate&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),u="taskAfterPredecessor_SF")),!i.i(r.isNullOrUndefined)(u)&&i.i(r.isNullOrUndefined)(l)&&(s=n,l=u)}return{parentTask:s,task:e,violationType:l}},e.prototype.addRemovePredecessor=function(e){var t=this.parent.previousRecords[e.uniqueID],n=e.ganttProperties.predecessor.slice();if(t&&t.ganttProperties&&t.ganttProperties.hasOwnProperty("predecessor")){var s=t.ganttProperties.predecessor;if(!i.i(r.isNullOrUndefined)(s))for(var o=0;o<s.length;o++){var l=this.parent.connectorLineModule.getRecordByID(s[parseInt(o.toString(),10)].from);if(l===e)e.ganttProperties.predecessor.push(s[parseInt(o.toString(),10)]);else{var d=i.i(r.extend)([],[],l.ganttProperties.predecessor,!0),h=i.i(a.h)(s[parseInt(o.toString(),10)],"from",d,"to");-1!==h&&(d.splice(h,1),this.parent.setRecordValue("predecessor",d,l.ganttProperties,!0))}}if(!i.i(r.isNullOrUndefined)(n))for(var p=0;p<n.length;p++){var l=this.parent.connectorLineModule.getRecordByID(n[parseInt(p.toString(),10)].from),d=i.i(r.extend)([],[],l.ganttProperties.predecessor,!0);d.push(n[parseInt(p.toString(),10)]),this.parent.setRecordValue("predecessor",d,l.ganttProperties,!0)}}},e.prototype.removePredecessorByIndex=function(e,t){var r=e.ganttProperties.predecessor,n=r.splice(t,1),s=this.parent.connectorLineModule.getRecordByID(n[0].from),o=s.ganttProperties.predecessor,l=i.i(a.h)(n[0],"from",o,"to");o.splice(l,1);var d=this.parent.predecessorModule.getPredecessorStringValue(e);r.push(n[0]),this.parent.connectorLineEditModule.updatePredecessor(e,d)},e.prototype.renderPredecessorDeleteConfirmDialog=function(){this.confirmPredecessorDialog=new s.Dialog({width:"320px",isModal:!0,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmPredecessorDelete"),buttons:[{click:this.confirmOkDeleteButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.confirmCloseDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});var e=i.i(r.createElement)("div",{id:this.parent.element.id+"_deletePredecessorConfirmDialog"});this.parent.element.appendChild(e),this.confirmPredecessorDialog.isStringTemplate=!0,this.confirmPredecessorDialog.appendTo(e)},e.prototype.confirmCloseDialog=function(){this.confirmPredecessorDialog.destroy()},e.prototype.confirmOkDeleteButton=function(){this.removePredecessorByIndex(this.childRecord,this.predecessorIndex),this.confirmPredecessorDialog.destroy()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(3),n=i(6),a=(i.n(n),i(0)),s=(i.n(a),i(4)),o=(i.n(s),i(13)),l=(i.n(o),function(){function e(e){var t=this;this.segmentIndex=-1,this.headerContextMenuClick=function(e){var r=i.i(a.closest)(e.event.target,".e-row"),n=i.i(a.closest)(e.event.target,".e-chart-row");i.i(a.isNullOrUndefined)(r)&&i.i(a.isNullOrUndefined)(n)&&(e.type="Header",t.parent.trigger("contextMenuClick",e))},this.headerContextMenuOpen=function(e){var r=i.i(a.closest)(e.event.target,".e-row"),n=i.i(a.closest)(e.event.target,".e-chart-row");i.i(a.isNullOrUndefined)(r)&&i.i(a.isNullOrUndefined)(n)?(e.type="Header",t.parent.trigger("contextMenuOpen",e)):e.cancel=!0},this.parent=e,this.ganttID=e.element.id,n.TreeGrid.Inject(n.ContextMenu),this.parent.treeGrid.contextMenuClick=this.headerContextMenuClick.bind(this),this.parent.treeGrid.contextMenuOpen=this.headerContextMenuOpen.bind(this),this.addEventListener(),this.resetItems()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("initiate-contextMenu",this.render,this),this.parent.on("reRender-contextMenu",this.reRenderContextMenu,this),this.parent.on("contextMenuClick",this.contextMenuItemClick,this),this.parent.on("contextMenuOpen",this.contextMenuBeforeOpen,this))},e.prototype.reRenderContextMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),i.i(a.remove)(this.element)),this.resetItems(),this.render())},e.prototype.render=function(){this.element=this.parent.createElement("ul",{id:this.ganttID+"_contextmenu",className:r.a}),this.parent.element.appendChild(this.element);var e="#"+this.ganttID;this.contextMenu=new o.ContextMenu({items:this.getMenuItems(),locale:this.parent.locale,enableRtl:this.parent.enableRtl,target:e,animationSettings:{effect:"None"},select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-gantt"}),this.contextMenu.appendTo(this.element),this.parent.treeGrid.contextMenuItems=this.headerMenuItems},e.prototype.contextMenuItemClick=function(e){this.item=this.getKeyFromId(e.item.id);var t,r,n,s=i.i(a.getValue)("parentObj",e.item),o=-1;switch(s&&!i.i(a.isNullOrUndefined)(s.id)&&"DeleteDependency"===this.getKeyFromId(s.id)&&(o=s.items.indexOf(e.item)),this.parent.isAdaptive&&("TaskInformation"!==this.item&&"Above"!==this.item&&"Below"!==this.item&&"Child"!==this.item&&"DeleteTask"!==this.item||this.parent.selectionModule&&"Multiple"===this.parent.selectionSettings.type&&(this.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),this.item){case"TaskInformation":i.i(a.isNullOrUndefined)(this.rowData)||("string"==typeof this.rowData.ganttProperties.taskId?this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID):this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID)));break;case"Above":case"Below":case"Child":if(i.i(a.isNullOrUndefined)(this.rowData))0===this.parent.flatData.length&&this.parent.addRecord();else if(t=this.item,r=i.i(a.extend)({},{},this.rowData.taskData,!0),n=this.parent.taskFields,r[n.startDate]&&this.parent.setRecordValue(n.startDate,this.rowData.ganttProperties.startDate,r,!0),r[n.endDate]&&this.parent.setRecordValue(n.endDate,this.rowData.ganttProperties.endDate,r,!0),i.i(a.isNullOrUndefined)(n.dependency)||(r[n.dependency]=null),!i.i(a.isNullOrUndefined)(n.child)&&r[n.child]&&delete r[n.child],!i.i(a.isNullOrUndefined)(n.parentID)&&r[n.parentID]&&(r[n.parentID]=null),this.rowData){var l=this.parent.updatedRecords.indexOf(this.rowData);this.parent.addRecord(r,t,l)}break;case"Milestone":case"ToMilestone":i.i(a.isNullOrUndefined)(this.rowData)?0===this.parent.flatData.length&&this.parent.addRecord():this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);break;case"DeleteTask":"Cell"!==this.parent.selectionSettings.mode&&this.parent.selectionModule.selectedRowIndexes.length>1||"Cell"===this.parent.selectionSettings.mode&&this.parent.selectionModule.getSelectedRowCellIndexes().length?this.parent.editModule.startDeleteAction():this.parent.editModule.deleteRecord(this.rowData);break;case"ToTask":if(!i.i(a.isNullOrUndefined)(this.rowData)){if(r=i.i(a.extend)({},{},this.rowData.taskData,!0),n=this.parent.taskFields,i.i(a.isNullOrUndefined)(n.duration)){r[n.startDate]=new Date(this.rowData.taskData[n.startDate]);var d=new Date(this.rowData.taskData[n.startDate]);d.setDate(d.getDate()+1),r[n.endDate]=d}else{this.rowData.ganttProperties;r[n.duration]=r[n.duration]<=0?1:r[n.duration]}i.i(a.isNullOrUndefined)(r[n.milestone])||!0===r[n.milestone]&&(r[n.milestone]=!1),r[n.startDate]&&this.parent.setRecordValue(n.startDate,this.rowData.ganttProperties.startDate,r,!0),this.parent.updateRecordByID(r)}break;case"Cancel":this.parent.cancelEdit();break;case"Save":this.parent.editModule.cellEditModule.isCellEdit=!1,this.parent.treeGrid.grid.saveCell();break;case"Dependency"+o:this.parent.connectorLineEditModule.removePredecessorByIndex(this.rowData,o);break;case"Auto":case"Manual":this.parent.changeTaskMode(this.rowData);break;case"Indent":this.parent.indent();break;case"Outdent":this.parent.outdent();break;case"Left":case"Right":this.mergeCall(this.item);break;case"SplitTask":this.splitTaskCall(e)}e.type="Content",e.rowData=this.rowData,this.parent.trigger("contextMenuClick",e)},e.prototype.splitTaskCall=function(e){var t=this;this.isEdit=!0;var r=this.parent.taskFields,n=this.getClickedDate(e.element);i.i(a.isNullOrUndefined)(this.parent.timelineSettings.bottomTier)&&"Hour"!==this.parent.timelineSettings.bottomTier.unit&&n.setHours(0,0,0,0);var s={rowData:this.rowData,requestType:"splitTaskbar",splitDate:n,cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",s,function(e){i.i(a.isNullOrUndefined)(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),t.parent.chartRowsModule.splitTask(t.rowData[r.id],n)})},e.prototype.mergeCall=function(e){var t=this;this.isEdit=!0;var r=this.parent.taskFields,n=this.rowData.ganttProperties.segments,s="Right"===e?this.segmentIndex:n[this.segmentIndex-1].segmentIndex,o="Left"===e?this.segmentIndex:n[this.segmentIndex+1].segmentIndex,l=[{firstSegmentIndex:s,secondSegmentIndex:o}],d={rowData:this.rowData,mergeSegmentIndexes:l,requestType:"mergeSegment",cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",d,function(e){i.i(a.isNullOrUndefined)(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),!1===e.cancel&&t.parent.chartRowsModule.mergeTask(t.rowData[r.id],l)})},e.prototype.getClickedDate=function(e){var t;if(this.parent.enableRtl){var r=this.parent.element.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,s=document.documentElement.clientLeft||document.body.clientLeft||0;t=r.left+n-s}else t=this.parent.getOffsetRect(this.parent.element).left;var o,l;this.parent.enableRtl?(o=Math.abs(t+this.parent.ganttChartModule.chartElement.offsetWidth-this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft),l=Math.abs(this.clickedPosition-o)):(o=t+this.parent.ganttChartModule.chartElement.offsetLeft+this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft,l=this.clickedPosition-o);var d=Math.ceil(l/this.parent.perDayWidth),h=this.rowData.ganttProperties.startDate;return i.i(a.isNullOrUndefined)(this.parent.timelineSettings.bottomTier)||"Hour"!==this.parent.timelineSettings.bottomTier.unit||(d=Math.ceil(l/this.parent.timelineSettings.timelineUnitSize),d-=1),this.parent.dataOperation.getEndDate(h,d,"None"!==this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.bottomTier.unit.toLocaleLowerCase():this.parent.timelineModule.customTimelineSettings.topTier.unit.toLocaleLowerCase(),this.rowData,!1)},e.prototype.contextMenuBeforeOpen=function(e){var t=this,n=e.event?e.event.target:this.parent.focusModule?this.parent.ganttChartModule.targetElement:this.parent.focusModule.getActiveElement();(!i.i(a.isNullOrUndefined)(this.parent.editModule)&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&n.parentElement.classList.contains("e-row")||n.parentElement.classList.contains("e-treecolumn-container"))&&this.parent.treeGrid.closeEdit(),i.i(a.isNullOrUndefined)(e.element)||e.element.id!==this.parent.element.id+"_contextmenu"||(this.clickedPosition=i.i(a.getValue)("event",e).clientX);var o=i.i(a.closest)(n,".e-gantt-child-taskbar");o&&(this.targetElement=e.target=o),e.gridRow=i.i(a.closest)(n,".e-row"),e.chartRow=i.i(a.closest)(n,".e-chart-row");var l=i.i(a.closest)(n,".e-gantt");if(!i.i(a.closest)(n,r.b)&&this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&this.parent.editModule.dialogModule.dialogObj&&!this.parent.editModule.dialogModule.dialogObj.open&&(this.parent.treeGrid.grid.saveCell(),this.parent.editModule.cellEditModule.isCellEdit=!1),this.parent.readOnly&&this.contextMenu.enableItems(["Add","Save","Convert","Delete Dependency","Delete Task","TaskMode","Indent","Outdent","SplitTask","MergeTask"],!1),(i.i(a.isNullOrUndefined)(e.gridRow)&&i.i(a.isNullOrUndefined)(e.chartRow)||0===this.contentMenuItems.length)&&((i.i(a.isNullOrUndefined)(e.parentItem)||i.i(a.isNullOrUndefined)(l))&&i.i(a.isNullOrUndefined)(i.i(a.closest)(n,".e-content"))?e.cancel=!0:e.cancel=!1),!e.cancel){var d=-1;e.gridRow?d=parseInt(e.gridRow.getAttribute("data-rowindex"),0):e.chartRow&&(d=parseInt(e.chartRow.getAttribute("aria-rowindex"),0)),this.parent.selectionModule&&this.parent.allowSelection&&!e.parentItem&&!i.i(a.isNullOrUndefined)(e.chartRow)&&this.parent.selectionModule.selectRow(d),e.parentItem||(this.rowData=this.parent.updatedRecords[parseInt(d.toString(),10)]);for(var h=0,p=e.items;h<p.length;h++){var u=p[h];u.separator||(!n.classList.contains("e-gantt-unscheduled-taskbar")||u.text!==this.getLocale("splitTask")&&u.text!==this.getLocale("mergeTask")?this.updateItemStatus(u,n,d):this.hideItems.push(u.text))}if(e.rowData=this.rowData,e.type="Content",e.disableItems=this.disableItems,e.hideItems=this.hideItems,e.hideChildItems=[],!i.i(a.isNullOrUndefined)(e.rowData)&&0===e.rowData.level&&"ResourceView"===this.parent.viewType)return void(e.cancel=!0);var c=new s.Deferred;return this.parent.trigger("contextMenuOpen",e,function(i){c.resolve(i),t.hideItems=i.hideItems,t.disableItems=i.disableItems,i.parentItem||i.hideItems.length!==i.items.length||(t.revertItemStatus(),i.cancel=!0),t.hideItems.length>0&&t.contextMenu.hideItems(t.hideItems),t.disableItems.length>0&&t.contextMenu.enableItems(t.disableItems,!1),e.hideChildItems.length>0&&t.contextMenu.hideItems(e.hideChildItems)}),c}},e.prototype.updateItemStatus=function(e,t,n){var s=this.getKeyFromId(e.id),o=i.i(a.closest)(t,r.b),l=[],d=i.i(a.closest)(t,".e-gantt-child-taskbar");if(o)"Save"!==s&&"Cancel"!==s&&this.hideItems.push(e.text);else switch(s){case"TaskInformation":this.parent.editSettings.allowEditing&&this.parent.editModule||this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"Add":this.parent.editSettings.allowAdding&&this.parent.editModule||this.updateItemVisibility(e.text);break;case"Save":case"Cancel":this.hideItems.push(e.text);break;case"Convert":!i.i(a.isNullOrUndefined)(this.rowData)&&this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowEditing&&this.parent.editModule?(i.i(a.isNullOrUndefined)(this.rowData)||this.rowData.ganttProperties.isMilestone?l.push(this.createItemModel(r.c,"ToTask",this.getLocale("toTask"))):l.push(this.createItemModel(r.c,"ToMilestone",this.getLocale("toMilestone"))),e.items=l):this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"DeleteDependency":var h=this.getPredecessorsItems();!i.i(a.isNullOrUndefined)(this.rowData)&&this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowDeleting&&0!==h.length&&this.parent.editModule?h.length>0&&(e.items=h):this.updateItemVisibility(e.text);break;case"DeleteTask":this.parent.editSettings.allowDeleting&&this.parent.editModule||this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"TaskMode":"Custom"!==this.parent.taskMode?this.updateItemVisibility(e.text):(this.rowData.ganttProperties.isAutoSchedule?l.push(this.createItemModel(r.c,"Manual",this.getLocale("manual"))):l.push(this.createItemModel(r.c,"Auto",this.getLocale("auto"))),e.items=l);break;case"Indent":if(this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings){var p=this.parent.selectedRowIndex,u=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),c=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1];this.parent.editSettings.allowEditing&&0!==p&&-1!==p&&u&&"ResourceView"!==this.parent.viewType&&this.parent.updatedRecords[parseInt(p.toString(),10)].level-c.level!=1||this.updateItemVisibility(e.text)}else this.hideItems.push(e.text);break;case"Outdent":if(this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings){var g=this.parent.selectionModule.getSelectedRowIndexes()[0],f=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length);this.parent.editSettings.allowEditing&&-1!==g&&0!==g&&f&&"ResourceView"!==this.parent.viewType&&0!==this.parent.updatedRecords[parseInt(g.toString(),10)].level||this.updateItemVisibility(e.text)}else this.hideItems.push(e.text);break;case"SplitTask":var m=this.parent.taskFields;(this.parent.readOnly||!d||i.i(a.isNullOrUndefined)(m.segments)||this.parent.currentViewData[parseInt(n.toString(),10)].hasChildRecords)&&this.updateItemVisibility(e.text);break;case"MergeTask":this.parent.readOnly||!d?this.updateItemVisibility(e.text):this.mergeItemVisiblity(t,e)}},e.prototype.mergeItemVisiblity=function(e,t){var n=[],s=this.parent.taskFields,o=this.getClickedDate(e);this.segmentIndex=this.parent.chartRowsModule.getSegmentIndex(o,this.rowData);var l=this.rowData.ganttProperties.segments;!i.i(a.isNullOrUndefined)(l)&&l.length>0?i.i(a.isNullOrUndefined)(s.segments)&&-1===this.segmentIndex?this.updateItemVisibility(t.text):(0===this.segmentIndex?n.push(this.createItemModel(r.c,"Right",this.getLocale("right"))):this.segmentIndex===l.length-1?n.push(this.createItemModel(r.c,"Left",this.getLocale("left"))):(n.push(this.createItemModel(r.c,"Right",this.getLocale("right"))),n.push(this.createItemModel(r.c,"Left",this.getLocale("left")))),t.items=n):this.hideItems.push(t.text)},e.prototype.updateItemVisibility=function(e){!i.i(a.isNullOrUndefined)(this.parent.contextMenuItems)?this.disableItems.push(e):this.hideItems.push(e)},e.prototype.contextMenuOpen=function(e){this.isOpen=!0;var t=e.element.querySelectorAll("li:not(.e-menu-hide):not(.e-disabled)")[0];i.i(a.isNullOrUndefined)(t)||i.i(a.addClass)([t],"e-focused")},e.prototype.getMenuItems=function(){for(var e=i.i(a.isNullOrUndefined)(this.parent.contextMenuItems)?this.getDefaultItems():this.parent.contextMenuItems,t=0,n=e;t<n.length;t++){var s=n[t];"string"==typeof s&&-1!==this.getDefaultItems().indexOf(s)?this.buildDefaultItems(s):"string"!=typeof s&&(-1!==this.getDefaultItems().indexOf(s.text)?this.buildDefaultItems(s.text,s.iconCss):s.target===r.d?this.headerMenuItems.push(s):this.contentMenuItems.push(s))}return this.contentMenuItems},e.prototype.createItemModel=function(e,t,i,r){return{text:i,id:this.generateID(t),target:e,iconCss:r?"e-icons "+r:null}},e.prototype.getLocale=function(e){return this.parent.localeObj.getConstant(e)},e.prototype.buildDefaultItems=function(e,t){var i;switch(e){case"AutoFitAll":case"AutoFit":case"SortAscending":case"SortDescending":this.headerMenuItems.push(e);break;case"TaskInformation":i=this.createItemModel(r.c,e,this.getLocale("taskInformation"),this.getIconCSS(r.e,t));break;case"Indent":i=this.createItemModel(r.c,e,this.getLocale("indent"),this.getIconCSS(r.f,t));break;case"Outdent":i=this.createItemModel(r.c,e,this.getLocale("outdent"),this.getIconCSS(r.g,t));break;case"Save":i=this.createItemModel(r.e,e,this.getLocale("save"),this.getIconCSS(r.h,t));break;case"Cancel":i=this.createItemModel(r.e,e,this.getLocale("cancel"),this.getIconCSS(r.i,t));break;case"Add":i=this.createItemModel(r.c,e,this.getLocale("add"),this.getIconCSS(r.j,t)),i.items=[],i.items.push(this.createItemModel(r.c,"Above",this.getLocale("above"),this.getIconCSS(r.k,t))),i.items.push(this.createItemModel(r.c,"Below",this.getLocale("below"),this.getIconCSS(r.l,t))),"ResourceView"!==this.parent.viewType&&i.items.push(this.createItemModel(r.c,"Child",this.getLocale("child"))),i.items.push(this.createItemModel(r.c,"Milestone",this.getLocale("milestone")));break;case"DeleteTask":i=this.createItemModel(r.c,e,this.getLocale("deleteTask"),this.getIconCSS(r.m,t));break;case"DeleteDependency":i=this.createItemModel(r.c,e,this.getLocale("deleteDependency")),i.items=[],i.items.push({});break;case"Convert":i=this.createItemModel(r.c,e,this.getLocale("convert")),i.items=[],i.items.push({});break;case"TaskMode":i=this.createItemModel(r.c,e,this.getLocale("changeScheduleMode")),i.items=[],i.items.push({});break;case"SplitTask":i=this.createItemModel(r.c,e,this.getLocale("splitTask"));break;case"MergeTask":i=this.createItemModel(r.c,e,this.getLocale("mergeTask")),i.items=[],i.items.push({})}i&&this.contentMenuItems.push(i)},e.prototype.getIconCSS=function(e,t){return i.i(a.isNullOrUndefined)(t)?e:t},e.prototype.getPredecessorsItems=function(){this.predecessors=this.parent.predecessorModule.getValidPredecessor(this.rowData);for(var e,t=[],i=0,n=0,a=this.predecessors;n<a.length;n++){var s=a[n],o=this.parent.getRecordByID(s.from),l=o.ganttProperties,d=l.rowUniqueID+" - "+l.taskName,h="Dependency"+i++;e=this.createItemModel(r.c,h,d),t.push(e)}return t},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","TaskInformation","DeleteTask","Save","Cancel","SortAscending","SortDescending","Add","DeleteDependency","Convert","TaskMode","Indent","Outdent","SplitTask","MergeTask"]},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("initiate-contextMenu",this.render),this.parent.off("reRender-contextMenu",this.reRenderContextMenu),this.parent.off("contextMenuClick",this.contextMenuItemClick),this.parent.off("contextMenuOpen",this.contextMenuOpen))},e.prototype.contextMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof o.ContextMenu&&this.revertItemStatus()},e.prototype.revertItemStatus=function(){this.contextMenu.showItems(this.hideItems),this.contextMenu.enableItems(this.disableItems),this.hideItems=[],this.disableItems=[],this.isOpen=!1},e.prototype.resetItems=function(){this.hideItems=[],this.disableItems=[],this.headerMenuItems=[],this.contentMenuItems=[],this.item=null},e.prototype.generateID=function(e){return this.ganttID+"_contextMenu_"+e},e.prototype.getKeyFromId=function(e){var t=this.ganttID+"_contextMenu_";return e.indexOf(t)>-1?e.replace(t,""):"Custom"},e.prototype.destroy=function(){this.contextMenu.destroy(),i.i(a.remove)(this.element),this.removeEventListener(),this.contextMenu=null,this.element=null},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(0),n=(i.n(r),i(3)),a=function(){function e(e){this.validatedids=[],this.resourceCollectionIds=[],this.criticalTasks=[],this.parent=e}return e.prototype.getCriticalTasks=function(){return this.criticalTasks},e.prototype.showCriticalPath=function(e){var t=this.parent.ids,i=this.parent.flatData;if(e&&this.parent.flatData.length>0){this.parent.enableCriticalPath=!0;var r=this.parent.treeGrid.parentData,n=r[0].ganttProperties.endDate,a=0,s=[],o=[],l=[],d=0,h=[],p=[],u=[],c=[],g=[],f=[];this.criticalTasks=[],r[0].ganttProperties.autoEndDate>r[0].ganttProperties.endDate&&!r[0].ganttProperties.isAutoSchedule&&(n=r[0].ganttProperties.autoEndDate),r[0].ganttProperties.taskId;for(var m=1;m<r.length;m++)r[m].ganttProperties.endDate>=n&&(n=r[m].ganttProperties.endDate,r[m].ganttProperties.taskId),r[m].ganttProperties.isAutoSchedule||r[m].ganttProperties.autoEndDate>=n&&(n=r[m].ganttProperties.autoEndDate,r[m].ganttProperties.taskId);this.maxEndDate=n;for(var y=0;y<i.length;y++)i[y].isCritical=!1,i[y].ganttProperties.isCritical=!1,a=this.parent.dataOperation.getDuration(i[y].ganttProperties.endDate,n,i[y].ganttProperties.durationUnit,i[y].ganttProperties.isAutoSchedule,i[y].ganttProperties.isMilestone),i[y].slack=a+" "+i[y].ganttProperties.durationUnit,i[y].ganttProperties.slack=a+" "+i[y].ganttProperties.durationUnit,i[y].ganttProperties.endDate>=n&&s.push(i[y].ganttProperties.taskId),i[y].ganttProperties.predecessor&&0!==i[y].ganttProperties.predecessor.length&&(o.push(i[y]),l.push(i[y].ganttProperties.taskId));if("ResourceView"===this.parent.viewType)for(var m=0;m<this.parent.taskIds.length;m++)this.resourceCollectionIds[m]=this.parent.taskIds[m].slice(1);for(var D=this,v=0;v<s.length;v++)!function(e){if(-1===l.indexOf(s[e])){if("ProjectView"===D.parent.viewType)d=t.indexOf(s[e].toString());else for(var r=D.parent.currentViewData.filter(function(t){return parseInt(t.ganttProperties.taskId)===s[e]}),n=0;n<r.length;n++)!r[n].hasChildRecords&&r[n].ganttProperties.endDate>=D.maxEndDate&&(d=r[n].index);i[d].ganttProperties.progress<100&&(i[d].isCritical=!0,i[d].ganttProperties.isCritical=!0),i[d].slack="0 "+i[d].ganttProperties.durationUnit,h.push(s[e])}else p.push(s[e])}(v);for(var w=o.length,k=[],b=0;b<w;b++){for(var T=-1,S=-1,P=-1,C=-1,M=void 0,R=b,x=o[b].ganttProperties.predecessor,O=o[b].ganttProperties.predecessor.length,I=o[b].ganttProperties.taskId,E=0;E<O;E++)M=isNaN(Number(x[E].from))||"string"==typeof I?(isNaN(Number(x[E].from)),x[E].from):parseInt(x[E].from,10),M===I&&(-1===T?x[E].offset?(T=x[E].to+":"+x[E].offset+x[E].offsetUnit,P=x[E].type):(T=x[E].to,P=x[E].type):x[E].offset?(T=T+","+x[E].to+":"+x[E].offset+x[E].offsetUnit,P=P+","+x[E].type):(T=T+","+x[E].to,P=P+","+x[E].type)),(M=isNaN(Number(x[E].to))||"string"==typeof I?(isNaN(Number(x[E].to)),x[E].to):parseInt(x[E].to,10))===I&&(-1===S?x[E].offset?(S=x[E].from+":"+x[E].offset+x[E].offsetUnit,C=x[E].type):(S=x[E].from,C=x[E].type):x[E].offset?(S=S+","+x[E].from+":"+x[E].offset+x[E].offsetUnit,C=C+","+x[E].type):(S=S+","+x[E].from,C=C+","+x[E].type));-1===S&&(S=null,C=null),-1===T&&(T=null,P=null),u.push({from:S,fromPredecessor:C,taskid:I,to:T,toPredecessor:P,currentIndex:R,slack:null,enddate:null}),c.push(I)}for(var F=u.length,N=0,U=void 0,V=0;V<F;V++)if(!u[V].to){U=u[V].taskid,N="ProjectView"===this.parent.viewType?t.indexOf(U.toString()):this.resourceCollectionIds.indexOf(U.toString());var L=i[N].ganttProperties;a=this.parent.dataOperation.getDuration(L.endDate,n,"minute",L.isAutoSchedule,L.isMilestone),u[V].slack=a,u[V].fs=-1,u[V].enddate=L.endDate,k.push({fromdata:u[V].from,todateID:u[V].taskid,fromDataPredecessor:u[V].fromPredecessor})}for(var v=0;v<k.length;v++)g.push(k[v]),this.slackCalculation(g,u,c,n,i,t);f=this.finalCriticalPath(u,h,i,t,n),this.validatedids=[],this.criticalPathCollection=f,this.detailPredecessorCollection=u,this.predecessorCollectionTaskIds=c}if(!1===e&&this.parent.flatData.length>0){var B=void 0;this.parent.enableCriticalPath=!1;for(var V=0;V<this.criticalPathCollection.length;V++)B=t.indexOf(this.criticalPathCollection[V].toString()),i[B].isCritical=!1;this.criticalPathCollection=[],this.detailPredecessorCollection=[],this.predecessorCollectionTaskIds=[]}},e.prototype.slackCalculation=function(e,t,n,a,s,o){var l=e[0].fromdata.split(","),d=e[0].fromDataPredecessor.split(",");n=n.toString(),n=n.split(",");for(var h,p,u,c,g,f,m,y,D=[],v=0;v<l.length;v++){D=l[v].split(":"),h=n.indexOf(D[0].toString()),c=n.indexOf(e[0].todateID.toString()),"ProjectView"===this.parent.viewType?(p=o.indexOf(D[0].toString()),u=o.indexOf(e[0].todateID.toString())):(p=this.resourceCollectionIds.indexOf(D[0].toString()),u=this.resourceCollectionIds.indexOf(e[0].todateID.toString()));var w=s[p].ganttProperties,k=s[u].ganttProperties;D.length>1&&(m=-1!==D[1].indexOf("hour")?60*parseFloat(D[1]):-1!==D[1].indexOf("day")?parseFloat(D[1])*(this.parent.secondsPerDay/3600)*60:parseFloat(D[1])),"FS"===d[v]&&(g=w.endDate>k.startDate?-this.parent.dataOperation.getDuration(k.startDate,w.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.parent.dataOperation.getDuration(w.endDate,k.startDate,"minute",w.isAutoSchedule,w.isMilestone),i.i(r.isNullOrUndefined)(t[h].slack)?D.length<=1&&(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g):t[h].slack>g&&0!==t[h].slack&&D.length<=1&&(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g),D.length>1&&(t[h].slack=t[c].slack+g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0)),t[h].fs=1,t[h].fsslack=t[h].slack,t[h].enddate=w.startDate,w.endDate>=a&&w.endDate<=a&&(t[h].slack=0)),"SS"===d[v]&&(w.isAutoSchedule?(g=w.startDate>k.startDate?-this.parent.dataOperation.getDuration(k.endDate,w.startDate,"minute",w.isAutoSchedule,w.isMilestone):this.parent.dataOperation.getDuration(w.startDate,k.startDate,"minute",w.isAutoSchedule,w.isMilestone),i.i(r.isNullOrUndefined)(t[h].slack)?D.length<=1&&(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g):t[h].slack>g&&0!==t[h].slack&&D.length<=1&&(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g),D.length>1&&(t[h].slack=t[c].slack+g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0)),t[h].fs=1,t[h].fsslack=t[h].slack,t[h].enddate=w.startDate):w.isAutoSchedule||(g=this.getSlackDuration(w.endDate,a,"minute",s[p]),i.i(r.isNullOrUndefined)(t[h].slack)?t[h].slack=g:t[h].slack>g&&0!==t[h].slack&&(t[h].slack=g)),w.endDate>=a&&w.endDate<=a&&(t[h].slack=0)),"FF"===d[v]&&(1!==t[c].fs&&1!==t[c].ff&&-1!==t[c].fs||(1!==t[c].fs&&1!==t[c].ff||(f=k.endDate,y=t[c].slack),-1===t[c].fs&&(f=t[c].enddate,y=t[c].slack),g=f>w.endDate?-this.getSlackDuration(w.endDate,f,"minute",s[p]):this.getSlackDuration(f,w.endDate,"minute",s[p]),i.i(r.isNullOrUndefined)(t[h].slack)?D.length<=1&&(t[h].slack=y-g<0?0:y-g):t[h].slack>g&&0!==t[h].slack&&D.length<=1&&(t[h].slack=y-g<0?0:y-g),D.length>1&&(t[h].slack=t[c].slack-g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0)),t[h].ff=1,t[h].enddate=f,t[h].fsslack=y),w.endDate>=a&&w.endDate<=a&&(t[h].slack=0)),"SF"===d[v]&&(w.isAutoSchedule?i.i(r.isNullOrUndefined)(t[h].slack)?(D.length<=1?i.i(r.isNullOrUndefined)(t[c].to)?(g=this.getSlackDuration(w.endDate,a,"minute",s[p]),t[h].slack=g):i.i(r.isNullOrUndefined)(t[c].to)||(g=k.endDate>w.startDate?-this.parent.dataOperation.getDuration(w.startDate,k.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.getSlackDuration(k.endDate,w.startDate,"minute",s[p]),t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g):D.length>1&&(g=k.endDate>=w.endDate?w.startDate>k.endDate?-this.getSlackDuration(k.endDate,w.startDate,"minute",s[p]):this.parent.dataOperation.getDuration(w.startDate,k.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.getSlackDuration(w.endDate,a,"minute",s[p]),t[h].slack=t[c].slack+g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0)),t[h].fs=1,t[h].fsslack=t[h].slack,t[h].enddate=w.startDate):(D.length<=1?(i.i(r.isNullOrUndefined)(t[c].to)?g=this.getSlackDuration(w.endDate,a,"minute",s[p]):i.i(r.isNullOrUndefined)(t[c].to)||(g=k.endDate>w.startDate?-this.parent.dataOperation.getDuration(w.startDate,k.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.getSlackDuration(k.endDate,w.startDate,"minute",s[p])),t[h].slack>g&&0!==t[h].slack&&(i.i(r.isNullOrUndefined)(t[c].to)?t[h].slack=g:i.i(r.isNullOrUndefined)(t[c].to)||(t[c].slack+g<0?t[h].slack=0:t[h].slack=t[c].slack+g))):D.length>1&&(g=k.endDate>w.endDate?w.startDate>k.endDate?-this.getSlackDuration(k.endDate,w.startDate,"minute",s[p]):this.parent.dataOperation.getDuration(w.startDate,k.endDate,"minute",w.isAutoSchedule,w.isMilestone):this.getSlackDuration(w.endDate,a,"minute",s[p]),t[h].slack>g&&0!==t[h].slack&&(t[h].slack=t[c].slack+g,t[h].slack=t[h].slack-m,t[h].slack<0&&(t[h].slack=0))),t[h].fs=1,t[h].fsslack=t[h].slack,t[h].enddate=w.startDate):w.isAutoSchedule||(g=this.getSlackDuration(w.endDate,a,"minute",s[p]),i.i(r.isNullOrUndefined)(t[h].slack)?t[h].slack=g:t[h].slack>g&&0!==t[h].slack&&(t[h].slack=g)),w.endDate>=a&&w.endDate<=a&&(t[h].slack=0)),t[h].from&&e.push({fromdata:t[h].from,todateID:t[h].taskid,fromDataPredecessor:t[h].fromPredecessor})}e&&(e.splice(0,1),e.length>0&&this.slackCalculation(e,t,n,a,s,o))},e.prototype.getSlackDuration=function(e,t,i,r){var n=this.parent.dateValidationModule.checkStartDate(new Date(e)),a=this.parent.dateValidationModule.checkEndDate(new Date(t));return this.parent.dataOperation.getTimeDifference(n,a,!0)<=0?0:this.parent.dataOperation.getDuration(n,a,i,r.ganttProperties.isAutoSchedule,!0)},e.prototype.updateCriticalTasks=function(e,t){for(var i=0;i<e.ganttProperties.predecessor.length;i++){var r=void 0;if("ProjectView"===this.parent.viewType)r=this.parent.getRecordByID(e.ganttProperties.predecessor[i].from);else{var n=this.resourceCollectionIds.indexOf(e.ganttProperties.predecessor[i].from.toString());r=this.parent.flatData[n]}var a=void 0;e.ganttProperties.endDate.getTime()>=this.maxEndDate.getTime()&&(e.ganttProperties.slack=e.slack="0 "+e.ganttProperties.durationUnit,e.ganttProperties.progress<100&&(e.isCritical=!0,e.ganttProperties.isCritical=!0,-1==t.indexOf(parseInt(e.ganttProperties.taskId))&&t.push(parseInt(e.ganttProperties.taskId)))),r&&("FS"==e.ganttProperties.predecessor[i].type?a=this.parent.dataOperation.getDuration(r.ganttProperties.endDate,e.ganttProperties.startDate,r.ganttProperties.durationUnit,r.ganttProperties.isAutoSchedule,!0):"SS"==e.ganttProperties.predecessor[i].type?a=this.parent.dataOperation.getDuration(r.ganttProperties.startDate,e.ganttProperties.startDate,r.ganttProperties.durationUnit,r.ganttProperties.isAutoSchedule,!0):"FF"==e.ganttProperties.predecessor[i].type?a=this.parent.dataOperation.getDuration(r.ganttProperties.endDate,e.ganttProperties.endDate,r.ganttProperties.durationUnit,r.ganttProperties.isAutoSchedule,!0):"SF"==e.ganttProperties.predecessor[i].type&&(a=this.parent.dataOperation.getDuration(e.ganttProperties.endDate,r.ganttProperties.startDate,r.ganttProperties.durationUnit,r.ganttProperties.isAutoSchedule,!0)),0==a&&-1==this.validatedids.indexOf(parseInt(r.ganttProperties.taskId))&&r.ganttProperties.taskId!=e.ganttProperties.taskId&&(r.ganttProperties.slack=e.ganttProperties.slack,r.slack=e.slack,r.isCritical=e.ganttProperties.isCritical,r.ganttProperties.isCritical=e.ganttProperties.isCritical,-1==t.indexOf(parseInt(r.ganttProperties.taskId))&&r.ganttProperties.isCritical&&r.ganttProperties.progress<100&&(this.validatedids.push(parseInt(r.ganttProperties.taskId)),t.push(parseInt(r.ganttProperties.taskId))),r.ganttProperties.predecessorsName&&this.updateCriticalTasks(r,t)))}},e.prototype.finalCriticalPath=function(e,t,i,r,n){for(var a,s,o=[],l=e.length-1;l>=0;l--){a="ProjectView"===this.parent.viewType?r.indexOf(e[l].taskid.toString()):this.resourceCollectionIds.indexOf(e[l].taskid.toString());for(var d=i[a].ganttProperties.predecessor,h="0 "+i[a].ganttProperties.durationUnit,p=d.length-1;p>=0;p--){var u=void 0;u="ProjectView"===this.parent.viewType?this.parent.ids.indexOf(d[p].to):this.resourceCollectionIds.indexOf(d[p].to);var c=void 0,g=i[a].ganttProperties;"FS"===d[p].type?(d[p].to!=g.taskId.toString()||"ResourceView"===this.parent.viewType?c=this.parent.dataOperation.getDuration(g.endDate,i[u].ganttProperties.startDate,g.durationUnit,g.isAutoSchedule,g.isMilestone):(u=this.parent.ids.indexOf(d[p].from),0===(c=this.parent.dataOperation.getDuration(i[u].ganttProperties.endDate,g.startDate,g.durationUnit,g.isAutoSchedule,g.isMilestone))&&a!==u&&i[a].slack==h&&(i[u].slack=i[a].slack,i[u].ganttProperties.slack=i[a].slack)),0===c&&a!==u&&i[a].slack!==h?(i[a].slack=i[u].slack,i[a].ganttProperties.slack=i[u].slack):0!==c&&a!==u&&i[u].isCritical&&(i[a].slack=c+" "+i[a].ganttProperties.durationUnit,i[a].ganttProperties.slack=c+" "+i[a].ganttProperties.durationUnit)):c="SF"===d[p].type?this.parent.dataOperation.getDuration(g.startDate,i[u].ganttProperties.endDate,g.durationUnit,g.isAutoSchedule,g.isMilestone):"SS"===d[p].type?this.parent.dataOperation.getDuration(g.startDate,i[u].ganttProperties.startDate,g.durationUnit,g.isAutoSchedule,g.isMilestone):this.parent.dataOperation.getDuration(g.endDate,i[u].ganttProperties.endDate,g.durationUnit,g.isAutoSchedule,g.isMilestone),s="number"==typeof i[a][this.parent.taskFields.id]?parseInt(d[p].from,10):d[p].from,s===i[a][this.parent.taskFields.id]&&i[u].slack===h&&c<=0&&(i[a].slack=h,i[a].ganttProperties.slack=h)}i[a].slack===h&&i[a].ganttProperties.progress<100&&(i[a].isCritical=!0,i[a].ganttProperties.isCritical=!0,this.criticalTasks.push(i[a]),-1===o.indexOf(e[l].taskid)&&o.push(e[l].taskid)),i[a].ganttProperties.predecessor.length>0&&this.updateCriticalTasks(i[a],o)}if(t.length>0)for(var p=0;p<t.length;p++)-1!==(a="ProjectView"===this.parent.viewType?r.indexOf(t[p].toString()):this.resourceCollectionIds.indexOf(t[p].toString()))&&i[a].ganttProperties.progress<100&&(this.criticalTasks.push(i[a]),-1===o.indexOf(t[p])&&(o=o.concat(t[p])));return o},e.prototype.criticalConnectorLine=function(e,t,a,s){this.parent.ganttChartModule.chartElement;this.parent.removeCriticalPathStyles();for(var o=this,l=0;l<e.length;l++)!function(t){var a;if("ProjectView"===o.parent.viewType)a=o.parent.flatData[o.parent.ids.indexOf(e[t].toString())];else for(var s=o.parent.flatData.filter(function(i){return i.ganttProperties.taskId.toString()===e[t].toString()}),l=0;l<s.length;l++)(s[l].ganttProperties.isCritical||s[l].ganttProperties.endDate>=o.maxEndDate)&&(a=s[l]);var d=o.parent.currentViewData.indexOf(a),h=o.parent.getRowByIndex(d),p=void 0,u=o.parent.taskFields;if(a&&a.parentItem){var c=o.parent.currentViewData.filter(function(e){return a.parentItem.uniqueID===e.uniqueID}),g=o.parent.flatData.indexOf(c[0]),f=o.parent.getRowByIndex(g);if(f)for(var m=f.querySelectorAll(".e-taskbar-main-container"),y=0;y<m.length;y++)m[y].getAttribute("rowuniqueid")===a.rowUniqueID&&i.i(r.addClass)(m[y].querySelectorAll(".e-gantt-child-taskbar-inner-div"),n.n)}p=o.parent.allowUnscheduledTasks&&a&&!a[u.startDate]&&!a[u.endDate]&&a[u.duration]?n.o:n.p,h&&("ProjectView"===o.parent.viewType||"ResourceView"===o.parent.viewType&&!a.hasChildRecords)&&(h.getElementsByClassName("e-gantt-milestone")[0]&&i.i(r.addClass)(h.querySelectorAll(".e-gantt-milestone"),n.q),h.getElementsByClassName("e-gantt-child-taskbar-inner-div").length>0&&i.i(r.addClass)(h.querySelectorAll(".e-gantt-child-taskbar-inner-div"),n.n),h.getElementsByClassName("e-gantt-child-progressbar-inner-div").length>0&&i.i(r.addClass)(h.querySelectorAll(".e-gantt-child-progressbar-inner-div"),p))}(l);if(0!==t.length)for(var d=0,h=void 0,p=[],u=void 0,c=void 0,l=0;l<this.criticalPathCollection.length;l++)if(d=s.indexOf(this.criticalPathCollection[l]),h=t[d],-1!==d&&h.to){p=h.to.split(",");for(var g=0;g<p.length;g++)if(c=p[g].split("+"),"+",p[g].indexOf("-")>=0&&(c=p[g].split("-"),"-"),u=c[0].replace(":",""),"number"==typeof e[g]&&(u=parseInt(c[0],10)),-1!==e.indexOf(u)){var f=this.parent.element.querySelectorAll("#ConnectorLineparent"+h.taskid+"child"+u);f.length>0&&(i.i(r.addClass)(this.parent.element.querySelectorAll("#ConnectorLineparent"+h.taskid+"child"+u)[0].querySelectorAll(".e-connector-line"),n.r),i.i(r.addClass)(this.parent.element.querySelectorAll("#ConnectorLineparent"+h.taskid+"child"+u)[0].querySelectorAll(".e-connector-line-arrow"),n.s))}}},e.prototype.getModuleName=function(){return"criticalPath"},e.prototype.destroy=function(){!this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(this.parent.criticalPathModule=void 0)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(81),n=i(80),a=i(0),s=(i.n(a),function(){function e(e){this.parent=e,this.nonworkingDayRender=new r.a(this.parent),this.eventMarkerRender=new n.a(this.parent),this.wireEvents()}return e.prototype.wireEvents=function(){this.parent.on("refreshDayMarkers",this.refreshMarkers,this),this.parent.on("updateHeight",this.updateHeight,this),this.parent.on("ui-update",this.propertyChanged,this)},e.prototype.propertyChanged=function(e){for(var t=Object.keys(i.i(a.getValue)("properties",e)),r=0;r<t.length;r++){switch(t[r]){case"eventMarkers":this.eventMarkerRender.renderEventMarkers(),this.updateHeight();break;case"highlightWeekends":this.nonworkingDayRender.renderWeekends(),this.updateHeight();break;case"holidays":this.nonworkingDayRender.renderHolidays(),this.updateHeight()}}},e.prototype.refreshMarkers=function(){this.nonworkingDayRender.renderWeekends(),this.nonworkingDayRender.renderHolidays(),"Vertical"!==this.parent.gridLines&&"Both"!==this.parent.gridLines||this.parent.renderChartVerticalLines(),this.eventMarkerRender.renderEventMarkers()},e.prototype.updateHeight=function(){this.nonworkingDayRender.updateContainerHeight(),this.eventMarkerRender.updateContainerHeight()},e.prototype.getModuleName=function(){return"dayMarkers"},e.prototype.destroy=function(){this.parent.isDestroyed||(this.nonworkingDayRender.removeContainers(),this.eventMarkerRender.removeContainer(),this.parent.off("refreshDayMarkers",this.refreshMarkers),this.parent.off("updateHeight",this.updateHeight),this.parent.off("ui-update",this.propertyChanged))},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return f});var r=i(0),n=(i.n(r),i(4)),a=(i.n(n),i(9)),s=(i.n(a),i(13)),o=(i.n(s),i(5)),l=(i.n(o),i(88)),d=(i.n(l),i(12)),h=(i.n(d),i(86)),p=(i.n(h),i(20)),u=(i.n(p),i(21)),c=(i.n(u),i(1)),g=i(6),f=(i.n(g),function(){function e(e){this.updatedEditFields=null,this.updatedAddFields=null,this.addedRecord=null,this.dialogEditValidationFlag=!1,this.ganttResources=[],this.isValidData=!0,this.previousResource=[],this.isResourceUpdate=!1,this.parent=e,this.localeObj=this.parent.localeObj,this.beforeOpenArgs={cancel:!1},this.types=this.getPredecessorType(),this.rowData={},this.editedRecord={},this.inputs={booleanedit:h.CheckBox,dropdownedit:u.DropDownList,datepickeredit:p.DatePicker,datetimepickeredit:p.DateTimePicker,maskededit:d.MaskedTextBox,numericedit:d.NumericTextBox,stringedit:d.TextBox,defaultedit:d.TextBox},this.processDialogFields(),this.wireEvents()}return e.prototype.wireEvents=function(){this.parent.on("chartDblClick",this.dblClickHandler,this)},e.prototype.dblClickHandler=function(e){var t=this.parent.ganttChartModule.getRecordByTarget(e);!i.i(r.isNullOrUndefined)(t)&&this.parent.editModule&&this.parent.editSettings.allowEditing&&this.openEditDialog(t)},e.prototype.processDialogFields=function(){i.i(r.isNullOrUndefined)(this.parent.editDialogFields)||this.parent.editDialogFields&&0===this.parent.editDialogFields.length?(this.updatedEditFields=this.getDefaultDialogFields(),this.updatedEditFields=this.validateDialogFields(this.updatedEditFields)):this.updatedEditFields=this.validateDialogFields(this.parent.editDialogFields),i.i(r.isNullOrUndefined)(this.parent.addDialogFields)||this.parent.addDialogFields&&0===this.parent.addDialogFields.length?(this.updatedAddFields=this.getDefaultDialogFields(),this.updatedAddFields=this.validateDialogFields(this.updatedAddFields)):this.updatedAddFields=this.validateDialogFields(this.parent.addDialogFields)},e.prototype.validateDialogFields=function(e){for(var t=[],n=0,a=0;a<e.length;a++){var s=i.i(o.getActualProperties)(e[a]);"General"!==s.type||!i.i(r.isNullOrUndefined)(s.fields)&&0!==s.fields.length||(s.fields=this.getGeneralColumnFields()),"Dependency"===s.type&&i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)||"Resources"===s.type&&i.i(r.isNullOrUndefined)(this.parent.taskFields.resourceInfo)||"Notes"===s.type&&i.i(r.isNullOrUndefined)(this.parent.taskFields.notes)||("Custom"!==s.type||!i.i(r.isNullOrUndefined)(s.fields)&&0!==s.fields.length||(n+=1,s.fields=this.getCustomColumnFields()),n>1||t.push(s))}return t},e.prototype.getGeneralColumnFields=function(){for(var e=[],t=0,i=Object.keys(this.parent.columnMapping);t<i.length;t++){var r=i[t];"dependency"!==r&&"resourceInfo"!==r&&"notes"!==r&&e.push(this.parent.columnMapping[r])}return e},e.prototype.getCustomColumnFields=function(){for(var e=[],t=0;t<this.parent.customColumns.length;t++)e.push(this.parent.customColumns[t]);return e},e.prototype.getDefaultDialogFields=function(){var e=[],t={},n=this.parent.taskFields,a=this.parent.columnMapping;return 0!==Object.keys(a).length&&(t.type="General",e.push(t)),i.i(r.isNullOrUndefined)(i.i(r.getValue)("dependency",a))||(t={},!1!==this.parent.columnByField[a.dependency.valueOf()].visible&&(t.type="Dependency"),e.push(t)),i.i(r.isNullOrUndefined)(i.i(r.getValue)("resourceInfo",a))||(t={},!1!==this.parent.columnByField[a.resourceInfo.valueOf()].visible&&(t.type="Resources"),e.push(t)),i.i(r.isNullOrUndefined)(i.i(r.getValue)("notes",a))||(t={},!1!==this.parent.columnByField[a.notes.valueOf()].visible&&(t.type="Notes"),e.push(t)),i.i(r.isNullOrUndefined)(i.i(r.getValue)("segments",n))||(t={},t.type="Segments",e.push(t)),this.parent.customColumns.length>0&&(t={},t.type="Custom",e.push(t)),e},e.prototype.openAddDialog=function(){this.isEdit=!1,this.editedRecord=this.composeAddRecord(),this.createDialog()},e.prototype.getMinimumStartDate=function(){var e=n.DataUtil.aggregates.min(this.parent.flatData,"ganttProperties.startDate");return e=i.i(r.isNullOrUndefined)(e)?new Date(this.parent.timelineModule.timelineStartDate.getTime()):new Date(e.getTime()),e=this.parent.dateValidationModule.checkStartDate(e),new Date(e.getTime())},e.prototype.composeAddRecord=function(){var e={};e.ganttProperties={};for(var t=this.parent.ganttColumns,n=this.parent.taskFields,a=this.parent.editModule.getNewTaskId(),s=0;s<t.length;s++){var o=t[s].field;o===n.id?(e[o]=a,e.ganttProperties.rowUniqueID=e[o]):t[s].field===n.startDate?(i.i(r.isNullOrUndefined)(e[n.endDate])?e[o]=this.getMinimumStartDate():e[o]=new Date(e[n.endDate]),this.parent.timezone&&(e[o]=this.parent.dateValidationModule.remove(e[o],this.parent.timezone)),e.ganttProperties.startDate=new Date(e[o])):t[s].field===n.endDate?(i.i(r.isNullOrUndefined)(e[n.startDate])?e[o]=this.getMinimumStartDate():e[o]=new Date(e[n.startDate]),this.parent.timezone&&(e[o]=this.parent.dateValidationModule.remove(e[o],this.parent.timezone)),e.ganttProperties.endDate=new Date(e[o])):t[s].field===n.duration?(e[o]=1,e.ganttProperties.duration=e[o],e.ganttProperties.durationUnit=this.parent.durationUnit.toLocaleLowerCase()):t[s].field===n.name?(e[o]=this.localeObj.getConstant("addDialogTitle")+" "+a,e.ganttProperties.taskName=e[o]):t[s].field===n.progress?(e[o]=0,e.ganttProperties.progress=e[o]):t[s].field===n.work?(e[o]=0,e.ganttProperties.work=e[o]):t[s].field===n.type?(e[o]=this.parent.taskType,e.ganttProperties.taskType=e[o]):e[this.parent.ganttColumns[s].field]=""}return e.ganttProperties.isAutoSchedule="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[n.manual],e},e.prototype.openToolbarEditDialog=function(){var e=this.parent;if(e.editModule&&e.editSettings.allowEditing){this.parent.ganttChartModule.focusedRowIndex>-1&&e.selectionModule&&e.selectionModule.selectRow(this.parent.ganttChartModule.focusedRowIndex,!1,!1);var t=e.selectionModule?"Row"!==e.selectionSettings.mode&&"Both"!==e.selectionSettings.mode||1!==e.selectionModule.selectedRowIndexes.length?"Cell"===e.selectionSettings.mode&&1===e.selectionModule.getSelectedRowCellIndexes().length?e.updatedRecords[e.selectionModule.getSelectedRowCellIndexes()[0].rowIndex].ganttProperties.rowUniqueID:null:e.updatedRecords[e.selectionModule.selectedRowIndexes[0]].ganttProperties.rowUniqueID:null;i.i(r.isNullOrUndefined)(t)||this.openEditDialog(t)}},e.prototype.openEditDialog=function(e){var t=this.parent;i.i(r.isNullOrUndefined)(e)||(i.i(r.isNullOrUndefined)(e.ganttProperties)||("string"==typeof e.ganttProperties.taskId?this.numericOrString="stringedit":this.numericOrString="numericedit"),i.i(r.isNullOrUndefined)(e.ganttProperties)&&!i.i(r.isNullOrUndefined)(e)&&(isNaN(Number(e))||"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?this.numericOrString="stringedit":this.numericOrString="numericedit")),"object"!=typeof e||i.i(r.isNullOrUndefined)(e)?i.i(r.isNullOrUndefined)(e)?t.selectedRowIndex>-1&&(this.rowData=t.currentViewData[t.selectedRowIndex],this.rowIndex=t.selectedRowIndex):(this.rowIndex=t.ids.indexOf(e.toString()),this.rowIndex>-1&&(this.rowData=t.flatData[this.rowIndex])):(this.rowIndex=this.parent.currentViewData.indexOf(e),this.rowIndex>-1&&(this.rowData=e)),this.isEdit=!0,"ResourceView"===this.parent.viewType&&0===this.rowData.level||0!==Object.keys(this.rowData).length&&(this.editedRecord=i.i(r.extend)({},{},this.rowData,!0),this.createDialog())},e.prototype.createDialog=function(){var e=this,t=this.parent,n={};this.beforeOpenArgs.dialogModel=n,this.beforeOpenArgs.rowData=this.editedRecord,this.beforeOpenArgs.rowIndex=this.rowIndex;var a=this.parent.isAdaptive?"":"600px",s=this.parent.createElement("div",{id:t.element.id+"_dialog",styles:"max-width:"+a});s.classList.add("e-gantt-dialog"),t.element.appendChild(s),n.animationSettings={effect:"None"},n.header=this.localeObj.getConstant(this.isEdit?"editDialogTitle":"addDialogTitle"),n.isModal=!0,n.enableRtl=this.parent.enableRtl,n.allowDragging=!this.parent.isAdaptive,n.showCloseIcon=!0;var o=this.parent.isAdaptive?{X:"top",Y:"left"}:{X:"center",Y:"center"};n.position=o,n.height=this.parent.isAdaptive?"100%":"auto",n.target=document.body,n.close=this.dialogClose.bind(this),n.closeOnEscape=!0,n.beforeClose=function(e){"escape"===e.closedBy&&"key-pressed"===e.event.name&&"INPUT"===e.event.target.nodeName&&(e.cancel=!0)},n.open=function(t){var n=i.i(r.getValue)("element",t),a=n.querySelector("#"+e.parent.element.id+"GeneralTabContainer");a&&a.scrollHeight>a.offsetHeight&&a.classList.add("e-scroll"),0===e.tabObj.selectedItem&&e.tabObj.select(0),e.parent.isAdaptive&&(n.style.maxHeight="none"),e.parent.focusModule&&e.parent.focusModule.setActiveElement(n)},n.locale=this.parent.locale,n.buttons=[{buttonModel:{content:this.localeObj.getConstant("saveButton"),cssClass:"e-primary"},click:this.buttonClick.bind(this)},{buttonModel:{cssClass:"e-flat",content:this.localeObj.getConstant("cancel")},click:this.buttonClick.bind(this)}],this.createTab(n,s)},e.prototype.buttonClick=function(e){var t=e.target;t.style.pointerEvents="none",this.localeObj.getConstant("cancel").toLowerCase()===e.target.innerText.trim().toLowerCase()?this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.hide(),this.dialogClose()):(this.initiateDialogSave(),t.style.pointerEvents="auto")},e.prototype.dialogClose=function(){this.dialog&&this.resetValues(),i.i(r.isNullOrUndefined)(this.parent.focusModule)||i.i(r.isNullOrUndefined)(this.parent.focusModule.getActiveElement(!0))||this.parent.focusModule.getActiveElement(!0).focus()},e.prototype.resetValues=function(){this.isEdit=!1,this.isAddNewResource=!1,this.editedRecord={},this.rowData={},this.rowIndex=-1,this.addedRecord=null,this.ganttResources=[],this.dialogEditValidationFlag=!1,this.dialog&&!this.dialogObj.isDestroyed&&(this.destroyDialogInnerElements(),this.dialogObj.destroy(),i.i(r.remove)(this.dialog))},e.prototype.destroyDialogInnerElements=function(){for(var e=this.parent,t=this.beforeOpenArgs.tabModel,n=t.items,a=0;a<n.length;a++){var s=n[a].content,o=s.id;if(!i.i(r.isNullOrUndefined)(o)||""!==o)if(o=o.replace(e.element.id,""),"General"===(o=o.replace("TabContainer","")))this.destroyCustomField(s);else if("Dependency"===o){var l=s.ej2_instances[0];l.destroy()}else if("Notes"===o){var d=s.ej2_instances[0];d.destroy()}else if("Resources"===o){var h=s.ej2_instances[0];h.destroy()}else-1!==o.indexOf("Custom")&&this.destroyCustomField(s)}},e.prototype.destroyCustomField=function(e){for(var t=e.childNodes,n=this.parent,a=0;a<t.length;a++){var s=t[a],l=s.querySelector('input[id^="'+n.element.id+'"]');if(l){var d=l.id.replace(n.element.id,""),h=s.querySelector("#"+n.element.id+d).ej2_instances[0];if(!i.i(r.isNullOrUndefined)(h)){var p=n.columnByField[d];if(!i.i(r.isNullOrUndefined)(p.edit)&&i.i(r.isNullOrUndefined)(p.edit.params)){var u=p.edit.destroy;"string"==typeof u?(u=i.i(o.getObject)(u,window))():p.edit.destroy()}else h.destroy()}}}},e.prototype.destroy=function(){this.resetValues(),this.parent.isDestroyed||(this.parent.off("chartDblClick",this.dblClickHandler),this.parent.editModule.dialogModule=void 0)},e.prototype.getEditFields=function(){return this.isEdit?this.updatedEditFields:this.updatedAddFields},e.prototype.createTab=function(e,t){var n,o=this,l=this.parent,d={},h=[],p=this.getEditFields(),u=l.taskFields,c=p.length;d.items=h,d.locale=this.parent.locale,d.enableRtl=this.parent.enableRtl,this.beforeOpenArgs.tabModel=d;var g=0,f=0;if(c>0)for(var m=0;m<c;m++){var y=p[m],D={};if("General"===y.type){if(0===Object.keys(l.columnMapping).length)continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("generalTab")),D.content="General",this.beforeOpenArgs[D.content]=this.getFieldsModel(y.fields)}else if("Segments"===y.type){if(i.i(r.isNullOrUndefined)(u.segments))continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("segments")),D.content="Segments",this.beforeOpenArgs[D.content]=this.getSegmentsModel(y.fields)}else if("Dependency"===y.type){if(i.i(r.isNullOrUndefined)(u.dependency))continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("dependency")),D.content="Dependency",this.beforeOpenArgs[D.content]=this.getPredecessorModel(y.fields)}else if("Resources"===y.type){if(i.i(r.isNullOrUndefined)(u.resourceInfo))continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("resourceName")),D.content="Resources",this.beforeOpenArgs[D.content]=this.getResourcesModel(y.fields)}else if("Notes"===y.type){if(i.i(r.isNullOrUndefined)(u.notes))continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("notes")),D.content="Notes",this.beforeOpenArgs[D.content]=this.getNotesModel(y.fields)}else{if(i.i(r.isNullOrUndefined)(y.fields)||0===y.fields.length)continue;i.i(r.isNullOrUndefined)(y.headerText)&&(y.headerText=this.localeObj.getConstant("customTab"),g++),D.content="Custom"+f++,this.beforeOpenArgs[D.content]=this.getFieldsModel(y.fields)}D.header={text:y.headerText},h.push(D)}this.beforeOpenArgs.requestType=this.isEdit?"beforeOpenEditDialog":"beforeOpenAddDialog";this.beforeOpenArgs.rowData,this.beforeOpenArgs.name,this.beforeOpenArgs.requestType,this.beforeOpenArgs.cancel;this.parent.trigger("actionBegin",this.beforeOpenArgs,function(h){if(i.i(r.isNullOrUndefined)(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.showSpinner():o.parent.showMaskRow(),o.renderTabItems(),!h.cancel){d.selected=o.tabSelectedEvent.bind(o),d.height=o.parent.isAdaptive?"100%":"auto",d.overflowMode="Scrollable",o.tabObj=new s.Tab(d),o.tabObj.isStringTemplate=!0,n=o.parent.createElement("div",{id:l.element.id+"_Tab"}),o.tabObj.appendTo(n),e.content=n,o.dialog=t,o.dialogObj=new a.Dialog(e),o.dialogObj.isStringTemplate=!0,o.dialogObj.appendTo(o.dialog);var p={action:"OpenDialog",requestType:o.isEdit?"openEditDialog":"openAddDialog",data:o.beforeOpenArgs.rowData,element:o.dialog,cancel:!1};o.parent.trigger("actionComplete",p,function(e){i.i(r.isNullOrUndefined)(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.hideSpinner():o.parent.hideMaskRow(),e.cancel&&o.resetValues()})}})},e.prototype.tabSelectedEvent=function(e){var t=this.parent,n=e.selectedContent.childNodes[0].id;if(this.parent.isAdaptive&&this.responsiveTabContent(n,t),n===t.element.id+"ResourcesTabContainer")this.resourceSelection(n);else if(n===t.element.id+"NotesTabContainer"){document.getElementById(n).ej2_instances[0].refresh();var a=document.querySelector("#"+this.parent.element.id+"NotesTabContainer");a.style.overflow="scroll"}else n===t.element.id+"SegmentsTabContainer"&&(i.i(r.isNullOrUndefined)(this.beforeOpenArgs.rowData.ganttProperties.startDate)?document.getElementById(n).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!1):document.getElementById(n).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!0))},e.prototype.responsiveTabContent=function(e,t){var i=document.getElementById(t.element.id+"_dialog_dialog-content"),r=i.clientHeight;r-=i.querySelector(".e-tab-header").offsetHeight;var n=document.querySelector("#"+e);if(n.classList.contains("e-grid")){r-=n.ej2_instances[0].getHeaderContent().offsetHeight;var a=n.querySelector(".e-toolbar");a&&(r-=a.offsetHeight)}n.parentElement.style.height=r+"px"},e.prototype.getFieldsModel=function(e){for(var t={},n=this.parent.columnByField,a=0;a<e.length;a++)if(e[a]!==this.parent.taskFields.dependency&&e[a]!==this.parent.taskFields.resourceInfo&&e[a]!==this.parent.taskFields.notes&&!i.i(r.isNullOrUndefined)(n[e[a]])){var s=e[a];this.createInputModel(n[s],t)}return t},e.prototype.createInputModel=function(e,t){var n=this,a=this.parent,s=this.parent.locale,o=this.parent.taskFields,l={placeholder:e.headerText,floatLabelType:"Auto"};switch(i.i(r.isNullOrUndefined)(this.parent.taskFields.id)||i.i(r.isNullOrUndefined)(this.parent.columnMapping.id)||i.i(r.isNullOrUndefined)(this.numericOrString)||o.id===e.field&&(e.editType=this.numericOrString),e.editType){case"booleanedit":var d={label:e.headerText,locale:s,enableRtl:this.parent.enableRtl};t[e.field]=d;break;case"defaultedit":case"stringedit":var h=l;h.enableRtl=this.parent.enableRtl,e.field!==a.columnMapping.duration&&e.field!==a.columnMapping.id&&e.field!==a.columnMapping.startDate&&e.field!==a.columnMapping.endDate||(h.change=function(t){n.validateScheduleFields(t,e,a)}),t[e.field]=l;break;case"numericedit":var p=l;p.enableRtl=this.parent.enableRtl,o.progress===e.field&&(p.min=0,p.max=100),o.work===e.field&&(p.change=function(t){n.validateScheduleFields(t,e,a)}),t[e.field]=p;break;case"datepickeredit":var u=l;u.format=this.parent.getDateFormat(),u.enableRtl=this.parent.enableRtl,u.strictMode=!0,u.firstDayOfWeek=a.timelineModule.customTimelineSettings.weekStartDay,e.field!==a.columnMapping.startDate&&e.field!==a.columnMapping.endDate||(u.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),u.change=function(t){n.validateScheduleFields(t,e,a)}),t[e.field]=u;break;case"datetimepickeredit":var c=l;c.format=this.parent.getDateFormat(),c.enableRtl=this.parent.enableRtl,c.strictMode=!0,c.firstDayOfWeek=a.timelineModule.customTimelineSettings.weekStartDay,e.field!==a.columnMapping.startDate&&e.field!==a.columnMapping.endDate||(c.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),c.change=function(t){n.validateScheduleFields(t,e,a)}),t[e.field]=c;break;case"dropdownedit":if(e.field===a.columnMapping.type||e.field===a.columnMapping.manual){var g=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];l.dataSource=g,l.fields={value:"Value"};var f=l;f.enableRtl=this.parent.enableRtl,f.change=function(t){e.field===o.manual&&(n.editedRecord.ganttProperties.isAutoSchedule=!t.value),n.validateScheduleFields(t,e,a)}}t[e.field]=l;break;case"maskededit":t[e.field]=l}return i.i(r.isNullOrUndefined)(e.edit)||i.i(r.isNullOrUndefined)(e.edit.params)||i.i(r.extend)(t[e.field],e.edit.params),t},e.prototype.validateScheduleFields=function(e,t,n){var a,s;i.i(r.isNullOrUndefined)(n.editModule.dialogModule.dialog)||(s=n.editModule.dialogModule.dialog);var o,l=null,h=n.editModule.dialogModule.editedRecord,p=null,u=null,c="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,g=this.parent.viewType;if(i.i(r.isNullOrUndefined)(e.element)?i.i(r.isNullOrUndefined)(e.container)?i.i(r.isNullOrUndefined)(e.event)||i.i(r.isNullOrUndefined)(e.event.path)||i.i(r.isNullOrUndefined)(e.event.path)[1]||(o=e.event.path[1],l=o.querySelector("input").getAttribute("id"),o=o.querySelector("#"+l)):(o=e.container,l=o.querySelector("input").getAttribute("id"),o=o.querySelector("#"+l)):(o=e.element,l=o.getAttribute("id")),i.i(r.isNullOrUndefined)(o))p=e.value,u=t.field;else if(p=o.value,u=l.replace(n.element.id,""),"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType){var f=function(e){return"ResourceView"===g?-1===c.indexOf("T"+e.value)&&-1===c.indexOf("R"+e.value):-1===c.indexOf(e.value)},m={rules:(a={},a[this.parent.taskFields.id]={required:!0,minLength:[f,"ID is already present, please enter new value"]},a)};new d.FormValidator("#"+this.parent.element.id+"GeneralTabContainer",m)}if(0===u.search("Segments"))return u=u.replace("SegmentsTabContainer",""),this.validateSegmentFields(n,u,p,e),!0;this.validateScheduleValuesByCurrentField(u,p,this.editedRecord);var y=h.ganttProperties,D=n.taskFields;return i.i(r.isNullOrUndefined)(D.startDate)||D.startDate===u||this.updateScheduleFields(s,y,"startDate"),D.endDate===u&&!i.i(r.isNullOrUndefined)(y.startDate)&&!i.i(r.isNullOrUndefined)(e.value)&&y.startDate.getTime()>e.value&&this.updateScheduleFields(s,y,"endDate"),i.i(r.isNullOrUndefined)(D.endDate)||D.endDate===u||this.updateScheduleFields(s,y,"endDate"),(!i.i(r.isNullOrUndefined)(D.duration)&&D.duration!==u||y.duration>=0)&&this.updateScheduleFields(s,y,"duration"),i.i(r.isNullOrUndefined)(D.work)||D.work===u||this.updateScheduleFields(s,y,"work"),this.dialogEditValidationFlag=!1,!0},e.prototype.updateScheduleFields=function(e,t,n){var a,s=this.parent,o=s.element.id,l=i.i(r.getValue)(n,s.columnMapping),d=s.columnByField[l],h=this.parent.taskFields;if("stringedit"===d.editType){var p=e.querySelector("#"+o+l).ej2_instances[0];a=i.i(r.isNullOrUndefined)(d.edit)||i.i(r.isNullOrUndefined)(d.edit.read)?i.i(r.isNullOrUndefined)(d.valueAccessor)?this.parent.dataOperation.getDurationString(t.duration,t.durationUnit):d.valueAccessor(l,s.editModule.dialogModule.editedRecord,d):d.edit.read(),p.value!==a.toString()&&h.duration===l?(p.value=a,p.dataBind()):h.startDate!==l&&h.endDate!==l||(p.value=h.startDate===l?t.startDate.toString():t.endDate.toString(),p.dataBind())}else if("datepickeredit"===d.editType||"datetimepickeredit"===d.editType){var u=(d.editType,e.querySelector("#"+o+l).ej2_instances[0]);a=t[n],(i.i(r.isNullOrUndefined)(u.value)&&!i.i(r.isNullOrUndefined)(a)||i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(u.value)||u.value!==a&&!i.i(r.isNullOrUndefined)(u.value)&&!i.i(r.isNullOrUndefined)(a)&&u.value.toString()!==a.toString())&&(u.value=a,u.dataBind())}else if("numericedit"===d.editType){var c=e.querySelector("#"+o+l).ej2_instances[0];a=t[n],i.i(r.isNullOrUndefined)(a)||c.value===a||(c.value=a,c.dataBind())}},e.prototype.validateDuration=function(e){var t=e.ganttProperties;if(!this.dialogEditValidationFlag){i.i(r.isNullOrUndefined)(t.duration)?(this.parent.setRecordValue("endDate",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0)):i.i(c.c)(t)||!i.i(r.isNullOrUndefined)(t.startDate)?(e.ganttProperties.isMilestone&&0!==e.ganttProperties.duration&&this.parent.dateValidationModule.checkStartDate(t.startDate),this.parent.dateValidationModule.calculateEndDate(e)):i.i(c.c)(t)||i.i(r.isNullOrUndefined)(t.endDate)||this.parent.dateValidationModule.calculateStartDate(e);var n=0===t.duration;this.parent.setRecordValue("isMilestone",n,t,!0),this.dialogEditValidationFlag=!0}},e.prototype.validateStartDate=function(e){var t=e.ganttProperties,n=this.parent.taskFields;this.dialogEditValidationFlag||(i.i(r.isNullOrUndefined)(t.startDate)?(this.parent.setRecordValue("duration",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0),this.parent.allowUnscheduledTasks&&i.i(r.isNullOrUndefined)(n.endDate)&&this.parent.setRecordValue("endDate",null,t,!0)):i.i(c.c)(t)?i.i(r.isNullOrUndefined)(n.duration)?this.parent.dateValidationModule.calculateDuration(e):(i.i(r.isNullOrUndefined)(n.endDate),this.parent.dateValidationModule.calculateEndDate(e)):i.i(r.isNullOrUndefined)(t.endDate)?i.i(r.isNullOrUndefined)(t.duration)||this.parent.dateValidationModule.calculateEndDate(e):this.parent.dateValidationModule.calculateDuration(e),this.dialogEditValidationFlag=!0)},e.prototype.validateEndDate=function(e){var t=e.ganttProperties,n=this.parent.taskFields;this.dialogEditValidationFlag||(i.i(r.isNullOrUndefined)(t.endDate)?(this.parent.setRecordValue("duration",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0)):i.i(c.c)(t)?i.i(r.isNullOrUndefined)(n.duration)?this.parent.dateValidationModule.calculateDuration(e):i.i(r.isNullOrUndefined)(t.startDate)?this.parent.dateValidationModule.calculateStartDate(e):(!i.i(r.isNullOrUndefined)(t.segments)&&t.segments.length>0&&(t.segments=this.parent.editModule.cellEditModule.validateEndDateWithSegments(t)),this.parent.dateValidationModule.calculateDuration(e)):i.i(r.isNullOrUndefined)(t.duration)?i.i(r.isNullOrUndefined)(t.startDate)||this.parent.dateValidationModule.calculateDuration(e):this.parent.dateValidationModule.calculateStartDate(e),this.dialogEditValidationFlag=!0)},e.prototype.validateScheduleValuesByCurrentField=function(e,t,n){var a=this.parent,s=n.ganttProperties,o=a.taskFields;if(o.duration===e&&(!i.i(r.isNullOrUndefined)(t)&&""!==t&&parseInt(t)>=0?(a.dataOperation.updateDurationValue(t,s),this.parent.setRecordValue(o.duration,t,n),this.parent.setRecordValue("taskData."+o.duration,s.duration,n),this.validateDuration(n)):a.allowUnscheduledTasks&&(s.startDate&&s.endDate&&s.startDate.getTime()>s.endDate.getTime()||-1!==t.indexOf("-")?(this.parent.setRecordValue("duration",0,s,!0),s.endDate&&this.parent.setRecordValue("startDate",s.endDate,s,!0)):""===t?(this.parent.setRecordValue("duration",null,s,!0),s.endDate&&this.parent.setRecordValue("endDate",null,s,!0)):this.parent.setRecordValue("duration",s.duration,s,!0)),this.parent.editModule.updateResourceRelatedFields(n,"duration")),o.startDate===e)if(""!==t){var l=this.parent.dateValidationModule.getDateFromFormat(t);l=this.parent.dateValidationModule.checkStartDate(l,s),this.parent.setRecordValue("startDate",l,s,!0),this.validateStartDate(n)}else a.allowUnscheduledTasks&&!n.hasChildRecords&&(this.parent.setRecordValue("startDate",null,s,!0),this.parent.setRecordValue("duration",null,s,!0),this.parent.setRecordValue("isMilestone",!1,s,!0));if(o.endDate===e)if(""!==t){var d=this.parent.dateValidationModule.getDateFromFormat(t);i.i(r.isNullOrUndefined)(s.startDate)&&i.i(r.isNullOrUndefined)(d)&&s.startDate.getTime()>d.getTime()&&(d=s.endDate),0===d.getHours()&&86400!==a.defaultEndTime&&this.parent.dateValidationModule.setTime(a.defaultEndTime,d),d=this.parent.dateValidationModule.checkEndDate(d,s),(i.i(r.isNullOrUndefined)(s.startDate)||d.getTime()>s.startDate.getTime())&&this.parent.setRecordValue("endDate",d,s,!0),this.validateEndDate(n)}else a.allowUnscheduledTasks&&(this.parent.setRecordValue("endDate",null,s,!0),this.parent.setRecordValue("duration",null,s,!0),this.parent.setRecordValue("isMilestone",!1,s,!0));return o.work===e&&(i.i(r.isNullOrUndefined)(t)||""===t||(this.parent.setRecordValue("work",t,s,!0),this.parent.editModule.updateResourceRelatedFields(n,"work"),this.validateDuration(n))),e===o.type&&this.parent.setRecordValue("taskType",t,s,!0),o.manual===e&&this.parent.editModule.updateTaskScheduleModes(n),!0},e.prototype.getSegmentsModel=function(e){var t=this,n=this.parent.taskFields;(i.i(r.isNullOrUndefined)(e)||0===e.length)&&(e=[],i.i(r.isNullOrUndefined)(n.startDate)||e.push("startDate"),i.i(r.isNullOrUndefined)(n.endDate)||e.push("endDate"),i.i(r.isNullOrUndefined)(n.duration)||e.push("duration"));var a={};a.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal",newRowPosition:"Bottom"},a.locale=this.parent.locale,a.dataSource=[],a.rowHeight=this.parent.isAdaptive?48:null,a.toolbar=[{id:this.parent.element.id+"SegmentsTabContainer_add",prefixIcon:"e-add",tooltipText:this.localeObj.getConstant("add"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("add")},{id:this.parent.element.id+"SegmentsTabContainer_delete",prefixIcon:"e-delete",tooltipText:this.localeObj.getConstant("delete"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("delete")}];for(var s=[],o=this,l=0;l<e.length;l++)!function(n){var a={};switch(e[n]){case"startDate":case"endDate":a={field:e[n],headerText:o.localeObj.getConstant(e[n]),editType:"stringedit",width:"200px",edit:{write:function(a){var s;if(i.i(r.isNullOrUndefined)(t.beforeOpenArgs.General)){var o=t.getGeneralColumnFields();s=t.getFieldsModel(o)[t.parent.taskFields[e[n]]]}else s=t.beforeOpenArgs.General[t.parent.taskFields[e[n]]];var l=a.rowData[a.column.field];i.i(r.setValue)("value",l,s),new t.inputs[t.parent.columnByField[t.parent.taskFields[e[n]]].editType](s).appendTo(a.element)},read:function(e){return e.ej2_instances[0].value}},format:o.parent.getDateFormat()},"startDate"===e[n]&&(a.validationRules={required:!0}),s.push(a);break;case"duration":a={field:e[n],headerText:o.localeObj.getConstant(e[n]),editType:"stringedit",width:"100px",edit:{write:function(a){var s;if(i.i(r.isNullOrUndefined)(t.beforeOpenArgs.General)){var o=t.getGeneralColumnFields();s=t.getFieldsModel(o)[t.parent.taskFields[e[n]]]}else s=t.beforeOpenArgs.General[t.parent.taskFields[e[n]]];s.floatLabelType="Never";var l=a.rowData[a.column.field];i.i(r.isNullOrUndefined)(l)?i.i(r.setValue)("value",null,s):i.i(r.setValue)("value",l,s),i.i(r.setValue)("value",l,s),new d.TextBox(s).appendTo(a.element)},read:function(e){return e.ej2_instances[0].value.toString()}}},s.push(a)}}(l);return a.columns=s,a.height=this.parent.isAdaptive?"100%":"153px",a},e.prototype.getGridColumnByField=function(e,t){for(var i,r=0;r<t.length;r++)t[r].field===e&&(i=t[r]);return i},e.prototype.updateSegmentField=function(e,t,n){var a,s=this.parent.editModule.dialogModule.dialog,o=i.i(r.getValue)("Segments",this.beforeOpenArgs),l=this.getGridColumnByField(e,o.columns),d=this.parent.element.id,h=n[e];"stringedit"===l.editType?a=s.querySelector("#"+d+"SegmentsTabContainer"+e).ej2_instances[0]:"datepickeredit"===l.editType&&(a=s.querySelector("#"+d+"SegmentsTabContainer"+e).ej2_instances[0]),i.i(r.isNullOrUndefined)(a.value)||a.value.toString()===h.toString()||(a.value=h,a.dataBind())},e.prototype.validateSegmentFields=function(e,t,n,a){var s=this.parent.taskFields;if(!i.i(r.isNullOrUndefined)(s.duration)&&s.duration.toLowerCase()===t.toLowerCase()&&!i.i(r.isNullOrUndefined)(n)&&""!==n){this.selectedSegment.duration=Number(n);var o=e.dataOperation.getEndDate(this.selectedSegment.startDate,Number(n),this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1);o=e.dataOperation.checkEndDate(o,this.editedRecord.ganttProperties,!1),this.selectedSegment.endDate=o}if(!i.i(r.isNullOrUndefined)(s.startDate)&&s.startDate.toLowerCase()===t.toLowerCase()&&""!==n){var l=this.parent.dateValidationModule.getDateFromFormat(n);l=this.parent.dateValidationModule.checkStartDate(l),this.selectedSegment.startDate=l,i.i(r.isNullOrUndefined)(s.endDate)||(this.selectedSegment.endDate=this.parent.dataOperation.getEndDate(l,this.selectedSegment.duration,this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1))}if(!i.i(r.isNullOrUndefined)(s.endDate)&&s.endDate.toLowerCase()===t.toLowerCase()&&""!==n){var o=this.parent.dateValidationModule.getDateFromFormat(n);0===o.getHours()&&86400!==e.defaultEndTime&&this.parent.dateValidationModule.setTime(e.defaultEndTime,o),o=this.parent.dateValidationModule.checkEndDate(o,this.editedRecord.ganttProperties),this.selectedSegment.endDate=o,this.selectedSegment.duration=this.parent.dataOperation.getDuration(this.selectedSegment.startDate,this.selectedSegment.endDate,this.editedRecord.ganttProperties.durationUnit,!0,!1,!0)}i.i(r.isNullOrUndefined)(s.startDate)||this.updateSegmentField("startDate",a,this.selectedSegment),i.i(r.isNullOrUndefined)(s.endDate)||this.updateSegmentField("endDate",a,this.selectedSegment),i.i(r.isNullOrUndefined)(s.duration)||this.updateSegmentField("duration",a,this.selectedSegment)},e.prototype.getPredecessorModel=function(e){(i.i(r.isNullOrUndefined)(e)||0===e.length)&&(e=["ID","Name","Type","Offset","UniqueId"]);var t={};t.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal"},t.locale=this.parent.locale,t.dataSource=[],t.rowHeight=this.parent.isAdaptive?48:null,t.toolbar=[{id:this.parent.element.id+"DependencyTabContainer_add",prefixIcon:"e-add",tooltipText:this.localeObj.getConstant("add"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("add")},{id:this.parent.element.id+"DependencyTabContainer_delete",prefixIcon:"e-delete",tooltipText:this.localeObj.getConstant("delete"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("delete")}];for(var n=[],a=0;a<e.length;a++){var s={};"id"===e[a].toLowerCase()?(s={field:"id",headerText:this.localeObj.getConstant("id"),allowEditing:!1,width:"70px"},n.push(s)):"name"===e[a].toLowerCase()?(s={field:"name",headerText:this.localeObj.getConstant("name"),editType:"stringedit",width:"250px",validationRules:{required:!0}},n.push(s)):"type"===e[a].toLowerCase()?(s={field:"type",headerText:this.localeObj.getConstant("type"),editType:"dropdownedit",dataSource:this.types,foreignKeyField:"id",foreignKeyValue:"text",defaultValue:"FS",validationRules:{required:!0},width:"150px"},n.push(s)):"offset"===e[a].toLowerCase()?(s={field:"offset",headerText:this.localeObj.getConstant("offset"),editType:"stringedit",defaultValue:this.parent.dataOperation.getDurationString(0,this.beforeOpenArgs.rowData.ganttProperties.durationUnit),validationRules:{required:!0},width:"100px"},n.push(s)):"uniqueid"===e[a].toLowerCase()&&(s={field:"uniqueId",isPrimaryKey:!0,visible:!1,defaultValue:i.i(c.k)().toString()},n.push(s))}return t.columns=n,t.height=this.parent.isAdaptive?"100%":"153px",t},e.prototype.getResourcesModel=function(e){var t=this.parent,n=t.resourceFields;(i.i(r.isNullOrUndefined)(e)||0===e.length)&&(e=[n.id,n.name,n.unit,n.group]);for(var a={allowFiltering:!0,treeColumnIndex:-1,childMapping:"",editSettings:{allowEditing:!0,mode:"Cell"},locale:this.parent.locale,allowSelection:!0,rowHeight:this.parent.isAdaptive?48:null,filterSettings:{type:"Menu"},selectionSettings:{checkboxOnly:!0,checkboxMode:"Default",persistSelection:!0,type:"Multiple"}},s=[{type:"checkbox",allowEditing:!1,allowSorting:!1,allowFiltering:!1,width:60}],o=0;o<e.length;o++){var l={};e[o]===n.id?(l={field:n.id,headerText:this.localeObj.getConstant("id"),isPrimaryKey:!0,width:"100px",allowEditing:!1},s.push(l)):e[o]===n.name?(l={field:n.name,headerText:this.localeObj.getConstant("name"),allowEditing:!1},s.push(l)):e[o]===n.unit?(l={field:n.unit,headerText:this.localeObj.getConstant("unit"),editType:"numericedit",edit:{params:{min:0}}},s.push(l)):e[o]!==n.group||i.i(r.isNullOrUndefined)(n.group)||(l={field:n.group,headerText:this.localeObj.getConstant("group"),allowEditing:!1},s.push(l))}return a.columns=s,a.height=this.parent.isAdaptive?"100%":"196px",a},e.prototype.getNotesModel=function(e){return(i.i(r.isNullOrUndefined)(e)||0===e.length)&&(e=["Bold","Italic","Underline","StrikeThrough","FontName","FontSize","FontColor","BackgroundColor","LowerCase","UpperCase","|","Alignments","OrderedList","UnorderedList","Outdent","Indent","|","CreateTable","CreateLink","|","ClearFormat","Print","|","Undo","Redo"]),{placeholder:this.localeObj.getConstant("writeNotes"),toolbarSettings:{items:e},height:this.parent.isAdaptive?"100%":"auto",locale:this.parent.locale}},e.prototype.createDivElement=function(e,t){return i.i(r.createElement)("div",{className:e,id:t})},e.prototype.createInputElement=function(e,t,n,a){return i.i(r.createElement)(a||"input",{className:e,attrs:{type:"text",id:t,name:n,title:n}})},e.prototype.renderTabItems=function(){for(var e=this.beforeOpenArgs.tabModel,t=e.items,i=0,r=0;r<t.length;r++){var n=t[r];n.content instanceof HTMLElement||("General"===n.content?n.content=this.renderGeneralTab(n.content):"Dependency"===n.content?(this.editedRecord.hasChildRecords&&!this.parent.allowParentDependency&&(n.disabled=!0),n.content=this.renderPredecessorTab(n.content)):"Resources"===n.content?n.content=this.renderResourceTab(n.content):n.content==="Custom"+i?(n.content=this.renderCustomTab(n.content),i++):"Notes"===n.content?n.content=this.renderNotesTab(n.content):"Segments"===n.content&&(this.editedRecord.hasChildRecords&&(n.disabled=!0),n.content=this.renderSegmentsTab(n.content)))}},e.prototype.segmentGridActionBegin=function(e){var t=this.parent.taskFields,n=this.beforeOpenArgs.Segments;if("add"===e.requestType||"beginEdit"===e.requestType||"save"===e.requestType){var a=n.dataSource,s=i.i(r.getValue)("rowData",e),o=this.beforeOpenArgs.rowData.ganttProperties.startDate;if(!i.i(r.isNullOrUndefined)(o)&&"add"===e.requestType){var l={},d=i.i(r.getValue)("startDate",s),h=i.i(r.getValue)("endDate",s),p=i.i(r.getValue)("duration",s),u=!i.i(r.isNullOrUndefined)(a)&&a.length>0?i.i(r.isNullOrUndefined)(t.endDate)||i.i(r.isNullOrUndefined)(a[0].endDate)?new Date(i.i(r.getValue)("startDate",a[0]).getTime()):new Date(i.i(r.getValue)("endDate",a[0]).getTime()):!i.i(r.isNullOrUndefined)(this.beforeOpenArgs.rowData.ganttProperties.startDate)&&new Date(this.beforeOpenArgs.rowData.ganttProperties.startDate.getTime());u.setHours(0,0,0,0),!i.i(r.isNullOrUndefined)(a)&&a.length>0&&u.setDate(u.getDate()+2),d=this.parent.dataOperation.checkStartDate(u),h=this.parent.dateValidationModule.getDateFromFormat(d),0===h.getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,h),h=!i.i(r.isNullOrUndefined)(t.endDate)&&!i.i(r.isNullOrUndefined)(a)&&a.length<=0?this.beforeOpenArgs.rowData.ganttProperties.endDate:h,p=!i.i(r.isNullOrUndefined)(t.duration)&&!i.i(r.isNullOrUndefined)(a)&&a.length<=0?this.beforeOpenArgs.rowData.ganttProperties.duration:1,l={startDate:d,endDate:h,duration:p},e.rowData=l}this.selectedSegment=e.rowData}},e.prototype.renderSegmentsTab=function(e){var t=this.parent,n=this.beforeOpenArgs[e],a=this.beforeOpenArgs.rowData,s=[];this.isEdit&&(s=i.i(r.isNullOrUndefined)(a.ganttProperties.segments)?[]:a.ganttProperties.segments),n.dataSource=s,n.actionBegin=this.segmentGridActionBegin.bind(this),o.Grid.Inject(o.Edit,o.Page,o.Toolbar,o.ForeignKey);var l=new o.Grid(n),d=this.createDivElement("",t.element.id+""+e+"TabContainer");return l.appendTo(d),d},e.prototype.renderGeneralTab=function(e){for(var t=this.parent,i=this.beforeOpenArgs[e],r=this.createDivElement("e-edit-form-row",t.element.id+""+e+"TabContainer"),n=0,a=Object.keys(i);n<a.length;n++){var s=a[n];if(!1!==this.parent.columnByField[s].visible){var o=this.parent.columnByField[s],l=i[s];r.appendChild(this.renderInputElements(l,o))}}return r},e.prototype.isCheckIsDisabled=function(e){var t,n=!1;if(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)if(-1!==this.parent.customColumns.indexOf(e.field))n=!0;else if(e.field===this.parent.taskFields.id||e.field===this.parent.taskFields.name||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.startDate||e.field===this.parent.taskFields.endDate||e.field===this.parent.taskFields.baselineStartDate||e.field===this.parent.taskFields.baselineEndDate||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type){for(var a=0;a<this.parent.currentViewData.length;a++)if(!i.i(r.isNullOrUndefined)(this.parent.currentViewData[a].ganttProperties.taskId)){t=this.parent.currentViewData[a].ganttProperties.taskId;break}n="string"!=typeof t}return this.isEdit&&(e.field===this.parent.taskFields.id&&(n=!0),this.editedRecord.hasChildRecords&&(e.field===this.parent.taskFields.endDate&&(!i.i(r.isNullOrUndefined)(this.editedRecord.isManual)&&!1===this.editedRecord.isManual||"Auto"===this.parent.taskMode)||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type)&&(n=!0)),n},e.prototype.isParentValid=function(e){if(e.length>0)for(var t=0;t<e.length;t++){if(e[t].uniqueID==this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}if(e[t].hasChildRecords&&this.isParentValid(e[t].childRecords),!this.isValidData)break}return this.isValidData},e.prototype.renderPredecessorTab=function(e){var t=this,a=this.parent,s=this.beforeOpenArgs[e],l=this.parent.columnByField[this.parent.taskFields.dependency];(!1===l.allowEditing||l.isPrimaryKey||this.parent.readOnly)&&(s.editSettings.allowEditing=!1,s.editSettings.allowAdding=!1,s.editSettings.allowDeleting=!1);var d=this.beforeOpenArgs.rowData,h=[];this.taskNameCollection(),this.isEdit&&(h=this.predecessorEditCollection(d),this.updatePredecessorDropDownData(d)),s.dataSource=h,s.actionBegin=this.gridActionBegin.bind(this),s.columns[1].edit={write:function(e){"add"===i.i(r.getValue)("requestType",e)&&i.i(r.setValue)("rowData.uniqueId",i.i(c.k)(),e),new u.ComboBox({dataSource:new n.DataManager(t.idCollection),popupHeight:"180px",allowCustom:!1,enableRtl:t.parent.enableRtl,fields:{value:"text"},value:e.rowData.name,change:function(e){var n=i.i(r.closest)(e.element,"tr"),a=n.querySelector("#"+t.parent.element.id+"DependencyTabContainerid");a&&(i.i(r.isNullOrUndefined)(e.itemData)||i.i(r.isNullOrUndefined)(e.item)?a.value="":a.value=e.itemData.id)},autofill:!0}).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value}},o.Grid.Inject(o.Edit,o.Page,o.Toolbar,o.ForeignKey);var p=new o.Grid(s),g=this.createDivElement("e-dependent-div",a.element.id+""+e+"TabContainer");return p.appendTo(g),g},e.prototype.gridActionBegin=function(e){var t=this,n=this.beforeOpenArgs.Dependency;if("add"===e.requestType||"beginEdit"===e.requestType){var a="add"!==e.requestType;this.idCollection=i.i(r.extend)([],[],this.preTableCollection,!0);for(var s=n.dataSource,o=this,l=0;l<=s.length;l++)!function(n){o.idCollection.forEach(function(o,l){if(o.id===i.i(r.getValue)("id",s[n])){var d=i.i(r.getValue)("rowData",e);if(a&&i.i(r.getValue)("id",d)===o.id)return;t.idCollection.splice(t.idCollection.indexOf(o),1)}})}(l)}},e.prototype.updateResourceCollection=function(e,t){if(!i.i(r.isNullOrUndefined)(e.data)&&Object.keys(e.data).length){var n=(this.parent,document.querySelector("#"+t)),a=n.ej2_instances[0];if(!i.i(r.isNullOrUndefined)(a)&&a.getSelectedRecords().length>0){var s=a.getSelectedRecords(),o=void 0,l=[];for(o=0;o<s.length;o++)l.push(s[o].taskData);this.ganttResources=i.i(r.extend)([],l)}else this.ganttResources=[]}else this.ganttResources=[]},e.prototype.renderResourceTab=function(e){var t=this,n=this.parent,a=n.resourceFields,s=this.beforeOpenArgs.rowData,o=s.ganttProperties.resourceInfo,l=this.beforeOpenArgs[e],d=n.element.id+""+e+"TabContainer",h=[];if("ResourceView"===this.parent.viewType)for(var p=0;p<n.currentViewData.length;p++)for(var u=0;u<n.resources.length;u++)n.currentViewData[p][n.taskFields.id]===n.resources[u][a.id]&&(n.currentViewData[p].hasChildRecords||i.i(r.isNullOrUndefined)(n.currentViewData[p].parentItem))&&h.push(n.resources[u]);else h=i.i(r.extend)([],[],n.resources,!0);if(this.parent.dataOperation.updateResourceUnit(h),!i.i(r.isNullOrUndefined)(o)){var c=void 0,f=o.length,m=void 0,y=h.length;for(c=0;c<f;c++)for(m=0;m<y;m++)o[c][a.id]===h[m][a.id]&&(h[m][a.unit]=o[c][a.unit])}l.dataSource=h;var D=s.ganttProperties.resourceInfo;if(this.isEdit&&!i.i(r.isNullOrUndefined)(D))for(var p=0;p<D.length;p++)this.ganttResources.push(D[p]);l.rowSelected=function(e){t.updateResourceCollection(e,d)},l.rowDeselected=function(e){t.updateResourceCollection(e,d)};var v=this.createDivElement("e-resource-div",d);g.TreeGrid.Inject(g.Selection,g.Filter,g.Edit,g.VirtualScroll);var w=new g.TreeGrid(l),k=this.parent.columnByField[this.parent.taskFields.resourceInfo];return(!1===k.allowEditing||k.isPrimaryKey||this.parent.readOnly)&&(w.allowSelection=!1,w.allowFiltering=!1,w.editSettings.allowEditing=!1),w.dataBound=function(){if(t.parent.editDialogFields.length>=1&&"Resources"===t.parent.editDialogFields[0].type){var e=t.parent.element.id+"ResourcesTabContainer";t.resourceSelection(e)}},w.appendTo(v),v},e.prototype.resourceSelection=function(e){var t=this,n=document.querySelector("#"+e).ej2_instances[0],a=n.getCurrentViewRecords(),s=this.ganttResources;s&&s.length>0&&a.forEach(function(e,a){for(var o=0;o<s.length;o++)e.taskData[t.parent.resourceFields.id]!==s[o][t.parent.resourceFields.id]||i.i(r.isNullOrUndefined)(n.selectionModule)||-1!==n.getSelectedRowIndexes().indexOf(a)||n.selectRow(a)})},e.prototype.renderCustomTab=function(e){return this.renderGeneralTab(e)},e.prototype.renderNotesTab=function(e){var t=this.parent,i=this.beforeOpenArgs[e];i.enableHtmlSanitizer=this.parent.enableHtmlSanitizer;var r=this.editedRecord.ganttProperties,n=this.createDivElement("",t.element.id+""+e+"TabContainer");l.RichTextEditor.Inject(l.Toolbar,l.Link,l.HtmlEditor,l.QuickToolbar,l.Count),i.value=r.notes;var a=this.parent.columnByField[this.parent.taskFields.notes];return(!1===a.allowEditing||a.isPrimaryKey||this.parent.readOnly)&&(i.enabled=!1),new l.RichTextEditor(i).appendTo(n),n},e.prototype.renderInputElements=function(e,t){var n,a=this,s=this.parent.element.id,l=this.editedRecord,d=this.createDivElement("e-edit-form-column"),h={column:t,data:l};if(!i.i(r.isNullOrUndefined)(t.edit)&&i.i(r.isNullOrUndefined)(t.edit.params)){var p=t.edit.create;"string"==typeof p?(p=i.i(o.getObject)(p,window),n=p(h)):n=t.edit.create(h),n.className="",n.setAttribute("type","text"),n.setAttribute("id",s+""+t.field),n.setAttribute("name",t.field),n.setAttribute("title",t.field),d.appendChild(n)}else n=this.createInputElement("",s+""+t.field,t.field),d.appendChild(n);if(e.enabled=i.i(r.isNullOrUndefined)(e.enabled)?!this.isCheckIsDisabled(t):e.enabled,t.field===this.parent.taskFields.duration)if(i.i(r.isNullOrUndefined)(t.valueAccessor)){if(i.i(r.isNullOrUndefined)(t.edit)){var u=l.ganttProperties;e.value=this.parent.dataOperation.getDurationString(u.duration,u.durationUnit)}}else if("string"==typeof t.valueAccessor){var c=i.i(o.getObject)(t.valueAccessor,window);e.value=c(t.field,l,t)}else e.value=t.valueAccessor(t.field,l,t);else"booleanedit"===t.editType?!0===l[t.field]?e.checked=!0:e.checked=!1:e.value=l[t.field];if(!i.i(r.isNullOrUndefined)(t.edit)&&i.i(r.isNullOrUndefined)(t.edit.params)){var g=t.edit.write,f=void 0;"string"==typeof g?(g=i.i(o.getObject)(g,window),f=g({column:t,rowData:l,element:n})):f=t.edit.write({column:t,rowData:l,element:n}),t.field===this.parent.taskFields.duration&&(f.change=function(e){a.validateScheduleFields(e,t,a.parent)})}else{var f=new this.inputs[t.editType](e);f.appendTo(n)}return d},e.prototype.taskNameCollection=function(){var e=this.parent.flatData;this.preTaskIds=[],this.preTableCollection=[];for(var t=0;t<e.length;t++){var i=e[t];if(this.parent.allowParentDependency){var r=i;if(i.parentUniqueID===this.beforeOpenArgs.rowData.uniqueID)this.isValidData=!1;else do{if(r.parentItem&&(r=this.parent.flatData[this.parent.ids.indexOf(r.parentItem.taskId)],r.uniqueID===this.beforeOpenArgs.rowData.uniqueID)){this.isValidData=!1;break}}while(r.parentItem);if(i.hasChildRecords&&this.isValidData&&(this.isValidData=this.isParentValid(i.childRecords)),!this.isValidData){this.isValidData=!0;continue}}else if(i.hasChildRecords)continue;var n="ResourceView"===this.parent.viewType?i.ganttProperties.taskId.toString():i.ganttProperties.rowUniqueID.toString(),a={id:n,text:n+"-"+i.ganttProperties.taskName,value:n};this.preTaskIds.push(a.id),this.preTableCollection.push(a)}},e.prototype.predecessorEditCollection=function(e){var t=[],n=e.ganttProperties;if(this.isEdit&&!i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)&&!i.i(r.isNullOrUndefined)(e)&&!i.i(r.isNullOrUndefined)(n.predecessor))for(var a=n.predecessor,s=this.preTableCollection,o=0;o<a.length;o++){var l=a[o].from.toString(),d={},h="ResourceView"===this.parent.viewType?n.taskId:n.rowUniqueID;if(h.toString()!==l){d.id=l;for(var p=0;p<s.length;p++)if(s[p].value===l){d.name=s[p].text;break}d.type=a[o].type;var u=a[o].offset,g=a[o].offsetUnit;d.offset=this.parent.dataOperation.getDurationString(u,g),d.uniqueId=i.i(c.k)(),t.push(d)}}return t},e.prototype.updatePredecessorDropDownData=function(e){var t=-1,i="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString();t=this.preTaskIds.indexOf(i),this.preTableCollection.splice(t,1),this.preTaskIds.splice(t,1),this.validSuccessorTasks(e,this.preTaskIds,this.preTableCollection)},e.prototype.validSuccessorTasks=function(e,t,i){var r=this,n=e.ganttProperties;if(n.predecessor&&n.predecessor.length>0){var a=n.predecessor,s="ResourceView"===this.parent.viewType?n.taskId.toString():n.rowUniqueID.toString();a.forEach(function(e){if(e.from.toString()===s){var n=e.to,a=-1;a=t.indexOf(n),a>-1&&(t.splice(a,1),i.splice(a,1));var o=r.parent.connectorLineModule.getRecordByID(n);r.validSuccessorTasks(o,t,i)}})}},e.prototype.getPredecessorType=function(){var e=[this.parent.getPredecessorTextValue("SS"),this.parent.getPredecessorTextValue("SF"),this.parent.getPredecessorTextValue("FS"),this.parent.getPredecessorTextValue("FF")];return[{id:"FS",text:e[2],value:e[2]},{id:"FF",text:e[3],value:e[3]},{id:"SS",text:e[0],value:e[0]},{id:"SF",text:e[1],value:e[1]}]},e.prototype.initiateDialogSave=function(){this.isEdit?this.parent.initiateEditAction(!0):this.addedRecord={};for(var e=this.parent,t=this.beforeOpenArgs.tabModel,n=t.items,a=0;a<n.length;a++){var s=n[a].content,o=s.id;i.i(r.isNullOrUndefined)(o)&&""===o||(o=o.replace(e.element.id,""),o=o.replace("TabContainer",""),"General"===o?this.updateGeneralTab(s,!1):"Dependency"===o?this.updatePredecessorTab(s):"Notes"===o?this.updateNotesTab(s):"Resources"===o?this.updateResourceTab(s):-1!==o.indexOf("Custom")?this.updateCustomTab(s):"Segments"===o&&this.updateSegmentsData(s,this.beforeOpenArgs.rowData))}if(this.isEdit){this.parent.dataOperation.updateWidthLeft(this.rowData);var l={data:this.rowData,action:"DialogEditing"};this.parent.editModule.initiateUpdateAction(l)}else if("ResourceView"===this.parent.viewType){var d=i.i(r.extend)({},this.addedRecord,!0);if(d[this.parent.taskFields.resourceInfo].length)for(var a=0;a<d[this.parent.taskFields.resourceInfo].length;a++){var o=d[this.parent.taskFields.resourceInfo][a].toString(),h=this.parent.getTaskIds().indexOf("R"+o.toString());if(-1!==h){this.parent.editModule.addRecord(this.addedRecord,"Child",h);break}}else this.parent.editModule.addRecord(this.addedRecord,"Bottom")}else this.parent.editModule.addRecord(this.addedRecord,this.parent.editSettings.newRowPosition,this.parent.selectedRowIndex);return!0},e.prototype.updateSegmentTaskData=function(e){for(var t=[],n=this.parent.taskFields,a=0;a<e.length;a++){var s={};i.i(r.isNullOrUndefined)(n.startDate)||(s[this.parent.taskFields.startDate]=e[a].startDate),i.i(r.isNullOrUndefined)(n.endDate)||(s[this.parent.taskFields.endDate]=e[a].endDate),i.i(r.isNullOrUndefined)(n.duration)||(s[this.parent.taskFields.duration]=Number(e[a].duration),e[a].duration=s[this.parent.taskFields.duration]),t.push(s)}this.isEdit?(this.rowData.ganttProperties.segments=e,this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(this.rowData,!1),this.rowData.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,t,this.rowData),e.length<=0&&this.validateDuration(this.rowData)):this.addedRecord[n.segments]=t},e.prototype.updateSegmentsData=function(e,t){var i,r=e.ej2_instances[0],n=r.isEdit;r.isEdit&&r.endEdit(),i=n&&r.currentViewData.length!=r.dataSource.length?r.dataSource:r.currentViewData,this.updateSegmentTaskData(i)},e.prototype.updateGeneralTab=function(e,t){var n=this.parent,a=e.childNodes,s={};this.isEdit||(s=this.addedRecord);for(var l=0;l<a.length;l++){var d=a[l],h=d.querySelector('input[id^="'+n.element.id+'"]')||d.querySelector('textarea[id^="'+n.element.id+'"]');if(h){var p=h.id.replace(n.element.id,""),u=d.querySelector("#"+n.element.id+p).ej2_instances[0];if("stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType&&p===this.parent.taskFields.id){var c=u.value.toString();u.value=c}var g=n.columnByField[p];if(!i.i(r.isNullOrUndefined)(g.edit)&&i.i(r.isNullOrUndefined)(g.edit.params)){var f=g.edit.read;"string"==typeof f?(f=i.i(o.getObject)(f,window),s[p]=f(h,u.value)):s[p]=g.edit.read(h,u.value)}else"booleanedit"===g.editType?h instanceof HTMLInputElement&&!0===h.checked?s[p]=!0:s[p]=!1:(s[p]=u.value,this.parent.enableHtmlSanitizer&&"string"==typeof u.value&&(u.value=r.SanitizeHtmlHelper.sanitize(u.value),s[p]=u.value))}}this.isEdit&&(t||this.updateScheduleProperties(this.editedRecord,this.rowData),n.editModule.validateUpdateValues(s,this.rowData,!0))},e.prototype.updateScheduleProperties=function(e,t){this.parent.setRecordValue("startDate",e.ganttProperties.startDate,t.ganttProperties,!0),this.parent.setRecordValue("endDate",e.ganttProperties.endDate,t.ganttProperties,!0),this.parent.setRecordValue("duration",e.ganttProperties.duration,t.ganttProperties,!0),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,t.ganttProperties,!0),this.parent.setRecordValue("work",e.ganttProperties.work,t.ganttProperties,!0),this.parent.setRecordValue("type",e.ganttProperties.taskType,t.ganttProperties,!0),this.parent.setRecordValue("resourceNames",e.ganttProperties.resourceNames,t.ganttProperties,!0),this.parent.setRecordValue("resourceInfo",e.ganttProperties.resourceInfo,t.ganttProperties,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.startDate)||this.parent.dataOperation.updateMappingData(t,this.parent.taskFields.startDate),i.i(r.isNullOrUndefined)(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(t,this.parent.taskFields.endDate),i.i(r.isNullOrUndefined)(this.parent.taskFields.duration)||(this.parent.dataOperation.updateMappingData(t,this.parent.taskFields.duration),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,this.rowData,!0),0===this.rowData.ganttProperties.duration?this.parent.setRecordValue("isMilestone",!0,t.ganttProperties,!0):this.parent.setRecordValue("isMilestone",!1,this.rowData.ganttProperties,!0)),i.i(r.isNullOrUndefined)(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.work),i.i(r.isNullOrUndefined)(this.parent.taskFields.manual)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.manual),i.i(r.isNullOrUndefined)(this.parent.taskFields.type)||this.parent.dataOperation.updateMappingData(this.rowData,"type"),i.i(r.isNullOrUndefined)(this.parent.taskFields.resourceInfo)||this.parent.dataOperation.updateMappingData(this.rowData,"resourceInfo")},e.prototype.updatePredecessorTab=function(e){var t=e.ej2_instances[0];t.isEdit&&t.endEdit();for(var i=t.dataSource,r=[],n=[],a="",s=[],o=0;o<i.length;o++){var l=i[o];if(-1===s.indexOf(l.id)){var d=l.id+l.type;l.offset&&-1!==l.offset.indexOf("-")?d+=l.offset:d+="+"+l.offset,r.push(d),s.push(l.id)}}this.isEdit?(r.length>0?(n=this.parent.predecessorModule.calculatePredecessor(r.join(","),this.rowData),this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=this.parent.predecessorModule.getPredecessorStringValue(this.rowData)):(n=[],this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=""),this.parent.setRecordValue("predecessorsName",a,this.rowData.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,this.rowData),this.parent.setRecordValue(this.parent.taskFields.dependency,a,this.rowData),this.parent.predecessorModule.updateUnscheduledDependency(this.rowData)):this.addedRecord[this.parent.taskFields.dependency]=r.length>0?r.join(","):""},e.prototype.updateResourceTab=function(e){var t=e.ej2_instances[0];t&&t.grid.endEdit();var n=this.ganttResources;"ResourceView"!==this.parent.viewType||i.i(r.isNullOrUndefined)(this.rowData.ganttProperties)||(JSON.stringify(this.ganttResources)!==JSON.stringify(this.rowData.ganttProperties.resourceInfo)?(this.isResourceUpdate=!0,this.previousResource=i.i(r.isNullOrUndefined)(this.rowData.ganttProperties.resourceInfo)?[]:this.rowData.ganttProperties.resourceInfo.slice()):this.isResourceUpdate=!1);var a=[];if(this.isEdit)this.parent.setRecordValue("resourceInfo",n,this.editedRecord.ganttProperties,!0),this.parent.dataOperation.updateMappingData(this.editedRecord,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(this.editedRecord,"resource"),this.validateDuration(this.editedRecord),this.updateScheduleProperties(this.editedRecord,this.rowData);else{for(var s=0;s<n.length;s++)a.push(n[s][this.parent.resourceFields.id]),this.isAddNewResource=!0;this.addedRecord[this.parent.taskFields.resourceInfo]=a}},e.prototype.updateNotesTab=function(e){var t=this.parent,i=e.ej2_instances[0];this.isEdit?(!1===t.columnByField[t.taskFields.notes].disableHtmlEncode?this.parent.setRecordValue("notes",i.getHtml(),this.rowData.ganttProperties,!0):this.parent.setRecordValue("notes",i.getText(),this.rowData.ganttProperties,!0),t.dataOperation.updateMappingData(this.rowData,"notes")):this.addedRecord[this.parent.taskFields.notes]=i.getHtml()},e.prototype.updateCustomTab=function(e){this.updateGeneralTab(e,!0)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var r=i(0),n=(i.n(r),i(4)),a=(i.n(n),i(5)),s=(i.n(a),i(1)),o=i(24),l=i(42),d=i(33),h=i(9),p=(i.n(h),i(21)),u=(i.n(p),i(29)),c=function(){function e(e){if(this.isFromDeleteMethod=!1,this.targetedRecords=[],this.isNewRecordAdded=!1,this.isValidatedEditedRecord=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.confirmDialog=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,this.isBreakLoop=!1,this.isResourceTaskDeleted=!1,this.deletedTaskDetails=[],this.parent=e,this.validatedChildItems=[],this.parent.editSettings.allowEditing&&"Auto"===this.parent.editSettings.mode&&(this.cellEditModule=new o.a(this.parent)),this.parent.taskFields.dependency&&(this.parent.connectorLineEditModule=new u.a(this.parent)),(this.parent.editSettings.allowAdding||this.parent.editSettings.allowEditing&&("Dialog"===this.parent.editSettings.mode||"Auto"===this.parent.editSettings.mode))&&(this.dialogModule=new d.a(this.parent)),this.parent.editSettings.allowTaskbarEditing&&(this.taskbarEditModule=new l.a(this.parent)),this.parent.editSettings.allowDeleting){var t=i.i(r.createElement)("div",{id:this.parent.element.id+"_deleteConfirmDialog"});this.parent.element.appendChild(t),this.renderDeleteConfirmDialog()}this.parent.treeGrid.recordDoubleClick=this.recordDoubleClick.bind(this),this.parent.treeGrid.editSettings.allowAdding=this.parent.editSettings.allowAdding,this.parent.treeGrid.editSettings.allowDeleting=this.parent.editSettings.allowDeleting,this.parent.treeGrid.editSettings.showDeleteConfirmDialog=this.parent.editSettings.showDeleteConfirmDialog,this.parent.treeGrid.editSettings.allowNextRowEdit=this.parent.editSettings.allowNextRowEdit,this.updateDefaultColumnEditors()}return e.prototype.getModuleName=function(){return"edit"},e.prototype.updateDefaultColumnEditors=function(){for(var e=[this.parent.taskFields.id,this.parent.taskFields.progress,this.parent.taskFields.resourceInfo,"taskType"],t=0;t<e.length;t++)if(!i.i(r.isNullOrUndefined)(e[t])&&e[t].length>0){var n=this.parent.getColumnByField(e[t],this.parent.treeGridModule.treeGridColumns);n&&(n.field===this.parent.taskFields.id?this.updateIDColumnEditParams(n):n.field===this.parent.taskFields.progress&&i.i(r.isNullOrUndefined)(n.edit)?this.updateProgessColumnEditParams(n):n.field===this.parent.taskFields.resourceInfo?this.updateResourceColumnEditor(n):"taskType"===n.field&&this.updateTaskTypeColumnEditor(n))}},e.prototype.updateIDColumnEditParams=function(e){var t={min:0,decimals:0,enableRtl:this.parent.enableRtl,validateDecimalOnType:!0,format:"n0",showSpinButton:!1};this.updateEditParams(e,t)},e.prototype.updateProgessColumnEditParams=function(e){var t={min:0,enableRtl:this.parent.enableRtl,decimals:0,validateDecimalOnType:!0,max:100,format:"n0"};this.updateEditParams(e,t)},e.prototype.updateEditParams=function(e,t){i.i(r.isNullOrUndefined)(e.edit)?(e.edit={},e.edit.params={}):i.i(r.isNullOrUndefined)(e.edit.params)&&(e.edit.params={}),i.i(r.extend)(t,e.edit.params),e.edit.params=t,this.parent.getColumnByField(e.field,this.parent.ganttColumns).edit=e.edit},e.prototype.updateResourceColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&i.i(r.isNullOrUndefined)(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getResourceEditor();var t=this.parent.getColumnByField(e.field,this.parent.ganttColumns);t.editType="dropdownedit",t.edit=e.edit}},e.prototype.getResourceEditor=function(){var e,t=this,a=this.parent.resourceFields,s={};return p.MultiSelect.Inject(p.CheckBoxSelection),s.write=function(i){t.parent.treeGridModule.currentEditRow={},e=new p.MultiSelect({dataSource:new n.DataManager(t.parent.resources),fields:{text:a.name,value:a.id},enableRtl:t.parent.enableRtl,mode:"CheckBox",showDropDownIcon:!0,popupHeight:"350px",delimiterChar:",",value:t.parent.treeGridModule.getResourceIds(i.rowData)}),e.appendTo(i.element)},s.read=function(e){var n=e.ej2_instances[0].value,s=[];i.i(r.isNullOrUndefined)(n)&&(n=[]);for(var o=0;o<n.length;o++)for(var l=0;l<t.parent.resources.length;l++)if(t.parent.resources[l][a.id]===n[o]){s.push(t.parent.resources[l][a.name]);break}return t.parent.treeGridModule.currentEditRow[t.parent.taskFields.resourceInfo]=n,s.join(",")},s.destroy=function(){e&&e.destroy()},s},e.prototype.updateTaskTypeColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&i.i(r.isNullOrUndefined)(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getTaskTypeEditor();var t=this.parent.getColumnByField(e.field,this.parent.ganttColumns);t.editType="dropdownedit",t.edit=e.edit}},e.prototype.getTaskTypeEditor=function(){var e,t=this,a={},s=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];return a.write=function(a){t.parent.treeGridModule.currentEditRow={},e=new p.DropDownList({dataSource:new n.DataManager(s),enableRtl:t.parent.enableRtl,fields:{value:"Value"},popupHeight:"350px",value:i.i(r.getValue)("taskType",a.rowData.ganttProperties)}),e.appendTo(a.element)},a.read=function(e){var i=e.ej2_instances[0].value;return t.parent.treeGridModule.currentEditRow.taskType=i,i},a.destroy=function(){e&&e.destroy()},a},e.prototype.reUpdateEditModules=function(){var e=this.parent.editSettings;if(e.allowEditing?(this.parent.editModule.cellEditModule&&"Dialog"===e.mode?(this.cellEditModule.destroy(),this.parent.treeGrid.recordDoubleClick=this.recordDoubleClick.bind(this)):i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule)&&"Auto"===e.mode&&(this.cellEditModule=new o.a(this.parent)),this.parent.editModule.dialogModule&&"Auto"===e.mode?this.parent.treeGrid.recordDoubleClick=void 0:i.i(r.isNullOrUndefined)(this.parent.editModule.dialogModule)&&(this.dialogModule=new d.a(this.parent))):(this.cellEditModule&&this.cellEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy()),e.allowDeleting&&e.showDeleteConfirmDialog){if(i.i(r.isNullOrUndefined)(this.confirmDialog)){var t=i.i(r.createElement)("div",{id:this.parent.element.id+"_deleteConfirmDialog"});this.parent.element.appendChild(t),this.renderDeleteConfirmDialog()}}else e.allowDeleting&&e.showDeleteConfirmDialog||this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy();e.allowTaskbarEditing?i.i(r.isNullOrUndefined)(this.parent.editModule.taskbarEditModule)&&(this.taskbarEditModule=new l.a(this.parent)):this.taskbarEditModule&&this.taskbarEditModule.destroy()},e.prototype.recordDoubleClick=function(e){if(this.parent.editSettings.allowEditing&&"Dialog"===this.parent.editSettings.mode){var t=void 0;if(e.row){var n=i.i(r.getValue)("rowIndex",e.row);t=this.parent.currentViewData[n]}i.i(r.isNullOrUndefined)(t)||this.dialogModule.openEditDialog(t)}this.parent.ganttChartModule.recordDoubleClick(e)},e.prototype.destroy=function(){this.cellEditModule&&this.cellEditModule.destroy(),this.taskbarEditModule&&this.taskbarEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy(),this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy()},e.prototype.updateRecordByID=function(e){if(!this.parent.readOnly){var t=this.parent.taskFields;if(i.i(r.isNullOrUndefined)(e)||i.i(r.isNullOrUndefined)(e[t.id]))return;var n="ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf("T"+e[t.id])]:this.parent.getRecordByID(e[t.id]);if(!i.i(r.isNullOrUndefined)(this.parent.editModule)&&n){this.parent.isOnEdit=!0,this.validateUpdateValues(e,n,!0),e[this.parent.taskFields.resourceInfo]&&(0===n.ganttProperties.duration&&this.parent.dataOperation.updateWorkWithDuration(n),this.updateResourceRelatedFields(n,"resource"),this.parent.dateValidationModule.calculateEndDate(n));var a=Object.keys(e);if(-1===a.indexOf(t.startDate)&&-1===a.indexOf(t.endDate)&&-1===a.indexOf(t.duration)||this.parent.dataOperation.calculateScheduledValues(n,n.taskData,!1),this.parent.dataOperation.updateWidthLeft(n),i.i(r.isUndefined)(e[this.parent.taskFields.dependency])||e[this.parent.taskFields.dependency]===n.ganttProperties.predecessorsName){var s={};s.data=n,"ResourceView"===this.parent.viewType&&(s.action="methodUpdate"),this.parent.editModule.initiateUpdateAction(s)}else this.parent.connectorLineEditModule.updatePredecessor(n,e[this.parent.taskFields.dependency])}}},e.prototype.validateUpdateValues=function(e,t,n){var a=this.parent,o=a.taskFields,l=i.i(s.d)(a.columnMapping),d=[],h=!1;i.i(r.isNullOrUndefined)(t[o.milestone])||!0===t[o.milestone]&&(t[o.milestone]=!1);for(var p=0,u=Object.keys(e);p<u.length;p++){var c=u[p];if(-1!==[o.startDate,o.endDate,o.duration].indexOf(c)){if(i.i(r.isNullOrUndefined)(e[""+c])&&!a.allowUnscheduledTasks)continue;if(n)if(o.duration===c)a.dataOperation.updateDurationValue(e[c],t.ganttProperties),t.ganttProperties.duration>0&&t.ganttProperties.isMilestone&&this.parent.setRecordValue("isMilestone",!1,t.ganttProperties,!0),a.dataOperation.updateMappingData(t,l[c]);else{var g="string"==typeof e[c]?new Date(e[c]):e[c];a.setRecordValue(l[c],g,t.ganttProperties,!0),a.dataOperation.updateMappingData(t,l[c])}else d.push(c),h=!0}else if(o.resourceInfo===c){var f=a.dataOperation.setResourceInfo(e);"ResourceView"===this.parent.viewType&&(JSON.stringify(f)!==JSON.stringify(t.ganttProperties.resourceInfo)?(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=i.i(r.isNullOrUndefined)(t.ganttProperties.resourceInfo)?[]:t.ganttProperties.resourceInfo.slice()):this.parent.editModule.dialogModule.isResourceUpdate=!1),t.ganttProperties.resourceInfo=f,a.dataOperation.updateMappingData(t,"resourceInfo")}else if(o.dependency===c);else if(-1!==[o.progress,o.notes,o.durationUnit,o.expandState,o.milestone,o.name,o.baselineStartDate,o.baselineEndDate,o.id,o.segments,o.cssClass].indexOf(c)){var m=a.columnByField[c],y=e[c];i.i(r.isNullOrUndefined)(m)||"datepickeredit"!==m.editType&&"datetimepickeredit"!==m.editType||(y=a.dataOperation.getDateFromFormat(y));var D=l[c];if(c===o.id)D="taskId";else if(c===o.name)D="taskName";else if(c===o.cssClass)D="cssClass";else if(c===o.milestone){if(D="isMilestone",!i.i(r.isNullOrUndefined)(o.duration)){var v=t.ganttProperties,w=e[o.duration];w=y?0:w<=0?1:w,a.setRecordValue(o.duration,w,t,!0),a.setRecordValue("duration",w,v,!0),a.setRecordValue("taskData."+o.duration,w,t)}}else if(c===o.segments&&!i.i(r.isNullOrUndefined)(t.ganttProperties.segments)&&(D="segments",e&&!i.i(r.isNullOrUndefined)(e[this.parent.taskFields.segments])&&e[this.parent.taskFields.segments].length>0)){for(var k=0,b=0;b<t.ganttProperties.segments.length;b++)k+=t.ganttProperties.segments[b].duration;var T=t.ganttProperties.startDate,S=this.parent.dataOperation.getEndDate(T,k,t.ganttProperties.durationUnit,t.ganttProperties,!1);a.setRecordValue("endDate",a.dataOperation.getDateFromFormat(S),t.ganttProperties,!0)}i.i(r.isNullOrUndefined)(D)||a.setRecordValue(D,y,t.ganttProperties,!0),(c===o.baselineStartDate||c===o.baselineEndDate)&&t.ganttProperties.baselineStartDate&&t.ganttProperties.baselineEndDate&&(a.setRecordValue("baselineStartDate",a.dataOperation.checkBaselineStartDate(t.ganttProperties.baselineStartDate),t.ganttProperties,!0),t.ganttProperties.baselineEndDate&&0===t.ganttProperties.baselineEndDate.getHours()&&86400!==this.parent.defaultEndTime&&a.dataOperation.setTime(this.parent.defaultEndTime,t.ganttProperties.baselineEndDate),a.setRecordValue("baselineEndDate",a.dataOperation.checkBaselineEndDate(t.ganttProperties.baselineEndDate),t.ganttProperties,!0),a.setRecordValue("baselineLeft",a.dataOperation.calculateBaselineLeft(t.ganttProperties),t.ganttProperties,!0),a.setRecordValue("baselineWidth",a.dataOperation.calculateBaselineWidth(t.ganttProperties),t.ganttProperties,!0)),a.setRecordValue("taskData."+c,y,t),c===o.segments&&e&&!i.i(r.isNullOrUndefined)(e[this.parent.taskFields.segments])&&e[this.parent.taskFields.segments].length>0&&a.dataOperation.setSegmentsInfo(t,!0),a.setRecordValue(c,y,t)}else if(o.indicators===c){var y=e[c];a.setRecordValue("indicators",y,t.ganttProperties,!0),a.setRecordValue("taskData."+c,y,t),a.setRecordValue(c,y,t)}else if(o.work===c)a.setRecordValue("work",e[c],t.ganttProperties,!0),this.parent.dataOperation.updateMappingData(t,"work"),this.parent.dataOperation.updateMappingData(t,"duration"),this.parent.dataOperation.updateMappingData(t,"endDate");else if(c===o.type)a.setRecordValue("taskType",e[c],t.ganttProperties,!0);else if(-1!==a.customColumns.indexOf(c)){var m=a.columnByField[c],y=e[c];i.i(r.isNullOrUndefined)(m.edit)&&("datepickeredit"!==m.editType&&"datetimepickeredit"!==m.editType||(y=a.dataOperation.getDateFromFormat(y))),a.setRecordValue("taskData."+c,y,t),a.setRecordValue(c,y,t)}else o.manual===c&&(a.setRecordValue("isAutoSchedule",!e[c],t.ganttProperties,!0),this.parent.setRecordValue(c,e[c],t),this.updateTaskScheduleModes(t))}h&&this.validateScheduleValues(d,t,e)},e.prototype.updateResourceRelatedFields=function(e,t){var n=e.ganttProperties,a=n.taskType,s=n.isAutoSchedule;if(!i.i(r.isNullOrUndefined)(n.resourceInfo))if(n.work>0||"work"===t)switch(a){case"FixedUnit":if(0===n.resourceInfo.length)return;s&&n.resourceInfo.length&&("work"===t||"resource"===t)?this.parent.dataOperation.updateDurationWithWork(e):s||"work"!==t?this.parent.dataOperation.updateWorkWithDuration(e):this.parent.dataOperation.updateUnitWithWork(e);break;case"FixedWork":if(0===n.resourceInfo.length)return;s?"duration"===t||"endDate"===t?(this.parent.dataOperation.updateUnitWithWork(e),0===n.duration&&(this.parent.setRecordValue("work",0,n,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(e,"work"))):this.parent.dataOperation.updateDurationWithWork(e):"work"===t?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e);break;case"FixedDuration":n.resourceInfo.length&&"work"===t?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e)}else this.parent.dataOperation.updateWorkWithDuration(e)},e.prototype.validateScheduleValues=function(e,t,i){var r=this.parent;e.length>2?r.dataOperation.calculateScheduledValues(t,i,!1):e.length>1?this.validateScheduleByTwoValues(i,e,t):this.dialogModule.validateScheduleValuesByCurrentField(e[0],i[e[0]],t)},e.prototype.validateScheduleByTwoValues=function(e,t,i){var r,n,a,s=this.parent,o=s.taskFields,l=i.ganttProperties,d=s.allowUnscheduledTasks;-1!==t.indexOf(o.startDate)&&(r=e[o.startDate]),-1!==t.indexOf(o.endDate)&&(n=e[o.endDate]),-1!==t.indexOf(o.duration)&&(a=e[o.duration]),r&&n||d&&-1!==t.indexOf(o.startDate)&&-1!==t.indexOf(o.endDate)?(s.setRecordValue("startDate",s.dataOperation.getDateFromFormat(r),l,!0),s.setRecordValue("endDate",s.dataOperation.getDateFromFormat(n),l,!0),s.dataOperation.calculateDuration(i)):n&&a||d&&-1!==t.indexOf(o.endDate)&&-1!==t.indexOf(o.duration)?(s.setRecordValue("endDate",s.dataOperation.getDateFromFormat(n),l,!0),s.dataOperation.updateDurationValue(a,l)):(r&&a||d&&-1!==t.indexOf(o.startDate)&&-1!==t.indexOf(o.duration))&&(s.setRecordValue("startDate",s.dataOperation.getDateFromFormat(r),l,!0),s.dataOperation.updateDurationValue(a,l))},e.prototype.isTaskbarMoved=function(e){var t=!1,n=e.ganttProperties,a=this.parent.previousRecords&&this.parent.previousRecords[e.uniqueID];if(a&&a.ganttProperties){var s=i.i(r.getValue)("ganttProperties.startDate",a),o=i.i(r.getValue)("ganttProperties.endDate",a),l=i.i(r.getValue)("ganttProperties.duration",a),d=i.i(r.getValue)("ganttProperties.durationUnit",a),h=Object.keys(a.ganttProperties);-1===h.indexOf("startDate")&&-1===h.indexOf("endDate")&&-1===h.indexOf("duration")&&-1===h.indexOf("durationUnit")||(i.i(r.isNullOrUndefined)(s)&&!i.i(r.isNullOrUndefined)(n.startDate)||i.i(r.isNullOrUndefined)(o)&&!i.i(r.isNullOrUndefined)(n.endDate)||i.i(r.isNullOrUndefined)(n.startDate)&&!i.i(r.isNullOrUndefined)(s)||i.i(r.isNullOrUndefined)(n.endDate)&&!i.i(r.isNullOrUndefined)(o)||s&&s.getTime()!==n.startDate.getTime()||o&&o.getTime()!==n.endDate.getTime()||!i.i(r.isNullOrUndefined)(l)&&l!==n.duration||!i.i(r.isNullOrUndefined)(l)&&l===n.duration&&d!==n.durationUnit)&&(t=!0)}return t},e.prototype.isPredecessorUpdated=function(e){var t=!1,i=this.parent.previousRecords[e.uniqueID];return i&&i.ganttProperties&&i.ganttProperties.hasOwnProperty("predecessor")&&(e.ganttProperties.predecessorsName!==i.ganttProperties.predecessorsName?t=!0:this.parent.setRecordValue("predecessor",i.ganttProperties.predecessor,e.ganttProperties,!0)),t},e.prototype.isCheckPredecessor=function(e){var t=!1;return this.parent.previousRecords[e.uniqueID]&&this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation&&this.parent.predecessorModule.getValidPredecessor(e).length>0&&this.isTaskbarMoved(e)&&(t=!0),t},e.prototype.updateGanttProperties=function(e,t){var i=["taskId","uniqueID","rowUniqueID","parentId"];Object.keys(e.ganttProperties).forEach(function(r){-1===i.indexOf(r)&&(t.ganttProperties[r]=e.ganttProperties[r])})},e.prototype.initiateUpdateAction=function(e){var t,n,a=this.isCheckPredecessor(e.data);if(i.i(r.isNullOrUndefined)(e.data.parentItem)||a){if(e.data.childRecords.length>0&&!a&&!(a=this.isCheckPredecessor(e.data))&&this.isTaskbarMoved(e.data))for(var s=0;s<e.data.childRecords.length;s++)this.parent.predecessorModule.getValidPredecessor(e.data.childRecords[s]).length>0&&(n=s,a=!0)}else t=this.parent.getRecordByID(e.data.parentItem.taskId),a=!!(this.isTaskbarMoved(e.data)&&this.parent.predecessorModule.getValidPredecessor(t).length>0&&this.parent.isInPredecessorValidation);this.taskbarMoved=this.isTaskbarMoved(e.data),this.predecessorUpdated=this.isPredecessorUpdated(e.data),this.predecessorUpdated&&(this.parent.isConnectorLineUpdate=!0,this.parent.connectorLineEditModule.addRemovePredecessor(e.data));var o={};if(a)if(o=i.i(r.isNullOrUndefined)(t)?i.i(r.isNullOrUndefined)(n)?this.parent.connectorLineEditModule.validateTypes(e.data):this.parent.connectorLineEditModule.validateTypes(e.data.childRecords[n],e.data):this.parent.connectorLineEditModule.validateTypes(t,e.data),this.parent.isConnectorLineUpdate=!0,i.i(r.isNullOrUndefined)(i.i(r.getValue)("violationType",o)))this.updateEditedTask(e);else{var l=this.validateTaskEvent(e);!1===l.validateMode.preserveLinkWithEditing&&!1===l.validateMode.removeLink&&!1===l.validateMode.respectLink?this.parent.connectorLineEditModule.openValidationDialog(o):(this.parent.editModule&&this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.isEdit&&this.predecessorUpdated&&(this.isValidatedEditedRecord=!0,this.parent.predecessorModule.validatePredecessor(e.data,[],"")),this.parent.connectorLineEditModule.applyPredecessorOption())}else this.taskbarMoved&&(this.parent.isConnectorLineUpdate=!0),this.updateEditedTask(e)},e.prototype.validateTaskEvent=function(e){var t={};return this.resetValidateArgs(),this.parent.currentEditedArgs=t,t.cancel=!1,t.data=e.data,t.requestType="validateLinkedTask",t.validateMode=this.parent.dialogValidateMode,t.editEventArgs=e,this.parent.actionBeginTask(t),t},e.prototype.resetValidateArgs=function(){this.parent.dialogValidateMode.preserveLinkWithEditing=!0,this.parent.dialogValidateMode.removeLink=!1,this.parent.dialogValidateMode.respectLink=!1},e.prototype.updateEditedTask=function(e){var t=e.data;if(this.parent.autoCalculateDateScheduling&&this.updateParentChildRecord(t),this.parent.isConnectorLineUpdate&&this.parent.autoCalculateDateScheduling){for(var i=0;i<this.validatedChildItems.length;i++){var r=this.validatedChildItems[i];r.ganttProperties.predecessor&&r.ganttProperties.predecessor.length>0&&(this.parent.editedTaskBarItem=r,this.parent.predecessorModule.validatePredecessor(r,[],""))}this.parent.predecessorModule.isValidatedParentTaskID="",t.ganttProperties.predecessor&&(this.parent.isMileStoneEdited=t.ganttProperties.isMilestone,this.taskbarMoved&&(this.parent.editedTaskBarItem=t),this.isValidatedEditedRecord||this.parent.predecessorModule.validatePredecessor(t,[],""),this.isValidatedEditedRecord=!1,this.parent.predecessorModule.isValidatedParentTaskID=""),this.parent.allowParentDependency&&t.hasChildRecords&&this.parent.previousRecords[t.uniqueID].ganttProperties.startDate&&"DrawConnectorLine"===e.action&&this.updateChildItems(t),this.updateParentItemOnEditing(),this.parent.dataOperation.updateParentItems(t,!0)}if(t.parentItem){this.parent.autoCalculateDateScheduling&&this.parent.dataOperation.updateParentItems(t,!0);var n=this.parent.getRecordByID(t.parentItem.taskId);n.ganttProperties.predecessorsName||(this.parent.predecessorModule.validatePredecessor(n,[],""),this.updateParentItemOnEditing())}this.parent.UpdateOffsetOnTaskbarEdit&&this.parent.connectorLineEditModule&&e.data&&this.parent.connectorLineEditModule.calculateOffset(e.data),this.parent.predecessorModule.validatedParentIds=[],this.initiateSaveAction(e)},e.prototype.updateParentItemOnEditing=function(){for(var e=i.i(r.getValue)("parentRecord",this.parent.predecessorModule),t=0;t<e.length;t++)this.parent.dataOperation.updateParentItems(e[t]);i.i(r.setValue)("parentRecord",[],this.parent.predecessorModule),i.i(r.setValue)("parentIds",[],this.parent.predecessorModule)},e.prototype.updateParentChildRecord=function(e){var t=e;!t.hasChildRecords||!this.taskbarMoved||!1!==t[this.parent.taskFields.manual]&&"Auto"!==this.parent.taskMode||i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isResourceCellEdited||this.updateChildItems(t),i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule)||(this.parent.editModule.cellEditModule.isResourceCellEdited=!1)},e.prototype.updateTaskScheduleModes=function(e){var t=e[this.parent.taskFields.startDate],i=e.ganttProperties;if(e.hasChildRecords&&i.isAutoSchedule)this.parent.setRecordValue("startDate",i.autoStartDate,i,!0),this.parent.setRecordValue("endDate",i.autoEndDate,i,!0),this.parent.setRecordValue("StartDate",i.autoStartDate,e,!0),this.parent.setRecordValue("EndDate",i.autoEndDate,e,!0),this.parent.setRecordValue("taskData.StartDate",i.autoStartDate,e,!0),this.parent.setRecordValue("taskData.EndDate",i.autoEndDate,e,!0),this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e,!0),i,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(i,!0),i,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(i.width,i.progress),i,!0),this.parent.dataOperation.calculateDuration(e);else if(e.hasChildRecords&&!i.isAutoSchedule)this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.calculateDuration(e),this.parent.setRecordValue("autoStartDate",i.autoStartDate,i,!0),this.parent.setRecordValue("autoEndDate",i.autoEndDate,i,!0),this.parent.setRecordValue("autoDuration",this.parent.dataOperation.calculateAutoDuration(e),i,!0),this.parent.dataOperation.updateAutoWidthLeft(e);else{var r=this.parent.dateValidationModule.checkStartDate(t,e.ganttProperties);this.parent.setRecordValue("startDate",r,e.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e,"startDate"),this.parent.dateValidationModule.calculateEndDate(e),this.parent.setRecordValue("taskData."+this.parent.taskFields.manual,e[this.parent.taskFields.manual],e),this.parent.dataOperation.updateWidthLeft(e)}},e.prototype.calculateDateByRoundOffDuration=function(e,t){var n=e,a=n.ganttProperties,s=new Date(t.getTime());if(!i.i(r.isNullOrUndefined)(a.endDate)&&i.i(r.isNullOrUndefined)(a.startDate)){var o=this.parent.dateValidationModule.checkStartDate(s,a,null);this.parent.setRecordValue("endDate",this.parent.dateValidationModule.checkEndDate(o,n.ganttProperties),a,!0)}else this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(s,a,!1),a,!0),i.i(r.isNullOrUndefined)(a.duration)||this.parent.dateValidationModule.calculateEndDate(n);this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(n)},e.prototype.updateParentProgress=function(e){var t=0,n=this.parent.getParentTask(e),a=n.childRecords,o=a?a.length:0,l=0,d=0,h=0,p=0,u={};if(a){for(var c=0;c<o;c++)a[c].ganttProperties.isMilestone&&!a[c].hasChildRecords||!i.i(s.c)(a[c].ganttProperties)?d+=1:(u=this.parent.dataOperation.getParentProgress(a[c]),l+=i.i(r.getValue)("totalProgress",u),p+=i.i(r.getValue)("totalDuration",u));h=o-d,t=h>0?Math.round(l/p):0,isNaN(t)&&(t=0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(n.ganttProperties.isAutoSchedule?n.ganttProperties.width:n.ganttProperties.autoWidth,t),n.ganttProperties,!0),this.parent.setRecordValue("progress",Math.floor(t),n.ganttProperties,!0),this.parent.setRecordValue("totalProgress",l,n.ganttProperties,!0),this.parent.setRecordValue("totalDuration",p,n.ganttProperties,!0)}this.parent.dataOperation.updateTaskData(n),n.parentItem&&this.updateParentProgress(n.parentItem)},e.prototype.revertCellEdit=function(e){this.parent.editModule.reUpdatePreviousRecords(!1,!0),this.resetEditProperties()},e.prototype.reUpdatePreviousRecords=function(e,t){for(var i=this.parent.previousRecords,r=Object.keys(i),n=0;n<r.length;n++){var a=r[n],s=i[a],o=this.parent.getTaskByUniqueID(a);this.copyTaskData(o.taskData,s.taskData),delete s.taskData,this.copyTaskData(o.ganttProperties,s.ganttProperties),delete s.ganttProperties,this.copyTaskData(o,s);var l=this.parent.currentViewData.indexOf(o);if(e&&this.parent.chartRowsModule.refreshRow(l),t){var d="ProjectView"===this.parent.viewType?o.ganttProperties.taskId:o.ganttProperties.rowUniqueID;this.parent.treeGrid.grid.setRowData(d,o);this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[l].getAttribute("data-uid")).data=o}}},e.prototype.copyTaskData=function(e,t){i.i(r.isNullOrUndefined)(t)||i.i(r.extend)(e,t)},e.prototype.updateScheduleDatesOnEditing=function(e){},e.prototype.updateChildItems=function(e){var t,n=this.parent.previousRecords[e.uniqueID];i.i(r.isNullOrUndefined)(n)||i.i(r.isNullOrUndefined)(n)&&!i.i(r.isNullOrUndefined)(n.ganttProperties)?t=new Date(e.ganttProperties.startDate.getTime()):i.i(r.isNullOrUndefined)(n.ganttProperties.startDate)||(t=new Date(n.ganttProperties.startDate.getTime()));var a,o,l,d,h,p=e.ganttProperties.startDate,u=[];if(this.getUpdatableChildRecords(e,u),0!==u.length){!i.i(r.isNullOrUndefined)(t)&&!i.i(r.isNullOrUndefined)(p)&&t.getTime()>p.getTime()?(a=this.parent.dateValidationModule.checkStartDate(p),o=this.parent.dateValidationModule.checkEndDate(t,e.ganttProperties),d=!1):(a=this.parent.dateValidationModule.checkStartDate(t),o=this.parent.dateValidationModule.checkEndDate(p,e.ganttProperties),d=!0),h=!i.i(r.isNullOrUndefined)(a)&&!i.i(r.isNullOrUndefined)(o)&&a.getTime()>=o.getTime()?0:this.parent.dateValidationModule.getDuration(a,o,"minute",!0,!1);for(var c=0;c<u.length;c++)if(u[c].ganttProperties.isAutoSchedule)if(h>0){var g=i.i(s.c)(u[c].ganttProperties)?u[c].ganttProperties.startDate:u[c].ganttProperties.startDate?u[c].ganttProperties.startDate:u[c].ganttProperties.endDate?u[c].ganttProperties.endDate:new Date(t.toString());l=d?this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(g,u[c].ganttProperties,u[c].ganttProperties.isMilestone),h,"minute",u[c].ganttProperties,!1):this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(g,u[c].ganttProperties),h,"minute",u[c].ganttProperties),this.calculateDateByRoundOffDuration(u[c],l),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(u[c])&&this.validatedChildItems.push(u[c])}else if(i.i(r.isNullOrUndefined)(n)){l=t;var f=this.parent.initialLoadData[u[c].index];this.parent.isLoad?this.calculateDateByRoundOffDuration(f,l):this.calculateDateByRoundOffDuration(u[c],l),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(u[c])&&this.validatedChildItems.push(u[c])}u.length&&this.parent.dataOperation.updateParentItems(e,!0)}},e.prototype.getUpdatableChildRecords=function(e,t){for(var i=e.childRecords,r=0;r<i.length;r++)i[r].ganttProperties.isAutoSchedule&&(t.push(i[r]),i[r].hasChildRecords&&this.getUpdatableChildRecords(i[r],t))},e.prototype.initiateSaveAction=function(e){var t=this,a={};a.requestType="beforeSave",a.data=e.data,a.cancel=!1,a.modifiedRecords=this.parent.editedRecords,i.i(r.isNullOrUndefined)(e.target)||(a.target=e.target),a.modifiedTaskData=i.i(s.e)(this.parent.editedRecords,!0),e.action&&"DrawConnectorLine"===e.action&&(a.action="DrawConnectorLine"),this.parent.trigger("actionBegin",a,function(o){if(i.i(r.isNullOrUndefined)(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),o.cancel)t.reUpdatePreviousRecords(),t.parent.chartRowsModule.refreshRecords([e.data]),t.resetEditProperties(a);else if(o.modifiedTaskData=i.i(s.e)(o.modifiedRecords,null,null,t.parent),i.i(s.f)(t.parent.dataSource)){var l=t.parent.dataSource,d={changedRecords:o.modifiedTaskData},h=t.parent.query instanceof n.Query?t.parent.query:new n.Query,p=null,u=l.adaptor;if(u instanceof n.WebApiAdaptor&&u instanceof n.ODataAdaptor&&!l.dataSource.batchUrl){p=l.update(t.parent.taskFields.id,d.changedRecords,null,h)}else p=l.saveChanges(d,t.parent.taskFields.id,null,h);p.then(function(i){return t.dmSuccess(i,e)}).catch(function(i){return t.dmFailure(i,e)})}else t.saveSuccess(e)})},e.prototype.dmSuccess=function(e,t){var i,r;i=e.changedRecords?e.changedRecords.length:e.length;for(var n=0;n<i;n++){r=e.changedRecords?e.changedRecords[parseInt(n.toString(),10)]:e[parseInt(n.toString(),10)];for(var a=Object.keys(r).length,s=0,o=Object.keys(r);s<a;s++){var l=o[parseInt(s.toString(),10)];this.parent.editedRecords[parseInt(n.toString(),10)][""+l]=r[""+l],this.parent.editedRecords[parseInt(n.toString(),10)].taskData[""+l]=r[""+l]}null!==this.parent.taskFields.id&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.taskId=r[this.parent.taskFields.id]),null!==this.parent.taskFields.name&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.taskName=r[this.parent.taskFields.name]),null!==this.parent.taskFields.startDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.startDate=r[this.parent.taskFields.startDate]),null!==this.parent.taskFields.endDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.endDate=r[this.parent.taskFields.endDate]),null!==this.parent.taskFields.duration&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.duration=parseInt(r[this.parent.taskFields.duration])),null!==this.parent.taskFields.durationUnit&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.durationUnit=r[this.parent.taskFields.durationUnit]),null!==this.parent.taskFields.progress&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.progress=r[this.parent.taskFields.progress]),null!==this.parent.taskFields.dependency&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.dependency=r[this.parent.taskFields.dependency]),null!==this.parent.taskFields.parentID&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.parentID=r[this.parent.taskFields.parentID]),null!==this.parent.taskFields.baselineEndDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.baselineEndDate=r[this.parent.taskFields.baselineEndDate]),null!==this.parent.taskFields.baselineStartDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.baselineStartDate=r[this.parent.taskFields.baselineStartDate]),null!==this.parent.taskFields.resourceInfo&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.resources=r[this.parent.taskFields.resourceInfo])}this.saveSuccess(t)},e.prototype.dmFailure=function(e,t){if(this.deletedTaskDetails.length){for(var i=this.deletedTaskDetails,r=0;r<i.length;r++)i[r].isDelete=!1;this.deletedTaskDetails=[]}this.reUpdatePreviousRecords(!0,!0),this.resetEditProperties(),this.parent.trigger("actionFailure",{error:e})},e.prototype.updateSharedTask=function(e){for(var t=e.ganttProperties.sharedTaskUniqueIds,n=0;n<t.length;n++){var a=this.parent.flatData[this.parent.ids.indexOf(t[n].toString())];a&&a.uniqueID!==e.uniqueID&&(this.updateGanttProperties(e,a),this.parent.setRecordValue("taskData",e.taskData,a,!0),this.parent.dataOperation.updateTaskData(a),this.parent.dataOperation.updateResourceName(a),i.i(r.isNullOrUndefined)(a.parentItem)||this.parent.dataOperation.updateParentItems(a.parentItem))}},e.prototype.saveSuccess=function(e){var t={};if(this.parent.timelineSettings.updateTimescaleView){var n=this.parent.editedRecords;this.parent.timelineModule.updateTimeLineOnEditing([n],e.action)}if("ResourceView"===this.parent.viewType){"TaskbarEditing"===e.action||"DrawConnectorLine"===e.action?this.updateSharedTask(e.data):"DialogEditing"!==e.action&&"CellEditing"!==e.action&&"methodUpdate"!==e.action||(this.parent.editModule.dialogModule.isResourceUpdate?(this.updateResoures(this.parent.editModule.dialogModule.previousResource,e.data.ganttProperties.resourceInfo,e.data),this.updateSharedTask(e.data),this.isTreeGridRefresh=!0):this.updateSharedTask(e.data));for(var a=0;a<this.updateParentRecords.length;a++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[a]);this.updateParentRecords=[],this.parent.editModule.dialogModule.isResourceUpdate=!1,this.parent.editModule.dialogModule.previousResource=[]}if(this.isTreeGridRefresh||(this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation&&(this.parent.contentHeight=this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,this.parent.ganttChartModule.chartBodyContent.style.height=this.parent.contentHeight+"px",this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData),this.parent.taskFields.dependency&&this.parent.ganttChartModule.reRenderConnectorLines()),this.parent.isConnectorLineUpdate&&!i.i(r.isNullOrUndefined)(this.parent.connectorLineEditModule)&&(this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.editedRecords),this.updateScheduleDatesOnEditing(e))),this.parent.enableCriticalPath){var o=this.parent.criticalPathModule;o.showCriticalPath(!0),o.criticalConnectorLine(o.criticalPathCollection,o.detailPredecessorCollection,!0,o.predecessorCollectionTaskIds)}!this.parent.editSettings.allowTaskbarEditing||this.parent.editSettings.allowTaskbarEditing&&!this.taskbarEditModule.dependencyCancel?(t.requestType="save",t.data=e.data,t.modifiedRecords=this.parent.editedRecords,t.modifiedTaskData=i.i(s.e)(this.parent.editedRecords,null,null,this.parent),i.i(r.isNullOrUndefined)(e.action)||i.i(r.setValue)("action",e.action,t),"TaskbarEditing"===e.action&&(t.taskBarEditAction=e.taskBarEditAction),this.endEditAction(e),this.parent.trigger("actionComplete",t),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()):(this.taskbarEditModule.dependencyCancel=!1,this.resetEditProperties()),"ResourceView"===this.parent.viewType&&this.isTreeGridRefresh&&(this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.isTreeGridRefresh=!1)},e.prototype.updateResoures=function(e,t,i){var r=this.parent.flatData,n=t?t.length:0,a=e?e.length:0;if(0!==n||0!==a){for(var s=0;s<n;s++){var o=[],l=parseInt(t[s][this.parent.resourceFields.id],10).toString();"NaN"===l&&(l=t[s][this.parent.resourceFields.id]);for(var d=0;d<e.length;d++){var h=parseInt(e[d][this.parent.resourceFields.id],10).toString();if("NaN"===h&&(h=e[d][this.parent.resourceFields.id]),h===l){o.push(d);break}}if(0===o.length){var p=r[this.parent.getTaskIds().indexOf("R"+l)];p&&this.addNewRecord(i,p)}else{var u=parseInt(o[0].toString(),10);"NaN"===u.toString()&&(u=o[0].toString()),e.splice(u,1)}}for(var c=e?e.length:0,s=0;s<c;s++)for(var g=i.ganttProperties.taskId,l=e[s][this.parent.resourceFields.id],f=r[this.parent.getTaskIds().indexOf("R"+l)],m=0;m<f.childRecords.length;m++)f.childRecords[m].ganttProperties.taskId===g&&this.removeChildRecord(f.childRecords[m]);if(n>0){var y=this.parent.getParentTask(i.parentItem);y&&y.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.removeChildRecord(i)}0===n&&this.checkWithUnassignedTask(i)}},e.prototype.checkWithUnassignedTask=function(e){for(var t=null,n=0;n<this.parent.flatData.length;n++)this.parent.flatData[n].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&(t=this.parent.flatData[n]);if(i.i(r.isNullOrUndefined)(t)){var a={};a[this.parent.taskFields.id]=0,a[this.parent.taskFields.name]=this.parent.localeObj.getConstant("unassignedTask");var s=this.parent.isOnEdit;this.parent.isOnEdit=!1;var o=this.parent.dataOperation.createRecord(a,0);this.parent.isOnEdit=s,this.addRecordAsBottom(o);var l=this.parent.flatData[this.parent.flatData.length-1];this.addNewRecord(e,l);this.parent.dataSource.push(e.taskData)}else this.addNewRecord(e,t);var d=this.parent.currentViewData.filter(function(t){return t.ganttProperties.taskId===e.ganttProperties.taskId&&t.hasChildRecords===e.hasChildRecords})[0];e.parentItem=d.parentItem,e.parentUniqueID=d.parentUniqueID},e.prototype.addRecordAsBottom=function(e){var t=this.parent.flatData.length;this.parent.currentViewData.splice(t+1,0,e),this.parent.flatData.splice(t+1,0,e),this.parent.ids.splice(t+1,0,e.ganttProperties.rowUniqueID.toString());var i=0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId;this.parent.getTaskIds().splice(t+1,0,i),this.updateTreeGridUniqueID(e,"add")},e.prototype.addNewRecord=function(e,t){var n=null;n=i.i(r.extend)({},{},e,!0),this.parent.setRecordValue("uniqueID",i.i(a.getUid)(this.parent.element.id+"_data_"),n),this.parent.setRecordValue("uniqueID",n.uniqueID,n.ganttProperties,!0);var s=n.uniqueID.replace(this.parent.element.id+"_data_","");this.parent.setRecordValue("rowUniqueID",s,n),this.parent.setRecordValue("rowUniqueID",s,n.ganttProperties,!0),this.parent.setRecordValue("level",1,n),this.parent.taskFields.parentID&&this.parent.setRecordValue("parentId",t.ganttProperties.taskId,n.ganttProperties,!0),this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(t),n);var o=n.parentItem?n.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",o,n),e.ganttProperties.sharedTaskUniqueIds.push(s),n.ganttProperties.sharedTaskUniqueIds=e.ganttProperties.sharedTaskUniqueIds,this.addRecordAsChild(t,n)},e.prototype.removeChildRecord=function(e){var t=this.parent,i=[];i=this.parent.dataSource instanceof n.DataManager&&this.parent.dataSource.dataSource.json.length>0?this.parent.dataSource.dataSource.json:this.parent.currentViewData;var r=this.parent.dataSource,a=e,s=this.parent.getParentTask(a.parentItem);if(a){if(a.parentItem){var o=s?s.childRecords:[],l=0;o&&o.length>0&&(1===o.length&&(this.parent.isOnDelete=!0,o[0].isDelete=!0,this.parent.dataOperation.updateParentItems(s),this.parent.isOnDelete=!1,o[0].isDelete=!1),l=o.indexOf(a),s.childRecords.splice(l,1),this.updateParentRecords.push(s))}if(a.ganttProperties.sharedTaskUniqueIds.length){var d=a.ganttProperties.sharedTaskUniqueIds.indexOf(a.ganttProperties.rowUniqueID);a.ganttProperties.sharedTaskUniqueIds.splice(d,1)}if(this.updateTreeGridUniqueID(a,"delete"),!this.parent.taskFields.parentID){var h=[];h.push(a.ganttProperties.rowUniqueID.toString()),"ProjectView"===this.parent.viewType&&this.parent.editModule.removeFromDataSource(h)}var p=this.parent.flatData.indexOf(a);if(t.taskFields.parentID){for(var u=void 0,c=this.parent.currentViewData,g=0;g<c.length;g++)c[g].ganttProperties.rowUniqueID===a.ganttProperties.rowUniqueID&&(u=g);-1!==u&&(r.length>0&&r.splice(u,1),i.splice(u,1),this.parent.flatData.splice(p,1),this.parent.ids.splice(p,1),this.parent.getTaskIds().splice(p,1))}var f=i.indexOf(a);if(!t.taskFields.parentID){var m=this.parent.editModule.getChildCount(a,0);i.splice(f,m+1),this.parent.flatData.splice(p,m+1),this.parent.ids.splice(p,m+1),this.parent.getTaskIds().splice(p,m+1)}a.parentItem&&s&&s.childRecords&&!s.childRecords.length&&(this.parent.setRecordValue("expanded",!1,s),this.parent.setRecordValue("hasChildRecords",!1,s))}},e.prototype.addRecordAsChild=function(e,t){var n,a=this.parent,s=this.parent.flatData.indexOf(e),o=this.parent.editModule.getChildCount(e,0);if(!i.i(r.isNullOrUndefined)(this.addRowIndex)&&this.addRowPosition&&e.childRecords&&"Child"!==this.addRowPosition){var l=e.childRecords[this.addRowIndex],d="Above"===this.addRowPosition||"Below"===this.addRowPosition?this.addRowPosition:"Child";n=l?this.addRowIndex+s+1:o+s+1,n="Above"===d?n:n+1}else n=i.i(r.isNullOrUndefined)(o)||0===o?s+1:o+s+1;this.parent.currentViewData.splice(n,0,t),this.parent.flatData.splice(n,0,t),this.parent.ids.splice(n,0,t.ganttProperties.rowUniqueID.toString()),this.updateTreeGridUniqueID(t,"add");var h=0===t.level?"R"+t.ganttProperties.taskId:"T"+t.ganttProperties.taskId;this.parent.getTaskIds().splice(n,0,h),e.hasChildRecords||(this.parent.setRecordValue("hasChildRecords",!0,e),this.parent.setRecordValue("expanded",!0,e),e.childRecords.length||(e.childRecords=[],!a.taskFields.parentID&&i.i(r.isNullOrUndefined)(e.taskData[this.parent.taskFields.child])&&(e.taskData[this.parent.taskFields.child]=[]))),e.childRecords.splice(e.childRecords.length,0,t),i.i(r.isNullOrUndefined)(t)||this.parent.taskFields.parentID||i.i(r.isNullOrUndefined)(e.taskData[this.parent.taskFields.child])||e.taskData[this.parent.taskFields.child].splice(e.childRecords.length,0,t.taskData),i.i(r.isNullOrUndefined)(t.parentItem)||this.updateParentRecords.push(e)},e.prototype.resetEditProperties=function(e){this.parent.currentEditedArgs={},this.resetValidateArgs(),this.parent.editedTaskBarItem=null,this.parent.isOnEdit=!1,this.validatedChildItems=[],this.parent.isConnectorLineUpdate=!1,this.parent.editedTaskBarItem=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,i.i(r.isNullOrUndefined)(this.dialogModule)||!i.i(r.isNullOrUndefined)(e)&&(i.i(r.isNullOrUndefined)(e)||"beforeSave"!==e.requestType||e.cancel)||(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose()),this.parent.hideSpinner(),this.parent.initiateEditAction(!1)},e.prototype.endEditAction=function(e){this.resetEditProperties(),"TaskbarEditing"===e.action?this.parent.trigger("taskbarEdited",e):"CellEditing"===e.action?this.parent.trigger("endEdit",e):"DialogEditing"===e.action&&(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose())},e.prototype.saveFailed=function(e){this.reUpdatePreviousRecords(),this.parent.hideSpinner()},e.prototype.renderDeleteConfirmDialog=function(){var e=new h.Dialog({width:"320px",isModal:!0,visible:!1,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmDelete"),buttons:[{click:this.confirmDeleteOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.closeConfirmDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});e.appendTo("#"+this.parent.element.id+"_deleteConfirmDialog"),this.confirmDialog=e},e.prototype.closeConfirmDialog=function(){this.confirmDialog.hide()},e.prototype.confirmDeleteOkButton=function(){this.deleteSelectedItems(),this.confirmDialog.hide(),this.parent.element.querySelector(".e-treegrid").focus()},e.prototype.startDeleteAction=function(){if(this.parent.editSettings.allowDeleting&&!this.parent.readOnly)if(this.parent.editSettings.showDeleteConfirmDialog)this.confirmDialog.show();else{this.deleteSelectedItems();var e=this.parent.element.querySelector(".e-treegrid");e.focus()}},e.prototype.deleteResourceRecords=function(e){for(var t=[],i=this,r=0;r<e.length;r++)!function(r){if(e[r].parentItem){if(1===e[r].ganttProperties.sharedTaskUniqueIds.length){for(var n=e[r],a=n.ganttProperties.sharedTaskUniqueIds,s=0;s<a.length;s++)-1!==i.parent.ids.indexOf(a[s].toString())&&t.push(i.parent.flatData[i.parent.ids.indexOf(a[s].toString())]);-1!==i.parent.ids.indexOf(n.ganttProperties.rowUniqueID)&&t.push(i.parent.flatData[i.parent.ids.indexOf(n.ganttProperties.rowUniqueID)])}}else{var o=i.parent.flatData.filter(function(t){return t.ganttProperties.taskId===e[r].ganttProperties.taskId&&t.hasChildRecords})[0];t.push(o)}}(r);this.deleteRow(t)},e.prototype.deleteSelectedItems=function(){if(this.isFromDeleteMethod)this.targetedRecords.length&&("ResourceView"===this.parent.viewType?this.deleteResourceRecords(this.targetedRecords):this.deleteRow(this.targetedRecords)),this.isFromDeleteMethod=!1;else{var e=[];"Cell"!==this.parent.selectionSettings.mode?e=this.parent.selectionModule.getSelectedRecords():"Cell"===this.parent.selectionSettings.mode&&(e=this.parent.selectionModule.getCellSelectedRecords()),"ResourceView"===this.parent.viewType?this.deleteResourceRecords(e):this.deleteRow(e)}},e.prototype.deleteRecord=function(e){this.isFromDeleteMethod=!0;var t=typeof e;switch(this.targetedRecords=[],t){case"number":case"string":var n=e.toString();"ResourceView"===this.parent.viewType?i.i(r.isNullOrUndefined)(n)||-1===this.parent.getTaskIds().indexOf("T"+n)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+n)]):i.i(r.isNullOrUndefined)(n)||-1===this.parent.ids.indexOf(n)||this.targetedRecords.push(this.parent.getRecordByID(n));break;case"object":Array.isArray(e)?this.updateTargetedRecords(e):this.targetedRecords.push(e.valueOf())}this.startDeleteAction()},e.prototype.updateTargetedRecords=function(e){if(e.length){if("object"===typeof e[0])this.targetedRecords=e;else for(var t=0;t<e.length;t++){var n=e[t].toString();"ResourceView"===this.parent.viewType?i.i(r.isNullOrUndefined)(n)||-1===this.parent.getTaskIds().indexOf("T"+n)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+n)]):i.i(r.isNullOrUndefined)(n)||-1===this.parent.ids.indexOf(n)||this.targetedRecords.push(this.parent.getRecordByID(n))}}},e.prototype.deleteRow=function(e){var t=e&&e.length?e:this.parent.selectionModule.getSelectedRecords();if(this.parent.addDeleteRecord=!0,t.length){this.parent.isOnDelete=!0,t.forEach(function(e){e.isDelete=!0}),"ResourceView"!==this.parent.viewType||e.length||(t=[]);for(var n=0;n<t.length;n++){var a=t[n];if(-1===this.deletedTaskDetails.indexOf(a)){var s=this.parent.getParentTask(a.parentItem);if(a.parentItem){var o=s.childRecords;(1===o.length?o:o.filter(function(e){return!e.isDelete})).length>0&&this.parent.dataOperation.updateParentItems(a.parentItem)}var l=a.ganttProperties.predecessor,d=!0;"ResourceView"===this.parent.viewType&&s&&s.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(d=!1),l&&l.length&&d&&this.removePredecessorOnDelete(a),this.deletedTaskDetails.push(a),a.hasChildRecords&&this.deleteChildRecords(a)}}this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.clearSelection();var h={};h.deletedRecordCollection=this.deletedTaskDetails,h.updatedRecordCollection=this.parent.editedRecords,h.cancel=!1,h.action="delete",this.initiateDeleteAction(h),this.parent.isOnDelete=!1}i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.removePredecessorOnDelete=function(e){for(var t=e.ganttProperties.predecessor,n=0;n<t.length;n++){var a=t[n],s="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(a.from.toString()===s.toString()){var o=this.parent.connectorLineModule.getRecordByID(a.to.toString());if(!i.i(r.isNullOrUndefined)(o)){for(var l=i.i(r.extend)([],[],o.ganttProperties.predecessor,!0),d=void 0,h=0;h<l.length;h++){var p="ResourceView"===this.parent.viewType?o.ganttProperties.taskId:o.ganttProperties.rowUniqueID;if(l[h].to.toString()===p.toString()&&l[h].from.toString()===s.toString()){d=h;break}}l.splice(d,1),this.updatePredecessorValues(o,l)}}else if(a.to.toString()===s.toString()){var u=this.parent.connectorLineModule.getRecordByID(a.from.toString());if(!i.i(r.isNullOrUndefined)(u)){for(var c=i.i(r.extend)([],[],u.ganttProperties.predecessor,!0),d=void 0,h=0;h<c.length;h++){var g="ResourceView"===this.parent.viewType?u.ganttProperties.taskId:u.ganttProperties.rowUniqueID;if(c[h].from.toString()===g.toString()&&c[h].to.toString()===s.toString()){d=h;break}}c.splice(d,1),this.updatePredecessorValues(u,c)}}}},e.prototype.updatePredecessorValues=function(e,t){this.parent.setRecordValue("predecessor",t,e.ganttProperties,!0);var i=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",i,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,i,e),this.parent.setRecordValue(this.parent.taskFields.dependency,i,e)},e.prototype.updateTaskId=function(e,t){if(!this.parent.readOnly){var n="number"==typeof e?e.toString():e,a="number"==typeof t?t.toString():t,s=this.parent.ids;if(!i.i(r.isNullOrUndefined)(n)&&!i.i(r.isNullOrUndefined)(a)){var o=s.indexOf(n),l=s.indexOf(a);if(-1===o||l>-1)return;var d=this.parent.flatData[o];if(d.ganttProperties.taskId=d.ganttProperties.rowUniqueID=a,d.taskData[this.parent.taskFields.id]=a,d[this.parent.taskFields.id]=a,s[o]=a,d.hasChildRecords&&this.parent.taskFields.parentID)for(var h=d.childRecords,p=0;p<h.length;p++){var u=h[p];u[this.parent.taskFields.parentID]=t,this.parent.chartRowsModule.refreshRecords([u])}if(this.parent.taskFields.dependency&&!i.i(r.isNullOrUndefined)(d.ganttProperties.predecessor))for(var c=d.ganttProperties.predecessor,g=void 0,f=0;f<c.length;f++){var m=c[f];m.to===n?g=this.parent.flatData[s.indexOf(m.from)]:m.from===n&&(g=this.parent.flatData[s.indexOf(m.to)]),this.updatePredecessorOnUpdateId(g,n,a)}this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh()}}},e.prototype.updatePredecessorOnUpdateId=function(e,t,i){if(this.parent.flatData.indexOf(e)>-1)for(var r=e.ganttProperties.predecessor,n=0;n<r.length;n++){var a=r[n];a.to===t?a.to=i:a.from===t&&(a.from=i)}this.updatePredecessorValues(e,e.ganttProperties.predecessor)},e.prototype.deleteChildRecords=function(e){for(var t=e.childRecords,i=0;i<t.length;i++){var r=t[i];if(-1===this.deletedTaskDetails.indexOf(r)){var n=r.ganttProperties.predecessor,a=!0,s=this.parent.getParentTask(r.parentItem);"ResourceView"===this.parent.viewType&&s&&s.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(a=!1),n&&n.length&&a&&this.removePredecessorOnDelete(r),this.deletedTaskDetails.push(r),r.hasChildRecords&&this.deleteChildRecords(r)}}},e.prototype.removeFromDataSource=function(e){var t;t=this.parent.dataSource instanceof n.DataManager?this.parent.dataSource.dataSource.json:this.parent.dataSource,this.removeData(t,e),this.isBreakLoop=!1},e.prototype.removeData=function(e,t){for(var n=0;n<e.length&&!this.isBreakLoop;n++)if(-1!==t.indexOf(i.i(r.getValue)(this.parent.taskFields.id,e[n]).toString())){if(e[n][this.parent.taskFields.child]){var a=e[n][this.parent.taskFields.child];this.removeData(a,t)}if(t.splice(t.indexOf(i.i(r.getValue)(this.parent.taskFields.id,e[n]).toString()),1),e.splice(n,1),0===t.length){this.isBreakLoop=!0;break}}else if(e[n][this.parent.taskFields.child]){var a=e[n][this.parent.taskFields.child];this.removeData(a,t)}},e.prototype.initiateDeleteAction=function(e){var t=this;this.parent.showSpinner();var a={};a.requestType="beforeDelete",a.data=e.deletedRecordCollection,a.modifiedRecords=e.updatedRecordCollection,a.modifiedTaskData=i.i(s.e)(e.updatedRecordCollection,null,null,this.parent),this.parent.trigger("actionBegin",a,function(a){if(i.i(r.isNullOrUndefined)(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),a.cancel){for(var o=t.deletedTaskDetails,l=0;l<o.length;l++)o[l].isDelete=!1;t.deletedTaskDetails=[],t.reUpdatePreviousRecords(),t.parent.initiateEditAction(!1),t.parent.hideSpinner()}else if(i.i(s.f)(t.parent.dataSource)){var d=t.parent.dataSource;t.parent.timezone&&i.i(s.g)(a.modifiedTaskData,t.parent);var h={deletedRecords:i.i(s.e)(a.data,null,null,t.parent),changedRecords:a.modifiedTaskData},p=d.adaptor,u=t.parent.query instanceof n.Query?t.parent.query:new n.Query;if(p instanceof n.WebApiAdaptor&&p instanceof n.ODataAdaptor&&!d.dataSource.batchUrl){for(var c=null,g=0;g<h.deletedRecords.length;g++)c=d.remove(t.parent.taskFields.id,h.deletedRecords[g],null,u);c.then(function(){d.update(t.parent.taskFields.id,h.changedRecords,null,u).then(function(){return t.deleteSuccess(e)}).catch(function(i){return t.dmFailure(i,e)})}).catch(function(i){return t.dmFailure(i,e)})}else{var f=d.saveChanges(h,t.parent.taskFields.id,null,u);f.then(function(){return t.deleteSuccess(e)}).catch(function(i){return t.dmFailure(i,e)})}}else t.deleteSuccess(e)})},e.prototype.deleteSuccess=function(e){var t=this,n=this.parent.flatData,a=this.parent.currentViewData,o=this.parent.getRecordFromFlatdata(e.deletedRecordCollection),l=[];o.length>0&&(this.parent.selectedRowIndex=o[o.length-1].index);for(var d=0;d<o.length;d++){var h=o[d],p=a.indexOf(h),u=n.indexOf(h),c=this.parent.treeGrid.parentData.indexOf(h),g=i.i(r.getValue)("dataOperation.dataArray",this.parent),f=g.indexOf(h.taskData),m=void 0;if(-1!==p&&a.splice(p,1),-1!==u&&n.splice(u,1),-1!==f&&g.splice(f,1),!i.i(r.isNullOrUndefined)(h)){if(l.push(h.ganttProperties.taskId.toString()),-1!==u&&(this.parent.ids.splice(u,1),"ResourceView"===this.parent.viewType&&(this.parent.getTaskIds().splice(u,1),this.isResourceTaskDeleted=!0,h.hasChildRecords||(h.ganttProperties.resourceInfo=null,delete h.ganttProperties.resourceNames,h[this.parent.taskFields.resourceInfo]=null,h.ganttProperties.sharedTaskUniqueIds=[],delete h.taskData[this.parent.taskFields.resourceInfo]))),0===h.level&&-1!==c&&this.parent.treeGrid.parentData.splice(c,1),h.parentItem){var y=this.parent.getParentTask(h.parentItem);if(y){var D=y.childRecords;m=D.indexOf(h),-1!==m&&D.splice(m,1),D.length||this.parent.setRecordValue("hasChildRecords",!1,y)}}this.updateTreeGridUniqueID(h,"delete")}}l.length>0&&this.removeFromDataSource(l);var v={};if(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(),v.requestType="delete",v.data=e.deletedRecordCollection,v.modifiedRecords=e.updatedRecordCollection,v.modifiedTaskData=i.i(s.e)(e.updatedRecordCollection,null,null,this.parent),i.i(r.setValue)("action",e.action,v),this.parent.isOnDelete=!1,"ResourceView"===this.parent.viewType)for(var w=v.data.filter(function(e){return!e.hasChildRecords}),k=this,d=0;d<w.length;d++)!function(e){var i=k.parent.flatData.filter(function(e){return e.ganttProperties.taskName===t.parent.localeObj.getConstant("unassignedTask")})[0],r=[];i&&(r=i.childRecords.filter(function(t){return t.ganttProperties.taskId===w[e].ganttProperties.taskId}));var n=k.parent.getParentTask(w[e].parentItem);n&&n.ganttProperties.taskName!==k.parent.localeObj.getConstant("unassignedTask")&&0===r.length?k.checkWithUnassignedTask(w[e]):n||r&&0!==r.length||k.checkWithUnassignedTask(w[e]),i=k.parent.flatData.filter(function(e){return e.ganttProperties.taskName===t.parent.localeObj.getConstant("unassignedTask")})[0];var a=k.parent.currentViewData.filter(function(t){return t.ganttProperties.taskId==w[e].ganttProperties.taskId&&!t.hasChildRecords&&t.parentItem&&i.uniqueID===t.parentItem.uniqueID?t:null});a[0]&&k.parent.dataOperation.updateParentItems(a[0])}(d);this.parent.trigger("actionComplete",v),this.deletedTaskDetails=[],this.parent.initiateEditAction(!1),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.getNewTaskId=function(){var e="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,t=e.length,i=t+1;if("ResourceView"===this.parent.viewType){if((-1!==e.indexOf("T"+i)||-1!==e.indexOf("R"+i))&&(i+=1,-1!==e.indexOf("T"+i)||-1!==e.indexOf("R"+i)))do{i+=1}while(-1!==e.indexOf("T"+i)||-1!==e.indexOf("R"+i))}else if(-1!=e.indexOf(i.toString())&&(i+=1,-1!=e.indexOf(i.toString())))do{i+=1}while(-1!=e.indexOf(i.toString()));return"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?i=i.toString():i},e.prototype.prepareNewlyAddedData=function(e,t){var n,a,s=this.parent.taskFields,o=this.parent.ids;if(e[s.id]&&(-1!==o.indexOf(e[s.id].toString())?e[s.id]=null:(a="string"==typeof e[s.id]?e[s.id]:parseInt(e[s.id],10),e[s.id]=i.i(r.isNullOrUndefined)(a)?null:a)),e[s.id]||(n=this.getNewTaskId(),e[s.id]=n),this.parent.allowUnscheduledTasks||e[s.startDate]||(e[s.startDate]=this.parent.projectStartDate),!this.parent.allowUnscheduledTasks&&s.duration&&i.i(r.isNullOrUndefined)(e[s.duration])&&(e[s.endDate]||(e[s.duration]="5")),s.progress&&(e[s.progress]=e[s.progress]?e[s.progress]>100?100:e[s.progress]:0),!this.parent.allowUnscheduledTasks&&!e[s.endDate]&&s.endDate&&!e[s.duration]){var l=this.parent.dataOperation.getDateFromFormat(this.parent.projectStartDate);l.setDate(l.getDate()+4),e[s.endDate]=this.parent.getFormatedDate(l,this.parent.getDateFormat())}},e.prototype.updateNewlyAddedDataBeforeAjax=function(e,t,n,a){var s=this.parent.dataOperation.createRecord(e,t);if(s.index=parseInt(s.ganttProperties.rowUniqueID.toString(),10)-1,!i.i(r.isNullOrUndefined)(a)){this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(a),s);var o=s.parentItem?s.parentItem.index:null;this.parent.setRecordValue("parentIndex",o,s);var l=s.parentItem?s.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",l,s),i.i(r.isNullOrUndefined)(this.parent.taskFields.id)||i.i(r.isNullOrUndefined)(this.parent.taskFields.parentID)||!s.parentItem||("ProjectView"===this.parent.viewType&&this.parent.setRecordValue(this.parent.taskFields.parentID,s.parentItem.taskId,s.taskData,!0),this.parent.setRecordValue("parentId",s.parentItem.taskId,s.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.parentID,s.parentItem.taskId,s,!0))}return this.parent.isOnEdit=!0,this.backUpAndPushNewlyAddedRecord(s,n,a),this.parent.taskFields.dependency&&s.ganttProperties.predecessorsName&&(this.parent.predecessorModule.ensurePredecessorCollectionHelper(s,s.ganttProperties),this.parent.predecessorModule.updatePredecessorHelper(s),this.parent.predecessorModule.validatePredecessorDates(s)),s.parentItem&&this.parent.getParentTask(s.parentItem).ganttProperties.isAutoSchedule&&this.parent.dataOperation.updateParentItems(s.parentItem),this.parent.isOnEdit=!1,s},e.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)i=e.childRecords[r],t++,i.hasChildRecords&&(t=this.getChildCount(i,t));return t},e.prototype.getVisibleChildRecordCount=function(e,t,i){var r,n;if(e.hasChildRecords){r=e.childRecords,n=r.length;for(var a=0;a<n;a++)-1!==i.indexOf(r[a])&&t++,r[a].hasChildRecords&&(t=this.getVisibleChildRecordCount(r[a],t,i))}else-1!==i.indexOf(e)&&t++;return t},e.prototype.updatePredecessorOnIndentOutdent=function(e){for(var t,n,a=e.ganttProperties.predecessor.length,o=e.ganttProperties,l=o.predecessor,d=[],h=0;h<a;h++)if(l[h].to===o.rowUniqueID.toString()){t=this.parent.getRecordByID(l[h].from),n=i.i(s.h)(l[h],"from",t.ganttProperties.predecessor,"to");var p=i.i(r.extend)([],t.ganttProperties.predecessor,[],!0);p.splice(n,1),this.parent.setRecordValue("predecessor",p,t.ganttProperties,!0)}else if(l[h].from===o.rowUniqueID.toString()){t=this.parent.getRecordByID(l[h].to);var u=t.ganttProperties.predecessorsName.toString().split(","),c=l[h].from+l[h].type,g=u.indexOf(c);u.splice(g,1),this.parent.setRecordValue("predecessorsName",u.join(","),t.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.dependency,u.join(","),t),n=i.i(s.h)(l[h],"from",t.ganttProperties.predecessor,"to");var f=i.i(r.extend)([],t.ganttProperties.predecessor,[],!0);f.splice(n,1),this.parent.setRecordValue("predecessor",f,t.ganttProperties,!0),this.parent.predecessorModule.validatePredecessorDates(t)}this.parent.setRecordValue("predecessor",d,e.ganttProperties,!0),this.parent.setRecordValue("predecessorsName","",e.ganttProperties,!0)},e.prototype.predecessorToString=function(e,t){var i=[],r=0,n=e.length;for(r;r<n;r++)if(t.ganttProperties.rowUniqueID.toString()!==e[r].from){var a=e[r].from+e[r].type;e[r].offset=isNaN(e[r].offset)?0:e[r].offset,0!==e[r].offset&&(e[r].offset<0?a+=e[r].offset.toString()+"d":e[r].offset>0&&(a+="+"+e[r].offset.toString()+"d")),i.push(a)}return i.join(",")},e.prototype.backUpAndPushNewlyAddedRecord=function(e,t,n){var a,s,o,l=this.parent.flatData,d=this.parent.currentViewData,h=this.parent.ids;switch(t){case"Top":l.splice(0,0,e),d.splice(0,0,e),h.splice(0,0,e.ganttProperties.rowUniqueID.toString());break;case"Bottom":if(l.push(e),d.push(e),h.push(e.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var p=0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId;this.parent.getTaskIds().push(p)}break;case"Above":s=l.indexOf(this.addRowSelectedItem),o=d.indexOf(this.addRowSelectedItem),this.recordCollectionUpdate(void 0,s,o,e,n,t);break;case"Below":if(a=l.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){var u=this.getChildCount(this.addRowSelectedItem,0);s=a+u+1,o=d.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,d)+1}else s=a+1,o=d.indexOf(this.addRowSelectedItem)+1;this.recordCollectionUpdate(NaN,s,o,e,n,t);break;case"Child":if(a=l.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){var u=this.getChildCount(this.addRowSelectedItem,0);s=a+u+1,this.addRowSelectedItem.expanded||this.parent.enableMultiTaskbar||this.parent.expandByID(this.addRowSelectedItem.ganttProperties.rowUniqueID),o=d.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,d)+1}else this.parent.setRecordValue("hasChildRecords",!0,this.addRowSelectedItem),this.parent.setRecordValue("isMilestone",!1,this.addRowSelectedItem.ganttProperties,!0),this.parent.setRecordValue("expanded",!0,this.addRowSelectedItem),this.parent.setRecordValue("childRecords",[],this.addRowSelectedItem),s=a+1,o=d.indexOf(this.addRowSelectedItem)+1,this.addRowSelectedItem.ganttProperties.predecessor&&this.updatePredecessorOnIndentOutdent(this.addRowSelectedItem),i.i(r.isNullOrUndefined)(this.addRowSelectedItem.ganttProperties.segments)||(this.addRowSelectedItem.ganttProperties.segments=null);this.recordCollectionUpdate(NaN,s,o,e,n,t)}this.newlyAddedRecordBackup=e},e.prototype.recordCollectionUpdate=function(e,t,a,s,o,l){var d=this.parent.flatData,h=this.parent.currentViewData,p=this.parent.ids;if(d.splice(t,0,s),h.splice(a,0,s),"ResourceView"===this.parent.viewType&&"number"==typeof s.ganttProperties.taskId){var u=s.ganttProperties.taskId;p.push(u.toString())}if(p.splice(t,0,s.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var c=0===s.level?"R"+s.ganttProperties.taskId:"T"+s.ganttProperties.taskId;this.parent.getTaskIds().splice(t,0,c)}if(!i.i(r.isNullOrUndefined)(o)&&(e="Above"==l?o.childRecords.indexOf(this.addRowSelectedItem):"Below"==l?o.childRecords.indexOf(this.addRowSelectedItem)+1:o.childRecords.length,o.childRecords.splice(e,0,s),this.parent.taskFields.child||(this.parent.taskFields.child="Children"),this.parent.dataSource instanceof n.DataManager&&i.i(r.isNullOrUndefined)(o.taskData[this.parent.taskFields.parentID])||!i.i(r.isNullOrUndefined)(this.parent.dataSource))){var g=this.parent.taskFields.child;o.taskData[g]&&o.taskData[g].length>0?"Above"===l||"Below"===l?o.taskData[g].splice(e,0,s.taskData):o.taskData[g].push(s.taskData):(o.taskData[g]=[],o.taskData[g].push(s.taskData)),this.isNewRecordAdded=!0}},e.prototype.constructTaskAddedEventArgs=function(e,t,r){var n={};if(n.action=n.requestType=r,e.length>1){n.data=[],n.newTaskData=[],n.recordIndex=[];for(var a=0;a<e.length;a++)n.data[a]=e[a],n.newTaskData[a]=i.i(s.e)([e[a]],n.data[a],n,this.parent),n.recordIndex[a]=e[a].index}else if(1===e.length)for(var a=0;a<e.length;a++)n.data=e[a],n.newTaskData=i.i(s.e)([e[a]],n.data,n,this.parent),n.recordIndex=e[a].index;return n.modifiedRecords=t,n.modifiedTaskData=i.i(s.e)(t,null,null,this.parent),n},e.prototype.addSuccess=function(e){this.parent.treeGrid.parentData=[],this.parent.addDeleteRecord=!0,this.parent.selectedRowIndex=0,this.parent.treeGrid.isAddedFromGantt=!0,this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&(this.parent.modifiedRecords=e.modifiedRecords,this.parent.modifiedRecords.push(e.data),this.refreshRecordInImmutableMode())},e.prototype.refreshRecordInImmutableMode=function(e,t){if(!t&&!i.i(r.isNullOrUndefined)(e))for(var n=e[0].index+1;n<this.parent.currentViewData.length&&e[0].level<this.parent.currentViewData[n].level;n++)this.parent.modifiedRecords.push(this.parent.currentViewData[n]);for(var a=this,n=0;n<this.parent.modifiedRecords.length;n++)!function(e){var t=a.parent.modifiedRecords[e],i=a.parent.allowRowDragAndDrop?1:0,r=a.parent.taskFields.id,n=a.parent.currentViewData.findIndex(function(e){return e[r]===t[r]});a.parent.treeGrid.getRows()[n]&&(a.parent.treeGrid.renderModule.cellRender({data:t,cell:a.parent.treeGrid.getRows()[n].cells[a.parent.treeColumnIndex+i],column:a.parent.treeGrid.grid.getColumns()[a.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),a.parent.treeGrid.renderModule.RowModifier({data:t,row:a.parent.treeGrid.getRows()[n],rowHeight:a.parent.rowHeight}))}(n)},e.prototype.updateRealDataSource=function(e,t){var a=this.parent.taskFields,o=i.i(s.i)(this.parent)?i.i(r.getValue)("result",this.parent.dataSource):this.parent.dataSource;this.parent.dataSource instanceof n.DataManager&&(o=this.parent.dataSource.dataSource.json);for(var l=0;l<e.length;l++)(i.i(r.isNullOrUndefined)(t)||i.i(r.isNullOrUndefined)(this.addRowSelectedItem))&&(t="Bottom"===t?"Bottom":"Top"),"Top"===t?o.splice(0,0,e[l].taskData):"Bottom"===t?o.push(e[l].taskData):i.i(r.isNullOrUndefined)(a.id)||i.i(r.isNullOrUndefined)(a.parentID)?(this.isNewRecordAdded||this.addDataInRealDataSource(o,e[l].taskData,t),this.isNewRecordAdded=!1):o.push(e[l].taskData),this.isBreakLoop=!1},e.prototype.addDataInRealDataSource=function(e,t,n){for(var a=0;a<e.length;a++){var s=this.parent.taskFields.child;if(this.isBreakLoop)break;if(i.i(r.getValue)(this.parent.taskFields.id,e[a]).toString()===this.addRowSelectedItem.ganttProperties.rowUniqueID.toString()){"Above"===n?e.splice(a,0,t):"Below"===n?e.splice(a+1,0,t):"Child"===n&&(e[a][s]&&e[a][s].length>0?e[a][s].push(t):(e[a][s]=[],e[a][s].push(t))),this.isBreakLoop=!0;break}if(e[a][s]){var o=e[a][s];this.addDataInRealDataSource(o,t,n)}}},e.prototype.updateClientDataFromServer=function(e,t){for(var i=e.addedRecords[0],r=Object.keys(i).length,n=0,a=Object.keys(i);n<r;n++){var s=a[parseInt(n.toString(),10)];t.data[""+s]=i[""+s]}null!==this.parent.taskFields.id&&(t.data.ganttProperties.taskId=i[this.parent.taskFields.id]),null!==this.parent.taskFields.name&&(t.data.ganttProperties.taskName=i[this.parent.taskFields.name]),null!==this.parent.taskFields.startDate&&(t.data.ganttProperties.startDate=i[this.parent.taskFields.startDate]),null!==this.parent.taskFields.endDate&&(t.data.ganttProperties.endDate=i[this.parent.taskFields.endDate]),null!==this.parent.taskFields.duration&&(t.data.ganttProperties.duration=parseInt(i[this.parent.taskFields.duration])),null!==this.parent.taskFields.durationUnit&&(t.data.ganttProperties.durationUnit=i[this.parent.taskFields.durationUnit]),null!==this.parent.taskFields.progress&&(t.data.ganttProperties.progress=i[this.parent.taskFields.progress]),null!==this.parent.taskFields.dependency&&(t.data.ganttProperties.dependency=i[this.parent.taskFields.dependency]),null!==this.parent.taskFields.parentID&&(t.data.ganttProperties.parentID=i[this.parent.taskFields.parentID]),null!==this.parent.taskFields.baselineEndDate&&(t.data.ganttProperties.baselineEndDate=i[this.parent.taskFields.baselineEndDate]),null!==this.parent.taskFields.baselineStartDate&&(t.data.ganttProperties.baselineStartDate=i[this.parent.taskFields.baselineStartDate]),null!==this.parent.taskFields.resourceInfo&&(t.data.ganttProperties.resources=i[this.parent.taskFields.resourceInfo])},e.prototype.addRecord=function(e,t,a){var o=this,l=this.parent.taskFields.id;if(this.parent.editModule&&this.parent.editSettings.allowAdding){this.parent.isDynamicData=!0;var d=[];if(i.i(r.isNullOrUndefined)(e))this.validateTaskPosition(e,t,a,d);else if(e instanceof Array)for(var h=0;h<e.length;h++)this.validateTaskPosition(e[h],t,a,d);else{if("object"!=typeof e)return;this.validateTaskPosition(e,t,a,d)}var p={};p=this.constructTaskAddedEventArgs(d,this.parent.editedRecords,"beforeAdd"),this.parent.trigger("actionBegin",p,function(e){i.i(r.isNullOrUndefined)(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.showSpinner():o.parent.showMaskRow();var a=o.parent.taskFields,h="ResourceView"===o.parent.viewType?o.parent.flatData[o.parent.getTaskIds().indexOf("T"+e.data[a.id])]:o.parent.getRecordByID(e.data[a.id]);if(i.i(r.isNullOrUndefined)(h)||(o.validateUpdateValues(e.newTaskData,h,!0),o.parent.dateValidationModule.calculateEndDate(h),o.parent.dataOperation.updateWidthLeft(h),o.parent.dataOperation.updateParentItems(h)),i.i(r.isNullOrUndefined)(e.data[""+l])||e.data[l]!=e.data.ganttProperties.taskId&&(e.data.ganttProperties.taskId=e.data[l],e.newTaskData[l]=e.data[l]),e.cancel)e=e,o.removeAddedRecord(),o.reUpdatePreviousRecords(),o._resetProperties();else if(i.i(s.f)(o.parent.dataSource)){var p=o.parent.dataSource,u={addedRecords:[e.newTaskData],changedRecords:e.modifiedTaskData},c=e.data.ganttProperties.taskId.toString(),g=o.parent.query instanceof n.Query?o.parent.query:new n.Query,f=p.adaptor,m=f.getModuleName();if("WebApiAdaptor"!=m&&"ODataAdaptor"!=m&&"ODataV4Adaptor"!=m||p.dataSource.batchUrl){var y=p.saveChanges(u,o.parent.taskFields.id,null,g);y.then(function(t){if(o.parent.taskFields.id&&!i.i(r.isNullOrUndefined)(t.addedRecords[0][o.parent.taskFields.id])&&t.addedRecords[0][o.parent.taskFields.id].toString()==c){o.parent.setRecordValue("taskId",t.addedRecords[0][o.parent.taskFields.id],e.data.ganttProperties,!0),o.parent.setRecordValue("taskData",t.addedRecords[0],e.data),o.parent.setRecordValue(o.parent.taskFields.id,t.addedRecords[0][o.parent.taskFields.id],e.data),o.parent.setRecordValue("rowUniqueID",t.addedRecords[0][o.parent.taskFields.id].toString(),e.data.ganttProperties,!0),o.updateClientDataFromServer(t,e);var n=o.parent.ids.indexOf(c);-1!==n&&(o.parent.ids[n]=t.addedRecords[0][o.parent.taskFields.id].toString())}o.updateNewRecord(d,e)}).catch(function(t){o.removeAddedRecord(),o.dmFailure(t,e),o._resetProperties()})}else{var D=p.insert(u.addedRecords,null,g);D.then(function(t){i.i(r.isNullOrUndefined)(t[0])?u.addedRecords[0]:t[0],o.updateNewRecord(d,e)}).catch(function(t){o.removeAddedRecord(),o.dmFailure(t,e),o._resetProperties()})}}else{if("ProjectView"===o.parent.viewType){if("Top"===t||"Bottom"===t||"Above"===t||"Below"===t||"Child"===t||i.i(r.isNullOrUndefined)(t)&&!e.data.parentItem)if(e.data instanceof Array)o.updateRealDataSource(e.data,t);else{var v=[];v.push(e.data),o.updateRealDataSource(v,t),o.parent.currentSelection=d[0].ganttProperties}}else{var w=i.i(s.i)(o.parent)?i.i(r.getValue)("result",o.parent.dataSource):o.parent.dataSource;w.push(e.data.taskData)}0===d.level&&o.parent.treeGrid.parentData.splice(0,0,d),o.updateTreeGridUniqueID(d,"add"),o.refreshNewlyAddedRecord(e,d),o._resetProperties()}})}},e.prototype.createNewRecord=function(){for(var e={},t=this.parent.ganttColumns,n=this.parent.taskFields,a=this.parent.editModule.getNewTaskId(),s=0;s<t.length;s++){var o=t[s].field;o===n.id?e[o]=a:t[s].field===n.startDate?(i.i(r.isNullOrUndefined)(e[n.endDate])?e[o]=this.parent.editModule.dialogModule.getMinimumStartDate():e[o]=new Date(e[n.endDate]),this.parent.timezone&&(e[o]=this.parent.dateValidationModule.remove(e[o],this.parent.timezone))):t[s].field===n.endDate?(i.i(r.isNullOrUndefined)(e[n.startDate])?e[o]=this.parent.editModule.dialogModule.getMinimumStartDate():e[o]=new Date(e[n.startDate]),this.parent.timezone&&(e[o]=this.parent.dateValidationModule.remove(e[o],this.parent.timezone))):t[s].field===n.duration?e[o]=1:t[s].field===n.name?e[o]=this.parent.editModule.dialogModule.localeObj.getConstant("addDialogTitle")+" "+a:t[s].field===n.progress?e[o]=0:t[s].field===n.work?e[o]=0:"taskType"===t[s].field?e[o]=this.parent.taskType:t[s].field===n.milestone?e[o]=null:e[this.parent.ganttColumns[s].field]=""}return e},e.prototype.validateTaskPosition=function(e,t,n,a){var s=i.i(r.isNullOrUndefined)(n)||isNaN(parseInt(n.toString(),10))?this.parent.selectionModule?"Row"!==this.parent.selectionSettings.mode&&"Both"!==this.parent.selectionSettings.mode||1!==this.parent.selectionModule.selectedRowIndexes.length?"Cell"===this.parent.selectionSettings.mode&&1===this.parent.selectionModule.getSelectedRowCellIndexes().length?this.parent.selectionModule.getSelectedRowCellIndexes()[0].rowIndex:null:this.parent.selectionModule.selectedRowIndexes[0]:null:n;this.addRowSelectedItem=i.i(r.isNullOrUndefined)(s)?null:this.parent.updatedRecords[s],t=i.i(r.isNullOrUndefined)(t)?this.parent.editSettings.newRowPosition:t,e=i.i(r.isNullOrUndefined)(e)?this.createNewRecord():e,((i.i(r.isNullOrUndefined)(s)||s<0||i.i(r.isNullOrUndefined)(this.addRowSelectedItem))&&("Above"===t||"Below"===t||"Child"===t)||!t||"Above"!==t&&"Below"!==t&&"Child"!==t&&"Top"!==t&&"Bottom"!==t)&&(t="Top");var o,l=0;switch(t){case"Top":case"Bottom":l="ResourceView"===this.parent.viewType?1:0;break;case"Above":case"Below":l=this.addRowSelectedItem.level,o=this.parent.getParentTask(this.addRowSelectedItem.parentItem);break;case"Child":l=this.addRowSelectedItem.level+1,o=this.addRowSelectedItem}this.prepareNewlyAddedData(e,t);var d=this.updateNewlyAddedDataBeforeAjax(e,l,t,o);a.push(d)},e.prototype.updateNewRecord=function(e,t){if(0===e.level){this.parent.treeGrid.parentData.splice(0,0,e);i.i(r.getValue)("dataOperation.dataArray",this.parent).splice(0,0,e.taskData)}this.updateTreeGridUniqueID(e,"add"),this.refreshNewlyAddedRecord(t,e),this._resetProperties()},e.prototype._resetProperties=function(){this.parent.isOnEdit=!1,this.parent.hideSpinner(),this.addRowSelectedItem=null,this.newlyAddedRecordBackup=null,this.isBreakLoop=!1,this.parent.element.tabIndex=0,this.parent.initiateEditAction(!1)},e.prototype.updateTreeGridUniqueID=function(e,t){"add"===t?i.i(r.setValue)("uniqueIDCollection."+e.uniqueID,e,this.parent.treeGrid):"delete"===t&&i.i(r.deleteObject)(i.i(r.getValue)("uniqueIDCollection",this.parent.treeGrid),e.uniqueID)},e.prototype.refreshNewlyAddedRecord=function(e,t){if(this.parent.selectionModule&&this.parent.allowSelection&&("Row"===this.parent.selectionSettings.mode||"Both"===this.parent.selectionSettings.mode)&&(this.parent.staticSelectedRowIndex=this.parent.currentViewData.indexOf(e.data)),this.parent.timelineSettings.updateTimescaleView){var n=[];e.modifiedRecords.length>0?(n=e.data.length>0?e.data:[e.data],n.push.apply(n,e.modifiedRecords)):n=e.data.length>0?e.data:[e.data],this.parent.timelineModule.updateTimeLineOnEditing([n],e.action)}if(this.addSuccess(e),e=this.constructTaskAddedEventArgs(t,e.modifiedRecords,"add"),this.dialogModule.isAddNewResource&&!this.parent.isEdit&&this.parent.taskFields.work&&this.parent.dataOperation.updateWorkWithDuration(t[0]),this.parent.trigger("actionComplete",e),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose(),"ResourceView"===this.parent.viewType)if(t.length>1)for(var a=0;a<t.length;a++){if(e.data[a].ganttProperties.sharedTaskUniqueIds.push(e.data[a].ganttProperties.rowUniqueID),e.data[a].ganttProperties.resourceInfo){var s=i.i(r.extend)([],[],e.data[a].ganttProperties.resourceInfo,!0);s.splice(0,1),this.updateResoures([],s,e.data[a])}else this.removeChildRecord(e.data[a]),this.parent.editModule.checkWithUnassignedTask(e.data[a]);for(var o=0;o<this.updateParentRecords.length;o++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[o]);this.updateParentRecords=[]}else{if(e.data.ganttProperties.sharedTaskUniqueIds.push(e.data.ganttProperties.rowUniqueID),e.data.ganttProperties.resourceInfo&&e.data.ganttProperties.resourceInfo.length){if(e.data.ganttProperties.resourceInfo.length>1){var s=i.i(r.extend)([],[],e.data.ganttProperties.resourceInfo,!0);s.splice(0,1),this.updateResoures([],s,e.data)}}else this.removeChildRecord(e.data),this.parent.editModule.checkWithUnassignedTask(e.data);for(var o=0;o<this.updateParentRecords.length;o++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[o]);this.updateParentRecords=[]}},e.prototype.removeAddedRecord=function(){var e=this.parent.flatData,t=this.parent.currentViewData,n=this.parent.ids,a=e.indexOf(this.newlyAddedRecordBackup),s=t.indexOf(this.newlyAddedRecordBackup),o=n.indexOf(this.newlyAddedRecordBackup.ganttProperties.rowUniqueID.toString());if(i.i(r.deleteObject)(this.parent.previousRecords,e[a].uniqueID),this.newlyAddedRecordBackup.parentItem){var l=this.parent.getParentTask(this.newlyAddedRecordBackup.parentItem),d=l.childRecords.indexOf(this.newlyAddedRecordBackup);l.childRecords.splice(d,1)}e.splice(a,1),t.splice(s,1),n.splice(o,1)},e.prototype.getPrevRecordIndex=function(){var e=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1],t=this.parent.selectionModule.getSelectedRecords()[0],i=this.parent.getRootParent(e,t.level);return this.parent.updatedRecords.indexOf(i)},e.prototype.indent=function(){var e,t=this.parent.selectedRowIndex,i=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),r=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1],n=this.parent.selectionModule.getSelectedRecords()[0];this.parent.editSettings.allowEditing&&0!==t&&-1!==t&&i&&"ResourceView"!==this.parent.viewType&&this.parent.updatedRecords[t].level-r.level!=1&&(e=r.level-n.level==0?this.parent.selectionModule.getSelectedRowIndexes()[0]-1:this.getPrevRecordIndex(),this.indentOutdentRow([this.parent.selectionModule.getSelectedRowIndexes()[0]],e,"child"))},e.prototype.outdent=function(){var e,t=this.parent.selectionModule.getSelectedRowIndexes()[0],i=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length);if(this.parent.editSettings.allowEditing&&-1!==t&&0!==t&&i&&"ResourceView"!==this.parent.viewType&&0!==this.parent.updatedRecords[t].level){var r=this.parent.getTaskByUniqueID(this.parent.selectionModule.getSelectedRecords()[0].parentItem.uniqueID);e=this.parent.updatedRecords.indexOf(r),this.indentOutdentRow([t],e,"below")}},e.prototype.indentOutdentRow=function(e,t,n){var a=this;if(e[0],!0){"above"===n&&(this.dropPosition="topSegment"),"below"===n&&(this.dropPosition="bottomSegment"),"child"===n&&(this.dropPosition="middleSegment");for(var s=void 0,o=[],l=0;l<e.length;l++)o[l]=this.parent.updatedRecords[e[l]];var d={data:o,dropIndex:t,dropPosition:this.dropPosition};"middleSegment"===this.dropPosition?s="indenting":"bottomSegment"===this.dropPosition&&(s="outdenting");var h={action:s,data:o[0],cancel:!1};this.parent.trigger("actionBegin",h,function(e){i.i(r.isNullOrUndefined)(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.showSpinner():a.parent.showMaskRow(),e.cancel||a.reArrangeRows(d,!0)})}},e.prototype.reArrangeRows=function(e,t){if(this.dropPosition=e.dropPosition,"Invalid"!==e.dropPosition&&this.parent.editModule){var n=this.parent,a=void 0;this.droppedRecord=n.updatedRecords[e.dropIndex];var s=[],o=this.droppedRecord;e.data[0]?s=e.data:s.push(e.data);for(var l=0,d=s.length,h=0;h<d;h++){if(this.parent.isOnEdit=!0,a=s[h],this.draggedRecord=a,"Invalid"!==this.dropPosition){t&&this.deleteDragRow();var p=this.treeGridData.indexOf(o);if("bottomSegment"===this.dropPosition){if(o.hasChildRecords){l=this.parent.editModule.getChildCount(o,0),this.parent.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(p+l+1,0,this.draggedRecord.taskData),this.treeGridData.splice(p+l+1,0,this.draggedRecord),this.parent.ids.splice(p+l+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString());var u=this.parent.ids.indexOf(this.draggedRecord[this.parent.taskFields.id].toString());u!==p+l+1&&(this.parent.ids.splice(u,1),this.parent.ids.splice(p+l+1,0,this.draggedRecord[this.parent.taskFields.id].toString()))}else this.parent.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(p+1,0,this.draggedRecord.taskData),this.treeGridData.splice(p+1,0,this.draggedRecord),this.parent.ids.splice(p+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString());if(this.parent.setRecordValue("parentItem",this.treeGridData[p].parentItem,a),this.parent.setRecordValue("parentUniqueID",this.treeGridData[p].parentUniqueID,a),this.parent.setRecordValue("level",this.treeGridData[p].level,a),a.hasChildRecords){this.updateChildRecordLevel(a,1),this.updateChildRecord(a,p+l+1)}if(o.parentItem){var c=this.parent.getParentTask(o.parentItem).childRecords,g=c,f=g.indexOf(o)+1;g.splice(f,0,a)}}"middleSegment"===this.dropPosition&&this.dropMiddle(p),i.i(r.isNullOrUndefined)(a.parentItem&&-1!==this.updateParentRecords.indexOf(a.parentItem))||this.updateParentRecords.push(a.parentItem)}if(i.i(r.isNullOrUndefined)(a.parentItem)){var m=this.parent.treeGrid.parentData,y=m.indexOf(this.droppedRecord);"bottomSegment"===this.dropPosition&&m.splice(y+1,0,a)}this.refreshDataSource()}"middleSegment"===this.dropPosition&&(o.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(o),o.ganttProperties.predecessor=null,o.ganttProperties.predecessorsName=null,o[this.parent.taskFields.dependency]=null,o.taskData[this.parent.taskFields.dependency]=null),o.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,o.ganttProperties,!0),i.i(r.isNullOrUndefined)(o.taskData[this.parent.taskFields.milestone])||!0===o.taskData[this.parent.taskFields.milestone]&&(o.taskData[this.parent.taskFields.milestone]=!1)));for(var D=0;D<this.updateParentRecords.length;D++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[D]);this.updateParentRecords=[],this.parent.isOnEdit=!1}this.refreshRecord(e)},e.prototype.refreshRecord=function(e,t){var r=this;if(i.i(s.f)(this.parent.dataSource)){var a=this.parent.dataSource,o={changedRecords:i.i(s.e)(this.parent.editedRecords,null,null,this.parent)},l=this.parent.query instanceof n.Query?this.parent.query:new n.Query,d=null,h=a.adaptor;if(h instanceof n.WebApiAdaptor&&h instanceof n.ODataAdaptor&&!a.dataSource.batchUrl){d=a.update(this.parent.taskFields.id,o.changedRecords,null,l)}else d=a.saveChanges(o,this.parent.taskFields.id,null,l);d.then(function(i){return r.indentSuccess(i,e,t)}).catch(function(e){return r.indentFailure(e)})}else this.indentOutdentSuccess(e,t)},e.prototype.indentSuccess=function(e,t,i){this.indentOutdentSuccess(t,i)},e.prototype.indentFailure=function(e){this.parent.trigger("actionFailure",{error:e})},e.prototype.indentOutdentSuccess=function(e,t){if(this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(e.data,t),t?e.requestType="rowDropped":"middleSegment"===this.dropPosition?e.requestType="indented":"bottomSegment"===this.dropPosition&&(e.requestType="outdented"),e.modifiedRecords=this.parent.editedRecords,this.parent.timezone)for(var n=0;n<e.modifiedRecords.length;n++)i.i(s.g)(e.modifiedRecords[n],this.parent);this.parent.trigger("actionComplete",e),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.editedRecords=[]},e.prototype.refreshDataSource=function(){var e,t,a=this.draggedRecord,s=this.droppedRecord,o=this.parent;if(e=this.parent.dataSource instanceof n.DataManager?i.i(r.getValue)("dataOperation.dataArray",this.parent):o.dataSource,e.length>0&&!i.i(r.isNullOrUndefined)(s)&&!s.parentItem){for(var l=0;l<Object.keys(e).length;l++)e[l][this.parent.taskFields.child]===s.taskData[this.parent.taskFields.child]&&(t=l);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(t,0,a.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(t+1,0,a.taskData))}else if(!this.parent.taskFields.parentID&&!i.i(r.isNullOrUndefined)(s)&&s.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var d="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=s;var h=[];Array.isArray(a)?h=a:h[0]=a,this.parent.editModule.updateRealDataSource(h,d),delete this.parent.editModule.addRowSelectedItem}this.parent.taskFields.parentID&&(a.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(a[this.parent.taskFields.parentID]=s[this.parent.taskFields.parentID],a.taskData[this.parent.taskFields.parentID]=s[this.parent.taskFields.parentID],a.ganttProperties.parentId=s[this.parent.taskFields.parentID]):(a[this.parent.taskFields.parentID]=s[this.parent.taskFields.id],a.taskData[this.parent.taskFields.parentID]=s[this.parent.taskFields.id],a.ganttProperties.parentId=s[this.parent.taskFields.id]):(a[this.parent.taskFields.parentID]=null,a.taskData[this.parent.taskFields.parentID]=null,a.ganttProperties.parentId=null))},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof n.DataManager?this.ganttData=i.i(r.getValue)("dataOperation.dataArray",this.parent):this.ganttData=i.i(s.i)(this.parent)?i.i(r.getValue)("result",this.parent.dataSource):this.parent.dataSource,this.treeGridData=i.i(s.i)(this.parent)?i.i(r.getValue)("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource;var e=this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);this.removeRecords(e)},e.prototype.updateIndentedChildRecords=function(e){for(var t={uniqueID:e.uniqueID,expanded:e.expanded,level:e.level,index:e.index,taskId:e.ganttProperties.rowUniqueID},i=0;i<e.childRecords.length;i++)this.parent.setRecordValue("parentItem",t,e.childRecords[i]),this.parent.setRecordValue("parentUniqueID",e.uniqueID,e.childRecords[i]);if(e.hasChildRecords){e=e.childRecords;for(var r=0;r<e.length;r++)this.updateIndentedChildRecords(e[r])}},e.prototype.dropMiddle=function(e){var t=this.parent,n=this.parent.editModule.getChildCount(this.droppedRecord,0),a=i.i(r.isNullOrUndefined)(n)||0===n?e+1:n+e+1;if("middleSegment"===this.dropPosition){if(t.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(a,0,this.draggedRecord.taskData),this.treeGridData.splice(a,0,this.draggedRecord),this.parent.ids.splice(a,0,this.draggedRecord[this.parent.taskFields.id].toString()),this.recordLevel(),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,a,this.droppedRecord.expanded),this.parent.enableImmutableMode)){var s=this.draggedRecord;this.updateIndentedChildRecords(s)}i.i(r.isNullOrUndefined)(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem))&&this.updateParentRecords.push(this.draggedRecord.parentItem)}},e.prototype.updateChildRecordLevel=function(e,t){var i,r=0;if(t++,!e.hasChildRecords)return 0;r=e.childRecords.length;for(var n=0;n<r;n++){i=e.childRecords[n];var a=void 0;if(e.parentItem){a=this.parent.treeGrid.uniqueIDCollection[e.parentItem.uniqueID]}i.level=e.parentItem?a.level+t:e.level+1,i.hasChildRecords&&(t--,t=this.updateChildRecordLevel(i,t))}return t},e.prototype.updateChildRecord=function(e,t,i){var r,n=this.parent,a=0;if(!e.hasChildRecords)return 0;a=e.childRecords.length;for(var s=0;s<a;s++)r=e.childRecords[s],t++,n.flatData.splice(t,0,r),this.parent.ids.splice(t,0,r.ganttProperties.rowUniqueID.toString()),n.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(t,0,r.taskData),r.hasChildRecords&&(t=this.updateChildRecord(r,t));return t},e.prototype.removeRecords=function(e){var t,a=this.parent;t=this.parent.dataSource instanceof n.DataManager?i.i(r.getValue)("dataOperation.dataArray",this.parent):this.parent.dataSource;var s=e,o=this.parent.getParentTask(s.parentItem);if(s){if(s.parentItem){var l=o?o.childRecords:[],d=0;l&&l.length>0&&(d=l.indexOf(s),o.childRecords.splice(d,1),this.parent.taskFields.parentID||o.taskData[this.parent.taskFields.child].splice(d,1),this.updateParentRecords.push(o))}if(a.taskFields.parentID){s.hasChildRecords&&s.childRecords.length>0&&this.removeChildItem(s);for(var h=void 0,p=t.length>0?t:this.parent.currentViewData,u=0;u<p.length;u++)p[u][this.parent.taskFields.id]===s.taskData[this.parent.taskFields.id]&&(h=u);if(-1!==h){t.length>0&&t.splice(h,1);for(var c=void 0,u=0;u<this.treeGridData.length;u++)this.treeGridData[u][this.parent.taskFields.id]===s.taskData[this.parent.taskFields.id]&&(c=u);this.treeGridData.splice(c,1),this.parent.ids.splice(c,1),-1!==this.parent.treeGrid.parentData.indexOf(s)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(s),1)}}var g=this.treeGridData.indexOf(s);if(!a.taskFields.parentID){var f=this.getChildCount(s,0);this.treeGridData.splice(g,f+1),this.parent.ids.splice(g,f+1);var m=this.ganttData.indexOf(s.taskData);-1!==m&&(this.ganttData.splice(m,1),this.parent.treeGrid.parentData.splice(m,1))}s.parentItem&&o&&o.childRecords&&!o.childRecords.length&&(this.parent.setRecordValue("expanded",!1,o),this.parent.setRecordValue("hasChildRecords",!1,o))}},e.prototype.removeChildItem=function(e){for(var t,a,s=0;s<e.childRecords.length;s++){t=e.childRecords[s];var o=void 0;o=this.parent.dataSource instanceof n.DataManager?i.i(r.getValue)("dataOperation.dataArray",this.parent):this.parent.dataSource;for(var l=0;l<o.length;l++)o[l][this.parent.taskFields.id]===t.taskData[this.parent.taskFields.id]&&(a=l);if(-1!==a){o.length>0&&o.splice(a,1);for(var d=void 0,h=0;h<this.treeGridData.length;h++)this.treeGridData[h][this.parent.taskFields.id]===t.taskData[this.parent.taskFields.id]&&(d=h);this.treeGridData.splice(d,1),this.parent.ids.splice(d,1)}t.hasChildRecords&&this.removeChildItem(t)}},e.prototype.recordLevel=function(){var e=this.parent,t=this.draggedRecord,n=this.droppedRecord,a=e.taskFields.child;if(n.hasChildRecords||(n.hasChildRecords=!0,n.childRecords.length||(n.childRecords=[],!e.taskFields.parentID&&i.i(r.isNullOrUndefined)(n.taskData[a])&&(n.taskData[a]=[]))),"middleSegment"===this.dropPosition){var s=i.i(r.extend)({},n);delete s.childRecords;var o={uniqueID:s.uniqueID,expanded:s.expanded,level:s.level,index:s.index,taskId:s.ganttProperties.rowUniqueID};if(this.parent.setRecordValue("parentItem",o,t),this.parent.setRecordValue("parentUniqueID",n.uniqueID,t),n.childRecords.splice(n.childRecords.length,0,t),i.i(r.isNullOrUndefined)(t)||e.taskFields.parentID||i.i(r.isNullOrUndefined)(n.taskData[a])||n.taskData[e.taskFields.child].splice(n.childRecords.length,0,t.taskData),!i.i(r.isNullOrUndefined)(n.ganttProperties.segments)&&n.ganttProperties.segments.length>0&&(n.ganttProperties.segments=null,n.taskData[e.taskFields.segments]=null),t.hasChildRecords){t.level=n.level+1,this.updateChildRecordLevel(t,1)}else t.level=n.level+1;n.expanded=!0}},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(6),n=(i.n(r),i(0)),a=(i.n(n),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.ExcelExport),this.parent.treeGrid.allowExcelExport=this.parent.allowExcelExport,this.bindEvents()}return e.prototype.getModuleName=function(){return"excelExport"},e.prototype.destroy=function(){},e.prototype.bindEvents=function(){var e=this;this.parent.treeGrid.beforeExcelExport=function(t){e.parent.trigger("beforeExcelExport",t),i.i(n.isNullOrUndefined)(e.parent.loadingIndicator)||"Shimmer"!==e.parent.loadingIndicator.indicatorType?e.parent.showSpinner():e.parent.showMaskRow()},this.parent.treeGrid.excelQueryCellInfo=function(t){e.parent.trigger("excelQueryCellInfo",t)},this.parent.treeGrid.excelHeaderQueryCellInfo=function(t){e.parent.trigger("excelHeaderQueryCellInfo",t)},this.parent.treeGrid.excelExportComplete=function(t){e.parent.trigger("excelExportComplete",t),i.i(n.isNullOrUndefined)(e.parent.loadingIndicator)||"Shimmer"!==e.parent.loadingIndicator.indicatorType?e.parent.hideSpinner():e.parent.hideMaskRow()}},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(6),n=(i.n(r),i(5)),a=(i.n(n),i(0)),s=(i.n(a),i(12)),o=(i.n(s),i(20)),l=(i.n(o),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.Filter),this.parent.treeGrid.allowFiltering=this.parent.allowFiltering,this.updateCustomFilters(),this.parent.treeGrid.filterSettings=i.i(n.getActualProperties)(this.parent.filterSettings),this.addEventListener()}return e.prototype.getModuleName=function(){return"filter"},e.prototype.updateCustomFilters=function(){for(var e=this.parent.taskFields,t=0;t<this.parent.ganttColumns.length;t++){var i=this.parent.ganttColumns[t];("datepickeredit"!==i.editType&&"datetimepickeredit"!==i.editType||i.field!==e.startDate&&i.field!==e.endDate&&i.field!==e.baselineStartDate&&i.field!==e.baselineEndDate)&&(i.field!==e.duration||"stringedit"!==i.editType)||this.initiateFiltering(this.parent.ganttColumns[t])}},e.prototype.updateModel=function(){this.parent.filterSettings=this.parent.treeGrid.filterSettings},e.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("actionBegin",this.actionBegin,this),this.parent.on("actionComplete",this.actionComplete,this),this.parent.on("columnMenuOpen",this.columnMenuOpen,this)},e.prototype.wireEvents=function(e){a.EventHandler.add(document.getElementById(e),"click",this.mouseClickHandler,this)},e.prototype.initiateFiltering=function(e){var t=this.parent.getColumnByField(e.field,this.parent.treeGridModule.treeGridColumns);e.allowFiltering=!1!==e.allowFiltering,!e.allowFiltering||"Menu"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||e.filter||(e.filter={ui:this.getCustomFilterUi(e)}),t&&(t.allowFiltering=e.allowFiltering,t.filter=e.allowFiltering?e.filter:{})},e.prototype.getCustomFilterUi=function(e){var t=this.parent.taskFields,i={};return"datepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?"datetimepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?e.field===t.duration&&"stringedit"===e.editType&&(i=this.getDurationFilter()):i=this.getDateTimePickerFilter():i=this.getDatePickerFilter(e.field),i},e.prototype.mouseClickHandler=function(e){i.i(a.closest)(e.target,".e-excelfilter")&&this.parent.treeGrid.grid.notify("click",e)},e.prototype.unWireEvents=function(){a.EventHandler.remove(this.parent.element,"click",this.mouseClickHandler)},e.prototype.getDatePickerFilter=function(e){var t,r=this,s=this.parent,l=e===s.taskFields.startDate||e===s.taskFields.baselineStartDate?s.defaultStartTime:s.defaultEndTime;return{create:function(e){var s=i.i(n.getCustomDateFormat)(e.column.format,e.column.type),l=i.i(a.createElement)("input",{className:"flm-input"});e.target.appendChild(l),t=new o.DatePicker({placeholder:r.parent.localeObj.getConstant("enterValue"),format:s}),t.enableRtl=r.parent.enableRtl,t.appendTo(l)},write:function(e){t.value=e.filteredValue},read:function(e){t.value&&t.value.setSeconds(l),e.fltrObj.filterByColumn(e.column.field,e.operator,t.value)}}},e.prototype.getDateTimePickerFilter=function(){var e,t=this;return{create:function(r){var s=i.i(n.getCustomDateFormat)(r.column.format,r.column.type),l=i.i(a.createElement)("input",{className:"flm-input"});r.target.appendChild(l),e=new o.DateTimePicker({placeholder:t.parent.localeObj.getConstant("enterValue"),format:s}),e.enableRtl=t.parent.enableRtl,e.appendTo(l)},write:function(t){e.value=t.filteredValue},read:function(t){t.fltrObj.filterByColumn(t.column.field,t.operator,e.value)}}},e.prototype.getDurationFilter=function(){var e,t=this,r=this.parent,n="";return{create:function(r){var n=i.i(a.createElement)("input",{className:"e-input"});n.setAttribute("placeholder",t.parent.localeObj.getConstant("enterValue")),r.target.appendChild(n),e=new s.TextBox,e.enableRtl=t.parent.enableRtl,e.appendTo(n)},write:function(t){e.value=t.filteredValue?n:""},read:function(s){var o=t.parent.dataOperation.getDurationValue(e.value),l=i.i(a.getValue)("duration",o),d=i.i(a.getValue)("durationUnit",o);if(l>=0){var h=void 0;"minute"===d?h=60*l/r.secondsPerDay:"hour"===d?h=60*l*60/r.secondsPerDay:(h=l,d="day"),s.fltrObj.filterByColumn(s.column.field,s.operator,h),n=t.parent.dataOperation.getDurationString(l,d)}else s.fltrObj.filterByColumn(s.column.field,s.operator,null),n=null}}},e.prototype.columnMenuOpen=function(e){this.filterMenuElement&&document.body.contains(this.filterMenuElement)&&i.i(a.remove)(this.filterMenuElement),this.filterMenuElement=null},e.prototype.actionBegin=function(e){},e.prototype.closeFilterOnContextClick=function(e){var t=document.querySelector("body > div.e-datepicker"),r=document.querySelector("body > div.e-datetimepicker");if(this.filterMenuElement&&document.body.contains(this.filterMenuElement)){var n=i.i(a.closest)(e,"#"+this.parent.element.id)||e.querySelector("#"+this.parent.element.id);(!this.filterMenuElement.contains(e)&&!i.i(a.isNullOrUndefined)(n)||!this.filterMenuElement.contains(e)&&i.i(a.isNullOrUndefined)(t)&&i.i(a.isNullOrUndefined)(r)&&("DIV"===e.nodeName||"HTML"===e.nodeName||"SPAN"===e.nodeName||"BUTTON"===e.nodeName))&&(i.i(a.remove)(this.filterMenuElement),this.parent.treeGrid.grid.notify("filter-menu-close",{isOpen:!1}),this.filterMenuElement=null)}},e.prototype.actionComplete=function(e){if(i.i(a.isNullOrUndefined)(e.filterModel)||i.i(a.isNullOrUndefined)(e.filterModel.dialogObj)||i.i(a.isNullOrUndefined)(e.filterModel.dialogObj.element)||"Excel"===this.parent.filterSettings.type&&this.wireEvents(e.filterModel.dialogObj.element.id),e.requestType===n.filterAfterOpen){"Menu"===this.parent.treeGrid.filterSettings.type?this.filterMenuElement=i.i(a.getValue)("filterModel.dlgObj.element",e):this.filterMenuElement=i.i(a.getValue)("filterModel.dialogObj.element",e),this.updateFilterMenuPosition(this.filterMenuElement,e);var t=this.parent.taskFields.id,r=this.parent.taskFields.dependency,s=this.parent.taskFields.resourceInfo,o=this.parent.treeGrid.grid.filterModule,l=i.i(a.getValue)("values",o);if(e.columnName===r&&i.i(a.isNullOrUndefined)(i.i(a.getValue)(r,l))||e.columnName===s&&i.i(a.isNullOrUndefined)(i.i(a.getValue)(s,l))){var d=this.filterMenuElement.querySelector(".e-dropdownlist"),h=void 0;i.i(a.isNullOrUndefined)(d)||(h=i.i(a.getValue)("ej2_instances[0]",d),h.index=2,h.dataBind())}else if(e.columnName===t&&i.i(a.isNullOrUndefined)(i.i(a.getValue)(t,l))&&"Menu"===this.parent.treeGrid.filterSettings.type){var d=this.filterMenuElement.querySelector(".e-flmenu-input"),h=i.i(a.getValue)("ej2_instances[0]",d);!i.i(a.isNullOrUndefined)(h)&&i.i(a.isNullOrUndefined)(this.parent.columnByField[e.columnName].format)&&(h.format="n")}}},e.prototype.setPosition=function(e,t){var r,n,s,o,l,d,h,p=this.parent.element.getBoundingClientRect(),u=p.top,c=p.left;if(!i.i(a.isNullOrUndefined)(this.parent.element.parentNode)&&"BODY"!=this.parent.element.parentNode.tagName){for(r=this.parent.element.parentNode,n=r.getBoundingClientRect().top,d=r.style.marginTop;;){if(Math.abs(u)>Math.abs(n)){o=u-n;break}if(!i.i(a.isNullOrUndefined)(this.parent.element.parentNode)){if(r.parentNode instanceof HTMLDocument)break;r=r.parentNode,r.parentNode&&r.parentNode.style&&(d=r.parentNode.style.marginTop)}n=r.getBoundingClientRect().top}for(s=r.getBoundingClientRect().left,h=r.style.marginLeft;;){if(Math.abs(c)>Math.abs(s)){l=c-s;break}if(!i.i(a.isNullOrUndefined)(this.parent.element.parentNode)){if(r.parentNode instanceof HTMLDocument)break;r=r.parentNode,h=r.style.marginLeft}s=r.getBoundingClientRect().left}}var g=e.getBoundingClientRect(),f=g.right+window.scrollX,m=g.top+window.scrollY;p.right<f+t.offsetWidth?g.left-t.offsetWidth>p.left?f=g.left-t.offsetWidth:f-=f+t.offsetWidth-p.right:i.i(a.isNullOrUndefined)(o)||i.i(a.isNullOrUndefined)(l)||(f=Math.abs(g.right-p.left),m=Math.abs(g.top-p.top)),i.i(a.isNullOrUndefined)(o)||i.i(a.isNullOrUndefined)(l)?(t.style.top=m+"px",t.style.left=f+"px"):(t.style.top="string"==typeof parseInt(d)?m+o+parseInt(d)+"px":m+o+"px",t.style.left="string"==typeof parseInt(h)?f+l+parseInt(h)+8+"px":f+l+"px")},e.prototype.updateFilterMenuPosition=function(e,t){i.i(a.addClass)([e],"e-gantt"),document.querySelector("#"+this.parent.controlId).appendChild(e);var r;this.parent.showColumnMenu?(r=document.querySelector("#treeGrid"+this.parent.controlId+"_gridcontrol_colmenu_Filter"),e.style.zIndex=r.parentElement.style.zIndex,"Menu"===this.parent.treeGrid.filterSettings.type?this.setPosition(r,i.i(a.getValue)("filterModel.dlgObj.element",t)):this.setPosition(r,i.i(a.getValue)("filterModel.dialogObj.element",t))):(r=this.parent.treeGrid.grid.getColumnHeaderByField(t.columnName).querySelector(".e-filtermenudiv"),"Menu"===this.parent.treeGrid.filterSettings.type?i.i(n.getFilterMenuPostion)(r,i.i(a.getValue)("filterModel.dlgObj",t)):i.i(n.getFilterMenuPostion)(r,i.i(a.getValue)("filterModel.dialogObj",t))),"Menu"===this.parent.treeGrid.filterSettings.type&&e.querySelector(".e-valid-input").focus()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("actionBegin",this.actionBegin),this.parent.off("actionComplete",this.actionComplete),this.parent.off("columnMenuOpen",this.columnMenuOpen))},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.parent=e,this.activeElement=null,this.previousActiveElement=null}return e.prototype.getActiveElement=function(e){return e?this.previousActiveElement:this.activeElement},e.prototype.setActiveElement=function(e){this.previousActiveElement=this.activeElement,this.activeElement=e},e.prototype.onKeyPress=function(e){var t=this.parent,n=t.getExpandedRecords(t.currentViewData);if(i.i(r.isNullOrUndefined)(this.parent.focusModule.getActiveElement())&&("expandAll"===e.action||"collapseAll"===e.action)){var a=this.parent.element.querySelector(".e-treegrid");a.focus()}var s=this.parent.focusModule.getActiveElement();if("home"!==e.action&&"end"!==e.action&&"downArrow"!==e.action&&"upArrow"!==e.action&&"delete"!==e.action&&"rightArrow"!==e.action&&"leftArrow"!==e.action&&"focusTask"!==e.action&&"focusSearch"!==e.action&&"expandAll"!==e.action&&"collapseAll"!==e.action||i.i(r.isNullOrUndefined)(t.editModule)||i.i(r.isNullOrUndefined)(t.editModule.cellEditModule)||!0!==t.editModule.cellEditModule.isCellEdit)switch(t.isAdaptive&&("addRowDialog"!==e.action&&"editRowDialog"!==e.action&&"delete"!==e.action&&"addRow"!==e.action||t.selectionModule&&"Multiple"===t.selectionSettings.type&&(t.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),e.action){case"home":if(t.selectionModule&&"Cell"!==t.selectionSettings.mode){if(0===t.selectedRowIndex)return;t.selectionModule.selectRow(0,!1,!0)}break;case"end":if(t.selectionModule&&"Cell"!==t.selectionSettings.mode){var o=n[n.length-1];if(t.selectedRowIndex===t.flatData.indexOf(o))return;t.selectionModule.selectRow(t.flatData.indexOf(o),!1,!0)}break;case"downArrow":case"upArrow":var l=t.element.querySelector("#"+t.element.id+"_searchbar");l&&l.parentElement.classList.contains("e-input-focus")&&t.selectionModule.clearSelection(),t.element.classList.contains("e-scroll-disabled")||(this.upDownKeyNavigate(e),i.i(r.isNullOrUndefined)(s)||i.i(r.isNullOrUndefined)(s.closest(".e-chart-row"))||t.ganttChartModule.manageFocus(this.getActiveElement(),"remove",!0));break;case"expandAll":t.ganttChartModule.expandCollapseAll("expand");break;case"collapseAll":t.ganttChartModule.expandCollapseAll("collapse");break;case"expandRow":case"collapseRow":this.expandCollapseKey(e);break;case"saveRequest":if(!i.i(r.isNullOrUndefined)(t.editModule)&&!i.i(r.isNullOrUndefined)(t.editModule.cellEditModule)&&t.editModule.cellEditModule.isCellEdit){var d=t.editModule.cellEditModule.editedColumn;if(d.field===t.columnMapping.duration&&!i.i(r.isNullOrUndefined)(d.edit)&&!i.i(r.isNullOrUndefined)(d.edit.read)){var h=e.target.ej2_instances[0],p=e.target.value,u=t.currentViewData[t.selectedRowIndex].ganttProperties,c=void 0;d.field===t.columnMapping.duration&&(c=i.i(r.isNullOrUndefined)(d.edit)||i.i(r.isNullOrUndefined)(d.edit.read)?i.i(r.isNullOrUndefined)(d.valueAccessor)?t.dataOperation.getDurationString(u.duration,u.durationUnit):d.valueAccessor(t.columnMapping.duration,t.editedRecords,d):d.edit.read(),p!==c.toString()&&(h.value=p,h.dataBind()))}if(t.editModule.dialogModule.dialogObj&&i.i(r.getValue)("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.treeGrid.grid.saveCell();var a=t.element.querySelector(".e-treegrid");a.focus()}if(!i.i(r.isNullOrUndefined)(this.parent.onTaskbarClick)&&!i.i(r.isNullOrUndefined)(s)&&!i.i(r.isNullOrUndefined)(s.closest(".e-chart-row"))){var g=e.target,f=s.querySelector(".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");f&&this.parent.ganttChartModule.onTaskbarClick(e,g,f)}break;case"cancelRequest":i.i(r.isNullOrUndefined)(t.editModule)||i.i(r.isNullOrUndefined)(t.editModule.cellEditModule)||(t.editModule.cellEditModule.isCellEdit=!1,i.i(r.isNullOrUndefined)(t.toolbarModule)||t.toolbarModule.refreshToolbarItems());break;case"addRow":if(t.editModule&&t.editModule.cellEditModule&&t.editModule.cellEditModule.isCellEdit)e.stopPropagation();else if(i.i(r.isNullOrUndefined)(document.getElementById(this.parent.element.id+"_dialog"))){e.preventDefault(),t.addRecord(void 0,this.parent.editSettings.newRowPosition,this.parent.selectedRowIndex);var a=t.element;a.focus()}break;case"addRowDialog":if(e.preventDefault(),t.editModule&&t.editModule.dialogModule&&t.editSettings.allowAdding){if(t.editModule.dialogModule.dialogObj&&i.i(r.getValue)("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.editModule.dialogModule.openAddDialog()}break;case"editRowDialog":e.preventDefault();if(t.element.querySelector(".e-treegrid").focus(),t.editModule&&t.editModule.dialogModule&&t.editSettings.allowEditing){if(t.editModule.dialogModule.dialogObj&&i.i(r.getValue)("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.editModule.dialogModule.openToolbarEditDialog()}break;case"delete":t.selectionModule&&t.editModule&&t.editModule.dialogModule&&(!t.editModule.dialogModule.dialogObj||t.editModule.dialogModule.dialogObj&&!t.editModule.dialogModule.dialogObj.visible)&&(!t.editSettings.allowTaskbarEditing||t.editSettings.allowTaskbarEditing&&!t.editModule.taskbarEditModule.touchEdit)&&("Cell"!==t.selectionSettings.mode&&t.selectionModule.selectedRowIndexes.length||"Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length)&&(i.i(r.isNullOrUndefined)(e.target)?t.editModule.startDeleteAction():"INPUT"!==e.target.tagName&&t.editModule.startDeleteAction());break;case"focusTask":e.preventDefault();var m=void 0;if(t.selectionModule){var y=t.currentViewData;if("Cell"===t.selectionSettings.mode||i.i(r.isNullOrUndefined)(y[t.selectedRowIndex])){if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var D=t.selectionModule.getSelectedRowCellIndexes();m=y[D[D.length-1].rowIndex].ganttProperties.rowUniqueID}}else m=t.currentViewData[t.selectedRowIndex].ganttProperties.rowUniqueID}m&&t.scrollToTask(m.toString());break;case"focusSearch":if(t.element.querySelector("#"+t.element.id+"_searchbar")){var l=t.element.querySelector("#"+t.element.id+"_searchbar");l.setAttribute("tabIndex","-1"),l.focus()}break;case"tab":case"shiftTab":t.element.classList.contains("e-scroll-disabled")||t.ganttChartModule.onTabAction(e);break;case"contextMenu":var v=document.getElementById(this.parent.element.id+"_contextmenu").ej2_instances[0],w=this.parent.getOffsetRect(e.target),k=w.top+w.height/2,b=w.left+w.width/2;this.setActiveElement(e.target),v.open(k,b),e.preventDefault();break;default:var T={requestType:"keyPressed",action:e.action,keyEvent:e};t.trigger("actionComplete",T)}},e.prototype.upDownKeyNavigate=function(e){e.preventDefault();var t=this.parent,i=t.getExpandedRecords(t.currentViewData);if(t.selectionModule){if("Cell"!==t.selectionSettings.mode&&-1!==t.selectedRowIndex){var r=t.currentViewData[t.selectedRowIndex],n=(this.parent.ganttChartModule.focusedRowIndex,i.indexOf(r)),a="downArrow"===e.action?i[n+1]:i[n-1];t.selectionModule.selectRow(t.currentViewData.indexOf(a),!1,!0)}else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var s=t.selectionModule.getSelectedRowCellIndexes(),o=s[s.length-1],l=o.cellIndexes[o.cellIndexes.length-1],r=t.currentViewData[o.rowIndex],n=i.indexOf(r),a="downArrow"===e.action?i[n+1]:i[n-1],d={rowIndex:t.currentViewData.indexOf(a),cellIndex:l};t.selectionModule.selectCell(d)}this.parent.ganttChartModule.focusedRowIndex=this.parent.selectedRowIndex}},e.prototype.expandCollapseKey=function(e){var t=this.parent;if(t.selectionModule&&-1!==t.selectedRowIndex){var i=void 0;if("Cell"!==t.selectionSettings.mode)i=t.selectedRowIndex;else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var r=t.selectionModule.getSelectedRowCellIndexes();i=r[r.length-1].rowIndex}"expandRow"===e.action?t.expandByIndex(i):t.collapseByIndex(i)}},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(17),n=i(7),a=i(0),s=(i.n(a),i(50)),o=i(2),l=(i.n(o),i(57)),d=function(){function e(e){this.isPdfExport=!1,this.parent=e,this.helper=new s.a(this.parent),this.pdfDocument=void 0}return e.prototype.getModuleName=function(){return"pdfExport"},e.prototype.destroy=function(){},e.prototype.initGantt=function(){this.pdfDocument=void 0,this.gantt=new l.a(this.parent)},e.prototype.export=function(e,t,r,n){var s=this;this.isBlob=n;var o={requestType:"beforePdfExport",ganttObject:this.parent,cancel:!1};return this.parent.trigger("beforePdfExport",o),i.i(a.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),i.i(a.getValue)("cancel",o)?new Promise(function(e,t){return e()}):new Promise(function(i,n){s.exportWithData(r,i,e,t)})},e.prototype.exportWithData=function(e,t,r,n){var s=this,l=[];i.i(a.isNullOrUndefined)(r)&&(r={}),r.fitToWidthSettings&&r.fitToWidthSettings.isFitToWidth?("CurrentViewData"===r.exportType?this.helper.beforeSinglePageExport.cloneFlatData=i.i(a.extend)([],this.parent.currentViewData,null,!0):this.helper.beforeSinglePageExport.cloneFlatData=i.i(a.extend)([],this.parent.flatData,null,!0),this.helper.beforeSinglePageExport.cloneCurrentViewData=i.i(a.extend)([],this.parent.currentViewData,null,!0),l=this.helper.beforeSinglePageExport.cloneFlatData):l="CurrentViewData"===r.exportType?this.parent.currentViewData:this.parent.flatData,this.initGantt(),i.i(a.isNullOrUndefined)(e)?this.pdfDocument=new o.PdfDocument:this.pdfDocument=e,this.processExport(l,r,n).then(function(){s.parent.trigger("pdfExportComplete",s.isBlob?{promise:s.blobPromise}:{}),i.i(a.isNullOrUndefined)(s.parent.loadingIndicator)||"Shimmer"!==s.parent.loadingIndicator.indicatorType?s.parent.hideSpinner():s.parent.hideMaskRow(),t(s.pdfDocument)})},e.prototype.processExport=function(e,t,r){var s=this,l=this.pdfDocument.sections.add();this.processSectionExportProperties(l,t);var d=l.pages.add();return this.pdfPageDimensions=d.getClientSize(),new Promise(function(i,r){s.helper.processGridExport(e,s.gantt,t),s.helper.initializePdf(s.pdfDocument),i()}).then(function(){var e=new n.i;e.break=o.PdfLayoutBreakType.FitElement;var l=s.gantt.drawGrid(d,0,0,e);return s.gantt.drawChart(l),s.helper.exportProps&&s.helper.exportProps.fitToWidthSettings&&s.helper.exportProps.fitToWidthSettings.isFitToWidth&&(s.parent.zoomingProjectStartDate=s.helper.beforeSinglePageExport.zoomingProjectStartDate,s.parent.zoomingProjectEndDate=s.helper.beforeSinglePageExport.zoomingProjectEndDate,s.parent.cloneProjectStartDate=s.helper.beforeSinglePageExport.cloneProjectStartDate,s.parent.cloneProjectEndDate=s.helper.beforeSinglePageExport.cloneProjectEndDate,s.parent.timelineModule.customTimelineSettings=s.helper.beforeSinglePageExport.customTimelineSettings,s.parent.isTimelineRoundOff=s.helper.beforeSinglePageExport.isTimelineRoundOff,s.parent.timelineModule.topTier=s.helper.beforeSinglePageExport.topTier,s.parent.timelineModule.topTierCellWidth=s.helper.beforeSinglePageExport.topTierCellWidth,s.parent.timelineModule.topTierCollection=s.helper.beforeSinglePageExport.topTierCollection,s.parent.timelineModule.bottomTier=s.helper.beforeSinglePageExport.bottomTier,s.parent.timelineModule.bottomTierCellWidth=s.helper.beforeSinglePageExport.bottomTierCellWidth,s.parent.timelineModule.bottomTierCollection=s.helper.beforeSinglePageExport.bottomTierCollection,s.parent.timelineModule.totalTimelineWidth=s.helper.beforeSinglePageExport.totalTimelineWidth,s.parent.timelineModule.timelineStartDate=s.helper.beforeSinglePageExport.timelineStartDate,s.parent.timelineModule.timelineEndDate=s.helper.beforeSinglePageExport.timelineEndDate,s.parent.timelineModule.timelineRoundOffEndDate=s.helper.beforeSinglePageExport.timelineRoundOffEndDate,s.parent.perDayWidth=s.helper.beforeSinglePageExport.perDayWidth,s.parent.updatedConnectorLineCollection=s.helper.beforeSinglePageExport.updatedConnectorLineCollection),r||(s.isBlob?s.blobPromise=s.pdfDocument.save():!i.i(a.isNullOrUndefined)(t)&&t.fileName?s.pdfDocument.save(t.fileName):s.pdfDocument.save("Export.pdf"),s.pdfDocument.destroy()),s.pdfDocument})},e.prototype.processSectionExportProperties=function(e,t){if(i.i(a.isNullOrUndefined)(t))this.gantt.ganttStyle=new r.a(t.theme).style;else{var n=new o.PdfPageSettings;if(i.i(a.isNullOrUndefined)(t.pageOrientation)||"Portrait"!==t.pageOrientation?n.orientation=o.PdfPageOrientation.Landscape:n.orientation=o.PdfPageOrientation.Portrait,i.i(a.isNullOrUndefined)(t.pageSize)||(n.size=this.getPageSize(t.pageSize)),e.setPageSettings(n),i.i(a.isNullOrUndefined)(t.ganttStyle))this.gantt.ganttStyle=new r.a(t.theme).style;else{var s=new r.a(t.theme).style;this.gantt.ganttStyle=i.i(a.extend)({},s,t.ganttStyle,!0)}}},e.prototype.getPageSize=function(e){switch(e){case"Letter":return new o.SizeF(612,792);case"Note":return new o.SizeF(540,720);case"Legal":return new o.SizeF(612,1008);case"A0":return new o.SizeF(2380,3368);case"A1":return new o.SizeF(1684,2380);case"A2":return new o.SizeF(1190,1684);case"A3":return new o.SizeF(842,1190);case"A5":return new o.SizeF(421,595);case"A6":return new o.SizeF(297,421);case"A7":return new o.SizeF(210,297);case"A8":return new o.SizeF(148,210);case"A9":return new o.SizeF(105,148);case"B0":return new o.SizeF(2836,4008);case"B1":return new o.SizeF(2004,2836);case"B2":return new o.SizeF(1418,2004);case"B3":return new o.SizeF(1002,1418);case"B4":return new o.SizeF(709,1002);case"B5":return new o.SizeF(501,709);case"Archa":return new o.SizeF(648,864);case"Archb":return new o.SizeF(864,1296);case"Archc":return new o.SizeF(1296,1728);case"Archd":return new o.SizeF(1728,2592);case"Arche":return new o.SizeF(2592,3456);case"Flsa":return new o.SizeF(612,936);case"HalfLetter":return new o.SizeF(396,612);case"Letter11x17":return new o.SizeF(792,1224);case"Ledger":return new o.SizeF(1224,792);default:return new o.SizeF(595,842)}},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(6),n=(i.n(r),i(0)),a=(i.n(n),i(4)),s=(i.n(a),i(15)),o=function(){function e(e){this.isTest=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.isSharedTask=!1,this.canDrop=!0,this.parent=e,r.TreeGrid.Inject(r.RowDD),this.parent.treeGrid.allowRowDragAndDrop=this.parent.allowRowDragAndDrop,this.bindEvents()}return e.prototype.getModuleName=function(){return"rowDragAndDrop"},e.prototype.destroy=function(){},e.prototype.bindEvents=function(){this.parent.treeGrid.rowDragStart=this.rowDragStart.bind(this),this.parent.treeGrid.rowDragStartHelper=this.rowDragStartHelper.bind(this),this.parent.treeGrid.rowDrag=this.rowDrag.bind(this),this.parent.treeGrid.rowDrop=this.rowDrop.bind(this)},e.prototype.rowDragStart=function(e){this.parent.trigger("rowDragStart",e),this.parent.element.style.position="relative"},e.prototype.addErrorElem=function(){var e=document.getElementsByClassName("e-ganttdrag")[0];if(!e.querySelectorAll(".e-errorelem").length){var t=document.createElement("div");i.i(n.classList)(t,["e-errorcontainer"],[]),i.i(n.classList)(t,["e-icons","e-errorelem"],[]);var r=e.querySelector(".errorValue"),a=e.querySelector(".e-rowcell").innerHTML;r&&(a=r.innerHTML,r.parentNode.removeChild(r)),e.querySelector(".e-rowcell").innerHTML="";var s=document.createElement("span");s.className="errorValue",s.style.paddingLeft="16px",s.innerHTML=a,e.querySelector(".e-rowcell").appendChild(t),e.querySelector(".e-rowcell").appendChild(s)}},e.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem");e&&e.remove()},e.prototype.rowDrag=function(e){var t=this.parent.element.querySelector(".e-cloneproperties");t.style.display="none";var r=t.cloneNode(!0);r.classList.add("e-ganttdrag"),r.style.display="",this.parent.element.querySelectorAll(".e-cloneproperties").length<=1?this.parent.element.appendChild(r):document.getElementsByClassName("e-cloneproperties")[0].querySelectorAll(".e-errorelem").length?this.addErrorElem():this.removeErrorElem(),"Both"===this.parent.gridLines&&i.i(n.addClass)(this.parent.element.querySelectorAll(".e-ganttdrag .e-rowcell"),["e-bothganttlines"]);var a,s,o=this.parent.element.querySelector(".e-ganttdrag"),l=this.parent.element.getClientRects()[0].top,d=this.parent.element.getClientRects()[0].left;this.parent.isAdaptive?(a=e.originalEvent.event.touches[0].clientX-d,s=e.originalEvent.event.touches[0].clientY-l):(a=i.i(n.getValue)("event",e.originalEvent).clientX-d,s=i.i(n.getValue)("event",e.originalEvent).clientY-l),o.style.left=a+20+"px",o.style.top=s+20+"px",this.parent.trigger("rowDrag",e)},e.prototype.rowDragStartHelper=function(e){this.parent.trigger("rowDragStartHelper",e),this.parent.readOnly&&(e.cancel=!0),"ResourceView"===this.parent.viewType&&0===i.i(n.getValue)("level",e.data[0])&&(e.cancel=!0)},e.prototype.rowDrop=function(e){var t=document.querySelector(".e-ganttdrag");t&&t.remove();var r=i.i(n.closest)(e.target,".e-row"),a=r?parseInt(r.getAttribute("data-rowindex"),10):e.dropIndex;e.dropIndex=a,e.dropRecord=this.parent.updatedRecords[e.dropIndex],this.parent.trigger("rowDrop",e),"ResourceView"===this.parent.viewType&&("middleSegment"===e.dropPosition&&(1!==e.dropRecord.level&&e.dropRecord.uniqueID!==i.i(n.getValue)("parentItem",e.data[0]).uniqueID||(e.cancel=!0)),"middleSegment"!==e.dropPosition&&(0!==e.dropRecord.level&&i.i(n.getValue)("parentItem",e.data[0]).uniqueID!==e.dropRecord.parentItem.uniqueID||(e.cancel=!0))),e.cancel||(e.requestType="beforeDrop",this.parent.trigger("actionBegin",e),i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),e.cancel||(this.dropRows(e,!0),e.cancel=!0))},e.prototype.dropRows=function(e,t){if(!this.parent.readOnly){if(this.dropPosition=e.dropPosition,"Invalid"!==e.dropPosition&&this.parent.editModule){var r=this.parent,a=void 0;this.droppedRecord=r.updatedRecords[e.dropIndex];var s=[],o=this.droppedRecord;e.data[0]?s=e.data:s.push(e.data);for(var l=0,d=s.length,h=this,p=0;p<d;p++){var u=function(e){if(h.parent.isOnEdit=!0,a=s[e],h.draggedRecord=a,"Invalid"!==h.dropPosition){if("ResourceView"===h.parent.viewType&&(h.checkisSharedTask(),h.previousParent=h.draggedRecord.parentItem.uniqueID),h.isSharedTask)return{value:void 0};t&&h.deleteDragRow();var d=h.treeGridData.indexOf(o);if("topSegment"===h.dropPosition&&h.dropAtTop(d),"bottomSegment"===h.dropPosition&&!h.isSharedTask){if(o.hasChildRecords){if(l=h.parent.editModule.getChildCount(o,0),h.parent.taskFields.parentID&&h.ganttData.length>0&&h.ganttData.splice(d+l+1,0,h.draggedRecord.taskData),h.treeGridData.splice(d+l+1,0,h.draggedRecord),h.parent.ids.splice(d+l+1,0,h.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===h.parent.viewType){var p=0===h.draggedRecord.level?"R"+h.draggedRecord.ganttProperties.taskId:"T"+h.draggedRecord.ganttProperties.taskId;h.parent.getTaskIds().splice(d+l+1,0,p)}}else if(h.parent.taskFields.parentID&&h.ganttData.length>0&&h.ganttData.splice(d+1,0,h.draggedRecord.taskData),h.treeGridData.splice(d+1,0,h.draggedRecord),h.parent.ids.splice(d+1,0,h.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===h.parent.viewType){var u=0===h.draggedRecord.level?"R"+h.draggedRecord.ganttProperties.taskId:"T"+h.draggedRecord.ganttProperties.taskId;h.parent.getTaskIds().splice(d+1,0,u)}if(h.parent.setRecordValue("parentItem",h.treeGridData[d].parentItem,a),h.parent.setRecordValue("parentUniqueID",h.treeGridData[d].parentUniqueID,a),h.parent.setRecordValue("level",h.treeGridData[d].level,a),a.hasChildRecords){h.updateChildRecordLevel(a,1),h.updateChildRecord(a,d+l+1)}if(o.parentItem){var c=h.parent.getParentTask(o.parentItem).childRecords,g=c,f=g.indexOf(o)+1;g.splice(f,0,a)}}if("middleSegment"===h.dropPosition&&(h.dropMiddle(d),o.childRecords.length>0&&(delete o.ganttProperties.segments,delete o.taskData[h.parent.taskFields.segments])),0!=h.treeGridData.length)for(var m=0;m<h.treeGridData.length;m++)if(h.treeGridData[parseInt(m.toString(),10)].index=m,!i.i(n.isNullOrUndefined)(h.treeGridData[parseInt(m.toString(),10)].parentItem)){var y=i.i(n.getValue)("uniqueIDCollection."+h.treeGridData[parseInt(m.toString(),10)].parentUniqueID,h.parent.treeGrid);h.treeGridData[parseInt(m.toString(),10)].parentItem.index=y.index}i.i(n.isNullOrUndefined)(a.parentItem&&-1!==h.updateParentRecords.indexOf(a.parentItem))||h.updateParentRecords.push(a.parentItem)}if(!h.parent.enableVirtualization){var D=r.flatData,v=void 0,w=void 0,k=h.parent.dataSource,b=h.parent.taskFields.id;if(a.index<o.index){v=a.index;for(var T=0;T<k.length;T++){if("break"===function(e){var t=h.parent.currentViewData.filter(function(t){return t[b]===k[e][b]})[0];if(t&&t.index>o.index)return w=t.index,"break"}(T))break}}else{v=o.index;for(var S=0;S<k.length;S++){if("break"===function(e){var t=h.parent.currentViewData.filter(function(t){return t[b]===k[e][b]})[0];if(t&&t.index>a.index)return w=t.index,"break"}(S))break}}for(var P=v;P<=w;P++)!function(e){if(!i.i(n.isNullOrUndefined)(D[e])&&(D[e].index=e,!i.i(n.isNullOrUndefined)(D[e].parentItem))){var t=D.filter(function(t){return t.uniqueID===D[e].parentUniqueID})[0];D[e].parentItem.index=t.index}}(P)}r.rowDragAndDropModule.refreshDataSource()}(p);if("object"==typeof u)return u.value}if("middleSegment"===this.dropPosition&&(o.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(o),o.ganttProperties.predecessor=null,o.ganttProperties.predecessorsName=null,o[this.parent.taskFields.dependency]=null,o.taskData[this.parent.taskFields.dependency]=null),o.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,o.ganttProperties,!0),i.i(n.isNullOrUndefined)(o.taskData[this.parent.taskFields.milestone])||!0===o.taskData[this.parent.taskFields.milestone]&&(o.taskData[this.parent.taskFields.milestone]=!1))),"ResourceView"===this.parent.viewType&&!this.isSharedTask){var c=void 0;c="middleSegment"===this.dropPosition?this.droppedRecord.uniqueID:this.droppedRecord.parentItem?this.droppedRecord.parentItem.uniqueID:this.droppedRecord.uniqueID;var g=this.parent.getTaskByUniqueID(c),f={};f[this.parent.taskFields.resourceInfo]=[],f[this.parent.taskFields.resourceInfo].push(g.ganttProperties.taskId),this.removeExistingResources();var m=this.parent.dataOperation.setResourceInfo(f),y=this.draggedRecord;i.i(n.isNullOrUndefined)(y.ganttProperties.resourceInfo)&&(y.ganttProperties.resourceInfo=[]),"Unassigned Task"===g.ganttProperties.taskName?(y.ganttProperties.resourceInfo=[],y.ganttProperties.sharedTaskUniqueIds=[y.ganttProperties.rowUniqueID]):y.ganttProperties.resourceInfo.push(m[0]),this.updateCurrentTask(y),"Unassigned Task"===g.ganttProperties.taskName?this.deleteSharedResourceTask():this.updateSharedResourceTask()}if(this.parent.taskFields.dependency&&this.parent.allowParentDependency){var D,v=!0,w=void 0;w=a.parentItem?this.parent.flatData[this.parent.ids.indexOf(a.parentItem.taskId)]:a,D=o.parentItem?this.parent.flatData[this.parent.ids.indexOf(o.parentItem.taskId)]:o;var k=void 0;if(D.uniqueID===w.uniqueID||w.parentItem&&D.uniqueID===this.parent.flatData[this.parent.ids.indexOf(w.parentItem.taskId)].uniqueID){k=this.parent.currentViewData.filter(function(e){if(e.ganttProperties.predecessor&&e.ganttProperties.predecessor.length>0)for(var t=0;t<e.ganttProperties.predecessor.length;t++)return parseInt(e.ganttProperties.predecessor[t].to)===parseInt(D.ganttProperties.taskId)||parseInt(e.ganttProperties.predecessor[t].from)===parseInt(D.ganttProperties.taskId);return null});for(var b=[],p=0;p<k.length;p++){if(b=[],k[p].ganttProperties.predecessor)for(var T=0;T<k[p].ganttProperties.predecessor.length;T++)parseInt(k[p].ganttProperties.taskId)!==parseInt(k[p].ganttProperties.predecessor[T].from)?b.push(k[p].ganttProperties.predecessor[T].from):b.push(k[p].ganttProperties.predecessor[T].to);for(var S=this,P=0;P<b.length;P++)!function(e){var t=b[e].replace(/\D/g,""),i=S.parent.currentViewData.filter(function(e){return parseInt(e.ganttProperties.taskId)==parseInt(t)});(v=S.parent.connectorLineEditModule.validateParentPredecessor(k[p],i[0]))||(S.parent.dataOperation.resetDependency(k[p]),S.parent.dataOperation.resetDependency(i[0]))}(P)}}}for(var P=0;P<this.updateParentRecords.length;P++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[P]);this.updateParentRecords=[],this.parent.isOnEdit=!1}i.i(n.isNullOrUndefined)(this.parent.editModule)||this.parent.editModule.refreshRecord(e,!0)}},e.prototype.updateCurrentTask=function(e){this.parent.dataOperation.updateMappingData(e,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(e,"resource"),this.parent.editModule.dialogModule.dialogEditValidationFlag=!1,this.parent.editModule.dialogModule.validateDuration(e),this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(e)},e.prototype.deleteSharedResourceTask=function(){for(var e=0;e<this.parent.getTaskIds().length;e++)this.parent.getTaskIds()[e]==="T"+this.draggedRecord.ganttProperties.taskId&&("Unassigned Task"!==this.parent.getTaskByUniqueID(this.parent.currentViewData[e].parentItem.uniqueID).ganttProperties.taskName&&this.removeRecords(this.parent.currentViewData[e]),i.i(n.isNullOrUndefined)(this.parent.currentViewData[e].parentItem&&-1!==this.updateParentRecords.indexOf(this.parent.currentViewData[e].parentItem))||this.updateParentRecords.push(this.parent.currentViewData[e].parentItem))},e.prototype.removeExistingResources=function(){var e=this.parent.getTaskByUniqueID(this.previousParent);if(this.draggedRecord.ganttProperties.resourceInfo)for(var t=0;t<this.draggedRecord.ganttProperties.resourceInfo.length;t++)if(this.draggedRecord.ganttProperties.resourceInfo[t][this.parent.resourceFields.id]===e.ganttProperties.taskId){this.draggedRecord.ganttProperties.resourceInfo.splice(t,1);break}},e.prototype.updateSharedResourceTask=function(){for(var e=0;e<this.parent.getTaskIds().length;e++)this.parent.getTaskIds()[e]==="T"+this.draggedRecord.ganttProperties.taskId&&(this.parent.editModule.updateGanttProperties(this.draggedRecord,this.parent.flatData[e]),this.parent.dataOperation.updateTaskData(this.parent.flatData[e]),i.i(n.isNullOrUndefined)(this.parent.flatData[e].parentItem&&-1!==this.updateParentRecords.indexOf(this.parent.currentViewData[e].parentItem))||this.updateParentRecords.push(this.parent.flatData[e].parentItem))},e.prototype._getExistingTaskWithID=function(e){for(var t=[],i=0;i<this.parent.getTaskIds().length;i++)this.parent.getTaskIds()[i]==="T"+e.ganttProperties.taskId&&t.push(this.parent.flatData[i]);return t},e.prototype.removeResourceInfo=function(e){var t=this.parent.getTaskByUniqueID(this.draggedRecord.parentItem.uniqueID);if(e.ganttProperties.resourceInfo&&e.ganttProperties.resourceInfo.length>1){var r=this._getExistingTaskWithID(e),a=void 0;if(null==r)return;for(var s=0;s<r.length;s++){a=r[s];for(var o=a.ganttProperties.resourceInfo,l=0;l<o.length;l++)if(o[l][this.parent.resourceFields.id]===t.ganttProperties.taskId){o.splice(l,1),this.parent.setRecordValue("resourceInfo",o,a.ganttProperties,!0),this.updateCurrentTask(a),i.i(n.isNullOrUndefined)(a.parentItem&&-1!==this.updateParentRecords.indexOf(a.parentItem))||this.updateParentRecords.push(a.parentItem);break}}}},e.prototype.refreshDataSource=function(){var e,t,r=this.draggedRecord,s=this.droppedRecord,o=this.parent,l=this.parent.taskFields;if(e=this.parent.dataSource instanceof a.DataManager?i.i(n.getValue)("dataOperation.dataArray",this.parent):o.dataSource,e.length>0&&!i.i(n.isNullOrUndefined)(s)&&!s.parentItem){for(var d=0;d<Object.keys(e).length;d++)i.i(n.isNullOrUndefined)(s.taskData[l.child])||e[d][l.child]!==s.taskData[l.child]?i.i(n.isNullOrUndefined)(s.taskData[l.child])&&s.taskData[l.id]===e[d][l.id]&&(t=d):t=d;"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(t,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(t+1,0,r.taskData))}else if(!this.parent.taskFields.parentID&&!i.i(n.isNullOrUndefined)(s)&&s.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var h="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=s,this.parent.editModule.updateRealDataSource([r],h),delete this.parent.editModule.addRowSelectedItem}if(this.parent.taskFields.parentID)if(r.parentItem){var p="middleSegment"===this.dropPosition?this.parent.taskFields.id:this.parent.taskFields.parentID;r[this.parent.taskFields.parentID]=s[p],r.ganttProperties.parentId=s[p],("ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition||"ProjectView"===this.parent.viewType)&&(r.taskData[this.parent.taskFields.parentID]=s.taskData[p])}else r[this.parent.taskFields.parentID]=null,r.taskData[this.parent.taskFields.parentID]=null,r.ganttProperties.parentId=null},e.prototype.dropMiddle=function(e){var t=this.parent,r=this.parent.editModule.getChildCount(this.droppedRecord,0),a=i.i(n.isNullOrUndefined)(r)||0===r?e+1:r+e+1;if("middleSegment"===this.dropPosition&&!this.isSharedTask){if(t.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(a,0,this.draggedRecord.taskData),this.treeGridData.splice(a,0,this.draggedRecord),this.parent.ids.splice(a,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var s=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId;this.parent.getTaskIds().splice(a,0,s)}this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,a,this.droppedRecord.expanded),this.recordLevel(),i.i(n.isNullOrUndefined)(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem))&&this.updateParentRecords.push(this.draggedRecord.parentItem)}},e.prototype.recordLevel=function(){var e=this.parent,t=this.draggedRecord,r=this.droppedRecord,a=e.taskFields.child;if(r.hasChildRecords||(r.hasChildRecords=!0,r.childRecords.length||(r.childRecords=[],!e.taskFields.parentID&&i.i(n.isNullOrUndefined)(r.taskData[a])&&(r.taskData[a]=[]))),"middleSegment"===this.dropPosition){var s=i.i(n.extend)({},r);delete s.childRecords;var o={uniqueID:s.uniqueID,expanded:s.expanded,level:s.level,index:s.index,taskId:s.ganttProperties.rowUniqueID};if(this.parent.setRecordValue("parentItem",o,t),this.parent.setRecordValue("parentUniqueID",r.uniqueID,t),r.childRecords.splice(r.childRecords.length,0,t),i.i(n.isNullOrUndefined)(t)||e.taskFields.parentID||i.i(n.isNullOrUndefined)(r.taskData[a])||r.taskData[e.taskFields.child].splice(r.childRecords.length,0,t.taskData),t.hasChildRecords){t.level=r.level+1,this.parent.setRecordValue("level",this.draggedRecord.level,this.draggedRecord),this.updateChildRecordLevel(t,1)}else t.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.treeGridData=i.i(s.e)(this.parent)?i.i(n.getValue)("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource,this.parent.dataSource instanceof a.DataManager?this.ganttData=i.i(n.getValue)("dataOperation.dataArray",this.parent):this.ganttData=i.i(s.e)(this.parent)?i.i(n.getValue)("result",this.parent.dataSource):this.parent.dataSource;var e=this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);this.removeRecords(e)},e.prototype.checkisSharedTask=function(){this.isSharedTask=!1;for(var e=null,t=0===this.droppedRecord.level?this.droppedRecord.uniqueID:this.droppedRecord.parentItem.uniqueID,i=this.parent.getTaskByUniqueID(t),r=i.childRecords,n=0;n<r.length;n++)"T"+this.draggedRecord.ganttProperties.taskId=="T"+r[n].ganttProperties.taskId&&(this.isSharedTask=!0,e=r[n]);this.isSharedTask&&this.removeResourceInfo(e)},e.prototype.dropAtTop=function(e){var t=this.parent;if(!this.isSharedTask){if(t.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(e,0,this.draggedRecord.taskData),this.treeGridData.splice(e,0,this.draggedRecord),this.parent.ids.splice(e,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),this.parent.setRecordValue("parentItem",this.droppedRecord.parentItem,this.draggedRecord),this.parent.setRecordValue("parentUniqueID",this.droppedRecord.parentUniqueID,this.draggedRecord),this.parent.setRecordValue("level",this.droppedRecord.level,this.draggedRecord),"ResourceView"===this.parent.viewType){var r=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId;this.parent.getTaskIds().splice(e,0,r)}if(this.draggedRecord.hasChildRecords){this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)}if(this.droppedRecord.parentItem){var a=this.parent.getParentTask(this.droppedRecord.parentItem).childRecords,s=a,o=s.indexOf(this.droppedRecord);s.splice(o,0,this.draggedRecord)}i.i(n.isNullOrUndefined)(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem))||this.updateParentRecords.push(this.draggedRecord.parentItem)}},e.prototype.updateChildRecordLevel=function(e,t){var i,r=0;if(t++,!e.hasChildRecords)return 0;r=e.childRecords.length;for(var n=0;n<r;n++){i=e.childRecords[n];var a=void 0;if(e.parentItem){a=this.parent.treeGrid.uniqueIDCollection[e.parentItem.uniqueID]}i.level=e.parentItem?a.level+t:e.level+1,this.parent.setRecordValue("level",i.level,i),i.hasChildRecords&&(t--,t=this.updateChildRecordLevel(i,t))}return t},e.prototype.updateChildRecord=function(e,t,i){var r,n=this.parent,a=0;if(!e.hasChildRecords)return 0;a=e.childRecords.length;for(var s=0;s<a;s++)r=e.childRecords[s],t++,n.flatData.splice(t,0,r),this.parent.ids.splice(t,0,r.ganttProperties.rowUniqueID.toString()),n.taskFields.parentID&&n.dataSource.length>0&&this.ganttData.splice(t,0,r.taskData),r.hasChildRecords&&(t=this.updateChildRecord(r,t));return t},e.prototype.removeRecords=function(e){var t,r=this.parent;t=this.parent.dataSource instanceof a.DataManager?i.i(n.getValue)("dataOperation.dataArray",this.parent):this.parent.dataSource;var s=e,o=this.parent.getParentTask(s.parentItem);if(s){if(s.parentItem){var l=o?o.childRecords:[],d=0;l&&l.length>0&&("ResourceView"===this.parent.viewType&&1===l.length&&(this.parent.isOnDelete=!0,l[0].isDelete=!0,this.parent.dataOperation.updateParentItems(o),this.parent.isOnDelete=!1,l[0].isDelete=!1),d=l.indexOf(s),o.childRecords.splice(d,1),!this.parent.taskFields.parentID&&o.taskData[this.parent.taskFields.child]&&o.taskData[this.parent.taskFields.child].splice(d,1),this.updateParentRecords.push(o))}if(!this.parent.taskFields.parentID){var h=[];h.push(s.ganttProperties.taskId.toString()),("ProjectView"===this.parent.viewType||"ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition)&&this.parent.editModule.removeFromDataSource(h)}if(r.taskFields.parentID){s.hasChildRecords&&s.childRecords.length>0&&this.removeChildItem(s);for(var p=void 0,u=t.length>0&&"ResourceView"!==this.parent.viewType?t:this.parent.updatedRecords,c=0;c<u.length;c++)"ResourceView"===this.parent.viewType?u[c].ganttProperties.rowUniqueID===s.ganttProperties.rowUniqueID&&(p=c):u[c][this.parent.taskFields.id]===s.taskData[this.parent.taskFields.id]&&(p=c);if(-1!==p){t.length>0&&t.splice(p,1);var g=this.treeGridData.indexOf(s);this.treeGridData.splice(g,1),this.parent.ids.splice(g,1),-1!==this.parent.treeGrid.parentData.indexOf(s)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(s),1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(p,1)}}var f=this.treeGridData.indexOf(s);if(!r.taskFields.parentID){var m=this.parent.editModule.getChildCount(s,0);this.treeGridData.splice(f,m+1),this.parent.ids.splice(f,m+1);var y=this.ganttData.indexOf(s.taskData);-1!==y&&(this.ganttData.splice(y,1),this.parent.treeGrid.parentData.splice(y,1)),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(f,m+1)}s.parentItem&&o&&o.childRecords&&!o.childRecords.length&&(o.expanded=!1,o.hasChildRecords=!1)}},e.prototype.removeChildItem=function(e){for(var t,r,s=0;s<e.childRecords.length;s++){t=e.childRecords[s];var o=void 0;o=this.parent.dataSource instanceof a.DataManager?i.i(n.getValue)("dataOperation.dataArray",this.parent):this.parent.dataSource;for(var l=0;l<o.length;l++)o[l][this.parent.taskFields.id]===t.taskData[this.parent.taskFields.id]&&(r=l);if(-1!==r){o.length>0&&o.splice(r,1);var d=this.treeGridData.indexOf(t);this.treeGridData.splice(d,1),this.parent.ids.splice(d,1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(r,1)}t.hasChildRecords&&this.removeChildItem(t)}},e.prototype.reorderRows=function(e,t,i){if(!this.parent.readOnly){if(e[0],0)return;"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var r=[],n=0;n<e.length;n++)r[n]=this.parent.updatedRecords[e[n]];var a={data:r,dropIndex:t,dropPosition:this.dropPosition};this.dropRows(a,!0)}},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(5),n=(i.n(r),i(0)),a=(i.n(n),i(4)),s=(i.n(a),function(){function e(e){this.isSelectionFromChart=!1,this.multipleIndexes=[],this.selectedRowIndexes=[],this.enableSelectMultiTouch=!1,this.openPopup=!1,this.parent=e,this.bindEvents(),this.parent.treeGrid.selectedRowIndex=this.parent.selectedRowIndex,this.parent.treeGrid.allowSelection=this.parent.allowSelection,this.parent.treeGrid.grid.selectionSettings.enableToggle=this.parent.selectionSettings.enableToggle,this.parent.treeGrid.selectionSettings=i.i(r.getActualProperties)(this.parent.selectionSettings),this.wireEvents()}return e.prototype.getModuleName=function(){return"selection"},e.prototype.wireEvents=function(){this.parent.on("selectRowByIndex",this.selectRowByIndex,this),this.parent.isAdaptive?(this.parent.on("chartMouseClick",this.mouseUpHandler,this),this.parent.on("treeGridClick",this.popUpClickHandler,this)):this.parent.on("chartMouseUp",this.mouseUpHandler,this)},e.prototype.selectRowByIndex=function(){-1===this.parent.selectedRowIndex&&-1===this.parent.staticSelectedRowIndex||!this.parent.isLoad||(this.selectRow(-1!==this.parent.staticSelectedRowIndex?this.parent.staticSelectedRowIndex:this.parent.selectedRowIndex),this.parent.staticSelectedRowIndex=-1)},e.prototype.bindEvents=function(){this.parent.treeGrid.rowSelecting=this.rowSelecting.bind(this),this.parent.treeGrid.rowSelected=this.rowSelected.bind(this),this.parent.treeGrid.rowDeselecting=this.rowDeselecting.bind(this),this.parent.treeGrid.rowDeselected=this.rowDeselected.bind(this),this.parent.treeGrid.cellSelecting=this.cellSelecting.bind(this),this.parent.treeGrid.cellSelected=this.cellSelected.bind(this),this.parent.treeGrid.cellDeselecting=this.cellDeselecting.bind(this),this.parent.treeGrid.cellDeselected=this.cellDeselected.bind(this)},e.prototype.rowSelecting=function(e){if(!this.parent.isGanttChartRendered)return void(e.cancel=!0);e.isCtrlPressed=this.isMultiCtrlRequest,e.isShiftPressed=this.isMultiShiftRequest,e.target=this.actualTarget,i.i(n.isNullOrUndefined)(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.parent.trigger("rowSelecting",e)},e.prototype.rowSelected=function(e){var t="Multiple"!==this.parent.selectionSettings.type||i.i(n.isNullOrUndefined)(e.rowIndexes)?[e.rowIndex]:e.rowIndexes;this.addRemoveClass(t),this.selectedRowIndexes=i.i(n.extend)([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:this.parent.treeGrid.grid.selectedRowIndex},!0),this.isMultiShiftRequest&&(this.selectedRowIndexes=t),this.parent.autoFocusTasks&&this.parent.ganttChartModule.updateScrollLeft(i.i(n.getValue)("data.ganttProperties.left",e)),e.target=this.actualTarget,i.i(n.isNullOrUndefined)(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.prevRowIndex=e.rowIndex,i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(e),this.parent.trigger("rowSelected",e)},e.prototype.rowDeselecting=function(e){e.target=this.actualTarget,e.isInteracted=this.isInteracted,this.parent.trigger("rowDeselecting",e)},e.prototype.rowDeselected=function(e){var t,r;if(0!==this.multipleIndexes.length)t=this.multipleIndexes;else if(i.i(n.isNullOrUndefined)(e.rowIndexes))t=[e.rowIndex];else{for(var a=0;a<e.rowIndexes.length;a++)e.rowIndexes[a]===e.rowIndex&&(r=!0);t=r?e.rowIndexes:[e.rowIndex]}this.addRemoveClass(t),this.selectedRowIndexes=i.i(n.extend)([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:-1},!0),1===this.selectedRowIndexes.length&&this.parent.setProperties({selectedRowIndex:this.selectedRowIndexes[0]},!0),i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&0===this.selectedRowIndexes.length&&this.hidePopUp(),e.target=this.actualTarget,e.isInteracted=this.isInteracted,this.parent.trigger("rowDeselected",e),this.isInteracted=!1,this.multipleIndexes=[]},e.prototype.cellSelecting=function(e){var t=new a.Deferred;return this.parent.trigger("cellSelecting",e,function(e){t.resolve(e)}),t},e.prototype.cellSelected=function(e){this.parent.trigger("cellSelected",e),i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.cellDeselecting=function(e){this.parent.trigger("cellDeselecting",e)},e.prototype.cellDeselected=function(e){this.parent.trigger("cellDeselected",e),i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.selectCell=function(e,t){this.parent.treeGrid.selectCell(e,t)},e.prototype.selectCells=function(e){this.parent.treeGrid.grid.selectCells(e)},e.prototype.selectRow=function(e,t,r){var a=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children);this.parent.enableVirtualization&&this.parent.treeGridModule.addedRecord&&(e=this.parent.flatData.indexOf(this.parent.currentViewData[e]),this.parent.treeGridModule.addedRecord=!1);var s,o=a.filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e})[0];-1===e||i.i(n.isNullOrUndefined)(o)||"Cell"===this.parent.selectionSettings.mode||(this.parent.showActiveElement&&!r?this.parent.treeGrid.grid.selectionModule.preventFocus=!0:this.parent.treeGrid.grid.selectionModule.preventFocus=!1,i.i(n.isNullOrUndefined)(this.selectedClass)||this.selectedClass!==o||t||(s=!0),!0!==s&&this.parent.treeGrid.selectRow(e,t),this.parent.treeGrid.grid.selectionModule.preventFocus=!0!==this.parent.treeGrid.grid.selectionModule.preventFocus&&this.parent.treeGrid.grid.selectionModule.preventFocus,this.prevRowIndex=e,this.selectedClass=o)},e.prototype.selectRows=function(e){!i.i(n.isNullOrUndefined)(e)&&e.length>0&&this.parent.treeGrid.selectRows(e)},e.prototype.getSelectedRowIndexes=function(){return this.parent.treeGrid.getSelectedRowIndexes()},e.prototype.getSelectedRowCellIndexes=function(){return this.parent.treeGrid.getSelectedRowCellIndexes()},e.prototype.getSelectedRecords=function(){if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){for(var e=[],t=this.parent.selectionModule.getSelectedRowIndexes(),i=this,r=0;r<t.length;r++)!function(r){var n=i.parent.currentViewData.filter(function(e){return e.index==t[r]})[0];e.push(n)}(r);return e}return this.parent.treeGrid.getSelectedRecords()},e.prototype.getCellSelectedRecords=function(){for(var e=this.parent.selectionModule.getSelectedRowCellIndexes(),t=[],i=0;i<e.length;i++)t.push(this.parent.currentViewData[e[i].rowIndex]);return t},e.prototype.getSelectedRows=function(){return this.parent.treeGrid.getSelectedRows()},e.prototype.clearSelection=function(){this.addRemoveClass(this.selectedRowIndexes),this.parent.treeGrid.clearSelection(),this.parent.selectedRowIndex=-1,this.selectedRowIndexes=[],this.selectedClass=null,i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.isInteracted=!1},e.prototype.highlightSelectedRows=function(e,t){if(this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch,this.isMultiShiftRequest=e.shiftKey,this.actualTarget=e.target,this.isInteracted=!0,this.isSelectionFromChart=t,t){var r=i.i(n.closest)(e.target,"tr.e-chart-row"),a=parseInt(r.getAttribute("aria-rowindex"),10),s=this.parent.selectionSettings.enableToggle;if("Single"===this.parent.selectionSettings.type||!this.isMultiCtrlRequest&&!this.isMultiShiftRequest)(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&!this.parent.rowDragAndDropModule.draggedRecord)&&this.selectRow(a,s);else if(this.isMultiShiftRequest)this.selectRowsByRange(i.i(n.isNullOrUndefined)(this.prevRowIndex)?a:this.prevRowIndex,a);else{i.i(n.setValue)("isMultiCtrlRequest",!0,this.parent.treeGrid.grid.selectionModule),this.parent.treeGrid.grid.selectionModule.addRowsToSelection([a]);var o=this.selectedRowIndexes.indexOf(a)>-1;o&&this.addRemoveClass([a])}}},e.prototype.getselectedrowsIndex=function(e,t){for(var i=[],r=e<t?{i:e,max:t}:{i:t,max:e},n=r.i,a=r.max;n<=a;n++)i.push(n);e>t&&i.reverse(),this.selectedRowIndexes=i},e.prototype.selectRowsByRange=function(e,t){this.isSelectionFromChart=!0,this.getselectedrowsIndex(e,t),this.selectRows(this.selectedRowIndexes)},e.prototype.addRemoveClass=function(e){"number"==typeof e&&(e=[e]);for(var t=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),r=this,a=0;a<e.length;a++)!function(a){var s=t.filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e[a]})[0];i.i(n.isNullOrUndefined)(s)||(r.getSelectedRowIndexes().indexOf(e[a])>-1?r.addClass(s):r.removeClass(s))}(a)},e.prototype.addClass=function(e){i.i(n.addClass)([e],"e-active"),e.setAttribute("aria-selected","true")},e.prototype.removeClass=function(e){i.i(n.removeClass)([e],"e-active"),e.removeAttribute("aria-selected")},e.prototype.showPopup=function(e){this.isSelectionFromChart?(i.i(r.setCssInGridPopUp)(this.parent.element.querySelector(".e-ganttpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(this.enableSelectMultiTouch&&(this.getSelectedRecords().length>1||this.getSelectedRowCellIndexes().length>1)?" e-spanclicked":"")),document.getElementsByClassName("e-gridpopup")[0].style.display="none",this.openPopup=!0):0===this.selectedRowIndexes.length&&this.hidePopUp()},e.prototype.hidePopUp=function(){this.openPopup?(document.getElementsByClassName("e-ganttpopup")[0].style.display="none",this.openPopup=!1):document.getElementsByClassName("e-gridpopup")[0].style.display="none"},e.prototype.popUpClickHandler=function(e){var t=e.target,r=this.parent.treeGrid.grid,a=i.i(n.closest)(t,".e-ganttpopup")?i.i(n.closest)(t,".e-ganttpopup"):i.i(n.closest)(t,".e-gridpopup");if(a){var s=a.querySelector(".e-rowselect");i.i(n.closest)(t,".e-ganttpopup")&&!s.classList.contains("e-spanclicked")?(this.enableSelectMultiTouch=!0,s.classList.add("e-spanclicked")):i.i(n.closest)(t,".e-gridpopup")&&s.classList.contains("e-spanclicked")?(this.openPopup=!0,this.enableSelectMultiTouch=!0):(this.hidePopUp(),this.enableSelectMultiTouch=!1,i.i(n.closest)(t,".e-ganttpopup")&&s.classList.remove("e-spanclicked"))}else if("Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive){var o=i.i(n.closest)(t,".e-rowcell");o&&0===this.selectedRowIndexes.length&&this.hidePopUp()}r&&i.i(n.setValue)("enableSelectMultiTouch",this.enableSelectMultiTouch,r.selectionModule)},e.prototype.mouseUpHandler=function(e){var t=!1,a=document.querySelectorAll(".e-drag-item"),s=null;if(e.target.closest(".e-rowcell")?s=e.target:e.target.closest(".e-chart-row")&&(s=e.target.closest(".e-left-label-container")||e.target.closest(".e-taskbar-main-container")||e.target.closest(".e-right-label-container")),this.parent.focusModule&&this.parent.focusModule.setActiveElement(s),this.parent.editModule&&this.parent.editSettings.allowTaskbarEditing&&this.parent.editModule.taskbarEditModule){var o=this.parent.editModule.taskbarEditModule;(o.isMouseDragged||o.tapPointOnFocus)&&(t=!0)}if(!t&&this.parent.element.contains(e.target)&&1!==a.length){var l=i.i(r.parentsUntil)(e.target,"e-chart-row"),d=e.target.classList.contains("e-rowcell")||e.target.classList.contains("e-row")||e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||!i.i(n.isNullOrUndefined)(l);this.popUpClickHandler(e),"Cell"!==this.parent.selectionSettings.mode&&d?(i.i(n.closest)(e.target,"tr.e-chart-row")?(this.parent.enableVirtualization&&(this.parent.treeGrid.grid.selectionModule.isInteracted=!0),this.highlightSelectedRows(e,!0)):this.highlightSelectedRows(e,!1),"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&(this.selectedRowIndexes.length>0?this.showPopup(e):this.hidePopUp())):this.isSelectionFromChart=!1}},e.prototype.maintainSelectedRecords=function(e){this.parent.selectionModule.getSelectedRowIndexes().indexOf(e)>-1&&this.addRemoveClass([e])},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off("selectRowByIndex",this.selectRowByIndex),this.parent.isAdaptive?(this.parent.off("chartMouseClick",this.mouseUpHandler),this.parent.off("treeGridClick",this.popUpClickHandler)):this.parent.off("chartMouseUp",this.mouseUpHandler))},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(6),n=(i.n(r),i(5)),a=(i.n(n),function(){function e(e){this.parent=e,r.TreeGrid.Inject(r.Sort),this.parent.treeGrid.allowSorting=this.parent.allowSorting,this.parent.treeGrid.sortSettings=i.i(n.getActualProperties)(this.parent.sortSettings),this.addEventListener()}return e.prototype.getModuleName=function(){return"sort"},e.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("updateModel",this.updateModel)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.sortColumn=function(e,t,i){this.parent.treeGrid.sortByColumn(e,t,i)},e.prototype.clearSorting=function(){this.parent.treeGrid.clearSorting()},e.prototype.updateModel=function(){this.parent.sortSettings=this.parent.treeGrid.sortSettings},e.prototype.removeSortColumn=function(e){this.parent.treeGrid.grid.removeSortColumn(e)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return h});var r=i(0),n=(i.n(r),i(1)),a=i(10),s=i(3),o=i(79),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),d=this&&this.__assign||function(){return d=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},d.apply(this,arguments)},h=function(e){function t(t){var i=e.call(this,t)||this;return i.isMouseDragged=!1,i.dependencyCancel=!1,i.editElement=null,i.elementOffsetLeft=0,i.elementOffsetTop=0,i.elementOffsetWidth=0,i.elementOffsetHeight=0,i.segmentIndex=-1,i.currentItemTop=0,i.currentItemPrevTop=0,i.topValue=0,i.draggedRecordMarginTop=0,i.parent=t,i.initPublicProp(),i.wireEvents(),i.editTooltip=new o.a(i.parent,i),i}return l(t,e),t.prototype.wireEvents=function(){this.parent.on("chartMouseDown",this.mouseDownHandler,this),this.parent.on("chartMouseUp",this.mouseUpHandler,this),this.parent.on("chartMouseLeave",this.mouseLeaveHandler,this),this.parent.on("chartMouseMove",this.mouseMoveAction,this),this.parent.on("chartMouseClick",this.mouseClickHandler,this)},t.prototype.initPublicProp=function(){this.taskBarEditElement=null,this.taskBarEditRecord=null,this.taskBarEditAction=null,this.connectorSecondElement=null,this.connectorSecondRecord=null,this.connectorSecondAction=null,this.highlightedSecondElement=null,this.fromPredecessorText=null,this.toPredecessorText=null,this.finalPredecessor=null,this.drawPredecessor=!1,this.roundOffDuration=!0,this.dragMouseLeave=!1,this.isMouseDragged=!1,this.previousItemProperty=["left","progress","duration","isMilestone","startDate","endDate","width","progressWidth","autoLeft","autoDuration","autoStartDate","autoEndDate","autoWidth","segments"],this.tapPointOnFocus=!1,this.touchEdit=!1},t.prototype.mouseDownHandler=function(e){if(this.parent.editSettings.allowTaskbarEditing&&!this.parent.readOnly)if(this.canDrag=!1,this.taskBarEditElement){var t=this.getElementByPosition(e),r=i.i(n.j)(t,s.D);(r&&r.innerHTML===this.taskBarEditElement.innerHTML||this.taskBarEditElement.classList.contains("e-segmented-taskbar")||this.taskBarEditElement.classList.contains("collpse-parent-border"))&&(this.updateTaskBarEditElement(e),this.canDrag=!0,e.preventDefault())}else this.parent.isAdaptive||this.updateTaskBarEditElement(e)},t.prototype.mouseClickHandler=function(e){if(this.parent.editSettings.allowTaskbarEditing){var t=this.getElementByPosition(e),a=i.i(n.j)(t,s.D);if(this.parent.selectionModule&&this.parent.selectionModule.enableSelectMultiTouch)return void(this.tapPointOnFocus&&this.updateTaskBarEditElement(e));this.tapPointOnFocus&&!i.i(r.isNullOrUndefined)(this.taskBarEditElement)&&a&&a.innerHTML!==this.taskBarEditElement.innerHTML?(this.connectorSecondRecord=this.parent.ganttChartModule.getRecordByTaskBar(a),this.connectorSecondAction="ConnectorPointLeftDrag",this.connectorSecondElement=a,this.fromPredecessorText="Finish",this.validateConnectorPoint()&&this.taskBarEditingAction(e,!0),this.showHideActivePredecessors(!1),this.initPublicProp()):t.classList.contains(s.E)?(this.canDrag=!1,this.multipleSelectionEnabled(),this.showHideTaskBarEditingElements(t,this.taskBarEditElement),this.tapPointOnFocus=!0,this.taskBarEditAction="ConnectorPointLeftDrag",this.connectorSecondRecord=this.taskBarEditRecord,this.taskBarEditingAction(e,!1)):t.classList.contains(s.F)?(this.canDrag=!1,this.multipleSelectionEnabled(),this.showHideTaskBarEditingElements(t,this.taskBarEditElement),this.tapPointOnFocus=!0,this.taskBarEditAction="ConnectorPointRightDrag",this.connectorSecondRecord=this.taskBarEditRecord,this.taskBarEditingAction(e,!1)):(this.tapPointOnFocus&&(this.showHideActivePredecessors(!1),this.showHideTaskBarEditingElements(a,this.taskBarEditElement)),this.updateTaskBarEditElement(e))}},t.prototype.showHideActivePredecessors=function(e){var t=this.taskBarEditRecord.ganttProperties,n=t.predecessor,a="ResourceView"===this.parent.viewType?t.taskId:t.rowUniqueID;if(n)for(var o=0;o<n.length;o++){var l=n[o];a.toString()!==l.from&&a.toString()!==l.to||this.applyActiveColor(l.from,l.to,e)}var d=this.parent.ganttChartModule.chartBodyContainer;e?(i.i(r.addClass)([this.taskBarEditElement],[s.G]),i.i(r.addClass)([d],[s.H])):(i.i(r.removeClass)([this.taskBarEditElement],[s.G]),i.i(r.removeClass)([d],[s.H])),this.touchEdit=e,i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},t.prototype.applyActiveColor=function(e,t,n){var a="ProjectView"===this.parent.viewType?this.taskBarEditRecord.ganttProperties.taskId.toString():this.taskBarEditRecord.ganttProperties.rowUniqueID.toString(),o=a===e?this.parent.connectorLineModule.getRecordByID(t):this.parent.connectorLineModule.getRecordByID(e),l=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(o)];if(!i.i(r.isNullOrUndefined)(l)){var d=l.querySelector("."+s.D),h=this.parent.element.querySelector("#ConnectorLineparent"+e+"child"+t);n?(i.i(r.addClass)([d],[s.I]),h&&i.i(r.addClass)([h],[s.I])):(i.i(r.removeClass)([d],[s.I]),h&&i.i(r.removeClass)([h],[s.I]))}},t.prototype.validateConnectorPoint=function(){var e=this.taskBarEditRecord.ganttProperties,t=this.connectorSecondRecord.ganttProperties,i=!0,r="ResourceView"===this.parent.viewType?e.taskId:e.rowUniqueID,n="ResourceView"===this.parent.viewType?t.taskId:t.rowUniqueID;if(this.connectorSecondRecord.hasChildRecords)i=!1;else if(t.predecessor)for(var a=0;a<t.predecessor.length;a++){var s=t.predecessor[a];if(s.from===r.toString()&&s.to===n.toString()){this.parent.connectorLineEditModule.childRecord=this.connectorSecondRecord,this.parent.connectorLineEditModule.predecessorIndex=a,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}if(s.from===n.toString()&&s.to===r.toString()){this.parent.connectorLineEditModule.childRecord=this.taskBarEditRecord,this.parent.connectorLineEditModule.predecessorIndex=a,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}}return i},t.prototype.mouseLeaveHandler=function(e){"ChildDrag"===this.taskBarEditAction||"ParentDrag"===this.taskBarEditAction||"ProgressResizing"===this.taskBarEditAction||"LeftResizing"===this.taskBarEditAction||"RightResizing"===this.taskBarEditAction?this.dragMouseLeave=!1:this.dragMouseLeave=!0},t.prototype.updateTaskBarEditElement=function(e){var t,a=this.getElementByPosition(e);if(a.classList.contains(s.J)||a.classList.contains(s.K)||a.classList.contains(s.L))t=i.i(n.j)(a,s.K);else if(a.classList.contains(s.M))t=i.i(n.j)(a,s.M);else if(t=i.i(n.j)(a,s.D),!i.i(r.isNullOrUndefined)(t)&&!a.classList.contains("e-connectorpoint-left")&&!a.classList.contains("e-connectorpoint-right")){var o=this.parent.ganttChartModule.getRecordByTaskBar(t);!i.i(r.isNullOrUndefined)(o.ganttProperties.segments)&&o.ganttProperties.segments.length>0&&(t=i.i(n.j)(a,s.N))}if(this.parent.editSettings.allowTaskbarEditing&&t){this.showHideTaskBarEditingElements(t,this.editElement),this.editElement=t,this.realTaskbarElement=this.editElement;var l=this.editElement.getAttribute("data-segment-index");if(i.i(r.isNullOrUndefined)(l)?this.segmentIndex=-1:this.segmentIndex=Number(l),this.taskBarEditRecord=this.parent.ganttChartModule.getRecordByTaskBar(this.editElement),"mousedown"===e.type||"touchstart"===e.type||"click"===e.type){this.taskBarEditAction=this.getTaskBarAction(e);var d=this.editElement.getAttribute("data-segment-index"),o=this.parent.ganttChartModule.getRecordByTaskBar(t),h=o.ganttProperties,p=this.editElement.parentElement.offsetLeft;this.currentData=o;var u=i.i(r.createElement)("div",{styles:"height:100%;border-style:dashed;border-bottom:none;border-top:none;border-width:1px;position:absolute;z-index:10000"});i.i(r.addClass)([u],"e-taskbar-resize-div"),u.style.setProperty("width",h.width+"px");var c=this.editElement.getAttribute("data-segment-index");u.style.setProperty("left",i.i(r.isNullOrUndefined)(h.segments)?h.left+"px":p+h.segments[Number(c)].left+"px");var g=this.parent.createElement("table"),f=this.parent.createElement("tbody");f.appendChild(u),g.appendChild(f);var m=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar"),y=null;if("ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||i.i(r.isNullOrUndefined)(d)||i.i(r.isNullOrUndefined)(d)||0!==Number(d))var D=this.editElement.cloneNode(!0);else var D=this.editElement.parentElement.cloneNode(!0);if(!m){i.i(r.addClass)([D],"e-clone-taskbar"),D.style.setProperty("position","absolute"),D.style.setProperty("top","0px"),y=this.parent.createElement("table");var v=this.parent.createElement("tbody");v.appendChild(D),y.appendChild(v)}if("ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||i.i(r.isNullOrUndefined)(d)||i.i(r.isNullOrUndefined)(d)||0!==Number(d))this.cloneTaskbarElement=D;else{var w=D.getElementsByClassName("e-segmented-taskbar");this.cloneTaskbarElement=w[Number(d)]}if(this.taskBarEditElement=this.cloneTaskbarElement,this.taskbarElement=y,this.taskbarResizer=g,this.currentIndex=d,this.roundOffDuration=!0,"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||!i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)||(this.taskBarEditAction=null),this.updateMouseDownProperties(e),"ResourceView"===this.parent.viewType){if(0===this.taskBarEditRecord.level)return;if(this.parent.enableMultiTaskbar){var k=this.parent.getTaskByUniqueID(this.taskBarEditRecord.parentItem.uniqueID);i.i(r.isNullOrUndefined)(k)||k.expanded||(this.prevZIndex=this.taskBarEditElement.style.zIndex,this.taskBarEditElement.style.zIndex="1000",this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")&&i.i(r.addClass)([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"))}}}}else this.parent.isAdaptive?(this.taskBarEditElement&&this.showHideTaskBarEditingElements(t,this.editElement),this.initPublicProp()):this.showHideTaskBarEditingElements(t,this.editElement)},t.prototype.showHideTaskBarEditingElements=function(e,t,n){t=t||this.editElement;var a=!!this.parent.taskFields.progress,o=!0;if(!this.parent.readOnly){if("ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar&&e){var l=this.parent.ganttChartModule.getRecordByTaskBar(e),d=this.parent.getParentTask(l.parentItem);i.i(r.isNullOrUndefined)(d)||d.expanded||(a=!1,o=!1)}if(e){if(e.querySelector("."+s.O)){if(i.i(r.addClass)([e.querySelector("."+s.O)],[s.P]),i.i(r.addClass)([e.querySelector("."+s.Q)],[s.R]),a){var h=e.querySelector("."+s.S);i.i(r.isNullOrUndefined)(h)||(i.i(r.addClass)([h],[s.T]),h.style.top="3px")}}else if(this.parent.isAdaptive&&a){var l=this.parent.ganttChartModule.getRecordByTaskBar(e);l.hasChildRecords&&i.i(r.addClass)([e],[s.U])}if(i.i(r.addClass)(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+s.V),[s.W]),!i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)&&(e.querySelector("."+s.X)||e.parentElement.querySelector("."+s.X))&&o){var p=i.i(r.isNullOrUndefined)(e.querySelector("."+s.X))?e.parentElement:e;i.i(r.isNullOrUndefined)(p.querySelector("."+s.X))||i.i(r.addClass)([p.querySelector("."+s.X)],[s.E]),i.i(r.isNullOrUndefined)(p.querySelector("."+s.Y))||i.i(r.addClass)([p.querySelector("."+s.Y)],[s.F])}}else n||i.i(r.removeClass)(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+s.V),[s.W]);if(t&&e!==t){if(t.querySelector("."+s.O)&&(i.i(r.removeClass)([t.querySelector("."+s.O)],[s.P]),i.i(r.removeClass)([t.querySelector("."+s.Q)],[s.R]),t.querySelector("."+s.S)&&i.i(r.removeClass)([t.querySelector("."+s.S)],[s.T])),i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)||!t.querySelector("."+s.X)&&!t.parentElement.querySelector("."+s.X)){if(this.parent.isAdaptive){var l=this.parent.ganttChartModule.getRecordByTaskBar(t);l&&l.hasChildRecords&&i.i(r.removeClass)([t],[s.U])}}else{var p=i.i(r.isNullOrUndefined)(t.querySelector("."+s.X))?t.parentElement:t;i.i(r.removeClass)([p.querySelector("."+s.X)],[s.E]),i.i(r.removeClass)([p.querySelector("."+s.Y)],[s.F])}this.editElement=null}}},t.prototype.getTaskBarAction=function(e){var t=this.getElementByPosition(e),n=this.taskBarEditRecord,a="";return t.classList.contains(s.O)?a="LeftResizing":t.classList.contains(s.Q)?a="RightResizing":(t.classList.contains(s.S)||i.i(r.closest)(t,"."+s.S))&&this.parent.taskFields.progress?a="ProgressResizing":t.classList.contains(s.X)?a="ConnectorPointLeftDrag":t.classList.contains(s.Y)?a="ConnectorPointRightDrag":t.classList.contains(s.J)?a="ParentResizing":t.classList.contains(s.L)||t.classList.contains(s.K)||t.classList.contains(s.M)?a="ManualParentDrag":n&&(a=n.hasChildRecords?"Auto"===this.parent.taskMode?"ParentDrag":"":n.ganttProperties.isMilestone?"MilestoneDrag":"ChildDrag"),a},t.prototype.updateMouseDownProperties=function(e){var t=this.getCoordinate(e),n=this.parent.element.closest('[style*="zoom"]');if(n){var a=parseFloat(getComputedStyle(n).zoom);t.pageX=t.pageX/a,t.pageY=t.pageY/a}if(t.pageX||t.pageY){var s=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.parent.enableRtl?this.mouseDownX=Math.abs(t.pageX-(s.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseDownX=t.pageX-s.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseDownX,this.mouseDownY=this.dragMoveY=t.pageY-s.top+this.parent.ganttChartModule.scrollObject.previousScroll.top}if("ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop){var o=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(o=this.parent.toolbarModule.element.offsetHeight),this.topValue=this.parent.getOffsetRect(e.target).top-this.parent.getOffsetRect(this.parent.element).top-parseInt(i.i(r.closest)(e.target,".e-taskbar-main-container").style.marginTop)-this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight-o+document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollTop,this.currentItemPrevTop=this.currentItemTop=this.topValue}"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.fromPredecessorText="ConnectorPointLeftDrag"===this.taskBarEditAction?"start":"finish",this.parent.connectorLineModule.tooltipTable.innerHTML=this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName,this.fromPredecessorText,"",""))},t.prototype.isMouseDragCheck=function(){if(!this.isMouseDragged&&this.taskBarEditAction&&(this.mouseDownX!==this.mouseMoveX&&(this.mouseDownX+3<this.mouseMoveX||this.mouseDownX-3>this.mouseMoveX)||this.mouseDownY!==this.mouseMoveY&&(this.mouseDownY+3<this.mouseMoveY||this.mouseDownY-3>this.mouseMoveY))){this.isMouseDragged=!0,this.parent.initiateEditAction(!0);var e=this.taskBarEditRecord.ganttProperties;this.previousItem=this.parent.timelineModule.extendFunction(e,this.previousItemProperty),"ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction||"ResourceView"==this.parent.viewType&&"ParentDrag"==this.taskBarEditAction||this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),this.taskBarEditElement.setAttribute("aria-grabbed","true")}},t.prototype.mouseMoveAction=function(e){var t=this;if(this.parent.isAdaptive){if(!this.canDrag)return;this.multipleSelectionEnabled()}var n=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),a=this.getCoordinate(e);if(this.parent.enableRtl?this.mouseMoveX=Math.abs(a.pageX-(n.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=a.pageX-n.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.mouseMoveY=a.pageY-n.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.dragMouseLeave=!1,this.isMouseDragCheck(),this.isMouseDragged&&this.taskBarEditAction){if(e.preventDefault(),!(i.i(r.isNullOrUndefined)(this.taskbarElement)||i.i(r.isNullOrUndefined)(this.editElement)||"ConnectorPointRightDrag"===this.taskBarEditAction||"ConnectorPointLeftDrag"===this.taskBarEditAction||"ResourceView"===this.parent.viewType&&this.currentData.hasChildRecords)){var s=this.editElement.parentElement;if(s.style.setProperty("position","absolute"),"ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||i.i(r.isNullOrUndefined)(this.currentIndex)||i.i(r.isNullOrUndefined)(this.currentIndex)||0!==Number(this.currentIndex)?s.appendChild(this.taskbarElement):(this.taskbarElement.childNodes[0].childNodes[0].style.setProperty("top",s.parentElement.offsetTop+"px"),s.parentElement.appendChild(this.taskbarElement)),"ProgressResizing"!==this.taskBarEditAction){this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-rows-container")[0].appendChild(this.taskbarResizer)}}var o={cancel:!1,requestType:"taskbarediting",taskBarEditAction:this.taskBarEditAction,data:this.taskBarEditRecord};-1!==this.segmentIndex&&(o.requestType="mergeSegment"),this.parent.trigger("actionBegin",o,function(n){"ConnectorPointRightDrag"!==o.taskBarEditAction&&"ConnectorPointLeftDrag"!==o.taskBarEditAction&&"LeftResizing"!==o.taskBarEditAction&&"RightResizing"!==o.taskBarEditAction&&"ProgressResizing"!==o.taskBarEditAction&&"ChildDrag"!==o.taskBarEditAction&&"ParentDrag"!==o.taskBarEditAction&&"MilestoneDrag"!==o.taskBarEditAction&&"ManualParentDrag"!==o.taskBarEditAction||(t.parent.showIndicator=!1),!i.i(r.isNullOrUndefined)(t.parent.loadingIndicator)&&"Shimmer"===t.parent.loadingIndicator.indicatorType&&t.parent.showIndicator?t.parent.showMaskRow():t.parent.showIndicator&&t.parent.showSpinner(),!1===n.cancel&&t.taskBarEditingAction(e,!1)})}else this.parent.isAdaptive||this.taskBarEditAction||this.updateTaskBarEditElement(e)},t.prototype.taskBarEditingAction=function(e,t){var n=this,a={},s=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement);if(null!==this.taskBarEditRecord){if(a.editingFields=this.taskBarEditRecord.ganttProperties,a.data=this.taskBarEditRecord,"ResourceView"===this.parent.viewType&&0===a.data.level)return;if(a.recordIndex=s,a.taskBarEditAction=this.taskBarEditAction,a.roundOffDuration=this.roundOffDuration,a.cancel=!1,a.previousData=this.previousItem,a.segmentIndex=this.segmentIndex,this.roundOffDuration=a.roundOffDuration,this.targetElement=a.target=i.i(r.closest)(e.target,".e-gantt-child-taskbar"),this.updateMouseMoveProperties(e),"ProgressResizing"===this.taskBarEditAction?this.performProgressResize(e):"LeftResizing"===this.taskBarEditAction?this.enableLeftResizing(e):"RightResizing"===this.taskBarEditAction||"ParentResizing"===this.taskBarEditAction?this.enableRightResizing(e):"ParentDrag"===this.taskBarEditAction||"ChildDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction||"ManualParentDrag"===this.taskBarEditAction?this.enableDragging(e):"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.updateConnectorLineSecondProperties(e),this.triggerDependencyEvent(e),this.drawFalseLine()),"ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop){this.dragMoveY>this.mouseMoveY?(this.mouseMoveY=this.dragMoveY-this.mouseMoveY,this.currentItemTop=this.currentItemTop-this.mouseMoveY):(this.mouseMoveY-=this.dragMoveY,this.currentItemTop=this.currentItemTop+this.mouseMoveY);var o=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.parent.isAdaptive||e.touches?this.dragMoveY=e.touches[0].pageY-o.top+this.parent.ganttChartModule.scrollObject.previousScroll.top:this.dragMoveY=e.pageY-o.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.topValue=this.currentItemTop,this.currentItemPrevTop=0===this.currentItemPrevTop||this.topValue==this.currentItemTop?this.topValue:this.currentItemPrevTop}this.setItemPosition(),this.updateEditedItem(),this.editTooltip.updateTooltip(this.segmentIndex),t&&this.taskBarEditedAction(e),this.parent.trigger("taskbarEditing",a,function(e){e.cancel&&null!==n.taskBarEditRecord&&(n.tapPointOnFocus=!1,i.i(r.merge)(n.taskBarEditRecord.ganttProperties,e.previousData))})}},t.prototype.updateMouseMoveProperties=function(e){var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),i=this.getCoordinate(e),r=this.parent.element.closest('[style*="zoom"]');if(r){var n=parseFloat(getComputedStyle(r).zoom);i.pageX=i.pageX/n,i.pageY=i.pageY/n}(i.pageX||i.pageY)&&(this.parent.enableRtl?this.mouseMoveX=Math.abs(i.pageX-(t.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=i.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseMoveX,this.mouseMoveY=i.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top);var a="ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction;if(this.taskBarEditRecord.ganttProperties.width>3&&("ProgressResizing"!==this.taskBarEditAction||0!==this.taskBarEditRecord.ganttProperties.progress&&100!==this.taskBarEditRecord.ganttProperties.progress)||a){var s=0;s=this.parent.enableRtl?Math.abs(Math.abs(this.mouseMoveX)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left)+t.left):this.mouseMoveX-this.parent.ganttChartModule.scrollObject.previousScroll.left+t.left;var o=this.mouseMoveY-this.parent.ganttChartModule.scrollObject.previousScroll.top+t.top;s+20>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):s+40>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth&&this.parent.enableRtl&&0==this.parent.ganttChartModule.scrollObject.previousScroll.left?(this.parent.ganttChartModule.scrollObject.previousScroll.left=-1,this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):s-20<t.left?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("left")):o+80>t.top+this.parent.ganttChartModule.chartBodyContainer.offsetHeight?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("bottom")):o-20<t.top?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("top")):this.stopScrollTimer()}else this.stopScrollTimer()},t.prototype.startScrollTimer=function(e){var t=this;this.stopScrollTimer();var i=0;this.scrollTimer=window.setInterval(function(){-1==Math.sign(t.timerCount)&&(i=-1,t.timerCount=Math.abs(t.timerCount)),t.timerCount="right"===e?t.timerCount+1>=t.parent.timelineModule.totalTimelineWidth?t.parent.timelineModule.totalTimelineWidth:t.timerCount+1:"bottom"===e?t.timerCount+1:t.timerCount-1<0?0:t.timerCount-1,"bottom"===e||"top"===e?t.parent.ganttChartModule.scrollObject.setScrollTop(t.timerCount):t.parent.ganttChartModule.scrollObject.setScrollLeft(t.timerCount,i),"ConnectorPointLeftDrag"!==t.taskBarEditAction&&"ConnectorPointRightDrag"!==t.taskBarEditAction||t.drawFalseLine()},0)},t.prototype.stopScrollTimer=function(){window.clearInterval(this.scrollTimer),this.scrollTimer=null},t.prototype.enableDragging=function(e){var t=this.taskBarEditRecord.ganttProperties,n=0;if(this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&!this.taskBarEditElement.classList.contains("e-segment-first")){var a=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return d({},e)}),s=a[this.segmentIndex];this.mouseDownX>this.mouseMoveX?(n=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,s.left=s.left-n):(n=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,s.left=s.left+n);var o=a[this.segmentIndex-1],l=a[this.segmentIndex+1],h=void 0;h=this.taskBarEditElement.classList.contains("e-segment-inprogress")?s.left<o.left+o.width?o.left+o.width:s.width+s.left>l.left?l.left-s.width:s.left:s.left<o.left+o.width?o.left+o.width:t.left+s.width+s.left>=this.parent.timelineModule.totalTimelineWidth?this.parent.timelineModule.totalTimelineWidth-s.width:s.left,s.left=h,this.parent.setRecordValue("segments",a,t,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")}else{this.mouseDownX>this.mouseMoveX?(n=this.mouseDownX-this.mouseMoveX)>0&&this.parent.setRecordValue("left",this.previousItem.left-n,t,!0):(n=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+n,t,!0));var h=t.left<0?0:t.left+t.width>=this.parent.timelineModule.totalTimelineWidth?this.parent.timelineModule.totalTimelineWidth-t.width:t.left;this.parent.setRecordValue("left",h,t,!0)}},t.prototype.performProgressResize=function(e){var t=this.taskBarEditRecord.ganttProperties,i=0;this.mouseDownX>this.mouseMoveX?this.mouseMoveX>t.left&&this.mouseMoveX<t.left+t.width&&t.left>0?(i=this.mouseMoveX-t.left,this.parent.setRecordValue("progressWidth",i,t,!0)):this.mouseMoveX>=t.left+t.width?this.parent.setRecordValue("progressWidth",t.width,t,!0):this.parent.setRecordValue("progressWidth",0,t,!0):this.mouseMoveX>t.left&&this.mouseMoveX<t.left+t.width?(i=this.mouseMoveX-t.left,this.parent.setRecordValue("progressWidth",i,t,!0)):this.mouseMoveX<=t.left?this.parent.setRecordValue("progressWidth",0,t,!0):this.parent.setRecordValue("progressWidth",t.width,t,!0);var r=t.progressWidth>t.width?t.width:t.progressWidth;r=t.progressWidth<0?0:t.progressWidth,this.parent.setRecordValue("progressWidth",r,t,!0);var n=t.width-t.progressWidth;this.progressBorderRadius=n<=4?4-n:0},t.prototype.enableLeftResizing=function(e){var t=this.taskBarEditRecord.ganttProperties,i=0;this.taskBarEditElement.classList.contains("e-segmented-taskbar")?this.enableSplitTaskLeftResize(t):(this.mouseDownX>this.mouseMoveX?this.mouseMoveX<t.left+t.width?(i=this.mouseDownX-this.mouseMoveX,t.left>0&&(this.parent.setRecordValue("left",this.previousItem.left-i,t,!0),this.parent.setRecordValue("width",this.previousItem.width+i,t,!0))):this.mouseMoveX>t.left+t.width&&(i=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("left",this.previousItem.left-i,t,!0),this.parent.setRecordValue("width",3,t,!0)):this.mouseMoveX<t.left+t.width?(i=this.mouseMoveX-this.mouseDownX,t.left<t.left+t.width&&this.previousItem.left+i<=this.previousItem.left+this.previousItem.width&&(this.parent.setRecordValue("left",this.previousItem.left+i,t,!0),this.parent.setRecordValue("width",this.previousItem.width-i,t,!0))):(i=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+i,t,!0),this.parent.setRecordValue("width",3,t,!0)),this.updateEditPosition(e,t),this.parent.setRecordValue("left",this.previousItem.left+this.previousItem.width-t.width,t,!0))},t.prototype.enableSplitTaskLeftResize=function(e){var t=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return d({},e)}),n=t[this.segmentIndex],a=0;if(this.mouseDownX>this.mouseMoveX)if(this.mouseMoveX<e.left+n.width+n.left){if(a=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,n.left>0){if(n.left=n.left-a,n.width=n.width+a,0!==this.segmentIndex){var s=t[this.segmentIndex-1];if(e.left+n.left<e.left+s.left+s.width){var o=e.left+s.left+s.width-(e.left+n.left);n.width-=o,n.left=n.left+o}}}else if(n.left<=0&&0===this.segmentIndex){this.parent.setRecordValue("left",e.left-a,e,!0),this.parent.setRecordValue("width",e.width+a,e,!0),n.width=n.width+a;for(var l=1;l<e.segments.length;l++){var h=t[l];h.left=h.left+a}}}else this.mouseMoveX>e.left+n.width+n.left&&(a=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,n.left=n.left-a,n.width=this.parent.perDayWidth);else if(this.mouseMoveX<e.left+n.width+n.left-this.parent.perDayWidth)if(a=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,0===this.segmentIndex&&n.left<=0){this.parent.setRecordValue("left",e.left+a,e,!0),this.parent.setRecordValue("width",e.width-a,e,!0),n.width=n.width-a;for(var l=1;l<e.segments.length;l++){var p=t[l];p.left=p.left-a}}else n.left<n.left+n.width&&n.left+a<=n.left+n.width&&(n.left=n.left+a,n.width=n.width-a);else if(this.mouseMoveX<e.left+n.left+n.width&&n.width>this.parent.perDayWidth){a=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX;var u=n.width-a<this.parent.perDayWidth?this.parent.perDayWidth>n.width?this.parent.perDayWidth-n.width:n.width-this.parent.perDayWidth:0;if(a-=u,0===this.segmentIndex){this.parent.setRecordValue("width",e.width-a,e,!0),this.parent.setRecordValue("left",e.left+a,e,!0),n.width=n.width-a;for(var l=1;l<e.segments.length;l++){var c=t[l];c.left=c.left-a}}else n.left=n.left+a,n.width=n.width-a}this.parent.setRecordValue("segments",t,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},t.prototype.updateEditPosition=function(e,t){this.updateIsMilestone(t),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.width,t.progress),t,!0)},t.prototype.updateIsMilestone=function(e){e.width<=3?(this.parent.setRecordValue("width",3,e,!0),this.parent.setRecordValue("isMilestone",!0,e,!0)):(this.parent.setRecordValue("width",e.width,e,!0),this.parent.setRecordValue("isMilestone",!1,e,!0))},t.prototype.enableRightResizing=function(e){var t=this.taskBarEditRecord.ganttProperties,n=0;if(this.taskBarEditElement.classList.contains("e-segmented-taskbar")){var a=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return d({},e)}),s=a[this.segmentIndex];if(this.mouseDownX>this.mouseMoveX){if(this.mouseMoveX>t.left+s.left&&this.mouseDownX-this.mouseMoveX>3)n=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,s.width=s.width-n;else if(this.mouseMoveX<t.left+s.left){var o=this.parent.timelineModule.isSingleTier&&("Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Hour"===this.parent.timelineModule.customTimelineSettings.topTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.topTier.unit)||"Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.timelineUnitSize:this.parent.perDayWidth;s.width=o}}else this.mouseMoveX>s.left&&(n=i.i(r.isNullOrUndefined)(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,s.width=s.width+n);var l=void 0,h=this.segmentIndex!==a.length-1?a[this.segmentIndex+1]:null;i.i(r.isNullOrUndefined)(h)||(this.taskBarEditElement.classList.contains("e-segment-last")||(l=s.left+s.width>h.left?h.left-s.left:s.width),s.width=l),this.segmentIndex===t.segments.length-1&&0===this.segmentIndex&&this.parent.setRecordValue("width",s.width,t,!0),this.parent.setRecordValue("segments",a,t,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")}else this.mouseDownX>this.mouseMoveX?this.mouseMoveX>t.left&&this.mouseDownX-this.mouseMoveX>3?(n=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("width",this.previousItem.width-n,t,!0)):this.mouseMoveX<t.left&&this.parent.setRecordValue("width",3,t,!0):this.mouseMoveX>t.left&&(n=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("width",this.previousItem.width+n,t,!0)),this.updateEditPosition(e,t)},t.prototype.updateEditedItem=function(){var e,t,n,a,s=this.taskBarEditRecord.ganttProperties;switch(this.taskBarEditAction){case"ProgressResizing":this.parent.setRecordValue("progress",this.getProgressPercent(s.width,s.progressWidth),s,!0);break;case"LeftResizing":-1===this.segmentIndex?(e=this.getRoundOffStartLeft(s,this.roundOffDuration),t=this.getDateByLeft(e),i.i(r.isNullOrUndefined)(s.endDate)&&(n=this.parent.dateValidationModule.getValidEndDate(s),this.parent.setRecordValue("endDate",n,s,!0)),a=this.parent.dateValidationModule.checkStartDate(t,s,null),this.parent.setRecordValue("startDate",new Date(a.getTime()),s,!0),0===this.parent.dateValidationModule.compareDates(s.startDate,s.endDate)&&i.i(r.isNullOrUndefined)(s.isMilestone)&&!1===s.isMilestone&&0===s.duration&&this.parent.setRecordValue("duration",1,s,!0),s.isMilestone&&this.parent.setRecordValue("endDate",new Date(a.getTime()),s,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")):this.updateSplitLeftResize(s);break;case"RightResizing":case"ParentResizing":if(-1===this.segmentIndex){e=this.getRoundOffEndLeft(s,this.roundOffDuration);var o=this.getDateByLeft(e);i.i(r.isNullOrUndefined)(s.startDate)&&(a=this.parent.dateValidationModule.getValidStartDate(s),this.parent.setRecordValue("startDate",a,s,!0));var l=i.i(r.isNullOrUndefined)(s.startDate)?a:s.startDate;n=s.isMilestone?l:this.parent.dateValidationModule.checkEndDate(o,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",new Date(n.getTime()),s,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")}else this.updateSplitRightResizing(s);break;case"ParentDrag":case"ChildDrag":case"MilestoneDrag":case"ManualParentDrag":-1===this.segmentIndex||0===this.segmentIndex?this.updateChildDrag(s):this.setSplitTaskDrag(s)}},t.prototype.updateChildDrag=function(e){var t,n=this.getRoundOffStartLeft(e,this.roundOffDuration),a=this.getDateByLeft(n,e.isMilestone,e);0===this.segmentIndex?(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(a,e,null),e,!0),e.segments[0].startDate=a,e.segments[0].endDate=this.parent.dataOperation.getEndDate(e.segments[0].startDate,e.segments[0].duration,e.durationUnit,e,!1),this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments"),this.parent.chartRowsModule.incrementSegments(e.segments,0,this.taskBarEditRecord),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0)):!i.i(r.isNullOrUndefined)(e.endDate)&&i.i(r.isNullOrUndefined)(e.startDate)?(t=this.parent.dateValidationModule.checkStartDate(a,e,null),t=this.parent.dateValidationModule.checkEndDate(t,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",t,e,!0)):(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(a,e,null),e,!0),i.i(r.isNullOrUndefined)(e.duration)||this.parent.dateValidationModule.calculateEndDate(this.taskBarEditRecord))},t.prototype.updateSplitLeftResize=function(e){var t=e.segments[this.segmentIndex],n=0===this.segmentIndex?this.getRoundOffStartLeft(e,this.roundOffDuration):this.getRoundOffStartLeft(t,this.roundOffDuration),a=0===this.segmentIndex?this.getDateByLeft(n):this.getDateByLeft(e.left+n),s=this.parent.dataOperation.checkStartDate(a,e,!1),o=this.parent.dataOperation.getDuration(s,t.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);if(t.startDate=new Date(s.getTime()),t.duration=o,this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),0===this.segmentIndex&&this.parent.setRecordValue("startDate",t.startDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration"),!i.i(r.isNullOrUndefined)(e.segments[this.segmentIndex-1])){var l=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);t.offsetDuration=l}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},t.prototype.updateSplitRightResizing=function(e){var t=e.segments[this.segmentIndex],n=this.getRoundOffEndLeft(e,this.roundOffDuration),a=this.getDateByLeft(n),s=this.parent.dataOperation.checkEndDate(a,e,!1),o=this.parent.dataOperation.getDuration(t.startDate,s,e.durationUnit,e.isAutoSchedule,e.isMilestone);if(t.endDate=new Date(s.getTime()),t.duration=o,!i.i(r.isNullOrUndefined)(e.segments[this.segmentIndex+1])){var l=e.segments[this.segmentIndex+1],d=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,l.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);t.offsetDuration=d}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments"),this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")},t.prototype.sumOfDuration=function(e){for(var t=0,i=0;i<e.length;i++){t+=e[i].duration}return t},t.prototype.setSplitTaskDrag=function(e){var t=e.segments[this.segmentIndex],n=this.getRoundOffStartLeft(t,this.roundOffDuration),a=this.getDateByLeft(e.left+n);if(a=this.parent.dateValidationModule.checkStartDate(a,e,null),t.startDate=a,t.endDate=this.parent.dataOperation.getEndDate(t.startDate,t.duration,e.durationUnit,e,!1),t.duration=this.parent.dataOperation.getDuration(t.startDate,t.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone),this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"endDate"),!i.i(r.isNullOrUndefined)(e.segments[this.segmentIndex-1])){var s=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==t.startDate.getDay()||0!==s||this.parent.includeWeekend||(s=1),t.offsetDuration=s}if(!i.i(r.isNullOrUndefined)(e.segments[this.segmentIndex+1])){var o=e.segments[this.segmentIndex+1],s=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,o.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==o.startDate.getDay()||0!==s||this.parent.includeWeekend||(s=1),o.offsetDuration=s}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},t.prototype.getRoundOffEndLeft=function(e,t){var i="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,r=e.width+e.left;if(-1!==this.segmentIndex){var n=e.segments[this.segmentIndex];r=r-e.width+n.width+n.left}var a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Day")/864e5),s=this.parent.perDayWidth-this.parent.perDayWidth/a,o=s/this.parent.perDayWidth;if(void 0===t&&(t=!1),t){if(t)if("Hour"===i){var l=this.parent.perDayWidth/24;a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Hour")/36e5),s=this.parent.perDayWidth/24-this.parent.perDayWidth/24/a,0!==s&&(r=r-s+l)}else if("Minutes"===i){var d=this.parent.perDayWidth/1440;a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Minutes")/6e4),s=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/a,0!==s&&(r=r-s+d)}else 0!==s&&(r=r-s+this.parent.perDayWidth)}else"Hour"!==i&&"Minutes"!==i&&(o>.5?r=r-s+this.parent.perDayWidth:o<.5&&(r=r-s+this.parent.perDayWidth/2));return r},t.prototype.getRoundOffStartLeft=function(e,t){var n=(i.i(r.isNullOrUndefined)(e),e.left),a="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,s=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(n,i.i(r.isNullOrUndefined)(e)?e.isMilestone:null,e),1,"Day")/864e5),o=this.parent.perDayWidth-this.parent.perDayWidth/s,l=o/this.parent.perDayWidth;return void 0===t&&(t=!1),t?t&&("Hour"===a?(s=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(n),1,"Hour")/36e5),o=this.parent.perDayWidth/24-this.parent.perDayWidth/24/s,n-=o):"Minutes"===a?(s=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(n),1,"Minutes")/6e4),o=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/s,n-=o):n-=o):"Hour"!==a&&"Minutes"!==a&&(l<=.5?n-=o:l>.5&&(n=n-o+this.parent.perDayWidth/2)),n},t.prototype.getDateByLeft=function(e,t,n){var a=new Date(this.parent.timelineModule.timelineStartDate.toString()),s=864e5/this.parent.perDayWidth;a.setTime(a.getTime()+e*s),t&&!i.i(r.isNullOrUndefined)(n.predecessorsName)&&""!==n.predecessorsName&&(a.setDate(a.getDate()-1),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,a),a=this.parent.dateValidationModule.checkStartDate(a,n,!0));var o="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier;return"Hour"!==o&&"Minutes"!==o&&(this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&!this.parent.isInDst(a)?a.setTime(a.getTime()+36e5):!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&this.parent.isInDst(a)&&a.setTime(a.getTime()-36e5)),a},t.prototype.setItemPosition=function(){if(!i.i(r.isNullOrUndefined)(this.editElement)){var e=this.editElement.parentElement;"ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&"ChildDrag"===this.taskBarEditAction?e.style.position=null:e.style.setProperty("position","absolute")}var t=this.taskBarEditRecord.ganttProperties,n=this.parent.enableRtl?"right":"left",a=i.i(r.isNullOrUndefined)(t.segments)?null:t.segments[this.segmentIndex],o="MilestoneDrag"===this.taskBarEditAction||t.isMilestone?this.parent.chartRowsModule.milestoneHeight:t.width,l=this.parent.isAdaptive?o-2:o-10;i.i(r.isNullOrUndefined)(a)||(l=this.parent.isAdaptive?a.width-2:a.width-10),this.taskBarEditElement.style.setProperty("opacity",".75");var d=this.taskBarEditElement.classList.contains(s.D)?this.taskBarEditElement:"ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||0!==this.segmentIndex?i.i(r.closest)(this.taskBarEditElement,"tr."+s.Z).querySelector("."+s.D):this.taskBarEditElement.parentElement,h=this.taskBarEditElement.classList.contains("e-segmented-taskbar"),p=this.taskBarEditElement.querySelector("."+s._0),u=this.taskBarEditElement.querySelector("."+s._1),c=this.taskBarEditElement.querySelector("."+s.S),g=this.taskBarEditElement.querySelector("."+s.Q),f=this.taskBarEditElement.querySelector("."+s._2),m=this.taskBarEditElement.querySelector("."+s._3),y=this.taskBarEditElement.querySelector("."+s._4),D=d.querySelector("."+s._4),v=this.taskBarEditElement,w=this.taskBarEditElement.querySelector("."+s.L),k=this.taskBarEditElement.querySelector("."+s.J),b=this.taskBarEditElement.querySelector("."+s._5),T=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div");if("ConnectorPointRightDrag"!==this.taskBarEditAction&&"ConnectorPointLeftDrag"!==this.taskBarEditAction){if("ParentResizing"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction){if(!h||i.i(r.isNullOrUndefined)(t.segments)||"RightResizing"!==this.taskBarEditAction&&0===this.segmentIndex||(i.i(r.isNullOrUndefined)(T)||(T.style.width=a.width+"px"),this.taskBarEditElement.style.width=a.width+"px",this.parent.enableRtl?this.taskBarEditElement.style.right=a.left+"px":(this.taskBarEditElement.style.left=a.left+"px",i.i(r.isNullOrUndefined)(T)||(T.style.left=a.left+this.editElement.parentElement.offsetLeft+"px"))),d.style.setProperty(n,t.left+"px"),d.style.width=o+"px",h&&D&&(D.style.left=(this.parent.isAdaptive?o+10:o+2)+"px"),"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&("ChildDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction)&&(d.style.setProperty("top",this.topValue+"px"),d.style.zIndex="4"),"LeftResizing"===this.taskBarEditAction&&0===this.segmentIndex){this.taskBarEditElement.style.setProperty("opacity",".75");for(var S=this.taskBarEditElement.parentElement,P=S.getElementsByClassName("e-segmented-taskbar"),C=0;C<t.segments.length;C++){var M=t.segments[C],R=P[C];R.style.width=M.width+"px",0===C&&(T.style.width=M.width+"px",T.style.left=M.left+t.left+"px"),this.parent.enableRtl?R.style.right=M.left+"px":R.style.left=M.left+"px"}}"ChildDrag"===this.taskBarEditAction&&0===this.segmentIndex&&(T.style.width=o+"px",T.style.left=t.left+"px",d.style.setProperty("opacity",".75"))}if(y&&(this.parent.enableRtl?y.style.left=(this.parent.isAdaptive?o+10:o-2)+"px":y.style.left=(this.parent.isAdaptive?o+10:o+2)+"px"),"MilestoneDrag"===this.taskBarEditAction||t.isMilestone)d.style.setProperty(n,t.left-o/2+"px"),T.style.left=t.left-o/2+"px",T.style.width=o+"px";else if("ProgressResizing"===this.taskBarEditAction)if(-1===this.segmentIndex){if(u.style.setProperty(n,t.left+t.progressWidth-10+"px"),!i.i(r.isNullOrUndefined)(p)){p.style.width=t.progressWidth+"px",p.style.borderBottomRightRadius=this.progressBorderRadius+"px",p.style.borderTopRightRadius=this.progressBorderRadius+"px";var x=this.parent.enableRtl?t.progressWidth+8:t.progressWidth-8;c.style.setProperty(n,x+"px")}}else{this.updateSegmentProgress(this.taskBarEditRecord.ganttProperties),p.style.width=t.segments[this.segmentIndex].progressWidth+"px",p.style.borderBottomRightRadius=this.progressBorderRadius+"px",p.style.borderTopRightRadius=this.progressBorderRadius+"px";var O=this.parent.enableRtl?t.segments[this.segmentIndex].progressWidth+8:t.segments[this.segmentIndex].progressWidth-8;c.style.setProperty(n,O+"px")}else"RightResizing"!==this.taskBarEditAction||i.i(r.isNullOrUndefined)(u)?"ParentDrag"===this.taskBarEditAction?(T.style.left=t.left+"px",T.style.width=o+"px",T.style.width=t.width+"px",i.i(r.isNullOrUndefined)(f)||(f.style.width=o+"px",T.style.width=t.width+"px"),i.i(r.isNullOrUndefined)(p)||(m.style.width=t.progressWidth+"px")):"ParentResizing"===this.taskBarEditAction?(T.style.width=t.width+"px",T.style.left=t.left+"px",v.style.width=w.style.width=t.width+"px",k.style.setProperty(n,t.width-b.offsetLeft+"px")):"ManualParentDrag"===this.taskBarEditAction?(T.style.width=t.width+"px",T.style.left=t.left+"px",v.style.setProperty(n,t.left-t.autoLeft+"px")):(i.i(r.isNullOrUndefined)(u)||h||(u.style.width=t.width+"px",u.style.left=t.left+"px",this.taskBarEditElement.style.width=t.width+"px",this.taskBarEditElement.style.left=t.left+"px",T.style.left=t.left+"px",T.style.width=t.width+"px"),i.i(r.isNullOrUndefined)(p)||(g.style.setProperty(n,l+"px"),p.style.width=t.progressWidth+"px",i.i(r.isNullOrUndefined)(c)||c.style.setProperty(n,t.progressWidth-10+"px")),h&&(g.style.setProperty(n,l+"px"),p.style.width=a.width+"px",i.i(r.isNullOrUndefined)(c)||c.style.setProperty(n,a.width-10+"px"))):(T.style.width=o+"px",u.style.width=o+"px",i.i(r.isNullOrUndefined)(p)||(p.style.width=t.progressWidth+"px",g.style.setProperty(n,l+"px"),i.i(r.isNullOrUndefined)(c)||c.style.setProperty(n,t.progressWidth-10+"px")))}},t.prototype.mouseUpHandler=function(e){var t=this.isMouseDragged;if(this.previousMouseMove=null,this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),this.taskBarEditAction&&this.isMouseDragged)if(!this.dragMouseLeave&&this.taskBarEditedAction||"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop)this.taskBarEditedAction(e),this.isMouseDragged=!1;else if(this.parent.isOnEdit=!1,this.cancelTaskbarEditActionInMouseLeave(),this.parent.enableCriticalPath&&this.parent.criticalPathModule){var n=this.parent.criticalPathModule;n.criticalConnectorLine(n.criticalPathCollection,n.detailPredecessorCollection,!0,n.predecessorCollectionTaskIds)}"ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar&&!i.i(r.isNullOrUndefined)(this.taskBarEditElement)&&(i.i(r.isNullOrUndefined)(this.taskBarEditElement.querySelector(".e-gantt-child-taskbar"))||this.taskBarEditElement.querySelector(".e-gantt-child-taskbar").classList.contains("e-collapsed-taskbar-drag")&&(i.i(r.removeClass)([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"),this.taskBarEditElement.style.zIndex=this.prevZIndex,this.prevZIndex="")),this.parent.isAdaptive&&!t||this.initPublicProp(),this.stopScrollTimer()},t.prototype.taskBarEditedAction=function(e){var t={},i=this.mouseDownX,r=this.mouseDownY,n=this.taskBarEditRecord,a=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement),s=this.mouseMoveX,o=this.getCoordinate(e),l=o.pageY-this.parent.ganttChartModule.chartBodyContainer.offsetTop;"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||this.drawPredecessor||(this.dependencyCancel=!0),("ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction)&&this.drawPredecessor&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)?this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord,this.finalPredecessor):(i!==s||Math.abs(r-l)>=(this.parent.rowHeight-this.parent.taskbarHeight)/2)&&null!==n&&(t.editingFields=n.ganttProperties,t.data=n,t.recordIndex=a,t.previousData=this.previousItem,t.taskBarEditAction=this.taskBarEditAction,t.action="TaskbarEditing",t.roundOffDuration=this.roundOffDuration,t.target=this.targetElement,this.taskbarEditedArgs=t,this.taskbarEdited(t)),this.parent.isProjectDateUpdated=!1},t.prototype.cancelTaskbarEditActionInMouseLeave=function(){this.parent.editModule.reUpdatePreviousRecords(!0)},t.prototype.updateSegmentProgress=function(e){for(var t=e.segments,i=!0,r=this.splitTasksDuration(t)*this.parent.perDayWidth,n=this.parent.dataOperation.getProgressWidth(r,e.progress),a=0;a<t.length;a++){var s=t[a];delete s.progressWidth,n>0&&n>s.width?(n-=s.width,s.progressWidth=s.width,s.showProgress=!1):i&&(s.progressWidth=n,s.showProgress=!0,n-=s.width,i=!1)}},t.prototype.taskbarEdited=function(e){var t=i.i(r.extend)({},e),n=t.data,a=n.ganttProperties,s=this.parent.currentViewData.indexOf(n);if(("MilestoneDrag"===t.taskBarEditAction||"ChildDrag"===t.taskBarEditAction)&&"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&this.dragMoveY>0){if(this.parent.rowDragAndDropModule){var o=this.parent.currentViewData;o[this.taskBarEditRecord.parentItem.index]&&-1===this.parent.editedRecords.indexOf(o[this.taskBarEditRecord.parentItem.index])&&this.parent.editedRecords.push(o[this.taskBarEditRecord.parentItem.index]);for(var l,d=0,h=0,p=void 0,u=this.parent.treeGrid.getRows().length,c=0;c<u;c++)d<this.dragMoveY&&"none"!==this.parent.getRowByIndex(c).style.display&&(h=c,d+=parseInt(this.parent.getRowByIndex(c).style.height),o[c].parentItem?this.parent.getRecordByID(o[c].parentItem.taskId):o[c]);for(var g=this.parent.getRowByIndex(s).getElementsByClassName("e-taskbar-main-container"),f=this.parent.getRowByIndex(h).getElementsByClassName("e-taskbar-main-container"),m=0;m<f.length;m++)f[m].offsetTop<this.dragMoveY&&g[0].getAttribute("rowuniqueid")!==f[m].getAttribute("rowuniqueid")&&(this.draggedRecordMarginTop=f[m].style.marginTop,l=f[m].getAttribute("rowuniqueid"));if(l&&(p=this.parent.currentViewData.filter(function(e){return e.rowUniqueID===l?e:null})),p){var y=this.parent.currentViewData.indexOf(p[0]),D=p[0].hasChildRecords||!p[0].parentItem&&0==p[0].childRecords.length?"child":"below";this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.reorderRows([s],y,D),this.dragMoveY=0}}"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.parent.ganttChartModule.renderOverAllocationContainer()}if("ProgressResizing"===t.taskBarEditAction)t.previousData.progress!==a.progress&&(this.parent.setRecordValue("progress",this.getProgressPercent(a.width,a.progressWidth),a,!0),n.parentItem&&this.parent.editModule.updateParentProgress(n.parentItem),i.i(r.isNullOrUndefined)(a.segments)||this.updateSegmentProgress(a));else{var v=t.data.ganttProperties.segments;if(!i.i(r.isNullOrUndefined)(v)&&v.length>0&&("LeftResizing"===this.taskBarEditAction&&0!==this.segmentIndex||"ChildDrag"===this.taskBarEditAction&&0!==this.segmentIndex||"RightResizing"===this.taskBarEditAction)){var w=v[this.segmentIndex],k=this.taskBarEditRecord.ganttProperties,b=0===this.segmentIndex?null:v[this.segmentIndex-1],T=this.segmentIndex===v.length-1?null:v[this.segmentIndex+1],S=i.i(r.isNullOrUndefined)(T)?this.parent.cloneProjectEndDate:new Date(T.startDate.getTime()),P=i.i(r.isNullOrUndefined)(b)?this.parent.cloneProjectStartDate:new Date(b.endDate.getTime()),C=new Date(w.startDate.getTime()),M=new Date(w.endDate.getTime());if("Day"===this.parent.timelineModule.topTier&&"Hour"===this.parent.timelineModule.bottomTier?(C.setHours(C.getHours()-1),M.setHours(M.getHours()+1)):(S.setHours(0,0,0,0),P.setHours(0,0,0,0),C.setDate(C.getDate()-1),M.setDate(M.getDate()+1),C.setHours(0,0,0,0),M.setHours(0,0,0,0)),C.getTime()<=P.getTime()&&!i.i(r.isNullOrUndefined)(b)&&!i.i(r.isNullOrUndefined)(w)){var R=[{firstSegmentIndex:b.segmentIndex,secondSegmentIndex:w.segmentIndex}];this.parent.chartRowsModule.mergeTask(k.taskId,R)}else if(M.getTime()>=S.getTime()&&this.segmentIndex!==v.length-1){var R=[{firstSegmentIndex:w.segmentIndex,secondSegmentIndex:T.segmentIndex}];this.parent.chartRowsModule.mergeTask(k.taskId,R)}else if(M.getTime()>=S.getTime()){w.endDate.setDate(this.parent.cloneProjectEndDate.getDate()-1),w.startDate=this.parent.dataOperation.getStartDate(w.endDate,w.duration,k.durationUnit,k);for(var c=v.length-2;c>=0;c++){var x=v[c],O=x.endDate;O.setDate(O.getDate()-x.offsetDuration),x.endDate=O,x.startDate=this.parent.dataOperation.getStartDate(x.endDate,x.duration,k.durationUnit,k)}}}this.parent.dataOperation.updateWidthLeft(t.data)}this.parent.dataOperation.updateTaskData(n),this.parent.editModule.initiateUpdateAction(t)},t.prototype.getProgressPercent=function(e,t){return Math.ceil(t/e*100)},t.prototype.drawFalseLine=function(){var e,t=this.mouseDownX,n=this.mouseDownY,a=this.mouseMoveX,o=this.mouseMoveY,l=Math.sqrt((t-a)*(t-a)+(n-o)*(n-o)),d=180*Math.atan2(o-n,a-t)/Math.PI,h="rotate("+(this.parent.enableRtl?-d:d)+"deg)",p=0;i.i(r.isNullOrUndefined)(document.querySelectorAll(".e-chart-row")[0])||(p=document.querySelectorAll(".e-chart-row")[0].offsetWidth),"ConnectorPointLeftDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?p-(this.elementOffsetLeft+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft-this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),"ConnectorPointRightDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?p-(this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left));var u=this.elementOffsetTop+this.elementOffsetHeight/2+this.parent.ganttChartModule.chartBodyContainer.offsetTop-this.parent.ganttChartModule.scrollObject.previousScroll.top;this.removeFalseLine(!1),this.falseLine=i.i(r.createElement)("div",{className:s._6,id:"ganttfalseline"+this.parent.element.id,styles:"position: absolute;transform:"+h+";border-top-width: 1px;border-top-style: dashed;z-index: 5;width:"+(l-3)+"px;top:"+u+"px;"}),this.parent.enableRtl?(this.falseLine.style.left="auto",this.falseLine.style.right=e+"px",this.falseLine.style.transformOrigin="100% 0%"):(this.falseLine.style.right="auto",this.falseLine.style.left=e+"px",this.falseLine.style.transformOrigin="0% 100%"),this.parent.ganttChartModule.chartBodyContainer.appendChild(this.falseLine)},t.prototype.removeFalseLine=function(e){this.falseLine&&(i.i(r.remove)(this.falseLine),this.falseLine=null,e&&(this.elementOffsetLeft=0,this.elementOffsetTop=0,this.elementOffsetWidth=0,this.elementOffsetHeight=0,i.i(r.removeClass)(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+s.V),[s.W])))},t.prototype.updateConnectorLineSecondProperties=function(e){var t=this.getElementByPosition(e),a=i.i(n.j)(t,s.D),o=document.body.className.includes("e-bigger");this.connectorSecondAction=null;var l=0;if(i.i(n.j)(t,s.X)?(this.connectorSecondAction="ConnectorPointLeftDrag",this.toPredecessorText="Start"):i.i(n.j)(t,s.Y)?(this.connectorSecondAction="ConnectorPointRightDrag",this.toPredecessorText="Finish"):(this.connectorSecondAction=null,this.toPredecessorText=null),this.taskBarEditElement!==a&&this.taskBarEditElement!==this.highlightedSecondElement){if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){l=this.parent.virtualScrollModule.getTopPosition()}(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&!this.elementOffsetLeft||!this.parent.enableVirtualization)&&(this.parent.allowParentDependency&&this.taskBarEditElement.children[0].classList.contains("e-manualparent-main-container")?(this.elementOffsetLeft=this.realTaskbarElement.children[0].offsetLeft+this.realTaskbarElement.offsetLeft-(o?10:0),this.elementOffsetTop=this.realTaskbarElement.parentElement.offsetTop+this.realTaskbarElement.offsetHeight/3-5+this.taskBarEditElement.children[0].offsetTop+l):(this.elementOffsetLeft=this.realTaskbarElement.offsetLeft-(o?10:0),this.elementOffsetTop=this.realTaskbarElement.parentElement.offsetTop+this.realTaskbarElement.offsetHeight/3+l),this.elementOffsetWidth=this.realTaskbarElement.offsetWidth+(o?20:0),this.elementOffsetHeight=this.realTaskbarElement.offsetHeight),this.showHideTaskBarEditingElements(a,this.highlightedSecondElement,!0)}i.i(r.isNullOrUndefined)(this.connectorSecondAction)&&!i.i(r.isNullOrUndefined)(this.connectorSecondElement)&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)&&(this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),i.i(r.removeClass)([this.connectorSecondElement.querySelector("."+s.X)],[s._7]),i.i(r.removeClass)([this.connectorSecondElement.querySelector("."+s.Y)],[s._7])),this.connectorSecondElement=this.connectorSecondAction?a:null,this.highlightedSecondElement=a,this.connectorSecondRecord=i.i(r.isNullOrUndefined)(this.connectorSecondElement)?null:this.parent.ganttChartModule.getRecordByTaskBar(this.connectorSecondElement)},t.prototype.triggerDependencyEvent=function(e,t){var n,a=this.parent.element.closest('[style*="zoom"]');if(a){var o=parseFloat(getComputedStyle(a).zoom);n=e.pageY/o}var l,d,h=this.taskBarEditRecord.ganttProperties,p=this.connectorSecondRecord?this.connectorSecondRecord.ganttProperties:null,u=this.getElementByPosition(e),c=u,g="ResourceView"===this.parent.viewType?h.taskId:h.rowUniqueID;if("ConnectorPointLeftDrag"===this.taskBarEditAction?l=g+(this.parent.enableRtl?"F":"S"):"ConnectorPointRightDrag"===this.taskBarEditAction&&(l=g+(this.parent.enableRtl?"S":"F")),this.connectorSecondAction&&("ConnectorPointLeftDrag"===this.connectorSecondAction?(l+=this.parent.enableRtl?"F":"S",d=this.parent.enableRtl?"finish":"start"):"ConnectorPointRightDrag"===this.connectorSecondAction&&(l+=this.parent.enableRtl?"S":"F",d=this.parent.enableRtl?"start":"finish")),i.i(r.isNullOrUndefined)(p))return void(this.drawPredecessor=!1);p.predecessorsName?this.finalPredecessor=p.predecessorsName+","+l:this.finalPredecessor=l;var f=this.parent.connectorLineEditModule.validatePredecessorRelation(this.connectorSecondRecord,this.finalPredecessor),m=this.parent.predecessorModule.calculatePredecessor(l,this.connectorSecondRecord),y={};if(y.fromItem=h,y.toItem=p,y.newPredecessorString=this.finalPredecessor,y.predecessor=m&&m[0],y.isValidLink=f,y.requestType="ValidateDependency",this.parent.trigger("actionBegin",y),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||"ValidateDependency"==y.requestType?"ValidateDependency"!=y.requestType&&this.parent.showSpinner():this.parent.showMaskRow(),y.isValidLink=!(!f&&y.isValidLink)&&y.isValidLink,y.isValidLink){if(this.editTooltip.toolTipObj||this.parent.isAdaptive||this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),this.editTooltip.toolTipObj){this.parent.connectorLineModule.tooltipTable.innerHTML=this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.taskName,this.parent.editModule.taskbarEditModule.fromPredecessorText,"","");var D=this.parent.connectorLineModule.tooltipTable.querySelector("#toPredecessor").querySelectorAll("td");D[1].innerText=p.taskName,D[2].innerText=this.parent.localeObj.getConstant(d);var v=this.parent.connectorLineModule.tooltipTable.parentElement.parentElement;v.offsetTop+v.offsetHeight>n&&(v.style.top=e.pageY-v.offsetHeight-20+"px")}this.drawPredecessor=!0}else this.parent.isAdaptive?(u.classList.contains(s.X)||u.classList.contains(s.Y))&&this.showHideActivePredecessors(!0):i.i(r.addClass)([c],[s._7]),this.drawPredecessor=!1},t.prototype.getCoordinate=function(e){var t={},i=e;if(t.pageX=i.pageX,t.pageY=i.pageY,e&&"click"!==e.type){var r=e;"touchmove"!==r.type&&"touchstart"!==r.type&&"touchend"!==r.type||(t.pageX=r.changedTouches[0].pageX,t.pageY=r.changedTouches[0].pageY)}return t},t.prototype.getElementByPosition=function(e){if(this.parent.isAdaptive){var t=this.getCoordinate(e);return document.elementFromPoint(t.pageX-window.pageXOffset,t.pageY-window.pageYOffset)}return e.target},t.prototype.multipleSelectionEnabled=function(){this.parent.selectionModule&&"Cell"!==this.parent.selectionSettings.mode&&"Multiple"===this.parent.selectionSettings.type&&this.parent.selectionModule.hidePopUp()},t.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.parent.off("chartMouseDown",this.mouseDownHandler),this.parent.off("chartMouseUp",this.mouseUpHandler),this.parent.off("chartMouseLeave",this.mouseLeaveHandler),this.parent.off("chartMouseMove",this.mouseMoveAction),this.parent.off("chartMouseClick",this.mouseClickHandler))},t.prototype.destroy=function(){this.unWireEvents(),this.stopScrollTimer(),this.parent.editModule.taskbarEditModule=void 0},t}(a.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(13),n=(i.n(r),i(0)),a=(i.n(n),i(3)),s=i(16),o=i(12),l=(i.n(o),function(){function e(e){this.predefinedItems={},this.items=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","Search","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath"],this.parent=e,this.id=this.parent.element.id,this.parent.on("ui-toolbarupdate",this.propertyChanged,this)}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.renderToolbar=function(){if((this.parent.toolbar||[]).length>0){this.element=i.i(n.createElement)("div",{id:this.parent.controlId+"_Gantt_Toolbar",className:a.C}),this.parent.treeGrid.grid.headerModule?this.parent.element.insertBefore(this.element,this.parent.treeGridPane.offsetParent):this.parent.element.appendChild(this.element);for(var e=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath"],t=0,r=e;t<r.length;t++){var s=r[t],o=void 0,l=void 0;"CriticalPath"===s?(o="critical-path",l="criticalPath"):(o=s.toLowerCase(),l=s[0].toLowerCase()+s.slice(1)),this.predefinedItems[s]={id:this.parent.element.id+"_"+o,prefixIcon:"e-"+o,text:this.parent.isAdaptive?"":this.parent.localeObj.getConstant(l),tooltipText:this.parent.localeObj.getConstant(l)+("add"===l||"edit"===l||"delete"===l?this.parent.localeObj.getConstant("task"):"expandAll"===l||"collapseAll"===l?this.parent.localeObj.getConstant("tasks"):""),align:this.parent.isAdaptive?"Right":"Left"},this.parent.enableRtl&&("PrevTimeSpan"===s&&(this.predefinedItems[s].prefixIcon="e-nexttimespan"),"NextTimeSpan"===s&&(this.predefinedItems[s].prefixIcon="e-prevtimespan"))}var d=this.parent.localeObj.getConstant("search");this.parent.isAdaptive?this.predefinedItems.Search={id:this.id+"_searchbutton",prefixIcon:"e-search-icon",tooltipText:d,align:"Right"}:this.predefinedItems.Search={id:this.id+"_search",template:'<div class="e-input-group e-search" role="search"><input id="'+this.id+'_searchbar" class="e-input" name="input" type="search"placeholder= "'+d+'"/><span id="'+this.id+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"tabindex="-1" title="'+d+'" aria-label= "search"></span></div>',tooltipText:d,align:"Right",cssClass:"e-search-wrapper"},this.createToolbar()}},e.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},e.prototype.createToolbar=function(){var e=this.getItems();this.toolbar=new r.Toolbar({items:e,enableRtl:this.parent.enableRtl,clicked:this.toolbarClickHandler.bind(this),height:this.parent.isAdaptive?48:"auto"}),this.toolbar.isStringTemplate=!0,this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this),this.toolbar.appendTo(this.element);var t=this.element.querySelector("#"+this.parent.element.id+"_cancel"),s=this.element.querySelector("#"+this.parent.element.id+"_update");if(t&&i.i(n.addClass)([t],a.a),s&&i.i(n.addClass)([s],a.a),this.parent.isAdaptive){this.element.insertBefore(this.getSearchBarElement(),this.element.childNodes[0]),this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar");new o.TextBox({placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,floatLabelType:"Never",showClearButton:!0}).appendTo(this.searchElement)}else this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar");this.parent.filterModule&&(this.wireEvent(),this.parent.searchSettings&&this.updateSearchTextBox()),this.parent.readOnly&&this.enableItems([this.parent.element.id+"_add",this.parent.element.id+"_update",this.parent.element.id+"_delete",this.parent.element.id+"_cancel",this.parent.element.id+"_indent",this.parent.element.id+"_outdent"],!1)},e.prototype.getSearchBarElement=function(){var e=this,t=i.i(n.createElement)("div",{className:"e-adaptive-searchbar",styles:"display: none"}),r=i.i(n.createElement)("input",{attrs:{type:"text"},id:this.parent.element.id+"_searchbar"}),a=i.i(n.createElement)("span",{className:"e-backarrowspan e-icons"});return a.onclick=function(){t.style.display="none",e.element.childNodes[1].style.display="block"},t.appendChild(a),t.appendChild(r),t},e.prototype.wireEvent=function(){this.searchElement&&(n.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),n.EventHandler.add(this.searchElement,"focus",this.focusHandler,this),n.EventHandler.add(this.searchElement,"blur",this.blurHandler,this))},e.prototype.propertyChanged=function(e){i.i(n.getValue)("module",e)===this.getModuleName()&&this.parent.toolbar&&(this.element&&this.element.parentNode&&i.i(n.remove)(this.element),this.renderToolbar(),this.refreshToolbarItems())},e.prototype.unWireEvent=function(){this.searchElement&&(n.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),n.EventHandler.remove(this.searchElement,"focus",this.focusHandler),n.EventHandler.remove(this.searchElement,"blur",this.blurHandler),this.searchElement=null),this.parent.off("ui-toolbarupdate",this.propertyChanged)},e.prototype.keyUpHandler=function(e){13===e.keyCode&&this.parent.searchSettings.key!==this.searchElement.value&&(this.parent.searchSettings.key=this.searchElement.value,this.parent.dataBind())},e.prototype.focusHandler=function(e){e.target.parentElement.classList.add("e-input-focus")},e.prototype.blurHandler=function(e){e.target.parentElement.classList.remove("e-input-focus")},e.prototype.updateSearchTextBox=function(){this.searchElement&&this.searchElement.value!==this.parent.searchSettings.key&&(this.searchElement.value=this.parent.searchSettings.key)},e.prototype.getItems=function(){var e=[],t=this.parent.toolbar,i=-1;if(t.forEach(function(e,t){("string"==typeof e&&"Search"===e||"object"==typeof e&&"Search"===e.text)&&(i=t)}),i>-1){var r=t.splice(i,1);t.push(r[0])}for(var n=0,a=t;n<a.length;n++){var s=a[n];"string"==typeof s?e.push(this.getItemObject(s)):e.push(this.getItem(s))}return e},e.prototype.getItem=function(e){var t=this.predefinedItems[e.text];return t?i.i(n.extend)(t,t,e):e},e.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.id+"_"+e}},e.prototype.toolbarClickHandler=function(e){var t=this,r=this.parent,a=this.id;this.parent.isToolBarClick=!1,i.i(n.extend)(e,{cancel:!1}),e.item.properties.id!==this.parent.element.id+"_pdfexport"&&e.item.properties.id!==this.parent.element.id+"_critical-path"||(i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow()),r.trigger(s.a,e,function(e){if(!e.cancel)switch(!0===t.parent.isAdaptive&&(e.item.id!==a+"_edit"&&e.item.id!==a+"_add"&&e.item.id!==a+"_delete"&&e.item.id!==a+"_searchbutton"&&e.item.id!==a+"_expandall"&&e.item.id!==a+"_collapseall"||t.parent.selectionModule&&"Multiple"===t.parent.selectionSettings.type&&(t.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),!i.i(n.isNullOrUndefined)(e.item)&&e.item.id){case a+"_edit":r.editModule&&r.editSettings.allowEditing&&r.editModule.dialogModule.openToolbarEditDialog();break;case a+"_indent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.indent();break;case a+"_critical-path":r.enableCriticalPath?r.enableCriticalPath=!1:r.enableCriticalPath=!0;break;case a+"_outdent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.outdent();break;case a+"_update":r.editModule.cellEditModule.isCellEdit=!1,r.treeGrid.grid.saveCell();break;case a+"_cancel":r.cancelEdit();break;case a+"_add":r.editModule&&r.editSettings.allowAdding&&r.editModule.dialogModule.openAddDialog();break;case a+"_delete":t.parent.selectionModule&&t.parent.editModule&&("Cell"!==t.parent.selectionSettings.mode&&t.parent.selectionModule.selectedRowIndexes.length||"Cell"===t.parent.selectionSettings.mode&&t.parent.selectionModule.getSelectedRowCellIndexes().length)&&t.parent.editModule.startDeleteAction();break;case a+"_search":if(i.i(n.getValue)("originalEvent.target.id",e)===t.parent.element.id+"_searchbutton"&&t.parent.filterModule){var s=t.element.querySelector("#"+t.parent.element.id+"_searchbar").value;t.parent.searchSettings.key!==s&&(t.parent.searchSettings.key=s,t.parent.dataBind())}break;case a+"_searchbutton":var o=t.element.querySelector(".e-adaptive-searchbar");o.parentElement.childNodes[1].style.display="none",o.style.display="block";break;case a+"_expandall":t.parent.ganttChartModule.expandCollapseAll("expand");break;case a+"_collapseall":t.parent.ganttChartModule.expandCollapseAll("collapse");break;case a+"_prevtimespan":t.parent.previousTimeSpan();break;case a+"_nexttimespan":t.parent.nextTimeSpan();break;case a+"_zoomin":t.zoomIn();break;case a+"_zoomout":t.zoomOut();break;case a+"_zoomtofit":t.zoomToFit()}})},e.prototype.zoomIn=function(){this.parent.timelineModule.processZooming(!0)},e.prototype.zoomToFit=function(){this.parent.timelineModule.isZoomIn&&(this.parent.timelineModule.isZoomIn=!1),this.parent.timelineModule.processZoomToFit(),this.parent.ganttChartModule.updateScrollLeft(0)},e.prototype.zoomOut=function(){this.parent.timelineModule.processZooming(!1)},e.prototype.refreshToolbarItems=function(e){var t=this.parent,r=[],a=[],s=t.editSettings,o=this.id,l=t.selectedRowIndex;if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)for(var d=0;d<t.updatedRecords.length;d++)if(t.updatedRecords[d].index===l){l=d;break}var h,p=!!t.selectionModule&&(1===t.selectionModule.selectedRowIndexes.length||1===t.selectionModule.getSelectedRowCellIndexes().length),u=this.toolbar?this.toolbar.items:[],c=[o+"_add",o+"_edit",o+"_delete",o+"_update",o+"_cancel",o+"_indent",o+"_outdent"],g="ResourceView"===this.parent.viewType&&0!==i.i(n.getValue)("data.level",e)||"ProjectView"===this.parent.viewType;if(i.i(n.isNullOrUndefined)(this.parent.editModule))a.push(o+"_delete"),a.push(o+"_add"),a.push(o+"_edit"),a.push(o+"_update"),a.push(o+"_cancel"),a.push(o+"_indent"),a.push(o+"_outdent");else{var f=!!t.editModule.taskbarEditModule&&t.editModule.taskbarEditModule.touchEdit,m=t.flatData&&t.flatData.length;s.allowAdding&&!f?r.push(o+"_add"):a.push(o+"_add"),s.allowEditing&&g&&m&&p&&!f?r.push(o+"_edit"):a.push(o+"_edit"),s.allowEditing&&0!==l&&-1!==l&&m&&p&&"ResourceView"!==this.parent.viewType?0===t.updatedRecords[l].level&&m&&!f?(r.push(o+"_indent"),a.push(o+"_outdent")):(h=t.updatedRecords[l-1],t.updatedRecords[l].level-h.level==1&&-1!==l?(a.push(o+"_indent"),r.push(o+"_outdent")):-1!==l&&(r.push(o+"_indent"),r.push(o+"_outdent"))):(a.push(o+"_indent"),a.push(o+"_outdent"));var y=!!t.selectionModule&&(t.selectionModule.selectedRowIndexes.length>0||t.selectionModule.getSelectedRowCellIndexes().length>0);if(s.allowDeleting&&m&&y&&!f?r.push(o+"_delete"):a.push(o+"_delete"),"Auto"===t.editSettings.mode&&!i.i(n.isNullOrUndefined)(t.editModule.cellEditModule)&&t.editModule.cellEditModule.isCellEdit){r=[],r.push(o+"_update",o+"_cancel"),a=[];for(var D=0;D<u.length;D++)u[D].id!==o+"_update"&&u[D].id!==o+"_cancel"&&-1!==c.indexOf(u[D].id)&&a.push(u[D].id)}else{a.push(o+"_update",o+"_cancel");for(var D=0;D<u.length;D++)-1===r.indexOf(u[D].id)&&-1===a.indexOf(u[D].id)&&r.push(u[D].id)}}for(var v=0;v<r.length;v++){for(var w=void 0,D=0;D<u.length;D++)if(u[D].id===r[v]){w=D;break}u.length>0&&this.toolbar.hideItem(w,!1)}for(var k=0;k<a.length;k++){for(var w=void 0,D=0;D<u.length;D++)if(u[D].id===a[k]){w=D;break}u.length>0&&this.toolbar.hideItem(w,!0)}},e.prototype.enableItems=function(e,t){for(var i=0,r=e;i<r.length;i++){var n=r[i],a=this.element.querySelector("#"+n);a&&this.toolbar.enableItems(a.parentElement,t)}},e.prototype.destroy=function(){this.parent.isDestroyed||(this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.toolbar.destroy(),this.parent.filterModule&&this.unWireEvent(),i.i(n.remove)(this.element))},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(6),n=(i.n(r),function(){function e(e){this.parent=e,this.bindTreeGridProperties()}return e.prototype.getModuleName=function(){return"virtualScroll"},e.prototype.bindTreeGridProperties=function(){this.parent.treeGrid.enableVirtualization=this.parent.enableVirtualization,r.TreeGrid.Inject(r.VirtualScroll)},e.prototype.getTopPosition=function(){var e,t=this.parent.ganttChartModule.scrollElement.querySelector(".e-virtualtable"),i=t.style.transform.split(",");if(i.length>1)e=i[1].trim().split(")")[0];else{var r=t.style.transform;e=r.substring(r.lastIndexOf("(")+1,r.lastIndexOf(")"))}return parseFloat(e)},e.prototype.destroy=function(){},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(0),n=(i.n(r),i(3)),a=i(25),s=i(5),o=(i.n(s),i(84)),l=function(){function e(e){this.isExpandCollapseFromChart=!1,this.isExpandAll=!1,this.isCollapseAll=!1,this.isGanttElement=!1,this.parent=e,this.chartTimelineContainer=null,this.rangeViewContainer=i.i(r.createElement)("div",{className:n._18}),this.rangeViewContainer.setAttribute("role","RangeContainer"),this.virtualRender=new o.a(this.parent),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("renderPanels",this.renderChartContainer,this),this.parent.on("recordsUpdated",this.renderChartElements,this),this.parent.on("dataReady",this.renderInitialContents,this),this.parent.on("tree-grid-created",this.renderChartContents,this),this.parent.on("destroy",this.destroy,this)},e.prototype.renderChartContents=function(){this.parent.notify("refreshDayMarkers",{}),this.wireEvents()},e.prototype.renderChartContainer=function(){this.chartElement=i.i(r.createElement)("div",{id:this.parent.element.id+"GanttChart",className:n._61}),this.parent.chartPane.appendChild(this.chartElement),this.renderTimelineContainer(),this.renderBodyContainers()},e.prototype.renderInitialContents=function(){this.parent.timelineModule.createTimelineSeries()},e.prototype.renderOverAllocationContainer=function(){for(var e=0;e<this.parent.flatData.length;e++){var t=this.parent.flatData[e];t.childRecords.length>0&&this.parent.dataOperation.updateOverlappingValues(t)}var i=this.parent.element.querySelector("."+n._18);i&&(i.innerHTML=""),0===this.parent.treeGrid.grid.filterSettings.columns.length&&this.renderRangeContainer(this.parent.currentViewData)},e.prototype.renderChartElements=function(){if(this.parent.isFromOnPropertyChange)this.rangeViewContainer.innerHTML="",this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff),this.parent.isFromOnPropertyChange=!1;else{this.parent.chartRowsModule.renderChartRows(),this.parent.predecessorModule&&this.parent.taskFields.dependency&&(this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection()),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);for(var e=0;e<this.parent.chartRowsModule.ganttChartTableBody.children.length;e++)this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4]?(this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[2].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4].setAttribute("tabindex","-1")):"ProjectView"===this.parent.viewType?i.i(r.isNullOrUndefined)(this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[1])||this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"):this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[0]&&this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[0].setAttribute("tabindex","-1");var t=this.parent.criticalPathModule;this.parent.enableCriticalPath&&t&&t.criticalPathCollection&&this.parent.criticalPathModule.criticalConnectorLine(t.criticalPathCollection,t.detailPredecessorCollection,this.parent.enableCriticalPath,t.predecessorCollectionTaskIds),"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.renderOverAllocationContainer()}this.updateWidthAndHeight(),this.parent.notify("selectRowByIndex",{}),this.parent.timelineModule.isZoomToFit&&this.parent.timelineModule.processZoomToFit()},e.prototype.renderRangeContainer=function(e){var t,i,r,n=e.length;if(0===this.parent.treeGrid.grid.filterSettings.columns.length)for(t=0;t<n;t++)i=e[t],(r=i.ganttProperties.workTimelineRanges)&&this.renderRange(r,i)},e.prototype.getTopValue=function(e){var t=this.parent.getExpandedRecords(this.parent.currentViewData),i=t.indexOf(e);return e.expanded?(i+1)*this.parent.rowHeight:i*this.parent.rowHeight},e.prototype.getRangeHeight=function(e){return!e.expanded&&e.hasChildRecords?this.parent.rowHeight-Math.floor(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight):e.childRecords.length*this.parent.rowHeight-Math.floor(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)},e.prototype.renderRange=function(e,t){var a=0,s=this.parent.currentViewData.indexOf(t);a=!this.parent.allowTaskbarOverlap&&this.parent.enableMultiTaskbar?t.expanded?this.parent.getRowByIndex(s).offsetTop+this.parent.rowHeight:this.parent.getRowByIndex(s).offsetTop:this.getTopValue(t);var o=this.rangeViewContainer.querySelector(".rangeContainer"+t.ganttProperties.rowUniqueID);o&&o.remove();var l=i.i(r.createElement)("div",{className:"rangeContainer"+t.ganttProperties.rowUniqueID,styles:"top:"+a+"px; position: absolute;"});if(0!==t.level||t.expanded||!i.i(r.isNullOrUndefined)(t.parentItem)||this.parent.enableMultiTaskbar){for(var d=0;d<e.length;d++){var h=void 0;h=this.parent.allowTaskbarOverlap||t.expanded||!this.parent.enableMultiTaskbar?this.getRangeHeight(t):parseInt(this.parent.chartRowsModule.ganttChartTableBody.childNodes[s].style.height)-(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight);var p=i.i(r.createElement)("div",{className:n._62+" e-leftarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[d].left+e[d].width-5:e[d].left)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px;\n height: "+(h+1)+"px; border-right: 0px"}),u=i.i(r.createElement)("div",{className:n._62+" e-rightarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[d].left:e[d].left+e[d].width-5)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px; height: "+(h+1)+"px;\n border-left: 0px"});l.appendChild(p),l.appendChild(u),this.rangeViewContainer.appendChild(l)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.rangeViewContainer)}},e.prototype.renderTimelineContainer=function(){this.chartTimelineContainer=i.i(r.createElement)("div",{className:n._14}),this.parent.enableRtl&&(this.chartTimelineContainer.style.borderLeftWidth="1px",this.chartTimelineContainer.style.borderRightWidth="0px"),this.chartTimelineContainer.setAttribute("role","presentation"),this.chartElement.appendChild(this.chartTimelineContainer)},e.prototype.renderBodyContainers=function(){this.chartBodyContainer=i.i(r.createElement)("div",{className:n._16}),this.chartElement.appendChild(this.chartBodyContainer),this.scrollElement=i.i(r.createElement)("div",{className:n._63+" "+n._64,styles:"position:relative;"}),this.chartBodyContainer.appendChild(this.scrollElement),this.chartBodyContent=i.i(r.createElement)("div",{className:n._15,styles:"position:relative; overflow:hidden "}),this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.ganttChartModule.virtualRender.renderWrapper():this.scrollElement.appendChild(this.chartBodyContent),this.scrollObject=new a.a(this.parent);var e=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(e=this.parent.toolbarModule.element.offsetHeight),this.scrollObject.setHeight(this.parent.ganttHeight-this.chartTimelineContainer.offsetHeight-e)},e.prototype.updateWidthAndHeight=function(){var e=0===this.parent.contentHeight?this.parent.flatData.length>1?36:0:this.parent.contentHeight,t=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];if(e>=t.offsetHeight||"auto"===this.parent.height)this.chartBodyContent.style.height=i.i(r.formatUnit)(e);else{var n=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;t.offsetHeight>=n?this.chartBodyContent.style.height=t.offsetHeight-17+"px":this.chartBodyContent.style.height=t.offsetHeight+"px"}this.chartBodyContent.style.width=i.i(r.formatUnit)(this.parent.timelineModule.totalTimelineWidth),this.setVirtualHeight(),this.parent.notify("updateHeight",{}),this.parent.updateGridLineContainerHeight(),this.updateLastRowBottomWidth()},e.prototype.setVirtualHeight=function(){if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){i.i(r.getValue)("virtualTrack",this.parent.ganttChartModule.virtualRender).style.height=this.parent.treeGrid.element.getElementsByClassName("e-virtualtrack")[0].style.height;var e=i.i(r.getValue)("wrapper",this.parent.ganttChartModule.virtualRender),t=this.parent.treeGrid.element.getElementsByClassName("e-virtualtable")[0].style.transform;e.style.transform=t}},e.prototype.updateLastRowBottomWidth=function(){if(this.parent.currentViewData.length>0&&"auto"!==this.parent.height){var e=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.getExpandedRecords(this.parent.currentViewData),t=e[e.length-1],n=this.parent.currentViewData.indexOf(t),a=this.parent.getRowByIndex(n),s=this.parent.chartRowsModule.ganttChartTableBody;if(s.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow")&&i.i(r.removeClass)(s.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow"),"e-lastrow"),this.chartBodyContent.clientHeight<this.chartBodyContainer.clientHeight&&a){i.i(r.addClass)(a.querySelectorAll("td"),"e-lastrow");var o=0===this.parent.contentHeight?this.parent.flatData.length>1?36:0:this.parent.contentHeight,l=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];if(o>=l.offsetHeight)this.chartBodyContent.style.height=i.i(r.formatUnit)(o);else{var d=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;l.offsetHeight>=d?this.chartBodyContent.style.height=l.offsetHeight-17+"px":this.chartBodyContent.style.height=l.offsetHeight+"px"}}}},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("renderPanels",this.renderChartContainer),this.parent.off("recordsUpdated",this.renderChartElements),this.parent.off("dataReady",this.renderInitialContents),this.parent.off("tree-grid-created",this.renderChartContents),this.parent.off("destroy",this.destroy))},e.prototype.ganttChartMouseDown=function(e){3!==e.which&&this.parent.editSettings.allowTaskbarEditing&&(this.parent.notify("chartMouseDown",e),this.parent.element.tabIndex=0),this.parent.editSettings.allowEditing&&this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length>0&&this.parent.treeGrid.endEdit()},e.prototype.ganttChartMouseClick=function(e){this.parent.autoFocusTasks&&this.scrollToTarget(e),this.parent.notify("chartMouseClick",e)},e.prototype.ganttChartMouseUp=function(e){if(this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseUp",e),!this.parent.editSettings.allowEditing){var t=!1;if(this.parent.editSettings.allowTaskbarEditing&&i.i(r.getValue)("editModule.taskbarEditModule.isMouseDragged",this.parent)&&i.i(r.getValue)("editModule.taskbarEditModule.taskBarEditAction",this.parent)&&(t=!0),!t){var a=e.target,s=e.target.classList.contains(n.D)||i.i(r.closest)(e.target,"."+n.D);i.i(r.closest)(a,".e-gantt-parent-taskbar")&&!this.parent.editSettings.allowEditing?this.chartExpandCollapseRequest(e):!s&&this.parent.autoFocusTasks&&this.scrollToTarget(e)}}if("touchend"===e.type){var o=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div");i.i(r.isNullOrUndefined)(o)||o.remove();var l=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar");if(!i.i(r.isNullOrUndefined)(l)){l.parentElement.parentElement.remove()}var d=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-gantt-false-line");i.i(r.isNullOrUndefined)(d)||this.parent.editModule.taskbarEditModule.removeFalseLine(!0)}},e.prototype.scrollToTarget=function(e){var t=i.i(r.closest)(e.target,"tr");if(t&&this.parent.element.contains(t)&&(this.parent.element.querySelectorAll(".e-chart-rows-container")[0].contains(e.target)||this.parent.element.querySelectorAll(".e-gridcontent")[0].contains(e.target))&&this.parent.currentViewData.length>0){var n=i.i(r.getValue)("rowIndex",i.i(r.closest)(e.target,"tr")),a=this.parent.currentViewData[n].ganttProperties.startDate;if(!i.i(r.isNullOrUndefined)(a)){var s=this.parent.dataOperation.getTaskLeft(a,!1);this.parent.autoFocusTasks&&this.updateScrollLeft(s)}}},e.prototype.updateScrollLeft=function(e){e=e>0?e:0,e=this.scrollElement.scrollWidth<=e?this.scrollElement.scrollWidth:e,(this.scrollElement.offsetWidth+this.parent.ganttChartModule.scrollElement.scrollLeft<e||this.scrollElement.scrollLeft>e)&&this.scrollObject.setScrollLeft(e-50,this.parent.enableRtl?-1:0)},e.prototype.mouseUp=function(e){i.i(r.isNullOrUndefined)(this.parent.editModule)||i.i(r.isNullOrUndefined)(this.parent.editModule.taskbarEditModule)||this.parent.editModule.taskbarEditModule.removeFalseLine(!1);var t=this.parent.element.querySelector(".e-taskbar-resize-div");if(i.i(r.isNullOrUndefined)(t)||t.remove(),this.parent.allowRowDragAndDrop){var n=this.parent.element.querySelector(".e-ganttdrag");n&&n.remove()}this.isGanttElement||this.parent.notify("chartMouseUp",e),this.isGanttElement=!1},e.prototype.documentMouseUp=function(e){if(this.isGanttElement=!0,(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse"))&&!0===i.i(r.getValue)("isEditCollapse",this.parent.treeGrid)&&i.i(r.setValue)("isEditCollapse",!1,this.parent.treeGrid),this.parent.allowRowDragAndDrop){var t=this.parent.element.querySelector(".e-ganttdrag");t&&t.remove()}if(!this.parent.isDestroyed&&3!==e.which){var a=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div");i.i(r.isNullOrUndefined)(a)||a.remove();var s=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar");if(!i.i(r.isNullOrUndefined)(s)){s.parentElement.parentElement.remove()}var o=!1;if(this.parent.editSettings.allowTaskbarEditing&&i.i(r.getValue)("editModule.taskbarEditModule.isMouseDragged",this.parent)&&i.i(r.getValue)("editModule.taskbarEditModule.taskBarEditAction",this.parent)&&(o=!0),this.parent.notify("chartMouseUp",e),this.parent.showActiveElement&&(this.parent.showIndicator=!0,i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.focusedElement&&!e.target.classList.contains("e-split-bar")&&(this.focusedElement.tabIndex=0===this.focusedElement.tabIndex?-1:this.focusedElement.tabIndex,i.i(r.removeClass)([this.focusedElement],"e-active-container"))),!o){var l=e.target,d=e.target.classList.contains(n.D)||i.i(r.closest)(e.target,"."+n.D);i.i(r.closest)(l,".e-gantt-parent-taskbar")&&!this.parent.editSettings.allowEditing?this.chartExpandCollapseRequest(e):!d&&this.parent.autoFocusTasks&&this.scrollToTarget(e)}if(this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.removeFalseLine(!0),!i.i(r.isNullOrUndefined)(this.parent.onTaskbarClick)&&!o){var l=e.target,h=i.i(r.closest)(l,".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");h&&this.onTaskbarClick(e,l,h)}}},e.prototype.onTaskbarClick=function(e,t,n){var a=i.i(r.closest)(t,"tr"),s=i.i(r.getValue)("rowIndex",a),o=this.getRecordByTarget(e),l={data:o,taskbarElement:n,rowIndex:s,target:t};this.parent.trigger("onTaskbarClick",l)},e.prototype.ganttChartLeave=function(e){this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseLeave",e)},e.prototype.ganttChartMove=function(e){this.parent.editSettings.allowTaskbarEditing&&(this.parent.notify("chartMouseMove",e),!i.i(r.isNullOrUndefined)(this.parent.taskFields.dependency)&&this.parent.connectorLineEditModule&&this.parent.connectorLineEditModule.updateConnectorLineEditElement(e))},e.prototype.contextClick=function(e){this.parent.allowFiltering&&this.parent.filterModule&&this.parent.filterModule.closeFilterOnContextClick(e.srcElement)},e.prototype.mouseMoveHandler=function(e){if(!i.i(r.isNullOrUndefined)(this.parent.onMouseMove)&&(this.parent.flatData.length||e.target.classList.contains("e-header-cell-label")||e.target.classList.contains("e-headercell"))){var t=e.target,n={originalEvent:e},a=i.i(r.closest)(t,".e-chart-row-cell,.e-connector-line-container,.e-event-markers,.e-header-cell-label,.e-rowcell,.e-headercell,.e-indicator-span");if(a){var s=void 0,o=i.i(r.closest)(t,".e-rowcell,.e-chart-row-cell"),l=i.i(r.closest)(t,".e-rowcell,.e-headercell");if(o&&(s=this.parent.ganttChartModule.getRecordByTarget(e),n.data=s),l){var d=i.i(r.getValue)("cellIndex",l);n.column=this.parent.treeGrid.columns[d]}if(i.i(r.closest)(t,".e-indicator-span")){var h=0,p=s.ganttProperties.indicators;if(p.length>1)for(h=0;h<p.length&&p[h].name!==a.innerText.trim();h++);n.indicator=p[h]}if(i.i(r.closest)(t,".e-connector-line-container")){var u={};u.target=a,n.predecessor=this.parent.tooltipModule.getPredecessorTooltipData(u)}if(i.i(r.closest)(t,".e-event-markers")){var u={};u.target=a,n.eventMarkers=this.parent.tooltipModule.getMarkerTooltipData(u)}t.classList.contains("e-header-cell-label")&&(n.date=new Date(t.dataset.content))}this.parent.trigger("onMouseMove",n)}},e.prototype.doubleClickHandler=function(e){this.parent.notify("chartDblClick",e);var t=e.target,n=i.i(r.closest)(t,"tr"),a=i.i(r.getValue)("rowIndex",n),s=this.parent.ganttChartModule.getRecordByTarget(e),o={row:n,rowData:s,rowIndex:a,target:t};this.recordDoubleClick(o)},e.prototype.recordDoubleClick=function(e){this.parent.trigger("recordDoubleClick",e)},e.prototype.getRecordByTarget=function(e){var t,a=i.i(r.closest)(e.target,"div."+n.D);if(i.i(r.isNullOrUndefined)(a)){if(a=i.i(r.closest)(e.target,"tr")){var s=i.i(r.getValue)("rowIndex",i.i(r.closest)(e.target,"tr"));t=this.parent.currentViewData[s]}}else{var o=a.getAttribute("rowUniqueId");t=this.parent.getRecordByID(o)}return t},e.prototype.getChartRows=function(){return null!=document.getElementById(this.parent.element.id+"GanttTaskTableBody")?document.getElementById(this.parent.element.id+"GanttTaskTableBody").querySelectorAll(".e-chart-row"):null},e.prototype.chartExpandCollapseRequest=function(e){if(!this.parent.enableMultiTaskbar){var t=e.target,n=i.i(r.closest)(t,".e-gantt-parent-taskbar"),a=this.getRecordByTarget(e),s=i.i(r.closest)(t,"tr"),o=i.i(r.getValue)("rowIndex",s),l=this.parent.treeGrid.getRows()[o],d={data:a,gridRow:l,chartRow:s,cancel:!1};this.isExpandCollapseFromChart=!0,n.classList.contains("e-row-expand")?this.collapseGanttRow(d):n.classList.contains("e-row-collapse")&&this.expandGanttRow(d)}},e.prototype.reRenderConnectorLines=function(){this.parent.connectorLineModule.dependencyViewContainer.innerHTML="",this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);var e=this.parent.criticalPathModule;this.parent.enableCriticalPath&&e&&e.criticalPathCollection&&e.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds)},e.prototype.collapseGanttRow=function(e,t){var n=this;t?this.collapsedGanttRow(e):this.parent.trigger("collapsing",e,function(e){n.isExpandCollapseFromChart&&!i.i(r.getValue)("cancel",e)&&n.collapsedGanttRow(e),n.isExpandCollapseFromChart=!1})},e.prototype.collapsedGanttRow=function(e){var t=this;if(!(i.i(r.isNullOrUndefined)(e.gridRow)&&this.parent.enableVirtualization||i.i(r.isNullOrUndefined)(e.chartRow))){var n;if(n=!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.currentViewData.filter(function(i){return i.ganttProperties[t.parent.taskFields.id]===e.data[t.parent.taskFields.id]})[0]:i.i(r.getValue)("data",e),this.isExpandCollapseFromChart){this.expandCollapseChartRows("collapse",i.i(r.getValue)("chartRow",e),n,null);var a=this.parent.taskFields.id;if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){var s=this.parent.treeGrid.getCurrentViewRecords().filter(function(t){return t[a]==e.data[a]})[0];this.parent.treeGrid.collapseRow(i.i(r.getValue)("gridRow",e),s)}else this.parent.treeGrid.collapseRow(i.i(r.getValue)("gridRow",e),n);this.isExpandCollapseFromChart=!1}else this.expandCollapseChartRows("collapse",i.i(r.getValue)("chartRow",e),n,null);"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(n),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),i.i(r.getValue)("chartRow",e).setAttribute("aria-expanded","false")}},e.prototype.expandGanttRow=function(e,t){var n=this;t?this.expandedGanttRow(e):this.parent.trigger("expanding",e,function(e){n.isExpandCollapseFromChart&&!i.i(r.getValue)("cancel",e)&&n.expandedGanttRow(e),n.isExpandCollapseFromChart=!1})},e.prototype.expandedGanttRow=function(e){var t=this;if(!(i.i(r.isNullOrUndefined)(e.gridRow)&&this.parent.enableVirtualization||i.i(r.isNullOrUndefined)(e.chartRow))){var n;if(n=!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.currentViewData.filter(function(i){return i.ganttProperties.taskId==e.data[t.parent.taskFields.id]})[0]:i.i(r.getValue)("data",e),this.isExpandCollapseFromChart){this.expandCollapseChartRows("expand",i.i(r.getValue)("chartRow",e),n,null);var a=this.parent.taskFields.id;if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){var s=this.parent.treeGrid.getCurrentViewRecords().filter(function(t){return t[a]==e.data[a]})[0];this.parent.treeGrid.expandRow(i.i(r.getValue)("gridRow",e),s)}else this.parent.treeGrid.expandRow(i.i(r.getValue)("gridRow",e),n);this.isExpandCollapseFromChart=!1}else this.parent.isExpandCollapseLevelMethod||this.expandCollapseChartRows("expand",i.i(r.getValue)("chartRow",e),n,null),this.parent.isExpandCollapseLevelMethod=!1;"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(n),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),i.i(r.getValue)("chartRow",e).setAttribute("aria-expanded","true")}},e.prototype.renderMultiTaskbar=function(e){this.parent.enableMultiTaskbar?this.parent.chartRowsModule.refreshRecords([e],!0):this.parent.showOverAllocation&&this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)},e.prototype.expandCollapseChartRows=function(e,t,n,a){var s;if("expand"===e){s="table-row",a||(n.expanded=!0);for(var o=t.querySelectorAll(".e-row-collapse"),l=0;l<o.length;l++)i.i(r.addClass)([o[l]],"e-row-expand"),i.i(r.removeClass)([o[l]],"e-row-collapse")}else if("collapse"===e){s="none",a||(n.expanded=!1);for(var o=t.querySelectorAll(".e-row-expand"),l=0;l<o.length;l++)i.i(r.addClass)([o[l]],"e-row-collapse"),i.i(r.removeClass)([o[l]],"e-row-expand")}if(!this.parent.enableVirtualization){for(var d=n.childRecords,h=this.getChartRows(),p=[],u=0;u<h.length;u++)h[u].classList.contains("gridrowtaskId"+n.ganttProperties.rowUniqueID+"level"+(n.level+1))&&p.push(h[u]);for(var u=0;u<p.length;u++)p[u].style.display=s,d[u].childRecords&&d[u].childRecords.length&&("collapse"===e||d[u].expanded||this.isExpandAll)&&this.expandCollapseChartRows(e,p[u],d[u],!0)}},e.prototype.expandCollapseAll=function(e){if("expand"===e)this.isExpandAll=!0,this.parent.treeGrid.expandAll();else if(this.isCollapseAll=!0,this.parent.treeGrid.collapseAll(),this.isCollapseAll&&!this.parent.allowTaskbarOverlap&&"ResourceView"===this.parent.viewType){var t=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight;this.parent.contentHeight=t,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px"}this.isExpandAll=!1,this.isCollapseAll=!1},e.prototype.expandAtLevel=function(e){this.parent.treeGrid.expandAtLevel(e)},e.prototype.collapseAtLevel=function(e){this.parent.enableVirtualization&&(this.parent.isExpandCollapseLevelMethod=!0),this.parent.treeGrid.collapseAtLevel(e)},e.prototype.wireEvents=function(){var e=r.Browser.isPointer,t=r.Browser.touchStartEvent,i=r.Browser.touchEndEvent,n=r.Browser.touchMoveEvent,a=e?"pointerleave":"mouseleave";r.EventHandler.add(this.parent.chartPane,t,this.ganttChartMouseDown,this),r.EventHandler.add(this.parent.chartPane,a,this.ganttChartLeave,this),r.EventHandler.add(this.parent.chartPane,n,this.ganttChartMove,this),this.parent.isAdaptive&&(r.EventHandler.add(this.parent.chartPane,s.click,this.ganttChartMouseClick,this),r.EventHandler.add(this.parent.chartPane,i,this.ganttChartMouseUp,this)),this.parent.isAdaptive||(r.EventHandler.add(this.parent.element,i,this.documentMouseUp,this),r.EventHandler.add(document,i,this.mouseUp,this)),r.EventHandler.add(this.parent.element,"mousemove",this.mouseMoveHandler,this),r.EventHandler.add(document.body,"contextmenu",this.contextClick,this),r.EventHandler.add(document,"mouseup",this.contextClick,this),r.EventHandler.add(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler,this)},e.prototype.unWireEvents=function(){var e=r.Browser.isPointer,t=r.Browser.touchStartEvent,i=r.Browser.touchEndEvent,n=r.Browser.touchMoveEvent,a=e?"pointerleave":"mouseleave";r.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,t,this.ganttChartMouseDown),r.EventHandler.remove(this.parent.chartPane,a,this.ganttChartLeave),r.EventHandler.remove(this.parent.chartPane,n,this.ganttChartMove),this.parent.isAdaptive&&(r.EventHandler.remove(this.parent.chartPane,s.click,this.ganttChartMouseClick),r.EventHandler.remove(this.parent.chartPane,i,this.ganttChartMouseUp)),this.parent.isAdaptive||(r.EventHandler.remove(this.parent.element,i,this.documentMouseUp),r.EventHandler.remove(document,i,this.mouseUp)),r.EventHandler.remove(this.parent.element,"mousemove",this.mouseMoveHandler),r.EventHandler.remove(document.body,"contextmenu",this.contextClick),r.EventHandler.remove(document,"mouseup",this.contextClick),r.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler)},e.prototype.getRecordByTaskBar=function(e){return this.parent.enableVirtualization&&this.parent.enableMultiTaskbar?this.parent.flatData[this.getIndexByTaskBar(e)]:this.parent.currentViewData[this.getIndexByTaskBar(e)]},e.prototype.onTabAction=function(e){this.parent.treeGrid.grid.enableHeaderFocus=this.parent.enableHeaderFocus;var t=this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit;if(this.parent.showActiveElement||t){var n=t?e.target.closest(".e-rowcell"):e.target;(n.closest(".e-rowcell")||n.closest(".e-chart-row"))&&this.parent.focusModule.setActiveElement(n),this.focusedRowIndex=n.closest(".e-rowcell")?n.parentElement.rowIndex:n.closest(".e-chart-row")?n.closest(".e-chart-row").rowIndex:-1;var a="tab"===e.action,s=this.getNextElement(n,a,t);if(s&&n.classList.contains("e-headercell")){var o=parseInt(s.getAttribute("data-colindex"));if("shiftTab"===e.action){for(;-1!=o&&!this.parent.treeGrid.columns[o].visible;)o-=1;if(-1!=o)s=document.getElementsByClassName("e-columnheader")[0].childNodes[o];else for(var l=document.getElementsByClassName("e-toolbar-item"),d=l.length-1;d>0;d--)if(!document.getElementsByClassName("e-toolbar-item")[d].classList.contains("e-hidden")){s=document.getElementsByClassName("e-toolbar-item")[d];break}}else{for(;!this.parent.treeGrid.columns[o].visible;)o+=1;s=document.getElementsByClassName("e-columnheader")[0].childNodes[o]}}if(!s&&"shiftTab"===e.action&&n.classList.contains("e-headercell"))for(var l=document.getElementsByClassName("e-toolbar-item"),d=l.length-1;d>0;d--)if(!document.getElementsByClassName("e-toolbar-item")[d].classList.contains("e-hidden")){s=document.getElementsByClassName("e-toolbar-item")[d];break}if(n.classList.contains("e-treegrid")&&!s)for(var d=0;d<this.parent.treeGrid.columns.length;d++)if(this.parent.treeGrid.columns[d].visible){s=document.getElementsByClassName("e-columnheader")[0].childNodes[d];break}if(!s&&n.classList.contains("e-headercell")&&(s=document.getElementsByClassName("e-timeline-header-container")[0]),"shiftTab"!==e.action&&n.classList.contains("e-timeline-header-container"))for(var d=0;d<this.parent.treeGrid.columns.length;d++)if(this.parent.treeGrid.columns[d].visible){s=document.getElementsByClassName("e-row")[0].childNodes[d];break}if("shiftTab"!==e.action||s||(s=document.getElementsByClassName("e-timeline-header-container")[0]),"shiftTab"===e.action&&n.classList.contains("e-timeline-header-container"))for(var d=this.parent.treeGrid.columns.length-1;d>0;d--)if(this.parent.treeGrid.columns[d].visible){s=document.getElementsByClassName("e-columnheader")[0].childNodes[d];break}if(this.tempNextElement=s,i.i(r.isNullOrUndefined)(s)||i.i(r.isNullOrUndefined)(s.cellIndex)||(this.parent.allowRowDragAndDrop?(this.childrenIndex=s.cellIndex,this.nextElementIndex=s.cellIndex-1):(this.childrenIndex=s.cellIndex,this.nextElementIndex=s.cellIndex),this.parent.ganttColumns[this.nextElementIndex].allowEditing||this.parent.ganttColumns[this.nextElementIndex].field===this.parent.taskFields.id?this.isEditableElement=!1:this.isEditableElement=!0),"noNextRow"===s)return void this.manageFocus(n,"remove",!0);if("string"!=typeof s){if((n.classList.contains("e-rowcell")||n.closest(".e-chart-row-cell")||n.classList.contains("e-headercell")||n.closest(".e-segmented-taskbar")||n.classList.contains("e-timeline-header-container"))&&e.preventDefault(),a&&n.classList.contains("e-rowdragdrop"))return void this.parent.treeGrid.grid.notify("key-pressed",e);if(n.classList.contains("e-rowcell")&&s&&s.classList.contains("e-rowcell")||n.classList.contains("e-headercell"))if(a)if(this.parent.editSettings.allowNextRowEdit){var h=this.parent.currentViewData[this.focusedRowIndex],p=this.parent.ganttColumns[s.getAttribute("data-colindex")].field;h.hasChildRecords?p===this.parent.taskFields.endDate||p===this.parent.taskFields.duration||p===this.parent.taskFields.dependency||p===this.parent.taskFields.progress||p===this.parent.taskFields.work||"taskType"===p?(this.parent.treeGrid.grid.endEdit(),this.parent.treeGrid.grid.notify("key-pressed",e)):p===this.parent.taskFields.name||p===this.parent.taskFields.startDate?this.parent.treeGrid.grid.notify("key-pressed",e):(this.parent.treeGrid.grid.notify("key-pressed",e),t&&this.parent.treeGrid.editCell(this.focusedRowIndex,p)):this.parent.treeGrid.grid.notify("key-pressed",e)}else(!s||s&&!s.classList.contains("e-headercell"))&&(n.classList.contains("e-headercell")&&this.manageFocus(n,"remove",!1),s&&!n.classList.contains("e-editedbatchcell")||this.parent.treeGrid.grid.notify("key-pressed",e));else s.classList.contains("e-headercell")||s.classList.contains("e-rowcell")||s.classList.contains("e-toolbar-item")||this.parent.treeGrid.grid.notify("key-pressed",e);if((!this.parent.editModule||!this.parent.editModule.cellEditModule||i.i(r.isNullOrUndefined)(this.parent.editModule.cellEditModule.editedColumn))&&s){if(n.classList.contains("e-rowcell")?this.manageFocus(n,"remove",!1):this.manageFocus(n,"remove",!0),s.classList.contains("e-rowcell")&&n.nextElementSibling&&!n.classList.contains("e-timeline-header-container")||n.classList.contains("e-right-label-container")){if(!n.classList.contains("e-rowcell")){this.parent.treeGrid.grid.notify("key-pressed",e);var u=i.i(r.getValue)("focusModule",this.parent.treeGrid.grid);u.currentInfo.element=s,u.currentInfo.elementToFocus=s,u.content.matrix.current=[s.parentElement.rowIndex,s.cellIndex]}this.manageFocus(s,"add",!1)}else s&&(s.classList.contains("e-toolbar-item")||s.classList.contains("e-headercell")||s.classList.contains("e-rowcell"))?(this.manageFocus(n,"remove",!1),this.manageFocus(s,"add",!1),n.classList.contains("e-treegrid")&&e.preventDefault()):this.manageFocus(s,"add",!0);this.parent.focusModule.setActiveElement(s)}}}},e.prototype.getNextElement=function(e,t,n){for(var a=t?e.nextElementSibling:e.previousElementSibling;a&&a.parentElement.classList.contains("e-row");){if(!a.matches(".e-hide")&&!a.matches(".e-rowdragdrop"))return a;a=t?a.nextElementSibling:a.previousElementSibling}if(!i.i(r.isNullOrUndefined)(a)&&(a.classList.contains("e-taskbar-main-container")||a.classList.contains("e-right-connectorpoint-outer-div"))){var s=this.parent.currentViewData[this.focusedRowIndex];!i.i(r.isNullOrUndefined)(s.ganttProperties.segments)&&s.ganttProperties.segments.length>0&&(a=a.classList.contains("e-right-connectorpoint-outer-div")?a.parentElement.nextElementSibling:a.getElementsByClassName("e-gantt-child-taskbar-inner-div")[0])}if(this.validateNextElement(a))return a;var o=-1,l=null;if(e.classList.contains("e-rowcell")&&n&&this.parent.editSettings.allowNextRowEdit)return o=e.parentElement.rowIndex,l=this.getNextRowElement(o,t,!0),this.getChildElement(l,t);if(e.classList.contains("e-rowcell"))if(o=e.parentElement.rowIndex,t){if(l=this.parent.getRowByIndex(o),this.validateNextElement(l,"e-left-label-container"))return l.getElementsByClassName("e-left-label-container")[0];if(this.validateNextElement(l,"e-taskbar-main-container"))return l.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(l,"e-right-label-container"))return l.getElementsByClassName("e-right-label-container")[0]}else{if(l=this.getNextRowElement(o,t,!1),this.validateNextElement(l,"e-right-label-container"))return l.getElementsByClassName("e-right-label-container")[0];if(this.validateNextElement(l,"e-taskbar-main-container"))return l.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(l,"e-left-label-container"))return l.getElementsByClassName("e-left-label-container")[0]}else if(e.parentElement.classList.contains("e-chart-row-cell")||e.parentElement.parentElement.classList.contains("e-chart-row-cell")){o=i.i(r.closest)(e,".e-chart-row").rowIndex,l=t?this.getNextRowElement(o,t,!0):this.parent.treeGrid.grid.getRowByIndex(o);var d=this.getChildElement(l,t);return d}if((a=e)&&a.parentElement.classList.contains("e-toolbar-item")&&this.parent.toolbarModule)for(;a&&a.parentElement.classList.contains("e-toolbar-item")&&a.parentElement.nextElementSibling.classList.contains("e-toolbar-item");){if(!a.parentElement.nextElementSibling.classList.contains("e-hidden"))return a.parentElement.nextElementSibling;a=a.parentElement.nextElementSibling.childNodes[0]}return null},e.prototype.getNextRowElement=function(e,t,i){var r=this.parent.getExpandedRecords(this.parent.currentViewData),n=this.parent.currentViewData[e],a=r.indexOf(n),s=t?r[a+1]:r[a-1],o=this.parent.currentViewData.indexOf(s);return s?i?this.parent.treeGrid.grid.getRowByIndex(o):this.parent.getRowByIndex(o):null},e.prototype.validateNextElement=function(e,t){if(e&&e.classList.contains("e-rowcell"))return!0;if(e&&t){var n=e.getElementsByClassName(t)[0];return!(!n||!n.hasChildNodes())}return!!e&&!(i.i(r.isNullOrUndefined)(e)||!e.hasChildNodes())},e.prototype.getChildElement=function(e,t){var i;if(!e)return"noNextRow";for(i=t?e.children[0]:e.children[e.children.length-1];i;){if(!i.matches(".e-hide")&&!i.matches(".e-rowdragdrop"))return i;i=t?i.nextElementSibling:i.previousElementSibling}return i},e.prototype.manageFocus=function(e,t,n){if(n){var a=null;if(e.classList.contains("e-left-label-container")||e.classList.contains("e-right-label-container"))a=e.getElementsByTagName("span")[0];else if(e.classList.contains("e-taskbar-main-container")||e.classList.contains("e-gantt-child-taskbar-inner-div")){var s=i.i(r.closest)(e,".e-chart-row").rowIndex,o=this.parent.currentViewData[s],l=o.hasChildRecords?o.ganttProperties.isAutoSchedule?"e-gantt-parent-taskbar":"e-manualparent-main-container":o.ganttProperties.isMilestone?"e-gantt-milestone":!i.i(r.isNullOrUndefined)(o.ganttProperties.segments)&&o.ganttProperties.segments.length>0?"e-segmented-taskbar":"e-gantt-child-taskbar";a=e.getElementsByClassName(l)[0],i.i(r.isNullOrUndefined)(a)&&(a=e)}(e.classList.contains("e-right-label-temp-container")||e.classList.contains("e-left-label-temp-container")||e.classList.contains("e-indicator-span")||e.classList.contains("e-timeline-header-container"))&&("add"===t?(e.setAttribute("tabIndex","0"),i.i(r.addClass)([e],"e-active-container"),e.focus()):(i.i(r.removeClass)([e],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur())),"add"!==t||i.i(r.isNullOrUndefined)(a)?i.i(r.isNullOrUndefined)(a)||(i.i(r.removeClass)([a],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur()):(e.setAttribute("tabIndex","0"),i.i(r.addClass)([a],"e-active-container"),e.focus(),this.focusedElement=a)}else"add"===t?(e.setAttribute("tabIndex","0"),i.i(r.addClass)([e],["e-focused","e-focus"]),e.focus()):(e.setAttribute("tabIndex","-1"),i.i(r.removeClass)([e],["e-focused","e-focus"]),e.blur())},e.prototype.getIndexByTaskBar=function(e){var t,a;if(t=e.classList.contains(n.D)?e:i.i(r.closest)(e,"div."+n.D),i.i(r.isNullOrUndefined)(t))t=i.i(r.closest)(e,"tr."+n.Z),a=[].slice.call(this.parent.chartRowsModule.ganttChartTableBody.childNodes).indexOf(t);else{var s=t.getAttribute("rowUniqueId"),o=this.parent.getRecordByID(s);a=this.parent.enableVirtualization&&this.parent.enableMultiTaskbar?this.parent.flatData.indexOf(o):this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport?this.parent.ids.indexOf(o.ganttProperties.taskId.toString()):this.parent.currentViewData.indexOf(o)}return a},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.scrollObject.destroy(),this.scrollObject=null},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return T});var r=i(0),n=(i.n(r),i(9)),a=(i.n(n),i(48)),s=i(45),o=i(82),l=i(49),d=i(8),h=i(10),p=i(77),u=i(14),c=i(3),g=i(6),f=(i.n(g),i(5)),m=(i.n(f),i(78)),y=i(47),D=i(83),v=i(37),w=i(1),k=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),b=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},T=function(e){function t(t,n){var a=e.call(this,t,n)||this;return a.showIndicator=!0,a.singleTier=0,a.isLocaleChanged=!1,a.isCancelled=!1,a.previousRecords={},a.editedRecords=[],a.modifiedRecords=[],a.isOnEdit=!1,a.isOnDelete=!1,a.isExpandCollapseLevelMethod=!1,a.isDynamicData=!1,a.isConnectorLineUpdate=!1,a.staticSelectedRowIndex=-1,a.needsID=!0,a.showActiveElement=!0,a.addDeleteRecord=!1,a.enableHeaderFocus=!0,a.enableValidation=!0,a.isTreeGridRendered=!1,a.isFromOnPropertyChange=!1,a.isFromRenderBaseline=!1,a.isGanttChartRendered=!1,a.isEdit=!1,i.i(r.setValue)("mergePersistData",a.mergePersistGanttData,a),a}return k(t,e),t.prototype.getModuleName=function(){return"gantt"},t.prototype.preRender=function(){this.initProperties()},t.prototype.initProperties=function(){this.globalize=new r.Internationalization(this.locale),this.isAdaptive=r.Browser.isDevice,this.flatData=[],this.currentViewData=[],this.updatedRecords=[],this.ids=[],this.ganttColumns=[],this.localeObj=new r.L10n(this.getModuleName(),this.getDefaultLocale(),this.locale),this.dataOperation=new a.a(this),this.nonWorkingHours=[],this.nonWorkingTimeRanges=[],this.workingTimeRanges=[],this.defaultEndTime=null,this.defaultStartTime=null,this.durationUnitTexts={days:"days",hours:"hours",minutes:"minutes",day:"day",hour:"hour",minute:"minute"},this.durationUnitEditText={minute:["m","min","minute","minutes"],hour:["h","hr","hour","hours"],day:["d","dy","day","days"]},this.perDayWidth=null,this.isMileStoneEdited=!1,this.chartVerticalLineContainer=null,this.updatedConnectorLineCollection=[],this.connectorLineIds=[],this.predecessorsCollection=[],this.isInPredecessorValidation=this.enablePredecessorValidation,this.isValidationEnabled=!0,this.isLoad=!0,this.editedTaskBarItem=null,this.validationDialogElement=null,this.currentEditedArgs={},this.dialogValidateMode={respectLink:!1,removeLink:!1,preserveLinkWithEditing:!0},this.secondsPerDay=this.dataOperation.getSecondsPerDay(),this.nonWorkingDayIndex=[],this.dataOperation.getNonWorkingDayIndex(),this.columnMapping={},this.controlId=this.element.id,this.cloneProjectStartDate=this.enablePersistence&&this.cloneProjectStartDate?this.cloneProjectStartDate:null,this.cloneProjectEndDate=this.enablePersistence&&this.cloneProjectEndDate?this.cloneProjectEndDate:null,this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.ganttChartModule=new s.a(this),this.timelineModule=new o.a(this),this.chartRowsModule=new p.a(this),this.treeGridModule=new l.a(this),this.dateValidationModule=new h.a(this),this.predecessorModule=new u.a(this),this.connectorLineModule=new m.a(this),this.splitterModule=new y.a(this),this.tooltipModule=new D.a(this),this.keyConfig={home:"home",end:"end",downArrow:"downarrow",upArrow:"uparrow",collapseAll:"ctrl+uparrow",expandAll:"ctrl+downarrow",collapseRow:"ctrl+shift+uparrow",expandRow:"ctrl+shift+downarrow",saveRequest:"13",cancelRequest:"27",addRow:"insert",addRowDialog:"ctrl+insert",editRowDialog:"ctrl+f2",delete:"delete",tab:"tab",shiftTab:"shift+tab",focusTask:"shift+f5",indentLevel:"shift+leftarrow",outdentLevel:"shift+rightarrow",focusSearch:"ctrl+shift+70",contextMenu:"shift+F10"},this.focusModule=new v.a(this),0===this.zoomingLevels.length&&this.setProperties({zoomingLevels:this.getZoomingLevels()},!0),this.resourceFieldsMapping(),i.i(r.isNullOrUndefined)(this.resourceFields.unit)&&this.setProperties({resourceFields:{unit:"unit"}},!0),i.i(r.isNullOrUndefined)(this.taskFields.work)||this.setProperties({taskType:"FixedWork"},!0),this.taskIds=[]},t.prototype.getDateFormat=function(){if(i.i(r.isNullOrUndefined)(this.dateFormat)){return this.globalize.getDatePattern({skeleton:"yMd"})}return this.dateFormat},t.prototype.getDefaultTZOffset=function(){var e=new Date((new Date).getFullYear(),0,1),t=new Date((new Date).getFullYear(),6,1);return Math.max(e.getTimezoneOffset(),t.getTimezoneOffset())},t.prototype.isInDst=function(e){return e.getTimezoneOffset()<this.getDefaultTZOffset()},t.prototype.resourceFieldsMapping=function(){var e=this.resourceFields;e.id=i.i(r.isNullOrUndefined)(e.id)?this.resourceIDMapping:e.id,e.name=i.i(r.isNullOrUndefined)(e.name)?this.resourceNameMapping:e.name},t.prototype.validateDimentionValue=function(e){return i.i(r.isNullOrUndefined)(e)?null:"string"==typeof e&&"auto"!==e&&-1===e.indexOf("%")?-1===e.indexOf("px")?e+"px":e:"number"==typeof e?e+"px":e.toString()},t.prototype.calculateDimensions=function(){var e=this.validateDimentionValue(this.height),t=this.validateDimentionValue(this.width);i.i(r.isNullOrUndefined)(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(t=this.width);var n=this.element.style.height,a=this.element.style.width;t&&(this.element.style.width=t),e&&(this.element.style.height=e),e||n||(this.element.style.height="auto"),t||a||(this.element.style.width="auto"),this.ganttHeight=this.element.offsetHeight,this.ganttWidth=this.element.offsetWidth},t.prototype.render=function(){this.isReact&&(this.treeGrid.isReact=!0,this.treeGrid.grid.isReact=!0),this.isVue&&(this.treeGrid.isVue=!0,this.treeGrid.grid.isVue=!0,this.treeGrid.vueInstance=this.vueInstance,this.treeGrid.grid.vueInstance=this.vueInstance),i.i(n.createSpinner)({target:this.element},this.createElement),this.trigger("load",{}),this.element.classList.add(c._11),this.rowHeight=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")&&36===this.rowHeight?46:this.rowHeight,this.isAdaptive?this.element.classList.add(c._12):this.element.classList.remove(c._12),this.calculateDimensions(),i.i(r.isNullOrUndefined)(this.toolbarModule)||this.renderToolbar(),this.splitterModule.renderSplitter(),this.notify("renderPanels",null),i.i(r.isNullOrUndefined)(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow(),this.dataOperation.checkDataBinding()},t.prototype.hideMaskRow=function(){var e=this.element.querySelectorAll(".e-masked-table").length;if(!i.i(r.isNullOrUndefined)(this.contentMaskTable)&&(0!=e||this.contentMaskTable)){var t=this.contentMaskTable;i.i(r.remove)(t),this.contentMaskTable=null}if(e=this.element.querySelectorAll(".e-masked-table").length,!i.i(r.isNullOrUndefined)(this.headerMaskTable)&&(0!=e||this.headerMaskTable)){var t=this.headerMaskTable;i.i(r.remove)(t),this.headerMaskTable=null}for(;0!=this.element.querySelectorAll(".e-table-background").length;)this.element.querySelectorAll(".e-table-background")[0].remove();for(;0!=this.element.querySelectorAll(".e-temp-timeline").length;)this.element.querySelectorAll(".e-temp-timeline")[0].remove();if(0!=this.element.querySelectorAll("."+c._13).length)for(var n=0;n<this.singleTier;n++)i.i(r.isNullOrUndefined)(this.element.querySelectorAll("."+c._13)[parseInt(n.toString(),10)])||(this.element.querySelectorAll("."+c._13)[parseInt(n.toString(),10)].style.visibility="visible");i.i(r.isNullOrUndefined)(this.element.querySelector("."+c._14))||(this.element.querySelector("."+c._14).style.position="relative"),i.i(r.isNullOrUndefined)(this.element.getElementsByClassName(c._15)[0])||(this.element.getElementsByClassName(c._15)[0].style.visibility="visible")},t.prototype.showMaskRow=function(){var e=this.chartPane.childNodes[0].childNodes[0];this.scrollLeftValue=this.chartPane.childNodes[0].childNodes[0].scrollLeft;var t=this.chartPane.childNodes[0].childNodes[1];if(this.treeGrid.element&&this.ganttChartModule.setVirtualHeight(),!this.contentMaskTable){if(t){var i=t;if(this.renderBackGround(i),0!=this.element.querySelectorAll("."+c._13).length){this.singleTier=this.timelineModule.isSingleTier?1:2;for(var r=0;r<this.singleTier;r++)this.element.querySelectorAll("."+c._13)[parseInt(r.toString(),10)].style.visibility="hidden"}0===this.singleTier&&(this.singleTier=2),this.element.getElementsByClassName(c._15)[0].style.visibility="hidden",this.contentMaskTable=this.contentMaskTable=this.createMaskTable(i)}if(e){this.element.querySelector("."+c._14).style.position="static";var i=e;this.renderHeaderBackground(i),this.headerMaskTable=this.headerMaskTable=this.createMaskTable(i)}}},t.prototype.renderHeaderBackground=function(e){var t=e,n=e.getBoundingClientRect().height;if(!!i.i(r.closest)(t,"."+c._14)){for(var a=this.createElement("div",{className:"e-table-background"}),s=(this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+n+"px;"}}),0),o=Math.round(e.getBoundingClientRect().width),l=0;l<3;l++)this.enableRtl?a.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(o-=160)+"px; top:0px;"}})):a.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(s+=160)+"px; top:0px;"}}));t.insertBefore(a,t.firstChild)}},t.prototype.renderBackGround=function(e){var t=e,n=e.getBoundingClientRect().height;if(!!i.i(r.closest)(t,"."+c._16)){for(var a=this.createElement("div",{className:"e-table-background"}),s=(this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+n+"px;"}}),0),o=Math.round(e.getBoundingClientRect().width),l=0;l<3;l++)this.enableRtl?a.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(o-=160)+"px;z-index:1;"}})):a.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(s+=160)+"px;z-index:1;"}}));t.insertBefore(a,t.firstChild)}},t.prototype.createMaskTable=function(e){var t,n=e,a=e.getBoundingClientRect().height,s=!!i.i(r.closest)(n,"."+c._14);if(s?(t=this.createEmptyTimeLineTable(a),t.style.position="sticky",t.style.left="0px",this.enableRtl&&t.style.removeProperty("left")):(t=this.createEmptyMaskTable(a),t.style.position="absolute",t.style.zIndex=1),s){t.style.height=e.getBoundingClientRect().height+"px";var o=this.createElement("div",{className:"e-temp-timeline"});o.style.width="614px",o.style.position="sticky",this.enableRtl?o.style["margin-right"]=Math.abs(this.scrollLeftValue)+"px":o.style["margin-left"]=this.scrollLeftValue+"px",o.appendChild(t),n.insertBefore(o,n.firstChild)}else t.style.height=e.getBoundingClientRect().height+"px",n.insertBefore(t,n.firstChild);return t},t.prototype.createEmptyTimeLineTable=function(e){for(var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),r=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/2+"px;"}}),a=0;a<this.singleTier;a++)r.push(n.cloneNode(!0));this.topBottomHeader=0;for(var a=0;a<r.length;a++)i.appendChild(this.applyTimelineMaskRow(r[parseInt(a.toString(),10)])),this.topBottomHeader=this.topBottomHeader+1;return t.appendChild(i),t.style.width="100%",t},t.prototype.applyTimelineMaskRow=function(e){var t=e;t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(var i=0;i<t.childNodes.length-1;i++)t.childNodes[parseInt(i.toString(),10)].style.width="166px";for(var r=[].slice.call(t.childNodes),i=0;i<r.length;i++){var n=r[parseInt(i.toString(),10)];switch(this.topBottomHeader){case 0:this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>',n.children[0].style.left="-20px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>';break;case 1:n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(var a=[].slice.call(n.childNodes),s=0;s<a.length;s++){var o=a[parseInt(s.toString(),10)];0===s?this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>',o.children[0].style.left="-14px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>':1===s?this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>',o.children[0].style.left="-30px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>':this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>',o.children[0].style.left="-60px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>'}}}return t},t.prototype.createEmptyMaskTable=function(e){var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),r=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/7+"px;"}});this.columnLoop=0;for(var a=0;a<6;a++)r.push(n.cloneNode(!0));for(var s=0;s<r.length;s++)this.columnLoop<4?this.columnLoop=this.columnLoop+1:4===this.columnLoop&&(this.columnLoop=1),i.appendChild(this.applyMaskRow(r[parseInt(s.toString(),10)]));t.appendChild(i),t.style.width="100%";var o=this.createElement("div",{className:"e-temp-container"});return o.style.width="calc(100% - 17px)",o.style.overflow="hidden",o.appendChild(t),o},t.prototype.applyMaskRow=function(e){var t=e;this.columnLoop<4?(t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"})),t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}))):t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}));for(var i=[].slice.call(t.childNodes),r=0;r<i.length;r++){var n=i[parseInt(r.toString(),10)];switch(this.columnLoop){case 1:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>',n.children[0].style.left="-14px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>':n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell02"></span>';break;case 2:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>',n.children[0].style.left="-14px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>':n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell04"></span>';break;case 3:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>',n.children[0].style.left="-64px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>':this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>',n.children[0].style.left="-192px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>';break;case 4:this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>',n.children[0].style.left="-388px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>'}}return t},t.prototype.showSpinner=function(){i.i(n.showSpinner)(this.element)},t.prototype.hideSpinner=function(){i.i(n.hideSpinner)(this.element)},t.prototype.processTimeline=function(){this.timelineModule.processTimelineUnit(),this.timelineModule.calculateZoomingLevelsPerDayWidth()},t.prototype.renderGantt=function(e){if(e&&(this.isFromOnPropertyChange=e),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors(),this.isInPredecessorValidation&&this.enableValidation&&this.autoCalculateDateScheduling&&this.predecessorModule.updatedRecordsDateByPredecessor()),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp()),e)if(this.enableValidation&&this.dataOperation.updateGanttData(),this.allowParentDependency&&this.predecessorModule.updateParentPredecessor(),this.dataSource instanceof Object&&i.i(w.i)(this)){var t=i.i(r.getValue)("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:t}}else this.treeGrid.setProperties({dataSource:this.flatData},!1);else this.enableValidation&&this.dataOperation.updateGanttData(),this.allowParentDependency&&this.predecessorModule.updateParentPredecessor(),this.treeGridPane.classList.remove("e-temp-content"),i.i(r.remove)(this.treeGridPane.querySelector(".e-gantt-temp-header")),this.notify("dataReady",{}),this.enableContextMenu&&this.notify("initiate-contextMenu",{}),this.renderTreeGrid(),this.wireEvents(),this.notify("initPredessorDialog",{});this.isFromOnPropertyChange||this.splitterModule.updateSplitterPosition()},t.prototype.removeCriticalPathStyles=function(){var e=this.ganttChartModule.chartElement;i.i(r.removeClass)(e.querySelectorAll(".e-gantt-child-taskbar-inner-div"),c.n),i.i(r.removeClass)(e.querySelectorAll(".e-gantt-child-progressbar-inner-div"),c.p),i.i(r.removeClass)(e.querySelectorAll(".e-critical-milestone"),c.q),i.i(r.removeClass)(this.element.querySelectorAll(".e-connector-line"),c.r),i.i(r.removeClass)(this.element.querySelectorAll(".e-connector-line-arrow"),c.s)},t.prototype.wireEvents=function(){this.allowKeyboard&&(this.keyboardModule=new r.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfig,eventName:"keydown"})),r.EventHandler.add(window,"resize",this.windowResize,this),r.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)},t.prototype.keyDownHandler=function(e){e.altKey&&74===e.keyCode&&(this.ganttChartModule.manageFocus(this.treeGrid.element.childNodes[1],"remove",!1),this.ganttChartModule.manageFocus(this.element,"add",!1))},t.prototype.windowResize=function(){if(!i.i(r.isNullOrUndefined)(this.element)){this.updateContentHeight(),this.ganttChartModule.updateWidthAndHeight(),this.treeGridModule.ensureScrollBar(),this.predecessorModule&&this.taskFields.dependency&&(this.updateRowHeightInConnectorLine(this.updatedConnectorLineCollection),this.connectorLineModule.renderConnectorLines(this.updatedConnectorLineCollection));var e=this.criticalPathModule;this.enableCriticalPath&&e&&e.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds),this.calculateDimensions();var t=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[0],n=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[1];this.splitterModule.splitterPreviousPositionGrid=t.scrollWidth+1+"px",this.splitterModule.splitterPreviousPositionChart=n.scrollWidth+1+"px",this.splitterModule.splitterObject.paneSettings[1].size=this.ganttWidth-parseInt(this.splitterModule.splitterPreviousPositionGrid)-4+"px";var a=this;this.timelineModule.isZoomToFit&&setTimeout(function(){a.timelineModule.processZoomToFit()},0)}},t.prototype.keyActionHandler=function(e){this.focusModule.onKeyPress(e)},t.prototype.updateRowHeightInConnectorLine=function(e){if(e&&e.length){var t=this.ganttChartModule.getChartRows()[0]&&this.ganttChartModule.getChartRows()[0].getBoundingClientRect().height;if(t&&!isNaN(t))for(var i=0;i<e.length;i++)e[i].rowHeight=t}},t.prototype.renderToolbar=function(){i.i(r.isNullOrUndefined)(this.toolbarModule)||(this.toolbarModule.renderToolbar(),this.toolbarModule.refreshToolbarItems())},t.prototype.renderTreeGrid=function(){this.treeGridModule.renderTreeGrid()},t.prototype.updateCurrentViewData=function(){var e=this;if(this.currentViewData=this.treeGrid.getCurrentViewRecords().slice(),!this.loadChildOnDemand&&this.taskFields.hasChildMapping&&this.currentViewData.length>0){this.autoCalculateDateScheduling=!1,this.flatData=[],this.dataOperation.taskIds=[],this.ids=[],this.dataOperation.recordIndex=0,this.dataOperation.dataArray=this.currentViewData,this.dataOperation.cloneDataSource(),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors());for(var t=this.treeGrid.grid.contentModule.rows,n=t.filter(function(t){if(t.data[e.taskFields.id]===e.flatData[0].ganttProperties.taskId)return t})[0],a=n.index,s=0;s<this.flatData.length;s++)this.flatData[s].index=a,a++;this.currentViewData=this.flatData,this.treeGrid.grid.currentViewData=this.flatData,i.i(r.isNullOrUndefined)(this.treeGrid.virtualScrollModule)||(this.treeGrid.virtualScrollModule.visualData=this.flatData,this.updatedRecords=this.flatData)}},t.prototype.getRecordFromFlatdata=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getTaskByUniqueID(e[i].uniqueID));return t},t.prototype.updateContentHeight=function(e){if(this.allowTaskbarOverlap||this.ganttChartModule.isCollapseAll||this.ganttChartModule.isExpandAll||"ResourceView"!==this.viewType||this.isLoad)if(this.virtualScrollModule&&this.enableVirtualization&&!i.i(r.isNullOrUndefined)(e)){var t=i.i(r.getValue)("result.length",e);this.contentHeight=t*this.rowHeight}else{var n=this.virtualScrollModule&&this.enableVirtualization?this.currentViewData:this.getExpandedRecords(this.currentViewData),a=void 0,s=i.i(r.isNullOrUndefined)(this.ganttChartModule.getChartRows())?null:this.ganttChartModule.getChartRows()[0];a=!i.i(r.isNullOrUndefined)(s)&&s.getBoundingClientRect().height>0?s.getBoundingClientRect().height:this.rowHeight,this.contentHeight=n.length*a}},t.prototype.getExpandStatus=function(e){var t=this.getParentTask(e.parentItem);if(i.i(r.isNullOrUndefined)(t))return!0;if(!1===t.expanded)return!1;if(t.parentItem){return!1!==this.getParentTask(t.parentItem).expanded&&this.getExpandStatus(this.getParentTask(t.parentItem))}return!0},t.prototype.getExpandedRecords=function(e){var t=this;return i.i(r.isNullOrUndefined)(e)?[]:e.filter(function(e){return!0===t.getExpandStatus(e)})},t.prototype.getZoomingLevels=function(){var e=this.timelineSettings.weekStartDay;return[{topTier:{unit:"Year",format:"yyyy",count:50},bottomTier:{unit:"Year",format:"yyyy",count:10},timelineUnitSize:99,level:0,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:20},bottomTier:{unit:"Year",format:"yyyy",count:5},timelineUnitSize:99,level:1,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:5},bottomTier:{unit:"Year",format:"yyyy",count:1},timelineUnitSize:99,level:2,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:66,level:3,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:99,level:4,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:66,level:5,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:99,level:6,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",format:"MMM yyyy",count:1},timelineUnitSize:99,level:7,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yy",count:1},bottomTier:{unit:"Week",format:"dd",count:1},timelineUnitSize:33,level:8,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:66,level:9,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:99,level:10,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:33,level:11,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:66,level:12,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:99,level:13,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:66,level:14,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:99,level:15,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:66,level:16,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:99,level:17,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:66,level:18,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:99,level:19,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:66,level:20,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:99,level:21,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:30},timelineUnitSize:66,level:22,timelineViewMode:"Hour",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:15},timelineUnitSize:66,level:23,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:1},timelineUnitSize:66,level:24,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0}]},t.prototype.displayQuarterValue=function(e){var t=e.getMonth();return t>=0&&t<=2?"Q1":t>=3&&t<=5?"Q2":t>=6&&t<=8?"Q3":"Q4"},t.prototype.displayHalfValue=function(e){var t=e.getMonth();return t>=0&&t<=5?"H1":"H2"},t.prototype.getFormatedDate=function(e,t){return i.i(r.isNullOrUndefined)(e)?null:(i.i(r.isNullOrUndefined)(t)&&(t=this.getDateFormat()),this.globalize.formatDate(e,{format:t}))},t.prototype.getDurationString=function(e,t){return this.dateValidationModule.getDurationString(e,t)},t.prototype.getWorkString=function(e,t){return this.dateValidationModule.getWorkString(e,t)},t.prototype.updateTreeColumns=function(){var e,t=this.treeGrid.grid.getColumns();-1!==this.treeColumnIndex&&this.columns[this.treeColumnIndex]&&!i.i(r.isNullOrUndefined)(this.columns[this.treeColumnIndex].template)&&(e=this.columns[this.treeColumnIndex].template,this.columns[this.treeColumnIndex].field);for(var n,a=0;a<t.length;a++){n={};for(var s=0;s<this.columns.length;s++)if(this.columns[s].field==t[a].field){for(var o=0,l=Object.keys(this.columns[s]);o<l.length;o++){var d=l[o];i.i(r.isUndefined)(this.columns[s][d])||(n[d]=t[a][d]),n.visible=t[a].visible,n.width=t[a].width}this.columns[s]=n,"checkbox"===this.columns[s].type||i.i(r.isNullOrUndefined)(e)||""===e||(this.columns[s].template=e)}}this.columns.length>0&&this.treeGrid.setProperties({columns:this.columns},!0)},t.prototype.treeDataBound=function(e){this.element.getElementsByClassName("e-chart-root-container")[0].style.height="100%";var t=(this.element.getElementsByClassName("e-gridcontent")[0].style.height,this.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight);if("calc(100% - "+t+"px)",this.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+t+"px)",i.i(r.isNullOrUndefined)(this.toolbarModule)||i.i(r.isNullOrUndefined)(this.toolbarModule.element)?this.splitterElement.style.height="100%":this.splitterElement.style.height="calc(100% - "+this.toolbarModule.element.offsetHeight+"px)",this.isLoad){if(this.enablePersistence&&this.updateTreeColumns(),this.updateCurrentViewData(),this.enableVirtualization||this.updateContentHeight(),!this.isTreeGridRendered){this.isTreeGridRendered=!0;i.i(r.isNullOrUndefined)(this.toolbarModule)||i.i(r.isNullOrUndefined)(this.toolbarModule.element)||this.toolbarModule.element.offsetHeight,this.timelineModule.isSingleTier?(i.i(r.addClass)(this.treeGrid.element.querySelectorAll(".e-headercell"),c._17),i.i(r.addClass)(this.treeGrid.element.querySelectorAll(".e-columnheader"),c._17)):(i.i(r.removeClass)(this.treeGrid.element.querySelectorAll(".e-headercell"),c._17),i.i(r.removeClass)(this.treeGrid.element.querySelectorAll(".e-columnheader"),c._17)),this.treeGrid.height="100%",this.notify("tree-grid-created",{}),this.createGanttPopUpElement(),i.i(r.isNullOrUndefined)(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),i.i(r.setValue)("isGanttCreated",!0,e),this.renderComplete()}}else this.getCurrentRecords(e);!this.loadChildOnDemand&&this.taskFields.hasChildMapping&&this.updateContentHeight(),this.enableCriticalPath&&this.criticalPathModule&&this.criticalPathModule.showCriticalPath(this.enableCriticalPath),this.notify("recordsUpdated",{});for(var n=0;n<document.getElementsByClassName("e-timeline-header-table-container").length;n++)for(var a=0;a<document.getElementsByClassName("e-timeline-header-table-container")[n].children[0].children[0].children.length;a++)document.getElementsByClassName("e-timeline-header-table-container")[n].children[0].children[0].children[a].children[0].setAttribute("tabindex","-1");var s=this.criticalPathModule;this.enableCriticalPath&&s&&s.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(s.criticalPathCollection,s.detailPredecessorCollection,!0,s.predecessorCollectionTaskIds),this.initialChartRowElements=this.ganttChartModule.getChartRows(),this.isLoad=!1,!this.loadChildOnDemand&&this.taskFields.hasChildMapping&&(this.autoCalculateDateScheduling=!0),this.trigger("dataBound",e)},t.prototype.getCurrentRecords=function(e){this.predecessorModule&&this.taskFields.dependency&&this.connectorLineModule.removePreviousConnectorLines(this.currentViewData),this.updateCurrentViewData(),this.enableVirtualization||this.updateContentHeight(),this.virtualScrollModule&&this.enableVirtualization&&(this.ganttChartModule.virtualRender.adjustTable(),this.ganttChartModule.scrollObject.updateTopPosition())},t.prototype.onPropertyChanged=function(e,t){for(var n=!1,a=0,s=Object.keys(e);a<s.length;a++){var o=s[a];switch(o){case"allowSelection":case"allowRowDragAndDrop":case"allowFiltering":case"showColumnMenu":case"allowResizing":case"allowReordering":case"enableImmutableMode":this.treeGrid[o]=this[o],this.treeGrid.dataBind();break;case"workWeek":this.dataOperation.getNonWorkingDayIndex(),this.dataOperation.reUpdateGanttData(),this.chartRowsModule.initiateTemplates(),this.taskFields.dependency&&this.predecessorModule.updatedRecordsDateByPredecessor(),this.chartRowsModule.refreshGanttRows(),this.treeGrid.refreshColumns(),this.timelineModule.refreshTimeline();break;case"toolbar":this.notify("ui-toolbarupdate",{module:"toolbar",properties:e});break;case"columnMenuItems":this.treeGrid.grid.columnMenuItems=i.i(f.getActualProperties)(this.columnMenuItems);break;case"eventMarkers":case"highlightWeekends":this.notify("ui-update",{module:"day-markers",properties:e});break;case"sortSettings":this.treeGrid.sortSettings=i.i(f.getActualProperties)(this.sortSettings),this.treeGrid.dataBind();break;case"timelineSettings":this.timelineModule.refreshTimeline();break;case"rowHeight":case"taskbarHeight":this.treeGrid.rowHeight=this.rowHeight,this.treeGrid.dataBind(),this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines();break;case"timezone":this.dataOperation.checkDataBinding(!0);break;case"enableCriticalPath":if(i.i(r.isNullOrUndefined)(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),this.enableCriticalPath&&this.criticalPathModule){this.criticalPathModule.showCriticalPath(this.enableCriticalPath);var l=this.criticalPathModule;l.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(l.criticalPathCollection,l.detailPredecessorCollection,!0,l.predecessorCollectionTaskIds)}else this.removeCriticalPathStyles();break;case"filterSettings":this.treeGrid.filterSettings=i.i(f.getActualProperties)(this.filterSettings),this.treeGrid.dataBind();break;case"gridLines":this.treeGrid.gridLines=this.gridLines,this.treeGrid.dataBind(),this.renderChartGridLines();break;case"tooltipSettings":this.tooltipModule.toolTipObj&&this.tooltipModule.toolTipObj.destroy(),this.tooltipModule.createTooltip();break;case"splitterSettings":this.splitterModule.updateSplitterPosition();break;case"selectionSettings":this.treeGrid.selectionSettings=i.i(f.getActualProperties)(this.selectionSettings),this.treeGrid.grid.selectionSettings.enableToggle=this.selectionSettings.enableToggle,this.treeGrid.dataBind();break;case"searchSettings":void 0!==e.searchSettings.key&&(this.treeGrid.grid.searchSettings=i.i(f.getActualProperties)(this.searchSettings),this.treeGrid.grid.dataBind()),this.treeGrid.searchSettings=i.i(f.getActualProperties)(this.searchSettings),this.treeGrid.dataBind(),this.toolbarModule&&this.toolbarModule.updateSearchTextBox();break;case"labelSettings":case"renderBaseline":case"baselineColor":this.isFromRenderBaseline=!0,this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isFromRenderBaseline=!1;break;case"resourceIDMapping":case"resourceNameMapping":case"resources":this.dataOperation.reUpdateResources(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"includeWeekend":case"allowUnscheduledTasks":case"holidays":this.isLoad=!0,"holidays"===o&&(this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.notify("ui-update",{module:"day-markers",properties:e})),this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1;break;case"dayWorkingTime":this.isLoad=!0,this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1;break;case"addDialogFields":case"editDialogFields":this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.processDialogFields();break;case"columns":this.treeGridModule.treeGridColumns=[],this.treeGridModule.validateGanttColumns(),this.treeGrid.columns=this.treeGridModule.treeGridColumns,this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline();break;case"width":case"height":this.reUpdateDimention();break;case"editSettings":this.treeGrid.editSettings.allowAdding=this.editSettings.allowAdding,this.treeGrid.editSettings.allowDeleting=this.editSettings.allowDeleting,this.treeGrid.editSettings.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,this.treeGrid.editSettings.allowEditing=this.editSettings.allowEditing,this.treeGrid.editSettings.allowNextRowEdit=this.editSettings.allowNextRowEdit,i.i(r.isNullOrUndefined)(this.editModule)||this.editModule.reUpdateEditModules(),i.i(r.isNullOrUndefined)(this.toolbarModule)||this.toolbarModule.refreshToolbarItems();break;case"connectorLineBackground":case"connectorLineWidth":this.taskFields.dependency&&(this.connectorLineModule.initPublicProp(),this.ganttChartModule.reRenderConnectorLines());break;case"treeColumnIndex":this.treeGrid.treeColumnIndex=this.treeColumnIndex;break;case"projectStartDate":case"projectEndDate":this.timelineModule.isZoomToFit=!1,this.dataOperation.calculateProjectDates(),this.updateProjectDates(this.cloneProjectStartDate,this.cloneProjectEndDate,this.isTimelineRoundOff);break;case"selectedRowIndex":i.i(r.isNullOrUndefined)(this.selectionModule)||this.selectionModule.selectRowByIndex();break;case"dataSource":if(this.closeGanttActions(),this.dataSource instanceof Object&&i.i(w.i)(this)){this.treeGrid.hasChildMapping="isParent";var d=i.i(r.getValue)("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:d}}else this.treeGrid.hasChildMapping=null;this.dataOperation.checkDataBinding(!0);break;case"enableContextMenu":case"contextMenuItems":this.enableContextMenu||"contextMenuItems"===o?this.notify("reRender-contextMenu",{module:"contextMenu",enable:this.contextMenuItems}):this.treeGrid.contextMenuItems=[],this.treeGrid.dataBind();break;case"currencyCode":case"locale":case"enableRtl":case"readOnly":case"viewType":case"taskFields":case"allowTaskbarDragAndDrop":case"allowTaskbarOverlap":case"allowParentDependency":if("locale"===o&&(this.isLocaleChanged=!0),"taskFields"===o&&!i.i(r.isNullOrUndefined)(e.taskFields.child))return;"allowTaskbarDragAndDrop"!==o&&(n=!0);break;case"validateManualTasksOnLinking":this.validateManualTasksOnLinking=e.validateManualTasksOnLinking;break;case"showOverAllocation":this.updateOverAllocationCotainer()}}n&&(this.isLoad&&this.contentMaskTable&&(this.contentMaskTable=null),this.refresh())},t.prototype.updateOverAllocationCotainer=function(){if(this.showOverAllocation&&"ResourceView"===this.viewType)this.ganttChartModule.renderOverAllocationContainer();else{var e=this.element.querySelector("."+c._18);e&&(e.innerHTML="")}},t.prototype.getPersistData=function(){for(var e=["sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","currentZoomingLevel","cloneProjectStartDate","cloneProjectEndDate"],t={filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[]},n=["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],a=0;a<e.length;a++)for(var s=this[e[a]],o=0,l=t[e[a]];!i.i(r.isNullOrUndefined)(l)&&o<l.length;o++){var d=l[o];delete s[d]}return this.ignoreInArrays(n,this.columns),this.addOnPersist(e)},t.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)this.ignoreInColumn(e,t[i])},t.prototype.ignoreInColumn=function(e,t){for(var i=0;i<e.length;i++)delete t[e[i]],t.filter={}},t.prototype.destroy=function(){this.notify("destroy",{}),i.i(r.isNullOrUndefined)(this.validationDialogElement)||this.validationDialogElement.isDestroyed||this.validationDialogElement.destroy();for(var t=["ganttChartModule","timelineModule","chartRowsModule","treeGridModule","ganttDataUpdatesModule","dateValidationModule","tooltipModule"],n=0;n<t.length;n++)this[t[n]]&&(this[t[n]]=null);this.keyboardModule&&this.keyboardModule.destroy(),this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.destroy(),e.prototype.destroy.call(this),this.chartVerticalLineContainer=null,this.element.innerHTML="",i.i(r.removeClass)([this.element],c._11),this.element.innerHTML="",this.isTreeGridRendered=!1,this.resetTemplates(),r.EventHandler.remove(window,"resize",this.windowResize)},t.prototype.getTaskbarHeight=function(){return this.chartRowsModule.taskBarHeight},t.prototype.requiredModules=function(){var e=[];return this.isDestroyed?e:(this.allowSorting&&e.push({member:"sort",args:[this]}),(this.allowFiltering||this.toolbar&&-1!==this.toolbar.indexOf("Search"))&&e.push({member:"filter",args:[this]}),this.allowReordering&&e.push({member:"reorder",args:[this]}),this.allowExcelExport&&e.push({member:"excelExport",args:[this]}),(this.allowRowDragAndDrop||this.allowTaskbarDragAndDrop)&&e.push({member:"rowDragAndDrop",args:[this]}),this.enableCriticalPath&&e.push({member:"criticalPath",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),this.toolbar&&this.toolbar.length>0&&e.push({member:"toolbar",args:[this]}),(this.editSettings.allowAdding||this.editSettings.allowEditing||this.editSettings.allowDeleting||this.editSettings.allowTaskbarEditing||this.allowRowDragAndDrop)&&e.push({member:"edit",args:[this]}),this.allowSelection&&e.push({member:"selection",args:[this]}),this.tooltipSettings.showTooltip&&e.push({member:"tooltip",args:[this]}),(this.highlightWeekends||this.holidays&&this.holidays.length>0||this.eventMarkers&&this.eventMarkers.length>0)&&e.push({member:"dayMarkers",args:[this]}),this.enableContextMenu&&e.push({member:"contextMenu",args:[this]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this]}),this.allowPdfExport&&e.push({member:"pdfExport",args:[this]}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this]}),e)},t.prototype.sortColumn=function(e,t,i){this.sortModule&&this.allowSorting&&this.sortModule.sortColumn(e,t,i)},t.prototype.mergePersistGanttData=function(){this.treeGrid||(this.treeGrid=new g.TreeGrid);this.treeGrid.grid.mergePersistGridData.apply(this)},t.prototype.mergeColumns=function(e,t){this.treeGrid.grid.mergeColumns.apply(this,[e,t])},t.prototype.clearSorting=function(){this.sortModule.clearSorting()},t.prototype.renderChartGridLines=function(){var e="e-chart-row-border",t=this.chartVerticalLineContainer,n=document.getElementById(this.element.id+"GanttTaskTableBody").querySelectorAll("td");if("Vertical"===this.gridLines){if(i.i(r.isNullOrUndefined)(t)?this.renderChartVerticalLines():"none"===t.style.display&&(t.style.display="block"),n[0].classList.contains(e))for(var a=0;a<n.length;a++)i.i(r.removeClass)([n[a]],e)}else if("Horizontal"===this.gridLines){if(i.i(r.isNullOrUndefined)(t)||(t.style.display="none"),!n[0].classList.contains(e))for(var a=0;a<n.length;a++)i.i(r.addClass)([n[a]],e)}else if("Both"===this.gridLines){if(i.i(r.isNullOrUndefined)(t)?this.renderChartVerticalLines():"none"===t.style.display&&(t.style.display="block"),!n[0].classList.contains(e))for(var a=0;a<n.length;a++)i.i(r.addClass)([n[a]],e)}else if("None"===this.gridLines&&(i.i(r.isNullOrUndefined)(t)||"none"===t.style.display||(t.style.display="none"),n[0].classList.contains(e)))for(var a=0;a<n.length;a++)i.i(r.removeClass)([n[a]],e)},t.prototype.updateGridLineContainerHeight=function(){this.chartVerticalLineContainer&&(this.chartVerticalLineContainer.style.height=i.i(r.formatUnit)(this.getContentHeight()))},t.prototype.getContentHeight=function(){var e=this.ganttChartModule.scrollElement.offsetHeight-16,t=this.ganttChartModule.chartBodyContent.offsetHeight;return t<e?t:e},t.prototype.reUpdateDimention=function(){var e=0;if(this.calculateDimensions(),i.i(r.isNullOrUndefined)(this.toolbarModule)||i.i(r.isNullOrUndefined)(this.toolbarModule.element)||(this.toolbarModule.toolbar.refresh(),this.toolbarModule.refreshToolbarItems(),e=this.toolbarModule.element.offsetHeight),this.treeGrid.height=this.ganttHeight-e-this.treeGrid.grid.getHeaderContent().offsetHeight,this.splitterModule.splitterObject.height=(this.ganttHeight-e).toString(),i.i(r.isNullOrUndefined)(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer.style.height=this.ganttHeight+"px"),!i.i(r.isNullOrUndefined)(this.dayMarkersModule)){var t=i.i(r.getValue)("nonworkingDayRender.holidayContainer",this.dayMarkersModule),n=i.i(r.getValue)("nonworkingDayRender.weekendContainer",this.dayMarkersModule),a=i.i(r.getValue)("eventMarkerRender.eventMarkersContainer",this.dayMarkersModule);t&&(t.style.height=this.ganttHeight+"px"),n&&(n.style.height=this.ganttHeight+"px"),a&&(a.style.height=this.ganttHeight+"px")}this.splitterModule.splitterObject.width=this.ganttWidth.toString(),this.ganttChartModule.scrollObject.setHeight(this.ganttHeight-this.ganttChartModule.chartTimelineContainer.offsetHeight-e)},t.prototype.renderChartVerticalLines=function(){this.element.contains(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer=i.i(r.createElement)("div",{id:this.element.id+"line-container",styles:"position:absolute;height:100%;"}),this.ganttChartModule.chartBodyContent.insertBefore(this.chartVerticalLineContainer,this.ganttChartModule.chartBodyContent.lastChild)),this.chartVerticalLineContainer.innerHTML="";var e=this.element.getElementsByClassName("e-timeline-header-table-container")[1];i.i(r.isNullOrUndefined)(e)&&(e=this.element.getElementsByClassName("e-timeline-header-table-container")[0]);for(var t,n=e.getElementsByTagName("th"),a=n.length,s=0,o=i.i(r.createElement)("div"),l=0;l<a;l++){s=0===l?-1:s+parseFloat(t),t=n[l].style.width;var d=i.i(r.createElement)("div",{className:"e-line-container-cell",styles:(this.enableRtl?"right:"+(s+1):"left:"+s)+"px"});o.appendChild(d)}this.chartVerticalLineContainer.innerHTML=o.innerHTML},t.prototype.getDefaultLocale=function(){return{emptyRecord:"No records to display",id:"ID",name:"Name",startDate:"Start Date",endDate:"End Date",duration:"Duration",progress:"Progress",dependency:"Dependency",notes:"Notes",criticalPath:"Critical Path",baselineStartDate:"Baseline Start Date",baselineEndDate:"Baseline End Date",taskMode:"Task Mode",changeScheduleMode:"Change Schedule Mode",subTasksStartDate:"SubTasks Start Date",subTasksEndDate:"SubTasks End Date",scheduleStartDate:"Schedule Start Date",scheduleEndDate:"Schedule End Date",auto:"Auto",manual:"Manual",type:"Type",offset:"Offset",resourceName:"Resources",resourceID:"Resource ID",day:"day",hour:"hour",minute:"minute",days:"days",hours:"hours",minutes:"minutes",generalTab:"General",customTab:"Custom Columns",writeNotes:"Write Notes",addDialogTitle:"New Task",editDialogTitle:"Task Information",add:"Add",edit:"Edit",update:"Update",delete:"Delete",cancel:"Cancel",search:"Search",task:" task",tasks:" tasks",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomToFit:"Zoom to fit",excelExport:"Excel export",csvExport:"CSV export",pdfExport:"Pdf export",expandAll:"Expand all",collapseAll:"Collapse all",nextTimeSpan:"Next timespan",prevTimeSpan:"Previous timespan",saveButton:"Save",taskBeforePredecessorFS:'You moved "{0}" to start before "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorFS:'You moved "{0}" away from "{1}" and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorSS:'You moved "{0}" to start before "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorSS:'You moved "{0}" to start after "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorFF:'You moved "{0}" to finish before "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorFF:'You moved "{0}" to finish after "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorSF:'You moved "{0}" away from "{1}" to starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorSF:'You moved "{0}" to finish after "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',okText:"Ok",confirmDelete:"Are you sure you want to Delete Record?",from:"From",to:"To",taskLink:"Task Link",lag:"Lag",start:"Start",finish:"Finish",enterValue:"Enter the value",taskInformation:"Task Information",deleteTask:"Delete Task",deleteDependency:"Delete Dependency",convert:"Convert",save:"Save",above:"Above",below:"Below",child:"Child",milestone:"Milestone",toTask:"To Task",toMilestone:"To Milestone",eventMarkers:"Event markers",leftTaskLabel:"Left task label",rightTaskLabel:"Right task label",timelineCell:"Timeline cell",confirmPredecessorDelete:"Are you sure you want to remove dependency link?",unit:"Unit",work:"Work",taskType:"Task Type",unassignedTask:"Unassigned Task",group:"Group",indent:"Indent",outdent:"Outdent",segments:"Segments",splitTask:"Split Task",mergeTask:"Merge Task",left:"Left",right:"Right"}},t.prototype.removeSortColumn=function(e){this.sortModule.removeSortColumn(e)},t.prototype.actionBeginTask=function(e){this.trigger("actionBegin",e),i.i(r.isNullOrUndefined)(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow()},t.prototype.scrollToDate=function(e){var t=this.dateValidationModule.getDateFromFormat(e),i=this.dataOperation.getTaskLeft(t,!1);this.ganttChartModule.updateScrollLeft(i)},t.prototype.scrollToTask=function(e){if(-1!==this.ids.indexOf(e)){var t=this.flatData[this.ids.indexOf(e)].ganttProperties.left;this.ganttChartModule.updateScrollLeft(t)}},t.prototype.updateChartScrollOffset=function(e,t){i.i(r.isNullOrUndefined)(e)||(e=this.ganttChartModule.scrollElement.scrollWidth<=e?this.ganttChartModule.scrollElement.scrollWidth:e,this.ganttChartModule.scrollObject.setScrollLeft(e,this.enableRtl?-1:0)),i.i(r.isNullOrUndefined)(t)||(t=this.ganttChartModule.scrollElement.scrollHeight<=t?this.ganttChartModule.scrollElement.scrollHeight:t,this.ganttChartModule.scrollObject.setScrollTop(t))},t.prototype.getParentTask=function(e){if(i.i(r.isNullOrUndefined)(e))return null;var t=this.flatData.filter(function(t){return e.uniqueID===t.uniqueID});return t.length>0?t[0]:null},t.prototype.getRootParent=function(e,t){return e.level===t?e:this.getRootParent(this.getParentTask(e.parentItem),t)},t.prototype.filterByColumn=function(e,t,i,r,n,a){this.treeGrid.filterByColumn(e,t,i,r,n,a)},t.prototype.excelExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.excelExport(e,t,i,r):null},t.prototype.csvExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.csvExport(e,t,i,r):null},t.prototype.pdfExport=function(e,t,i,r){return e&&e.fitToWidthSettings&&e.fitToWidthSettings.isFitToWidth&&e.pageOrientation,this.pdfExportModule?this.pdfExportModule.export(e,t,i,r):null},t.prototype.clearFiltering=function(e){this.treeGrid.grid.clearFiltering(e)},t.prototype.removeFilteredColsByField=function(e){this.treeGrid.removeFilteredColsByField(e,!1)},t.prototype.renderWorkingDayCell=function(e){var t="Auto"!==this.taskMode||!(!this.includeWeekend&&this.autoCalculateDateScheduling),i=t?[]:this.nonWorkingDayIndex,r=this.totalHolidayDates;if(i.length>0&&-1!==i.indexOf(e.date.getDay()))e.isDisabled=!0;else if(r.length>0){var n=new Date(e.date.getTime());n.setHours(0,0,0),-1!==r.indexOf(n.getTime())&&(this.autoCalculateDateScheduling?e.isDisabled=!0:e.isDisabled=!1)}},t.prototype.previousTimeSpan=function(e){this.timelineModule.performTimeSpanAction("prevTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},t.prototype.nextTimeSpan=function(e){this.timelineModule.performTimeSpanAction("nextTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},t.prototype.updateProjectDates=function(e,t,n,a){this.timelineModule.totalTimelineWidth=0,this.cloneProjectStartDate=e,this.cloneProjectEndDate=t,this.isTimelineRoundOff=n,this.timelineModule.refreshTimelineByTimeSpan(),this.dataOperation.reUpdateGanttDataPosition(),(!this.pdfExportModule||this.pdfExportModule&&!this.pdfExportModule.isPdfExport||this.pdfExportModule&&this.pdfExportModule.isPdfExport&&this.pdfExportModule.helper.exportProps&&this.pdfExportModule.helper.exportProps.fitToWidthSettings&&!this.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(this.timelineModule.updateChartByNewTimeline(),this.ganttChartModule.chartBodyContent.style.width=i.i(r.formatUnit)(this.timelineModule.totalTimelineWidth),this.ganttChartModule.updateLastRowBottomWidth(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines(),"beforeAdd"!==a&&this.notify("selectRowByIndex",{}))},t.prototype.splitTask=function(e,t){this.isEdit=!0,this.chartRowsModule.splitTask(e,t)},t.prototype.mergeTask=function(e,t){this.chartRowsModule.mergeTask(e,t)},t.prototype.reorderColumns=function(e,t){this.treeGrid.reorderColumns(e,t)},t.prototype.initiateEditAction=function(e){this.isOnEdit=e,this.previousRecords={},this.editedRecords=[]},t.prototype.setRecordValue=function(e,t,n,a){if(t=i.i(r.isUndefined)(t)?null:t,this.isOnEdit||this.isOnDelete){this.makeCloneData(e,n,a);var s=a?n:n.ganttProperties,o=s.rowUniqueID,l=this.getRecordByID(o),d=!1;(i.i(r.isNullOrUndefined)(t)||!i.i(r.isNullOrUndefined)(t)&&!i.i(r.isNullOrUndefined)(n[""+e])&&(t instanceof Date?t.getTime()!==n[""+e].getTime():n[""+e]!==t))&&(d=!0),l&&(-1===this.editedRecords.indexOf(l)&&d||0===this.editedRecords.length)&&(this.editModule.draggedRecord&&this.editModule.draggedRecord.ganttProperties.taskId===s.taskId?this.editedRecords.splice(0,0,l):this.editedRecords.push(l),this.enableImmutableMode&&this.modifiedRecords.push(l))}i.i(r.setValue)(e,t,n)},t.prototype.makeCloneData=function(e,t,n){var a,s,o,l=i.i(r.getValue)(e,t);if(n&&(e="ganttProperties."+e),i.i(r.isNullOrUndefined)(this.previousRecords[t.uniqueID])){var d={};this.previousRecords[t.uniqueID]=d}a=this.previousRecords[t.uniqueID],s=i.i(r.getValue)(e,a),i.i(r.isUndefined)(s)&&(o=l instanceof Date?new Date(l.getTime()):i.i(r.isObjectArray)(l)?i.i(r.extend)([],l,[],!0):i.i(r.isObject)(l)?i.i(r.extend)({},{},l,!0):l,i.i(r.isUndefined)(o)?i.i(r.setValue)(e,null,a):i.i(r.setValue)(e,o,a))},t.prototype.closeGanttActions=function(){this.editModule&&(this.editModule.cellEditModule&&this.editModule.cellEditModule.isCellEdit?(this.treeGrid.closeEdit(),this.editModule.cellEditModule.isCellEdit=!1,i.i(r.isNullOrUndefined)(this.toolbarModule)||this.toolbarModule.refreshToolbarItems()):this.editModule.dialogModule&&this.editModule.dialogModule.dialogObj&&this.editModule.dialogModule.dialogObj.visible&&(this.editModule.dialogModule.dialogObj.hide(),this.editModule.dialogModule.dialogClose()))},t.prototype.getTaskByUniqueID=function(e){var t=this.flatData.filter(function(t){return t.uniqueID===e});return t.length>0?t[0]:null},t.prototype.getRecordByID=function(e){return i.i(r.isNullOrUndefined)(e)?null:this.flatData[this.ids.indexOf(e.toString())]},t.prototype.setSplitterPosition=function(e,t){var i={};i[t]=e;var r=this.splitterModule.calculateSplitterPosition(i),n=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[0],a=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[1];this.splitterModule.splitterPreviousPositionGrid=n.scrollWidth+1+"px",this.splitterModule.splitterPreviousPositionChart=a.scrollWidth+1+"px",this.splitterModule.splitterObject.paneSettings[0].size=r,this.splitterModule.triggerCustomResizedEvent()},t.prototype.expandByIndex=function(e){if("number"==typeof e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)}else for(var i=0;i<e.length;i++)if("number"==typeof e[i]){var r=e[i],t=this.contructExpandCollapseArgs(null,r);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)}},t.prototype.expandByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)},t.prototype.collapseByIndex=function(e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},t.prototype.collapseByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},t.prototype.addRecord=function(e,t,n){if(this.editModule&&this.editSettings.allowAdding)if("ResourceView"===this.viewType){this.editModule.addRowPosition=t,this.editModule.addRowIndex=n;var a=void 0;i.i(r.isNullOrUndefined)(e)||(a=e[this.taskFields.resourceInfo]);var s=void 0,o=void 0;if(!i.i(r.isNullOrUndefined)(a)&&a.length){for(var l=0;l<a.length&&(s="object"==typeof a[l]?a[l][this.resourceFields.id]:a[0],!(o=this.flatData[this.getTaskIds().indexOf("R"+s)]));l++);if(o&&o.childRecords.length||0===o.level){var d=o.childRecords[n];if(d){var h="Above"===t||"Below"===t?t:"Child";"Child"===h?this.editModule.addRecord(e,h,this.getTaskIds().indexOf("R"+s)):this.editModule.addRecord(e,h,this.flatData.indexOf(d))}else this.editModule.addRecord(e,"Child",this.getTaskIds().indexOf("R"+s))}else this.editModule.addRecord(e,"Bottom")}else this.editModule.addRecord(e,"Bottom");this.editModule.addRowPosition=null,this.editModule.addRowIndex=null}else this.editModule.addRecord(e,t,n),"Bottom"===t&&(this.selectedRowIndex=n),"Above"!==t&&"Below"!==t&&"Child"!==t||(this.currentSelection=i.i(r.isNullOrUndefined)(e)?this.currentSelection:e)},t.prototype.updateRecordByID=function(e){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateRecordByID(e)},t.prototype.updateTaskId=function(e,t){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateTaskId(e,t)},t.prototype.expandAtLevel=function(e){this.enableVirtualization&&(this.isExpandCollapseLevelMethod=!0),this.ganttChartModule.expandAtLevel(e)},t.prototype.indent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.indent()},t.prototype.outdent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.outdent()},t.prototype.showCriticalPath=function(e){if(this.criticalPathModule){this.criticalPathModule.showCriticalPath(e);var t=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(t.criticalPathCollection,t.detailPredecessorCollection,!0,t.predecessorCollectionTaskIds)}},t.prototype.getCriticalTasks=function(){return!i.i(r.isNullOrUndefined)(this.criticalPathModule)&&this.enableCriticalPath?this.criticalPathModule.getCriticalTasks():null},t.prototype.zoomIn=function(){this.timelineModule.processZooming(!0)},t.prototype.zoomOut=function(){this.timelineModule.processZooming(!1)},t.prototype.fitToProject=function(){this.timelineModule.processZoomToFit(),this.ganttChartModule.updateScrollLeft(0)},t.prototype.reorderRows=function(e,t,i){this.rowDragAndDropModule.reorderRows(e,t,i)},t.prototype.updateRecordByIndex=function(e,t){if(this.editModule&&this.editSettings.allowEditing){var n=this.taskFields,a=this.updatedRecords.length>0?i.i(r.isNullOrUndefined)(this.updatedRecords[e])?null:this.updatedRecords[e]:null;i.i(r.isNullOrUndefined)(a)||(t[n.id]=a[n.id],this.editModule.updateRecordByID(t))}},t.prototype.addPredecessor=function(e,t){var n=this.getRecordByID(e.toString());this.editModule&&!i.i(r.isNullOrUndefined)(n)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.addPredecessor(n,t)},t.prototype.removePredecessor=function(e){var t=this.getRecordByID(e.toString());this.editModule&&!i.i(r.isNullOrUndefined)(t)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.removePredecessor(t)},t.prototype.updatePredecessor=function(e,t){var n=this.getRecordByID(e.toString());this.editModule&&!i.i(r.isNullOrUndefined)(n)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.updatePredecessor(n,t)},t.prototype.openAddDialog=function(){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowAdding&&this.editModule.dialogModule.openAddDialog()},t.prototype.openEditDialog=function(e){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowEditing&&this.editModule.dialogModule.openEditDialog(e)},t.prototype.contructExpandCollapseArgs=function(e,t){var n,a,s;return i.i(r.isNullOrUndefined)(t)?(a=this.getRecordByID(e.toString()),n=this.getRowByID(e),i.i(r.isNullOrUndefined)(n)||(s=i.i(r.getValue)("rowIndex",n))):i.i(r.isNullOrUndefined)(t)||(n=this.getRowByIndex(t),s=i.i(r.getValue)("rowIndex",n),a=this.currentViewData[s]),{data:a,gridRow:this.treeGrid.getRows()[s],chartRow:n,cancel:!1}},t.prototype.getRowByIndex=function(e){try{var t=this.element.querySelectorAll(".e-chart-row");return i.i(r.isNullOrUndefined)(e)?null:t[e]}catch(e){return null}},t.prototype.getRowByID=function(e){var t,i=this,r=this.getRecordByID(e.toString());return t=!this.loadChildOnDemand&&this.taskFields.hasChildMapping?this.updatedRecords.map(function(e){return e[i.taskFields.id]}).indexOf(r.ganttProperties.taskId):this.updatedRecords.indexOf(r),-1!==t?this.getRowByIndex(t):null},t.prototype.getUnscheduledTaskClass=function(e){return i.i(r.isNullOrUndefined)(e.startDate)&&i.i(r.isNullOrUndefined)(e.endDate)&&i.i(r.isNullOrUndefined)(e.duration)?" "+c._19:i.i(r.isNullOrUndefined)(e.startDate)||i.i(r.isNullOrUndefined)(e.endDate)||i.i(r.isNullOrUndefined)(e.duration)?" "+c._19:""},t.prototype.isUnscheduledTask=function(e){return!!(i.i(r.isNullOrUndefined)(e.startDate)||i.i(r.isNullOrUndefined)(e.endDate)||i.i(r.isNullOrUndefined)(e.duration))},t.prototype.createGanttPopUpElement=function(){var e=this.createElement("div",{className:"e-ganttpopup",styles:"display:none;"}),t=this.createElement("div",{className:"e-content",attrs:{tabIndex:"-1"}});i.i(r.append)([t,this.createElement("div",{className:"e-uptail e-tail"})],e),t.appendChild(this.createElement("span")),i.i(r.append)([t,this.createElement("div",{className:"e-downtail e-tail"})],e),document.getElementById(this.element.id+"GanttChart").appendChild(e)},t.prototype.getPredecessorTextValue=function(e){var t;switch(e){case"SS":t=this.localeObj.getConstant("start")+"-"+this.localeObj.getConstant("start");break;case"FF":t=this.localeObj.getConstant("finish")+"-"+this.localeObj.getConstant("finish");break;case"SF":t=this.localeObj.getConstant("start")+"-"+this.localeObj.getConstant("finish");break;case"FS":t=this.localeObj.getConstant("finish")+"-"+this.localeObj.getConstant("start")}return t},t.prototype.search=function(e){this.filterModule&&(this.searchSettings.key=e,this.dataBind())},t.prototype.getOffsetRect=function(e){var t=e.getBoundingClientRect(),i=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,r=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.clientTop||document.body.clientTop||0,a=document.documentElement.clientLeft||document.body.clientLeft||0,s=t.top+i-n,o=this.enableRtl?t.right+r-a:t.left+r-a;return{top:Math.round(s),left:Math.round(o),width:t.width,height:t.height}},t.prototype.expandAll=function(){this.ganttChartModule.expandCollapseAll("expand")},t.prototype.updateDataSource=function(e,t){if(this.isDynamicData=!0,!i.i(r.isNullOrUndefined)(t))for(var n=0,a=Object.keys(t);n<a.length;n++){var s=a[n];switch(s){case"projectStartDate":this.setProperties({projectStartDate:t[s]},!0);break;case"projectEndDate":this.setProperties({projectEndDate:t[s]},!0)}}this.dataSource=e},t.prototype.collapseAll=function(){this.ganttChartModule.expandCollapseAll("collapse")},t.prototype.getGridColumns=function(){return this.treeGrid.getColumns()},t.prototype.getColumnByField=function(e,t){var i=t.filter(function(t){return t.field===e});return i.length>0?i[0]:null},t.prototype.getGanttColumns=function(){return this.ganttColumns},t.prototype.showColumn=function(e,t){this.treeGrid.showColumns(e,t),this.updateTreeColumns()},t.prototype.hideColumn=function(e,t){this.treeGrid.hideColumns(e,t),this.updateTreeColumns()},t.prototype.setScrollTop=function(e){this.ganttChartModule.scrollObject.setScrollTop(e)},t.prototype.cancelEdit=function(){this.isCancelled=!0,this.closeGanttActions()},t.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},t.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},t.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},t.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},t.prototype.deleteRecord=function(e){this.editModule&&this.editModule.deleteRecord(e)},t.prototype.enableItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},t.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},t.prototype.updateDataArgs=function(e){if(!Array.isArray(e.data)){var t=[];t.push(e.data),i.i(r.setValue)("data",t,e)}return e},t.prototype.convertToMilestone=function(e){var t=this.getRecordByID(e);if(!i.i(r.isNullOrUndefined)(t)){var n=i.i(r.extend)({},{},t.taskData,!0),a=this.taskFields;if(n[a.startDate]&&this.setRecordValue(a.startDate,t.ganttProperties.startDate,n,!0),i.i(r.isNullOrUndefined)(a.duration)?(n[a.startDate]=new Date(t.ganttProperties.startDate),n[a.endDate]=new Date(t.ganttProperties.endDate)):n[a.duration]=0,i.i(r.isNullOrUndefined)(a.milestone)||!1===n[a.milestone]&&(n[a.milestone]=!0),i.i(r.isNullOrUndefined)(a.progress)||(n[a.progress]=0),!i.i(r.isNullOrUndefined)(a.child)&&n[a.child]&&(n[a.child]=[]),!i.i(r.isNullOrUndefined)(a.parentID)&&n[a.parentID]&&(n[a.parentID]=null),i.i(r.isNullOrUndefined)(a.segments)||(n[a.segments]=null),!i.i(r.isNullOrUndefined)(this.contextMenuModule)&&this.contextMenuModule.isOpen&&"Milestone"===this.contextMenuModule.item){i.i(r.isNullOrUndefined)(a.dependency)||(n[a.dependency]=null);var s=this.editSettings.newRowPosition;this.addRecord(n,s,this.selectedRowIndex)}else t.hasChildRecords||t.ganttProperties.isMilestone||this.updateRecordByID(n)}},t.prototype.changeTaskMode=function(e){var t=this.taskFields,n=this.getRecordByID(e[t.id]),a=n.ganttProperties;this.isOnEdit=!0,this.setRecordValue("isAutoSchedule",!a.isAutoSchedule,a,!0),i.i(r.isNullOrUndefined)(this.taskFields.manual)||(this.setRecordValue("taskData."+t.manual,!a.isAutoSchedule,n),this.setRecordValue(t.manual,!a.isAutoSchedule,n)),this.editModule.updateTaskScheduleModes(n);var s={data:n};this.editModule.initiateUpdateAction(s)},t.prototype.getTaskIds=function(){return this.taskIds},t.prototype.setTaskIds=function(e){if("ProjectView"!==this.viewType){var t=e.ganttProperties.taskId;t=0===e.level?"R"+t:"T"+t,this.taskIds.push(t)}},t.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},t.prototype.resetTemplates=function(){this.isReact&&this.clearTemplate()},b([i.i(r.Property)(!0)],t.prototype,"allowKeyboard",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableImmutableMode",void 0),b([i.i(r.Property)(!0)],t.prototype,"allowParentDependency",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableHtmlSanitizer",void 0),b([i.i(r.Property)(!0)],t.prototype,"disableHtmlEncode",void 0),b([i.i(r.Complex)({},d.t)],t.prototype,"loadingIndicator",void 0),b([i.i(r.Property)(!0)],t.prototype,"enableVirtualMaskRow",void 0),b([i.i(r.Property)(!1)],t.prototype,"loadChildOnDemand",void 0),b([i.i(r.Property)(!0)],t.prototype,"UpdateOffsetOnTaskbarEdit",void 0),b([i.i(r.Property)(!0)],t.prototype,"autoCalculateDateScheduling",void 0),b([i.i(r.Property)(!0)],t.prototype,"autoFocusTasks",void 0),b([i.i(r.Property)(!0)],t.prototype,"allowSelection",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowSorting",void 0),b([i.i(r.Property)(!0)],t.prototype,"enablePredecessorValidation",void 0),b([i.i(r.Property)(!1)],t.prototype,"showColumnMenu",void 0),b([i.i(r.Property)()],t.prototype,"columnMenuItems",void 0),b([i.i(r.Property)()],t.prototype,"timezone",void 0),b([i.i(r.Property)(!1)],t.prototype,"collapseAllParentTasks",void 0),b([i.i(r.Property)(!1)],t.prototype,"highlightWeekends",void 0),b([i.i(r.Property)(0)],t.prototype,"treeColumnIndex",void 0),b([i.i(r.Property)([])],t.prototype,"dataSource",void 0),b([i.i(r.Property)("day")],t.prototype,"durationUnit",void 0),b([i.i(r.Property)(null)],t.prototype,"query",void 0),b([i.i(r.Property)(null)],t.prototype,"dateFormat",void 0),b([i.i(r.Property)("auto")],t.prototype,"height",void 0),b([i.i(r.Property)(!1)],t.prototype,"renderBaseline",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowTaskbarDragAndDrop",void 0),b([i.i(r.Property)(!0)],t.prototype,"allowTaskbarOverlap",void 0),b([i.i(r.Property)("Horizontal")],t.prototype,"gridLines",void 0),b([i.i(r.Complex)({},d.j)],t.prototype,"labelSettings",void 0),b([i.i(r.Property)(null)],t.prototype,"taskbarTemplate",void 0),b([i.i(r.Property)(null)],t.prototype,"parentTaskbarTemplate",void 0),b([i.i(r.Property)(null)],t.prototype,"milestoneTemplate",void 0),b([i.i(r.Property)()],t.prototype,"baselineColor",void 0),b([i.i(r.Property)("auto")],t.prototype,"width",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableVirtualization",void 0),b([i.i(r.Property)()],t.prototype,"toolbar",void 0),b([i.i(r.Property)(["Monday","Tuesday","Wednesday","Thursday","Friday"])],t.prototype,"workWeek",void 0),b([i.i(r.Property)(!1)],t.prototype,"includeWeekend",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowUnscheduledTasks",void 0),b([i.i(r.Property)(!1)],t.prototype,"showInlineNotes",void 0),b([i.i(r.Property)(36)],t.prototype,"rowHeight",void 0),b([i.i(r.Property)(null)],t.prototype,"taskbarHeight",void 0),b([i.i(r.Property)(null)],t.prototype,"projectStartDate",void 0),b([i.i(r.Property)(null)],t.prototype,"projectEndDate",void 0),b([i.i(r.Property)(null)],t.prototype,"resourceIDMapping",void 0),b([i.i(r.Property)(null)],t.prototype,"resourceNameMapping",void 0),b([i.i(r.Property)([])],t.prototype,"resources",void 0),b([i.i(r.Property)([])],t.prototype,"segmentData",void 0),b([i.i(r.Property)(null)],t.prototype,"connectorLineBackground",void 0),b([i.i(r.Property)(1)],t.prototype,"connectorLineWidth",void 0),b([i.i(r.Property)([])],t.prototype,"columns",void 0),b([i.i(r.Property)([])],t.prototype,"addDialogFields",void 0),b([i.i(r.Property)([])],t.prototype,"editDialogFields",void 0),b([i.i(r.Property)(-1)],t.prototype,"selectedRowIndex",void 0),b([i.i(r.Property)("hour")],t.prototype,"workUnit",void 0),b([i.i(r.Property)("FixedUnit")],t.prototype,"taskType",void 0),b([i.i(r.Property)("ProjectView")],t.prototype,"viewType",void 0),b([i.i(r.Collection)([{from:8,to:12},{from:13,to:17}],d.b)],t.prototype,"dayWorkingTime",void 0),b([i.i(r.Collection)([],d.i)],t.prototype,"holidays",void 0),b([i.i(r.Collection)([],d.f)],t.prototype,"eventMarkers",void 0),b([i.i(r.Complex)({},d.m)],t.prototype,"taskFields",void 0),b([i.i(r.Complex)({},d.s)],t.prototype,"resourceFields",void 0),b([i.i(r.Complex)({},d.o)],t.prototype,"timelineSettings",void 0),b([i.i(r.Property)([])],t.prototype,"zoomingLevels",void 0),b([i.i(r.Complex)({},d.r)],t.prototype,"sortSettings",void 0),b([i.i(r.Complex)({},d.e)],t.prototype,"editSettings",void 0),b([i.i(r.Complex)({},d.p)],t.prototype,"tooltipSettings",void 0),b([i.i(r.Complex)({},d.k)],t.prototype,"selectionSettings",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowFiltering",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowExcelExport",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowRowDragAndDrop",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowReordering",void 0),b([i.i(r.Property)(!1)],t.prototype,"readOnly",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowResizing",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableContextMenu",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableCriticalPath",void 0),b([i.i(r.Property)()],t.prototype,"contextMenuItems",void 0),b([i.i(r.Property)(!1)],t.prototype,"allowPdfExport",void 0),b([i.i(r.Property)(!1)],t.prototype,"validateManualTasksOnLinking",void 0),b([i.i(r.Property)(!1)],t.prototype,"enableMultiTaskbar",void 0),b([i.i(r.Property)(!1)],t.prototype,"showOverAllocation",void 0),b([i.i(r.Property)("Auto")],t.prototype,"taskMode",void 0),b([i.i(r.Complex)({},d.g)],t.prototype,"filterSettings",void 0),b([i.i(r.Complex)({},d.h)],t.prototype,"searchSettings",void 0),b([i.i(r.Complex)({},d.l)],t.prototype,"splitterSettings",void 0),b([i.i(r.Event)()],t.prototype,"queryTaskbarInfo",void 0),b([i.i(r.Event)()],t.prototype,"beforeExcelExport",void 0),b([i.i(r.Event)()],t.prototype,"excelExportComplete",void 0),b([i.i(r.Event)()],t.prototype,"excelQueryCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"excelHeaderQueryCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"rowDrag",void 0),b([i.i(r.Event)()],t.prototype,"rowDragStart",void 0),b([i.i(r.Event)()],t.prototype,"rowDragStartHelper",void 0),b([i.i(r.Event)()],t.prototype,"rowDrop",void 0),b([i.i(r.Event)()],t.prototype,"collapsing",void 0),b([i.i(r.Event)()],t.prototype,"collapsed",void 0),b([i.i(r.Event)()],t.prototype,"expanding",void 0),b([i.i(r.Event)()],t.prototype,"expanded",void 0),b([i.i(r.Event)()],t.prototype,"actionBegin",void 0),b([i.i(r.Event)()],t.prototype,"actionComplete",void 0),b([i.i(r.Event)()],t.prototype,"actionFailure",void 0),b([i.i(r.Event)()],t.prototype,"dataStateChange",void 0),b([i.i(r.Event)()],t.prototype,"taskbarEdited",void 0),b([i.i(r.Event)()],t.prototype,"endEdit",void 0),b([i.i(r.Event)()],t.prototype,"cellEdit",void 0),b([i.i(r.Event)()],t.prototype,"load",void 0),b([i.i(r.Event)()],t.prototype,"created",void 0),b([i.i(r.Event)()],t.prototype,"destroyed",void 0),b([i.i(r.Event)()],t.prototype,"taskbarEditing",void 0),b([i.i(r.Event)()],t.prototype,"dataBound",void 0),b([i.i(r.Event)()],t.prototype,"resizeStart",void 0),b([i.i(r.Event)()],t.prototype,"resizing",void 0),b([i.i(r.Event)()],t.prototype,"resizeStop",void 0),b([i.i(r.Event)()],t.prototype,"splitterResizeStart",void 0),b([i.i(r.Event)()],t.prototype,"splitterResizing",void 0),b([i.i(r.Event)()],t.prototype,"splitterResized",void 0),b([i.i(r.Event)()],t.prototype,"columnDragStart",void 0),b([i.i(r.Event)()],t.prototype,"columnDrag",void 0),b([i.i(r.Event)()],t.prototype,"columnDrop",void 0),b([i.i(r.Event)()],t.prototype,"beforeTooltipRender",void 0),b([i.i(r.Event)()],t.prototype,"rowSelecting",void 0),b([i.i(r.Event)()],t.prototype,"rowSelected",void 0),b([i.i(r.Event)()],t.prototype,"rowDeselecting",void 0),b([i.i(r.Event)()],t.prototype,"rowDeselected",void 0),b([i.i(r.Event)()],t.prototype,"cellSelecting",void 0),b([i.i(r.Event)()],t.prototype,"cellSelected",void 0),b([i.i(r.Event)()],t.prototype,"cellDeselecting",void 0),b([i.i(r.Event)()],t.prototype,"cellDeselected",void 0),b([i.i(r.Event)()],t.prototype,"queryCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"headerCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"rowDataBound",void 0),b([i.i(r.Event)()],t.prototype,"columnMenuOpen",void 0),b([i.i(r.Event)()],t.prototype,"toolbarClick",void 0),b([i.i(r.Event)()],t.prototype,"columnMenuClick",void 0),b([i.i(r.Event)()],t.prototype,"contextMenuOpen",void 0),b([i.i(r.Event)()],t.prototype,"contextMenuClick",void 0),b([i.i(r.Event)()],t.prototype,"onTaskbarClick",void 0),b([i.i(r.Event)()],t.prototype,"recordDoubleClick",void 0),b([i.i(r.Event)()],t.prototype,"onMouseMove",void 0),b([i.i(r.Event)()],t.prototype,"beforePdfExport",void 0),b([i.i(r.Event)()],t.prototype,"pdfExportComplete",void 0),b([i.i(r.Event)()],t.prototype,"pdfQueryCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"pdfQueryTaskbarInfo",void 0),b([i.i(r.Event)()],t.prototype,"pdfQueryTimelineCellInfo",void 0),b([i.i(r.Event)()],t.prototype,"pdfColumnHeaderQueryCellInfo",void 0),t=b([r.NotifyPropertyChanges],t)}(r.Component)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(3)),a=i(87),s=(i.n(a),i(4)),o=(i.n(s),function(){function e(e){this.parent=e,this.parent.on("destroy",this.destroy,this)}return e.prototype.renderSplitter=function(){var e=this,t=this.calculateSplitterPosition(this.parent.splitterSettings);this.parent.splitterElement=i.i(r.createElement)("div",{className:n._21}),this.parent.treeGridPane=i.i(r.createElement)("div",{className:n._22}),this.parent.chartPane=i.i(r.createElement)("div",{className:n._23}),i.i(r.addClass)([this.parent.chartPane],"e-droppable"),this.parent.enableRtl?(this.parent.splitterElement.appendChild(this.parent.chartPane),this.parent.splitterElement.appendChild(this.parent.treeGridPane)):(this.parent.splitterElement.appendChild(this.parent.treeGridPane),this.parent.splitterElement.appendChild(this.parent.chartPane)),this.splitterObject=new a.Splitter({height:null,width:this.parent.ganttWidth.toString(),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,separatorSize:this.parent.splitterSettings.separatorSize,paneSettings:[{resizable:!0,size:t,min:this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum)},{resizable:!0}],orientation:"Horizontal",resizeStart:function(t){e.parent.contextMenuModule&&e.parent.contextMenuModule.isOpen&&e.parent.contextMenuModule.contextMenu.close();var i=t.pane[0],r=t.pane[1];e.splitterPreviousPositionGrid=i.scrollWidth+1+"px",e.splitterPreviousPositionChart=r.scrollWidth+1+"px";var n=new s.Deferred;return e.parent.trigger("splitterResizeStart",t,function(e){n.resolve(e)}),n},resizing:function(t){e.parent.trigger("splitterResizing",t),e.parent.timelineModule.isZoomToFit&&e.parent.timelineModule.updateTimelineAfterZooming(e.parent.timelineModule.timelineEndDate,!0)},resizeStop:function(t){e.parent.calculateDimensions();var n=t.pane[0];e.splitterPreviousPositionGrid=n.scrollWidth+1+"px",e.splitterObject.paneSettings[0].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionGrid),e.splitterObject.paneSettings[1].size=e.parent.ganttWidth-parseInt(e.splitterPreviousPositionGrid)-4+"px";var a=new s.Deferred;return e.parent.trigger("splitterResized",t,function(t){!0===t.cancel&&(e.splitterObject.paneSettings[0].size=null,e.splitterObject.paneSettings[0].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionGrid),e.splitterObject.paneSettings[1].size=null,e.splitterObject.paneSettings[1].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionChart)),i.i(r.isNullOrUndefined)(e.parent.projectEndDate)&&e.parent.timelineModule.updateTimelineAfterZooming(e.parent.timelineModule.timelineEndDate,!0),a.resolve(t)}),a}}),this.parent.element.appendChild(this.parent.splitterElement),this.splitterObject.appendTo(this.parent.splitterElement)},e.prototype.calculateSplitterPosition=function(e){return!i.i(r.isNullOrUndefined)(this.splitterObject)&&this.parent.enablePersistence?this.splitterObject.paneSettings[0].size:"Grid"===e.view?"100%":"Chart"===e.view?"0%":i.i(r.isNullOrUndefined)(e.position)||""===e.position?!i.i(r.isNullOrUndefined)(e.columnIndex)&&e.columnIndex>=0?150*e.columnIndex<this.parent.ganttWidth||!this.parent.element.classList.contains("e-device")?this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(e.columnIndex).toString()+"px"):this.getSpliterPositionInPercentage(130*e.columnIndex+"px"):this.getSpliterPositionInPercentage("250px"):this.getSpliterPositionInPercentage(e.position)},e.prototype.getSpliterPositionInPercentage=function(e){var t=i.i(r.isNullOrUndefined)(e)||""===e?null:e;if(!i.i(r.isNullOrUndefined)(t))if(-1!==e.indexOf("px")){var n=parseInt(e,10);t=n/this.parent.ganttWidth*100<=100?n/this.parent.ganttWidth*100+"%":"25%"}else t=-1===e.indexOf("%")?e+"%":e;return t},e.prototype.getTotalColumnWidthByIndex=function(e){var t=0,i=this.parent.ganttColumns;e=i.length>e?e:i.length;for(var r=0;r<e;r++)t+=parseInt(i[r].width);return t},e.prototype.updateSplitterPosition=function(){this.splitterObject.separatorSize=this.parent.splitterSettings.separatorSize>=4?this.parent.splitterSettings.separatorSize:4;var e=this.calculateSplitterPosition(this.parent.splitterSettings);this.splitterObject.paneSettings[0].min=this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum),this.splitterObject.dataBind(),this.splitterObject.paneSettings[0].size=e},e.prototype.triggerCustomResizedEvent=function(){var e=this.splitterObject.element.querySelectorAll(".e-pane")[0],t=this.splitterObject.element.querySelectorAll(".e-pane")[1],i={event:null,element:this.splitterObject.element,pane:[e,t],index:[0,1],separator:this.splitterObject.element.querySelector(".e-split-bar"),paneSize:[e.offsetWidth,t.offsetWidth]};this.parent.trigger("splitterResized",i),!0===i.cancel&&(this.splitterObject.paneSettings[0].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionGrid),this.splitterObject.paneSettings[1].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionChart))},e.prototype.destroy=function(){this.splitterObject.destroy(),this.parent.off("destroy",this.destroy)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(0),n=(i.n(r),i(5)),a=(i.n(n),i(4)),s=(i.n(a),i(1)),o=i(10),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),d=function(e){function t(t){var i=e.call(this,t)||this;return i.recordIndex=0,i.taskIds=[],i.hierarchyData=[],i.addEventListener(),i}return l(t,e),t.prototype.addEventListener=function(){this.parent.on("beforeDataManipulate",this.checkDataBinding.bind(this))},t.prototype.checkDataBinding=function(e){if(e&&(this.parent.flatData=[],this.parent.currentViewData=[],this.parent.updatedRecords=[],this.dataArray=[],this.taskIds=[],this.parent.ids=[],this.recordIndex=0,this.hierarchyData=[],this.parent.predecessorsCollection=[],this.parent.treeGrid.parentData=[],this.parent.taskIds=[]),i.i(r.isNullOrUndefined)(this.parent.dataSource))this.parent.dataSource=[],this.parent.processTimeline(),this.parent.renderGantt(e);else if(this.parent.dataSource instanceof a.DataManager)this.initDataSource(e);else{if(this.parent.dataSource instanceof Object&&i.i(s.i)(this.parent)){var t=i.i(r.getValue)("result",this.parent.dataSource);this.dataArray=t}else this.dataArray=this.parent.dataSource;this.processTimeline(),this.cloneDataSource(),this.parent.renderGantt(e)}},t.prototype.processTimeline=function(){this.parent.processTimeline(),this.parent.enableValidation||(this.parent.dataOperation.calculateProjectDatesForValidatedTasks(),this.parent.timelineModule.validateTimelineProp())},t.prototype.initDataSource=function(e){var t=this,i=this.parent.query instanceof a.Query?this.parent.query:new a.Query;i.requiresCount(),this.parent.dataSource.executeQuery(i).then(function(i){t.dataArray=i.result,t.processTimeline(),(t.parent.loadChildOnDemand||!t.parent.loadChildOnDemand&&!t.parent.taskFields.hasChildMapping)&&t.cloneDataSource(),t.parent.renderGantt(e)}).catch(function(i){t.parent.processTimeline(),t.parent.renderGantt(e),t.parent.trigger("actionFailure",{error:i})})},t.prototype.constructDataSource=function(e){for(var t,n=new a.DataManager(e).executeLocal((new a.Query).group(this.parent.taskFields.parentID)),s=[],o=0;o<n.length;o++){var l=n[o];!i.i(r.isNullOrUndefined)(l.key)&&(t=this.taskIds.indexOf(l.key.toString()))>-1&&!i.i(r.isNullOrUndefined)(l.key)?e[t][this.parent.taskFields.child]=l.items:-1!==t&&s.push.apply(s,l.items)}this.hierarchyData=this.dataReorder(e,s)},t.prototype.cloneDataSource=function(){var e=this.parent.taskFields.id,t=this.parent.taskFields.parentID,n=[];if(i.i(r.isNullOrUndefined)(e)||i.i(r.isNullOrUndefined)(t))n=this.dataArray;else{for(var s=[],o=0;o<this.dataArray.length;o++){var l=this.dataArray[o];l.parentItem&&delete l.parentItem,s.push(i.i(r.extend)({},{},l,!0)),i.i(r.isNullOrUndefined)(l[e])||this.taskIds.push(l[e].toString())}this.parent.taskFields.child||this.parent.setProperties({taskFields:{child:"Children"}},!0),this.constructDataSource(s),n=!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping&&0===this.hierarchyData.length?this.dataArray:this.hierarchyData}if(this.parent.taskFields.segmentId&&(this.segmentCollection=new a.DataManager(this.parent.segmentData).executeLocal((new a.Query).group(this.parent.taskFields.segmentId)),this.parent.taskFields.segments||(this.parent.taskFields.segments="Segments")),"ProjectView"!==this.parent.viewType){var d=i.i(r.extend)([],[],this.parent.resources,!0),h=[];if(this.constructResourceViewDataSource(d,n,h),h.length>0){var p={};p[this.parent.resourceFields.id]=0,p[this.parent.resourceFields.name]=this.parent.localeObj.getConstant("unassignedTask"),p[this.parent.taskFields.child]=h,d.push(p)}n=d}this.prepareDataSource(n)},t.prototype.constructResourceViewDataSource=function(e,t,i){for(var r=this,n=0;n<t.length;n++)!function(n){var a=t[n],s=null!=r.parent.taskFields.child?r.parent.taskFields.child:r.parent.taskFields.child="Children",o=a&&a[r.parent.taskFields.resourceInfo],l=r.parent.resourceFields.id;a[s]&&0!==a[s].length||!o||!o.length?(!a[s]||a[s]&&0===a[s].length)&&i.push(a):o.forEach(function(t){for(var i="object"==typeof t?t[l]:t,r=0;r<e.length;r++)if(e[r][l].toString()===i.toString()){e[r][s]?e[r][s].push(a):e[r][s]=[a];break}}),a[r.parent.taskFields.child]&&a[r.parent.taskFields.child].length&&r.constructResourceViewDataSource(e,a[r.parent.taskFields.child],i)}(n)},t.prototype.prepareDataSource=function(e){this.prepareRecordCollection(e,0),this.parent.initialLoadData=i.i(r.extend)({},{},this.parent.flatData,!0),"ResourceView"===this.parent.viewType&&this.calculateSharedTaskUniqueIds(),this.parent.taskFields.dependency&&this.parent.predecessorModule&&this.parent.predecessorModule.ensurePredecessorCollection()},t.prototype.calculateSharedTaskUniqueIds=function(){for(var e=this,t=0;t<this.parent.getTaskIds().length;t++)!function(t){var i=[];if(i[0]=e.parent.getTaskIds()[t][0],i[1]=e.parent.getTaskIds()[t].slice(1),"R"!==i[0]){var r=[],n=[];e.parent.flatData.filter(function(e){e.ganttProperties.taskId.toString()===i[1]&&0!==e.level&&(n.push(e.ganttProperties.rowUniqueID),r.push(e))});for(var a=0;a<r.length;a++)r[a].ganttProperties.sharedTaskUniqueIds=n}}(t)},t.prototype.prepareRecordCollection=function(e,t,n){for(var a=this,s=e.length,o=this,l=0;l<s;l++)!function(s){var l=e[s];if(!i.i(r.isNullOrUndefined)(o.parent.taskFields.segmentId)){var d=o.segmentCollection.filter(function(e){return e.key===l[a.parent.taskFields.id]});d.length>0&&(l[o.parent.taskFields.segments]=d[0].items)}var h=o.createRecord(l,t,n,!0);o.parent.enableValidation&&o.parent.autoCalculateDateScheduling||o.updateTaskLeftWidth(h),h.index=o.recordIndex++,o.parent.ids[h.index]=h.ganttProperties.rowUniqueID,o.parent.flatData.push(h),o.parent.setTaskIds(h);var p=l[o.parent.taskFields.child];if("ResourceView"===o.parent.viewType&&i.i(r.isNullOrUndefined)(p)&&i.i(r.isNullOrUndefined)(h.parentItem)&&0===h.level){var u=h.ganttProperties,c=h;o.parent.setRecordValue(u.isAutoSchedule?"startDate":"autoStartDate",null,c.ganttProperties,!0),o.parent.setRecordValue(u.isAutoSchedule?"endDate":"autoEndDate",null,c.ganttProperties,!0);var g=c.ganttProperties;o.parent.setRecordValue("isMilestone",!1,g,!0),g.isAutoSchedule&&o.calculateDuration(c),o.updateWorkWithDuration(c);var f=g.work;o.parent.setRecordValue("work",f,g,!0),o.parent.setRecordValue("taskType","FixedDuration",g,!0),i.i(r.isNullOrUndefined)(o.parent.taskFields.type)||o.updateMappingData(c,"type"),o.parent.setRecordValue("progress",Math.floor(0),g,!0),o.parent.setRecordValue("totalProgress",0,g,!0),o.parent.setRecordValue("totalDuration",0,g,!0),g.isAutoSchedule||(o.parent.setRecordValue("autoDuration",o.calculateAutoDuration(g),g,!0),o.updateAutoWidthLeft(c)),o.parent.allowParentDependency||o.resetDependency(c),o.updateWidthLeft(c),o.updateTaskData(c)}!i.i(r.isNullOrUndefined)(p)&&p.length>0&&o.prepareRecordCollection(p,h.level+1,h)}(l)},t.prototype.addCustomFieldValue=function(e,t){var i=this.parent.ganttColumns,r=i.length;if(r)for(var n=0;n<r;n++){var a=t[i[n].field];void 0===a&&this.parent.setRecordValue(i[n].field,e[i[n].field],t)}},t.prototype.createRecord=function(e,t,a,o){var l=this.parent.taskFields,d=this.parent.resourceFields,h=e[l.progress],p=null,u=null,c=e[l.notes];h=h&&parseFloat(h.toString())?parseFloat(h.toString()):0;var g=e[l.dependency],f=this.getDateFromFormat(e[l.baselineStartDate],!0),m=this.getDateFromFormat(e[l.baselineEndDate],!0),y={},D={},v="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[l.manual];this.parent.setRecordValue("ganttProperties",D,y),i.i(r.isNullOrUndefined)(e[l.id])?i.i(r.isNullOrUndefined)(e[d.id])||(p=e[d.id],u=e[d.name],this.addTaskData(y,e,!1)):(p=e[l.id],u=e[l.name],!this.parent.loadChildOnDemand&&l.hasChildMapping&&e.taskData?y.taskData=e.taskData:this.addTaskData(y,e,o)),this.parent.setRecordValue("taskId",p,D,!0),this.parent.setRecordValue("taskName",u,D,!0),l.parentID&&this.parent.setRecordValue("parentId",e[l.parentID],D,!0),this.addCustomFieldValue(e,y),this.parent.setRecordValue("isAutoSchedule",v,D,!0),this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),D,!0),this.parent.setRecordValue("isMilestone",!1,D,!0),this.parent.setRecordValue("indicators",e[l.indicators],D,!0),this.updateResourceName(y),this.calculateScheduledValues(y,e,o),this.parent.setRecordValue("baselineStartDate",this.checkBaselineStartDate(f),D,!0),m&&0===m.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,m),(D.baselineStartDate&&m&&D.baselineStartDate.getTime()>m.getTime()||!i.i(r.isNullOrUndefined)(D.baselineStartDate)&&!i.i(r.isNullOrUndefined)(D.startDate)&&D.baselineStartDate.getTime()===D.startDate.getTime()&&!i.i(r.isNullOrUndefined)(m)&&!i.i(r.isNullOrUndefined)(D.endDate)&&m.toLocaleDateString()===D.endDate.toLocaleDateString()&&D.isMilestone)&&(m=D.baselineStartDate),this.parent.setRecordValue("baselineEndDate",this.checkBaselineEndDate(m,D),D,!0),this.parent.setRecordValue("progress",h,D,!0),this.parent.setRecordValue("totalProgress",h,D,!0),this.parent.setRecordValue("predecessorsName",g,D,!0),this.parent.setRecordValue("notes",c,D,!0),this.parent.setRecordValue("cssClass",e[l.cssClass],D,!0),this.parent.setRecordValue("parentItem",this.getCloneParent(a),y),!this.parent.loadChildOnDemand&&l.hasChildMapping&&this.parent.currentViewData.length>0&&this.parent.setRecordValue("parentItem",y.parentItem,this.parent.currentViewData[this.taskIds.indexOf(e[l.id].toString())]);var w=y.parentItem?y.parentItem.uniqueID:null;if(this.parent.setRecordValue("parentUniqueID",w,y),"ResourceView"!==this.parent.viewType||i.i(r.isNullOrUndefined)(l.parentID)||i.i(r.isNullOrUndefined)(y.parentItem)||this.parent.setRecordValue("parentId",y.parentItem.taskId,D,!0),this.parent.setRecordValue("level",t,y),!this.parent.loadChildOnDemand&&l.hasChildMapping&&e.uniqueID?this.parent.setRecordValue("uniqueID",e.uniqueID,y):this.parent.setRecordValue("uniqueID",i.i(n.getUid)(this.parent.element.id+"_data_"),y),this.parent.setRecordValue("uniqueID",y.uniqueID,D,!0),this.parent.setRecordValue("childRecords",[],y),this.parent.dataSource instanceof Object&&i.i(s.i)(this.parent)&&!i.i(r.isNullOrUndefined)(l.child)&&this.parent.setRecordValue(l.child,[],y),!i.i(r.isNullOrUndefined)(e[l.child])&&e[l.child].length>0?(this.parent.setRecordValue("hasChildRecords",!0,y),this.parent.setRecordValue("isMilestone",!1,D,!0),this.parent.allowParentDependency||this.resetDependency(y)):!this.parent.loadChildOnDemand&&l.hasChildMapping&&y.taskData[l.hasChildMapping]?this.parent.setRecordValue("hasChildRecords",!0,y):this.parent.setRecordValue("hasChildRecords",!1,y),y.hasChildRecords&&(this.parent.setRecordValue("autoStartDate",y.ganttProperties.startDate,D),this.parent.setRecordValue("autoEndDate",y.ganttProperties.endDate,D),this.parent.setRecordValue("autoDuration",y.ganttProperties.duration,D)),this.parent.setRecordValue("expanded",!y.hasChildRecords||!this.parent.collapseAllParentTasks,y),this.updateExpandStateMappingValue(y,e),o||(this.parent.setRecordValue("width",this.calculateWidth(y),D,!0),this.parent.setRecordValue("left",this.calculateLeft(D),D,!0),this.parent.setRecordValue("progressWidth",this.getProgressWidth(D.width,h),D,!0),D.baselineEndDate&&D.baselineStartDate&&(this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(D),D,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(D),D,!0))),i.i(r.isNullOrUndefined)(l.work)&&this.updateWorkWithDuration(y),i.i(r.isNullOrUndefined)(l.manual)||this.parent.dataOperation.updateMappingData(y,"manual"),this.updateTaskData(y),g&&this.parent.predecessorsCollection.push(y),i.i(r.isNullOrUndefined)(a)||(a.childRecords.push(y),this.parent.dataSource instanceof Object&&i.i(s.i)(this.parent)&&!i.i(r.isNullOrUndefined)(this.parent.taskFields.child)&&a[this.parent.taskFields.child].push(y.taskData)),"ProjectView"===this.parent.viewType)this.parent.setRecordValue("rowUniqueID",D.taskId.toString(),D,!0);else{var k=y.uniqueID.replace(this.parent.element.id+"_data_","");this.parent.setRecordValue("rowUniqueID",k,y),this.parent.setRecordValue("rowUniqueID",k,D,!0),this.parent.setRecordValue("sharedTaskUniqueIds",[],D,!0)}return this.parent.allowUnscheduledTasks&&y.ganttProperties.startDate&&(y.ganttProperties.endDate||y.ganttProperties.duration)&&(this.parent.setRecordValue("segments",this.setSegmentsInfo(y,!0),D,!0),this.parent.dataOperation.updateMappingData(y,"segments"),o||this.updateWidthLeft(y)),y},t.prototype.sortSegmentsData=function(e,t,i){var r=this;return t?e.sort(function(e,t){var i=r.parent.taskFields.startDate;return r.getDateFromFormat(e[i]).getTime()-r.getDateFromFormat(t[i]).getTime()}):e.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),e},t.prototype.setSegmentsInfo=function(e,t){var n,a=this.parent.taskFields,s=[],o=0,l=0,d=[];if(!i.i(r.isNullOrUndefined)(this.parent.taskFields.segments)&&(n=t?e.taskData[this.parent.taskFields.segments]:e.ganttProperties.segments,!i.i(r.isNullOrUndefined)(n)&&n.length>1)){this.sortSegmentsData(n,t,e.ganttProperties);for(var h=0;h<n.length;h++){var p=n[h],u=t?p[a.startDate]:p.startDate,c=t?p[a.endDate]:p.endDate,g=t?p[a.duration]:p.duration;if(u=this.getDateFromFormat(u),u=this.checkStartDate(u,e.ganttProperties,!1),i.i(r.isNullOrUndefined)(g)){if(c=this.getDateFromFormat(c),c&&(i.i(r.isNullOrUndefined)(g)||""===String(g))&&0===c.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,c),c=this.checkEndDate(c,e.ganttProperties,!1),g=this.getDuration(u,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),a.duration){if((l=e.ganttProperties.duration-o-1)<=0)continue;g=h===n.length-1?l:l>0&&g>l?l:g,c=this.getEndDate(u,g,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!a.duration&&a.endDate&&(c=!i.i(r.isNullOrUndefined)(e.ganttProperties.endDate)&&c.getTime()<e.ganttProperties.endDate.getTime()&&h!==n.length-1?c:e.ganttProperties.endDate,g=this.getDuration(u,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),s.length>0&&c.getTime()<u.getTime()&&c.getTime()<=e.ganttProperties.endDate.getTime())){s[h-1].duration=this.getDuration(s[h-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);continue}}else if(c=this.getEndDate(u,g,e.ganttProperties.durationUnit,e.ganttProperties,!1),a.duration){if((l=e.ganttProperties.duration-o)<=0)continue;g=h===n.length-1?l:l>0&&g>l?l:g,c=this.getEndDate(u,g,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!a.duration&&a.endDate&&(c=!i.i(r.isNullOrUndefined)(e.ganttProperties.endDate)&&c.getTime()>e.ganttProperties.endDate.getTime()&&h!==n.length-1?c:e.ganttProperties.endDate,g=this.getDuration(u,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),s.length>0&&c.getTime()<u.getTime()&&c.getTime()<=e.ganttProperties.endDate.getTime())){s[h-1].duration=this.getDuration(s[h-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);continue}if(p={},!(u&&c&&u&&g))break;if(o+=g,p.startDate=u,p.endDate=c,p.duration=g,p.width=0,p.left=0,p.segmentIndex=h,s.push(p),i.i(r.isNullOrUndefined)(s[h-1]))p.offsetDuration=0;else{var f=this.getDuration(s[h-1].endDate,s[h].startDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);p.offsetDuration=f,f<1&&(p.startDate=this.getEndDate(s[h-1].endDate,1,e.ganttProperties.durationUnit,e.ganttProperties,!1),p.startDate=this.checkStartDate(p.startDate,e.ganttProperties,!1),p.endDate=this.getEndDate(p.startDate,p.duration,e.ganttProperties.durationUnit,e.ganttProperties,!1),p.endDate=!a.duration&&a.endDate&&p.endDate>e.ganttProperties.endDate?e.ganttProperties.endDate:p.endDate,p.offsetDuration=1,p.duration=this.getDuration(p.startDate,p.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone))}d.push(this.setSegmentTaskData(p,n[h]))}this.parent.setRecordValue("duration",o,e.ganttProperties,!0),i.i(r.isNullOrUndefined)(s[s.length-1])||this.parent.setRecordValue("endDate",s[s.length-1].endDate,e.ganttProperties,!0),i.i(r.isNullOrUndefined)(a.endDate)||i.i(r.isNullOrUndefined)(s[s.length-1])||this.parent.setRecordValue(this.parent.taskFields.endDate,s[s.length-1].endDate,e,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,d,e)}return s.length>1?this.parent.setRecordValue("segments",s,e.ganttProperties,!0):s=null,s},t.prototype.setSegmentTaskData=function(e,t){var n=this.parent.taskFields,a=i.i(r.extend)({},{},t,!0);return i.i(r.isNullOrUndefined)(n.startDate)||(a[this.parent.taskFields.startDate]=e.startDate),i.i(r.isNullOrUndefined)(n.endDate)||(a[this.parent.taskFields.endDate]=e.endDate),i.i(r.isNullOrUndefined)(n.duration)||(a[this.parent.taskFields.duration]=Number(e.duration)),a},t.prototype.updateWorkWithDuration=function(e){var t=e.ganttProperties.resourceInfo,n=0;if(!i.i(r.isNullOrUndefined)(t)){var a=t.length,s=void 0,o=void 0,l=void 0,d=this.parent.secondsPerDay/3600,h=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit);for(s=0;s<a;s++)o=t[s][this.parent.resourceFields.unit],l=o>0?d*o/100:d,n+=l*h;"minute"===e.ganttProperties.workUnit&&(n*=60),"day"===e.ganttProperties.workUnit&&(n/=d),n%1!=0&&(n=parseFloat(n.toFixed(2)))}if(e.childRecords.length>0&&this.parent.isOnEdit){for(var p=0,u=0;u<e.childRecords.length;u++)p+=e.childRecords[u].ganttProperties.work;n+=p}this.parent.setRecordValue("work",n,e.ganttProperties,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(e,"work")},t.prototype.getCloneParent=function(e){if(i.i(r.isNullOrUndefined)(e))return null;var t={};return t.uniqueID=e.uniqueID,t.expanded=e.expanded,t.level=e.level,t.index=e.index,t.taskId=e.ganttProperties.rowUniqueID,t},t.prototype.reUpdateResources=function(){if(this.parent.flatData.length>0)for(var e=void 0,t=void 0,i=void 0,r=0;r<this.parent.flatData.length;r++)e=this.parent.flatData[r].taskData,t=this.parent.flatData[r].ganttProperties,i=this.parent.flatData[r],this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),t,!0),this.updateResourceName(i)},t.prototype.addTaskData=function(e,t,n){var s=this,o=this.parent.taskFields,l=this.parent.dataSource;if(n)if(o.parentID||l instanceof a.DataManager&&l.dataSource.json&&l.dataSource.offline)if(o.parentID){var d=t[o.id],h=this.taskIds.indexOf(d.toString()),p=h>-1?this.dataArray[h]:{};if(!i.i(r.isNullOrUndefined)(this.parent.taskFields.segmentId)){var u=this.segmentCollection.filter(function(e){return e.key===p[s.parent.taskFields.id]});u.length>0&&(p[this.parent.taskFields.segments]=u[0].items)}this.parent.setRecordValue("taskData",p,e)}else this.parent.setRecordValue("taskData",t,e);else this.parent.setRecordValue("taskData",t,e);else this.parent.setRecordValue("taskData",t,e)},t.prototype.updateExpandStateMappingValue=function(e,t){var n,a=this.parent.taskFields.expandState,s=t[a];a&&e.hasChildRecords&&(i.i(r.isNullOrUndefined)(s)?i.i(r.isNullOrUndefined)(s)&&!this.parent.collapseAllParentTasks?n=!0:i.i(r.isNullOrUndefined)(s)&&this.parent.collapseAllParentTasks&&(n=!1):n="true"===s.toString(),this.parent.setRecordValue("taskData."+a,n,e),this.parent.setRecordValue(a,n,e),this.parent.setRecordValue("expanded",n,e))},t.prototype.setValidatedDates=function(e,t){var n=e.ganttProperties,a=this.parent.taskFields,s=t[a.duration],o=this.getDateFromFormat(t[a.startDate],!0),l=this.getDateFromFormat(t[a.endDate],!0);s=i.i(r.isNullOrUndefined)(s)||""===s?null:s,this.parent.setRecordValue("startDate",new Date(o.getTime()),n,!0),i.i(r.isNullOrUndefined)(s)||""===s?this.calculateDuration(e):this.updateDurationValue(s,n),this.parent.setRecordValue("endDate",new Date(l.getTime()),n,!0)},t.prototype.calculateScheduledValues=function(e,t,n){var a=this.parent.taskFields,s=e.ganttProperties,o=t[a.duration];o=i.i(r.isNullOrUndefined)(o)||""===o?null:o;var l,d;s.startDate&&s.endDate?(l=this.getDateFromFormat(s.startDate,!0),d=this.getDateFromFormat(s.endDate,!0)):(l=this.getDateFromFormat(t[a.startDate],!0),d=this.getDateFromFormat(t[a.endDate],!0));var h=a.segments?t[a.segments]||e.taskData[a.segments]:null,p=!!a.milestone&&!!t[a.milestone],u=t[a.durationUnit]?t[a.durationUnit]:"";this.parent.setRecordValue("durationUnit",this.validateDurationUnitMapping(u),s,!0);var c=i.i(r.isNullOrUndefined)(t[a.work])?0:parseFloat(t[a.work]);this.parent.setRecordValue("workUnit",this.validateWorkUnitMapping(this.parent.workUnit),s,!0);var g=t[a.type]?t[a.type]:"",f=this.validateTaskTypeMapping(g);if(this.parent.setRecordValue("taskType",f,s,!0),n&&!this.parent.enableValidation&&l&&d)this.setValidatedDates(e,t);else if(d||l||!i.i(r.isNullOrUndefined)(o)&&""!==o)l?this.calculateDateFromStartDate(l,d,o,e,n):d?this.calculateDateFromEndDate(d,o,e):i.i(r.isNullOrUndefined)(o)||""===o||(this.updateDurationValue(o,s),this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,s,!0),this.parent.setRecordValue("endDate",null,s,!0)):(this.parent.setRecordValue("startDate",this.getProjectStartDate(s,n),s,!0),this.calculateEndDate(e)));else{if(this.parent.allowUnscheduledTasks)return;this.parent.setRecordValue("duration",1,s,!0),this.parent.setRecordValue("startDate",this.getProjectStartDate(s,n),s,!0),this.calculateEndDate(e)}if(this.parent.autoCalculateDateScheduling||(i.i(r.isNullOrUndefined)(e.ganttProperties.startDate)||(e[this.parent.taskFields.startDate]=e.ganttProperties.startDate,e.taskData[this.parent.taskFields.startDate]=e.ganttProperties.startDate),i.i(r.isNullOrUndefined)(e.ganttProperties.endDate)||(e[this.parent.taskFields.endDate]=e.ganttProperties.endDate,e.taskData[this.parent.taskFields.endDate]=e.ganttProperties.endDate)),i.i(r.isNullOrUndefined)(h)||this.parent.setRecordValue("segments",this.setSegmentsInfo(e,!0),s,!0),0===s.duration&&(this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0)),!i.i(r.isNullOrUndefined)(p)&&p&&(this.parent.setRecordValue("duration",0,s,!0),this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0)),i.i(r.isNullOrUndefined)(a.work))a.type&&s.taskType&&this.parent.dataOperation.updateMappingData(e,"type");else{if(this.parent.setRecordValue("durationUnit",this.parent.durationUnit,s,!0),isNaN(c)||i.i(r.isNullOrUndefined)(c))this.parent.setRecordValue("work",0,s,!0),this.parent.setRecordValue("duration",0,s,!0),this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0);else{switch(this.parent.setRecordValue("work",c,s,!0),f){case"FixedDuration":case"FixedWork":this.updateUnitWithWork(e);break;case"FixedUnit":this.updateDurationWithWork(e)}i.i(r.isNullOrUndefined)(a.type)||this.parent.dataOperation.updateMappingData(e,"type"),0===s.duration?(this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0)):i.i(r.isNullOrUndefined)(s.startDate)||i.i(r.isNullOrUndefined)(s.duration)||(this.parent.setRecordValue("isMilestone",!1,s,!0),this.calculateEndDate(e))}this.parent.dataOperation.updateMappingData(e,"work")}},t.prototype.updateDurationWithWork=function(e){var t=e.ganttProperties,n=t.resourceInfo;if(!i.i(r.isNullOrUndefined)(n)){var a=i.i(r.isNullOrUndefined)(n)?0:n.length,s=0,o=this.parent.secondsPerDay/3600,l=0,d=void 0,h=void 0;for(h=0;h<a;h++)d=n[h][this.parent.resourceFields.unit],s+=d>0?o*d/100:o;var p=this.getWorkInHour(t.work,t.workUnit);a>0&&(l+=p/s),"minute"===t.durationUnit&&(l=l*o*60),"hour"===t.durationUnit&&(l*=o),l%1!=0&&(l=parseFloat(l.toFixed(2))),i.i(r.isNullOrUndefined)(t.duration)||this.parent.setRecordValue("duration",l,t,!0),this.parent.dataOperation.updateMappingData(e,"duration")}},t.prototype.updateUnitWithWork=function(e){var t=e.ganttProperties,n=t.resourceInfo,a=i.i(r.isNullOrUndefined)(n)?0:n.length,s=this.parent.secondsPerDay/3600;if(0!==a){var o=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit),l=this.getWorkInHour(t.work,t.workUnit),d=o>0?l/(o*s)*100:0,h=d>0?d/a:100;h%1!=0&&(h=parseFloat(h.toFixed(2)));for(var p=0;p<a;p++)n[p][this.parent.resourceFields.unit]=h;this.updateResourceName(e)}},t.prototype.calculateDateFromEndDate=function(e,t,n){var a=n.ganttProperties;0===e.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,e);var s=0===parseInt(t,10)||null;this.parent.setRecordValue("endDate",this.checkEndDate(e,n.ganttProperties,s),a,!0),i.i(r.isNullOrUndefined)(t)||""===t?this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,a,!0),this.parent.setRecordValue("duration",null,a,!0)):(this.parent.setRecordValue("duration",1,a,!0),this.parent.setRecordValue("startDate",this.getStartDate(a.endDate,a.duration,a.durationUnit,a),a,!0)):i.i(r.isNullOrUndefined)(t)||""===t||(this.updateDurationValue(t,a),this.parent.setRecordValue("startDate",this.getStartDate(a.endDate,a.duration,a.durationUnit,a),a,!0))},t.prototype.calculateDateFromStartDate=function(e,t,n,a,s){var o=a.ganttProperties,l=!!(0===parseInt(n,10)||e&&t&&new Date(e.getTime())===new Date(t.getTime()))||null;this.parent.setRecordValue("startDate",this.checkStartDate(e,o,l,s),o,!0),this.parent.isTreeGridRendered&&a&&this.updateTaskData(a),t||!i.i(r.isNullOrUndefined)(n)&&""!==n?i.i(r.isNullOrUndefined)(n)||t?t&&(i.i(r.isNullOrUndefined)(n)||""===n)?(0===t.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,t),this.parent.setRecordValue("endDate",this.checkEndDate(t,a.ganttProperties),o,!0),1===this.compareDates(o.startDate,o.endDate)?(this.parent.setRecordValue("endDate",o.startDate,o,!0),this.parent.setRecordValue("isMilestone",!0,o,!0),this.parent.setRecordValue("duration",0,o,!0)):this.calculateDuration(a)):(this.updateDurationValue(n,o),this.parent.autoCalculateDateScheduling?this.calculateEndDate(a):this.parent.setRecordValue("endDate",t,o,!0)):(this.updateDurationValue(n,o),this.calculateEndDate(a)):this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("endDate",null,o,!0),this.parent.setRecordValue("duration",null,o,!0)):(this.parent.setRecordValue("duration",1,o,!0),this.calculateEndDate(a))},t.prototype.getProgressWidth=function(e,t){return e*t/100},t.prototype.calculateWidth=function(e,t){var n=e.ganttProperties,a=t?n.autoStartDate:n.startDate,s=t?n.autoEndDate:n.endDate;return i.i(r.isNullOrUndefined)(a)&&i.i(r.isNullOrUndefined)(s)&&(a=this.getValidStartDate(n,t),s=this.getValidEndDate(n,t)),i.i(r.isNullOrUndefined)(a)||i.i(r.isNullOrUndefined)(s)?3:!n.isMilestone||e.hasChildRecords&&!n.isAutoSchedule?this.getTaskWidth(a,s,n):0},t.prototype.getTaskbarHeight=function(){var e=this.parent.rowHeight,t=this.parent.taskbarHeight;return t<e?t:e},t.prototype.calculateLeft=function(e,t){var n=null,a=-300,s=t?e.autoStartDate:e.startDate,o=t?e.autoEndDate:e.endDate,l=(t?e.autoDuration:e.duration,e.isMilestone);return s?n=new Date(s.getTime()):o?(n=new Date(o.getTime()),l=!i.i(r.isNullOrUndefined)(s)||!this.parent.allowUnscheduledTasks):n=this.getValidStartDate(e),i.i(r.isNullOrUndefined)(n)||(a=this.getTaskLeft(n,l)),a},t.prototype.calculateAutoLeft=function(e){return this.getTaskLeft(e.autoStartDate,e.isMilestone)},t.prototype.calculateAutoDuration=function(e){return this.getDuration(e.autoStartDate,e.autoEndDate,e.durationUnit,!1,e.isMilestone)},t.prototype.calculateAutoWidth=function(e){return this.getTaskWidth(e.autoStartDate,e.autoEndDate)},t.prototype.calculateBaselineLeft=function(e){var t=this.getDateFromFormat(e.baselineStartDate),i=this.getDateFromFormat(e.baselineEndDate);return t&&i?this.getTaskLeft(t,e.isMilestone):0},t.prototype.calculateBaselineWidth=function(e){var t=this.getDateFromFormat(e.baselineStartDate),i=this.getDateFromFormat(e.baselineEndDate);return t&&i&&t.getTime()!==i.getTime()?this.getTaskWidth(t,i):0},t.prototype.getTaskWidth=function(e,t,n){var a=new Date(e.getTime()),s=new Date(t.getTime()),o="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,l=!1,d=new Date(e.getTime()),h=0;i.i(r.isNullOrUndefined)(n)||"hour"!=n.durationUnit||(d=new Date(d.getTime()+60*n.duration*60*1e3)),(!i.i(r.isNullOrUndefined)(n)&&"minute"==n.durationUnit||!i.i(r.isNullOrUndefined)(n)&&"day"==n.durationUnit&&n.duration<1)&&(d=new Date(d.getTime()+60*n.duration*1e3));for(var p=0;p<this.parent.dayWorkingTime.length;p++)h=h+this.parent.dayWorkingTime[p].to-this.parent.dayWorkingTime[p].from;var u=d.getTime()-a.getTime();return!i.i(r.isNullOrUndefined)(n)&&"minute"==n.durationUnit&&n.duration<60*h||!i.i(r.isNullOrUndefined)(n)&&"day"==n.durationUnit&&n.duration<1?("Day"===o?((Math.floor(u/36e5%24)>=h||0===u)&&(l=!0),this.getSecondsInDecimal(a)===this.parent.defaultStartTime&&l&&a.setHours(0,0,0,0),this.getSecondsInDecimal(s)===this.parent.defaultEndTime&&s.setHours(24),this.getSecondsInDecimal(s)===this.parent.defaultStartTime&&s.setHours(0,0,0,0)):l=!0,a.getTime()===s.getTime()?this.parent.perDayWidth:l?this.getTimeDifference(a,s)/864e5*this.parent.perDayWidth:this.getTimeDifference(a,s)/(36e5*h)*this.parent.perDayWidth):("Day"===o&&(this.getSecondsInDecimal(a)===this.parent.defaultStartTime&&a.setHours(0,0,0,0),this.getSecondsInDecimal(s)===this.parent.defaultEndTime&&s.setHours(24),this.getSecondsInDecimal(s)===this.parent.defaultStartTime&&s.setHours(0,0,0,0)),a.getTime()===s.getTime()?this.parent.perDayWidth:this.getTimeDifference(a,s)/864e5*this.parent.perDayWidth)},t.prototype.getTaskLeft=function(e,t){var i=new Date(e.getTime());"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(this.getSecondsInDecimal(i)===this.parent.defaultStartTime?i.setHours(0,0,0,0):t&&this.getSecondsInDecimal(i)===this.parent.defaultEndTime?i.setHours(24):this.getSecondsInDecimal(i)===this.parent.defaultEndTime&&this.parent.allowUnscheduledTasks&&i.setHours(22));var r=this.parent.timelineModule.timelineStartDate;return r?(i.getTime()-r.getTime())/864e5*this.parent.perDayWidth:0},t.prototype.getSplitTaskWidth=function(e,t,i){var r=new Date(e.getTime()),n=new Date(this.getEndDate(r,t,i.ganttProperties.durationUnit,i.ganttProperties,!1).getTime());return"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(this.getSecondsInDecimal(r)===this.parent.defaultStartTime&&r.setHours(0,0,0,0),this.getSecondsInDecimal(n)===this.parent.defaultEndTime&&n.setHours(24),this.getSecondsInDecimal(n)===this.parent.defaultStartTime&&n.setHours(0,0,0,0)),this.getTimeDifference(r,n)/864e5*this.parent.perDayWidth},t.prototype.getSplitTaskLeft=function(e,t){var i=new Date(e.getTime());return"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(this.getSecondsInDecimal(i)===this.parent.defaultStartTime&&i.setHours(0,0,0,0),this.getSecondsInDecimal(t)===this.parent.defaultStartTime&&t.setHours(0,0,0,0)),t?(i.getTime()-t.getTime())/864e5*this.parent.perDayWidth:0},t.prototype.updateMappingData=function(e,t){var n=this.parent.columnMapping,a=e.ganttProperties;if(!i.i(r.isNullOrUndefined)(n[t])||"taskType"===t||"segments"===t)if("predecessorName"===t);else if("resourceInfo"===t){var s=a.resourceInfo,o=this.parent.resourceFields,l=[],d=[];if(!i.i(r.isNullOrUndefined)(s))for(var h=0;h<s.length;h++){l.push(s[h][o.id]);var p=s[h][o.name],u=s[h][o.unit];100!==u&&(p+="["+u+"%]"),d.push(p)}this.parent.setRecordValue("resourceNames",d.join(","),a,!0),this.updateTaskDataResource(e),this.parent.setRecordValue(n[t],d.join(","),e)}else"startDate"===t||"endDate"===t?this.setRecordDate(e,a[t],n[t]):"duration"===t?this.setRecordDuration(e,n[t]):"work"===t?(this.parent.setRecordValue("taskData."+n[t],this.getWorkString(a.work,a.workUnit),e),this.parent.setRecordValue(n[t],a[t],e)):"type"===t?(this.parent.setRecordValue("taskData."+n[t],a[t],e),this.parent.setRecordValue(n[t],a[t],e)):"manual"===t?(this.parent.setRecordValue("taskData."+n[t],!a.isAutoSchedule,e),this.parent.setRecordValue(n[t],!a.isAutoSchedule,e)):"segments"===t?this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,this.segmentTaskData(e),e):(this.parent.setRecordValue("taskData."+n[t],a[t],e),this.parent.setRecordValue(n[t],a[t],e))},t.prototype.segmentTaskData=function(e){var t=e.ganttProperties.segments,n=this.parent.taskFields;if(i.i(r.isNullOrUndefined)(t))return null;for(var a=i.i(r.extend)([],[],e.taskData[n.segments],!0),s=0;s<t.length;s++)(this.parent.isEdit||this.parent.editModule&&this.parent.editModule.dialogModule&&i.i(r.getValue)("isEdit",this.parent.editModule.dialogModule)||this.parent.contextMenuModule&&i.i(r.getValue)("isEdit",this.parent.contextMenuModule))&&(a[s]={}),i.i(r.isNullOrUndefined)(n.startDate)||(a[s][this.parent.taskFields.startDate]=t[s].startDate),i.i(r.isNullOrUndefined)(n.endDate)||(a[s][this.parent.taskFields.endDate]=t[s].endDate),i.i(r.isNullOrUndefined)(n.duration)||(a[s][this.parent.taskFields.duration]=Number(t[s].duration));return a},t.prototype.updateTaskDataResource=function(e){var t=e.ganttProperties.resourceInfo,n=e.taskData[this.parent.taskFields.resourceInfo],a=this.parent.resourceFields;if(i.i(r.isNullOrUndefined)(n))e.taskData[this.parent.taskFields.resourceInfo]=t;else if(t.length){for(var s=0;s<t.length;s++){for(var o=!1,l=0;l<n.length;l++)if("number"==typeof n[l]||"string"==typeof n[l]){if(parseInt(n[l],10)===parseInt(t[s][a.id],10)){n[l]=t[s],o=!0;break}}else if(n[l][a.id]===t[s][a.id]&&"number"!=typeof n[l]){n[l]=i.i(r.extend)({},n[l],t[s],!0),o=!0;break}o||n.push(t[s])}for(var d=[],h=0;h<n.length;h++)!function(e){t.filter(function(t){t[a.id]===n[e][a.id]&&-1===d.indexOf(n[e])&&d.push(n[e])})}(h);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,d,e)}else this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e)},t.prototype.setRecordDate=function(e,t,n){var a="string"==typeof t?new Date(t):t;i.i(r.isNullOrUndefined)(t)||(t=new Date(a.getTime())),this.parent.setRecordValue(n,t,e),i.i(r.isNullOrUndefined)(t)||(t=new Date(a.getTime())),this.parent.isLoad||this.parent.isDynamicData||this.parent.setRecordValue("taskData."+n,t,e),this.parent.isDynamicData=!1},t.prototype.getDurationInDay=function(e,t){return"day"===t?e:"hour"===t?e/(this.parent.secondsPerDay/3600):e/(this.parent.secondsPerDay/60)},t.prototype.setRecordDuration=function(e,t){var n=e.ganttProperties.duration,a=e.ganttProperties.durationUnit;if(i.i(r.isNullOrUndefined)(n))this.parent.setRecordValue(t,n,e),this.parent.setRecordValue("taskData."+t,n,e);else{this.parent.setRecordValue(t,e.ganttProperties.duration,e);var s=i.i(r.getValue)(t,e.taskData);isNaN(s)&&i.i(r.isNullOrUndefined)(this.parent.taskFields.durationUnit)&&!i.i(r.isNullOrUndefined)(s)?this.parent.setRecordValue("taskData."+t,this.getDurationString(n,a),e):"string"==typeof s?this.parent.setRecordValue("taskData."+t,n.toString(),e):this.parent.setRecordValue("taskData."+t,n,e)}this.parent.taskFields.durationUnit&&(e.taskData[this.parent.taskFields.durationUnit]=e.ganttProperties.durationUnit)},t.prototype.setDataSource=function(e){for(var t=[],n=e.length,a=0;a<n;a++){var s=e[a];t.push(s),i.i(r.isNullOrUndefined)(e[a][this.parent.taskFields.child])||this.setDataSource(e[a][this.parent.taskFields.child])}return t},t.prototype.setStartDate=function(e){var t=this,n=[];n=i.i(r.isNullOrUndefined)(this.parent.taskFields.parentID)||i.i(r.isNullOrUndefined)(this.parent.taskFields.id)?this.parent.dataSource:this.setDataSource(this.parent.dataSource),n.map(function(n){e.ganttProperties.taskId===n[t.parent.taskFields.id]&&(i.i(r.isNullOrUndefined)(t.parent.taskFields.startDate)||(e[t.parent.taskFields.startDate]=n[t.parent.taskFields.startDate]),i.i(r.isNullOrUndefined)(t.parent.taskFields.endDate)||(e[t.parent.taskFields.endDate]=n[t.parent.taskFields.endDate]))})},t.prototype.getWorkInHour=function(e,t){return"day"===t?e*(this.parent.secondsPerDay/3600):"minute"===t?e/60:e},t.prototype.updateTaskData=function(e){var t=this.parent.taskFields,n=e.ganttProperties;if(!i.i(r.isNullOrUndefined)(e.taskData)){var a=e.taskData;if(t.id&&(this.parent.setRecordValue("taskData."+t.id,n.taskId,e),this.parent.setRecordValue(t.id,n.taskId,e)),t.name&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.name,n.taskName,e),this.parent.setRecordValue(t.name,n.taskName,e)),t.startDate&&this.setRecordDate(e,n.startDate,t.startDate),t.endDate&&this.setRecordDate(e,n.endDate,t.endDate),t.duration&&(i.i(r.isNullOrUndefined)(t.milestone)||e.taskData[t.milestone]||this.setRecordDuration(e,t.duration)),t.durationUnit&&(a[t.durationUnit]=n.durationUnit),t.progress&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.progress,n.progress,e),this.parent.setRecordValue(t.progress,n.progress,e)),t.baselineStartDate&&this.setRecordDate(e,n.baselineStartDate,t.baselineStartDate),t.baselineEndDate&&this.setRecordDate(e,n.baselineEndDate,t.baselineEndDate),t.notes&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.notes,n.notes,e),this.parent.setRecordValue(t.notes,n.notes,e)),t.cssClass&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.cssClass,n.cssClass,e),this.parent.setRecordValue(t.cssClass,n.cssClass,e)),t.indicators&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.indicators,n.indicators,e),this.parent.setRecordValue(t.indicators,n.indicators,e)),t.parentID){var s="ProjectView"===this.parent.viewType?n.parentId:a[t.parentID];this.parent.setRecordValue("taskData."+t.parentID,s,e),this.parent.setRecordValue(t.parentID,n.parentId,e)}t.work&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.work,this.getWorkString(n.work,n.workUnit),e),this.parent.setRecordValue(t.work,n.work,e)),t.type&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+t.type,n.taskType,e),this.parent.setRecordValue(t.type,n.taskType,e))}},t.prototype.setResourceInfo=function(e){var t;if(i.i(r.isNullOrUndefined)(e[this.parent.taskFields.resourceInfo]))return t;t=e[this.parent.taskFields.resourceInfo];var n;n=i.i(r.isNullOrUndefined)(this.parent.editModule)||i.i(r.isNullOrUndefined)(this.parent.editModule.dialogModule)||!this.parent.editModule.dialogModule.isAddNewResource?this.parent.resources:this.parent.editModule.dialogModule.ganttResources;for(var a=this.parent.resourceFields.id,s=this.parent.resourceFields.unit,o=this.parent.resourceFields.group,l=[],d=0;d<t.length;d++)!function(e){var d=n.filter(function(i){return"object"==typeof t[e]&&t[e][a]===i[a]||t[e]===i[a]}),h=i.i(r.extend)({},d[0]);l.push(h),i.i(r.isNullOrUndefined)(s)||i.i(r.isNullOrUndefined)(t[e][s])||(h[s]=t[e][s]),i.i(r.isNullOrUndefined)(o)||i.i(r.isNullOrUndefined)(t[e][o])||(h[o]=t[e][o])}(d);return this.updateResourceUnit(l),l},t.prototype.updateResourceUnit=function(e){var t=this.parent.resourceFields.unit;if(!i.i(r.isNullOrUndefined)(t)){var n=e.length,a=void 0;for(a=0;a<n;a++)i.i(r.isNullOrUndefined)(e[a][t])&&(e[a][t]=100)}},t.prototype.updateResourceName=function(e){var t=e.ganttProperties.resourceInfo,n=[],a=this.parent.taskFields;if(t){var s=t.length,o=i.i(r.extend)([],[],e.taskData[this.parent.taskFields.resourceInfo],!0);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e);for(var l=0;l<s;l++){var d=t[l],h=d[this.parent.resourceFields.name],p=d[this.parent.resourceFields.unit];if(100!==p&&(h+="["+p+"%]"),i.i(r.isNullOrUndefined)(h)||n.push(h),e.taskData){var u=a.resourceInfo;o[l],e.taskData[u].push(o[l])}}this.parent.setRecordValue("resourceNames",n.join(","),e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.resourceInfo,n.join(","),e,!0),this.updateTaskDataResource(e)}},t.prototype.dataReorder=function(e,t){for(var i=[];e.length>0&&t.length>0;){var r=t.indexOf(e[0]);-1===r?e.shift():(i.push(e.shift()),t.splice(r,1))}return i},t.prototype.validateDurationUnitMapping=function(e){var t=e;return t="minute"===t||"minutes"===t||"m"===t||"min"===t?"minute":"hour"===t||"hours"===t||"h"===t||"hr"===t?"hour":"day"===t||"days"===t||"d"===t?"day":this.parent.durationUnit.toLocaleLowerCase()},t.prototype.validateTaskTypeMapping=function(e){var t=e;return t="FixedDuration"===t?"FixedDuration":"FixedUnit"===t?"FixedUnit":"FixedWork"===t?"FixedWork":this.parent.taskType},t.prototype.validateWorkUnitMapping=function(e){var t=e;return t="minute"===t?"minute":"hour"===t?"hour":"day"===t?"day":this.parent.workUnit.toLocaleLowerCase()},t.prototype.updateDurationValue=function(e,t){var n=this.getDurationValue(e);isNaN(i.i(r.getValue)("duration",n))||"ResourceView"===this.parent.viewType&&0===n.duration||this.parent.setRecordValue("duration",i.i(r.getValue)("duration",n),t,!0),i.i(r.isNullOrUndefined)(i.i(r.getValue)("durationUnit",n))||this.parent.setRecordValue("durationUnit",i.i(r.getValue)("durationUnit",n),t,!0)},t.prototype.reUpdateGanttData=function(){if(this.parent.flatData.length>0){var e=void 0,t=void 0;this.parent.secondsPerDay=this.getSecondsPerDay();for(var n=0;n<this.parent.flatData.length;n++)e=this.parent.flatData[n].taskData,t=this.parent.flatData[n],i.i(r.isNullOrUndefined)(this.parent.taskFields.duration)||this.setRecordDuration(t,this.parent.taskFields.duration),this.parent.isLoad&&this.setStartDate(t),this.calculateScheduledValues(t,e,!1);this.updateGanttData()}},t.prototype._isInStartDateRange=function(e,t,i){var r=!1;return e.getTime()>=t.getTime()&&e.getTime()<i.getTime()&&(r=!0),r},t.prototype._isInEndDateRange=function(e,t,i){var r=!1;return e.getTime()>t.getTime()&&e.getTime()<=i.getTime()&&(r=!0),r},t.prototype.updateOverlappingValues=function(e){var t,i=e.childRecords,r=[];if(i.length<=1)return void(e.ganttProperties.workTimelineRanges=[]);i=this.setSortedChildTasks(e),this.updateOverlappingIndex(i);for(var n=1;n<i.length;n++){t=i[n];for(var a=new Date(t.ganttProperties.startDate.getTime()),s=new Date(t.ganttProperties.endDate.getTime()),o=[],l=0;l<n;l++){var d=i[l].ganttProperties.startDate,h=i[l].ganttProperties.endDate,p={};(this._isInStartDateRange(a,d,h)||this._isInEndDateRange(s,d,h))&&(d.getTime()>a.getTime()&&d.getTime()<s.getTime()&&h.getTime()>a.getTime()&&h.getTime()>=s.getTime()||a.getTime()===d.getTime()&&s.getTime()<=h.getTime()?(p.from=d,p.to=s):a.getTime()===d.getTime()&&s.getTime()>h.getTime()?(p.from=d,p.to=h):a.getTime()>d.getTime()&&s.getTime()>=h.getTime()?(p.from=a,p.to=h):a.getTime()>d.getTime()&&s.getTime()<h.getTime()&&(p.from=a,p.to=s),o.push(p))}r.push.apply(r,this.mergeRangeCollections(o))}this.parent.setRecordValue("workTimelineRanges",this.mergeRangeCollections(r,!0),e.ganttProperties,!0),this.calculateRangeLeftWidth(e.ganttProperties.workTimelineRanges)},t.prototype.updateOverlappingIndex=function(e){for(var t=0;t<e.length;t++)e[t].ganttProperties.eOverlapIndex=t},t.prototype.calculateRangeLeftWidth=function(e){for(var t=0;t<e.length;t++)e[t].left=this.getTaskLeft(e[t].from,!1),e[t].width=this.getTaskWidth(e[t].from,e[t].to)},t.prototype.mergeRangeCollections=function(e,t){for(var i,r,n,s,o=[],l={},d={},h=new a.DataManager(e).executeLocal((new a.Query).sortBy(this.parent.taskFields.startDate,"Ascending")),p=0;p<h.length;p++)0!==o.length||0!==p?(l=o[o.length-1],i=l.from,r=l.to,d=h[p],n=d.from,s=d.to,i.getTime()===n.getTime()&&r.getTime()>=s.getTime()||i.getTime()<n.getTime()&&r.getTime()>=s.getTime()||(i.getTime()<=n.getTime()&&r.getTime()>=n.getTime()&&r.getTime()<s.getTime()||r.getTime()<n.getTime()&&this.checkStartDate(r).getTime()===n.getTime()?l.to=s:r.getTime()<n.getTime()&&this.checkStartDate(r).getTime()!==n.getTime()&&o.push(h[p]))):o.push(h[p]);return t&&(o=this.splitRangeCollection(o)),o},t.prototype.setSortedChildTasks=function(e){return new a.DataManager(e.childRecords).executeLocal((new a.Query).sortBy(this.parent.taskFields.startDate,"Ascending"))},t.prototype.splitRangeCollection=function(e,t,i){var r;return r=this.parent.timelineModule.isSingleTier?"None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier,"Week"===r||"Month"===r||"Year"===r?e:"Day"===r?this.getRangeWithWeek(e,t,i):0===this.parent.workingTimeRanges[0].from&&86400===this.parent.workingTimeRanges[0].to?this.getRangeWithWeek(e,t,i):this.getRangeWithDay(e,t,i)},t.prototype.getRangeWithDay=function(e,t,i){for(var r=[],n=0;n<e.length;n++)r.push.apply(r,this.splitRangeForDayMode(e[n],t,i));return r},t.prototype.splitRangeForDayMode=function(e,t,n){var a=t||"from",s=n||"to",o=new Date(e[a]),l=new Date(e[s]),d=[],h={};if(o.getTime()<l.getTime())do{for(var p=new Date(o.getTime()),u=new Date(o.getTime()),c=0,g=this.parent.dataOperation.getSecondsInDecimal(o),f=-1,m=0;m<this.parent.workingTimeRanges.length;m++){var y=this.parent.workingTimeRanges[m];if(g>=y.from&&g<=y.to){f=m;break}}-1!==f&&(c=Math.round(this.parent.workingTimeRanges[f].to-g),u.setSeconds(u.getSeconds()+c));u.getTime()<l.getTime()?(h={},e.task&&(h.task=i.i(r.extend)([],e.task)),h[a]=p,h[s]=u,h.isSplit=!0,d.push(h)):(h={},e.task&&(h.task=i.i(r.extend)([],e.task)),h[a]=p,h[s]=l,h.isSplit=!0,d.push(h)),o=this.checkStartDate(u)}while(o.getTime()<l.getTime());else d.push(e);return d},t.prototype.getRangeWithWeek=function(e,t,i){for(var r=[],n=0;n<e.length;n++)r.push.apply(r,this.splitRangeForWeekMode(e[n],t,i));return r},t.prototype.splitRangeForWeekMode=function(e,t,n){var a=t||"from",s=n||"to",o=new Date(e[a]),l=new Date(e[a]),d=new Date(e[s]),h=!1,p=[],u={};if(l.setDate(l.getDate()+1),l.getTime()<d.getTime()){do{if(this.parent.dataOperation.isOnHolidayOrWeekEnd(l,null)){var c=new Date(l.getTime());c.setDate(l.getDate()-1),this.setTime(this.parent.defaultEndTime,c),u={},u[a]=o,u.isSplit=!0,u[s]=c,e.task&&(u.task=i.i(r.extend)([],e.task,!0)),o.getTime()!==c.getTime()&&p.push(u),o=this.checkStartDate(c),l=new Date(o.getTime()),h=!0}else l.setDate(l.getDate()+1)}while(l.getTime()<d.getTime());h?o.getTime()!==d.getTime()&&(u={},e.task&&(u.task=i.i(r.extend)([],e.task,!0)),u[a]=o,u[s]=d,u.isSplit=!0,p.push(u)):p.push(e)}else p.push(e);return p},t.prototype.updateGanttData=function(){for(var e=this.parent.flatData,t=e.length,i=0;i<t;i++){var r=e[i];this.updateTaskLeftWidth(r)}},t.prototype.updateTaskLeftWidth=function(e){var t=e.ganttProperties;e.hasChildRecords&&this.parent.autoCalculateDateScheduling||this.updateWidthLeft(e),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(t),t,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(t),t,!0);var i,r=[];e.parentItem&&(i=this.parent.getParentTask(e.parentItem),r=i.childRecords),i&&r.indexOf(e)===r.length-1&&!e.hasChildRecords&&this.parent.enableValidation?((this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType)&&this.updateParentItems(i),this.parent.autoCalculateDateScheduling||this.updateWidthLeft(i)):i&&!this.parent.enableValidation&&this.updateWidthLeft(i)},t.prototype.reUpdateGanttDataPosition=function(){var e;e=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.flatData;for(var t=e.length,i=0;i<t;i++){var r=e[i],n=r.ganttProperties;this.updateWidthLeft(r),"Auto"!==this.parent.taskMode&&r.hasChildRecords&&this.updateAutoWidthLeft(r),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(n),n,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(n),n,!0),this.parent.dataOperation.updateTaskData(r)}},t.prototype.updateWidthLeft=function(e){var t=e.ganttProperties;if(!i.i(r.isNullOrUndefined)(t.segments)&&t.segments.length>0){for(var n=t.segments,a=!0,s=this.splitTasksDuration(n)*("Hour"===this.parent.timelineModule.bottomTier||"Minutes"===this.parent.timelineModule.bottomTier?this.parent.timelineSettings.timelineUnitSize:this.parent.perDayWidth),o=this.parent.dataOperation.getProgressWidth(s,t.progress),l=0;l<n.length;l++){var d=n[l];if(0===l&&!i.i(r.isNullOrUndefined)(t.startDate)&&d.startDate.getTime()!==t.startDate.getTime()){d.startDate=t.startDate;var h=this.parent.dataOperation.getEndDate(d.startDate,d.duration,t.durationUnit,t,!1);d.endDate=this.parent.dataOperation.checkEndDate(h,t,!1),this.parent.chartRowsModule.incrementSegments(n,0,e)}if(d.width=this.getSplitTaskWidth(d.startDate,d.duration,e),d.showProgress=!1,d.progressWidth=-1,0!==l){var p=new Date(t.startDate.getTime());d.left=this.getSplitTaskLeft(d.startDate,p)}o>0&&o>d.width?(o-=d.width,d.progressWidth=d.width,d.showProgress=!1):a&&(d.progressWidth=o,d.showProgress=!0,o-=d.width,a=!1)}this.parent.setRecordValue("segments",t.segments,t,!0),this.parent.dataOperation.updateMappingData(e,"segments")}this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e),t,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(t),t,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.isAutoSchedule||!e.hasChildRecords?t.width:t.autoWidth,t.progress),t,!0)},t.prototype.updateAutoWidthLeft=function(e){var t=e.ganttProperties;this.parent.setRecordValue("autoWidth",this.calculateWidth(e,!0),t,!0),this.parent.setRecordValue("autoLeft",this.calculateLeft(t,!0),t,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.isAutoSchedule||!e.hasChildRecords?t.width:t.autoWidth,t.progress),t,!0)},t.prototype.getParentProgress=function(e){var t=0,n={};switch(e.ganttProperties.durationUnit){case"hour":t=e.ganttProperties.duration/(this.parent.secondsPerDay/3600);break;case"minute":t=e.ganttProperties.duration/(this.parent.secondsPerDay/60);break;default:t=e.ganttProperties.duration}return e.hasChildRecords?(i.i(r.setValue)("totalProgress",e.ganttProperties.totalProgress,n),i.i(r.setValue)("totalDuration",e.ganttProperties.totalDuration?e.ganttProperties.totalDuration:0,n)):(i.i(r.setValue)("totalProgress",e.ganttProperties.progress*t,n),i.i(r.setValue)("totalDuration",t,n)),n},t.prototype.resetDependency=function(e){var t=this.parent.taskFields.dependency;if(!i.i(r.isNullOrUndefined)(t)){var n=e.ganttProperties;this.parent.setRecordValue("predecessor",[],n,!0),this.parent.setRecordValue("predecessorsName",null,n,!0),this.parent.setRecordValue("taskData."+t,null,e),this.parent.setRecordValue(t,null,e)}},t.prototype.updateParentItems=function(e,t){var n=this,a=t?e:this.parent.getParentTask(e),o=!1,l=a.ganttProperties;if(this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType){if(a.childRecords.length>0){for(var d=l.isAutoSchedule?l.startDate:l.autoStartDate,h=l.isAutoSchedule?l.endDate:l.autoEndDate,p=a.childRecords,u=p.length,c=0,g={},f=null,m=null,y=0,D=0,v=0,w=void 0,k=this,b=0;b<u;b++)!function(e){if(w=!k.parent.loadChildOnDemand&&k.parent.taskFields.hasChildMapping?k.parent.currentViewData.filter(function(t){return t.ganttProperties.taskId===p[e][n.parent.taskFields.id]})[0]:p[e],k.parent.isOnDelete&&w.isDelete)return 1===u&&"ProjectView"===k.parent.viewType&&(o=!0),"continue";var t=k.getValidStartDate(w.ganttProperties);!a.hasChildRecords||l.isAutoSchedule||i.i(r.isNullOrUndefined)(w.ganttProperties.autoStartDate)||(t=w.ganttProperties.autoStartDate);var d=k.getValidEndDate(w.ganttProperties);!a.hasChildRecords||l.isAutoSchedule||i.i(r.isNullOrUndefined)(w.ganttProperties.autoEndDate)||(d=w.ganttProperties.autoEndDate),i.i(r.isNullOrUndefined)(f)&&(f=k.getDateFromFormat(t)),i.i(r.isNullOrUndefined)(m)&&(m=k.getDateFromFormat(d)),i.i(r.isNullOrUndefined)(d)||1!==k.compareDates(d,m)||(m=k.getDateFromFormat(d)),i.i(r.isNullOrUndefined)(t)||-1!==k.compareDates(t,f)||(f=k.getDateFromFormat(t)),!w.ganttProperties.isMilestone&&i.i(s.c)(w.ganttProperties)?(g=k.getParentProgress(w),D+=i.i(r.getValue)("totalProgress",g),w[k.parent.taskFields.duration]<1?(c+=i.i(r.getValue)("totalDuration",g),c=Number(c.toFixed(4))):c+=i.i(r.getValue)("totalDuration",g)):y++,v+=w.ganttProperties.work}(b);if(!o){var T=void 0;T=this.parent.isOnDelete&&w.isDelete?u-y-1:u-y;var S=T>0&&c>0?Number((D/c).toFixed(2)):0,P=a.ganttProperties,C=!(0!==T||!f||!m||f.getTime()!==m.getTime());0!==this.compareDates(d,f)&&(this.parent.setRecordValue(l.isAutoSchedule?"startDate":"autoStartDate",f,a.ganttProperties,!0),(i.i(r.isNullOrUndefined)(l.autoDuration)?0===l.duration:0===l.autoDuration)&&a.isManual&&C&&a.hasChildRecords&&a.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("startDate",f,a.ganttProperties,!0)),0!==this.compareDates(h,m)&&(this.parent.setRecordValue(l.isAutoSchedule?"endDate":"autoEndDate",m,a.ganttProperties,!0),(i.i(r.isNullOrUndefined)(l.autoDuration)?0===l.duration:0===l.autoDuration)&&a.isManual&&C&&a.hasChildRecords&&a.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("endDate",m,a.ganttProperties,!0)),this.parent.setRecordValue("isMilestone",C,P,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.milestone)||this.updateMappingData(a,"milestone"),P.isAutoSchedule&&this.calculateDuration(a),this.updateWorkWithDuration(a);var M=P.work;M=this.parent.isOnEdit?M:M+v,this.parent.setRecordValue("work",M,P,!0),this.parent.setRecordValue("taskType","FixedDuration",P,!0),i.i(r.isNullOrUndefined)(this.parent.taskFields.type)||this.updateMappingData(a,"type"),this.parent.setRecordValue("progress",Math.floor(S),P,!0),this.parent.setRecordValue("totalProgress",D,P,!0),this.parent.setRecordValue("totalDuration",c,P,!0),this.parent.setRecordValue("autoDuration",P.duration,P,!0),P.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(P),P,!0),this.updateAutoWidthLeft(a)),this.parent.allowParentDependency||this.resetDependency(a),this.updateWidthLeft(a),this.updateTaskData(a)}}}else a.ganttProperties.endDate=a.taskData[this.parent.taskFields.endDate];o&&1===a.childRecords.length&&0===a.ganttProperties.duration&&(this.parent.setRecordValue("isMilestone",!0,a.ganttProperties,!0),this.updateWidthLeft(a),this.updateTaskData(a));var R=this.parent.getParentTask(a.parentItem);R&&(this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType)&&this.updateParentItems(R),o=!1},t}(o.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(6),n=(i.n(r),i(0)),a=(i.n(n),i(4)),s=(i.n(a),i(19)),o=i(1),l=function(){function e(e){var t=this;this.previousScroll={top:0,left:0},this.queryCellInfo=function(e){t.parent.trigger("queryCellInfo",e)},this.headerCellInfo=function(e){t.parent.trigger("headerCellInfo",e)},this.rowDataBound=function(e){t.parent.trigger("rowDataBound",e)},this.columnMenuOpen=function(e){t.parent.notify("columnMenuOpen",e),t.parent.trigger("columnMenuOpen",e),document.querySelector(".e-colmenu").addEventListener("mousemove",function(e){var r=document.querySelector(".e-filter-popup"),a=document.querySelector(".e-filter-item");i.i(n.isNullOrUndefined)(r)||a.classList.contains("e-focused")||i.i(n.remove)(t.parent.filterModule.filterMenuElement)})},this.columnMenuClick=function(e){t.parent.trigger("columnMenuClick",e)},this.objectEqualityChecker=function(e,i){if(e){for(var r=Object.keys(e),n=!0,a=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","ganttProperties"],s=0;s<r.length;s++){if((e[r[s]]instanceof Date?new Date(e[r[s]]).getTime():e[r[s]])!==(i[r[s]]instanceof Date?new Date(i[r[s]]).getTime():i[r[s]])&&-1===a.indexOf(r[s])){t.parent.modifiedRecords.push(i),n=!1;break}}return n}return!1},this.parent=e,this.parent.treeGrid=new r.TreeGrid,this.parent.treeGrid.allowSelection=!1,this.parent.treeGrid.allowKeyboard=this.parent.allowKeyboard,this.parent.treeGrid["${enableHtmlSanitizer}"]=this.parent.enableHtmlSanitizer,this.parent.treeGrid.enableImmutableMode=this.parent.enableImmutableMode,this.treeGridColumns=[],!this.parent.isLocaleChanged&&this.parent.isLoad&&(this.parent.previousGanttColumns=i.i(n.extend)([],[],this.parent.columns,!0)),this.validateGanttColumns(),this.parent.isLocaleChanged&&(this.parent.isLocaleChanged=!1),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createContainer,this),this.parent.on("chartScroll",this.updateScrollTop,this),this.parent.on("destroy",this.destroy,this),this.parent.treeGrid.on("renderReactTemplate",this.renderReactTemplate,this)},e.prototype.renderReactTemplate=function(e){this.parent.portals=e,this.parent.renderTemplates()},e.prototype.createContainer=function(){this.treeGridElement=i.i(n.createElement)("div",{id:"treeGrid"+this.parent.element.id,className:"e-gantt-tree-grid"});var e=i.i(n.createElement)("div",{className:"e-gantt-temp-header"});this.parent.treeGridPane.appendChild(this.treeGridElement),this.treeGridElement.appendChild(e),this.parent.treeGridPane.classList.add("e-temp-content")},e.prototype.renderTreeGrid=function(){this.composeProperties(),this.bindEvents();this.parent.treeGrid.root=this.parent.root?this.parent.root:this.parent,this.parent.treeGrid.appendTo(this.treeGridElement),this.parent.treeGrid.grid&&this.parent.toolbarModule&&this.parent.isReact&&(this.parent.treeGrid.grid.portals=this.parent.portals),this.wireEvents()},e.prototype.composeProperties=function(){if(this.parent.treeGrid.hasChildMapping=this.parent.taskFields.hasChildMapping,this.parent.treeGrid.loadChildOnDemand=this.parent.loadChildOnDemand,this.parent.treeGrid.isFromGantt=!0,this.parent.treeGrid.parentIdMapping=this.parent.taskFields.parentID,this.parent.treeGrid.idMapping=this.parent.taskFields.id,this.parent.treeGrid.showColumnMenu=this.parent.showColumnMenu,this.parent.treeGrid.enableCollapseAll=this.parent.collapseAllParentTasks,this.parent.treeGrid.columnMenuItems=this.parent.columnMenuItems,this.parent.treeGrid.enableRtl=this.parent.enableRtl,this.parent.treeGrid.childMapping=i.i(n.isNullOrUndefined)(this.parent.taskFields.child)?"":this.parent.taskFields.child,this.parent.treeGrid.treeColumnIndex=this.parent.treeColumnIndex,this.parent.treeGrid.columns=this.treeGridColumns,this.parent.treeGrid.loadingIndicator=this.parent.loadingIndicator,this.parent.treeGrid.enableVirtualMaskRow=this.parent.enableVirtualMaskRow,this.parent.dataSource instanceof Object&&i.i(o.i)(this.parent)){this.parent.treeGrid.hasChildMapping="isParent";var e=i.i(n.getValue)("count",this.parent.dataSource);this.parent.treeGrid.dataSource={result:this.parent.flatData,count:e}}else!this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(this.parent.autoCalculateDateScheduling=!1,this.parent.treeGrid.dataSource=this.parent.dataSource):(this.parent.treeGrid.hasChildMapping=null,this.parent.treeGrid.dataSource=this.parent.flatData);this.parent.treeGrid.expandStateMapping=this.parent.taskFields.expandState;this.parent.treeGrid.isGantt=!0,this.parent.treeGrid.rowHeight=this.parent.rowHeight,this.parent.treeGrid.gridLines=this.parent.gridLines,0===this.parent.searchSettings.fields.length&&""===this.parent.searchSettings.key||(this.parent.treeGrid.searchSettings=this.parent.searchSettings);this.parent.treeGrid.isJsComponent=!0;i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||i.i(n.isNullOrUndefined)(this.parent.toolbarModule.element)||this.parent.toolbarModule.element.offsetHeight,this.parent.treeGrid.height=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].offsetHeight-19},e.prototype.getContentDiv=function(){return this.treeGridElement.querySelector(".e-content")},e.prototype.getHeaderDiv=function(){return this.treeGridElement.querySelector(".e-headercontent")},e.prototype.getScrollbarWidth=function(){var e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar";var t=document.createElement("div");e.appendChild(t),this.parent.element.appendChild(e);var i=e.offsetWidth-t.offsetWidth;return e.parentNode.removeChild(e),i},e.prototype.ensureScrollBar=function(){var e=this.getContentDiv(),t=this.getHeaderDiv(),i=this.getScrollbarWidth(),r=/Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);0!==i?e.style.cssText+="width: calc(100% + "+(i+1)+"px);":e.classList.add("e-gantt-scroll-padding"),0===i&&r&&(t.style.cssText+="width: calc(100% + 17px);")},e.prototype.bindEvents=function(){this.parent.treeGrid.dataBound=this.dataBound.bind(this),this.parent.treeGrid.collapsing=this.collapsing.bind(this),this.parent.treeGrid.collapsed=this.collapsed.bind(this),this.parent.treeGrid.expanding=this.expanding.bind(this),this.parent.treeGrid.expanded=this.expanded.bind(this),this.parent.treeGrid.actionBegin=this.actionBegin.bind(this),this.parent.treeGrid.actionComplete=this.treeActionComplete.bind(this),this.parent.treeGrid.created=this.created.bind(this),this.parent.treeGrid.actionFailure=this.actionFailure.bind(this),this.parent.treeGrid.queryCellInfo=this.queryCellInfo.bind(this),this.parent.treeGrid.headerCellInfo=this.headerCellInfo.bind(this),this.parent.treeGrid.rowDataBound=this.rowDataBound.bind(this),this.parent.treeGrid.columnMenuOpen=this.columnMenuOpen.bind(this),this.parent.treeGrid.columnMenuClick=this.columnMenuClick.bind(this),this.parent.treeGrid.beforeDataBound=this.beforeDataBound.bind(this),this.parent.treeGrid.dataStateChange=this.dataStateChange.bind(this)},e.prototype.beforeDataBound=function(e){this.parent.updatedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?i.i(n.getValue)("virtualScrollModule.visualData",this.parent.treeGrid):i.i(n.getValue)("result",e),this.parent.virtualScrollModule&&this.parent.enableVirtualization&&this.parent.updateContentHeight(e),i.i(n.setValue)("contentModule.objectEqualityChecker",this.objectEqualityChecker,this.parent.treeGrid.grid)},e.prototype.dataBound=function(e){this.ensureScrollBar(),this.parent.treeDataBound(e),this.parent.isVirtualScroll&&((this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization||this.parent.enableVirtualization&&!this.parent.enableVirtualMaskRow&&"Shimmer"===this.parent.loadingIndicator.indicatorType||"Shimmer"===this.parent.loadingIndicator.indicatorType)&&this.parent.hideMaskRow(),this.parent.isVirtualScroll=!1),this.prevCurrentView=i.i(n.extend)([],[],this.parent.currentViewData,!0)},e.prototype.dataStateChange=function(e){e.action&&"refresh"===e.action.requestType&&(this.parent.treeGrid.dataSource={result:i.i(n.getValue)("result",this.parent.treeGrid.dataSource),count:i.i(n.getValue)("count",this.parent.treeGrid.dataSource)}),this.parent.trigger("dataStateChange",e)},e.prototype.collapsing=function(e){var t,r=(new a.Deferred,i.i(n.getValue)("data",e)),s=r.length;if(!this.parent.ganttChartModule.isExpandCollapseFromChart)if(i.i(n.isNullOrUndefined)(s))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.collapseGanttRow(t),i.i(n.setValue)("cancel",i.i(n.getValue)("cancel",t),e);else{for(var o=0;o<s;o++)t=this.createExpandCollapseArgs(e,r[o]),this.parent.ganttChartModule.collapseGanttRow(t);i.i(n.setValue)("cancel",i.i(n.getValue)("cancel",t),e)}},e.prototype.expanding=function(e){var t,r=(new a.Deferred,i.i(n.getValue)("data",e)),s=r.length;if(!this.parent.ganttChartModule.isExpandCollapseFromChart)if(i.i(n.isNullOrUndefined)(s))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.expandGanttRow(t),i.i(n.setValue)("cancel",i.i(n.getValue)("cancel",t),e);else{for(var o=0;o<s;o++)t=this.createExpandCollapseArgs(e,r[o]),this.parent.ganttChartModule.expandGanttRow(t);i.i(n.setValue)("cancel",i.i(n.getValue)("cancel",t),e)}},e.prototype.collapsed=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var t=void 0,r=i.i(n.getValue)("data",e),a=r.length;if(i.i(n.isNullOrUndefined)(a))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.collapsedGanttRow(t);else for(var s=0;s<a;s++)t=this.createExpandCollapseArgs(e,r[s]),this.parent.ganttChartModule.collapsedGanttRow(t);"ResourceView"!==this.parent.viewType||this.parent.allowTaskbarOverlap||this.parent.ganttChartModule.isCollapseAll||!t.gridRow||(t.gridRow.style.height=t.chartRow.style.height,this.parent.contentHeight=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.trigger("collapsed",e)},e.prototype.expanded=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var t=void 0,r=i.i(n.getValue)("data",e),a=r.length;if(i.i(n.isNullOrUndefined)(a))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.expandedGanttRow(t);else for(var s=0;s<a;s++)t=this.createExpandCollapseArgs(e,r[s]),this.parent.ganttChartModule.expandedGanttRow(t);"ResourceView"!==this.parent.viewType||this.parent.allowTaskbarOverlap||this.parent.ganttChartModule.isExpandAll||!e.row||(e.row.style.height=this.parent.rowHeight+"px",this.parent.contentHeight=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.trigger("expanded",e)},e.prototype.actionBegin=function(e){this.parent.notify("actionBegin",e),null!==i.i(n.getValue)("doubleClickTarget",this.parent.treeGrid.editModule)&&i.i(n.setValue)("doubleClickTarget",null,this.parent.treeGrid.editModule),this.parent.trigger("actionBegin",e),"virtualscroll"!=e.requestType&&"edit"!=e.type&&"beginEdit"!=e.requestType&&(i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow())},e.prototype.created=function(e){this.updateKeyConfigSettings()},e.prototype.actionFailure=function(e){this.parent.trigger("actionFailure",e)},e.prototype.createExpandCollapseArgs=function(e,t){var r,a=i.i(n.getValue)("data",e),s=a.length;if(i.i(n.isNullOrUndefined)(s)){var o=i.i(n.getValue)("data",e),l=i.i(n.getValue)("row",e);r=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(o)];var d={data:o,gridRow:l,chartRow:r,cancel:!1};return d}var l=i.i(n.getValue)("row",e);r=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(t)];var d={data:t,gridRow:l,chartRow:r,cancel:!1};return d},e.prototype.treeActionComplete=function(e){var t=this,r=i.i(n.extend)({},e);if("sorting"===i.i(n.getValue)("requestType",e))this.parent.notify("updateModel",{}),i.i(n.deleteObject)(r,"isFrozen");else if("filtering"===i.i(n.getValue)("requestType",e)){this.parent.notify("updateModel",{});var a=this.parent.element.querySelector(".e-treegrid");a.focus()}else if("save"===i.i(n.getValue)("type",e)&&this.parent.editModule&&this.parent.editModule.cellEditModule){var s=i.i(n.getValue)("data",e);i.i(n.isNullOrUndefined)(s)||i.i(n.isNullOrUndefined)(this.parent.getTaskByUniqueID(s.uniqueID))||(this.parent.getTaskByUniqueID(s.uniqueID).taskData[this.parent.taskFields.duration]=s.taskData[this.parent.taskFields.duration],i.i(n.isNullOrUndefined)(s.taskData[this.parent.taskFields.resourceInfo])||(this.parent.getTaskByUniqueID(s.uniqueID).taskData[this.parent.taskFields.resourceInfo]=s.taskData[this.parent.taskFields.resourceInfo])),this.parent.editModule.cellEditModule.initiateCellEdit(e,this.currentEditRow),this.parent.editModule.cellEditModule.isCellEdit=!1,this.currentEditRow={}}if("filterafteropen"===i.i(n.getValue)("requestType",e)&&this.parent.notify("actionComplete",e),"searching"===i.i(n.getValue)("requestType",e)&&this.parent.notify("actionComplete",e),i.i(n.isNullOrUndefined)(i.i(n.getValue)("batchChanges",e))||i.i(n.isNullOrUndefined)(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.parent.isCancelled&&(i.i(n.setValue)("requestType","cancel",r),i.i(n.setValue)("action","CellEditing",r),this.parent.isCancelled=!1),"refresh"===i.i(n.getValue)("requestType",e)&&i.i(n.isNullOrUndefined)(i.i(n.getValue)("type",e))&&this.parent.addDeleteRecord){if(-1!=this.parent.selectedRowIndex)this.parent.selectRow(this.parent.selectedRowIndex),this.parent.selectedRowIndex>this.parent.currentViewData.length-1&&(this.parent.selectedRowIndex=-1);else{var o=0;this.parent.currentViewData.map(function(e,r){(!i.i(n.isNullOrUndefined)(t.parent.currentSelection)&&e.ganttProperties.taskId===t.parent.currentSelection[t.parent.taskFields.id]||!i.i(n.isNullOrUndefined)(t.parent.currentSelection)&&e.ganttProperties.taskId===t.parent.currentSelection.taskId)&&(o=r)}),this.addedRecord=!0,this.parent.selectRow(i.i(n.isNullOrUndefined)(o)?0:o)}this.parent.addDeleteRecord=!1}if(this.parent.trigger("actionComplete",r),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation){for(var l=0;l<this.parent.currentViewData.length;l++)this.parent.currentViewData[l].hasChildRecords&&!this.parent.currentViewData[l].expanded&&this.parent.chartRowsModule.updateDragDropRecords(this.parent.currentViewData[l]);this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}i.i(n.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.updateKeyConfigSettings=function(){delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.delete,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.insert,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlHome,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlEnd,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.shiftTab,delete this.parent.treeGrid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.keyboardModule.keyConfigs.shiftTab},e.prototype.wireEvents=function(){var e=this.parent.treeGrid.element.querySelector(".e-content");e&&n.EventHandler.add(e,"scroll",this.scrollHandler,this),this.parent.isAdaptive&&n.EventHandler.add(this.parent.treeGridPane,"click",this.treeGridClickHandler,this)},e.prototype.unWireEvents=function(){var e=this.parent.treeGrid.element&&this.parent.treeGrid.element.querySelector(".e-content");e&&n.EventHandler.remove(e,"scroll",this.scrollHandler),this.parent.isAdaptive&&n.EventHandler.remove(this.parent.treeGridPane,"click",this.treeGridClickHandler)},e.prototype.scrollHandler=function(e){var t=this.parent.treeGrid.element.querySelector(".e-content");t.scrollTop!==this.previousScroll.top&&this.parent.notify("grid-scroll",{top:t.scrollTop}),this.previousScroll.top=t.scrollTop,this.parent.contextMenuModule&&this.parent.contextMenuModule.isOpen&&this.parent.contextMenuModule.contextMenu.close()},e.prototype.validateGanttColumns=function(){var e=this.parent,t=e.columns.length,r=this.parent.taskFields;this.parent.columnMapping={},this.parent.columnByField={},this.parent.customColumns=[];for(var a=["id","name","startDate","endDate","duration","dependency","progress","baselineStartDate","baselineEndDate","resourceInfo","notes","work","manual","type","milestone"],s=this,o=0;o<t;o++)!function(t){var i={};"string"==typeof e.columns[t]?i.field=e.columns[t]:i=e.columns[t];var n=[];if(a.length>0&&(n=a.filter(function(e){return i.field===r[e]})),0===n.length)return i.field===s.parent.resourceFields.group?"continue":(s.parent.customColumns.push(i.field),i.headerText=i.headerText?i.headerText:i.field,i.width=i.width?i.width:150,i.editType=i.editType?i.editType:"stringedit",i.type=i.type?i.type:"string",s.bindTreeGridColumnProperties(i,!0),"continue");var o=a.indexOf(n[0]);a.splice(o,1),s.createTreeGridColumn(i,!0),s.parent.columnMapping[n[0]]=i.field}(o);for(var l=0;l<a.length;l++){var d={};i.i(n.isNullOrUndefined)(r[a[l]])||(d.field=r[a[l]],this.createTreeGridColumn(d,0===t),this.parent.columnMapping[a[l]]=d.field)}if("ProjectView"!==this.parent.viewType){var d={};this.composeUniqueIDColumn(d),this.createTreeGridColumn(d,!0)}},e.prototype.createTreeGridColumn=function(e,t){var r=this.parent.taskFields,s=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];if(e.disableHtmlEncode=i.i(n.isNullOrUndefined)(e.disableHtmlEncode)?this.parent.disableHtmlEncode:e.disableHtmlEncode,r.id!==e.field&&(e.clipMode=e.clipMode?e.clipMode:"EllipsisWithTooltip"),r.id===e.field)this.composeIDColumn(e);else if(r.name===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("name"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("name"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type=e.type?e.type:"string";else if(r.startDate===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("startDate"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("startDate"),e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.width=e.width?e.width:150,e.edit&&e.edit.params?e.edit.params.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent):e.edit?e.edit.params={renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}:e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.endDate===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("endDate"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("endDate"),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.width=e.width?e.width:150,e.edit&&e.edit.params?e.edit.params.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent):e.edit?e.edit.params={renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}:e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.duration===e.field)e.width=e.width?e.width:150,this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("duration"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("duration"),e.valueAccessor=e.valueAccessor?e.valueAccessor:i.i(n.isNullOrUndefined)(e.edit)?this.durationValueAccessor.bind(this):null,e.editType=e.editType?e.editType:"stringedit",e.type=e.type?e.type:"string";else if(r.progress===e.field)this.composeProgressColumn(e);else if(r.dependency===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("dependency"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("dependency"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type="string",e.allowFiltering=!1!==e.allowFiltering;else if(r.resourceInfo===e.field)this.composeResourceColumn(e);else if(r.notes===e.field)this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("notes"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("notes"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",this.parent.showInlineNotes||e.template||(e.template='<div class="e-ganttnotes-info"><span class="e-icons e-notes-info"></span></div>');else if(r.baselineStartDate===e.field||r.baselineEndDate===e.field){var o=r.baselineEndDate===e.field?"baselineEndDate":"baselineStartDate";e.width=e.width?e.width:150,this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant(o):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant(o),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"}else r.work===e.field?(this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("work"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("work"),e.width=e.width?e.width:150,e.valueAccessor=e.valueAccessor?e.valueAccessor:this.workValueAccessor.bind(this),e.editType=e.editType?e.editType:"numericedit"):r.type===e.field?(this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("taskType"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskType"),e.width=e.width?e.width:150,e.editType="dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.taskTypeValueAccessor.bind(this)):r.manual===e.field&&"Custom"===this.parent.taskMode&&(this.parent.isLocaleChanged&&s?e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("taskMode"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskMode"),e.width=e.width?e.width:120,e.editType=e.editType?e.editType:"dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.modeValueAccessor.bind(this),e.edit={params:{query:new a.Query,dataSource:[{id:1,text:this.parent.localeObj.getConstant("manual"),value:!0},{id:2,text:this.parent.localeObj.getConstant("auto"),value:!1}],fields:{text:"text",value:"value"}}});this.bindTreeGridColumnProperties(e,t)},e.prototype.composeResourceColumn=function(e){var t=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];this.parent.isLocaleChanged&&t?e.headerText=t.headerText?t.headerText:this.parent.localeObj.getConstant("resourceName"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("resourceName"),e.width=e.width?e.width:150,e.type="string",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.resourceValueAccessor.bind(this),e.allowFiltering=!1!==e.allowFiltering},e.prototype.getResourceIds=function(e){var t=i.i(n.getValue)(this.parent.taskFields.resourceInfo,e.taskData),r=[];if(i.i(n.isNullOrUndefined)(t))return t;for(var a=0;a<t.length;a++)r.push("object"==typeof t[a]?t[a][this.parent.resourceFields.id]:t[a]);return r},e.prototype.composeIDColumn=function(e){var t,r="ProjectView"===this.parent.viewType,a=this.parent.dataSource.length;if(e.isPrimaryKey=!!r,this.parent.isLocaleChanged){var s=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];s&&(e.headerText=s.headerText?s.headerText:this.parent.localeObj.getConstant("id"))}else e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("id");e.width=e.width?e.width:100;for(var o=0;o<a;o++)if(!i.i(n.isNullOrUndefined)(this.parent.dataSource[o][this.parent.taskFields.id])){t=this.parent.dataSource[o][this.parent.taskFields.id];break}"string"==typeof t||i.i(n.isNullOrUndefined)(t)?("ResourceView"===this.parent.viewType?e.allowEditing=!!e.allowEditing&&e.allowEditing:e.allowEditing=!e.allowEditing||e.allowEditing,e.editType=e.editType?e.editType:"stringedit"):(e.allowEditing=!!e.allowEditing&&e.allowEditing,e.editType=e.editType?e.editType:"numericedit"),e.valueAccessor=r?null:this.idValueAccessor.bind(this)},e.prototype.composeUniqueIDColumn=function(e){e.field="rowUniqueID",e.isPrimaryKey=!0,e.headerText="UniqueID",e.allowEditing=!1,e.visible=!1},e.prototype.composeProgressColumn=function(e){var t=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];this.parent.isLocaleChanged&&t?e.headerText=t.headerText?t.headerText:this.parent.localeObj.getConstant("progress"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("progress"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"numericedit"},e.prototype.bindTreeGridColumnProperties=function(e,t){for(var i={},r={},n=0,a=Object.keys(e);n<a.length;n++){var o=a[n];i[o]=r[o]=e[o]}this.parent.columnByField[r.field]=r,this.parent.ganttColumns.push(new s.a(r)),t&&this.treeGridColumns.push(i)},e.prototype.durationValueAccessor=function(e,t,r){var a=t.ganttProperties;return i.i(n.isNullOrUndefined)(a)?!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.dataOperation.getDurationString(parseInt(t[this.parent.taskFields.duration]),this.parent.durationUnit):"":this.parent.dataOperation.getDurationString(a.duration,a.durationUnit)},e.prototype.resourceValueAccessor=function(e,t,r){var a=t.ganttProperties;return i.i(n.isNullOrUndefined)(a)?"":a.resourceNames},e.prototype.workValueAccessor=function(e,t,r){var a=t.ganttProperties;return i.i(n.isNullOrUndefined)(a)?"":this.parent.dataOperation.getWorkString(a.work,a.workUnit)},e.prototype.taskTypeValueAccessor=function(e,t,r){var a=t.ganttProperties;return i.i(n.isNullOrUndefined)(a)?"":a.taskType},e.prototype.modeValueAccessor=function(e,t,i){return t[e]?"Manual":"Auto"},e.prototype.idValueAccessor=function(e,t,i){return 0===t.level?"R-"+t.ganttProperties.taskId:"T-"+t.ganttProperties.taskId},e.prototype.updateScrollTop=function(e){var t;t=i.i(n.getValue)("top",e),this.treeGridElement.querySelector(".e-content").scrollTop=t,this.previousScroll.top=this.treeGridElement.querySelector(".e-content").scrollTop},e.prototype.treeGridClickHandler=function(e){this.parent.notify("treeGridClick",e)},e.prototype.removeEventListener=function(){this.parent.off("renderPanels",this.createContainer),this.parent.off("chartScroll",this.updateScrollTop),this.parent.off("destroy",this.destroy),this.parent.treeGrid.off("reactTemplateRender",this.renderReactTemplate)},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.parent.treeGrid.element&&this.parent.treeGrid.destroy()},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(2),n=(i.n(r),i(7)),a=i(0),s=(i.n(a),i(5)),o=(i.n(s),i(1)),l=function(){function e(e){this.totalColumnWidth=0,this.beforeSinglePageExport={},this.baselineHeight=8,this.parent=e}return e.prototype.processToFit=function(){this.beforeSinglePageExport.zoomingProjectStartDate=this.parent.zoomingProjectStartDate,this.beforeSinglePageExport.zoomingProjectEndDate=this.parent.zoomingProjectEndDate,this.beforeSinglePageExport.cloneProjectStartDate=this.parent.cloneProjectStartDate,this.beforeSinglePageExport.cloneProjectEndDate=this.parent.cloneProjectEndDate,this.beforeSinglePageExport.customTimelineSettings=i.i(a.extend)({},this.parent.timelineModule.customTimelineSettings,null,!0),this.beforeSinglePageExport.isTimelineRoundOff=this.parent.isTimelineRoundOff,this.beforeSinglePageExport.topTier=this.parent.timelineModule.topTier,this.beforeSinglePageExport.topTierCellWidth=this.parent.timelineModule.topTierCellWidth,this.beforeSinglePageExport.topTierCollection=this.parent.timelineModule.topTierCollection,this.beforeSinglePageExport.bottomTier=this.parent.timelineModule.bottomTier,this.beforeSinglePageExport.bottomTierCellWidth=this.parent.timelineModule.bottomTierCellWidth,this.beforeSinglePageExport.bottomTierCollection=this.parent.timelineModule.bottomTierCollection,this.beforeSinglePageExport.totalTimelineWidth=this.parent.timelineModule.totalTimelineWidth,this.beforeSinglePageExport.timelineStartDate=this.parent.timelineModule.timelineStartDate,this.beforeSinglePageExport.timelineEndDate=this.parent.timelineModule.timelineEndDate,this.beforeSinglePageExport.timelineRoundOffEndDate=this.parent.timelineModule.timelineRoundOffEndDate,this.beforeSinglePageExport.perDayWidth=this.parent.perDayWidth,this.beforeSinglePageExport.updatedConnectorLineCollection=i.i(a.extend)([],this.parent.updatedConnectorLineCollection,null,!0),this.parent.timelineModule.isZoomToFit=!0,this.parent.timelineModule.isZooming=!1,this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.zoomingProjectStartDate>this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=new Date(this.parent.allowUnscheduledTasks?this.parent.zoomingProjectStartDate:this.parent.cloneProjectStartDate)),this.parent.dataOperation.calculateProjectDates();var e,t,r=this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime(),n=r/864e5;this.exportProps.fitToWidthSettings.gridWidth&&(t=parseInt(this.exportProps.fitToWidthSettings.gridWidth.split("%")[0])),e=this.exportProps.fitToWidthSettings.chartWidth?parseInt(this.exportProps.fitToWidthSettings.chartWidth.split("%")[0]):this.exportProps.fitToWidthSettings.gridWidth?100-t:70;var s,o,l,d=this.parent.pdfExportModule.pdfPageDimensions.width*e/100,h=d,p=h/n,u=this.parent.zoomingLevels.slice(),c=u.sort(function(e,t){return e.perDayWidth||t.perDayWidth?e.perDayWidth<t.perDayWidth?1:-1:0});if(0!==p){for(var g=0;g<c.length;g++){if(o=c[g],g===c.length-1){s=c[g];break}if(l=c[g+1],p>=o.perDayWidth){s=c[g];break}if(p<o.perDayWidth&&p>l.perDayWidth){s=c[g+1];break}}var f=i.i(a.extend)({},{},s,!0);this.parent.timelineModule.roundOffDateToZoom(this.parent.cloneProjectStartDate,!0,p,f.bottomTier.unit,s),this.parent.timelineModule.roundOffDateToZoom(this.parent.cloneProjectEndDate,!1,p,f.bottomTier.unit,s);var m=this.parent.timelineModule.calculateNumberOfTimelineCells(f),y=this.parent.pdfExportModule.pdfPageDimensions.height,D=this.parent.pdfExportModule.pdfPageDimensions.height,v=D<=y?0:17;f.timelineUnitSize=Math.abs(h-v)/m,this.parent.timelineModule.changeTimelineSettings(f),this.parent.timelineModule.isZoomToFit=!1,this.parent.timelineModule.isZooming=!1}},e.prototype.processGridExport=function(e,t,r){this.flatData=e,this.gantt=t,this.exportValueFormatter=new d(this.parent.locale),this.exportProps=r,this.rowIndex=0,this.colIndex=0,this.columns=this.parent.treeGrid.columns,this.gantt.treeColumnIndex=this.parent.treeColumnIndex,this.gantt.rowHeight=i.i(o.b)(this.parent.rowHeight),this.gantt.style.cellPadding.left=0,this.gantt.style.cellPadding.right=0,this.ganttStyle=this.gantt.ganttStyle,this.gantt.borderColor=this.ganttStyle.chartGridLineColor,this.parent.pdfExportModule.isPdfExport=!0,this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth&&this.processToFit(),this.processHeaderContent(),this.processGanttContent(),this.processTimeline(),this.processTaskbar(),this.processPredecessor(),this.parent.pdfExportModule.isPdfExport=!1},e.prototype.processHeaderContent=function(){var e=this;this.rowIndex++,this.row=this.gantt.rows.addRow();var t=0;this.columns.forEach(function(i){e.isColumnVisible(i)&&(e.processColumnHeader(i,t),t++)})},e.prototype.processColumnHeader=function(e,t){this.gantt.columns.add(1);var n=this.gantt.columns.getColumn(t);this.parent.treeColumnIndex===t&&(n.isTreeColumn=!0);var a=parseInt(e.width,10);n.width=i.i(o.b)(a),this.totalColumnWidth+=n.width,n.headerText=e.headerText,n.field=e.field;var s=this.row.cells.getCell(t);s.value=e.headerText,s.isHeaderCell=!0;var l=this.parent.timelineModule.isSingleTier?45:60;this.copyStyles(this.ganttStyle.columnHeader,s,!1),this.row.height=i.i(o.b)(l),e.headerTextAlign&&(s.style.format.alignment=r.PdfTextAlignment[e.headerTextAlign]);var d={cell:s,style:s.style,value:s.value,column:e};this.parent.pdfColumnHeaderQueryCellInfo&&this.parent.trigger("pdfColumnHeaderQueryCellInfo",d),s.value=d.value},e.prototype.isColumnVisible=function(e){var t=e.visible||this.exportProps.includeHiddenColumn,r=!!i.i(a.isNullOrUndefined)(e.template);return t&&r},e.prototype.processGanttContent=function(){var e=this;if(0===this.flatData.length)this.renderEmptyGantt();else{var t=void 0;t=this.flatData,t.forEach(function(t){e.row=e.gantt.rows.addRow(),t.hasChildRecords?(e.gantt.rows.getRow(e.rowIndex).isParentRow=!0,e.processRecordRow(t)):e.processRecordRow(t),e.exportProps.fitToWidthSettings&&e.exportProps.fitToWidthSettings.isFitToWidth&&(e.row.height=33.33),e.rowIndex++})}},e.prototype.processTimeline=function(){var e=this.parent.timelineModule;this.gantt.chartHeader.topTierHeight=this.gantt.chartHeader.bottomTierHeight=this.parent.timelineModule.isSingleTier?45:30,this.gantt.chartHeader.topTierCellWidth=e.topTierCellWidth,this.gantt.chartHeader.bottomTierCellWidth=e.bottomTierCellWidth,this.gantt.chartHeader.topTier=i.i(a.extend)([],[],e.topTierCollection,!0),this.gantt.chartHeader.bottomTier=i.i(a.extend)([],[],e.bottomTierCollection,!0),this.gantt.chartHeader.width=e.totalTimelineWidth,this.gantt.chartHeader.height=this.gantt.rows.getRow(0).height,this.gantt.timelineStartDate=new Date(e.timelineStartDate.getTime())},e.prototype.processPredecessor=function(){var e=this;(i.i(a.isNullOrUndefined)(this.exportProps.showPredecessorLines)||this.exportProps.showPredecessorLines)&&(this.parent.pdfExportModule.isPdfExport=!0,this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.updatedConnectorLineCollection.forEach(function(t){var r=e.gantt.predecessor.add();r.parentLeft=t.parentLeft,r.childLeft=t.childLeft,r.parentWidth=t.parentWidth,r.childWidth=t.childWidth,r.parentIndex=t.parentIndex,r.childIndex=t.childIndex,r.rowHeight=t.rowHeight,r.type=t.type,r.milestoneParent=t.milestoneParent,r.milestoneChild=t.milestoneChild,r.parentEndPoint=t.parentEndPoint,r.lineWidth=e.parent.connectorLineWidth>5?i.i(o.b)(5):i.i(o.b)(e.parent.connectorLineWidth),t.isCritical?r.connectorLineColor=e.ganttStyle.criticalConnectorLineColor:r.connectorLineColor=e.ganttStyle.connectorLineColor,e.ganttStyle.connectorLineColor=r.connectorLineColor,e.gantt.predecessorCollection.push(r)}),this.parent.pdfExportModule.isPdfExport=!1)},e.prototype.processRecordRow=function(e){var t=this;this.colIndex=0,this.row.level=e.level,this.columns.forEach(function(i){t.isColumnVisible(i)&&(t.processRecordCell(e,i,t.row),t.colIndex++)})},e.prototype.processRecordCell=function(e,t,s){var o=s.cells.getCell(this.colIndex),l=this.parent.taskFields,d=e.ganttProperties;"datepickeredit"===t.editType||"datetimepickeredit"===t.editType?o.value=e[t.field]:t.field===l.duration?o.value=this.parent.getDurationString(d.duration,d.durationUnit):t.field===l.resourceInfo?o.value=d.resourceNames:t.field===l.work?o.value=this.parent.getWorkString(d.work,d.workUnit):o.value=i.i(a.isNullOrUndefined)(e[t.field])?"":e[t.field].toString(),o.isHeaderCell=!1,o.style.padding=new n.c,this.copyStyles(this.ganttStyle.cell,o,s.isParentRow),this.colIndex!==this.parent.treeColumnIndex?o.style.format.alignment=r.PdfTextAlignment[t.textAlign]:o.style.format.paragraphIndent=10*o.row.level;var h={data:e,value:o.value,column:t,style:o.style,cell:o};h.value=this.exportValueFormatter.formatCellValue(h),this.parent.pdfQueryCellInfo&&this.parent.trigger("pdfQueryCellInfo",h),o.value=h.value},e.prototype.processTaskbar=function(){var e,t=this;e=this.flatData,e.forEach(function(e){var n=t.gantt.taskbar.add(),s=e.ganttProperties;if(n.left=s.left,n.width=s.width,n.left<0&&(n.width=n.width+n.left,n.left=0),n.progress=s.progress,n.isScheduledTask=i.i(o.c)(s),o.c?i.i(a.isNullOrUndefined)(s.endDate)&&i.i(a.isNullOrUndefined)(s.duration)?n.unscheduledTaskBy="startDate":i.i(a.isNullOrUndefined)(s.startDate)&&i.i(a.isNullOrUndefined)(s.duration)?n.unscheduledTaskBy="endDate":(n.unscheduledTaskBy="duration",n.unscheduleStarteDate=t.parent.dateValidationModule.getValidStartDate(e.ganttProperties),n.unscheduleEndDate=t.parent.dateValidationModule.getValidEndDate(e.ganttProperties)):(n.unscheduleStarteDate=null,n.unscheduleEndDate=null),n.startDate=s.startDate,n.endDate=s.endDate,n.height=t.parent.chartRowsModule.taskBarHeight,t.parent.renderBaseline){var l=void 0;l=n.height+t.baselineHeight<=t.parent.rowHeight?n.height:n.height-(t.baselineHeight+1),n.height=l}n.baselineTop=t.parent.chartRowsModule.baselineTop,n.isMilestone=s.isMilestone,n.baselineStartDate=s.baselineStartDate,n.baselineEndDate=s.baselineEndDate,n.baselineLeft=s.baselineLeft,n.baselineWidth=s.baselineWidth,n.milestoneColor=new r.PdfColor(t.ganttStyle.taskbar.milestoneColor),n.isParentTask=e.hasChildRecords,s.isMilestone&&(n.height=s.width),e[t.parent.labelSettings.leftLabel]&&(n.leftTaskLabel.value=e[t.parent.labelSettings.leftLabel].toString()),e[t.parent.labelSettings.rightLabel]&&(n.rightTaskLabel.value=e[t.parent.labelSettings.rightLabel].toString()),e[t.parent.labelSettings.taskLabel]&&(n.taskLabel=e[t.parent.labelSettings.taskLabel].toString());var d=s.isMilestone?Math.floor(t.parent.chartRowsModule.taskBarHeight/2)+33:33;n.rightTaskLabel.left=s.left+s.width+d,n.fontFamily=t.ganttStyle.fontFamily,n.progressWidth=s.progressWidth,n.labelColor=new r.PdfColor(t.ganttStyle.label.fontColor),n.progressFontColor=new r.PdfColor(t.ganttStyle.taskbar.progressFontColor),n.isParentTask?(n.taskColor=new r.PdfColor(t.ganttStyle.taskbar.parentTaskColor),n.taskBorderColor=new r.PdfColor(t.ganttStyle.taskbar.parentTaskBorderColor),n.progressColor=new r.PdfColor(t.ganttStyle.taskbar.parentProgressColor)):e.isCritical?(n.taskColor=new r.PdfColor(t.ganttStyle.taskbar.criticalTaskColor),n.progressColor=new r.PdfColor(t.ganttStyle.taskbar.criticalProgressColor),n.taskBorderColor=new r.PdfColor(t.ganttStyle.taskbar.criticalTaskBorderColor),n.milestoneColor=new r.PdfColor(t.ganttStyle.taskbar.criticalTaskColor)):(n.taskColor=new r.PdfColor(t.ganttStyle.taskbar.taskColor),n.progressColor=new r.PdfColor(t.ganttStyle.taskbar.progressColor),n.taskBorderColor=new r.PdfColor(t.ganttStyle.taskbar.taskBorderColor)),n.baselineColor=new r.PdfColor(t.ganttStyle.taskbar.baselineColor),n.baselineBorderColor=new r.PdfColor(t.ganttStyle.taskbar.baselineBorderColor),n.gridLineColor=new r.PdfColor(t.ganttStyle.chartGridLineColor),t.gantt.taskbarCollection.push(n);var h={};h.progressFontColor=n.progressFontColor,h.taskColor=n.taskColor,h.taskBorderColor=n.taskBorderColor,h.progressColor=n.progressColor,h.milestoneColor=n.milestoneColor,h.baselineColor=n.baselineColor,h.baselineBorderColor=n.baselineBorderColor;var p={taskbar:h,data:e};t.parent.pdfQueryTaskbarInfo&&(t.parent.trigger("pdfQueryTaskbarInfo",p),n.progressFontColor=p.taskbar.progressFontColor,n.taskColor=p.taskbar.taskColor,n.taskBorderColor=p.taskbar.taskBorderColor,n.progressColor=p.taskbar.progressColor,n.milestoneColor=p.taskbar.milestoneColor,n.baselineColor=p.taskbar.baselineColor,n.baselineBorderColor=p.taskbar.baselineBorderColor)})},e.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new r.PdfStringFormat),e){case"Right":t.alignment=r.PdfTextAlignment.Right;break;case"Center":t.alignment=r.PdfTextAlignment.Center;break;case"Justify":t.alignment=r.PdfTextAlignment.Justify;break;case"Left":t.alignment=r.PdfTextAlignment.Left}return t},e.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new r.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=r.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=r.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=r.PdfVerticalAlignment.Top}return t},e.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},e.prototype.getFont=function(e){if(e.font)return e.font;var t=i.i(a.isNullOrUndefined)(e.style.fontSize)?9.75:.75*e.style.fontSize,n=i.i(a.isNullOrUndefined)(e.style.fontFamily)?r.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),s=r.PdfFontStyle.Regular;return!i.i(a.isNullOrUndefined)(e.style.bold)&&e.style.bold&&(s|=r.PdfFontStyle.Bold),!i.i(a.isNullOrUndefined)(e.style.italic)&&e.style.italic&&(s|=r.PdfFontStyle.Italic),!i.i(a.isNullOrUndefined)(e.style.underline)&&e.style.underline&&(s|=r.PdfFontStyle.Underline),!i.i(a.isNullOrUndefined)(e.style.strikeout)&&e.style.strikeout&&(s|=r.PdfFontStyle.Strikeout),new r.PdfStandardFont(n,t,s)},e.prototype.renderEmptyGantt=function(){var e=this.gantt.rows.addRow();e.cells.getCell(0).isHeaderCell=!1,e.height=i.i(o.b)(this.parent.rowHeight),this.copyStyles(this.ganttStyle.columnHeader,e.cells.getCell(0),e.isParentRow);var t=this.columns.length;e.cells.getCell(0).value=this.parent.localeObj.getConstant("emptyRecord"),this.mergeCells(1,0,t)},e.prototype.mergeCells=function(e,t,i){this.gantt.rows.getRow(e).cells.getCell(t).columnSpan=i},e.prototype.copyStyles=function(e,t,i){t.style.fontColor=new r.PdfColor(e.fontColor),t.style.backgroundColor=new r.PdfColor(e.backgroundColor),t.style.borderColor=new r.PdfColor(e.borderColor),t.style.fontSize=e.fontSize,t.style.fontStyle=e.fontStyle,t.style.format=Object.assign(new r.PdfStringFormat,e.format),t.style.borders=new n.b,t.style.borders.all=new r.PdfPen(t.style.borderColor),t.style.padding=new n.c;var a=0;a=t.isHeaderCell?this.parent.timelineModule.isSingleTier?22.5:30:this.parent.rowHeight/2,t.style.padding.top=a-e.fontSize,t.style.padding.bottom=a-e.fontSize,t.style.padding.left=10,t.style.padding.right=10,e.padding&&(t.style.padding=e.padding),e.borders&&(t.style.borders=e.borders)},e.prototype.initializePdf=function(e){this.pdfDoc=e;var t=[],n=this.pdfDoc.pageSettings.width-82;if(this.exportProps&&this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth){var s=void 0;if(this.exportProps.fitToWidthSettings.gridWidth)s=parseInt(this.exportProps.fitToWidthSettings.gridWidth.split("%")[0]);else if(this.exportProps.fitToWidthSettings.chartWidth){var o=parseInt(this.exportProps.fitToWidthSettings.chartWidth.split("%")[0]);s=100-o}else s=30;for(var l=this.parent.pdfExportModule.pdfPageDimensions.width*s/100,d=l/this.gantt.columns.columns.length,h=0;h<this.gantt.columns.columns.length;h++)this.gantt.columns.getColumn(h).width=d}if(this.totalColumnWidth>this.pdfDoc.pageSettings.width-82?this.gantt.style.allowHorizontalOverflow=!0:n/this.columns.length<t[0]&&(this.gantt.columns.getColumn(0).width=t[0]),this.exportProps.enableFooter||i.i(a.isNullOrUndefined)(this.exportProps.enableFooter)){var p=new r.RectangleF(0,0,e.pageSettings.width,35),u=new r.PdfPen(this.ganttStyle.chartGridLineColor),c=new r.PdfPageTemplateElement(p),g=new r.PdfSolidBrush(this.ganttStyle.footer.backgroundColor);c.graphics.drawRectangle(u,g,0,0,e.pageSettings.width,35);var f=new r.PdfStandardFont(this.ganttStyle.fontFamily,this.ganttStyle.footer.fontSize,this.ganttStyle.footer.fontStyle);this.ganttStyle.font&&(f=this.ganttStyle.font);var m=new r.PdfSolidBrush(this.ganttStyle.footer.fontColor),y=new r.PdfPageNumberField(f),D=new r.PdfPageCountField(f,m),v=new r.PdfCompositeField(f,m,"Page {0}",y,D);v.stringFormat=this.ganttStyle.footer.format,v.bounds=p,v.draw(c.graphics,new r.PointF(0,0)),e.template.bottom=c}},e}(),d=function(){function e(e){this.valueFormatter=new s.ValueFormatter(e),this.internationalization=new a.Internationalization(e)}return e.prototype.returnFormattedValue=function(e,t){return!i.i(a.isNullOrUndefined)(e.value)&&e.value?this.valueFormatter.getFormatFunction(t)(e.value):""},e.prototype.formatCellValue=function(e){if(e.isForeignKey&&(e.value=i.i(a.getValue)(e.column.foreignKeyValue,i.i(s.getForeignData)(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format)return e.value?this.internationalization.getNumberFormat({format:e.column.format})(e.value):"";if("boolean"===e.column.type)return e.value?"true":"false";if("date"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format)return(i.i(a.isNullOrUndefined)(e.column.type)||i.i(a.isNullOrUndefined)(e.value))&&i.i(a.isNullOrUndefined)(e.value)?"":e.value.toString();if("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format){var t=void 0;return t="date"===e.column.type?{type:"date",format:e.column.format}:"time"===e.column.type?{type:"time",format:e.column.format}:{type:"dateTime",format:e.column.format},this.returnFormattedValue(e,t)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var r=void 0;return r="date"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,r)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){this.mKeys=[],this.mValues=[]}return e.prototype.size=function(){return this.mKeys.length},e.prototype.add=function(e,t){if(void 0===e||null===e||void 0===t||null===t)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(e)<0)return this.mKeys.push(e),this.mValues.push(t),1;throw new RangeError("An item with the same key has already been added.")},e.prototype.keys=function(){return this.mKeys},e.prototype.values=function(){return this.mValues},e.prototype.getValue=function(e){if(void 0===e||null===e)throw new ReferenceError("Provided key is not valid.");var t=this.mKeys.indexOf(e);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[t]},e.prototype.setValue=function(e,t){if(void 0===e||null===e)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(e);i<0?(this.mKeys.push(e),this.mValues.push(t)):this.mValues[i]=t},e.prototype.remove=function(e){if(void 0===e||null===e)throw new ReferenceError("Provided key is not valid.");var t=this.mKeys.indexOf(e);if(t<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(t,1),this.mValues.splice(t,1),!0},e.prototype.containsKey=function(e){if(void 0===e||null===e)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(e)<0)},e.prototype.clear=function(){this.mKeys=[],this.mValues=[]},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var r=i(2),n=(i.n(r),function(){function e(){var e=new r.PdfPen(new r.PdfColor(0,0,0));e.dashStyle=r.PdfDashStyle.Solid;var t=new r.PdfPen(new r.PdfColor(0,0,0));t.dashStyle=r.PdfDashStyle.Solid;var i=new r.PdfPen(new r.PdfColor(0,0,0));i.dashStyle=r.PdfDashStyle.Solid;var n=new r.PdfPen(new r.PdfColor(0,0,0));n.dashStyle=r.PdfDashStyle.Solid,this.leftPen=e,this.rightPen=t,this.topPen=i,this.bottomPen=n}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftPen},set:function(e){this.leftPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightPen},set:function(e){this.rightPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topPen},set:function(e){this.topPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomPen},set:function(e){this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"all",{set:function(e){this.leftPen=this.rightPen=this.topPen=this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(e,"default",{get:function(){return new e},enumerable:!0,configurable:!0}),e}()),a=function(){function e(e,t,i,r){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===e?(this.leftPad=this.rightPad=5.76,this.bottomPad=this.topPad=.5):(this.leftPad=e,this.rightPad=t,this.topPad=i,this.bottomPad=r,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftPad},set:function(e){this.leftPad=e,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightPad},set:function(e){this.rightPad=e,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topPad},set:function(e){this.topPad=e,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomPad},set:function(e){this.bottomPad=e,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"all",{set:function(e){this.leftPad=this.rightPad=this.topPad=this.bottomPad=e,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return o}),i.d(t,"c",function(){return l}),i.d(t,"d",function(){return d}),i.d(t,"e",function(){return h}),i.d(t,"f",function(){return p}),i.d(t,"g",function(){return u});var r=i(18),n=i(0),a=(i.n(n),i(2)),s=(i.n(a),function(){function e(e){this.cellWidth=0,this.cellHeight=0,this.finishedDrawingCell=!0,i.i(n.isNullOrUndefined)(e)?(this.rowSpan=1,this.columnSpan=1):this.row=e,this.style={}}return Object.defineProperty(e.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(e){this.cellHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return 0===this.cellWidth&&(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(e){this.cellWidth=e},enumerable:!0,configurable:!0}),e.prototype.measureWidth=function(){var e=0,t=new a.PdfStringLayouter;if("string"==typeof this.value){var i=new a.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);this.row.treegrid.ganttStyle.font&&(i=this.row.treegrid.ganttStyle.font);e+=t.layout(this.value,i,this.style.format,new a.SizeF(Number.MAX_VALUE,Number.MAX_VALUE),!1,new a.SizeF(0,0)).actualSize.width,e+=2*(this.style.borders.left.width+this.style.borders.right.width)}return void 0!==this.row.treegrid.style.cellPadding.left&&this.row.treegrid.style.cellPadding.hasLeftPad&&(e+=this.row.treegrid.style.cellPadding.left),void 0!==this.row.treegrid.style.cellPadding.right&&this.row.treegrid.style.cellPadding.hasRightPad&&(e+=this.row.treegrid.style.cellPadding.right),e+=this.row.treegrid.style.cellSpacing},e.prototype.measureHeight=function(){var e=this.row.treegrid.rowHeight,t=0,r=this.calculateWidth();r-=this.row.treegrid.style.cellPadding.right+this.row.treegrid.style.cellPadding.left,r-=this.style.borders.left.width+this.style.borders.right.width;var s=new a.PdfStringLayouter;if("string"==typeof this.value||"string"==typeof this.remainingString){var o=this.value;this.finishedDrawingCell||(o=i.i(n.isNullOrUndefined)(this.remainingString)||""===this.remainingString?this.value:this.remainingString);var l=new a.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);this.row.treegrid.ganttStyle.font&&(l=this.row.treegrid.ganttStyle.font);t+=s.layout(o,l,this.style.format,new a.SizeF(r,0),!1,new a.SizeF(0,0)).actualSize.height,t+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}return t+=this.row.treegrid.style.cellPadding.top+this.row.treegrid.style.cellPadding.bottom,t+=this.row.treegrid.style.cellSpacing,t>e?t:e},e.prototype.calculateWidth=function(){for(var e=this.row.cells.indexOf(this),t=this.columnSpan,i=0,r=0;r<t;r++)i+=this.row.treegrid.columns.getColumn(e+r).width;return this.row.treegrid.columns.getColumn(e).isTreeColumn&&(i-=10*this.row.level),i},e.prototype.draw=function(e,t,i,r){var n=null;if(i){for(var s=this.row.cells.indexOf(this),o=s+1;o<=s+this.columnSpan;o++)this.row.cells.getCell(o).isCellMergeContinue=!1,this.row.cells.getCell(o).isRowMergeContinue=!1;this.columnSpan=1}if((this.isCellMergeContinue||this.isRowMergeContinue)&&this.isCellMergeContinue&&this.row.treegrid.style.allowHorizontalOverflow)return this.row.rowOverflowIndex>0&&this.row.cells.indexOf(this)!==this.row.rowOverflowIndex+1||0===this.row.rowOverflowIndex&&this.isCellMergeContinue,n;this.drawCellBackground(e,t);var l=new a.PdfSolidBrush(this.style.fontColor),d=null;d=this.row.isParentRow?new a.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,a.PdfFontStyle.Bold):new a.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),this.row.treegrid.ganttStyle.font&&(d=this.row.treegrid.ganttStyle.font);var h=t;if(this.isHeaderCell||(h.x=h.x,h.width=h.width),h.height>=e.clientSize.height&&(this.row.treegrid.allowRowBreakAcrossPages?(h.height-=h.y,t.height-=t.y):(h.height=e.clientSize.height,t.height=e.clientSize.height)),h=this.adjustContentLayoutArea(h),"string"==typeof this.value||"string"==typeof this.remainingString){var p=null;this.finishedDrawingCell?(p=""===this.remainingString?this.remainingString:this.value,e.drawString(p,d,null,l,h.x+r,this.isHeaderCell?h.y-16:h.y,h.width-r-10,h.height-10,this.style.format)):e.drawString(this.remainingString,d,null,l,h.x+r,this.isHeaderCell?h.y-16:h.y,this.style.format),n=e.stringLayoutResult}return null!=this.style.borders&&this.drawCellBorder(e,t),n},e.prototype.drawCellBackground=function(e,t){var i=new a.PdfSolidBrush(this.style.backgroundColor);null!=i&&(e.save(),e.drawRectangle(i,t.x,t.y,t.width,t.height),e.restore())},e.prototype.adjustContentLayoutArea=function(e){var t=new a.RectangleF(new a.PointF(e.x,e.y),new a.SizeF(e.width,e.height)),i=this.style.padding;if(this.value instanceof r.a){var n=this.value.size;this.style.format.alignment===a.PdfTextAlignment.Center?(t.x+=i.left+(t.width-n.width)/2,t.y+=i.top+(t.height-n.height)/2):this.style.format.alignment===a.PdfTextAlignment.Left?(t.x+=i.left,t.y+=i.top):this.style.format.alignment===a.PdfTextAlignment.Right&&(t.x+=i.left+(t.width-n.width),t.y+=i.top)}else t.x+=i.left,t.y+=i.top;return t},e.prototype.drawCellBorder=function(e,t){if(this.row.treegrid.style.borderOverlapStyle===a.PdfBorderOverlapStyle.Inside&&(t.x+=this.style.borders.left.width,t.y+=this.style.borders.top.width,t.width-=this.style.borders.right.width,t.height-=this.style.borders.bottom.width),this.style.borders.isAll&&this.isHeaderCell)return e.drawRectangle(this.style.borders.left,t.x,t.y,t.width,t.height),void e.restore();var i=new a.PointF(t.x,t.y+t.height),r=new a.PointF(t.x,t.y),n=this.style.borders.left;this.style.borders.left.dashStyle===a.PdfDashStyle.Solid&&(n.lineCap=a.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new a.PointF(t.x+t.width,t.y),r=new a.PointF(t.x+t.width,t.y+t.height),n=this.style.borders.right,t.x+t.width>e.clientSize.width-n.width/2&&(i=new a.PointF(e.clientSize.width-n.width/2,t.y),r=new a.PointF(e.clientSize.width-n.width/2,t.y+t.height)),this.style.borders.right.dashStyle===a.PdfDashStyle.Solid&&(n.lineCap=a.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new a.PointF(t.x,t.y),r=new a.PointF(t.x+t.width,t.y),n=this.style.borders.top,this.style.borders.top.dashStyle===a.PdfDashStyle.Solid&&(n.lineCap=a.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new a.PointF(t.x+t.width,t.y+t.height),r=new a.PointF(t.x,t.y+t.height),n=this.style.borders.bottom,t.y+t.height>e.clientSize.height-n.width/2&&(i=new a.PointF(t.x+t.width,e.clientSize.height-n.width/2),r=new a.PointF(t.x,e.clientSize.height-n.width/2)),this.style.borders.bottom.dashStyle===a.PdfDashStyle.Solid&&(n.lineCap=a.PdfLineCap.Square),e.drawLine(n,i,r),e.restore()},e}()),o=function(){function e(e){this.treegridRow=e,this.cells=[]}return e.prototype.getCell=function(e){if(e<0||e>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[e]},Object.defineProperty(e.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),e.prototype.add=function(e){if(void 0===e){var t=new s;return this.add(t),e}e.row=this.treegridRow,this.cells.push(e)},e.prototype.indexOf=function(e){return this.cells.indexOf(e)},e}(),l=function(){function e(e){this.treegridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this._isParentRow=!1,this.intendLevel=0,this.pdfTreeGrid=e}return Object.defineProperty(e.prototype,"cells",{get:function(){return i.i(n.isNullOrUndefined)(this.treegridCells)&&(this.treegridCells=new o(this)),this.treegridCells},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isParentRow",{get:function(){return this._isParentRow},set:function(e){this._isParentRow=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"treegrid",{get:function(){return this.pdfTreeGrid},set:function(e){this.pdfTreeGrid=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowBreakHeight",{get:function(){return void 0===this.treegridRowBreakHeight&&(this.treegridRowBreakHeight=0),this.treegridRowBreakHeight},set:function(e){this.treegridRowBreakHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowOverflowIndex",{get:function(){return this.treegridRowOverflowIndex},set:function(e){this.treegridRowOverflowIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"level",{get:function(){return this.intendLevel},set:function(e){this.intendLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 0===this.rowHeight&&(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(e){this.rowHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return 0===this.rowWidth&&(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowIndex",{get:function(){return this.treegrid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),e.prototype.measureWidth=function(){for(var e=this.treegrid.columns.columns,t=0,i=0;i<e.length;i++){t+=e[i].width}return t},e.prototype.measureHeight=function(){for(var e=this.cells.getCell(0).height,t=0;t<this.cells.count;t++){var i=this.cells.getCell(t);e=1===i.columnSpan||1===i.rowSpan?Math.max(e,i.height):Math.min(e,i.height),i.height=e}return e},e}(),d=function(){function e(e){this.rows=[],this.treegrid=e}return Object.defineProperty(e.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),e.prototype.addRow=function(e){if(void 0===e){var t=new l(this.treegrid);return this.addRow(t),t}if(0===e.cells.count)for(var i=0;i<this.treegrid.columns.count;i++)e.cells.add(new s);this.rows.push(e)},e.prototype.getRow=function(e){return this.rows[e]},e}(),h=function(){function e(e){this.rows=[],this.treegrid=e,this.rows=[]}return e.prototype.getHeader=function(e){return this.rows[e]},Object.defineProperty(e.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),e.prototype.add=function(e){this.rows.push(e)},e.prototype.indexOf=function(e){return this.rows.indexOf(e)},e}(),p=function(){function e(e){this.columnWidth=0,this.treeColumnIndex=!1,this._headerText="",this._field="",this.treegrid=e}return Object.defineProperty(e.prototype,"headerText",{get:function(){return this._headerText},set:function(e){this._headerText=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"field",{get:function(){return this._field},set:function(e){this._field=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.columnWidth},set:function(e){this.columnWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isTreeColumn",{get:function(){return this.treeColumnIndex},set:function(e){this.treeColumnIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new a.PdfStringFormat),this.stringFormat},set:function(e){this.stringFormat=e},enumerable:!0,configurable:!0}),e}(),u=function(){function e(e){this.internalColumns=[],this.columnWidth=0,this.treegrid=e,this.internalColumns=[]}return e.prototype.add=function(e){for(var t=0;t<e;t++){this.internalColumns.push(new p(this.treegrid));for(var i=0;i<this.treegrid.rows.count;i++){var r=this.treegrid.rows.getRow(i),n=new s;n.value="",r.cells.add(n)}}},Object.defineProperty(e.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),e.prototype.getColumn=function(e){if(e>=0&&e<=this.columns.length)return this.columns[e];throw Error("can not get the column from the index: "+e)},e.prototype.measureColumnsWidth=function(){var e=0;this.treegrid.measureColumnsWidth();for(var t=0,i=this.internalColumns.length;t<i;t++)e+=this.internalColumns[t].width;return e},e.prototype.getDefaultWidths=function(e){for(var t=[],i=this.count,r=0;r<this.count;r++)t[r]=this.internalColumns[r].width,this.internalColumns[r].width>0?(e-=this.internalColumns[r].width,i--):t[r]=0;for(var r=0;r<this.count;r++){var n=e/i;t[r]<=0&&(t[r]=n)}return t},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return o});var r=i(2),n=(i.n(r),i(7)),a=i(11),s=function(){function e(){}return e}(),o=function(){function e(){this.cellSpacing=0,this.borderOverlapStyle=r.PdfBorderOverlapStyle.Overlap,this.allowHorizontalOverflow=!1,this.horizontalOverflowType=a.a.LastPage,this.cellPadding=new n.c}return e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return d}),i.d(t,"b",function(){return h}),i.d(t,"c",function(){return p});var r=i(0),n=(i.n(r),i(7)),a=i(11),s=i(2),o=(i.n(s),i(1)),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),d=function(e){function t(t){var i=e.call(this,t)||this;return i.columnRanges=[],i.repeatRowIndex=-1,i.currentBounds=new s.RectangleF(0,0,0,0),i}return l(t,e),Object.defineProperty(t.prototype,"treegrid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),t.prototype.layoutInternal=function(e){if(i.i(r.isNullOrUndefined)(e))throw Error("Argument Null Expection");this.currentPage=e.page;var t=e.format;if(null!==this.currentPage&&(this.currentPageBounds=this.currentPage.getClientSize()),this.currentGraphics=this.currentPage.graphics,null!==t&&t.break===s.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new s.RectangleF(new s.PointF(e.bounds.x,e.bounds.y),new s.SizeF(this.treegrid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new s.RectangleF(new s.PointF(e.bounds.x,e.bounds.y),this.currentGraphics.clientSize),0===this.treegrid.rows.count)throw Error("Please add row or header into grid");return this.currentBounds.width=e.bounds.width>0?e.bounds.width:this.currentBounds.width-this.treegrid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2,this.startLocation=new s.PointF(e.bounds.x,e.bounds.y),e.bounds.height>0&&(this.currentBounds.height=e.bounds.height),this.treegrid.style.allowHorizontalOverflow||this.treegrid.isFitToWidth?(this.treegrid.measureColumnsWidth(this.currentBounds),this.columnRanges.push([0,this.treegrid.columns.count-1])):(this.treegrid.measureColumnsWidth(),this.determineColumnDrawRanges()),this.layoutOnPage(e)},t.prototype.determineColumnDrawRanges=function(){for(var e=0,t=0,r=0,n=i.i(o.a)(this.currentGraphics.clientSize.width)-this.currentBounds.x,a=0;a<this.treegrid.columns.count;a++)if((r+=this.treegrid.columns.getColumn(a).width)>=n){for(var s=0,l=e;l<=a&&!((s+=this.treegrid.columns.getColumn(l).width)>n);l++)t=l;this.columnRanges.push([e,t]),e=t+1,r=t<=a?this.treegrid.columns.getColumn(a).width:0}this.columnRanges.push([e,this.treegrid.columns.count-1])},t.prototype.getFormat=function(e){return e},t.prototype.layoutOnPage=function(e){for(var t=this.getFormat(e.format),i=null,r=new n.a,o=e.page,l=0;l<this.columnRanges.length;l++){var d=this.columnRanges[l];this.cellStartIndex=d[0],this.cellEndIndex=d[1];for(var h=this.treegrid.rows.count,p=0,u=!1,c=0;c<h;c++){var g=this.treegrid.rows.getRow(c);p++;var f=this.currentBounds.y;null===this.currentPage||r.containsKey(this.currentPage)||r.add(this.currentPage,d);var m=this.drawRow(g);for(f===this.currentBounds.y?(u=!0,this.repeatRowIndex=this.treegrid.rows.rowCollection.indexOf(g)):(u=!1,this.repeatRowIndex=-1);!m.isFinish&&null!==o;)if(this.treegrid.allowRowBreakAcrossPages)this.currentPage=this.getNextPageFormat(t),this.treegrid.enableHeader&&this.drawHeader(),this.checkBounds(t),m=this.drawRow(g);else{if(!this.treegrid.allowRowBreakAcrossPages&&p<length){this.currentPage=this.getNextPageFormat(t),this.treegrid.enableHeader&&this.drawHeader();break}if(p>=length)break}!m.isFinish&&null!==o&&t.layout!==s.PdfLayoutType.OnePage&&u&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageFormat(t),this.treegrid.enableHeader&&this.drawHeader(),this.startLocation.y=this.currentBounds.y,t.paginateBounds===new s.RectangleF(0,0,0,0)&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===n.b.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.drawRow(g),null===this.currentPage||r.containsKey(this.currentPage)||r.add(this.currentPage,d))}this.columnRanges.indexOf(d)<this.columnRanges.length-1&&null!==o&&t.layout!==s.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageFormat(t),this.checkBounds(t))}return i=this.getLayoutResult(),this.treegrid.style.allowHorizontalOverflow&&this.treegrid.style.horizontalOverflowType===a.a.NextPage&&this.reArrangePages(r),i},t.prototype.checkBounds=function(e){var t=new s.PointF(n.b.default.right.width/2,n.b.default.top.width/2);e.paginateBounds===new s.RectangleF(0,0,0,0)&&this.startLocation===t&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)},t.prototype.drawHeader=function(){this.drawRow(this.treegrid.rows.getRow(0))},t.prototype.reArrangePages=function(e){for(var t=this.currentPage.document,i=[],r=e.keys(),n=0;n<r.length;n++){var a=r[n];a.section=null,i.push(a),t.pages.remove(a)}for(var n=0;n<e.size();n++)for(var s=e.size()/this.columnRanges.length,o=n;o<e.size();o+=s){var a=i[o];-1===t.pages.indexOf(a)&&t.pages.add(a)}},t.prototype.getNextPageFormat=function(e){var t=this.currentPage.section,i=null,r=t.indexOf(this.currentPage);return i=r===t.count-1?t.add():t.getPages()[r+1],this.currentGraphics=i.graphics,this.currentBounds=new s.RectangleF(new s.PointF(0,0),i.getClientSize()),i},t.prototype.getLayoutResult=function(){var e=new s.RectangleF(this.startLocation,new s.SizeF(this.currentBounds.width,this.currentBounds.y-this.startLocation.y));return new h(this.currentPage,e)},t.prototype.checkIfDefaultFormat=function(e){var t=new s.PdfStringFormat;return e.alignment===t.alignment&&e.characterSpacing===t.characterSpacing&&e.clipPath===t.clipPath&&e.firstLineIndent===t.firstLineIndent&&e.horizontalScalingFactor===t.horizontalScalingFactor&&e.lineAlignment===t.lineAlignment&&e.lineLimit===t.lineLimit&&e.lineSpacing===t.lineSpacing&&e.measureTrailingSpaces===t.measureTrailingSpaces&&e.noClip===t.noClip&&e.paragraphIndent===t.paragraphIndent&&e.rightToLeft===t.rightToLeft&&e.subSuperScript===t.subSuperScript&&e.wordSpacing===t.wordSpacing&&e.wordWrap===t.wordWrap},t.prototype.drawRow=function(e,t,n){if(i.i(r.isNullOrUndefined)(t)){var a=new s.RowLayoutResult;return n=e.rowBreakHeight>0?e.rowBreakHeight:e.height,n>this.currentPageBounds.height?this.treegrid.allowRowBreakAcrossPages?(a.isFinish=!0,this.drawRowWithBreak(a,e,n)):(a.isFinish=!1,this.drawRow(e,a,n)):this.currentBounds.y+n>this.currentPageBounds.height||this.currentBounds.y+n>this.currentBounds.height?this.repeatRowIndex>-1&&this.repeatRowIndex===e.rowIndex?this.treegrid.allowRowBreakAcrossPages?(a.isFinish=!0,this.drawRowWithBreak(a,e,n)):(a.isFinish=!1,this.drawRow(e,a,n)):a.isFinish=!1:(a.isFinish=!0,this.drawRow(e,a,n)),a}var o=new s.PointF(this.currentBounds.x,this.currentBounds.y);t.bounds=new s.RectangleF(o,new s.SizeF(0,0));var l=0;n=this.reCalculateHeight(e,n);for(var d=this.cellStartIndex;d<=this.cellEndIndex;d++){var h=e.cells.getCell(d),p=this.treegrid.columns.getColumn(d);p.isTreeColumn&&(l=10*e.level);var u=d>this.cellEndIndex+1&&h.columnSpan>1;if(!u)for(var c=1;c<h.columnSpan;c++)e.cells.getCell(d+c).isCellMergeContinue=!0;var g=new s.SizeF(p.width,n);h.columnSpan>1&&(g=new s.SizeF(h.width,n),d+=h.columnSpan),!this.checkIfDefaultFormat(p.format)&&this.checkIfDefaultFormat(h.style.format)&&(h.style.format=p.format),h.draw(this.currentGraphics,new s.RectangleF(o,g),u,l),e.treegrid.style.allowHorizontalOverflow&&(h.columnSpan>this.cellEndIndex||d+h.columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),o.x+=p.width,l=0}return this.currentBounds.y+=n,t.bounds=new s.RectangleF(new s.PointF(t.bounds.x,t.bounds.y),new s.SizeF(o.x,o.y)),null},t.prototype.drawRowWithBreak=function(e,t,i){var r=new s.PointF(this.currentBounds.x,this.currentBounds.y);e.bounds=new s.RectangleF(r,new s.SizeF(0,0));var n=0;this.treegridHeight=this.currentBounds.height,t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height;for(var a=0;a<t.cells.count;a++){var o=t.cells.getCell(a);o.measureHeight()===i&&null===o.value&&(t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height)}for(var l=this.cellStartIndex;l<=this.cellEndIndex;l++){var d=this.treegrid.columns.getColumn(l);d.isTreeColumn&&(n=10*t.level);var o=t.cells.getCell(l),h=o.columnSpan+l>this.cellEndIndex+1&&o.columnSpan>1;if(!h)for(var p=1;p<o.columnSpan;p++)t.cells.getCell(l+p).isCellMergeContinue=!0;var u=this.treegridHeight>0?this.treegridHeight:this.currentBounds.height,c=new s.SizeF(d.width,u);!this.checkIfDefaultFormat(d.format)&&this.checkIfDefaultFormat(o.style.format)&&(o.style.format=d.format),o.draw(this.currentGraphics,new s.RectangleF(r,c),h,n),e.isFinish=e.isFinish?o.finishedDrawingCell:e.isFinish,r.x+=d.width,n=0,this.currentBounds.y+=this.treegridHeight>0?this.treegridHeight:i,e.bounds=new s.RectangleF(new s.PointF(e.bounds.x,e.bounds.y),new s.SizeF(r.x,r.y))}},t.prototype.reCalculateHeight=function(e,t){for(var n=0,a=this.cellStartIndex;a<=this.cellEndIndex;a++)i.i(r.isNullOrUndefined)(e.cells.getCell(a).remainingString)&&""!==e.cells.getCell(a).remainingString||(n=Math.max(n,e.cells.getCell(a).measureHeight()));return Math.max(t,n)},t}(s.ElementLayouter),h=function(e){function t(t,i){return e.call(this,t,i)||this}return l(t,e),t}(s.PdfLayoutResult),p=function(e){function t(t){return void 0===t?e.call(this)||this:e.call(this,t)||this}return l(t,e),t}(s.PdfLayoutFormat)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(2),n=(i.n(r),i(1)),a=i(0),s=(i.n(a),this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},s.apply(this,arguments)}),o=function(){function e(e,t){this.parent=e,this.pdfGantt=t}return e.prototype.add=function(){return new e(this.parent)},e.prototype.findindex=function(e){var t;return this.parent.currentViewData.map(function(i,r){i.index==e&&(t=r)}),t},e.prototype.drawPredecessor=function(e){this.pdfGantt=e;var t,a,o=e.result.page.section.getPages(),l=e.taskbarCollection[this.findindex(this.parentIndex)],d=e.taskbarCollection[this.findindex(this.childIndex)],h=new r.PdfPage,p=new r.PdfPage,u="",c=0,g=0;switch(this.type){case"FS":if(!(d.startPage>-1&&l.endPage>-1))return;h=o[l.endPage],p=o[d.startPage],t=e.pdfPageDetail[l.endPage-e.chartPageIndex],a=e.pdfPageDetail[d.startPage-e.chartPageIndex],u=this.parentIndex<this.childIndex?this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType1":"FSType2":this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType3":"FSType4";break;case"SF":if(!(d.endPage>-1&&l.startPage>-1))return;h=o[l.startPage],p=o[d.endPage],t=e.pdfPageDetail[l.endPage-e.chartPageIndex],a=e.pdfPageDetail[d.startPage-e.chartPageIndex],u=this.parentIndex<this.childIndex?this.parentLeft>this.childLeft+this.childWidth?"SFType1":"SFType2":this.parentLeft>this.childLeft+this.childWidth?"SFType3":"SFType4";break;case"FF":if(!(d.endPage>-1&&l.endPage>-1))return;h=o[l.endPage],p=o[d.endPage],t=e.pdfPageDetail[l.endPage-e.chartPageIndex],a=e.pdfPageDetail[d.endPage-e.chartPageIndex],u=this.parentIndex<this.childIndex?this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType1":"FFType2":this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType3":"FFType4";break;case"SS":if(!(d.startPage>-1&&l.startPage>-1))return;h=o[l.startPage],p=o[d.startPage],t=e.pdfPageDetail[l.startPage-e.chartPageIndex],a=e.pdfPageDetail[d.startPage-e.chartPageIndex],u=this.parentIndex<this.childIndex?this.parentLeft>=this.childLeft?"SSType1":"SSType2":this.parentLeft>=this.childLeft?"SSType3":"SSType4"}var f=Math.round((this.parent.rowHeight-1)/2),m=Math.round((this.parent.rowHeight-10)/2),y=this.parent.renderBaseline?m:f;y=i.i(n.b)(y);var D,v,w,k,b,T;D=v=w=k=b=T=new r.PointF;var S=s({},l.taskStartPoint),P=s({},d.taskStartPoint);c=S.y+t.startPoint.y,g=P.y+a.startPoint.y;var C=new r.PointF(i.i(n.b)(this.parentLeft+this.parentWidth),c+y),M=new r.PointF(i.i(n.b)(this.parentLeft)-1,c+y),R=new r.PointF(i.i(n.b)(this.childLeft-20),g+y),x=new r.PointF(i.i(n.b)(this.childLeft-6-this.lineWidth)-1,g+y),O=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+6+this.lineWidth)+1,g+y);switch(u){case"FSType1":case"FSType3":D=C,v=new r.PointF(i.i(n.b)(this.childLeft-20),c+y),w=R,k=x,this.connectLines(h,p,D,v,w,k,d,y);break;case"FSType2":D=C,v=new r.PointF(D.x+10,c+y),w=new r.PointF(D.x+10,g+2),k=new r.PointF(i.i(n.b)(this.childLeft-20),g+2),b=R,T=x,this.connectLines(h,p,D,v,w,k,d,y,b,T);break;case"FSType4":D=C,v=new r.PointF(D.x+10,c+y),w=new r.PointF(D.x+10,c+2),k=new r.PointF(i.i(n.b)(this.childLeft-20),c+2),b=R,T=x,this.connectLines(h,p,D,v,w,k,d,y,b,T);break;case"FFType1":case"FFType3":D=new r.PointF(i.i(n.b)(this.parentLeft+this.parentWidth)+1,c+y),v=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+20),c+y),w=new r.PointF(v.x,g+y),k=O,this.connectLines(h,p,D,v,w,k,d,y);break;case"FFType2":case"FFType4":D=new r.PointF(i.i(n.b)(this.parentLeft+this.parentWidth)+1,c+y),v=new r.PointF(i.i(n.b)(this.parentLeft+this.parentWidth+20),c+y),w=new r.PointF(v.x,g+y),k=O,this.connectLines(h,p,D,v,w,k,d,y);break;case"SSType1":case"SSType3":D=M,v=new r.PointF(i.i(n.b)(this.childLeft-20),c+y),w=new r.PointF(v.x,g+y),k=x,this.connectLines(h,p,D,v,w,k,d,y);break;case"SSType2":case"SSType4":D=M,v=new r.PointF(i.i(n.b)(this.parentLeft-20),c+y),w=new r.PointF(v.x,g+y),k=x,this.connectLines(h,p,D,v,w,k,d,y);break;case"SFType1":case"SFType3":D=M,v=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+20),c+y),w=new r.PointF(v.x,g+y),k=O,this.connectLines(h,p,D,v,w,k,d,y);break;case"SFType2":D=M,v=new r.PointF(i.i(n.b)(this.parentLeft-20),c+y),w=new r.PointF(v.x,g+2),k=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+20),g+2),b=new r.PointF(k.x,g+y),T=O,this.connectLines(h,p,D,v,w,k,d,y,b,T);break;case"SFType4":D=M,v=new r.PointF(i.i(n.b)(this.parentLeft-20),c+y),w=new r.PointF(v.x,c+2),k=new r.PointF(i.i(n.b)(this.childLeft+this.childWidth+20),c+2),b=new r.PointF(k.x,g+y),T=O,this.connectLines(h,p,D,v,w,k,d,y,b,T)}},e.prototype.connectLines=function(e,t,r,n,s,o,l,d,h,p){this.drawLine(e,r,n),this.drawLine(e,n,s),this.drawLine(e,s,o),i.i(a.isNullOrUndefined)(h)||i.i(a.isNullOrUndefined)(p)||(this.drawLine(e,o,h),this.drawLine(e,h,p)),this.drawArrow(t,l,d)},e.prototype.contains=function(e,t,i){return e.x<=t&&t<e.x+e.width&&e.y<=i&&i<e.y+e.height},e.prototype.findPageIndex=function(e){for(var t=-1,i=0;i<this.pdfGantt.pdfPageDetail.length;i++){var n=this.pdfGantt.pdfPageDetail[i],a=new r.RectangleF(n.startPoint.x,n.startPoint.y,n.width,n.height);if(this.contains(a,e.x,e.y)){t=i;break}}return t},e.prototype.drawLine=function(e,t,a){var o=this.pdfGantt.result.page.section.getPages(),l=e.graphics,d=s({},a),h=s({},a),p=s({},a),u=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],c=new r.RectangleF(u.startPoint.x,u.startPoint.y,u.width,u.height),g=this.contains(c,t.x,t.y),f=this.contains(c,a.x,a.y),m=-1;if(t=new r.PointF(t.x,t.y),a=new r.PointF(a.x,a.y),!g&&!f||f&&!g)(m=this.findPageIndex(t))>-1&&(u=this.pdfGantt.pdfPageDetail[m],h=t,d=a,this.drawLine(o[m+this.pdfGantt.chartPageIndex],h,d));else if(!f&&g){var y=c.x,D=c.x+c.width,v=c.y+c.height,w=c.y;y>a.x?(p.x=a.x=y-1,h.x=y-1):D<a.x?(p.x=a.x=D,h.x=D,p.x+=1):v<a.y?(p.y=a.y=v,h.y=v,p.y+=1,this.pdfGantt.enableHeader&&(h.y+=this.parent.timelineModule.isSingleTier?i.i(n.b)(45):i.i(n.b)(62))):w>a.y&&(h.y=p.y=w-1,a.y=w,this.pdfGantt.enableHeader&&(p.y+=this.parent.timelineModule.isSingleTier?i.i(n.b)(45):i.i(n.b)(62),a.y+=this.parent.timelineModule.isSingleTier?i.i(n.b)(45):i.i(n.b)(62))),m=this.findPageIndex(p),-1!==m&&this.drawLine(o[m+this.pdfGantt.chartPageIndex],h,d)}if(g){t=new r.PointF(t.x,t.y),a=new r.PointF(a.x,a.y),t.x=t.x+u.pageStartX-u.startPoint.x,t.y=t.y-u.startPoint.y,a.x=a.x+u.pageStartX-u.startPoint.x,a.y=a.y-u.startPoint.y;var k=new r.PdfSolidBrush(this.connectorLineColor),b=new r.PdfPen(k,i.i(n.b)(this.lineWidth));l.drawLine(b,t,a)}},e.prototype.drawArrow=function(e,t,a){var s,o=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],l=new r.RectangleF(new r.PointF(o.startPoint.x,o.startPoint.y),new r.SizeF(o.width,o.height)),d=new r.PointF,h=e.section.getPages(),p=6+this.lineWidth;if(d="FS"===this.type||"SS"===this.type?new r.PointF(i.i(n.b)(this.childLeft)-1,t.taskStartPoint.y+o.startPoint.y):new r.PointF(i.i(n.b)(this.childLeft+this.childWidth)+1,t.taskStartPoint.y+o.startPoint.y),!this.contains(l,d.x,d.y)){var u=this.findPageIndex(d);u>-1&&(o=this.pdfGantt.pdfPageDetail[u],e=h[u+this.pdfGantt.chartPageIndex])}var c=e.graphics;d.x=d.x-o.startPoint.x+o.pageStartX,d.y=d.y-o.startPoint.y;var g=new r.PointF(d.x,d.y+a);s="FS"===this.type||"SS"===this.type?new r.PointF(g.x-i.i(n.b)(p),g.y-i.i(n.b)(p)):new r.PointF(g.x+i.i(n.b)(p),g.y-i.i(n.b)(p));var f=new r.PointF(s.x,s.y+i.i(n.b)(2*p)),m=new r.PdfSolidBrush(this.connectorLineColor),y=new r.PdfPen(m,i.i(n.b)(this.lineWidth));c.drawLine(y,g,s),c.drawLine(y,s,f),c.drawLine(y,f,g)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return u});var r=i(58),n=i(0),a=(i.n(n),i(2)),s=(i.n(a),i(18)),o=i(59),l=i(1),d=i(56),h=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),p=this&&this.__assign||function(){return p=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},p.apply(this,arguments)},u=function(e){function t(t){var i=e.call(this)||this;return i.exportProps={},i.parent=t,i.chartHeader=new o.a(i),i.predecessor=new d.a(t,i),i.headerDetails=[],i.pdfPageDetail=[],i.taskbarCollection=[],i.predecessorCollection=[],i}return h(t,e),Object.defineProperty(t.prototype,"taskbar",{get:function(){return i.i(n.isNullOrUndefined)(this.taskbars)&&(this.taskbars=new r.a(this.parent)),this.taskbars},enumerable:!0,configurable:!0}),t.prototype.drawChart=function(e){this.result=e,this.totalPages=this.result.page.section.count,this.perColumnPages=this.totalPages/this.layouter.columnRanges.length,this.calculateRange(),this.drawGantttChart(),this.drawPageBorder()},t.prototype.calculateRange=function(){for(var e=this.layouter.columnRanges[this.layouter.columnRanges.length-1],t=0,r=!0,s=0,o=0,d=0,h=i.i(l.b)(this.chartHeader.width),p=this.parent.timelineModule,u=e[0];u<=e[1];u++)t+=this.layouter.treegrid.columns.getColumn(u).width;for(t+=.5,t+100<this.result.page.getClientSize().width?(o=this.result.page.getClientSize().width-t,this.chartPageIndex=this.startPageIndex=this.totalPages-this.perColumnPages,r=!1,this.startPoint=new a.PointF(t,0)):(this.result.page.section.add(),this.chartPageIndex=this.startPageIndex=this.totalPages,r=!0,this.startPoint=new a.PointF(d,0));Math.round(d)<Math.round(h);){r?s=this.result.page.getClientSize().width:(s=o,r=!0);var c={},g=[],f=i.i(l.b)(this.chartHeader.bottomTierCellWidth),m=0;0!==this.chartHeader.bottomTierCellWidth&&(m=Math.floor(s/f)*f),g[0]=d,h-d<=m?(g[1]=h,c.totalWidth=i.i(l.a)(h-d)):(g[1]=d+m,c.totalWidth=i.i(l.a)(m)),c.startPoint=g[0],c.endPoint=g[1],0===this.parent.cloneProjectStartDate.getHours()&&0===this.parent.cloneProjectStartDate.getMinutes()&&0===this.parent.cloneProjectStartDate.getSeconds()&&this.parent.cloneProjectStartDate.setHours(8);var y=this.parent.dataOperation.getDateFromFormat(this.parent.timelineModule.timelineStartDate),D=i.i(n.isNullOrUndefined)(p.customTimelineSettings.bottomTier.count)?p.customTimelineSettings.topTier.count:p.customTimelineSettings.bottomTier.count;switch("None"===p.customTimelineSettings.bottomTier.unit?p.customTimelineSettings.topTier.unit:p.customTimelineSettings.bottomTier.unit){case"Minutes":c.startDate=new Date(y.getTime());var v=Math.floor(i.i(l.a)(c.startPoint)/this.chartHeader.bottomTierCellWidth);c.startDate.setMinutes(c.startDate.getMinutes()+v*D),c.startDate.setSeconds(c.startDate.getSeconds()+1),c.endDate=new Date(c.startDate.getTime());var w=Math.floor(i.i(l.a)(c.endPoint-c.startPoint)/this.chartHeader.bottomTierCellWidth);c.endDate.setMinutes(c.endDate.getMinutes()+w*D);break;case"Hour":c.startDate=new Date(y.getTime());var k=Math.floor(i.i(l.a)(c.startPoint)/this.chartHeader.bottomTierCellWidth);c.startDate.setHours(c.startDate.getHours()+k*D),c.startDate.setMinutes(c.startDate.getMinutes()+1),c.endDate=new Date(c.startDate.getTime());var b=Math.floor(i.i(l.a)(c.endPoint-c.startPoint)/this.chartHeader.bottomTierCellWidth);c.endDate.setHours(c.endDate.getHours()+b*D);break;case"Day":c.startDate=new Date(y.getTime());var T=Math.round(c.startPoint/i.i(l.b)(this.chartHeader.bottomTierCellWidth));c.startDate.setDate(c.startDate.getDate()+T*D);var S=Math.round((c.endPoint-c.startPoint)/i.i(l.b)(this.chartHeader.bottomTierCellWidth))-1;c.endDate=new Date(c.startDate.getTime()),c.endDate.setDate(c.startDate.getDate()+S*D);break;case"Week":c.startDate=new Date(y.getTime());var P=c.startPoint/i.i(l.b)(this.chartHeader.bottomTierCellWidth)*7;c.startDate.setDate(c.startDate.getDate()+P*D);var C=7*Math.round((c.endPoint-c.startPoint)/i.i(l.b)(this.chartHeader.bottomTierCellWidth))-1;c.endDate=new Date(c.startDate.getTime()),c.endDate.setDate(c.startDate.getDate()+C*D);break;case"Month":c.startDate=new Date(y.getTime());var M=c.startPoint/i.i(l.b)(this.chartHeader.bottomTierCellWidth)*31;c.startDate.setDate(c.startDate.getDate()+M*D);var R=31*Math.round((c.endPoint-c.startPoint)/i.i(l.b)(this.chartHeader.bottomTierCellWidth))-1;c.endDate=new Date(c.startDate.getTime()),c.endDate.setDate(c.startDate.getDate()+R*D);break;case"Year":c.startDate=new Date(y.getTime());var x=c.startPoint/i.i(l.b)(this.chartHeader.bottomTierCellWidth)*365;c.startDate.setDate(c.startDate.getDate()+x*D);var O=365*Math.round((c.endPoint-c.startPoint)/i.i(l.b)(this.chartHeader.bottomTierCellWidth))-1;c.endDate=new Date(c.startDate.getTime()),c.endDate.setDate(c.startDate.getDate()+O*D)}this.headerDetails.push(c),d+=m}},t.prototype.drawPageBorder=function(){for(var e=this.result.page.section.getPages(),t=0;t<e.length;t++){var i=e[t],r=i.graphics,n=i.getClientSize(),s=new a.PdfPen(new a.PdfColor(206,206,206));r.drawRectangle(s,0,0,n.width,n.height)}},t.prototype.drawGantttChart=function(){var e,t=this,r=this.startPoint,n=new a.PointF,s=0,o=0,d=0,h=0;this.headerDetails.forEach(function(u,c){var g=t.result.page.section.getPages()[t.startPageIndex];g.contentWidth=i.i(l.a)(t.headerDetails[c].endPoint-t.headerDetails[c].startPoint),t.chartHeader.drawTimeline(g,t.startPoint,u),r.y=r.y+i.i(l.b)(t.parent.timelineModule.isSingleTier?45:60),s=r.x,d=i.i(l.b)(t.parent.timelineModule.isSingleTier?45:60),t.headerDetails[t.headerDetails.indexOf(u)].startIndex=t.startPageIndex,t.headerDetails[t.headerDetails.indexOf(u)].pageStartPoint=r;for(var f=0;f<t.taskbarCollection.length;f++){var m=t.taskbarCollection[f],y=t.rows.getRow(f+1).height,D=t.result.page.section.getPages()[t.startPageIndex],v=D.graphics,w=new a.PdfPen(new a.PdfColor(206,206,206));!g.contentWidth||"Both"!=t.parent.gridLines&&"Horizontal"!=t.parent.gridLines||v.drawRectangle(w,s,r.y,g.contentWidth+.5,y);m.drawTaskbar(D,r,u,o,y,t.taskbarCollection[f])&&(t.enableHeader?r.y=i.i(l.b)(t.parent.timelineModule.isSingleTier?45:60):r.y=0,t.startPageIndex++,e={},e.height=d,e.pageStartX=s,e.startPoint=p({},n),e.width=i.i(l.b)(u.totalWidth),t.pdfPageDetail.push(e),n.y+=e.height,t.enableHeader?d=t.chartHeader.height:(r.y=0,d=0)),r.y+=y,d+=y,h+=y}t.headerDetails[c].endIndex=t.startPageIndex,o+=u.totalWidth,e={},e.height=d,e.pageStartX=s,e.startPoint=p({},n),e.width=i.i(l.b)(u.totalWidth),t.pdfPageDetail.push(e),n.x+=e.width,n.y=0,t.enableHeader?d=t.chartHeader.height:r.y=0,t.headerDetails.indexOf(u)!==t.headerDetails.length-1&&(t.result.page.section.add(),t.startPageIndex=t.result.page.section.count-1,r=t.startPoint=new a.PointF(0,0))});for(var u=0;u<this.predecessorCollection.length;u++){this.predecessorCollection[u].drawPredecessor(this)}},t}(s.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(2),n=(i.n(r),i(1)),a=i(0),s=(i.n(a),this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},s.apply(this,arguments)}),o=function(){function e(e){this.baselineHeight=8,this.leftTaskLabel={},this.rightTaskLabel={},this.startPage=-1,this.endPage=-1,this.parent=e}return e.prototype.add=function(){return new e(this.parent)},e.prototype.GetNextPage=function(e){var t=e.section,i=t.indexOf(e);return i===t.count-1?t.add():t.getPages()[i+1]},e.prototype.drawTaskbar=function(e,t,o,l,d,h){var p=e.graphics,u=!1,c=e.getClientSize();if(t.y+d>c.height){e=this.GetNextPage(e),e.contentWidth=i.i(n.a)(o.endPoint-o.startPoint),p=e.graphics,t.y=0,this.parent.pdfExportModule.gantt.enableHeader&&(this.parent.pdfExportModule.gantt.chartHeader.drawPageTimeline(e,t,o),t.y=i.i(n.b)(this.parent.timelineModule.isSingleTier?45:60)),u=!0;var g=e.graphics,f=new r.PdfPen(new r.PdfColor(206,206,206));!e.contentWidth||"Both"!=this.parent.gridLines&&"Horizontal"!=this.parent.gridLines||g.drawRectangle(f,t.x,t.y,e.contentWidth+.5,d)}this.drawLeftLabel(e,t,o,l);var m=new r.PdfStandardFont(this.fontFamily,9,r.PdfFontStyle.Regular);!i.i(a.isNullOrUndefined)(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(m=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var y=new r.PdfSolidBrush(this.progressFontColor),D=new r.PdfStringFormat;D.lineAlignment=r.PdfVerticalAlignment.Middle,D.alignment=r.PdfTextAlignment.Right;var v,w=!1;/^[a-zA-Z]/.test(this.taskLabel)&&(w=!0,D.alignment=r.PdfTextAlignment.Left);var k=-1;if(h.isMilestone)this.drawMilestone(e,t,o,l),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&this.drawMilestone(e,t,o,l);else{var b=new r.PdfPen(h.taskBorderColor),T=new r.PdfSolidBrush(h.taskColor),S=new r.PdfPen(h.baselineBorderColor),P=new r.PdfSolidBrush(h.baselineColor),C=new r.PdfPen(h.progressColor),M=new r.PdfSolidBrush(h.progressColor),R=i.i(n.b)((this.parent.rowHeight-this.height)/2),x=i.i(n.b)((this.parent.rowHeight-this.height)/4.5),O=this.parent.renderBaseline?x:R;k=e.section.indexOf(e);var I=i.i(a.isNullOrUndefined)(this.unscheduleStarteDate)?this.startDate:this.unscheduleStarteDate,E=i.i(a.isNullOrUndefined)(this.unscheduleEndDate)?this.endDate:this.unscheduleEndDate;if(o.startDate<=I&&E<=o.endDate)this.isStartPoint||(this.taskStartPoint=s({},t),this.isStartPoint=!0),this.isScheduledTask||"duration"===this.unscheduledTaskBy?(this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&p.drawRectangle(S,P,t.x+i.i(n.b)(h.baselineLeft-l)+.5,t.y+O+i.i(n.b)(h.height+3),i.i(n.b)(this.baselineWidth),i.i(n.b)(this.baselineHeight)),p.drawRectangle(b,T,t.x+i.i(n.b)(this.left-l)+.5,t.y+O,i.i(n.b)(h.width),i.i(n.b)(h.height)),this.isScheduledTask&&(p.drawRectangle(C,M,t.x+i.i(n.b)(this.left-l)+.5,t.y+O,i.i(n.b)(h.progressWidth),i.i(n.b)(h.height)),i.i(a.isNullOrUndefined)(this.parent.labelSettings.taskLabel)||i.i(a.isNullOrUndefined)(this.taskLabel)||(v=this.progressWidth,w&&(v=this.width),p.drawString(this.taskLabel.toString(),m,null,y,t.x+i.i(n.b)(this.left-l),t.y+O,i.i(n.b)(v),i.i(n.b)(this.height),D)))):this.drawUnscheduledTask(p,t,l,O),this.isCompleted=!0,this.startPage=k,this.endPage=k;else if(o.startDate<=I&&o.endDate>=I&&E>=o.endDate){this.isStartPoint||(this.taskStartPoint=s({},t),this.isStartPoint=!0);var F=0;if(w||(this.width=this.width-(o.totalWidth-(this.left-l))),F=o.totalWidth-(this.left-l),this.isScheduledTask||"duration"===this.unscheduledTaskBy){if(this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&p.drawRectangle(S,P,t.x+i.i(n.b)(h.baselineLeft-l)+.5,t.y+O+i.i(n.b)(h.height+3),i.i(n.b)(this.baselineWidth),i.i(n.b)(this.baselineHeight)),p.drawRectangle(b,T,t.x+i.i(n.b)(this.left-l)+.5,t.y+O,i.i(n.b)(F),i.i(n.b)(h.height)),h.width=h.width-F,this.isScheduledTask){var N=0;N=this.progressWidth<=F?this.progressWidth:F,p.drawRectangle(C,M,t.x+i.i(n.b)(this.left-l)+.5,t.y+O,i.i(n.b)(N),i.i(n.b)(h.height)),this.progressWidth-=N,this.parent.labelSettings.taskLabel&&!i.i(a.isNullOrUndefined)(this.taskLabel)&&(v=N,w&&(v=this.width),p.drawString(this.taskLabel.toString(),m,null,y,t.x+i.i(n.b)(this.left-l),t.y+O,i.i(n.b)(v),i.i(n.b)(this.height),D))}}else this.drawUnscheduledTask(p,t,l,O);this.left=0,this.isCompleted=!1,this.startPage=k}else if(E<=o.endDate&&o.startDate<=E&&!this.isCompleted)this.isStartPoint||(this.taskStartPoint=s({},t),this.isStartPoint=!0),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&p.drawRectangle(S,P,t.x+i.i(n.b)(h.baselineLeft-l)+.5,t.y+O+i.i(n.b)(h.height+3),i.i(n.b)(this.baselineWidth),i.i(n.b)(this.baselineHeight)),p.drawRectangle(b,T,t.x+i.i(n.b)(h.left+.5),t.y+O,i.i(n.b)(h.width),i.i(n.b)(h.height)),this.isScheduledTask&&(p.drawRectangle(C,M,t.x+i.i(n.b)(h.left+.5),t.y+O,i.i(n.b)(h.progressWidth),i.i(n.b)(h.height)),i.i(a.isNullOrUndefined)(this.taskLabel)||(v=this.progressWidth,w&&(v=this.width),p.drawString(this.taskLabel.toString(),m,null,y,t.x+i.i(n.b)(this.left),t.y+O,i.i(n.b)(v),i.i(n.b)(this.height),D))),this.isCompleted=!0,this.endPage=k;else if(I<o.startDate&&E>o.endDate){if(this.isStartPoint||(this.taskStartPoint=s({},t),this.isStartPoint=!0),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&p.drawRectangle(S,P,t.x+i.i(n.b)(h.baselineLeft-l)+.5,t.y+O+i.i(n.b)(h.height+3),i.i(n.b)(this.baselineWidth),i.i(n.b)(this.baselineHeight)),p.drawRectangle(b,T,t.x+i.i(n.b)(h.left)+.5,t.y+O,i.i(n.b)(o.totalWidth),i.i(n.b)(h.height)),this.isScheduledTask){var N=0;N=this.progressWidth<=o.totalWidth?this.progressWidth:o.totalWidth,p.drawRectangle(C,M,t.x+i.i(n.b)(h.left)+.5,t.y+O,i.i(n.b)(N),i.i(n.b)(h.height)),this.progressWidth-=N,i.i(a.isNullOrUndefined)(this.taskLabel)||(v=N,w&&(v=this.width),p.drawString(this.taskLabel.toString(),m,null,y,t.x+i.i(n.b)(this.left),t.y+O,i.i(n.b)(v),i.i(n.b)(this.height),D))}this.isCompleted=!1,this.width-=o.totalWidth}}return this.drawRightLabel(e,t,o,l),u},e.prototype.drawRightLabel=function(e,t,s,o){var l,d=e.graphics;l=this.rightTaskLabel.isLeftCalculated?this.rightTaskLabel.left:i.i(n.b)(this.rightTaskLabel.left);var h=l-i.i(n.b)(o)+t.x;if(s.startPoint<=l&&l<s.endPoint&&!i.i(a.isNullOrUndefined)(this.rightTaskLabel.value)&&!this.rightTaskLabel.isCompleted){var p=this.getWidth(this.rightTaskLabel.value,s.endPoint-l,15),u=new r.PdfStandardFont(this.fontFamily,9);!i.i(a.isNullOrUndefined)(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(u=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var c=(i.i(n.b)(this.parent.rowHeight)-p.actualSize.height)/2,g=new r.PointF(h,t.y+c),f=new r.SizeF(p.actualSize.width,p.actualSize.height),m=new r.RectangleF(g,f),y=new r.PdfStringFormat;if(y.alignment=r.PdfTextAlignment.Right,y.lineAlignment=r.PdfVerticalAlignment.Middle,p.actualSize.width>0){var D=new r.PdfSolidBrush(this.labelColor);d.drawString(p.lines[0].text,u,null,D,m.x,m.y,p.actualSize.width,p.actualSize.height,y),null!==p.remainder?(this.rightTaskLabel.value=p.remainder,this.rightTaskLabel.left=s.endPoint,this.rightTaskLabel.isLeftCalculated=!0):this.rightTaskLabel.isCompleted=!0}else this.rightTaskLabel.left=s.endPoint}},e.prototype.drawLeftLabel=function(e,t,s,o){var l,d=e.graphics;if(!i.i(a.isNullOrUndefined)(this.leftTaskLabel.value)){var h=0;if(h=this.left,this.leftTaskLabel.isLeftCalculated)l=this.leftTaskLabel.left;else{var p=this.getWidth(this.leftTaskLabel.value,Number.MAX_VALUE,15),u=this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33;l=i.i(n.b)(h-u)-p.actualSize.width,this.leftTaskLabel.left=l,this.leftTaskLabel.isLeftCalculated=!0}var c=l-i.i(n.b)(o)+t.x;if(s.startPoint<=l&&l<s.endPoint&&!i.i(a.isNullOrUndefined)(this.leftTaskLabel.value)&&!this.leftTaskLabel.isCompleted){var p=this.getWidth(this.leftTaskLabel.value,s.endPoint-l,15),g=new r.PdfStandardFont(this.fontFamily,9);!i.i(a.isNullOrUndefined)(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(g=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var f=(i.i(n.b)(this.parent.rowHeight)-p.actualSize.height)/2,m=new r.PointF(c,t.y+f),y=new r.SizeF(p.actualSize.width,p.actualSize.height),D=new r.RectangleF(m,y),v=new r.PdfStringFormat;if(v.alignment=r.PdfTextAlignment.Right,v.lineAlignment=r.PdfVerticalAlignment.Middle,p.actualSize.width>0){var w=new r.PdfSolidBrush(this.labelColor);d.drawString(p.lines[0].text,g,null,w,D.x,D.y,p.actualSize.width,p.actualSize.height,v),null!==p.remainder?(this.leftTaskLabel.value=p.remainder,this.leftTaskLabel.left=s.endPoint):this.leftTaskLabel.isCompleted=!0}else this.leftTaskLabel.left=s.endPoint}}},e.prototype.getWidth=function(e,t,n){var s=new r.PdfStandardFont(this.fontFamily,9);!i.i(a.isNullOrUndefined)(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(s=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var o=new r.PdfStringLayouter,l=new r.PdfStringFormat;return l.alignment=r.PdfTextAlignment.Left,l.wordWrap=r.PdfWordWrapType.Character,l.lineAlignment=r.PdfVerticalAlignment.Middle,o.layout(e,s,l,new r.SizeF(t,n),!1,new r.SizeF(t,n))},e.prototype.drawUnscheduledTask=function(e,t,a,s){var o=new r.PdfSolidBrush(this.taskColor);e.drawRectangle(o,t.x+i.i(n.b)(this.left-a),t.y+s,i.i(n.b)(3),i.i(n.b)(this.height))},e.prototype.drawMilestone=function(e,t,a,o){if(a.startDate<=this.startDate&&this.startDate<=a.endDate){var l=e.graphics,d=e.section.indexOf(e);this.taskStartPoint=s({},t);var h=new r.PdfPen(this.milestoneColor),p=i.i(n.b)((this.parent.rowHeight-this.height)/3),u=i.i(n.b)((this.parent.rowHeight-this.height)/2),c=this.parent.renderBaseline?p:u,g=new r.PdfSolidBrush(this.milestoneColor),f=new r.PdfPen(this.baselineBorderColor),m=new r.PdfSolidBrush(this.baselineColor);l.save();var y=Math.floor(.8*this.parent.chartRowsModule.taskBarHeight);l.translateTransform(t.x+i.i(n.b)(this.left-o),t.y+c-.7*this.parent.chartRowsModule.taskBarHeight/2),l.rotateTransform(45),this.parent.renderBaseline&&this.baselineStartDate&&this.baselineEndDate&&l.drawRectangle(f,m,2,2,i.i(n.b)(y),i.i(n.b)(y)),l.drawRectangle(h,g,0,0,i.i(n.b)(y),i.i(n.b)(y)),l.restore(),this.endPage=this.startPage=d}},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(2),n=(i.n(r),i(0)),a=(i.n(n),i(1)),s=function(){function e(e){this.width=0,this.gantt=e,this.parent=e.parent,this.topTierPoint=new r.PointF,this.bottomTierPoint=new r.PointF,this.topTierIndex=0,this.bottomTierIndex=0,this.prevTopTierIndex=0,this.prevBottomTierIndex=0}return e.prototype.drawTimeline=function(e,t,n){var s=i.i(a.a)(Math.floor(n.totalWidth)),o=0;for(this.topTierPoint.x=t.x,this.topTierPoint.y=t.y,this.prevTopTierIndex=this.topTierIndex,this.prevBottomTierIndex=this.bottomTierIndex;s>0;){var l=this.topTier[this.topTierIndex];if(this.topTier.length>this.topTierIndex){var d=!1;this.topTier[this.topTierIndex].isFinished||(s>=l.width?(o=l.width,l.isFinished=!0,l.completedWidth=o,d=!0):(o=s,d=!1,l.isFinished=!1,l.width=l.width-s,l.completedWidth=o)),this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,o,l.value,!0),this.topTierPoint.x+=o,s-=o,d&&this.topTierIndex++}else s=0}s=Math.floor(n.totalWidth);var h=this.parent.timelineModule.isSingleTier?0:this.topTierHeight;for(this.bottomTierPoint=new r.PointF(t.x,i.i(a.b)(t.y+h));s>0;){var p=this.bottomTier[this.bottomTierIndex];if(this.bottomTier.length>this.bottomTierIndex){var d=!0,u=p.width;s<u&&(u=s,d=!1,p.completedWidth=u),this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,u,p.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+u,s-=u,p.completedWidth=u,d&&this.bottomTierIndex++}else s=0}},e.prototype.drawPageTimeline=function(e,t,r){this.topTierPoint=i.i(n.extend)({},{},t,!0);for(var s=this.prevTopTierIndex;s<=this.topTierIndex;s++)if(this.topTier.length>s){var o=this.topTier[s];o.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,o.completedWidth,o.value,!0),this.topTierPoint.x+=o.completedWidth)}this.bottomTierPoint.x=t.x,this.bottomTierPoint.y=i.i(a.b)(t.y+this.topTierHeight);for(var s=this.prevBottomTierIndex;s<=this.bottomTierIndex;s++)if(this.bottomTier.length>s){var l=this.bottomTier[s];l.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,l.width,l.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+l.width)}},e.prototype.triggerQueryTimelinecell=function(e,t,s,o,l,d,h){var p=e.graphics,u={},c=this.gantt.ganttStyle;u.borderColor=new r.PdfColor(c.timeline.borderColor),u.fontColor=new r.PdfColor(c.timeline.fontColor),u.fontSize=c.timeline.fontSize,u.fontStyle=c.timeline.fontStyle,u.backgroundColor=new r.PdfColor(c.timeline.backgroundColor),c.timeline.padding&&(u.padding=c.timeline.padding);var g=new r.PdfStringFormat;i.i(n.isNullOrUndefined)(c.timeline.format)?h?(g.lineAlignment=r.PdfVerticalAlignment.Middle,g.alignment=r.PdfTextAlignment.Left):(g.lineAlignment=r.PdfVerticalAlignment.Middle,g.alignment=r.PdfTextAlignment.Center,g.wordWrap=r.PdfWordWrapType.Character):g=c.timeline.format,u.format=g;var f={timelineCell:u,value:d};this.parent.pdfQueryTimelineCellInfo&&this.parent.trigger("pdfQueryTimelineCellInfo",f);var m=f.timelineCell,y=new r.PdfPen(f.timelineCell.borderColor),D=new r.PdfSolidBrush(f.timelineCell.backgroundColor);p.drawRectangle(y,D,t,s,l,i.i(a.b)(o)),h||"Both"!=this.parent.gridLines&&"Vertical"!=this.parent.gridLines||p.drawRectangle(y,D,t,s+i.i(a.b)(o),l,e.getClientSize().height);var v=new r.PdfStandardFont(c.fontFamily,m.fontSize,m.fontStyle);c.font&&(v=c.font);var w=new r.PdfSolidBrush(f.timelineCell.fontColor),k=c.timeline.padding?f.timelineCell.padding.left:0,b=c.timeline.padding?f.timelineCell.padding.top:0;h?t=t+k+4:t+=k,p.drawString(f.value,v,null,w,t,s+b,i.i(a.b)(l),i.i(a.b)(o),m.format)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"type",void 0),a([i.i(r.Property)(null)],t.prototype,"headerText",void 0),a([i.i(r.Property)([])],t.prototype,"fields",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"from",void 0),a([i.i(r.Property)(null)],t.prototype,"to",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"type",void 0),a([i.i(r.Property)(null)],t.prototype,"headerText",void 0),a([i.i(r.Property)([])],t.prototype,"fields",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(!1)],t.prototype,"allowEditing",void 0),a([i.i(r.Property)(!1)],t.prototype,"allowAdding",void 0),a([i.i(r.Property)(!1)],t.prototype,"allowDeleting",void 0),a([i.i(r.Property)("Auto")],t.prototype,"mode",void 0),a([i.i(r.Property)("Top")],t.prototype,"newRowPosition",void 0),a([i.i(r.Property)(!1)],t.prototype,"showDeleteConfirmDialog",void 0),a([i.i(r.Property)(!1)],t.prototype,"allowTaskbarEditing",void 0),a([i.i(r.Property)(!1)],t.prototype,"allowNextRowEdit",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"day",void 0),a([i.i(r.Property)(null)],t.prototype,"label",void 0),a([i.i(r.Property)(null)],t.prototype,"cssClass",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(5)),a=(i.n(n),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),s=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),s([i.i(r.Collection)([],n.Predicate)],t.prototype,"columns",void 0),s([i.i(r.Property)("Menu")],t.prototype,"type",void 0),s([i.i(r.Property)()],t.prototype,"operators",void 0),s([i.i(r.Property)(!1)],t.prototype,"ignoreAccent",void 0),s([i.i(r.Property)("Parent")],t.prototype,"hierarchyMode",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"from",void 0),a([i.i(r.Property)(null)],t.prototype,"to",void 0),a([i.i(r.Property)(null)],t.prototype,"label",void 0),a([i.i(r.Property)(null)],t.prototype,"cssClass",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"rightLabel",void 0),a([i.i(r.Property)(null)],t.prototype,"leftLabel",void 0),a([i.i(r.Property)(null)],t.prototype,"taskLabel",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)("Spinner")],t.prototype,"indicatorType",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"id",void 0),a([i.i(r.Property)(null)],t.prototype,"name",void 0),a([i.i(r.Property)(null)],t.prototype,"unit",void 0),a([i.i(r.Property)(null)],t.prototype,"group",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)([])],t.prototype,"fields",void 0),a([i.i(r.Property)(!1)],t.prototype,"ignoreCase",void 0),a([i.i(r.Property)("contains")],t.prototype,"operator",void 0),a([i.i(r.Property)("")],t.prototype,"key",void 0),a([i.i(r.Property)("Parent")],t.prototype,"hierarchyMode",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)("Row")],t.prototype,"mode",void 0),a([i.i(r.Property)("Flow")],t.prototype,"cellSelectionMode",void 0),a([i.i(r.Property)("Single")],t.prototype,"type",void 0),a([i.i(r.Property)(!1)],t.prototype,"persistSelection",void 0),a([i.i(r.Property)(!1)],t.prototype,"enableToggle",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return o});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)()],t.prototype,"field",void 0),a([i.i(r.Property)()],t.prototype,"direction",void 0),t}(r.ChildProperty),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Collection)([],s)],t.prototype,"columns",void 0),a([i.i(r.Property)(!0)],t.prototype,"allowUnsort",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"position",void 0),a([i.i(r.Property)(-1)],t.prototype,"columnIndex",void 0),a([i.i(r.Property)(4)],t.prototype,"separatorSize",void 0),a([i.i(r.Property)(null)],t.prototype,"minimum",void 0),a([i.i(r.Property)("Default")],t.prototype,"view",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(null)],t.prototype,"id",void 0),a([i.i(r.Property)(null)],t.prototype,"name",void 0),a([i.i(r.Property)(null)],t.prototype,"parentID",void 0),a([i.i(r.Property)(null)],t.prototype,"hasChildMapping",void 0),a([i.i(r.Property)(null)],t.prototype,"startDate",void 0),a([i.i(r.Property)(null)],t.prototype,"endDate",void 0),a([i.i(r.Property)(null)],t.prototype,"dependency",void 0),a([i.i(r.Property)(null)],t.prototype,"progress",void 0),a([i.i(r.Property)(null)],t.prototype,"child",void 0),a([i.i(r.Property)(null)],t.prototype,"milestone",void 0),a([i.i(r.Property)(null)],t.prototype,"duration",void 0),a([i.i(r.Property)(null)],t.prototype,"durationUnit",void 0),a([i.i(r.Property)(null)],t.prototype,"cssClass",void 0),a([i.i(r.Property)(null)],t.prototype,"baselineStartDate",void 0),a([i.i(r.Property)(null)],t.prototype,"baselineEndDate",void 0),a([i.i(r.Property)(null)],t.prototype,"resourceInfo",void 0),a([i.i(r.Property)(null)],t.prototype,"expandState",void 0),a([i.i(r.Property)(null)],t.prototype,"indicators",void 0),a([i.i(r.Property)(null)],t.prototype,"notes",void 0),a([i.i(r.Property)(null)],t.prototype,"work",void 0),a([i.i(r.Property)(null)],t.prototype,"manual",void 0),a([i.i(r.Property)(null)],t.prototype,"type",void 0),a([i.i(r.Property)(null)],t.prototype,"segments",void 0),a([i.i(r.Property)(null)],t.prototype,"segmentId",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return o});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)("")],t.prototype,"format",void 0),a([i.i(r.Property)("None")],t.prototype,"unit",void 0),a([i.i(r.Property)(1)],t.prototype,"count",void 0),a([i.i(r.Property)(null)],t.prototype,"formatter",void 0),t}(r.ChildProperty),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)("Week")],t.prototype,"timelineViewMode",void 0),a([i.i(r.Complex)({},s)],t.prototype,"topTier",void 0),a([i.i(r.Complex)({},s)],t.prototype,"bottomTier",void 0),a([i.i(r.Property)(33)],t.prototype,"timelineUnitSize",void 0),a([i.i(r.Property)(0)],t.prototype,"weekStartDay",void 0),a([i.i(r.Property)(null)],t.prototype,"weekendBackground",void 0),a([i.i(r.Property)(!0)],t.prototype,"showTooltip",void 0),a([i.i(r.Property)(!0)],t.prototype,"updateTimescaleView",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}()),a=this&&this.__decorate||function(e,t,i,r){var n,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),a([i.i(r.Property)(!0)],t.prototype,"showTooltip",void 0),a([i.i(r.Property)()],t.prototype,"taskbar",void 0),a([i.i(r.Property)()],t.prototype,"baseline",void 0),a([i.i(r.Property)()],t.prototype,"connectorLine",void 0),a([i.i(r.Property)()],t.prototype,"editing",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(0),n=(i.n(r),i(1)),a=i(4),s=(i.n(a),i(3)),o=i(10),l=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),d=function(e){function t(t){var i=e.call(this,t)||this;return i.taskBarHeight=0,i.milestoneHeight=0,i.milesStoneRadius=0,i.baselineTop=0,i.baselineHeight=8,i.touchLeftConnectorpoint="",i.touchRightConnectorpoint="",i.dropSplit=!1,i.refreshedTr=[],i.refreshedData=[],i.isUpdated=!0,i.parent=t,i.initPublicProp(),i.addEventListener(),i}return l(t,e),t.prototype.initPublicProp=function(){this.ganttChartTableBody=null},t.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createChartTable,this),this.parent.on("dataReady",this.initiateTemplates,this),this.parent.on("destroy",this.destroy,this)},t.prototype.refreshChartByTimeline=function(){this.taskTable.style.width=i.i(r.formatUnit)(this.parent.timelineModule.totalTimelineWidth);var e=i.i(r.getValue)("prevProjectStartDate",this.parent.dataOperation),t=!1;e&&(t=e.getTime()===this.parent.cloneProjectStartDate.getTime()),this.isUpdated=!!(this.parent.isFromOnPropertyChange&&t&&i.i(r.getValue)("mutableData",this.parent.treeGrid.grid.contentModule)),this.refreshGanttRows(),this.isUpdated=!0},t.prototype.createChartTable=function(){this.taskTable=i.i(r.createElement)("table",{className:s._25+" "+s._26,id:"GanttTaskTable"+this.parent.element.id,styles:"position: absolute;width:"+this.parent.timelineModule.totalTimelineWidth+"px;",attrs:{cellspacing:"0.25px"}});var e=i.i(r.createElement)("colgroup"),t=i.i(r.createElement)("col",{styles:"width:"+this.parent.timelineModule.totalTimelineWidth+"px;"});e.appendChild(t),this.taskTable.appendChild(e),this.ganttChartTableBody=i.i(r.createElement)("tbody",{id:this.parent.element.id+"GanttTaskTableBody"}),this.taskTable.appendChild(this.ganttChartTableBody),this.parent.ganttChartModule.chartBodyContent.appendChild(this.taskTable)},t.prototype.initiateTemplates=function(){this.taskTable.style.width=i.i(r.formatUnit)(this.parent.timelineModule.totalTimelineWidth),this.initChartHelperPrivateVariable(),this.initializeChartTemplate()},t.prototype.renderChartRows=function(){this.createTaskbarTemplate(),this.parent.isGanttChartRendered=!0},t.prototype.getIndicatorNode=function(e){var t='<label class="'+s._27+" "+s._28+'"style="line-height:'+this.parent.rowHeight+"px;"+(this.parent.enableRtl?"right:":"left:")+this.getIndicatorleft(e.date)+'px;"><i class="'+e.iconClass+'"></i> </label>';return this.createDivElement(t)},t.prototype.getIndicatorleft=function(e){return e=this.parent.dateValidationModule.getDateFromFormat(e),this.parent.dataOperation.getTaskLeft(e,!1)},t.prototype.getChildTaskbarNode=function(e,t){var n,a=null,o=this.templateData;if(n=this.parent.enableRtl?"right:":"left:",this.childTaskbarTemplateFunction)a=this.childTaskbarTemplateFunction(i.i(r.extend)({index:e},o),this.parent,"TaskbarTemplate",this.getTemplateID("TaskbarTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var l="",d="",h=void 0,p=void 0;o.ganttProperties.startDate&&o.ganttProperties.endDate&&o.ganttProperties.duration&&(h=this.createDivElement('<div class="'+s.N+" "+s._1+" "+(o.ganttProperties.isAutoSchedule?"":s._29)+'"style="width:'+o.ganttProperties.width+"px;height:"+this.taskBarHeight+'px; margin-top :-1px"></div>'),p=this.createDivElement('<div class="'+s._30+" "+s._0+" "+(o.ganttProperties.isAutoSchedule?"":s._31)+'" style="border-style:'+(o.ganttProperties.progressWidth?"solid;":"none;")+"width:"+o.ganttProperties.progressWidth+"px;height:100%;border-top-right-radius:"+this.getBorderRadius(o.ganttProperties)+"px;border-bottom-right-radius:"+this.getBorderRadius(o.ganttProperties)+'px;"></div>'));var u=i.i(r.createElement)("div");if(this.taskLabelTemplateFunction&&!i.i(r.isNullOrUndefined)(p)&&p.length>0){var c=this.taskLabelTemplateFunction(i.i(r.extend)({index:e},o),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,p[0]);c&&c.length>0&&(i.i(r.append)(c,u),l=u.innerHTML)}else{var g=this.parent.labelSettings.taskLabel;l=this.getTaskLabel(g),l="isCustomTemplate"===l?this.parent.labelSettings.taskLabel:l,this.parent.enableHtmlSanitizer&&"string"==typeof l&&(l=r.SanitizeHtmlHelper.sanitize(l))}-1===l.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(l=""),d=isNaN(parseInt(l))?'<span class="'+s._32+'" style="line-height:'+(this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(o.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="'+s._32+'" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"text-align:"+(this.parent.enableRtl?"right;":"left;"):"")+ +("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+ +("ResourceView"===this.parent.viewType?o.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;"></span>');var f=!i.i(r.isNullOrUndefined)(o.ganttProperties.segments)&&o.ganttProperties.segments.length>0?this.splitTaskbar(o,l):o.ganttProperties.startDate&&o.ganttProperties.endDate&&o.ganttProperties.duration?d:!o.ganttProperties.startDate||o.ganttProperties.endDate||o.ganttProperties.duration?!o.ganttProperties.endDate||o.ganttProperties.startDate||o.ganttProperties.duration?!o.ganttProperties.duration||o.ganttProperties.startDate||o.ganttProperties.endDate?"":'<div class="'+s._30+" "+s._1+" "+s._35+" "+(o.ganttProperties.isAutoSchedule?"":s._29)+'"style="'+n+o.ganttProperties.left+"px; width:"+o.ganttProperties.width+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+s._30+" "+s._1+" "+s._34+" "+(o.ganttProperties.isAutoSchedule?"":s._29)+'"style="'+n+o.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+s._30+" "+s._1+" "+s._33+" "+(o.ganttProperties.isAutoSchedule?"":s._29)+'"style="'+n+o.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>';if(o.ganttProperties.startDate&&o.ganttProperties.endDate&&o.ganttProperties.duration&&(i.i(r.isNullOrUndefined)(o.ganttProperties.segments)||!i.i(r.isNullOrUndefined)(o.ganttProperties.segments)&&0===o.ganttProperties.segments.length)){if(""!==f&&!i.i(r.isNullOrUndefined)(p)&&p.length>0){var m=this.createDivElement(f)[0];this.parent.disableHtmlEncode?m.innerText=l:m.innerHTML=l;var y=this.parent.labelSettings.taskLabel;y&&y.elementRef&&m.appendChild(u),p[0].appendChild(m),""!==p[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(y)&&p[0].querySelectorAll(".e-task-label")[0].children[0]&&p[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""===p[0].querySelectorAll(".e-task-label")[0].textContent&&y&&!y.elementRef&&""!==u.innerHTML&&(p[0].querySelectorAll(".e-task-label")[0].textContent=y)}!i.i(r.isNullOrUndefined)(h)&&h.length>0&&h[0].appendChild([].slice.call(p)[0]),a=h}else a=this.createDivElement(f)}return this.parent.enableRtl&&!i.i(r.isNullOrUndefined)(a)&&a[0]&&a[0].querySelector(".e-task-label")&&(a[0].querySelector(".e-task-label").style.marginLeft="15px",a[0].querySelector(".e-task-label").style.marginRight="8px",a[0].querySelector(".e-gantt-child-progressbar")&&(a[0].querySelector(".e-gantt-child-progressbar").style.textAlign="left")),a},t.prototype.splitTaskbar=function(e,t){for(var i="",r=0;r<e.ganttProperties.segments.length;r++){var n=e.ganttProperties.segments[r],a=void 0;a=n.showProgress?"initial":"hidden";var o=0===r?"e-segment-first":r===e.ganttProperties.segments.length-1?"e-segment-last":"e-segment-inprogress";i+='<div class="'+s.N+" "+o+" "+s._1+' e-segmented-taskbar"style="width:'+n.width+"px;position: absolute;"+(this.parent.enableRtl?"right:":"left:")+n.left+"px;height:"+this.taskBarHeight+"px; overflow:"+a+';" data-segment-index = "'+r+'" aria-label = "'+this.generateSpiltTaskAriaLabel(n,e.ganttProperties)+'"> '+this.getSplitTaskbarLeftResizerNode()+'<div class="'+s._30+" "+s._0+' " style="border-style:'+(n.progressWidth?"solid;":"none;")+"display:"+(n.progressWidth>=0?"block;":"none;")+"width:"+n.progressWidth+"px;height:100%;text-align:"+(this.parent.enableRtl?"left;":"right;")+"border-top-right-radius:"+this.getSplitTaskBorderRadius(n)+"px;border-bottom-right-radius:"+this.getSplitTaskBorderRadius(n)+'px;"><span class="'+s._32+'" style="line-height:'+(this.taskBarHeight-1)+"px;display:"+(n.showProgress?"inline;":"none;")+"height:"+this.taskBarHeight+'px;">'+t+"</span></div>"+this.getSplitTaskbarRightResizerNode(n)+(n.showProgress?this.getSplitProgressResizerNode(n):"")+"</div></div>"}return i},t.prototype.getSplitTaskbarLeftResizerNode=function(){var e=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?5:-2;return'<div class="'+s.O+" "+s._36+'" style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>'},t.prototype.getSplitTaskbarRightResizerNode=function(e){var t=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?-17:-10;return'<div class="'+s.Q+" "+s._36+'" style="'+(this.parent.enableRtl?"right:":"left:")+(e.width+t)+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>'},t.prototype.getSplitProgressResizerNode=function(e){var t=this.parent.enableRtl?e.progressWidth+8:e.progressWidth-6;return'<div class="'+s.S+'" style="'+(this.parent.enableRtl?"right:":"left:")+t+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+s._37+'"><div class="'+s._38+'"></div><div class="'+s._39+'"></div></div>'},t.prototype.getSegmentIndex=function(e,t){var n=-1,a=t.ganttProperties,s=a.segments;if(!i.i(r.isNullOrUndefined)(s)){s.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()});for(var o=s.length,l=0;l<o;l++){var d=s[l];if(e.getTime()===a.startDate.getTime())this.dropSplit=!0,n=0;else if(e.getTime()===d.startDate.getTime()){this.dropSplit=!0;var h=d.startDate;h.setDate(h.getDate()+1),h=d.startDate=this.parent.dataOperation.checkStartDate(h,a,!1),d.startDate=h;var p=d.endDate;p=this.parent.dataOperation.getEndDate(h,d.duration,a.durationUnit,a,!1),d.endDate=p,l===s.length-1&&this.parent.setRecordValue("endDate",p,a,!0),this.incrementSegments(s,l,t),n=d.segmentIndex}else d.endDate=this.parent.dataOperation.getEndDate(d.startDate,d.duration,a.durationUnit,a,!1),e.getTime()>=d.startDate.getTime()&&e.getTime()<=d.endDate.getTime()&&(n=d.segmentIndex);this.parent.setRecordValue("segments",a.segments,a,!0)}}return-1===n&&(this.dropSplit=!0),n},t.prototype.mergeTask=function(e,t){var i=t.length,r=this.parent.taskFields,n=this.parent.flatData.filter(function(t){return t[r.id]===e?t:null})[0],a=n.ganttProperties.segments;t=t.sort(function(e,t){return t.firstSegmentIndex-e.firstSegmentIndex});for(var s=0;s<i;s++){var o=a[t[s].firstSegmentIndex],l=a[t[s].secondSegmentIndex],d=o.duration+l.duration,h=this.parent.dataOperation.getEndDate(o.startDate,d,n.ganttProperties.durationUnit,n.ganttProperties,!1),p={startDate:o.startDate,endDate:h,duration:d},u=t[s].firstSegmentIndex;a.splice(u,2,p),this.parent.setRecordValue("segments",a,n.ganttProperties,!0),this.parent.dataOperation.updateMappingData(n,"segments"),1===a.length?(this.parent.setRecordValue("endDate",h,n.ganttProperties,!0),this.parent.setRecordValue("EndDate",h,n,!0),this.parent.setRecordValue("segments",null,n.ganttProperties,!0),this.parent.dataOperation.updateMappingData(n,"segments")):n.ganttProperties.endDate!==a[a.length-1].endDate&&this.parent.setRecordValue("endDate",a[a.length-1].endDate,n.ganttProperties,!0)}this.refreshChartAfterSegment(n,"mergeSegment")},t.prototype.refreshChartAfterSegment=function(e,t){this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e,!1),e.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e,"segments"),this.parent.dataOperation.updateWidthLeft(e),this.parent.predecessorModule&&this.parent.taskFields.dependency?(this.parent.predecessorModule.updatedRecordsDateByPredecessor(),this.parent.connectorLineModule.removePreviousConnectorLines(this.parent.flatData),this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.flatData),e.parentItem&&this.parent.getParentTask(e.parentItem).ganttProperties.isAutoSchedule&&this.parent.isInPredecessorValidation&&this.parent.dataOperation.updateParentItems(e.parentItem),this.refreshRecords(this.parent.currentViewData)):this.refreshRow(this.parent.currentViewData.indexOf(e));var n=this.ganttChartTableBody.querySelectorAll("tr")[this.parent.currentViewData.indexOf(e)],a={requestType:t,rowData:e};this.triggerQueryTaskbarInfoByIndex(n,e),this.parent.selectionModule.clearSelection();var s=a.rowData.taskData[this.parent.taskFields.segments];if(this.parent.timezone&&null!=s)for(var o=0;o<s.length;o++)s[o][this.parent.taskFields.startDate]=this.parent.dateValidationModule.remove(a.rowData.ganttProperties.segments[o].startDate,this.parent.timezone),this.parent.taskFields.endDate&&(s[o][this.parent.taskFields.endDate]=this.parent.dateValidationModule.remove(a.rowData.ganttProperties.segments[o].endDate,this.parent.timezone));this.parent.trigger("actionComplete",a),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),i.i(r.setValue)("isEdit",!1,this.parent.contextMenuModule),i.i(r.setValue)("isEdit",!1,this.parent)},t.prototype.splitTask=function(e,t){var n=this.parent.taskFields,a=t,s=this.parent.flatData.filter(function(t){return t[n.id]===e?t:null})[0],o=s.ganttProperties;this.dropSplit=!1;var l=-1,d=o.segments;if(i.i(r.isNullOrUndefined)(t.length)||t.length<0){var h=this.parent.dataOperation.checkStartDate(a,o,!1);if(h.getTime()!==o.startDate.getTime()&&o.isAutoSchedule){if(!i.i(r.isNullOrUndefined)(d)&&d.length>0&&(l=this.getSegmentIndex(h,s)),!1===this.dropSplit&&a.getTime()>o.startDate.getTime()&&a.getTime()<o.endDate.getTime()){d=-1!==l?d:[];var p=-1!==l?d[l].startDate:new Date(o.startDate.getTime()),u=-1!==l?d[l].endDate:new Date(o.endDate.getTime()),c=this.parent.dataOperation.getDuration(p,u,o.durationUnit,o.isAutoSchedule,o.isMilestone);this.parent.setRecordValue("segments",this.splitSegmentedTaskbar(p,u,a,l,d,s,c),o,!0),-1!==l&&this.incrementSegments(d,l+1,s),this.parent.setRecordValue("endDate",d[d.length-1].endDate,o,!0),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(s,"endDate")}this.refreshChartAfterSegment(s,"splitTaskbar")}}else t.sort(function(e,t){return e.getTime()-t.getTime()}),this.parent.setRecordValue("segments",this.constructSegments(t,s.ganttProperties),s.ganttProperties,!0),this.refreshChartAfterSegment(s,"splitTask")},t.prototype.constructSegments=function(e,t){for(var i,r,n,a=[],s=new Date,o=0;o<e.length+1&&(s=0===o?t.startDate:s,s=this.parent.dataOperation.checkStartDate(s,t,!1),r=o!==e.length?new Date(e[o].getTime())>t.endDate?t.endDate:new Date(e[o].getTime()):t.endDate,r=this.parent.dataOperation.checkEndDate(r,t,!1),n=this.parent.dataOperation.getDuration(s,r,t.durationUnit,t.isAutoSchedule,t.isMilestone),r.getTime()>=s.getTime()&&(i={startDate:s,endDate:r,duration:n},a.push(i)),o!==e.length);o++)s=new Date(e[o].getTime()),s.setDate(e[o].getDate()+1);return a},t.prototype.splitSegmentedTaskbar=function(e,t,i,r,n,a,s){var o=a.ganttProperties,l=this.parent.nonWorkingDayIndex.indexOf(i.getDay()),d=-1===l?0:0===l?1:2;e=this.parent.dataOperation.checkStartDate(e,o,!1);var h=new Date(i.getTime());h=this.parent.dataOperation.checkEndDate(h,o,!1);for(var p=0;p<2;p++){var u={startDate:e,endDate:h,duration:this.parent.dataOperation.getDuration(e,h,o.durationUnit,o.isAutoSchedule,o.isMilestone),offsetDuration:1},c=this.parent.nonWorkingDayIndex.indexOf(h.getDay());-1!==r&&(n.splice(r,1),r=-1),n.push(u);var g=this.parent.timelineModule.customTimelineSettings.bottomTier.unit;if("Hour"===g||"Minutes"===g){e=new Date(i.getTime()),e=this.parent.dataOperation.checkStartDate(e,o,!1);var f=this.parent.timelineModule.customTimelineSettings.bottomTier.count,m=this.parent.timelineModule.customTimelineSettings.bottomTier.unit,y=this.parent.timelineModule.getIncrement(e,f,m),D=e.getTime()+y;e.setTime(D+d),h=new Date(t.getTime()),y=this.parent.timelineModule.getIncrement(h,f,m),D=h.getTime()+y,h.setTime(D+d)}else e=new Date(i.getTime()),e.setDate(e.getDate()+1+d),this.setTime(this.parent.defaultStartTime,e),e=this.parent.dataOperation.checkStartDate(e,o,!1),h=new Date(t.getTime()),h.setDate(h.getDate()+1);if(-1!==c){var v=s-u.duration;h=this.parent.dataOperation.getEndDate(e,v,o.durationUnit,o,!1)}else h=this.parent.dataOperation.checkEndDate(h,o,!1)}return n.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),n},t.prototype.incrementSegments=function(e,t,i){for(var r=i.ganttProperties,n=t+1;n<e.length;n++){var a=e[n],s=0!==n?new Date(e[n-1].endDate.getTime()):new Date(a.startDate.getTime());s=this.parent.dataOperation.getEndDate(s,a.offsetDuration,r.durationUnit,r,!1),s=this.parent.dataOperation.checkStartDate(s,r,!1),a.startDate=s;var o=a.endDate=this.parent.dataOperation.getEndDate(s,a.duration,r.durationUnit,r,!1);a.endDate=o,n===e.length-1&&(this.parent.setRecordValue("endDate",o,r,!0),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(i,"endDate"))}e.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),this.parent.setRecordValue("segments",e,r,!0),this.parent.dataOperation.updateMappingData(i,"segments")},t.prototype.getMilestoneNode=function(e,t){var n=null,a=this.templateData;if(this.milestoneTemplateFunction)n=this.milestoneTemplateFunction(i.i(r.extend)({index:e},a),this.parent,"MilestoneTemplate",this.getTemplateID("MilestoneTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var o='<div class="'+s._40+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6)+'px;position:absolute;transform: rotate(45deg);left:1px;"> </div>';n=this.createDivElement(o)}return n},t.prototype.getTaskBaselineNode=function(){var e=this.templateData,t='<div class="'+s._41+' " role="term" style="margin-top:'+this.baselineTop+"px;"+(this.parent.enableRtl?"right:":"left:")+e.ganttProperties.baselineLeft+"px;width:"+e.ganttProperties.baselineWidth+"px;height:"+this.baselineHeight+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+'"></div>';return this.createDivElement(t)},t.prototype.getMilestoneBaselineNode=function(){var e=this.templateData,t=this.parent.renderBaseline?5:2,i='<div class="'+s._42+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-10)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-10)+"px;position:absolute;transform:rotate(45deg);"+(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e.ganttProperties.left-this.milestoneHeight/2+3:e.ganttProperties.baselineLeft-this.milestoneHeight/2+1)+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+"margin-top:"+(-Math.floor(this.parent.rowHeight-this.milestoneMarginTop)+t+2)+'px"> </div>';return this.createDivElement(i)},t.prototype.getLeftLabelNode=function(e){var t=this.leftLabelContainer();""!==this.generateTaskLabelAriaLabel("left")&&t[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("left"));var n=null;if(this.leftTaskLabelTemplateFunction)n=this.leftTaskLabelTemplateFunction(i.i(r.extend)({index:e},this.templateData),this.parent,"LeftLabelTemplate",this.getTemplateID("LeftLabelTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var a=this.parent.labelSettings.leftLabel,o=this.getTaskLabel(a);o&&(o="isCustomTemplate"===o?a:o,n=this.getLableText(o,s._43),this.parent.enableHtmlSanitizer&&"string"==typeof o&&(o=r.SanitizeHtmlHelper.sanitize(o),o="isCustomTemplate"===o?a:o,n=this.getLableText(o,s._43)))}return n&&n.length>0&&("null"===n[0].data&&(n[0].data=""),i.i(r.append)(n,t[0])),this.parent.enableRtl&&(t[0].style.paddingLeft="25px",t[0].style.paddingRight="0px"),t},t.prototype.getLableText=function(e,t){var n=this.parent.renderBaseline?(this.parent.rowHeight-this.taskBarHeight)/2:this.taskBarMarginTop,a=i.i(r.createElement)("div",{className:t,styles:"height:"+this.taskBarHeight+"px;margin-top:"+n+"px;"}),o=i.i(r.createElement)("span",{className:s._27});o[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=e,a.appendChild(o);var l=i.i(r.createElement)("div");return l.appendChild(a),l.childNodes},t.prototype.getRightLabelNode=function(e){var t=this.rightLabelContainer();""!==this.generateTaskLabelAriaLabel("right")&&t[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("right"));var n=null;if(this.rightTaskLabelTemplateFunction)n=this.rightTaskLabelTemplateFunction(i.i(r.extend)({index:e},this.templateData),this.parent,"RightLabelTemplate",this.getTemplateID("RightLabelTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var a=this.parent.labelSettings.rightLabel,o=this.getTaskLabel(a);o&&(o="isCustomTemplate"===o?a:o,n=this.getLableText(o,s._44),this.parent.enableHtmlSanitizer&&"string"==typeof o&&(o=r.SanitizeHtmlHelper.sanitize(o),o="isCustomTemplate"===o?a:o,n=this.getLableText(o,s._44)))}return n&&n.length>0&&("null"===n[0].data&&(n[0].data=""),i.i(r.append)(n,t[0])),this.parent.enableRtl&&(t[0].style.marginLeft="0px",t[0].style.paddingRight="25px"),t},t.prototype.getManualTaskbar=function(){var e=this.templateData,t=this.taskBarHeight/2-1,i=e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration?'<div class="'+s.L+'" style="width:'+e.ganttProperties.width+"px;height:"+t/5+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>':e.ganttProperties.startDate||e.ganttProperties.endDate||!e.ganttProperties.duration?'<div class="'+s.L+" "+(e.ganttProperties.startDate?s._33:s._34)+'" style="width:'+e.ganttProperties.width+"px;height:"+2*t+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>':'<div class="'+s.L+" "+s._45+'" style="width:'+e.ganttProperties.width+"px;height:"+(t/5+1)+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>',r='<div class="'+s.K+'"style='+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-e.ganttProperties.autoLeft)+"px;width:"+e.ganttProperties.width+"px;height:"+t+"px;>"+i+(e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration||e.ganttProperties.duration?'<div class="e-gantt-manualparenttaskbar-left" style='+(this.parent.enableRtl?"margin-right:0px;":"")+'"height:'+(t/5+8)+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div><div class="e-gantt-manualparenttaskbar-right" style='+(this.parent.enableRtl?"margin-right:-8px;":"")+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.width-Math.floor((t/5+8)/5))+"px;height:"+(t/5+8)+"px;border-right-width:"+t/5+"px;border-bottom:"+t/5+"px solid transparent;></div></div>":""),n='<div class="'+s.M+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;position:absolute;transform: rotate(45deg);top:"+(this.parent.rowHeight>40?0:2)+"px;left:"+(this.parent.renderBaseline?2:1)+'px;"> </div>';return this.createDivElement(0!==e.ganttProperties.duration?r:n)},t.prototype.getParentTaskbarNode=function(e,t){var n=null,a=this.templateData;if(this.parentTaskbarTemplateFunction)n=this.parentTaskbarTemplateFunction(i.i(r.extend)({index:e},a),this.parent,"ParentTaskbarTemplate",this.getTemplateID("ParentTaskbarTemplate"),!1,void 0,t[0],this.parent.treeGrid.root);else{var o="",l=void 0,d=this.taskBarHeight/5,h=this.createDivElement('<div class="'+s._46+" "+this.getExpandClass(a)+" "+s._2+'" style="width:'+(a.ganttProperties.isAutoSchedule?a.ganttProperties.width:a.ganttProperties.autoWidth)+"px;height:"+(a.ganttProperties.isAutoSchedule?this.taskBarHeight:3*d)+"px;margin-top:"+(a.ganttProperties.isAutoSchedule?-1:2*d)+'px; "></div>'),p=this.createDivElement('<div class="'+s._47+" "+this.getExpandClass(a)+" "+s._3+'" style="border-style:'+(a.ganttProperties.progressWidth?"solid;":"none;")+"width:"+a.ganttProperties.progressWidth+"px;border-top-right-radius:"+this.getBorderRadius(a)+"px;border-bottom-right-radius:"+this.getBorderRadius(a)+'px;height:100%;"></div>'),u=i.i(r.createElement)("div");if(this.taskLabelTemplateFunction){var c=this.taskLabelTemplateFunction(i.i(r.extend)({index:e},a),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,p[0]);c&&c.length>0&&(i.i(r.append)(c,u),o=u.innerHTML)}else o=this.getTaskLabel(this.parent.labelSettings.taskLabel),o="isCustomTemplate"===o?this.parent.labelSettings.taskLabel:o,this.parent.enableHtmlSanitizer&&"string"==typeof o&&(o=r.SanitizeHtmlHelper.sanitize(o));if(-1===o.indexOf("null")){"isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(o=""),l=isNaN(parseInt(o))?'<span class="'+s._32+'" style="line-height:'+(a.isManual&&a.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(a.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="'+s._32+'" style="line-height:'+(a.isManual&&a.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(a.ganttProperties.width-10):"")+"px; height:"+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display: inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(a.ganttProperties.width-10):"")+"px; height:"+this.taskBarHeight+'px;"></span>';var g=this.createDivElement(l)[0];this.parent.disableHtmlEncode?g.innerText=o:g.innerHTML=o;var f=this.parent.labelSettings.taskLabel;f&&f.elementRef&&g.appendChild(u),p[0].appendChild(g),""!==p[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(f)&&p[0].querySelectorAll(".e-task-label")[0].children[0]&&p[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""===p[0].querySelectorAll(".e-task-label")[0].textContent&&f&&!f.elementRef&&""!==u.innerHTML&&(p[0].querySelectorAll(".e-task-label")[0].textContent=f)}var m='<div class="'+s._48+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;position:absolute;transform: rotate(45deg);top:"+(this.parent.rowHeight>40?0:2)+"px;left:"+(this.parent.renderBaseline?2:1)+'px;"> </div>';h[0].appendChild([].slice.call(p)[0]),n=a.ganttProperties.isMilestone?this.createDivElement(a.ganttProperties.isAutoSchedule?m:""):h}return this.parent.enableRtl&&n[0]&&n[0].querySelector(".e-task-label")&&(n[0].querySelector(".e-task-label").style.marginLeft="15px",n[0].querySelector(".e-task-label").style.marginRight="8px",n[0].querySelector(".e-gantt-parent-progressbar")&&(n[0].querySelector(".e-gantt-parent-progressbar").style.textAlign="left")),n},t.prototype.getTableTrNode=function(e){var t,n=i.i(r.createElement)("table"),a="Horizontal"===this.parent.gridLines||"Both"===this.parent.gridLines?"e-chart-row-border":"",o=this.parent.treeGrid.grid.contentModule.getRows()[e];return t=o&&o.isSelected?"e-active":"",n.innerHTML='<tr class="'+this.getRowClassName(this.templateData)+" "+s.Z+" "+t+'"style="display:'+this.getExpandDisplayProp(this.templateData)+";height:"+this.parent.rowHeight+'px;"><td class="'+s._20+" "+a+'"style="width:'+this.parent.timelineModule.totalTimelineWidth+'px;"></td></tr>',n.childNodes},t.prototype.initializeChartTemplate=function(){i.i(r.isNullOrUndefined)(this.parent.parentTaskbarTemplate)||(this.parentTaskbarTemplateFunction=this.templateCompiler(this.parent.parentTaskbarTemplate)),!i.i(r.isNullOrUndefined)(this.parent.labelSettings.leftLabel)&&this.isTemplate(this.parent.labelSettings.leftLabel)&&(this.leftTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.leftLabel)),!i.i(r.isNullOrUndefined)(this.parent.labelSettings.rightLabel)&&this.isTemplate(this.parent.labelSettings.rightLabel)&&(this.rightTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.rightLabel)),!i.i(r.isNullOrUndefined)(this.parent.labelSettings.taskLabel)&&this.isTemplate(this.parent.labelSettings.taskLabel)&&(this.taskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.taskLabel)),i.i(r.isNullOrUndefined)(this.parent.taskbarTemplate)||(this.childTaskbarTemplateFunction=this.templateCompiler(this.parent.taskbarTemplate)),i.i(r.isNullOrUndefined)(this.parent.milestoneTemplate)||(this.milestoneTemplateFunction=this.templateCompiler(this.parent.milestoneTemplate))},t.prototype.createDivElement=function(e){var t=i.i(r.createElement)("div");return t.innerHTML=e,t.childNodes},t.prototype.isTemplate=function(e){for(var t=!1,i=0;i<this.parent.ganttColumns.length;i++)if(e===this.parent.ganttColumns[i].field){t=!0;break}return t="string"!=typeof e||0===e.indexOf("#")||e.indexOf("<")>-1||e.indexOf("$")>-1||!t},t.prototype.getTemplateID=function(e){return this.parent.element.id+e},t.prototype.leftLabelContainer=function(){var e='<div class="'+(this.leftTaskLabelTemplateFunction?s._49:s._50)+' " tabindex="-1" role="term" style="height:'+(this.parent.rowHeight-2)+"px;width:"+this.taskNameWidth(this.templateData)+'"></div>';return this.createDivElement(e)},t.prototype.taskbarContainer=function(){var e=this.templateData,t=!(!this.parent.editModule||!this.parent.editSettings.allowTaskbarEditing||"ParentResizing"!==this.parent.editModule.taskbarEditModule.taskBarEditAction),i='<div class="'+s.D+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+" "+(e.ganttProperties.cssClass?e.ganttProperties.cssClass:"")+'" tabindex="-1" role="term" style="'+(!e.ganttProperties.isMilestone||t||e.hasChildRecords&&!e.ganttProperties.isAutoSchedule?"width:"+e.ganttProperties.width+"px;margin-top:"+this.taskBarMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(!e.hasChildRecords||e.ganttProperties.isAutoSchedule?e.ganttProperties.left:e.ganttProperties.autoLeft)+"px;height:"+this.taskBarHeight+"px;cursor:"+(e.ganttProperties.isAutoSchedule?"move;":"auto;"):"width:"+this.milestoneHeight+"px;height:"+this.milestoneHeight+"px;margin-top:"+this.milestoneMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-this.milestoneHeight/2)+"px;")+'"></div>';return this.createDivElement(i)},t.prototype.rightLabelContainer=function(){var e='<div class="'+(this.rightTaskLabelTemplateFunction?s._51:s._52)+'" tabindex="-1" role="term" style="'+(this.parent.enableRtl?"right:":"left:")+this.getRightLabelLeft(this.templateData)+"px; height:"+(this.parent.rowHeight-2)+'px;"></div>';return this.createDivElement(e)},t.prototype.childTaskbarLeftResizer=function(){var e=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?5:-2,t='<div class="'+s.O+" "+s._36+'"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>';return this.createDivElement(t)},t.prototype.childTaskbarRightResizer=function(){var e=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?-17:-10,t='<div class="'+s.Q+" "+s._36+'"style="'+(this.parent.enableRtl?"right:":"left:")+(this.templateData.ganttProperties.width+e)+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>';return this.createDivElement(t)},t.prototype.childTaskbarProgressResizer=function(){var e=this.parent.enableRtl?this.templateData.ganttProperties.progressWidth+8:this.templateData.ganttProperties.progressWidth-6,t='<div class="'+s.S+'"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+s._37+'"><div class="'+s._38+'"></div><div class="'+s._39+'"></div></div>';return this.createDivElement(t)},t.prototype.getLeftPointNode=function(){var e,t=this.templateData,n=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?12:0,a=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?6:3,o=-(3+this.connectorPointWidth+n),l=-(this.connectorPointWidth+4+a),d=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2);e=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px";var h='<div class="'+s._53+'" style="'+(t.ganttProperties.isMilestone?"margin-top:"+d+"px;left:"+l+"px;":e+";left:"+o+"px;")+'"><div class="'+s.X+" "+this.parent.getUnscheduledTaskClass(t.ganttProperties)+'" style="width: '+this.connectorPointWidth+"px;"+(this.parent.enableRtl?"margin-right:2px;":"")+"height: "+this.connectorPointWidth+'px;">'+this.touchLeftConnectorpoint+"</div></div>";return this.createDivElement(h)},t.prototype.getRightPointNode=function(){var e,t=this.templateData,n=!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?-12:0,a=-(3+n),o=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2);e=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px";var l='<div class="'+s._4+'" style="'+(t.ganttProperties.isMilestone?"left:"+(!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?this.milestoneHeight+5:this.milestoneHeight-2)+"px;margin-top:"+o+"px;":"left:"+(t.ganttProperties.width+a)+"px;"+e+";")+'"><div class="'+s.Y+" "+this.parent.getUnscheduledTaskClass(t.ganttProperties)+'" style="width:'+this.connectorPointWidth+"px;height:"+this.connectorPointWidth+'px;">'+this.touchRightConnectorpoint+"</div></div>";return this.createDivElement(l)},t.prototype.getTaskLabel=function(e){var t=this.parent.ganttColumns.length,n=null;if(i.i(r.isNullOrUndefined)(e)||""===e)n="";else if(e===this.parent.taskFields.resourceInfo)n=this.getResourceName(this.templateData);else{for(var a=0;a<t;a++)if(e===this.parent.ganttColumns[a].field){n=this.getFieldValue(this.templateData[e]).toString();break}if(i.i(r.isNullOrUndefined)(n))return"isCustomTemplate"}return n},t.prototype.getExpandDisplayProp=function(e){return e=this.templateData,this.parent.getExpandStatus(e)?"table-row":"none"},t.prototype.getRowClassName=function(e){e=this.templateData;var t="gridrowtaskId",i=e.parentItem;return i&&(t+=i.taskId.toString()),t+="level",t+=e.level.toString()},t.prototype.getBorderRadius=function(e){e=this.templateData;var t=e.ganttProperties.width-e.ganttProperties.progressWidth;return t<=4?4-t:0},t.prototype.getSplitTaskBorderRadius=function(e){var t=e.width-e.progressWidth;return t<=4?4-t:0},t.prototype.taskNameWidth=function(e){e=this.templateData;var t,i=e.ganttProperties;return t=e.ganttProperties.isMilestone?e.ganttProperties.left-this.parent.getTaskbarHeight()/2:e.hasChildRecords&&!i.isAutoSchedule?this.parent.allowUnscheduledTasks?i.left<i.autoLeft?i.left:i.autoLeft:i.autoStartDate.getTime()<i.startDate.getTime()?i.autoLeft:i.left:e.ganttProperties.left,t<0&&(t=0),t+"px"},t.prototype.getRightLabelLeft=function(e){e=this.templateData;var t,i,r,n=e.ganttProperties;return e.ganttProperties.isMilestone?e.ganttProperties.left+this.parent.getTaskbarHeight()/2:e.hasChildRecords&&!n.isAutoSchedule?(this.parent.allowUnscheduledTasks?(t=n.left<n.autoLeft?n.autoLeft:n.left,r=n.autoWidth):(t=n.autoStartDate.getTime()<n.startDate.getTime()?n.autoLeft:n.left,i=n.autoEndDate.getTime()<n.endDate.getTime()?this.parent.dataOperation.getTaskLeft(n.endDate,n.isMilestone):this.parent.dataOperation.getTaskLeft(n.autoEndDate,n.isMilestone),r=i-t),t+r):e.ganttProperties.left+e.ganttProperties.width},t.prototype.getExpandClass=function(e){return e=this.templateData,e.expanded?s._54:!e.expanded&&e.hasChildRecords?s._55:""},t.prototype.getFieldValue=function(e){return i.i(r.isNullOrUndefined)(e)?"":e},t.prototype.getResourceName=function(e){e=this.templateData;var t=null;if(!i.i(r.isNullOrUndefined)(e.ganttProperties.resourceInfo)){var n=e.ganttProperties.resourceInfo.length;if(n>0){for(var a=0;a<n;a++){var s=e.ganttProperties.resourceInfo[a][this.parent.resourceFields.name],o=e.ganttProperties.resourceInfo[a][this.parent.resourceFields.unit];100!==o&&(s+="["+o+"%]"),i.i(r.isNullOrUndefined)(t)?t=s:t+=" , "+s}return t}return""}return""},t.prototype.initChartHelperPrivateVariable=function(){var e=this.parent.renderBaseline?.45:!i.i(r.isNullOrUndefined)(document.body.className)&&document.body.className.includes("e-bigger")?.7:.62,t=this.parent.renderBaseline?4:2,n=this.parent.renderBaseline?1.13:.82;if(this.baselineColor=i.i(r.isNullOrUndefined)(this.parent.baselineColor)||""===this.parent.baselineColor?null:this.parent.baselineColor,this.taskBarHeight=i.i(r.isNullOrUndefined)(this.parent.taskbarHeight)||this.parent.taskbarHeight>=this.parent.rowHeight?Math.floor(this.parent.rowHeight*e):this.parent.taskbarHeight,this.parent.renderBaseline){var a=void 0;a=this.taskBarHeight+this.baselineHeight<=this.parent.rowHeight?this.taskBarHeight:this.taskBarHeight-(this.baselineHeight+1),this.taskBarHeight=a}this.milestoneHeight=Math.floor(this.taskBarHeight*n),this.taskBarMarginTop=Math.floor((this.parent.rowHeight-this.taskBarHeight)/t),this.milestoneMarginTop=Math.floor((this.parent.rowHeight-this.milestoneHeight)/2),this.milesStoneRadius=Math.floor(this.milestoneHeight/2),this.baselineTop=-(Math.floor(this.parent.rowHeight-(this.taskBarHeight+this.taskBarMarginTop))-4),this.connectorPointWidth=this.parent.isAdaptive?Math.round(this.taskBarHeight/2):8,this.connectorPointMargin=Math.floor(this.taskBarHeight/2-this.connectorPointWidth/2)},t.prototype.refreshGanttRows=function(){if(this.parent.currentViewData=this.parent.treeGrid.getCurrentViewRecords().slice(),this.createTaskbarTemplate(),"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation){for(var e=0;e<this.parent.currentViewData.length;e++){var t=this.parent.currentViewData[e];t.childRecords.length>0&&(this.parent.setRecordValue("workTimelineRanges",this.parent.dataOperation.mergeRangeCollections(t.ganttProperties.workTimelineRanges,!0),t.ganttProperties,!0),this.parent.dataOperation.calculateRangeLeftWidth(t.ganttProperties.workTimelineRanges))}this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}this.parent.ganttChartModule.updateLastRowBottomWidth()},t.prototype.createTaskbarTemplate=function(){var e,t=[].slice.call(this.ganttChartTableBody.querySelectorAll("tr"));this.ganttChartTableBody.innerHTML="";var n=[],a=this.parent.treeGridModule.prevCurrentView;if(this.refreshedTr=[],this.refreshedData=[],this.parent.enableImmutableMode&&a&&a.length>0&&this.isUpdated){for(var s={},o=[],l=this.parent.treeGrid.getPrimaryKeyFieldNames()[0],d=0;d<a.length;d++)o[d]=t[d],s[a[d][l]]=d;for(var h=0;h<this.parent.currentViewData.length;h++){var p=s[this.parent.currentViewData[h][l]],u=this.parent.modifiedRecords.indexOf(this.parent.currentViewData[h]);if(i.i(r.isNullOrUndefined)(p)||-1!==u||this.parent.isFromRenderBaseline){var c=this.getGanttChartRow(h,this.parent.currentViewData[h]);this.ganttChartTableBody.appendChild(c),this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[h]),this.refreshedData.push(this.parent.currentViewData[h])}else this.ganttChartTableBody.appendChild(o[p]);this.ganttChartTableBody.querySelectorAll("tr")[h].setAttribute("aria-rowindex",h.toString())}}else{var g=void 0;g=i.i(r.createElement)("tbody",{id:this.parent.element.id+"GanttTaskTableBody"});for(var d=0;d<this.parent.currentViewData.length;d++){var f=this.parent.currentViewData[d];"ResourceView"===this.parent.viewType&&((this.parent.editModule&&this.parent.editModule.isResourceTaskDeleted||this.parent.isFromOnPropertyChange)&&(this.parent.editModule.isResourceTaskDeleted=!1),!f.expanded&&this.parent.enableMultiTaskbar&&n.push(f));var c=this.getGanttChartRow(d,f);g.appendChild(c),this.parent.enableImmutableMode&&(this.refreshedTr.push(g.querySelectorAll("tr")[d]),this.refreshedData.push(this.parent.currentViewData[d])),this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.maintainSelectedRecords(parseInt(c.getAttribute("aria-rowindex"),10))}(e=this.ganttChartTableBody).replaceChildren.apply(e,g.childNodes),this.parent.initialChartRowElements=this.parent.ganttChartModule.getChartRows()}if(this.parent.enableCriticalPath&&this.parent.criticalPathModule){var m=this.parent.criticalPathModule;m.criticalPathCollection&&this.parent.criticalPathModule.criticalConnectorLine(m.criticalPathCollection,m.detailPredecessorCollection,!0,m.predecessorCollectionTaskIds)}if(this.parent.renderTemplates(),this.triggerQueryTaskbarInfo(),this.parent.modifiedRecords=[],"ResourceView"==this.parent.viewType&&this.parent.showOverAllocation&&this.updateOverlapped(),n.length)for(var y=0;y<n.length;y++)n[y].hasChildRecords&&(this.parent.isGanttChartRendered=!0,this.parent.chartRowsModule.refreshRecords([n[y]]));this.parent.isGanttChartRendered=!0,this.parent.renderTemplates()},t.prototype.getGanttChartRow=function(e,t){this.templateData=t;var a=null,s=this.getTableTrNode(e),o=this.getLeftLabelNode(e),l=this.taskbarContainer();l[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),l[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID);var d;if(this.templateData.hasChildRecords||this.parent.allowParentDependency)this.parent.allowParentDependency&&(d=this.getLeftPointNode(),(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)&&l[0].appendChild([].slice.call(d)[0]));else{var h=this.getLeftPointNode();l[0].appendChild([].slice.call(h)[0])}if(this.templateData.hasChildRecords){var p=this.getParentTaskbarNode(e,l);if(!this.templateData.ganttProperties.isAutoSchedule){var u=this.getManualTaskbar();if(!i.i(r.isNullOrUndefined)(u[0])){if(this.parent.allowParentDependency){u[0].appendChild([].slice.call(d)[0]);var c=this.getRightPointNode();u[0].appendChild([].slice.call(c)[0])}l[0].appendChild([].slice.call(u)[0])}}if(0!==this.templateData.ganttProperties.autoDuration&&!this.templateData.ganttProperties.isMilestone&&p&&p.length>0)i.i(r.append)(p,l[0]);else if(0===this.templateData.ganttProperties.duration&&this.templateData.ganttProperties.isMilestone&&this.templateData.ganttProperties.isAutoSchedule){var g=this.getMilestoneNode(e,l);g&&g.length>0&&i.i(r.append)(g,l[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(a=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineStartDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineEndDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}else if(this.templateData.ganttProperties.isMilestone){var g=this.getMilestoneNode(e,l);g&&g.length>0&&i.i(r.append)(g,l[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(a=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineStartDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineEndDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}else{var f=i.i(n.c)(this.templateData.ganttProperties),m=null,y=null,D=null;if(!i.i(r.isNullOrUndefined)(f)){(f||this.templateData.ganttProperties.duration)&&f&&(i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.segments)||this.templateData.ganttProperties.segments.length<=0)&&(m=this.childTaskbarProgressResizer(),D=this.childTaskbarLeftResizer(),y=this.childTaskbarRightResizer());var v=this.getChildTaskbarNode(e,l);if(D&&l[0].appendChild([].slice.call(D)[0]),v&&v.length>0)if(this.templateData.ganttProperties.segments&&this.templateData.ganttProperties.segments.length>0){var w=this.templateData.ganttProperties.segments.length,k=null;k=this.createDivElement('<div class="e-gantt-split-container-line"></div>'),l[0].appendChild([].slice.call(k)[0]);for(var b=0;b<w;b++)l[0].appendChild([].slice.call(v)[0])}else i.i(r.append)(v,l[0]);m&&l[0].appendChild([].slice.call(m)[0]),y&&l[0].appendChild([].slice.call(y)[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(a=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineStartDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.baselineEndDate)||i.i(r.isNullOrUndefined)(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}var T;this.parent.allowParentDependency&&(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)?(T=this.getRightPointNode(),l[0].appendChild([].slice.call(T)[0])):this.parent.allowParentDependency||(T=this.getRightPointNode(),l[0].appendChild([].slice.call(T)[0]));var S=this.getRightLabelNode(e);if(s[0].childNodes[0].childNodes[0].appendChild([].slice.call(o)[0]),s[0].childNodes[0].childNodes[0].appendChild([].slice.call(l)[0]),this.templateData.ganttProperties.indicators&&this.templateData.ganttProperties.indicators.length>0)for(var P=void 0,C=void 0,M=void 0,R=this.templateData.ganttProperties.indicators,x=0;x<R.length;x++){if(P=this.getIndicatorNode(R[x]),P[0].setAttribute("aria-label",R[x].name),R[x].name.indexOf("$")>-1||R[x].name.indexOf("#")>-1)C=this.templateCompiler(R[x].name),M=C(i.i(r.extend)({index:e},this.templateData),this.parent,"indicatorLabelText");else{var O=i.i(r.createElement)("Text");O.innerHTML=R[x].name,this.parent.enableHtmlSanitizer&&"string"==typeof R[x].name&&(R[x].name=r.SanitizeHtmlHelper.sanitize(R[x].name),O.innerText=R[x].name),M=O.childNodes}P[0].appendChild([].slice.call(M)[0]),P[0].title=i.i(r.isNullOrUndefined)(R[x].tooltip)?"":R[x].tooltip,s[0].childNodes[0].childNodes[0].appendChild([].slice.call(P)[0])}S&&S.length>0&&s[0].childNodes[0].childNodes[0].appendChild([].slice.call(S)[0]),i.i(r.isNullOrUndefined)(a)||s[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[0]);var I=s[0].childNodes[0];return this.setAriaRowIndex(t,I),I},t.prototype.setAriaRowIndex=function(e,t){var n,a=this,s=this.parent.treeGrid.getCurrentViewRecords(),o=this.parent.virtualScrollModule&&this.parent.enableVirtualization?i.i(r.getValue)("virtualScrollModule.visualData",this.parent.treeGrid):s;if(!this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){var l=this.parent.treeGrid.grid.contentModule.rows,d=l.filter(function(t){if(t.data[a.parent.taskFields.id]===e.ganttProperties.taskId)return t})[0];t.setAttribute("aria-rowindex",d.index.toString())}else n=o.indexOf(e),t.setAttribute("aria-rowindex",n.toString())},t.prototype.triggerQueryTaskbarInfo=function(){if(this.parent.queryTaskbarInfo)for(var e,t,n=this.parent.enableImmutableMode?this.refreshedTr.length:this.ganttChartTableBody.querySelectorAll("tr").length,a=0;a<n;a++){e=this.parent.enableImmutableMode?this.refreshedTr[a]:this.ganttChartTableBody.querySelectorAll("tr")[a],t=this.refreshedData.length>0?this.refreshedData[a]:this.parent.currentViewData[a];var s=!i.i(r.isNullOrUndefined)(t.ganttProperties.segments)&&t.ganttProperties.segments.length;if(s>0)for(var o=0;o<s;o++){var l=e.getElementsByClassName("e-segmented-taskbar"),d=l[o];this.triggerQueryTaskbarInfoByIndex(d,t)}else e&&this.triggerQueryTaskbarInfoByIndex(e,t)}},t.prototype.triggerQueryTaskbarInfoByIndex=function(e,t){var n,a=this,o=!i.i(r.isNullOrUndefined)(t.ganttProperties.segments)&&t.ganttProperties.segments.length>0?e:e.querySelector("."+s.D);t.ganttProperties.segments&&t.ganttProperties.segments.length>0&&(n=e.parentElement.parentElement.parentElement);var l={data:t,rowElement:e,taskbarElement:o,taskbarType:t.hasChildRecords?"ParentTask":t.ganttProperties.isMilestone?"Milestone":"ChildTask"},d=this.getClassName(l);if("Milestone"===l.taskbarType)l.milestoneColor=o.querySelector(d[0])?getComputedStyle(o.querySelector(d[0])).backgroundColor:null,l.baselineColor=e.querySelector(d[1])?getComputedStyle(e.querySelector(d[1])).backgroundColor:e.querySelector("."+s._41)?getComputedStyle(e.querySelector("."+s._41)).backgroundColor:null;else if(o){var h=o.querySelector(d[0]),p=o.querySelector(d[1]);l.taskbarBgColor=i.i(r.isNullOrUndefined)(h)?null:o.classList.contains(s._1)?getComputedStyle(o).backgroundColor:getComputedStyle(o.querySelector(d[0])).backgroundColor,l.taskbarBorderColor=i.i(r.isNullOrUndefined)(h)?null:o.classList.contains(s._1)?getComputedStyle(o).backgroundColor:getComputedStyle(o.querySelector(d[0])).outlineColor,l.progressBarBgColor=i.i(r.isNullOrUndefined)(p)?null:o.classList.contains(s._0)?getComputedStyle(o).backgroundColor:getComputedStyle(o.querySelector(d[1])).backgroundColor,l.baselineColor=n?n.querySelector("."+s._41)?getComputedStyle(n.querySelector("."+s._41)).backgroundColor:null:e.querySelector("."+s._41)?getComputedStyle(e.querySelector("."+s._41)).backgroundColor:null,l.taskLabelColor=o.querySelector("."+s._32)?getComputedStyle(o.querySelector("."+s._32)).color:null}n?(l.rightLabelColor=n.querySelector("."+s._52)&&n.querySelector("."+s._52).querySelector("."+s._27)?getComputedStyle(n.querySelector("."+s._52).querySelector("."+s._27)).color:null,l.leftLabelColor=n.querySelector("."+s._50)&&n.querySelector("."+s._50).querySelector("."+s._27)?getComputedStyle(n.querySelector("."+s._50).querySelector("."+s._27)).color:null):(l.rightLabelColor=e.querySelector("."+s._52)&&e.querySelector("."+s._52).querySelector("."+s._27)?getComputedStyle(e.querySelector("."+s._52).querySelector("."+s._27)).color:null,l.leftLabelColor=e.querySelector("."+s._50)&&e.querySelector("."+s._50).querySelector("."+s._27)?getComputedStyle(e.querySelector("."+s._50).querySelector("."+s._27)).color:null),this.parent.trigger("queryTaskbarInfo",l,function(e){a.updateQueryTaskbarInfoArgs(e,void 0,void 0)})},t.prototype.updateQueryTaskbarInfoArgs=function(e,t,i){var r,n=e.rowElement,a=this.parent.enableVirtualization?e.rowElement:e.taskbarElement,o=this.getClassName(e);e.data.ganttProperties.segments&&e.data.ganttProperties.segments.length>0&&(r=n.parentElement.parentElement.parentElement),"Milestone"===e.taskbarType?(a.querySelector(o[0])&&getComputedStyle(a.querySelector(o[0])).backgroundColor!==e.milestoneColor&&(a.querySelector(o[0]).style.backgroundColor=e.milestoneColor),n.querySelector(o[1])&&getComputedStyle(n.querySelector(o[1])).backgroundColor!==e.baselineColor&&(n.querySelector(o[1]).style.backgroundColor=e.baselineColor),n.querySelector("."+s._41)&&getComputedStyle(n.querySelector("."+s._41)).borderTopColor!==e.baselineColor&&(n.querySelector("."+s._41).style.backgroundColor=e.baselineColor)):a&&(a.querySelector(o[0])&&getComputedStyle(a.querySelector(o[0])).backgroundColor!==e.taskbarBgColor&&(a.querySelector(o[0]).style.backgroundColor=e.taskbarBgColor),a.querySelector(o[0])&&getComputedStyle(a.querySelector(o[0])).outlineColor!==e.taskbarBorderColor&&(a.querySelector(o[0]).style.outlineColor=e.taskbarBorderColor),a.querySelector(o[1])&&getComputedStyle(a.querySelector(o[1])).backgroundColor!==e.progressBarBgColor&&(a.querySelector(o[1]).style.backgroundColor=e.progressBarBgColor),a.classList.contains(s._1)&&getComputedStyle(a).backgroundColor!==e.taskbarBgColor&&(a.style.backgroundColor=e.taskbarBgColor),a.classList.contains(s._1)&&getComputedStyle(a).outlineColor!==e.taskbarBorderColor&&(a.style.outlineColor=e.taskbarBorderColor),a.classList.contains(s._0)&&getComputedStyle(a).backgroundColor!==e.progressBarBgColor&&(a.style.backgroundColor=e.progressBarBgColor),a.querySelector("."+s._32)&&getComputedStyle(a.querySelector("."+s._32)).color!==e.taskLabelColor&&(a.querySelector("."+s._32).style.color=e.taskLabelColor),r?r.querySelector("."+s._41)&&getComputedStyle(r.querySelector("."+s._41)).backgroundColor!==e.baselineColor&&(r.querySelector("."+s._41).style.backgroundColor=e.baselineColor):n.querySelector("."+s._41)&&getComputedStyle(n.querySelector("."+s._41)).backgroundColor!==e.baselineColor&&(n.querySelector("."+s._41).style.backgroundColor=e.baselineColor)),r?(r.querySelector("."+s._50)&&r.querySelector("."+s._50).querySelector("."+s._27)&&getComputedStyle(r.querySelector("."+s._50).querySelector("."+s._27)).color!==e.leftLabelColor&&(r.querySelector("."+s._50).querySelector("."+s._27).style.color=e.leftLabelColor),r.querySelector("."+s._52)&&r.querySelector("."+s._52).querySelector("."+s._27)&&getComputedStyle(r.querySelector("."+s._52).querySelector("."+s._27)).color!==e.rightLabelColor&&(r.querySelector("."+s._52).querySelector("."+s._27).style.color=e.rightLabelColor)):(n.querySelector("."+s._50)&&n.querySelector("."+s._50).querySelector("."+s._27)&&getComputedStyle(n.querySelector("."+s._50).querySelector("."+s._27)).color!==e.leftLabelColor&&(n.querySelector("."+s._50).querySelector("."+s._27).style.color=e.leftLabelColor),n.querySelector("."+s._52)&&n.querySelector("."+s._52).querySelector("."+s._27)&&getComputedStyle(n.querySelector("."+s._52).querySelector("."+s._27)).color!==e.rightLabelColor&&(n.querySelector("."+s._52).querySelector("."+s._27).style.color=e.rightLabelColor))},t.prototype.getClassName=function(e){var t=[];return t.push("."+("ParentTask"===e.taskbarType?s._2:"ChildTask"===e.taskbarType?s._1:s._40)),t.push("."+("ParentTask"===e.taskbarType?s._3:"ChildTask"===e.taskbarType?s._0:s._42)),t},t.prototype.templateCompiler=function(e){if(!i.i(r.isNullOrUndefined)(e)&&""!==e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?i.i(r.compile)(document.querySelector(e).innerHTML.trim(),this.parent):i.i(r.compile)(e,this.parent)}catch(t){return i.i(r.compile)(e,this.parent)}return null},t.prototype.updateOverlapped=function(){for(var e=0;e<this.parent.treeGrid.parentData.length;e++)for(var t=this.parent.treeGrid.parentData[e].childRecords,n=0;n<t.length;n++){t[n+1]&&(t[n].ganttProperties.eOverlapped=void 0);for(var a=n+1;a<t.length;a++)t[a].ganttProperties.eOverlapped=void 0,t[n].ganttProperties.startDate.getTime()<t[a].ganttProperties.endDate.getTime()&&t[n].ganttProperties.endDate.getTime()>t[a].ganttProperties.startDate.getTime()?(t[a].ganttProperties.eOverlapped=!0,t[n].ganttProperties.eOverlapped=!0):(i.i(r.isNullOrUndefined)(t[a].ganttProperties.eOverlapped)&&(t[a].ganttProperties.eOverlapped=!1),i.i(r.isNullOrUndefined)(t[n].ganttProperties.eOverlapped)&&(t[n].ganttProperties.eOverlapped=!1))}},t.prototype.updateDragDropRecords=function(e,t){var i=e.childRecords,r=this.parent.currentViewData.indexOf(e),n=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight;t||(t=this.ganttChartTableBody.childNodes[r]),t.style.height=this.parent.treeGrid.getRowByIndex(r).style.height=this.parent.rowHeight+"px",this.parent.contentHeight=n;var a=[],s=0;if(e){for(var o=0;o<i.length;o++)for(var l=o+1;l<i.length;l++)for(var d=t.getElementsByClassName("e-taskbar-main-container"),h=0;h<d.length;h++)i[o].ganttProperties.startDate.getTime()<i[l].ganttProperties.endDate.getTime()&&i[o].ganttProperties.endDate.getTime()>i[l].ganttProperties.startDate.getTime()?d[h].getAttribute("rowuniqueid")===i[l].rowUniqueID&&-1==a.indexOf(i[l].rowUniqueID)&&(a.push(i[l].rowUniqueID),s++,t.children[0].style.verticalAlign="baseline",t.getElementsByClassName("e-taskbar-main-container")[h].style.marginTop=s*this.parent.rowHeight+this.taskBarMarginTop+"px",t.style.height=this.parent.treeGrid.getRowByIndex(r).style.height=parseInt(t.style.height)+this.parent.rowHeight+"px"):d[h].getAttribute("rowuniqueid")===i[l].rowUniqueID&&-1==a.indexOf(i[l].rowUniqueID)&&this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.draggedRecord&&d[h].getAttribute("rowuniqueid")===this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID&&this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID===i[l].rowUniqueID&&(t.getElementsByClassName("e-taskbar-main-container")[h].style.marginTop=this.parent.editModule.taskbarEditModule.draggedRecordMarginTop);this.parent.contentHeight=n,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px"}},t.prototype.refreshRow=function(e,t){var n=this.ganttChartTableBody.childNodes[e],a=this.parent.currentViewData[e];if(-1!==e&&a){var s=a;!this.parent.allowTaskbarOverlap&&"ResourceView"===this.parent.viewType&&s.expanded&&(n.style.height=this.parent.treeGrid.getRowByIndex(e).style.height=this.parent.rowHeight+"px"),"ResourceView"===this.parent.viewType&&s.hasChildRecords&&!s.expanded&&this.parent.enableMultiTaskbar?n.replaceChild(this.getResourceParent(s).childNodes[0],n.childNodes[0]):"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&!s.expanded?n.replaceWith(this.getGanttChartRow(e,s)):n.replaceChild(this.getGanttChartRow(e,s).childNodes[0],n.childNodes[0]),this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&s.hasChildRecords&&this.parent.showOverAllocation&&this.parent.allowTaskbarOverlap&&(t?this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData):(this.parent.dataOperation.updateOverlappingValues(s),this.parent.ganttChartModule.renderRangeContainer([s])));var o=!i.i(r.isNullOrUndefined)(s.ganttProperties.segments)&&s.ganttProperties.segments.length;if(o>0)for(var l=0;l<o;l++){var d=n.getElementsByClassName("e-segmented-taskbar"),h=d[l];this.triggerQueryTaskbarInfoByIndex(h,s)}else this.triggerQueryTaskbarInfoByIndex(n,s);var p="ProjectView"===this.parent.viewType?s.ganttProperties.taskId:s.ganttProperties.rowUniqueID;this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll||this.parent.treeGrid.grid.setRowData(p,s),"ResourceView"===this.parent.viewType&&s.hasChildRecords&&!s.expanded&&this.parent.enableMultiTaskbar&&!this.parent.allowTaskbarOverlap&&this.updateDragDropRecords(a,n),"ResourceView"===this.parent.viewType&&s.hasChildRecords&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap&&this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);var u=this.parent.ganttChartModule.tempNextElement;this.parent.ganttChartModule.isEditableElement&&u&&(this.parent.treeGrid.grid.focusModule.focus(),i.i(r.addClass)([this.parent.treeGrid.getRows()[n.ariaRowIndex].children[this.parent.ganttChartModule.childrenIndex]],"e-focused"),this.parent.ganttChartModule.tempNextElement=null);var c=this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[e].getAttribute("data-uid"));i.i(r.isNullOrUndefined)(c)||(c.data=s)}},t.prototype.updateResourceTaskbarElement=function(e,t){var n=e.querySelector(".e-taskbar-main-container");i.i(r.addClass)([n],"collpse-parent-border");var a=e.querySelector("."+s.D).getAttribute("rowUniqueId"),o=this.parent.getRecordByID(a),l=n.querySelector(".e-gantt-child-taskbar");this.parent.queryTaskbarInfo&&this.triggerQueryTaskbarInfoByIndex(l,o);var d="";o&&!i.i(r.isNullOrUndefined)(o.ganttProperties.eOverlapIndex)&&(d=o.ganttProperties.eOverlapIndex.toString());var h=n.cloneNode(!0);h.style.zIndex=d,t[0].childNodes[0].childNodes[0].childNodes[0].appendChild(h)},t.prototype.getResourceParent=function(e){var t=this.parent.ganttChartModule.getChartRows();if(this.parent.initialChartRowElements&&!this.parent.allowTaskbarDragAndDrop&&this.parent.allowTaskbarOverlap)for(var n=0;n<this.parent.initialChartRowElements.length;n++)i.i(r.isNullOrUndefined)(t[n])||i.i(r.isNullOrUndefined)(t[n].childNodes[0].childNodes[1].childNodes[2])||i.i(r.isNullOrUndefined)(this.parent.initialChartRowElements[n].childNodes[0].childNodes[1].childNodes[2])||(t[n].childNodes[0].childNodes[1].childNodes[2].innerHTML=this.parent.initialChartRowElements[n].childNodes[0].childNodes[1].childNodes[2].innerHTML);this.templateData=e;var a=this.getTableTrNode(),s=this.leftLabelContainer(),o=i.i(r.createElement)("div",{className:"e-collapse-parent"});a[0].childNodes[0].childNodes[0].appendChild(o);var l=this.parent.dataOperation.setSortedChildTasks(e);this.parent.dataOperation.updateOverlappingIndex(l);var d;if(this.parent.enableVirtualization)for(var h=0;h<e.childRecords.length;h++)d=this.getGanttChartRow(e.childRecords[h].index,this.parent.flatData[e.childRecords[h].index]),this.updateResourceTaskbarElement(d,a);else for(var h=0;h<t.length;h++)t[h].classList.contains("gridrowtaskId"+e.ganttProperties.rowUniqueID+"level"+(e.level+1))&&this.updateResourceTaskbarElement(t[h],a);return a[0].childNodes[0].childNodes[0].appendChild([].slice.call(s)[0]),a[0].childNodes[0]},t.prototype.refreshRecords=function(e,t){if(this.parent.isGanttChartRendered){if(this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar){var i=[];i=new a.DataManager(e).executeLocal((new a.Query).sortBy("expanded","Descending")),e=i}for(var r=0;r<e.length;r++){var n=this.parent.currentViewData.indexOf(e[r]);this.refreshRow(n,t)}this.parent.ganttChartModule.updateLastRowBottomWidth()}},t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("renderPanels",this.createChartTable),this.parent.off("dataReady",this.initiateTemplates),this.parent.off("destroy",this.destroy))},t.prototype.destroy=function(){this.removeEventListener()},t.prototype.generateAriaLabel=function(e){e=this.templateData;var t="",i=this.parent.localeObj.getConstant("name"),r=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),a=this.parent.localeObj.getConstant("duration"),s=e.ganttProperties.taskName,o=e.ganttProperties.startDate,l=e.ganttProperties.endDate,d=e.ganttProperties.duration;return e.ganttProperties.isMilestone?t=i+" "+s+" "+r+" "+this.parent.getFormatedDate(o):(s&&(t+=i+" "+s+" "),o&&(t+=r+" "+this.parent.getFormatedDate(o)+" "),l&&(t+=n+" "+this.parent.getFormatedDate(l)+" "),d&&(t+=a+" "+this.parent.getDurationString(d,e.ganttProperties.durationUnit))),t},t.prototype.generateBaselineAriaLabel=function(e){e=this.templateData;var t="",i=this.parent.localeObj.getConstant("name"),r=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),a=e.ganttProperties.taskName,s=e.ganttProperties.baselineStartDate,o=e.ganttProperties.baselineEndDate;return t+="Baseline ",t+=i+" "+a+" ",t+=r+" "+this.parent.getFormatedDate(s)+" ",t+=n+" "+this.parent.getFormatedDate(o)+" "},t.prototype.generateSpiltTaskAriaLabel=function(e,t){var i="",r=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),a=this.parent.localeObj.getConstant("duration"),s=e.startDate,o=e.endDate,l=e.duration;return s&&(i+=r+" "+this.parent.getFormatedDate(s)+" "),o&&(i+=n+" "+this.parent.getFormatedDate(o)+" "),l&&(i+=a+" "+this.parent.getDurationString(l,t.durationUnit)),i},t.prototype.generateTaskLabelAriaLabel=function(e){var t="";return"left"===e&&this.parent.labelSettings.leftLabel&&!this.leftTaskLabelTemplateFunction?t+=this.parent.localeObj.getConstant("leftTaskLabel")+" "+this.getTaskLabel(this.parent.labelSettings.leftLabel):"right"===e&&this.parent.labelSettings.rightLabel&&!this.rightTaskLabelTemplateFunction&&(t+=this.parent.localeObj.getConstant("rightTaskLabel")+" "+this.getTaskLabel(this.parent.labelSettings.rightLabel)),t},t}(o.a)},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(3)),a=i(1),s=i(89),o=(i.n(s),function(){function e(e){this.transform="",this.connectorLinePath="",this.arrowPath="",this.taskLineValue=0,this.expandedRecords=[],this.parent=e,this.dependencyViewContainer=i.i(r.createElement)("div",{className:n._24}),Object.assign(this.dependencyViewContainer.style,{width:"100%",height:"100%",zIndex:2,position:"absolute",pointerEvents:"none"}),this.renderer=new s.SvgRenderer(this.parent.element.id),this.initPublicProp(),this.svgObject=this.renderer.createSvg({id:this.parent.element.id+"_svg"}),this.svgObject.setAttribute("height","100%"),this.svgObject.setAttribute("width","100%")}return e.prototype.getconnectorLineGap=function(e){return e.milestoneChild?this.parent.chartRowsModule.milestoneMarginTop/2+this.parent.chartRowsModule.milestoneHeight/2:this.parent.chartRowsModule.taskBarMarginTop/2+this.parent.chartRowsModule.taskBarHeight/2},e.prototype.initPublicProp=function(){this.lineColor=this.parent.connectorLineBackground,this.lineStroke=this.parent.connectorLineWidth>4?4:this.parent.connectorLineWidth,this.createConnectorLineTooltipTable()},e.prototype.getTaskbarMidpoint=function(e){return Math.floor(e?this.parent.chartRowsModule.milestoneMarginTop+this.parent.chartRowsModule.milestoneHeight/2:this.parent.chartRowsModule.taskBarMarginTop+this.parent.chartRowsModule.taskBarHeight/2)+1},e.prototype.createConnectorLineObject=function(e,t,n){var s,o={};s=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.expandedRecords:this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport?this.parent.flatData:this.expandedRecords;var l,d;if(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth){var h=this.parent.flatData.filter(function(t){return t.ganttProperties.taskId.toString()==e.ganttProperties.taskId.toString()})[0],p=this.parent.flatData.filter(function(e){return e.ganttProperties.taskId.toString()==t.ganttProperties.taskId.toString()})[0];l=h.index,d=p.index}else l=s.indexOf(e),d=s.indexOf(t);var u,c=e.ganttProperties,g=t.ganttProperties;if(u=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData):this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.getExpandedRecords(this.parent.currentViewData),o.parentIndexInCurrentView=u.indexOf(e),o.childIndexInCurrentView=u.indexOf(t),!(this.parent.virtualScrollModule&&this.parent.enableVirtualization)&&(-1===o.parentIndexInCurrentView||-1===o.childIndexInCurrentView)||-1===o.parentIndexInCurrentView&&-1===o.childIndexInCurrentView)return null;o.parentLeft=c.isMilestone?c.left-this.parent.chartRowsModule.milestoneHeight/2:c.left,o.childLeft=g.isMilestone?g.left-this.parent.chartRowsModule.milestoneHeight/2:g.left,o.parentWidth=0===c.width||c.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):c.width,o.childWidth=0===g.width||g.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):g.width,o.parentIndex=l,o.childIndex=d;var f=!i.i(r.isNullOrUndefined)(this.parent.ganttChartModule.getChartRows())&&this.parent.ganttChartModule.getChartRows()[0]&&this.parent.ganttChartModule.getChartRows()[0].getBoundingClientRect().height;o.rowHeight=f&&!isNaN(f)?f:this.parent.rowHeight,o.type=n.type;var m="ResourceView"===this.parent.viewType?c.taskId:c.rowUniqueID,y="ResourceView"===this.parent.viewType?g.taskId:g.rowUniqueID;return o.connectorLineId="parent"+m+"child"+y,o.milestoneParent=!!c.isMilestone,o.milestoneChild=!!g.isMilestone,o.parentEndPoint=o.parentLeft+o.parentWidth,o.childEndPoint=o.childLeft+o.childWidth,i.i(r.isNullOrUndefined)(i.i(a.c)(c))||i.i(r.isNullOrUndefined)(i.i(a.c)(g))?null:o},e.prototype.renderConnectorLines=function(e){for(var t="",i=[],r=0;r<e.length;r++)t+=this.getConnectorLineTemplate(e[r]),i.push(e[r]);this.svgObject.innerHTML=t;for(var n=this.parent.connectorLineModule.svgObject.childNodes,a=0;a<n.length;a++)for(var s=n[a].childNodes,o=0;o<s.length;o++){var l="Connector Line "+this.parent.connectorLineModule.generateAriaLabel(i[a]);s[o].setAttribute("aria-label",l)}this.parent.ganttChartModule.chartBodyContent.insertBefore(this.dependencyViewContainer,this.parent.ganttChartModule.chartBodyContent.lastChild),this.dependencyViewContainer.appendChild(this.svgObject);for(var a=0;a<this.svgObject.children.length;a++)this.svgObject.children[a].children[0].setAttribute("tabindex","-1")},e.prototype.getParentPosition=function(e){if(e.parentIndex<e.childIndex){if("FF"===e.type)return e.childLeft+e.childWidth>=e.parentLeft+e.parentWidth?"FFType2":"FFType1";if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth+25){if("FS"===e.type)return"FSType1";if("SF"===e.type)return"SFType1";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType2"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.parentLeft>e.childLeft+e.childWidth+25&&"SF"===e.type)return"SFType2";if(e.parentLeft>e.childLeft){if("SS"===e.type)return"SSType1";if("SF"===e.type)return"SFType1";if("FF"===e.type)return"FFType1"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType2";if("FS"===e.type)return"FSType2";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType1";if("SF"===e.type)return"SFType1"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType2";if("FF"===e.type)return"FFType2";if("SS"===e.type)return"SSType2";if("SF"===e.type)return"SFType1"}}else if(e.parentIndex>e.childIndex)if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth){if("FS"===e.type)return 30>=e.childLeft-(e.milestoneParent?e.parentLeft+e.parentWidth+4:e.parentLeft+e.parentWidth)?"FSType3":"FSType4";if(e.parentLeft<e.childLeft||e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType4"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.childLeft+e.childWidth<=e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType3";if("SF"===e.type)return e.childLeft+e.childWidth+25<e.parentLeft?"SFType3":"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}if("FS"===e.type)return"FSType3"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType3";if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}return null},e.prototype.getHeightValue=function(e){return"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap?e.parentIndex*this.parent.rowHeight>e.childIndex*this.parent.rowHeight?e.parentIndex*this.parent.rowHeight-e.childIndex*this.parent.rowHeight:e.childIndex*this.parent.rowHeight-e.parentIndex*this.parent.rowHeight:e.parentIndex*e.rowHeight>e.childIndex*e.rowHeight?e.parentIndex*e.rowHeight-e.childIndex*e.rowHeight:e.childIndex*e.rowHeight-e.parentIndex*e.rowHeight},e.prototype.getInnerElementWidthSSType2=function(e){return e.parentLeft===e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getInnerElementLeftSSType2=function(e){return e.parentLeft===e.childLeft?e.parentLeft-20:e.parentLeft-10},e.prototype.getInnerChildWidthSSType2=function(e){return e.parentLeft+e.parentWidth<e.childLeft?10:e.parentLeft===e.childLeft?20:e.parentLeft+e.parentWidth>=e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getBorderStyles=function(e,t){return"border-"+e+"-width:"+t+"px;border-"+e+"-style:solid;"+(i.i(r.isNullOrUndefined)(this.lineColor)?"":"border-"+e+"-color:"+this.lineColor+";")},e.prototype.getConnectorLineTemplate=function(e){var t=this.getInnerChildWidthSSType2(e),i=this.getInnerElementWidthSSType2(e),r=this.getInnerElementLeftSSType2(e),a=this.getHeightValue(e),s=!!e.milestoneParent,o=!!e.milestoneChild,l=this.parent.virtualScrollModule&&this.parent.enableVirtualization,d=this.getPosition(e,this.getParentPosition(e),a),h=this.getPosition(e,this.getParentPosition(e),a),p=h.top,u=0;this.parent.renderBaseline&&(u=e.milestoneParent&&e.milestoneChild?0:e.milestoneParent?-5:e.milestoneChild?5:0);var c=l?d.height:a+u,g=0,f=0,m=0,y=0,D=0;if("ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap){for(var v=0;v<this.parent.currentViewData.length;v++)"none"!=this.parent.getRowByIndex(v).style.display&&D<e.parentIndex&&(D++,m+=this.parent.getRowByIndex(v).offsetHeight);D=0;for(var w=0;w<this.parent.currentViewData.length;w++)"none"!=this.parent.getRowByIndex(w).style.display&&D<e.childIndex&&(D++,y+=this.parent.getRowByIndex(w).offsetHeight);c=Math.abs(m-y)}if(this.parent.currentViewData[e.parentIndex]&&this.parent.currentViewData[e.childIndex]&&this.parent.allowParentDependency){var k=this.parent.currentViewData[e.parentIndex].hasChildRecords,b=this.parent.currentViewData[e.childIndex].hasChildRecords,T=this.parent.currentViewData[e.parentIndex].ganttProperties.isAutoSchedule,S=this.parent.currentViewData[e.childIndex].ganttProperties.isAutoSchedule,P=!0;(k&&T&&!b||b&&S&&!k||k&&T&&S&&b||!k&&!b)&&(P=!1),P&&(k&&!T&&b&&!S?f=-11:k&&!T&&b&&!S||(e.childIndex>e.parentIndex?!k&&b?g=-11:(g=11,f=-11):k&&!b?g=-11:(g=11,f=-11)),this.parent.currentViewData[e.parentIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(f=-11,g=12):"SS"!==e.type&&"FF"!==e.type||(f=-5):this.parent.currentViewData[e.childIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(f=5,g=-10):e.parentIndex<e.childIndex&&("SS"!==e.type&&"FF"!==e.type||(f=-10)):e.parentIndex<e.childIndex&&T&&!S?(f=0,g=-11):e.childIndex<e.parentIndex&&!T&&S&&(f=0,g=-11))}return this.getParentPosition(e)&&(this.transform=this.parent.enableRtl?"translate("+this.parent.timelineModule.totalTimelineWidth+", 0) scale(-1, 1)":"",this.connectorId="ConnectorLine"+e.connectorLineId,this.groupObject=this.renderer.createGroup({id:this.connectorId,transform:this.transform,style:"pointer-events: stroke",class:n.V}),this.connectorPath=this.renderer.drawPath({class:n._9,d:this.connectorLinePath,fill:"transparent","stroke-width":1}),this.arrowlinePath=this.renderer.drawPath({d:this.arrowPath,class:n._10}),this.groupObject.appendChild(this.connectorPath),this.groupObject.appendChild(this.arrowlinePath),"FSType1"===this.getParentPosition(e)&&(this.taskLineValue=e.milestoneChild?1:0,this.x1=e.parentEndPoint+(e.milestoneParent?-1:e.milestoneChild?-1:0),this.x2=e.milestoneParent?e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10+1:e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-u,this.y2=c+this.taskLineValue+g-this.lineStroke,this.connectorLinePath="M "+this.x1+" "+this.y1+" L "+(this.x1+this.x2)+" "+this.y1+" L "+(this.x1+this.x2)+" "+(this.y1+this.y2)+" L "+(this.x1+this.x2+12)+" "+(this.y1+this.y2),this.arrowPath="M "+(this.x1+this.x2+20)+" "+(this.y1+this.y2)+" L "+(this.x1+this.x2+12)+" "+(this.y1+this.y2-(4+this.lineStroke))+" L "+(this.x1+this.x2+12)+" "+(this.y1+this.y2+4)+" Z"),"FSType2"===this.getParentPosition(e)&&(this.x1=e.parentLeft,this.x2=e.parentWidth+(e.milestoneParent?-1:0),this.x3=this.x2+(e.milestoneParent?11:10),this.x4=e.parentWidth-(e.parentEndPoint-e.childLeft+20),this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-u,this.y2=c+g-this.getconnectorLineGap(e)-this.lineStroke,this.y3=this.getconnectorLineGap(e),this.y4=this.parent.allowTaskbarOverlap?this.y1+this.y2-(this.y1+this.y2)%e.rowHeight:y,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+(this.x1+this.x3)+" "+this.y1+" L "+(this.x1+this.x3)+" "+this.y4+" L "+(this.x1+this.x4)+" "+this.y4+" L "+(this.x1+this.x4)+" "+(this.y1+this.y2+this.y3)+" L "+(this.x1+this.x4+12)+" "+(this.y1+this.y2+this.y3),this.arrowPath="M "+(this.x1+this.x4+20)+" "+(this.y1+this.y2+this.y3)+" L "+(this.x1+this.x4+12)+" "+(this.y1+this.y2+this.y3-(4+this.lineStroke))+" L "+(this.x1+this.x4+12)+" "+(this.y1+this.y2+this.y3+4+this.lineStroke)+" Z"),"FSType3"===this.getParentPosition(e)&&(this.taskLineValue=e.milestoneChild?1:0,this.point1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-u,this.x1=e.childLeft+(e.milestoneChild?-1:0)+(e.milestoneParent?1:0)-20,this.x2=e.parentEndPoint-e.childLeft+30,this.y1=this.point1+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?11:e.milestoneParent&&!e.milestoneChild?-12:0:0),this.y2=this.point1+c+g-this.getconnectorLineGap(e)-this.lineStroke+this.taskLineValue,this.y3=this.getconnectorLineGap(e),this.y4=this.y2-this.y2%e.rowHeight,this.connectorLinePath="M "+(this.x1+12)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y4+" L "+(this.x1+this.x2)+" "+this.y4+" L "+(this.x1+this.x2)+" "+(this.y2+this.y3)+" L "+(this.x1+this.x2-12)+" "+(this.y2+this.y3),this.arrowPath="M "+(this.x1+20)+" "+this.y1+" L "+(this.x1+12)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+12)+" "+(this.y1+4+this.lineStroke)+" Z"),"FSType4"===this.getParentPosition(e)&&(this.point1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.parentEndPoint+(e.milestoneChild?-1:0)+(e.milestoneParent?1:0),this.x2=e.childLeft-e.parentEndPoint-20,this.y1=this.point1+(e.milestoneChild?-1:0),this.y2=this.point1+c+g-this.lineStroke+1+this.taskLineValue+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?-12:e.milestoneParent&&!e.milestoneChild?11:0:0),this.connectorLinePath="M "+(this.x1+this.x2+12)+" "+this.y1+" L "+(this.x1+this.x2)+" "+this.y1+" L "+(this.x1+this.x2)+" "+this.y2+" L "+this.x1+" "+this.y2,this.arrowPath="M "+(this.x1+this.x2+20)+" "+this.y1+" L "+(this.x1+this.x2+12)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+this.x2+12)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType4"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.point1=c+this.taskLineValue+g,this.point2=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.x1=e.parentLeft-10,this.x2=e.childLeft-e.parentLeft,this.y1=this.point2+(e.milestoneChild?1:0),this.y2=this.y1+this.point1+(this.parent.renderBaseline?e.milestoneParent&&!e.milestoneChild?10:e.milestoneChild&&!e.milestoneParent?-13:0:0),this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y2+" L "+(this.x1+10)+" "+this.y2,this.arrowPath="M "+(this.x1+this.x2+8)+" "+this.y1+" L "+(this.x1+this.x2)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+this.x2)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType3"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=c+this.taskLineValue+g-(this.lineStroke-1),this.x1=e.childLeft-20,this.y1=(e.milestoneChild?1:0)+(this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)),this.x2=e.parentLeft-e.childLeft+21,this.y2=this.y1+this.point1+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?-11:e.milestoneParent&&!e.milestoneChild?10:0:0),this.connectorLinePath="M "+(this.x1+12)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y2+" L "+(this.x1+this.x2)+" "+this.y2,this.arrowPath="M "+(this.x1+20)+" "+this.y1+" L "+(this.x1+12)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+12)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType2"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=c+this.taskLineValue+g-this.lineStroke,this.x1=r,this.x2=t+1,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1),this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y2+" L "+(this.x1+i)+" "+this.y2,this.arrowPath="M "+(this.x1+i+8)+" "+this.y2+" L "+(this.x1+i)+" "+(this.y2-(4+this.lineStroke))+" L "+(this.x1+i)+" "+(this.y2+4+this.lineStroke)+" Z"),"SSType1"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=c+this.taskLineValue+g-this.lineStroke,this.x1=e.childLeft-20,this.x2=e.parentLeft-e.childLeft+21,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1),this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y2+" L "+(this.x1+12)+" "+this.y2,this.arrowPath="M "+(this.x1+20)+" "+this.y2+" L "+(this.x1+12)+" "+(this.y2-(4+this.lineStroke))+" L "+(this.x1+12)+" "+(this.y2+4+this.lineStroke)+" Z"),"FFType1"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.x1=e.childEndPoint,this.x2=e.parentEndPoint+(e.milestoneParent?-1:0),this.x3=e.milestoneParent?22:21,this.x4=e.milestoneChild?4:8,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1),this.y2=c+this.taskLineValue+g-this.lineStroke,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+(this.x2+this.x3)+" "+this.y1+" L "+(this.x2+this.x3)+" "+(this.y1+this.y2)+" L "+(this.x1+this.x4)+" "+(this.y1+this.y2),this.arrowPath="M "+this.x1+" "+(this.y1+this.y2)+" L "+(this.x1+8)+" "+(this.y1+this.y2-(4+this.lineStroke))+" L "+(this.x1+8)+" "+(this.y1+this.y2+4+this.lineStroke)+" Z"),"FFType2"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.x1=e.parentEndPoint,this.x2=e.childEndPoint+(e.milestoneParent?22:21),this.x3=e.childEndPoint+(e.milestoneChild?9:8),this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(e.milestoneParent)-(this.lineStroke-1),this.y2=c+this.taskLineValue+g-this.lineStroke,this.connectorLinePath="M "+this.x1+" "+this.y1+" L "+this.x2+" "+this.y1+" L "+this.x2+" "+(this.y1+this.y2)+" L "+this.x3+" "+(this.y1+this.y2),this.arrowPath="M "+(this.x3-8)+" "+(this.y1+this.y2)+" L "+this.x3+" "+(this.y1+this.y2-(4+this.lineStroke))+" L "+this.x3+" "+(this.y1+this.y2+4+this.lineStroke)+" Z"),"FFType3"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.childEndPoint,this.x2=this.x1+(e.milestoneChild?4:8),this.x3=e.parentEndPoint-e.childEndPoint+(e.milestoneChild?16:10),this.x4=e.parentEndPoint+(e.milestoneParent?-1:0),this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.y2=c+this.taskLineValue+g-this.lineStroke+(this.parent.renderBaseline?e.milestoneParent&&!e.milestoneChild?10:e.milestoneChild&&!e.milestoneParent?-11:0:0),this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+(this.x2+this.x3)+" "+this.y1+" L "+(this.x2+this.x3)+" "+(this.y1+this.y2)+" L "+this.x4+" "+(this.y1+this.y2),this.arrowPath="M "+this.x1+" "+this.y1+" L "+(this.x1+8)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+8)+" "+(this.y1+4+this.lineStroke)+" Z"),"FFType4"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.parentEndPoint,this.x2=e.childEndPoint+(e.milestoneChild?7:8),this.x3=this.x2+(e.milestoneChild?12:11),this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.y2=c+this.taskLineValue+g+(this.parent.renderBaseline?e.milestoneParent&&!e.milestoneChild?10:e.milestoneChild&&!e.milestoneParent?-12:0:0)-this.lineStroke+1,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+(this.y1+this.y2)+" L "+this.x1+" "+(this.y1+this.y2),this.arrowPath="M "+(this.x2-8)+" "+this.y1+" L "+this.x2+" "+(this.y1-(4+this.lineStroke))+" L "+this.x2+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType4"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?-1:0,this.point1=this.taskLineValue+c+g-this.getconnectorLineGap(e)-(this.lineStroke-1),this.point2=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-u,this.x1=e.parentLeft-10,this.x2=this.x1+(e.childEndPoint-e.parentLeft+18),this.x3=this.x2+(e.milestoneChild?16:11),this.y1=this.point2+(e.milestoneChild?2:0)+(this.parent.renderBaseline&&e.milestoneParent?-5:0),this.y2=this.y1+this.point1+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?-9:e.milestoneParent&&!e.milestoneChild?9:0:0),this.y3=this.getconnectorLineGap(e),this.y4=this.y2-this.y2%e.rowHeight,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+this.y4+" L "+this.x1+" "+this.y4+" L "+this.x1+" "+(this.y2+this.y3)+" L "+(this.x1+11)+" "+(this.y2+this.y3),this.arrowPath="M "+(this.x2-8)+" "+this.y1+" L "+this.x2+" "+(this.y1-(4+this.lineStroke))+" L "+this.x2+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType3"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.point1=e.parentLeft-(e.childEndPoint+(e.milestoneParent?23:20))+1,this.point2=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:y)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1),this.x1=e.childEndPoint,this.x2=this.x1+(e.milestoneChild?9:8),this.x3=this.x2+(e.milestoneChild?17:11),this.y1=this.point2,this.y2=this.y1+c+g-(this.lineStroke-1)+this.taskLineValue+(this.parent.renderBaseline?e.milestoneChild&&!e.milestoneParent?-12:e.milestoneParent&&!e.milestoneChild?10:0:0),this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+this.y2+" L "+(this.x3+this.point1)+" "+this.y2,this.arrowPath="M "+(this.x2-8)+" "+this.y1+" L "+this.x2+" "+(this.y1-(4+this.lineStroke))+" L "+this.x2+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType1"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=c+g-this.getconnectorLineGap(e)+this.taskLineValue-this.lineStroke,this.point2=this.getconnectorLineGap(e),this.x1=e.parentLeft-10,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-u,this.x2=e.childEndPoint-e.parentLeft+31,this.y2=this.y1+this.point1,this.x3=e.childEndPoint-e.parentLeft+18,this.y3=this.y2-this.y2%e.rowHeight,this.connectorLinePath="M "+(this.x1+11)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y3+" L "+(this.x1+this.x2)+" "+this.y3+" L "+(this.x1+this.x2)+" "+(this.y2+this.point2)+" L "+(this.x1+this.x3)+" "+(this.y2+this.point2),this.arrowPath="M "+(this.x1+this.x3-8)+" "+(this.y2+this.point2)+" L "+(this.x1+this.x3)+" "+(this.y2+this.point2-(4+this.lineStroke))+" L "+(this.x1+this.x3)+" "+(this.y2+this.point2+4+this.lineStroke)+" Z"),"SFType2"===this.getParentPosition(e)&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.childEndPoint,this.y1=this.parent.enableVirtualization?p:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:m)+f+this.getTaskbarMidpoint(s)-(this.lineStroke-1),this.x2=e.parentLeft-e.childEndPoint,this.y2=this.y1+c+this.taskLineValue+g-this.lineStroke,this.connectorLinePath="M "+(this.x1+this.x2+1)+" "+this.y1+" L "+(this.x1+this.x2-10)+" "+this.y1+" L "+(this.x1+this.x2-10)+" "+this.y2+" L "+(this.x1+8)+" "+this.y2,this.arrowPath="M "+this.x1+" "+this.y2+" L "+(this.x1+8)+" "+(this.y2-(4+this.lineStroke))+" L "+(this.x1+8)+" "+(this.y2+4+this.lineStroke)+" Z"),this.connectorPath.setAttribute("d",this.connectorLinePath),this.arrowlinePath.setAttribute("d",this.arrowPath)),this.groupObject.outerHTML},e.prototype.getPosition=function(e,t,i){var r=0,n=0;if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){var a=!!e.milestoneParent,s=!!e.milestoneChild,o=this.getTaskbarMidpoint(a)-(this.lineStroke-1),l=this.getTaskbarMidpoint(s)-(this.lineStroke-1),d=-1!==e.parentIndexInCurrentView,h=-1!==e.childIndexInCurrentView,p=this.parent.currentViewData.length-1;"SSType1"===t||"SSType2"===t||"FFType1"===t||"FFType2"===t||"SFType2"===t?(r=d?e.parentIndexInCurrentView*e.rowHeight+o:0,n=d&&h?i:h?e.childIndexInCurrentView*e.rowHeight+o:p*e.rowHeight+o):"SSType3"===t||"SSType4"===t||"FSType4"===t||"FFType3"===t||"FFType4"===t||"SFType4"===t||"SFType3"===t?(r=h?e.childIndexInCurrentView*e.rowHeight+l:0,n=d&&h?i:d?e.parentIndexInCurrentView*e.rowHeight+l:p*e.rowHeight+l):"FSType3"===t?(r=h?e.childIndexInCurrentView*e.rowHeight+o:0,n=d&&h?i:d?e.parentIndexInCurrentView*e.rowHeight+l:p*e.rowHeight+o):"SFType1"!==t&&"FSType1"!==t&&"FSType2"!==t||(r=d?e.parentIndexInCurrentView*e.rowHeight+l:0,n=d&&h?i:h?e.childIndexInCurrentView*e.rowHeight+l:p*e.rowHeight+l)}return{top:r,height:n}},e.prototype.createConnectorLineTooltipTable=function(){this.tooltipTable=i.i(r.createElement)("table",{className:".e-tooltiptable",styles:"margin-top:0px",attrs:{cellspacing:"2px",cellpadding:"2px"}});var e=i.i(r.createElement)("tbody");e.innerHTML="",this.tooltipTable.appendChild(e)},e.prototype.getConnectorLineTooltipInnerTd=function(e,t,i,r){var n='<tr id="fromPredecessor"><td style="padding: 4px;width: 30px;">'+this.parent.localeObj.getConstant("from")+"</td><td> ";return n=n+e+' </td><td style="padding: 2px;"> '+this.parent.localeObj.getConstant(t)+" </td> </tr>",n=n+'<tr id="toPredecessor"><td style="padding: 4px;">'+this.parent.localeObj.getConstant("to")+"</td><td> "+i,n=n+' </td><td style="padding: 2px;width: 30px;"> '+this.parent.localeObj.getConstant(r)+" </td></tr></tbody><table>"},e.prototype.generateAriaLabel=function(e){var t=e.type,i=this.expandedRecords,r=i[e.parentIndex].ganttProperties.taskName,n=i[e.childIndex].ganttProperties.taskName,a=this.parent.localeObj.getConstant("start"),s=this.parent.localeObj.getConstant("finish");return"FS"===t?r+" "+s+" to "+n+" "+a:"FF"===t?r+" "+s+" to "+n+" "+s:"SS"===t?r+" "+a+" to "+n+" "+a:r+" "+a+" to "+n+" "+s},e.prototype.getRecordByID=function(e){if(i.i(r.isNullOrUndefined)(e))return null;if(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth){return this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData.filter(function(t){return t.ganttProperties.taskId.toString()===e.toString()})[0]}return"ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf("T"+e.toString())]:this.parent.flatData[this.parent.ids.indexOf(e.toString())]},e.prototype.removePreviousConnectorLines=function(e){var t;t=!0===i.i(r.isObject)(e);for(var n=t?Object.keys(e).length:e.length,a=Object.keys(e),s=0;s<n;s++){var o=void 0;if(t){o=e[a[s]]}else o=e[s];var l=o.ganttProperties&&o.ganttProperties.predecessor;if(l&&l.length>0)for(var d=0;d<l.length;d++){var h="parent"+l[d].from+"child"+l[d].to;this.removeConnectorLineById(h)}}},e.prototype.removeConnectorLineById=function(e){var t=this.parent.connectorLineModule.dependencyViewContainer.querySelector("#ConnectorLine"+e);i.i(r.isNullOrUndefined)(t)||i.i(r.remove)(t)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),i(9)),a=(i.n(n),i(3)),s=function(){function e(e,t){this.parent=e,this.taskbarEdit=t}return e.prototype.createTooltip=function(e,t,i){var r=this;this.toolTipObj=new n.Tooltip({opensOn:e,position:"TopRight",enableRtl:this.parent.enableRtl,mouseTrail:t,cssClass:a._8,target:i||null,animation:{open:{effect:"None"},close:{effect:"None"}}}),this.toolTipObj.beforeRender=function(e){var t={data:r.taskbarEdit.taskBarEditRecord,args:e,content:r.toolTipObj.content};r.parent.trigger("beforeTooltipRender",t)},this.toolTipObj.afterOpen=function(e){r.updateTooltipPosition(e)},this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.chartPane)},e.prototype.updateTooltipPosition=function(e){e.element.style.visibility="visible";var t=this.parent.element.closest('[style*="zoom"]');if(i.i(r.isNullOrUndefined)(t)){var n=this.parent.getOffsetRect(this.parent.chartPane),a=n.left+this.parent.chartPane.offsetWidth,s=e.element.offsetLeft;a<s+e.element.offsetWidth&&(s+=a-(s+e.element.offsetWidth)),e.element.style.left=s+"px",e.element.style.visibility="visible"}},e.prototype.showHideTaskbarEditTooltip=function(e,t){e&&this.parent.tooltipSettings.showTooltip?(this.createTooltip("Custom",!1),this.parent.tooltipModule.toolTipObj.close(),this.updateTooltip(t),"ConnectorPointLeftDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+a.X)):"ConnectorPointRightDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+a.Y)):this.toolTipObj.open(this.taskbarEdit.taskBarEditElement)):i.i(r.isNullOrUndefined)(this.toolTipObj)||(this.toolTipObj.destroy(),this.toolTipObj=null)},e.prototype.updateTooltip=function(e){var t=this.taskbarEdit.taskBarEditRecord.ganttProperties,n=-1===e?t.width:t.segments[e].width,a=-1===e?t.progressWidth:t.segments[e].progressWidth,s=-1===e?t.left:t.left+t.segments[e].left;i.i(r.isNullOrUndefined)(this.toolTipObj)||("ConnectorPointLeftDrag"===this.taskbarEdit.taskBarEditAction||"ConnectorPointRightDrag"===this.taskbarEdit.taskBarEditAction?(this.toolTipObj.content=this.getTooltipText(e),this.toolTipObj.offsetY=-3):(this.toolTipObj.content=this.getTooltipText(e),this.toolTipObj.refresh(this.taskbarEdit.taskBarEditElement),"LeftResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=0:this.toolTipObj.offsetX=-n:"RightResizing"===this.taskbarEdit.taskBarEditAction||"ParentResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-n:this.toolTipObj.offsetX=0:"ProgressResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-a:this.toolTipObj.offsetX=-(n-a):"MilestoneDrag"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-this.parent.chartRowsModule.milestoneHeight/2:n>5&&(this.toolTipObj.offsetX=-(n+s-this.taskbarEdit.tooltipPositionX))))},e.prototype.getTooltipText=function(e){var t="",n=this.parent.globalize,a=this.taskbarEdit.taskBarEditRecord.ganttProperties;if(!i.i(r.isNullOrUndefined)(a.segments)&&a.segments.length>0&&-1!==e&&"ProgressResizing"!==this.taskbarEdit.taskBarEditAction&&(a=a.segments[e]),this.parent.tooltipSettings.editing){var s=this.parent.tooltipModule.templateCompiler(this.parent.tooltipSettings.editing,this.parent,this.taskbarEdit.taskBarEditRecord,"TooltipEditingTemplate");i.i(r.getValue)("tooltipEle",this.toolTipObj)&&this.parent.renderTemplates(),t=s[0]}else{var o=void 0,l=void 0,d=void 0;switch(i.i(r.isNullOrUndefined)(a.startDate)||(o='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+n.formatDate(a.startDate,{format:this.parent.getDateFormat()})+"</td></tr>"),i.i(r.isNullOrUndefined)(a.endDate)||(l='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+n.formatDate(a.endDate,{format:this.parent.getDateFormat()})+"</td></tr>"),i.i(r.isNullOrUndefined)(a.duration)||(d='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+this.parent.getDurationString(a.duration,a.durationUnit)+"</td></tr>"),this.taskbarEdit.taskBarEditAction){case"ProgressResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+('<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+a.progress+"</td></tr>")+"</tbody></table>";break;case"LeftResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+o+d+"</tbody></table>";break;case"RightResizing":case"ParentResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+l+d+"</tbody></table>";break;case"ChildDrag":case"ParentDrag":case"MilestoneDrag":case"ManualParentDrag":var h="",p="";i.i(r.isNullOrUndefined)(this.taskbarEdit.taskBarEditRecord.ganttProperties.startDate)||(h=o),i.i(r.isNullOrUndefined)(this.taskbarEdit.taskBarEditRecord.ganttProperties.endDate)||(p=l),t='<table class = "e-gantt-tooltiptable"><tbody>'+h+p+"</tbody></table>";break;case"ConnectorPointLeftDrag":case"ConnectorPointRightDrag":t=this.parent.connectorLineModule.tooltipTable,i.i(r.isNullOrUndefined)(this.toolTipObj)&&(this.parent.connectorLineModule.tooltipTable.innerHTML=this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.taskName,this.parent.editModule.taskbarEditModule.fromPredecessorText,"",""))}}return t},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(0),n=(i.n(r),i(3)),a=function(){function e(e){this.parent=e,this.eventMarkersContainer=null}return e.prototype.renderEventMarkers=function(){this.parent.eventMarkers&&this.parent.eventMarkers.length>0?(this.parent.ganttChartModule.chartBodyContent.contains(this.eventMarkersContainer)||(this.eventMarkersContainer=i.i(r.createElement)("div",{className:n.t}),this.eventMarkersContainer.setAttribute("role","term"),this.parent.ganttChartModule.chartBodyContent.appendChild(this.eventMarkersContainer)),this.eventMarkersContainer.innerHTML="",this.getEventMarkersElements(this.eventMarkersContainer)):this.removeContainer()},e.prototype.removeContainer=function(){this.eventMarkersContainer&&(i.i(r.remove)(this.eventMarkersContainer),this.eventMarkersContainer=null)},e.prototype.getEventMarkersElements=function(e){for(var t,a,s,o,l=0;l<this.parent.eventMarkers.length;l++){t=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(this.parent.eventMarkers[l].day,!0),!1);var d=void 0;if(d=this.parent.enableRtl?"right:"+t+"px;":"left:"+t+"px;",a=i.i(r.createElement)("div",{className:n.u,styles:d+" height:100%;",id:"stripline"+l}),this.parent.eventMarkers[l].label){s=i.i(r.createElement)("div",{className:n.v});var h=this.parent.disableHtmlEncode?"textContent":"innerHTML";s[h]=this.parent.eventMarkers[l].label,this.parent.enableHtmlSanitizer&&"string"==typeof s[h]&&(s[h]=r.SanitizeHtmlHelper.sanitize(s[h])),this.parent.enableRtl?s.style.right="5px":s.style.left="5px",a.appendChild(s),o=i.i(r.createElement)("div",{className:"e-gantt-right-arrow"}),a.appendChild(o)}this.parent.eventMarkers[l].cssClass&&a.classList.add(this.parent.eventMarkers[l].cssClass),a.setAttribute("tabindex","-1"),i.i(r.isNullOrUndefined)(this.parent.eventMarkers[l].day)||a.setAttribute("aria-label",this.parent.localeObj.getConstant("eventMarkers")+" "+("string"==typeof this.parent.eventMarkers[l].day?this.parent.eventMarkers[l].day:this.parent.getFormatedDate(this.parent.eventMarkers[l].day))+" "+this.parent.eventMarkers[l].label),e.appendChild(a)}},e.prototype.updateContainerHeight=function(){this.eventMarkersContainer&&(this.eventMarkersContainer.style.height=i.i(r.formatUnit)(this.parent.getContentHeight()))},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(0),n=(i.n(r),i(3)),a=function(){function e(e){this.weekendWidthUpdated=!1,this.parent=e,this.nonworkingContainer=null,this.holidayContainer=null,this.weekendContainer=null}return e.prototype.createNonworkingContainer=function(){this.parent.ganttChartModule.chartBodyContent.contains(this.nonworkingContainer)||(this.nonworkingContainer=i.i(r.createElement)("div",{className:n.w}),this.parent.ganttChartModule.chartBodyContent.insertBefore(this.nonworkingContainer,this.parent.ganttChartModule.chartBodyContent.lastChild))},e.prototype.renderHolidays=function(){this.parent.holidays&&this.parent.holidays.length>0?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.holidayContainer)||(this.holidayContainer=i.i(r.createElement)("div",{className:n.x}),this.nonworkingContainer.appendChild(this.holidayContainer)),this.holidayContainer.innerHTML=this.getHolidaysElement().innerHTML):this.holidayContainer&&this.holidayContainer.parentNode&&(i.i(r.remove)(this.holidayContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&i.i(r.remove)(this.nonworkingContainer))},e.prototype.getHolidaysElement=function(){var e,t,a=i.i(r.createElement)("div"),s=this.parent.contentHeight,o=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(o=this.parent.toolbarModule.element.offsetHeight);for(var l=this.parent.ganttHeight-o-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,d=0;d<this.parent.holidays.length;d++){this.parent.holidays[d].from&&this.parent.holidays[d].to?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[d].from),t=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[d].to),t.setDate(t.getDate()+1),e.setHours(0,0,0,0),t.setHours(0,0,0,0)):this.parent.holidays[d].from?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[d].from),e.setHours(0,0,0,0)):this.parent.holidays[d].to&&(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[d].to),e.setHours(0,0,0,0));var h=this.parent.holidays[d].from&&this.parent.holidays[d].to?this.parent.dataOperation.getTaskWidth(e,t):this.parent.perDayWidth,p=this.parent.dataOperation.getTaskLeft(e,!1),u=this.parent.enableRtl?"right:"+p+"px;":"left:"+p+"px;",c=i.i(r.createElement)("div",{className:n.y,styles:u+" width:"+h+"px; height:100%;"}),g=l<s?l/2:s/2,f=i.i(r.createElement)("span",{className:n.z,styles:"top:"+g+"px;left:"+h/2+"px;"}),m=this.parent.disableHtmlEncode?"textContent":"innerHTML";f[m]=this.parent.holidays[d].label?this.parent.holidays[d].label:"",this.parent.enableHtmlSanitizer&&"string"==typeof f[m]&&(f[m]=r.SanitizeHtmlHelper.sanitize(f[m])),c.appendChild(f),this.parent.holidays[d].cssClass&&c.classList.add(this.parent.holidays[d].cssClass),a.appendChild(c)}return a},e.prototype.renderWeekends=function(){this.parent.highlightWeekends?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.weekendContainer)||(this.weekendContainer=i.i(r.createElement)("div",{className:n.A}),this.nonworkingContainer.appendChild(this.weekendContainer)),this.weekendContainer.innerHTML=this.getWeekendElements().innerHTML):this.weekendContainer&&(i.i(r.remove)(this.weekendContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&i.i(r.remove)(this.nonworkingContainer))},e.prototype.getWeekendElements=function(){var e=i.i(r.createElement)("div"),t=new Date(this.parent.timelineModule.timelineStartDate.getTime()),a=new Date(this.parent.timelineModule.timelineEndDate.getTime()),s=this.parent.nonWorkingDayIndex,o=!0;do{if(-1!==s.indexOf(t.getDay())){var l=this.parent.dataOperation.getTaskLeft(t,!1),d=this.parent.perDayWidth;if(o){var h=new Date(t.getTime()),p=new Date(h.getTime());p.setDate(p.getDate()+1),p.setHours(0,0,0,0),d=this.parent.dataOperation.getTaskWidth(h,p),o=!1}var u=new Date(t);u.setDate(u.getDate()+1),u.getTimezoneOffset()==this.parent.timelineModule.timelineStartDate.getTimezoneOffset()||this.weekendWidthUpdated||"Hour"==this.parent.timelineModule.bottomTier&&1===this.parent.timelineSettings.bottomTier.count&&(d-=this.parent.timelineSettings.timelineUnitSize,this.weekendWidthUpdated=!0);var c=this.parent.enableRtl?"right:"+l+"px;":"left:"+l+"px;",g=i.i(r.createElement)("div",{className:n.B,styles:c+" width:"+d+"px;height:100%;"});e.appendChild(g)}t.setDate(t.getDate()+1),t.setHours(0,0,0,0)}while(t<a);return e},e.prototype.updateHolidayLabelHeight=function(){var e=this.parent.getContentHeight(),t=document.getElementById("ganttContainer"),a=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(a=this.parent.toolbarModule.element.offsetHeight);for(var s="auto"===this.parent.height?t.offsetHeight-a-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight:this.parent.ganttHeight-a-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,o=s<e?s/2:e/2,l=this.holidayContainer.querySelectorAll("."+n.z),d=0;d<l.length;d++)l[d].style.top=i.i(r.formatUnit)(o)},e.prototype.updateContainerHeight=function(){var e=this.parent.getContentHeight();this.holidayContainer&&(this.holidayContainer.style.height=i.i(r.formatUnit)(e),this.updateHolidayLabelHeight()),this.weekendContainer&&(this.weekendContainer.style.height=i.i(r.formatUnit)(e))},e.prototype.removeContainers=function(){this.holidayContainer&&i.i(r.remove)(this.holidayContainer),this.weekendContainer&&i.i(r.remove)(this.weekendContainer),this.nonworkingContainer&&i.i(r.remove)(this.nonworkingContainer)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(3)),a=i(4),s=(i.n(a),this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},s.apply(this,arguments)}),o=function(){function e(e){this.isZoomIn=!1,this.isZooming=!1,this.isZoomToFit=!1,this.topTierCollection=[],this.bottomTierCollection=[],this.parent=e,this.initProperties()}return e.prototype.initProperties=function(){this.timelineStartDate=null,this.timelineEndDate=null,this.totalTimelineWidth=0,this.customTimelineSettings=null,this.parent.isTimelineRoundOff=!this.isZoomToFit&&!!i.i(r.isNullOrUndefined)(this.parent.projectStartDate),this.parent.enablePersistence&&this.parent.isLoad&&(this.parent.timelineSettings=this.parent.currentZoomingLevel)},e.prototype.validateTimelineProp=function(){this.roundOffDays(),this.processTimelineProperty(),this.timelineWidthCalculation()},e.prototype.refreshTimeline=function(){this.initProperties(),this.processTimelineUnit(),this.parent.dataOperation.calculateProjectDates(),this.parent.isFromOnPropertyChange||this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff)},e.prototype.refreshTimelineByTimeSpan=function(){this.validateTimelineProp(),(!this.parent.pdfExportModule||this.parent.pdfExportModule&&!this.parent.pdfExportModule.isPdfExport||this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&!this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(this.parent.ganttChartModule.chartTimelineContainer.innerHTML=""),this.createTimelineSeries()},e.prototype.updateChartByNewTimeline=function(){this.parent.chartRowsModule.refreshChartByTimeline(),this.parent.notify("refreshDayMarkers",{})},e.prototype.processZooming=function(e){this.isZoomToFit=!1,this.parent.isProjectDateUpdated||this.parent.dateValidationModule.calculateProjectDates(),i.i(r.isNullOrUndefined)(this.parent.zoomingProjectStartDate)||(this.parent.cloneProjectStartDate=this.parent.cloneProjectStartDate.getTime()<this.parent.zoomingProjectStartDate.getTime()?this.parent.cloneProjectStartDate:this.parent.zoomingProjectStartDate,this.parent.cloneProjectEndDate=this.parent.cloneProjectEndDate.getTime()>this.parent.zoomingProjectEndDate.getTime()?this.parent.cloneProjectEndDate:this.parent.zoomingProjectEndDate),this.parent.zoomingProjectStartDate=null,this.parent.zoomingProjectEndDate=null;var t=this.checkCurrentZoomingLevel();this.isZoomIn=e,this.isZooming=!0;var n=e?t+1:t-1;this.parent.toolbarModule&&(e?n===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?(this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1),this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!0)):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!0):n===this.parent.zoomingLevels[0].level?(this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1),this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!0)):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!0)),n=this.parent.zoomingLevels.findIndex(function(e){return e.level===n});var a=this.parent.zoomingLevels[n],s={requestType:e?"beforeZoomIn":"beforeZoomOut",timeline:a,cancel:!1};this.parent.trigger("actionBegin",s),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),s.cancel||(a=s.timeline,this.changeTimelineSettings(a))},e.prototype.changeTimelineSettings=function(e){var t=this;this.isZoomToFit?this.isSingleTier="None"===this.customTimelineSettings.topTier.unit||"None"===this.customTimelineSettings.bottomTier.unit:this.isZoomIn||(this.isSingleTier="None"===e.topTier.unit||"None"===e.bottomTier.unit);var n=this.isSingleTier?"None"===this.customTimelineSettings.topTier.unit?"topTier":"bottomTier":null;Object.keys(this.customTimelineSettings).forEach(function(a){if(a!==n)t.customTimelineSettings[a]="object"!=typeof e[a]||i.i(r.isNullOrUndefined)(e[a])?e[a]:s({},e[a]);else{var o="topTier"===a?"bottomTier":"topTier";"None"!=e.bottomTier.unit&&(t.customTimelineSettings[o]=s({},e.bottomTier))}}),this.parent.isTimelineRoundOff=!this.isZoomToFit&&!!i.i(r.isNullOrUndefined)(this.parent.projectStartDate),this.processTimelineUnit(),this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff);var a=this.parent.criticalPathModule;if(this.parent.enableCriticalPath&&a&&a.criticalConnectorLine(a.criticalPathCollection,a.detailPredecessorCollection,!0,a.predecessorCollectionTaskIds),this.isZooming||this.isZoomToFit){var o={requestType:this.isZoomIn?"AfterZoomIn":this.isZoomToFit?"AfterZoomToProject":"AfterZoomOut",timeline:this.parent.currentZoomingLevel};this.parent.trigger("actionComplete",o),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()}},e.prototype.processZoomToFit=function(){this.isZoomToFit=!0,this.isZooming=!1,this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.zoomingProjectStartDate>this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=new Date(this.parent.allowUnscheduledTasks?this.parent.zoomingProjectStartDate:this.parent.cloneProjectStartDate)),this.parent.dataOperation.calculateProjectDates();var e,t,n,a=this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime(),s=a/864e5,o=this.parent.ganttChartModule.chartElement.offsetWidth,l=o/s,d=this.parent.zoomingLevels.slice(),h=d.sort(function(e,t){return e.perDayWidth||t.perDayWidth?e.perDayWidth<t.perDayWidth?1:-1:0});if(0!==l){for(var p=0;p<h.length;p++){if(t=h[p],p===h.length-1){e=h[p];break}if(n=h[p+1],l>=t.perDayWidth){e=h[p];break}if(l<t.perDayWidth&&l>n.perDayWidth){e=h[p+1];break}}var u=i.i(r.extend)({},{},e,!0);this.roundOffDateToZoom(this.parent.cloneProjectStartDate,!0,l,u.bottomTier.unit,e),this.roundOffDateToZoom(this.parent.cloneProjectEndDate,!1,l,u.bottomTier.unit,e);var c=this.calculateNumberOfTimelineCells(u),g=this.parent.ganttChartModule.scrollElement.offsetHeight-17,f=this.parent.ganttChartModule.chartBodyContent.offsetHeight,m=f<=g?0:17;u.timelineUnitSize=Math.abs(o-m)/c;var y={requestType:"beforeZoomToProject",timeline:u};this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin",this.parent.controlId+"_zoomout"],!0),this.parent.trigger("actionBegin",y),i.i(r.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),this.changeTimelineSettings(u),this.parent.isTimelineRoundOff=!!i.i(r.isNullOrUndefined)(this.parent.projectStartDate)}},e.prototype.bottomTierCellWidthCalc=function(e,t,i){var r;switch(e){case"Minutes":r=6e4*t.bottomTier.count;break;case"Hour":r=36e5*t.bottomTier.count;break;case"Week":r=6048e5*t.bottomTier.count;break;case"Day":r=864e5*t.bottomTier.count;break;case"Month":var n=new Date(i.getFullYear(),i.getMonth()+1,0).getDate();r=t.bottomTier.count*(86400*n*1e3);break;case"Year":var a=i.getFullYear()%400==0||i.getFullYear()%100!=0&&i.getFullYear()%4==0?366:365;r=t.bottomTier.count*(86400*a*1e3)}return r},e.prototype.roundOffDateToZoom=function(e,t,i,r,n){var a=this.bottomTierCellWidthCalc(r,n,e);t?e.setTime(e.getTime()-a):e.setTime(e.getTime()+a)},e.prototype.calculateNumberOfTimelineCells=function(e){var t=Math.abs((this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime())/864e5),i=e.bottomTier.count,r=e.bottomTier.unit;return"Day"===r?t/i:"Week"===r?t/i/7:"Month"===r?t/i/28:"Year"===r?t/i/336:"Hour"===r?t*(24/i):t*(1440/i)},e.prototype.processTimelineUnit=function(){var e=["timelineViewMode","timelineUnitSize","weekStartDay","weekendBackground"],t={topTier:["unit","format","count","formatter"],bottomTier:["unit","format","count","formatter"]},i=["Year","Month","Week","Day","Hour","Minutes"];this.customTimelineSettings=this.customTimelineSettings?this.customTimelineSettings:this.extendFunction(this.parent.timelineSettings,e,t),-1===i.indexOf(this.customTimelineSettings.topTier.unit)&&-1===i.indexOf(this.customTimelineSettings.bottomTier.unit)?(this.customTimelineSettings.topTier.unit=-1!==i.indexOf(this.customTimelineSettings.timelineViewMode)?this.customTimelineSettings.timelineViewMode:"Week",this.customTimelineSettings.bottomTier.unit=5!==i.indexOf(this.customTimelineSettings.topTier.unit)?i[i.indexOf(this.customTimelineSettings.topTier.unit)+1]:"None"):-1!==i.indexOf(this.customTimelineSettings.topTier.unit)&&-1!==i.indexOf(this.customTimelineSettings.bottomTier.unit)&&i.indexOf(this.customTimelineSettings.topTier.unit)>i.indexOf(this.customTimelineSettings.bottomTier.unit)?this.customTimelineSettings.bottomTier.unit=this.customTimelineSettings.topTier.unit:(this.customTimelineSettings.topTier.unit=-1===i.indexOf(this.customTimelineSettings.topTier.unit)?"None":this.customTimelineSettings.topTier.unit,this.customTimelineSettings.bottomTier.unit=-1===i.indexOf(this.customTimelineSettings.bottomTier.unit)?"None":this.customTimelineSettings.bottomTier.unit),this.topTier=this.customTimelineSettings.topTier.unit,this.bottomTier=this.customTimelineSettings.bottomTier.unit,this.previousIsSingleTier=this.isSingleTier,this.isSingleTier="None"===this.topTier||"None"===this.bottomTier},e.prototype.processTimelineProperty=function(){this.customTimelineSettings.topTier.count="None"===this.topTier?1:this.validateCount(this.customTimelineSettings.topTier.unit,this.customTimelineSettings.topTier.count,"topTier"),this.customTimelineSettings.bottomTier.count="None"===this.customTimelineSettings.bottomTier.unit?1:this.validateCount(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.count,"bottomTier"),this.customTimelineSettings.bottomTier.format=this.validateFormat(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.format),this.customTimelineSettings.topTier.format=this.validateFormat(this.topTier,this.customTimelineSettings.topTier.format),this.customTimelineSettings.weekStartDay=this.customTimelineSettings.weekStartDay>=0&&this.customTimelineSettings.weekStartDay<=6?this.customTimelineSettings.weekStartDay:0,this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth||this.checkCurrentZoomingLevel()},e.prototype.calculateZoomingLevelsPerDayWidth=function(){for(var e=this.parent.zoomingLevels,t=0;t<e.length;t++){var i=this.getPerDayWidth(e[t].timelineUnitSize,e[t].bottomTier.count,e[t].bottomTier.unit);e[t].perDayWidth=i}},e.prototype.checkCurrentZoomingLevel=function(){var e="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.count:this.customTimelineSettings.topTier.count,t="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.unit:this.customTimelineSettings.topTier.unit,i="None"!==this.customTimelineSettings.bottomTier.unit?"bottomTier":"topTier",r=this.getCurrentZoomingLevel(t,e,i);return this.parent.toolbarModule&&(r===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):r===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),this.parent.currentZoomingLevel=this.parent.zoomingLevels[r],r},e.prototype.getCurrentZoomingLevel=function(e,t,i){var r,n,a,s,o;this.parent.zoomingLevels.length||(this.parent.zoomingLevels=this.parent.getZoomingLevels());var l=this.parent.zoomingLevels.filter(function(t){return"bottomTier"===i?t.bottomTier.unit===e:t.topTier.unit===e});if(0===l.length){var d=this.getClosestUnit(e,"",!1);l=this.parent.zoomingLevels.filter(function(e){return"bottomTier"===i?e.bottomTier.unit===d:e.topTier.unit===d})}for(var h=l.sort(function(e,t){return"bottomTier"===i?e.bottomTier.count&&t.bottomTier.count?e.bottomTier.count<t.bottomTier.count?1:-1:0:e.topTier.count&&t.topTier.count?e.topTier.count<t.topTier.count?1:-1:0}),p=0;p<h.length;p++){if(o=h[p],p===h.length-1){r=h[p].level;break}if(s=h[p+1],t>=o[""+i].count){n=h[p],a=h.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count}),r=a.length>1?this.checkCollectionsWidth(a):a[0].level;break}if(t<o[""+i].count&&t>s[""+i].count){n=h[p+1],a=h.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count}),r=a.length>1?this.checkCollectionsWidth(a):a[0].level;break}}return r},e.prototype.getClosestUnit=function(e,t,i){var r=["Year","Month","Week","Day","Hour","Minutes"],n=r.indexOf(e);return 0===n&&(i=!0),e=this.isZoomIn||i?r[n+1]:r[n-1],0===this.parent.zoomingLevels.filter(function(t){return t.bottomTier.unit===e}).length?("Year"===e&&(i=!0),t=e,this.getClosestUnit(e,t,i)):e},e.prototype.checkCollectionsWidth=function(e){for(var t,i,r,n=e,a=this.customTimelineSettings.timelineUnitSize,s=n.sort(function(e,t){return e.timelineUnitSize<t.timelineUnitSize?1:-1}),o=0;o<s.length;o++){if(r=s[o],o===s.length-1){t=s[o].level;break}if(i=s[o+1],a>=r.timelineUnitSize){t=s[o].level;break}if(a<r.timelineUnitSize&&a>i.timelineUnitSize){t=s[o+1].level;break}}return t},e.prototype.updateTimelineHeaderHeight=function(){if(this.parent.timelineModule.isSingleTier?(i.i(r.addClass)([this.parent.ganttChartModule.chartTimelineContainer],n._17),this.parent.treeGrid.element&&(i.i(r.addClass)(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),n._17),i.i(r.addClass)(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),n._17))):(i.i(r.removeClass)([this.parent.ganttChartModule.chartTimelineContainer],n._17),this.parent.treeGrid.element&&(i.i(r.removeClass)(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),n._17),i.i(r.removeClass)(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),n._17))),this.previousIsSingleTier!==this.isSingleTier){var e=0;i.i(r.isNullOrUndefined)(this.parent.toolbarModule)||i.i(r.isNullOrUndefined)(this.parent.toolbarModule.element)||(e=this.parent.toolbarModule.element.offsetHeight),this.parent.ganttChartModule.scrollObject.setHeight(this.parent.ganttHeight-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight-e),this.parent.treeGrid.height=this.parent.ganttHeight-e-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight}},e.prototype.createTimelineSeries=function(){var e,t,a,s,o,l=this.isSingleTier?1:2,d="None"===this.topTier?"bottomTier":"topTier";this.updateTimelineHeaderHeight(),this.topTierCollection=[],this.bottomTierCollection=[];for(var h=0;h<l;h++)s=i.i(r.createElement)("table",{className:n._13,styles:"display: block;"}),o=i.i(r.createElement)("thead",{className:n._56,styles:"display:block; border-collapse:collapse"}),e=i.i(r.createElement)("tr",{innerHTML:this.createTimelineTemplate(d)}),(!this.parent.pdfExportModule||this.parent.pdfExportModule&&!this.parent.pdfExportModule.isPdfExport||this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&!this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(t=i.i(r.createElement)("th"),a=i.i(r.createElement)("div",{styles:"width: 20px"}),t.appendChild(a),e.appendChild(t),o.appendChild(e),s.appendChild(o),this.parent.ganttChartModule.chartTimelineContainer.appendChild(s)),d="bottomTier",e=null;if("Auto"===this.parent.height||this.parent.timelineModule.isSingleTier){var p=this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight;this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+p+"px)",i.i(r.isNullOrUndefined)(this.parent.element.getElementsByClassName("e-gridcontent")[0])||(this.parent.treeGrid.element.getElementsByClassName("e-gridcontent")[0].style.height="calc(100% - "+p+"px)")}},e.prototype.validateCount=function(e,t,n){var a,s=!i.i(r.isNullOrUndefined)(t)&&parseInt(t.toString(),10)>0?parseInt(t.toString(),10):1,o=Math.abs(this.timelineRoundOffEndDate.getTime()-this.timelineStartDate.getTime());switch(e){case"Year":a=Math.round(o/864e5/336),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Month":a=Math.round(o/864e5/28),s=s<=a?s:a>0?a+1:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Week":a=Math.round(o/864e5/7),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Day":a=Math.round(o/864e5),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Hour":a=Math.round(o/36e5),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s));break;case"Minutes":a=Math.round(o/6e4),s=s<=a?s:a>0?a:1,"None"!==this.topTier&&"bottomTier"===n&&(s=this.validateBottomTierCount(e,s))}return t!==s&&this.isZooming&&this.parent.toolbarModule&&("bottomTier"===n||this.isSingleTier)&&(this.isZoomIn?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),s},e.prototype.validateBottomTierCount=function(e,t){var i;switch(e){case"Year":i=t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Month":i="Year"===this.topTier?t<=12*this.customTimelineSettings.topTier.count?t:12*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Week":i="Year"===this.topTier?t<=48*this.customTimelineSettings.topTier.count?t:48*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=4*this.customTimelineSettings.topTier.count?t:4*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Day":i="Year"===this.topTier?t<=336*this.customTimelineSettings.topTier.count?t:336*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=28*this.customTimelineSettings.topTier.count?t:28*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count?t:7*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Hour":i="Year"===this.topTier?t<=8064*this.customTimelineSettings.topTier.count?t:8064*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=672*this.customTimelineSettings.topTier.count?t:672*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count*24?t:7*this.customTimelineSettings.topTier.count*24:"Day"===this.topTier?t<=24*this.customTimelineSettings.topTier.count?t:24*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Minutes":i="Year"===this.topTier?t<=483840*this.customTimelineSettings.topTier.count?t:483840*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=40320*this.customTimelineSettings.topTier.count?t:40320*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count*24*60?t:7*this.customTimelineSettings.topTier.count*24*60:"Day"===this.topTier?t<=24*this.customTimelineSettings.topTier.count*60?t:24*this.customTimelineSettings.topTier.count*60:"Hour"===this.topTier?t<=60*this.customTimelineSettings.topTier.count?t:60*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count}return i},e.prototype.validateFormat=function(e,t){var i;switch(e){case"Week":i=t||"MMM dd, yyyy";break;case"Day":case"None":i=t||"";break;case"Hour":i=t||"H";break;case"Month":i=t||"MMM yyyy";break;case"Year":i=t||"yyyy";break;case"Minutes":i=t||"m"}return i},e.prototype.extendFunction=function(e,t,i){for(var r=this,n={},a=0;a<t.length;a++)n[t[a]]=e[t[a]];return i&&Object.keys(i).forEach(function(t){n[t]=r.extendFunction(e[t],i[t],null)}),n},e.prototype.formatDateHeader=function(e,t){var i,r=new Date(t.getTime());return""===e?(i=this.parent.globalize.formatDate(r,{format:"E"}),i="zh"===this.parent.locale?i.slice(1):i.slice(0,1)):i=this.parent.globalize.formatDate(r,{format:e}),i},e.prototype.customFormat=function(e,t,n,a,s){return(s="string"==typeof s?i.i(r.getValue)(s,window):s)(e,t,n,a)},e.prototype.createTimelineTemplate=function(e){var t,i,r=!1,n=this.parent,a="",s="",o="topTier"===e?n.timelineModule.customTimelineSettings.topTier.unit:n.timelineModule.customTimelineSettings.bottomTier.unit,l="topTier"===e?n.timelineModule.customTimelineSettings.topTier.count:n.timelineModule.customTimelineSettings.bottomTier.count,d=new Date(this.parent.timelineModule.timelineStartDate.toString()),h=new Date(this.timelineRoundOffEndDate.toString()),p=[];do{var u={};u.startDate=new Date(d.getTime()),"Month"===o&&"bottomTier"===e&&1!=l&&0===p.length&&(r=!0),s=this.getHeaterTemplateString(new Date(d.toString()),o,e,!1,l,u,r),p.push(new Date(d.toString())),r?i=this.calculateQuarterEndDate(d,l).getTime():(t=this.getIncrement(d,l,o),i=d.getTime()+t),r=!1,d.setTime(i),5===d.getHours()&&2===l&&"bottomTier"===e&&"Hour"===this.parent.timelineSettings.bottomTier.unit&&d.setTime(d.getTime()-36e5),d>=h&&(s=this.getHeaterTemplateString(p[p.length-1],o,e,!0,l,u)),a+=s;var c="topTier"===e?this.topTierCollection:this.bottomTierCollection;u.endDate=new Date(d.getTime()),c.push(u)}while(d<h);return a},e.prototype.updateTimelineAfterZooming=function(e,t){var n,a,s,o=document.getElementsByClassName("e-chart-scroll-container e-content")[0];if(!i.i(r.isNullOrUndefined)(o)){var l=o.offsetWidth,d=o.offsetHeight,h=document.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;if(n=Math.abs(this.timelineStartDate.getTime()-e.getTime()),n/=864e5,a="None"===this.bottomTier?this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize,this.customTimelineSettings.topTier.count,this.topTier):this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize,this.customTimelineSettings.bottomTier.count,this.bottomTier),s=d<h?a*n+17:a*n,l>=s){var p=l-s;p=Math.round(p/a),e.setDate(e.getDate()+p),this.parent.timelineModule.timelineEndDate=e,t&&this.parent.updateProjectDates(this.timelineStartDate,this.timelineEndDate,this.parent.isTimelineRoundOff)}}},e.prototype.getTimelineRoundOffEndDate=function(e){var t="None"===this.topTier?this.bottomTier:this.topTier,n=new Date(e.toString());return this.parent.isTimelineRoundOff&&("Hour"===t?n.setMinutes(60):"Minutes"===t?n.setSeconds(60):n.setHours(24,0,0,0)),i.i(r.isNullOrUndefined)(this.parent.projectEndDate)&&this.updateTimelineAfterZooming(n,!1),n},e.prototype.getIncrement=function(e,t,i){var r,n=new Date(e.getTime()),a=new Date(e.getTime());switch(i){case"Year":n=e,a=new Date(e.getFullYear()+(t-1),11,31),r=a.getTime()-n.getTime()+864e5;break;case"Month":n=e,a=new Date(e.getFullYear(),e.getMonth()+t,1),r=a.getTime()-n.getTime();break;case"Week":var s=this.parent.timelineModule.customTimelineSettings.weekStartDay,o=e.getDay()<s?s-e.getDay():6-e.getDay()+s;t=o>0?t-1:0,a.setHours(24,0,0,0),o=e.getDay()<s&&o>0?o-1:o,a.setDate(a.getDate()+(o+7*t)),r=a.getTime()-n.getTime();break;case"Day":a.setHours(24,0,0,0),r=a.getTime()-n.getTime()+864e5*(t-1);break;case"Hour":a.setMinutes(60),a.setSeconds(0),r=a.getTime()-n.getTime()+36e5*(t-1),r=this.checkDate(n,a,r,t);break;case"Minutes":a.setSeconds(60),r=a.getTime()-n.getTime()+6e4*(t-1)}return r},e.prototype.checkDate=function(e,t,i,r){var n=new Date(e.getTime());if(n.setTime(n.getTime()+i),1!==r&&(n.getTime()-t.getTime())/36e5!=r&&e.getTimezoneOffset()!==n.getTimezoneOffset()){var a=r-(n.getTime()-t.getTime())/36e5;this.parent.isInDst(n)?this.parent.isInDst(n)&&2!==r&&(i-=36e5*a):i+=36e5*a}return i},e.prototype.isWeekendHeaderCell=function(e,t,i){return!("Day"!==e&&"Hour"!==e&&"Minutes"!==e||1!==this.customTimelineSettings[t].count&&"Hour"!==e&&"Minutes"!==e||-1===this.parent.nonWorkingDayIndex.indexOf(i.getDay()))},e.prototype.calculateQuarterEndDate=function(e,t){var i=e.getMonth();return 3===t?i>=0&&i<=2?new Date(e.getFullYear(),3,1):i>=3&&i<=5?new Date(e.getFullYear(),6,1):i>=6&&i<=8?new Date(e.getFullYear(),9,1):new Date(e.getFullYear()+1,0,1):i>=0&&i<=5?new Date(e.getFullYear(),6,1):new Date(e.getFullYear()+1,0,1)},e.prototype.getHeaterTemplateString=function(e,t,a,s,o,l,d){var h,p="",u="",c="topTier"===a?this.parent.timelineModule.customTimelineSettings.topTier.format:this.parent.timelineModule.customTimelineSettings.bottomTier.format,g="topTier"===a?this.parent.timelineModule.customTimelineSettings.topTier.formatter:this.parent.timelineModule.customTimelineSettings.bottomTier.formatter,f=i.i(r.isNullOrUndefined)(g)?this.parent.globalize.formatDate(e,{format:this.parent.getDateFormat()}):this.customFormat(e,c,a,t,g);h=this.getIncrement(e,o,t)/864e5*this.parent.perDayWidth;var m=h;h=s||d?s?this.calculateWidthBetweenTwoDate(t,e,this.timelineRoundOffEndDate):this.calculateWidthBetweenTwoDate(t,e,this.calculateQuarterEndDate(e,o)):h;var y=this.isWeekendHeaderCell(t,a,e),D="topTier"===a?" e-gantt-top-cell-text":"",v=i.i(r.isNullOrUndefined)(g)?this.formatDateHeader(c,e):this.customFormat(e,c,a,t,g);return u+=this.parent.timelineModule.isSingleTier?'<th class="'+n._57+" ":'<th class="'+n._58,u+=y?" "+n._59:"",u+='" tabindex="-1" aria-label= "'+this.parent.localeObj.getConstant("timelineCell")+" "+f,u+='" style="width:'+h+"px;",u+=y&&this.customTimelineSettings.weekendBackground?"background-color:"+this.customTimelineSettings.weekendBackground+";":"",u+='"><div class="'+n._60+D+'" style="width:'+(h-1)+"px;"+(this.parent.timelineSettings.showTooltip?'"title="'+f:""),u+='">'+v+"</div>",p+=u,p+="</th>",!this.isSingleTier&&"topTier"!==a||s?(this.isSingleTier||"topTier"===a)&&s&&(this.totalTimelineWidth=this.totalTimelineWidth-m+h):this.totalTimelineWidth=this.totalTimelineWidth+h,l.value=v,l.isWeekend=y,l.width=h,p},e.prototype.calculateWidthBetweenTwoDate=function(e,t,i){return(i.getTime()-t.getTime())/864e5*this.parent.perDayWidth},e.prototype.timelineWidthCalculation=function(){var e=this.customTimelineSettings.timelineUnitSize,t=this.customTimelineSettings.bottomTier.count,i=this.customTimelineSettings.topTier.count;this.bottomTierCellWidth=e,"None"===this.bottomTier?this.parent.perDayWidth=this.getPerDayWidth(e,i,this.topTier):this.parent.perDayWidth=this.getPerDayWidth(e,t,this.bottomTier),this.topTierCellWidth="None"!==this.bottomTier?"Week"===this.topTier?7*this.parent.perDayWidth:"Hour"===this.topTier?this.parent.perDayWidth/24:"Minutes"===this.topTier?this.parent.perDayWidth/1440:this.parent.perDayWidth:e,this.topTierCellWidth=this.isSingleTier?this.topTierCellWidth:this.topTierCellWidth*i},e.prototype.getPerDayWidth=function(e,t,i){var r;switch(i){case"Year":r=e/t/336;break;case"Month":r=e/t/28;break;case"Week":r=e/t/7;break;case"Day":r=e/t;break;case"Hour":r=24/t*e;break;case"Minutes":r=1440/t*e}return r},e.prototype.roundOffDays=function(){var e=this.parent.cloneProjectStartDate,t=this.parent.cloneProjectEndDate,i="None"===this.topTier?this.bottomTier:this.topTier;if(this.parent.isTimelineRoundOff){if("Year"===i)e=new Date(e.getFullYear(),0,1),t=new Date(t.getFullYear(),11,31);else if("Month"===i)e=new Date(e.getFullYear(),e.getMonth(),1),t=new Date(t.getFullYear(),t.getMonth()+1,0);else if("Week"===i){var r=this.parent.timelineModule.customTimelineSettings.weekStartDay,n=e.getDay()<r?e.getDate()-(7-r+e.getDay()):e.getDate()-e.getDay()+r;e.setDate(n);var a=t.getDate()-t.getDay(),s=a+6+r;t.setDate(s)}"Hour"===i?e.setMinutes(0):"Minutes"===i?e.setSeconds(0):e.setHours(0,0,0,0)}this.timelineStartDate=e,this.timelineEndDate=t,this.timelineRoundOffEndDate=this.getTimelineRoundOffEndDate(this.timelineEndDate)},e.prototype.updateScheduleDatesByToolBar=function(e,t,i,r){if("Year"===e&&("prevTimeSpan"===t?i=0===i.getMonth()?new Date(i.getFullYear()-1,0,1):new Date(i.getFullYear(),0,1):r=11===r.getMonth()?new Date(r.getFullYear()+1,0,1):new Date(r.getFullYear(),12,1)),"Month"===e&&("prevTimeSpan"===t?i=1===i.getDate()?new Date(i.getFullYear(),i.getMonth()-1,1):new Date(i.getFullYear(),i.getMonth(),1):r=new Date(r.getFullYear(),r.getMonth()+1,1)),"Week"===e){var n=this.parent.timelineModule.customTimelineSettings.weekStartDay,a=void 0;"prevTimeSpan"===t?(a=i.getDay()<n?7-(n-i.getDay()):i.getDay()-n,i.setHours(0,0,0,0),0===a?i.setDate(i.getDate()-7):i.setDate(i.getDate()-a)):(a=r.getDay()<n?n-r.getDay():7-r.getDay()+n,r.setHours(0,0,0,0),0===a?r.setDate(r.getDate()+6):r.setDate(r.getDate()+a))}"Day"===e&&("prevTimeSpan"===t?0===i.getHours()?i.setTime(i.getTime()-864e5):i.setHours(0):0===r.getHours()?r.setTime(r.getTime()+864e5):r.setHours(24)),"Hour"===e&&("prevTimeSpan"===t?0===i.getMinutes()?i.setTime(i.getTime()-36e5):i.setMinutes(0):0===r.getMinutes()?r.setTime(r.getTime()+36e5):r.setMinutes(60)),"Minutes"===e&&("prevTimeSpan"===t?0===i.getSeconds()?i.setTime(i.getTime()-6e4):i.setSeconds(0):0===r.getSeconds()?r.setTime(r.getTime()+6e4):r.setSeconds(60)),this.parent.cloneProjectStartDate=i,this.parent.cloneProjectEndDate=r},e.prototype.updateTimeLineOnEditing=function(e,t){if(e[0].length>=1)for(var n=0;n<e.length;n++){var s=e[n],o=s.filter(function(e){return!i.i(r.isNullOrUndefined)(e.ganttProperties.startDate)}),l=s.filter(function(e){return!i.i(r.isNullOrUndefined)(e.ganttProperties.endDate)}),d=o.length>0?new Date(a.DataUtil.aggregates.min(o,"ganttProperties.startDate")):null,h=l.length>0?new Date(a.DataUtil.aggregates.max(l,"ganttProperties.endDate")):null,p=new Date(this.parent.dataOperation.checkStartDate(this.timelineStartDate).getTime()),u=new Date(this.parent.dataOperation.checkEndDate(this.timelineEndDate).getTime()),c=i.i(r.isNullOrUndefined)(d)?null:this.parent.dataOperation.getTaskLeft(d,!1),g=i.i(r.isNullOrUndefined)(h)?null:this.parent.dataOperation.getTaskLeft(h,!1),f=this.parent.dataOperation.getTaskLeft(p,!1),m=this.parent.dataOperation.getTaskLeft(u,!1),y=void 0,D=this.parent.editModule.taskbarEditModule;!i.i(r.isNullOrUndefined)(c)&&(d<this.timelineStartDate||!i.i(r.isNullOrUndefined)(D)&&!i.i(r.isNullOrUndefined)(D.taskBarEditAction)&&"ProgressResizing"!==D.taskBarEditAction&&"RightResizing"!==D.taskBarEditAction)&&(c<this.bottomTierCellWidth||c<=f)?(y="prevTimeSpan",d=d>this.timelineStartDate?this.timelineStartDate:d):d=this.timelineStartDate,!i.i(r.isNullOrUndefined)(g)&&(g>=this.totalTimelineWidth-this.bottomTierCellWidth||g>=m)?(y="prevTimeSpan"===y?"both":"nextTimeSpan",h=h<this.timelineEndDate?this.timelineEndDate:h):h=this.timelineEndDate,y?this.performTimeSpanAction(y,t,d,h):i.i(r.isNullOrUndefined)(s[0].ganttProperties.segments)||this.parent.dataOperation.updateWidthLeft(s[0]);break}},e.prototype.performTimeSpanAction=function(e,t,n,a,s){s=i.i(r.isNullOrUndefined)(s)?"None"===this.parent.timelineModule.topTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier:s;var o=new Date(this.parent.cloneProjectStartDate.getTime()),l=new Date(this.parent.cloneProjectEndDate.getTime());"publicMethod"!==t&&"both"===e?(this.updateScheduleDatesByToolBar(s,"prevTimeSpan",n,a),this.updateScheduleDatesByToolBar(s,"nextTimeSpan",new Date(this.parent.cloneProjectStartDate.getTime()),a)):this.updateScheduleDatesByToolBar(s,e,n,a);var d=this.timeSpanActionEvent("actionBegin",e,t);if(d.cancel)this.parent.cloneProjectStartDate=o,this.parent.cloneProjectEndDate=l;else{if(this.parent.updateProjectDates(d.projectStartDate,d.ProjectEndDate,d.isTimelineRoundOff,t),"prevTimeSpan"===e&&"publicMethod"===t)this.parent.ganttChartModule.updateScrollLeft(0),this.parent.timelineModule.isZoomToFit=!1;else if("nextTimeSpan"===e&&"publicMethod"===t)this.parent.ganttChartModule.updateScrollLeft(this.parent.timelineModule.totalTimelineWidth),this.parent.timelineModule.isZoomToFit=!1;else if("nextTimeSpan"===e&&"TaskbarEditing"===t){var h=document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollLeft;this.parent.element.querySelector(".e-timeline-header-container").scrollLeft=h,this.parent.timelineModule.isZoomToFit=!1}this.parent.timelineModule.timeSpanActionEvent("actionComplete",e,t)}},e.prototype.timeSpanActionEvent=function(e,t,i){var r={};return r.projectStartDate=new Date(this.parent.cloneProjectStartDate.getTime()),r.ProjectEndDate=new Date(this.parent.cloneProjectEndDate.getTime()),r.requestType="publicMethod"===i?t:"beforeAdd"===i?"TimelineRefreshOnAdd":"TaskbarEditing"===i?"TimelineRefreshOnEdit":t,"actionBegin"===e&&(r.isTimelineRoundOff=this.parent.isTimelineRoundOff,r.cancel=!1),r.action="TimescaleUpdate",this.parent.trigger(e,r),r},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(9),n=(i.n(r),i(1)),a=i(3),s=i(0),o=(i.n(s),i(4)),l=(i.n(o),function(){function e(e){this.parent=e,this.createTooltip(),this.parent.on("destroy",this.destroy,this)}return e.prototype.createTooltip=function(){this.toolTipObj=new r.Tooltip,this.toolTipObj.target=".e-header-cell-label, .e-gantt-child-taskbar,.e-gantt-parent-taskbar, .e-gantt-milestone, .e-gantt-unscheduled-taskbar.e-event-markers, .e-baseline-bar, .e-event-markers,.e-connector-line-container, .e-indicator-span, .e-notes-info, .e-gantt-manualparent-milestone,.e-taskbar-left-resizer, .e-taskbar-right-resizer, .e-baseline-gantt-milestone, .e-gantt-manualparenttaskbar",this.toolTipObj.position="BottomCenter",this.toolTipObj.openDelay=700,this.toolTipObj.enableRtl=this.parent.enableRtl,this.toolTipObj.enableHtmlSanitizer=this.parent.enableHtmlSanitizer,this.toolTipObj.cssClass=a._8,this.toolTipObj.animation={open:{effect:"None",delay:0},close:{effect:"None",delay:0}},this.toolTipObj.afterOpen=this.updateTooltipPosition.bind(this),this.toolTipObj.showTipPointer=!1,this.toolTipObj.beforeRender=this.tooltipBeforeRender.bind(this),this.toolTipObj.afterClose=this.tooltipCloseHandler.bind(this),this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.element)},e.prototype.tooltipBeforeRender=function(e){var t=this.parent;if(t.isOnEdit)return void(e.cancel=!0);var r,l=i.i(s.closest)(e.target,"div."+a.D);r=i.i(s.isNullOrUndefined)(l)?i.i(n.j)(e.target,a._20):e.target;var d,h={data:{},args:e,cancel:!1,content:""};if(e.target.classList.contains("e-header-cell-label"))t.timelineSettings.showTooltip?h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("timeline",d,t,e):e.cancel=!0;else if(t.tooltipSettings.showTooltip)if(r&&(h.data=t.ganttChartModule.getRecordByTaskBar(r),d=h.data),e.target.classList.contains("e-gantt-child-taskbar")||e.target.classList.contains("e-gantt-parent-taskbar")||e.target.classList.contains("e-gantt-milestone")||e.target.classList.contains("e-gantt-unscheduled-taskbar")||e.target.classList.contains("e-taskbar-left-resizer")||e.target.classList.contains("e-taskbar-right-resizer")||e.target.classList.contains("e-gantt-manualparenttaskbar")&&t.tooltipSettings.taskbar){var p=void 0;t.tooltipSettings.taskbar&&(p=t.tooltipModule.templateCompiler(t.tooltipSettings.taskbar,t,d,"TooltipTaskbarTemplate"));var u=document.createElement("div");p&&i.i(s.append)(p,u),h.content=this.toolTipObj.content=p?u:d?t.tooltipModule.getTooltipContent(d.ganttProperties.isMilestone?"milestone":"taskbar",d,t,e):""}else if(e.target.classList.contains("e-baseline-bar")||e.target.classList.contains("e-baseline-gantt-milestone")){var c=void 0;t.tooltipSettings.baseline&&(c=t.tooltipModule.templateCompiler(t.tooltipSettings.baseline,t,d,"TooltipBaselineTemplate"));var g=document.createElement("div");c&&i.i(s.append)(c,g),h.content=this.toolTipObj.content=c?g:d?t.tooltipModule.getTooltipContent(d.ganttProperties.isMilestone?"milestone":"baseline",d,t,e):""}else if(e.target.classList.contains("e-event-markers"))h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("marker",d,t,e);else if(e.target.classList.contains("e-connector-line-container")){var f=void 0;t.tooltipModule.predecessorTooltipData=t.tooltipModule.getPredecessorTooltipData(e),h.data=this.predecessorTooltipData,t.tooltipSettings.connectorLine&&(f=t.tooltipModule.templateCompiler(t.tooltipSettings.connectorLine,t,t.tooltipModule.predecessorTooltipData,"TooltipConnectorLineTemplate")),h.content=this.toolTipObj.content=f?f[0]:t.tooltipModule.getTooltipContent("connectorLine",d,t,e)}else if(e.target.classList.contains("e-indicator-span"))h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("indicator",d,t,e),i.i(s.isNullOrUndefined)(h.content)&&(e.cancel=!0);else if(e.target.classList.contains("e-notes-info")){var m=this.parent.ganttChartModule.getRecordByTarget(e.event);h.content=this.toolTipObj.content=m.ganttProperties.notes,i.i(s.isNullOrUndefined)(h.content)&&(e.cancel=!0)}else e.target.classList.contains("e-gantt-manualparenttaskbar")?(h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("manualtaskbar",d,t,e),i.i(s.isNullOrUndefined)(h.content)&&(e.cancel=!0)):e.target.classList.contains("e-gantt-manualparent-milestone")&&(h.content=this.toolTipObj.content=t.tooltipModule.getTooltipContent("manualmilestone",d,t,e),i.i(s.isNullOrUndefined)(h.content)&&(e.cancel=!0));else e.cancel=!0;if(!1===e.cancel){var y=new o.Deferred;return t.trigger("beforeTooltipRender",h,function(t){y.resolve(t),t.cancel&&(e.cancel=!0)}),this.toolTipObj.content=h.content,this.parent.isAdaptive||"mouseover"!==e.event.type||(this.currentTarget=e.target,s.EventHandler.add(this.currentTarget,"mousemove",this.mouseMoveHandler.bind(this))),this.parent.renderTemplates(),y}},e.prototype.tooltipCloseHandler=function(e){this.tooltipMouseEvent=null,this.parent.isAdaptive||i.i(s.isNullOrUndefined)(this.currentTarget)||s.EventHandler.remove(this.currentTarget,"mousemove",this.mouseMoveHandler),this.currentTarget=null},e.prototype.mouseMoveHandler=function(e){this.tooltipMouseEvent=e},e.prototype.updateTooltipPosition=function(e){e.element.style.visibility="visible";var t=this.parent.element.closest('[style*="zoom"]');if(i.i(s.isNullOrUndefined)(t)){if(i.i(s.isNullOrUndefined)(this.tooltipMouseEvent)||e.target.classList.contains("e-notes-info"))return;var r=this.getPointorPosition(this.tooltipMouseEvent),n=this.parent.getOffsetRect(this.parent.chartPane),a=n.top+this.parent.chartPane.offsetHeight,o=n.left+this.parent.chartPane.offsetWidth,l=r.x,d=r.y;if(o<l+e.element.offsetWidth+10)for(;o<l+e.element.offsetWidth+10;)l=o-e.element.offsetWidth-10,e.element.style.left=l+"px";else l+=10,e.element.style.left=l+"px";window.innerHeight<e.element.offsetHeight+d&&(d=d-e.element.offsetHeight-10),a<d+e.element.offsetHeight+20?d=d-e.element.offsetHeight-10:d+=10,e.element.style.top=d+"px"}},e.prototype.getPointorPosition=function(e){var t,r;return i.i(s.isNullOrUndefined)(i.i(s.getValue)("pageX",e))&&i.i(s.isNullOrUndefined)(i.i(s.getValue)("pageY",e))?i.i(s.isNullOrUndefined)(i.i(s.getValue)("clientX",e))&&i.i(s.isNullOrUndefined)(i.i(s.getValue)("clientY",e))||(t=i.i(s.getValue)("clientX",e)+document.body.scrollLeft+document.documentElement.scrollLeft,r=i.i(s.getValue)("clientY",e)+document.body.scrollTop+document.documentElement.scrollTop):(t=i.i(s.getValue)("pageX",e),r=i.i(s.getValue)("pageY",e)),{x:t,y:r}},e.prototype.getTooltipContent=function(e,t,r,n){var a,o,l;if(t){o=t.ganttProperties;var d=o.taskName;this.parent.enableHtmlSanitizer&&"string"==typeof d&&(d=s.SanitizeHtmlHelper.sanitize(d)),l=i.i(s.isNullOrUndefined)(d)?"":'<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">'+(this.parent.disableHtmlEncode?d.replace(/</g,"<").replace(/>/g,">"):d)+"</td></tr>"}switch(e){case"milestone":var h=void 0;n.target.className.includes("e-baseline-gantt-milestone")&&!i.i(s.isNullOrUndefined)(o.baselineStartDate)?h=o.baselineStartDate:i.i(s.isNullOrUndefined)(o.startDate)||(h=o.startDate);var p=this.parent.getFormatedDate(h,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&"string"==typeof p&&(p=s.SanitizeHtmlHelper.sanitize(p));var u=i.i(s.isNullOrUndefined)(h)?"":'<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+p+"</td></tr>",c=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+u+"</tbody></table>"};a=i.i(s.initializeCSPTemplate)(c);break;case"taskbar":var g=!(t.hasChildRecords&&!o.isAutoSchedule),f=this.parent.getFormatedDate(g?o.startDate:o.autoStartDate,this.parent.getDateFormat()),m=this.parent.getFormatedDate(g?o.endDate:o.autoEndDate,this.parent.getDateFormat()),y=this.parent.getDurationString(g?o.duration:o.autoDuration,o.durationUnit),D=o.progress;this.parent.enableHtmlSanitizer&&(f="string"==typeof f?s.SanitizeHtmlHelper.sanitize(f):f,m="string"==typeof m?s.SanitizeHtmlHelper.sanitize(m):m,y="string"==typeof y?s.SanitizeHtmlHelper.sanitize(y):y,D="string"==typeof D?s.SanitizeHtmlHelper.sanitize(D):D);var v=o.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(g?"startDate":"subTasksStartDate")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value"> '+f+"</td></tr>":"",w=o.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(g?"endDate":"subTasksEndDate")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value">'+m+"</td></tr>":"",k=i.i(s.isNullOrUndefined)(o.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td style="padding: 2px;">:</td><td class = "e-gantt-tooltip-value"> '+y+"</td></tr>",b=i.i(s.isNullOrUndefined)(o.progress)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+'</td><td style="padding: 2px;">:</td><td>'+D+"</td></tr>",T=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+v+w+k+b+"</tbody></table>"};a=i.i(s.initializeCSPTemplate)(T);break;case"baseline":var S=this.parent.getFormatedDate(o.baselineStartDate,this.parent.getDateFormat()),P=this.parent.getFormatedDate(o.baselineEndDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(S="string"==typeof S?s.SanitizeHtmlHelper.sanitize(S):S,P="string"==typeof P?s.SanitizeHtmlHelper.sanitize(P):P);var C=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+S+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+P+"</td></tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(C,this);break;case"marker":var M=r.tooltipModule.getMarkerTooltipData(n),R=this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(M.day),this.parent.getDateFormat()),x=M.label?M.label:"";this.parent.enableHtmlSanitizer&&(x="string"==typeof x?s.SanitizeHtmlHelper.sanitize(x):x,R="string"==typeof R?s.SanitizeHtmlHelper.sanitize(R):R);var O=function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr><td>'+R+"</td></tr><tr><td>"+(this.parent.disableHtmlEncode?x.replace(/</g,"<").replace(/>/g,">"):x)+"</td></tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(O,this);break;case"connectorLine":var I=r.tooltipModule.predecessorTooltipData.fromName,E=r.tooltipModule.predecessorTooltipData.fromId,F=r.tooltipModule.predecessorTooltipData.toName,N=r.tooltipModule.predecessorTooltipData.toId,U=r.tooltipModule.predecessorTooltipData.linkText,V=r.tooltipModule.predecessorTooltipData.offsetString;this.parent.enableHtmlSanitizer&&(I="string"==typeof I?s.SanitizeHtmlHelper.sanitize(I):I,E="string"==typeof E?s.SanitizeHtmlHelper.sanitize(E):E,F="string"==typeof F?s.SanitizeHtmlHelper.sanitize(F):F,N="string"==typeof N?s.SanitizeHtmlHelper.sanitize(N):N,U="string"==typeof U?s.SanitizeHtmlHelper.sanitize(U):U,V="string"==typeof V?s.SanitizeHtmlHelper.sanitize(V):V);var L=function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("from")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?I.replace(/</g,"<").replace(/>/g,">"):I)+" ("+(this.parent.disableHtmlEncode&&"string"==typeof E?E.replace(/</g,"<").replace(/>/g,">"):E)+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("to")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?F.replace(/</g,"<").replace(/>/g,">"):F)+" ("+N+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("taskLink")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+U+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("lag")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+V+"</td></tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(L,this);break;case"indicator":if(n.target.title.length){var B=n.target.title;this.parent.enableHtmlSanitizer&&"string"==typeof B&&(B=s.SanitizeHtmlHelper.sanitize(B));var A=function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr>'+B+"</tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(A)}break;case"timeline":var H=n.target.title;this.parent.enableHtmlSanitizer&&"string"==typeof H&&(H=s.SanitizeHtmlHelper.sanitize(H));var j=function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr>'+H+"</tr></tbody></table>"};a=i.i(s.initializeCSPTemplate)(j);break;case"manualtaskbar":var W=this.parent.getFormatedDate(o.autoStartDate,this.parent.getDateFormat()),_=this.parent.getFormatedDate(o.autoEndDate,this.parent.getDateFormat()),q=this.parent.getDurationString(o.duration,o.durationUnit),G=this.parent.getFormatedDate(o.startDate,this.parent.getDateFormat()),z=this.parent.getFormatedDate(o.endDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(W="string"==typeof W?s.SanitizeHtmlHelper.sanitize(W):W,_="string"==typeof _?s.SanitizeHtmlHelper.sanitize(_):_,q="string"==typeof q?s.SanitizeHtmlHelper.sanitize(q):q,G="string"==typeof G?s.SanitizeHtmlHelper.sanitize(G):G,z="string"==typeof z?s.SanitizeHtmlHelper.sanitize(z):z);var X=o.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+W+"</td></tr>":"",Y=o.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+_+"</td></tr>":"",Z=i.i(s.isNullOrUndefined)(o.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+q+"</td></tr>",Q=o.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+G+"</td></tr>":"",K=o.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+z+"</td></tr>":"",J=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+Q+X+K+Y+Z+"</tbody></table>"};a=i.i(s.initializeCSPTemplate)(J);break;case"manualmilestone":var $=this.parent.getFormatedDate(o.autoStartDate,this.parent.getDateFormat()),ee=this.parent.getFormatedDate(o.autoEndDate,this.parent.getDateFormat()),te=this.parent.getFormatedDate(o.startDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&($="string"==typeof $?s.SanitizeHtmlHelper.sanitize($):$,ee="string"==typeof ee?s.SanitizeHtmlHelper.sanitize(ee):ee,te="string"==typeof te?s.SanitizeHtmlHelper.sanitize(te):te);var ie=o.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+$+"</td></tr>":"",re=o.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+ee+"</td></tr>":"",ne='<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+te+"</tr>",ae=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+l+ne+ie+re+"</tbody></table>"};a=i.i(s.initializeCSPTemplate)(ae)}return a},e.prototype.getMarkerTooltipData=function(e){var t=e.target.id.match(/\d+/g);return this.parent.eventMarkers[Number(t)]},e.prototype.getPredecessorTooltipData=function(e){var t=e.target.id;this.parent.enableHtmlSanitizer&&"string"==typeof t&&(t=s.SanitizeHtmlHelper.sanitize(t));var i=t.match(/ConnectorLineparent(.*)child(.*)/);i.shift();var r,n;"ResourceView"===this.parent.viewType?(r=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i[0])],n=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i[1])]):(r=this.parent.flatData[this.parent.ids.indexOf(i[0])],n=this.parent.flatData[this.parent.ids.indexOf(i[1])]);var a=r.ganttProperties.predecessor.filter(function(e){return e.to===i[1]});return{fromId:"ResourceView"===this.parent.viewType?r.ganttProperties.taskId:r.ganttProperties.rowUniqueID,toId:"ResourceView"===this.parent.viewType?n.ganttProperties.taskId:n.ganttProperties.rowUniqueID,fromName:r.ganttProperties.taskName,toName:n.ganttProperties.taskName,linkType:a[0].type,linkText:this.parent.getPredecessorTextValue(a[0].type),offset:a[0].offset,offsetUnit:a[0].offsetUnit,offsetString:this.parent.getDurationString(a[0].offset,a[0].offsetUnit)}},e.prototype.templateCompiler=function(e,t,r,n){var a=t.chartRowsModule.templateCompiler(e),o=t.chartRowsModule.getTemplateID(n);return a(i.i(s.extend)({index:0},r),t,n,o,!0)},e.prototype.destroy=function(){this.toolTipObj.destroy()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){this.parent=e}return e.prototype.renderWrapper=function(){this.wrapper=i.i(r.createElement)("div",{className:"e-virtualtable",styles:"position: absolute; transform: translate(0px, 0px);"}),this.parent.ganttChartModule.scrollElement.appendChild(this.wrapper),this.virtualTrack=i.i(r.createElement)("div",{className:"e-virtualtrack",styles:"position: relative; pointer-events: none; width: 100%;"}),this.parent.ganttChartModule.scrollElement.appendChild(this.virtualTrack),this.wrapper.appendChild(this.parent.ganttChartModule.chartBodyContent)},e.prototype.appendChildElements=function(e){this.wrapper.appendChild(e)},e.prototype.adjustTable=function(){var e=this.parent.treeGrid.getContent().querySelector(".e-content").querySelector(".e-virtualtable");this.parent.ganttChartModule.virtualRender.wrapper.style.transform=e.style.transform},e}())},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(22);i.d(t,"Gantt",function(){return r.a}),i.d(t,"PdfHorizontalOverflowType",function(){return r.b}),i.d(t,"parentsUntil",function(){return r.c}),i.d(t,"isScheduledTask",function(){return r.d}),i.d(t,"isCountRequired",function(){return r.e}),i.d(t,"getSwapKey",function(){return r.f}),i.d(t,"isRemoteData",function(){return r.g}),i.d(t,"getTaskData",function(){return r.h}),i.d(t,"updateDates",function(){return r.i}),i.d(t,"formatString",function(){return r.j}),i.d(t,"getIndex",function(){return r.k}),i.d(t,"pixelToPoint",function(){return r.l}),i.d(t,"pointToPixel",function(){return r.m}),i.d(t,"getUid",function(){return r.n}),i.d(t,"load",function(){return r.o}),i.d(t,"rowDataBound",function(){return r.p}),i.d(t,"queryCellInfo",function(){return r.q}),i.d(t,"toolbarClick",function(){return r.r}),i.d(t,"keyPressed",function(){return r.s}),i.d(t,"Edit",function(){return r.t}),i.d(t,"Reorder",function(){return r.u}),i.d(t,"Resize",function(){return r.v}),i.d(t,"Filter",function(){return r.w}),i.d(t,"Sort",function(){return r.x}),i.d(t,"Dependency",function(){return r.y}),i.d(t,"Selection",function(){return r.z}),i.d(t,"Toolbar",function(){return r.A}),i.d(t,"DayMarkers",function(){return r.B}),i.d(t,"CriticalPath",function(){return r.C}),i.d(t,"ContextMenu",function(){return r.D}),i.d(t,"ExcelExport",function(){return r.E}),i.d(t,"ColumnMenu",function(){return r.F}),i.d(t,"RowDD",function(){return r.G}),i.d(t,"PdfExport",function(){return r.H}),i.d(t,"VirtualScroll",function(){return r.I}),i.d(t,"Column",function(){return r.J}),i.d(t,"DayWorkingTime",function(){return r.K}),i.d(t,"AddDialogFieldSettings",function(){return r.L}),i.d(t,"EditDialogFieldSettings",function(){return r.M}),i.d(t,"EditSettings",function(){return r.N}),i.d(t,"EventMarker",function(){return r.O}),i.d(t,"FilterSettings",function(){return r.P}),i.d(t,"SearchSettings",function(){return r.Q}),i.d(t,"Holiday",function(){return r.R}),i.d(t,"LabelSettings",function(){return r.S}),i.d(t,"SelectionSettings",function(){return r.T}),i.d(t,"SplitterSettings",function(){return r.U}),i.d(t,"TaskFields",function(){return r.V}),i.d(t,"TimelineTierSettings",function(){return r.W}),i.d(t,"TimelineSettings",function(){return r.X}),i.d(t,"TooltipSettings",function(){return r.Y}),i.d(t,"SortDescriptor",function(){return r.Z}),i.d(t,"SortSettings",function(){return r._0}),i.d(t,"ResourceFields",function(){return r._1}),i.d(t,"LoadingIndicator",function(){return r._2}),i.d(t,"TemporaryDictionary",function(){return r._3}),i.d(t,"PdfBorders",function(){return r._4}),i.d(t,"PdfPaddings",function(){return r._5}),i.d(t,"PdfTreeGridStyleBase",function(){return r._6}),i.d(t,"PdfTreeGridStyle",function(){return r._7}),i.d(t,"PdfGanttTheme",function(){return r._8}),i.d(t,"PdfTreeGridLayouter",function(){return r._9}),i.d(t,"PdfTreeGridLayoutResult",function(){return r._10}),i.d(t,"PdfTreeGridLayoutFormat",function(){return r._11}),i.d(t,"PdfTreeGridCell",function(){return r._12}),i.d(t,"PdfTreeGridCellCollection",function(){return r._13}),i.d(t,"PdfTreeGridRow",function(){return r._14}),i.d(t,"PdfTreeGridRowCollection",function(){return r._15}),i.d(t,"PdfTreeGridHeaderCollection",function(){return r._16}),i.d(t,"PdfTreeGridColumn",function(){return r._17}),i.d(t,"PdfTreeGridColumnCollection",function(){return r._18})},function(e,t){e.exports=h},function(e,t){e.exports=p},function(e,t){e.exports=u},function(e,t){e.exports=c}])});
|