@syncfusion/ej2-gantt 20.2.36 → 20.2.43
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 +32 -0
- package/dist/ej2-gantt.umd.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +84 -24
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +84 -24
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +2 -2
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +18 -18
- package/src/gantt/actions/context-menu.js +1 -1
- package/src/gantt/actions/edit.js +2 -1
- package/src/gantt/actions/rowdragdrop.js +8 -2
- package/src/gantt/base/date-processor.js +9 -3
- package/src/gantt/base/gantt-chart.d.ts +4 -0
- package/src/gantt/base/gantt-chart.js +22 -1
- package/src/gantt/base/tree-grid.js +1 -0
- package/src/gantt/renderer/chart-rows.js +6 -0
- package/src/gantt/renderer/timeline.d.ts +1 -0
- package/src/gantt/renderer/timeline.js +34 -15
- package/src/gantt/renderer/tooltip.js +1 -1
- package/styles/fluent-dark.css +8 -8
- package/styles/gantt/fluent-dark.css +8 -8
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-gantt.umd.min.js
|
|
3
|
-
* version : 20.2.
|
|
3
|
+
* version : 20.2.43
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-treegrid"),require("@syncfusion/ej2-layouts"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-richtexteditor"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-grids","@syncfusion/ej2-data","@syncfusion/ej2-treegrid","@syncfusion/ej2-layouts","@syncfusion/ej2-navigations","@syncfusion/ej2-richtexteditor","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-calendars","@syncfusion/ej2-dropdowns","@syncfusion/ej2-pdf-export"],t):t(e.ej={},e.ej2Base,e.ej2Popups,e.ej2Grids,e.ej2Data,e.ej2Treegrid,e.ej2Layouts,e.ej2Navigations,e.ej2Richtexteditor,e.ej2Inputs,e.ej2Buttons,e.ej2Calendars,e.ej2Dropdowns,e.ej2PdfExport)}(this,function(e,t,i,r,n,a,s,o,l,d,p,h,c,u){"use strict";function g(e,t,i){for(var r=e;r&&(i?r.id!==t:!r.classList.contains(t));)r=r.parentElement;return r}function f(e){return t.isNullOrUndefined(e.startDate)&&t.isNullOrUndefined(e.endDate)&&t.isNullOrUndefined(e.duration)?null:!(t.isNullOrUndefined(e.startDate)||t.isNullOrUndefined(e.endDate)||t.isNullOrUndefined(e.duration))}function m(e){return!(!e.dataSource||e.dataSource instanceof n.DataManager||!("result"in e.dataSource))}function y(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 v(e){if(e instanceof n.DataManager){var t=e.adaptor;return t instanceof n.ODataAdaptor||t instanceof n.ODataV4Adaptor||t instanceof n.WebApiAdaptor||t instanceof n.WebMethodAdaptor||t instanceof n.CacheAdaptor||t instanceof n.RemoteSaveAdaptor||t instanceof n.UrlAdaptor}return!1}function D(e,i,r,n){if(r){for(var a=void 0,s=0;s<e.length;s++){var o=void 0;a=o=i?e[s].taskData:t.extend({},e[s].taskData,{},!0)}return a}for(a=[],s=0;s<e.length;s++){o=void 0;!t.isNullOrUndefined(n)&&n.timezone&&w(e[s],n),o=i?e[s].taskData:t.extend({},e[s].taskData,{},!0),a.push(o)}return a}function w(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 k(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 T(e,i,r,n){for(var a=-1,s=0;s<r.length;s++)if(t.getValue(i,r[s])===t.getValue(i,e)&&t.isNullOrUndefined(n)||!t.isNullOrUndefined(n)&&t.getValue(i,r[s])===t.getValue(i,e)&&t.getValue(n,r[s])===t.getValue(n,e)){a=s;break}return a}function S(e){return 76*e/92}function b(e){return 92*e/76}function P(){return C++}var C=0,M=function(){function e(e){this.parent=e}return e.prototype.isValidateNonWorkDays=function(e){return!t.isNullOrUndefined(e)&&e.isAutoSchedule&&(!this.parent.includeWeekend||this.parent.totalHolidayDates.length>0)||t.isNullOrUndefined(e)&&(!this.parent.includeWeekend||this.parent.totalHolidayDates.length>0)},e.prototype.checkStartDate=function(e,i,r,n){if(t.isNullOrUndefined(e))return null;var a=new Date(e.getTime()),s=this.getSecondsInDecimal(a);if(r=t.isNullOrUndefined(r)?!t.isNullOrUndefined(i)&&i.isMilestone:r,s<this.parent.defaultStartTime&&(!r||n))this.setTime(this.parent.defaultStartTime,a);else if(s<this.parent.defaultStartTime&&r)this.setTime(this.parent.defaultEndTime,a);else if(s===this.parent.defaultEndTime&&(!i||!r)||s>this.parent.defaultEndTime)a.setDate(a.getDate()+1),this.setTime(this.parent.defaultStartTime,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){(s!==l.to||i&&r)&&s===l.to||this.setTime(this.parent.workingTimeRanges[o+1].from,a);break}}var d;do{d=new Date(a.getTime());var p=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(i)){var h=!r||n?this.parent.defaultStartTime:this.parent.defaultEndTime;if(!this.parent.includeWeekend){var c=new Date(a.getTime());a=this.getNextWorkingDay(a),c.getTime()!==a.getTime()&&this.setTime(h,a)}for(var u=0;u<p;u++){var g=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[u])),f=new Date(g.getTime());g.setHours(0,0,0,0),f.setHours(23,59,59,59),a.getTime()>=g.getTime()&&a.getTime()<f.getTime()&&(a.setDate(a.getDate()+1),this.setTime(h,a))}}}while(d.getTime()!==a.getTime());return new Date(a.getTime())},e.prototype.checkEndDate=function(e,i,r){if(t.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&&!r)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++){if(a>this.parent.workingTimeRanges[s].to&&this.parent.workingTimeRanges[s+1]&&a<=this.parent.workingTimeRanges[s+1].from){this.setTime(this.parent.workingTimeRanges[s].to,n);break}}var o;do{o=new Date(n.getTime());var l=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(i)){if(!this.parent.includeWeekend){var d=new Date(n.getTime());n=this.getPreviousWorkingDay(n),d.getTime()!==n.getTime()&&this.setTime(this.parent.defaultEndTime,n)}for(var p=0;p<l;p++){var h=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[p])),c=new Date(h.getTime()),u=new Date(n.getTime());u.setMinutes(n.getMilliseconds()-2),h.setHours(0,0,0,0),c.setHours(23,59,59,59),(n.getTime()>=h.getTime()&&n.getTime()<c.getTime()||u.getTime()>=h.getTime()&&u.getTime()<c.getTime())&&(n.setDate(n.getDate()-1),n.getTime()===h.getTime()&&86400===this.parent.defaultEndTime&&0===this.getSecondsInDecimal(n)||this.setTime(this.parent.defaultEndTime,n))}}}while(o.getTime()!==n.getTime());return new Date(n.getTime())},e.prototype.checkBaselineStartDate=function(e){if(t.isNullOrUndefined(e))return null;var i=new Date(e.getTime()),r=this.getSecondsInDecimal(i);if(r<this.parent.defaultStartTime)this.setTime(this.parent.defaultStartTime,i);else if(r>=this.parent.defaultEndTime)i.setDate(i.getDate()+1),this.setTime(this.parent.defaultStartTime,i);else if(r>this.parent.defaultStartTime&&r<this.parent.defaultEndTime)for(var n=0;n<this.parent.workingTimeRanges.length;n++){if(r>=this.parent.workingTimeRanges[n].to&&this.parent.workingTimeRanges[n+1]&&r<this.parent.workingTimeRanges[n+1].from){this.setTime(this.parent.workingTimeRanges[n+1].from,i);break}}return i},e.prototype.checkBaselineEndDate=function(e,i){if(t.isNullOrUndefined(e))return null;var r=new Date(e.getTime()),n=this.getSecondsInDecimal(r);if(n>this.parent.defaultEndTime)this.setTime(this.parent.defaultEndTime,r);else if(n<=this.parent.defaultStartTime&&!i.isMilestone)r.setDate(r.getDate()-1),this.setTime(this.parent.defaultEndTime,r);else if(n>this.parent.defaultStartTime&&n<this.parent.defaultEndTime)for(var a=0;a<this.parent.workingTimeRanges.length;a++){if(n>this.parent.workingTimeRanges[a].to&&this.parent.workingTimeRanges[a+1]&&n<=this.parent.workingTimeRanges[a+1].from){this.setTime(this.parent.workingTimeRanges[a].to,r);break}}return r},e.prototype.calculateStartDate=function(e){var i=e.ganttProperties,r=null;t.isNullOrUndefined(i.endDate)||t.isNullOrUndefined(i.duration)||(r=this.getStartDate(i.endDate,i.duration,i.durationUnit,i)),this.parent.setRecordValue("startDate",r,i,!0),this.parent.taskFields.startDate&&this.parent.dataOperation.updateMappingData(e,"startDate")},e.prototype.calculateEndDate=function(e){var i=e.ganttProperties,r=null;if(!t.isNullOrUndefined(i.startDate)){if(!t.isNullOrUndefined(i.endDate)&&t.isNullOrUndefined(i.duration)&&(1===this.compareDates(i.startDate,i.endDate)&&(this.parent.setRecordValue("startDate",new Date(i.endDate.getTime()),i,!0),this.setTime(this.parent.defaultStartTime,i.startDate)),this.calculateDuration(e)),!t.isNullOrUndefined(i.duration)){var n=!t.isNullOrUndefined(i.segments)&&i.segments.length>0?this.totalDuration(i.segments):i.duration;r=this.getEndDate(i.startDate,n,i.durationUnit,i,!1)}this.parent.setRecordValue("endDate",r,i,!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 i,r=e.ganttProperties;i=!t.isNullOrUndefined(r.segments)&&r.segments.length>0&&!t.isNullOrUndefined(this.parent.editModule.taskbarEditModule)?this.parent.editModule.taskbarEditModule.sumOfDuration(r.segments):t.isNullOrUndefined(r.startDate)||t.isNullOrUndefined(r.endDate)||r.startDate.getTime()!==r.endDate.getTime()||t.isNullOrUndefined(e.taskData[this.parent.taskFields.milestone])?this.getDuration(r.startDate,r.endDate,r.durationUnit,r.isAutoSchedule,r.isMilestone):1,this.parent.setRecordValue("duration",i,r,!0);var n=this.parent.columnByField[this.parent.columnMapping.duration];if(!(t.isNullOrUndefined(this.parent.editModule)||t.isNullOrUndefined(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isCellEdit||t.isNullOrUndefined(n))){if(!t.isNullOrUndefined(n.edit)&&!t.isNullOrUndefined(n.edit.read)){var a=this.parent.editModule.dialogModule.dialog;if(!t.isNullOrUndefined(a)){var s=a.querySelector("#"+this.parent.element.id+"Duration").ej2_instances[0];t.isNullOrUndefined(s)||s.value===i.toString()||(s.value=i.toString(),s.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,i,r,n){n=!!t.isNullOrUndefined(n)||n;var a=!this.parent.includeWeekend&&r?this.getWeekendCount(e,i):0,s=this.getNumberOfSeconds(e,i,n),o=r?this.getHolidaysCount(e,i):0,l=(s-86400*a-86400*o)/86400,d=this.getNonWorkingSecondsOnDate(e,i,r);return l*(86400-this.parent.secondsPerDay)+86400*a+86400*o+d},e.prototype.getDuration=function(e,i,r,n,a,s){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))return null;s=!!t.isNullOrUndefined(s)||s;var o=0,l=this.getTimeDifference(e,i,s)/1e3-this.getNonworkingTime(e,i,n,s);return o=a&&this.parent.getFormatedDate(e)===this.parent.getFormatedDate(i)?0:r&&"day"!==r?"minute"===r?l/60:l/3600:l/this.parent.secondsPerDay,parseFloat(o.toString())},e.prototype.getDurationAsSeconds=function(e,t){return t&&"day"!==t?"hour"===t?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);o>0;)s.setSeconds(s.getSeconds()+o),(o-=o-this.getNonworkingTime(a,s,r.isAutoSchedule,!0))>0&&(s=this.checkStartDate(s,r,n)),a=new Date(s.getTime());return s},e.prototype.getStartDate=function(e,t,i,r){for(var n=new Date(e.getTime()),a=new Date(e.getTime()),s=this.getDurationAsSeconds(t,i);s>0;)a.setSeconds(a.getSeconds()-s),(s-=s-this.getNonworkingTime(a,n,r.isAutoSchedule,!0))>0&&(n=this.checkEndDate(a,r)),n=new Date(a.getTime());return a},e.prototype.getProjectStartDate=function(e,i){if(!t.isNullOrUndefined(this.parent.cloneProjectStartDate)){var r=this.checkStartDate(this.parent.cloneProjectStartDate);return this.parent.cloneProjectStartDate=r,new Date(r.getTime())}if(t.isNullOrUndefined(this.parent.projectStartDate)){if(t.isNullOrUndefined(i))return null;var n=this.parent.flatData,a=void 0;n.length>0?a=n[0].ganttProperties.startDate:(a=new Date).setHours(0,0,0,0);for(var s=1;s<n.length;s++){var o=n[s].ganttProperties.startDate;t.isNullOrUndefined(o)||-1!==this.compareDates(o,a)||(a=o)}this.parent.cloneProjectStartDate=this.checkStartDate(a,e)}else{r=this.getDateFromFormat(this.parent.projectStartDate);this.parent.cloneProjectStartDate=this.checkStartDate(r)}return new Date(this.parent.cloneProjectStartDate.getTime())},e.prototype.getValidStartDate=function(e,i){var r=null,n=i?e.autoStartDate:e.startDate,a=i?e.autoEndDate:e.endDate,s=!e.isAutoSchedule&&e.autoDuration?e.autoDuration:e.duration;return t.isNullOrUndefined(n)?t.isNullOrUndefined(a)?t.isNullOrUndefined(s)||(r=this.getProjectStartDate(e)):(r=new Date(a.getTime()),this.setTime(this.parent.defaultStartTime,r)):r=new Date(n.getTime()),r},e.prototype.getValidEndDate=function(e,i){var r=null,n=i?e.autoStartDate:e.startDate,a=i?e.autoEndDate:e.endDate,s=i?e.autoDuration:e.duration;if(t.isNullOrUndefined(a))if(t.isNullOrUndefined(n)){if(!t.isNullOrUndefined(s)){var o=this.getValidStartDate(e);o&&(r=this.getEndDate(o,s,e.durationUnit,e,!1))}}else e.isMilestone?r=this.checkStartDate(n):(r=new Date(n.getTime()),this.setTime(this.parent.defaultEndTime,r));else r=new Date(a.getTime());return r},e.prototype.getSecondsPerDay=function(){var e=this.parent.dayWorkingTime,i=e.length,r=0,n=new Date("10/11/2018");this.parent.nonWorkingHours=[];var a=this.parent.nonWorkingHours;this.parent.workingTimeRanges=[];var s=this.parent.workingTimeRanges;this.parent.nonWorkingTimeRanges=[];for(var o=this.parent.nonWorkingTimeRanges,l=0;l<i;l++){var d=e[l];if(!t.isNullOrUndefined(d.from)&&!t.isNullOrUndefined(d.to)){n.setHours(0,0,0,0);var p=new Date(n.getTime());n.setTime(n.getTime()+36e5*d.from);var h=new Date(n.getTime());p.setTime(p.getTime()+36e5*d.to);var c=new Date(p.getTime()),u=c.getTime()-h.getTime(),g=this.getSecondsInDecimal(h),f=this.getSecondsInDecimal(c);0===f&&(f=86400),r+=u/1e3,0===l&&(this.parent.defaultStartTime=g),l===i-1&&(this.parent.defaultEndTime=f),l>0?(a.push(a[a.length-1]+g-s[l-1].to),s[l-1].to<g&&o.push({from:s[l-1].to,to:g,isWorking:!1,interval:g-s[l-1].to})):(a.push(0),o.push({from:0,to:g,isWorking:!1,interval:g})),s.push({from:g,to:f}),o.push({from:g,to:f,isWorking:!0,interval:f-g})}}return this.parent.defaultEndTime/3600!=24&&o.push({from:this.parent.defaultEndTime,to:86400,isWorking:!1,interval:86400-this.parent.defaultEndTime}),r},e.prototype.getDurationValue=function(e,i){var r=null,n=null;if("string"==typeof e){var a=e.match(/(\d*\.*\d+|.+$)/g);if(a&&a.length<=2){n=parseFloat(a[0].toString().trim());var s=a[1]?a[1].toString().trim().toLowerCase():null;-1!==t.getValue("minute",this.parent.durationUnitEditText).indexOf(s)?r="minute":-1!==t.getValue("hour",this.parent.durationUnitEditText).indexOf(s)?r="hour":-1!==t.getValue("day",this.parent.durationUnitEditText).indexOf(s)&&(r="day")}}else n=e,r=null;return{duration:n,durationUnit:r}},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,i=[],r=0;r<e.length;r++){var n=this.getDateFromFormat(e[r].from),a=this.getDateFromFormat(e[r].to);if(!t.isNullOrUndefined(n)||!t.isNullOrUndefined(a))if(t.isNullOrUndefined(n)||t.isNullOrUndefined(a)){var s=n||a;s.setHours(0,0,0,0),-1===i.indexOf(s.getTime())&&i.push(s.getTime())}else for(;n<=a;)n.setHours(0,0,0,0),-1===i.indexOf(n.getTime())&&i.push(n.getTime()),n.setDate(n.getDate()+1)}return i},e.prototype.isOnHolidayOrWeekEnd=function(e,i){if(!(i=t.isNullOrUndefined(i)?this.parent.includeWeekend:i)&&-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay()))return!0;for(var r=this.parent.totalHolidayDates,n=0;n<r.length;n++){var a=this.getDateFromFormat(new Date(r[n])),s=new Date(a.getTime());if(a.setHours(0,0,0,0),s.setHours(23,59,59,59),e.getTime()>=a.getTime()&&e.getTime()<s.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.isOnHolidayOrWeekEnd(e,null),d=!!i&&this.isOnHolidayOrWeekEnd(t,null),p=0;p<this.parent.nonWorkingTimeRanges.length;p++){var h=this.parent.nonWorkingTimeRanges[p];r>=h.from&&r<=h.to&&(a=p),n>=h.from&&n<=h.to&&(s=p)}if(e.getDate()!==t.getDate()||e.getMonth()!==t.getMonth()||e.getFullYear()!==t.getFullYear()){if(l)o+=86400-r;else for(p=a;p<this.parent.nonWorkingTimeRanges.length;p++)this.parent.nonWorkingTimeRanges[p].isWorking||(o+=p===a?this.parent.nonWorkingTimeRanges[p].to-r:this.parent.nonWorkingTimeRanges[p].interval);if(d)o+=n;else for(p=0;p<=s;p++)this.parent.nonWorkingTimeRanges[p].isWorking||(o+=p===s?n-this.parent.nonWorkingTimeRanges[p].from:this.parent.nonWorkingTimeRanges[p].interval)}else if(a!==s)if(d)o+=n-r;else for(p=a;p<=s;p++)this.parent.nonWorkingTimeRanges[p].isWorking||(o+=p===a?this.parent.nonWorkingTimeRanges[p].to-r:p===s?n-this.parent.nonWorkingTimeRanges[p].from:this.parent.nonWorkingTimeRanges[p].interval);else if(d)o+=n-r;else{this.parent.nonWorkingTimeRanges[a].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(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,r=(e-3600*(i=parseInt(i,10)))/60,n=e-3600*i-60*(r=parseInt(r,10));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){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,i){return t.isNullOrUndefined(e)||(e=this.reverse(e,i,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(),n=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(n-r))},e.prototype.convert=function(e,t){var i=e.getTimezoneOffset(),r=this.offset(e,t),n=(e=new Date(e.getTime()+6e4*(i-r))).getTimezoneOffset();return new Date(e.getTime()+6e4*(n-i))},e.prototype.getDateFromFormat=function(e,i){var r;if(t.isNullOrUndefined(e))return null;if(e instanceof Date)r=new Date(e.getTime());else{var n=this.parent.globalize.parseDate(e,{format:this.parent.getDateFormat(),type:"dateTime"});r=t.isNullOrUndefined(n)&&!isNaN(new Date(e).getTime())?new Date(e):n}if(!t.isNullOrUndefined(this.parent.timezone)&&i){return this.convert(r,this.parent.timezone)}return r},e.prototype.compareDates=function(e,i){return t.isNullOrUndefined(e)||t.isNullOrUndefined(i)?!t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)?1:t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)?-1:null:e.getTime()>i.getTime()?1:e.getTime()<i.getTime()?-1:0},e.prototype.getDurationString=function(e,i){var r="";if(!t.isNullOrUndefined(e)&&(r+=parseFloat(e.toFixed(2))+" ",!t.isNullOrUndefined(i))){var n=1!==e;"day"===i?r+=n?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===i?r+=n?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===i&&(r+=n?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return r},e.prototype.getWorkString=function(e,i){var r="";if(!t.isNullOrUndefined(e)&&(r+=parseFloat(e).toFixed(2)+" ",!t.isNullOrUndefined(i))){var n=1!==e;"day"===i?r+=n?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===i?r+=n?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===i&&(r+=n?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return r},e.prototype.calculateProjectDatesForValidatedTasks=function(e){var i=this,r="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,n="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,a=null,s=null,o=t.getValue("dataOperation.dataArray",this.parent);if(r&&n||!o||0!==o.length){if(o.length>0){var l=o.slice().sort(function(e,t){return new Date(e[i.parent.taskFields.startDate]).getTime()-new Date(t[i.parent.taskFields.startDate]).getTime()}),d=o.slice().sort(function(e,t){return new Date(t[i.parent.taskFields.endDate]).getTime()-new Date(e[i.parent.taskFields.endDate]).getTime()});a=l[0][this.parent.taskFields.startDate],s=d[d.length-1][this.parent.taskFields.endDate]}}else a=this.getDateFromFormat(new Date),s=this.getDateFromFormat(new Date(a.getTime()));this.parent.cloneProjectStartDate=r?new Date(r.getTime()):"string"==typeof a?new Date(a):a,this.parent.cloneProjectEndDate=n?new Date(n.getTime()):"string"==typeof s?new Date(s):s},e.prototype.calculateProjectDates=function(e){var i=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 r="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,n="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,a=this.parent.timelineModule.isZooming&&this.parent.cloneProjectStartDate?this.getDateFromFormat(this.parent.cloneProjectStartDate):this.getDateFromFormat(r),s=this.parent.timelineModule.isZooming&&this.parent.cloneProjectEndDate?this.getDateFromFormat(this.parent.cloneProjectEndDate):this.getDateFromFormat(n),o=null,l=null,d=this.parent.flatData,p=this.parent.currentViewData,h=[],c=function(e){t.isNullOrUndefined(e)||h.push(e)},u=function(e){e.length>0&&(e.sort(function(e,t){return e.getTime()-t.getTime()}),o=new Date(e[0].getTime()),l=e.length>1?new Date(e[e.length-1].getTime()):null)};if((!a||!s)&&d.length>0||e||this.parent.timelineModule.isZoomToFit){if((p.length>0&&this.parent.timelineModule.isZoomToFit&&this.parent.treeGrid.filterModule&&this.parent.treeGrid.filterModule.filteredResult.length>0?p:d).forEach(function(e){h=[];var t=e.ganttProperties,r=i.getValidStartDate(t),n=i.getValidEndDate(t);c(o),c(l),c(r),c(n),i.parent.renderBaseline&&!i.parent.timelineModule.isZoomToFit&&(c(t.baselineStartDate),c(t.baselineEndDate)),t.indicators&&t.indicators.length>0&&!i.parent.timelineModule.isZoomToFit&&t.indicators.forEach(function(e){c(i.getDateFromFormat(e.date))}),u(h)}),h=[],c(o),c(l),this.parent.eventMarkers.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.eventMarkers.forEach(function(e,t){c(i.getDateFromFormat(e.day))})}if(this.parent.totalHolidayDates.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.totalHolidayDates.forEach(function(e,t){c(new Date(e))})}u(h),o&&l||(o=t.isNullOrUndefined(o)?this.getDateFromFormat(new Date):o,(l=this.getDateFromFormat(new Date(o.getTime()))).setDate(l.getDate()+20))}else a&&s||0!==d.length||(o=this.getDateFromFormat(new Date),l=this.getDateFromFormat(new Date(o.getTime())));e?(t.setValue("minStartDate",o,e),t.setValue("maxEndDate",l,e)):(this.prevProjectStartDate=this.parent.cloneProjectStartDate,this.parent.cloneProjectStartDate=o||new Date(a.getTime()),this.parent.cloneProjectEndDate=l||new Date(s.getTime()))},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;t+=Math.ceil(this.getTimeDifference(n,a)/864e5)}return t},e}(),R=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)}}(),O=function(e){function i(t){var i=e.call(this,t)||this;return i.recordIndex=0,i.taskIds=[],i.hierarchyData=[],i.addEventListener(),i}return R(i,e),i.prototype.addEventListener=function(){this.parent.on("beforeDataManipulate",this.checkDataBinding.bind(this))},i.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=[]),t.isNullOrUndefined(this.parent.dataSource))this.parent.dataSource=[],this.parent.processTimeline(),this.parent.renderGantt(e);else if(this.parent.dataSource instanceof n.DataManager)this.initDataSource(e);else{if(this.parent.dataSource instanceof Object&&m(this.parent)){var i=t.getValue("result",this.parent.dataSource);this.dataArray=i}else this.dataArray=this.parent.dataSource;this.processTimeline(),this.cloneDataSource(),this.parent.renderGantt(e)}},i.prototype.processTimeline=function(){this.parent.processTimeline(),this.parent.enableValidation||(this.parent.dataOperation.calculateProjectDatesForValidatedTasks(),this.parent.timelineModule.validateTimelineProp())},i.prototype.initDataSource=function(e){var t=this,i=this.parent.query instanceof n.Query?this.parent.query:new n.Query;i.requiresCount();this.parent.dataSource.executeQuery(i).then(function(i){t.dataArray=i.result,t.processTimeline(),t.cloneDataSource(),t.parent.renderGantt(e)}).catch(function(i){t.parent.processTimeline(),t.parent.renderGantt(e),t.parent.trigger("actionFailure",{error:i})})},i.prototype.constructDataSource=function(e){for(var i,r=new n.DataManager(e).executeLocal((new n.Query).group(this.parent.taskFields.parentID)),a=[],s=0;s<r.length;s++){var o=r[s];!t.isNullOrUndefined(o.key)&&(i=this.taskIds.indexOf(o.key.toString()))>-1&&!t.isNullOrUndefined(o.key)?e[i][this.parent.taskFields.child]=o.items:-1!==i&&a.push.apply(a,o.items)}this.hierarchyData=this.dataReorder(e,a)},i.prototype.cloneDataSource=function(){var e=this.parent.taskFields.id,i=this.parent.taskFields.parentID,r=[];if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))r=this.dataArray;else{for(var a=[],s=0;s<this.dataArray.length;s++){var o=this.dataArray[s];a.push(t.extend({},{},o,!0)),t.isNullOrUndefined(o[e])||this.taskIds.push(o[e].toString())}this.parent.taskFields.child||(this.parent.taskFields.child="Children"),this.constructDataSource(a),r=this.hierarchyData}if(this.parent.taskFields.segmentId&&(this.segmentCollection=new n.DataManager(this.parent.segmentData).executeLocal((new n.Query).group(this.parent.taskFields.segmentId)),this.parent.taskFields.segments||(this.parent.taskFields.segments="Segments")),"ProjectView"!==this.parent.viewType){var l=t.extend([],[],this.parent.resources,!0),d=[];if(this.constructResourceViewDataSource(l,r,d),d.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]=d,l.push(p)}r=l}this.prepareDataSource(r)},i.prototype.constructResourceViewDataSource=function(e,t,i){for(var r=function(r){var a=t[r],s=n.parent.taskFields.child,o=a&&a[n.parent.taskFields.resourceInfo],l=n.parent.resourceFields.id;a[s]&&0!==a[s].length||!o||!o.length?a[s]||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[n.parent.taskFields.child]&&a[n.parent.taskFields.child].length&&n.constructResourceViewDataSource(e,a[n.parent.taskFields.child],i)},n=this,a=0;a<t.length;a++)r(a)},i.prototype.prepareDataSource=function(e){this.prepareRecordCollection(e,0),"ResourceView"===this.parent.viewType&&this.calculateSharedTaskUniqueIds(),this.parent.taskFields.dependency&&this.parent.predecessorModule&&this.parent.predecessorModule.ensurePredecessorCollection()},i.prototype.calculateSharedTaskUniqueIds=function(){for(var e=function(e){var i=t.parent.getTaskIds()[e].match(/(\d+|[A-z]+)/g);if("R"!==i[0]){var r=[],n=[];t.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=this,i=0;i<this.parent.getTaskIds().length;i++)e(i)},i.prototype.prepareRecordCollection=function(e,i,r){for(var n=this,a=e.length,s=function(a){var s=e[a];if(!t.isNullOrUndefined(o.parent.taskFields.segmentId)){var l=o.segmentCollection.filter(function(e){return e.key===s[n.parent.taskFields.id]});l.length>0&&(s[o.parent.taskFields.segments]=l[0].items)}var d=o.createRecord(s,i,r,!0);o.parent.enableValidation||o.updateTaskLeftWidth(d),d.index=o.recordIndex++,o.parent.ids[d.index]=d.ganttProperties.rowUniqueID,o.parent.flatData.push(d),o.parent.setTaskIds(d);var p=s[o.parent.taskFields.child];if("ResourceView"===o.parent.viewType&&t.isNullOrUndefined(p)&&t.isNullOrUndefined(d.parentItem)&&0===d.level){var h=d.ganttProperties,c=d;o.parent.setRecordValue(h.isAutoSchedule?"startDate":"autoStartDate",null,c.ganttProperties,!0),o.parent.setRecordValue(h.isAutoSchedule?"endDate":"autoEndDate",null,c.ganttProperties,!0);var u=c.ganttProperties;o.parent.setRecordValue("isMilestone",!1,u,!0),u.isAutoSchedule&&o.calculateDuration(c),o.updateWorkWithDuration(c);var g=u.work;o.parent.setRecordValue("work",g,u,!0),o.parent.setRecordValue("taskType","FixedDuration",u,!0),t.isNullOrUndefined(o.parent.taskFields.type)||o.updateMappingData(c,"type"),o.parent.setRecordValue("progress",Math.floor(0),u,!0),o.parent.setRecordValue("totalProgress",0,u,!0),o.parent.setRecordValue("totalDuration",0,u,!0),u.isAutoSchedule||(o.parent.setRecordValue("autoDuration",o.calculateAutoDuration(u),u,!0),o.updateAutoWidthLeft(c)),o.resetDependency(c),o.updateWidthLeft(c),o.updateTaskData(c)}!t.isNullOrUndefined(p)&&p.length>0&&o.prepareRecordCollection(p,d.level+1,d)},o=this,l=0;l<a;l++)s(l)},i.prototype.addCustomFieldValue=function(e,t){var i=this.parent.ganttColumns,r=i.length;if(r)for(var n=0;n<r;n++)void 0===t[i[n].field]&&this.parent.setRecordValue(i[n].field,e[i[n].field],t)},i.prototype.createRecord=function(e,i,n,a){var s=this.parent.taskFields,o=this.parent.resourceFields,l=e[s.progress],d=null,p=null,h=e[s.notes];l=l&&parseFloat(l.toString())?parseFloat(l.toString()):0;var c=e[s.dependency],u=this.getDateFromFormat(e[s.baselineStartDate],!0),g=this.getDateFromFormat(e[s.baselineEndDate],!0),f={},y={},v="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[s.manual];this.parent.setRecordValue("ganttProperties",y,f),t.isNullOrUndefined(e[s.id])?t.isNullOrUndefined(e[o.id])||(d=e[o.id],p=e[o.name],this.addTaskData(f,e,!1)):(d=e[s.id],p=e[s.name],this.addTaskData(f,e,a)),this.parent.setRecordValue("taskId",d,y,!0),this.parent.setRecordValue("taskName",p,y,!0),s.parentID&&this.parent.setRecordValue("parentId",e[s.parentID],y,!0),this.addCustomFieldValue(e,f),this.parent.setRecordValue("isAutoSchedule",v,y,!0),this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),y,!0),this.parent.setRecordValue("isMilestone",!1,y,!0),this.parent.setRecordValue("indicators",e[s.indicators],y,!0),this.updateResourceName(f),this.calculateScheduledValues(f,e,a),this.parent.setRecordValue("baselineStartDate",this.checkBaselineStartDate(u),y,!0),g&&0===g.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,g),(y.baselineStartDate&&g&&y.baselineStartDate.getTime()>g.getTime()||y.isMilestone)&&(g=y.baselineStartDate),this.parent.setRecordValue("baselineEndDate",this.checkBaselineEndDate(g,y),y,!0),this.parent.setRecordValue("progress",l,y,!0),this.parent.setRecordValue("totalProgress",l,y,!0),this.parent.setRecordValue("predecessorsName",c,y,!0),this.parent.setRecordValue("notes",h,y,!0),this.parent.setRecordValue("cssClass",e[s.cssClass],y,!0),this.parent.setRecordValue("parentItem",this.getCloneParent(n),f);var D=f.parentItem?f.parentItem.uniqueID:null;if(this.parent.setRecordValue("parentUniqueID",D,f),"ResourceView"!==this.parent.viewType||t.isNullOrUndefined(s.parentID)||t.isNullOrUndefined(f.parentItem)||this.parent.setRecordValue("parentId",f.parentItem.taskId,y,!0),this.parent.setRecordValue("level",i,f),this.parent.setRecordValue("uniqueID",r.getUid(this.parent.element.id+"_data_"),f),this.parent.setRecordValue("uniqueID",f.uniqueID,y,!0),this.parent.setRecordValue("childRecords",[],f),this.parent.dataSource instanceof Object&&m(this.parent)&&!t.isNullOrUndefined(s.child)&&this.parent.setRecordValue(s.child,[],f),!t.isNullOrUndefined(e[s.child])&&e[s.child].length>0?(this.parent.setRecordValue("hasChildRecords",!0,f),this.parent.setRecordValue("isMilestone",!1,y,!0),this.resetDependency(f)):this.parent.setRecordValue("hasChildRecords",!1,f),f.hasChildRecords&&(this.parent.setRecordValue("autoStartDate",f.ganttProperties.startDate,y),this.parent.setRecordValue("autoEndDate",f.ganttProperties.endDate,y),this.parent.setRecordValue("autoDuration",f.ganttProperties.duration,y)),this.parent.setRecordValue("expanded",!f.hasChildRecords||!this.parent.collapseAllParentTasks,f),this.updateExpandStateMappingValue(f,e),a||(this.parent.setRecordValue("width",this.calculateWidth(f),y,!0),this.parent.setRecordValue("left",this.calculateLeft(y),y,!0),this.parent.setRecordValue("progressWidth",this.getProgressWidth(y.width,l),y,!0),y.baselineEndDate&&y.baselineStartDate&&(this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(y),y,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(y),y,!0))),t.isNullOrUndefined(s.work)&&this.updateWorkWithDuration(f),t.isNullOrUndefined(s.manual)||this.parent.dataOperation.updateMappingData(f,"manual"),this.updateTaskData(f),c&&this.parent.predecessorsCollection.push(f),t.isNullOrUndefined(n)||(n.childRecords.push(f),this.parent.dataSource instanceof Object&&m(this.parent)&&!t.isNullOrUndefined(this.parent.taskFields.child)&&n[this.parent.taskFields.child].push(f.taskData)),"ProjectView"===this.parent.viewType)this.parent.setRecordValue("rowUniqueID",y.taskId.toString(),y,!0);else{var w=f.uniqueID.replace(this.parent.element.id+"_data_","");this.parent.setRecordValue("rowUniqueID",w,f),this.parent.setRecordValue("rowUniqueID",w,y,!0),this.parent.setRecordValue("sharedTaskUniqueIds",[],y,!0)}return this.parent.allowUnscheduledTasks&&f.ganttProperties.startDate&&(f.ganttProperties.endDate||f.ganttProperties.duration)&&(this.parent.setRecordValue("segments",this.setSegmentsInfo(f,!0),y,!0),this.parent.dataOperation.updateMappingData(f,"segments"),a||this.updateWidthLeft(f)),f},i.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},i.prototype.setSegmentsInfo=function(e,i){var r,n=this.parent.taskFields,a=[],s=0,o=0,l=[];if(!t.isNullOrUndefined(this.parent.taskFields.segments)&&(r=i?e.taskData[this.parent.taskFields.segments]:e.ganttProperties.segments,!t.isNullOrUndefined(r)&&r.length>1)){this.sortSegmentsData(r,i,e.ganttProperties);for(var d=0;d<r.length;d++){var p=r[d],h=i?p[n.startDate]:p.startDate,c=i?p[n.endDate]:p.endDate,u=i?p[n.duration]:p.duration;if(h=this.getDateFromFormat(h),h=this.checkStartDate(h,e.ganttProperties,!1),t.isNullOrUndefined(u)?(c=this.getDateFromFormat(c),c=this.checkEndDate(c,e.ganttProperties,!1),u=this.getDuration(h,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone)):c=this.getEndDate(h,u,e.ganttProperties.durationUnit,e.ganttProperties,!1),n.duration){if((o=e.ganttProperties.duration-s)<=0)continue;u=d===r.length-1?o:o>0&&u>o?o:u,c=this.getEndDate(h,u,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!n.duration&&n.endDate&&(c=!t.isNullOrUndefined(e.ganttProperties.endDate)&&c.getTime()>e.ganttProperties.endDate.getTime()&&d!==r.length-1?c:e.ganttProperties.endDate,u=this.getDuration(h,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),a.length>0&&c.getTime()<h.getTime()&&c.getTime()<=e.ganttProperties.endDate.getTime())){a[d-1].duration=this.getDuration(a[d-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);continue}if(p={},!(h&&c&&h&&u))break;if(s+=u,p.startDate=h,p.endDate=c,p.duration=u,p.width=0,p.left=0,p.segmentIndex=d,a.push(p),t.isNullOrUndefined(a[d-1]))p.offsetDuration=0;else{var g=this.getDuration(a[d-1].endDate,a[d].startDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);p.offsetDuration=g,g<1&&(p.startDate=this.getEndDate(a[d-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=!n.duration&&n.endDate&&p.endDate>e.ganttProperties.endDate?e.ganttProperties.endDate:p.endDate,p.offsetDuration=1)}l.push(this.setSegmentTaskData(p,r[d]))}this.parent.setRecordValue("duration",s,e.ganttProperties,!0),this.parent.setRecordValue("endDate",a[a.length-1].endDate,e.ganttProperties,!0),t.isNullOrUndefined(n.endDate)||this.parent.setRecordValue(this.parent.taskFields.endDate,a[a.length-1].endDate,e,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,l,e)}return a.length>1?this.parent.setRecordValue("segments",a,e.ganttProperties,!0):a=null,a},i.prototype.setSegmentTaskData=function(e,i){var r=this.parent.taskFields,n=t.extend({},{},i,!0);return t.isNullOrUndefined(r.startDate)||(n[this.parent.taskFields.startDate]=e.startDate),t.isNullOrUndefined(r.endDate)||(n[this.parent.taskFields.endDate]=e.endDate),t.isNullOrUndefined(r.duration)||(n[this.parent.taskFields.duration]=Number(e.duration)),n},i.prototype.updateWorkWithDuration=function(e){var i=e.ganttProperties.resourceInfo,r=0;if(!t.isNullOrUndefined(i)){var n=i.length,a=void 0,s=void 0,o=this.parent.secondsPerDay/3600,l=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit);for(a=0;a<n;a++)r+=((s=i[a][this.parent.resourceFields.unit])>0?o*s/100:o)*l;"minute"===e.ganttProperties.workUnit&&(r*=60),"day"===e.ganttProperties.workUnit&&(r/=o),r%1!=0&&(r=parseFloat(r.toFixed(2)))}if(e.childRecords.length>0&&this.parent.isOnEdit){for(var d=0,p=0;p<e.childRecords.length;p++)d+=e.childRecords[p].ganttProperties.work;r+=d}this.parent.setRecordValue("work",r,e.ganttProperties,!0),t.isNullOrUndefined(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(e,"work")},i.prototype.getCloneParent=function(e){if(t.isNullOrUndefined(e))return null;var i={};return i.uniqueID=e.uniqueID,i.expanded=e.expanded,i.level=e.level,i.index=e.index,i.taskId=e.ganttProperties.rowUniqueID,i},i.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)},i.prototype.addTaskData=function(e,i,r){var a=this,s=this.parent.taskFields,o=this.parent.dataSource;if(r)if(s.parentID||o instanceof n.DataManager&&o.dataSource.json&&o.dataSource.offline)if(s.parentID){var l=i[s.id],d=this.taskIds.indexOf(l.toString()),p=d>-1?this.dataArray[d]:{};if(!t.isNullOrUndefined(this.parent.taskFields.segmentId)){var h=this.segmentCollection.filter(function(e){return e.key===p[a.parent.taskFields.id]});h.length>0&&(p[this.parent.taskFields.segments]=h[0].items)}this.parent.setRecordValue("taskData",p,e)}else this.parent.setRecordValue("taskData",i,e);else this.parent.setRecordValue("taskData",i,e);else this.parent.setRecordValue("taskData",i,e)},i.prototype.updateExpandStateMappingValue=function(e,i){var r,n=this.parent.taskFields.expandState,a=i[n];n&&e.hasChildRecords&&(t.isNullOrUndefined(a)?t.isNullOrUndefined(a)&&!this.parent.collapseAllParentTasks?r=!0:t.isNullOrUndefined(a)&&this.parent.collapseAllParentTasks&&(r=!1):r="true"===a.toString(),this.parent.setRecordValue("taskData."+n,r,e),this.parent.setRecordValue(n,r,e),this.parent.setRecordValue("expanded",r,e))},i.prototype.setValidatedDates=function(e,i){var r=e.ganttProperties,n=this.parent.taskFields,a=i[n.duration],s=this.getDateFromFormat(i[n.startDate],!0),o=this.getDateFromFormat(i[n.endDate],!0);a=t.isNullOrUndefined(a)||""===a?null:a,this.parent.setRecordValue("startDate",new Date(s.getTime()),r,!0),t.isNullOrUndefined(a)||""===a?this.calculateDuration(e):this.updateDurationValue(a,r),this.parent.setRecordValue("endDate",new Date(o.getTime()),r,!0)},i.prototype.calculateScheduledValues=function(e,i,r){var n=this.parent.taskFields,a=e.ganttProperties,s=i[n.duration];s=t.isNullOrUndefined(s)||""===s?null:s;var o,l;a.startDate&&a.endDate?(o=this.getDateFromFormat(a.startDate,!0),l=this.getDateFromFormat(a.endDate,!0)):(o=this.getDateFromFormat(i[n.startDate],!0),l=this.getDateFromFormat(i[n.endDate],!0));var d=n.segments?i[n.segments]||e.taskData[n.segments]:null,p=!!n.milestone&&!!i[n.milestone],h=i[n.durationUnit]?i[n.durationUnit]:"";this.parent.setRecordValue("durationUnit",this.validateDurationUnitMapping(h),a,!0);var c=t.isNullOrUndefined(i[n.work])?0:parseFloat(i[n.work]);this.parent.setRecordValue("workUnit",this.validateWorkUnitMapping(this.parent.workUnit),a,!0);var u=i[n.type]?i[n.type]:"",g=this.validateTaskTypeMapping(u);if(this.parent.setRecordValue("taskType",g,a,!0),r&&!this.parent.enableValidation&&o&&l)this.setValidatedDates(e,i);else if(l||o||!t.isNullOrUndefined(s)&&""!==s)o?this.calculateDateFromStartDate(o,l,s,e,r):l?this.calculateDateFromEndDate(l,s,e):t.isNullOrUndefined(s)||""===s||(this.updateDurationValue(s,a),this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,a,!0),this.parent.setRecordValue("endDate",null,a,!0)):(this.parent.setRecordValue("startDate",this.getProjectStartDate(a,r),a,!0),this.calculateEndDate(e)));else{if(this.parent.allowUnscheduledTasks)return;this.parent.setRecordValue("duration",1,a,!0),this.parent.setRecordValue("startDate",this.getProjectStartDate(a,r),a,!0),this.calculateEndDate(e)}if(t.isNullOrUndefined(d)||this.parent.setRecordValue("segments",this.setSegmentsInfo(e,!0),a,!0),0===a.duration&&(this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("endDate",a.startDate,a,!0)),!t.isNullOrUndefined(p)&&p&&(this.parent.setRecordValue("duration",0,a,!0),this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("endDate",a.startDate,a,!0)),t.isNullOrUndefined(n.work))n.type&&a.taskType&&this.parent.dataOperation.updateMappingData(e,"type");else{if(this.parent.setRecordValue("durationUnit",this.parent.durationUnit,a,!0),isNaN(c)||t.isNullOrUndefined(c))this.parent.setRecordValue("work",0,a,!0),this.parent.setRecordValue("duration",0,a,!0),this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("endDate",a.startDate,a,!0);else{switch(this.parent.setRecordValue("work",c,a,!0),g){case"FixedDuration":case"FixedWork":this.updateUnitWithWork(e);break;case"FixedUnit":this.updateDurationWithWork(e)}t.isNullOrUndefined(n.type)||this.parent.dataOperation.updateMappingData(e,"type"),0===a.duration?(this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("endDate",a.startDate,a,!0)):t.isNullOrUndefined(a.startDate)||t.isNullOrUndefined(a.duration)||(this.parent.setRecordValue("isMilestone",!1,a,!0),this.calculateEndDate(e))}this.parent.dataOperation.updateMappingData(e,"work")}},i.prototype.updateDurationWithWork=function(e){var i=e.ganttProperties,r=i.resourceInfo;if(!t.isNullOrUndefined(r)){var n=t.isNullOrUndefined(r)?0:r.length,a=0,s=this.parent.secondsPerDay/3600,o=0,l=void 0,d=void 0;for(d=0;d<n;d++)a+=(l=r[d][this.parent.resourceFields.unit])>0?s*l/100:s;var p=this.getWorkInHour(i.work,i.workUnit);n>0&&(o+=p/a),"minute"===i.durationUnit&&(o=o*s*60),"hour"===i.durationUnit&&(o*=s),o%1!=0&&(o=parseFloat(o.toFixed(2))),t.isNullOrUndefined(i.duration)||this.parent.setRecordValue("duration",o,i,!0),this.parent.dataOperation.updateMappingData(e,"duration")}},i.prototype.updateUnitWithWork=function(e){var i=e.ganttProperties,r=i.resourceInfo,n=t.isNullOrUndefined(r)?0:r.length,a=this.parent.secondsPerDay/3600;if(0!==n){var s=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit),o=this.getWorkInHour(i.work,i.workUnit),l=s>0?o/(s*a)*100:0,d=l>0?l/n:100;d%1!=0&&(d=parseFloat(d.toFixed(2)));for(var p=0;p<n;p++)r[p][this.parent.resourceFields.unit]=d;this.updateResourceName(e)}},i.prototype.calculateDateFromEndDate=function(e,i,r){var n=r.ganttProperties;0===e.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,e);var a=0===parseInt(i,10)||null;this.parent.setRecordValue("endDate",this.checkEndDate(e,r.ganttProperties,a),n,!0),t.isNullOrUndefined(i)||""===i?this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,n,!0),this.parent.setRecordValue("duration",null,n,!0)):(this.parent.setRecordValue("duration",1,n,!0),this.parent.setRecordValue("startDate",this.getStartDate(n.endDate,n.duration,n.durationUnit,n),n,!0)):t.isNullOrUndefined(i)||""===i||(this.updateDurationValue(i,n),this.parent.setRecordValue("startDate",this.getStartDate(n.endDate,n.duration,n.durationUnit,n),n,!0))},i.prototype.calculateDateFromStartDate=function(e,i,r,n,a){var s=n.ganttProperties,o=!!(0===parseInt(r,10)||e&&i&&new Date(e.getTime())===new Date(i.getTime()))||null;this.parent.setRecordValue("startDate",this.checkStartDate(e,s,o,a),s,!0),this.parent.isTreeGridRendered&&n&&this.updateTaskData(n),i||!t.isNullOrUndefined(r)&&""!==r?(t.isNullOrUndefined(r)||i)&&i&&(t.isNullOrUndefined(r)||""===r)?(0===i.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,i),this.parent.setRecordValue("endDate",this.checkEndDate(i,n.ganttProperties),s,!0),1===this.compareDates(s.startDate,s.endDate)?(this.parent.setRecordValue("endDate",s.startDate,s,!0),this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("duration",0,s,!0)):this.calculateDuration(n)):(this.updateDurationValue(r,s),this.calculateEndDate(n)):this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("endDate",null,s,!0),this.parent.setRecordValue("duration",null,s,!0)):(this.parent.setRecordValue("duration",1,s,!0),this.calculateEndDate(n))},i.prototype.getProgressWidth=function(e,t){return e*t/100},i.prototype.calculateWidth=function(e,i){var r=e.ganttProperties,n=i?r.autoStartDate:r.startDate,a=i?r.autoEndDate:r.endDate;return t.isNullOrUndefined(n)&&t.isNullOrUndefined(a)&&(n=this.getValidStartDate(r,i),a=this.getValidEndDate(r,i)),t.isNullOrUndefined(n)||t.isNullOrUndefined(a)?3:!r.isMilestone||e.hasChildRecords&&!r.isAutoSchedule?this.getTaskWidth(n,a):0},i.prototype.getTaskbarHeight=function(){var e=this.parent.rowHeight,t=this.parent.taskbarHeight;return t<e?t:e},i.prototype.calculateLeft=function(e,i){var r=null,n=-300,a=i?e.autoStartDate:e.startDate,s=i?e.autoEndDate:e.endDate,o=(i?e.autoDuration:e.duration,e.isMilestone);return a?r=new Date(a.getTime()):s?(r=new Date(s.getTime()),o=!0):r=this.getValidStartDate(e),t.isNullOrUndefined(r)||(n=this.getTaskLeft(r,o)),n},i.prototype.calculateAutoLeft=function(e){return this.getTaskLeft(e.autoStartDate,e.isMilestone)},i.prototype.calculateAutoDuration=function(e){return this.getDuration(e.autoStartDate,e.autoEndDate,e.durationUnit,!1,e.isMilestone)},i.prototype.calculateAutoWidth=function(e){return this.getTaskWidth(e.autoStartDate,e.autoEndDate)},i.prototype.calculateBaselineLeft=function(e){var t=this.getDateFromFormat(e.baselineStartDate),i=this.getDateFromFormat(e.baselineEndDate);return t&&i?this.getTaskLeft(t,e.isMilestone):0},i.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},i.prototype.getTaskWidth=function(e,t){var i=new Date(e.getTime()),r=new Date(t.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(r)===this.parent.defaultEndTime&&r.setHours(24),this.getSecondsInDecimal(r)===this.parent.defaultStartTime&&r.setHours(0,0,0,0)),i.getTime()===r.getTime()?this.parent.perDayWidth:this.getTimeDifference(i,r)/864e5*this.parent.perDayWidth},i.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));var r=this.parent.timelineModule.timelineStartDate;return r?(i.getTime()-r.getTime())/864e5*this.parent.perDayWidth:0},i.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},i.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},i.prototype.updateMappingData=function(e,i){var r=this.parent.columnMapping,n=e.ganttProperties;if(!t.isNullOrUndefined(r[i])||"taskType"===i||"segments"===i)if("predecessorName"===i);else if("resourceInfo"===i){var a=n.resourceInfo,s=this.parent.resourceFields,o=[],l=[];if(!t.isNullOrUndefined(a))for(var d=0;d<a.length;d++){o.push(a[d][s.id]);var p=a[d][s.name],h=a[d][s.unit];100!==h&&(p+="["+h+"%]"),l.push(p)}this.parent.setRecordValue("resourceNames",l.join(","),n,!0),this.updateTaskDataResource(e),this.parent.setRecordValue(r[i],l.join(","),e)}else"startDate"===i||"endDate"===i?this.setRecordDate(e,n[i],r[i]):"duration"===i?this.setRecordDuration(e,r[i]):"work"===i?(this.parent.setRecordValue("taskData."+r[i],this.getWorkString(n.work,n.workUnit),e),this.parent.setRecordValue(r[i],n[i],e)):"type"===i?(this.parent.setRecordValue("taskData."+r[i],n[i],e),this.parent.setRecordValue(r[i],n[i],e)):"manual"===i?(this.parent.setRecordValue("taskData."+r[i],!n.isAutoSchedule,e),this.parent.setRecordValue(r[i],!n.isAutoSchedule,e)):"segments"===i?this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,this.segmentTaskData(e),e):(this.parent.setRecordValue("taskData."+r[i],n[i],e),this.parent.setRecordValue(r[i],n[i],e))},i.prototype.segmentTaskData=function(e){var i=e.ganttProperties.segments,r=this.parent.taskFields;if(t.isNullOrUndefined(i))return null;for(var n=t.extend([],[],e.taskData[r.segments],!0),a=0;a<i.length;a++)(this.parent.isEdit||this.parent.editModule&&this.parent.editModule.dialogModule&&t.getValue("isEdit",this.parent.editModule.dialogModule)||this.parent.contextMenuModule&&t.getValue("isEdit",this.parent.contextMenuModule))&&(n[a]={}),t.isNullOrUndefined(r.startDate)||(n[a][this.parent.taskFields.startDate]=i[a].startDate),t.isNullOrUndefined(r.endDate)||(n[a][this.parent.taskFields.endDate]=i[a].endDate),t.isNullOrUndefined(r.duration)||(n[a][this.parent.taskFields.duration]=Number(i[a].duration));return n},i.prototype.updateTaskDataResource=function(e){var i=e.ganttProperties.resourceInfo,r=e.taskData[this.parent.taskFields.resourceInfo],n=this.parent.resourceFields;if(t.isNullOrUndefined(r))e.taskData[this.parent.taskFields.resourceInfo]=i;else if(i.length){for(var a=0;a<i.length;a++){for(var s=!1,o=0;o<r.length;o++)if("number"==typeof r[o]||"string"==typeof r[o]){if(parseInt(r[o],10)===parseInt(i[a][n.id],10)){r[o]=i[a],s=!0;break}}else if(r[o][n.id]===i[a][n.id]&&"number"!=typeof r[o]){r[o]=t.extend({},r[o],i[a],!0),s=!0;break}s||r.push(i[a])}for(var l=[],d=function(e){i.filter(function(t){t[n.id]===r[e][n.id]&&l.push(r[e])})},p=0;p<r.length;p++)d(p);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,l,e)}else this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e)},i.prototype.setRecordDate=function(e,i,r){var n="string"==typeof i?new Date(i):i;t.isNullOrUndefined(i)||(i=new Date(n.getTime())),this.parent.setRecordValue(r,i,e),t.isNullOrUndefined(i)||(i=new Date(n.getTime())),this.parent.isLoad||this.parent.isDynamicData||this.parent.setRecordValue("taskData."+r,i,e),this.parent.isDynamicData=!1},i.prototype.getDurationInDay=function(e,t){return"day"===t?e:"hour"===t?e/(this.parent.secondsPerDay/3600):e/(this.parent.secondsPerDay/60)},i.prototype.setRecordDuration=function(e,i){var r=e.ganttProperties.duration,n=e.ganttProperties.durationUnit;if(t.isNullOrUndefined(r))this.parent.setRecordValue(i,r,e),this.parent.setRecordValue("taskData."+i,r,e);else{this.parent.setRecordValue(i,e.ganttProperties.duration,e);var a=t.getValue(i,e.taskData);isNaN(a)&&t.isNullOrUndefined(this.parent.taskFields.durationUnit)&&!t.isNullOrUndefined(a)?this.parent.setRecordValue("taskData."+i,this.getDurationString(r,n),e):"string"==typeof a?this.parent.setRecordValue("taskData."+i,r.toString(),e):this.parent.setRecordValue("taskData."+i,r,e)}this.parent.taskFields.durationUnit&&(e.taskData[this.parent.taskFields.durationUnit]=e.ganttProperties.durationUnit)},i.prototype.getWorkInHour=function(e,t){return"day"===t?e*(this.parent.secondsPerDay/3600):"minute"===t?e/60:e},i.prototype.updateTaskData=function(e){var i=this.parent.taskFields,r=e.ganttProperties;if(!t.isNullOrUndefined(e.taskData)){var n=e.taskData;if(i.id&&(this.parent.setRecordValue("taskData."+i.id,r.taskId,e),this.parent.setRecordValue(i.id,r.taskId,e)),i.name&&(this.parent.setRecordValue("taskData."+i.name,r.taskName,e),this.parent.setRecordValue(i.name,r.taskName,e)),i.startDate&&this.setRecordDate(e,r.startDate,i.startDate),i.endDate&&this.setRecordDate(e,r.endDate,i.endDate),i.duration&&this.setRecordDuration(e,i.duration),i.durationUnit&&(n[i.durationUnit]=r.durationUnit),i.progress&&(this.parent.setRecordValue("taskData."+i.progress,r.progress,e),this.parent.setRecordValue(i.progress,r.progress,e)),i.baselineStartDate&&this.setRecordDate(e,r.baselineStartDate,i.baselineStartDate),i.baselineEndDate&&this.setRecordDate(e,r.baselineEndDate,i.baselineEndDate),i.notes&&(this.parent.setRecordValue("taskData."+i.notes,r.notes,e),this.parent.setRecordValue(i.notes,r.notes,e)),i.cssClass&&(this.parent.setRecordValue("taskData."+i.cssClass,r.cssClass,e),this.parent.setRecordValue(i.cssClass,r.cssClass,e)),i.indicators&&(this.parent.setRecordValue("taskData."+i.indicators,r.indicators,e),this.parent.setRecordValue(i.indicators,r.indicators,e)),i.parentID){var a="ProjectView"===this.parent.viewType?r.parentId:n[i.parentID];this.parent.setRecordValue("taskData."+i.parentID,a,e),this.parent.setRecordValue(i.parentID,r.parentId,e)}i.work&&(this.parent.setRecordValue("taskData."+i.work,this.getWorkString(r.work,r.workUnit),e),this.parent.setRecordValue(i.work,r.work,e)),i.type&&(this.parent.setRecordValue("taskData."+i.type,r.taskType,e),this.parent.setRecordValue(i.type,r.taskType,e))}},i.prototype.setResourceInfo=function(e){var i;if(t.isNullOrUndefined(e[this.parent.taskFields.resourceInfo]))return i;i=e[this.parent.taskFields.resourceInfo];var r;r=t.isNullOrUndefined(this.parent.editModule)||t.isNullOrUndefined(this.parent.editModule.dialogModule)||!this.parent.editModule.dialogModule.isAddNewResource?this.parent.resources:this.parent.editModule.dialogModule.ganttResources;for(var n=this.parent.resourceFields.id,a=this.parent.resourceFields.unit,s=this.parent.resourceFields.group,o=[],l=function(e){var l=r.filter(function(t){return"object"==typeof i[e]&&i[e][n]===t[n]||i[e]===t[n]}),d=t.extend({},l[0]);o.push(d),t.isNullOrUndefined(a)||t.isNullOrUndefined(i[e][a])||(d[a]=i[e][a]),t.isNullOrUndefined(s)||t.isNullOrUndefined(i[e][s])||(d[s]=i[e][s])},d=0;d<i.length;d++)l(d);return this.updateResourceUnit(o),o},i.prototype.updateResourceUnit=function(e){var i=this.parent.resourceFields.unit;if(!t.isNullOrUndefined(i)){var r=e.length,n=void 0;for(n=0;n<r;n++)t.isNullOrUndefined(e[n][i])&&(e[n][i]=100)}},i.prototype.updateResourceName=function(e){var i=e.ganttProperties.resourceInfo,r=[];if(i){var n=t.extend([],[],e.taskData[this.parent.taskFields.resourceInfo],!0);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e);for(var a=0;a<i.length;a++){var s=i[a],o=s[this.parent.resourceFields.name],l=s[this.parent.resourceFields.unit];if(100!==l&&(o+="["+l+"%]"),r.push(o),e.taskData){var d=this.parent.taskFields.resourceInfo;n[a],e.taskData[d].push(n[a])}}this.parent.setRecordValue("resourceNames",r.join(","),e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.resourceInfo,r.join(","),e,!0),this.updateTaskDataResource(e)}},i.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},i.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()},i.prototype.validateTaskTypeMapping=function(e){var t=e;return t="FixedDuration"===t?"FixedDuration":"FixedUnit"===t?"FixedUnit":"FixedWork"===t?"FixedWork":this.parent.taskType},i.prototype.validateWorkUnitMapping=function(e){var t=e;return t="minute"===t?"minute":"hour"===t?"hour":"day"===t?"day":this.parent.workUnit.toLocaleLowerCase()},i.prototype.updateDurationValue=function(e,i){var r=this.getDurationValue(e);isNaN(t.getValue("duration",r))||this.parent.setRecordValue("duration",t.getValue("duration",r),i,!0),t.isNullOrUndefined(t.getValue("durationUnit",r))||this.parent.setRecordValue("durationUnit",t.getValue("durationUnit",r),i,!0)},i.prototype.reUpdateGanttData=function(){if(this.parent.flatData.length>0){var e=void 0,i=void 0;this.parent.secondsPerDay=this.getSecondsPerDay();for(var r=0;r<this.parent.flatData.length;r++)e=this.parent.flatData[r].taskData,i=this.parent.flatData[r],t.isNullOrUndefined(this.parent.taskFields.duration)||this.setRecordDuration(i,this.parent.taskFields.duration),this.calculateScheduledValues(i,e,!1);this.updateGanttData()}},i.prototype._isInStartDateRange=function(e,t,i){var r=!1;return e.getTime()>=t.getTime()&&e.getTime()<i.getTime()&&(r=!0),r},i.prototype._isInEndDateRange=function(e,t,i){var r=!1;return e.getTime()>t.getTime()&&e.getTime()<=i.getTime()&&(r=!0),r},i.prototype.updateOverlappingValues=function(e){var t,i=e.childRecords,r=[];if(i.length<=1)e.ganttProperties.workTimelineRanges=[];else{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,p=i[l].ganttProperties.endDate,h={};(this._isInStartDateRange(a,d,p)||this._isInEndDateRange(s,d,p))&&(d.getTime()>a.getTime()&&d.getTime()<s.getTime()&&p.getTime()>a.getTime()&&p.getTime()>s.getTime()||a.getTime()===d.getTime()&&s.getTime()<=p.getTime()?(h.from=d,h.to=s):a.getTime()===d.getTime()&&s.getTime()>p.getTime()?(h.from=d,h.to=p):a.getTime()>d.getTime()&&s.getTime()>=p.getTime()?(h.from=a,h.to=p):a.getTime()>d.getTime()&&s.getTime()<p.getTime()&&(h.from=a,h.to=s),o.push(h))}r.push.apply(r,this.mergeRangeCollections(o))}this.parent.setRecordValue("workTimelineRanges",this.mergeRangeCollections(r,!0),e.ganttProperties,!0),this.calculateRangeLeftWidth(e.ganttProperties.workTimelineRanges)}},i.prototype.updateOverlappingIndex=function(e){for(var t=0;t<e.length;t++)e[t].ganttProperties.eOverlapIndex=t},i.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)},i.prototype.mergeRangeCollections=function(e,t){for(var i,r,a,s,o=[],l={},d={},p=new n.DataManager(e).executeLocal((new n.Query).sortBy(this.parent.taskFields.startDate,"Ascending")),h=0;h<p.length;h++)0!==o.length||0!==h?(i=(l=o[o.length-1]).from,r=l.to,a=(d=p[h]).from,s=d.to,i.getTime()===a.getTime()&&r.getTime()>=s.getTime()||i.getTime()<a.getTime()&&r.getTime()>=s.getTime()||(i.getTime()<=a.getTime()&&r.getTime()>=a.getTime()&&r.getTime()<s.getTime()||r.getTime()<a.getTime()&&this.checkStartDate(r).getTime()===a.getTime()?l.to=s:r.getTime()<a.getTime()&&this.checkStartDate(r).getTime()!==a.getTime()&&o.push(p[h]))):o.push(p[h]);return t&&(o=this.splitRangeCollection(o)),o},i.prototype.setSortedChildTasks=function(e){return new n.DataManager(e.childRecords).executeLocal((new n.Query).sortBy(this.parent.taskFields.startDate,"Ascending"))},i.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)},i.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},i.prototype.splitRangeForDayMode=function(e,i,r){var n=i||"from",a=r||"to",s=new Date(e[n]),o=new Date(e[a]),l=[],d={};if(s.getTime()<o.getTime())do{for(var p=new Date(s.getTime()),h=new Date(s.getTime()),c=0,u=this.parent.dataOperation.getSecondsInDecimal(s),g=-1,f=0;f<this.parent.workingTimeRanges.length;f++){var m=this.parent.workingTimeRanges[f];if(u>=m.from&&u<=m.to){g=f;break}}-1!==g&&(c=Math.round(this.parent.workingTimeRanges[g].to-u),h.setSeconds(h.getSeconds()+c));h.getTime()<o.getTime()?(d={},e.task&&(d.task=t.extend([],e.task)),d[n]=p,d[a]=h,d.isSplit=!0,l.push(d)):(d={},e.task&&(d.task=t.extend([],e.task)),d[n]=p,d[a]=o,d.isSplit=!0,l.push(d)),s=this.checkStartDate(h)}while(s.getTime()<o.getTime());else l.push(e);return l},i.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},i.prototype.splitRangeForWeekMode=function(e,i,r){var n=i||"from",a=r||"to",s=new Date(e[n]),o=new Date(e[n]),l=new Date(e[a]),d=!1,p=[],h={};if(o.setDate(o.getDate()+1),o.getTime()<l.getTime()){do{if(this.parent.dataOperation.isOnHolidayOrWeekEnd(o,null)){var c=new Date(o.getTime());c.setDate(o.getDate()-1),this.setTime(this.parent.defaultEndTime,c),(h={})[n]=s,h.isSplit=!0,h[a]=c,e.task&&(h.task=t.extend([],e.task,!0)),s.getTime()!==c.getTime()&&p.push(h),s=this.checkStartDate(c),o=new Date(s.getTime()),d=!0}else o.setDate(o.getDate()+1)}while(o.getTime()<l.getTime());d?s.getTime()!==l.getTime()&&(h={},e.task&&(h.task=t.extend([],e.task,!0)),h[n]=s,h[a]=l,h.isSplit=!0,p.push(h)):p.push(e)}else p.push(e);return p},i.prototype.updateGanttData=function(){for(var e=this.parent.flatData,t=e.length,i=0;i<t;i++){var r=e[i];this.updateTaskLeftWidth(r)}},i.prototype.updateTaskLeftWidth=function(e){var t=e.ganttProperties;e.hasChildRecords||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&&(r=(i=this.parent.getParentTask(e.parentItem)).childRecords),i&&r.indexOf(e)===r.length-1&&!e.hasChildRecords&&this.parent.enableValidation?this.updateParentItems(i):i&&!this.parent.enableValidation&&this.updateWidthLeft(i)},i.prototype.reUpdateGanttDataPosition=function(){for(var e=this.parent.flatData,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)}},i.prototype.updateWidthLeft=function(e){var i=e.ganttProperties;if(!t.isNullOrUndefined(i.segments)&&i.segments.length>0){for(var r=i.segments,n=!0,a=this.splitTasksDuration(r)*this.parent.perDayWidth,s=this.parent.dataOperation.getProgressWidth(a,i.progress),o=0;o<r.length;o++){var l=r[o];if(0===o&&!t.isNullOrUndefined(i.startDate)&&l.startDate.getTime()!==i.startDate.getTime()){l.startDate=i.startDate;var d=this.parent.dataOperation.getEndDate(l.startDate,l.duration,i.durationUnit,i,!1);l.endDate=this.parent.dataOperation.checkEndDate(d,i,!1),this.parent.chartRowsModule.incrementSegments(r,0,e)}if(l.width=this.getSplitTaskWidth(l.startDate,l.duration,e),l.showProgress=!1,l.progressWidth=-1,0!==o){var p=new Date(i.startDate.getTime());l.left=this.getSplitTaskLeft(l.startDate,p)}s>0&&s>l.width?(s-=l.width,l.progressWidth=l.width,l.showProgress=!1):n&&(l.progressWidth=s,l.showProgress=!0,s-=l.width,n=!1)}this.parent.setRecordValue("segments",i.segments,i,!0),this.parent.dataOperation.updateMappingData(e,"segments")}this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e),i,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(i),i,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(i.isAutoSchedule||!e.hasChildRecords?i.width:i.autoWidth,i.progress),i,!0)},i.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)},i.prototype.getParentProgress=function(e){var i=0,r={};switch(e.ganttProperties.durationUnit){case"hour":i=e.ganttProperties.duration/(this.parent.secondsPerDay/3600);break;case"minute":i=e.ganttProperties.duration/(this.parent.secondsPerDay/60);break;default:i=e.ganttProperties.duration}return e.hasChildRecords?(t.setValue("totalProgress",e.ganttProperties.totalProgress,r),t.setValue("totalDuration",e.ganttProperties.totalDuration,r)):(t.setValue("totalProgress",e.ganttProperties.progress*i,r),t.setValue("totalDuration",i,r)),r},i.prototype.resetDependency=function(e){var i=this.parent.taskFields.dependency;if(!t.isNullOrUndefined(i)){var r=e.ganttProperties;this.parent.setRecordValue("predecessor",[],r,!0),this.parent.setRecordValue("predecessorsName",null,r,!0),this.parent.setRecordValue("taskData."+i,null,e),this.parent.setRecordValue(i,null,e)}},i.prototype.updateParentItems=function(e,i){var r=i?e:this.parent.getParentTask(e),n=!1,a=r.ganttProperties;if(r.childRecords.length>0){for(var s=a.isAutoSchedule?a.startDate:a.autoStartDate,o=a.isAutoSchedule?a.endDate:a.autoEndDate,l=r.childRecords,d=l.length,p=0,h={},c=null,u=null,g=0,m=0,y=0,v=void 0,D=0;D<d;D++)if(v=l[D],this.parent.isOnDelete&&v.isDelete)1===d&&"ProjectView"===this.parent.viewType&&(n=!0);else{var w=this.getValidStartDate(v.ganttProperties);!r.hasChildRecords||a.isAutoSchedule||t.isNullOrUndefined(v.ganttProperties.autoStartDate)||(w=v.ganttProperties.autoStartDate);var k=this.getValidEndDate(v.ganttProperties);!r.hasChildRecords||a.isAutoSchedule||t.isNullOrUndefined(v.ganttProperties.autoEndDate)||(k=v.ganttProperties.autoEndDate),t.isNullOrUndefined(c)&&(c=this.getDateFromFormat(w)),t.isNullOrUndefined(u)&&(u=this.getDateFromFormat(k)),t.isNullOrUndefined(k)||1!==this.compareDates(k,u)||(u=this.getDateFromFormat(k)),t.isNullOrUndefined(w)||-1!==this.compareDates(w,c)||(c=this.getDateFromFormat(w)),!v.ganttProperties.isMilestone&&f(v.ganttProperties)?(h=this.getParentProgress(v),m+=t.getValue("totalProgress",h),p+=t.getValue("totalDuration",h)):g++,y+=v.ganttProperties.work}if(!n){0!==this.compareDates(s,c)&&this.parent.setRecordValue(a.isAutoSchedule?"startDate":"autoStartDate",c,r.ganttProperties,!0),0!==this.compareDates(o,u)&&this.parent.setRecordValue(a.isAutoSchedule?"endDate":"autoEndDate",u,r.ganttProperties,!0);var T=void 0,S=(T=this.parent.isOnDelete&&v.isDelete?d-g-1:d-g)>0&&p>0?m/p:0,b=r.ganttProperties,P=!(0!==T||!c||!u||c.getTime()!==u.getTime());this.parent.setRecordValue("isMilestone",P,b,!0),b.isAutoSchedule&&this.calculateDuration(r),this.updateWorkWithDuration(r);var C=b.work;C=this.parent.isOnEdit?C:C+y,this.parent.setRecordValue("work",C,b,!0),this.parent.setRecordValue("taskType","FixedDuration",b,!0),t.isNullOrUndefined(this.parent.taskFields.type)||this.updateMappingData(r,"type"),this.parent.setRecordValue("progress",Math.floor(S),b,!0),this.parent.setRecordValue("totalProgress",m,b,!0),this.parent.setRecordValue("totalDuration",p,b,!0),b.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(b),b,!0),this.updateAutoWidthLeft(r)),this.resetDependency(r),this.updateWidthLeft(r),this.updateTaskData(r)}}n&&1===r.childRecords.length&&0===r.ganttProperties.duration&&(this.parent.setRecordValue("isMilestone",!0,r.ganttProperties,!0),this.updateWidthLeft(r),this.updateTaskData(r));var M=this.parent.getParentTask(r.parentItem);M&&this.updateParentItems(M),n=!1},i}(M),x="e-timeline-single-header-outer-div",I="e-left-label-container",E="e-right-label-container",F="e-taskbar-main-container",U="e-task-label",V="e-gantt-child-taskbar-inner-div",L="e-gantt-child-progressbar-inner-div",N="e-gantt-child-critical-taskbar-inner-div",B="e-gantt-child-critical-progressbar-inner-div",A="e-milestone-bottom",H="e-critical-milestone-top",W="e-critical-milestone-bottom",j="e-baseline-bar",G="e-baseline-gantt-milestone",q="e-baseline-milestone-top",z="e-baseline-milestone-bottom",_="e-chart-row-cell",X="e-chart-row",Y="e-taskbar-left-resizer",Z="e-taskbar-right-resizer",Q="e-child-progress-resizer",K="e-progressbar-handler",J="e-progressbar-handler-element",$="e-progressbar-handler-after",ee="e-gantt-child-taskbar",te="e-gantt-child-progressbar",ie="e-manualparent-main-container",re="e-gantt-manualparenttaskbar",ne="e-gantt-manualparent-milestone",ae="e-manualparent-milestone-top",se="e-manualparent-milestone-bottom",oe="e-gantt-child-manualtaskbar",le="e-gantt-manualparenttaskbar-right",de="e-gantt-parent-taskbar",pe="e-gantt-parent-progressbar",he="e-gantt-unscheduled-task",ce="e-left-resize-gripper",ue="e-right-resize-gripper",ge="e-progress-resize-gripper",fe="e-label",me="e-gantt-unscheduled-taskbar-left",ye="e-gantt-unscheduled-taskbar-right",ve="e-gantt-dependency-view-container",De="e-connector-line-container",we="e-line",ke="e-criticalconnector-line",Te="e-criticalconnector-line-right-arrow",Se="e-criticalconnector-line-left-arrow",be="e-connector-line-right-arrow",Pe="e-connector-line-left-arrow",Ce="e-connector-line-z-index",Me="e-connector-line-hover",Re="e-critical-connector-line-hover",Oe="e-connector-line-hover-z-index",xe="e-connector-line-right-arrow-hover",Ie="e-connector-line-left-arrow-hover",Ee="e-critical-connector-line-right-arrow-hover",Fe="e-critical-connector-line-left-arrow-hover",Ue="e-connectorpoint-left",Ve="e-connectorpoint-right",Le="e-connectorpoint-left-hover",Ne="e-connectorpoint-right-hover",Be="e-right-connectorpoint-outer-div",Ae="e-connectorpoint-allow-block",He=".e-content",We="e-active-parent-task",je="e-active-child-task",Ge="e-active-connected-task",qe="e-predecessor-touch-mode",ze="e-rangecontainer",_e=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),t.EventHandler.add(this.element,"scroll",this.onScroll,this)},e.prototype.removeEventListeners=function(){t.EventHandler.remove(this.element,"scroll",this.onScroll),this.parent.off("grid-scroll",this.gridScrollHandler)},e.prototype.gridScrollHandler=function(e){this.element.scrollTop=t.getValue("top",e),this.isFromTreeGrid=!0},e.prototype.updateTopPosition=function(){var e,i=this.parent.treeGrid.element.querySelector(".e-content").scrollTop;if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){e=i-this.parent.virtualScrollModule.getTopPosition()}else e=i;if(!t.isNullOrUndefined(this.parent.dayMarkersModule)){var r=t.getValue("nonworkingDayRender.holidayContainer",this.parent.dayMarkersModule),n=t.getValue("nonworkingDayRender.weekendContainer",this.parent.dayMarkersModule),a=t.getValue("eventMarkerRender.eventMarkersContainer",this.parent.dayMarkersModule);r&&(r.style.top=t.formatUnit(e)),n&&(n.style.top=t.formatUnit(e)),a&&(a.style.top=t.formatUnit(e))}this.parent.chartVerticalLineContainer&&(this.parent.chartVerticalLineContainer.style.top=t.formatUnit(e))},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"),e.requestType="scroll",this.parent.trigger("actionComplete",e)},e.prototype.setHeight=function(e){this.element.style.height=t.formatUnit(e)},e.prototype.setWidth=function(e){this.element.style.width=t.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){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}(),Xe=function(){function e(e){this.parent=e}return e.prototype.renderWrapper=function(){this.wrapper=t.createElement("div",{className:"e-virtualtable",styles:"position: absolute; transform: translate(0px, 0px);"}),this.parent.ganttChartModule.scrollElement.appendChild(this.wrapper),this.virtualTrack=t.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}(),Ye=function(){function e(e){this.isExpandCollapseFromChart=!1,this.isExpandAll=!1,this.isGanttElement=!1,this.parent=e,this.chartTimelineContainer=null,this.rangeViewContainer=t.createElement("div",{className:ze}),this.rangeViewContainer.setAttribute("role","RangeContainer"),this.virtualRender=new Xe(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=t.createElement("div",{id:this.parent.element.id+"GanttChart",className:"e-gantt-chart"}),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("."+ze);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{if(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),this.parent.enableCriticalPath){var e=this.parent.criticalPathModule;this.parent.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,this.parent.enableCriticalPath,e.predecessorCollectionTaskIds)}"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.renderOverAllocationContainer()}this.updateWidthAndHeight(),this.parent.notify("selectRowByIndex",{})},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++)(r=(i=e[t]).ganttProperties.workTimelineRanges)&&this.renderRange(r,i)},e.prototype.getTopValue=function(e){var t=this.parent.getExpandedRecords(this.parent.currentViewData).indexOf(e);return e.expanded?(t+1)*this.parent.rowHeight:t*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,i){var r=this.getTopValue(i),n=this.rangeViewContainer.querySelector(".rangeContainer"+i.ganttProperties.rowUniqueID);n&&n.remove();var a=t.createElement("div",{className:"rangeContainer"+i.ganttProperties.rowUniqueID,styles:"top:"+r+"px; position: absolute;"});if(0!==i.level||i.expanded||!t.isNullOrUndefined(i.parentItem)||this.parent.enableMultiTaskbar){for(var s=0;s<e.length;s++){var o=this.getRangeHeight(i),l=t.createElement("div",{className:"e-rg-rangdiv e-leftarc",styles:"left:"+e[s].left+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px;\n height: "+(o+1)+"px; border-right: 0px"}),d=t.createElement("div",{className:"e-rg-rangdiv e-rightarc",styles:"left:"+(e[s].left+e[s].width-5)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px; height: "+(o+1)+"px;\n border-left: 0px"});a.appendChild(l),a.appendChild(d),this.rangeViewContainer.appendChild(a)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.rangeViewContainer)}},e.prototype.renderTimelineContainer=function(){this.chartTimelineContainer=t.createElement("div",{className:"e-timeline-header-container"}),this.chartTimelineContainer.setAttribute("role","TimelineHeader"),this.chartElement.appendChild(this.chartTimelineContainer)},e.prototype.renderBodyContainers=function(){this.chartBodyContainer=t.createElement("div",{className:"e-chart-root-container"}),this.chartElement.appendChild(this.chartBodyContainer),this.scrollElement=t.createElement("div",{className:"e-chart-scroll-container e-content",styles:"position:relative;"}),this.chartBodyContainer.appendChild(this.scrollElement),this.chartBodyContent=t.createElement("div",{className:"e-chart-rows-container",styles:"position:relative; overflow:hidden "}),this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.ganttChartModule.virtualRender.renderWrapper():this.scrollElement.appendChild(this.chartBodyContent),this.scrollObject=new _e(this.parent);var e=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.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,i=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];if(e>=i.offsetHeight||"auto"===this.parent.height)this.chartBodyContent.style.height=t.formatUnit(e);else{var r=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;i.offsetHeight>=r?this.chartBodyContent.style.height=i.offsetHeight-17+"px":this.chartBodyContent.style.height=i.offsetHeight+"px"}this.chartBodyContent.style.width=t.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){t.getValue("virtualTrack",this.parent.ganttChartModule.virtualRender).style.height=this.parent.updatedRecords.length*this.parent.rowHeight+"px"}},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),i=e[e.length-1],r=this.parent.currentViewData.indexOf(i),n=this.parent.getRowByIndex(r),a=this.parent.chartRowsModule.ganttChartTableBody;if(a.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow")&&t.removeClass(a.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow"),"e-lastrow"),this.chartBodyContent.clientHeight<this.chartBodyContainer.clientHeight&&n){t.addClass(n.querySelectorAll("td"),"e-lastrow");var s=0===this.parent.contentHeight?this.parent.flatData.length>1?36:0:this.parent.contentHeight,o=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];if(s>=o.offsetHeight)this.chartBodyContent.style.height=t.formatUnit(s);else{var l=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;o.offsetHeight>=l?this.chartBodyContent.style.height=o.offsetHeight-17+"px":this.chartBodyContent.style.height=o.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)},e.prototype.ganttChartMouseClick=function(e){this.parent.editSettings.allowTaskbarEditing&&(this.parent.autoFocusTasks&&this.scrollToTarget(e),this.parent.notify("chartMouseClick",e))},e.prototype.ganttChartMouseUp=function(e){this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseUp",e)},e.prototype.scrollToTarget=function(e){var i=t.closest(e.target,"tr");if(i&&this.parent.element.contains(i)&&(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 r=t.getValue("rowIndex",t.closest(e.target,"tr")),n=this.parent.currentViewData[r].ganttProperties.startDate;if(!t.isNullOrUndefined(n)){var a=this.parent.dataOperation.getTaskLeft(n,!1);this.parent.autoFocusTasks&&this.updateScrollLeft(a)}}},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)},e.prototype.mouseUp=function(e){if(this.parent.allowRowDragAndDrop){var t=this.parent.element.querySelector(".e-ganttdrag");t&&t.remove()}this.isGanttElement||this.parent.notify("chartMouseUp",e),this.isGanttElement=!1},e.prototype.documentMouseUp=function(e){if(this.isGanttElement=!0,this.parent.allowRowDragAndDrop){var i=this.parent.element.querySelector(".e-ganttdrag");i&&i.remove()}if(!this.parent.isDestroyed&&3!==e.which){var r=!1;if(this.parent.editSettings.allowTaskbarEditing&&t.getValue("editModule.taskbarEditModule.isMouseDragged",this.parent)&&t.getValue("editModule.taskbarEditModule.taskBarEditAction",this.parent)&&(r=!0),this.parent.notify("chartMouseUp",e),this.parent.showActiveElement&&this.focusedElement&&!e.target.classList.contains("e-split-bar")&&(this.focusedElement.tabIndex=0===this.focusedElement.tabIndex?-1:this.focusedElement.tabIndex,t.removeClass([this.focusedElement],"e-active-container")),!r){var n=e.target,a=e.target.classList.contains(F)||t.closest(e.target,"."+F);t.closest(n,".e-gantt-parent-taskbar")&&!this.parent.editSettings.allowEditing?this.chartExpandCollapseRequest(e):!a&&this.parent.autoFocusTasks&&this.scrollToTarget(e)}if(this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.removeFalseLine(!0),!t.isNullOrUndefined(this.parent.onTaskbarClick)&&!r){n=e.target;var s=t.closest(n,".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");s&&this.onTaskbarClick(e,n,s)}}},e.prototype.onTaskbarClick=function(e,i,r){var n=t.closest(i,"tr"),a=t.getValue("rowIndex",n),s={data:this.getRecordByTarget(e),taskbarElement:r,rowIndex:a,target:i};this.parent.trigger("onTaskbarClick",s)},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),!t.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(!t.isNullOrUndefined(this.parent.onMouseMove)&&(this.parent.flatData.length||e.target.classList.contains("e-header-cell-label")||e.target.classList.contains("e-headercell"))){var i=e.target,r={originalEvent:e},n=t.closest(i,".e-chart-row-cell,.e-connector-line-container,.e-event-markers,.e-header-cell-label,.e-rowcell,.e-headercell,.e-indicator-span");if(n){var a=void 0,s=t.closest(i,".e-rowcell,.e-chart-row-cell"),o=t.closest(i,".e-rowcell,.e-headercell");if(s&&(a=this.parent.ganttChartModule.getRecordByTarget(e),r.data=a),o){var l=t.getValue("cellIndex",o);r.column=this.parent.treeGrid.columns[l]}if(t.closest(i,".e-indicator-span")){var d=0,p=a.ganttProperties.indicators;if(p.length>1)for(d=0;d<p.length&&p[d].name!==n.innerText.trim();d++);r.indicator=p[d]}if(t.closest(i,".e-connector-line-container")){(h={}).target=n,r.predecessor=this.parent.tooltipModule.getPredecessorTooltipData(h)}if(t.closest(i,".e-event-markers")){var h;(h={}).target=n,r.eventMarkers=this.parent.tooltipModule.getMarkerTooltipData(h)}i.classList.contains("e-header-cell-label")&&(r.date=new Date(i.dataset.content))}this.parent.trigger("onMouseMove",r)}},e.prototype.doubleClickHandler=function(e){this.parent.notify("chartDblClick",e);var i=e.target,r=t.closest(i,"tr"),n=t.getValue("rowIndex",r),a={row:r,rowData:this.parent.ganttChartModule.getRecordByTarget(e),rowIndex:n,target:i};this.recordDoubleClick(a)},e.prototype.recordDoubleClick=function(e){this.parent.trigger("recordDoubleClick",e)},e.prototype.getRecordByTarget=function(e){var i,r=t.closest(e.target,"div."+F);if(t.isNullOrUndefined(r)){if(r=t.closest(e.target,"tr")){var n=t.getValue("rowIndex",t.closest(e.target,"tr"));i=this.parent.currentViewData[n]}}else{var a=r.getAttribute("rowUniqueId");i=this.parent.getRecordByID(a)}return i},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 i=e.target,r=t.closest(i,".e-gantt-parent-taskbar"),n=this.getRecordByTarget(e),a=t.closest(i,"tr"),s=t.getValue("rowIndex",a),o={data:n,gridRow:this.parent.treeGrid.getRows()[s],chartRow:a,cancel:!1};this.isExpandCollapseFromChart=!0,r.classList.contains("e-row-expand")?this.collapseGanttRow(o):r.classList.contains("e-row-collapse")&&this.expandGanttRow(o)}},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)},e.prototype.collapseGanttRow=function(e,i){var r=this;i?this.collapsedGanttRow(e):this.parent.trigger("collapsing",e,function(e){r.isExpandCollapseFromChart&&!t.getValue("cancel",e)&&r.collapsedGanttRow(e),r.isExpandCollapseFromChart=!1})},e.prototype.collapsedGanttRow=function(e){var i=t.getValue("data",e);this.isExpandCollapseFromChart?(this.expandCollapseChartRows("collapse",t.getValue("chartRow",e),i,null),this.parent.treeGrid.collapseRow(t.getValue("gridRow",e),i),this.isExpandCollapseFromChart=!1):this.expandCollapseChartRows("collapse",t.getValue("chartRow",e),i,null),"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(i),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),t.getValue("chartRow",e).setAttribute("aria-expanded","false"),this.parent.trigger("collapsed",e)},e.prototype.expandGanttRow=function(e,i){var r=this;i?this.expandedGanttRow(e):this.parent.trigger("expanding",e,function(e){r.isExpandCollapseFromChart&&!t.getValue("cancel",e)&&r.expandedGanttRow(e),r.isExpandCollapseFromChart=!1})},e.prototype.expandedGanttRow=function(e){var i=t.getValue("data",e);this.isExpandCollapseFromChart?(this.expandCollapseChartRows("expand",t.getValue("chartRow",e),i,null),this.parent.treeGrid.expandRow(t.getValue("gridRow",e),i),this.isExpandCollapseFromChart=!1):(this.parent.isExpandCollapseLevelMethod||this.expandCollapseChartRows("expand",t.getValue("chartRow",e),i,null),this.parent.isExpandCollapseLevelMethod=!1),"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(i),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),t.getValue("chartRow",e).setAttribute("aria-expanded","true"),this.parent.trigger("expanded",e)},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,i,r,n){var a;if("expand"===e){a="table-row",n||(r.expanded=!0);for(var s=i.querySelectorAll(".e-row-collapse"),o=0;o<s.length;o++)t.addClass([s[o]],"e-row-expand"),t.removeClass([s[o]],"e-row-collapse")}else if("collapse"===e){a="none",n||(r.expanded=!1);for(s=i.querySelectorAll(".e-row-expand"),o=0;o<s.length;o++)t.addClass([s[o]],"e-row-collapse"),t.removeClass([s[o]],"e-row-expand")}for(var l=r.childRecords,d=this.getChartRows(),p=[],h=0;h<d.length;h++)d[h].classList.contains("gridrowtaskId"+r.ganttProperties.rowUniqueID+"level"+(r.level+1))&&p.push(d[h]);for(h=0;h<p.length;h++)p[h].style.display=a,l[h].childRecords&&l[h].childRecords.length&&("collapse"===e||l[h].expanded||this.isExpandAll)&&this.expandCollapseChartRows(e,p[h],l[h],!0)},e.prototype.expandCollapseAll=function(e){"expand"===e?(this.isExpandAll=!0,this.parent.treeGrid.expandAll()):this.parent.treeGrid.collapseAll(),this.isExpandAll=!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=t.Browser.isPointer,i=t.Browser.touchStartEvent,n=t.Browser.touchEndEvent,a=t.Browser.touchMoveEvent,s=e?"pointerleave":"mouseleave";t.EventHandler.add(this.parent.chartPane,i,this.ganttChartMouseDown,this),t.EventHandler.add(this.parent.chartPane,s,this.ganttChartLeave,this),t.EventHandler.add(this.parent.chartPane,a,this.ganttChartMove,this),this.parent.isAdaptive&&(t.EventHandler.add(this.parent.chartPane,r.click,this.ganttChartMouseClick,this),t.EventHandler.add(this.parent.chartPane,n,this.ganttChartMouseUp,this)),this.parent.isAdaptive||(t.EventHandler.add(this.parent.element,n,this.documentMouseUp,this),t.EventHandler.add(document,n,this.mouseUp,this)),t.EventHandler.add(this.parent.element,"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(document.body,"contextmenu",this.contextClick,this),t.EventHandler.add(document,"mouseup",this.contextClick,this),t.EventHandler.add(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler,this)},e.prototype.unWireEvents=function(){var e=t.Browser.isPointer,i=t.Browser.touchStartEvent,n=t.Browser.touchEndEvent,a=t.Browser.touchMoveEvent,s=e?"pointerleave":"mouseleave";t.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,i,this.ganttChartMouseDown),t.EventHandler.remove(this.parent.chartPane,s,this.ganttChartLeave),t.EventHandler.remove(this.parent.chartPane,a,this.ganttChartMove),this.parent.isAdaptive&&(t.EventHandler.remove(this.parent.chartPane,r.click,this.ganttChartMouseClick),t.EventHandler.remove(this.parent.chartPane,n,this.ganttChartMouseUp)),this.parent.isAdaptive||(t.EventHandler.remove(this.parent.element,n,this.documentMouseUp),t.EventHandler.remove(document,n,this.mouseUp)),t.EventHandler.remove(this.parent.element,"mousemove",this.mouseMoveHandler),t.EventHandler.remove(document.body,"contextmenu",this.contextClick),t.EventHandler.remove(document,"mouseup",this.contextClick),t.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler)},e.prototype.getRecordByTaskBar=function(e){return this.parent.currentViewData[this.getIndexByTaskBar(e)]},e.prototype.onTabAction=function(e){this.parent.treeGrid.grid.enableHeaderFocus=this.parent.enableHeaderFocus;var i=this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit;if(this.parent.showActiveElement||i){var r=i?e.target.closest(".e-rowcell"):e.target;(r.closest(".e-rowcell")||r.closest(".e-chart-row"))&&this.parent.focusModule.setActiveElement(r),this.focusedRowIndex=r.closest(".e-rowcell")?r.parentElement.rowIndex:r.closest(".e-chart-row")?r.closest(".e-chart-row").rowIndex:-1;var n="tab"===e.action,a=this.getNextElement(r,n,i);if("noNextRow"!==a){if("string"!=typeof a){if((r.classList.contains("e-rowcell")||r.closest(".e-chart-row-cell")||r.classList.contains("e-headercell")||r.closest(".e-segmented-taskbar"))&&e.preventDefault(),n&&r.classList.contains("e-rowdragdrop"))return void this.parent.treeGrid.grid.notify("key-pressed",e);if(r.classList.contains("e-rowcell")&&a&&a.classList.contains("e-rowcell")||r.classList.contains("e-headercell"))if(n)if(this.parent.editSettings.allowNextRowEdit){var s=this.parent.currentViewData[this.focusedRowIndex],o=this.parent.ganttColumns[a.getAttribute("aria-colindex")].field;s.hasChildRecords?o===this.parent.taskFields.endDate||o===this.parent.taskFields.duration||o===this.parent.taskFields.dependency||o===this.parent.taskFields.progress||o===this.parent.taskFields.work||"taskType"===o?(this.parent.treeGrid.grid.endEdit(),this.parent.treeGrid.grid.notify("key-pressed",e)):o===this.parent.taskFields.name||o===this.parent.taskFields.startDate?this.parent.treeGrid.grid.notify("key-pressed",e):(this.parent.treeGrid.grid.notify("key-pressed",e),this.parent.treeGrid.editCell(this.focusedRowIndex,o)):this.parent.treeGrid.grid.notify("key-pressed",e)}else this.parent.treeGrid.grid.notify("key-pressed",e);else this.parent.treeGrid.grid.notify("key-pressed",e);if(!t.isNullOrUndefined(i)&&!this.parent.editModule.cellEditModule.isCellEdit&&a){if(r.classList.contains("e-rowcell")?this.manageFocus(r,"remove",!1):this.manageFocus(r,"remove",!0),a.classList.contains("e-rowcell")&&r.nextElementSibling||r.classList.contains("e-right-label-container")){if(!r.classList.contains("e-rowcell")){this.parent.treeGrid.grid.notify("key-pressed",e);var l=t.getValue("focusModule",this.parent.treeGrid.grid);l.currentInfo.element=a,l.currentInfo.elementToFocus=a,l.content.matrix.current=[a.parentElement.rowIndex,a.cellIndex]}this.manageFocus(a,"add",!1)}else this.manageFocus(a,"add",!0);this.parent.focusModule.setActiveElement(a)}}}else this.manageFocus(r,"remove",!0)}},e.prototype.getNextElement=function(e,i,r){for(var n=i?e.nextElementSibling:e.previousElementSibling;n&&n.parentElement.classList.contains("e-row");){if(!n.matches(".e-hide")&&!n.matches(".e-rowdragdrop"))return n;n=i?n.nextElementSibling:n.previousElementSibling}if(!t.isNullOrUndefined(n)&&(n.classList.contains("e-taskbar-main-container")||n.classList.contains("e-right-connectorpoint-outer-div"))){var a=this.parent.currentViewData[this.focusedRowIndex];!t.isNullOrUndefined(a.ganttProperties.segments)&&a.ganttProperties.segments.length>0&&(n=n.classList.contains("e-right-connectorpoint-outer-div")?n.parentElement.nextElementSibling:n.getElementsByClassName("e-gantt-child-taskbar-inner-div")[0])}if(this.validateNextElement(n))return n;var s=-1,o=null;if(e.classList.contains("e-rowcell")&&r&&this.parent.editSettings.allowNextRowEdit)return s=e.parentElement.rowIndex,o=this.getNextRowElement(s,i,!0),this.getChildElement(o,i);if(e.classList.contains("e-rowcell"))if(s=e.parentElement.rowIndex,i){if(o=this.parent.getRowByIndex(s),this.validateNextElement(o,"e-left-label-container"))return o.getElementsByClassName("e-left-label-container")[0];if(this.validateNextElement(o,"e-taskbar-main-container"))return o.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(o,"e-right-label-container"))return o.getElementsByClassName("e-right-label-container")[0]}else{if(o=this.getNextRowElement(s,i,!1),this.validateNextElement(o,"e-right-label-container"))return o.getElementsByClassName("e-right-label-container")[0];if(this.validateNextElement(o,"e-taskbar-main-container"))return o.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(o,"e-left-label-container"))return o.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")){s=t.closest(e,".e-chart-row").rowIndex,o=i?this.getNextRowElement(s,i,!0):this.parent.treeGrid.grid.getRowByIndex(s);return this.getChildElement(o,i)}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,i){if(e&&e.classList.contains("e-rowcell"))return!0;if(e&&i){var r=e.getElementsByClassName(i)[0];return!(!r||!r.hasChildNodes())}return!!e&&!(t.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,i,r){if(r){var n=null;if(e.classList.contains("e-left-label-container")||e.classList.contains("e-right-label-container"))n=e.getElementsByTagName("span")[0];else if(e.classList.contains("e-taskbar-main-container")||e.classList.contains("e-gantt-child-taskbar-inner-div")){var a=t.closest(e,".e-chart-row").rowIndex,s=this.parent.currentViewData[a],o=s.hasChildRecords?s.ganttProperties.isAutoSchedule?"e-gantt-parent-taskbar":"e-manualparent-main-container":s.ganttProperties.isMilestone?"e-gantt-milestone":!t.isNullOrUndefined(s.ganttProperties.segments)&&s.ganttProperties.segments.length>0?"e-segmented-taskbar":"e-gantt-child-taskbar";n=e.getElementsByClassName(o)[0],t.isNullOrUndefined(n)&&(n=e)}"add"!==i||t.isNullOrUndefined(n)?t.isNullOrUndefined(n)||(t.removeClass([n],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur()):(e.setAttribute("tabIndex","0"),t.addClass([n],"e-active-container"),e.focus(),this.focusedElement=n)}else"add"===i?(e.setAttribute("tabIndex","0"),t.addClass([e],["e-focused","e-focus"]),e.focus()):(e.setAttribute("tabIndex","-1"),t.removeClass([e],["e-focused","e-focus"]),e.blur())},e.prototype.getIndexByTaskBar=function(e){var i,r;if(i=e.classList.contains(F)?e:t.closest(e,"div."+F),t.isNullOrUndefined(i))i=t.closest(e,"tr."+X),r=[].slice.call(this.parent.chartRowsModule.ganttChartTableBody.childNodes).indexOf(i);else{var n=i.getAttribute("rowUniqueId"),a=this.parent.getRecordByID(n);r=this.parent.currentViewData.indexOf(a)}return r},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.scrollObject.destroy(),this.scrollObject=null},e}(),Ze=function(){return(Ze=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}).apply(this,arguments)},Qe=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&&!!t.isNullOrUndefined(this.parent.projectStartDate),this.parent.enablePersistence&&(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.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,t.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 i=this.checkCurrentZoomingLevel();this.isZoomIn=e,this.isZooming=!0;var r=e?i+1:i-1;this.parent.toolbarModule&&(e?r===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):r===this.parent.zoomingLevels[0].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!0)),r=this.parent.zoomingLevels.findIndex(function(e){return e.level===r});var n=this.parent.zoomingLevels[r],a={requestType:e?"beforeZoomIn":"beforeZoomOut",timeline:n,cancel:!1};this.parent.trigger("actionBegin",a),a.cancel||(n=a.timeline,this.changeTimelineSettings(n))},e.prototype.changeTimelineSettings=function(e){var i=this,r=this.isSingleTier?"None"===this.customTimelineSettings.topTier.unit?"topTier":"bottomTier":null;Object.keys(this.customTimelineSettings).forEach(function(n){if(n!==r)i.customTimelineSettings[n]="object"!=typeof e[n]||t.isNullOrUndefined(e[n])?e[n]:Ze({},e[n]);else{var a="topTier"===n?"bottomTier":"topTier";i.customTimelineSettings[a]=Ze({},e.bottomTier)}}),this.parent.isTimelineRoundOff=!this.isZoomToFit&&!!t.isNullOrUndefined(this.parent.projectStartDate),this.processTimelineUnit(),this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff);var n=this.parent.criticalPathModule;if(this.parent.enableCriticalPath&&n&&n.criticalConnectorLine(n.criticalPathCollection,n.detailPredecessorCollection,!0,n.predecessorCollectionTaskIds),this.isZooming||this.isZoomToFit){var a={requestType:this.isZoomIn?"AfterZoomIn":this.isZoomToFit?"AfterZoomToProject":"AfterZoomOut",timeline:this.parent.currentZoomingLevel};this.parent.trigger("actionComplete",a)}},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.dataOperation.calculateProjectDates(),this.parent.zoomingProjectStartDate>this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=new Date(this.parent.allowUnscheduledTasks?this.parent.zoomingProjectStartDate:this.parent.cloneProjectStartDate));var e,i,r,n=(this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime())/864e5,a=this.parent.ganttChartModule.chartElement.offsetWidth,s=a/n,o=this.parent.zoomingLevels.slice().sort(function(e,t){return e.perDayWidth<t.perDayWidth?1:-1});if(0!==s){for(var l=0;l<o.length;l++){if(i=o[l],l===o.length-1){e=o[l];break}if(r=o[l+1],s>=i.perDayWidth){e=o[l];break}if(s<i.perDayWidth&&s>r.perDayWidth){e=o[l+1];break}}var d=t.extend({},{},e,!0);this.roundOffDateToZoom(this.parent.cloneProjectStartDate,!0,s,d.bottomTier.unit),this.roundOffDateToZoom(this.parent.cloneProjectEndDate,!1,s,d.bottomTier.unit);var p=this.calculateNumberOfTimelineCells(d),h=this.parent.ganttChartModule.scrollElement.offsetHeight-17,c=this.parent.ganttChartModule.chartBodyContent.offsetHeight<=h?0:17;d.timelineUnitSize=Math.abs(a-c)/p;var u={requestType:"beforeZoomToProject",timeline:d};this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin",this.parent.controlId+"_zoomout"],!0),this.parent.trigger("actionBegin",u),this.changeTimelineSettings(d)}},e.prototype.roundOffDateToZoom=function(e,t,i,r){var n=("Month"===r||"Year"===r?60:20)/i*864e5;t?e.setTime(e.getTime()-n):e.setTime(e.getTime()+n),"Hour"===r?e.setMinutes(t?-120:120):"Minutes"===r?e.setSeconds(t?-120:120):e.setHours(t?-48:48,0,0,0)},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=["Year","Month","Week","Day","Hour","Minutes"];this.customTimelineSettings=this.customTimelineSettings?this.customTimelineSettings:this.extendFunction(this.parent.timelineSettings,["timelineViewMode","timelineUnitSize","weekStartDay","weekendBackground"],{topTier:["unit","format","count","formatter"],bottomTier:["unit","format","count","formatter"]}),-1===e.indexOf(this.customTimelineSettings.topTier.unit)&&-1===e.indexOf(this.customTimelineSettings.bottomTier.unit)?(this.customTimelineSettings.topTier.unit=-1!==e.indexOf(this.customTimelineSettings.timelineViewMode)?this.customTimelineSettings.timelineViewMode:"Week",this.customTimelineSettings.bottomTier.unit=5!==e.indexOf(this.customTimelineSettings.topTier.unit)?e[e.indexOf(this.customTimelineSettings.topTier.unit)+1]:"None"):-1!==e.indexOf(this.customTimelineSettings.topTier.unit)&&-1!==e.indexOf(this.customTimelineSettings.bottomTier.unit)&&e.indexOf(this.customTimelineSettings.topTier.unit)>e.indexOf(this.customTimelineSettings.bottomTier.unit)?this.customTimelineSettings.bottomTier.unit=this.customTimelineSettings.topTier.unit:(this.customTimelineSettings.topTier.unit=-1===e.indexOf(this.customTimelineSettings.topTier.unit)?"None":this.customTimelineSettings.topTier.unit,this.customTimelineSettings.bottomTier.unit=-1===e.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.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=this.getCurrentZoomingLevel(t,e);return this.parent.toolbarModule&&(i===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):i===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),this.parent.currentZoomingLevel=this.parent.zoomingLevels[i],i},e.prototype.getCurrentZoomingLevel=function(e,t){var i,r,n,a,s;this.parent.zoomingLevels.length||(this.parent.zoomingLevels=this.parent.getZoomingLevels());var o=this.parent.zoomingLevels.filter(function(t){return t.bottomTier.unit===e});if(0===o.length){var l=this.getClosestUnit(e,"",!1);o=this.parent.zoomingLevels.filter(function(e){return e.bottomTier.unit===l})}for(var d=o.sort(function(e,t){return e.bottomTier.count<t.bottomTier.count?1:-1}),p=0;p<d.length;p++){if(s=d[p],p===d.length-1){i=d[p].level;break}if(a=d[p+1],t>=s.bottomTier.count){r=d[p],i=(n=d.filter(function(e){return e.bottomTier.count===r.bottomTier.count})).length>1?this.checkCollectionsWidth(n):n[0].level;break}if(t<s.bottomTier.count&&t>a.bottomTier.count){r=d[p+1],i=(n=d.filter(function(e){return e.bottomTier.count===r.bottomTier.count})).length>1?this.checkCollectionsWidth(n):n[0].level;break}}return i},e.prototype.getClosestUnit=function(e,t,i){var r=["Year","Month","Week","Day","Hour","Minutes"],n=r.indexOf(e);0===n&&(i=!0),e=this.isZoomIn||i?r[n+1]:r[n-1];return 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?(t.addClass([this.parent.ganttChartModule.chartTimelineContainer],x),this.parent.treeGrid.element&&(t.addClass(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),x),t.addClass(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),x))):(t.removeClass([this.parent.ganttChartModule.chartTimelineContainer],x),this.parent.treeGrid.element&&(t.removeClass(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),x),t.removeClass(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),x))),this.previousIsSingleTier!==this.isSingleTier){var e=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.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,i,r,n,a,s=this.isSingleTier?1:2,o="None"===this.topTier?"bottomTier":"topTier";this.updateTimelineHeaderHeight(),this.topTierCollection=[],this.bottomTierCollection=[];for(var l=0;l<s;l++)n=t.createElement("table",{className:"e-timeline-header-table-container",styles:"display: block;"}),a=t.createElement("thead",{className:"e-timeline-header-table-body",styles:"display:block; border-collapse:collapse"}),e=t.createElement("tr",{innerHTML:this.createTimelineTemplate(o)}),i=t.createElement("th"),r=t.createElement("div",{styles:"width: 20px"}),i.appendChild(r),e.appendChild(i),a.appendChild(e),n.appendChild(a),this.parent.ganttChartModule.chartTimelineContainer.appendChild(n),o="bottomTier",e=null},e.prototype.validateCount=function(e,i,r){var n,a=!t.isNullOrUndefined(i)&&parseInt(i.toString(),10)>0?parseInt(i.toString(),10):1,s=Math.abs(this.timelineRoundOffEndDate.getTime()-this.timelineStartDate.getTime());switch(e){case"Year":a=a<=(n=Math.round(s/864e5/336))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Month":a=a<=(n=Math.round(s/864e5/28))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Week":a=a<=(n=Math.round(s/864e5/7))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Day":a=a<=(n=Math.round(s/864e5))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Hour":a=a<=(n=Math.round(s/36e5))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Minutes":a=a<=(n=Math.round(s/6e4))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a))}return i!==a&&this.isZooming&&this.parent.toolbarModule&&("bottomTier"===r||this.isSingleTier)&&(this.isZoomIn?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),a},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,i,r,n,a){return(a="string"==typeof a?t.getValue(a,window):a)(e,i,r,n)},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()),p=new Date(this.timelineRoundOffEndDate.toString()),h=[];do{var c={};c.startDate=new Date(d.getTime()),"Month"===o&&"bottomTier"===e&&1!=l&&0===h.length&&(r=!0),s=this.getHeaterTemplateString(new Date(d.toString()),o,e,!1,l,c,r),h.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>=p&&(s=this.getHeaterTemplateString(h[h.length-1],o,e,!0,l,c)),a+=s;var u="topTier"===e?this.topTierCollection:this.bottomTierCollection;c.endDate=new Date(d.getTime()),u.push(c)}while(d<p);return a},e.prototype.updateTimelineAfterZooming=function(e,i){var r,n,a,s=document.getElementsByClassName("e-chart-scroll-container e-content")[0];if(!t.isNullOrUndefined(s)){var o=s.offsetWidth,l=s.offsetHeight,d=document.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;if(r=Math.abs(this.timelineStartDate.getTime()-e.getTime()),r/=864e5,n="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),a=l<d?n*r+17:n*r,o>=a){var p=o-a;p=Math.round(p/n),e.setDate(e.getDate()+p),this.parent.timelineModule.timelineEndDate=e,i&&this.parent.updateProjectDates(this.timelineStartDate,this.timelineEndDate,this.parent.isTimelineRoundOff)}}},e.prototype.getTimelineRoundOffEndDate=function(e){var t="None"===this.topTier?this.bottomTier:this.topTier,i=new Date(e.toString());return this.parent.isTimelineRoundOff&&("Hour"===t?i.setMinutes(60):"Minutes"===t?i.setSeconds(60):i.setHours(24,0,0,0)),(this.isZooming||this.parent.isLoad)&&this.updateTimelineAfterZooming(i,!1),i},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,r=(a=new Date(e.getFullYear()+(t-1),11,31)).getTime()-n.getTime()+864e5;break;case"Month":n=e,r=(a=new Date(e.getFullYear(),e.getMonth()+t,1)).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,i,r,n,a,s,o){var l,d="",p="",h="topTier"===r?this.parent.timelineModule.customTimelineSettings.topTier.format:this.parent.timelineModule.customTimelineSettings.bottomTier.format,c="topTier"===r?this.parent.timelineModule.customTimelineSettings.topTier.formatter:this.parent.timelineModule.customTimelineSettings.bottomTier.formatter,u=t.isNullOrUndefined(c)?this.parent.globalize.formatDate(e,{format:this.parent.getDateFormat()}):this.customFormat(e,h,r,i,c),g=l=this.getIncrement(e,a,i)/864e5*this.parent.perDayWidth;l=n||o?n?this.calculateWidthBetweenTwoDate(i,e,this.timelineRoundOffEndDate):this.calculateWidthBetweenTwoDate(i,e,this.calculateQuarterEndDate(e,a)):l;var f=this.isWeekendHeaderCell(i,r,e),m="topTier"===r?" e-gantt-top-cell-text":"",y=t.isNullOrUndefined(c)?this.formatDateHeader(h,e):this.customFormat(e,h,r,i,c);return p+=this.parent.timelineModule.isSingleTier?'<th class="e-timeline-single-header-cell ':'<th class="e-timeline-top-header-cell',p+=f?" e-weekend-header-cell":"",p+='" tabindex="-1" aria-label= "'+this.parent.localeObj.getConstant("timelineCell")+" "+u,p+='" style="width:'+l+"px;",p+=f&&this.customTimelineSettings.weekendBackground?"background-color:"+this.customTimelineSettings.weekendBackground+";":"",p+='"><div class="e-header-cell-label'+m+'" style="width:'+(l-1)+"px;"+(this.parent.timelineSettings.showTooltip?'"title="'+u:""),p+='">'+y+"</div>",d+=p,d+="</th>",!this.isSingleTier&&"topTier"!==r||n?(this.isSingleTier||"topTier"===r)&&n&&(this.totalTimelineWidth=this.totalTimelineWidth-g+l):this.totalTimelineWidth=this.totalTimelineWidth+l,s.value=y,s.isWeekend=f,s.width=g,d},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()+6+r;t.setDate(a)}"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,i){if(e[0].length>=1)for(var r=0;r<e.length;r++){var a=e[r],s=a.filter(function(e){return!t.isNullOrUndefined(e.ganttProperties.startDate)}),o=a.filter(function(e){return!t.isNullOrUndefined(e.ganttProperties.endDate)}),l=s.length>0?new Date(n.DataUtil.aggregates.min(s,"ganttProperties.startDate")):null,d=o.length>0?new Date(n.DataUtil.aggregates.max(o,"ganttProperties.endDate")):null,p=new Date(this.parent.dataOperation.checkStartDate(this.timelineStartDate).getTime()),h=new Date(this.parent.dataOperation.checkEndDate(this.timelineEndDate).getTime()),c=t.isNullOrUndefined(l)?null:this.parent.dataOperation.getTaskLeft(l,!1),u=t.isNullOrUndefined(d)?null:this.parent.dataOperation.getTaskLeft(d,!1),g=this.parent.dataOperation.getTaskLeft(p,!1),f=this.parent.dataOperation.getTaskLeft(h,!1),m=void 0;!t.isNullOrUndefined(c)&&(c<this.bottomTierCellWidth||c<=g)?(m="prevTimeSpan",l=l>this.timelineStartDate?this.timelineStartDate:l):l=this.timelineStartDate,!t.isNullOrUndefined(u)&&(u>=this.totalTimelineWidth-this.bottomTierCellWidth||u>=f)?(m="prevTimeSpan"===m?"both":"nextTimeSpan",d=d<this.timelineEndDate?this.timelineEndDate:d):d=this.timelineEndDate,m?this.performTimeSpanAction(m,i,l,d):t.isNullOrUndefined(a[0].ganttProperties.segments)||this.parent.dataOperation.updateWidthLeft(a[0]);break}},e.prototype.performTimeSpanAction=function(e,i,r,n,a){a=t.isNullOrUndefined(a)?"None"===this.parent.timelineModule.topTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier:a;var s=new Date(this.parent.cloneProjectStartDate.getTime()),o=new Date(this.parent.cloneProjectEndDate.getTime());"publicMethod"!==i&&"both"===e?(this.updateScheduleDatesByToolBar(a,"prevTimeSpan",r,n),this.updateScheduleDatesByToolBar(a,"nextTimeSpan",new Date(this.parent.cloneProjectStartDate.getTime()),n)):this.updateScheduleDatesByToolBar(a,e,r,n);var l=this.timeSpanActionEvent("actionBegin",e,i);if(l.cancel)this.parent.cloneProjectStartDate=s,this.parent.cloneProjectEndDate=o;else{if(this.parent.updateProjectDates(l.projectStartDate,l.ProjectEndDate,l.isTimelineRoundOff,i),"prevTimeSpan"===e&&"publicMethod"===i)this.parent.ganttChartModule.updateScrollLeft(0);else if("nextTimeSpan"===e&&"publicMethod"===i||"nextTimeSpan"===e&&"TaskbarEditing"===i){var d=document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollLeft;this.parent.element.querySelector(".e-timeline-header-container").scrollLeft=d}this.parent.timelineModule.timeSpanActionEvent("actionComplete",e,i)}},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}(),Ke=function(){return function(e){this.allowEditing=!0,this.allowReordering=!0,this.allowResizing=!0,this.allowSorting=!0,this.allowFiltering=!0,this.edit={},t.merge(this,e)}}(),Je=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)},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 a.TreeGrid,this.parent.treeGrid.allowSelection=!1,this.parent.treeGrid.allowKeyboard=this.parent.allowKeyboard,this.parent.treeGrid.enableImmutableMode=this.parent.enableImmutableMode,this.treeGridColumns=[],this.validateGanttColumns(),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=t.createElement("div",{id:"treeGrid"+this.parent.element.id,className:"e-gantt-tree-grid"});var e=t.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.wireEvents()},e.prototype.composeProperties=function(){if(this.parent.treeGrid.showColumnMenu=this.parent.showColumnMenu,this.parent.treeGrid.columnMenuItems=this.parent.columnMenuItems,this.parent.treeGrid.childMapping=t.isNullOrUndefined(this.parent.taskFields.child)?"":this.parent.taskFields.child,this.parent.treeGrid.treeColumnIndex=this.parent.treeColumnIndex,this.parent.treeGrid.columns=this.treeGridColumns,this.parent.dataSource instanceof Object&&m(this.parent)){this.parent.treeGrid.hasChildMapping="isParent";var e=t.getValue("count",this.parent.dataSource);this.parent.treeGrid.dataSource={result:this.parent.flatData,count:e}}else 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;var i=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(i=this.parent.toolbarModule.element.offsetHeight),this.parent.treeGrid.height=this.parent.ganttHeight-i-46},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?t.getValue("virtualScrollModule.visualData",this.parent.treeGrid):t.getValue("result",e),this.parent.virtualScrollModule&&this.parent.enableVirtualization&&this.parent.updateContentHeight(e),t.setValue("contentModule.objectEqualityChecker",this.objectEqualityChecker,this.parent.treeGrid.grid)},e.prototype.dataBound=function(e){this.ensureScrollBar(),this.parent.treeDataBound(e),this.prevCurrentView=t.extend([],[],this.parent.currentViewData,!0)},e.prototype.dataStateChange=function(e){e.action&&"refresh"===e.action.requestType&&(this.parent.treeGrid.dataSource={result:t.getValue("result",this.parent.treeGrid.dataSource),count:t.getValue("count",this.parent.treeGrid.dataSource)}),this.parent.trigger("dataStateChange",e)},e.prototype.collapsing=function(e){new n.Deferred;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){var i=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.collapseGanttRow(i),t.setValue("cancel",t.getValue("cancel",i),e)}},e.prototype.expanding=function(e){new n.Deferred;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){var i=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.expandGanttRow(i),t.setValue("cancel",t.getValue("cancel",i),e)}},e.prototype.collapsed=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var t=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.collapsedGanttRow(t)}},e.prototype.expanded=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod&&!e.data.length){var t=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.expandedGanttRow(t)}},e.prototype.actionBegin=function(e){this.parent.notify("actionBegin",e);null!==t.getValue("doubleClickTarget",this.parent.treeGrid.editModule)&&t.setValue("doubleClickTarget",null,this.parent.treeGrid.editModule),this.parent.trigger("actionBegin",e)},e.prototype.created=function(e){this.updateKeyConfigSettings()},e.prototype.actionFailure=function(e){this.parent.trigger("actionFailure",e)},e.prototype.createExpandCollapseArgs=function(e){var i=t.getValue("data",e);return{data:i,gridRow:t.getValue("row",e),chartRow:this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(i)],cancel:!1}},e.prototype.treeActionComplete=function(e){var i=t.extend({},e);if("sorting"===t.getValue("requestType",e))this.parent.notify("updateModel",{}),t.deleteObject(i,"isFrozen");else if("filtering"===t.getValue("requestType",e)){this.parent.notify("updateModel",{});this.parent.element.querySelector(".e-treegrid").focus()}else if("save"===t.getValue("type",e)&&this.parent.editModule&&this.parent.editModule.cellEditModule){var r=t.getValue("data",e);t.isNullOrUndefined(r)||t.isNullOrUndefined(this.parent.getTaskByUniqueID(r.uniqueID))||(this.parent.getTaskByUniqueID(r.uniqueID).taskData[this.parent.taskFields.duration]=r.taskData[this.parent.taskFields.duration],t.isNullOrUndefined(r.taskData[this.parent.taskFields.resourceInfo])||(this.parent.getTaskByUniqueID(r.uniqueID).taskData[this.parent.taskFields.resourceInfo]=r.taskData[this.parent.taskFields.resourceInfo])),this.parent.editModule.cellEditModule.initiateCellEdit(e,this.currentEditRow),this.currentEditRow={}}"filterafteropen"===t.getValue("requestType",e)&&this.parent.notify("actionComplete",e),"searching"===t.getValue("requestType",e)&&this.parent.notify("actionComplete",e),t.isNullOrUndefined(t.getValue("batchChanges",e))||t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.parent.isCancelled&&(t.setValue("requestType","cancel",i),t.setValue("action","CellEditing",i),this.parent.isCancelled=!1),"refresh"===t.getValue("requestType",e)&&t.isNullOrUndefined(t.getValue("type",e))&&this.parent.addDeleteRecord&&(-1!=this.parent.selectedRowIndex?(this.parent.selectRow(this.parent.selectedRowIndex),this.parent.selectedRowIndex>this.parent.currentViewData.length-1&&(this.parent.selectedRowIndex=-1)):this.parent.selectRow(0),this.parent.addDeleteRecord=!1),this.parent.trigger("actionComplete",i)},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&&t.EventHandler.add(e,"scroll",this.scrollHandler,this),this.parent.isAdaptive&&t.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&&t.EventHandler.remove(e,"scroll",this.scrollHandler),this.parent.isAdaptive&&t.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,i=e.columns.length,r=this.parent.taskFields;this.parent.columnMapping={},this.parent.columnByField={},this.parent.customColumns=[];for(var n=["id","name","startDate","endDate","duration","dependency","progress","baselineStartDate","baselineEndDate","resourceInfo","notes","work","manual","type"],a=function(t){var i={};"string"==typeof e.columns[t]?i.field=e.columns[t]:i=e.columns[t];var a=[];if(n.length>0&&(a=n.filter(function(e){return i.field===r[e]})),0===a.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=n.indexOf(a[0]);n.splice(o,1),s.createTreeGridColumn(i,!0),s.parent.columnMapping[a[0]]=i.field},s=this,o=0;o<i;o++)a(o);for(var l=0;l<n.length;l++){var d={};t.isNullOrUndefined(r[n[l]])||(d.field=r[n[l]],this.createTreeGridColumn(d,0===i),this.parent.columnMapping[n[l]]=d.field)}if("ProjectView"!==this.parent.viewType){d={};this.composeUniqueIDColumn(d),this.createTreeGridColumn(d,!0)}},e.prototype.createTreeGridColumn=function(e,i){var r=this.parent.taskFields;if(e.disableHtmlEncode=t.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)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)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={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.endDate===e.field)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={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.duration===e.field)e.width=e.width?e.width:150,e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("duration"),e.valueAccessor=e.valueAccessor?e.valueAccessor:t.isNullOrUndefined(e.edit)?this.durationValueAccessor.bind(this):null,e.editType=e.editType?e.editType:"stringedit",e.type="string";else if(r.progress===e.field)this.composeProgressColumn(e);else if(r.dependency===e.field)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)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 a=r.baselineEndDate===e.field?"baselineEndDate":"baselineStartDate";e.width=e.width?e.width:150,e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant(a),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?(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?(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&&(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 n.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,i)},e.prototype.composeResourceColumn=function(e){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 i=t.getValue(this.parent.taskFields.resourceInfo,e.taskData),r=[];if(t.isNullOrUndefined(i))return i;for(var n=0;n<i.length;n++)r.push("object"==typeof i[n]?i[n][this.parent.resourceFields.id]:i[n]);return r},e.prototype.composeIDColumn=function(e){var t="ProjectView"===this.parent.viewType;e.isPrimaryKey=!!t,e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("id"),e.width=e.width?e.width:100,e.allowEditing=!!e.allowEditing&&e.allowEditing,e.editType=e.editType?e.editType:"numericedit",e.valueAccessor=t?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){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 s=a[n];i[s]=r[s]=e[s]}this.parent.columnByField[r.field]=r,this.parent.ganttColumns.push(new Ke(r)),t&&this.treeGridColumns.push(i)},e.prototype.durationValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":this.parent.dataOperation.getDurationString(n.duration,n.durationUnit)},e.prototype.resourceValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":n.resourceNames},e.prototype.workValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":this.parent.dataOperation.getWorkString(n.work,n.workUnit)},e.prototype.taskTypeValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":n.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){this.treeGridElement.querySelector(".e-content").scrollTop=t.getValue("top",e),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}(),$e=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)}}(),et=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},tt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $e(i,e),et([t.Property(null)],i.prototype,"from",void 0),et([t.Property(null)],i.prototype,"to",void 0),i}(t.ChildProperty),it=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)}}(),rt=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},nt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return it(i,e),rt([t.Property(null)],i.prototype,"type",void 0),rt([t.Property(null)],i.prototype,"headerText",void 0),rt([t.Property([])],i.prototype,"fields",void 0),i}(t.ChildProperty),at=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)}}(),st=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},ot=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),st([t.Property(null)],i.prototype,"type",void 0),st([t.Property(null)],i.prototype,"headerText",void 0),st([t.Property([])],i.prototype,"fields",void 0),i}(t.ChildProperty),lt=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)}}(),dt=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},pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return lt(i,e),dt([t.Property(!1)],i.prototype,"allowEditing",void 0),dt([t.Property(!1)],i.prototype,"allowAdding",void 0),dt([t.Property(!1)],i.prototype,"allowDeleting",void 0),dt([t.Property("Auto")],i.prototype,"mode",void 0),dt([t.Property("Top")],i.prototype,"newRowPosition",void 0),dt([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),dt([t.Property(!1)],i.prototype,"allowTaskbarEditing",void 0),dt([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),ht=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)}}(),ct=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},ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ht(i,e),ct([t.Property(null)],i.prototype,"day",void 0),ct([t.Property(null)],i.prototype,"label",void 0),ct([t.Property(null)],i.prototype,"cssClass",void 0),i}(t.ChildProperty),gt=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)}}(),ft=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},mt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return gt(i,e),ft([t.Collection([],r.Predicate)],i.prototype,"columns",void 0),ft([t.Property("Menu")],i.prototype,"type",void 0),ft([t.Property()],i.prototype,"operators",void 0),ft([t.Property(!1)],i.prototype,"ignoreAccent",void 0),ft([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),yt=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)}}(),vt=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},Dt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return yt(i,e),vt([t.Property([])],i.prototype,"fields",void 0),vt([t.Property(!1)],i.prototype,"ignoreCase",void 0),vt([t.Property("contains")],i.prototype,"operator",void 0),vt([t.Property("")],i.prototype,"key",void 0),vt([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),wt=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)}}(),kt=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},Tt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wt(i,e),kt([t.Property(null)],i.prototype,"from",void 0),kt([t.Property(null)],i.prototype,"to",void 0),kt([t.Property(null)],i.prototype,"label",void 0),kt([t.Property(null)],i.prototype,"cssClass",void 0),i}(t.ChildProperty),St=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)}}(),bt=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},Pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return St(i,e),bt([t.Property(null)],i.prototype,"rightLabel",void 0),bt([t.Property(null)],i.prototype,"leftLabel",void 0),bt([t.Property(null)],i.prototype,"taskLabel",void 0),i}(t.ChildProperty),Ct=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)}}(),Mt=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},Rt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ct(i,e),Mt([t.Property("Row")],i.prototype,"mode",void 0),Mt([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),Mt([t.Property("Single")],i.prototype,"type",void 0),Mt([t.Property(!1)],i.prototype,"persistSelection",void 0),Mt([t.Property(!1)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Ot=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)}}(),xt=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},It=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ot(i,e),xt([t.Property(null)],i.prototype,"position",void 0),xt([t.Property(-1)],i.prototype,"columnIndex",void 0),xt([t.Property(4)],i.prototype,"separatorSize",void 0),xt([t.Property(null)],i.prototype,"minimum",void 0),xt([t.Property("Default")],i.prototype,"view",void 0),i}(t.ChildProperty),Et=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)}}(),Ft=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},Ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Et(i,e),Ft([t.Property(null)],i.prototype,"id",void 0),Ft([t.Property(null)],i.prototype,"name",void 0),Ft([t.Property(null)],i.prototype,"parentID",void 0),Ft([t.Property(null)],i.prototype,"startDate",void 0),Ft([t.Property(null)],i.prototype,"endDate",void 0),Ft([t.Property(null)],i.prototype,"dependency",void 0),Ft([t.Property(null)],i.prototype,"progress",void 0),Ft([t.Property(null)],i.prototype,"child",void 0),Ft([t.Property(null)],i.prototype,"milestone",void 0),Ft([t.Property(null)],i.prototype,"duration",void 0),Ft([t.Property(null)],i.prototype,"durationUnit",void 0),Ft([t.Property(null)],i.prototype,"cssClass",void 0),Ft([t.Property(null)],i.prototype,"baselineStartDate",void 0),Ft([t.Property(null)],i.prototype,"baselineEndDate",void 0),Ft([t.Property(null)],i.prototype,"resourceInfo",void 0),Ft([t.Property(null)],i.prototype,"expandState",void 0),Ft([t.Property(null)],i.prototype,"indicators",void 0),Ft([t.Property(null)],i.prototype,"notes",void 0),Ft([t.Property(null)],i.prototype,"work",void 0),Ft([t.Property(null)],i.prototype,"manual",void 0),Ft([t.Property(null)],i.prototype,"type",void 0),Ft([t.Property(null)],i.prototype,"segments",void 0),Ft([t.Property(null)],i.prototype,"segmentId",void 0),i}(t.ChildProperty),Vt=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)}}(),Lt=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},Nt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),Lt([t.Property("")],i.prototype,"format",void 0),Lt([t.Property("None")],i.prototype,"unit",void 0),Lt([t.Property(1)],i.prototype,"count",void 0),Lt([t.Property(null)],i.prototype,"formatter",void 0),i}(t.ChildProperty),Bt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),Lt([t.Property("Week")],i.prototype,"timelineViewMode",void 0),Lt([t.Complex({},Nt)],i.prototype,"topTier",void 0),Lt([t.Complex({},Nt)],i.prototype,"bottomTier",void 0),Lt([t.Property(33)],i.prototype,"timelineUnitSize",void 0),Lt([t.Property(0)],i.prototype,"weekStartDay",void 0),Lt([t.Property(null)],i.prototype,"weekendBackground",void 0),Lt([t.Property(!0)],i.prototype,"showTooltip",void 0),Lt([t.Property(!0)],i.prototype,"updateTimescaleView",void 0),i}(t.ChildProperty),At=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)}}(),Ht=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},Wt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return At(i,e),Ht([t.Property(!0)],i.prototype,"showTooltip",void 0),Ht([t.Property()],i.prototype,"taskbar",void 0),Ht([t.Property()],i.prototype,"baseline",void 0),Ht([t.Property()],i.prototype,"connectorLine",void 0),Ht([t.Property()],i.prototype,"editing",void 0),i}(t.ChildProperty),jt=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)}}(),Gt=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},qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),Gt([t.Property()],i.prototype,"field",void 0),Gt([t.Property()],i.prototype,"direction",void 0),i}(t.ChildProperty),zt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),Gt([t.Collection([],qt)],i.prototype,"columns",void 0),Gt([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),_t=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)}}(),Xt=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},Yt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _t(i,e),Xt([t.Property(null)],i.prototype,"id",void 0),Xt([t.Property(null)],i.prototype,"name",void 0),Xt([t.Property(null)],i.prototype,"unit",void 0),Xt([t.Property(null)],i.prototype,"group",void 0),i}(t.ChildProperty),Zt=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)}}(),Qt=function(e){function i(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 Zt(i,e),i.prototype.initPublicProp=function(){this.ganttChartTableBody=null},i.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createChartTable,this),this.parent.on("dataReady",this.initiateTemplates,this),this.parent.on("destroy",this.destroy,this)},i.prototype.refreshChartByTimeline=function(){this.taskTable.style.width=t.formatUnit(this.parent.timelineModule.totalTimelineWidth);var e=t.getValue("prevProjectStartDate",this.parent.dataOperation),i=!1;e&&(i=e.getTime()===this.parent.cloneProjectStartDate.getTime()),this.isUpdated=!!(this.parent.isFromOnPropertyChange&&i&&t.getValue("mutableData",this.parent.treeGrid.grid.contentModule)),this.refreshGanttRows(),this.isUpdated=!0},i.prototype.createChartTable=function(){this.taskTable=t.createElement("table",{className:"e-task-table e-zero-spacing",id:"GanttTaskTable"+this.parent.element.id,styles:"z-index: 2;position: absolute;width:"+this.parent.timelineModule.totalTimelineWidth+"px;",attrs:{cellspacing:"0.25px"}});var e=t.createElement("colgroup"),i=t.createElement("col",{styles:"width:"+this.parent.timelineModule.totalTimelineWidth+"px;"});e.appendChild(i),this.taskTable.appendChild(e),this.ganttChartTableBody=t.createElement("tbody",{id:this.parent.element.id+"GanttTaskTableBody"}),this.taskTable.appendChild(this.ganttChartTableBody),this.parent.ganttChartModule.chartBodyContent.appendChild(this.taskTable)},i.prototype.initiateTemplates=function(){this.taskTable.style.width=t.formatUnit(this.parent.timelineModule.totalTimelineWidth),this.initChartHelperPrivateVariable(),this.initializeChartTemplate()},i.prototype.renderChartRows=function(){this.createTaskbarTemplate(),this.parent.isGanttChartRendered=!0},i.prototype.getIndicatorNode=function(e){var t='<label class="e-label e-indicator-span" role="LabelIndicator" style="line-height:'+this.parent.rowHeight+"px;left:"+this.getIndicatorleft(e.date)+'px;"><i class="'+e.iconClass+'"></i> </label>';return this.createDivElement(t)},i.prototype.getIndicatorleft=function(e){e=this.parent.dateValidationModule.getDateFromFormat(e);return this.parent.dataOperation.getTaskLeft(e,!1)},i.prototype.getChildTaskbarNode=function(e,i){var r=null,n=this.templateData;if(this.childTaskbarTemplateFunction)r=this.childTaskbarTemplateFunction(t.extend({index:e},n),this.parent,"TaskbarTemplate",this.getTemplateID("TaskbarTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var a="",s="",o=void 0,l=void 0;n.ganttProperties.startDate&&n.ganttProperties.endDate&&n.ganttProperties.duration&&(o=this.createDivElement('<div class="'+V+" "+ee+" "+(n.ganttProperties.isAutoSchedule?"":oe)+'"style="width:'+n.ganttProperties.width+"px;height:"+this.taskBarHeight+'px;"></div>'),l=this.createDivElement('<div class="'+L+" "+te+" "+(n.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualprogressbar")+'" style="border-style:'+(n.ganttProperties.progressWidth?"solid;":"none;")+"width:"+n.ganttProperties.progressWidth+"px;height:100%;border-top-right-radius:"+this.getBorderRadius(n.ganttProperties)+"px;border-bottom-right-radius:"+this.getBorderRadius(n.ganttProperties)+'px;"></div>'));var d=t.createElement("div");if(this.taskLabelTemplateFunction&&!t.isNullOrUndefined(l)&&l.length>0){var p=this.taskLabelTemplateFunction(t.extend({index:e},n),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,l[0]);p&&p.length>0&&(d.appendChild(p[0]),a=d.innerHTML)}else a="isCustomTemplate"===(a=this.getTaskLabel(this.parent.labelSettings.taskLabel))?this.parent.labelSettings.taskLabel:a;-1===a.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(a=""),s=isNaN(parseInt(a))?'<span class="'+U+'" style="line-height:'+(this.taskBarHeight-1)+"px; text-align: left;display:inline-block;width:"+(n.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;">'+a+"</span>":'<span class="'+U+'" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"text-align: left;":"")+ +("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+ +("ResourceView"===this.parent.viewType?n.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;">'+a+"</span>");var h=!t.isNullOrUndefined(n.ganttProperties.segments)&&n.ganttProperties.segments.length>0?this.splitTaskbar(n,a):n.ganttProperties.startDate&&n.ganttProperties.endDate&&n.ganttProperties.duration?s:!n.ganttProperties.startDate||n.ganttProperties.endDate||n.ganttProperties.duration?!n.ganttProperties.endDate||n.ganttProperties.startDate||n.ganttProperties.duration?!n.ganttProperties.duration||n.ganttProperties.startDate||n.ganttProperties.endDate?"":'<div class="'+L+" "+ee+" e-gantt-unscheduled-taskbar "+(n.ganttProperties.isAutoSchedule?"":oe)+'"style="left:'+n.ganttProperties.left+"px; width:"+n.ganttProperties.width+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+L+" "+ee+" "+ye+" "+(n.ganttProperties.isAutoSchedule?"":oe)+'"style="left:'+n.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+L+" "+ee+" "+me+" "+(n.ganttProperties.isAutoSchedule?"":oe)+'"style="left:'+n.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>';if(n.ganttProperties.startDate&&n.ganttProperties.endDate&&n.ganttProperties.duration&&(t.isNullOrUndefined(n.ganttProperties.segments)||!t.isNullOrUndefined(n.ganttProperties.segments)&&0===n.ganttProperties.segments.length)){if(""!==h&&!t.isNullOrUndefined(l)&&l.length>0){var c=this.createDivElement(h)[0],u=this.parent.labelSettings.taskLabel;u&&u.elementRef&&c.appendChild(d),l[0].appendChild(c),""!==l[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(u)&&l[0].querySelectorAll(".e-task-label")[0].children[0]&&l[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""==l[0].querySelectorAll(".e-task-label")[0].textContent&&u&&!u.elementRef&&""!==d.innerHTML&&(l[0].querySelectorAll(".e-task-label")[0].textContent=u)}!t.isNullOrUndefined(o)&&o.length>0&&o[0].appendChild([].slice.call(l)[0]),r=o}else r=this.createDivElement(h)}return r},i.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 s=0===r?"e-segment-first":r===e.ganttProperties.segments.length-1?"e-segment-last":"e-segment-inprogress";i+='<div class="'+V+" "+s+" "+ee+' e-segmented-taskbar"style="width:'+n.width+"px;position: absolute; 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="'+L+" "+te+' " style="border-style:'+(n.progressWidth?"solid;":"none;")+"display:"+(n.progressWidth>=0?"block;":"none;")+"width:"+n.progressWidth+"px;height:100%;border-top-right-radius:"+this.getSplitTaskBorderRadius(n)+"px;border-bottom-right-radius:"+this.getSplitTaskBorderRadius(n)+'px;"><span class="'+U+'" 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},i.prototype.getSplitTaskbarLeftResizerNode=function(){var e=-(this.parent.isAdaptive?12:2);return'<div class="'+Y+' e-icon" style="left:'+e+"px;height:"+this.taskBarHeight+'px;"></div>'},i.prototype.getSplitTaskbarRightResizerNode=function(e){var t=this.parent.isAdaptive?-2:-10;return'<div class="'+Z+' e-icon" style="left:'+(e.width+t)+"px;height:"+this.taskBarHeight+'px;"></div>'},i.prototype.getSplitProgressResizerNode=function(e){return'<div class="'+Q+'" style="left:'+(e.progressWidth-6)+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+K+'"><div class="'+J+'"></div><div class="'+$+'"></div></div>'},i.prototype.getSegmentIndex=function(e,i){var r=-1,n=i.ganttProperties,a=n.segments;if(!t.isNullOrUndefined(a)){a.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()});for(var s=a.length,o=0;o<s;o++){var l=a[o];if(e.getTime()===n.startDate.getTime())this.dropSplit=!0,r=0;else if(e.getTime()===l.startDate.getTime()){this.dropSplit=!0;var d=l.startDate;d.setDate(d.getDate()+1),d=l.startDate=this.parent.dataOperation.checkStartDate(d,n,!1),l.startDate=d;var p=l.endDate;p=this.parent.dataOperation.getEndDate(d,l.duration,n.durationUnit,n,!1),l.endDate=p,o===a.length-1&&this.parent.setRecordValue("endDate",p,n,!0),this.incrementSegments(a,o,i),r=l.segmentIndex}else l.endDate=this.parent.dataOperation.getEndDate(l.startDate,l.duration,n.durationUnit,n,!1),e.getTime()>=l.startDate.getTime()&&e.getTime()<=l.endDate.getTime()&&(r=l.segmentIndex);this.parent.setRecordValue("segments",n.segments,n,!0)}}return-1===r&&(this.dropSplit=!0),r},i.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,p=this.parent.dataOperation.getEndDate(o.startDate,d,n.ganttProperties.durationUnit,n.ganttProperties,!1),h={startDate:o.startDate,endDate:p,duration:d},c=t[s].firstSegmentIndex;a.splice(c,2,h),this.parent.setRecordValue("segments",a,n.ganttProperties,!0),this.parent.dataOperation.updateMappingData(n,"segments"),1===a.length?(this.parent.setRecordValue("endDate",p,n.ganttProperties,!0),this.parent.setRecordValue("EndDate",p,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")},i.prototype.refreshChartAfterSegment=function(e,i){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 r=this.ganttChartTableBody.querySelectorAll("tr")[this.parent.currentViewData.indexOf(e)],n={requestType:i,rowData:e};this.triggerQueryTaskbarInfoByIndex(r,e),this.parent.selectionModule.clearSelection();var a=n.rowData.taskData[this.parent.taskFields.segments];if(this.parent.timezone&&null!=a)for(var s=0;s<a.length;s++)a[s][this.parent.taskFields.startDate]=this.parent.dateValidationModule.remove(n.rowData.ganttProperties.segments[s].startDate,this.parent.timezone),this.parent.taskFields.endDate&&(a[s][this.parent.taskFields.endDate]=this.parent.dateValidationModule.remove(n.rowData.ganttProperties.segments[s].endDate,this.parent.timezone));this.parent.trigger("actionComplete",n),t.setValue("isEdit",!1,this.parent.contextMenuModule),t.setValue("isEdit",!1,this.parent)},i.prototype.splitTask=function(e,i){var r=this.parent.taskFields,n=i,a=this.parent.flatData.filter(function(t){return t[r.id]===e?t:null})[0],s=a.ganttProperties;this.dropSplit=!1;var o=-1,l=s.segments;if(t.isNullOrUndefined(i.length)||i.length<0){var d=this.parent.dataOperation.checkStartDate(n,s,!1);if(d.getTime()!==s.startDate.getTime()&&s.isAutoSchedule){if(t.isNullOrUndefined(l)||(o=this.getSegmentIndex(d,a)),!1===this.dropSplit&&n.getTime()>s.startDate.getTime()&&n.getTime()<s.endDate.getTime()){l=-1!==o?l:[];var p=-1!==o?l[o].startDate:new Date(s.startDate.getTime()),h=-1!==o?l[o].endDate:new Date(s.endDate.getTime()),c=this.parent.dataOperation.getDuration(p,h,s.durationUnit,s.isAutoSchedule,s.isMilestone);this.parent.setRecordValue("segments",this.splitSegmentedTaskbar(p,h,n,o,l,a,c),s,!0),-1!==o&&this.incrementSegments(l,o+1,a),this.parent.setRecordValue("endDate",l[l.length-1].endDate,s,!0),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(a,"endDate")}this.refreshChartAfterSegment(a,"splitTaskbar")}}else i.sort(function(e,t){return e.getTime()-t.getTime()}),this.parent.setRecordValue("segments",this.constructSegments(i,a.ganttProperties),a.ganttProperties,!0),this.refreshChartAfterSegment(a,"splitTask")},i.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())).setDate(e[o].getDate()+1);return a},i.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 p=new Date(i.getTime());p=this.parent.dataOperation.checkEndDate(p,o,!1);for(var h=0;h<2;h++){var c={startDate:e,endDate:p,duration:this.parent.dataOperation.getDuration(e,p,o.durationUnit,o.isAutoSchedule,o.isMilestone),offsetDuration:1},u=this.parent.nonWorkingDayIndex.indexOf(p.getDay());-1!==r&&(n.splice(r,1),r=-1),n.push(c);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),v=e.getTime()+y;e.setTime(v+d),p=new Date(t.getTime()),y=this.parent.timelineModule.getIncrement(p,f,m),v=p.getTime()+y,p.setTime(v+d)}else(e=new Date(i.getTime())).setDate(e.getDate()+1+d),this.setTime(this.parent.defaultStartTime,e),e=this.parent.dataOperation.checkStartDate(e,o,!1),(p=new Date(t.getTime())).setDate(p.getDate()+1);if(-1!==u){var D=s-c.duration;p=this.parent.dataOperation.getEndDate(e,D,o.durationUnit,o,!1)}else p=this.parent.dataOperation.checkEndDate(p,o,!1)}return n.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),n},i.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")},i.prototype.getMilestoneNode=function(e,i){var r=null,n=this.templateData;if(this.milestoneTemplateFunction)r=this.milestoneTemplateFunction(t.extend({index:e},n),this.parent,"MilestoneTemplate",this.getTemplateID("MilestoneTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var a='<div class="e-gantt-milestone" style="position:absolute;"><div class="e-milestone-top '+(n.ganttProperties.startDate||n.ganttProperties.endDate?"":"e-unscheduled-milestone-top")+'" style="border-right-width:'+this.milesStoneRadius+"px;border-left-width:"+this.milesStoneRadius+"px;border-bottom-width:"+this.milesStoneRadius+'px;"></div><div class="'+A+" "+(n.ganttProperties.startDate||n.ganttProperties.endDate?"":"e-unscheduled-milestone-bottom")+'" style="top:'+this.milesStoneRadius+"px;border-right-width:"+this.milesStoneRadius+"px; border-left-width:"+this.milesStoneRadius+"px; border-top-width:"+this.milesStoneRadius+'px;"></div></div>';r=this.createDivElement(a)}return r},i.prototype.getTaskBaselineNode=function(){var e=this.templateData,t='<div class="'+j+' " role="BaselineBar" style="margin-top:'+this.baselineTop+"px;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)},i.prototype.getMilestoneBaselineNode=function(){var e=this.templateData,t=this.parent.renderBaseline?5:2,i='<div class="e-baseline-gantt-milestone-container " style="left:'+(e.ganttProperties.baselineLeft-this.milesStoneRadius)+"px;margin-top:"+(-Math.floor(this.parent.rowHeight-this.milestoneMarginTop)+t)+'px"><div class="'+G+'"><div class="'+G+" "+q+'" style="top:'+-this.milestoneHeight+"px;border-right:"+this.milesStoneRadius+"px solid transparent;border-left:"+this.milesStoneRadius+"px solid transparent;border-top:0pxsolid transparent;border-bottom-width:"+this.milesStoneRadius+"px;border-bottom-style: solid;"+(this.baselineColor?"border-bottom-color: "+this.baselineColor+";":"")+'"></div><div class="'+G+" "+z+'" style="top:'+(this.milesStoneRadius-this.milestoneHeight)+"px;border-right:"+this.milesStoneRadius+"px solid transparent;border-left:"+this.milesStoneRadius+"px solid transparent;border-bottom:0pxsolid transparent;border-top-width:"+this.milesStoneRadius+"px;border-top-style: solid;"+(this.baselineColor?"border-top-color: "+this.baselineColor+";":"")+'"></div></div></div>';return this.createDivElement(i)},i.prototype.getLeftLabelNode=function(e){var i=this.leftLabelContainer();""!==this.generateTaskLabelAriaLabel("left")&&i[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("left"));var r=null;if(this.leftTaskLabelTemplateFunction)r=this.leftTaskLabelTemplateFunction(t.extend({index:e},this.templateData),this.parent,"LeftLabelTemplate",this.getTemplateID("LeftLabelTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var n=this.parent.labelSettings.leftLabel,a=this.getTaskLabel(n);a&&(a="isCustomTemplate"===a?n:a,r=this.getLableText(a,"e-left-label-inner-div"))}return r&&r.length>0&&("null"===r[0].data&&(r[0].data=""),i[0].appendChild([].slice.call(r)[0])),i},i.prototype.getLableText=function(e,i){var r=this.parent.renderBaseline?(this.parent.rowHeight-this.taskBarHeight)/2:this.taskBarMarginTop,n=t.createElement("div",{className:i,styles:"height:"+this.taskBarHeight+"px;margin-top:"+r+"px;"}),a=t.createElement("span",{className:fe});a[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=e,n.appendChild(a);var s=t.createElement("div");return s.appendChild(n),s.childNodes},i.prototype.getRightLabelNode=function(e){var i=this.rightLabelContainer();""!==this.generateTaskLabelAriaLabel("right")&&i[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("right"));var r=null;if(this.rightTaskLabelTemplateFunction)r=this.rightTaskLabelTemplateFunction(t.extend({index:e},this.templateData),this.parent,"RightLabelTemplate",this.getTemplateID("RightLabelTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var n=this.parent.labelSettings.rightLabel,a=this.getTaskLabel(n);a&&(a="isCustomTemplate"===a?n:a,r=this.getLableText(a,"e-right-label-inner-div"))}return r&&r.length>0&&("null"===r[0].data&&(r[0].data=""),i[0].appendChild([].slice.call(r)[0])),i},i.prototype.getManualTaskbar=function(){var e=this.templateData,t=this.taskBarHeight/2-1,i=e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration?'<div class="'+re+'" 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="'+re+" "+(e.ganttProperties.startDate?me:ye)+'" 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="'+re+' e-gantt-unscheduled-manualtask" 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="'+ie+'"style=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="height:'+t+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div><div class="e-gantt-manualparenttaskbar-right" style=left:'+(e.ganttProperties.width-t/5)+"px;height:"+t+"px;border-right-width:"+t/5+"px;border-bottom:"+t/5+"px solid transparent;></div></div>":""),n='<div class="'+ne+'" style="position:absolute;left:'+(e.ganttProperties.left-e.ganttProperties.autoLeft-this.milestoneHeight/2)+"px;width:"+2*this.milesStoneRadius+'px;"><div class="'+ae+'" style="border-right-width:'+this.milesStoneRadius+"px;border-left-width:"+this.milesStoneRadius+"px;border-bottom-width:"+this.milesStoneRadius+'px;"></div><div class="'+se+'" style="top:'+this.milesStoneRadius+"px;border-right-width:"+this.milesStoneRadius+"px; border-left-width:"+this.milesStoneRadius+"px; border-top-width:"+this.milesStoneRadius+'px;"></div></div>';return this.createDivElement(0===e.ganttProperties.width?n:r)},i.prototype.getParentTaskbarNode=function(e,i){var r=null,n=this.templateData;if(this.parentTaskbarTemplateFunction)r=this.parentTaskbarTemplateFunction(t.extend({index:e},n),this.parent,"ParentTaskbarTemplate",this.getTemplateID("ParentTaskbarTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var a="",s=void 0,o=this.taskBarHeight/5,l=this.createDivElement('<div class="e-gantt-parent-taskbar-inner-div '+this.getExpandClass(n)+" "+de+'" style="width:'+(n.ganttProperties.isAutoSchedule?n.ganttProperties.width:n.ganttProperties.autoWidth)+"px;height:"+(n.ganttProperties.isAutoSchedule?this.taskBarHeight:3*o)+"px;margin-top:"+(n.ganttProperties.isAutoSchedule?"":2*o)+'px;"></div>'),d=this.createDivElement('<div class="e-gantt-parent-progressbar-inner-div '+this.getExpandClass(n)+" "+pe+'" style="border-style:'+(n.ganttProperties.progressWidth?"solid;":"none;")+"width:"+n.ganttProperties.progressWidth+"px;border-top-right-radius:"+this.getBorderRadius(n)+"px;border-bottom-right-radius:"+this.getBorderRadius(n)+'px;height:100%;"></div>'),p=t.createElement("div");if(this.taskLabelTemplateFunction){var h=this.taskLabelTemplateFunction(t.extend({index:e},n),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,d[0]);h&&h.length>0&&(p.appendChild(h[0]),a=p.innerHTML)}else a="isCustomTemplate"===(a=this.getTaskLabel(this.parent.labelSettings.taskLabel))?this.parent.labelSettings.taskLabel:a;if(-1===a.indexOf("null")){"isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(a=""),s=isNaN(parseInt(a))?'<span class="'+U+'" style="line-height:'+(this.taskBarHeight-1)+"px; text-align: left;display:inline-block;width:"+(n.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;">'+a+"</span>":'<span class="'+U+'" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(n.ganttProperties.width-10):"")+"px; height:"+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display: inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(n.ganttProperties.width-10):"")+"px; height:"+this.taskBarHeight+'px;">'+a+"</span>";var c=this.createDivElement(s)[0],u=this.parent.labelSettings.taskLabel;u&&u.elementRef&&c.appendChild(p),d[0].appendChild(c),""!==d[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(u)&&d[0].querySelectorAll(".e-task-label")[0].children[0]&&d[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""==d[0].querySelectorAll(".e-task-label")[0].textContent&&u&&!u.elementRef&&""!==p.innerHTML&&(d[0].querySelectorAll(".e-task-label")[0].textContent=u)}var g='<div class="e-gantt-parent-milestone" style="position:absolute;"><div class="e-parent-milestone-top" style="border-right-width:'+this.milesStoneRadius+"px;border-left-width:"+this.milesStoneRadius+"px;border-bottom-width:"+this.milesStoneRadius+'px;"></div><div class="e-parent-milestone-bottom" style="top:'+this.milesStoneRadius+"px;border-right-width:"+this.milesStoneRadius+"px; border-left-width:"+this.milesStoneRadius+"px; border-top-width:"+this.milesStoneRadius+'px;"></div></div>';l[0].appendChild([].slice.call(d)[0]),r=n.ganttProperties.isMilestone?this.createDivElement(n.ganttProperties.isAutoSchedule?g:""):l}return r},i.prototype.getTableTrNode=function(){var e=t.createElement("table"),i="Horizontal"===this.parent.gridLines||"Both"===this.parent.gridLines?"e-chart-row-border":"";return e.innerHTML='<tr class="'+this.getRowClassName(this.templateData)+" "+X+'"role="ChartRow" style="display:'+this.getExpandDisplayProp(this.templateData)+";height:"+this.parent.rowHeight+'px;"><td class="'+_+" "+i+'" role="ChartCell" style="width:'+this.parent.timelineModule.totalTimelineWidth+'px;"></td></tr>',e.childNodes},i.prototype.initializeChartTemplate=function(){t.isNullOrUndefined(this.parent.parentTaskbarTemplate)||(this.parentTaskbarTemplateFunction=this.templateCompiler(this.parent.parentTaskbarTemplate)),!t.isNullOrUndefined(this.parent.labelSettings.leftLabel)&&this.isTemplate(this.parent.labelSettings.leftLabel)&&(this.leftTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.leftLabel)),!t.isNullOrUndefined(this.parent.labelSettings.rightLabel)&&this.isTemplate(this.parent.labelSettings.rightLabel)&&(this.rightTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.rightLabel)),!t.isNullOrUndefined(this.parent.labelSettings.taskLabel)&&this.isTemplate(this.parent.labelSettings.taskLabel)&&(this.taskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.taskLabel)),t.isNullOrUndefined(this.parent.taskbarTemplate)||(this.childTaskbarTemplateFunction=this.templateCompiler(this.parent.taskbarTemplate)),t.isNullOrUndefined(this.parent.milestoneTemplate)||(this.milestoneTemplateFunction=this.templateCompiler(this.parent.milestoneTemplate))},i.prototype.createDivElement=function(e){var i=t.createElement("div");return i.innerHTML=e,i.childNodes},i.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},i.prototype.getTemplateID=function(e){return this.parent.element.id+e},i.prototype.leftLabelContainer=function(){var e='<div class="'+(this.leftTaskLabelTemplateFunction?"e-left-label-container e-left-label-temp-container":I)+' " tabindex="-1" role="LeftLabel" style="height:'+(this.parent.rowHeight-2)+"px;width:"+this.taskNameWidth(this.templateData)+'"></div>';return this.createDivElement(e)},i.prototype.taskbarContainer=function(){var e=this.templateData,t=!(!this.parent.editModule||!this.parent.editSettings.allowTaskbarEditing||"ParentResizing"!==this.parent.editModule.taskbarEditModule.taskBarEditAction),i='<div class="'+F+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+" "+(e.ganttProperties.cssClass?e.ganttProperties.cssClass:"")+'" tabindex="-1" role="TaskBar" style="'+(e.ganttProperties.isMilestone&&!t?"width:"+this.milestoneHeight+"px;height:"+this.milestoneHeight+"px;margin-top:"+this.milestoneMarginTop+"px;left:"+(e.ganttProperties.left-this.milestoneHeight/2)+"px;":"width:"+e.ganttProperties.width+"px;margin-top:"+this.taskBarMarginTop+"px;left:"+(!e.hasChildRecords||e.ganttProperties.isAutoSchedule?e.ganttProperties.left:e.ganttProperties.autoLeft)+"px;height:"+this.taskBarHeight+"px;cursor:"+(e.ganttProperties.isAutoSchedule?"move;":"auto;"))+'"></div>';return this.createDivElement(i)},i.prototype.rightLabelContainer=function(){var e='<div class="'+(this.rightTaskLabelTemplateFunction?"e-right-label-container e-right-label-temp-container":E)+'" tabindex="-1" role="RightLabel" style="left:'+this.getRightLabelLeft(this.templateData)+"px; height:"+(this.parent.rowHeight-2)+'px;"></div>';return this.createDivElement(e)},i.prototype.childTaskbarLeftResizer=function(){var e=-(this.parent.isAdaptive?12:2),t='<div class="'+Y+' e-icon" role="LeftResizer" style="left:'+e+"px;height:"+this.taskBarHeight+'px;"></div>';return this.createDivElement(t)},i.prototype.childTaskbarRightResizer=function(){var e=this.parent.isAdaptive?-2:-10,t='<div class="'+Z+' e-icon" role="RightResizer" style="left:'+(this.templateData.ganttProperties.width+e)+"px;height:"+this.taskBarHeight+'px;"></div>';return this.createDivElement(t)},i.prototype.childTaskbarProgressResizer=function(){var e='<div class="'+Q+'" role="ProgressResizer" style="left:'+(this.templateData.ganttProperties.progressWidth-6)+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+K+'"><div class="'+J+'"></div><div class="'+$+'"></div></div>';return this.createDivElement(e)},i.prototype.getLeftPointNode=function(){var e=this.templateData,t=-((this.parent.isAdaptive?14:2)+this.connectorPointWidth),i=-(this.connectorPointWidth+2),r=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),n='<div class="e-left-connectorpoint-outer-div" style="'+(e.ganttProperties.isMilestone?"margin-top:"+r+"px;left:"+i+"px;":"margin-top:"+this.connectorPointMargin+"px;left:"+t+"px;")+'"><div class="'+Ue+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width: '+this.connectorPointWidth+"px;height: "+this.connectorPointWidth+'px;">'+this.touchLeftConnectorpoint+"</div></div>";return this.createDivElement(n)},i.prototype.getRightPointNode=function(){var e=this.templateData,t=this.parent.isAdaptive?10:-2,i=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),r='<div class="'+Be+'" style="'+(e.ganttProperties.isMilestone?"left:"+(this.milestoneHeight-2)+"px;margin-top:"+i+"px;":"left:"+(e.ganttProperties.width+t)+"px;margin-top:"+this.connectorPointMargin+"px;")+'"><div class="'+Ve+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width:'+this.connectorPointWidth+"px;height:"+this.connectorPointWidth+'px;">'+this.touchRightConnectorpoint+"</div></div>";return this.createDivElement(r)},i.prototype.getTaskLabel=function(e){var i=this.parent.ganttColumns.length,r=null;if(t.isNullOrUndefined(e)||""===e)r="";else if(e===this.parent.taskFields.resourceInfo)r=this.getResourceName(this.templateData);else{for(var n=0;n<i;n++)if(e===this.parent.ganttColumns[n].field){r=this.getFieldValue(this.templateData[e]).toString();break}if(t.isNullOrUndefined(r))return"isCustomTemplate"}return r},i.prototype.getExpandDisplayProp=function(e){return e=this.templateData,this.parent.getExpandStatus(e)?"table-row":"none"},i.prototype.getRowClassName=function(e){var t="gridrowtaskId",i=(e=this.templateData).parentItem;return i&&(t+=i.taskId.toString()),t+="level",t+=e.level.toString()},i.prototype.getBorderRadius=function(e){var t=(e=this.templateData).ganttProperties.width-e.ganttProperties.progressWidth;return t<=4?4-t:0},i.prototype.getSplitTaskBorderRadius=function(e){var t=e.width-e.progressWidth;return t<=4?4-t:0},i.prototype.taskNameWidth=function(e){var t,i=(e=this.templateData).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)<0&&(t=0),t+"px"},i.prototype.getRightLabelLeft=function(e){var t,i,r=(e=this.templateData).ganttProperties;return e.ganttProperties.isMilestone?e.ganttProperties.left+this.parent.getTaskbarHeight()/2:e.hasChildRecords&&!r.isAutoSchedule?(this.parent.allowUnscheduledTasks?(t=r.left<r.autoLeft?r.left:r.autoLeft,i=r.autoWidth):(t=r.autoStartDate.getTime()<r.startDate.getTime()?r.autoLeft:r.left,i=(r.autoEndDate.getTime()<r.endDate.getTime()?this.parent.dataOperation.getTaskLeft(r.endDate,r.isMilestone):this.parent.dataOperation.getTaskLeft(r.autoEndDate,r.isMilestone))-t),t+i):e.ganttProperties.left+e.ganttProperties.width},i.prototype.getExpandClass=function(e){return(e=this.templateData).expanded?"e-row-expand":!e.expanded&&e.hasChildRecords?"e-row-collapse":""},i.prototype.getFieldValue=function(e){return t.isNullOrUndefined(e)?"":e},i.prototype.getResourceName=function(e){e=this.templateData;var i=null;if(!t.isNullOrUndefined(e.ganttProperties.resourceInfo)){var r=e.ganttProperties.resourceInfo.length;if(r>0){for(var n=0;n<r;n++){var a=e.ganttProperties.resourceInfo[n][this.parent.resourceFields.name],s=e.ganttProperties.resourceInfo[n][this.parent.resourceFields.unit];100!==s&&(a+="["+s+"%]"),t.isNullOrUndefined(i)?i=a:i+=" , "+a}return i}return""}return""},i.prototype.initChartHelperPrivateVariable=function(){var e=this.parent.renderBaseline?.45:.62,i=this.parent.renderBaseline?4:2,r=this.parent.renderBaseline?1.13:.82;if(this.baselineColor=t.isNullOrUndefined(this.parent.baselineColor)||""===this.parent.baselineColor?null:this.parent.baselineColor,this.taskBarHeight=t.isNullOrUndefined(this.parent.taskbarHeight)||this.parent.taskbarHeight>=this.parent.rowHeight?Math.floor(this.parent.rowHeight*e):this.parent.taskbarHeight,this.parent.renderBaseline){var n=void 0;n=this.taskBarHeight+this.baselineHeight<=this.parent.rowHeight?this.taskBarHeight:this.taskBarHeight-(this.baselineHeight+1),this.taskBarHeight=n}this.milestoneHeight=Math.floor(this.taskBarHeight*r),this.taskBarMarginTop=Math.floor((this.parent.rowHeight-this.taskBarHeight)/i),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)},i.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)}},i.prototype.createTaskbarTemplate=function(){var e=[].slice.call(this.ganttChartTableBody.querySelectorAll("tr"));this.ganttChartTableBody.innerHTML="";var i=[],r=this.parent.treeGridModule.prevCurrentView;if(this.refreshedTr=[],this.refreshedData=[],this.parent.enableImmutableMode&&r&&r.length>0&&this.isUpdated){for(var n={},a=[],s=this.parent.treeGrid.getPrimaryKeyFieldNames()[0],o=0;o<r.length;o++)a[o]=e[o],n[r[o][s]]=o;for(var l=0;l<this.parent.currentViewData.length;l++){var d=n[this.parent.currentViewData[l][s]],p=this.parent.modifiedRecords.indexOf(this.parent.currentViewData[l]);if(t.isNullOrUndefined(d)||-1!==p){var h=this.getGanttChartRow(l,this.parent.currentViewData[l]);this.ganttChartTableBody.appendChild(h),this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[l]),this.refreshedData.push(this.parent.currentViewData[l])}else this.ganttChartTableBody.appendChild(a[d]);this.ganttChartTableBody.querySelectorAll("tr")[l].setAttribute("aria-rowindex",l.toString())}}else for(o=0;o<this.parent.currentViewData.length;o++){var c=this.parent.currentViewData[o];"ResourceView"===this.parent.viewType&&!c.expanded&&this.parent.enableMultiTaskbar&&i.push(c);h=this.getGanttChartRow(o,c);this.ganttChartTableBody.appendChild(h),this.parent.enableImmutableMode&&(this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[o]),this.refreshedData.push(this.parent.currentViewData[o])),this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.maintainSelectedRecords(parseInt(h.getAttribute("aria-rowindex"),10))}if(this.parent.renderTemplates(),this.triggerQueryTaskbarInfo(),this.parent.modifiedRecords=[],i.length)for(var u=0;u<i.length;u++)i[u].hasChildRecords&&(this.parent.isGanttChartRendered=!0,this.parent.chartRowsModule.refreshRecords([i[u]]));this.parent.renderTemplates()},i.prototype.getGanttChartRow=function(e,i){this.templateData=i;var r=null,n=this.getTableTrNode(),a=this.getLeftLabelNode(e),s=this.taskbarContainer();if(s[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),s[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID),!this.templateData.hasChildRecords){var o=this.getLeftPointNode();s[0].appendChild([].slice.call(o)[0])}if(this.templateData.hasChildRecords){var l=this.getParentTaskbarNode(e,s);if(!this.templateData.ganttProperties.isAutoSchedule){var d=this.getManualTaskbar();s[0].appendChild([].slice.call(d)[0])}l&&l.length>0&&s[0].appendChild([].slice.call(l)[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.getTaskBaselineNode())}else if(this.templateData.ganttProperties.isMilestone){var p=this.getMilestoneNode(e,s);p&&p.length>0&&s[0].appendChild([].slice.call(p)[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.getMilestoneBaselineNode())}else{var h=f(this.templateData.ganttProperties),c=null,u=null,g=null;if(!t.isNullOrUndefined(h)){(h||this.templateData.ganttProperties.duration)&&h&&(t.isNullOrUndefined(this.templateData.ganttProperties.segments)||this.templateData.ganttProperties.segments.length<=0)&&(c=this.childTaskbarProgressResizer(),g=this.childTaskbarLeftResizer(),u=this.childTaskbarRightResizer());var m=this.getChildTaskbarNode(e,s);if(g&&s[0].appendChild([].slice.call(g)[0]),m&&m.length>0)if(this.templateData.ganttProperties.segments&&this.templateData.ganttProperties.segments.length>0){var y=this.templateData.ganttProperties.segments.length,v=null;v=this.createDivElement('<div class="e-gantt-split-container-line"></div>'),s[0].appendChild([].slice.call(v)[0]);for(var D=0;D<y;D++)s[0].appendChild([].slice.call(m)[0])}else s[0].appendChild([].slice.call(m)[0]);c&&s[0].appendChild([].slice.call(c)[0]),u&&s[0].appendChild([].slice.call(u)[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.getTaskBaselineNode())}if(!this.templateData.hasChildRecords){var w=this.getRightPointNode();s[0].appendChild([].slice.call(w)[0])}var k=this.getRightLabelNode(e);if(n[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[0]),n[0].childNodes[0].childNodes[0].appendChild([].slice.call(s)[0]),this.templateData.ganttProperties.indicators&&this.templateData.ganttProperties.indicators.length>0)for(var T=void 0,S=void 0,b=this.templateData.ganttProperties.indicators,P=0;P<b.length;P++){if((T=this.getIndicatorNode(b[P]))[0].setAttribute("aria-label",b[P].name),b[P].name.indexOf("$")>-1||b[P].name.indexOf("#")>-1)S=this.templateCompiler(b[P].name)(t.extend({index:e},this.templateData),this.parent,"indicatorLabelText");else{var C=t.createElement("Text");C.innerHTML=b[P].name,S=C.childNodes}T[0].appendChild([].slice.call(S)[0]),T[0].title=t.isNullOrUndefined(b[P].tooltip)?"":b[P].tooltip,n[0].childNodes[0].childNodes[0].appendChild([].slice.call(T)[0])}k&&k.length>0&&n[0].childNodes[0].childNodes[0].appendChild([].slice.call(k)[0]),t.isNullOrUndefined(r)||n[0].childNodes[0].childNodes[0].appendChild([].slice.call(r)[0]);var M=n[0].childNodes[0];return this.setAriaRowIndex(i,M),M},i.prototype.setAriaRowIndex=function(e,i){var r=this.parent.treeGrid.getCurrentViewRecords(),n=(this.parent.virtualScrollModule&&this.parent.enableVirtualization?t.getValue("virtualScrollModule.visualData",this.parent.treeGrid):r).indexOf(e);i.setAttribute("aria-rowindex",n.toString())},i.prototype.triggerQueryTaskbarInfo=function(){if(this.parent.queryTaskbarInfo)for(var e,i,r=this.parent.enableImmutableMode?this.refreshedTr.length:this.ganttChartTableBody.querySelectorAll("tr").length,n=0;n<r;n++){e=this.parent.enableImmutableMode?this.refreshedTr[n]:this.ganttChartTableBody.querySelectorAll("tr")[n],i=this.refreshedData.length>0?this.refreshedData[n]:this.parent.currentViewData[n];var a=!t.isNullOrUndefined(i.ganttProperties.segments)&&i.ganttProperties.segments.length;if(a>0)for(var s=0;s<a;s++){var o=e.getElementsByClassName("e-segmented-taskbar")[s];this.triggerQueryTaskbarInfoByIndex(o,i)}else e&&this.triggerQueryTaskbarInfoByIndex(e,i)}},i.prototype.triggerQueryTaskbarInfoByIndex=function(e,i){var r=this,n=!t.isNullOrUndefined(i.ganttProperties.segments)&&i.ganttProperties.segments.length>0?e:e.querySelector("."+F),a={data:i,rowElement:e,taskbarElement:n,taskbarType:i.hasChildRecords?"ParentTask":i.ganttProperties.isMilestone?"Milestone":"ChildTask"},s=this.getClassName(a);if("Milestone"===a.taskbarType)a.milestoneColor=n.querySelector(s[0])?getComputedStyle(n.querySelector(s[0])).borderBottomColor:null,a.baselineColor=e.querySelector(s[1])?getComputedStyle(e.querySelector(s[1])).borderBottomColor:null;else{var o=n.querySelector(s[0]),l=n.querySelector(s[1]);a.taskbarBgColor=t.isNullOrUndefined(o)?null:n.classList.contains(ee)?getComputedStyle(n).backgroundColor:getComputedStyle(n.querySelector(s[0])).backgroundColor,a.taskbarBorderColor=t.isNullOrUndefined(o)?null:n.classList.contains(ee)?getComputedStyle(n).backgroundColor:getComputedStyle(n.querySelector(s[0])).borderColor,a.progressBarBgColor=t.isNullOrUndefined(l)?null:n.classList.contains(te)?getComputedStyle(n).backgroundColor:getComputedStyle(n.querySelector(s[1])).backgroundColor,a.baselineColor=e.querySelector("."+j)?getComputedStyle(e.querySelector("."+j)).backgroundColor:null,a.taskLabelColor=n.querySelector("."+U)?getComputedStyle(n.querySelector("."+U)).color:null}a.rightLabelColor=e.querySelector("."+E)&&e.querySelector("."+E).querySelector("."+fe)?getComputedStyle(e.querySelector("."+E).querySelector("."+fe)).color:null,a.leftLabelColor=e.querySelector("."+I)&&e.querySelector("."+I).querySelector("."+fe)?getComputedStyle(e.querySelector("."+I).querySelector("."+fe)).color:null,this.parent.trigger("queryTaskbarInfo",a,function(e){r.updateQueryTaskbarInfoArgs(e,void 0,void 0)})},i.prototype.updateQueryTaskbarInfoArgs=function(e,t,i){var r=e.rowElement,n=e.taskbarElement,a=this.getClassName(e);"Milestone"===e.taskbarType?(n.querySelector(a[0])&&getComputedStyle(n.querySelector(a[0])).borderBottomColor!==e.milestoneColor&&(n.querySelector(a[0]).style.borderBottomColor=e.milestoneColor,n.querySelector("."+A).style.borderTopColor=e.milestoneColor),r.querySelector(a[1])&&getComputedStyle(r.querySelector(a[1])).borderTopColor!==e.baselineColor&&(r.querySelector(a[1]).style.borderBottomColor=e.baselineColor,r.querySelector("."+z).style.borderTopColor=e.baselineColor)):(n.querySelector(a[0])&&getComputedStyle(n.querySelector(a[0])).backgroundColor!==e.taskbarBgColor&&(n.querySelector(a[0]).style.backgroundColor=e.taskbarBgColor),n.querySelector(a[0])&&getComputedStyle(n.querySelector(a[0])).borderColor!==e.taskbarBorderColor&&(n.querySelector(a[0]).style.borderColor=e.taskbarBorderColor),n.querySelector(a[1])&&getComputedStyle(n.querySelector(a[1])).backgroundColor!==e.progressBarBgColor&&(n.querySelector(a[1]).style.backgroundColor=e.progressBarBgColor),n.classList.contains(ee)&&getComputedStyle(n).backgroundColor!==e.taskbarBgColor&&(n.style.backgroundColor=e.taskbarBgColor),n.classList.contains(ee)&&getComputedStyle(n).borderColor!==e.taskbarBorderColor&&(n.style.borderColor=e.taskbarBorderColor),n.classList.contains(te)&&getComputedStyle(n).backgroundColor!==e.progressBarBgColor&&(n.style.backgroundColor=e.progressBarBgColor),n.querySelector("."+U)&&getComputedStyle(n.querySelector("."+U)).color!==e.taskLabelColor&&(n.querySelector("."+U).style.color=e.taskLabelColor),r.querySelector("."+j)&&getComputedStyle(r.querySelector("."+j)).backgroundColor!==e.baselineColor&&(r.querySelector("."+j).style.backgroundColor=e.baselineColor)),r.querySelector("."+I)&&r.querySelector("."+I).querySelector("."+fe)&&getComputedStyle(r.querySelector("."+I).querySelector("."+fe)).color!==e.leftLabelColor&&(r.querySelector("."+I).querySelector("."+fe).style.color=e.leftLabelColor),r.querySelector("."+E)&&r.querySelector("."+E).querySelector("."+fe)&&getComputedStyle(r.querySelector("."+E).querySelector("."+fe)).color!==e.rightLabelColor&&(r.querySelector("."+E).querySelector("."+fe).style.color=e.rightLabelColor)},i.prototype.getClassName=function(e){var t=[];return t.push("."+("ParentTask"===e.taskbarType?de:"ChildTask"===e.taskbarType?ee:"e-milestone-top")),t.push("."+("ParentTask"===e.taskbarType?pe:"ChildTask"===e.taskbarType?te:q)),t},i.prototype.templateCompiler=function(e){if(!t.isNullOrUndefined(e)&&""!==e)try{return document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim(),this.parent):t.compile(e,this.parent)}catch(i){return t.compile(e,this.parent)}return null},i.prototype.refreshRow=function(e,i){var r=this.ganttChartTableBody.childNodes[e],n=this.parent.currentViewData[e];if(-1!==e&&n){var a=n;"ResourceView"===this.parent.viewType&&a.hasChildRecords&&!a.expanded&&this.parent.enableMultiTaskbar?r.replaceChild(this.getResourceParent(a).childNodes[0],r.childNodes[0]):r.replaceChild(this.getGanttChartRow(e,a).childNodes[0],r.childNodes[0]),this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&this.parent.showOverAllocation&&(i?this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData):(this.parent.dataOperation.updateOverlappingValues(a),this.parent.ganttChartModule.renderRangeContainer([a])));var s=!t.isNullOrUndefined(a.ganttProperties.segments)&&a.ganttProperties.segments.length;if(s>0)for(var o=0;o<s;o++){var l=r.getElementsByClassName("e-segmented-taskbar")[o];this.triggerQueryTaskbarInfoByIndex(l,a)}else this.triggerQueryTaskbarInfoByIndex(r,a);var d="ProjectView"===this.parent.viewType?a.ganttProperties.taskId:a.ganttProperties.rowUniqueID;this.parent.treeGrid.grid.setRowData(d,a);this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[e].getAttribute("data-uid")).data=a}},i.prototype.getResourceParent=function(e){var i=this.parent.ganttChartModule.getChartRows();if(this.parent.initialChartRowElements)for(var r=0;r<this.parent.initialChartRowElements.length;r++)t.isNullOrUndefined(i[r])||t.isNullOrUndefined(i[r].childNodes[0].childNodes[1].childNodes[2])||t.isNullOrUndefined(this.parent.initialChartRowElements[r].childNodes[0].childNodes[1].childNodes[2])||(i[r].childNodes[0].childNodes[1].childNodes[2].innerHTML=this.parent.initialChartRowElements[r].childNodes[0].childNodes[1].childNodes[2].innerHTML);this.templateData=e;var n=this.getTableTrNode(),a=this.leftLabelContainer(),s=t.createElement("div",{className:"e-collapse-parent"});n[0].childNodes[0].childNodes[0].appendChild(s);var o=this.parent.dataOperation.setSortedChildTasks(e);this.parent.dataOperation.updateOverlappingIndex(o);for(var l=0;l<i.length;l++)if(i[l].classList.contains("gridrowtaskId"+e.ganttProperties.rowUniqueID+"level"+(e.level+1))){var d=i[l].querySelector(".e-taskbar-main-container");t.addClass([d],"collpse-parent-border");var p=i[l].querySelector("."+F).getAttribute("rowUniqueId"),h=this.parent.getRecordByID(p).ganttProperties.eOverlapIndex.toString(),c=d.cloneNode(!0);c.style.zIndex=h,n[0].childNodes[0].childNodes[0].childNodes[0].appendChild(c)}return n[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[0]),n[0].childNodes[0]},i.prototype.refreshRecords=function(e,t){if(this.parent.isGanttChartRendered){if(this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar){e=new n.DataManager(e).executeLocal((new n.Query).sortBy("expanded","Descending"))}for(var i=0;i<e.length;i++){var r=this.parent.currentViewData.indexOf(e[i]);this.refreshRow(r,t)}this.parent.ganttChartModule.updateLastRowBottomWidth()}},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("renderPanels",this.createChartTable),this.parent.off("dataReady",this.initiateTemplates),this.parent.off("destroy",this.destroy))},i.prototype.destroy=function(){this.removeEventListener()},i.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},i.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},i.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},i}(M),Kt=function(){function e(e){this.parentRecord=[],this.parentIds=[],this.parent=e,this.dateValidateModule=this.parent.dateValidationModule}return e.prototype.ensurePredecessorCollection=function(){for(var e=this.parent.predecessorsCollection,t=e.length-1;t>=0;t--){var i=e[t],r=i.ganttProperties;i.hasChildRecords||this.ensurePredecessorCollectionHelper(i,r)}},e.prototype.ensurePredecessorCollectionHelper=function(e,i){var r=i.predecessorsName;if(!r||"string"!=typeof r&&"number"!=typeof r){if(r&&"object"==typeof r&&r.length){for(var n=[],a=0;a<r.length;a++){var s=r[a],o={};o.from=t.getValue("from",s),o.to=t.getValue("to",s)?t.getValue("to",s):i.rowUniqueID,o.type=t.getValue("type",s)?t.getValue("type",s):"FS";var l=t.getValue("offset",s);if(t.isNullOrUndefined(l))o.offset=0,o.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();else if("string"==typeof l){var d=this.getOffsetDurationUnit(t.getValue("offset",s));o.offset=d.duration,o.offsetUnit=d.durationUnit}else o.offset=parseFloat(l.toString()),o.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();this.checkIsParent(o.from.toString())||n.push(o)}this.parent.setRecordValue("predecessor",n,i,!0)}}else this.parent.setRecordValue("predecessor",this.calculatePredecessor(r,e),i,!0);this.parent.setRecordValue("predecessorsName",this.getPredecessorStringValue(e),i,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,i.predecessorsName,e),this.parent.setRecordValue(this.parent.taskFields.dependency,i.predecessorsName,e)},e.prototype.updateUnscheduledDependency=function(e){for(var i=this.parent.taskFields,r=t.isNullOrUndefined(e[i.dependency])?[]:e[i.dependency].toString().split(","),n=0;n<r.length;n++){var a=parseInt(r[n],10);if(!isNaN(a)){var s=this.parent.getRecordByID(a.toString()),o=t.isNullOrUndefined(s)?null:t.extend({},{},s.taskData,!0);!t.isNullOrUndefined(o)&&t.isNullOrUndefined(o[i.startDate])&&t.isNullOrUndefined(o[i.duration])&&t.isNullOrUndefined(o[i.endDate])&&(o[i.duration]=1,o[i.startDate]=this.parent.projectStartDate,this.parent.updateRecordByID(o))}}},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=[];return e.toString().split(",").forEach(function(e){r=e.split("+"),n="+",e.indexOf("-")>=0&&(r=e.split("-"),n="-"),i=r[0].match(/(\d+|[A-z]+)/g);var l="ResourceView"===s.parent.viewType?s.parent.getTaskIds():s.parent.ids,d="ResourceView"===s.parent.viewType?l.indexOf("T"+i[0]):l.indexOf(i[0]);if(i[0]&&-1!==d){if(i.length>1){var p=i[1].toUpperCase();a="FS"===p||"FF"===p||"SF"===p||"SS"===p?p:"FS"}else a="FS";var h=r.length>1?n+""+r[1]:"0",c=s.getOffsetDurationUnit(h),u={from:i[0],type:a,isDrawn:!1,to:"ResourceView"===s.parent.viewType?t.ganttProperties.taskId.toString():t.ganttProperties.rowUniqueID.toString(),offsetUnit:c.durationUnit,offset:c.duration};s.checkIsParent(i[0])||o.push(u)}}),o},e.prototype.getPredecessorStringValue=function(e){var i=e.ganttProperties.predecessor,r=this.parent.durationUnitTexts,n="";if(i)for(var a=i.length,s=0;s<a;s++){var o=i[s],l="",d="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(o.from!==d.toString()){if(l=o.from+o.type,0!==o.offset){l+=o.offset>0?"+"+o.offset+" ":o.offset+" ";var p=1!==o.offset;"day"===o.offsetUnit?l+=p?t.getValue("days",r):t.getValue("day",r):"hour"===o.offsetUnit?l+=p?t.getValue("hours",r):t.getValue("hour",r):l+=p?t.getValue("minutes",r):t.getValue("minute",r)}n=n.length>0?n+","+l:l}}return n},e.prototype.getOffsetDurationUnit=function(e){var i=0,r=this.parent.durationUnit.toLocaleLowerCase(),n=this.parent.durationUnitEditText;if("string"==typeof e){for(var a=e.match(/[^0-9]+|[0-9]+/g),s=0;s<a.length;s++)a[s]=a[s].trim();"-"===a[0]&&a[1]?(a[1]=a[0]+a[1],a.shift()):"+"===a[0]&&a.shift(),"."!==a[1]||isNaN(parseInt(a[2],10))||(a[0]+=a[1]+a[2],a.splice(1,2)),a&&a.length<=2&&(i=parseFloat(a[0]),r=a[1]?a[1].toLowerCase().trim():"",r=-1!==t.getValue("minute",n).indexOf(r)?"minute":-1!==t.getValue("hour",n).indexOf(r)?"hour":-1!==t.getValue("day",n).indexOf(r)?"day":this.parent.durationUnit.toLocaleLowerCase())}else i=e,r=this.parent.durationUnit.toLocaleLowerCase();return isNaN(i)&&(i=0,r=this.parent.durationUnit.toLocaleLowerCase()),{duration:i,durationUnit:r}},e.prototype.updatePredecessors=function(){for(var e,t=this.parent.predecessorsCollection,i=t.length,r=0;r<i;r++)(e=t[r]).hasChildRecords||this.updatePredecessorHelper(e,t)},e.prototype.updatePredecessorHelper=function(e,i){var r,n=e.ganttProperties.predecessor,a=n.length;i=t.isNullOrUndefined(i)?[]:i;for(var s=0;s<a;s++){var o=n[s];r=this.parent.connectorLineModule.getRecordByID(o.from);var l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(o.from!==l.toString()&&r){var d=void 0;r.ganttProperties.predecessor?((d=t.extend([],r.ganttProperties.predecessor,[],!0)).push(o),this.parent.setRecordValue("predecessor",d,r.ganttProperties,!0)):((d=[]).push(o),this.parent.setRecordValue("predecessor",d,r.ganttProperties,!0),i.push(r))}}},e.prototype.updatedRecordsDateByPredecessor=function(){for(var e=this.parent.flatData,t=0;t<e.length;t++)e[t].ganttProperties.predecessor&&this.validatePredecessorDates(e[t])},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)).ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)&&this.validateChildGanttRecord(r,n)}}},e.prototype.validateChildGanttRecord=function(e,i){if(this.parent.editedTaskBarItem!==i&&!t.isNullOrUndefined(f(e.ganttProperties))&&!t.isNullOrUndefined(f(i.ganttProperties))&&this.parent.isInPredecessorValidation&&(i.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)){var r=i.ganttProperties,n="ResourceView"===this.parent.viewType?r.taskId.toString():r.rowUniqueID.toString(),a=r.predecessor.filter(function(e){return e.to===n?e:null}),s=this.getPredecessorDate(i,a);this.parent.setRecordValue("startDate",s,r,!0),this.parent.dataOperation.updateMappingData(i,"startDate");var o=i.ganttProperties.segments;t.isNullOrUndefined(o)&&this.dateValidateModule.calculateEndDate(i),this.parent.dataOperation.updateWidthLeft(i),i.parentItem&&this.parent.getParentTask(i.parentItem).ganttProperties.isAutoSchedule&&this.parent.isInPredecessorValidation&&!this.parent.isLoad&&-1===this.parentIds.indexOf(i.parentItem.uniqueID)&&(this.parentIds.push(i.parentItem.uniqueID),this.parentRecord.push(i.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 p=o[d];n=this.parent.connectorLineModule.getRecordByID(p.from),a=this.parent.connectorLineModule.getRecordByID(p.to),r=this.getValidatedStartDate(a.ganttProperties,n.ganttProperties,p),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):(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,i,r=e||this.parent.currentViewData,n=r.length;for(this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.getExpandedRecords(this.parent.updatedRecords),t=0;t<n;t++)(i=r[t].ganttProperties.predecessor)&&this.addPredecessorsCollection(i)},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){for(var r=e.ganttProperties.predecessor,n=void 0,a=null,s=void 0,o=void 0,l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),d=r.filter(function(e){return e.to===l?e:null}),p=r.filter(function(e){return e.from===l?e:null}),h=0;h<d.length;h++){s=d[h],n=this.parent.connectorLineModule.getRecordByID(s.from),a=this.parent.connectorLineModule.getRecordByID(s.to),this.parent.isInPredecessorValidation&&a.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1;var c="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;c.toString()!==s.to&&c.toString()!==s.from||i&&"predecessor"!==i||this.validateChildGanttRecord(n,a)}for(h=0;h<p.length;h++)o=p[h],n=this.parent.connectorLineModule.getRecordByID(o.from),a=this.parent.connectorLineModule.getRecordByID(o.to),this.parent.isInPredecessorValidation&&a.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1,"predecessor"!==i&&this.parent.isValidationEnabled&&this.validateChildGanttRecord(n,a),!1!==n.expanded&&a.expanded,a&&this.validatePredecessor(a,void 0,"successor")}},e.prototype.getValidPredecessor=function(e){var i=this,r=[];if(!t.isNullOrUndefined(e)){var n=e.ganttProperties.predecessor;n&&n.length>0&&(r=n.filter(function(t){var r="ResourceView"===i.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;return t.from!==r.toString()}))}return r},e}(),Jt=function(){function e(e){this.expandedRecords=[],this.parent=e,this.dependencyViewContainer=t.createElement("div",{className:ve}),this.initPublicProp()}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,i,r){var n={},a=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport?this.parent.flatData:this.expandedRecords,s=a.indexOf(e),o=a.indexOf(i),l=e.ganttProperties,d=i.ganttProperties,p=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.getExpandedRecords(this.parent.currentViewData);n.parentIndexInCurrentView=p.indexOf(e),n.childIndexInCurrentView=p.indexOf(i);if(!(this.parent.virtualScrollModule&&this.parent.enableVirtualization)&&(-1===n.parentIndexInCurrentView||-1===n.childIndexInCurrentView)||-1===n.parentIndexInCurrentView&&-1===n.childIndexInCurrentView)return null;n.parentLeft=l.isMilestone?l.left-this.parent.chartRowsModule.milestoneHeight/2:l.left,n.childLeft=d.isMilestone?d.left-this.parent.chartRowsModule.milestoneHeight/2:d.left,n.parentWidth=0===l.width||l.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):l.width,n.childWidth=0===d.width||d.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):d.width,n.parentIndex=s,n.childIndex=o;var h=!t.isNullOrUndefined(this.parent.ganttChartModule.getChartRows())&&this.parent.ganttChartModule.getChartRows()[0]&&this.parent.ganttChartModule.getChartRows()[0].getBoundingClientRect().height;n.rowHeight=h&&!isNaN(h)?h:this.parent.rowHeight,n.type=r.type;var c="ResourceView"===this.parent.viewType?l.taskId:l.rowUniqueID,u="ResourceView"===this.parent.viewType?d.taskId:d.rowUniqueID;return n.connectorLineId="parent"+c+"child"+u,n.milestoneParent=!!l.isMilestone,n.milestoneChild=!!d.isMilestone,t.isNullOrUndefined(f(l))||t.isNullOrUndefined(f(d))?null:n},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.dependencyViewContainer.innerHTML=t;for(var n=this.parent.connectorLineModule.dependencyViewContainer.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.appendChild(this.dependencyViewContainer)},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 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,i){return"border-"+e+"-width:"+i+"px;"+("border-"+e+"-style:solid;")+(t.isNullOrUndefined(this.lineColor)?"":"border-"+e+"-color:"+this.lineColor+";")},e.prototype.getConnectorLineTemplate=function(e){var i=this.getInnerChildWidthSSType2(e),r=this.getInnerElementWidthSSType2(e),n=this.getInnerElementLeftSSType2(e),a=this.getHeightValue(e),s=!!e.milestoneParent,o=!!e.milestoneChild,l="",d=this.parent.virtualScrollModule&&this.parent.enableVirtualization,p=this.getPosition(e,this.getParentPosition(e),a),h=0;this.parent.renderBaseline&&(h=e.milestoneParent&&e.milestoneChild?0:e.milestoneParent?-5:e.milestoneChild?5:0);var c=d?p.height:a+h;if(this.getParentPosition(e)){l='<div id="ConnectorLine'+e.connectorLineId+'" style="background-color:black">';var u='<div class="'+De+'" tabindex="-1" style="',g='<div class="e-line" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),f='<div class="'+be+'" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),m='<div class="'+Pe+'" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),y=m+(o?"left:0px;":"")+this.getBorderStyles("right",10)+"top:"+(-5-this.lineStroke+(this.lineStroke-1))+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',v=this.getBorderStyles("left",10)+"top:"+-6+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',D=this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>'+g+"top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-(this.lineStroke-1))+'position:relative;"></div>',w=m+"left:"+(e.childLeft+e.childWidth-e.parentLeft+10)+"px;"+this.getBorderStyles("right",10),k="top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>';"FSType1"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType1">',u=(u+=g)+"left:"+(s?-1:0)+"px;width:"+(s?e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10+1:e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:0px;"+this.getBorderStyles("right",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=f)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles("left",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FSType2"===this.getParentPosition(e)&&(u=u+"left:"+e.parentLeft+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType2">',u=(u+=g)+"left:"+(s?e.parentWidth-1:e.parentWidth)+"px;width:"+(s?11:10)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentWidth+10-this.lineStroke)+"px;"+this.getBorderStyles("left",this.lineStroke)+"width:0px;"+this.getBorderStyles("top",c-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:"+(e.parentLeft+e.parentWidth-e.childLeft+30)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:0px;"+this.getBorderStyles("top",this.getconnectorLineGap(e)-this.lineStroke)+this.getBorderStyles("left",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=f)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+10))+"px;"+this.getBorderStyles("left",10)+"border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+"px;top:"+(-6-this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FSType3"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft-20)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType3">',u=(u+=f)+"left:10px;"+this.getBorderStyles("left",10)+"border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+"px;top:"+-6+'px;width:0;height:0;position:relative;"></div>',u=(u+=g)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(6+(5+this.lineStroke)+Math.round(this.lineStroke/2))+'px;"></div>',u=(u+=g)+"width:"+this.lineStroke+"px;"+this.getBorderStyles("top",c-this.getconnectorLineGap(e)-this.lineStroke+1)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',u=(u+=g)+"width:"+(e.parentLeft+e.parentWidth-e.childLeft+30)+"px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',u=(u+=g)+"left:"+(e.parentLeft+e.parentWidth-e.childLeft+(30-this.lineStroke))+"px;width:0px;height:"+(this.getconnectorLineGap(e)-this.lineStroke)+"px;"+this.getBorderStyles("left",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',u=(u+=g)+(s?"left:"+(e.parentLeft+e.parentWidth-e.childLeft+(18-this.lineStroke))+"px;width:"+(12+this.lineStroke)+"px;":"left:"+(e.parentLeft+e.parentWidth-e.childLeft+20)+"px;width:10px;")+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div></div>'),"FSType4"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType4">',u=(u+=f)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles("left",10)+"top:"+-6+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth)-20)+"px;top:"+-(6+(5+this.lineStroke)+Math.round(this.lineStroke/2))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;left:"+(e.childLeft-(e.parentLeft+e.parentWidth)-20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke+1)+'position:relative;"></div>',u=(u+=g)+(s?"left:-1px;":"")+"top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(s?e.childLeft-(e.parentLeft+e.parentWidth+20)+1+this.lineStroke:e.childLeft-(e.parentLeft+e.parentWidth+20)+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SSType4"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft-10)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType4">',u=(u+=f)+"left:"+(e.childLeft-e.parentLeft)+"px;"+v,u=(u+=g)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:"+(e.childLeft-e.parentLeft)+"px;"+D,u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SSType3"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft-20)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType3">',u=(u+=f)+"left:10px;"+v,u=(u+=g)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:10px;"+D,u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(e.parentLeft-e.childLeft+21)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SSType2"===this.getParentPosition(e)&&(u=u+"left:"+n+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType2">',u=(u+=g)+"width:"+(i+1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:"+r+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=f)+"left:"+r+"px;"+this.getBorderStyles("left",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"SSType1"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft-20)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType1">',u=(u+=g)+"width:"+(e.parentLeft-e.childLeft+21)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=f)+"left:10px;"+this.getBorderStyles("left",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FFType1"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType1">',u=(u+=g)+"left:"+(s?e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)-1:e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth))+"px;width:"+(s?21+this.lineStroke:20+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(o?4:10)+"px;width:"+(o?e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+(16+this.lineStroke):e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+(10+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=m)+(o?"left:0px;":"")+this.getBorderStyles("right",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FFType2"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType2">',u=(u+=g)+(s?"left:-1px;":"")+"width:"+(s?e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(21+this.lineStroke):e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(20+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(o?e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+4:e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+10)+"px;width:"+(o?16+this.lineStroke:10+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=m)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth))+"px;"+this.getBorderStyles("right",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FFType3"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType3">',u+=y,u=(u+=g)+(o?"left:4px;width:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+16):"left:10px;width:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+10))+"px;top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+20)+"px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke+1)+'position:relative;"></div>',u=(u+=g)+(s?"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)-1)+"px;width:21":"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth))+"px;width:20")+"px;top:"+-(13+2*(this.lineStroke-1))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"FFType4"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType4">',u=(u+=m)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth))+"px;"+this.getBorderStyles("right",10)+"top:"+(-5-this.lineStroke+(this.lineStroke-1))+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',u=(u+=g)+(o?"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+4)+"px;width:"+(16+this.lineStroke):"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+10)+"px;width:"+(10+this.lineStroke))+"px;"+k,u=(u+=g)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+20)+"px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke+1)+'position:relative;"></div>',u=(u+=g)+(s?"left:-1px;width:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(21+this.lineStroke)):"width:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(20+this.lineStroke)))+"px;top:"+-(13+2*(this.lineStroke-1))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType4"===this.getParentPosition(e)&&(u=(u=u+"left:"+(e.parentLeft-10)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType4">')+w+"top:"+(-5-this.lineStroke+(this.lineStroke-1))+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',u=(u+=g)+"left:"+(o?e.childLeft+e.childWidth-e.parentLeft+(14+this.lineStroke)+"px;width:16":e.childLeft+e.childWidth-e.parentLeft+20+"px;width:"+(10+this.lineStroke))+"px;"+k,u=(u+=g)+"left:"+(e.childLeft+e.childWidth-e.parentLeft+30)+"px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.getconnectorLineGap(e)-(this.lineStroke-1))+'position:relative;"></div>',u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(e.childLeft+e.childWidth-e.parentLeft+(30+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType3"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType3">',u+=y,u=(u+=g)+(o?"left:4px;width:"+(16+this.lineStroke):"left:10px;width:"+(10+this.lineStroke))+"px;top:"+-(13+2*(this.lineStroke-1)-1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:20px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-(this.lineStroke-1))+'position:relative;"></div>',u=(u+=g)+"left:20px;top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(e.parentLeft-(e.childLeft+e.childWidth+20)+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType1"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft-10)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType1">',u=(u+=g)+"width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:"+(e.childLeft+e.childWidth-e.parentLeft+(30+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft+e.childWidth-e.parentLeft+30)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',u=(u=(u+=g)+(o?"left:"+(e.childLeft+e.childWidth-e.parentLeft+15)+"px;width:"+(15+this.lineStroke):"left:"+(e.childLeft+e.childWidth-e.parentLeft+20)+"px;width:"+(10+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>')+w+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;position:relative;"></div></div>'),"SFType2"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType2">',u=(u+=g)+"left:"+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+(o?"left:4px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(14-this.lineStroke)):"left:10px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(20-this.lineStroke)))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=m)+"left:0px;"+this.getBorderStyles("right",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),l+=u,l+="</div>"}return l},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,p=-1!==e.childIndexInCurrentView,h=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&&p?i:p?e.childIndexInCurrentView*e.rowHeight+o:h*e.rowHeight+o):"SSType3"===t||"SSType4"===t||"FSType4"===t||"FFType3"===t||"FFType4"===t||"SFType4"===t||"SFType3"===t?(r=p?e.childIndexInCurrentView*e.rowHeight+l:0,n=d&&p?i:d?e.parentIndexInCurrentView*e.rowHeight+l:h*e.rowHeight+l):"FSType3"===t?(r=p?e.childIndexInCurrentView*e.rowHeight+o:0,n=d&&p?i:d?e.parentIndexInCurrentView*e.rowHeight+l:h*e.rowHeight+o):"SFType1"!==t&&"FSType1"!==t&&"FSType2"!==t||(r=d?e.parentIndexInCurrentView*e.rowHeight+l:0,n=d&&p?i:p?e.childIndexInCurrentView*e.rowHeight+l:h*e.rowHeight+l)}return{top:r,height:n}},e.prototype.createConnectorLineTooltipTable=function(){this.tooltipTable=t.createElement("table",{className:".e-tooltiptable",styles:"margin-top:0px",attrs:{cellspacing:"2px",cellpadding:"2px"}});var e=t.createElement("tbody");e.innerHTML="",this.tooltipTable.appendChild(e)},e.prototype.getConnectorLineTooltipInnerTd=function(e,t,i,r){var n='<tr id="fromPredecessor"><td >'+this.parent.localeObj.getConstant("from")+"</td><td> ";return n=n+e+" </td><td> "+this.parent.localeObj.getConstant(t)+" </td> </tr>",n=n+'<tr id="toPredecessor"><td>'+this.parent.localeObj.getConstant("to")+"</td><td> "+i,n=n+" </td><td> "+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){return t.isNullOrUndefined(e)?null:"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){for(var i,r=(i=!0===t.isObject(e))?Object.keys(e).length:e.length,n=Object.keys(e),a=0;a<r;a++){var s=void 0;if(i){s=e[n[a]]}else s=e[a];var o=s.ganttProperties&&s.ganttProperties.predecessor;if(o&&o.length>0)for(var l=0;l<o.length;l++){var d="parent"+o[l].from+"child"+o[l].to;this.removeConnectorLineById(d)}}},e.prototype.removeConnectorLineById=function(e){var i=this.parent.connectorLineModule.dependencyViewContainer.querySelector("#ConnectorLine"+e);t.isNullOrUndefined(i)||t.remove(i)},e}(),$t=function(){function e(e){this.parent=e,this.parent.on("destroy",this.destroy,this)}return e.prototype.renderSplitter=function(){var e=this,i=this.calculateSplitterPosition(this.parent.splitterSettings);this.parent.splitterElement=t.createElement("div",{className:"e-gantt-splitter"}),this.parent.treeGridPane=t.createElement("div",{className:"e-gantt-tree-grid-pane"}),this.parent.chartPane=t.createElement("div",{className:"e-gantt-chart-pane"}),this.parent.splitterElement.appendChild(this.parent.treeGridPane),this.parent.splitterElement.appendChild(this.parent.chartPane),this.splitterObject=new s.Splitter({height:null,width:this.parent.ganttWidth.toString(),enablePersistence:this.parent.enablePersistence,separatorSize:this.parent.splitterSettings.separatorSize,paneSettings:[{resizable:!0,size:i,min:this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum)},{resizable:!0}],orientation:"Horizontal",resizeStart:function(t){var i=t.pane[0],r=t.pane[1];e.splitterPreviousPositionGrid=i.scrollWidth+1+"px",e.splitterPreviousPositionChart=r.scrollWidth+1+"px";var a=new n.Deferred;return e.parent.trigger("splitterResizeStart",t,function(e){a.resolve(e)}),a},resizing:function(t){e.parent.trigger("splitterResizing",t)},resizeStop:function(t){var i=new n.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)),e.parent.timelineModule.updateTimelineAfterZooming(e.parent.timelineModule.timelineEndDate,!0),i.resolve(t)}),i}}),this.parent.element.appendChild(this.parent.splitterElement),this.splitterObject.appendTo(this.parent.splitterElement)},e.prototype.calculateSplitterPosition=function(e,i){return!t.isNullOrUndefined(this.splitterObject)&&this.parent.enablePersistence?this.splitterObject.paneSettings[0].size:"Grid"===e.view?"100%":"Chart"===e.view?"0%":t.isNullOrUndefined(e.position)||""===e.position?!t.isNullOrUndefined(e.columnIndex)&&e.columnIndex>=0?150*e.columnIndex<this.parent.ganttWidth||!this.parent.element.classList.contains("e-device")?i?this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(e.columnIndex).toString()+"px"):this.getSpliterPositionInPercentage(150*e.columnIndex+"px"):this.getSpliterPositionInPercentage(130*e.columnIndex+"px"):this.getSpliterPositionInPercentage("250px"):this.getSpliterPositionInPercentage(e.position)},e.prototype.getSpliterPositionInPercentage=function(e){var i=t.isNullOrUndefined(e)||""===e?null:e;if(!t.isNullOrUndefined(i))if(-1!==e.indexOf("px")){var r=parseInt(e,10);i=r/this.parent.ganttWidth*100<=100?r/this.parent.ganttWidth*100+"%":"25%"}else i=-1===e.indexOf("%")?e+"%":e;return i},e.prototype.getTotalColumnWidthByIndex=function(e){var t=0,i=this.parent.treeGrid.element.querySelectorAll(".e-headercell");e=i.length>e?e:i.length;for(var r=0;r<e;r++)t+=i[r].offsetWidth;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,!0);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}(),ei=function(){function e(e){this.parent=e,this.createTooltip(),this.parent.on("destroy",this.destroy,this)}return e.prototype.createTooltip=function(){this.toolTipObj=new i.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.enableHtmlSanitizer=!1,this.toolTipObj.cssClass="e-gantt-tooltip",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 i=this.parent;if(i.isOnEdit)e.cancel=!0;else{var r,a=t.closest(e.target,"div."+F);r=t.isNullOrUndefined(a)?g(e.target,_):e.target;var s,o={data:{},args:e,cancel:!1,content:""};if(e.target.classList.contains("e-header-cell-label"))i.timelineSettings.showTooltip?o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("timeline",s,i,e):e.cancel=!0;else if(i.tooltipSettings.showTooltip)if(r&&(o.data=i.ganttChartModule.getRecordByTaskBar(r),s=o.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")&&i.tooltipSettings.taskbar){var l=void 0;i.tooltipSettings.taskbar&&(l=i.tooltipModule.templateCompiler(i.tooltipSettings.taskbar,i,s,"TooltipTaskbarTemplate")),o.content=this.toolTipObj.content=l?l[0]:i.tooltipModule.getTooltipContent(s.ganttProperties.isMilestone?"milestone":"taskbar",s,i,e)}else if(e.target.classList.contains("e-baseline-bar")||e.target.classList.contains("e-baseline-gantt-milestone")){var d=void 0;i.tooltipSettings.baseline&&(d=i.tooltipModule.templateCompiler(i.tooltipSettings.baseline,i,s,"TooltipBaselineTemplate")),o.content=this.toolTipObj.content=d?d[0]:i.tooltipModule.getTooltipContent(s.ganttProperties.isMilestone?"milestone":"baseline",s,i,e)}else if(e.target.classList.contains("e-event-markers"))o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("marker",s,i,e);else if(e.target.classList.contains("e-connector-line-container")){var p=void 0;i.tooltipModule.predecessorTooltipData=i.tooltipModule.getPredecessorTooltipData(e),o.data=this.predecessorTooltipData,i.tooltipSettings.connectorLine&&(p=i.tooltipModule.templateCompiler(i.tooltipSettings.connectorLine,i,i.tooltipModule.predecessorTooltipData,"TooltipConnectorLineTemplate")),o.content=this.toolTipObj.content=p?p[0]:i.tooltipModule.getTooltipContent("connectorLine",s,i,e)}else if(e.target.classList.contains("e-indicator-span"))o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("indicator",s,i,e),t.isNullOrUndefined(o.content)&&(e.cancel=!0);else if(e.target.classList.contains("e-notes-info")){var h=this.parent.ganttChartModule.getRecordByTarget(e.event);o.content=this.toolTipObj.content=h.ganttProperties.notes,t.isNullOrUndefined(o.content)&&(e.cancel=!0)}else e.target.classList.contains("e-gantt-manualparenttaskbar")?(o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("manualtaskbar",s,i,e),t.isNullOrUndefined(o.content)&&(e.cancel=!0)):e.target.classList.contains("e-gantt-manualparent-milestone")&&(o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("manualmilestone",s,i,e),t.isNullOrUndefined(o.content)&&(e.cancel=!0));else e.cancel=!0;if(!1===e.cancel){var c=new n.Deferred;return i.trigger("beforeTooltipRender",o,function(t){c.resolve(t),t.cancel&&(e.cancel=!0)}),this.parent.isAdaptive||"mouseover"!==e.event.type||(this.currentTarget=e.target,t.EventHandler.add(this.currentTarget,"mousemove",this.mouseMoveHandler.bind(this))),this.parent.renderTemplates(),c}}},e.prototype.tooltipCloseHandler=function(e){this.tooltipMouseEvent=null,this.parent.isAdaptive||t.EventHandler.remove(this.currentTarget,"mousemove",this.mouseMoveHandler),this.currentTarget=null},e.prototype.mouseMoveHandler=function(e){this.tooltipMouseEvent=e},e.prototype.updateTooltipPosition=function(e){if(e.element.style.visibility="visible",!t.isNullOrUndefined(this.tooltipMouseEvent)&&!e.target.classList.contains("e-notes-info")){var i=this.getPointorPosition(this.tooltipMouseEvent),r=this.parent.getOffsetRect(this.parent.chartPane),n=r.top+this.parent.chartPane.offsetHeight,a=r.left+this.parent.chartPane.offsetWidth,s=i.x,o=i.y;if(a<s+e.element.offsetWidth+10)for(;a<s+e.element.offsetWidth+10;)s=a-e.element.offsetWidth-10,e.element.style.left=s+"px";else s+=10,e.element.style.left=s+"px";window.innerHeight<e.element.offsetHeight+o&&(o=o-e.element.offsetHeight-10),n<o+e.element.offsetHeight+20?o=o-e.element.offsetHeight-10:o+=10,e.element.style.top=o+"px"}},e.prototype.getPointorPosition=function(e){var i,r;return t.isNullOrUndefined(t.getValue("pageX",e))&&t.isNullOrUndefined(t.getValue("pageY",e))?t.isNullOrUndefined(t.getValue("clientX",e))&&t.isNullOrUndefined(t.getValue("clientY",e))||(i=t.getValue("clientX",e)+document.body.scrollLeft+document.documentElement.scrollLeft,r=t.getValue("clientY",e)+document.body.scrollTop+document.documentElement.scrollTop):(i=t.getValue("pageX",e),r=t.getValue("pageY",e)),{x:i,y:r}},e.prototype.getTooltipContent=function(e,i,r,n){var a,s,o;switch(i&&(s=i.ganttProperties,o=t.isNullOrUndefined(s.taskName)?"":'<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">'+s.taskName+"</td></tr>"),e){case"milestone":var l=void 0;n.target.className.includes("e-baseline-gantt-milestone")&&!t.isNullOrUndefined(s.baselineStartDate)?l=s.baselineStartDate:t.isNullOrUndefined(s.startDate)||(l=s.startDate);a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(t.isNullOrUndefined(l)?"":'<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(l,this.parent.getDateFormat())+"</td></tr>")+"</tbody></table>";break;case"taskbar":var d=!(i.hasChildRecords&&!s.isAutoSchedule);a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(s.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(d?"startDate":"subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(d?s.startDate:s.autoStartDate,this.parent.getDateFormat())+"</td></tr>":"")+(s.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(d?"endDate":"subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(d?s.endDate:s.autoEndDate,this.parent.getDateFormat())+"</td></tr>":"")+(t.isNullOrUndefined(s.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getDurationString(d?s.duration:s.autoDuration,s.durationUnit)+"</td></tr>")+(t.isNullOrUndefined(s.progress)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+"</td><td>:</td><td>"+s.progress+"</td></tr>")+"</tbody></table>";break;case"baseline":a='<table class = "e-gantt-tooltiptable"><tbody>'+o+'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.baselineStartDate,this.parent.getDateFormat())+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.baselineEndDate,this.parent.getDateFormat())+"</td></tr></tbody></table>";break;case"marker":var p=r.tooltipModule.getMarkerTooltipData(n),h=p.label?p.label:"";a='<table class = "e-gantt-tooltiptable"><tbody><tr><td>'+this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(p.day),this.parent.getDateFormat())+"</td></tr><tr><td>"+h+"</td></tr></tbody></table>";break;case"connectorLine":a='<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">'+r.tooltipModule.predecessorTooltipData.fromName+" ("+r.tooltipModule.predecessorTooltipData.fromId+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("to")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.tooltipModule.predecessorTooltipData.toName+" ("+r.tooltipModule.predecessorTooltipData.toId+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("taskLink")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+r.tooltipModule.predecessorTooltipData.linkText+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("lag")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.tooltipModule.predecessorTooltipData.offsetString+"</td></tr></tbody></table>";break;case"indicator":n.target.title.length&&(a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+n.target.title+"</tr></tbody></table>");break;case"timeline":a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+n.target.title+"</tr></tbody></table>";break;case"manualtaskbar":var c=s.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(s.autoStartDate,this.parent.getDateFormat())+"</td></tr>":"",u=s.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.autoEndDate,this.parent.getDateFormat())+"</td></tr>":"",g=t.isNullOrUndefined(s.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getDurationString(s.duration,s.durationUnit)+"</td></tr>";a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(s.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(s.startDate,this.parent.getDateFormat())+"</td></tr>":"")+c+(s.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.endDate,this.parent.getDateFormat())+"</td></tr>":"")+u+g+"</tbody></table>";break;case"manualmilestone":var f=s.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(s.autoStartDate,this.parent.getDateFormat())+"</td></tr>":"",m=s.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.autoEndDate,this.parent.getDateFormat())+"</td></tr>":"";a='<table class = "e-gantt-tooltiptable"><tbody>'+o+('<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.startDate,this.parent.getDateFormat())+"</tr>")+f+m+"</tbody></table>"}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,i,r=e.target.parentElement.id.match(/\d+/g);"ResourceView"===this.parent.viewType?(t=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[0])],i=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[1])]):(t=this.parent.flatData[this.parent.ids.indexOf(r[0])],i=this.parent.flatData[this.parent.ids.indexOf(r[1])]);var n=t.ganttProperties.predecessor.filter(function(e){return e.to===r[1]});return{fromId:"ResourceView"===this.parent.viewType?t.ganttProperties.taskId:t.ganttProperties.rowUniqueID,toId:"ResourceView"===this.parent.viewType?i.ganttProperties.taskId:i.ganttProperties.rowUniqueID,fromName:t.ganttProperties.taskName,toName:i.ganttProperties.taskName,linkType:n[0].type,linkText:this.parent.getPredecessorTextValue(n[0].type),offset:n[0].offset,offsetUnit:n[0].offsetUnit,offsetString:this.parent.getDurationString(n[0].offset,n[0].offsetUnit)}},e.prototype.templateCompiler=function(e,i,r,n){var a=i.chartRowsModule.templateCompiler(e),s=i.chartRowsModule.getTemplateID(n);return a(t.extend({index:0},r),i,n,s,!0)},e.prototype.destroy=function(){this.toolTipObj.destroy()},e}(),ti=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 i=this.parent,r=i.getExpandedRecords(i.currentViewData);if(t.isNullOrUndefined(this.parent.focusModule.getActiveElement())&&("expandAll"===e.action||"collapseAll"===e.action)){this.parent.element.querySelector(".e-treegrid").focus()}var n=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||t.isNullOrUndefined(i.editModule)||t.isNullOrUndefined(i.editModule.cellEditModule)||!0!==i.editModule.cellEditModule.isCellEdit)switch(i.isAdaptive&&("addRowDialog"!==e.action&&"editRowDialog"!==e.action&&"delete"!==e.action&&"addRow"!==e.action||i.selectionModule&&"Multiple"===i.selectionSettings.type&&(i.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),e.action){case"home":if(i.selectionModule&&"Cell"!==i.selectionSettings.mode){if(0===i.selectedRowIndex)return;i.selectionModule.selectRow(0,!1,!0)}break;case"end":if(i.selectionModule&&"Cell"!==i.selectionSettings.mode){var a=r[r.length-1];if(i.selectedRowIndex===i.flatData.indexOf(a))return;i.selectionModule.selectRow(i.flatData.indexOf(a),!1,!0)}break;case"downArrow":case"upArrow":(f=i.element.querySelector("#"+i.element.id+"_searchbar"))&&f.parentElement.classList.contains("e-input-focus")&&i.selectionModule.clearSelection(),i.element.classList.contains("e-scroll-disabled")||(this.upDownKeyNavigate(e),t.isNullOrUndefined(n)||t.isNullOrUndefined(n.closest(".e-chart-row"))||i.ganttChartModule.manageFocus(this.getActiveElement(),"remove",!0));break;case"expandAll":i.ganttChartModule.expandCollapseAll("expand");break;case"collapseAll":i.ganttChartModule.expandCollapseAll("collapse");break;case"expandRow":case"collapseRow":this.expandCollapseKey(e);break;case"saveRequest":if(!t.isNullOrUndefined(i.editModule)&&!t.isNullOrUndefined(i.editModule.cellEditModule)&&i.editModule.cellEditModule.isCellEdit){var s=i.editModule.cellEditModule.editedColumn;if(s.field===i.columnMapping.duration&&!t.isNullOrUndefined(s.edit)&&!t.isNullOrUndefined(s.edit.read)){var o=e.target.ej2_instances[0],l=e.target.value,d=i.currentViewData[i.selectedRowIndex].ganttProperties;s.field===i.columnMapping.duration&&l!==(t.isNullOrUndefined(s.edit)||t.isNullOrUndefined(s.edit.read)?t.isNullOrUndefined(s.valueAccessor)?i.dataOperation.getDurationString(d.duration,d.durationUnit):s.valueAccessor(i.columnMapping.duration,i.editedRecords,s):s.edit.read()).toString()&&(o.value=l,o.dataBind())}if(i.editModule.dialogModule.dialogObj&&t.getValue("dialogOpen",i.editModule.dialogModule.dialogObj))return;i.editModule.cellEditModule.isCellEdit=!1,i.treeGrid.grid.saveCell();i.element.querySelector(".e-treegrid").focus()}if(!t.isNullOrUndefined(this.parent.onTaskbarClick)&&!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(n.closest(".e-chart-row"))){var p=e.target,h=n.querySelector(".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");h&&this.parent.ganttChartModule.onTaskbarClick(e,p,h)}break;case"cancelRequest":t.isNullOrUndefined(i.editModule)||t.isNullOrUndefined(i.editModule.cellEditModule)||(i.editModule.cellEditModule.isCellEdit=!1,t.isNullOrUndefined(i.toolbarModule)||i.toolbarModule.refreshToolbarItems());break;case"addRow":if(t.isNullOrUndefined(document.getElementById(this.parent.element.id+"_dialog"))){e.preventDefault(),i.addRecord(void 0,this.parent.editSettings.newRowPosition);i.element.focus()}break;case"addRowDialog":if(e.preventDefault(),i.editModule&&i.editModule.dialogModule&&i.editSettings.allowAdding){if(i.editModule.dialogModule.dialogObj&&t.getValue("dialogOpen",i.editModule.dialogModule.dialogObj))return;i.editModule.dialogModule.openAddDialog()}break;case"editRowDialog":e.preventDefault();if(i.element.querySelector(".e-treegrid").focus(),i.editModule&&i.editModule.dialogModule&&i.editSettings.allowEditing){if(i.editModule.dialogModule.dialogObj&&t.getValue("dialogOpen",i.editModule.dialogModule.dialogObj))return;i.editModule.dialogModule.openToolbarEditDialog()}break;case"delete":i.selectionModule&&i.editModule&&i.editModule.dialogModule&&(!i.editModule.dialogModule.dialogObj||i.editModule.dialogModule.dialogObj&&!i.editModule.dialogModule.dialogObj.visible)&&(!i.editSettings.allowTaskbarEditing||i.editSettings.allowTaskbarEditing&&!i.editModule.taskbarEditModule.touchEdit)&&("Cell"!==i.selectionSettings.mode&&i.selectionModule.selectedRowIndexes.length||"Cell"===i.selectionSettings.mode&&i.selectionModule.getSelectedRowCellIndexes().length)&&i.editModule.startDeleteAction();break;case"focusTask":e.preventDefault();var c=void 0;if(i.selectionModule){var u=i.currentViewData;if("Cell"===i.selectionSettings.mode||t.isNullOrUndefined(u[i.selectedRowIndex])){if("Cell"===i.selectionSettings.mode&&i.selectionModule.getSelectedRowCellIndexes().length>0){var g=i.selectionModule.getSelectedRowCellIndexes();c=u[g[g.length-1].rowIndex].ganttProperties.rowUniqueID}}else c=i.currentViewData[i.selectedRowIndex].ganttProperties.rowUniqueID}c&&i.scrollToTask(c.toString());break;case"focusSearch":if(i.element.querySelector("#"+i.element.id+"_searchbar")){var f;(f=i.element.querySelector("#"+i.element.id+"_searchbar")).setAttribute("tabIndex","-1"),f.focus()}break;case"tab":case"shiftTab":i.element.classList.contains("e-scroll-disabled")||i.ganttChartModule.onTabAction(e);break;case"contextMenu":var m=document.getElementById(this.parent.element.id+"_contextmenu").ej2_instances[0],y=this.parent.getOffsetRect(e.target),v=y.top+y.height/2,D=y.left+y.width/2;this.setActiveElement(e.target),m.open(v,D),e.preventDefault();break;default:var w={requestType:"keyPressed",action:e.action,keyEvent:e};i.trigger("actionComplete",w)}},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,a=n>-1?n:i.indexOf(r),s="downArrow"===e.action?i[a+1]:i[a-1];t.selectionModule.selectRow(t.currentViewData.indexOf(s),!1,!0)}else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var o=t.selectionModule.getSelectedRowCellIndexes(),l=o[o.length-1],d=l.cellIndexes[l.cellIndexes.length-1],p=(r=t.currentViewData[l.rowIndex],a=i.indexOf(r),s="downArrow"===e.action?i[a+1]:i[a-1],{rowIndex:t.currentViewData.indexOf(s),cellIndex:d});t.selectionModule.selectCell(p)}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}(),ii=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)}}(),ri=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},ni=function(e){function n(i,r){var n=e.call(this,i,r)||this;return n.isCancelled=!1,n.previousRecords={},n.editedRecords=[],n.modifiedRecords=[],n.isOnEdit=!1,n.isOnDelete=!1,n.isExpandCollapseLevelMethod=!1,n.isDynamicData=!1,n.isConnectorLineUpdate=!1,n.staticSelectedRowIndex=-1,n.needsID=!0,n.showActiveElement=!0,n.addDeleteRecord=!1,n.enableHeaderFocus=!0,n.enableValidation=!0,n.isTreeGridRendered=!1,n.isFromOnPropertyChange=!1,n.isGanttChartRendered=!1,n.isEdit=!1,t.setValue("mergePersistData",n.mergePersistGanttData,n),n}return ii(n,e),n.prototype.getModuleName=function(){return"gantt"},n.prototype.preRender=function(){this.initProperties()},n.prototype.initProperties=function(){this.globalize=new t.Internationalization(this.locale),this.isAdaptive=t.Browser.isDevice,this.flatData=[],this.currentViewData=[],this.updatedRecords=[],this.ids=[],this.ganttColumns=[],this.localeObj=new t.L10n(this.getModuleName(),this.getDefaultLocale(),this.locale),this.dataOperation=new O(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 Ye(this),this.timelineModule=new Qe(this),this.chartRowsModule=new Qt(this),this.treeGridModule=new Je(this),this.dateValidationModule=new M(this),this.predecessorModule=new Kt(this),this.connectorLineModule=new Jt(this),this.splitterModule=new $t(this),this.tooltipModule=new ei(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 ti(this),this.zoomingLevels=this.getZoomingLevels(),this.resourceFieldsMapping(),t.isNullOrUndefined(this.resourceFields.unit)&&(this.resourceFields.unit="unit"),t.isNullOrUndefined(this.taskFields.work)||(this.taskType="FixedWork"),this.taskIds=[]},n.prototype.getDateFormat=function(){if(t.isNullOrUndefined(this.dateFormat)){return this.globalize.getDatePattern({skeleton:"yMd"})}return this.dateFormat},n.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())},n.prototype.isInDst=function(e){return e.getTimezoneOffset()<this.getDefaultTZOffset()},n.prototype.resourceFieldsMapping=function(){var e=this.resourceFields;e.id=t.isNullOrUndefined(e.id)?this.resourceIDMapping:e.id,e.name=t.isNullOrUndefined(e.name)?this.resourceNameMapping:e.name},n.prototype.validateDimentionValue=function(e){return t.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()},n.prototype.calculateDimensions=function(){var e=this.validateDimentionValue(this.height),i=this.validateDimentionValue(this.width);t.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(i=this.width);var r=this.element.style.height,n=this.element.style.width;i&&(this.element.style.width=i),e&&(this.element.style.height=e),e||r||(this.element.style.height="auto"),i||n||(this.element.style.width="auto"),this.ganttHeight=this.element.offsetHeight,this.ganttWidth=this.element.offsetWidth},n.prototype.render=function(){this.isReact&&(this.treeGrid.isReact=!0,this.treeGrid.grid.isReact=!0),i.createSpinner({target:this.element},this.createElement),this.trigger("load",{}),this.element.classList.add("e-gantt"),this.isAdaptive?this.element.classList.add("e-device"):this.element.classList.remove("e-device"),this.calculateDimensions(),t.isNullOrUndefined(this.toolbarModule)||this.renderToolbar(),this.splitterModule.renderSplitter(),this.notify("renderPanels",null),this.showSpinner(),this.dataOperation.checkDataBinding()},n.prototype.showSpinner=function(){i.showSpinner(this.element)},n.prototype.hideSpinner=function(){i.hideSpinner(this.element)},n.prototype.processTimeline=function(){this.timelineModule.processTimelineUnit(),this.timelineModule.calculateZoomingLevelsPerDayWidth()},n.prototype.renderGantt=function(e){if(this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors(),this.isInPredecessorValidation&&this.enableValidation&&this.predecessorModule.updatedRecordsDateByPredecessor()),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp()),e)if(this.isFromOnPropertyChange=e,this.enableValidation&&this.dataOperation.updateGanttData(),this.dataSource instanceof Object&&m(this)){var i=t.getValue("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:i}}else this.treeGrid.setProperties({dataSource:this.flatData},!1);else this.enableValidation&&this.dataOperation.updateGanttData(),this.treeGridPane.classList.remove("e-temp-content"),t.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.splitterModule.updateSplitterPosition(),"Vertical"!==this.gridLines&&"Both"!==this.gridLines||this.renderChartVerticalLines()},n.prototype.wireEvents=function(){this.allowKeyboard&&(this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfig,eventName:"keydown"})),t.EventHandler.add(window,"resize",this.windowResize,this)},n.prototype.windowResize=function(){if(!t.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)),this.enableCriticalPath)){var e=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds)}},n.prototype.keyActionHandler=function(e){this.focusModule.onKeyPress(e)},n.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}},n.prototype.renderToolbar=function(){t.isNullOrUndefined(this.toolbarModule)||(this.toolbarModule.renderToolbar(),this.toolbarModule.refreshToolbarItems())},n.prototype.renderTreeGrid=function(){this.treeGridModule.renderTreeGrid()},n.prototype.updateCurrentViewData=function(){this.currentViewData=this.treeGrid.getCurrentViewRecords().slice()},n.prototype.getRecordFromFlatdata=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getTaskByUniqueID(e[i].uniqueID));return t},n.prototype.updateContentHeight=function(e){if(this.virtualScrollModule&&this.enableVirtualization&&!t.isNullOrUndefined(e)){var i=t.getValue("result.length",e);this.contentHeight=i*this.rowHeight}else{var r=this.virtualScrollModule&&this.enableVirtualization?this.currentViewData:this.getExpandedRecords(this.currentViewData),n=void 0,a=t.isNullOrUndefined(this.ganttChartModule.getChartRows())?null:this.ganttChartModule.getChartRows()[0];n=!t.isNullOrUndefined(a)&&a.getBoundingClientRect().height>0?a.getBoundingClientRect().height:this.rowHeight,this.contentHeight=r.length*n}},n.prototype.getExpandStatus=function(e){var i=this.getParentTask(e.parentItem);if(t.isNullOrUndefined(i))return!0;if(!1===i.expanded)return!1;if(i.parentItem){return!1!==this.getParentTask(i.parentItem).expanded&&this.getExpandStatus(this.getParentTask(i.parentItem))}return!0},n.prototype.getExpandedRecords=function(e){var i=this;if(t.isNullOrUndefined(e))return[];return e.filter(function(e){return!0===i.getExpandStatus(e)})},n.prototype.getZoomingLevels=function(){return[{topTier:{unit:"Year",format:"yyyy",count:50},bottomTier:{unit:"Year",format:"yyyy",count:10},timelineUnitSize:99,level:0,timelineViewMode:"Year",weekStartDay:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0}]},n.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"},n.prototype.displayHalfValue=function(e){var t=e.getMonth();return t>=0&&t<=5?"H1":"H2"},n.prototype.getFormatedDate=function(e,i){return t.isNullOrUndefined(e)?null:(t.isNullOrUndefined(i)&&(i=this.getDateFormat()),this.globalize.formatDate(e,{format:i}))},n.prototype.getDurationString=function(e,t){return this.dateValidationModule.getDurationString(e,t)},n.prototype.getWorkString=function(e,t){return this.dateValidationModule.getWorkString(e,t)},n.prototype.updateTreeColumns=function(){var e,i=this.treeGrid.grid.getColumns();-1!==this.treeColumnIndex&&this.columns[this.treeColumnIndex]&&!t.isNullOrUndefined(this.columns[this.treeColumnIndex].template)&&(e=this.columns[this.treeColumnIndex].template,this.columns[this.treeColumnIndex].field);for(var r,n=0;n<i.length;n++){r={};for(var a=0;a<this.columns.length;a++)if(this.columns[a].field==i[n].field){for(var s=0,o=Object.keys(this.columns[a]);s<o.length;s++){var l=o[s];t.isUndefined(this.columns[a][l])||(r[l]=i[n][l]),r.visible=i[n].visible,r.width=i[n].width}this.columns[a]=r,"checkbox"===this.columns[a].type||t.isNullOrUndefined(e)||""===e||(this.columns[a].template=e)}}this.columns.length>0&&this.treeGrid.setProperties({columns:this.columns},!0)},n.prototype.treeDataBound=function(e){this.element.getElementsByClassName("e-chart-root-container")[0].style.height="100%";this.element.getElementsByClassName("e-gridcontent")[0].style.height;var i=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight;if("calc(100% - "+i+"px)",this.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+i+"px)",t.isNullOrUndefined(this.toolbarModule)||t.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;t.isNullOrUndefined(this.toolbarModule)||t.isNullOrUndefined(this.toolbarModule.element)||this.toolbarModule.element.offsetHeight,this.timelineModule.isSingleTier?(t.addClass(this.treeGrid.element.querySelectorAll(".e-headercell"),x),t.addClass(this.treeGrid.element.querySelectorAll(".e-columnheader"),x)):(t.removeClass(this.treeGrid.element.querySelectorAll(".e-headercell"),x),t.removeClass(this.treeGrid.element.querySelectorAll(".e-columnheader"),x)),this.treeGrid.height="100%",this.notify("tree-grid-created",{}),this.createGanttPopUpElement(),this.hideSpinner(),t.setValue("isGanttCreated",!0,e),this.renderComplete()}}else this.getCurrentRecords(e);if(this.enableCriticalPath&&this.criticalPathModule&&this.criticalPathModule.showCriticalPath(this.enableCriticalPath),this.notify("recordsUpdated",{}),this.enableCriticalPath&&this.criticalPathModule){var r=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(r.criticalPathCollection,r.detailPredecessorCollection,!0,r.predecessorCollectionTaskIds)}this.initialChartRowElements=this.ganttChartModule.getChartRows(),this.isLoad=!1,this.trigger("dataBound",e)},n.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())},n.prototype.onPropertyChanged=function(e,i){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=r.getActualProperties(this.columnMenuItems);break;case"eventMarkers":case"highlightWeekends":this.notify("ui-update",{module:"day-markers",properties:e});break;case"sortSettings":this.treeGrid.sortSettings=r.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":case"enableCriticalPath":this.dataOperation.checkDataBinding(!0);break;case"filterSettings":this.treeGrid.filterSettings=r.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=r.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=r.getActualProperties(this.searchSettings),this.treeGrid.grid.dataBind()),this.treeGrid.searchSettings=r.getActualProperties(this.searchSettings),this.treeGrid.dataBind(),this.toolbarModule&&this.toolbarModule.updateSearchTextBox();break;case"labelSettings":case"renderBaseline":case"baselineColor":this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"resourceIDMapping":case"resourceNameMapping":case"resources":this.dataOperation.reUpdateResources(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"includeWeekend":case"dayWorkingTime":case"allowUnscheduledTasks":case"holidays":"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();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,t.isNullOrUndefined(this.editModule)||this.editModule.reUpdateEditModules(),t.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.dataOperation.calculateProjectDates(),this.updateProjectDates(this.cloneProjectStartDate,this.cloneProjectEndDate,this.isTimelineRoundOff);break;case"selectedRowIndex":t.isNullOrUndefined(this.selectionModule)||this.selectionModule.selectRowByIndex();break;case"dataSource":if(this.closeGanttActions(),this.dataSource instanceof Object&&m(this)){this.treeGrid.hasChildMapping="isParent";var l=t.getValue("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:l}}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":n=!0;break;case"validateManualTasksOnLinking":this.validateManualTasksOnLinking=e.validateManualTasksOnLinking;break;case"showOverAllocation":this.updateOverAllocationCotainer()}}n&&this.refresh()},n.prototype.updateOverAllocationCotainer=function(){if(this.showOverAllocation&&"ResourceView"===this.viewType)this.ganttChartModule.renderOverAllocationContainer();else{var e=this.element.querySelector("."+ze);e&&(e.innerHTML="")}},n.prototype.getPersistData=function(){for(var e=["sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","currentZoomingLevel","cloneProjectStartDate","cloneProjectEndDate"],i={filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[]},r=0;r<e.length;r++)for(var n=this[e[r]],a=0,s=i[e[r]];!t.isNullOrUndefined(s)&&a<s.length;a++){delete n[s[a]]}return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},n.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)this.ignoreInColumn(e,t[i])},n.prototype.ignoreInColumn=function(e,t){for(var i=0;i<e.length;i++)delete t[e[i]],t.filter={}},n.prototype.destroy=function(){this.notify("destroy",{}),t.isNullOrUndefined(this.validationDialogElement)||this.validationDialogElement.isDestroyed||this.validationDialogElement.destroy();for(var i=["ganttChartModule","timelineModule","chartRowsModule","treeGridModule","ganttDataUpdatesModule","dateValidationModule","tooltipModule"],r=0;r<i.length;r++)this[i[r]]&&(this[i[r]]=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="",t.removeClass([this.element],"e-gantt"),this.element.innerHTML="",this.isTreeGridRendered=!1,this.resetTemplates(),t.EventHandler.remove(window,"resize",this.windowResize)},n.prototype.getTaskbarHeight=function(){return this.chartRowsModule.taskBarHeight},n.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&&e.push({member:"rowDragAndDrop",args:[this]}),this.enableCriticalPath&&e.push({member:"criticalPath",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),this.toolbar&&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)},n.prototype.sortColumn=function(e,t,i){this.sortModule&&this.allowSorting&&this.sortModule.sortColumn(e,t,i)},n.prototype.mergePersistGanttData=function(){this.treeGrid||(this.treeGrid=new a.TreeGrid);this.treeGrid.grid.mergePersistGridData.apply(this)},n.prototype.mergeColumns=function(e,t){this.treeGrid.grid.mergeColumns.apply(this,[e,t])},n.prototype.clearSorting=function(){this.sortModule.clearSorting()},n.prototype.renderChartGridLines=function(){var e="e-chart-row-border",i=this.chartVerticalLineContainer,r=document.getElementById(this.element.id+"GanttTaskTableBody").querySelectorAll("td");if("Vertical"===this.gridLines){if(t.isNullOrUndefined(i)?this.renderChartVerticalLines():"none"===i.style.display&&(i.style.display="block"),r[0].classList.contains(e))for(var n=0;n<r.length;n++)t.removeClass([r[n]],e)}else if("Horizontal"===this.gridLines){if(t.isNullOrUndefined(i)||(i.style.display="none"),!r[0].classList.contains(e))for(n=0;n<r.length;n++)t.addClass([r[n]],e)}else if("Both"===this.gridLines){if(t.isNullOrUndefined(i)?this.renderChartVerticalLines():"none"===i.style.display&&(i.style.display="block"),!r[0].classList.contains(e))for(n=0;n<r.length;n++)t.addClass([r[n]],e)}else if("None"===this.gridLines&&(t.isNullOrUndefined(i)||"none"===i.style.display||(i.style.display="none"),r[0].classList.contains(e)))for(n=0;n<r.length;n++)t.removeClass([r[n]],e)},n.prototype.updateGridLineContainerHeight=function(){this.chartVerticalLineContainer&&(this.chartVerticalLineContainer.style.height=t.formatUnit(this.getContentHeight()))},n.prototype.getContentHeight=function(){var e=this.ganttChartModule.scrollElement.offsetHeight-16,t=this.ganttChartModule.chartBodyContent.offsetHeight;return t<e?t:e},n.prototype.reUpdateDimention=function(){var e=0;if(this.calculateDimensions(),t.isNullOrUndefined(this.toolbarModule)||t.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(),t.isNullOrUndefined(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer.style.height=this.ganttHeight+"px"),!t.isNullOrUndefined(this.dayMarkersModule)){var i=t.getValue("nonworkingDayRender.holidayContainer",this.dayMarkersModule),r=t.getValue("nonworkingDayRender.weekendContainer",this.dayMarkersModule),n=t.getValue("eventMarkerRender.eventMarkersContainer",this.dayMarkersModule);i&&(i.style.height=this.ganttHeight+"px"),r&&(r.style.height=this.ganttHeight+"px"),n&&(n.style.height=this.ganttHeight+"px")}this.splitterModule.splitterObject.width=this.ganttWidth.toString(),this.ganttChartModule.scrollObject.setHeight(this.ganttHeight-this.ganttChartModule.chartTimelineContainer.offsetHeight-e)},n.prototype.renderChartVerticalLines=function(){this.element.contains(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer=t.createElement("div",{id:this.element.id+"line-container",styles:"position:absolute;height:100%;z-index:1"}),this.ganttChartModule.chartBodyContent.appendChild(this.chartVerticalLineContainer)),this.chartVerticalLineContainer.innerHTML="";var e=this.element.getElementsByClassName("e-timeline-header-table-container")[1];t.isNullOrUndefined(e)&&(e=this.element.getElementsByClassName("e-timeline-header-table-container")[0]);for(var i,r=e.getElementsByTagName("th"),n=r.length,a=0,s=t.createElement("div"),o=0;o<n;o++){a=0===o?-1:a+parseFloat(i),i=r[o].style.width;var l=t.createElement("div",{className:"e-line-container-cell",styles:"left:"+a+"px"});s.appendChild(l)}this.chartVerticalLineContainer.innerHTML=s.innerHTML},n.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"}},n.prototype.removeSortColumn=function(e){this.sortModule.removeSortColumn(e)},n.prototype.actionBeginTask=function(e){this.trigger("actionBegin",e)},n.prototype.scrollToDate=function(e){var t=this.dateValidationModule.getDateFromFormat(e),i=this.dataOperation.getTaskLeft(t,!1);this.ganttChartModule.updateScrollLeft(i)},n.prototype.scrollToTask=function(e){if(-1!==this.ids.indexOf(e)){var t=this.flatData[this.ids.indexOf(e)].ganttProperties.left;this.ganttChartModule.updateScrollLeft(t)}},n.prototype.updateChartScrollOffset=function(e,i){t.isNullOrUndefined(e)||(e=this.ganttChartModule.scrollElement.scrollWidth<=e?this.ganttChartModule.scrollElement.scrollWidth:e,this.ganttChartModule.scrollObject.setScrollLeft(e)),t.isNullOrUndefined(i)||(i=this.ganttChartModule.scrollElement.scrollHeight<=i?this.ganttChartModule.scrollElement.scrollHeight:i,this.ganttChartModule.scrollObject.setScrollTop(i))},n.prototype.getParentTask=function(e){if(t.isNullOrUndefined(e))return null;var i=this.flatData.filter(function(t){return e.uniqueID===t.uniqueID});return i.length>0?i[0]:null},n.prototype.getRootParent=function(e,t){return e.level===t?e:this.getRootParent(this.getParentTask(e.parentItem),t)},n.prototype.filterByColumn=function(e,t,i,r,n,a){this.treeGrid.filterByColumn(e,t,i,r,n,a)},n.prototype.excelExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.excelExport(e,t,i,r):null},n.prototype.csvExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.csvExport(e,t,i,r):null},n.prototype.pdfExport=function(e,t,i){return this.pdfExportModule?this.pdfExportModule.export(e,t,i):null},n.prototype.clearFiltering=function(e){this.treeGrid.grid.clearFiltering(e)},n.prototype.removeFilteredColsByField=function(e){this.treeGrid.removeFilteredColsByField(e,!1)},n.prototype.renderWorkingDayCell=function(e){var t="Auto"!==this.taskMode||!!this.includeWeekend?[]:this.nonWorkingDayIndex,i=this.totalHolidayDates;if(t.length>0&&-1!==t.indexOf(e.date.getDay()))e.isDisabled=!0;else if(i.length>0){var r=new Date(e.date.getTime());r.setHours(0,0,0),-1!==i.indexOf(r.getTime())&&(e.isDisabled=!0)}},n.prototype.previousTimeSpan=function(e){this.timelineModule.performTimeSpanAction("prevTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},n.prototype.nextTimeSpan=function(e){this.timelineModule.performTimeSpanAction("nextTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},n.prototype.updateProjectDates=function(e,i,r,n){this.timelineModule.totalTimelineWidth=0,this.cloneProjectStartDate=e,this.cloneProjectEndDate=i,this.isTimelineRoundOff=r,this.timelineModule.refreshTimelineByTimeSpan(),this.dataOperation.reUpdateGanttDataPosition(),this.timelineModule.updateChartByNewTimeline(),this.ganttChartModule.chartBodyContent.style.width=t.formatUnit(this.timelineModule.totalTimelineWidth),this.ganttChartModule.updateLastRowBottomWidth(),"Vertical"!==this.gridLines&&"Both"!==this.gridLines||this.renderChartVerticalLines(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines(),"beforeAdd"!==n&&this.notify("selectRowByIndex",{})},n.prototype.splitTask=function(e,t){this.isEdit=!0,this.chartRowsModule.splitTask(e,t)},n.prototype.mergeTask=function(e,t){this.chartRowsModule.mergeTask(e,t)},n.prototype.reorderColumns=function(e,t){this.treeGrid.reorderColumns(e,t)},n.prototype.initiateEditAction=function(e){this.isOnEdit=e,this.previousRecords={},this.editedRecords=[]},n.prototype.setRecordValue=function(e,i,r,n){if(this.isOnEdit||this.isOnDelete){this.makeCloneData(e,r,n);var a=n?r.rowUniqueID:r.ganttProperties.rowUniqueID,s=this.getRecordByID(a);s&&-1===this.editedRecords.indexOf(s)&&(this.editedRecords.push(s),this.enableImmutableMode&&this.modifiedRecords.push(s))}i=t.isUndefined(i)?null:i,t.setValue(e,i,r)},n.prototype.makeCloneData=function(e,i,r){var n,a,s,o=t.getValue(e,i);if(r&&(e="ganttProperties."+e),t.isNullOrUndefined(this.previousRecords[i.uniqueID])){this.previousRecords[i.uniqueID]={}}n=this.previousRecords[i.uniqueID],a=t.getValue(e,n),t.isUndefined(a)&&(s=o instanceof Date?new Date(o.getTime()):t.isObjectArray(o)?t.extend([],o,[],!0):t.isObject(o)?t.extend({},{},o,!0):o,t.isUndefined(s)?t.setValue(e,null,n):t.setValue(e,s,n))},n.prototype.closeGanttActions=function(){this.editModule&&(this.editModule.cellEditModule&&this.editModule.cellEditModule.isCellEdit?(this.treeGrid.closeEdit(),this.editModule.cellEditModule.isCellEdit=!1,t.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()))},n.prototype.getTaskByUniqueID=function(e){var t=this.flatData.filter(function(t){return t.uniqueID===e});return t.length>0?t[0]:null},n.prototype.getRecordByID=function(e){return t.isNullOrUndefined(e)?null:this.flatData[this.ids.indexOf(e.toString())]},n.prototype.setSplitterPosition=function(e,t){var i={};i[t]=e;var r=this.splitterModule.calculateSplitterPosition(i,!0),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()},n.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)}},n.prototype.expandByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)},n.prototype.collapseByIndex=function(e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},n.prototype.collapseByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},n.prototype.addRecord=function(e,i,r){if(this.editModule&&this.editSettings.allowAdding)if("ResourceView"===this.viewType){this.editModule.addRowPosition=i,this.editModule.addRowIndex=r;var n=e[this.taskFields.resourceInfo],a=void 0,s=void 0;if(!t.isNullOrUndefined(n)&&n.length){for(var o=0;o<n.length&&(a="object"==typeof n[o]?n[o][this.resourceFields.id]:n[0],!(s=this.flatData[this.getTaskIds().indexOf("R"+a)]));o++);if(s&&s.childRecords.length||0===s.level){var l=s.childRecords[r];if(l){var d="Above"===i||"Below"===i?i:"Child";"Child"===d?this.editModule.addRecord(e,d,this.getTaskIds().indexOf("R"+a)):this.editModule.addRecord(e,d,this.flatData.indexOf(l))}else this.editModule.addRecord(e,"Child",this.getTaskIds().indexOf("R"+a))}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,i,r)},n.prototype.updateRecordByID=function(e){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateRecordByID(e)},n.prototype.updateTaskId=function(e,t){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateTaskId(e,t)},n.prototype.expandAtLevel=function(e){this.enableVirtualization&&(this.isExpandCollapseLevelMethod=!0),this.ganttChartModule.expandAtLevel(e)},n.prototype.indent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.indent()},n.prototype.outdent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.outdent()},n.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)}},n.prototype.getCriticalTasks=function(){return!t.isNullOrUndefined(this.criticalPathModule)&&this.enableCriticalPath?this.criticalPathModule.getCriticalTasks():null},n.prototype.zoomIn=function(){this.timelineModule.processZooming(!0)},n.prototype.zoomOut=function(){this.timelineModule.processZooming(!1)},n.prototype.fitToProject=function(){this.timelineModule.processZoomToFit(),this.ganttChartModule.updateScrollLeft(0)},n.prototype.reorderRows=function(e,t,i){this.rowDragAndDropModule.reorderRows(e,t,i)},n.prototype.updateRecordByIndex=function(e,i){if(this.editModule&&this.editSettings.allowEditing){var r=this.taskFields,n=this.updatedRecords.length>0?t.isNullOrUndefined(this.updatedRecords[e])?null:this.updatedRecords[e]:null;t.isNullOrUndefined(n)||(i[r.id]=n[r.id],this.editModule.updateRecordByID(i))}},n.prototype.addPredecessor=function(e,i){var r=this.getRecordByID(e.toString());this.editModule&&!t.isNullOrUndefined(r)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.addPredecessor(r,i)},n.prototype.removePredecessor=function(e){var i=this.getRecordByID(e.toString());this.editModule&&!t.isNullOrUndefined(i)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.removePredecessor(i)},n.prototype.updatePredecessor=function(e,i){var r=this.getRecordByID(e.toString());this.editModule&&!t.isNullOrUndefined(r)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.updatePredecessor(r,i)},n.prototype.openAddDialog=function(){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowAdding&&this.editModule.dialogModule.openAddDialog()},n.prototype.openEditDialog=function(e){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowEditing&&this.editModule.dialogModule.openEditDialog(e)},n.prototype.contructExpandCollapseArgs=function(e,i){var r,n,a;t.isNullOrUndefined(i)?(n=this.getRecordByID(e.toString()),r=this.getRowByID(e),a=t.getValue("rowIndex",r)):t.isNullOrUndefined(i)||(r=this.getRowByIndex(i),a=t.getValue("rowIndex",r),n=this.currentViewData[a]);return{data:n,gridRow:this.treeGrid.getRows()[a],chartRow:r,cancel:!1}},n.prototype.getRowByIndex=function(e){try{var i=this.element.querySelectorAll(".e-chart-row");return t.isNullOrUndefined(e)?null:i[e]}catch(e){return null}},n.prototype.getRowByID=function(e){var t=this.getRecordByID(e.toString()),i=this.updatedRecords.indexOf(t);return-1!==i?this.getRowByIndex(i):null},n.prototype.getUnscheduledTaskClass=function(e){return t.isNullOrUndefined(e.startDate)&&t.isNullOrUndefined(e.endDate)&&t.isNullOrUndefined(e.duration)?" "+he:t.isNullOrUndefined(e.startDate)||t.isNullOrUndefined(e.endDate)||t.isNullOrUndefined(e.duration)?" "+he:""},n.prototype.isUnscheduledTask=function(e){return!!(t.isNullOrUndefined(e.startDate)||t.isNullOrUndefined(e.endDate)||t.isNullOrUndefined(e.duration))},n.prototype.createGanttPopUpElement=function(){var e=this.createElement("div",{className:"e-ganttpopup",styles:"display:none;"}),i=this.createElement("div",{className:"e-content",attrs:{tabIndex:"-1"}});t.append([i,this.createElement("div",{className:"e-uptail e-tail"})],e),i.appendChild(this.createElement("span")),t.append([i,this.createElement("div",{className:"e-downtail e-tail"})],e),document.getElementById(this.element.id+"GanttChart").appendChild(e)},n.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},n.prototype.search=function(e){this.filterModule&&(this.searchSettings.key=e,this.dataBind())},n.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=t.left+r-a;return{top:Math.round(s),left:Math.round(o),width:t.width,height:t.height}},n.prototype.expandAll=function(){this.ganttChartModule.expandCollapseAll("expand")},n.prototype.updateDataSource=function(e,i){if(this.isDynamicData=!0,!t.isNullOrUndefined(i))for(var r=0,n=Object.keys(i);r<n.length;r++){var a=n[r];switch(a){case"projectStartDate":this.setProperties({projectStartDate:i[a]},!0);break;case"projectEndDate":this.setProperties({projectEndDate:i[a]},!0)}}this.dataSource=e},n.prototype.collapseAll=function(){this.ganttChartModule.expandCollapseAll("collapse")},n.prototype.getGridColumns=function(){return this.treeGrid.getColumns()},n.prototype.getColumnByField=function(e,t){var i=t.filter(function(t){return t.field===e});return i.length>0?i[0]:null},n.prototype.getGanttColumns=function(){return this.ganttColumns},n.prototype.showColumn=function(e,t){this.treeGrid.showColumns(e,t)},n.prototype.hideColumn=function(e,t){this.treeGrid.hideColumns(e,t)},n.prototype.setScrollTop=function(e){this.ganttChartModule.scrollObject.setScrollTop(e)},n.prototype.cancelEdit=function(){this.isCancelled=!0,this.closeGanttActions()},n.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},n.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},n.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},n.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},n.prototype.deleteRecord=function(e){this.editModule&&this.editModule.deleteRecord(e)},n.prototype.enableItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},n.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},n.prototype.updateDataArgs=function(e){if(!Array.isArray(e.data)){var i=[];i.push(e.data),t.setValue("data",i,e)}return e},n.prototype.convertToMilestone=function(e){var i=this.getRecordByID(e);if(!t.isNullOrUndefined(i)){var r=t.extend({},{},i.taskData,!0),n=this.taskFields;if(r[n.startDate]&&this.setRecordValue(n.startDate,i.ganttProperties.startDate,r,!0),t.isNullOrUndefined(n.duration)?(r[n.startDate]=new Date(i.ganttProperties.startDate),r[n.endDate]=new Date(i.ganttProperties.endDate)):r[n.duration]=0,t.isNullOrUndefined(n.milestone)||!1===r[n.milestone]&&(r[n.milestone]=!0),t.isNullOrUndefined(n.progress)||(r[n.progress]=0),!t.isNullOrUndefined(n.child)&&r[n.child]&&(r[n.child]=[]),!t.isNullOrUndefined(n.parentID)&&r[n.parentID]&&(r[n.parentID]=null),t.isNullOrUndefined(n.segments)||(r[n.segments]=null),!t.isNullOrUndefined(this.contextMenuModule)&&this.contextMenuModule.isOpen&&"Milestone"===this.contextMenuModule.item){t.isNullOrUndefined(n.dependency)||(r[n.dependency]=null);this.addRecord(r,"Below")}else i.hasChildRecords||i.ganttProperties.isMilestone||this.updateRecordByID(r)}},n.prototype.changeTaskMode=function(e){var i=this.taskFields,r=this.getRecordByID(e[i.id]),n=r.ganttProperties;this.isOnEdit=!0,this.setRecordValue("isAutoSchedule",!n.isAutoSchedule,n,!0),t.isNullOrUndefined(this.taskFields.manual)||(this.setRecordValue("taskData."+i.manual,!n.isAutoSchedule,r),this.setRecordValue(i.manual,!n.isAutoSchedule,r)),this.editModule.updateTaskScheduleModes(r);var a={data:r};this.editModule.initiateUpdateAction(a)},n.prototype.getTaskIds=function(){return this.taskIds},n.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)}},n.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},n.prototype.resetTemplates=function(){this.isReact&&this.clearTemplate()},ri([t.Property(!0)],n.prototype,"allowKeyboard",void 0),ri([t.Property(!1)],n.prototype,"enableImmutableMode",void 0),ri([t.Property(!0)],n.prototype,"disableHtmlEncode",void 0),ri([t.Property(!0)],n.prototype,"autoFocusTasks",void 0),ri([t.Property(!0)],n.prototype,"allowSelection",void 0),ri([t.Property(!1)],n.prototype,"allowSorting",void 0),ri([t.Property(!0)],n.prototype,"enablePredecessorValidation",void 0),ri([t.Property(!1)],n.prototype,"showColumnMenu",void 0),ri([t.Property()],n.prototype,"columnMenuItems",void 0),ri([t.Property()],n.prototype,"timezone",void 0),ri([t.Property(!1)],n.prototype,"collapseAllParentTasks",void 0),ri([t.Property(!1)],n.prototype,"highlightWeekends",void 0),ri([t.Property(0)],n.prototype,"treeColumnIndex",void 0),ri([t.Property([])],n.prototype,"dataSource",void 0),ri([t.Property("day")],n.prototype,"durationUnit",void 0),ri([t.Property(null)],n.prototype,"query",void 0),ri([t.Property(null)],n.prototype,"dateFormat",void 0),ri([t.Property("auto")],n.prototype,"height",void 0),ri([t.Property(!1)],n.prototype,"renderBaseline",void 0),ri([t.Property("Horizontal")],n.prototype,"gridLines",void 0),ri([t.Complex({},Pt)],n.prototype,"labelSettings",void 0),ri([t.Property(null)],n.prototype,"taskbarTemplate",void 0),ri([t.Property(null)],n.prototype,"parentTaskbarTemplate",void 0),ri([t.Property(null)],n.prototype,"milestoneTemplate",void 0),ri([t.Property()],n.prototype,"baselineColor",void 0),ri([t.Property("auto")],n.prototype,"width",void 0),ri([t.Property(!1)],n.prototype,"enableVirtualization",void 0),ri([t.Property()],n.prototype,"toolbar",void 0),ri([t.Property(["Monday","Tuesday","Wednesday","Thursday","Friday"])],n.prototype,"workWeek",void 0),ri([t.Property(!1)],n.prototype,"includeWeekend",void 0),ri([t.Property(!1)],n.prototype,"allowUnscheduledTasks",void 0),ri([t.Property(!1)],n.prototype,"showInlineNotes",void 0),ri([t.Property(36)],n.prototype,"rowHeight",void 0),ri([t.Property(null)],n.prototype,"taskbarHeight",void 0),ri([t.Property(null)],n.prototype,"projectStartDate",void 0),ri([t.Property(null)],n.prototype,"projectEndDate",void 0),ri([t.Property(null)],n.prototype,"resourceIDMapping",void 0),ri([t.Property(null)],n.prototype,"resourceNameMapping",void 0),ri([t.Property([])],n.prototype,"resources",void 0),ri([t.Property([])],n.prototype,"segmentData",void 0),ri([t.Property(null)],n.prototype,"connectorLineBackground",void 0),ri([t.Property(1)],n.prototype,"connectorLineWidth",void 0),ri([t.Property([])],n.prototype,"columns",void 0),ri([t.Property([])],n.prototype,"addDialogFields",void 0),ri([t.Property([])],n.prototype,"editDialogFields",void 0),ri([t.Property(-1)],n.prototype,"selectedRowIndex",void 0),ri([t.Property("hour")],n.prototype,"workUnit",void 0),ri([t.Property("FixedUnit")],n.prototype,"taskType",void 0),ri([t.Property("ProjectView")],n.prototype,"viewType",void 0),ri([t.Collection([{from:8,to:12},{from:13,to:17}],tt)],n.prototype,"dayWorkingTime",void 0),ri([t.Collection([],Tt)],n.prototype,"holidays",void 0),ri([t.Collection([],ut)],n.prototype,"eventMarkers",void 0),ri([t.Complex({},Ut)],n.prototype,"taskFields",void 0),ri([t.Complex({},Yt)],n.prototype,"resourceFields",void 0),ri([t.Complex({},Bt)],n.prototype,"timelineSettings",void 0),ri([t.Complex({},zt)],n.prototype,"sortSettings",void 0),ri([t.Complex({},pt)],n.prototype,"editSettings",void 0),ri([t.Complex({},Wt)],n.prototype,"tooltipSettings",void 0),ri([t.Complex({},Rt)],n.prototype,"selectionSettings",void 0),ri([t.Property(!1)],n.prototype,"allowFiltering",void 0),ri([t.Property(!1)],n.prototype,"allowExcelExport",void 0),ri([t.Property(!1)],n.prototype,"allowRowDragAndDrop",void 0),ri([t.Property(!1)],n.prototype,"allowReordering",void 0),ri([t.Property(!1)],n.prototype,"readOnly",void 0),ri([t.Property(!1)],n.prototype,"allowResizing",void 0),ri([t.Property(!1)],n.prototype,"enableContextMenu",void 0),ri([t.Property(!1)],n.prototype,"enableCriticalPath",void 0),ri([t.Property()],n.prototype,"contextMenuItems",void 0),ri([t.Property(!1)],n.prototype,"allowPdfExport",void 0),ri([t.Property(!1)],n.prototype,"validateManualTasksOnLinking",void 0),ri([t.Property(!1)],n.prototype,"enableMultiTaskbar",void 0),ri([t.Property(!1)],n.prototype,"showOverAllocation",void 0),ri([t.Property("Auto")],n.prototype,"taskMode",void 0),ri([t.Complex({},mt)],n.prototype,"filterSettings",void 0),ri([t.Complex({},Dt)],n.prototype,"searchSettings",void 0),ri([t.Complex({},It)],n.prototype,"splitterSettings",void 0),ri([t.Event()],n.prototype,"queryTaskbarInfo",void 0),ri([t.Event()],n.prototype,"beforeExcelExport",void 0),ri([t.Event()],n.prototype,"excelExportComplete",void 0),ri([t.Event()],n.prototype,"excelQueryCellInfo",void 0),ri([t.Event()],n.prototype,"excelHeaderQueryCellInfo",void 0),ri([t.Event()],n.prototype,"rowDrag",void 0),ri([t.Event()],n.prototype,"rowDragStart",void 0),ri([t.Event()],n.prototype,"rowDragStartHelper",void 0),ri([t.Event()],n.prototype,"rowDrop",void 0),ri([t.Event()],n.prototype,"collapsing",void 0),ri([t.Event()],n.prototype,"collapsed",void 0),ri([t.Event()],n.prototype,"expanding",void 0),ri([t.Event()],n.prototype,"expanded",void 0),ri([t.Event()],n.prototype,"actionBegin",void 0),ri([t.Event()],n.prototype,"actionComplete",void 0),ri([t.Event()],n.prototype,"actionFailure",void 0),ri([t.Event()],n.prototype,"dataStateChange",void 0),ri([t.Event()],n.prototype,"taskbarEdited",void 0),ri([t.Event()],n.prototype,"endEdit",void 0),ri([t.Event()],n.prototype,"cellEdit",void 0),ri([t.Event()],n.prototype,"load",void 0),ri([t.Event()],n.prototype,"created",void 0),ri([t.Event()],n.prototype,"destroyed",void 0),ri([t.Event()],n.prototype,"taskbarEditing",void 0),ri([t.Event()],n.prototype,"dataBound",void 0),ri([t.Event()],n.prototype,"resizeStart",void 0),ri([t.Event()],n.prototype,"resizing",void 0),ri([t.Event()],n.prototype,"resizeStop",void 0),ri([t.Event()],n.prototype,"splitterResizeStart",void 0),ri([t.Event()],n.prototype,"splitterResizing",void 0),ri([t.Event()],n.prototype,"splitterResized",void 0),ri([t.Event()],n.prototype,"columnDragStart",void 0),ri([t.Event()],n.prototype,"columnDrag",void 0),ri([t.Event()],n.prototype,"columnDrop",void 0),ri([t.Event()],n.prototype,"beforeTooltipRender",void 0),ri([t.Event()],n.prototype,"rowSelecting",void 0),ri([t.Event()],n.prototype,"rowSelected",void 0),ri([t.Event()],n.prototype,"rowDeselecting",void 0),ri([t.Event()],n.prototype,"rowDeselected",void 0),ri([t.Event()],n.prototype,"cellSelecting",void 0),ri([t.Event()],n.prototype,"cellSelected",void 0),ri([t.Event()],n.prototype,"cellDeselecting",void 0),ri([t.Event()],n.prototype,"cellDeselected",void 0),ri([t.Event()],n.prototype,"queryCellInfo",void 0),ri([t.Event()],n.prototype,"headerCellInfo",void 0),ri([t.Event()],n.prototype,"rowDataBound",void 0),ri([t.Event()],n.prototype,"columnMenuOpen",void 0),ri([t.Event()],n.prototype,"toolbarClick",void 0),ri([t.Event()],n.prototype,"columnMenuClick",void 0),ri([t.Event()],n.prototype,"contextMenuOpen",void 0),ri([t.Event()],n.prototype,"contextMenuClick",void 0),ri([t.Event()],n.prototype,"onTaskbarClick",void 0),ri([t.Event()],n.prototype,"recordDoubleClick",void 0),ri([t.Event()],n.prototype,"onMouseMove",void 0),ri([t.Event()],n.prototype,"beforePdfExport",void 0),ri([t.Event()],n.prototype,"pdfExportComplete",void 0),ri([t.Event()],n.prototype,"pdfQueryCellInfo",void 0),ri([t.Event()],n.prototype,"pdfQueryTaskbarInfo",void 0),ri([t.Event()],n.prototype,"pdfQueryTimelineCellInfo",void 0),ri([t.Event()],n.prototype,"pdfColumnHeaderQueryCellInfo",void 0),n=ri([t.NotifyPropertyChanges],n)}(t.Component);!function(e){e[e.NextPage=0]="NextPage",e[e.LastPage=1]="LastPage"}(e.PdfHorizontalOverflowType||(e.PdfHorizontalOverflowType={}));var ai=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&&a.TreeGrid.Inject(a.Edit)},e.prototype.ensureEditCell=function(e){var i=this,r=e.rowData,a=e.columnName;this.editedColumn=this.parent.getColumnByField(a,this.parent.ganttColumns);var s=this.parent.taskFields;if(this.parent.readOnly)e.cancel=!0;else if("Dialog"!==this.parent.editSettings.mode){if(!r.hasChildRecords||(a!==s.endDate||(t.isNullOrUndefined(r.isManual)||!1!==r.isManual)&&"Auto"!==this.parent.taskMode)&&a!==s.duration&&a!==s.dependency&&a!==s.progress&&a!==s.work&&"taskType"!==a){var o=new n.Deferred;return this.parent.trigger("cellEdit",e,function(e){0===r.level&&"ResourceView"===i.parent.viewType&&(e.cancel=!0),o.resolve(e),e.cancel||(e.columnName===i.parent.taskFields.notes?i.openNotesEditor(e):(i.isCellEdit=!0,t.isNullOrUndefined(i.parent.toolbarModule)||i.parent.toolbarModule.refreshToolbarItems()))}),o}e.cancel=!0}else 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}).indexOf("Notes");if(-1!==n){this.parent.editModule.dialogModule.openEditDialog(i.ganttProperties.rowUniqueID);document.getElementById(this.parent.element.id+"_Tab").ej2_instances[0].selectedItem=n}}r===t.notes&&!0===this.parent.showInlineNotes&&(this.isCellEdit=!0)},e.prototype.isValueChange=function(e,i){var r=t.getValue("data",e),n=r[i],a=t.getValue("previousData",e);if(t.isNullOrUndefined(n)&&!t.isNullOrUndefined(a)||!t.isNullOrUndefined(n)&&t.isNullOrUndefined(a))return!0;if(!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(a)){if(n instanceof Date)return n.getTime()!==r.taskData[i].getTime();if(i===this.parent.taskFields.resourceInfo)return n!==a;if(n!==r.taskData[i])return!0}return!1},e.prototype.initiateCellEdit=function(e,i){var r=t.getValue("column",e),n=t.getValue("data",e),a={};a.action="CellEditing",a.data=this.parent.getTaskByUniqueID(n.uniqueID);var s=t.getValue("previousData",e),o=this.parent.allowUnscheduledTasks?n[r.field]:!t.isNullOrUndefined(n[r.field])&&""!==n[r.field]||this.parent.taskFields.duration!==r.field&&this.parent.taskFields.startDate!==r.field&&this.parent.taskFields.endDate!==r.field?n[r.field]:s;t.isNullOrUndefined(n)?this.parent.editModule.endEditAction(e):(n[r.field]=s,a.data[r.field]=s,this.parent.initiateEditAction(!0),this.parent.setRecordValue(r.field,o,a.data),r.field===this.parent.taskFields.name?this.taskNameEdited(a):r.field===this.parent.taskFields.startDate?this.startDateEdited(a):r.field===this.parent.taskFields.endDate?this.endDateEdited(a):r.field===this.parent.taskFields.duration?this.durationEdited(a):r.field===this.parent.taskFields.resourceInfo?this.resourceEdited(a,i,n):r.field===this.parent.taskFields.progress?this.progressEdited(a):r.field===this.parent.taskFields.baselineStartDate||r.field===this.parent.taskFields.baselineEndDate?this.baselineEdited(a):r.field===this.parent.taskFields.dependency?this.dependencyEdited(a,s):r.field===this.parent.taskFields.notes?this.notedEdited(a):r.field===this.parent.taskFields.work?this.workEdited(a):"taskType"!==r.field||t.isNullOrUndefined(this.parent.taskFields.work)?r.field===this.parent.taskFields.manual?this.taskmodeEdited(a):(this.parent.setRecordValue("taskData."+r.field,a.data[r.field],a.data),this.parent.editModule.initiateSaveAction(a)):this.typeEdited(a,i)),this.isCellEdit=!1,t.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 i=e.data,r=e.data.ganttProperties,n=e.data[this.parent.taskFields.startDate];n=n?new Date(n.getTime()):null,n=this.parent.dateValidationModule.checkStartDate(n,i.ganttProperties,i.ganttProperties.isMilestone),t.isNullOrUndefined(n)?i.hasChildRecords||(this.parent.setRecordValue("startDate",null,r,!0),this.parent.setRecordValue("duration",null,r,!0),this.parent.setRecordValue("isMilestone",!1,r,!0),this.parent.allowUnscheduledTasks&&t.isNullOrUndefined(this.parent.taskFields.endDate)&&this.parent.setRecordValue("endDate",null,r,!0)):r.endDate||!t.isNullOrUndefined(r.duration)?(this.parent.setRecordValue("startDate",new Date(n.getTime()),r,!0),this.parent.dateValidationModule.calculateEndDate(i)):t.isNullOrUndefined(r.endDate)&&t.isNullOrUndefined(r.duration)&&this.parent.setRecordValue("startDate",new Date(n.getTime()),r,!0),this.parent.setRecordValue("isMilestone",0===r.duration,r,!0),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(i,"startDate"),this.parent.dataOperation.updateMappingData(i,"endDate"),this.parent.dataOperation.updateMappingData(i,"duration"),this.updateEditedRecord(e)},e.prototype.validateEndDateWithSegments=function(e){for(var i=[],r=e.segments,n=0;n<r.length;n++){var a=r[n],s=a.endDate;s=!t.isNullOrUndefined(e.endDate)&&s.getTime()<e.endDate.getTime()&&n!==r.length-1?s:e.endDate,a.duration=this.parent.dataOperation.getDuration(a.startDate,s,e.durationUnit,e.isAutoSchedule,e.isMilestone),r.length>0&&s.getTime()<a.startDate.getTime()&&s.getTime()<=e.endDate.getTime()?r[n-1].duration=this.parent.dataOperation.getDuration(r[n-1].startDate,e.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone):i.push(a)}return i},e.prototype.endDateEdited=function(e){var i=e.data.ganttProperties,r=e.data[this.parent.taskFields.endDate];r=r?new Date(r.getTime()):null,t.isNullOrUndefined(r)?(this.parent.setRecordValue("endDate",r,i,!0),this.parent.setRecordValue("duration",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0)):(0===r.getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,r),r=this.parent.dateValidationModule.checkEndDate(r,i),this.parent.setRecordValue("endDate",r,i,!0),!t.isNullOrUndefined(i.startDate)&&t.isNullOrUndefined(i.duration)?-1===this.parent.dateValidationModule.compareDates(i.endDate,i.startDate)&&(this.parent.setRecordValue("endDate",new Date(i.startDate.getTime()),i,!0),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,i.endDate)):!t.isNullOrUndefined(i.duration)&&t.isNullOrUndefined(i.startDate)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(i.endDate,i.duration,i.durationUnit,i),i,!0),t.isNullOrUndefined(i.segments)||(i.segments=this.validateEndDateWithSegments(i)),-1===this.compareDatesFromRecord(i)?this.parent.dateValidationModule.calculateDuration(e.data):this.parent.editModule.revertCellEdit(e),this.parent.setRecordValue("isMilestone",0===i.duration,i,!0),i.isMilestone&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(i.startDate,i),i,!0)),!t.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){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 i=e.data.ganttProperties,r=this.parent.dateValidationModule.getDateFromFormat(i.endDate),n=this.parent.dateValidationModule.getDateFromFormat(i.startDate),a=i.duration;t.isNullOrUndefined(a)?(this.parent.setRecordValue("isMilestone",!1,i,!0),null!=e.data[this.parent.taskFields.duration]&&this.parent.setRecordValue("endDate",null,i,!0)):(t.isNullOrUndefined(n)&&!t.isNullOrUndefined(r)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(r,a,i.durationUnit,i),i,!0),0!==a&&i.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,i,!0),this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(i.startDate,i),i,!0)),!t.isNullOrUndefined(i.segments)&&i.segments.length>0&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),i,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),this.parent.setRecordValue("isMilestone",0===i.duration,i,!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 i=e.data;if(this.parent.setRecordValue("progress",i[this.parent.taskFields.progress]>100?100:i[this.parent.taskFields.progress],i.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.progress,i[this.parent.taskFields.progress]>100?100:i[this.parent.taskFields.progress],e.data),i.ganttProperties.isAutoSchedule||this.parent.setRecordValue("autoWidth",this.parent.dataOperation.calculateWidth(i,!1),i.ganttProperties,!0),!t.isNullOrUndefined(e.data.ganttProperties.segments)&&e.data.ganttProperties.segments.length>0&&!t.isNullOrUndefined(this.parent.editModule.taskbarEditModule)&&this.parent.editModule.taskbarEditModule.updateSegmentProgress(e.data.ganttProperties),!e.data.hasChildRecords){var r=i.ganttProperties.isAutoSchedule?i.ganttProperties.width:i.ganttProperties.autoWidth;this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(r,i.ganttProperties.progress),i.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,i,r){var n=this.parent.resourceFields,a=i[this.parent.taskFields.resourceInfo];if(a){this.isResourceCellEdited=!0;for(var s=this.parent.dataOperation.setResourceInfo(i).length,o=r.ganttProperties.resourceInfo,l=void 0,d=[],p=this.parent.resources,h=void 0,c=function(e){if(o){var i=o.length;for(h=0;h<i;h++){if(o[h][n.id]===a[e]){l=h;break}l=-1}}if(t.isNullOrUndefined(l)||-1===l){var r=p.filter(function(t){return a[e]===t[n.id]}),s=t.extend({},r[0]);s[n.unit]=100,d.push(s)}else d.push(o[l])},u=0;u<s;u++)c(u);e.data.ganttProperties.resourceInfo=d,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=o),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}(),si=function(){function e(e,t){this.parent=e,this.taskbarEdit=t}return e.prototype.createTooltip=function(e,t,r){var n=this;this.toolTipObj=new i.Tooltip({opensOn:e,position:"TopRight",mouseTrail:t,cssClass:"e-gantt-tooltip",target:r||null,animation:{open:{effect:"None"},close:{effect:"None"}}}),this.toolTipObj.beforeRender=function(e){var t={data:n.taskbarEdit.taskBarEditRecord,args:e,content:n.toolTipObj.content};n.parent.trigger("beforeTooltipRender",t)},this.toolTipObj.afterOpen=function(e){n.updateTooltipPosition(e)},this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.chartPane)},e.prototype.updateTooltipPosition=function(e){var t=this.parent.getOffsetRect(this.parent.chartPane).left+this.parent.chartPane.offsetWidth,i=e.element.offsetLeft;t<i+e.element.offsetWidth&&(i+=t-(i+e.element.offsetWidth)),e.element.style.left=i+"px",e.element.style.visibility="visible"},e.prototype.showHideTaskbarEditTooltip=function(e,i){e&&this.parent.tooltipSettings.showTooltip?(this.createTooltip("Custom",!1),this.parent.tooltipModule.toolTipObj.close(),this.updateTooltip(i),"ConnectorPointLeftDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+Ue)):"ConnectorPointRightDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+Ve)):this.toolTipObj.open(this.taskbarEdit.taskBarEditElement)):t.isNullOrUndefined(this.toolTipObj)||(this.toolTipObj.destroy(),this.toolTipObj=null)},e.prototype.updateTooltip=function(e){var i=this.taskbarEdit.taskBarEditRecord.ganttProperties,r=-1===e?i.width:i.segments[e].width,n=-1===e?i.progressWidth:i.segments[e].progressWidth,a=-1===e?i.left:i.left+i.segments[e].left;t.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.toolTipObj.offsetX=-r:"RightResizing"===this.taskbarEdit.taskBarEditAction||"ParentResizing"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=0:"ProgressResizing"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-(r-n):"MilestoneDrag"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-this.parent.chartRowsModule.milestoneHeight/2:r>5&&(this.toolTipObj.offsetX=-(r+a-this.taskbarEdit.tooltipPositionX))))},e.prototype.getTooltipText=function(e){var i="",r=this.parent.globalize,n=this.taskbarEdit.taskBarEditRecord.ganttProperties;if(!t.isNullOrUndefined(n.segments)&&n.segments.length>0&&-1!==e&&"ProgressResizing"!==this.taskbarEdit.taskBarEditAction&&(n=n.segments[e]),this.parent.tooltipSettings.editing){var a=this.parent.tooltipModule.templateCompiler(this.parent.tooltipSettings.editing,this.parent,this.taskbarEdit.taskBarEditRecord,"TooltipEditingTemplate");t.getValue("tooltipEle",this.toolTipObj)&&this.parent.renderTemplates(),i=a[0]}else{var s=void 0,o=void 0,l=void 0;switch(t.isNullOrUndefined(n.startDate)||(s='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.formatDate(n.startDate,{format:this.parent.getDateFormat()})+"</td></tr>"),t.isNullOrUndefined(n.endDate)||(o='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.formatDate(n.endDate,{format:this.parent.getDateFormat()})+"</td></tr>"),t.isNullOrUndefined(n.duration)||(l='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getDurationString(n.duration,n.durationUnit)+"</td></tr>"),this.taskbarEdit.taskBarEditAction){case"ProgressResizing":i='<table class = "e-gantt-tooltiptable"><tbody>'+('<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+n.progress+"</td></tr>")+"</tbody></table>";break;case"LeftResizing":i='<table class = "e-gantt-tooltiptable"><tbody>'+s+l+"</tbody></table>";break;case"RightResizing":case"ParentResizing":i='<table class = "e-gantt-tooltiptable"><tbody>'+o+l+"</tbody></table>";break;case"ChildDrag":case"ParentDrag":case"MilestoneDrag":case"ManualParentDrag":var d="",p="";t.isNullOrUndefined(this.taskbarEdit.taskBarEditRecord.ganttProperties.startDate)||(d=s),t.isNullOrUndefined(this.taskbarEdit.taskBarEditRecord.ganttProperties.endDate)||(p=o),i='<table class = "e-gantt-tooltiptable"><tbody>'+d+p+"</tbody></table>";break;case"ConnectorPointLeftDrag":case"ConnectorPointRightDrag":i=this.parent.connectorLineModule.tooltipTable,t.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 i},e}(),oi=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)}}(),li=function(){return(li=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}).apply(this,arguments)},di=function(e){function i(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.parent=t,i.initPublicProp(),i.wireEvents(),i.editTooltip=new si(i.parent,i),i}return oi(i,e),i.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)},i.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},i.prototype.mouseDownHandler=function(e){if(this.parent.editSettings.allowTaskbarEditing&&!this.parent.readOnly)if(this.canDrag=!1,this.parent.isAdaptive&&this.taskBarEditElement){var t=this.getElementByPosition(e),i=g(t,F);!i||i.innerHTML!==this.taskBarEditElement.innerHTML||t.classList.contains(Ue)||t.classList.contains(Ve)||this.tapPointOnFocus||(this.updateTaskBarEditElement(e),this.canDrag=!0,e.preventDefault())}else this.parent.isAdaptive||this.updateTaskBarEditElement(e)},i.prototype.mouseClickHandler=function(e){var t=this.getElementByPosition(e),i=g(t,F);this.parent.selectionModule&&this.parent.selectionModule.enableSelectMultiTouch?this.tapPointOnFocus&&this.updateTaskBarEditElement(e):this.tapPointOnFocus&&i&&i.innerHTML!==this.taskBarEditElement.innerHTML?(this.connectorSecondRecord=this.parent.ganttChartModule.getRecordByTaskBar(i),this.connectorSecondAction="ConnectorPointLeftDrag",this.connectorSecondElement=i,this.fromPredecessorText="Finish",this.validateConnectorPoint()&&this.taskBarEditingAction(e,!0),this.showHideActivePredecessors(!1),this.initPublicProp()):t.classList.contains(Le)||t.classList.contains(Ne)?(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(i,this.taskBarEditElement)),this.updateTaskBarEditElement(e))},i.prototype.showHideActivePredecessors=function(e){var i=this.taskBarEditRecord.ganttProperties,r=i.predecessor,n="ResourceView"===this.parent.viewType?i.taskId:i.rowUniqueID;if(r)for(var a=0;a<r.length;a++){var s=r[a];n.toString()!==s.from&&n.toString()!==s.to||this.applyActiveColor(s.from,s.to,e)}var o=this.parent.ganttChartModule.chartBodyContainer;e?(t.addClass([this.taskBarEditElement],[je]),t.addClass([o],[qe])):(t.removeClass([this.taskBarEditElement],[je]),t.removeClass([o],[qe])),this.touchEdit=e,t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},i.prototype.applyActiveColor=function(e,i,r){var n=("ProjectView"===this.parent.viewType?this.taskBarEditRecord.ganttProperties.taskId.toString():this.taskBarEditRecord.ganttProperties.rowUniqueID.toString())===e?this.parent.connectorLineModule.getRecordByID(i):this.parent.connectorLineModule.getRecordByID(e),a=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(n)];if(!t.isNullOrUndefined(a)){var s=a.querySelector("."+F),o=this.parent.element.querySelector("#ConnectorLineparent"+e+"child"+i);r?(t.addClass([s],[Ge]),o&&t.addClass([o],[Ge])):(t.removeClass([s],[Ge]),o&&t.removeClass([o],[Ge]))}},i.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},i.prototype.mouseLeaveHandler=function(e){this.dragMouseLeave=!0},i.prototype.updateTaskBarEditElement=function(e){var i,r=this.getElementByPosition(e);if(r.classList.contains(le)||r.classList.contains(ie)||r.classList.contains(re))i=g(r,ie);else if(r.classList.contains(ae)||r.classList.contains(se)||r.classList.contains(ne))i=g(r,ne);else if(i=g(r,F),!t.isNullOrUndefined(i)&&!r.classList.contains("e-connectorpoint-left")&&!r.classList.contains("e-connectorpoint-right")){var n=this.parent.ganttChartModule.getRecordByTaskBar(i);!t.isNullOrUndefined(n.ganttProperties.segments)&&n.ganttProperties.segments.length>0&&(i=g(r,V))}if(this.parent.editSettings.allowTaskbarEditing&&i){this.showHideTaskBarEditingElements(i,this.taskBarEditElement),this.editElement=i,this.taskBarEditElement=i;var a=this.taskBarEditElement.getAttribute("data-segment-index");if(t.isNullOrUndefined(a)?this.segmentIndex=-1:this.segmentIndex=Number(a),this.taskBarEditRecord=this.parent.ganttChartModule.getRecordByTaskBar(this.taskBarEditElement),("mousedown"===e.type||"touchstart"===e.type||"click"===e.type)&&(this.roundOffDuration=!0,this.taskBarEditAction=this.getTaskBarAction(e),"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||!t.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 s=this.parent.getTaskByUniqueID(this.taskBarEditRecord.parentItem.uniqueID);t.isNullOrUndefined(s)||s.expanded||(this.prevZIndex=this.taskBarEditElement.style.zIndex,this.taskBarEditElement.style.zIndex="1000",t.addClass([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"))}}}else this.parent.isAdaptive?(this.taskBarEditElement&&this.showHideTaskBarEditingElements(i,this.taskBarEditElement),this.initPublicProp()):this.showHideTaskBarEditingElements(i,this.taskBarEditElement)},i.prototype.showHideTaskBarEditingElements=function(e,i,r){i=i||this.editElement;var n=!!this.parent.taskFields.progress,a=!0;if(!this.parent.readOnly){if("ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar&&e){var s=this.parent.ganttChartModule.getRecordByTaskBar(e),o=this.parent.getParentTask(s.parentItem);t.isNullOrUndefined(o)||o.expanded||(n=!1,a=!1)}if(e){if(e.querySelector("."+Y)){if(t.addClass([e.querySelector("."+Y)],[ce]),t.addClass([e.querySelector("."+Z)],[ue]),n){!t.isNullOrUndefined(e.querySelector("."+Q))&&t.addClass([e.querySelector("."+Q)],[ge])}}else if(this.parent.isAdaptive&&n){(s=this.parent.ganttChartModule.getRecordByTaskBar(e)).hasChildRecords&&t.addClass([e],[We])}if(t.addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+De),[Ce]),!t.isNullOrUndefined(this.parent.taskFields.dependency)&&(e.querySelector("."+Ue)||e.parentElement.querySelector("."+Ue))&&a){var l=t.isNullOrUndefined(e.querySelector("."+Ue))?e.parentElement:e;t.addClass([l.querySelector("."+Ue)],[Le]),t.addClass([l.querySelector("."+Ve)],[Ne])}}else r||t.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+De),[Ce]);if(i&&e!==i){if(i.querySelector("."+Y)&&(t.removeClass([i.querySelector("."+Y)],[ce]),t.removeClass([i.querySelector("."+Z)],[ue]),i.querySelector("."+Q)&&t.removeClass([i.querySelector("."+Q)],[ge])),t.isNullOrUndefined(this.parent.taskFields.dependency)||!i.querySelector("."+Ue)&&!i.parentElement.querySelector("."+Ue)){if(this.parent.isAdaptive){(s=this.parent.ganttChartModule.getRecordByTaskBar(i))&&s.hasChildRecords&&t.removeClass([i],[We])}}else{l=t.isNullOrUndefined(i.querySelector("."+Ue))?i.parentElement:i;t.removeClass([l.querySelector("."+Ue)],[Le]),t.removeClass([l.querySelector("."+Ve)],[Ne])}this.editElement=null}}},i.prototype.getTaskBarAction=function(e){var i=this.getElementByPosition(e),r=this.taskBarEditRecord,n="";return i.classList.contains(Y)?n="LeftResizing":i.classList.contains(Z)?n="RightResizing":(i.classList.contains(Q)||t.closest(i,"."+Q))&&this.parent.taskFields.progress?n="ProgressResizing":i.classList.contains(Ue)?n="ConnectorPointLeftDrag":i.classList.contains(Ve)?n="ConnectorPointRightDrag":i.classList.contains(le)?n="ParentResizing":i.classList.contains(re)||i.classList.contains(ie)||i.classList.contains(ne)||i.classList.contains(ae)||i.classList.contains(se)||i.classList.contains(ne)?n="ManualParentDrag":r&&(n=r.hasChildRecords?"Auto"===this.parent.taskMode?"ParentDrag":"":r.ganttProperties.isMilestone?"MilestoneDrag":"ChildDrag"),n},i.prototype.updateMouseDownProperties=function(e){var t=this.getCoordinate(e);if(t.pageX||t.pageY){var i=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.mouseDownX=t.pageX-i.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseDownX,this.mouseDownY=t.pageY-i.top+this.parent.ganttChartModule.scrollObject.previousScroll.top}"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,"",""))},i.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&&this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),this.taskBarEditElement.setAttribute("aria-grabbed","true")}},i.prototype.mouseMoveAction=function(e){var t=this;if(this.parent.isAdaptive){if(!this.canDrag)return;this.multipleSelectionEnabled()}var i=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),r=this.getCoordinate(e);if(this.mouseMoveX=r.pageX-i.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.mouseMoveY=r.pageY-i.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.dragMouseLeave=!1,this.isMouseDragCheck(),this.isMouseDragged&&this.taskBarEditAction){var n={cancel:!1,requestType:"taskbarediting",taskBarEditAction:this.taskBarEditAction,data:this.taskBarEditRecord};-1!==this.segmentIndex&&(n.requestType="mergeSegment"),this.parent.trigger("actionBegin",n,function(i){!1===i.cancel&&t.taskBarEditingAction(e,!1)})}else this.parent.isAdaptive||this.taskBarEditAction||this.updateTaskBarEditElement(e)},i.prototype.taskBarEditingAction=function(e,i){var r=this,n={},a=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement);if(null!==this.taskBarEditRecord){if(n.editingFields=this.taskBarEditRecord.ganttProperties,n.data=this.taskBarEditRecord,"ResourceView"===this.parent.viewType&&0===n.data.level)return;n.recordIndex=a,n.taskBarEditAction=this.taskBarEditAction,n.roundOffDuration=this.roundOffDuration,n.cancel=!1,n.previousData=this.previousItem,n.segmentIndex=this.segmentIndex,this.roundOffDuration=n.roundOffDuration,this.targetElement=n.target=t.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.parent.isAdaptive||this.drawFalseLine()),this.setItemPosition(),this.updateEditedItem(),this.editTooltip.updateTooltip(this.segmentIndex),i&&this.taskBarEditedAction(e),this.parent.trigger("taskbarEditing",n,function(e){e.cancel&&null!==r.taskBarEditRecord&&(r.tapPointOnFocus=!1,t.merge(r.taskBarEditRecord.ganttProperties,e.previousData))})}},i.prototype.updateMouseMoveProperties=function(e){var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),i=this.getCoordinate(e);(i.pageX||i.pageY)&&(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 r="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)||r){var n=this.mouseMoveX-this.parent.ganttChartModule.scrollObject.previousScroll.left+t.left,a=this.mouseMoveY-this.parent.ganttChartModule.scrollObject.previousScroll.top+t.top;n+20>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):n-20<t.left?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("left")):r&&a+80>t.top+this.parent.ganttChartModule.chartBodyContainer.offsetHeight?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("bottom")):r&&a-20<t.top?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("top")):this.stopScrollTimer()}else this.stopScrollTimer()},i.prototype.startScrollTimer=function(e){var t=this;this.stopScrollTimer(),this.scrollTimer=window.setInterval(function(){t.timerCount="right"===e||"bottom"===e?t.timerCount+1>=t.parent.timelineModule.totalTimelineWidth?t.parent.timelineModule.totalTimelineWidth: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),"ConnectorPointLeftDrag"!==t.taskBarEditAction&&"ConnectorPointRightDrag"!==t.taskBarEditAction||t.drawFalseLine()},0)},i.prototype.stopScrollTimer=function(){window.clearInterval(this.scrollTimer),this.scrollTimer=null},i.prototype.enableDragging=function(e){var i=this.taskBarEditRecord.ganttProperties,r=0;if(this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&!this.taskBarEditElement.classList.contains("e-segment-first")){var n=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return li({},e)}),a=n[this.segmentIndex];this.mouseDownX>this.mouseMoveX?(r=t.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,a.left=a.left-r):(r=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,a.left=a.left+r);var s=n[this.segmentIndex-1],o=n[this.segmentIndex+1],l=void 0;l=this.taskBarEditElement.classList.contains("e-segment-inprogress")?a.left<s.left+s.width?s.left+s.width:a.width+a.left>o.left?o.left-a.width:a.left:a.left<s.left+s.width?s.left+s.width:i.left+a.width+a.left>=this.parent.timelineModule.totalTimelineWidth?this.parent.timelineModule.totalTimelineWidth-a.width:a.left,a.left=l,this.parent.setRecordValue("segments",n,i,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")}else{this.mouseDownX>this.mouseMoveX?(r=this.mouseDownX-this.mouseMoveX)>0&&this.parent.setRecordValue("left",this.previousItem.left-r,i,!0):(r=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+r,i,!0));l=i.left<0?0:i.left+i.width>=this.parent.timelineModule.totalTimelineWidth?this.parent.timelineModule.totalTimelineWidth-i.width:i.left;this.parent.setRecordValue("left",l,i,!0)}},i.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},i.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))},i.prototype.enableSplitTaskLeftResize=function(e){var i=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return li({},e)}),r=i[this.segmentIndex],n=0;if(this.mouseDownX>this.mouseMoveX)if(this.mouseMoveX<e.left+r.width+r.left){if(n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,r.left>0){if(r.left=r.left-n,r.width=r.width+n,0!==this.segmentIndex){var a=i[this.segmentIndex-1];if(e.left+r.left<e.left+a.left+a.width){var s=e.left+a.left+a.width-(e.left+r.left);r.width-=s,r.left=r.left+s}}}else if(r.left<=0&&0===this.segmentIndex){this.parent.setRecordValue("left",e.left-n,e,!0),this.parent.setRecordValue("width",e.width+n,e,!0),r.width=r.width+n;for(var o=1;o<e.segments.length;o++){var l=i[o];l.left=l.left+n}}}else this.mouseMoveX>e.left+r.width+r.left&&(n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,r.left=r.left-n,r.width=this.parent.perDayWidth);else if(this.mouseMoveX<e.left+r.width+r.left-this.parent.perDayWidth)if(n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,0===this.segmentIndex&&r.left<=0){this.parent.setRecordValue("left",e.left+n,e,!0),this.parent.setRecordValue("width",e.width-n,e,!0),r.width=r.width-n;for(o=1;o<e.segments.length;o++){var d=i[o];d.left=d.left-n}}else r.left<r.left+r.width&&r.left+n<=r.left+r.width&&(r.left=r.left+n,r.width=r.width-n);else if(this.mouseMoveX<e.left+r.left+r.width&&r.width>this.parent.perDayWidth){n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX;if(n-=r.width-n<this.parent.perDayWidth?this.parent.perDayWidth>r.width?this.parent.perDayWidth-r.width:r.width-this.parent.perDayWidth:0,0===this.segmentIndex){this.parent.setRecordValue("width",e.width-n,e,!0),this.parent.setRecordValue("left",e.left+n,e,!0);for(o=1;o<e.segments.length;o++){var p=i[o];p.left=p.left-n}}else r.left=r.left+n,r.width=r.width-n}this.parent.setRecordValue("segments",i,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},i.prototype.updateEditPosition=function(e,t){this.updateIsMilestone(t),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.width,t.progress),t,!0)},i.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))},i.prototype.enableRightResizing=function(e){var i=this.taskBarEditRecord.ganttProperties,r=0;if(this.taskBarEditElement.classList.contains("e-segmented-taskbar")){var n=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return li({},e)}),a=n[this.segmentIndex];this.mouseDownX>this.mouseMoveX?this.mouseMoveX>i.left+a.left&&this.mouseDownX-this.mouseMoveX>3?(r=t.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,a.width=a.width-r):this.mouseMoveX<i.left+a.left&&(a.width=this.parent.perDayWidth):this.mouseMoveX>a.left&&(r=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,a.width=a.width+r);var s=void 0,o=this.segmentIndex!==n.length-1?n[this.segmentIndex+1]:null;t.isNullOrUndefined(o)||(this.taskBarEditElement.classList.contains("e-segment-last")||(s=a.left+a.width>o.left?o.left-a.left:a.width),a.width=s),this.segmentIndex===i.segments.length-1&&0===this.segmentIndex&&this.parent.setRecordValue("width",a.width,i,!0),this.parent.setRecordValue("segments",n,i,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")}else this.mouseDownX>this.mouseMoveX?this.mouseMoveX>i.left&&this.mouseDownX-this.mouseMoveX>3?(r=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("width",this.previousItem.width-r,i,!0)):this.mouseMoveX<i.left&&this.parent.setRecordValue("width",3,i,!0):this.mouseMoveX>i.left&&(r=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("width",this.previousItem.width+r,i,!0)),this.updateEditPosition(e,i)},i.prototype.updateEditedItem=function(){var e,i,r,n,a=this.taskBarEditRecord.ganttProperties;switch(this.taskBarEditAction){case"ProgressResizing":this.parent.setRecordValue("progress",this.getProgressPercent(a.width,a.progressWidth),a,!0);break;case"LeftResizing":-1===this.segmentIndex?(e=this.getRoundOffStartLeft(a,this.roundOffDuration),i=this.getDateByLeft(e),t.isNullOrUndefined(a.endDate)&&(r=this.parent.dateValidationModule.getValidEndDate(a),this.parent.setRecordValue("endDate",r,a,!0)),n=this.parent.dateValidationModule.checkStartDate(i,a,null),this.parent.setRecordValue("startDate",new Date(n.getTime()),a,!0),0===this.parent.dateValidationModule.compareDates(a.startDate,a.endDate)&&t.isNullOrUndefined(a.isMilestone)&&!1===a.isMilestone&&0===a.duration&&this.parent.setRecordValue("duration",1,a,!0),a.isMilestone&&this.parent.setRecordValue("endDate",new Date(n.getTime()),a,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")):this.updateSplitLeftResize(a);break;case"RightResizing":case"ParentResizing":if(-1===this.segmentIndex){e=this.getRoundOffEndLeft(a,this.roundOffDuration);var s=this.getDateByLeft(e);t.isNullOrUndefined(a.startDate)&&(n=this.parent.dateValidationModule.getValidStartDate(a),this.parent.setRecordValue("startDate",n,a,!0));var o=t.isNullOrUndefined(a.startDate)?n:a.startDate;r=a.isMilestone?o:this.parent.dateValidationModule.checkEndDate(s,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",new Date(r.getTime()),a,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")}else this.updateSplitRightResizing(a);break;case"ParentDrag":case"ChildDrag":case"MilestoneDrag":case"ManualParentDrag":-1===this.segmentIndex||0===this.segmentIndex?this.updateChildDrag(a):this.setSplitTaskDrag(a)}},i.prototype.updateChildDrag=function(e){var i,r=this.getRoundOffStartLeft(e,this.roundOffDuration),n=this.getDateByLeft(r);0===this.segmentIndex?(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(n,e,null),e,!0),e.segments[0].startDate=n,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)):!t.isNullOrUndefined(e.endDate)&&t.isNullOrUndefined(e.startDate)?(i=this.parent.dateValidationModule.checkStartDate(n,e,null),i=this.parent.dateValidationModule.checkEndDate(i,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",i,e,!0)):(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(n,e,null),e,!0),t.isNullOrUndefined(e.duration)||this.parent.dateValidationModule.calculateEndDate(this.taskBarEditRecord))},i.prototype.updateSplitLeftResize=function(e){var i=e.segments[this.segmentIndex],r=0===this.segmentIndex?this.getRoundOffStartLeft(e,this.roundOffDuration):this.getRoundOffStartLeft(i,this.roundOffDuration),n=0===this.segmentIndex?this.getDateByLeft(r):this.getDateByLeft(e.left+r),a=this.parent.dataOperation.checkStartDate(n,e,!1),s=this.parent.dataOperation.getDuration(a,i.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);if(i.startDate=new Date(a.getTime()),i.duration=s,this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),0===this.segmentIndex&&this.parent.setRecordValue("startDate",i.startDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration"),!t.isNullOrUndefined(e.segments[this.segmentIndex-1])){var o=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);i.offsetDuration=o}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},i.prototype.updateSplitRightResizing=function(e){var i=e.segments[this.segmentIndex],r=this.getRoundOffEndLeft(e,this.roundOffDuration),n=this.getDateByLeft(r),a=this.parent.dataOperation.checkEndDate(n,e,!1),s=this.parent.dataOperation.getDuration(i.startDate,a,e.durationUnit,e.isAutoSchedule,e.isMilestone);if(i.endDate=new Date(a.getTime()),i.duration=s,!t.isNullOrUndefined(e.segments[this.segmentIndex+1])){var o=e.segments[this.segmentIndex+1],l=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,o.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);i.offsetDuration=l}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")},i.prototype.sumOfDuration=function(e){for(var t=0,i=0;i<e.length;i++){t+=e[i].duration}return t},i.prototype.setSplitTaskDrag=function(e){var i=e.segments[this.segmentIndex],r=this.getRoundOffStartLeft(i,this.roundOffDuration),n=this.getDateByLeft(e.left+r);if(n=this.parent.dateValidationModule.checkStartDate(n,e,null),i.startDate=n,i.endDate=this.parent.dataOperation.getEndDate(i.startDate,i.duration,e.durationUnit,e,!1),i.duration=this.parent.dataOperation.getDuration(i.startDate,i.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),t.isNullOrUndefined(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"endDate"),!t.isNullOrUndefined(e.segments[this.segmentIndex-1])){var a=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==i.startDate.getDay()||0!==a||this.parent.includeWeekend||(a=1),i.offsetDuration=a}if(!t.isNullOrUndefined(e.segments[this.segmentIndex+1])){var s=e.segments[this.segmentIndex+1];a=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,s.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==s.startDate.getDay()||0!==a||this.parent.includeWeekend||(a=1),s.offsetDuration=a}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},i.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),0!==(s=this.parent.perDayWidth/24-this.parent.perDayWidth/24/a)&&(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),0!==(s=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/a)&&(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},i.prototype.getRoundOffStartLeft=function(e,i){var r=(t.isNullOrUndefined(e),e.left),n="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,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;return void 0===i&&(i=!1),i?i&&("Hour"===n?(a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Hour")/36e5),r-=s=this.parent.perDayWidth/24-this.parent.perDayWidth/24/a):"Minutes"===n?(a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Minutes")/6e4),r-=s=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/a):r-=s):"Hour"!==n&&"Minutes"!==n&&(o<=.5?r-=s:o>.5&&(r=r-s+this.parent.perDayWidth/2)),r},i.prototype.getDateByLeft=function(e){var t=new Date(this.parent.timelineModule.timelineStartDate.toString()),i=864e5/this.parent.perDayWidth;t.setTime(t.getTime()+e*i);var r="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier;return"Hour"!==r&&"Minutes"!==r&&(this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&!this.parent.isInDst(t)?t.setTime(t.getTime()+36e5):!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&this.parent.isInDst(t)&&t.setTime(t.getTime()-36e5)),t},i.prototype.setItemPosition=function(){var e=this.taskBarEditRecord.ganttProperties,i=t.isNullOrUndefined(e.segments)?null:e.segments[this.segmentIndex],r="MilestoneDrag"===this.taskBarEditAction||e.isMilestone?this.parent.chartRowsModule.milestoneHeight:e.width,n=this.parent.isAdaptive?r-2:r-10;t.isNullOrUndefined(i)||(n=this.parent.isAdaptive?i.width-2:i.width-10);var a=this.taskBarEditElement.classList.contains(F)?this.taskBarEditElement:t.closest(this.taskBarEditElement,"tr."+X).querySelector("."+F),s=this.taskBarEditElement.classList.contains("e-segmented-taskbar"),o=t.closest(this.taskBarEditElement,"tr."+X).querySelector("."+I),l=t.closest(this.taskBarEditElement,"tr."+X).querySelector("."+E),d=this.taskBarEditElement.querySelector("."+te),p=this.taskBarEditElement.querySelector("."+ee),h=this.taskBarEditElement.querySelector("."+Q),c=this.taskBarEditElement.querySelector("."+Z),u=this.taskBarEditElement.querySelector("."+de),g=this.taskBarEditElement.querySelector("."+pe),f=this.taskBarEditElement.querySelector("."+Be),m=this.taskBarEditElement,y=this.taskBarEditElement.querySelector("."+re),v=this.taskBarEditElement.querySelector("."+le),D=this.taskBarEditElement.querySelector(".e-gantt-manualparenttaskbar-left");if("ConnectorPointRightDrag"!==this.taskBarEditAction&&"ConnectorPointLeftDrag"!==this.taskBarEditAction){if("ParentResizing"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction){if(!s||t.isNullOrUndefined(e.segments)||"RightResizing"!==this.taskBarEditAction&&0===this.segmentIndex||(this.taskBarEditElement.style.width=i.width+"px",this.taskBarEditElement.style.left=i.left+"px"),a.style.width=r+"px",a.style.left=e.left+"px",o.style.width=e.left+"px","LeftResizing"===this.taskBarEditAction&&0===this.segmentIndex)for(var w=this.taskBarEditElement.parentElement.getElementsByClassName("e-segmented-taskbar"),k=0;k<e.segments.length;k++){var T=e.segments[k],S=w[k];S.style.width=T.width+"px",S.style.left=T.left+"px"}t.isNullOrUndefined(l)||(l.style.left=e.left+r+"px")}f&&(f.style.left=(this.parent.isAdaptive?r+10:r+2)+"px"),"MilestoneDrag"===this.taskBarEditAction||e.isMilestone?(a.style.left=e.left-r/2+"px",o.style.width=e.left-r/2+"px",t.isNullOrUndefined(l)||(l.style.left=e.left+r/2+"px")):"ProgressResizing"===this.taskBarEditAction?-1===this.segmentIndex?(p.style.left=e.left+e.progressWidth-10+"px",t.isNullOrUndefined(d)||(d.style.width=e.progressWidth+"px",d.style.borderBottomRightRadius=this.progressBorderRadius+"px",d.style.borderTopRightRadius=this.progressBorderRadius+"px",h.style.left=e.progressWidth-8+"px")):(this.updateSegmentProgress(this.taskBarEditRecord.ganttProperties),d.style.width=e.segments[this.segmentIndex].progressWidth+"px",d.style.borderBottomRightRadius=this.progressBorderRadius+"px",d.style.borderTopRightRadius=this.progressBorderRadius+"px",h.style.left=e.segments[this.segmentIndex].progressWidth-8+"px"):"RightResizing"!==this.taskBarEditAction||t.isNullOrUndefined(p)?"ParentDrag"===this.taskBarEditAction?(t.isNullOrUndefined(u)||(u.style.width=r+"px"),t.isNullOrUndefined(d)||(g.style.width=e.progressWidth+"px")):"ParentResizing"===this.taskBarEditAction?(m.style.width=y.style.width=e.width+"px",v.style.left=e.width-D.offsetLeft+"px"):"ManualParentDrag"===this.taskBarEditAction?m.style.left=e.left-e.autoLeft+"px":(t.isNullOrUndefined(p)||s||(p.style.width=r+"px"),t.isNullOrUndefined(d)||(c.style.left=n+"px",d.style.width=e.progressWidth+"px",t.isNullOrUndefined(h)||(h.style.left=e.progressWidth-10+"px")),s&&(c.style.left=n+"px",d.style.width=i.progressWidth+"px",t.isNullOrUndefined(h)||(h.style.left=i.progressWidth-10+"px"))):(p.style.width=r+"px",t.isNullOrUndefined(d)||(d.style.width=e.progressWidth+"px",c.style.left=n+"px",t.isNullOrUndefined(h)||(h.style.left=e.progressWidth-10+"px")))}},i.prototype.mouseUpHandler=function(e){var i=this.isMouseDragged;if(this.previousMouseMove=null,this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),this.taskBarEditAction&&this.isMouseDragged)if(!this.dragMouseLeave&&this.taskBarEditedAction)this.taskBarEditedAction(e),this.isMouseDragged=!1;else if(this.parent.isOnEdit=!1,this.cancelTaskbarEditActionInMouseLeave(),this.parent.enableCriticalPath&&this.parent.criticalPathModule){var r=this.parent.criticalPathModule;r.criticalConnectorLine(r.criticalPathCollection,r.detailPredecessorCollection,!0,r.predecessorCollectionTaskIds)}"ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar&&!t.isNullOrUndefined(this.taskBarEditElement)&&(t.isNullOrUndefined(this.taskBarEditElement.querySelector(".e-gantt-child-taskbar"))||this.taskBarEditElement.querySelector(".e-gantt-child-taskbar").classList.contains("e-collapsed-taskbar-drag")&&(t.removeClass([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"),this.taskBarEditElement.style.zIndex=this.prevZIndex,this.prevZIndex="")),this.parent.isAdaptive&&!i||this.initPublicProp(),this.stopScrollTimer()},i.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).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?(i!==s||Math.abs(r-o)>=(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.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord,this.finalPredecessor)},i.prototype.cancelTaskbarEditActionInMouseLeave=function(){this.parent.editModule.reUpdatePreviousRecords(!0)},i.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)}},i.prototype.taskbarEdited=function(e){var i=t.extend({},e),r=i.data,n=r.ganttProperties;if("ProgressResizing"===i.taskBarEditAction)i.previousData.progress!==n.progress&&(this.parent.setRecordValue("progress",this.getProgressPercent(n.width,n.progressWidth),n,!0),r.parentItem&&this.parent.editModule.updateParentProgress(r.parentItem),t.isNullOrUndefined(n.segments)||this.updateSegmentProgress(n));else{var a=i.data.ganttProperties.segments;if(!t.isNullOrUndefined(a)&&a.length>0&&("LeftResizing"===this.taskBarEditAction&&0!==this.segmentIndex||"ChildDrag"===this.taskBarEditAction&&0!==this.segmentIndex||"RightResizing"===this.taskBarEditAction)){var s=a[this.segmentIndex],o=this.taskBarEditRecord.ganttProperties,l=0===this.segmentIndex?null:a[this.segmentIndex-1],d=this.segmentIndex===a.length-1?null:a[this.segmentIndex+1],p=t.isNullOrUndefined(d)?this.parent.cloneProjectEndDate:new Date(d.startDate.getTime()),h=t.isNullOrUndefined(l)?this.parent.cloneProjectStartDate:new Date(l.endDate.getTime());p.setHours(0,0,0,0),h.setHours(0,0,0,0);var c=new Date(s.startDate.getTime()),u=new Date(s.endDate.getTime());if(c.setDate(c.getDate()-1),u.setDate(u.getDate()+1),c.setHours(0,0,0,0),u.setHours(0,0,0,0),c.getTime()<=h.getTime()&&!t.isNullOrUndefined(l)&&!t.isNullOrUndefined(s)){var g=[{firstSegmentIndex:l.segmentIndex,secondSegmentIndex:s.segmentIndex}];this.parent.chartRowsModule.mergeTask(o.taskId,g)}else if(u.getTime()>=p.getTime()&&this.segmentIndex!==a.length-1){g=[{firstSegmentIndex:s.segmentIndex,secondSegmentIndex:d.segmentIndex}];this.parent.chartRowsModule.mergeTask(o.taskId,g)}else if(u.getTime()>=p.getTime()){s.endDate.setDate(this.parent.cloneProjectEndDate.getDate()-1),s.startDate=this.parent.dataOperation.getStartDate(s.endDate,s.duration,o.durationUnit,o);for(var f=a.length-2;f>=0;f++){var m=a[f],y=m.endDate;y.setDate(y.getDate()-m.offsetDuration),m.endDate=y,m.startDate=this.parent.dataOperation.getStartDate(m.endDate,m.duration,o.durationUnit,o)}}}this.parent.dataOperation.updateWidthLeft(i.data)}this.parent.dataOperation.updateTaskData(r),this.parent.editModule.initiateUpdateAction(i)},i.prototype.getProgressPercent=function(e,t){return Math.ceil(t/e*100)},i.prototype.drawFalseLine=function(){var e,i=this.mouseDownX,r=this.mouseDownY,n=this.mouseMoveX,a=this.mouseMoveY,s=Math.sqrt((i-n)*(i-n)+(r-a)*(r-a)),o="rotate("+180*Math.atan2(a-r,n-i)/Math.PI+"deg)";"ConnectorPointLeftDrag"===this.taskBarEditAction&&(e=this.elementOffsetLeft-this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),"ConnectorPointRightDrag"===this.taskBarEditAction&&(e=this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left);var l=this.elementOffsetTop+this.elementOffsetHeight/2+this.parent.ganttChartModule.chartBodyContainer.offsetTop-this.parent.ganttChartModule.scrollObject.previousScroll.top;this.removeFalseLine(!1),this.falseLine=t.createElement("div",{className:"e-gantt-false-line",id:"ganttfalseline"+this.parent.element.id,styles:"transform-origin: 0% 100%;right: auto;position: absolute;transform:"+o+";border-top-width: 1px;border-top-style: dashed;z-index: 5;width:"+(s-3)+"px;left:"+e+"px;top:"+l+"px;"}),this.parent.ganttChartModule.chartBodyContainer.appendChild(this.falseLine)},i.prototype.removeFalseLine=function(e){this.falseLine&&(t.remove(this.falseLine),this.falseLine=null,e&&(this.elementOffsetLeft=0,this.elementOffsetTop=0,this.elementOffsetWidth=0,this.elementOffsetHeight=0,t.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+De),[Ce])))},i.prototype.updateConnectorLineSecondProperties=function(e){var i=this.getElementByPosition(e),r=g(i,F);this.connectorSecondAction=null;var n=0;if(g(i,Ue)?(this.connectorSecondAction="ConnectorPointLeftDrag",this.toPredecessorText="Start"):g(i,Ve)?(this.connectorSecondAction="ConnectorPointRightDrag",this.toPredecessorText="Finish"):(this.connectorSecondAction=null,this.toPredecessorText=null),this.taskBarEditElement!==r&&this.taskBarEditElement!==this.highlightedSecondElement){if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){n=this.parent.virtualScrollModule.getTopPosition()}(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&!this.elementOffsetLeft||!this.parent.enableVirtualization)&&(this.elementOffsetLeft=this.taskBarEditElement.offsetLeft,this.elementOffsetTop=this.taskBarEditElement.offsetTop+n,this.elementOffsetWidth=this.taskBarEditElement.offsetWidth,this.elementOffsetHeight=this.taskBarEditElement.offsetHeight),this.showHideTaskBarEditingElements(r,this.highlightedSecondElement,!0)}t.isNullOrUndefined(this.connectorSecondAction)&&!t.isNullOrUndefined(this.connectorSecondElement)&&(this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),t.removeClass([this.connectorSecondElement.querySelector("."+Ue)],[Ae]),t.removeClass([this.connectorSecondElement.querySelector("."+Ve)],[Ae])),this.connectorSecondElement=this.connectorSecondAction?r:null,this.highlightedSecondElement=r,this.connectorSecondRecord=t.isNullOrUndefined(this.connectorSecondElement)?null:this.parent.ganttChartModule.getRecordByTaskBar(this.connectorSecondElement)},i.prototype.triggerDependencyEvent=function(e,i){var r,n,a=this.taskBarEditRecord.ganttProperties,s=this.connectorSecondRecord?this.connectorSecondRecord.ganttProperties:null,o=this.getElementByPosition(e),l=o,d="ResourceView"===this.parent.viewType?a.taskId:a.rowUniqueID;if("ConnectorPointLeftDrag"===this.taskBarEditAction?r=d+"S":"ConnectorPointRightDrag"===this.taskBarEditAction&&(r=d+"F"),this.connectorSecondAction&&("ConnectorPointLeftDrag"===this.connectorSecondAction?(r+="S",n="start"):"ConnectorPointRightDrag"===this.connectorSecondAction&&(r+="F",n="finish")),t.isNullOrUndefined(s))this.drawPredecessor=!1;else{s.predecessorsName?this.finalPredecessor=s.predecessorsName+","+r:this.finalPredecessor=r;var p=this.parent.connectorLineEditModule.validatePredecessorRelation(this.connectorSecondRecord,this.finalPredecessor),h=this.parent.predecessorModule.calculatePredecessor(r,this.connectorSecondRecord),c={};if(c.fromItem=a,c.toItem=s,c.newPredecessorString=this.finalPredecessor,c.predecessor=h&&h[0],c.isValidLink=p,c.requestType="ValidateDependency",this.parent.trigger("actionBegin",c),c.isValidLink=!(!p&&c.isValidLink)&&c.isValidLink,c.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 u=this.parent.connectorLineModule.tooltipTable.querySelector("#toPredecessor").querySelectorAll("td");u[1].innerText=s.taskName,u[2].innerText=this.parent.localeObj.getConstant(n);var g=this.parent.connectorLineModule.tooltipTable.parentElement.parentElement;g.offsetTop+g.offsetHeight>e.pageY&&(g.style.top=e.pageY-g.offsetHeight-20+"px")}this.drawPredecessor=!0}else this.parent.isAdaptive?(o.classList.contains(Ue)||o.classList.contains(Ve))&&this.showHideActivePredecessors(!0):t.addClass([l],[Ae]),this.drawPredecessor=!1}},i.prototype.getCoordinate=function(e){var t={};if(this.parent.isAdaptive&&e&&"click"!==e.type){"touchmove"!==(i=e).type&&"touchstart"!==i.type&&"touchend"!==i.type||(t.pageX=i.changedTouches[0].pageX,t.pageY=i.changedTouches[0].pageY)}else if(e){var i=e;t.pageX=i.pageX,t.pageY=i.pageY}return t},i.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},i.prototype.multipleSelectionEnabled=function(){this.parent.selectionModule&&"Cell"!==this.parent.selectionSettings.mode&&"Multiple"===this.parent.selectionSettings.type&&this.parent.selectionModule.hidePopUp()},i.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))},i.prototype.destroy=function(){this.unWireEvents(),this.stopScrollTimer(),this.parent.editModule.taskbarEditModule=void 0},i}(M),pi=function(){function e(e){this.updatedEditFields=null,this.updatedAddFields=null,this.addedRecord=null,this.dialogEditValidationFlag=!1,this.ganttResources=[],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:p.CheckBox,dropdownedit:c.DropDownList,datepickeredit:h.DatePicker,datetimepickeredit:h.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 i=this.parent.ganttChartModule.getRecordByTarget(e);!t.isNullOrUndefined(i)&&this.parent.editModule&&this.parent.editSettings.allowEditing&&this.openEditDialog(i)},e.prototype.processDialogFields=function(){t.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),t.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 i=[],n=0,a=0;a<e.length;a++){var s=r.getActualProperties(e[a]);"General"!==s.type||!t.isNullOrUndefined(s.fields)&&0!==s.fields.length||(s.fields=this.getGeneralColumnFields()),"Dependency"===s.type&&t.isNullOrUndefined(this.parent.taskFields.dependency)||"Resources"===s.type&&t.isNullOrUndefined(this.parent.taskFields.resourceInfo)||"Notes"===s.type&&t.isNullOrUndefined(this.parent.taskFields.notes)||("Custom"!==s.type||!t.isNullOrUndefined(s.fields)&&0!==s.fields.length||(n+=1,s.fields=this.getCustomColumnFields()),n>1||i.push(s))}return i},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=[],i={},r=this.parent.taskFields,n=this.parent.columnMapping;return 0!==Object.keys(n).length&&(i.type="General",e.push(i)),t.isNullOrUndefined(t.getValue("dependency",n))||(i={},!1!==this.parent.columnByField[n.dependency.valueOf()].visible&&(i.type="Dependency"),e.push(i)),t.isNullOrUndefined(t.getValue("resourceInfo",n))||(i={},!1!==this.parent.columnByField[n.resourceInfo.valueOf()].visible&&(i.type="Resources"),e.push(i)),t.isNullOrUndefined(t.getValue("notes",n))||(i={},!1!==this.parent.columnByField[n.notes.valueOf()].visible&&(i.type="Notes"),e.push(i)),t.isNullOrUndefined(t.getValue("segments",r))||((i={}).type="Segments",e.push(i)),this.parent.customColumns.length>0&&((i={}).type="Custom",e.push(i)),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=t.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 i=this.parent.ganttColumns,r=this.parent.taskFields,n=this.parent.editModule.getNewTaskId(),a=0;a<i.length;a++){var s=i[a].field;s===r.id?(e[s]=n,e.ganttProperties.rowUniqueID=e[s]):i[a].field===r.startDate?(t.isNullOrUndefined(e[r.endDate])?e[s]=this.getMinimumStartDate():e[s]=new Date(e[r.endDate]),this.parent.timezone&&(e[s]=this.parent.dateValidationModule.remove(e[s],this.parent.timezone)),e.ganttProperties.startDate=new Date(e[s])):i[a].field===r.endDate?(t.isNullOrUndefined(e[r.startDate])?e[s]=this.getMinimumStartDate():e[s]=new Date(e[r.startDate]),this.parent.timezone&&(e[s]=this.parent.dateValidationModule.remove(e[s],this.parent.timezone)),e.ganttProperties.endDate=new Date(e[s])):i[a].field===r.duration?(e[s]=1,e.ganttProperties.duration=e[s],e.ganttProperties.durationUnit=this.parent.durationUnit.toLocaleLowerCase()):i[a].field===r.name?(e[s]=this.localeObj.getConstant("addDialogTitle")+" "+n,e.ganttProperties.taskName=e[s]):i[a].field===r.progress?(e[s]=0,e.ganttProperties.progress=e[s]):i[a].field===r.work?(e[s]=0,e.ganttProperties.work=e[s]):"taskType"===i[a].field?(e[s]=this.parent.taskType,e.ganttProperties.taskType=e[s]):e[this.parent.ganttColumns[a].field]=""}return e.ganttProperties.isAutoSchedule="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[r.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 i=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;t.isNullOrUndefined(i)||this.openEditDialog(i)}},e.prototype.openEditDialog=function(e){var i=this.parent;"object"!=typeof e||t.isNullOrUndefined(e)?t.isNullOrUndefined(e)?i.selectedRowIndex>-1&&(this.rowData=i.currentViewData[i.selectedRowIndex],this.rowIndex=i.selectedRowIndex):(this.rowIndex=i.ids.indexOf(e.toString()),this.rowIndex>-1&&(this.rowData=i.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=t.extend({},{},this.rowData,!0),this.createDialog())},e.prototype.createDialog=function(){var e=this,i=this.parent,r={};this.beforeOpenArgs.dialogModel=r,this.beforeOpenArgs.rowData=this.editedRecord,this.beforeOpenArgs.rowIndex=this.rowIndex;var n=this.parent.isAdaptive?"":"600px",a=this.parent.createElement("div",{id:i.element.id+"_dialog",styles:"max-width:"+n});i.element.appendChild(a),r.animationSettings={effect:"None"},r.header=this.localeObj.getConstant(this.isEdit?"editDialogTitle":"addDialogTitle"),r.isModal=!0,r.cssClass="e-gantt-dialog",r.allowDragging=!this.parent.isAdaptive,r.showCloseIcon=!0;var s=this.parent.isAdaptive?{X:"top",Y:"left"}:{X:"center",Y:"center"};r.position=s,r.height=this.parent.isAdaptive?"100%":"auto",r.target=document.body,r.close=this.dialogClose.bind(this),r.closeOnEscape=!0,r.beforeClose=function(e){"escape"==e.closedBy&&"key-pressed"==e.event.name&&"INPUT"==e.event.target.nodeName&&(e.cancel=!0)},r.open=function(i){var r=t.getValue("element",i),n=r.querySelector("#"+e.parent.element.id+"GeneralTabContainer");n&&n.scrollHeight>n.offsetHeight&&n.classList.add("e-scroll"),0===e.tabObj.selectedItem&&e.tabObj.select(0),e.parent.isAdaptive&&(r.style.maxHeight="none"),e.parent.focusModule&&e.parent.focusModule.setActiveElement(r)},r.locale=this.parent.locale,r.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(r,a)},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(),t.isNullOrUndefined(this.parent.focusModule)||t.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(),t.remove(this.dialog))},e.prototype.destroyDialogInnerElements=function(){for(var e=this.parent,i=this.beforeOpenArgs.tabModel.items,r=0;r<i.length;r++){var n=i[r].content,a=n.id;if(!t.isNullOrUndefined(a)||""!==a)if(a=a.replace(e.element.id,""),"General"===(a=a.replace("TabContainer","")))this.destroyCustomField(n);else if("Dependency"===a){n.ej2_instances[0].destroy()}else if("Notes"===a){n.ej2_instances[0].destroy()}else if("Resources"===a){n.ej2_instances[0].destroy()}else-1!==a.indexOf("Custom")&&this.destroyCustomField(n)}},e.prototype.destroyCustomField=function(e){for(var i=e.childNodes,n=this.parent,a=0;a<i.length;a++){var s=i[a],o=s.querySelector('input[id^="'+n.element.id+'"]');if(o){var l=o.id.replace(n.element.id,""),d=s.querySelector("#"+n.element.id+l).ej2_instances[0];if(!t.isNullOrUndefined(d)){var p=n.columnByField[l];if(!t.isNullOrUndefined(p.edit)&&t.isNullOrUndefined(p.edit.params)){var h=p.edit.destroy;"string"==typeof h?(h=r.getObject(h,window))():p.edit.destroy()}else d.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,r){var n,a=this,s=this.parent,l={},d=[],p=this.getEditFields(),h=s.taskFields,c=p.length;l.items=d,l.locale=this.parent.locale,this.beforeOpenArgs.tabModel=l;var u=0;if(c>0)for(var g=0;g<c;g++){var f=p[g],m={};if("General"===f.type){if(0===Object.keys(s.columnMapping).length)continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("generalTab")),m.content="General",this.beforeOpenArgs[m.content]=this.getFieldsModel(f.fields)}else if("Segments"===f.type){if(t.isNullOrUndefined(h.segments))continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("segments")),m.content="Segments",this.beforeOpenArgs[m.content]=this.getSegmentsModel(f.fields)}else if("Dependency"===f.type){if(t.isNullOrUndefined(h.dependency))continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("dependency")),m.content="Dependency",this.beforeOpenArgs[m.content]=this.getPredecessorModel(f.fields)}else if("Resources"===f.type){if(t.isNullOrUndefined(h.resourceInfo))continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("resourceName")),m.content="Resources",this.beforeOpenArgs[m.content]=this.getResourcesModel(f.fields)}else if("Notes"===f.type){if(t.isNullOrUndefined(h.notes))continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("notes")),m.content="Notes",this.beforeOpenArgs[m.content]=this.getNotesModel(f.fields)}else{if(t.isNullOrUndefined(f.fields)||0===f.fields.length)continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("customTab")),m.content="Custom"+u++,this.beforeOpenArgs[m.content]=this.getFieldsModel(f.fields)}m.header={text:f.headerText},d.push(m)}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(t){if(a.renderTabItems(),!t.cancel){l.selected=a.tabSelectedEvent.bind(a),l.height=a.parent.isAdaptive?"100%":"auto",l.overflowMode="Scrollable",a.tabObj=new o.Tab(l),a.tabObj.isStringTemplate=!0,n=a.parent.createElement("div",{id:s.element.id+"_Tab"}),a.tabObj.appendTo(n),e.content=n,a.dialog=r,a.dialogObj=new i.Dialog(e),a.dialogObj.isStringTemplate=!0,a.dialogObj.appendTo(a.dialog);var d={action:"OpenDialog",requestType:a.isEdit?"openEditDialog":"openAddDialog",data:a.beforeOpenArgs.rowData,element:a.dialog,cancel:!1};a.parent.trigger("actionComplete",d,function(e){e.cancel&&a.resetValues()})}})},e.prototype.tabSelectedEvent=function(e){var i=this.parent,r=e.selectedContent.childNodes[0].id;if(this.parent.isAdaptive&&this.responsiveTabContent(r,i),r===i.element.id+"ResourcesTabContainer")this.resourceSelection(r);else if(r===i.element.id+"NotesTabContainer"){document.getElementById(r).ej2_instances[0].refresh();document.querySelector("#"+this.parent.element.id+"NotesTabContainer").style.overflow="scroll"}else r===i.element.id+"SegmentsTabContainer"&&(t.isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)?document.getElementById(r).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!1):document.getElementById(r).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 i={},r=this.parent.columnByField,n=0;n<e.length;n++)if(e[n]!==this.parent.taskFields.dependency&&e[n]!==this.parent.taskFields.resourceInfo&&e[n]!==this.parent.taskFields.notes&&!t.isNullOrUndefined(r[e[n]])){var a=e[n];this.createInputModel(r[a],i)}return i},e.prototype.createInputModel=function(e,i){var r=this,n=this.parent,a=this.parent.locale,s=this.parent.taskFields,o={placeholder:e.headerText,floatLabelType:"Auto"};switch(e.editType){case"booleanedit":var l={label:e.headerText,locale:a};i[e.field]=l;break;case"defaultedit":case"stringedit":var d=o;e.field!==n.columnMapping.duration&&e.field!==n.columnMapping.startDate&&e.field!==n.columnMapping.endDate||(d.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=o;break;case"numericedit":var p=o;s.progress===e.field&&(p.min=0,p.max=100),s.work===e.field&&(p.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=p;break;case"datepickeredit":var h=o;h.format=this.parent.getDateFormat(),h.strictMode=!0,h.firstDayOfWeek=n.timelineModule.customTimelineSettings.weekStartDay,e.field!==n.columnMapping.startDate&&e.field!==n.columnMapping.endDate||(h.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),h.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=h;break;case"datetimepickeredit":var c=o;c.format=this.parent.getDateFormat(),c.strictMode=!0,c.firstDayOfWeek=n.timelineModule.customTimelineSettings.weekStartDay,e.field!==n.columnMapping.startDate&&e.field!==n.columnMapping.endDate||(c.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),c.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=c;break;case"dropdownedit":if("taskType"===e.field||e.field===n.columnMapping.manual){o.dataSource=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}],o.fields={value:"Value"};o.change=function(t){e.field===s.manual&&(r.editedRecord.ganttProperties.isAutoSchedule=!t.value),r.validateScheduleFields(t,e,n)}}i[e.field]=o;break;case"maskededit":i[e.field]=o}return t.isNullOrUndefined(e.edit)||t.isNullOrUndefined(e.edit.params)||t.extend(i[e.field],e.edit.params),i},e.prototype.validateScheduleFields=function(e,i,r){var n,a=r.editModule.dialogModule.dialog,s=null,o=r.editModule.dialogModule.editedRecord,l=null,d=null;if(t.isNullOrUndefined(e.element)?t.isNullOrUndefined(e.container)?t.isNullOrUndefined(e.event)||t.isNullOrUndefined(e.event.path[1])||(s=(n=e.event.path[1]).querySelector("input").getAttribute("id"),n=n.querySelector("#"+s)):(s=(n=e.container).querySelector("input").getAttribute("id"),n=n.querySelector("#"+s)):s=(n=e.element).getAttribute("id"),t.isNullOrUndefined(n)?(l=e.value,d=i.field):(l=n.value,d=s.replace(r.element.id,"")),0===d.search("Segments"))return d=d.replace("SegmentsTabContainer",""),this.validateSegmentFields(r,d,l,e),!0;this.validateScheduleValuesByCurrentField(d,l,this.editedRecord);var p=o.ganttProperties,h=r.taskFields;return t.isNullOrUndefined(h.startDate)||h.startDate===d||this.updateScheduleFields(a,p,"startDate"),t.isNullOrUndefined(h.endDate)||h.endDate===d||this.updateScheduleFields(a,p,"endDate"),t.isNullOrUndefined(h.duration)||h.duration===d||this.updateScheduleFields(a,p,"duration"),t.isNullOrUndefined(h.work)||h.work===d||this.updateScheduleFields(a,p,"work"),this.dialogEditValidationFlag=!1,!0},e.prototype.updateScheduleFields=function(e,i,r){var n,a=this.parent,s=a.element.id,o=t.getValue(r,a.columnMapping),l=a.columnByField[o],d=this.parent.taskFields;if("stringedit"===l.editType){var p=e.querySelector("#"+s+o).ej2_instances[0];n=t.isNullOrUndefined(l.edit)||t.isNullOrUndefined(l.edit.read)?t.isNullOrUndefined(l.valueAccessor)?this.parent.dataOperation.getDurationString(i.duration,i.durationUnit):l.valueAccessor(o,a.editModule.dialogModule.editedRecord,l):l.edit.read(),p.value!==n.toString()&&d.duration===o?(p.value=n,p.dataBind()):d.startDate!==o&&d.endDate!==o||(p.value=d.startDate===o?i.startDate.toString():i.endDate.toString(),p.dataBind())}else if("datepickeredit"===l.editType||"datetimepickeredit"===l.editType){var h=(l.editType,e.querySelector("#"+s+o).ej2_instances[0]);n=i[r],(t.isNullOrUndefined(h.value)&&!t.isNullOrUndefined(n)||t.isNullOrUndefined(n)&&!t.isNullOrUndefined(h.value)||h.value!==n&&!t.isNullOrUndefined(h.value)&&!t.isNullOrUndefined(n)&&h.value.toString()!==n.toString())&&(h.value=n,h.dataBind())}else if("numericedit"===l.editType){var c=e.querySelector("#"+s+o).ej2_instances[0];n=i[r],t.isNullOrUndefined(n)||c.value===n||(c.value=n,c.dataBind())}},e.prototype.validateDuration=function(e){var i=e.ganttProperties;if(!this.dialogEditValidationFlag){t.isNullOrUndefined(i.duration)?(this.parent.setRecordValue("endDate",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0)):f(i)||!t.isNullOrUndefined(i.startDate)?(e.ganttProperties.isMilestone&&0!==e.ganttProperties.duration&&this.parent.dateValidationModule.checkStartDate(i.startDate),this.parent.dateValidationModule.calculateEndDate(e)):f(i)||t.isNullOrUndefined(i.endDate)||this.parent.dateValidationModule.calculateStartDate(e);var r=0===i.duration;this.parent.setRecordValue("isMilestone",r,i,!0),this.dialogEditValidationFlag=!0}},e.prototype.validateStartDate=function(e){var i=e.ganttProperties,r=this.parent.taskFields;this.dialogEditValidationFlag||(t.isNullOrUndefined(i.startDate)?(this.parent.setRecordValue("duration",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0),this.parent.allowUnscheduledTasks&&t.isNullOrUndefined(r.endDate)&&this.parent.setRecordValue("endDate",null,i,!0)):f(i)?t.isNullOrUndefined(r.duration)?this.parent.dateValidationModule.calculateDuration(e):(t.isNullOrUndefined(r.endDate),this.parent.dateValidationModule.calculateEndDate(e)):t.isNullOrUndefined(i.endDate)?t.isNullOrUndefined(i.duration)||this.parent.dateValidationModule.calculateEndDate(e):this.parent.dateValidationModule.calculateDuration(e),this.dialogEditValidationFlag=!0)},e.prototype.validateEndDate=function(e){var i=e.ganttProperties,r=this.parent.taskFields;this.dialogEditValidationFlag||(t.isNullOrUndefined(i.endDate)?(this.parent.setRecordValue("duration",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0)):f(i)?t.isNullOrUndefined(r.duration)?this.parent.dateValidationModule.calculateDuration(e):t.isNullOrUndefined(i.startDate)?this.parent.dateValidationModule.calculateStartDate(e):(!t.isNullOrUndefined(i.segments)&&i.segments.length>0&&(i.segments=this.parent.editModule.cellEditModule.validateEndDateWithSegments(i)),this.parent.dateValidationModule.calculateDuration(e)):t.isNullOrUndefined(i.duration)?t.isNullOrUndefined(i.startDate)||this.parent.dateValidationModule.calculateDuration(e):this.parent.dateValidationModule.calculateStartDate(e),this.dialogEditValidationFlag=!0)},e.prototype.validateScheduleValuesByCurrentField=function(e,i,r){var n=this.parent,a=r.ganttProperties,s=n.taskFields;if(s.duration===e&&(t.isNullOrUndefined(i)||""===i?n.allowUnscheduledTasks&&this.parent.setRecordValue("duration",null,a,!0):n.dataOperation.updateDurationValue(i,a),this.validateDuration(r),this.parent.editModule.updateResourceRelatedFields(r,"duration")),s.startDate===e){if(""!==i){var o=this.parent.dateValidationModule.getDateFromFormat(i);o=this.parent.dateValidationModule.checkStartDate(o,a),this.parent.setRecordValue("startDate",o,a,!0)}else n.allowUnscheduledTasks&&!r.hasChildRecords&&this.parent.setRecordValue("startDate",null,a,!0);this.validateStartDate(r)}if(s.endDate===e){if(""!==i){var l=this.parent.dateValidationModule.getDateFromFormat(i);0===l.getHours()&&86400!==n.defaultEndTime&&this.parent.dateValidationModule.setTime(n.defaultEndTime,l),l=this.parent.dateValidationModule.checkEndDate(l,a),(t.isNullOrUndefined(a.startDate)||l.getTime()>a.startDate.getTime())&&this.parent.setRecordValue("endDate",l,a,!0)}else n.allowUnscheduledTasks&&this.parent.setRecordValue("endDate",null,a,!0);this.validateEndDate(r)}return s.work===e&&(t.isNullOrUndefined(i)||""===i||(this.parent.setRecordValue("work",i,a,!0),this.parent.editModule.updateResourceRelatedFields(r,"work"),this.validateDuration(r))),"taskType"===e&&this.parent.setRecordValue("taskType",i,a,!0),s.manual===e&&this.parent.editModule.updateTaskScheduleModes(r),!0},e.prototype.getSegmentsModel=function(e){var i=this,r=this.parent.taskFields;(t.isNullOrUndefined(e)||0===e.length)&&(e=[],t.isNullOrUndefined(r.startDate)||e.push("startDate"),t.isNullOrUndefined(r.endDate)||e.push("endDate"),t.isNullOrUndefined(r.duration)||e.push("duration"));var n={};n.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal",newRowPosition:"Bottom"},n.locale=this.parent.locale,n.dataSource=[],n.rowHeight=this.parent.isAdaptive?48:null,n.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 a=[],s=function(r){var n={};switch(e[r]){case"startDate":case"endDate":n={field:e[r],headerText:o.localeObj.getConstant(e[r]),editType:"stringedit",width:"200px",edit:{write:function(n){var a;if(t.isNullOrUndefined(i.beforeOpenArgs.General)){var s=i.getGeneralColumnFields();a=i.getFieldsModel(s)[i.parent.taskFields[e[r]]]}else a=i.beforeOpenArgs.General[i.parent.taskFields[e[r]]];var o=n.rowData[n.column.field];t.setValue("value",o,a);new i.inputs[i.parent.columnByField[i.parent.taskFields[e[r]]].editType](a).appendTo(n.element)},read:function(e){return e.ej2_instances[0].value}},format:o.parent.getDateFormat()},"startDate"===e[r]&&(n.validationRules={required:!0}),a.push(n);break;case"duration":n={field:e[r],headerText:o.localeObj.getConstant(e[r]),editType:"stringedit",width:"100px",edit:{write:function(n){var a;if(t.isNullOrUndefined(i.beforeOpenArgs.General)){var s=i.getGeneralColumnFields();a=i.getFieldsModel(s)[i.parent.taskFields[e[r]]]}else a=i.beforeOpenArgs.General[i.parent.taskFields[e[r]]];a.floatLabelType="Never";var o=n.rowData[n.column.field];t.isNullOrUndefined(o)?t.setValue("value",null,a):t.setValue("value",o,a),t.setValue("value",o,a);new d.TextBox(a).appendTo(n.element)},read:function(e){return e.ej2_instances[0].value.toString()}}},a.push(n)}},o=this,l=0;l<e.length;l++)s(l);return n.columns=a,n.height=this.parent.isAdaptive?"100%":"153px",n},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,i,r){var n,a=this.parent.editModule.dialogModule.dialog,s=t.getValue("Segments",this.beforeOpenArgs),o=this.getGridColumnByField(e,s.columns),l=this.parent.element.id,d=r[e];"stringedit"===o.editType?n=a.querySelector("#"+l+"SegmentsTabContainer"+e).ej2_instances[0]:"datepickeredit"===o.editType&&(n=a.querySelector("#"+l+"SegmentsTabContainer"+e).ej2_instances[0]),n.value.toString()!==d.toString()&&(n.value=d,n.dataBind())},e.prototype.validateSegmentFields=function(e,i,r,n){var a=this.parent.taskFields;if(!t.isNullOrUndefined(a.duration)&&a.duration.toLowerCase()===i.toLowerCase()&&!t.isNullOrUndefined(r)&&""!==r){this.selectedSegment.duration=Number(r);var s=e.dataOperation.getEndDate(this.selectedSegment.startDate,Number(r),this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1);s=e.dataOperation.checkEndDate(s,this.editedRecord.ganttProperties,!1),this.selectedSegment.endDate=s}if(!t.isNullOrUndefined(a.startDate)&&a.startDate.toLowerCase()===i.toLowerCase()&&""!==r){var o=this.parent.dateValidationModule.getDateFromFormat(r);o=this.parent.dateValidationModule.checkStartDate(o),this.selectedSegment.startDate=o,t.isNullOrUndefined(a.endDate)||(this.selectedSegment.endDate=this.parent.dataOperation.getEndDate(o,this.selectedSegment.duration,this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1))}if(!t.isNullOrUndefined(a.endDate)&&a.endDate.toLowerCase()===i.toLowerCase()&&""!==r){0===(s=this.parent.dateValidationModule.getDateFromFormat(r)).getHours()&&86400!==e.defaultEndTime&&this.parent.dateValidationModule.setTime(e.defaultEndTime,s),s=this.parent.dateValidationModule.checkEndDate(s,this.editedRecord.ganttProperties),this.selectedSegment.endDate=s,this.selectedSegment.duration=this.parent.dataOperation.getDuration(this.selectedSegment.startDate,this.selectedSegment.endDate,this.editedRecord.ganttProperties.durationUnit,!0,!1,!0)}t.isNullOrUndefined(a.startDate)||this.updateSegmentField("startDate",n,this.selectedSegment),t.isNullOrUndefined(a.endDate)||this.updateSegmentField("endDate",n,this.selectedSegment),t.isNullOrUndefined(a.duration)||this.updateSegmentField("duration",n,this.selectedSegment)},e.prototype.getPredecessorModel=function(e){(t.isNullOrUndefined(e)||0===e.length)&&(e=["ID","Name","Type","Offset","UniqueId"]);var i={};i.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal"},i.locale=this.parent.locale,i.dataSource=[],i.rowHeight=this.parent.isAdaptive?48:null,i.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 r=[],n=0;n<e.length;n++){var a={};"id"===e[n].toLowerCase()?(a={field:"id",headerText:this.localeObj.getConstant("id"),allowEditing:!1,width:"70px"},r.push(a)):"name"===e[n].toLowerCase()?(a={field:"name",headerText:this.localeObj.getConstant("name"),editType:"stringedit",width:"250px",validationRules:{required:!0}},r.push(a)):"type"===e[n].toLowerCase()?(a={field:"type",headerText:this.localeObj.getConstant("type"),editType:"dropdownedit",dataSource:this.types,foreignKeyField:"id",foreignKeyValue:"text",defaultValue:"FS",validationRules:{required:!0},width:"150px"},r.push(a)):"offset"===e[n].toLowerCase()?(a={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"},r.push(a)):"uniqueid"===e[n].toLowerCase()&&(a={field:"uniqueId",isPrimaryKey:!0,visible:!1,defaultValue:P().toString()},r.push(a))}return i.columns=r,i.height=this.parent.isAdaptive?"100%":"153px",i},e.prototype.getResourcesModel=function(e){var i=this.parent.resourceFields;(t.isNullOrUndefined(e)||0===e.length)&&(e=[i.id,i.name,i.unit,i.group]);for(var r={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"}},n=[{type:"checkbox",allowEditing:!1,allowSorting:!1,allowFiltering:!1,width:60}],a=0;a<e.length;a++){var s={};e[a]===i.id?(s={field:i.id,headerText:this.localeObj.getConstant("id"),isPrimaryKey:!0,width:"100px",allowEditing:!1},n.push(s)):e[a]===i.name?(s={field:i.name,headerText:this.localeObj.getConstant("name"),allowEditing:!1},n.push(s)):e[a]===i.unit?(s={field:i.unit,headerText:this.localeObj.getConstant("unit"),editType:"numericedit",edit:{params:{min:0}}},n.push(s)):e[a]!==i.group||t.isNullOrUndefined(i.group)||(s={field:i.group,headerText:this.localeObj.getConstant("group"),allowEditing:!1},n.push(s))}return r.columns=n,r.height=this.parent.isAdaptive?"100%":"196px",r},e.prototype.getNotesModel=function(e){(t.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"]);return{placeholder:this.localeObj.getConstant("writeNotes"),toolbarSettings:{items:e},height:this.parent.isAdaptive?"100%":"auto",locale:this.parent.locale}},e.prototype.createDivElement=function(e,i){return t.createElement("div",{className:e,id:i})},e.prototype.createInputElement=function(e,i,r,n){return t.createElement(n||"input",{className:e,attrs:{type:"text",id:i,name:r,title:r}})},e.prototype.renderTabItems=function(){for(var e=this.beforeOpenArgs.tabModel.items,t=0,i=0;i<e.length;i++){var r=e[i];r.content instanceof HTMLElement||("General"===r.content?r.content=this.renderGeneralTab(r.content):"Dependency"===r.content?(this.editedRecord.hasChildRecords&&(r.disabled=!0),r.content=this.renderPredecessorTab(r.content)):"Resources"===r.content?r.content=this.renderResourceTab(r.content):r.content==="Custom"+t?(r.content=this.renderCustomTab(r.content),t++):"Notes"===r.content?r.content=this.renderNotesTab(r.content):"Segments"===r.content&&(this.editedRecord.hasChildRecords&&(r.disabled=!0),r.content=this.renderSegmentsTab(r.content)))}},e.prototype.segmentGridActionBegin=function(e){var i=this.parent.taskFields,r=this.beforeOpenArgs.Segments;if("add"===e.requestType||"beginEdit"===e.requestType||"save"===e.requestType){var n=r.dataSource,a=t.getValue("rowData",e),s=this.beforeOpenArgs.rowData.ganttProperties.startDate;if(!t.isNullOrUndefined(s)&&"add"===e.requestType){var o={},l=t.getValue("startDate",a),d=t.getValue("endDate",a),p=(t.getValue("duration",a),!t.isNullOrUndefined(n)&&n.length>0?t.isNullOrUndefined(i.endDate)?new Date(t.getValue("startDate",n[0]).getTime()):new Date(t.getValue("endDate",n[0]).getTime()):!t.isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)&&new Date(this.beforeOpenArgs.rowData.ganttProperties.startDate.getTime()));p.setHours(0,0,0,0),!t.isNullOrUndefined(n)&&n.length>0&&p.setDate(p.getDate()+2),l=this.parent.dataOperation.checkStartDate(p),0===(d=this.parent.dateValidationModule.getDateFromFormat(l)).getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,d),o={startDate:l,endDate:d=!t.isNullOrUndefined(i.endDate)&&!t.isNullOrUndefined(n)&&n.length<=0?this.beforeOpenArgs.rowData.ganttProperties.endDate:d,duration:!t.isNullOrUndefined(i.duration)&&!t.isNullOrUndefined(n)&&n.length<=0?this.beforeOpenArgs.rowData.ganttProperties.duration:1},e.rowData=o}this.selectedSegment=e.rowData}},e.prototype.renderSegmentsTab=function(e){var i=this.parent,n=this.beforeOpenArgs[e],a=this.beforeOpenArgs.rowData,s=[];this.isEdit&&(s=t.isNullOrUndefined(a.ganttProperties.segments)?[]:a.ganttProperties.segments),n.dataSource=s,n.actionBegin=this.segmentGridActionBegin.bind(this),r.Grid.Inject(r.Edit,r.Page,r.Toolbar,r.ForeignKey);var o=new r.Grid(n),l=this.createDivElement("",i.element.id+""+e+"TabContainer");return o.appendTo(l),l},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 i=!1;return(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)&&(-1!==this.parent.customColumns.indexOf(e.field)?i=!0: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&&"taskType"!==e.field||(i=!0)),this.isEdit&&(e.field===this.parent.taskFields.id&&(i=!0),this.editedRecord.hasChildRecords&&(e.field===this.parent.taskFields.endDate&&(!t.isNullOrUndefined(this.editedRecord.isManual)&&0==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||"taskType"===e.field)&&(i=!0)),i},e.prototype.renderPredecessorTab=function(e){var i=this,a=this.parent,s=this.beforeOpenArgs[e],o=this.parent.columnByField[this.parent.taskFields.dependency];(!1===o.allowEditing||o.isPrimaryKey||this.parent.readOnly)&&(s.editSettings.allowEditing=!1,s.editSettings.allowAdding=!1,s.editSettings.allowDeleting=!1);var l=this.beforeOpenArgs.rowData,d=[];this.taskNameCollection(),this.isEdit&&(d=this.predecessorEditCollection(l),this.updatePredecessorDropDownData(l)),s.dataSource=d,s.actionBegin=this.gridActionBegin.bind(this);s.columns[1].edit={write:function(e){"add"===t.getValue("requestType",e)&&t.setValue("rowData.uniqueId",P(),e);new c.ComboBox({dataSource:new n.DataManager(i.idCollection),popupHeight:"180px",allowCustom:!1,fields:{value:"text"},value:e.rowData.name,change:function(e){var r=t.closest(e.element,"tr").querySelector("#"+i.parent.element.id+"DependencyTabContainerid");r&&(t.isNullOrUndefined(e.itemData)||t.isNullOrUndefined(e.item)?r.value="":r.value=e.itemData.id)},autofill:!0}).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value}},r.Grid.Inject(r.Edit,r.Page,r.Toolbar,r.ForeignKey);var p=new r.Grid(s),h=this.createDivElement("e-dependent-div",a.element.id+""+e+"TabContainer");return p.appendTo(h),h},e.prototype.gridActionBegin=function(e){var i=this,r=this.beforeOpenArgs.Dependency;if("add"===e.requestType||"beginEdit"===e.requestType){var n="add"!==e.requestType;this.idCollection=t.extend([],[],this.preTableCollection,!0);for(var a=r.dataSource,s=function(r){o.idCollection.forEach(function(s,o){if(s.id===t.getValue("id",a[r])){var l=t.getValue("rowData",e);if(n&&t.getValue("id",l)===s.id)return;i.idCollection.splice(i.idCollection.indexOf(s),1)}})},o=this,l=0;l<=a.length;l++)s(l)}},e.prototype.updateResourceCollection=function(e,i){if(!t.isNullOrUndefined(e.data)&&Object.keys(e.data).length){this.parent;var r=document.querySelector("#"+i).ej2_instances[0];if(!t.isNullOrUndefined(r)&&r.getSelectedRecords().length>0){var n=r.getSelectedRecords(),a=void 0,s=[];for(a=0;a<n.length;a++)s.push(n[a].taskData);this.ganttResources=t.extend([],s)}else this.ganttResources=[]}else this.ganttResources=[]},e.prototype.renderResourceTab=function(e){var i=this,r=this.parent,n=r.resourceFields,s=this.beforeOpenArgs.rowData,o=s.ganttProperties.resourceInfo,l=this.beforeOpenArgs[e],d=r.element.id+""+e+"TabContainer",p=t.extend([],[],r.resources,!0);if(this.parent.dataOperation.updateResourceUnit(p),!t.isNullOrUndefined(o)){var h=void 0,c=o.length,u=void 0,g=p.length;for(h=0;h<c;h++)for(u=0;u<g;u++)o[h][n.id]===p[u][n.id]&&(p[u][n.unit]=o[h][n.unit])}l.dataSource=p;var f=s.ganttProperties.resourceInfo;if(this.isEdit&&!t.isNullOrUndefined(f))for(var m=0;m<f.length;m++)this.ganttResources.push(f[m]);l.rowSelected=function(e){i.updateResourceCollection(e,d)},l.rowDeselected=function(e){i.updateResourceCollection(e,d)};var y=this.createDivElement("e-resource-div",d);a.TreeGrid.Inject(a.Selection,a.Filter,a.Edit,a.VirtualScroll);var v=new a.TreeGrid(l),D=this.parent.columnByField[this.parent.taskFields.resourceInfo];return(!1===D.allowEditing||D.isPrimaryKey||this.parent.readOnly)&&(v.allowSelection=!1,v.allowFiltering=!1,v.editSettings.allowEditing=!1),v.dataBound=function(){if(i.parent.editDialogFields.length>=1&&"Resources"===i.parent.editDialogFields[0].type){var e=i.parent.element.id+"ResourcesTabContainer";i.resourceSelection(e)}},v.appendTo(y),y},e.prototype.resourceSelection=function(e){var i=this,r=document.querySelector("#"+e).ej2_instances[0],n=r.getCurrentViewRecords(),a=this.ganttResources;a&&a.length>0&&n.forEach(function(e,n){for(var s=0;s<a.length;s++)e.taskData[i.parent.resourceFields.id]!==a[s][i.parent.resourceFields.id]||t.isNullOrUndefined(r.selectionModule)||-1!==r.getSelectedRowIndexes().indexOf(n)||r.selectRow(n)})},e.prototype.renderCustomTab=function(e){return this.renderGeneralTab(e)},e.prototype.renderNotesTab=function(e){var t=this.parent,i=this.beforeOpenArgs[e],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];(!1===a.allowEditing||a.isPrimaryKey||this.parent.readOnly)&&(i.enabled=!1);return new l.RichTextEditor(i).appendTo(n),n},e.prototype.renderInputElements=function(e,i){var n,a=this,s=this.parent.element.id,o=this.editedRecord,l=this.createDivElement("e-edit-form-column"),d={column:i,data:o};if(!t.isNullOrUndefined(i.edit)&&t.isNullOrUndefined(i.edit.params)){var p=i.edit.create;(n="string"==typeof p?(p=r.getObject(p,window))(d):i.edit.create(d)).className="",n.setAttribute("type","text"),n.setAttribute("id",s+""+i.field),n.setAttribute("name",i.field),n.setAttribute("title",i.field),l.appendChild(n)}else n=this.createInputElement("",s+""+i.field,i.field),l.appendChild(n);if(e.enabled=!this.isCheckIsDisabled(i),i.field===this.parent.taskFields.duration)if(t.isNullOrUndefined(i.valueAccessor)){if(t.isNullOrUndefined(i.edit)){var h=o.ganttProperties;e.value=this.parent.dataOperation.getDurationString(h.duration,h.durationUnit)}}else if("string"==typeof i.valueAccessor){var c=r.getObject(i.valueAccessor,window);e.value=c(i.field,o,i)}else e.value=i.valueAccessor(i.field,o,i);else"booleanedit"===i.editType?!0===o[i.field]?e.checked=!0:e.checked=!1:e.value=o[i.field];if(!t.isNullOrUndefined(i.edit)&&t.isNullOrUndefined(i.edit.params)){var u=i.edit.write,g=void 0;g="string"==typeof u?(u=r.getObject(u,window))({column:i,rowData:o,element:n}):i.edit.write({column:i,rowData:o,element:n}),i.field===this.parent.taskFields.duration&&(g.change=function(e){a.validateScheduleFields(e,i,a.parent)})}else{(g=new this.inputs[i.editType](e)).appendTo(n)}return l},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(!i.hasChildRecords){var r="ResourceView"===this.parent.viewType?i.ganttProperties.taskId.toString():i.ganttProperties.rowUniqueID.toString(),n={id:r,text:r+"-"+i.ganttProperties.taskName,value:r};this.preTaskIds.push(n.id),this.preTableCollection.push(n)}}},e.prototype.predecessorEditCollection=function(e){var i=[],r=e.ganttProperties;if(this.isEdit&&!t.isNullOrUndefined(this.parent.taskFields.dependency)&&!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(r.predecessor))for(var n=r.predecessor,a=this.preTableCollection,s=0;s<n.length;s++){var o=n[s].from.toString(),l={};if(("ResourceView"===this.parent.viewType?r.taskId:r.rowUniqueID).toString()!==o){l.id=o;for(var d=0;d<a.length;d++)if(a[d].value===o){l.name=a[d].text;break}l.type=n[s].type;var p=n[s].offset,h=n[s].offsetUnit;l.offset=this.parent.dataOperation.getDurationString(p,h),l.uniqueId=P(),i.push(l)}}return i},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))>-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,i=this.beforeOpenArgs.tabModel.items,r=0;r<i.length;r++){var n=i[r].content,a=n.id;t.isNullOrUndefined(a)&&""===a||("General"===(a=(a=a.replace(e.element.id,"")).replace("TabContainer",""))?this.updateGeneralTab(n,!1):"Dependency"===a?this.updatePredecessorTab(n):"Notes"===a?this.updateNotesTab(n):"Resources"===a?this.updateResourceTab(n):-1!==a.indexOf("Custom")?this.updateCustomTab(n):"Segments"===a&&this.updateSegmentsData(n,this.beforeOpenArgs.rowData))}if(this.isEdit){this.parent.dataOperation.updateWidthLeft(this.rowData);var s={data:this.rowData,action:"DialogEditing"};this.parent.editModule.initiateUpdateAction(s)}else if("ResourceView"===this.parent.viewType){var o=t.extend({},this.addedRecord,!0);if(o[this.parent.taskFields.resourceInfo].length)for(r=0;r<o[this.parent.taskFields.resourceInfo].length;r++){a=o[this.parent.taskFields.resourceInfo][r].toString();var l=this.parent.getTaskIds().indexOf("R"+a.toString());if(-1!==l){this.parent.editModule.addRecord(this.addedRecord,"Child",l);break}}else this.parent.editModule.addRecord(this.addedRecord,"Bottom")}else this.parent.editModule.addRecord(this.addedRecord,this.parent.editSettings.newRowPosition);return!0},e.prototype.updateSegmentTaskData=function(e){for(var i=[],r=this.parent.taskFields,n=0;n<e.length;n++){var a={};t.isNullOrUndefined(r.startDate)||(a[this.parent.taskFields.startDate]=e[n].startDate),t.isNullOrUndefined(r.endDate)||(a[this.parent.taskFields.endDate]=e[n].endDate),t.isNullOrUndefined(r.duration)||(a[this.parent.taskFields.duration]=Number(e[n].duration),e[n].duration=a[this.parent.taskFields.duration]),i.push(a)}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,i,this.rowData),e.length<=0&&this.validateDuration(this.rowData)):this.addedRecord[r.segments]=i},e.prototype.updateSegmentsData=function(e,t){var i=e.ej2_instances[0];i.isEdit&&i.endEdit();var r=i.currentViewData;this.updateSegmentTaskData(r)},e.prototype.updateGeneralTab=function(e,i){var n=this.parent,a=e.childNodes,s={};this.isEdit||(s=this.addedRecord);for(var o=0;o<a.length;o++){var l=a[o],d=l.querySelector('input[id^="'+n.element.id+'"]');if(d){var p=d.id.replace(n.element.id,""),h=l.querySelector("#"+n.element.id+p).ej2_instances[0],c=n.columnByField[p];if(!t.isNullOrUndefined(c.edit)&&t.isNullOrUndefined(c.edit.params)){var u=c.edit.read;"string"==typeof u?(u=r.getObject(u,window),s[p]=u(d,h.value)):s[p]=c.edit.read(d,h.value)}else i&&"booleanedit"===c.editType?!0===d.checked?s[p]=!0:s[p]=!1:s[p]=h.value}}this.isEdit&&(this.updateScheduleProperties(this.editedRecord,this.rowData),n.editModule.validateUpdateValues(s,this.rowData,!0))},e.prototype.updateScheduleProperties=function(e,i){this.parent.setRecordValue("startDate",e.ganttProperties.startDate,i.ganttProperties,!0),this.parent.setRecordValue("endDate",e.ganttProperties.endDate,i.ganttProperties,!0),this.parent.setRecordValue("duration",e.ganttProperties.duration,i.ganttProperties,!0),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,i.ganttProperties,!0),this.parent.setRecordValue("work",e.ganttProperties.work,i.ganttProperties,!0),t.isNullOrUndefined(this.parent.taskFields.startDate)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.startDate),t.isNullOrUndefined(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.endDate),t.isNullOrUndefined(this.parent.taskFields.duration)||(this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.duration),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,this.rowData,!0),0===this.rowData.ganttProperties.duration?this.parent.setRecordValue("isMilestone",!0,this.rowData.ganttProperties,!0):this.parent.setRecordValue("isMilestone",!1,this.rowData.ganttProperties,!0)),t.isNullOrUndefined(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.work),t.isNullOrUndefined(this.parent.taskFields.manual)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.manual)},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],d=l.name.split("-")[0];if(l.id!==d&&(l.id=d),-1===s.indexOf(l.id)){var p=l.id+l.type;l.offset&&-1!==l.offset.indexOf("-")?p+=l.offset:p+="+"+l.offset,r.push(p),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 i=e.ej2_instances[0];i&&i.grid.endEdit();var r=this.ganttResources;"ResourceView"!==this.parent.viewType||t.isNullOrUndefined(this.rowData.ganttProperties)||(JSON.stringify(this.ganttResources)!==JSON.stringify(this.rowData.ganttProperties.resourceInfo)?(this.isResourceUpdate=!0,this.previousResource=t.isNullOrUndefined(this.rowData.ganttProperties.resourceInfo)?[]:this.rowData.ganttProperties.resourceInfo.slice()):this.isResourceUpdate=!1);var n=[];if(this.isEdit)this.parent.setRecordValue("resourceInfo",r,this.rowData.ganttProperties,!0),this.parent.dataOperation.updateMappingData(this.rowData,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(this.rowData,"resource"),this.validateDuration(this.rowData);else{for(var a=0;a<r.length;a++)n.push(r[a][this.parent.resourceFields.id]),this.isAddNewResource=!0;this.addedRecord[this.parent.taskFields.resourceInfo]=n}},e.prototype.updateNotesTab=function(e){var t=this.parent,i=e.ej2_instances[0];this.isEdit?(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}(),hi=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 i=this.getConnectorLineHoverElement(e.target);t.getValue("editModule.taskbarEditModule.taskBarEditAction",this.parent)||this.highlightConnectorLineElements(i)},e.prototype.getConnectorLineHoverElement=function(e){var t=g(e,we),i=g(e,be),r=g(e,Pe);return t||i||r?g(e,De):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,t.addClass([e],[Oe]),e.querySelectorAll(".e-line")[0].classList.contains("e-criticalconnector-line")?(t.addClass(e.querySelectorAll(".e-line"),[Re]),t.addClass(e.querySelectorAll("."+be),[Ee]),t.addClass(e.querySelectorAll("."+Pe),[Fe])):(t.addClass(e.querySelectorAll(".e-line"),[Me]),t.addClass(e.querySelectorAll("."+be),[xe]),t.addClass(e.querySelectorAll("."+Pe),[Ie]))},e.prototype.removeHighlight=function(){t.isNullOrUndefined(this.connectorLineElement)||(t.removeClass([this.connectorLineElement],[Oe]),this.connectorLineElement.querySelectorAll(".e-line")[0].classList.contains(Re)?(t.removeClass(this.connectorLineElement.querySelectorAll(".e-line"),[Re]),t.removeClass(this.connectorLineElement.querySelectorAll("."+be),[Ee]),t.removeClass(this.connectorLineElement.querySelectorAll("."+Pe),[Fe])):(t.removeClass(this.connectorLineElement.querySelectorAll(".e-line"),[Me]),t.removeClass(this.connectorLineElement.querySelectorAll("."+be),[xe]),t.removeClass(this.connectorLineElement.querySelectorAll("."+Pe),[Ie])),this.connectorLineElement=null)},e.prototype.getEditedConnectorLineString=function(e){for(var i,r,n,a,s,o,l=[],d=[],p="",h=0;h<e.length;h++)if(i=e[h],r=i.ganttProperties.predecessor){for(var c=0;c<r.length;c++){n=r[c];if(this.parent.connectorLineModule.removeConnectorLineById("parent"+n.from+"child"+n.to),a=this.parent.connectorLineModule.getRecordByID(n.from),s=this.parent.connectorLineModule.getRecordByID(n.to),(a&&!0===a.expanded||s&&!0===s.expanded)&&(o=this.parent.predecessorModule.updateConnectorLineObject(a,s,n),!t.isNullOrUndefined(o))){var u=l.indexOf(o.connectorLineId),g=this.parent.connectorLineModule.getConnectorLineTemplate(o);-1!==u?d[u]=g:(l.push(o.connectorLineId),d.push(g))}}p=d.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.dependencyViewContainer.innerHTML=this.parent.connectorLineModule.dependencyViewContainer.innerHTML+t},e.prototype.idFromPredecessor=function(e){for(var i=e.split(","),r=[],n=0;n<i.length;n++){for(var a=[],s=0;s<i[n].length&&(!t.isNullOrUndefined(i[n].charAt(s))&&"NaN"!==parseInt(i[n].charAt(s),10).toString());s++)a.push(i[n].charAt(s));r.push(a.join(""))}return r},e.prototype.predecessorValidation=function(e,i){for(var r,n,a=i.rowUniqueID,s=0;s<e.length;s++){r=e[s];var o=[];e.slice(0).splice(s,1);for(var l=function(){var e=[];return-1!==o.indexOf(r)?"break":t.isNullOrUndefined(d.parent.connectorLineModule.getRecordByID(r))?{value:!1}:(n=d.parent.connectorLineModule.getRecordByID(r).ganttProperties,!t.isNullOrUndefined(n.predecessor)&&n.predecessor.length>0&&n.predecessor.forEach(function(t){n.rowUniqueID.toString()!==t.from&&e.push(t.from.toString())}),a.toString()===n.rowUniqueID.toString()||-1!==e.indexOf(a.toString())?{value:!1}:(o.push(r),!t.isNullOrUndefined(n.predecessor)&&n.predecessor.length>0?void(r=n.predecessor[0].from):"break"))},d=this;null!==r;){var p=l();if("object"==typeof p)return p.value;if("break"===p)break}}return!0},e.prototype.validatePredecessorRelation=function(e,i){var r,n,a="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(!t.isNullOrUndefined(i)&&i.length>0){r=this.idFromPredecessor(i);for(var s=function(i){if(!o.checkParentRelation(e,r))return{value:!1};var s=[],l=!0;if(r.slice(0).forEach(function(e){-1===s.indexOf(e)?s.push(e):l=!1}),!l)return{value:!1};n=r[i];var d=[];r.slice(0).splice(i,1);for(var p=function(){var i,r,s=[];if(-1!==d.indexOf(n))return"break";if(t.isNullOrUndefined(o.parent.connectorLineModule.getRecordByID(n.toString())))return{value:!1};if(r=o.parent.connectorLineModule.getRecordByID(n.toString()).ganttProperties,!t.isNullOrUndefined(r.predecessor)&&r.predecessor.length>0&&r.predecessor.forEach(function(e,t){r.rowUniqueID.toString()!==e.from&&(s.push(e.from.toString()),i=t)}),a.toString()===r.rowUniqueID.toString()||-1!==s.indexOf(a.toString()))return{value:!1};if(d.push(n),t.isNullOrUndefined(r.predecessor)||!(r.predecessor.length>0))return"break";var l=void 0;return s.length>1?l=o.predecessorValidation(s,e.ganttProperties):1===s.length&&(n=r.predecessor[i].from),!1===l?{value:!1}:void 0};null!==n;){var h=p();if("object"==typeof h)return h;if("break"===h)break}},o=this,l=0;l<r.length;l++){var d=s(l);if("object"==typeof d)return d.value}}return!0},e.prototype.addPredecessor=function(e,i){var r=t.isNullOrUndefined(e.ganttProperties.predecessorsName)||""===e.ganttProperties.predecessorsName?i:e.ganttProperties.predecessorsName+","+i;this.updatePredecessorHelper(e,r)},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,i,r){if(t.isUndefined(i)||this.validatePredecessorRelation(e,i)){this.parent.isOnEdit=!0;var n=[];t.isNullOrUndefined(i)||""===i||(n=this.parent.predecessorModule.calculatePredecessor(i,e)),this.parent.setRecordValue("predecessor",n,e.ganttProperties,!0);var a=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",a,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,e),this.parent.setRecordValue(this.parent.taskFields.dependency,a,e);var s={};return s.action=r&&r.action&&"CellEditing"===r.action?r.action:"DrawConnectorLine",s.data=e,this.parent.editModule.initiateUpdateAction(s),!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=function(e){var i=n.parent.currentViewData.filter(function(i){return i&&i.ganttProperties.rowUniqueID.toString()===t[e].toString()});if(i[0]&&i[0].hasChildRecords)return{value:!1}},n=this,a=0;a<t.length;a++){var s=r(a);if("object"==typeof s)return s.value}return!0},e.prototype.initPredecessorValidationDialog=function(){if(this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation){var e=t.createElement("div",{id:this.parent.element.id+"_dialogValidationRule"});this.parent.element.appendChild(e),this.renderValidationDialog()}},e.prototype.renderValidationDialog=function(){var e=new i.Dialog({header:"Validate Editing",isModal:!0,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){t.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.removePredecessors(t,this.validationPredecessor),this.parent.editModule.updateEditedTask(e.editEventArgs)):e.validateMode.preserveLinkWithEditing&&(this.calculateOffset(t),this.parent.editModule.updateEditedTask(e.editEventArgs))},e.prototype.calculateOffset=function(e){for(var i=t.extend([],e.ganttProperties.predecessor,[],!0),r=this.parent.predecessorModule.getValidPredecessor(e),n=0;n<r.length;n++){var a=r[n],s=this.parent.connectorLineModule.getRecordByID(a.from),o=void 0;if(f(s.ganttProperties)&&f(e.ganttProperties)){var l=void 0,d=void 0,p=void 0,h=void 0;switch(a.type){case"FS":l=new Date(s.ganttProperties.endDate.getTime()),d=new Date(e.ganttProperties.startDate.getTime());break;case"SS":l=new Date(s.ganttProperties.startDate.getTime()),d=new Date(e.ganttProperties.startDate.getTime());break;case"SF":l=new Date(s.ganttProperties.startDate.getTime()),d=new Date(e.ganttProperties.endDate.getTime());break;case"FF":l=new Date(s.ganttProperties.endDate.getTime()),d=new Date(e.ganttProperties.endDate.getTime())}if(l.getTime()<d.getTime())l=this.dateValidateModule.checkStartDate(l),d=this.dateValidateModule.checkEndDate(d,null),h=!1;else{var c=new Date(l.getTime());l=this.dateValidateModule.checkStartDate(d),d=this.dateValidateModule.checkEndDate(c,null),h=!0}l.getTime()<d.getTime()?(p=this.dateValidateModule.getDuration(l,d,a.offsetUnit,!0,!1),o=h?-1*p:p):o=0}else o=0;i[T(a,"from",i,"to")].offset=o;var u=t.extend([],s.ganttProperties.predecessor,[],!0);u[T(a,"from",u,"to")].offset=o,this.parent.setRecordValue("predecessor",u,s.ganttProperties,!0)}this.parent.setRecordValue("predecessor",i,e.ganttProperties,!0);var g=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,g,e),this.parent.setRecordValue(this.parent.taskFields.dependency,g,e),this.parent.setRecordValue("predecessorsName",g,e.ganttProperties,!0)},e.prototype.removePredecessors=function(e,i){for(var r=t.extend([],[],e.ganttProperties.predecessor,!0),n=i.length,a=0;a<n;a++){var s=this.parent.connectorLineModule.getRecordByID(i[a].from),o=t.extend([],[],s.ganttProperties.predecessor,!0),l=T(i[a],"from",r,"to");r.splice(l,1);var d=T(i[a],"from",o,"to");o.splice(d,1),this.parent.setRecordValue("predecessor",o,s.ganttProperties,!0)}if(r.length!==e.ganttProperties.predecessor.length){this.parent.setRecordValue("predecessor",r,e.ganttProperties,!0);var p=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",p,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,p,e),this.parent.setRecordValue(this.parent.taskFields.dependency,p,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 i,r=this.parent.element.id,n=t.createElement("div",{className:"e-ValidationContent"}),a=t.getValue("task",e),s=t.getValue("parentTask",e),o=t.getValue("violationType",e),l=a.ganttProperties.taskName,d=this.parent.getFormatedDate(a.ganttProperties.startDate,"MM/dd/yyyy"),p=[l,s.ganttProperties.taskName];"taskBeforePredecessor_FS"===o?i=this.parent.localeObj.getConstant("taskBeforePredecessor_FS"):"taskAfterPredecessor_FS"===o?i=this.parent.localeObj.getConstant("taskAfterPredecessor_FS"):"taskBeforePredecessor_SS"===o?i=this.parent.localeObj.getConstant("taskBeforePredecessor_SS"):"taskAfterPredecessor_SS"===o?i=this.parent.localeObj.getConstant("taskAfterPredecessor_SS"):"taskBeforePredecessor_FF"===o?i=this.parent.localeObj.getConstant("taskBeforePredecessor_FF"):"taskAfterPredecessor_FF"===o?i=this.parent.localeObj.getConstant("taskAfterPredecessor_FF"):"taskBeforePredecessor_SF"===o?i=this.parent.localeObj.getConstant("taskBeforePredecessor_SF"):"taskAfterPredecessor_SF"===o&&(i=this.parent.localeObj.getConstant("taskAfterPredecessor_SF"));var h='<div id="'+r+'_ValidationText">'+(i=k(i,p))+"<div>",c='<table><tr><td><input type="radio" id="'+r+'_ValidationCancel" name="ValidationRule" checked/><label for="'+r+'_ValidationCancel" id= "'+r+'_cancelLink">Cancel, keep the existing link</label></td></tr><tr><td><input type="radio" id="'+r+'_ValidationRemoveline" name="ValidationRule"/><label for="'+r+'_ValidationRemoveline" id="'+r+'_removeLink">Remove the link and move <b>'+l+"</b> to start on <b>"+d+'</b>.</label></td></tr><tr><td><input type="radio" id="'+r+'_ValidationAddlineOffset" name="ValidationRule"/><label for="'+r+'_ValidationAddlineOffset" id="'+r+'_preserveLink">Move the <b>'+l+"</b> to start on <b>"+d+"</b> and keep the link.</label></td></tr></table>";return n.innerHTML=h+c,n},e.prototype.validateTypes=function(e){var i,r=this.parent.predecessorModule.getValidPredecessor(e);this.validationPredecessor=[];for(var n,a,s=this.parent.predecessorModule.getPredecessorDate(e,r),o=e.ganttProperties,l=this.parent.allowUnscheduledTasks&&t.isNullOrUndefined(s)?o.endDate:this.dateValidateModule.getEndDate(s,o.duration,o.durationUnit,o,!1),d=0;d<r.length;d++){i=this.parent.connectorLineModule.getRecordByID(r[d].from);var p=null;"FS"===r[d].type?o.startDate<s?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_FS"):o.startDate>s&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_FS"):"SS"===r[d].type?o.startDate<s?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_SS"):o.startDate>s&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_SS"):"FF"===r[d].type?l<=i.ganttProperties.endDate?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_FF"):l>i.ganttProperties.endDate&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_FF"):"SF"===r[d].type&&(l<i.ganttProperties.startDate?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_SF"):l>=i.ganttProperties.startDate&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_SF")),!t.isNullOrUndefined(p)&&t.isNullOrUndefined(a)&&(n=i,a=p)}return{parentTask:n,task:e,violationType:a}},e.prototype.addRemovePredecessor=function(e){var i=this.parent.previousRecords[e.uniqueID],r=e.ganttProperties.predecessor.slice();if(i&&i.ganttProperties&&i.ganttProperties.hasOwnProperty("predecessor")){var n=i.ganttProperties.predecessor;if(!t.isNullOrUndefined(n))for(var a=0;a<n.length;a++){if((d=this.parent.connectorLineModule.getRecordByID(n[a].from))===e)e.ganttProperties.predecessor.push(n[a]);else{var s=t.extend([],[],d.ganttProperties.predecessor,!0),o=T(n[a],"from",s,"to");-1!==o&&(s.splice(o,1),this.parent.setRecordValue("predecessor",s,d.ganttProperties,!0))}}if(!t.isNullOrUndefined(r))for(var l=0;l<r.length;l++){var d=this.parent.connectorLineModule.getRecordByID(r[l].from);(s=t.extend([],[],d.ganttProperties.predecessor,!0)).push(r[l]),this.parent.setRecordValue("predecessor",s,d.ganttProperties,!0)}}},e.prototype.removePredecessorByIndex=function(e,t){var i=e.ganttProperties.predecessor,r=i.splice(t,1),n=this.parent.connectorLineModule.getRecordByID(r[0].from).ganttProperties.predecessor,a=T(r[0],"from",n,"to");n.splice(a,1);var s=this.parent.predecessorModule.getPredecessorStringValue(e);i.push(r[0]),this.parent.connectorLineEditModule.updatePredecessor(e,s)},e.prototype.renderPredecessorDeleteConfirmDialog=function(){this.confirmPredecessorDialog=new i.Dialog({width:"320px",isModal:!0,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=t.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}(),ci=function(){function e(e){if(this.isFromDeleteMethod=!1,this.targetedRecords=[],this.updateParentRecords=[],this.isaddtoBottom=!1,this.confirmDialog=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,this.isBreakLoop=!1,this.deletedTaskDetails=[],this.parent=e,this.validatedChildItems=[],this.parent.editSettings.allowEditing&&"Auto"===this.parent.editSettings.mode&&(this.cellEditModule=new ai(this.parent)),this.parent.taskFields.dependency&&(this.parent.connectorLineEditModule=new hi(this.parent)),(this.parent.editSettings.allowAdding||this.parent.editSettings.allowEditing&&("Dialog"===this.parent.editSettings.mode||"Auto"===this.parent.editSettings.mode))&&(this.dialogModule=new pi(this.parent)),this.parent.editSettings.allowTaskbarEditing&&(this.taskbarEditModule=new di(this.parent)),this.parent.editSettings.allowDeleting){var i=t.createElement("div",{id:this.parent.element.id+"_deleteConfirmDialog"});this.parent.element.appendChild(i),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"],i=0;i<e.length;i++)if(!t.isNullOrUndefined(e[i])&&e[i].length>0){var r=this.parent.getColumnByField(e[i],this.parent.treeGridModule.treeGridColumns);r&&(r.field===this.parent.taskFields.id?this.updateIDColumnEditParams(r):r.field===this.parent.taskFields.progress?this.updateProgessColumnEditParams(r):r.field===this.parent.taskFields.resourceInfo?this.updateResourceColumnEditor(r):"taskType"===r.field&&this.updateTaskTypeColumnEditor(r))}},e.prototype.updateIDColumnEditParams=function(e){this.updateEditParams(e,{min:0,decimals:0,validateDecimalOnType:!0,format:"n0",showSpinButton:!1})},e.prototype.updateProgessColumnEditParams=function(e){this.updateEditParams(e,{min:0,decimals:0,validateDecimalOnType:!0,max:100,format:"n0"})},e.prototype.updateEditParams=function(e,i){t.isNullOrUndefined(e.edit)?(e.edit={},e.edit.params={}):t.isNullOrUndefined(e.edit.params)&&(e.edit.params={}),t.extend(i,e.edit.params),e.edit.params=i;this.parent.getColumnByField(e.field,this.parent.ganttColumns).edit=e.edit},e.prototype.updateResourceColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&t.isNullOrUndefined(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getResourceEditor();var i=this.parent.getColumnByField(e.field,this.parent.ganttColumns);i.editType="dropdownedit",i.edit=e.edit}},e.prototype.getResourceEditor=function(){var e,i=this,r=this.parent.resourceFields,a={};return c.MultiSelect.Inject(c.CheckBoxSelection),a.write=function(t){i.parent.treeGridModule.currentEditRow={},(e=new c.MultiSelect({dataSource:new n.DataManager(i.parent.resources),fields:{text:r.name,value:r.id},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"350px",delimiterChar:",",value:i.parent.treeGridModule.getResourceIds(t.rowData)})).appendTo(t.element)},a.read=function(e){var n=e.ej2_instances[0].value,a=[];t.isNullOrUndefined(n)&&(n=[]);for(var s=0;s<n.length;s++)for(var o=0;o<i.parent.resources.length;o++)if(i.parent.resources[o][r.id]===n[s]){a.push(i.parent.resources[o][r.name]);break}return i.parent.treeGridModule.currentEditRow[i.parent.taskFields.resourceInfo]=n,a.join(",")},a.destroy=function(){e&&e.destroy()},a},e.prototype.updateTaskTypeColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&t.isNullOrUndefined(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getTaskTypeEditor();var i=this.parent.getColumnByField(e.field,this.parent.ganttColumns);i.editType="dropdownedit",i.edit=e.edit}},e.prototype.getTaskTypeEditor=function(){var e,i=this,r={},a=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];return r.write=function(r){i.parent.treeGridModule.currentEditRow={},(e=new c.DropDownList({dataSource:new n.DataManager(a),fields:{value:"Value"},popupHeight:"350px",value:t.getValue("taskType",r.rowData.ganttProperties)})).appendTo(r.element)},r.read=function(e){var t=e.ej2_instances[0].value;return i.parent.treeGridModule.currentEditRow.taskType=t,t},r.destroy=function(){e&&e.destroy()},r},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)):t.isNullOrUndefined(this.parent.editModule.cellEditModule)&&"Auto"===e.mode&&(this.cellEditModule=new ai(this.parent)),this.parent.editModule.dialogModule&&"Auto"===e.mode?this.parent.treeGrid.recordDoubleClick=void 0:t.isNullOrUndefined(this.parent.editModule.dialogModule)&&(this.dialogModule=new pi(this.parent))):(this.cellEditModule&&this.cellEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy()),e.allowDeleting&&e.showDeleteConfirmDialog){if(t.isNullOrUndefined(this.confirmDialog)){var i=t.createElement("div",{id:this.parent.element.id+"_deleteConfirmDialog"});this.parent.element.appendChild(i),this.renderDeleteConfirmDialog()}}else e.allowDeleting&&e.showDeleteConfirmDialog||this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy();e.allowTaskbarEditing?t.isNullOrUndefined(this.parent.editModule.taskbarEditModule)&&(this.taskbarEditModule=new di(this.parent)):this.taskbarEditModule&&this.taskbarEditModule.destroy()},e.prototype.recordDoubleClick=function(e){if(this.parent.editSettings.allowEditing&&"Dialog"===this.parent.editSettings.mode){var i=void 0;if(e.row){var r=t.getValue("rowIndex",e.row);i=this.parent.currentViewData[r]}t.isNullOrUndefined(i)||this.dialogModule.openEditDialog(i)}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 i=this.parent.taskFields;if(t.isNullOrUndefined(e)||t.isNullOrUndefined(e[i.id]))return;var r="ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf("T"+e[i.id])]:this.parent.getRecordByID(e[i.id]);if(!t.isNullOrUndefined(this.parent.editModule)&&r){this.parent.isOnEdit=!0,this.validateUpdateValues(e,r,!0),e[this.parent.taskFields.resourceInfo]&&(0===r.ganttProperties.duration&&this.parent.dataOperation.updateWorkWithDuration(r),this.updateResourceRelatedFields(r,"resource"),this.parent.dateValidationModule.calculateEndDate(r));var n=Object.keys(e);if(-1===n.indexOf(i.startDate)&&-1===n.indexOf(i.endDate)&&-1===n.indexOf(i.duration)||this.parent.dataOperation.calculateScheduledValues(r,r.taskData,!1),this.parent.dataOperation.updateWidthLeft(r),t.isUndefined(e[this.parent.taskFields.dependency])||e[this.parent.taskFields.dependency]===r.ganttProperties.predecessorsName){var a={};a.data=r,"ResourceView"===this.parent.viewType&&(a.action="methodUpdate"),this.parent.editModule.initiateUpdateAction(a)}else this.parent.connectorLineEditModule.updatePredecessor(r,e[this.parent.taskFields.dependency])}}},e.prototype.validateUpdateValues=function(e,i,r){for(var n=this.parent,a=n.taskFields,s=y(n.columnMapping),o=[],l=!1,d=0,p=Object.keys(e);d<p.length;d++){var h=p[d];if(-1!==[a.startDate,a.endDate,a.duration].indexOf(h)){if(t.isNullOrUndefined(e[h])&&!n.allowUnscheduledTasks)continue;if(r)if(a.duration===h)n.dataOperation.updateDurationValue(e[h],i.ganttProperties),i.ganttProperties.duration>0&&i.ganttProperties.isMilestone&&this.parent.setRecordValue("isMilestone",!1,i.ganttProperties,!0),n.dataOperation.updateMappingData(i,s[h]);else{var c="string"==typeof e[h]?new Date(e[h]):e[h];n.setRecordValue(s[h],c,i.ganttProperties,!0),n.dataOperation.updateMappingData(i,s[h])}else o.push(h),l=!0}else if(a.resourceInfo===h){var u=n.dataOperation.setResourceInfo(e);"ResourceView"===this.parent.viewType&&(JSON.stringify(u)!==JSON.stringify(i.ganttProperties.resourceInfo)?(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=t.isNullOrUndefined(i.ganttProperties.resourceInfo)?[]:i.ganttProperties.resourceInfo.slice()):this.parent.editModule.dialogModule.isResourceUpdate=!1),i.ganttProperties.resourceInfo=u,n.dataOperation.updateMappingData(i,"resourceInfo")}else if(a.dependency===h);else if(-1!==[a.progress,a.notes,a.durationUnit,a.expandState,a.milestone,a.name,a.baselineStartDate,a.baselineEndDate,a.id,a.segments].indexOf(h)){var g=n.columnByField[h],f=e[h];t.isNullOrUndefined(g)||"datepickeredit"!==g.editType&&"datetimepickeredit"!==g.editType||(f=n.dataOperation.getDateFromFormat(f));var m=s[h];if(h===a.id)m="taskId";else if(h===a.name)m="taskName";else if(h===a.segments&&(m="segments",e&&!t.isNullOrUndefined(e[this.parent.taskFields.segments])&&e[this.parent.taskFields.segments].length>0)){for(var v=0,D=0;D<i.ganttProperties.segments.length;D++)v+=i.ganttProperties.segments[D].duration;var w=i.ganttProperties.startDate,k=this.parent.dataOperation.getEndDate(w,v,i.ganttProperties.durationUnit,i.ganttProperties,!1);n.setRecordValue("endDate",n.dataOperation.getDateFromFormat(k),i.ganttProperties,!0)}t.isNullOrUndefined(m)||n.setRecordValue(m,f,i.ganttProperties,!0),(h===a.baselineStartDate||h===a.baselineEndDate)&&i.ganttProperties.baselineStartDate&&i.ganttProperties.baselineEndDate&&(n.setRecordValue("baselineStartDate",n.dataOperation.checkBaselineStartDate(i.ganttProperties.baselineStartDate),i.ganttProperties,!0),n.dataOperation.setTime(this.parent.defaultEndTime,i.ganttProperties.baselineEndDate),n.setRecordValue("baselineEndDate",n.dataOperation.checkBaselineEndDate(i.ganttProperties.baselineEndDate),i.ganttProperties,!0),n.setRecordValue("baselineLeft",n.dataOperation.calculateBaselineLeft(i.ganttProperties),i.ganttProperties,!0),n.setRecordValue("baselineWidth",n.dataOperation.calculateBaselineWidth(i.ganttProperties),i.ganttProperties,!0)),n.setRecordValue("taskData."+h,f,i),h===a.segments&&e&&!t.isNullOrUndefined(e[this.parent.taskFields.segments])&&e[this.parent.taskFields.segments].length>0&&n.dataOperation.setSegmentsInfo(i,!0),n.setRecordValue(h,f,i)}else if(a.indicators===h){f=e[h];n.setRecordValue("indicators",f,i.ganttProperties,!0),n.setRecordValue("taskData."+h,f,i),n.setRecordValue(h,f,i)}else if(a.work===h)n.setRecordValue("work",e[h],i.ganttProperties,!0),this.parent.dataOperation.updateMappingData(i,"work"),this.parent.dataOperation.updateMappingData(i,"duration"),this.parent.dataOperation.updateMappingData(i,"endDate");else if("taskType"===h)n.setRecordValue("taskType",e[h],i.ganttProperties,!0);else if(-1!==n.customColumns.indexOf(h)){g=n.columnByField[h],f=e[h];t.isNullOrUndefined(g.edit)&&("datepickeredit"!==g.editType&&"datetimepickeredit"!==g.editType||(f=n.dataOperation.getDateFromFormat(f))),n.setRecordValue("taskData."+h,f,i),n.setRecordValue(h,f,i)}else a.manual===h&&(n.setRecordValue("isAutoSchedule",!e[h],i.ganttProperties,!0),this.parent.setRecordValue(h,e[h],i),this.updateTaskScheduleModes(i))}l&&this.validateScheduleValues(o,i,e)},e.prototype.updateResourceRelatedFields=function(e,i){var r=e.ganttProperties,n=r.taskType,a=r.isAutoSchedule;if(!t.isNullOrUndefined(r.resourceInfo))if(r.work>0||"work"===i)switch(n){case"FixedUnit":if(0===r.resourceInfo.length)return;a&&r.resourceInfo.length&&("work"===i||"resource"===i)?this.parent.dataOperation.updateDurationWithWork(e):a||"work"!==i?this.parent.dataOperation.updateWorkWithDuration(e):this.parent.dataOperation.updateUnitWithWork(e);break;case"FixedWork":if(0===r.resourceInfo.length)return;a?"duration"===i||"endDate"===i?(this.parent.dataOperation.updateUnitWithWork(e),0===r.duration&&(this.parent.setRecordValue("work",0,r,!0),t.isNullOrUndefined(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(e,"work"))):this.parent.dataOperation.updateDurationWithWork(e):"work"===i?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e);break;case"FixedDuration":r.resourceInfo.length&&"work"===i?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 i=!1,r=e.ganttProperties,n=this.parent.previousRecords&&this.parent.previousRecords[e.uniqueID];if(n&&n.ganttProperties){var a=t.getValue("ganttProperties.startDate",n),s=t.getValue("ganttProperties.endDate",n),o=t.getValue("ganttProperties.duration",n),l=t.getValue("ganttProperties.durationUnit",n),d=Object.keys(n.ganttProperties);-1===d.indexOf("startDate")&&-1===d.indexOf("endDate")&&-1===d.indexOf("duration")&&-1===d.indexOf("durationUnit")||(t.isNullOrUndefined(a)&&!t.isNullOrUndefined(r.startDate)||t.isNullOrUndefined(s)&&!t.isNullOrUndefined(r.endDate)||t.isNullOrUndefined(r.startDate)&&!t.isNullOrUndefined(a)||t.isNullOrUndefined(r.endDate)&&!t.isNullOrUndefined(s)||a&&a.getTime()!==r.startDate.getTime()||s&&s.getTime()!==r.endDate.getTime()||!t.isNullOrUndefined(o)&&o!==r.duration||!t.isNullOrUndefined(o)&&o===r.duration&&l!==r.durationUnit)&&(i=!0)}return i},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 i=this.isCheckPredecessor(e.data);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 r={};if(i)if(r=this.parent.connectorLineEditModule.validateTypes(e.data),this.parent.isConnectorLineUpdate=!0,t.isNullOrUndefined(t.getValue("violationType",r)))this.updateEditedTask(e);else{var n=this.validateTaskEvent(e);!1===n.validateMode.preserveLinkWithEditing&&!1===n.validateMode.removeLink&&!1===n.validateMode.respectLink?this.parent.connectorLineEditModule.openValidationDialog(r):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.updateParentChildRecord(t),this.parent.isConnectorLineUpdate){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,[],""))}t.ganttProperties.predecessor&&(this.parent.isMileStoneEdited=t.ganttProperties.isMilestone,this.taskbarMoved&&(this.parent.editedTaskBarItem=t),this.parent.predecessorModule.validatePredecessor(t,[],"")),this.updateParentItemOnEditing()}t.parentItem&&this.parent.dataOperation.updateParentItems(t,!0),this.initiateSaveAction(e)},e.prototype.updateParentItemOnEditing=function(){for(var e=t.getValue("parentRecord",this.parent.predecessorModule),i=0;i<e.length;i++)this.parent.dataOperation.updateParentItems(e[i]);t.setValue("parentRecord",[],this.parent.predecessorModule),t.setValue("parentIds",[],this.parent.predecessorModule)},e.prototype.updateParentChildRecord=function(e){var i=e;i.hasChildRecords&&this.taskbarMoved&&"Auto"===this.parent.taskMode&&!t.isNullOrUndefined(this.parent.editModule.cellEditModule)&&!this.parent.editModule.cellEditModule.isResourceCellEdited&&this.updateChildItems(i),t.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("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.startDate,i,!0),this.parent.setRecordValue("autoEndDate",i.endDate,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,i){var r=e,n=r.ganttProperties,a=new Date(i.getTime());if(!t.isNullOrUndefined(n.endDate)&&t.isNullOrUndefined(n.startDate)){var s=this.parent.dateValidationModule.checkStartDate(a,n,null);this.parent.setRecordValue("endDate",this.parent.dateValidationModule.checkEndDate(s,r.ganttProperties),n,!0)}else this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(a,n,!1),n,!0),t.isNullOrUndefined(n.duration)||this.parent.dateValidationModule.calculateEndDate(r);this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(r)},e.prototype.updateParentProgress=function(e){var i=0,r=this.parent.getParentTask(e),n=r.childRecords,a=n?n.length:0,s=0,o=0,l=0,d={};if(n){for(var p=0;p<a;p++)n[p].ganttProperties.isMilestone&&!n[p].hasChildRecords||!f(n[p].ganttProperties)?o+=1:(d=this.parent.dataOperation.getParentProgress(n[p]),s+=t.getValue("totalProgress",d),l+=t.getValue("totalDuration",d));i=a-o>0?Math.round(s/l):0,isNaN(i)&&(i=0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(r.ganttProperties.isAutoSchedule?r.ganttProperties.width:r.ganttProperties.autoWidth,i),r.ganttProperties,!0),this.parent.setRecordValue("progress",Math.floor(i),r.ganttProperties,!0),this.parent.setRecordValue("totalProgress",s,r.ganttProperties,!0),this.parent.setRecordValue("totalDuration",l,r.ganttProperties,!0)}this.parent.dataOperation.updateTaskData(r),r.parentItem&&this.updateParentProgress(r.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,i){t.isNullOrUndefined(i)||t.extend(e,i)},e.prototype.updateScheduleDatesOnEditing=function(e){},e.prototype.updateChildItems=function(e){var i,r=this.parent.previousRecords[e.uniqueID];i=t.isNullOrUndefined(r)||t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.ganttProperties)?new Date(e.ganttProperties.startDate.getTime()):new Date(r.ganttProperties.startDate.getTime());var n,a,s,o,l,d=e.ganttProperties.startDate,p=[];if(this.getUpdatableChildRecords(e,p),0!==p.length){i.getTime()>d.getTime()?(n=this.parent.dateValidationModule.checkStartDate(d),a=this.parent.dateValidationModule.checkEndDate(i,e.ganttProperties),o=!1):(n=this.parent.dateValidationModule.checkStartDate(i),a=this.parent.dateValidationModule.checkEndDate(d,e.ganttProperties),o=!0),l=n.getTime()>=a.getTime()?0:this.parent.dateValidationModule.getDuration(n,a,"minute",!0,!1);for(var h=0;h<p.length;h++)if(p[h].ganttProperties.isAutoSchedule)if(l>0){var c=f(p[h].ganttProperties)?p[h].ganttProperties.startDate:p[h].ganttProperties.startDate?p[h].ganttProperties.startDate:p[h].ganttProperties.endDate?p[h].ganttProperties.endDate:new Date(i.toString());s=o?this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(c,p[h].ganttProperties,p[h].ganttProperties.isMilestone),l,"minute",p[h].ganttProperties,!1):this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(c,p[h].ganttProperties),l,"minute",p[h].ganttProperties),this.calculateDateByRoundOffDuration(p[h],s),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(p[h])&&this.validatedChildItems.push(p[h])}else t.isNullOrUndefined(r)&&(s=i,this.calculateDateByRoundOffDuration(p[h],s),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(p[h])&&this.validatedChildItems.push(p[h]));p.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 i=this;this.parent.showSpinner();var r={};r.requestType="beforeSave",r.data=e.data,r.cancel=!1,r.modifiedRecords=this.parent.editedRecords,t.isNullOrUndefined(e.target)||(r.target=e.target),r.modifiedTaskData=D(this.parent.editedRecords,!0),e.action&&"DrawConnectorLine"===e.action&&(r.action="DrawConnectorLine"),this.parent.trigger("actionBegin",r,function(t){if(t.cancel)i.reUpdatePreviousRecords(),i.parent.chartRowsModule.refreshRecords([e.data]),i.resetEditProperties(r);else if(t.modifiedTaskData=D(t.modifiedRecords,null,null,i.parent),v(i.parent.dataSource)){var a=i.parent.dataSource,s={changedRecords:t.modifiedTaskData},o=i.parent.query instanceof n.Query?i.parent.query:new n.Query,l=null,d=a.adaptor;if(d instanceof n.WebApiAdaptor&&d instanceof n.ODataAdaptor&&!a.dataSource.batchUrl){l=a.update(i.parent.taskFields.id,s.changedRecords,null,o)}else l=a.saveChanges(s,i.parent.taskFields.id,null,o);l.then(function(t){return i.dmSuccess(t,e)}).catch(function(t){return i.dmFailure(t,e)})}else i.saveSuccess(e)})},e.prototype.dmSuccess=function(e,t){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 i=e.ganttProperties.sharedTaskUniqueIds,r=0;r<i.length;r++){var n=this.parent.flatData[this.parent.ids.indexOf(i[r].toString())];n.uniqueID!==e.uniqueID&&(this.updateGanttProperties(e,n),this.parent.setRecordValue("taskData",e.taskData,n,!0),this.parent.dataOperation.updateTaskData(n),this.parent.dataOperation.updateResourceName(n),t.isNullOrUndefined(n.parentItem)||this.parent.dataOperation.updateParentItems(n.parentItem))}},e.prototype.saveSuccess=function(e){var i={};if(this.parent.timelineSettings.updateTimescaleView){var r=this.parent.editedRecords;this.parent.timelineModule.updateTimeLineOnEditing([r],e.action)}if("ResourceView"===this.parent.viewType){"TaskbarEditing"===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 n=0;n<this.updateParentRecords.length;n++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[n]);this.updateParentRecords=[],this.parent.editModule.dialogModule.isResourceUpdate=!1,this.parent.editModule.dialogModule.previousResource=[]}if(this.isTreeGridRefresh||(this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords),this.parent.isConnectorLineUpdate&&!t.isNullOrUndefined(this.parent.connectorLineEditModule)&&(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.editedRecords),this.updateScheduleDatesOnEditing(e))),!this.parent.editSettings.allowTaskbarEditing||this.parent.editSettings.allowTaskbarEditing&&!this.taskbarEditModule.dependencyCancel){if(i.requestType="save",i.data=e.data,i.modifiedRecords=this.parent.editedRecords,i.modifiedTaskData=D(this.parent.editedRecords,null,null,this.parent),t.isNullOrUndefined(e.action)||t.setValue("action",e.action,i),"TaskbarEditing"===e.action&&(i.taskBarEditAction=e.taskBarEditAction),this.endEditAction(e),this.parent.enableCriticalPath){var a=this.parent.criticalPathModule;a.showCriticalPath(!0),a.criticalConnectorLine(a.criticalPathCollection,a.detailPredecessorCollection,!0,a.predecessorCollectionTaskIds)}this.parent.trigger("actionComplete",i)}else 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++){for(var o=[],l=parseInt(t[s][this.parent.resourceFields.id],10),d=0;d<e.length;d++)if(parseInt(e[d][this.parent.resourceFields.id],10)===l){o.push(d);break}if(0===o.length){var p=r[this.parent.getTaskIds().indexOf("R"+l)];p&&this.addNewRecord(i,p)}else e.splice(parseInt(o[0].toString(),10),1)}var h=e?e.length:0;for(s=0;s<h;s++)for(var c=i.ganttProperties.taskId,u=(l=e[s][this.parent.resourceFields.id],r[this.parent.getTaskIds().indexOf("R"+l)]),g=0;g<u.childRecords.length;g++)u.childRecords[g].ganttProperties.taskId===c&&this.removeChildRecord(u.childRecords[g]);if(n>0){var f=this.parent.getParentTask(i.parentItem);f&&f.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.removeChildRecord(i)}0===n&&this.checkWithUnassignedTask(i)}},e.prototype.checkWithUnassignedTask=function(e){for(var i=null,r=0;r<this.parent.flatData.length;r++)this.parent.flatData[r].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&(i=this.parent.flatData[r]);if(t.isNullOrUndefined(i)){var n={};n[this.parent.taskFields.id]=0,n[this.parent.taskFields.name]=this.parent.localeObj.getConstant("unassignedTask");var a=this.parent.isOnEdit;this.parent.isOnEdit=!1;var s=this.parent.dataOperation.createRecord(n,0);this.parent.isOnEdit=a,this.addRecordAsBottom(s);var o=this.parent.flatData[this.parent.flatData.length-1];this.addNewRecord(e,o)}else this.addNewRecord(e,i)},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,i){var n=null;n=t.extend({},{},e,!0),this.parent.setRecordValue("uniqueID",r.getUid(this.parent.element.id+"_data_"),n),this.parent.setRecordValue("uniqueID",n.uniqueID,n.ganttProperties,!0);var a=n.uniqueID.replace(this.parent.element.id+"_data_","");this.parent.setRecordValue("rowUniqueID",a,n),this.parent.setRecordValue("rowUniqueID",a,n.ganttProperties,!0),this.parent.setRecordValue("level",1,n),this.parent.taskFields.parentID&&this.parent.setRecordValue("parentId",i.ganttProperties.taskId,n.ganttProperties,!0),this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(i),n);var s=n.parentItem?n.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",s,n),e.ganttProperties.sharedTaskUniqueIds.push(a),n.ganttProperties.sharedTaskUniqueIds=e.ganttProperties.sharedTaskUniqueIds,this.addRecordAsChild(i,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 p=[];p.push(a.ganttProperties.rowUniqueID.toString()),this.parent.editModule.removeFromDataSource(p)}var h=this.parent.flatData.indexOf(a);if(t.taskFields.parentID){for(var c=void 0,u=this.parent.currentViewData,g=0;g<u.length;g++)u[g].ganttProperties.rowUniqueID===a.ganttProperties.rowUniqueID&&(c=g);-1!==c&&(r.length>0&&r.splice(c,1),i.splice(c,1),this.parent.flatData.splice(h,1),this.parent.ids.splice(h,1),this.parent.getTaskIds().splice(h,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(h,m+1),this.parent.ids.splice(h,m+1),this.parent.getTaskIds().splice(h,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,i){var r,n=this.parent,a=this.parent.flatData.indexOf(e),s=this.parent.editModule.getChildCount(e,0);if(!t.isNullOrUndefined(this.addRowIndex)&&this.addRowPosition&&e.childRecords&&"Child"!==this.addRowPosition){var o=e.childRecords[this.addRowIndex],l="Above"===this.addRowPosition||"Below"===this.addRowPosition?this.addRowPosition:"Child";r=o?this.addRowIndex+a+1:s+a+1,r="Above"===l?r:r+1}else r=t.isNullOrUndefined(s)||0===s?a+1:s+a+1;this.parent.currentViewData.splice(r,0,i),this.parent.flatData.splice(r,0,i),this.parent.ids.splice(r,0,i.ganttProperties.rowUniqueID.toString()),this.updateTreeGridUniqueID(i,"add");var d=0===i.level?"R"+i.ganttProperties.taskId:"T"+i.ganttProperties.taskId;this.parent.getTaskIds().splice(r,0,d),e.hasChildRecords||(this.parent.setRecordValue("hasChildRecords",!0,e),this.parent.setRecordValue("expanded",!0,e),e.childRecords.length||(e.childRecords=[],!n.taskFields.parentID&&t.isNullOrUndefined(e.taskData[this.parent.taskFields.child])&&(e.taskData[this.parent.taskFields.child]=[]))),e.childRecords.splice(e.childRecords.length,0,i),t.isNullOrUndefined(i)||this.parent.taskFields.parentID||t.isNullOrUndefined(e.taskData[this.parent.taskFields.child])||e.taskData[this.parent.taskFields.child].splice(e.childRecords.length,0,i.taskData),t.isNullOrUndefined(i.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,t.isNullOrUndefined(this.dialogModule)||!t.isNullOrUndefined(e)&&(t.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 i.Dialog({width:"320px",isModal:!0,visible:!1,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();this.parent.element.querySelector(".e-treegrid").focus()}},e.prototype.deleteResourceRecords=function(e){for(var t=[],i=0;i<e.length;i++)if(e[i].parentItem)for(var r=e[i].ganttProperties.sharedTaskUniqueIds,n=0;n<r.length;n++)t.push(this.parent.flatData[this.parent.ids.indexOf(r[n].toString())]);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 i=typeof e;switch(this.targetedRecords=[],i){case"number":case"string":var r=e.toString();"ResourceView"===this.parent.viewType?t.isNullOrUndefined(r)||-1===this.parent.getTaskIds().indexOf("T"+r)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r)]):t.isNullOrUndefined(r)||-1===this.parent.ids.indexOf(r)||this.targetedRecords.push(this.parent.getRecordByID(r));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 i=0;i<e.length;i++){var r=e[i].toString();"ResourceView"===this.parent.viewType?t.isNullOrUndefined(r)||-1===this.parent.getTaskIds().indexOf("T"+r)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r)]):t.isNullOrUndefined(r)||-1===this.parent.ids.indexOf(r)||this.targetedRecords.push(this.parent.getRecordByID(r))}}},e.prototype.deleteRow=function(e){var i=e&&e.length?e:this.parent.selectionModule.getSelectedRecords();if(this.parent.addDeleteRecord=!0,i.length){this.parent.isOnDelete=!0,i.forEach(function(e){e.isDelete=!0}),"ResourceView"!==this.parent.viewType||e.length||(i=[]);for(var r=0;r<i.length;r++){var n=i[r];if(-1===this.deletedTaskDetails.indexOf(n)){if(n.parentItem){var a=this.parent.getParentTask(n.parentItem).childRecords;(1===a.length?a:a.filter(function(e){return!e.isDelete})).length>0&&this.parent.dataOperation.updateParentItems(n.parentItem)}var s=n.ganttProperties.predecessor;s&&s.length&&this.removePredecessorOnDelete(n),this.deletedTaskDetails.push(n),n.hasChildRecords&&this.deleteChildRecords(n)}}this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.clearSelection();var o={};o.deletedRecordCollection=this.deletedTaskDetails,o.updatedRecordCollection=this.parent.editedRecords,o.cancel=!1,o.action="delete",this.initiateDeleteAction(o),this.parent.isOnDelete=!1}t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.removePredecessorOnDelete=function(e){for(var i=e.ganttProperties.predecessor,r=0;r<i.length;r++){var n=i[r],a="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(n.from.toString()===a.toString()){var s=this.parent.connectorLineModule.getRecordByID(n.to.toString());if(!t.isNullOrUndefined(s)){for(var o=t.extend([],[],s.ganttProperties.predecessor,!0),l=void 0,d=0;d<o.length;d++){var p="ResourceView"===this.parent.viewType?s.ganttProperties.taskId:s.ganttProperties.rowUniqueID;if(o[d].to.toString()===p.toString()&&o[d].from.toString()===a.toString()){l=d;break}}o.splice(l,1),this.updatePredecessorValues(s,o)}}else if(n.to.toString()===a.toString()){var h=this.parent.connectorLineModule.getRecordByID(n.from.toString());if(!t.isNullOrUndefined(h)){var c=t.extend([],[],h.ganttProperties.predecessor,!0);for(l=void 0,d=0;d<c.length;d++){var u="ResourceView"===this.parent.viewType?h.ganttProperties.taskId:h.ganttProperties.rowUniqueID;if(c[d].from.toString()===u.toString()&&c[d].to.toString()===a.toString()){l=d;break}}c.splice(l,1),this.updatePredecessorValues(h,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,i){if(!this.parent.readOnly){var r="number"==typeof e?e.toString():e,n="number"==typeof i?i.toString():i,a=this.parent.ids;if(!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(n)){var s=a.indexOf(r),o=a.indexOf(n);if(-1===s||o>-1)return;var l=this.parent.flatData[s];if(l.ganttProperties.taskId=l.ganttProperties.rowUniqueID=n,l.taskData[this.parent.taskFields.id]=n,l[this.parent.taskFields.id]=n,a[s]=n,l.hasChildRecords&&this.parent.taskFields.parentID)for(var d=l.childRecords,p=0;p<d.length;p++){var h=d[p];h[this.parent.taskFields.parentID]=i,this.parent.chartRowsModule.refreshRecords([h])}if(this.parent.taskFields.dependency&&!t.isNullOrUndefined(l.ganttProperties.predecessor))for(var c=l.ganttProperties.predecessor,u=void 0,g=0;g<c.length;g++){var f=c[g];f.to===r?u=this.parent.flatData[a.indexOf(f.from)]:f.from===r&&(u=this.parent.flatData[a.indexOf(f.to)]),this.updatePredecessorOnUpdateId(u,r,n)}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;n&&n.length&&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,i){for(var r=0;r<e.length&&!this.isBreakLoop;r++)if(-1!==i.indexOf(t.getValue(this.parent.taskFields.id,e[r]).toString())){if(e[r][this.parent.taskFields.child]){var n=e[r][this.parent.taskFields.child];this.removeData(n,i)}if(i.splice(i.indexOf(t.getValue(this.parent.taskFields.id,e[r]).toString()),1),e.splice(r,1),0===i.length){this.isBreakLoop=!0;break}}else if(e[r][this.parent.taskFields.child]){n=e[r][this.parent.taskFields.child];this.removeData(n,i)}},e.prototype.initiateDeleteAction=function(e){var t=this;this.parent.showSpinner();var i={};i.requestType="beforeDelete",i.data=e.deletedRecordCollection,i.modifiedRecords=e.updatedRecordCollection,i.modifiedTaskData=D(e.updatedRecordCollection,null,null,this.parent),this.parent.trigger("actionBegin",i,function(i){if(i.cancel){for(var r=t.deletedTaskDetails,a=0;a<r.length;a++)r[a].isDelete=!1;t.deletedTaskDetails=[],t.reUpdatePreviousRecords(),t.parent.initiateEditAction(!1),t.parent.hideSpinner()}else if(v(t.parent.dataSource)){var s=t.parent.dataSource;t.parent.timezone&&w(i.modifiedTaskData,t.parent);var o={deletedRecords:D(i.data,null,null,t.parent),changedRecords:i.modifiedTaskData},l=s.adaptor,d=t.parent.query instanceof n.Query?t.parent.query:new n.Query;if(l instanceof n.WebApiAdaptor&&l instanceof n.ODataAdaptor&&!s.dataSource.batchUrl){for(var p=null,h=0;h<o.deletedRecords.length;h++)p=s.remove(t.parent.taskFields.id,o.deletedRecords[h],null,d);p.then(function(){s.update(t.parent.taskFields.id,o.changedRecords,null,d).then(function(){return t.deleteSuccess(e)}).catch(function(i){return t.dmFailure(i,e)})}).catch(function(i){return t.dmFailure(i,e)})}else{s.saveChanges(o,t.parent.taskFields.id,null,d).then(function(){return t.deleteSuccess(e)}).catch(function(i){return t.dmFailure(i,e)})}}else t.deleteSuccess(e)})},e.prototype.deleteSuccess=function(e){var i=this.parent.flatData,r=this.parent.currentViewData,n=this.parent.getRecordFromFlatdata(e.deletedRecordCollection),a=[];n.length>0&&(this.parent.selectedRowIndex=n[n.length-1].index);for(var s=0;s<n.length;s++){var o=n[s],l=r.indexOf(o),d=i.indexOf(o),p=this.parent.treeGrid.parentData.indexOf(o),h=t.getValue("dataOperation.dataArray",this.parent),c=h.indexOf(o.taskData),u=void 0;if(-1!==l&&r.splice(l,1),-1!==d&&i.splice(d,1),-1!==c&&h.splice(c,1),!t.isNullOrUndefined(o)){if(a.push(o.ganttProperties.taskId.toString()),-1!==d&&(this.parent.ids.splice(d,1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(d,1)),0===o.level&&-1!==p&&this.parent.treeGrid.parentData.splice(p,1),o.parentItem){var g=this.parent.getParentTask(o.parentItem);if(g){var f=g.childRecords;-1!==(u=f.indexOf(o))&&f.splice(u,1),f.length||this.parent.setRecordValue("hasChildRecords",!1,g)}}this.updateTreeGridUniqueID(o,"delete")}}a.length>0&&this.removeFromDataSource(a);var m={};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(),m.requestType="delete",m.data=e.deletedRecordCollection,m.modifiedRecords=e.updatedRecordCollection,m.modifiedTaskData=D(e.updatedRecordCollection,null,null,this.parent),t.setValue("action",e.action,m),this.parent.trigger("actionComplete",m),this.deletedTaskDetails=[],this.parent.initiateEditAction(!1),this.parent.hideSpinner()},e.prototype.getNewTaskId=function(){var e=n.DataUtil.aggregates.max(this.parent.flatData,this.parent.taskFields.id);return t.isNullOrUndefined(e)?1:parseInt(e.toString(),10)+1},e.prototype.prepareNewlyAddedData=function(e,i){var r,n=this.parent.taskFields,a=this.parent.ids;if(e[n.id]&&(-1!==a.indexOf(e[n.id].toString())?e[n.id]=null:e[n.id]=t.isNullOrUndefined(e[n.id])?null:parseInt(e[n.id],10)),e[n.id]||(r=this.getNewTaskId(),e[n.id]=r),this.parent.allowUnscheduledTasks||e[n.startDate]||(e[n.startDate]=this.parent.projectStartDate),!this.parent.allowUnscheduledTasks&&n.duration&&t.isNullOrUndefined(e[n.duration])&&(e[n.endDate]||(e[n.duration]="5")),n.progress&&(e[n.progress]=e[n.progress]?e[n.progress]>100?100:e[n.progress]:0),!this.parent.allowUnscheduledTasks&&!e[n.endDate]&&n.endDate&&!e[n.duration]){var s=this.parent.dataOperation.getDateFromFormat(this.parent.projectStartDate);s.setDate(s.getDate()+4),e[n.endDate]=this.parent.getFormatedDate(s,this.parent.getDateFormat())}},e.prototype.updateNewlyAddedDataBeforeAjax=function(e,i,r,n){var a=this.parent.dataOperation.createRecord(e,i);if(a.index=parseInt(a.ganttProperties.rowUniqueID.toString(),10)-1,!t.isNullOrUndefined(n)){this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(n),a);var s=a.parentItem?a.parentItem.index:null;this.parent.setRecordValue("parentIndex",s,a);var o=a.parentItem?a.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",o,a),t.isNullOrUndefined(this.parent.taskFields.id)||t.isNullOrUndefined(this.parent.taskFields.parentID)||!a.parentItem||("ProjectView"===this.parent.viewType&&this.parent.setRecordValue(this.parent.taskFields.parentID,a.parentItem.taskId,a.taskData,!0),this.parent.setRecordValue("parentId",a.parentItem.taskId,a.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.parentID,a.parentItem.taskId,a,!0))}return this.parent.isOnEdit=!0,this.backUpAndPushNewlyAddedRecord(a,r,n),this.parent.taskFields.dependency&&a.ganttProperties.predecessorsName&&(this.parent.predecessorModule.ensurePredecessorCollectionHelper(a,a.ganttProperties),this.parent.predecessorModule.updatePredecessorHelper(a),this.parent.predecessorModule.validatePredecessorDates(a)),a.parentItem&&this.parent.getParentTask(a.parentItem).ganttProperties.isAutoSchedule&&this.parent.dataOperation.updateParentItems(a.parentItem),this.parent.isOnEdit=!1,a},e.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)t++,(i=e.childRecords[r]).hasChildRecords&&(t=this.getChildCount(i,t));return t},e.prototype.getVisibleChildRecordCount=function(e,t,i){var r,n;if(e.hasChildRecords){n=(r=e.childRecords).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 i,r,n=e.ganttProperties.predecessor.length,a=e.ganttProperties,s=a.predecessor,o=0;o<n;o++)if(s[o].to===a.rowUniqueID.toString()){i=this.parent.getRecordByID(s[o].from),r=T(s[o],"from",i.ganttProperties.predecessor,"to");var l=t.extend([],i.ganttProperties.predecessor,[],!0);l.splice(r,1),this.parent.setRecordValue("predecessor",l,i.ganttProperties,!0)}else if(s[o].from===a.rowUniqueID.toString()){var d=(i=this.parent.getRecordByID(s[o].to)).ganttProperties.predecessorsName.toString().split(","),p=s[o].from+s[o].type,h=d.indexOf(p);d.splice(h,1),this.parent.setRecordValue("predecessorsName",d.join(","),i.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.dependency,d.join(","),i),r=T(s[o],"from",i.ganttProperties.predecessor,"to");var c=t.extend([],i.ganttProperties.predecessor,[],!0);c.splice(r,1),this.parent.setRecordValue("predecessor",c,i.ganttProperties,!0),this.parent.predecessorModule.validatePredecessorDates(i)}this.parent.setRecordValue("predecessor",[],e.ganttProperties,!0),this.parent.setRecordValue("predecessorsName","",e.ganttProperties,!0)},e.prototype.predecessorToString=function(e,t){for(var i=[],r=0,n=e.length;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,i,r){var n,a,s,o=this.parent.flatData,l=this.parent.currentViewData,d=this.parent.ids;switch(i){case"Top":o.splice(0,0,e),l.splice(0,0,e),d.splice(0,0,e.ganttProperties.rowUniqueID.toString());break;case"Bottom":if(o.push(e),l.push(e),d.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":a=o.indexOf(this.addRowSelectedItem),s=l.indexOf(this.addRowSelectedItem),this.recordCollectionUpdate(void 0,a,s,e,r,i);break;case"Below":if(n=o.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){a=n+this.getChildCount(this.addRowSelectedItem,0)+1,s=l.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,l)+1}else a=n+1,s=l.indexOf(this.addRowSelectedItem)+1;this.recordCollectionUpdate(NaN,a,s,e,r,i);break;case"Child":if(n=o.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){a=n+this.getChildCount(this.addRowSelectedItem,0)+1,this.addRowSelectedItem.expanded||this.parent.enableMultiTaskbar||this.parent.expandByID(Number(this.addRowSelectedItem.ganttProperties.rowUniqueID)),s=l.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,l)+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),a=n+1,s=l.indexOf(this.addRowSelectedItem)+1,this.addRowSelectedItem.ganttProperties.predecessor&&this.updatePredecessorOnIndentOutdent(this.addRowSelectedItem),t.isNullOrUndefined(this.addRowSelectedItem.ganttProperties.segments)||(this.addRowSelectedItem.ganttProperties.segments=null);this.recordCollectionUpdate(NaN,a,s,e,r,i)}this.newlyAddedRecordBackup=e},e.prototype.recordCollectionUpdate=function(e,i,r,a,s,o){var l=this.parent.flatData,d=this.parent.currentViewData,p=this.parent.ids;if(l.splice(i,0,a),d.splice(r,0,a),p.splice(i,0,a.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var h=0===a.level?"R"+a.ganttProperties.taskId:"T"+a.ganttProperties.taskId;this.parent.getTaskIds().splice(i,0,h)}if(!t.isNullOrUndefined(s)&&(e="Above"==o?s.childRecords.indexOf(this.addRowSelectedItem):"Below"==o?s.childRecords.indexOf(this.addRowSelectedItem)+1:s.childRecords.length,s.childRecords.splice(e,0,a),this.parent.dataSource instanceof n.DataManager&&t.isNullOrUndefined(s.taskData[this.parent.taskFields.parentID])||!t.isNullOrUndefined(this.parent.dataSource))){var c=this.parent.taskFields.child;s.taskData[c]&&s.taskData[c].length>0?"Above"===o||"Below"===o?s.taskData[c].splice(e,0,a.taskData):s.taskData[c].push(a.taskData):(s.taskData[c]=[],s.taskData[c].push(a.taskData))}},e.prototype.constructTaskAddedEventArgs=function(e,t,i){var r={};if(r.action=r.requestType=i,e.length>1){r.data=[],r.newTaskData=[],r.recordIndex=[];for(var n=0;n<e.length;n++)r.data[n]=e[n],r.newTaskData[n]=D([e[n]],r.data[n],r,this.parent),r.recordIndex[n]=e[n].index}else if(1===e.length)for(n=0;n<e.length;n++)r.data=e[n],r.newTaskData=D([e[n]],r.data,r,this.parent),r.recordIndex=e[n].index;return r.modifiedRecords=t,r.modifiedTaskData=D(t,null,null,this.parent),r},e.prototype.addSuccess=function(e){this.parent.treeGrid.parentData=[],this.parent.addDeleteRecord=!0,this.parent.selectedRowIndex=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,i){if(!i&&!t.isNullOrUndefined(e))for(var r=e[0].index+1;r<this.parent.currentViewData.length&&e[0].level<this.parent.currentViewData[r].level;r++)this.parent.modifiedRecords.push(this.parent.currentViewData[r]);var n,a=function(e){var t=s.parent.modifiedRecords[e],i=s.parent.allowRowDragAndDrop?1:0,r=s.parent.taskFields.id;n=s.parent.currentViewData.findIndex(function(e){return e[r]==t[r]}),s.parent.treeGrid.getRows()[n]&&(s.parent.treeGrid.renderModule.cellRender({data:t,cell:s.parent.treeGrid.getRows()[n].cells[s.parent.treeColumnIndex+i],column:s.parent.treeGrid.grid.getColumns()[s.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),s.parent.treeGrid.renderModule.RowModifier({data:t,row:s.parent.treeGrid.getRows()[n],rowHeight:s.parent.rowHeight}))},s=this;for(r=0;r<this.parent.modifiedRecords.length;r++)a(r)},e.prototype.updateRealDataSource=function(e,i){var r=this.parent.taskFields,a=m(this.parent)?t.getValue("result",this.parent.dataSource):this.parent.dataSource;this.parent.dataSource instanceof n.DataManager&&(a=this.parent.dataSource.dataSource.json);for(var s=0;s<e.length;s++)(t.isNullOrUndefined(i)||t.isNullOrUndefined(this.addRowSelectedItem))&&(i="Bottom"===i?"Bottom":"Top"),"Top"===i?a.splice(0,0,e[s].taskData):"Bottom"===i?a.push(e[s].taskData):t.isNullOrUndefined(r.id)||t.isNullOrUndefined(r.parentID)?this.addDataInRealDataSource(a,e[s].taskData,i):a.push(e[s].taskData),this.isBreakLoop=!1},e.prototype.addDataInRealDataSource=function(e,i,r){for(var n=0;n<e.length;n++){var a=this.parent.taskFields.child;if(this.isBreakLoop)break;if(t.getValue(this.parent.taskFields.id,e[n]).toString()===this.addRowSelectedItem.ganttProperties.rowUniqueID.toString()){"Above"===r?e.splice(n,0,i):"Below"===r?e.splice(n+1,0,i):"Child"===r&&(e[n][a]&&e[n][a].length>0?e[n][a].push(i):(e[n][a]=[],e[n][a].push(i))),this.isBreakLoop=!0;break}if(e[n][a]){var s=e[n][a];this.addDataInRealDataSource(s,i,r)}}},e.prototype.addRecord=function(e,i,r){var a=this;if(this.parent.editModule&&this.parent.editSettings.allowAdding){this.parent.isDynamicData=!0;var s=[];if(t.isNullOrUndefined(e))this.validateTaskPosition(e,i,r,s);else if(e instanceof Array)for(var o=0;o<e.length;o++)this.validateTaskPosition(e[o],i,r,s);else{if("object"!=typeof e)return;this.validateTaskPosition(e,i,r,s)}var l={};l=this.constructTaskAddedEventArgs(s,this.parent.editedRecords,"beforeAdd"),this.parent.showSpinner(),this.parent.trigger("actionBegin",l,function(e){if(e.cancel)e=e,a.removeAddedRecord(),a.reUpdatePreviousRecords(),a._resetProperties();else if(v(a.parent.dataSource)){var r=a.parent.dataSource,o={addedRecords:[e.newTaskData],changedRecords:e.modifiedTaskData},l=e.data.ganttProperties.taskId.toString(),d=a.parent.query instanceof n.Query?a.parent.query:new n.Query,p=r.adaptor;if(p instanceof n.WebApiAdaptor&&p instanceof n.ODataAdaptor&&!r.dataSource.batchUrl){r.insert(o.addedRecords,null,d).then(function(i){var n;n=t.isNullOrUndefined(i[0])?o.addedRecords[0]:i[0];r.update(a.parent.taskFields.id,o.changedRecords,null,d).then(function(){if(a.parent.taskFields.id&&!t.isNullOrUndefined(n[a.parent.taskFields.id])&&n[a.parent.taskFields.id].toString()!==l){a.parent.setRecordValue("taskId",n[a.parent.taskFields.id],e.data.ganttProperties,!0),a.parent.setRecordValue("taskData."+a.parent.taskFields.id,n[a.parent.taskFields.id],e.data),a.parent.setRecordValue(a.parent.taskFields.id,n[a.parent.taskFields.id],e.data),a.parent.setRecordValue("rowUniqueID",n[a.parent.taskFields.id].toString(),e.data.ganttProperties,!0);var i=a.parent.ids.indexOf(l);-1!==i&&(a.parent.ids[i]=n[a.parent.taskFields.id].toString())}a.updateNewRecord(s,e)}).catch(function(t){a.removeAddedRecord(),a.dmFailure(t,e),a._resetProperties()})}).catch(function(t){a.removeAddedRecord(),a.dmFailure(t,e),a._resetProperties()})}else{r.saveChanges(o,a.parent.taskFields.id,null,d).then(function(i){if(a.parent.taskFields.id&&!t.isNullOrUndefined(i.addedRecords[0][a.parent.taskFields.id])&&i.addedRecords[0][a.parent.taskFields.id].toString()!==l){a.parent.setRecordValue("taskId",i.addedRecords[0][a.parent.taskFields.id],e.data.ganttProperties,!0),a.parent.setRecordValue("taskData."+a.parent.taskFields.id,i.addedRecords[0][a.parent.taskFields.id],e.data),a.parent.setRecordValue(a.parent.taskFields.id,i.addedRecords[0][a.parent.taskFields.id],e.data),a.parent.setRecordValue("rowUniqueID",i.addedRecords[0][a.parent.taskFields.id].toString(),e.data.ganttProperties,!0);var r=a.parent.ids.indexOf(l);-1!==r&&(a.parent.ids[r]=i.addedRecords[0][a.parent.taskFields.id].toString())}a.updateNewRecord(s,e)}).catch(function(t){a.removeAddedRecord(),a.dmFailure(t,e),a._resetProperties()})}}else{if("ProjectView"===a.parent.viewType){if("Top"===i||"Bottom"===i||("Above"===i||"Below"===i||"Child"===i)&&!e.data.parentItem)if(e.data instanceof Array)a.updateRealDataSource(e.data,i);else{var h=[];h.push(e.data),a.updateRealDataSource(h,i)}}else{(m(a.parent)?t.getValue("result",a.parent.dataSource):a.parent.dataSource).push(e.data.taskData)}0===s.level&&a.parent.treeGrid.parentData.splice(0,0,s),a.updateTreeGridUniqueID(s,"add"),a.refreshNewlyAddedRecord(e,s),a._resetProperties()}})}},e.prototype.createNewRecord=function(){for(var e={},i=this.parent.ganttColumns,r=this.parent.taskFields,n=this.parent.editModule.getNewTaskId(),a=0;a<i.length;a++){var s=i[a].field;s===r.id?e[s]=n:i[a].field===r.startDate?(t.isNullOrUndefined(e[r.endDate])?e[s]=this.parent.editModule.dialogModule.getMinimumStartDate():e[s]=new Date(e[r.endDate]),this.parent.timezone&&(e[s]=this.parent.dateValidationModule.remove(e[s],this.parent.timezone))):i[a].field===r.endDate?(t.isNullOrUndefined(e[r.startDate])?e[s]=this.parent.editModule.dialogModule.getMinimumStartDate():e[s]=new Date(e[r.startDate]),this.parent.timezone&&(e[s]=this.parent.dateValidationModule.remove(e[s],this.parent.timezone))):i[a].field===r.duration?e[s]=1:i[a].field===r.name?e[s]=this.parent.editModule.dialogModule.localeObj.getConstant("addDialogTitle")+" "+n:i[a].field===r.progress?e[s]=0:i[a].field===r.work?e[s]=0:"taskType"===i[a].field?e[s]=this.parent.taskType:e[this.parent.ganttColumns[a].field]=""}return e},e.prototype.validateTaskPosition=function(e,i,r,n){var a=t.isNullOrUndefined(r)||isNaN(parseInt(r.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:r;this.addRowSelectedItem=t.isNullOrUndefined(a)?null:this.parent.updatedRecords[a],i=t.isNullOrUndefined(i)?this.parent.editSettings.newRowPosition:i,e=t.isNullOrUndefined(e)?this.createNewRecord():e,((t.isNullOrUndefined(a)||a<0||t.isNullOrUndefined(this.addRowSelectedItem))&&("Above"===i||"Below"===i||"Child"===i)||!i||"Above"!==i&&"Below"!==i&&"Child"!==i&&"Top"!==i&&"Bottom"!==i)&&(i="Top");var s,o=0;switch(i){case"Top":case"Bottom":o="ResourceView"===this.parent.viewType?1:0;break;case"Above":case"Below":o=this.addRowSelectedItem.level,s=this.parent.getParentTask(this.addRowSelectedItem.parentItem);break;case"Child":o=this.addRowSelectedItem.level+1,s=this.addRowSelectedItem}this.prepareNewlyAddedData(e,i);var l=this.updateNewlyAddedDataBeforeAjax(e,o,i,s);n.push(l)},e.prototype.updateNewRecord=function(e,i){if(0===e.level){this.parent.treeGrid.parentData.splice(0,0,e);t.getValue("dataOperation.dataArray",this.parent).splice(0,0,e.taskData)}this.updateTreeGridUniqueID(e,"add"),this.refreshNewlyAddedRecord(i,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,i){"add"===i?t.setValue("uniqueIDCollection."+e.uniqueID,e,this.parent.treeGrid):"delete"===i&&t.deleteObject(t.getValue("uniqueIDCollection",this.parent.treeGrid),e.uniqueID)},e.prototype.refreshNewlyAddedRecord=function(e,i){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 r=[];e.modifiedRecords.length>0?(r=e.data.length>0?e.data:[e.data]).push.apply(r,e.modifiedRecords):r=e.data.length>0?e.data:[e.data],this.parent.timelineModule.updateTimeLineOnEditing([r],e.action)}if(this.addSuccess(e),e=this.constructTaskAddedEventArgs(i,e.modifiedRecords,"add"),this.dialogModule.isAddNewResource&&!this.parent.isEdit&&this.parent.taskFields.work&&this.parent.dataOperation.updateWorkWithDuration(i[0]),this.parent.trigger("actionComplete",e),this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose(),"ResourceView"===this.parent.viewType)if(i.length>1)for(var n=0;n<i.length;n++){if(e.data[n].ganttProperties.sharedTaskUniqueIds.push(e.data[n].ganttProperties.rowUniqueID),e.data[n].ganttProperties.resourceInfo){(s=t.extend([],[],e.data[n].ganttProperties.resourceInfo,!0)).splice(0,1),this.updateResoures([],s,e.data[n])}else this.removeChildRecord(e.data[n]),this.parent.editModule.checkWithUnassignedTask(e.data[n]);for(var a=0;a<this.updateParentRecords.length;a++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[a]);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;(s=t.extend([],[],e.data.ganttProperties.resourceInfo,!0)).splice(0,1),this.updateResoures([],s,e.data)}}else this.removeChildRecord(e.data),this.parent.editModule.checkWithUnassignedTask(e.data);for(a=0;a<this.updateParentRecords.length;a++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[a]);this.updateParentRecords=[]}},e.prototype.removeAddedRecord=function(){var e=this.parent.flatData,i=this.parent.currentViewData,r=this.parent.ids,n=e.indexOf(this.newlyAddedRecordBackup),a=i.indexOf(this.newlyAddedRecordBackup),s=r.indexOf(this.newlyAddedRecordBackup.ganttProperties.rowUniqueID.toString());if(t.deleteObject(this.parent.previousRecords,e[n].uniqueID),this.newlyAddedRecordBackup.parentItem){var o=this.parent.getParentTask(this.newlyAddedRecordBackup.parentItem),l=o.childRecords.indexOf(this.newlyAddedRecordBackup);o.childRecords.splice(l,1)}e.splice(n,1),i.splice(a,1),r.splice(s,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,i){var r=this;e[0],"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var n=void 0,a=[],s=0;s<e.length;s++)a[s]=this.parent.updatedRecords[e[s]];var o={data:a,dropIndex:t,dropPosition:this.dropPosition};"middleSegment"===this.dropPosition?n="indenting":"bottomSegment"===this.dropPosition&&(n="outdenting");var l={action:n,data:a[0],cancel:!1};this.parent.trigger("actionBegin",l,function(e){e.cancel||r.reArrangeRows(o,!0)})},e.prototype.reArrangeRows=function(e,i){if(this.dropPosition=e.dropPosition,"Invalid"!==e.dropPosition&&this.parent.editModule){var r=this.parent,n=void 0;this.droppedRecord=r.updatedRecords[e.dropIndex];var a=[],s=this.droppedRecord;e.data[0]?a=e.data:a.push(e.data);for(var o=0,l=a.length,d=0;d<l;d++){if(this.parent.isOnEdit=!0,n=a[d],this.draggedRecord=n,"Invalid"!==this.dropPosition){i&&this.deleteDragRow();var p=this.treeGridData.indexOf(s);if("bottomSegment"===this.dropPosition){if(s.hasChildRecords){o=this.parent.editModule.getChildCount(s,0),this.parent.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(p+o+1,0,this.draggedRecord.taskData),this.treeGridData.splice(p+o+1,0,this.draggedRecord),this.parent.ids.splice(p+o+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString());var h=this.parent.ids.indexOf(this.draggedRecord[this.parent.taskFields.id].toString());h!==p+o+1&&(this.parent.ids.splice(h,1),this.parent.ids.splice(p+o+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,n),this.parent.setRecordValue("parentUniqueID",this.treeGridData[p].parentUniqueID,n),this.parent.setRecordValue("level",this.treeGridData[p].level,n),n.hasChildRecords){this.updateChildRecordLevel(n,1),this.updateChildRecord(n,p+o+1)}if(s.parentItem){var c=this.parent.getParentTask(s.parentItem).childRecords,u=c.indexOf(s)+1;c.splice(u,0,n)}}"middleSegment"===this.dropPosition&&this.dropMiddle(p),t.isNullOrUndefined(n.parentItem&&-1!==this.updateParentRecords.indexOf(n.parentItem))||this.updateParentRecords.push(n.parentItem)}if(t.isNullOrUndefined(n.parentItem)){var g=this.parent.treeGrid.parentData,f=g.indexOf(this.droppedRecord);"bottomSegment"===this.dropPosition&&g.splice(f+1,0,n)}this.refreshDataSource()}"middleSegment"===this.dropPosition&&(s.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(s),s.ganttProperties.predecessor=null,s.ganttProperties.predecessorsName=null,s[this.parent.taskFields.dependency]=null,s.taskData[this.parent.taskFields.dependency]=null),s.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,s.ganttProperties,!0),t.isNullOrUndefined(s.taskData[this.parent.taskFields.milestone])||!0===s.taskData[this.parent.taskFields.milestone]&&(s.taskData[this.parent.taskFields.milestone]=!1)));for(var m=0;m<this.updateParentRecords.length;m++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[m]);this.updateParentRecords=[],this.parent.isOnEdit=!1}this.refreshRecord(e)},e.prototype.refreshRecord=function(e,t){var i=this;if(v(this.parent.dataSource)){var r=this.parent.dataSource,a={changedRecords:D(this.parent.editedRecords,null,null,this.parent)},s=this.parent.query instanceof n.Query?this.parent.query:new n.Query,o=null,l=r.adaptor;if(l instanceof n.WebApiAdaptor&&l instanceof n.ODataAdaptor&&!r.dataSource.batchUrl){o=r.update(this.parent.taskFields.id,a.changedRecords,null,s)}else o=r.saveChanges(a,this.parent.taskFields.id,null,s);o.then(function(r){return i.indentSuccess(r,e,t)}).catch(function(e){return i.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 i=0;i<e.modifiedRecords.length;i++)w(e.modifiedRecords[i],this.parent);this.parent.trigger("actionComplete",e),this.parent.editedRecords=[]},e.prototype.refreshDataSource=function(){var e,i,r=this.draggedRecord,a=this.droppedRecord,s=this.parent;if((e=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):s.dataSource).length>0&&!t.isNullOrUndefined(a)&&!a.parentItem){for(var o=0;o<Object.keys(e).length;o++)e[o][this.parent.taskFields.child]===a.taskData[this.parent.taskFields.child]&&(i=o);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(i,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(i+1,0,r.taskData))}else if(!this.parent.taskFields.parentID&&!t.isNullOrUndefined(a)&&a.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var l="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=a,this.parent.editModule.updateRealDataSource(r,l),delete this.parent.editModule.addRowSelectedItem}this.parent.taskFields.parentID&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID],r.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID],r.ganttProperties.parentId=a[this.parent.taskFields.parentID]):(r[this.parent.taskFields.parentID]=a[this.parent.taskFields.id],r.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.id],r.ganttProperties.parentId=a[this.parent.taskFields.id]):(r[this.parent.taskFields.parentID]=null,r.taskData[this.parent.taskFields.parentID]=null,r.ganttProperties.parentId=null))},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof n.DataManager?this.ganttData=t.getValue("dataOperation.dataArray",this.parent):this.ganttData=m(this.parent)?t.getValue("result",this.parent.dataSource):this.parent.dataSource,this.treeGridData=m(this.parent)?t.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 i=this.parent,r=this.parent.editModule.getChildCount(this.droppedRecord,0),n=t.isNullOrUndefined(r)||0===r?e+1:r+e+1;if("middleSegment"===this.dropPosition){if(i.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(n,0,this.draggedRecord.taskData),this.treeGridData.splice(n,0,this.draggedRecord),this.parent.ids.splice(n,0,this.draggedRecord[this.parent.taskFields.id].toString()),this.recordLevel(),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,n,this.droppedRecord.expanded),this.parent.enableImmutableMode)){var a=this.draggedRecord;this.updateIndentedChildRecords(a)}t.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 i,r=this.parent;i=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource;var a=e,s=this.parent.getParentTask(a.parentItem);if(a){if(a.parentItem){var o=s?s.childRecords:[],l=0;o&&o.length>0&&(l=o.indexOf(a),s.childRecords.splice(l,1),this.parent.taskFields.parentID||s.taskData[this.parent.taskFields.child].splice(l,1),this.updateParentRecords.push(s))}if(r.taskFields.parentID){a.hasChildRecords&&a.childRecords.length>0&&this.removeChildItem(a);for(var d=void 0,p=i.length>0?i:this.parent.currentViewData,h=0;h<p.length;h++)p[h][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(d=h);if(-1!==d){i.length>0&&i.splice(d,1);var c=void 0;for(h=0;h<this.treeGridData.length;h++)this.treeGridData[h][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(c=h);this.treeGridData.splice(c,1),this.parent.ids.splice(c,1),-1!==this.parent.treeGrid.parentData.indexOf(a)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(a),1)}}var u=this.treeGridData.indexOf(a);if(!r.taskFields.parentID){var g=this.getChildCount(a,0);this.treeGridData.splice(u,g+1),this.parent.ids.splice(u,g+1);var f=this.ganttData.indexOf(a.taskData);-1!==f&&(this.ganttData.splice(f,1),this.parent.treeGrid.parentData.splice(f,1))}a.parentItem&&s&&s.childRecords&&!s.childRecords.length&&(this.parent.setRecordValue("expanded",!1,s),this.parent.setRecordValue("hasChildRecords",!1,s))}},e.prototype.removeChildItem=function(e){for(var i,r,a=0;a<e.childRecords.length;a++){i=e.childRecords[a];var s=void 0;s=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource;for(var o=0;o<s.length;o++)s[o][this.parent.taskFields.id]===i.taskData[this.parent.taskFields.id]&&(r=o);if(-1!==r){s.length>0&&s.splice(r,1);for(var l=void 0,d=0;d<this.treeGridData.length;d++)this.treeGridData[d][this.parent.taskFields.id]===i.taskData[this.parent.taskFields.id]&&(l=d);this.treeGridData.splice(l,1),this.parent.ids.splice(l,1)}i.hasChildRecords&&this.removeChildItem(i)}},e.prototype.recordLevel=function(){var e=this.parent,i=this.draggedRecord,r=this.droppedRecord,n=e.taskFields.child;if(r.hasChildRecords||(r.hasChildRecords=!0,r.childRecords.length||(r.childRecords=[],!e.taskFields.parentID&&t.isNullOrUndefined(r.taskData[n])&&(r.taskData[n]=[]))),"middleSegment"===this.dropPosition){var a=t.extend({},r);delete a.childRecords;var s={uniqueID:a.uniqueID,expanded:a.expanded,level:a.level,index:a.index,taskId:a.ganttProperties.rowUniqueID};if(this.parent.setRecordValue("parentItem",s,i),this.parent.setRecordValue("parentUniqueID",r.uniqueID,i),r.childRecords.splice(r.childRecords.length,0,i),t.isNullOrUndefined(i)||e.taskFields.parentID||t.isNullOrUndefined(r.taskData[n])||r.taskData[e.taskFields.child].splice(r.childRecords.length,0,i.taskData),!t.isNullOrUndefined(r.ganttProperties.segments)&&r.ganttProperties.segments.length>0&&(r.ganttProperties.segments=null,r.taskData[e.taskFields.segments]=null),i.hasChildRecords){i.level=r.level+1,this.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e}(),ui=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.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}(),gi=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.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}(),fi=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.Filter),this.parent.treeGrid.allowFiltering=this.parent.allowFiltering,this.updateCustomFilters(),this.parent.treeGrid.filterSettings=r.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.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&&!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.getDatePickerFilter=function(e){var i,n=this,a=this.parent,s=e===a.taskFields.startDate||e===a.taskFields.baselineStartDate?a.defaultStartTime:a.defaultEndTime;return{create:function(e){var a=r.getCustomDateFormat(e.column.format,e.column.type),s=t.createElement("input",{className:"flm-input"});e.target.appendChild(s),(i=new h.DatePicker({placeholder:n.parent.localeObj.getConstant("enterValue"),format:a})).appendTo(s)},write:function(e){i.value=e.filteredValue},read:function(e){i.value&&i.value.setSeconds(s),e.fltrObj.filterByColumn(e.column.field,e.operator,i.value)}}},e.prototype.getDateTimePickerFilter=function(){var e,i=this;return{create:function(n){var a=r.getCustomDateFormat(n.column.format,n.column.type),s=t.createElement("input",{className:"flm-input"});n.target.appendChild(s),(e=new h.DateTimePicker({placeholder:i.parent.localeObj.getConstant("enterValue"),format:a})).appendTo(s)},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,i=this,r=this.parent,n="";return{create:function(r){var n=t.createElement("input",{className:"e-input"});n.setAttribute("placeholder",i.parent.localeObj.getConstant("enterValue")),r.target.appendChild(n),(e=new d.TextBox).appendTo(n)},write:function(t){e.value=t.filteredValue?n:""},read:function(a){var s=i.parent.dataOperation.getDurationValue(e.value),o=t.getValue("duration",s),l=t.getValue("durationUnit",s);if(o>=0){var d=void 0;"minute"===l?d=60*o/r.secondsPerDay:"hour"===l?d=60*o*60/r.secondsPerDay:(d=o,l="day"),a.fltrObj.filterByColumn(a.column.field,a.operator,d),n=i.parent.dataOperation.getDurationString(o,l)}else a.fltrObj.filterByColumn(a.column.field,a.operator,null),n=null}}},e.prototype.columnMenuOpen=function(e){this.filterMenuElement&&document.body.contains(this.filterMenuElement)&&t.remove(this.filterMenuElement),this.filterMenuElement=null},e.prototype.actionBegin=function(e){},e.prototype.closeFilterOnContextClick=function(e){var i=document.querySelector("body > div.e-datepicker"),r=document.querySelector("body > div.e-datetimepicker");if(this.filterMenuElement&&document.body.contains(this.filterMenuElement)){var n=t.closest(e,"#"+this.parent.element.id)||e.querySelector("#"+this.parent.element.id);(!this.filterMenuElement.contains(e)&&!t.isNullOrUndefined(n)||!this.filterMenuElement.contains(e)&&t.isNullOrUndefined(i)&&t.isNullOrUndefined(r)&&("DIV"===e.nodeName||"HTML"===e.nodeName||"SPAN"===e.nodeName||"BUTTON"===e.nodeName))&&(t.remove(this.filterMenuElement),this.parent.treeGrid.grid.notify("filter-menu-close",{isOpen:!1}),this.filterMenuElement=null)}},e.prototype.actionComplete=function(e){if(e.requestType===r.filterAfterOpen){"Menu"===this.parent.treeGrid.filterSettings.type?this.filterMenuElement=t.getValue("filterModel.dlgObj.element",e):this.filterMenuElement=t.getValue("filterModel.dialogObj.element",e),this.updateFilterMenuPosition(this.filterMenuElement,e);var i=this.parent.taskFields.id,n=this.parent.taskFields.dependency,a=this.parent.taskFields.resourceInfo,s=this.parent.treeGrid.grid.filterModule,o=t.getValue("values",s);if(e.columnName===n&&t.isNullOrUndefined(t.getValue(n,o))||e.columnName===a&&t.isNullOrUndefined(t.getValue(a,o))){var l=this.filterMenuElement.querySelector(".e-dropdownlist");(d=t.getValue("ej2_instances[0]",l)).index=2,d.dataBind()}else if(e.columnName===i&&t.isNullOrUndefined(t.getValue(i,o))&&"Menu"===this.parent.treeGrid.filterSettings.type){l=this.filterMenuElement.querySelector(".e-numerictextbox");var d=t.getValue("ej2_instances[0]",l);!t.isNullOrUndefined(d)&&t.isNullOrUndefined(this.parent.columnByField[e.columnName].format)&&(d.format="n")}}},e.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),r=e.getBoundingClientRect(),n=r.right+window.scrollX,a=r.top+window.scrollY;i.right<n+t.offsetWidth&&(r.left-t.offsetWidth>i.left?n=r.left-t.offsetWidth:n-=n+t.offsetWidth-i.right),t.style.top=a+"px",t.style.left=n+"px"},e.prototype.updateFilterMenuPosition=function(e,i){t.addClass([e],"e-gantt"),document.querySelector("#"+this.parent.controlId).appendChild(e);var n;this.parent.showColumnMenu?(n=document.querySelector("#treeGrid"+this.parent.controlId+"_gridcontrol_colmenu_Filter"),e.style.zIndex=n.parentElement.style.zIndex,"Menu"===this.parent.treeGrid.filterSettings.type?this.setPosition(n,t.getValue("filterModel.dlgObj.element",i)):this.setPosition(n,t.getValue("filterModel.dialogObj.element",i))):(n=this.parent.treeGrid.grid.getColumnHeaderByField(i.columnName).querySelector(".e-filtermenudiv"),"Menu"===this.parent.treeGrid.filterSettings.type?r.getFilterMenuPostion(n,t.getValue("filterModel.dlgObj",i)):r.getFilterMenuPostion(n,t.getValue("filterModel.dialogObj",i))),"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()},e}(),mi=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.Sort),this.parent.treeGrid.allowSorting=this.parent.allowSorting,this.parent.treeGrid.sortSettings=r.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}(),yi=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=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){this.parent.isGanttChartRendered?(e.isCtrlPressed=this.isMultiCtrlRequest,e.isShiftPressed=this.isMultiShiftRequest,e.target=this.actualTarget,t.isNullOrUndefined(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.parent.trigger("rowSelecting",e)):e.cancel=!0},e.prototype.rowSelected=function(e){var i="Multiple"!==this.parent.selectionSettings.type||t.isNullOrUndefined(e.rowIndexes)?[e.rowIndex]:e.rowIndexes;this.addRemoveClass(i),this.selectedRowIndexes=t.extend([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:this.parent.treeGrid.grid.selectedRowIndex},!0),this.isMultiShiftRequest&&(this.selectedRowIndexes=i),this.parent.autoFocusTasks&&this.parent.ganttChartModule.updateScrollLeft(t.getValue("data.ganttProperties.left",e)),e.target=this.actualTarget,t.isNullOrUndefined(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.prevRowIndex=e.rowIndex,t.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 i,r;if(0!==this.multipleIndexes.length)i=this.multipleIndexes;else if(t.isNullOrUndefined(e.rowIndexes))i=[e.rowIndex];else{for(var n=0;n<e.rowIndexes.length;n++)e.rowIndexes[n]===e.rowIndex&&(r=!0);i=r?e.rowIndexes:[e.rowIndex]}this.addRemoveClass(i),this.selectedRowIndexes=t.extend([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:-1},!0),1===this.selectedRowIndexes.length&&this.parent.setProperties({selectedRowIndex:this.selectedRowIndexes[0]},!0),t.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 n.Deferred;return this.parent.trigger("cellSelecting",e,function(e){t.resolve(e)}),t},e.prototype.cellSelected=function(e){this.parent.trigger("cellSelected",e),t.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),t.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,i,r){var n,a=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children).filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e})[0];-1===e||t.isNullOrUndefined(a)||"Cell"===this.parent.selectionSettings.mode||(this.parent.showActiveElement&&!r?this.parent.treeGrid.grid.selectionModule.preventFocus=!0:this.parent.treeGrid.grid.selectionModule.preventFocus=!1,t.isNullOrUndefined(this.selectedClass)||this.selectedClass!==a||i||(n=!0),!0!==n&&this.parent.treeGrid.selectRow(e,i),this.parent.treeGrid.grid.selectionModule.preventFocus=!0!==this.parent.treeGrid.grid.selectionModule.preventFocus&&this.parent.treeGrid.grid.selectionModule.preventFocus,this.prevRowIndex=e,this.selectedClass=a)},e.prototype.selectRows=function(e){!t.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(){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,t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.isInteracted=!1},e.prototype.highlightSelectedRows=function(e,i){if(this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch,this.isMultiShiftRequest=e.shiftKey,this.actualTarget=e.target,this.isInteracted=!0,this.isSelectionFromChart=i,i){var r=t.closest(e.target,"tr.e-chart-row"),n=parseInt(r.getAttribute("aria-rowindex"),10),a=this.parent.selectionSettings.enableToggle;if("Single"===this.parent.selectionSettings.type||!this.isMultiCtrlRequest&&!this.isMultiShiftRequest)this.selectRow(n,a);else if(this.isMultiShiftRequest)this.selectRowsByRange(t.isNullOrUndefined(this.prevRowIndex)?n:this.prevRowIndex,n);else{t.setValue("isMultiCtrlRequest",!0,this.parent.treeGrid.grid.selectionModule),this.parent.treeGrid.grid.selectionModule.addRowsToSelection([n]);this.selectedRowIndexes.indexOf(n)>-1&&this.addRemoveClass([n])}}},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){for(var i=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),r=function(r){var a=i.filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e[r]})[0];t.isNullOrUndefined(a)||(n.getSelectedRowIndexes().indexOf(e[r])>-1?n.addClass(a):n.removeClass(a))},n=this,a=0;a<e.length;a++)r(a)},e.prototype.addClass=function(e){t.addClass([e],"e-active"),e.setAttribute("aria-selected","true")},e.prototype.removeClass=function(e){t.removeClass([e],"e-active"),e.removeAttribute("aria-selected")},e.prototype.showPopup=function(e){this.isSelectionFromChart?(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 i=e.target,r=this.parent.treeGrid.grid,n=t.closest(i,".e-ganttpopup")?t.closest(i,".e-ganttpopup"):t.closest(i,".e-gridpopup");if(n){var a=n.querySelector(".e-rowselect");t.closest(i,".e-ganttpopup")&&!a.classList.contains("e-spanclicked")?(this.enableSelectMultiTouch=!0,a.classList.add("e-spanclicked")):t.closest(i,".e-gridpopup")&&a.classList.contains("e-spanclicked")?(this.openPopup=!0,this.enableSelectMultiTouch=!0):(this.hidePopUp(),this.enableSelectMultiTouch=!1,t.closest(i,".e-ganttpopup")&&a.classList.remove("e-spanclicked"))}else if("Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive){t.closest(i,".e-rowcell")&&0===this.selectedRowIndexes.length&&this.hidePopUp()}r&&t.setValue("enableSelectMultiTouch",this.enableSelectMultiTouch,r.selectionModule)},e.prototype.mouseUpHandler=function(e){var i=!1,n=null;if(e.target.closest(".e-rowcell")?n=e.target:e.target.closest(".e-chart-row")&&(n=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(n),this.parent.editModule&&this.parent.editSettings.allowTaskbarEditing&&this.parent.editModule.taskbarEditModule){var a=this.parent.editModule.taskbarEditModule;(a.isMouseDragged||a.tapPointOnFocus)&&(i=!0)}if(!i&&this.parent.element.contains(e.target)){var s=r.parentsUntil(e.target,"e-chart-row"),o=e.target.classList.contains("e-rowcell")||e.target.classList.contains("e-row")||e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||!t.isNullOrUndefined(s);this.popUpClickHandler(e),"Cell"!==this.parent.selectionSettings.mode&&o?(t.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}(),vi=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=t.createElement("div",{id:this.parent.controlId+"_Gantt_Toolbar",className:"e-gantt-toolbar"}),this.parent.treeGrid.grid.headerModule?this.parent.element.insertBefore(this.element,this.parent.treeGridPane.offsetParent):this.parent.element.appendChild(this.element);for(var e=0,i=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath"];e<i.length;e++){var r=i[e],n=void 0,a=void 0;"CriticalPath"===r?(n="critical-path",a="criticalPath"):(n=r.toLowerCase(),a=r[0].toLowerCase()+r.slice(1)),this.predefinedItems[r]={id:this.parent.element.id+"_"+n,prefixIcon:"e-"+n,text:this.parent.isAdaptive?"":this.parent.localeObj.getConstant(a),tooltipText:this.parent.localeObj.getConstant(a)+("add"===a||"edit"===a||"delete"===a?this.parent.localeObj.getConstant("task"):"expandAll"===a||"collapseAll"===a?this.parent.localeObj.getConstant("tasks"):""),align:this.parent.isAdaptive?"Right":"Left"}}var s=this.parent.localeObj.getConstant("search");this.parent.isAdaptive?this.predefinedItems.Search={id:this.id+"_searchbutton",prefixIcon:"e-search-icon",tooltipText:s,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= "'+s+'"/><span id="'+this.id+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"tabindex="-1" title="'+s+'" aria-label= "search"></span></div>',tooltipText:s,align:"Right",cssClass:"e-search-wrapper"},this.createToolbar()}},e.prototype.createToolbar=function(){var e=this.getItems();this.toolbar=new o.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),height:this.parent.isAdaptive?48:"auto"}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.element);var i=this.element.querySelector("#"+this.parent.element.id+"_cancel"),r=this.element.querySelector("#"+this.parent.element.id+"_update");if(i&&t.addClass([i],"e-grid"),r&&t.addClass([r],"e-grid"),this.parent.isAdaptive){this.element.insertBefore(this.getSearchBarElement(),this.element.childNodes[0]),this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar");new d.TextBox({placeholder:this.parent.localeObj.getConstant("search"),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,i=t.createElement("div",{className:"e-adaptive-searchbar",styles:"display: none"}),r=t.createElement("input",{attrs:{type:"text"},id:this.parent.element.id+"_searchbar"}),n=t.createElement("span",{className:"e-backarrowspan e-icons"});return n.onclick=function(){i.style.display="none",e.element.childNodes[1].style.display="block"},i.appendChild(n),i.appendChild(r),i},e.prototype.wireEvent=function(){this.searchElement&&(t.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.searchElement,"focus",this.focusHandler,this),t.EventHandler.add(this.searchElement,"blur",this.blurHandler,this))},e.prototype.propertyChanged=function(e){t.getValue("module",e)===this.getModuleName()&&this.parent.toolbar&&(this.element&&this.element.parentNode&&t.remove(this.element),this.renderToolbar(),this.refreshToolbarItems())},e.prototype.unWireEvent=function(){this.searchElement&&(t.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),t.EventHandler.remove(this.searchElement,"focus",this.focusHandler),t.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 i=this.predefinedItems[e.text];return i?t.extend(i,i,e):e},e.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.id+"_"+e}},e.prototype.toolbarClickHandler=function(e){var i=this,r=this.parent,n=this.id;t.extend(e,{cancel:!1}),r.trigger("toolbarClick",e,function(e){if(!e.cancel)switch(!0===i.parent.isAdaptive&&(e.item.id!==n+"_edit"&&e.item.id!==n+"_add"&&e.item.id!==n+"_delete"&&e.item.id!==n+"_searchbutton"&&e.item.id!==n+"_expandall"&&e.item.id!==n+"_collapseall"||i.parent.selectionModule&&"Multiple"===i.parent.selectionSettings.type&&(i.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),!t.isNullOrUndefined(e.item)&&e.item.id){case n+"_edit":r.editModule&&r.editSettings.allowEditing&&r.editModule.dialogModule.openToolbarEditDialog();break;case n+"_indent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.indent();break;case n+"_critical-path":r.enableCriticalPath?r.enableCriticalPath=!1:r.enableCriticalPath=!0;break;case n+"_outdent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.outdent();break;case n+"_update":r.editModule.cellEditModule.isCellEdit=!1,r.treeGrid.grid.saveCell();break;case n+"_cancel":r.cancelEdit();break;case n+"_add":r.editModule&&r.editSettings.allowAdding&&r.editModule.dialogModule.openAddDialog();break;case n+"_delete":i.parent.selectionModule&&i.parent.editModule&&("Cell"!==i.parent.selectionSettings.mode&&i.parent.selectionModule.selectedRowIndexes.length||"Cell"===i.parent.selectionSettings.mode&&i.parent.selectionModule.getSelectedRowCellIndexes().length)&&i.parent.editModule.startDeleteAction();break;case n+"_search":if(t.getValue("originalEvent.target.id",e)===i.parent.element.id+"_searchbutton"&&i.parent.filterModule){var a=i.element.querySelector("#"+i.parent.element.id+"_searchbar").value;i.parent.searchSettings.key!==a&&(i.parent.searchSettings.key=a,i.parent.dataBind())}break;case n+"_searchbutton":var s=i.element.querySelector(".e-adaptive-searchbar");s.parentElement.childNodes[1].style.display="none",s.style.display="block";break;case n+"_expandall":i.parent.ganttChartModule.expandCollapseAll("expand");break;case n+"_collapseall":i.parent.ganttChartModule.expandCollapseAll("collapse");break;case n+"_prevtimespan":i.parent.previousTimeSpan();break;case n+"_nexttimespan":i.parent.nextTimeSpan();break;case n+"_zoomin":i.zoomIn();break;case n+"_zoomout":i.zoomOut();break;case n+"_zoomtofit":i.zoomToFit()}})},e.prototype.zoomIn=function(){this.parent.timelineModule.processZooming(!0)},e.prototype.zoomToFit=function(){this.parent.timelineModule.processZoomToFit(),this.parent.ganttChartModule.updateScrollLeft(0)},e.prototype.zoomOut=function(){this.parent.timelineModule.processZooming(!1)},e.prototype.refreshToolbarItems=function(e){var i,r=this.parent,n=[],a=[],s=r.editSettings,o=this.id,l=r.selectedRowIndex,d=!!r.selectionModule&&(1===r.selectionModule.selectedRowIndexes.length||1===r.selectionModule.getSelectedRowCellIndexes().length),p=this.toolbar?this.toolbar.items:[],h=[o+"_add",o+"_edit",o+"_delete",o+"_update",o+"_cancel",o+"_indent",o+"_outdent"],c="ResourceView"===this.parent.viewType&&0!==t.getValue("data.level",e)||"ProjectView"===this.parent.viewType;if(t.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 u=!!r.editModule.taskbarEditModule&&r.editModule.taskbarEditModule.touchEdit,g=r.flatData&&r.flatData.length;s.allowAdding&&!u?n.push(o+"_add"):a.push(o+"_add"),s.allowEditing&&c&&g&&d&&!u?n.push(o+"_edit"):a.push(o+"_edit"),s.allowEditing&&0!==l&&-1!==l&&g&&d&&"ResourceView"!==this.parent.viewType?0===r.updatedRecords[l].level&&g&&!u?(n.push(o+"_indent"),a.push(o+"_outdent")):(i=r.updatedRecords[l-1],r.updatedRecords[l].level-i.level==1&&-1!==l?(a.push(o+"_indent"),n.push(o+"_outdent")):-1!==l&&(n.push(o+"_indent"),n.push(o+"_outdent"))):(a.push(o+"_indent"),a.push(o+"_outdent"));var f=!!r.selectionModule&&(r.selectionModule.selectedRowIndexes.length>0||r.selectionModule.getSelectedRowCellIndexes().length>0);if(s.allowDeleting&&c&&g&&f&&!u?n.push(o+"_delete"):a.push(o+"_delete"),"Auto"===r.editSettings.mode&&!t.isNullOrUndefined(r.editModule.cellEditModule)&&r.editModule.cellEditModule.isCellEdit){(n=[]).push(o+"_update",o+"_cancel"),a=[];for(var m=0;m<p.length;m++)p[m].id!==o+"_update"&&p[m].id!==o+"_cancel"&&-1!==h.indexOf(p[m].id)&&a.push(p[m].id)}else{a.push(o+"_update",o+"_cancel");for(m=0;m<p.length;m++)-1===n.indexOf(p[m].id)&&-1===a.indexOf(p[m].id)&&n.push(p[m].id)}}for(var y=0;y<n.length;y++){var v=void 0;for(m=0;m<p.length;m++)if(p[m].id===n[y]){v=m;break}p.length>0&&this.toolbar.hideItem(v,!1)}for(var D=0;D<a.length;D++){for(v=void 0,m=0;m<p.length;m++)if(p[m].id===a[D]){v=m;break}p.length>0&&this.toolbar.hideItem(v,!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.destroy(),this.parent.filterModule&&this.unWireEvent(),t.remove(this.element))},e}(),Di=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=t.createElement("div",{className:"e-nonworking-day-container"}),this.nonworkingContainer.setAttribute("role","NonWorkingDays"),this.parent.ganttChartModule.chartBodyContent.appendChild(this.nonworkingContainer))},e.prototype.renderHolidays=function(){this.parent.holidays&&this.parent.holidays.length>0?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.holidayContainer)||(this.holidayContainer=t.createElement("div",{className:"e-holiday-container"}),this.nonworkingContainer.appendChild(this.holidayContainer)),this.holidayContainer.innerHTML=this.getHolidaysElement().innerHTML):this.holidayContainer&&this.holidayContainer.parentNode&&(t.remove(this.holidayContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&t.remove(this.nonworkingContainer))},e.prototype.getHolidaysElement=function(){var e,i,r=t.createElement("div"),n=this.parent.contentHeight,a=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(a=this.parent.toolbarModule.element.offsetHeight);for(var s=this.parent.ganttHeight-a-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,o=0;o<this.parent.holidays.length;o++){this.parent.holidays[o].from&&this.parent.holidays[o].to?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[o].from),(i=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[o].to)).setDate(i.getDate()+1),e.setHours(0,0,0,0),i.setHours(0,0,0,0)):this.parent.holidays[o].from?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[o].from)).setHours(0,0,0,0):this.parent.holidays[o].to&&(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[o].to)).setHours(0,0,0,0);var l=this.parent.holidays[o].from&&this.parent.holidays[o].to?this.parent.dataOperation.getTaskWidth(e,i):this.parent.perDayWidth,d=this.parent.dataOperation.getTaskLeft(e,!1),p=t.createElement("div",{className:"e-holiday",styles:"left:"+d+"px; width:"+l+"px; height:100%;"}),h=s<n?s/2:n/2,c=t.createElement("span",{className:"e-span",styles:"top:"+h+"px;left:"+l/2+"px;"});c[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=this.parent.holidays[o].label?this.parent.holidays[o].label:"",p.appendChild(c),this.parent.holidays[o].cssClass&&p.classList.add(this.parent.holidays[o].cssClass),r.appendChild(p)}return r},e.prototype.renderWeekends=function(){this.parent.highlightWeekends?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.weekendContainer)||(this.weekendContainer=t.createElement("div",{className:"e-weekend-container"}),this.nonworkingContainer.appendChild(this.weekendContainer)),this.weekendContainer.innerHTML=this.getWeekendElements().innerHTML):this.weekendContainer&&(t.remove(this.weekendContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&t.remove(this.nonworkingContainer))},e.prototype.getWeekendElements=function(){var e=t.createElement("div"),i=new Date(this.parent.timelineModule.timelineStartDate.getTime()),r=new Date(this.parent.timelineModule.timelineEndDate.getTime()),n=this.parent.nonWorkingDayIndex,a=!0;do{if(-1!==n.indexOf(i.getDay())){var s=this.parent.dataOperation.getTaskLeft(i,!1),o=this.parent.perDayWidth;if(a){var l=new Date(i.getTime()),d=new Date(l.getTime());d.setDate(d.getDate()+1),d.setHours(0,0,0,0),o=this.parent.dataOperation.getTaskWidth(l,d),a=!1}var p=new Date(i);p.setDate(p.getDate()+1),p.getTimezoneOffset()==this.parent.timelineModule.timelineStartDate.getTimezoneOffset()||this.weekendWidthUpdated||"Hour"==this.parent.timelineModule.bottomTier&&1===this.parent.timelineSettings.bottomTier.count&&(o-=this.parent.timelineSettings.timelineUnitSize,this.weekendWidthUpdated=!0);var h=t.createElement("div",{className:"e-weekend",styles:"left:"+s+"px;width:"+o+"px;height:100%;"});e.appendChild(h)}i.setDate(i.getDate()+1),i.setHours(0,0,0,0)}while(i<r);return e},e.prototype.updateHolidayLabelHeight=function(){var e=this.parent.getContentHeight(),i=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(i=this.parent.toolbarModule.element.offsetHeight);for(var r=this.parent.ganttHeight-i-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,n=r<e?r/2:e/2,a=this.holidayContainer.querySelectorAll(".e-span"),s=0;s<a.length;s++)a[s].style.top=t.formatUnit(n)},e.prototype.updateContainerHeight=function(){var e=this.parent.getContentHeight();this.holidayContainer&&(this.holidayContainer.style.height=t.formatUnit(e),this.updateHolidayLabelHeight()),this.weekendContainer&&(this.weekendContainer.style.height=t.formatUnit(e))},e.prototype.removeContainers=function(){this.holidayContainer&&t.remove(this.holidayContainer),this.weekendContainer&&t.remove(this.weekendContainer),this.nonworkingContainer&&t.remove(this.nonworkingContainer)},e}(),wi=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=t.createElement("div",{className:"e-event-markers-container"}),this.eventMarkersContainer.setAttribute("role","EventMarker"),this.parent.ganttChartModule.chartBodyContent.appendChild(this.eventMarkersContainer)),this.eventMarkersContainer.innerHTML="",this.getEventMarkersElements(this.eventMarkersContainer)):this.removeContainer()},e.prototype.removeContainer=function(){this.eventMarkersContainer&&(t.remove(this.eventMarkersContainer),this.eventMarkersContainer=null)},e.prototype.getEventMarkersElements=function(e){for(var i,r,n,a,s=0;s<this.parent.eventMarkers.length;s++){if(i=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(this.parent.eventMarkers[s].day,!0),!1),r=t.createElement("div",{className:"e-event-markers",styles:"left:"+i+"px; height:100%;",id:"stripline"+s}),this.parent.eventMarkers[s].label){(n=t.createElement("div",{className:"e-span-label"}))[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=this.parent.eventMarkers[s].label,r.appendChild(n),a=t.createElement("div",{className:"e-gantt-right-arrow"}),r.appendChild(a)}this.parent.eventMarkers[s].cssClass&&r.classList.add(this.parent.eventMarkers[s].cssClass),r.setAttribute("tabindex","-1"),t.isNullOrUndefined(this.parent.eventMarkers[s].day)||r.setAttribute("aria-label",this.parent.localeObj.getConstant("eventMarkers")+" "+("string"==typeof this.parent.eventMarkers[s].day?this.parent.eventMarkers[s].day:this.parent.getFormatedDate(this.parent.eventMarkers[s].day))+" "+this.parent.eventMarkers[s].label),e.appendChild(r)}},e.prototype.updateContainerHeight=function(){this.eventMarkersContainer&&(this.eventMarkersContainer.style.height=t.formatUnit(this.parent.getContentHeight()))},e}(),ki=function(){function e(e){this.parent=e,this.nonworkingDayRender=new Di(this.parent),this.eventMarkerRender=new wi(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 i=Object.keys(t.getValue("properties",e)),r=0;r<i.length;r++){switch(i[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.eventMarkerRender.renderEventMarkers(),this.nonworkingDayRender.renderWeekends(),this.nonworkingDayRender.renderHolidays()},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}(),Ti=function(){function e(e){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.enableMultiTaskbar){this.parent.enableCriticalPath=!0;var r=this.parent.treeGrid.parentData,n=r[0].ganttProperties.endDate,a=0,s=[],o=[],l=[],d=0,p=[],h=[],c=[],u=[],g=[],f=[];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(parseInt(i[y].ganttProperties.taskId,10)),i[y].ganttProperties.predecessor&&0!==i[y].ganttProperties.predecessor.length&&(o.push(i[y]),l.push(parseInt(i[y].ganttProperties.taskId,10)));if("ResourceView"===this.parent.viewType)for(m=0;m<this.parent.taskIds.length;m++)this.resourceCollectionIds[m]=this.parent.taskIds[m].slice(1);for(var v=0;v<s.length;v++)-1===l.indexOf(s[v])?(i[d="ProjectView"===this.parent.viewType?t.indexOf(s[v].toString()):this.resourceCollectionIds.indexOf(s[v].toString())].ganttProperties.progress<100&&(i[d].isCritical=!0,i[d].ganttProperties.isCritical=!0),i[d].slack="0 "+i[d].ganttProperties.durationUnit,p.push(s[v])):h.push(s[v]);for(var D=o.length,w=[],k=0;k<D;k++){for(var T=-1,S=-1,b=-1,P=-1,C=k,M=o[k].ganttProperties.predecessor,R=o[k].ganttProperties.predecessor.length,O=parseInt(o[k].ganttProperties.taskId,10),x=0;x<R;x++)parseInt(M[x].from,10)===O&&(-1===T?M[x].offset?(T=M[x].to+":"+M[x].offset+M[x].offsetUnit,b=M[x].type):(T=M[x].to,b=M[x].type):M[x].offset?(T=T+","+M[x].to+":"+M[x].offset+M[x].offsetUnit,b=b+","+M[x].type):(T=T+","+M[x].to,b=b+","+M[x].type)),parseInt(M[x].to,10)===O&&(-1===S?M[x].offset?(S=M[x].from+":"+M[x].offset+M[x].offsetUnit,P=M[x].type):(S=M[x].from,P=M[x].type):M[x].offset?(S=S+","+M[x].from+":"+M[x].offset+M[x].offsetUnit,P=P+","+M[x].type):(S=S+","+M[x].from,P=P+","+M[x].type));-1===S&&(S=null,P=null),-1===T&&(T=null,b=null),c.push({from:S,fromPredecessor:P,taskid:O,to:T,toPredecessor:b,currentIndex:C,slack:null,enddate:null}),u.push(O)}for(var I=c.length,E=void 0,F=0;F<I;F++)if(!c[F].to){E=c[F].taskid;var U=i["ProjectView"===this.parent.viewType?t.indexOf(E.toString()):this.resourceCollectionIds.indexOf(E.toString())].ganttProperties;a=this.parent.dataOperation.getDuration(U.endDate,n,"minute",U.isAutoSchedule,U.isMilestone),c[F].slack=a,c[F].fs=-1,c[F].enddate=U.endDate,w.push({fromdata:c[F].from,todateID:c[F].taskid,fromDataPredecessor:c[F].fromPredecessor})}for(v=0;v<w.length;v++)g.push(w[v]),this.slackCalculation(g,c,u,n,i,t);f=this.finalCriticalPath(c,p,i,t,n),this.criticalPathCollection=f,this.detailPredecessorCollection=c,this.predecessorCollectionTaskIds=u}if(!1===e&&this.parent.flatData.length>0&&!this.parent.enableMultiTaskbar){this.parent.enableCriticalPath=!1;for(F=0;F<this.criticalPathCollection.length;F++)i[t.indexOf(this.criticalPathCollection[F].toString())].isCritical=!1;this.criticalPathCollection=[],this.detailPredecessorCollection=[],this.predecessorCollectionTaskIds=[]}},e.prototype.slackCalculation=function(e,i,r,n,a,s){for(var o,l,d,p,h,c,u,g,f=e[0].fromdata.split(","),m=e[0].fromDataPredecessor.split(","),y=[],v=0;v<f.length;v++){y=f[v].split(":"),o=r.indexOf(parseInt(y[0],10)),p=r.indexOf(parseInt(e[0].todateID,10)),"ProjectView"===this.parent.viewType?(l=s.indexOf(y[0].toString()),d=s.indexOf(e[0].todateID.toString())):(l=this.resourceCollectionIds.indexOf(y[0].toString()),d=this.resourceCollectionIds.indexOf(e[0].todateID.toString()));var D=a[l].ganttProperties,w=a[d].ganttProperties;y.length>1&&(u=-1!==y[1].indexOf("hour")?60*parseFloat(y[1]):-1!==y[1].indexOf("day")?parseFloat(y[1])*(this.parent.secondsPerDay/3600)*60:parseFloat(y[1])),"FS"===m[v]&&(h=D.endDate>w.startDate?-this.parent.dataOperation.getDuration(w.startDate,D.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.parent.dataOperation.getDuration(D.endDate,w.startDate,"minute",D.isAutoSchedule,D.isMilestone),t.isNullOrUndefined(i[o].slack)?y.length<=1&&(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h):i[o].slack>h&&0!==i[o].slack&&y.length<=1&&(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h),y.length>1&&(i[o].slack=i[p].slack+h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0)),i[o].fs=1,i[o].fsslack=i[o].slack,i[o].enddate=D.startDate,D.endDate>=n&&D.endDate<=n&&(i[o].slack=0)),"SS"===m[v]&&(D.isAutoSchedule?(h=D.startDate>w.startDate?-this.parent.dataOperation.getDuration(w.endDate,D.startDate,"minute",D.isAutoSchedule,D.isMilestone):this.parent.dataOperation.getDuration(D.startDate,w.startDate,"minute",D.isAutoSchedule,D.isMilestone),t.isNullOrUndefined(i[o].slack)?y.length<=1&&(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h):i[o].slack>h&&0!==i[o].slack&&y.length<=1&&(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h),y.length>1&&(i[o].slack=i[p].slack+h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0)),i[o].fs=1,i[o].fsslack=i[o].slack,i[o].enddate=D.startDate):D.isAutoSchedule||(h=this.getSlackDuration(D.endDate,n,"minute",a[l]),t.isNullOrUndefined(i[o].slack)?i[o].slack=h:i[o].slack>h&&0!==i[o].slack&&(i[o].slack=h)),D.endDate>=n&&D.endDate<=n&&(i[o].slack=0)),"FF"===m[v]&&(1!==i[p].fs&&1!==i[p].ff&&-1!==i[p].fs||(1!==i[p].fs&&1!==i[p].ff||(c=w.endDate,g=i[p].slack),-1===i[p].fs&&(c=i[p].enddate,g=i[p].slack),h=c>D.endDate?-this.getSlackDuration(D.endDate,c,"minute",a[l]):this.getSlackDuration(c,D.endDate,"minute",a[l]),t.isNullOrUndefined(i[o].slack)?y.length<=1&&(i[o].slack=g-h<0?0:g-h):i[o].slack>h&&0!==i[o].slack&&y.length<=1&&(i[o].slack=g-h<0?0:g-h),y.length>1&&(i[o].slack=i[p].slack-h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0)),i[o].ff=1,i[o].enddate=c,i[o].fsslack=g),D.endDate>=n&&D.endDate<=n&&(i[o].slack=0)),"SF"===m[v]&&(D.isAutoSchedule?t.isNullOrUndefined(i[o].slack)?(y.length<=1?t.isNullOrUndefined(i[p].to)?(h=this.getSlackDuration(D.endDate,n,"minute",a[l]),i[o].slack=h):t.isNullOrUndefined(i[p].to)||(h=w.endDate>D.startDate?-this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(w.endDate,D.startDate,"minute",a[l]),i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h):y.length>1&&(h=w.endDate>=D.endDate?D.startDate>w.endDate?-this.getSlackDuration(w.endDate,D.startDate,"minute",a[l]):this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(D.endDate,n,"minute",a[l]),i[o].slack=i[p].slack+h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0)),i[o].fs=1,i[o].fsslack=i[o].slack,i[o].enddate=D.startDate):(y.length<=1?(t.isNullOrUndefined(i[p].to)?h=this.getSlackDuration(D.endDate,n,"minute",a[l]):t.isNullOrUndefined(i[p].to)||(h=w.endDate>D.startDate?-this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(w.endDate,D.startDate,"minute",a[l])),i[o].slack>h&&0!==i[o].slack&&(t.isNullOrUndefined(i[p].to)?i[o].slack=h:t.isNullOrUndefined(i[p].to)||(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h))):y.length>1&&(h=w.endDate>D.endDate?D.startDate>w.endDate?-this.getSlackDuration(w.endDate,D.startDate,"minute",a[l]):this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(D.endDate,n,"minute",a[l]),i[o].slack>h&&0!==i[o].slack&&(i[o].slack=i[p].slack+h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0))),i[o].fs=1,i[o].fsslack=i[o].slack,i[o].enddate=D.startDate):D.isAutoSchedule||(h=this.getSlackDuration(D.endDate,n,"minute",a[l]),t.isNullOrUndefined(i[o].slack)?i[o].slack=h:i[o].slack>h&&0!==i[o].slack&&(i[o].slack=h)),D.endDate>=n&&D.endDate<=n&&(i[o].slack=0)),i[o].from&&e.push({fromdata:i[o].from,todateID:i[o].taskid,fromDataPredecessor:i[o].fromPredecessor})}e&&(e.splice(0,1),e.length>0&&this.slackCalculation(e,i,r,n,a,s))},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.finalCriticalPath=function(e,t,i,r,n){for(var a,s=[],o=e.length-1;o>=0;o--){for(var l=i[a="ProjectView"===this.parent.viewType?r.indexOf(e[o].taskid.toString()):this.resourceCollectionIds.indexOf(e[o].taskid.toString())].ganttProperties.predecessor,d="0 "+i[a].ganttProperties.durationUnit,p=0;p<l.length;p++){var h=void 0;h="ProjectView"===this.parent.viewType?this.parent.ids.indexOf(l[p].to):this.resourceCollectionIds.indexOf(l[p].to);var c=void 0,u=i[a].ganttProperties;"FS"===l[p].type?0===(c=this.parent.dataOperation.getDuration(u.endDate,i[h].ganttProperties.startDate,u.durationUnit,u.isAutoSchedule,u.isMilestone))&&a!==h&&i[a].slack!==d?(i[a].slack=i[h].slack,i[a].ganttProperties.slack=i[h].slack):0!==c&&a!==h&&i[h].isCritical&&(i[a].slack=c+" "+i[a].ganttProperties.durationUnit,i[a].ganttProperties.slack=c+" "+i[a].ganttProperties.durationUnit):c="SF"===l[p].type?this.parent.dataOperation.getDuration(u.startDate,i[h].ganttProperties.endDate,u.durationUnit,u.isAutoSchedule,u.isMilestone):"SS"===l[p].type?this.parent.dataOperation.getDuration(u.startDate,i[h].ganttProperties.startDate,u.durationUnit,u.isAutoSchedule,u.isMilestone):this.parent.dataOperation.getDuration(u.endDate,i[h].ganttProperties.endDate,u.durationUnit,u.isAutoSchedule,u.isMilestone),parseInt(l[p].from,10)===i[a][this.parent.taskFields.id]&&i[h].slack===d&&c<=0&&(i[a].slack=d,i[a].ganttProperties.slack=d)}i[a].slack===d&&i[a].ganttProperties.progress<100&&(i[a].isCritical=!0,i[a].ganttProperties.isCritical=!0,this.criticalTasks.push(i[a]),s.push(e[o].taskid))}if(t.length>0)for(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]),s=s.concat(t[p]));return s},e.prototype.criticalConnectorLine=function(e,i,r,n){var a=this.parent.ganttChartModule.chartElement;t.removeClass(a.querySelectorAll(".e-gantt-child-taskbar-inner-div"),N),t.removeClass(a.querySelectorAll(".e-gantt-child-progressbar-inner-div"),B),t.removeClass(a.querySelectorAll(".e-milestone-top"),H),t.removeClass(a.querySelectorAll(".e-milestone-bottom"),W);for(var s=0;s<e.length;s++){var o=void 0;o="ProjectView"===this.parent.viewType?this.parent.flatData[this.parent.ids.indexOf(e[s].toString())]:this.parent.flatData[this.resourceCollectionIds.indexOf(e[s].toString())];var l=this.parent.currentViewData.indexOf(o),d=this.parent.getRowByIndex(l),p=void 0,h=this.parent.taskFields;p=this.parent.allowUnscheduledTasks&&!o[h.startDate]&&!o[h.endDate]&&o[h.duration]?"e-gantt-critical-unscheduled-taskbar":B,d&&(d.getElementsByClassName("e-milestone-top")[0]&&t.addClass(d.querySelectorAll(".e-milestone-top"),H),d.getElementsByClassName("e-milestone-bottom")[0]&&t.addClass(d.querySelectorAll(".e-milestone-bottom"),W),d.getElementsByClassName("e-gantt-child-taskbar-inner-div").length>0&&t.addClass(d.querySelectorAll(".e-gantt-child-taskbar-inner-div"),N),d.getElementsByClassName("e-gantt-child-progressbar-inner-div").length>0&&t.addClass(d.querySelectorAll(".e-gantt-child-progressbar-inner-div"),p))}if(t.removeClass(this.parent.element.querySelectorAll(".e-line"),ke),t.removeClass(this.parent.element.querySelectorAll(".e-connector-line-right-arrow"),Te),t.removeClass(this.parent.element.querySelectorAll(".e-connector-line-left-arrow"),Se),0!==i.length){l=0;var c=void 0,u=[],g=void 0;for(s=0;s<this.criticalPathCollection.length;s++)if(l=n.indexOf(this.criticalPathCollection[s]),c=i[l],-1!==l&&c.to){u=c.to.split(",");for(var f=0;f<u.length;f++)if(g=parseInt(u[f],10),-1!==e.indexOf(g)){this.parent.element.querySelectorAll("#ConnectorLineparent"+c.taskid+"child"+g).length>0&&(t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+c.taskid+"child"+g)[0].querySelectorAll(".e-line"),ke),t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+c.taskid+"child"+g)[0].querySelectorAll(".e-connector-line-right-arrow"),Te),t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+c.taskid+"child"+g)[0].querySelectorAll(".e-connector-line-left-arrow"),Se))}}}},e.prototype.getModuleName=function(){return"criticalPath"},e.prototype.destroy=function(){!this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(this.parent.criticalPathModule=void 0)},e}(),Si=function(){function e(e){var i=this;this.segmentIndex=-1,this.headerContextMenuClick=function(e){var r=t.closest(e.event.target,".e-row"),n=t.closest(e.event.target,".e-chart-row");t.isNullOrUndefined(r)&&t.isNullOrUndefined(n)&&(e.type="Header",i.parent.trigger("contextMenuClick",e))},this.headerContextMenuOpen=function(e){var r=t.closest(e.event.target,".e-row"),n=t.closest(e.event.target,".e-chart-row");t.isNullOrUndefined(r)&&t.isNullOrUndefined(n)?(e.type="Header",i.parent.trigger("contextMenuOpen",e)):e.cancel=!0},this.parent=e,this.ganttID=e.element.id,a.TreeGrid.Inject(a.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(),t.remove(this.element)),this.resetItems(),this.render())},e.prototype.render=function(){this.element=this.parent.createElement("ul",{id:this.ganttID+"_contextmenu",className:"e-grid"}),this.parent.element.appendChild(this.element);var e="#"+this.ganttID;this.contextMenu=new o.ContextMenu({items:this.getMenuItems(),locale:this.parent.locale,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 i,r,n,a=t.getValue("parentObj",e.item),s=-1;switch(a&&!t.isNullOrUndefined(a.id)&&"DeleteDependency"===this.getKeyFromId(a.id)&&(s=a.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":this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID));break;case"Above":case"Below":case"Child":if(i=this.item,r=t.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),t.isNullOrUndefined(n.dependency)||(r[n.dependency]=null),!t.isNullOrUndefined(n.child)&&r[n.child]&&delete r[n.child],!t.isNullOrUndefined(n.parentID)&&r[n.parentID]&&(r[n.parentID]=null),this.rowData){var o=this.parent.updatedRecords.indexOf(this.rowData);this.parent.addRecord(r,i,o)}break;case"Milestone":case"ToMilestone":this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);break;case"DeleteTask":this.parent.editModule.deleteRecord(this.rowData);break;case"ToTask":if(r=t.extend({},{},this.rowData.taskData,!0),n=this.parent.taskFields,t.isNullOrUndefined(n.duration)){r[n.startDate]=new Date(this.rowData.taskData[n.startDate]);var l=new Date(this.rowData.taskData[n.startDate]);l.setDate(l.getDate()+1),r[n.endDate]=l}else{var d=this.rowData.ganttProperties;r[n.duration]="1 "+d.durationUnit}t.isNullOrUndefined(r[n.milestone])||!0===r[n.milestone]&&(r[n.milestone]=!1),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"+s:this.parent.connectorLineEditModule.removePredecessorByIndex(this.rowData,s);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 i=this;this.isEdit=!0;var r=this.parent.taskFields,n=this.getClickedDate(e.element);t.isNullOrUndefined(this.parent.timelineSettings.bottomTier)&&"Hour"!==this.parent.timelineSettings.bottomTier.unit&&n.setHours(0,0,0,0);var a={rowData:this.rowData,requestType:"splitTaskbar",splitDate:n,cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",a,function(e){i.parent.chartRowsModule.splitTask(i.rowData[r.id],n)})},e.prototype.mergeCall=function(e){var t=this;this.isEdit=!0;var i=this.parent.taskFields,r=this.rowData.ganttProperties.segments,n=[{firstSegmentIndex:"Right"===e?this.segmentIndex:r[this.segmentIndex-1].segmentIndex,secondSegmentIndex:"Left"===e?this.segmentIndex:r[this.segmentIndex+1].segmentIndex}],a={rowData:this.rowData,mergeSegmentIndexes:n,requestType:"mergeSegment",cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",a,function(e){!1===e.cancel&&t.parent.chartRowsModule.mergeTask(t.rowData[i.id],n)})},e.prototype.getClickedDate=function(e){var i=this.parent.getOffsetRect(this.parent.element).left+this.parent.ganttChartModule.chartElement.offsetLeft+this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft,r=this.clickedPosition-i,n=Math.ceil(r/this.parent.perDayWidth),a=this.rowData.ganttProperties.startDate;t.isNullOrUndefined(this.parent.timelineSettings.bottomTier)||"Hour"!==this.parent.timelineSettings.bottomTier.unit||(n=Math.ceil(r/this.parent.timelineSettings.timelineUnitSize),n-=1);return this.parent.dataOperation.getEndDate(a,n,this.rowData.ganttProperties.durationUnit,this.rowData,!1)},e.prototype.contextMenuBeforeOpen=function(e){var i=this,r=e.event?e.event.target:this.parent.focusModule?this.parent.ganttChartModule.targetElement:this.parent.focusModule.getActiveElement();!t.isNullOrUndefined(this.parent.editModule)&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&r.parentElement.classList.contains("e-row")&&this.parent.treeGrid.closeEdit(),t.isNullOrUndefined(e.element)||e.element.id!==this.parent.element.id+"_contextmenu"||(this.clickedPosition=t.getValue("event",e).clientX);var a=t.closest(r,".e-gantt-child-taskbar");a&&(this.targetElement=e.target=a),e.gridRow=t.closest(r,".e-row"),e.chartRow=t.closest(r,".e-chart-row");var s=t.closest(r,".e-gantt");if(!t.closest(r,".e-gridform")&&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),(t.isNullOrUndefined(e.gridRow)&&t.isNullOrUndefined(e.chartRow)||0===this.contentMenuItems.length)&&(t.isNullOrUndefined(e.parentItem)||t.isNullOrUndefined(s)?e.cancel=!0:e.cancel=!1),!e.cancel){var o=-1;e.gridRow?o=parseInt(e.gridRow.getAttribute("aria-rowindex"),0):e.chartRow&&(o=parseInt(e.chartRow.getAttribute("aria-rowindex"),0)),this.parent.selectionModule&&this.parent.allowSelection&&!e.parentItem&&!t.isNullOrUndefined(e.chartRow)&&this.parent.selectionModule.selectRow(o),e.parentItem||(this.rowData=this.parent.updatedRecords[o]);for(var l=0,d=e.items;l<d.length;l++){var p=d[l];p.separator||(!r.classList.contains("e-gantt-unscheduled-taskbar")||p.text!==this.getLocale("splitTask")&&p.text!==this.getLocale("mergeTask")?this.updateItemStatus(p,r,o):this.hideItems.push(p.text))}if(e.rowData=this.rowData,e.type="Content",e.disableItems=this.disableItems,e.hideItems=this.hideItems,e.hideChildItems=[],0===e.rowData.level&&"ResourceView"===this.parent.viewType)return void(e.cancel=!0);var h=new n.Deferred;return this.parent.trigger("contextMenuOpen",e,function(t){h.resolve(t),i.hideItems=t.hideItems,i.disableItems=t.disableItems,t.parentItem||t.hideItems.length!==t.items.length||(i.revertItemStatus(),t.cancel=!0),i.hideItems.length>0&&i.contextMenu.hideItems(i.hideItems),i.disableItems.length>0&&i.contextMenu.enableItems(i.disableItems,!1),e.hideChildItems.length>0&&i.contextMenu.hideItems(e.hideChildItems)}),h}},e.prototype.updateItemStatus=function(e,i,r){var n=this.getKeyFromId(e.id),a=t.closest(i,".e-gridform"),s=[],o=t.closest(i,".e-gantt-child-taskbar");if(a)"Save"!==n&&"Cancel"!==n&&this.hideItems.push(e.text);else switch(n){case"TaskInformation":this.parent.editSettings.allowEditing&&this.parent.editModule||this.updateItemVisibility(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":this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowEditing&&this.parent.editModule?(this.rowData.ganttProperties.isMilestone?s.push(this.createItemModel(He,"ToTask",this.getLocale("toTask"))):s.push(this.createItemModel(He,"ToMilestone",this.getLocale("toMilestone"))),e.items=s):this.updateItemVisibility(e.text);break;case"DeleteDependency":var l=this.getPredecessorsItems();this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowDeleting&&0!==l.length&&this.parent.editModule?l.length>0&&(e.items=l):this.updateItemVisibility(e.text);break;case"DeleteTask":this.parent.editSettings.allowDeleting&&this.parent.editModule||this.updateItemVisibility(e.text);break;case"TaskMode":"Custom"!==this.parent.taskMode?this.updateItemVisibility(e.text):(this.rowData.ganttProperties.isAutoSchedule?s.push(this.createItemModel(He,"Manual",this.getLocale("manual"))):s.push(this.createItemModel(He,"Auto",this.getLocale("auto"))),e.items=s);break;case"Indent":if(this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings){var d=this.parent.selectedRowIndex,p=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),h=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1];this.parent.editSettings.allowEditing&&0!==d&&-1!==d&&p&&"ResourceView"!==this.parent.viewType&&this.parent.updatedRecords[d].level-h.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 c=this.parent.selectionModule.getSelectedRowIndexes()[0],u=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length);this.parent.editSettings.allowEditing&&-1!==c&&0!==c&&u&&"ResourceView"!==this.parent.viewType&&0!==this.parent.updatedRecords[c].level||this.updateItemVisibility(e.text)}else this.hideItems.push(e.text);break;case"SplitTask":var g=this.parent.taskFields;(this.parent.readOnly||!o||t.isNullOrUndefined(g.segments)||this.parent.currentViewData[r].hasChildRecords)&&this.updateItemVisibility(e.text);break;case"MergeTask":this.parent.readOnly||!o?this.updateItemVisibility(e.text):this.mergeItemVisiblity(i,e)}},e.prototype.mergeItemVisiblity=function(e,i){var r=[],n=this.parent.taskFields,a=this.getClickedDate(e);this.segmentIndex=this.parent.chartRowsModule.getSegmentIndex(a,this.rowData);var s=this.rowData.ganttProperties.segments;!t.isNullOrUndefined(s)&&s.length>0?t.isNullOrUndefined(n.segments)&&-1===this.segmentIndex?this.updateItemVisibility(i.text):(0===this.segmentIndex?r.push(this.createItemModel(He,"Right",this.getLocale("right"))):this.segmentIndex===s.length-1?r.push(this.createItemModel(He,"Left",this.getLocale("left"))):(r.push(this.createItemModel(He,"Right",this.getLocale("right"))),r.push(this.createItemModel(He,"Left",this.getLocale("left")))),i.items=r):this.hideItems.push(i.text)},e.prototype.updateItemVisibility=function(e){!!t.isNullOrUndefined(this.parent.contextMenuItems)?this.hideItems.push(e):this.disableItems.push(e)},e.prototype.contextMenuOpen=function(e){this.isOpen=!0;var i=e.element.querySelectorAll("li:not(.e-menu-hide):not(.e-disabled)")[0];t.addClass([i],"e-focused")},e.prototype.getMenuItems=function(){for(var e=0,i=t.isNullOrUndefined(this.parent.contextMenuItems)?this.getDefaultItems():this.parent.contextMenuItems;e<i.length;e++){var r=i[e];"string"==typeof r&&-1!==this.getDefaultItems().indexOf(r)?this.buildDefaultItems(r):"string"!=typeof r&&(-1!==this.getDefaultItems().indexOf(r.text)?this.buildDefaultItems(r.text,r.iconCss):".e-gridheader"===r.target?this.headerMenuItems.push(r):this.contentMenuItems.push(r))}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(He,e,this.getLocale("taskInformation"),this.getIconCSS("e-edit",t));break;case"Indent":i=this.createItemModel(He,e,this.getLocale("indent"),this.getIconCSS("e-indent",t));break;case"Outdent":i=this.createItemModel(He,e,this.getLocale("outdent"),this.getIconCSS("e-outdent",t));break;case"Save":i=this.createItemModel("e-edit",e,this.getLocale("save"),this.getIconCSS("e-save",t));break;case"Cancel":i=this.createItemModel("e-edit",e,this.getLocale("cancel"),this.getIconCSS("e-cancel",t));break;case"Add":(i=this.createItemModel(He,e,this.getLocale("add"),this.getIconCSS("e-add",t))).items=[],i.items.push(this.createItemModel(He,"Above",this.getLocale("above"),this.getIconCSS("e-add-above",t))),i.items.push(this.createItemModel(He,"Below",this.getLocale("below"),this.getIconCSS("e-add-below",t))),"ResourceView"!==this.parent.viewType&&i.items.push(this.createItemModel(He,"Child",this.getLocale("child"))),i.items.push(this.createItemModel(He,"Milestone",this.getLocale("milestone")));break;case"DeleteTask":i=this.createItemModel(He,e,this.getLocale("deleteTask"),this.getIconCSS("e-delete",t));break;case"DeleteDependency":(i=this.createItemModel(He,e,this.getLocale("deleteDependency"))).items=[],i.items.push({});break;case"Convert":(i=this.createItemModel(He,e,this.getLocale("convert"))).items=[],i.items.push({});break;case"TaskMode":(i=this.createItemModel(He,e,this.getLocale("changeScheduleMode"))).items=[],i.items.push({});break;case"SplitTask":i=this.createItemModel(He,e,this.getLocale("splitTask"));break;case"MergeTask":(i=this.createItemModel(He,e,this.getLocale("mergeTask"))).items=[],i.items.push({})}i&&this.contentMenuItems.push(i)},e.prototype.getIconCSS=function(e,i){return t.isNullOrUndefined(i)?e:i},e.prototype.getPredecessorsItems=function(){this.predecessors=this.parent.predecessorModule.getValidPredecessor(this.rowData);for(var e,t=[],i=0,r=0,n=this.predecessors;r<n.length;r++){var a=n[r],s=this.parent.getRecordByID(a.from).ganttProperties,o=s.rowUniqueID+" - "+s.taskName,l="Dependency"+i++;e=this.createItemModel(He,l,o),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(),t.remove(this.element),this.removeEventListener(),this.contextMenu=null,this.element=null},e}(),bi=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.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)},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)}},e}(),Pi=function(){function e(e){a.TreeGrid.Inject(a.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}(),Ci=function(){function e(e){this.isTest=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.isSharedTask=!1,this.canDrop=!0,this.parent=e,a.TreeGrid.Inject(a.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 i=document.createElement("div");t.classList(i,["e-errorcontainer"],[]),t.classList(i,["e-icons","e-errorelem"],[]);var r=e.querySelector(".errorValue"),n=e.querySelector(".e-rowcell").innerHTML;r&&(n=r.innerHTML,r.parentNode.removeChild(r)),e.querySelector(".e-rowcell").innerHTML="";var a=document.createElement("span");a.className="errorValue",a.style.paddingLeft="16px",a.innerHTML=n,e.querySelector(".e-rowcell").appendChild(i),e.querySelector(".e-rowcell").appendChild(a)}},e.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem");e&&e.remove()},e.prototype.rowDrag=function(e){var i=this.parent.element.querySelector(".e-cloneproperties");i.style.display="none";var r=i.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&&t.addClass(this.parent.element.querySelectorAll(".e-ganttdrag .e-rowcell"),["e-bothganttlines"]);var n=this.parent.element.querySelector(".e-ganttdrag"),a=this.parent.element.getClientRects()[0].top,s=this.parent.element.getClientRects()[0].left,o=t.getValue("event",e.originalEvent).clientX-s,l=t.getValue("event",e.originalEvent).clientY-a;n.style.left=o+20+"px",n.style.top=l+20+"px",this.parent.trigger("rowDrag",e)},e.prototype.rowDragStartHelper=function(e){this.parent.trigger("rowDragStartHelper",e),(this.parent.readOnly||this.parent.filterSettings.columns.length>0)&&(e.cancel=!0),"ResourceView"===this.parent.viewType&&0===t.getValue("level",e.data[0])&&(e.cancel=!0)},e.prototype.rowDrop=function(e){var i=document.querySelector(".e-ganttdrag");i&&i.remove();var r=t.closest(e.target,".e-row"),n=r?parseInt(r.getAttribute("aria-rowindex"),10):e.dropIndex;e.dropIndex=n,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!==t.getValue("parentItem",e.data[0]).uniqueID||(e.cancel=!0)),"middleSegment"!==e.dropPosition&&(0!==e.dropRecord.level&&t.getValue("parentItem",e.data[0]).uniqueID!==e.dropRecord.parentItem.uniqueID||(e.cancel=!0))),e.cancel||(e.requestType="beforeDrop",this.parent.trigger("actionBegin",e),e.cancel||(this.dropRows(e,!0),e.cancel=!0))},e.prototype.dropRows=function(e,i){if(!this.parent.readOnly){if(this.dropPosition=e.dropPosition,"Invalid"!==e.dropPosition&&this.parent.editModule){var r=this.parent,n=void 0;this.droppedRecord=r.updatedRecords[e.dropIndex];var a=[],s=this.droppedRecord;e.data[0]?a=e.data:a.push(e.data);for(var o=0,l=a.length,d=function(e){if(p.parent.isOnEdit=!0,n=a[e],p.draggedRecord=n,"Invalid"!==p.dropPosition){if("ResourceView"===p.parent.viewType&&(p.checkisSharedTask(),p.previousParent=p.draggedRecord.parentItem.uniqueID),p.isSharedTask)return{value:void 0};i&&p.deleteDragRow();var l=p.treeGridData.indexOf(s);if("topSegment"===p.dropPosition&&p.dropAtTop(l),"bottomSegment"===p.dropPosition&&!p.isSharedTask){if(s.hasChildRecords){if(o=p.parent.editModule.getChildCount(s,0),p.parent.taskFields.parentID&&p.ganttData.length>0&&p.ganttData.splice(l+o+1,0,p.draggedRecord.taskData),p.treeGridData.splice(l+o+1,0,p.draggedRecord),p.parent.ids.splice(l+o+1,0,p.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===p.parent.viewType){var d=0===p.draggedRecord.level?"R"+p.draggedRecord.ganttProperties.taskId:"T"+p.draggedRecord.ganttProperties.taskId;p.parent.getTaskIds().splice(l+o+1,0,d)}}else if(p.parent.taskFields.parentID&&p.ganttData.length>0&&p.ganttData.splice(l+1,0,p.draggedRecord.taskData),p.treeGridData.splice(l+1,0,p.draggedRecord),p.parent.ids.splice(l+1,0,p.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===p.parent.viewType){var h=0===p.draggedRecord.level?"R"+p.draggedRecord.ganttProperties.taskId:"T"+p.draggedRecord.ganttProperties.taskId;p.parent.getTaskIds().splice(l+1,0,h)}if(p.parent.setRecordValue("parentItem",p.treeGridData[l].parentItem,n),p.parent.setRecordValue("parentUniqueID",p.treeGridData[l].parentUniqueID,n),p.parent.setRecordValue("level",p.treeGridData[l].level,n),n.hasChildRecords){p.updateChildRecordLevel(n,1),p.updateChildRecord(n,l+o+1)}if(s.parentItem){var c=p.parent.getParentTask(s.parentItem).childRecords,u=c.indexOf(s)+1;c.splice(u,0,n)}}"middleSegment"===p.dropPosition&&(p.dropMiddle(l),s.childRecords.length>0&&(delete s.ganttProperties.segments,delete s.taskData[p.parent.taskFields.segments])),t.isNullOrUndefined(n.parentItem&&-1!==p.updateParentRecords.indexOf(n.parentItem))||p.updateParentRecords.push(n.parentItem)}if(!p.parent.enableVirtualization){var g=r.flatData,f=void 0,m=void 0,y=p.parent.dataSource,v=p.parent.taskFields.id;if(n.index<s.index){f=n.index;for(var D=function(e){var t=p.parent.currentViewData.filter(function(t){return t[v]===y[e][v]})[0];if(t.index>s.index)return m=t.index,"break"},w=0;w<y.length;w++){if("break"===D(w))break}}else{f=s.index;for(var k=function(e){var t=p.parent.currentViewData.filter(function(t){return t[v]===y[e][v]})[0];if(t.index>n.index)return m=t.index,"break"},T=0;T<y.length;T++){if("break"===k(T))break}}for(var S=function(e){if(!t.isNullOrUndefined(g[e])&&(g[e].index=e,!t.isNullOrUndefined(g[e].parentItem))){var i=g.filter(function(t){return t.uniqueID===g[e].parentUniqueID})[0];g[e].parentItem.index=i.index}},b=f;b<=m;b++)S(b)}r.rowDragAndDropModule.refreshDataSource()},p=this,h=0;h<l;h++){var c=d(h);if("object"==typeof c)return c.value}if("middleSegment"===this.dropPosition&&(s.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(s),s.ganttProperties.predecessor=null,s.ganttProperties.predecessorsName=null,s[this.parent.taskFields.dependency]=null,s.taskData[this.parent.taskFields.dependency]=null),s.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,s.ganttProperties,!0),t.isNullOrUndefined(s.taskData[this.parent.taskFields.milestone])||!0===s.taskData[this.parent.taskFields.milestone]&&(s.taskData[this.parent.taskFields.milestone]=!1))),"ResourceView"===this.parent.viewType&&!this.isSharedTask){var u=void 0;u="middleSegment"===this.dropPosition?this.droppedRecord.uniqueID:this.droppedRecord.parentItem.uniqueID;var g=this.parent.getTaskByUniqueID(u),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;t.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()}for(var v=0;v<this.updateParentRecords.length;v++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[v]);this.updateParentRecords=[],this.parent.isOnEdit=!1}t.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]),t.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]),t.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 i=this.parent.getTaskByUniqueID(this.draggedRecord.parentItem.uniqueID);if(e.ganttProperties.resourceInfo&&e.ganttProperties.resourceInfo.length>1){var r=this._getExistingTaskWithID(e),n=void 0;if(null==r)return;for(var a=0;a<r.length;a++)for(var s=(n=r[a]).ganttProperties.resourceInfo,o=0;o<s.length;o++)if(s[o][this.parent.resourceFields.id]===i.ganttProperties.taskId){s.splice(o,1),this.parent.setRecordValue("resourceInfo",s,n.ganttProperties,!0),this.updateCurrentTask(n),t.isNullOrUndefined(n.parentItem&&-1!==this.updateParentRecords.indexOf(n.parentItem))||this.updateParentRecords.push(n.parentItem);break}}},e.prototype.refreshDataSource=function(){var e,i,r=this.draggedRecord,a=this.droppedRecord,s=this.parent;if((e=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):s.dataSource).length>0&&!t.isNullOrUndefined(a)&&!a.parentItem){for(var o=0;o<Object.keys(e).length;o++)e[o][this.parent.taskFields.child]===a.taskData[this.parent.taskFields.child]&&(i=o);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(i,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(i+1,0,r.taskData))}else if(!this.parent.taskFields.parentID&&!t.isNullOrUndefined(a)&&a.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var l="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=a,this.parent.editModule.updateRealDataSource([r],l),delete this.parent.editModule.addRowSelectedItem}if(this.parent.taskFields.parentID)if(r.parentItem){var d="middleSegment"===this.dropPosition?this.parent.taskFields.id:this.parent.taskFields.parentID;r[this.parent.taskFields.parentID]=a[d],r.ganttProperties.parentId=a[d],("ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition||"ProjectView"===this.parent.viewType)&&(r.taskData[this.parent.taskFields.parentID]=a.taskData[d])}else r[this.parent.taskFields.parentID]=null,r.taskData[this.parent.taskFields.parentID]=null,r.ganttProperties.parentId=null},e.prototype.dropMiddle=function(e){var i=this.parent,r=this.parent.editModule.getChildCount(this.droppedRecord,0),n=t.isNullOrUndefined(r)||0===r?e+1:r+e+1;if("middleSegment"===this.dropPosition&&!this.isSharedTask){if(i.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(n,0,this.draggedRecord.taskData),this.treeGridData.splice(n,0,this.draggedRecord),this.parent.ids.splice(n,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var a=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId;this.parent.getTaskIds().splice(n,0,a)}this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,n,this.droppedRecord.expanded),this.recordLevel(),t.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,i=this.draggedRecord,r=this.droppedRecord,n=e.taskFields.child;if(r.hasChildRecords||(r.hasChildRecords=!0,r.childRecords.length||(r.childRecords=[],!e.taskFields.parentID&&t.isNullOrUndefined(r.taskData[n])&&(r.taskData[n]=[]))),"middleSegment"===this.dropPosition){var a=t.extend({},r);delete a.childRecords;var s={uniqueID:a.uniqueID,expanded:a.expanded,level:a.level,index:a.index,taskId:a.ganttProperties.rowUniqueID};if(this.parent.setRecordValue("parentItem",s,i),this.parent.setRecordValue("parentUniqueID",r.uniqueID,i),r.childRecords.splice(r.childRecords.length,0,i),t.isNullOrUndefined(i)||e.taskFields.parentID||t.isNullOrUndefined(r.taskData[n])||r.taskData[e.taskFields.child].splice(r.childRecords.length,0,i.taskData),i.hasChildRecords){i.level=r.level+1,this.parent.setRecordValue("level",this.draggedRecord.level,this.draggedRecord),this.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.treeGridData=m(this.parent)?t.getValue("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource,this.parent.dataSource instanceof n.DataManager?this.ganttData=t.getValue("dataOperation.dataArray",this.parent):this.ganttData=m(this.parent)?t.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).childRecords,r=0;r<i.length;r++)"T"+this.draggedRecord.ganttProperties.taskId=="T"+i[r].ganttProperties.taskId&&(this.isSharedTask=!0,e=i[r]);this.isSharedTask&&this.removeResourceInfo(e)},e.prototype.dropAtTop=function(e){var i=this.parent;if(!this.isSharedTask){if(i.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 n=this.parent.getParentTask(this.droppedRecord.parentItem).childRecords,a=n.indexOf(this.droppedRecord);n.splice(a,0,this.draggedRecord)}t.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 i,r=this.parent;i=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource;var a=e,s=this.parent.getParentTask(a.parentItem);if(a){if(a.parentItem){var o=s?s.childRecords:[],l=0;o&&o.length>0&&("ResourceView"===this.parent.viewType&&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.parent.taskFields.parentID&&s.taskData[this.parent.taskFields.child]&&s.taskData[this.parent.taskFields.child].splice(l,1),this.updateParentRecords.push(s))}if(!this.parent.taskFields.parentID){var d=[];d.push(a.ganttProperties.taskId.toString()),("ProjectView"===this.parent.viewType||"ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition)&&this.parent.editModule.removeFromDataSource(d)}if(r.taskFields.parentID){a.hasChildRecords&&a.childRecords.length>0&&this.removeChildItem(a);for(var p=void 0,h=i.length>0&&"ResourceView"!==this.parent.viewType?i:this.parent.updatedRecords,c=0;c<h.length;c++)"ResourceView"===this.parent.viewType?h[c].ganttProperties.rowUniqueID===a.ganttProperties.rowUniqueID&&(p=c):h[c][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(p=c);if(-1!==p){i.length>0&&i.splice(p,1);var u=this.treeGridData.indexOf(a);this.treeGridData.splice(u,1),this.parent.ids.splice(u,1),-1!==this.parent.treeGrid.parentData.indexOf(a)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(a),1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(p,1)}}var g=this.treeGridData.indexOf(a);if(!r.taskFields.parentID){var f=this.parent.editModule.getChildCount(a,0);this.treeGridData.splice(g,f+1),this.parent.ids.splice(g,f+1);var m=this.ganttData.indexOf(a.taskData);-1!==m&&(this.ganttData.splice(m,1),this.parent.treeGrid.parentData.splice(m,1)),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(g,f+1)}a.parentItem&&s&&s.childRecords&&!s.childRecords.length&&(s.expanded=!1,s.hasChildRecords=!1)}},e.prototype.removeChildItem=function(e){for(var i,r,a=0;a<e.childRecords.length;a++){i=e.childRecords[a];var s=void 0;s=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource;for(var o=0;o<s.length;o++)s[o][this.parent.taskFields.id]===i.taskData[this.parent.taskFields.id]&&(r=o);if(-1!==r){s.length>0&&s.splice(r,1);var l=this.treeGridData.indexOf(i);this.treeGridData.splice(l,1),this.parent.ids.splice(l,1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(r,1)}i.hasChildRecords&&this.removeChildItem(i)}},e.prototype.reorderRows=function(e,t,i){if(!this.parent.readOnly){e[0],"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}(),Mi=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 u.PdfColor(0,0,0),e.columnHeader.fontColor.gray=.2,e.columnHeader.backgroundColor=new u.PdfColor(255,255,255),e.columnHeader.borderColor=new u.PdfColor(234,234,234),e.columnHeader.format.lineAlignment=1,e.columnHeader.format.alignment=0,e.fontFamily=u.PdfFontFamily.Helvetica,e.cell.fontSize=9.5,e.cell.backgroundColor=new u.PdfColor(255,255,255),e.cell.borderColor=new u.PdfColor(234,234,234),e.cell.fontColor=new u.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 u.PdfColor(252,252,252),e.timeline.fontColor=new u.PdfColor(40,40,39),e.chartGridLineColor=new u.PdfColor(206,206,206),e.timeline.borderColor=new u.PdfColor(206,206,206),t){case"Bootstrap":e.taskbar.taskColor=new u.PdfColor(49,122,185),e.taskbar.progressColor=new u.PdfColor(33,82,125),e.taskbar.criticalTaskColor=new u.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new u.PdfColor(255,85,85),e.criticalConnectorLineColor=new u.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new u.PdfColor(255,85,85),e.taskbar.parentTaskColor=new u.PdfColor(119,119,119),e.taskbar.parentProgressColor=new u.PdfColor(85,85,85),e.taskbar.taskBorderColor=new u.PdfColor(33,82,125),e.taskbar.parentTaskBorderColor=new u.PdfColor(85,85,85),e.taskbar.milestoneColor=new u.PdfColor(85,85,85),e.footer.fontColor=new u.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new u.PdfColor(33,82,125),e.footer.backgroundColor=new u.PdfColor(255,255,255),e.taskbar.progressFontColor=new u.PdfColor(255,255,255),e.label.fontColor=new u.PdfColor(0,0,0);break;case"Bootstrap 4":e.taskbar.taskColor=new u.PdfColor(0,123,255),e.taskbar.progressColor=new u.PdfColor(0,86,179),e.taskbar.criticalTaskColor=new u.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new u.PdfColor(255,85,85),e.criticalConnectorLineColor=new u.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new u.PdfColor(255,85,85),e.taskbar.parentTaskColor=new u.PdfColor(108,117,125),e.taskbar.parentProgressColor=new u.PdfColor(73,80,87),e.taskbar.taskBorderColor=new u.PdfColor(0,86,179),e.taskbar.parentTaskBorderColor=new u.PdfColor(73,80,87),e.taskbar.milestoneColor=new u.PdfColor(73,80,87),e.footer.fontColor=new u.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new u.PdfColor(0,86,179),e.footer.backgroundColor=new u.PdfColor(255,255,255),e.taskbar.progressFontColor=new u.PdfColor(255,255,255),e.label.fontColor=new u.PdfColor(33,37,41);break;case"Fabric":e.columnHeader.fontColor=new u.PdfColor(102,102,102),e.cell.fontColor=new u.PdfColor(51,51,51),e.taskbar.taskColor=new u.PdfColor(0,120,214),e.taskbar.progressColor=new u.PdfColor(0,91,163),e.taskbar.criticalTaskColor=new u.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new u.PdfColor(255,85,85),e.criticalConnectorLineColor=new u.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new u.PdfColor(255,85,85),e.taskbar.parentTaskColor=new u.PdfColor(118,118,118),e.taskbar.parentProgressColor=new u.PdfColor(80,80,80),e.taskbar.taskBorderColor=new u.PdfColor(0,91,163),e.taskbar.parentTaskBorderColor=new u.PdfColor(80,80,80),e.taskbar.milestoneColor=new u.PdfColor(80,80,80),e.footer.fontColor=new u.PdfColor(51,51,51),e.footer.fontColor.gray=.2,e.connectorLineColor=new u.PdfColor(0,69,122),e.footer.backgroundColor=new u.PdfColor(255,255,255),e.taskbar.progressFontColor=new u.PdfColor(255,255,255),e.label.fontColor=new u.PdfColor(51,51,51);break;default:e.taskbar.taskColor=new u.PdfColor(88,105,197),e.taskbar.progressColor=new u.PdfColor(63,81,181),e.taskbar.criticalTaskColor=new u.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new u.PdfColor(255,85,85),e.criticalConnectorLineColor=new u.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new u.PdfColor(255,85,85),e.taskbar.parentTaskColor=new u.PdfColor(132,132,132),e.taskbar.parentProgressColor=new u.PdfColor(97,97,97),e.taskbar.taskBorderColor=new u.PdfColor(63,81,181),e.taskbar.parentTaskBorderColor=new u.PdfColor(51,51,51),e.taskbar.milestoneColor=new u.PdfColor(97,97,97),e.footer.fontColor=new u.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new u.PdfColor(63,81,181),e.footer.backgroundColor=new u.PdfColor(255,255,255),e.taskbar.progressFontColor=new u.PdfColor(255,255,255),e.label.fontColor=new u.PdfColor(51,51,51)}},e.prototype.initStyles=function(e){e.columnHeader={},e.columnHeader.format=new u.PdfStringFormat,e.cell={},e.cell.format=new u.PdfStringFormat,e.timeline={},e.footer={},e.footer.format=new u.PdfStringFormat,e.label={},e.taskbar={}},e}(),Ri=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}(),Oi=function(){function e(){var e=new u.PdfPen(new u.PdfColor(0,0,0));e.dashStyle=u.PdfDashStyle.Solid;var t=new u.PdfPen(new u.PdfColor(0,0,0));t.dashStyle=u.PdfDashStyle.Solid;var i=new u.PdfPen(new u.PdfColor(0,0,0));i.dashStyle=u.PdfDashStyle.Solid;var r=new u.PdfPen(new u.PdfColor(0,0,0));r.dashStyle=u.PdfDashStyle.Solid,this.leftPen=e,this.rightPen=t,this.topPen=i,this.bottomPen=r}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}(),xi=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}(),Ii=function(){return function(){this.cellSpacing=0,this.borderOverlapStyle=u.PdfBorderOverlapStyle.Overlap,this.allowHorizontalOverflow=!1,this.horizontalOverflowType=e.PdfHorizontalOverflowType.LastPage,this.cellPadding=new xi}}(),Ei=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)}}(),Fi=function(i){function r(e){var t=i.call(this,e)||this;return t.columnRanges=[],t.repeatRowIndex=-1,t.currentBounds=new u.RectangleF(0,0,0,0),t}return Ei(r,i),Object.defineProperty(r.prototype,"treegrid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),r.prototype.layoutInternal=function(e){if(t.isNullOrUndefined(e))throw Error("Argument Null Expection");this.currentPage=e.page;var i=e.format;if(null!==this.currentPage&&(this.currentPageBounds=this.currentPage.getClientSize()),this.currentGraphics=this.currentPage.graphics,null!==i&&i.break===u.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new u.RectangleF(new u.PointF(e.bounds.x,e.bounds.y),new u.SizeF(this.treegrid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new u.RectangleF(new u.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 u.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)},r.prototype.determineColumnDrawRanges=function(){for(var e=0,t=0,i=0,r=this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.treegrid.columns.count;n++)if((i+=this.treegrid.columns.getColumn(n).width)>=r){for(var a=0,s=e;s<=n&&!((a+=this.treegrid.columns.getColumn(s).width)>r);s++)t=s;this.columnRanges.push([e,t]),e=t+1,i=t<=n?this.treegrid.columns.getColumn(n).width:0}this.columnRanges.push([e,this.treegrid.columns.count-1])},r.prototype.getFormat=function(e){return e},r.prototype.layoutOnPage=function(t){for(var i=this.getFormat(t.format),r=null,n=new Ri,a=t.page,s=0;s<this.columnRanges.length;s++){var o=this.columnRanges[s];this.cellStartIndex=o[0],this.cellEndIndex=o[1];for(var l=this.treegrid.rows.count,d=0,p=!1,h=0;h<l;h++){var c=this.treegrid.rows.getRow(h);d++;var g=this.currentBounds.y;null===this.currentPage||n.containsKey(this.currentPage)||n.add(this.currentPage,o);var f=this.drawRow(c);for(g===this.currentBounds.y?(p=!0,this.repeatRowIndex=this.treegrid.rows.rowCollection.indexOf(c)):(p=!1,this.repeatRowIndex=-1);!f.isFinish&&null!==a;)if(this.treegrid.allowRowBreakAcrossPages)this.currentPage=this.getNextPageFormat(i),this.treegrid.enableHeader&&this.drawHeader(),this.checkBounds(i),f=this.drawRow(c);else{if(!this.treegrid.allowRowBreakAcrossPages&&d<length){this.currentPage=this.getNextPageFormat(i),this.treegrid.enableHeader&&this.drawHeader();break}if(d>=length)break}!f.isFinish&&null!==a&&i.layout!==u.PdfLayoutType.OnePage&&p&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageFormat(i),this.treegrid.enableHeader&&this.drawHeader(),this.startLocation.y=this.currentBounds.y,i.paginateBounds===new u.RectangleF(0,0,0,0)&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===Oi.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.drawRow(c),null===this.currentPage||n.containsKey(this.currentPage)||n.add(this.currentPage,o))}this.columnRanges.indexOf(o)<this.columnRanges.length-1&&null!==a&&i.layout!==u.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageFormat(i),this.checkBounds(i))}return r=this.getLayoutResult(),this.treegrid.style.allowHorizontalOverflow&&this.treegrid.style.horizontalOverflowType===e.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(n),r},r.prototype.checkBounds=function(e){var t=new u.PointF(Oi.default.right.width/2,Oi.default.top.width/2);e.paginateBounds===new u.RectangleF(0,0,0,0)&&this.startLocation===t&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)},r.prototype.drawHeader=function(){this.drawRow(this.treegrid.rows.getRow(0))},r.prototype.reArrangePages=function(e){for(var t=this.currentPage.document,i=[],r=e.keys(),n=0;n<r.length;n++){(o=r[n]).section=null,i.push(o),t.pages.remove(o)}for(n=0;n<e.size();n++)for(var a=e.size()/this.columnRanges.length,s=n;s<e.size();s+=a){var o=i[s];-1===t.pages.indexOf(o)&&t.pages.add(o)}},r.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 u.RectangleF(new u.PointF(0,0),i.getClientSize()),i},r.prototype.getLayoutResult=function(){var e=new u.RectangleF(this.startLocation,new u.SizeF(this.currentBounds.width,this.currentBounds.y-this.startLocation.y));return new Ui(this.currentPage,e)},r.prototype.checkIfDefaultFormat=function(e){var t=new u.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},r.prototype.drawRow=function(e,i,r){if(t.isNullOrUndefined(i)){var n=new u.RowLayoutResult;return(r=e.rowBreakHeight>0?e.rowBreakHeight:e.height)>this.currentPageBounds.height?this.treegrid.allowRowBreakAcrossPages?(n.isFinish=!0,this.drawRowWithBreak(n,e,r)):(n.isFinish=!1,this.drawRow(e,n,r)):this.currentBounds.y+r>this.currentPageBounds.height||this.currentBounds.y+r>this.currentBounds.height?this.repeatRowIndex>-1&&this.repeatRowIndex===e.rowIndex?this.treegrid.allowRowBreakAcrossPages?(n.isFinish=!0,this.drawRowWithBreak(n,e,r)):(n.isFinish=!1,this.drawRow(e,n,r)):n.isFinish=!1:(n.isFinish=!0,this.drawRow(e,n,r)),n}var a=new u.PointF(this.currentBounds.x,this.currentBounds.y);i.bounds=new u.RectangleF(a,new u.SizeF(0,0));var s=0;r=this.reCalculateHeight(e,r);for(var o=this.cellStartIndex;o<=this.cellEndIndex;o++){var l=e.cells.getCell(o),d=this.treegrid.columns.getColumn(o);d.isTreeColumn&&(s=10*e.level);var p=o>this.cellEndIndex+1&&l.columnSpan>1;if(!p)for(var h=1;h<l.columnSpan;h++)e.cells.getCell(o+h).isCellMergeContinue=!0;var c=new u.SizeF(d.width,r);!this.checkIfDefaultFormat(d.format)&&this.checkIfDefaultFormat(l.style.format)&&(l.style.format=d.format),l.draw(this.currentGraphics,new u.RectangleF(a,c),p,s),e.treegrid.style.allowHorizontalOverflow&&(l.columnSpan>this.cellEndIndex||o+l.columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),a.x+=d.width,s=0}return this.currentBounds.y+=r,i.bounds=new u.RectangleF(new u.PointF(i.bounds.x,i.bounds.y),new u.SizeF(a.x,a.y)),null},r.prototype.drawRowWithBreak=function(e,t,i){var r=new u.PointF(this.currentBounds.x,this.currentBounds.y);e.bounds=new u.RectangleF(r,new u.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++){(l=t.cells.getCell(a)).measureHeight()===i&&null===l.value&&(t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height)}for(var s=this.cellStartIndex;s<=this.cellEndIndex;s++){var o=this.treegrid.columns.getColumn(s);o.isTreeColumn&&(n=10*t.level);var l,d=(l=t.cells.getCell(s)).columnSpan+s>this.cellEndIndex+1&&l.columnSpan>1;if(!d)for(var p=1;p<l.columnSpan;p++)t.cells.getCell(s+p).isCellMergeContinue=!0;var h=this.treegridHeight>0?this.treegridHeight:this.currentBounds.height,c=new u.SizeF(o.width,h);!this.checkIfDefaultFormat(o.format)&&this.checkIfDefaultFormat(l.style.format)&&(l.style.format=o.format),l.draw(this.currentGraphics,new u.RectangleF(r,c),d,n),e.isFinish=e.isFinish?l.finishedDrawingCell:e.isFinish,r.x+=o.width,n=0,this.currentBounds.y+=this.treegridHeight>0?this.treegridHeight:i,e.bounds=new u.RectangleF(new u.PointF(e.bounds.x,e.bounds.y),new u.SizeF(r.x,r.y))}},r.prototype.reCalculateHeight=function(e,i){for(var r=0,n=this.cellStartIndex;n<=this.cellEndIndex;n++)t.isNullOrUndefined(e.cells.getCell(n).remainingString)&&""!==e.cells.getCell(n).remainingString||(r=Math.max(r,e.cells.getCell(n).measureHeight()));return Math.max(i,r)},r}(u.ElementLayouter),Ui=function(e){function t(t,i){return e.call(this,t,i)||this}return Ei(t,e),t}(u.PdfLayoutResult),Vi=function(e){function t(t){return void 0===t?e.call(this)||this:e.call(this,t)||this}return Ei(t,e),t}(u.PdfLayoutFormat),Li=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)}}(),Ni=function(e){function t(){var t=e.call(this)||this;return t.treeGridSize=new u.SizeF(0,0),t.treeColumnIndex=0,t.allowRowBreakAcrossPages=!0,t.enableHeader=!0,t.isFitToWidth=!1,t.columns=new qi(t),t.rows=new Wi(t),t.headers=new ji(t),t.style=new Ii,t.rowHeight=0,t}return Li(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 u.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 u.RectangleF&&void 0!==t.width&&void 0===i)return this.drawHelper(e,t,null);if(t instanceof u.PointF&&void 0===t.width&&i instanceof u.PdfLayoutFormat)return this.drawHelper(e,t.x,t.y,i);if("number"==typeof t&&"number"==typeof i&&(r instanceof u.PdfLayoutFormat||null==r)){var n=e.graphics.clientSize.width-t,a=new u.RectangleF(t,i,n,0);return this.drawHelper(e,a,r)}return t instanceof u.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{t=[];var r=0,n=0,a=this.columns.count;for(i=0;i<a;i++){for(var s=this.rows.count,o=0;o<s;o++){var l=this.rows.getRow(o).cells.getCell(i).width,d=this.initialWidth>0?Math.min(this.initialWidth,l):l;r=Math.max(r,d),r=Math.max(this.columns.getColumn(i).width,r),this.columns.getColumn(i).isTreeColumn&&(n=Math.max(n,this.rows.getRow(o).level))}this.columns.getColumn(i).isTreeColumn?t.push(r+10*n):t.push(r),r=0}for(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++){e+=this.headers.getHeader(i).height}for(i=0;i<this.rows.count;i++){e+=this.rows.getRow(i).height}return new u.SizeF(t,e)},t.prototype.drawGrid=function(e,t,i,r){this.initialWidth=e.graphics.clientSize.width;var n=new u.RectangleF(0,0,e.getClientSize().height,0);return this.draw(e,n,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,r=t.borders.top.width/2;if(e.bounds.x===Oi.default.right.width/2&&e.bounds.y===Oi.default.right.width/2){var n=new u.RectangleF(new u.PointF(i,r),new u.SizeF(this.size.width,this.size.height));e.bounds=n}}}this.setSpan(),this.layouter=new Fi(this);return 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++){n=0;for(var o=(p=this.headers.getHeader(s)).cells.count,l=0;l<o;l++){var d=p.cells.getCell(l);if(n=Math.max(n,d.rowSpan),!d.isCellMergeContinue&&!d.isRowMergeContinue&&(d.columnSpan>1||d.rowSpan>1)){if(d.columnSpan+l>p.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(d.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+s.toString());if(d.columnSpan>1&&d.rowSpan>1){for(e=d.columnSpan,t=d.rowSpan,i=l,r=s,d.isCellMergeStart=!0,d.isRowMergeStart=!0;e>1;)i++,p.cells.getCell(i).isCellMergeContinue=!0,p.cells.getCell(i).isRowMergeContinue=!0,p.cells.getCell(i).rowSpan=t,e--;for(i=l,e=d.columnSpan;t>1;){for(r++,this.headers.getHeader(r).cells.getCell(l).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=d.columnSpan,i=l}}else if(d.columnSpan>1&&1===d.rowSpan)for(e=d.columnSpan,i=l,d.isCellMergeStart=!0;e>1;)i++,p.cells.getCell(i).isCellMergeContinue=!0,e--;else if(1===d.columnSpan&&d.rowSpan>1)for(t=d.rowSpan,r=s;t>1;)r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,t--}}p.maximumRowSpan=n}e=t=1,i=r=0,a=this.rows.count;for(s=0;s<a;s++){var p,h=(p=this.rows.getRow(s)).cells.count;for(l=0;l<h;l++){if(!(d=p.cells.getCell(l)).isCellMergeContinue&&!d.isRowMergeContinue&&(d.columnSpan>1||d.rowSpan>1)){if(d.columnSpan+l>p.cells.count)throw new Error("Invalid span specified at row {0} column {1} "+l.toString());if(d.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row {0} column {1} "+l.toString());if(d.columnSpan>1&&d.rowSpan>1){for(e=d.columnSpan,t=d.rowSpan,i=l,r=s,d.isCellMergeStart=!0,d.isRowMergeStart=!0;e>1;)i++,p.cells.getCell(i).isCellMergeContinue=!0,e--;for(i=l,e=d.columnSpan;t>1;){for(r++,this.rows.getRow(r).cells.getCell(l).isRowMergeContinue=!0,t--;e>1;)i++,this.rows.getRow(r).cells.getCell(i).isCellMergeContinue=!0,e--;e=d.columnSpan,i=l}}else if(d.columnSpan>1&&1===d.rowSpan)for(e=d.columnSpan,i=l,d.isCellMergeStart=!0;e>1;)i++,p.cells.getCell(i).isCellMergeContinue=!0,e--;else if(1===d.columnSpan&&d.rowSpan>1)for(t=d.rowSpan,r=s;t>1;)r++,this.rows.getRow(r).cells.getCell(l).isRowMergeContinue=!0,t--}}}},t}(u.PdfLayoutElement),Bi=function(){function e(e){this.cellWidth=0,this.cellHeight=0,this.finishedDrawingCell=!0,t.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 u.PdfStringLayouter;if("string"==typeof this.value){var i=new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);e+=t.layout(this.value,i,this.style.format,new u.SizeF(Number.MAX_VALUE,Number.MAX_VALUE),!1,new u.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,i=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 n=new u.PdfStringLayouter;if("string"==typeof this.value||"string"==typeof this.remainingString){var a=this.value;this.finishedDrawingCell||(a=t.isNullOrUndefined(this.remainingString)||""===this.remainingString?this.value:this.remainingString);var s=new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);i+=n.layout(a,s,this.style.format,new u.SizeF(r,0),!1,new u.SizeF(0,0)).actualSize.height,i+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}return i+=this.row.treegrid.style.cellPadding.top+this.row.treegrid.style.cellPadding.bottom,(i+=this.row.treegrid.style.cellSpacing)>e?i: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 a=this.row.cells.indexOf(this),s=a+1;s<=a+this.columnSpan;s++)this.row.cells.getCell(s).isCellMergeContinue=!1,this.row.cells.getCell(s).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 o=new u.PdfSolidBrush(this.style.fontColor),l=null;l=this.row.isParentRow?new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,u.PdfFontStyle.Bold):new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);var d=t;if(this.isHeaderCell||(d.x=d.x,d.width=d.width),d.height>=e.clientSize.height&&(this.row.treegrid.allowRowBreakAcrossPages?(d.height-=d.y,t.height-=t.y):(d.height=e.clientSize.height,t.height=e.clientSize.height)),d=this.adjustContentLayoutArea(d),"string"==typeof this.value||"string"==typeof this.remainingString){var p=null;this.finishedDrawingCell?(p=""===this.remainingString?this.remainingString:this.value,e.drawString(p,l,null,o,d.x+r,d.y,d.width-r-10,d.height-10,this.style.format)):e.drawString(this.remainingString,l,null,o,d.x+r,d.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 u.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 u.RectangleF(new u.PointF(e.x,e.y),new u.SizeF(e.width,e.height)),i=this.style.padding;if(this.value instanceof Ni){var r=this.value.size;this.style.format.alignment===u.PdfTextAlignment.Center?(t.x+=i.left+(t.width-r.width)/2,t.y+=i.top+(t.height-r.height)/2):this.style.format.alignment===u.PdfTextAlignment.Left?(t.x+=i.left,t.y+=i.top):this.style.format.alignment===u.PdfTextAlignment.Right&&(t.x+=i.left+(t.width-r.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===u.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 u.PointF(t.x,t.y+t.height),r=new u.PointF(t.x,t.y),n=this.style.borders.left;this.style.borders.left.dashStyle===u.PdfDashStyle.Solid&&(n.lineCap=u.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new u.PointF(t.x+t.width,t.y),r=new u.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 u.PointF(e.clientSize.width-n.width/2,t.y),r=new u.PointF(e.clientSize.width-n.width/2,t.y+t.height)),this.style.borders.right.dashStyle===u.PdfDashStyle.Solid&&(n.lineCap=u.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new u.PointF(t.x,t.y),r=new u.PointF(t.x+t.width,t.y),n=this.style.borders.top,this.style.borders.top.dashStyle===u.PdfDashStyle.Solid&&(n.lineCap=u.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new u.PointF(t.x+t.width,t.y+t.height),r=new u.PointF(t.x,t.y+t.height),n=this.style.borders.bottom,t.y+t.height>e.clientSize.height-n.width/2&&(i=new u.PointF(t.x+t.width,e.clientSize.height-n.width/2),r=new u.PointF(t.x,e.clientSize.height-n.width/2)),this.style.borders.bottom.dashStyle===u.PdfDashStyle.Solid&&(n.lineCap=u.PdfLineCap.Square),e.drawLine(n,i,r),e.restore()},e}(),Ai=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 Bi;return this.add(t),e}e.row=this.treegridRow,this.cells.push(e)},e.prototype.indexOf=function(e){return this.cells.indexOf(e)},e}(),Hi=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 t.isNullOrUndefined(this.treegridCells)&&(this.treegridCells=new Ai(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}(),Wi=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 Hi(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 Bi);this.rows.push(e)},e.prototype.getRow=function(e){return this.rows[e]},e}(),ji=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}(),Gi=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 u.PdfStringFormat),this.stringFormat},set:function(e){this.stringFormat=e},enumerable:!0,configurable:!0}),e}(),qi=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 Gi(this.treegrid));for(var i=0;i<this.treegrid.rows.count;i++){var r=this.treegrid.rows.getRow(i),n=new Bi;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(r=0;r<this.count;r++){var n=e/i;t[r]<=0&&(t[r]=n)}return t},e}(),zi=function(){function e(e){this.parent=e}return e.prototype.processGridExport=function(e,t,i){this.flatData=e,this.gantt=t,this.exportValueFormatter=new _i(this.parent.locale),this.exportProps=i,this.rowIndex=0,this.colIndex=0,this.columns=this.parent.treeGrid.columns,this.gantt.treeColumnIndex=this.parent.treeColumnIndex,this.gantt.rowHeight=S(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.processHeaderContent(),this.processGanttContent(),this.processTimeline(),this.processTaskbar(),this.processPredecessor()},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 i=this.gantt.columns.getColumn(t);this.parent.treeColumnIndex===t&&(i.isTreeColumn=!0);var r=parseInt(e.width,10);i.width=S(r),this.totalColumnWidth+=i.width,i.headerText=e.headerText,i.field=e.field;var n=this.row.cells.getCell(t);n.value=e.headerText,n.isHeaderCell=!0;var a=this.parent.timelineModule.isSingleTier?45:60;this.copyStyles(this.ganttStyle.columnHeader,n,!1),this.row.height=S(a),e.headerTextAlign&&(n.style.format.alignment=u.PdfTextAlignment[e.headerTextAlign]);var s={cell:n,style:n.style,value:n.value,column:e};this.parent.pdfColumnHeaderQueryCellInfo&&this.parent.trigger("pdfColumnHeaderQueryCellInfo",s),n.value=s.value},e.prototype.isColumnVisible=function(e){var i=e.visible||this.exportProps.includeHiddenColumn,r=!!t.isNullOrUndefined(e.template);return i&&r},e.prototype.processGanttContent=function(){var e=this;0===this.flatData.length?this.renderEmptyGantt():this.flatData.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.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=t.extend([],[],e.topTierCollection,!0),this.gantt.chartHeader.bottomTier=t.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;(t.isNullOrUndefined(this.exportProps.showPredecessorLines)||this.exportProps.showPredecessorLines)&&(this.parent.pdfExportModule.isPdfExport=!0,this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.updatedConnectorLineCollection.forEach(function(t){var i=e.gantt.predecessor.add();i.parentLeft=t.parentLeft,i.childLeft=t.childLeft,i.parentWidth=t.parentWidth,i.childWidth=t.childWidth,i.parentIndex=t.parentIndex,i.childIndex=t.childIndex,i.rowHeight=t.rowHeight,i.type=t.type,i.milestoneParent=t.milestoneParent,i.milestoneChild=t.milestoneChild,i.lineWidth=e.parent.connectorLineWidth>5?S(5):S(e.parent.connectorLineWidth),t.isCritical?i.connectorLineColor=e.ganttStyle.criticalConnectorLineColor:i.connectorLineColor=e.ganttStyle.connectorLineColor,i.connectorLineColor=e.ganttStyle.connectorLineColor,e.gantt.predecessorCollection.push(i)}),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,i,r){var n=r.cells.getCell(this.colIndex),a=this.parent.taskFields,s=e.ganttProperties;"datepickeredit"===i.editType||"datetimepickeredit"===i.editType?n.value=e[i.field]:i.field===a.duration?n.value=this.parent.getDurationString(s.duration,s.durationUnit):i.field===a.resourceInfo?n.value=s.resourceNames:i.field===a.work?n.value=this.parent.getWorkString(s.work,s.workUnit):n.value=t.isNullOrUndefined(e[i.field])?"":e[i.field].toString(),n.isHeaderCell=!1,n.style.padding=new xi,this.copyStyles(this.ganttStyle.cell,n,r.isParentRow),this.colIndex!==this.parent.treeColumnIndex?n.style.format.alignment=u.PdfTextAlignment[i.textAlign]:n.style.format.paragraphIndent=10*n.row.level;var o={data:e,value:n.value,column:i,style:n.style,cell:n};o.value=this.exportValueFormatter.formatCellValue(o),this.parent.pdfQueryCellInfo&&this.parent.trigger("pdfQueryCellInfo",o),n.value=o.value},e.prototype.processTaskbar=function(){var e=this;this.flatData.forEach(function(i){var r=e.gantt.taskbar.add(),n=i.ganttProperties;r.left=n.left,r.width=n.width,r.left<0&&(r.width=r.width+r.left,r.left=0),r.progress=n.progress,r.isScheduledTask=f(n),f?t.isNullOrUndefined(n.endDate)&&t.isNullOrUndefined(n.duration)?r.unscheduledTaskBy="startDate":t.isNullOrUndefined(n.startDate)&&t.isNullOrUndefined(n.duration)?r.unscheduledTaskBy="endDate":(r.unscheduledTaskBy="duration",r.unscheduleStarteDate=e.parent.dateValidationModule.getValidStartDate(i.ganttProperties),r.unscheduleEndDate=e.parent.dateValidationModule.getValidEndDate(i.ganttProperties)):(r.unscheduleStarteDate=null,r.unscheduleEndDate=null),r.startDate=n.startDate,r.endDate=n.endDate,r.height=e.parent.chartRowsModule.taskBarHeight,r.isMilestone=n.isMilestone,r.milestoneColor=new u.PdfColor(e.ganttStyle.taskbar.milestoneColor),r.isParentTask=i.hasChildRecords,n.isMilestone&&(r.height=n.width),i[e.parent.labelSettings.leftLabel]&&(r.leftTaskLabel.value=i[e.parent.labelSettings.leftLabel].toString()),i[e.parent.labelSettings.rightLabel]&&(r.rightTaskLabel.value=i[e.parent.labelSettings.rightLabel].toString()),i[e.parent.labelSettings.taskLabel]&&(r.taskLabel=i[e.parent.labelSettings.taskLabel].toString());var a=n.isMilestone?Math.floor(e.parent.chartRowsModule.taskBarHeight/2)+33:33;r.rightTaskLabel.left=n.left+n.width+a,r.fontFamily=e.ganttStyle.fontFamily,r.progressWidth=n.progressWidth,r.labelColor=new u.PdfColor(e.ganttStyle.label.fontColor),r.progressFontColor=new u.PdfColor(e.ganttStyle.taskbar.progressFontColor),r.isParentTask?(r.taskColor=new u.PdfColor(e.ganttStyle.taskbar.parentTaskColor),r.taskBorderColor=new u.PdfColor(e.ganttStyle.taskbar.parentTaskBorderColor),r.progressColor=new u.PdfColor(e.ganttStyle.taskbar.parentProgressColor)):i.isCritical?(r.taskColor=new u.PdfColor(e.ganttStyle.taskbar.criticalTaskColor),r.progressColor=new u.PdfColor(e.ganttStyle.taskbar.criticalProgressColor),r.taskBorderColor=new u.PdfColor(e.ganttStyle.taskbar.criticalTaskBorderColor)):(r.taskColor=new u.PdfColor(e.ganttStyle.taskbar.taskColor),r.progressColor=new u.PdfColor(e.ganttStyle.taskbar.progressColor),r.taskBorderColor=new u.PdfColor(e.ganttStyle.taskbar.taskBorderColor)),r.gridLineColor=new u.PdfColor(e.ganttStyle.chartGridLineColor),e.gantt.taskbarCollection.push(r);var s={};s.progressFontColor=r.progressFontColor,s.taskColor=r.taskColor,s.taskBorderColor=r.taskBorderColor,s.progressColor=r.progressColor,s.milestoneColor=r.milestoneColor;var o={taskbar:s,data:i};e.parent.pdfQueryTaskbarInfo&&(e.parent.trigger("pdfQueryTaskbarInfo",o),r.progressFontColor=o.taskbar.progressFontColor,r.taskColor=o.taskbar.taskColor,r.taskBorderColor=o.taskbar.taskBorderColor,r.progressColor=o.taskbar.progressColor,r.milestoneColor=o.taskbar.milestoneColor)})},e.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new u.PdfStringFormat),e){case"Right":t.alignment=u.PdfTextAlignment.Right;break;case"Center":t.alignment=u.PdfTextAlignment.Center;break;case"Justify":t.alignment=u.PdfTextAlignment.Justify;break;case"Left":t.alignment=u.PdfTextAlignment.Left}return t},e.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new u.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=u.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=u.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=u.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 i=t.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,r=t.isNullOrUndefined(e.style.fontFamily)?u.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),n=u.PdfFontStyle.Regular;return!t.isNullOrUndefined(e.style.bold)&&e.style.bold&&(n|=u.PdfFontStyle.Bold),!t.isNullOrUndefined(e.style.italic)&&e.style.italic&&(n|=u.PdfFontStyle.Italic),!t.isNullOrUndefined(e.style.underline)&&e.style.underline&&(n|=u.PdfFontStyle.Underline),!t.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(n|=u.PdfFontStyle.Strikeout),new u.PdfStandardFont(r,i,n)},e.prototype.renderEmptyGantt=function(){var e=this.gantt.rows.addRow();e.cells.getCell(0).isHeaderCell=!1,e.height=S(this.parent.rowHeight),this.copyStyles(this.ganttStyle.columnHeader,e.cells.getCell(0),e.isParentRow);var t=this.columns.length;this.mergeCells(0,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 u.PdfColor(e.fontColor),t.style.backgroundColor=new u.PdfColor(e.backgroundColor),t.style.borderColor=new u.PdfColor(e.borderColor),t.style.fontSize=e.fontSize,t.style.fontStyle=e.fontStyle,t.style.format=Object.assign(new u.PdfStringFormat,e.format),t.style.borders=new Oi,t.style.borders.all=new u.PdfPen(t.style.borderColor),t.style.padding=new xi;var r=0;r=t.isHeaderCell?this.parent.timelineModule.isSingleTier?22.5:30:this.parent.rowHeight/2,t.style.padding.top=r-e.fontSize,t.style.padding.bottom=r-e.fontSize,t.style.padding.left=10,t.style.padding.right=10},e.prototype.initializePdf=function(e){this.pdfDoc=e;var i=[],r=this.pdfDoc.pageSettings.width-82;if(this.totalColumnWidth>this.pdfDoc.pageSettings.width-82?this.gantt.style.allowHorizontalOverflow=!0:r/this.columns.length<i[0]&&(this.gantt.columns.getColumn(0).width=i[0]),this.exportProps.enableFooter||t.isNullOrUndefined(this.exportProps.enableFooter)){var n=new u.RectangleF(0,0,e.pageSettings.width,35),a=new u.PdfPen(this.ganttStyle.chartGridLineColor),s=new u.PdfPageTemplateElement(n),o=new u.PdfSolidBrush(this.ganttStyle.footer.backgroundColor);s.graphics.drawRectangle(a,o,0,0,e.pageSettings.width,35);var l=new u.PdfStandardFont(this.ganttStyle.fontFamily,this.ganttStyle.footer.fontSize,this.ganttStyle.footer.fontStyle),d=new u.PdfSolidBrush(this.ganttStyle.footer.fontColor),p=new u.PdfPageNumberField(l),h=new u.PdfPageCountField(l,d),c=new u.PdfCompositeField(l,d,"Page {0}",p,h);c.stringFormat=this.ganttStyle.footer.format,c.bounds=n,c.draw(s.graphics,new u.PointF(0,0)),e.template.bottom=s}},e}(),_i=function(){function e(e){this.valueFormatter=new r.ValueFormatter(e),this.internationalization=new t.Internationalization(e)}return e.prototype.returnFormattedValue=function(e,i){return!t.isNullOrUndefined(e.value)&&e.value?this.valueFormatter.getFormatFunction(i)(e.value):""},e.prototype.formatCellValue=function(e){if(e.isForeignKey&&(e.value=t.getValue(e.column.foreignKeyValue,r.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(t.isNullOrUndefined(e.column.type)||t.isNullOrUndefined(e.value))&&t.isNullOrUndefined(e.value)?"":e.value.toString();if("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format){var i=void 0;return i="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,i)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var n=void 0;return n="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,n)},e}(),Xi=function(){return(Xi=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}).apply(this,arguments)},Yi=function(){function e(e){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,i,r,n,a,s){var o=e.graphics,l=!1,d=e.getClientSize();i.y+a>d.height&&(o=(e=this.GetNextPage(e)).graphics,i.y=0,this.parent.pdfExportModule.gantt.enableHeader&&(this.parent.pdfExportModule.gantt.chartHeader.drawPageTimeline(e,i,r),i.y=S(this.parent.timelineModule.isSingleTier?45:60)),l=!0),this.drawLeftLabel(e,i,r,n);var p=new u.PdfStandardFont(this.fontFamily,9,u.PdfFontStyle.Regular),h=new u.PdfSolidBrush(this.progressFontColor),c=new u.PdfStringFormat;c.lineAlignment=u.PdfVerticalAlignment.Middle,c.alignment=u.PdfTextAlignment.Right;var g,f=!1;/^[a-zA-Z]/.test(this.taskLabel)&&(f=!0,c.alignment=u.PdfTextAlignment.Left);var m=-1;if(s.isMilestone)this.drawMilestone(e,i,r,n);else{var y=new u.PdfPen(s.taskBorderColor),v=new u.PdfSolidBrush(s.taskColor),D=new u.PdfPen(s.progressColor),w=new u.PdfSolidBrush(s.progressColor),k=S((this.parent.rowHeight-this.height)/2);m=e.section.indexOf(e);var T=t.isNullOrUndefined(this.unscheduleStarteDate)?this.startDate:this.unscheduleStarteDate,b=t.isNullOrUndefined(this.unscheduleEndDate)?this.endDate:this.unscheduleEndDate;if(r.startDate<=T&&b<=r.endDate)this.isStartPoint||(this.taskStartPoint=Xi({},i),this.isStartPoint=!0),this.isScheduledTask||"duration"===this.unscheduledTaskBy?(o.drawRectangle(y,v,i.x+S(this.left-n)+.5,i.y+k,S(s.width),S(s.height)),this.isScheduledTask&&(o.drawRectangle(D,w,i.x+S(this.left-n)+.5,i.y+k,S(s.progressWidth),S(s.height)),t.isNullOrUndefined(this.parent.labelSettings.taskLabel)||t.isNullOrUndefined(this.taskLabel)||(g=this.progressWidth,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+S(this.left-n),i.y+k,S(g),S(this.height),c)))):this.drawUnscheduledTask(o,i,n,k),this.isCompleted=!0,this.startPage=m,this.endPage=m;else if(r.startDate<=T&&r.endDate>=T&&b>=r.endDate){this.isStartPoint||(this.taskStartPoint=Xi({},i),this.isStartPoint=!0);var P=0;if(f||(this.width=this.width-(r.totalWidth-(this.left-n))),P=r.totalWidth-(this.left-n),this.isScheduledTask||"duration"===this.unscheduledTaskBy){if(o.drawRectangle(y,v,i.x+S(this.left-n)+.5,i.y+k,S(P),S(s.height)),this.isScheduledTask){var C=0;C=this.progressWidth<=P?this.progressWidth:P,o.drawRectangle(D,w,i.x+S(this.left-n)+.5,i.y+k,S(C),S(s.height)),this.progressWidth-=C,this.parent.labelSettings.taskLabel&&!t.isNullOrUndefined(this.taskLabel)&&(g=C,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+S(this.left-n),i.y+k,S(g),S(this.height),c))}}else this.drawUnscheduledTask(o,i,n,k);this.left=0,this.isCompleted=!1,this.startPage=m}else if(b<=r.endDate&&r.startDate<=b&&!this.isCompleted)this.isStartPoint||(this.taskStartPoint=Xi({},i),this.isStartPoint=!0),o.drawRectangle(y,v,i.x+S(s.left+.5),i.y+k,S(s.width),S(s.height)),this.isScheduledTask&&(o.drawRectangle(D,w,i.x+S(s.left+.5),i.y+k,S(s.progressWidth),S(s.height)),t.isNullOrUndefined(this.taskLabel)||(g=this.progressWidth,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+S(this.left),i.y+k,S(g),S(this.height),c))),this.isCompleted=!0,this.endPage=m;else if(T<r.startDate&&b>r.endDate){if(this.isStartPoint||(this.taskStartPoint=Xi({},i),this.isStartPoint=!0),o.drawRectangle(y,v,i.x+S(s.left)+.5,i.y+k,S(r.totalWidth),S(s.height)),this.isScheduledTask){C=0;C=this.progressWidth<=r.totalWidth?this.progressWidth:r.totalWidth,o.drawRectangle(D,w,i.x+S(s.left)+.5,i.y+k,S(C),S(s.height)),this.progressWidth-=C,t.isNullOrUndefined(this.taskLabel)||(g=C,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+S(this.left),i.y+k,S(g),S(this.height),c))}this.isCompleted=!1,this.width-=r.totalWidth}}return this.drawRightLabel(e,i,r,n),l},e.prototype.drawRightLabel=function(e,i,r,n){var a,s=e.graphics,o=(a=this.rightTaskLabel.isLeftCalculated?this.rightTaskLabel.left:S(this.rightTaskLabel.left))-S(n)+i.x;if(r.startPoint<=a&&a<r.endPoint&&!t.isNullOrUndefined(this.rightTaskLabel.value)&&!this.rightTaskLabel.isCompleted){var l=this.getWidth(this.rightTaskLabel.value,r.endPoint-a,15),d=new u.PdfStandardFont(this.fontFamily,9),p=(S(this.parent.rowHeight)-l.actualSize.height)/2,h=new u.PointF(o,i.y+p),c=new u.SizeF(l.actualSize.width,l.actualSize.height),g=new u.RectangleF(h,c),f=new u.PdfStringFormat;if(f.alignment=u.PdfTextAlignment.Right,f.lineAlignment=u.PdfVerticalAlignment.Middle,l.actualSize.width>0){var m=new u.PdfSolidBrush(this.labelColor);s.drawString(l.lines[0].text,d,null,m,g.x,g.y,l.actualSize.width,l.actualSize.height,f),null!==l.remainder?(this.rightTaskLabel.value=l.remainder,this.rightTaskLabel.left=r.endPoint,this.rightTaskLabel.isLeftCalculated=!0):this.rightTaskLabel.isCompleted=!0}else this.rightTaskLabel.left=r.endPoint}},e.prototype.drawLeftLabel=function(e,i,r,n){var a,s=e.graphics;if(!t.isNullOrUndefined(this.leftTaskLabel.value)){var o=0;if(o=this.left,this.leftTaskLabel.isLeftCalculated)a=this.leftTaskLabel.left;else{var l=this.getWidth(this.leftTaskLabel.value,Number.MAX_VALUE,15);a=S(o-(this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33))-l.actualSize.width,this.leftTaskLabel.left=a,this.leftTaskLabel.isLeftCalculated=!0}var d=a-S(n)+i.x;if(r.startPoint<=a&&a<r.endPoint&&!t.isNullOrUndefined(this.leftTaskLabel.value)&&!this.leftTaskLabel.isCompleted){l=this.getWidth(this.leftTaskLabel.value,r.endPoint-a,15);var p=new u.PdfStandardFont(this.fontFamily,9),h=(S(this.parent.rowHeight)-l.actualSize.height)/2,c=new u.PointF(d,i.y+h),g=new u.SizeF(l.actualSize.width,l.actualSize.height),f=new u.RectangleF(c,g),m=new u.PdfStringFormat;if(m.alignment=u.PdfTextAlignment.Right,m.lineAlignment=u.PdfVerticalAlignment.Middle,l.actualSize.width>0){var y=new u.PdfSolidBrush(this.labelColor);s.drawString(l.lines[0].text,p,null,y,f.x,f.y,l.actualSize.width,l.actualSize.height,m),null!==l.remainder?(this.leftTaskLabel.value=l.remainder,this.leftTaskLabel.left=r.endPoint):this.leftTaskLabel.isCompleted=!0}else this.leftTaskLabel.left=r.endPoint}}},e.prototype.getWidth=function(e,t,i){var r=new u.PdfStandardFont(this.fontFamily,9),n=new u.PdfStringLayouter,a=new u.PdfStringFormat;a.alignment=u.PdfTextAlignment.Left,a.wordWrap=u.PdfWordWrapType.Character,a.lineAlignment=u.PdfVerticalAlignment.Middle;return n.layout(e,r,a,new u.SizeF(t,i),!1,new u.SizeF(t,i))},e.prototype.drawUnscheduledTask=function(e,t,i,r){var n=new u.PdfSolidBrush(this.taskColor);e.drawRectangle(n,t.x+S(this.left-i),t.y+r,S(3),S(this.height))},e.prototype.drawMilestone=function(e,t,i,r){if(i.startDate<=this.startDate&&this.startDate<=i.endDate){var n=e.graphics,a=e.section.indexOf(e);this.taskStartPoint=Xi({},t);var s=new u.PdfPen(this.milestoneColor),o=S((this.parent.rowHeight-this.height)/2),l=new u.PdfSolidBrush(this.milestoneColor);n.save();var d=Math.floor(.6*this.parent.chartRowsModule.taskBarHeight);n.translateTransform(t.x+S(this.left-r),t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2),n.rotateTransform(45),n.drawRectangle(s,l,0,0,S(d),S(d)),n.restore(),this.endPage=this.startPage=a}},e}(),Zi=function(){function e(e){this.width=0,this.gantt=e,this.parent=e.parent,this.topTierPoint=new u.PointF,this.bottomTierPoint=new u.PointF,this.topTierIndex=0,this.bottomTierIndex=0,this.prevTopTierIndex=0,this.prevBottomTierIndex=0}return e.prototype.drawTimeline=function(e,t,i){var r=Math.floor(i.totalWidth),n=0;for(this.topTierPoint.x=t.x,this.topTierPoint.y=t.y,this.prevTopTierIndex=this.topTierIndex,this.prevBottomTierIndex=this.bottomTierIndex;r>0;){var a=this.topTier[this.topTierIndex];if(this.topTier.length>this.topTierIndex){var s=!1;this.topTier[this.topTierIndex].isFinished||(r>=a.width?(n=a.width,a.isFinished=!0,a.completedWidth=n,s=!0):(n=r,s=!1,a.isFinished=!1,a.width=a.width-r,a.completedWidth=n)),this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,n,a.value,!0),this.topTierPoint.x+=S(n),r-=n,s&&this.topTierIndex++}else r=0}r=Math.floor(i.totalWidth);var o=this.parent.timelineModule.isSingleTier?0:this.topTierHeight;for(this.bottomTierPoint=new u.PointF(t.x,S(t.y+o));r>0;){var l=this.bottomTier[this.bottomTierIndex];if(this.bottomTier.length>this.bottomTierIndex){s=!0;var d=l.width;r<d&&(d=r,s=!1,l.completedWidth=d),this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,d,l.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+S(d),r-=d,l.completedWidth=d,s&&this.bottomTierIndex++}else r=0}},e.prototype.drawPageTimeline=function(e,i,r){this.topTierPoint=t.extend({},{},i,!0);for(var n=this.prevTopTierIndex;n<=this.topTierIndex;n++)if(this.topTier.length>n){var a=this.topTier[n];a.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,a.completedWidth,a.value,!0),this.topTierPoint.x+=S(a.completedWidth))}this.bottomTierPoint.x=i.x,this.bottomTierPoint.y=S(i.y+this.topTierHeight);for(n=this.prevBottomTierIndex;n<=this.bottomTierIndex;n++)if(this.bottomTier.length>n){var s=this.bottomTier[n];s.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,s.width,s.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+S(s.width))}},e.prototype.triggerQueryTimelinecell=function(e,i,r,n,a,s,o){var l=e.graphics,d={},p=this.gantt.ganttStyle;d.borderColor=new u.PdfColor(p.timeline.borderColor),d.fontColor=new u.PdfColor(p.timeline.fontColor),d.fontSize=p.timeline.fontSize,d.fontStyle=p.timeline.fontStyle,d.backgroundColor=new u.PdfColor(p.timeline.backgroundColor),p.timeline.padding&&(d.padding=p.timeline.padding);var h=new u.PdfStringFormat;t.isNullOrUndefined(p.timeline.format)?o?(h.lineAlignment=u.PdfVerticalAlignment.Middle,h.alignment=u.PdfTextAlignment.Left):(h.lineAlignment=u.PdfVerticalAlignment.Middle,h.alignment=u.PdfTextAlignment.Center,h.wordWrap=u.PdfWordWrapType.Character):h=p.timeline.format,d.format=h;var c={timelineCell:d,value:s};this.parent.pdfQueryTimelineCellInfo&&this.parent.trigger("pdfQueryTimelineCellInfo",c);var g=c.timelineCell,f=new u.PdfPen(c.timelineCell.borderColor),m=new u.PdfSolidBrush(c.timelineCell.backgroundColor);l.drawRectangle(f,m,i,r,S(a),S(n));var y=new u.PdfStandardFont(p.fontFamily,g.fontSize,g.fontStyle),v=new u.PdfSolidBrush(c.timelineCell.fontColor),D=p.timeline.padding?c.timelineCell.padding.left:0,w=p.timeline.padding?c.timelineCell.padding.top:0;l.drawString(c.value,y,null,v,i+D,r+w,S(a),S(n),g.format)},e}(),Qi=function(){return(Qi=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}).apply(this,arguments)},Ki=function(){function e(e,t){this.parent=e,this.pdfGantt=t}return e.prototype.add=function(){return new e(this.parent)},e.prototype.drawPredecessor=function(e){this.pdfGantt=e;var t,i,r=e.result.page.section.getPages(),n=e.taskbarCollection[this.parentIndex],a=e.taskbarCollection[this.childIndex],s=new u.PdfPage,o=new u.PdfPage,l="",d=0,p=0;switch(this.type){case"FS":if(!(a.startPage>-1&&n.endPage>-1))return;s=r[n.endPage],o=r[a.startPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[a.startPage-e.chartPageIndex],l=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(!(a.endPage>-1&&n.startPage>-1))return;s=r[n.startPage],o=r[a.endPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[a.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>this.childLeft+this.childWidth?"SFType1":"SFType2":this.parentLeft>this.childLeft+this.childWidth?"SFType3":"SFType4";break;case"FF":if(!(a.endPage>-1&&n.endPage>-1))return;s=r[n.endPage],o=r[a.endPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[a.endPage-e.chartPageIndex],l=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(!(a.startPage>-1&&n.startPage>-1))return;s=r[n.startPage],o=r[a.startPage],t=e.pdfPageDetail[n.startPage-e.chartPageIndex],i=e.pdfPageDetail[a.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>=this.childLeft?"SSType1":"SSType2":this.parentLeft>=this.childLeft?"SSType3":"SSType4"}var h=Math.round((this.parent.rowHeight-1)/2);h=S(h);var c,g,f,m,y,v;c=g=f=m=y=v=new u.PointF;var D=Qi({},n.taskStartPoint),w=Qi({},a.taskStartPoint);d=D.y+t.startPoint.y,p=w.y+i.startPoint.y;var k=new u.PointF(S(this.parentLeft+this.parentWidth),d+h),T=new u.PointF(S(this.parentLeft)-1,d+h),b=new u.PointF(S(this.childLeft-20),p+h),P=new u.PointF(S(this.childLeft-6-this.lineWidth)-1,p+h),C=new u.PointF(S(this.childLeft+this.childWidth+6+this.lineWidth)+1,p+h);switch(l){case"FSType1":case"FSType3":c=k,g=new u.PointF(S(this.childLeft-20),d+h),f=b,m=P,this.connectLines(s,o,c,g,f,m,a,h);break;case"FSType2":c=k,g=new u.PointF(c.x+10,d+h),f=new u.PointF(c.x+10,p+2),m=new u.PointF(S(this.childLeft-20),p+2),y=b,v=P,this.connectLines(s,o,c,g,f,m,a,h,y,v);break;case"FSType4":c=k,g=new u.PointF(c.x+10,d+h),f=new u.PointF(c.x+10,d+2),m=new u.PointF(S(this.childLeft-20),d+2),y=b,v=P,this.connectLines(s,o,c,g,f,m,a,h,y,v);break;case"FFType1":case"FFType3":c=new u.PointF(S(this.parentLeft+this.parentWidth)+1,d+h),g=new u.PointF(S(this.childLeft+this.childWidth+20),d+h),f=new u.PointF(g.x,p+h),m=C,this.connectLines(s,o,c,g,f,m,a,h);break;case"FFType2":case"FFType4":c=new u.PointF(S(this.parentLeft+this.parentWidth)+1,d+h),g=new u.PointF(S(this.parentLeft+this.parentWidth+20),d+h),f=new u.PointF(g.x,p+h),m=C,this.connectLines(s,o,c,g,f,m,a,h);break;case"SSType1":case"SSType3":c=T,g=new u.PointF(S(this.childLeft-20),d+h),f=new u.PointF(g.x,p+h),m=P,this.connectLines(s,o,c,g,f,m,a,h);break;case"SSType2":case"SSType4":c=T,g=new u.PointF(S(this.parentLeft-20),d+h),f=new u.PointF(g.x,p+h),m=P,this.connectLines(s,o,c,g,f,m,a,h);break;case"SFType1":case"SFType3":c=T,g=new u.PointF(S(this.childLeft+this.childWidth+20),d+h),f=new u.PointF(g.x,p+h),m=C,this.connectLines(s,o,c,g,f,m,a,h);break;case"SFType2":c=T,g=new u.PointF(S(this.parentLeft-20),d+h),f=new u.PointF(g.x,p+2),m=new u.PointF(S(this.childLeft+this.childWidth+20),p+2),y=new u.PointF(m.x,p+h),v=C,this.connectLines(s,o,c,g,f,m,a,h,y,v);break;case"SFType4":c=T,g=new u.PointF(S(this.parentLeft-20),d+h),f=new u.PointF(g.x,d+2),m=new u.PointF(S(this.childLeft+this.childWidth+20),d+2),y=new u.PointF(m.x,p+h),v=C,this.connectLines(s,o,c,g,f,m,a,h,y,v)}},e.prototype.connectLines=function(e,i,r,n,a,s,o,l,d,p){this.drawLine(e,r,n),this.drawLine(e,n,a),this.drawLine(e,a,s),t.isNullOrUndefined(d)||t.isNullOrUndefined(p)||(this.drawLine(e,s,d),this.drawLine(e,d,p)),this.drawArrow(i,o,l)},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 r=this.pdfGantt.pdfPageDetail[i],n=new u.RectangleF(r.startPoint.x,r.startPoint.y,r.width,r.height);if(this.contains(n,e.x,e.y)){t=i;break}}return t},e.prototype.drawLine=function(e,t,i){var r=this.pdfGantt.result.page.section.getPages(),n=e.graphics,a=Qi({},i),s=Qi({},i),o=Qi({},i),l=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],d=new u.RectangleF(l.startPoint.x,l.startPoint.y,l.width,l.height),p=this.contains(d,t.x,t.y),h=this.contains(d,i.x,i.y),c=-1;if(t=new u.PointF(t.x,t.y),i=new u.PointF(i.x,i.y),!p&&!h||h&&!p)(c=this.findPageIndex(t))>-1&&(l=this.pdfGantt.pdfPageDetail[c],s=t,a=i,this.drawLine(r[c+this.pdfGantt.chartPageIndex],s,a));else if(!h&&p){var g=d.x,f=d.x+d.width,m=d.y+d.height,y=d.y;g>i.x?(o.x=i.x=g-1,s.x=g-1):f<i.x?(o.x=i.x=f,s.x=f,o.x+=1):m<i.y?(o.y=i.y=m,s.y=m,o.y+=1,this.pdfGantt.enableHeader&&(s.y+=this.parent.timelineModule.isSingleTier?S(45):S(62))):y>i.y&&(s.y=o.y=y-1,i.y=y,this.pdfGantt.enableHeader&&(o.y+=this.parent.timelineModule.isSingleTier?S(45):S(62),i.y+=this.parent.timelineModule.isSingleTier?S(45):S(62))),-1!==(c=this.findPageIndex(o))&&this.drawLine(r[c+this.pdfGantt.chartPageIndex],s,a)}if(p){t=new u.PointF(t.x,t.y),i=new u.PointF(i.x,i.y),t.x=t.x+l.pageStartX-l.startPoint.x,t.y=t.y-l.startPoint.y,i.x=i.x+l.pageStartX-l.startPoint.x,i.y=i.y-l.startPoint.y;var v=new u.PdfSolidBrush(this.connectorLineColor),D=new u.PdfPen(v,S(this.lineWidth));n.drawLine(D,t,i)}},e.prototype.drawArrow=function(e,t,i){var r,n=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],a=new u.RectangleF(new u.PointF(n.startPoint.x,n.startPoint.y),new u.SizeF(n.width,n.height)),s=new u.PointF,o=e.section.getPages(),l=6+this.lineWidth;s="FS"===this.type||"SS"===this.type?new u.PointF(S(this.childLeft)-1,t.taskStartPoint.y+n.startPoint.y):new u.PointF(S(this.childLeft+this.childWidth)+1,t.taskStartPoint.y+n.startPoint.y);if(!this.contains(a,s.x,s.y)){var d=this.findPageIndex(s);d>-1&&(n=this.pdfGantt.pdfPageDetail[d],e=o[d+this.pdfGantt.chartPageIndex])}var p=e.graphics;s.x=s.x-n.startPoint.x+n.pageStartX,s.y=s.y-n.startPoint.y;var h=new u.PointF(s.x,s.y+i);r="FS"===this.type||"SS"===this.type?new u.PointF(h.x-S(l),h.y-S(l)):new u.PointF(h.x+S(l),h.y-S(l));var c=new u.PointF(r.x,r.y+S(2*l)),g=new u.PdfSolidBrush(this.connectorLineColor),f=new u.PdfPen(g,S(this.lineWidth));p.drawLine(f,h,r),p.drawLine(f,r,c),p.drawLine(f,c,h)},e}(),Ji=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)}}(),$i=function(){return($i=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}).apply(this,arguments)},er=function(e){function i(t){var i=e.call(this)||this;return i.exportProps={},i.parent=t,i.chartHeader=new Zi(i),i.predecessor=new Ki(t,i),i.headerDetails=[],i.pdfPageDetail=[],i.taskbarCollection=[],i.predecessorCollection=[],i}return Ji(i,e),Object.defineProperty(i.prototype,"taskbar",{get:function(){return t.isNullOrUndefined(this.taskbars)&&(this.taskbars=new Yi(this.parent)),this.taskbars},enumerable:!0,configurable:!0}),i.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()},i.prototype.calculateRange=function(){for(var e=this.layouter.columnRanges[this.layouter.columnRanges.length-1],i=0,r=!0,n=0,a=0,s=0,o=S(this.chartHeader.width),l=this.parent.timelineModule,d=e[0];d<=e[1];d++)i+=this.layouter.treegrid.columns.getColumn(d).width;for((i+=.5)+100<this.result.page.getClientSize().width?(a=this.result.page.getClientSize().width-i,this.chartPageIndex=this.startPageIndex=this.totalPages-this.perColumnPages,r=!1,this.startPoint=new u.PointF(i,0)):(this.result.page.section.add(),this.chartPageIndex=this.startPageIndex=this.totalPages,r=!0,this.startPoint=new u.PointF(s,0));Math.round(s)<Math.round(o);){r?n=this.result.page.getClientSize().width:(n=a,r=!0);var p={},h=[],c=S(this.chartHeader.bottomTierCellWidth),g=0;0!==this.chartHeader.bottomTierCellWidth&&(g=Math.floor(n/c)*c),h[0]=s,o-s<=g?(h[1]=o,p.totalWidth=b(o-s)):(h[1]=s+g,p.totalWidth=b(g)),p.startPoint=h[0],p.endPoint=h[1],0===this.parent.cloneProjectStartDate.getHours()&&0===this.parent.cloneProjectStartDate.getMinutes()&&0===this.parent.cloneProjectStartDate.getSeconds()&&this.parent.cloneProjectStartDate.setHours(8);var f=this.parent.dataOperation.getDateFromFormat(this.parent.cloneProjectStartDate),m=t.isNullOrUndefined(l.customTimelineSettings.bottomTier.count)?l.customTimelineSettings.topTier.count:l.customTimelineSettings.bottomTier.count;switch("None"===l.customTimelineSettings.bottomTier.unit?l.customTimelineSettings.topTier.unit:l.customTimelineSettings.bottomTier.unit){case"Minutes":p.startDate=new Date(f.getTime());var y=Math.floor(b(p.startPoint)/this.chartHeader.bottomTierCellWidth);p.startDate.setMinutes(p.startDate.getMinutes()+y*m),p.startDate.setSeconds(p.startDate.getSeconds()+1),p.endDate=new Date(p.startDate.getTime());var v=Math.floor(b(p.endPoint-p.startPoint)/this.chartHeader.bottomTierCellWidth);p.endDate.setMinutes(p.endDate.getMinutes()+v*m);break;case"Hour":p.startDate=new Date(f.getTime());var D=Math.floor(b(p.startPoint)/this.chartHeader.bottomTierCellWidth);p.startDate.setHours(p.startDate.getHours()+D*m),p.startDate.setMinutes(p.startDate.getMinutes()+1),p.endDate=new Date(p.startDate.getTime());var w=Math.floor(b(p.endPoint-p.startPoint)/this.chartHeader.bottomTierCellWidth);p.endDate.setHours(p.endDate.getHours()+w*m);break;case"Day":p.startDate=new Date(f.getTime());var k=Math.round(p.startPoint/S(this.chartHeader.bottomTierCellWidth));p.startDate.setDate(p.startDate.getDate()+k*m);var T=Math.round((p.endPoint-p.startPoint)/S(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+T*m);break;case"Week":p.startDate=new Date(f.getTime());var P=p.startPoint/S(this.chartHeader.bottomTierCellWidth)*7;p.startDate.setDate(p.startDate.getDate()+P*m);var C=7*Math.round((p.endPoint-p.startPoint)/S(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+C*m);break;case"Month":p.startDate=new Date(f.getTime());var M=p.startPoint/S(this.chartHeader.bottomTierCellWidth)*31;p.startDate.setDate(p.startDate.getDate()+M*m);var R=31*Math.round((p.endPoint-p.startPoint)/S(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+R*m);break;case"Year":p.startDate=new Date(f.getTime());var O=p.startPoint/S(this.chartHeader.bottomTierCellWidth)*365;p.startDate.setDate(p.startDate.getDate()+O*m);var x=365*Math.round((p.endPoint-p.startPoint)/S(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+x*m)}this.headerDetails.push(p),s+=g}},i.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(),a=new u.PdfPen(new u.PdfColor(206,206,206));r.drawRectangle(a,0,0,n.width,n.height)}},i.prototype.drawGantttChart=function(){var e,t=this,i=this.startPoint,r=new u.PointF,n=0,a=0,s=0;this.headerDetails.forEach(function(o,l){var d=t.result.page.section.getPages()[t.startPageIndex];t.chartHeader.drawTimeline(d,t.startPoint,o),i.y=i.y+S(t.parent.timelineModule.isSingleTier?45:60),n=i.x,s=S(t.parent.timelineModule.isSingleTier?45:60),t.headerDetails[t.headerDetails.indexOf(o)].startIndex=t.startPageIndex,t.headerDetails[t.headerDetails.indexOf(o)].pageStartPoint=i;for(var p=0;p<t.taskbarCollection.length;p++){var h=t.taskbarCollection[p],c=t.rows.getRow(p+1).height,g=t.result.page.section.getPages()[t.startPageIndex];h.drawTaskbar(g,i,o,a,c,t.taskbarCollection[p])&&(t.enableHeader?i.y=S(t.parent.timelineModule.isSingleTier?45:60):i.y=0,t.startPageIndex++,(e={}).height=s,e.pageStartX=n,e.startPoint=$i({},r),e.width=S(o.totalWidth),t.pdfPageDetail.push(e),r.y+=e.height,t.enableHeader?s=t.chartHeader.height:(i.y=0,s=0)),i.y+=c,s+=c}t.headerDetails[l].endIndex=t.startPageIndex,a+=o.totalWidth,(e={}).height=s,e.pageStartX=n,e.startPoint=$i({},r),e.width=S(o.totalWidth),t.pdfPageDetail.push(e),r.x+=e.width,r.y=0,t.enableHeader?s=t.chartHeader.height:i.y=0,t.headerDetails.indexOf(o)!==t.headerDetails.length-1&&(t.result.page.section.add(),t.startPageIndex=t.result.page.section.count-1,i=t.startPoint=new u.PointF(0,0))});for(var o=0;o<this.predecessorCollection.length;o++){this.predecessorCollection[o].drawPredecessor(this)}},i}(Ni),tr=function(){function e(e){this.isPdfExport=!1,this.parent=e,this.helper=new zi(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 er(this.parent)},e.prototype.export=function(e,i,r){var n=this,a={requestType:"beforePdfExport",ganttObject:this.parent,cancel:!1};return this.parent.trigger("beforePdfExport",a),t.getValue("cancel",a)?new Promise(function(e,t){return e()}):new Promise(function(t,a){n.exportWithData(r,t,e,i)})},e.prototype.exportWithData=function(e,i,r,n){var a=this,s=[];t.isNullOrUndefined(r)&&(r={}),s="CurrentViewData"===r.exportType?this.parent.currentViewData:this.parent.flatData,this.initGantt(),t.isNullOrUndefined(e)?this.pdfDocument=new u.PdfDocument:this.pdfDocument=e,this.processExport(s,r,n).then(function(){a.parent.trigger("pdfExportComplete",{}),i(a.pdfDocument)})},e.prototype.processExport=function(e,i,r){var n=this,a=this.pdfDocument.sections.add();this.processSectionExportProperties(a,i);var s=a.pages.add();return new Promise(function(t,r){n.helper.processGridExport(e,n.gantt,i),n.helper.initializePdf(n.pdfDocument),t()}).then(function(){var e=new Vi;e.break=u.PdfLayoutBreakType.FitElement;var a=n.gantt.drawGrid(s,0,0,e);return n.gantt.drawChart(a),r||(!t.isNullOrUndefined(i)&&i.fileName?n.pdfDocument.save(i.fileName):n.pdfDocument.save("Export.pdf"),n.pdfDocument.destroy()),n.pdfDocument})},e.prototype.processSectionExportProperties=function(e,i){if(t.isNullOrUndefined(i))this.gantt.ganttStyle=new Mi(i.theme).style;else{var r=new u.PdfPageSettings;if(t.isNullOrUndefined(i.pageOrientation)||"Portrait"!==i.pageOrientation?r.orientation=u.PdfPageOrientation.Landscape:r.orientation=u.PdfPageOrientation.Portrait,t.isNullOrUndefined(i.pageSize)||(r.size=this.getPageSize(i.pageSize)),e.setPageSettings(r),t.isNullOrUndefined(i.ganttStyle))this.gantt.ganttStyle=new Mi(i.theme).style;else{var n=new Mi(i.theme).style;this.gantt.ganttStyle=t.extend({},n,i.ganttStyle,!0)}}},e.prototype.getPageSize=function(e){switch(e){case"Letter":return new u.SizeF(612,792);case"Note":return new u.SizeF(540,720);case"Legal":return new u.SizeF(612,1008);case"A0":return new u.SizeF(2380,3368);case"A1":return new u.SizeF(1684,2380);case"A2":return new u.SizeF(1190,1684);case"A3":return new u.SizeF(842,1190);case"A5":return new u.SizeF(421,595);case"A6":return new u.SizeF(297,421);case"A7":return new u.SizeF(210,297);case"A8":return new u.SizeF(148,210);case"A9":return new u.SizeF(105,148);case"B0":return new u.SizeF(2836,4008);case"B1":return new u.SizeF(2004,2836);case"B2":return new u.SizeF(1418,2004);case"B3":return new u.SizeF(1002,1418);case"B4":return new u.SizeF(709,1002);case"B5":return new u.SizeF(501,709);case"Archa":return new u.SizeF(648,864);case"Archb":return new u.SizeF(864,1296);case"Archc":return new u.SizeF(1296,1728);case"Archd":return new u.SizeF(1728,2592);case"Arche":return new u.SizeF(2592,3456);case"Flsa":return new u.SizeF(612,936);case"HalfLetter":return new u.SizeF(396,612);case"Letter11x17":return new u.SizeF(792,1224);case"Ledger":return new u.SizeF(1224,792);default:return new u.SizeF(595,842)}},e}(),ir=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,a.TreeGrid.Inject(a.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}();e.Gantt=ni,e.parentsUntil=g,e.isScheduledTask=f,e.isCountRequired=m,e.getSwapKey=y,e.isRemoteData=v,e.getTaskData=D,e.updateDates=w,e.formatString=k,e.getIndex=T,e.pixelToPoint=S,e.pointToPixel=b,e.getUid=P,e.load="load",e.rowDataBound="rowDataBound",e.queryCellInfo="queryCellInfo",e.toolbarClick="toolbarClick",e.keyPressed="key-pressed",e.Edit=ci,e.Reorder=ui,e.Resize=gi,e.Filter=fi,e.Sort=mi,e.Dependency=Kt,e.Selection=yi,e.Toolbar=vi,e.DayMarkers=ki,e.CriticalPath=Ti,e.ContextMenu=Si,e.ExcelExport=bi,e.ColumnMenu=Pi,e.RowDD=Ci,e.PdfExport=tr,e.VirtualScroll=ir,e.Column=Ke,e.DayWorkingTime=tt,e.AddDialogFieldSettings=nt,e.EditDialogFieldSettings=ot,e.EditSettings=pt,e.EventMarker=ut,e.FilterSettings=mt,e.SearchSettings=Dt,e.Holiday=Tt,e.LabelSettings=Pt,e.SelectionSettings=Rt,e.SplitterSettings=It,e.TaskFields=Ut,e.TimelineTierSettings=Nt,e.TimelineSettings=Bt,e.TooltipSettings=Wt,e.SortDescriptor=qt,e.SortSettings=zt,e.ResourceFields=Yt,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-treegrid"),require("@syncfusion/ej2-layouts"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-richtexteditor"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-grids","@syncfusion/ej2-data","@syncfusion/ej2-treegrid","@syncfusion/ej2-layouts","@syncfusion/ej2-navigations","@syncfusion/ej2-richtexteditor","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-calendars","@syncfusion/ej2-dropdowns","@syncfusion/ej2-pdf-export"],t):t(e.ej={},e.ej2Base,e.ej2Popups,e.ej2Grids,e.ej2Data,e.ej2Treegrid,e.ej2Layouts,e.ej2Navigations,e.ej2Richtexteditor,e.ej2Inputs,e.ej2Buttons,e.ej2Calendars,e.ej2Dropdowns,e.ej2PdfExport)}(this,function(e,t,i,r,n,a,s,o,l,d,p,h,c,u){"use strict";function g(e,t,i){for(var r=e;r&&(i?r.id!==t:!r.classList.contains(t));)r=r.parentElement;return r}function f(e){return t.isNullOrUndefined(e.startDate)&&t.isNullOrUndefined(e.endDate)&&t.isNullOrUndefined(e.duration)?null:!(t.isNullOrUndefined(e.startDate)||t.isNullOrUndefined(e.endDate)||t.isNullOrUndefined(e.duration))}function m(e){return!(!e.dataSource||e.dataSource instanceof n.DataManager||!("result"in e.dataSource))}function y(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 v(e){if(e instanceof n.DataManager){var t=e.adaptor;return t instanceof n.ODataAdaptor||t instanceof n.ODataV4Adaptor||t instanceof n.WebApiAdaptor||t instanceof n.WebMethodAdaptor||t instanceof n.CacheAdaptor||t instanceof n.RemoteSaveAdaptor||t instanceof n.UrlAdaptor}return!1}function D(e,i,r,n){if(r){for(var a=void 0,s=0;s<e.length;s++){var o=void 0;a=o=i?e[s].taskData:t.extend({},e[s].taskData,{},!0)}return a}for(a=[],s=0;s<e.length;s++){o=void 0;!t.isNullOrUndefined(n)&&n.timezone&&w(e[s],n),o=i?e[s].taskData:t.extend({},e[s].taskData,{},!0),a.push(o)}return a}function w(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 k(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 T(e,i,r,n){for(var a=-1,s=0;s<r.length;s++)if(t.getValue(i,r[s])===t.getValue(i,e)&&t.isNullOrUndefined(n)||!t.isNullOrUndefined(n)&&t.getValue(i,r[s])===t.getValue(i,e)&&t.getValue(n,r[s])===t.getValue(n,e)){a=s;break}return a}function S(e){return 76*e/92}function b(e){return 92*e/76}function P(){return C++}var C=0,M=function(){function e(e){this.parent=e}return e.prototype.isValidateNonWorkDays=function(e){return!t.isNullOrUndefined(e)&&e.isAutoSchedule&&(!this.parent.includeWeekend||this.parent.totalHolidayDates.length>0)||t.isNullOrUndefined(e)&&(!this.parent.includeWeekend||this.parent.totalHolidayDates.length>0)},e.prototype.checkStartDate=function(e,i,r,n){if(t.isNullOrUndefined(e))return null;var a=new Date(e.getTime()),s=this.getSecondsInDecimal(a);if(r=t.isNullOrUndefined(r)?!t.isNullOrUndefined(i)&&i.isMilestone:r,s<this.parent.defaultStartTime&&(!r||n))this.setTime(this.parent.defaultStartTime,a);else if(s<this.parent.defaultStartTime&&r)this.setTime(this.parent.defaultStartTime,a);else if(s===this.parent.defaultEndTime&&(!i||!r)||s>this.parent.defaultEndTime)a.setDate(a.getDate()+1),this.setTime(this.parent.defaultStartTime,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){(s!==l.to||i&&r)&&s===l.to||this.setTime(this.parent.workingTimeRanges[o+1].from,a);break}}var d;do{d=new Date(a.getTime());var p=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(i)){var h=!r||n?this.parent.defaultStartTime:this.parent.defaultEndTime;if(!this.parent.includeWeekend){var c=new Date(a.getTime());a=this.getNextWorkingDay(a),c.getTime()!==a.getTime()&&this.setTime(h,a)}for(var u=0;u<p;u++){var g=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[u])),f=new Date(g.getTime());g.setHours(0,0,0,0),f.setHours(23,59,59,59),a.getTime()>=g.getTime()&&a.getTime()<f.getTime()&&(a.setDate(a.getDate()+1),this.setTime(h,a))}}}while(d.getTime()!==a.getTime());return new Date(a.getTime())},e.prototype.checkEndDate=function(e,i,r){if(t.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&&!r)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++){if(a>this.parent.workingTimeRanges[s].to&&this.parent.workingTimeRanges[s+1]&&a<=this.parent.workingTimeRanges[s+1].from){this.setTime(this.parent.workingTimeRanges[s].to,n);break}}var o;do{o=new Date(n.getTime());var l=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(i)){if(!this.parent.includeWeekend){var d=new Date(n.getTime());n=this.getPreviousWorkingDay(n),d.getTime()!==n.getTime()&&this.setTime(this.parent.defaultEndTime,n)}for(var p=0;p<l;p++){var h=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[p])),c=new Date(h.getTime()),u=new Date(n.getTime());u.setMinutes(n.getMilliseconds()-2),h.setHours(0,0,0,0),c.setHours(23,59,59,59),(n.getTime()>=h.getTime()&&n.getTime()<c.getTime()||u.getTime()>=h.getTime()&&u.getTime()<c.getTime())&&(n.setDate(n.getDate()-1),n.getTime()===h.getTime()&&86400===this.parent.defaultEndTime&&0===this.getSecondsInDecimal(n)||this.setTime(this.parent.defaultEndTime,n))}}}while(o.getTime()!==n.getTime());return new Date(n.getTime())},e.prototype.checkBaselineStartDate=function(e){if(t.isNullOrUndefined(e))return null;var i=new Date(e.getTime()),r=this.getSecondsInDecimal(i);if(r<this.parent.defaultStartTime)this.setTime(this.parent.defaultStartTime,i);else if(r>=this.parent.defaultEndTime)i.setDate(i.getDate()+1),this.setTime(this.parent.defaultStartTime,i);else if(r>this.parent.defaultStartTime&&r<this.parent.defaultEndTime)for(var n=0;n<this.parent.workingTimeRanges.length;n++){if(r>=this.parent.workingTimeRanges[n].to&&this.parent.workingTimeRanges[n+1]&&r<this.parent.workingTimeRanges[n+1].from){this.setTime(this.parent.workingTimeRanges[n+1].from,i);break}}return i},e.prototype.checkBaselineEndDate=function(e,i){if(t.isNullOrUndefined(e))return null;var r=new Date(e.getTime()),n=this.getSecondsInDecimal(r);if(n>this.parent.defaultEndTime)this.setTime(this.parent.defaultEndTime,r);else if(n<=this.parent.defaultStartTime&&!t.isNullOrUndefined(i)&&!i.isMilestone)r.setDate(r.getDate()-1),this.setTime(this.parent.defaultEndTime,r);else if(n>this.parent.defaultStartTime&&n<this.parent.defaultEndTime)for(var a=0;a<this.parent.workingTimeRanges.length;a++){if(n>this.parent.workingTimeRanges[a].to&&this.parent.workingTimeRanges[a+1]&&n<=this.parent.workingTimeRanges[a+1].from){this.setTime(this.parent.workingTimeRanges[a].to,r);break}}return r},e.prototype.calculateStartDate=function(e){var i=e.ganttProperties,r=null;t.isNullOrUndefined(i.endDate)||t.isNullOrUndefined(i.duration)||(r=this.getStartDate(i.endDate,i.duration,i.durationUnit,i)),this.parent.setRecordValue("startDate",r,i,!0),this.parent.taskFields.startDate&&this.parent.dataOperation.updateMappingData(e,"startDate")},e.prototype.calculateEndDate=function(e){var i=e.ganttProperties,r=null;if(!t.isNullOrUndefined(i.startDate)){if(!t.isNullOrUndefined(i.endDate)&&t.isNullOrUndefined(i.duration)&&(1===this.compareDates(i.startDate,i.endDate)&&(this.parent.setRecordValue("startDate",new Date(i.endDate.getTime()),i,!0),this.setTime(this.parent.defaultStartTime,i.startDate)),this.calculateDuration(e)),!t.isNullOrUndefined(i.duration)){var n=!t.isNullOrUndefined(i.segments)&&i.segments.length>0?this.totalDuration(i.segments):i.duration;r=this.getEndDate(i.startDate,n,i.durationUnit,i,!1)}this.parent.setRecordValue("endDate",r,i,!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 i,r=e.ganttProperties;i=!t.isNullOrUndefined(r.segments)&&r.segments.length>0&&!t.isNullOrUndefined(this.parent.editModule.taskbarEditModule)?this.parent.editModule.taskbarEditModule.sumOfDuration(r.segments):t.isNullOrUndefined(r.startDate)||t.isNullOrUndefined(r.endDate)||r.startDate.getTime()!==r.endDate.getTime()||t.isNullOrUndefined(e.taskData[this.parent.taskFields.milestone])?this.getDuration(r.startDate,r.endDate,r.durationUnit,r.isAutoSchedule,r.isMilestone):1,this.parent.setRecordValue("duration",i,r,!0);var n=this.parent.columnByField[this.parent.columnMapping.duration];if(!(t.isNullOrUndefined(this.parent.editModule)||t.isNullOrUndefined(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isCellEdit||t.isNullOrUndefined(n))){if(!t.isNullOrUndefined(n.edit)&&!t.isNullOrUndefined(n.edit.read)){var a=this.parent.editModule.dialogModule.dialog;if(!t.isNullOrUndefined(a)){var s=a.querySelector("#"+this.parent.element.id+"Duration").ej2_instances[0];t.isNullOrUndefined(s)||s.value===i.toString()||(s.value=i.toString(),s.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,i,r,n){n=!!t.isNullOrUndefined(n)||n;var a=!this.parent.includeWeekend&&r?this.getWeekendCount(e,i):0,s=this.getNumberOfSeconds(e,i,n),o=r?this.getHolidaysCount(e,i):0,l=(s-86400*a-86400*o)/86400,d=this.getNonWorkingSecondsOnDate(e,i,r);return l*(86400-this.parent.secondsPerDay)+86400*a+86400*o+d},e.prototype.getDuration=function(e,i,r,n,a,s){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))return null;s=!!t.isNullOrUndefined(s)||s;var o=0,l=this.getTimeDifference(e,i,s)/1e3-this.getNonworkingTime(e,i,n,s);return o=a&&this.parent.getFormatedDate(e)===this.parent.getFormatedDate(i)?0:r&&"day"!==r?"minute"===r?l/60:l/3600:l/this.parent.secondsPerDay,parseFloat(o.toString())},e.prototype.getDurationAsSeconds=function(e,t){return t&&"day"!==t?"hour"===t?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);o>0;)s.setSeconds(s.getSeconds()+o),(o-=o-this.getNonworkingTime(a,s,r.isAutoSchedule,!0))>0&&(s=this.checkStartDate(s,r,n)),a=new Date(s.getTime());return s},e.prototype.getStartDate=function(e,t,i,r){for(var n=new Date(e.getTime()),a=new Date(e.getTime()),s=this.getDurationAsSeconds(t,i);s>0;)a.setSeconds(a.getSeconds()-s),(s-=s-this.getNonworkingTime(a,n,r.isAutoSchedule,!0))>0&&(n=this.checkEndDate(a,r)),n=new Date(a.getTime());return a},e.prototype.getProjectStartDate=function(e,i){if(!t.isNullOrUndefined(this.parent.cloneProjectStartDate)){var r=this.checkStartDate(this.parent.cloneProjectStartDate);return this.parent.cloneProjectStartDate=r,new Date(r.getTime())}if(t.isNullOrUndefined(this.parent.projectStartDate)){if(t.isNullOrUndefined(i))return null;var n=this.parent.flatData,a=void 0;n.length>0?a=n[0].ganttProperties.startDate:(a=new Date).setHours(0,0,0,0);for(var s=1;s<n.length;s++){var o=n[s].ganttProperties.startDate;t.isNullOrUndefined(o)||-1!==this.compareDates(o,a)||(a=o)}this.parent.cloneProjectStartDate=this.checkStartDate(a,e)}else{r=this.getDateFromFormat(this.parent.projectStartDate);this.parent.cloneProjectStartDate=this.checkStartDate(r)}return new Date(this.parent.cloneProjectStartDate.getTime())},e.prototype.getValidStartDate=function(e,i){var r=null,n=i?e.autoStartDate:e.startDate,a=i?e.autoEndDate:e.endDate,s=!e.isAutoSchedule&&e.autoDuration?e.autoDuration:e.duration;return t.isNullOrUndefined(n)?t.isNullOrUndefined(a)?t.isNullOrUndefined(s)||(r=this.getProjectStartDate(e)):(r=new Date(a.getTime()),this.setTime(this.parent.defaultStartTime,r)):r=new Date(n.getTime()),r},e.prototype.getValidEndDate=function(e,i){var r=null,n=i?e.autoStartDate:e.startDate,a=i?e.autoEndDate:e.endDate,s=i?e.autoDuration:e.duration;if(t.isNullOrUndefined(a))if(t.isNullOrUndefined(n)){if(!t.isNullOrUndefined(s)){var o=this.getValidStartDate(e);o&&(r=this.getEndDate(o,s,e.durationUnit,e,!1))}}else e.isMilestone?r=this.checkStartDate(n):(r=new Date(n.getTime()),this.setTime(this.parent.defaultEndTime,r));else r=new Date(a.getTime());return r},e.prototype.getSecondsPerDay=function(){var e=this.parent.dayWorkingTime,i=e.length,r=0,n=new Date("10/11/2018");this.parent.nonWorkingHours=[];var a=this.parent.nonWorkingHours;this.parent.workingTimeRanges=[];var s=this.parent.workingTimeRanges;this.parent.nonWorkingTimeRanges=[];for(var o=this.parent.nonWorkingTimeRanges,l=0;l<i;l++){var d=e[l];if(!t.isNullOrUndefined(d.from)&&!t.isNullOrUndefined(d.to)){n.setHours(0,0,0,0);var p=new Date(n.getTime());n.setTime(n.getTime()+36e5*d.from);var h=new Date(n.getTime());p.setTime(p.getTime()+36e5*d.to);var c=new Date(p.getTime()),u=c.getTime()-h.getTime(),g=this.getSecondsInDecimal(h),f=this.getSecondsInDecimal(c);0===f&&(f=86400),r+=u/1e3,0===l&&(this.parent.defaultStartTime=g),l===i-1&&(this.parent.defaultEndTime=f),l>0?(a.push(a[a.length-1]+g-s[l-1].to),s[l-1].to<g&&o.push({from:s[l-1].to,to:g,isWorking:!1,interval:g-s[l-1].to})):(a.push(0),o.push({from:0,to:g,isWorking:!1,interval:g})),s.push({from:g,to:f}),o.push({from:g,to:f,isWorking:!0,interval:f-g})}}return this.parent.defaultEndTime/3600!=24&&o.push({from:this.parent.defaultEndTime,to:86400,isWorking:!1,interval:86400-this.parent.defaultEndTime}),r},e.prototype.getDurationValue=function(e,i){var r=null,n=null;if("string"==typeof e){var a=e.match(/(\d*\.*\d+|.+$)/g);if(a&&a.length<=2){n=parseFloat(a[0].toString().trim());var s=a[1]?a[1].toString().trim().toLowerCase():null;-1!==t.getValue("minute",this.parent.durationUnitEditText).indexOf(s)?r="minute":-1!==t.getValue("hour",this.parent.durationUnitEditText).indexOf(s)?r="hour":-1!==t.getValue("day",this.parent.durationUnitEditText).indexOf(s)&&(r="day")}}else n=e,r=null;return{duration:n,durationUnit:r}},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,i=[],r=0;r<e.length;r++){var n=this.getDateFromFormat(e[r].from),a=this.getDateFromFormat(e[r].to);if(!t.isNullOrUndefined(n)||!t.isNullOrUndefined(a))if(t.isNullOrUndefined(n)||t.isNullOrUndefined(a)){var s=n||a;s.setHours(0,0,0,0),-1===i.indexOf(s.getTime())&&i.push(s.getTime())}else for(;n<=a;)n.setHours(0,0,0,0),-1===i.indexOf(n.getTime())&&i.push(n.getTime()),n.setDate(n.getDate()+1)}return i},e.prototype.isOnHolidayOrWeekEnd=function(e,i){if(!(i=t.isNullOrUndefined(i)?this.parent.includeWeekend:i)&&-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay()))return!0;for(var r=this.parent.totalHolidayDates,n=0;n<r.length;n++){var a=this.getDateFromFormat(new Date(r[n])),s=new Date(a.getTime());if(a.setHours(0,0,0,0),s.setHours(23,59,59,59),e.getTime()>=a.getTime()&&e.getTime()<s.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.isOnHolidayOrWeekEnd(e,null),d=!!i&&this.isOnHolidayOrWeekEnd(t,null),p=0;p<this.parent.nonWorkingTimeRanges.length;p++){var h=this.parent.nonWorkingTimeRanges[p];r>=h.from&&r<=h.to&&(a=p),n>=h.from&&n<=h.to&&(s=p)}if(e.getDate()!==t.getDate()||e.getMonth()!==t.getMonth()||e.getFullYear()!==t.getFullYear()){if(l)o+=86400-r;else for(p=a;p<this.parent.nonWorkingTimeRanges.length;p++)this.parent.nonWorkingTimeRanges[p].isWorking||(o+=p===a?this.parent.nonWorkingTimeRanges[p].to-r:this.parent.nonWorkingTimeRanges[p].interval);if(d)o+=n;else for(p=0;p<=s;p++)this.parent.nonWorkingTimeRanges[p].isWorking||(o+=p===s?n-this.parent.nonWorkingTimeRanges[p].from:this.parent.nonWorkingTimeRanges[p].interval)}else if(a!==s)if(d)o+=n-r;else for(p=a;p<=s;p++)this.parent.nonWorkingTimeRanges[p].isWorking||(o+=p===a?this.parent.nonWorkingTimeRanges[p].to-r:p===s?n-this.parent.nonWorkingTimeRanges[p].from:this.parent.nonWorkingTimeRanges[p].interval);else if(d)o+=n-r;else{this.parent.nonWorkingTimeRanges[a].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(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,r=(e-3600*(i=parseInt(i,10)))/60,n=e-3600*i-60*(r=parseInt(r,10));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){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,i){return t.isNullOrUndefined(e)||(e=this.reverse(e,i,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(),n=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(n-r))},e.prototype.convert=function(e,t){var i=e.getTimezoneOffset(),r=this.offset(e,t),n=(e=new Date(e.getTime()+6e4*(i-r))).getTimezoneOffset();return new Date(e.getTime()+6e4*(n-i))},e.prototype.getDateFromFormat=function(e,i){var r;if(t.isNullOrUndefined(e))return null;if(e instanceof Date)r=new Date(e.getTime());else{var n=this.parent.globalize.parseDate(e,{format:this.parent.getDateFormat(),type:"dateTime"});r=t.isNullOrUndefined(n)&&!isNaN(new Date(e).getTime())?new Date(e):n}if(!t.isNullOrUndefined(this.parent.timezone)&&i){return this.convert(r,this.parent.timezone)}return r},e.prototype.compareDates=function(e,i){return t.isNullOrUndefined(e)||t.isNullOrUndefined(i)?!t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)?1:t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)?-1:null:e.getTime()>i.getTime()?1:e.getTime()<i.getTime()?-1:0},e.prototype.getDurationString=function(e,i){var r="";if(!t.isNullOrUndefined(e)&&(r+=parseFloat(e.toFixed(2))+" ",!t.isNullOrUndefined(i))){var n=1!==e;"day"===i?r+=n?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===i?r+=n?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===i&&(r+=n?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return r},e.prototype.getWorkString=function(e,i){var r="";if(!t.isNullOrUndefined(e)&&(r+=parseFloat(e).toFixed(2)+" ",!t.isNullOrUndefined(i))){var n=1!==e;"day"===i?r+=n?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===i?r+=n?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===i&&(r+=n?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return r},e.prototype.calculateProjectDatesForValidatedTasks=function(e){var i=this,r="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,n="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,a=null,s=null,o=t.getValue("dataOperation.dataArray",this.parent);if(r&&n||!o||0!==o.length){if(o.length>0){var l=o.slice().sort(function(e,t){return new Date(e[i.parent.taskFields.startDate]).getTime()-new Date(t[i.parent.taskFields.startDate]).getTime()}),d=o.slice().sort(function(e,t){return new Date(t[i.parent.taskFields.endDate]).getTime()-new Date(e[i.parent.taskFields.endDate]).getTime()});a=l[0][this.parent.taskFields.startDate],s=d[d.length-1][this.parent.taskFields.endDate]}}else a=this.getDateFromFormat(new Date),s=this.getDateFromFormat(new Date(a.getTime()));this.parent.cloneProjectStartDate=r?new Date(r.getTime()):"string"==typeof a?new Date(a):a,this.parent.cloneProjectEndDate=n?new Date(n.getTime()):"string"==typeof s?new Date(s):s},e.prototype.calculateProjectDates=function(e){var i=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 r="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,n="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,a=this.parent.timelineModule.isZooming&&this.parent.cloneProjectStartDate?this.getDateFromFormat(this.parent.cloneProjectStartDate):this.getDateFromFormat(r),s=this.parent.timelineModule.isZooming&&this.parent.cloneProjectEndDate?this.getDateFromFormat(this.parent.cloneProjectEndDate):this.getDateFromFormat(n),o=null,l=null,d=this.parent.flatData,p=this.parent.currentViewData,h=[],c=function(e){t.isNullOrUndefined(e)||h.push(e)},u=function(e){e.length>0&&(e.sort(function(e,t){return e.getTime()-t.getTime()}),o=new Date(e[0].getTime()),l=e.length>1?new Date(e[e.length-1].getTime()):null)};if((!a||!s)&&d.length>0||e||this.parent.timelineModule.isZoomToFit){if((p.length>0&&this.parent.timelineModule.isZoomToFit&&this.parent.treeGrid.filterModule&&this.parent.treeGrid.filterModule.filteredResult.length>0?p:d).forEach(function(e){h=[];var t=e.ganttProperties,r=i.getValidStartDate(t),n=i.getValidEndDate(t);c(o),c(l),c(r),c(n),i.parent.renderBaseline&&!i.parent.timelineModule.isZoomToFit&&(c(t.baselineStartDate),c(t.baselineEndDate)),t.indicators&&t.indicators.length>0&&!i.parent.timelineModule.isZoomToFit&&t.indicators.forEach(function(e){c(i.getDateFromFormat(e.date))}),u(h)}),h=[],c(o),c(l),this.parent.eventMarkers.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.eventMarkers.forEach(function(e,t){c(i.getDateFromFormat(e.day))})}if(this.parent.totalHolidayDates.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.totalHolidayDates.forEach(function(e,t){c(new Date(e))})}u(h),o&&l||(o?o=t.isNullOrUndefined(o)?this.getDateFromFormat(new Date):o:(o=t.isNullOrUndefined(o)?this.getDateFromFormat(new Date):o).setHours(0,0,0,0),(l=this.getDateFromFormat(new Date(o.getTime()))).setDate(l.getDate()+20))}else a&&s||0!==d.length||(o=this.getDateFromFormat(new Date),l=this.getDateFromFormat(new Date(o.getTime())));e?(t.setValue("minStartDate",o,e),t.setValue("maxEndDate",l,e)):(this.prevProjectStartDate=this.parent.cloneProjectStartDate,this.parent.cloneProjectStartDate=o||new Date(a.getTime()),this.parent.cloneProjectEndDate=l||new Date(s.getTime()))},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;t+=Math.ceil(this.getTimeDifference(n,a)/864e5)}return t},e}(),R=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)}}(),O=function(e){function i(t){var i=e.call(this,t)||this;return i.recordIndex=0,i.taskIds=[],i.hierarchyData=[],i.addEventListener(),i}return R(i,e),i.prototype.addEventListener=function(){this.parent.on("beforeDataManipulate",this.checkDataBinding.bind(this))},i.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=[]),t.isNullOrUndefined(this.parent.dataSource))this.parent.dataSource=[],this.parent.processTimeline(),this.parent.renderGantt(e);else if(this.parent.dataSource instanceof n.DataManager)this.initDataSource(e);else{if(this.parent.dataSource instanceof Object&&m(this.parent)){var i=t.getValue("result",this.parent.dataSource);this.dataArray=i}else this.dataArray=this.parent.dataSource;this.processTimeline(),this.cloneDataSource(),this.parent.renderGantt(e)}},i.prototype.processTimeline=function(){this.parent.processTimeline(),this.parent.enableValidation||(this.parent.dataOperation.calculateProjectDatesForValidatedTasks(),this.parent.timelineModule.validateTimelineProp())},i.prototype.initDataSource=function(e){var t=this,i=this.parent.query instanceof n.Query?this.parent.query:new n.Query;i.requiresCount();this.parent.dataSource.executeQuery(i).then(function(i){t.dataArray=i.result,t.processTimeline(),t.cloneDataSource(),t.parent.renderGantt(e)}).catch(function(i){t.parent.processTimeline(),t.parent.renderGantt(e),t.parent.trigger("actionFailure",{error:i})})},i.prototype.constructDataSource=function(e){for(var i,r=new n.DataManager(e).executeLocal((new n.Query).group(this.parent.taskFields.parentID)),a=[],s=0;s<r.length;s++){var o=r[s];!t.isNullOrUndefined(o.key)&&(i=this.taskIds.indexOf(o.key.toString()))>-1&&!t.isNullOrUndefined(o.key)?e[i][this.parent.taskFields.child]=o.items:-1!==i&&a.push.apply(a,o.items)}this.hierarchyData=this.dataReorder(e,a)},i.prototype.cloneDataSource=function(){var e=this.parent.taskFields.id,i=this.parent.taskFields.parentID,r=[];if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))r=this.dataArray;else{for(var a=[],s=0;s<this.dataArray.length;s++){var o=this.dataArray[s];a.push(t.extend({},{},o,!0)),t.isNullOrUndefined(o[e])||this.taskIds.push(o[e].toString())}this.parent.taskFields.child||(this.parent.taskFields.child="Children"),this.constructDataSource(a),r=this.hierarchyData}if(this.parent.taskFields.segmentId&&(this.segmentCollection=new n.DataManager(this.parent.segmentData).executeLocal((new n.Query).group(this.parent.taskFields.segmentId)),this.parent.taskFields.segments||(this.parent.taskFields.segments="Segments")),"ProjectView"!==this.parent.viewType){var l=t.extend([],[],this.parent.resources,!0),d=[];if(this.constructResourceViewDataSource(l,r,d),d.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]=d,l.push(p)}r=l}this.prepareDataSource(r)},i.prototype.constructResourceViewDataSource=function(e,t,i){for(var r=function(r){var a=t[r],s=n.parent.taskFields.child,o=a&&a[n.parent.taskFields.resourceInfo],l=n.parent.resourceFields.id;a[s]&&0!==a[s].length||!o||!o.length?a[s]||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[n.parent.taskFields.child]&&a[n.parent.taskFields.child].length&&n.constructResourceViewDataSource(e,a[n.parent.taskFields.child],i)},n=this,a=0;a<t.length;a++)r(a)},i.prototype.prepareDataSource=function(e){this.prepareRecordCollection(e,0),"ResourceView"===this.parent.viewType&&this.calculateSharedTaskUniqueIds(),this.parent.taskFields.dependency&&this.parent.predecessorModule&&this.parent.predecessorModule.ensurePredecessorCollection()},i.prototype.calculateSharedTaskUniqueIds=function(){for(var e=function(e){var i=t.parent.getTaskIds()[e].match(/(\d+|[A-z]+)/g);if("R"!==i[0]){var r=[],n=[];t.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=this,i=0;i<this.parent.getTaskIds().length;i++)e(i)},i.prototype.prepareRecordCollection=function(e,i,r){for(var n=this,a=e.length,s=function(a){var s=e[a];if(!t.isNullOrUndefined(o.parent.taskFields.segmentId)){var l=o.segmentCollection.filter(function(e){return e.key===s[n.parent.taskFields.id]});l.length>0&&(s[o.parent.taskFields.segments]=l[0].items)}var d=o.createRecord(s,i,r,!0);o.parent.enableValidation||o.updateTaskLeftWidth(d),d.index=o.recordIndex++,o.parent.ids[d.index]=d.ganttProperties.rowUniqueID,o.parent.flatData.push(d),o.parent.setTaskIds(d);var p=s[o.parent.taskFields.child];if("ResourceView"===o.parent.viewType&&t.isNullOrUndefined(p)&&t.isNullOrUndefined(d.parentItem)&&0===d.level){var h=d.ganttProperties,c=d;o.parent.setRecordValue(h.isAutoSchedule?"startDate":"autoStartDate",null,c.ganttProperties,!0),o.parent.setRecordValue(h.isAutoSchedule?"endDate":"autoEndDate",null,c.ganttProperties,!0);var u=c.ganttProperties;o.parent.setRecordValue("isMilestone",!1,u,!0),u.isAutoSchedule&&o.calculateDuration(c),o.updateWorkWithDuration(c);var g=u.work;o.parent.setRecordValue("work",g,u,!0),o.parent.setRecordValue("taskType","FixedDuration",u,!0),t.isNullOrUndefined(o.parent.taskFields.type)||o.updateMappingData(c,"type"),o.parent.setRecordValue("progress",Math.floor(0),u,!0),o.parent.setRecordValue("totalProgress",0,u,!0),o.parent.setRecordValue("totalDuration",0,u,!0),u.isAutoSchedule||(o.parent.setRecordValue("autoDuration",o.calculateAutoDuration(u),u,!0),o.updateAutoWidthLeft(c)),o.resetDependency(c),o.updateWidthLeft(c),o.updateTaskData(c)}!t.isNullOrUndefined(p)&&p.length>0&&o.prepareRecordCollection(p,d.level+1,d)},o=this,l=0;l<a;l++)s(l)},i.prototype.addCustomFieldValue=function(e,t){var i=this.parent.ganttColumns,r=i.length;if(r)for(var n=0;n<r;n++)void 0===t[i[n].field]&&this.parent.setRecordValue(i[n].field,e[i[n].field],t)},i.prototype.createRecord=function(e,i,n,a){var s=this.parent.taskFields,o=this.parent.resourceFields,l=e[s.progress],d=null,p=null,h=e[s.notes];l=l&&parseFloat(l.toString())?parseFloat(l.toString()):0;var c=e[s.dependency],u=this.getDateFromFormat(e[s.baselineStartDate],!0),g=this.getDateFromFormat(e[s.baselineEndDate],!0),f={},y={},v="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[s.manual];this.parent.setRecordValue("ganttProperties",y,f),t.isNullOrUndefined(e[s.id])?t.isNullOrUndefined(e[o.id])||(d=e[o.id],p=e[o.name],this.addTaskData(f,e,!1)):(d=e[s.id],p=e[s.name],this.addTaskData(f,e,a)),this.parent.setRecordValue("taskId",d,y,!0),this.parent.setRecordValue("taskName",p,y,!0),s.parentID&&this.parent.setRecordValue("parentId",e[s.parentID],y,!0),this.addCustomFieldValue(e,f),this.parent.setRecordValue("isAutoSchedule",v,y,!0),this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),y,!0),this.parent.setRecordValue("isMilestone",!1,y,!0),this.parent.setRecordValue("indicators",e[s.indicators],y,!0),this.updateResourceName(f),this.calculateScheduledValues(f,e,a),this.parent.setRecordValue("baselineStartDate",this.checkBaselineStartDate(u),y,!0),g&&0===g.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,g),(y.baselineStartDate&&g&&y.baselineStartDate.getTime()>g.getTime()||y.isMilestone)&&(g=y.baselineStartDate),this.parent.setRecordValue("baselineEndDate",this.checkBaselineEndDate(g,y),y,!0),this.parent.setRecordValue("progress",l,y,!0),this.parent.setRecordValue("totalProgress",l,y,!0),this.parent.setRecordValue("predecessorsName",c,y,!0),this.parent.setRecordValue("notes",h,y,!0),this.parent.setRecordValue("cssClass",e[s.cssClass],y,!0),this.parent.setRecordValue("parentItem",this.getCloneParent(n),f);var D=f.parentItem?f.parentItem.uniqueID:null;if(this.parent.setRecordValue("parentUniqueID",D,f),"ResourceView"!==this.parent.viewType||t.isNullOrUndefined(s.parentID)||t.isNullOrUndefined(f.parentItem)||this.parent.setRecordValue("parentId",f.parentItem.taskId,y,!0),this.parent.setRecordValue("level",i,f),this.parent.setRecordValue("uniqueID",r.getUid(this.parent.element.id+"_data_"),f),this.parent.setRecordValue("uniqueID",f.uniqueID,y,!0),this.parent.setRecordValue("childRecords",[],f),this.parent.dataSource instanceof Object&&m(this.parent)&&!t.isNullOrUndefined(s.child)&&this.parent.setRecordValue(s.child,[],f),!t.isNullOrUndefined(e[s.child])&&e[s.child].length>0?(this.parent.setRecordValue("hasChildRecords",!0,f),this.parent.setRecordValue("isMilestone",!1,y,!0),this.resetDependency(f)):this.parent.setRecordValue("hasChildRecords",!1,f),f.hasChildRecords&&(this.parent.setRecordValue("autoStartDate",f.ganttProperties.startDate,y),this.parent.setRecordValue("autoEndDate",f.ganttProperties.endDate,y),this.parent.setRecordValue("autoDuration",f.ganttProperties.duration,y)),this.parent.setRecordValue("expanded",!f.hasChildRecords||!this.parent.collapseAllParentTasks,f),this.updateExpandStateMappingValue(f,e),a||(this.parent.setRecordValue("width",this.calculateWidth(f),y,!0),this.parent.setRecordValue("left",this.calculateLeft(y),y,!0),this.parent.setRecordValue("progressWidth",this.getProgressWidth(y.width,l),y,!0),y.baselineEndDate&&y.baselineStartDate&&(this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(y),y,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(y),y,!0))),t.isNullOrUndefined(s.work)&&this.updateWorkWithDuration(f),t.isNullOrUndefined(s.manual)||this.parent.dataOperation.updateMappingData(f,"manual"),this.updateTaskData(f),c&&this.parent.predecessorsCollection.push(f),t.isNullOrUndefined(n)||(n.childRecords.push(f),this.parent.dataSource instanceof Object&&m(this.parent)&&!t.isNullOrUndefined(this.parent.taskFields.child)&&n[this.parent.taskFields.child].push(f.taskData)),"ProjectView"===this.parent.viewType)this.parent.setRecordValue("rowUniqueID",y.taskId.toString(),y,!0);else{var w=f.uniqueID.replace(this.parent.element.id+"_data_","");this.parent.setRecordValue("rowUniqueID",w,f),this.parent.setRecordValue("rowUniqueID",w,y,!0),this.parent.setRecordValue("sharedTaskUniqueIds",[],y,!0)}return this.parent.allowUnscheduledTasks&&f.ganttProperties.startDate&&(f.ganttProperties.endDate||f.ganttProperties.duration)&&(this.parent.setRecordValue("segments",this.setSegmentsInfo(f,!0),y,!0),this.parent.dataOperation.updateMappingData(f,"segments"),a||this.updateWidthLeft(f)),f},i.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},i.prototype.setSegmentsInfo=function(e,i){var r,n=this.parent.taskFields,a=[],s=0,o=0,l=[];if(!t.isNullOrUndefined(this.parent.taskFields.segments)&&(r=i?e.taskData[this.parent.taskFields.segments]:e.ganttProperties.segments,!t.isNullOrUndefined(r)&&r.length>1)){this.sortSegmentsData(r,i,e.ganttProperties);for(var d=0;d<r.length;d++){var p=r[d],h=i?p[n.startDate]:p.startDate,c=i?p[n.endDate]:p.endDate,u=i?p[n.duration]:p.duration;if(h=this.getDateFromFormat(h),h=this.checkStartDate(h,e.ganttProperties,!1),t.isNullOrUndefined(u)?(c=this.getDateFromFormat(c),c=this.checkEndDate(c,e.ganttProperties,!1),u=this.getDuration(h,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone)):c=this.getEndDate(h,u,e.ganttProperties.durationUnit,e.ganttProperties,!1),n.duration){if((o=e.ganttProperties.duration-s)<=0)continue;u=d===r.length-1?o:o>0&&u>o?o:u,c=this.getEndDate(h,u,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!n.duration&&n.endDate&&(c=!t.isNullOrUndefined(e.ganttProperties.endDate)&&c.getTime()>e.ganttProperties.endDate.getTime()&&d!==r.length-1?c:e.ganttProperties.endDate,u=this.getDuration(h,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),a.length>0&&c.getTime()<h.getTime()&&c.getTime()<=e.ganttProperties.endDate.getTime())){a[d-1].duration=this.getDuration(a[d-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);continue}if(p={},!(h&&c&&h&&u))break;if(s+=u,p.startDate=h,p.endDate=c,p.duration=u,p.width=0,p.left=0,p.segmentIndex=d,a.push(p),t.isNullOrUndefined(a[d-1]))p.offsetDuration=0;else{var g=this.getDuration(a[d-1].endDate,a[d].startDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);p.offsetDuration=g,g<1&&(p.startDate=this.getEndDate(a[d-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=!n.duration&&n.endDate&&p.endDate>e.ganttProperties.endDate?e.ganttProperties.endDate:p.endDate,p.offsetDuration=1)}l.push(this.setSegmentTaskData(p,r[d]))}this.parent.setRecordValue("duration",s,e.ganttProperties,!0),this.parent.setRecordValue("endDate",a[a.length-1].endDate,e.ganttProperties,!0),t.isNullOrUndefined(n.endDate)||this.parent.setRecordValue(this.parent.taskFields.endDate,a[a.length-1].endDate,e,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,l,e)}return a.length>1?this.parent.setRecordValue("segments",a,e.ganttProperties,!0):a=null,a},i.prototype.setSegmentTaskData=function(e,i){var r=this.parent.taskFields,n=t.extend({},{},i,!0);return t.isNullOrUndefined(r.startDate)||(n[this.parent.taskFields.startDate]=e.startDate),t.isNullOrUndefined(r.endDate)||(n[this.parent.taskFields.endDate]=e.endDate),t.isNullOrUndefined(r.duration)||(n[this.parent.taskFields.duration]=Number(e.duration)),n},i.prototype.updateWorkWithDuration=function(e){var i=e.ganttProperties.resourceInfo,r=0;if(!t.isNullOrUndefined(i)){var n=i.length,a=void 0,s=void 0,o=this.parent.secondsPerDay/3600,l=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit);for(a=0;a<n;a++)r+=((s=i[a][this.parent.resourceFields.unit])>0?o*s/100:o)*l;"minute"===e.ganttProperties.workUnit&&(r*=60),"day"===e.ganttProperties.workUnit&&(r/=o),r%1!=0&&(r=parseFloat(r.toFixed(2)))}if(e.childRecords.length>0&&this.parent.isOnEdit){for(var d=0,p=0;p<e.childRecords.length;p++)d+=e.childRecords[p].ganttProperties.work;r+=d}this.parent.setRecordValue("work",r,e.ganttProperties,!0),t.isNullOrUndefined(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(e,"work")},i.prototype.getCloneParent=function(e){if(t.isNullOrUndefined(e))return null;var i={};return i.uniqueID=e.uniqueID,i.expanded=e.expanded,i.level=e.level,i.index=e.index,i.taskId=e.ganttProperties.rowUniqueID,i},i.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)},i.prototype.addTaskData=function(e,i,r){var a=this,s=this.parent.taskFields,o=this.parent.dataSource;if(r)if(s.parentID||o instanceof n.DataManager&&o.dataSource.json&&o.dataSource.offline)if(s.parentID){var l=i[s.id],d=this.taskIds.indexOf(l.toString()),p=d>-1?this.dataArray[d]:{};if(!t.isNullOrUndefined(this.parent.taskFields.segmentId)){var h=this.segmentCollection.filter(function(e){return e.key===p[a.parent.taskFields.id]});h.length>0&&(p[this.parent.taskFields.segments]=h[0].items)}this.parent.setRecordValue("taskData",p,e)}else this.parent.setRecordValue("taskData",i,e);else this.parent.setRecordValue("taskData",i,e);else this.parent.setRecordValue("taskData",i,e)},i.prototype.updateExpandStateMappingValue=function(e,i){var r,n=this.parent.taskFields.expandState,a=i[n];n&&e.hasChildRecords&&(t.isNullOrUndefined(a)?t.isNullOrUndefined(a)&&!this.parent.collapseAllParentTasks?r=!0:t.isNullOrUndefined(a)&&this.parent.collapseAllParentTasks&&(r=!1):r="true"===a.toString(),this.parent.setRecordValue("taskData."+n,r,e),this.parent.setRecordValue(n,r,e),this.parent.setRecordValue("expanded",r,e))},i.prototype.setValidatedDates=function(e,i){var r=e.ganttProperties,n=this.parent.taskFields,a=i[n.duration],s=this.getDateFromFormat(i[n.startDate],!0),o=this.getDateFromFormat(i[n.endDate],!0);a=t.isNullOrUndefined(a)||""===a?null:a,this.parent.setRecordValue("startDate",new Date(s.getTime()),r,!0),t.isNullOrUndefined(a)||""===a?this.calculateDuration(e):this.updateDurationValue(a,r),this.parent.setRecordValue("endDate",new Date(o.getTime()),r,!0)},i.prototype.calculateScheduledValues=function(e,i,r){var n=this.parent.taskFields,a=e.ganttProperties,s=i[n.duration];s=t.isNullOrUndefined(s)||""===s?null:s;var o,l;a.startDate&&a.endDate?(o=this.getDateFromFormat(a.startDate,!0),l=this.getDateFromFormat(a.endDate,!0)):(o=this.getDateFromFormat(i[n.startDate],!0),l=this.getDateFromFormat(i[n.endDate],!0));var d=n.segments?i[n.segments]||e.taskData[n.segments]:null,p=!!n.milestone&&!!i[n.milestone],h=i[n.durationUnit]?i[n.durationUnit]:"";this.parent.setRecordValue("durationUnit",this.validateDurationUnitMapping(h),a,!0);var c=t.isNullOrUndefined(i[n.work])?0:parseFloat(i[n.work]);this.parent.setRecordValue("workUnit",this.validateWorkUnitMapping(this.parent.workUnit),a,!0);var u=i[n.type]?i[n.type]:"",g=this.validateTaskTypeMapping(u);if(this.parent.setRecordValue("taskType",g,a,!0),r&&!this.parent.enableValidation&&o&&l)this.setValidatedDates(e,i);else if(l||o||!t.isNullOrUndefined(s)&&""!==s)o?this.calculateDateFromStartDate(o,l,s,e,r):l?this.calculateDateFromEndDate(l,s,e):t.isNullOrUndefined(s)||""===s||(this.updateDurationValue(s,a),this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,a,!0),this.parent.setRecordValue("endDate",null,a,!0)):(this.parent.setRecordValue("startDate",this.getProjectStartDate(a,r),a,!0),this.calculateEndDate(e)));else{if(this.parent.allowUnscheduledTasks)return;this.parent.setRecordValue("duration",1,a,!0),this.parent.setRecordValue("startDate",this.getProjectStartDate(a,r),a,!0),this.calculateEndDate(e)}if(t.isNullOrUndefined(d)||this.parent.setRecordValue("segments",this.setSegmentsInfo(e,!0),a,!0),0===a.duration&&(this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("endDate",a.startDate,a,!0)),!t.isNullOrUndefined(p)&&p&&(this.parent.setRecordValue("duration",0,a,!0),this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("endDate",a.startDate,a,!0)),t.isNullOrUndefined(n.work))n.type&&a.taskType&&this.parent.dataOperation.updateMappingData(e,"type");else{if(this.parent.setRecordValue("durationUnit",this.parent.durationUnit,a,!0),isNaN(c)||t.isNullOrUndefined(c))this.parent.setRecordValue("work",0,a,!0),this.parent.setRecordValue("duration",0,a,!0),this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("endDate",a.startDate,a,!0);else{switch(this.parent.setRecordValue("work",c,a,!0),g){case"FixedDuration":case"FixedWork":this.updateUnitWithWork(e);break;case"FixedUnit":this.updateDurationWithWork(e)}t.isNullOrUndefined(n.type)||this.parent.dataOperation.updateMappingData(e,"type"),0===a.duration?(this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("endDate",a.startDate,a,!0)):t.isNullOrUndefined(a.startDate)||t.isNullOrUndefined(a.duration)||(this.parent.setRecordValue("isMilestone",!1,a,!0),this.calculateEndDate(e))}this.parent.dataOperation.updateMappingData(e,"work")}},i.prototype.updateDurationWithWork=function(e){var i=e.ganttProperties,r=i.resourceInfo;if(!t.isNullOrUndefined(r)){var n=t.isNullOrUndefined(r)?0:r.length,a=0,s=this.parent.secondsPerDay/3600,o=0,l=void 0,d=void 0;for(d=0;d<n;d++)a+=(l=r[d][this.parent.resourceFields.unit])>0?s*l/100:s;var p=this.getWorkInHour(i.work,i.workUnit);n>0&&(o+=p/a),"minute"===i.durationUnit&&(o=o*s*60),"hour"===i.durationUnit&&(o*=s),o%1!=0&&(o=parseFloat(o.toFixed(2))),t.isNullOrUndefined(i.duration)||this.parent.setRecordValue("duration",o,i,!0),this.parent.dataOperation.updateMappingData(e,"duration")}},i.prototype.updateUnitWithWork=function(e){var i=e.ganttProperties,r=i.resourceInfo,n=t.isNullOrUndefined(r)?0:r.length,a=this.parent.secondsPerDay/3600;if(0!==n){var s=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit),o=this.getWorkInHour(i.work,i.workUnit),l=s>0?o/(s*a)*100:0,d=l>0?l/n:100;d%1!=0&&(d=parseFloat(d.toFixed(2)));for(var p=0;p<n;p++)r[p][this.parent.resourceFields.unit]=d;this.updateResourceName(e)}},i.prototype.calculateDateFromEndDate=function(e,i,r){var n=r.ganttProperties;0===e.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,e);var a=0===parseInt(i,10)||null;this.parent.setRecordValue("endDate",this.checkEndDate(e,r.ganttProperties,a),n,!0),t.isNullOrUndefined(i)||""===i?this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,n,!0),this.parent.setRecordValue("duration",null,n,!0)):(this.parent.setRecordValue("duration",1,n,!0),this.parent.setRecordValue("startDate",this.getStartDate(n.endDate,n.duration,n.durationUnit,n),n,!0)):t.isNullOrUndefined(i)||""===i||(this.updateDurationValue(i,n),this.parent.setRecordValue("startDate",this.getStartDate(n.endDate,n.duration,n.durationUnit,n),n,!0))},i.prototype.calculateDateFromStartDate=function(e,i,r,n,a){var s=n.ganttProperties,o=!!(0===parseInt(r,10)||e&&i&&new Date(e.getTime())===new Date(i.getTime()))||null;this.parent.setRecordValue("startDate",this.checkStartDate(e,s,o,a),s,!0),this.parent.isTreeGridRendered&&n&&this.updateTaskData(n),i||!t.isNullOrUndefined(r)&&""!==r?(t.isNullOrUndefined(r)||i)&&i&&(t.isNullOrUndefined(r)||""===r)?(0===i.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,i),this.parent.setRecordValue("endDate",this.checkEndDate(i,n.ganttProperties),s,!0),1===this.compareDates(s.startDate,s.endDate)?(this.parent.setRecordValue("endDate",s.startDate,s,!0),this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("duration",0,s,!0)):this.calculateDuration(n)):(this.updateDurationValue(r,s),this.calculateEndDate(n)):this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("endDate",null,s,!0),this.parent.setRecordValue("duration",null,s,!0)):(this.parent.setRecordValue("duration",1,s,!0),this.calculateEndDate(n))},i.prototype.getProgressWidth=function(e,t){return e*t/100},i.prototype.calculateWidth=function(e,i){var r=e.ganttProperties,n=i?r.autoStartDate:r.startDate,a=i?r.autoEndDate:r.endDate;return t.isNullOrUndefined(n)&&t.isNullOrUndefined(a)&&(n=this.getValidStartDate(r,i),a=this.getValidEndDate(r,i)),t.isNullOrUndefined(n)||t.isNullOrUndefined(a)?3:!r.isMilestone||e.hasChildRecords&&!r.isAutoSchedule?this.getTaskWidth(n,a):0},i.prototype.getTaskbarHeight=function(){var e=this.parent.rowHeight,t=this.parent.taskbarHeight;return t<e?t:e},i.prototype.calculateLeft=function(e,i){var r=null,n=-300,a=i?e.autoStartDate:e.startDate,s=i?e.autoEndDate:e.endDate,o=(i?e.autoDuration:e.duration,e.isMilestone);return a?r=new Date(a.getTime()):s?(r=new Date(s.getTime()),o=!0):r=this.getValidStartDate(e),t.isNullOrUndefined(r)||(n=this.getTaskLeft(r,o)),n},i.prototype.calculateAutoLeft=function(e){return this.getTaskLeft(e.autoStartDate,e.isMilestone)},i.prototype.calculateAutoDuration=function(e){return this.getDuration(e.autoStartDate,e.autoEndDate,e.durationUnit,!1,e.isMilestone)},i.prototype.calculateAutoWidth=function(e){return this.getTaskWidth(e.autoStartDate,e.autoEndDate)},i.prototype.calculateBaselineLeft=function(e){var t=this.getDateFromFormat(e.baselineStartDate),i=this.getDateFromFormat(e.baselineEndDate);return t&&i?this.getTaskLeft(t,e.isMilestone):0},i.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},i.prototype.getTaskWidth=function(e,t){var i=new Date(e.getTime()),r=new Date(t.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(r)===this.parent.defaultEndTime&&r.setHours(24),this.getSecondsInDecimal(r)===this.parent.defaultStartTime&&r.setHours(0,0,0,0)),i.getTime()===r.getTime()?this.parent.perDayWidth:this.getTimeDifference(i,r)/864e5*this.parent.perDayWidth},i.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));var r=this.parent.timelineModule.timelineStartDate;return r?(i.getTime()-r.getTime())/864e5*this.parent.perDayWidth:0},i.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},i.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},i.prototype.updateMappingData=function(e,i){var r=this.parent.columnMapping,n=e.ganttProperties;if(!t.isNullOrUndefined(r[i])||"taskType"===i||"segments"===i)if("predecessorName"===i);else if("resourceInfo"===i){var a=n.resourceInfo,s=this.parent.resourceFields,o=[],l=[];if(!t.isNullOrUndefined(a))for(var d=0;d<a.length;d++){o.push(a[d][s.id]);var p=a[d][s.name],h=a[d][s.unit];100!==h&&(p+="["+h+"%]"),l.push(p)}this.parent.setRecordValue("resourceNames",l.join(","),n,!0),this.updateTaskDataResource(e),this.parent.setRecordValue(r[i],l.join(","),e)}else"startDate"===i||"endDate"===i?this.setRecordDate(e,n[i],r[i]):"duration"===i?this.setRecordDuration(e,r[i]):"work"===i?(this.parent.setRecordValue("taskData."+r[i],this.getWorkString(n.work,n.workUnit),e),this.parent.setRecordValue(r[i],n[i],e)):"type"===i?(this.parent.setRecordValue("taskData."+r[i],n[i],e),this.parent.setRecordValue(r[i],n[i],e)):"manual"===i?(this.parent.setRecordValue("taskData."+r[i],!n.isAutoSchedule,e),this.parent.setRecordValue(r[i],!n.isAutoSchedule,e)):"segments"===i?this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,this.segmentTaskData(e),e):(this.parent.setRecordValue("taskData."+r[i],n[i],e),this.parent.setRecordValue(r[i],n[i],e))},i.prototype.segmentTaskData=function(e){var i=e.ganttProperties.segments,r=this.parent.taskFields;if(t.isNullOrUndefined(i))return null;for(var n=t.extend([],[],e.taskData[r.segments],!0),a=0;a<i.length;a++)(this.parent.isEdit||this.parent.editModule&&this.parent.editModule.dialogModule&&t.getValue("isEdit",this.parent.editModule.dialogModule)||this.parent.contextMenuModule&&t.getValue("isEdit",this.parent.contextMenuModule))&&(n[a]={}),t.isNullOrUndefined(r.startDate)||(n[a][this.parent.taskFields.startDate]=i[a].startDate),t.isNullOrUndefined(r.endDate)||(n[a][this.parent.taskFields.endDate]=i[a].endDate),t.isNullOrUndefined(r.duration)||(n[a][this.parent.taskFields.duration]=Number(i[a].duration));return n},i.prototype.updateTaskDataResource=function(e){var i=e.ganttProperties.resourceInfo,r=e.taskData[this.parent.taskFields.resourceInfo],n=this.parent.resourceFields;if(t.isNullOrUndefined(r))e.taskData[this.parent.taskFields.resourceInfo]=i;else if(i.length){for(var a=0;a<i.length;a++){for(var s=!1,o=0;o<r.length;o++)if("number"==typeof r[o]||"string"==typeof r[o]){if(parseInt(r[o],10)===parseInt(i[a][n.id],10)){r[o]=i[a],s=!0;break}}else if(r[o][n.id]===i[a][n.id]&&"number"!=typeof r[o]){r[o]=t.extend({},r[o],i[a],!0),s=!0;break}s||r.push(i[a])}for(var l=[],d=function(e){i.filter(function(t){t[n.id]===r[e][n.id]&&l.push(r[e])})},p=0;p<r.length;p++)d(p);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,l,e)}else this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e)},i.prototype.setRecordDate=function(e,i,r){var n="string"==typeof i?new Date(i):i;t.isNullOrUndefined(i)||(i=new Date(n.getTime())),this.parent.setRecordValue(r,i,e),t.isNullOrUndefined(i)||(i=new Date(n.getTime())),this.parent.isLoad||this.parent.isDynamicData||this.parent.setRecordValue("taskData."+r,i,e),this.parent.isDynamicData=!1},i.prototype.getDurationInDay=function(e,t){return"day"===t?e:"hour"===t?e/(this.parent.secondsPerDay/3600):e/(this.parent.secondsPerDay/60)},i.prototype.setRecordDuration=function(e,i){var r=e.ganttProperties.duration,n=e.ganttProperties.durationUnit;if(t.isNullOrUndefined(r))this.parent.setRecordValue(i,r,e),this.parent.setRecordValue("taskData."+i,r,e);else{this.parent.setRecordValue(i,e.ganttProperties.duration,e);var a=t.getValue(i,e.taskData);isNaN(a)&&t.isNullOrUndefined(this.parent.taskFields.durationUnit)&&!t.isNullOrUndefined(a)?this.parent.setRecordValue("taskData."+i,this.getDurationString(r,n),e):"string"==typeof a?this.parent.setRecordValue("taskData."+i,r.toString(),e):this.parent.setRecordValue("taskData."+i,r,e)}this.parent.taskFields.durationUnit&&(e.taskData[this.parent.taskFields.durationUnit]=e.ganttProperties.durationUnit)},i.prototype.getWorkInHour=function(e,t){return"day"===t?e*(this.parent.secondsPerDay/3600):"minute"===t?e/60:e},i.prototype.updateTaskData=function(e){var i=this.parent.taskFields,r=e.ganttProperties;if(!t.isNullOrUndefined(e.taskData)){var n=e.taskData;if(i.id&&(this.parent.setRecordValue("taskData."+i.id,r.taskId,e),this.parent.setRecordValue(i.id,r.taskId,e)),i.name&&(this.parent.setRecordValue("taskData."+i.name,r.taskName,e),this.parent.setRecordValue(i.name,r.taskName,e)),i.startDate&&this.setRecordDate(e,r.startDate,i.startDate),i.endDate&&this.setRecordDate(e,r.endDate,i.endDate),i.duration&&this.setRecordDuration(e,i.duration),i.durationUnit&&(n[i.durationUnit]=r.durationUnit),i.progress&&(this.parent.setRecordValue("taskData."+i.progress,r.progress,e),this.parent.setRecordValue(i.progress,r.progress,e)),i.baselineStartDate&&this.setRecordDate(e,r.baselineStartDate,i.baselineStartDate),i.baselineEndDate&&this.setRecordDate(e,r.baselineEndDate,i.baselineEndDate),i.notes&&(this.parent.setRecordValue("taskData."+i.notes,r.notes,e),this.parent.setRecordValue(i.notes,r.notes,e)),i.cssClass&&(this.parent.setRecordValue("taskData."+i.cssClass,r.cssClass,e),this.parent.setRecordValue(i.cssClass,r.cssClass,e)),i.indicators&&(this.parent.setRecordValue("taskData."+i.indicators,r.indicators,e),this.parent.setRecordValue(i.indicators,r.indicators,e)),i.parentID){var a="ProjectView"===this.parent.viewType?r.parentId:n[i.parentID];this.parent.setRecordValue("taskData."+i.parentID,a,e),this.parent.setRecordValue(i.parentID,r.parentId,e)}i.work&&(this.parent.setRecordValue("taskData."+i.work,this.getWorkString(r.work,r.workUnit),e),this.parent.setRecordValue(i.work,r.work,e)),i.type&&(this.parent.setRecordValue("taskData."+i.type,r.taskType,e),this.parent.setRecordValue(i.type,r.taskType,e))}},i.prototype.setResourceInfo=function(e){var i;if(t.isNullOrUndefined(e[this.parent.taskFields.resourceInfo]))return i;i=e[this.parent.taskFields.resourceInfo];var r;r=t.isNullOrUndefined(this.parent.editModule)||t.isNullOrUndefined(this.parent.editModule.dialogModule)||!this.parent.editModule.dialogModule.isAddNewResource?this.parent.resources:this.parent.editModule.dialogModule.ganttResources;for(var n=this.parent.resourceFields.id,a=this.parent.resourceFields.unit,s=this.parent.resourceFields.group,o=[],l=function(e){var l=r.filter(function(t){return"object"==typeof i[e]&&i[e][n]===t[n]||i[e]===t[n]}),d=t.extend({},l[0]);o.push(d),t.isNullOrUndefined(a)||t.isNullOrUndefined(i[e][a])||(d[a]=i[e][a]),t.isNullOrUndefined(s)||t.isNullOrUndefined(i[e][s])||(d[s]=i[e][s])},d=0;d<i.length;d++)l(d);return this.updateResourceUnit(o),o},i.prototype.updateResourceUnit=function(e){var i=this.parent.resourceFields.unit;if(!t.isNullOrUndefined(i)){var r=e.length,n=void 0;for(n=0;n<r;n++)t.isNullOrUndefined(e[n][i])&&(e[n][i]=100)}},i.prototype.updateResourceName=function(e){var i=e.ganttProperties.resourceInfo,r=[];if(i){var n=t.extend([],[],e.taskData[this.parent.taskFields.resourceInfo],!0);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e);for(var a=0;a<i.length;a++){var s=i[a],o=s[this.parent.resourceFields.name],l=s[this.parent.resourceFields.unit];if(100!==l&&(o+="["+l+"%]"),r.push(o),e.taskData){var d=this.parent.taskFields.resourceInfo;n[a],e.taskData[d].push(n[a])}}this.parent.setRecordValue("resourceNames",r.join(","),e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.resourceInfo,r.join(","),e,!0),this.updateTaskDataResource(e)}},i.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},i.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()},i.prototype.validateTaskTypeMapping=function(e){var t=e;return t="FixedDuration"===t?"FixedDuration":"FixedUnit"===t?"FixedUnit":"FixedWork"===t?"FixedWork":this.parent.taskType},i.prototype.validateWorkUnitMapping=function(e){var t=e;return t="minute"===t?"minute":"hour"===t?"hour":"day"===t?"day":this.parent.workUnit.toLocaleLowerCase()},i.prototype.updateDurationValue=function(e,i){var r=this.getDurationValue(e);isNaN(t.getValue("duration",r))||this.parent.setRecordValue("duration",t.getValue("duration",r),i,!0),t.isNullOrUndefined(t.getValue("durationUnit",r))||this.parent.setRecordValue("durationUnit",t.getValue("durationUnit",r),i,!0)},i.prototype.reUpdateGanttData=function(){if(this.parent.flatData.length>0){var e=void 0,i=void 0;this.parent.secondsPerDay=this.getSecondsPerDay();for(var r=0;r<this.parent.flatData.length;r++)e=this.parent.flatData[r].taskData,i=this.parent.flatData[r],t.isNullOrUndefined(this.parent.taskFields.duration)||this.setRecordDuration(i,this.parent.taskFields.duration),this.calculateScheduledValues(i,e,!1);this.updateGanttData()}},i.prototype._isInStartDateRange=function(e,t,i){var r=!1;return e.getTime()>=t.getTime()&&e.getTime()<i.getTime()&&(r=!0),r},i.prototype._isInEndDateRange=function(e,t,i){var r=!1;return e.getTime()>t.getTime()&&e.getTime()<=i.getTime()&&(r=!0),r},i.prototype.updateOverlappingValues=function(e){var t,i=e.childRecords,r=[];if(i.length<=1)e.ganttProperties.workTimelineRanges=[];else{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,p=i[l].ganttProperties.endDate,h={};(this._isInStartDateRange(a,d,p)||this._isInEndDateRange(s,d,p))&&(d.getTime()>a.getTime()&&d.getTime()<s.getTime()&&p.getTime()>a.getTime()&&p.getTime()>s.getTime()||a.getTime()===d.getTime()&&s.getTime()<=p.getTime()?(h.from=d,h.to=s):a.getTime()===d.getTime()&&s.getTime()>p.getTime()?(h.from=d,h.to=p):a.getTime()>d.getTime()&&s.getTime()>=p.getTime()?(h.from=a,h.to=p):a.getTime()>d.getTime()&&s.getTime()<p.getTime()&&(h.from=a,h.to=s),o.push(h))}r.push.apply(r,this.mergeRangeCollections(o))}this.parent.setRecordValue("workTimelineRanges",this.mergeRangeCollections(r,!0),e.ganttProperties,!0),this.calculateRangeLeftWidth(e.ganttProperties.workTimelineRanges)}},i.prototype.updateOverlappingIndex=function(e){for(var t=0;t<e.length;t++)e[t].ganttProperties.eOverlapIndex=t},i.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)},i.prototype.mergeRangeCollections=function(e,t){for(var i,r,a,s,o=[],l={},d={},p=new n.DataManager(e).executeLocal((new n.Query).sortBy(this.parent.taskFields.startDate,"Ascending")),h=0;h<p.length;h++)0!==o.length||0!==h?(i=(l=o[o.length-1]).from,r=l.to,a=(d=p[h]).from,s=d.to,i.getTime()===a.getTime()&&r.getTime()>=s.getTime()||i.getTime()<a.getTime()&&r.getTime()>=s.getTime()||(i.getTime()<=a.getTime()&&r.getTime()>=a.getTime()&&r.getTime()<s.getTime()||r.getTime()<a.getTime()&&this.checkStartDate(r).getTime()===a.getTime()?l.to=s:r.getTime()<a.getTime()&&this.checkStartDate(r).getTime()!==a.getTime()&&o.push(p[h]))):o.push(p[h]);return t&&(o=this.splitRangeCollection(o)),o},i.prototype.setSortedChildTasks=function(e){return new n.DataManager(e.childRecords).executeLocal((new n.Query).sortBy(this.parent.taskFields.startDate,"Ascending"))},i.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)},i.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},i.prototype.splitRangeForDayMode=function(e,i,r){var n=i||"from",a=r||"to",s=new Date(e[n]),o=new Date(e[a]),l=[],d={};if(s.getTime()<o.getTime())do{for(var p=new Date(s.getTime()),h=new Date(s.getTime()),c=0,u=this.parent.dataOperation.getSecondsInDecimal(s),g=-1,f=0;f<this.parent.workingTimeRanges.length;f++){var m=this.parent.workingTimeRanges[f];if(u>=m.from&&u<=m.to){g=f;break}}-1!==g&&(c=Math.round(this.parent.workingTimeRanges[g].to-u),h.setSeconds(h.getSeconds()+c));h.getTime()<o.getTime()?(d={},e.task&&(d.task=t.extend([],e.task)),d[n]=p,d[a]=h,d.isSplit=!0,l.push(d)):(d={},e.task&&(d.task=t.extend([],e.task)),d[n]=p,d[a]=o,d.isSplit=!0,l.push(d)),s=this.checkStartDate(h)}while(s.getTime()<o.getTime());else l.push(e);return l},i.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},i.prototype.splitRangeForWeekMode=function(e,i,r){var n=i||"from",a=r||"to",s=new Date(e[n]),o=new Date(e[n]),l=new Date(e[a]),d=!1,p=[],h={};if(o.setDate(o.getDate()+1),o.getTime()<l.getTime()){do{if(this.parent.dataOperation.isOnHolidayOrWeekEnd(o,null)){var c=new Date(o.getTime());c.setDate(o.getDate()-1),this.setTime(this.parent.defaultEndTime,c),(h={})[n]=s,h.isSplit=!0,h[a]=c,e.task&&(h.task=t.extend([],e.task,!0)),s.getTime()!==c.getTime()&&p.push(h),s=this.checkStartDate(c),o=new Date(s.getTime()),d=!0}else o.setDate(o.getDate()+1)}while(o.getTime()<l.getTime());d?s.getTime()!==l.getTime()&&(h={},e.task&&(h.task=t.extend([],e.task,!0)),h[n]=s,h[a]=l,h.isSplit=!0,p.push(h)):p.push(e)}else p.push(e);return p},i.prototype.updateGanttData=function(){for(var e=this.parent.flatData,t=e.length,i=0;i<t;i++){var r=e[i];this.updateTaskLeftWidth(r)}},i.prototype.updateTaskLeftWidth=function(e){var t=e.ganttProperties;e.hasChildRecords||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&&(r=(i=this.parent.getParentTask(e.parentItem)).childRecords),i&&r.indexOf(e)===r.length-1&&!e.hasChildRecords&&this.parent.enableValidation?this.updateParentItems(i):i&&!this.parent.enableValidation&&this.updateWidthLeft(i)},i.prototype.reUpdateGanttDataPosition=function(){for(var e=this.parent.flatData,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)}},i.prototype.updateWidthLeft=function(e){var i=e.ganttProperties;if(!t.isNullOrUndefined(i.segments)&&i.segments.length>0){for(var r=i.segments,n=!0,a=this.splitTasksDuration(r)*this.parent.perDayWidth,s=this.parent.dataOperation.getProgressWidth(a,i.progress),o=0;o<r.length;o++){var l=r[o];if(0===o&&!t.isNullOrUndefined(i.startDate)&&l.startDate.getTime()!==i.startDate.getTime()){l.startDate=i.startDate;var d=this.parent.dataOperation.getEndDate(l.startDate,l.duration,i.durationUnit,i,!1);l.endDate=this.parent.dataOperation.checkEndDate(d,i,!1),this.parent.chartRowsModule.incrementSegments(r,0,e)}if(l.width=this.getSplitTaskWidth(l.startDate,l.duration,e),l.showProgress=!1,l.progressWidth=-1,0!==o){var p=new Date(i.startDate.getTime());l.left=this.getSplitTaskLeft(l.startDate,p)}s>0&&s>l.width?(s-=l.width,l.progressWidth=l.width,l.showProgress=!1):n&&(l.progressWidth=s,l.showProgress=!0,s-=l.width,n=!1)}this.parent.setRecordValue("segments",i.segments,i,!0),this.parent.dataOperation.updateMappingData(e,"segments")}this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e),i,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(i),i,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(i.isAutoSchedule||!e.hasChildRecords?i.width:i.autoWidth,i.progress),i,!0)},i.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)},i.prototype.getParentProgress=function(e){var i=0,r={};switch(e.ganttProperties.durationUnit){case"hour":i=e.ganttProperties.duration/(this.parent.secondsPerDay/3600);break;case"minute":i=e.ganttProperties.duration/(this.parent.secondsPerDay/60);break;default:i=e.ganttProperties.duration}return e.hasChildRecords?(t.setValue("totalProgress",e.ganttProperties.totalProgress,r),t.setValue("totalDuration",e.ganttProperties.totalDuration,r)):(t.setValue("totalProgress",e.ganttProperties.progress*i,r),t.setValue("totalDuration",i,r)),r},i.prototype.resetDependency=function(e){var i=this.parent.taskFields.dependency;if(!t.isNullOrUndefined(i)){var r=e.ganttProperties;this.parent.setRecordValue("predecessor",[],r,!0),this.parent.setRecordValue("predecessorsName",null,r,!0),this.parent.setRecordValue("taskData."+i,null,e),this.parent.setRecordValue(i,null,e)}},i.prototype.updateParentItems=function(e,i){var r=i?e:this.parent.getParentTask(e),n=!1,a=r.ganttProperties;if(r.childRecords.length>0){for(var s=a.isAutoSchedule?a.startDate:a.autoStartDate,o=a.isAutoSchedule?a.endDate:a.autoEndDate,l=r.childRecords,d=l.length,p=0,h={},c=null,u=null,g=0,m=0,y=0,v=void 0,D=0;D<d;D++)if(v=l[D],this.parent.isOnDelete&&v.isDelete)1===d&&"ProjectView"===this.parent.viewType&&(n=!0);else{var w=this.getValidStartDate(v.ganttProperties);!r.hasChildRecords||a.isAutoSchedule||t.isNullOrUndefined(v.ganttProperties.autoStartDate)||(w=v.ganttProperties.autoStartDate);var k=this.getValidEndDate(v.ganttProperties);!r.hasChildRecords||a.isAutoSchedule||t.isNullOrUndefined(v.ganttProperties.autoEndDate)||(k=v.ganttProperties.autoEndDate),t.isNullOrUndefined(c)&&(c=this.getDateFromFormat(w)),t.isNullOrUndefined(u)&&(u=this.getDateFromFormat(k)),t.isNullOrUndefined(k)||1!==this.compareDates(k,u)||(u=this.getDateFromFormat(k)),t.isNullOrUndefined(w)||-1!==this.compareDates(w,c)||(c=this.getDateFromFormat(w)),!v.ganttProperties.isMilestone&&f(v.ganttProperties)?(h=this.getParentProgress(v),m+=t.getValue("totalProgress",h),p+=t.getValue("totalDuration",h)):g++,y+=v.ganttProperties.work}if(!n){0!==this.compareDates(s,c)&&this.parent.setRecordValue(a.isAutoSchedule?"startDate":"autoStartDate",c,r.ganttProperties,!0),0!==this.compareDates(o,u)&&this.parent.setRecordValue(a.isAutoSchedule?"endDate":"autoEndDate",u,r.ganttProperties,!0);var T=void 0,S=(T=this.parent.isOnDelete&&v.isDelete?d-g-1:d-g)>0&&p>0?m/p:0,b=r.ganttProperties,P=!(0!==T||!c||!u||c.getTime()!==u.getTime());this.parent.setRecordValue("isMilestone",P,b,!0),b.isAutoSchedule&&this.calculateDuration(r),this.updateWorkWithDuration(r);var C=b.work;C=this.parent.isOnEdit?C:C+y,this.parent.setRecordValue("work",C,b,!0),this.parent.setRecordValue("taskType","FixedDuration",b,!0),t.isNullOrUndefined(this.parent.taskFields.type)||this.updateMappingData(r,"type"),this.parent.setRecordValue("progress",Math.floor(S),b,!0),this.parent.setRecordValue("totalProgress",m,b,!0),this.parent.setRecordValue("totalDuration",p,b,!0),b.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(b),b,!0),this.updateAutoWidthLeft(r)),this.resetDependency(r),this.updateWidthLeft(r),this.updateTaskData(r)}}n&&1===r.childRecords.length&&0===r.ganttProperties.duration&&(this.parent.setRecordValue("isMilestone",!0,r.ganttProperties,!0),this.updateWidthLeft(r),this.updateTaskData(r));var M=this.parent.getParentTask(r.parentItem);M&&this.updateParentItems(M),n=!1},i}(M),x="e-timeline-single-header-outer-div",I="e-left-label-container",E="e-right-label-container",F="e-taskbar-main-container",U="e-task-label",V="e-gantt-child-taskbar-inner-div",L="e-gantt-child-progressbar-inner-div",N="e-gantt-child-critical-taskbar-inner-div",B="e-gantt-child-critical-progressbar-inner-div",A="e-milestone-bottom",H="e-critical-milestone-top",W="e-critical-milestone-bottom",j="e-baseline-bar",G="e-baseline-gantt-milestone",q="e-baseline-milestone-top",z="e-baseline-milestone-bottom",_="e-chart-row-cell",X="e-chart-row",Y="e-taskbar-left-resizer",Z="e-taskbar-right-resizer",Q="e-child-progress-resizer",K="e-progressbar-handler",J="e-progressbar-handler-element",$="e-progressbar-handler-after",ee="e-gantt-child-taskbar",te="e-gantt-child-progressbar",ie="e-manualparent-main-container",re="e-gantt-manualparenttaskbar",ne="e-gantt-manualparent-milestone",ae="e-manualparent-milestone-top",se="e-manualparent-milestone-bottom",oe="e-gantt-child-manualtaskbar",le="e-gantt-manualparenttaskbar-right",de="e-gantt-parent-taskbar",pe="e-gantt-parent-progressbar",he="e-gantt-unscheduled-task",ce="e-left-resize-gripper",ue="e-right-resize-gripper",ge="e-progress-resize-gripper",fe="e-label",me="e-gantt-unscheduled-taskbar-left",ye="e-gantt-unscheduled-taskbar-right",ve="e-gantt-dependency-view-container",De="e-connector-line-container",we="e-line",ke="e-criticalconnector-line",Te="e-criticalconnector-line-right-arrow",Se="e-criticalconnector-line-left-arrow",be="e-connector-line-right-arrow",Pe="e-connector-line-left-arrow",Ce="e-connector-line-z-index",Me="e-connector-line-hover",Re="e-critical-connector-line-hover",Oe="e-connector-line-hover-z-index",xe="e-connector-line-right-arrow-hover",Ie="e-connector-line-left-arrow-hover",Ee="e-critical-connector-line-right-arrow-hover",Fe="e-critical-connector-line-left-arrow-hover",Ue="e-connectorpoint-left",Ve="e-connectorpoint-right",Le="e-connectorpoint-left-hover",Ne="e-connectorpoint-right-hover",Be="e-right-connectorpoint-outer-div",Ae="e-connectorpoint-allow-block",He=".e-content",We="e-active-parent-task",je="e-active-child-task",Ge="e-active-connected-task",qe="e-predecessor-touch-mode",ze="e-rangecontainer",_e=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),t.EventHandler.add(this.element,"scroll",this.onScroll,this)},e.prototype.removeEventListeners=function(){t.EventHandler.remove(this.element,"scroll",this.onScroll),this.parent.off("grid-scroll",this.gridScrollHandler)},e.prototype.gridScrollHandler=function(e){this.element.scrollTop=t.getValue("top",e),this.isFromTreeGrid=!0},e.prototype.updateTopPosition=function(){var e,i=this.parent.treeGrid.element.querySelector(".e-content").scrollTop;if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){e=i-this.parent.virtualScrollModule.getTopPosition()}else e=i;if(!t.isNullOrUndefined(this.parent.dayMarkersModule)){var r=t.getValue("nonworkingDayRender.holidayContainer",this.parent.dayMarkersModule),n=t.getValue("nonworkingDayRender.weekendContainer",this.parent.dayMarkersModule),a=t.getValue("eventMarkerRender.eventMarkersContainer",this.parent.dayMarkersModule);r&&(r.style.top=t.formatUnit(e)),n&&(n.style.top=t.formatUnit(e)),a&&(a.style.top=t.formatUnit(e))}this.parent.chartVerticalLineContainer&&(this.parent.chartVerticalLineContainer.style.top=t.formatUnit(e))},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"),e.requestType="scroll",this.parent.trigger("actionComplete",e)},e.prototype.setHeight=function(e){this.element.style.height=t.formatUnit(e)},e.prototype.setWidth=function(e){this.element.style.width=t.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){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}(),Xe=function(){function e(e){this.parent=e}return e.prototype.renderWrapper=function(){this.wrapper=t.createElement("div",{className:"e-virtualtable",styles:"position: absolute; transform: translate(0px, 0px);"}),this.parent.ganttChartModule.scrollElement.appendChild(this.wrapper),this.virtualTrack=t.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}(),Ye=function(){function e(e){this.isExpandCollapseFromChart=!1,this.isExpandAll=!1,this.isGanttElement=!1,this.parent=e,this.chartTimelineContainer=null,this.rangeViewContainer=t.createElement("div",{className:ze}),this.rangeViewContainer.setAttribute("role","RangeContainer"),this.virtualRender=new Xe(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=t.createElement("div",{id:this.parent.element.id+"GanttChart",className:"e-gantt-chart"}),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("."+ze);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{if(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),this.parent.enableCriticalPath){var e=this.parent.criticalPathModule;this.parent.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,this.parent.enableCriticalPath,e.predecessorCollectionTaskIds)}"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.renderOverAllocationContainer()}this.updateWidthAndHeight(),this.parent.notify("selectRowByIndex",{})},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++)(r=(i=e[t]).ganttProperties.workTimelineRanges)&&this.renderRange(r,i)},e.prototype.getTopValue=function(e){var t=this.parent.getExpandedRecords(this.parent.currentViewData).indexOf(e);return e.expanded?(t+1)*this.parent.rowHeight:t*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,i){var r=this.getTopValue(i),n=this.rangeViewContainer.querySelector(".rangeContainer"+i.ganttProperties.rowUniqueID);n&&n.remove();var a=t.createElement("div",{className:"rangeContainer"+i.ganttProperties.rowUniqueID,styles:"top:"+r+"px; position: absolute;"});if(0!==i.level||i.expanded||!t.isNullOrUndefined(i.parentItem)||this.parent.enableMultiTaskbar){for(var s=0;s<e.length;s++){var o=this.getRangeHeight(i),l=t.createElement("div",{className:"e-rg-rangdiv e-leftarc",styles:"left:"+e[s].left+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px;\n height: "+(o+1)+"px; border-right: 0px"}),d=t.createElement("div",{className:"e-rg-rangdiv e-rightarc",styles:"left:"+(e[s].left+e[s].width-5)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px; height: "+(o+1)+"px;\n border-left: 0px"});a.appendChild(l),a.appendChild(d),this.rangeViewContainer.appendChild(a)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.rangeViewContainer)}},e.prototype.renderTimelineContainer=function(){this.chartTimelineContainer=t.createElement("div",{className:"e-timeline-header-container"}),this.chartTimelineContainer.setAttribute("role","TimelineHeader"),this.chartElement.appendChild(this.chartTimelineContainer)},e.prototype.renderBodyContainers=function(){this.chartBodyContainer=t.createElement("div",{className:"e-chart-root-container"}),this.chartElement.appendChild(this.chartBodyContainer),this.scrollElement=t.createElement("div",{className:"e-chart-scroll-container e-content",styles:"position:relative;"}),this.chartBodyContainer.appendChild(this.scrollElement),this.chartBodyContent=t.createElement("div",{className:"e-chart-rows-container",styles:"position:relative; overflow:hidden "}),this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.ganttChartModule.virtualRender.renderWrapper():this.scrollElement.appendChild(this.chartBodyContent),this.scrollObject=new _e(this.parent);var e=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.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,i=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];if(e>=i.offsetHeight||"auto"===this.parent.height)this.chartBodyContent.style.height=t.formatUnit(e);else{var r=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;i.offsetHeight>=r?this.chartBodyContent.style.height=i.offsetHeight-17+"px":this.chartBodyContent.style.height=i.offsetHeight+"px"}this.chartBodyContent.style.width=t.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){t.getValue("virtualTrack",this.parent.ganttChartModule.virtualRender).style.height=this.parent.updatedRecords.length*this.parent.rowHeight+"px"}},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),i=e[e.length-1],r=this.parent.currentViewData.indexOf(i),n=this.parent.getRowByIndex(r),a=this.parent.chartRowsModule.ganttChartTableBody;if(a.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow")&&t.removeClass(a.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow"),"e-lastrow"),this.chartBodyContent.clientHeight<this.chartBodyContainer.clientHeight&&n){t.addClass(n.querySelectorAll("td"),"e-lastrow");var s=0===this.parent.contentHeight?this.parent.flatData.length>1?36:0:this.parent.contentHeight,o=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];if(s>=o.offsetHeight)this.chartBodyContent.style.height=t.formatUnit(s);else{var l=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;o.offsetHeight>=l?this.chartBodyContent.style.height=o.offsetHeight-17+"px":this.chartBodyContent.style.height=o.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)},e.prototype.ganttChartMouseClick=function(e){this.parent.editSettings.allowTaskbarEditing&&(this.parent.autoFocusTasks&&this.scrollToTarget(e),this.parent.notify("chartMouseClick",e))},e.prototype.ganttChartMouseUp=function(e){this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseUp",e)},e.prototype.scrollToTarget=function(e){var i=t.closest(e.target,"tr");if(i&&this.parent.element.contains(i)&&(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 r=t.getValue("rowIndex",t.closest(e.target,"tr")),n=this.parent.currentViewData[r].ganttProperties.startDate;if(!t.isNullOrUndefined(n)){var a=this.parent.dataOperation.getTaskLeft(n,!1);this.parent.autoFocusTasks&&this.updateScrollLeft(a)}}},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)},e.prototype.mouseUp=function(e){if(this.parent.allowRowDragAndDrop){var t=this.parent.element.querySelector(".e-ganttdrag");t&&t.remove()}this.isGanttElement||this.parent.notify("chartMouseUp",e),this.isGanttElement=!1},e.prototype.documentMouseUp=function(e){if(this.isGanttElement=!0,this.parent.allowRowDragAndDrop){var i=this.parent.element.querySelector(".e-ganttdrag");i&&i.remove()}if(!this.parent.isDestroyed&&3!==e.which){var r=!1;if(this.parent.editSettings.allowTaskbarEditing&&t.getValue("editModule.taskbarEditModule.isMouseDragged",this.parent)&&t.getValue("editModule.taskbarEditModule.taskBarEditAction",this.parent)&&(r=!0),this.parent.notify("chartMouseUp",e),this.parent.showActiveElement&&this.focusedElement&&!e.target.classList.contains("e-split-bar")&&(this.focusedElement.tabIndex=0===this.focusedElement.tabIndex?-1:this.focusedElement.tabIndex,t.removeClass([this.focusedElement],"e-active-container")),!r){var n=e.target,a=e.target.classList.contains(F)||t.closest(e.target,"."+F);t.closest(n,".e-gantt-parent-taskbar")&&!this.parent.editSettings.allowEditing?this.chartExpandCollapseRequest(e):!a&&this.parent.autoFocusTasks&&this.scrollToTarget(e)}if(this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.removeFalseLine(!0),!t.isNullOrUndefined(this.parent.onTaskbarClick)&&!r){n=e.target;var s=t.closest(n,".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");s&&this.onTaskbarClick(e,n,s)}}},e.prototype.onTaskbarClick=function(e,i,r){var n=t.closest(i,"tr"),a=t.getValue("rowIndex",n),s={data:this.getRecordByTarget(e),taskbarElement:r,rowIndex:a,target:i};this.parent.trigger("onTaskbarClick",s)},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),!t.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(!t.isNullOrUndefined(this.parent.onMouseMove)&&(this.parent.flatData.length||e.target.classList.contains("e-header-cell-label")||e.target.classList.contains("e-headercell"))){var i=e.target,r={originalEvent:e},n=t.closest(i,".e-chart-row-cell,.e-connector-line-container,.e-event-markers,.e-header-cell-label,.e-rowcell,.e-headercell,.e-indicator-span");if(n){var a=void 0,s=t.closest(i,".e-rowcell,.e-chart-row-cell"),o=t.closest(i,".e-rowcell,.e-headercell");if(s&&(a=this.parent.ganttChartModule.getRecordByTarget(e),r.data=a),o){var l=t.getValue("cellIndex",o);r.column=this.parent.treeGrid.columns[l]}if(t.closest(i,".e-indicator-span")){var d=0,p=a.ganttProperties.indicators;if(p.length>1)for(d=0;d<p.length&&p[d].name!==n.innerText.trim();d++);r.indicator=p[d]}if(t.closest(i,".e-connector-line-container")){(h={}).target=n,r.predecessor=this.parent.tooltipModule.getPredecessorTooltipData(h)}if(t.closest(i,".e-event-markers")){var h;(h={}).target=n,r.eventMarkers=this.parent.tooltipModule.getMarkerTooltipData(h)}i.classList.contains("e-header-cell-label")&&(r.date=new Date(i.dataset.content))}this.parent.trigger("onMouseMove",r)}},e.prototype.doubleClickHandler=function(e){this.parent.notify("chartDblClick",e);var i=e.target,r=t.closest(i,"tr"),n=t.getValue("rowIndex",r),a={row:r,rowData:this.parent.ganttChartModule.getRecordByTarget(e),rowIndex:n,target:i};this.recordDoubleClick(a)},e.prototype.recordDoubleClick=function(e){this.parent.trigger("recordDoubleClick",e)},e.prototype.getRecordByTarget=function(e){var i,r=t.closest(e.target,"div."+F);if(t.isNullOrUndefined(r)){if(r=t.closest(e.target,"tr")){var n=t.getValue("rowIndex",t.closest(e.target,"tr"));i=this.parent.currentViewData[n]}}else{var a=r.getAttribute("rowUniqueId");i=this.parent.getRecordByID(a)}return i},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 i=e.target,r=t.closest(i,".e-gantt-parent-taskbar"),n=this.getRecordByTarget(e),a=t.closest(i,"tr"),s=t.getValue("rowIndex",a),o={data:n,gridRow:this.parent.treeGrid.getRows()[s],chartRow:a,cancel:!1};this.isExpandCollapseFromChart=!0,r.classList.contains("e-row-expand")?this.collapseGanttRow(o):r.classList.contains("e-row-collapse")&&this.expandGanttRow(o)}},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)},e.prototype.collapseGanttRow=function(e,i){var r=this;i?this.collapsedGanttRow(e):this.parent.trigger("collapsing",e,function(e){r.isExpandCollapseFromChart&&!t.getValue("cancel",e)&&r.collapsedGanttRow(e),r.isExpandCollapseFromChart=!1})},e.prototype.collapsedGanttRow=function(e){var i=t.getValue("data",e);this.isExpandCollapseFromChart?(this.expandCollapseChartRows("collapse",t.getValue("chartRow",e),i,null),this.parent.treeGrid.collapseRow(t.getValue("gridRow",e),i),this.isExpandCollapseFromChart=!1):this.expandCollapseChartRows("collapse",t.getValue("chartRow",e),i,null),"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(i),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),t.getValue("chartRow",e).setAttribute("aria-expanded","false"),this.parent.trigger("collapsed",e)},e.prototype.expandGanttRow=function(e,i){var r=this;i?this.expandedGanttRow(e):this.parent.trigger("expanding",e,function(e){r.isExpandCollapseFromChart&&!t.getValue("cancel",e)&&r.expandedGanttRow(e),r.isExpandCollapseFromChart=!1})},e.prototype.expandedGanttRow=function(e){if(!t.isNullOrUndefined(e.gridRow)||!this.parent.enableVirtualization){var i=t.getValue("data",e);this.isExpandCollapseFromChart?(this.expandCollapseChartRows("expand",t.getValue("chartRow",e),i,null),this.parent.treeGrid.expandRow(t.getValue("gridRow",e),i),this.isExpandCollapseFromChart=!1):(this.parent.isExpandCollapseLevelMethod||this.expandCollapseChartRows("expand",t.getValue("chartRow",e),i,null),this.parent.isExpandCollapseLevelMethod=!1),"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(i),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),t.getValue("chartRow",e).setAttribute("aria-expanded","true"),this.parent.trigger("expanded",e)}},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,i,r,n){var a;if("expand"===e){a="table-row",n||(r.expanded=!0);for(var s=i.querySelectorAll(".e-row-collapse"),o=0;o<s.length;o++)t.addClass([s[o]],"e-row-expand"),t.removeClass([s[o]],"e-row-collapse")}else if("collapse"===e){a="none",n||(r.expanded=!1);for(s=i.querySelectorAll(".e-row-expand"),o=0;o<s.length;o++)t.addClass([s[o]],"e-row-collapse"),t.removeClass([s[o]],"e-row-expand")}for(var l=r.childRecords,d=this.getChartRows(),p=[],h=0;h<d.length;h++)d[h].classList.contains("gridrowtaskId"+r.ganttProperties.rowUniqueID+"level"+(r.level+1))&&p.push(d[h]);for(h=0;h<p.length;h++)p[h].style.display=a,l[h].childRecords&&l[h].childRecords.length&&("collapse"===e||l[h].expanded||this.isExpandAll)&&this.expandCollapseChartRows(e,p[h],l[h],!0)},e.prototype.expandCollapseAll=function(e){"expand"===e?(this.isExpandAll=!0,this.parent.treeGrid.expandAll()):this.parent.treeGrid.collapseAll(),this.isExpandAll=!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=t.Browser.isPointer,i=t.Browser.touchStartEvent,n=t.Browser.touchEndEvent,a=t.Browser.touchMoveEvent,s=e?"pointerleave":"mouseleave";t.EventHandler.add(this.parent.chartPane,i,this.ganttChartMouseDown,this),t.EventHandler.add(this.parent.chartPane,s,this.ganttChartLeave,this),t.EventHandler.add(this.parent.chartPane,a,this.ganttChartMove,this),this.parent.isAdaptive&&(t.EventHandler.add(this.parent.chartPane,r.click,this.ganttChartMouseClick,this),t.EventHandler.add(this.parent.chartPane,n,this.ganttChartMouseUp,this)),this.parent.isAdaptive||(t.EventHandler.add(this.parent.element,n,this.documentMouseUp,this),t.EventHandler.add(document,n,this.mouseUp,this)),t.EventHandler.add(this.parent.element,"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(document.body,"contextmenu",this.contextClick,this),t.EventHandler.add(document,"mouseup",this.contextClick,this),t.EventHandler.add(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler,this)},e.prototype.unWireEvents=function(){var e=t.Browser.isPointer,i=t.Browser.touchStartEvent,n=t.Browser.touchEndEvent,a=t.Browser.touchMoveEvent,s=e?"pointerleave":"mouseleave";t.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,i,this.ganttChartMouseDown),t.EventHandler.remove(this.parent.chartPane,s,this.ganttChartLeave),t.EventHandler.remove(this.parent.chartPane,a,this.ganttChartMove),this.parent.isAdaptive&&(t.EventHandler.remove(this.parent.chartPane,r.click,this.ganttChartMouseClick),t.EventHandler.remove(this.parent.chartPane,n,this.ganttChartMouseUp)),this.parent.isAdaptive||(t.EventHandler.remove(this.parent.element,n,this.documentMouseUp),t.EventHandler.remove(document,n,this.mouseUp)),t.EventHandler.remove(this.parent.element,"mousemove",this.mouseMoveHandler),t.EventHandler.remove(document.body,"contextmenu",this.contextClick),t.EventHandler.remove(document,"mouseup",this.contextClick),t.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler)},e.prototype.getRecordByTaskBar=function(e){return this.parent.currentViewData[this.getIndexByTaskBar(e)]},e.prototype.onTabAction=function(e){this.parent.treeGrid.grid.enableHeaderFocus=this.parent.enableHeaderFocus;var i=this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit;if(this.parent.showActiveElement||i){var r=i?e.target.closest(".e-rowcell"):e.target;(r.closest(".e-rowcell")||r.closest(".e-chart-row"))&&this.parent.focusModule.setActiveElement(r),this.focusedRowIndex=r.closest(".e-rowcell")?r.parentElement.rowIndex:r.closest(".e-chart-row")?r.closest(".e-chart-row").rowIndex:-1;var n="tab"===e.action,a=this.getNextElement(r,n,i);if(this.tempNextElement=a,t.isNullOrUndefined(a.cellIndex)||(this.parent.allowRowDragAndDrop?(this.childrenIndex=a.cellIndex,this.nextElementIndex=a.cellIndex-1):(this.childrenIndex=a.cellIndex,this.nextElementIndex=a.cellIndex),this.parent.ganttColumns[this.nextElementIndex].allowEditing||this.parent.ganttColumns[this.nextElementIndex].field===this.parent.taskFields.id?this.isEditableElement=!1:this.isEditableElement=!0),"noNextRow"!==a){if("string"!=typeof a){if((r.classList.contains("e-rowcell")||r.closest(".e-chart-row-cell")||r.classList.contains("e-headercell")||r.closest(".e-segmented-taskbar"))&&e.preventDefault(),n&&r.classList.contains("e-rowdragdrop"))return void this.parent.treeGrid.grid.notify("key-pressed",e);if(r.classList.contains("e-rowcell")&&a&&a.classList.contains("e-rowcell")||r.classList.contains("e-headercell"))if(n)if(this.parent.editSettings.allowNextRowEdit){var s=this.parent.currentViewData[this.focusedRowIndex],o=this.parent.ganttColumns[a.getAttribute("aria-colindex")].field;s.hasChildRecords?o===this.parent.taskFields.endDate||o===this.parent.taskFields.duration||o===this.parent.taskFields.dependency||o===this.parent.taskFields.progress||o===this.parent.taskFields.work||"taskType"===o?(this.parent.treeGrid.grid.endEdit(),this.parent.treeGrid.grid.notify("key-pressed",e)):o===this.parent.taskFields.name||o===this.parent.taskFields.startDate?this.parent.treeGrid.grid.notify("key-pressed",e):(this.parent.treeGrid.grid.notify("key-pressed",e),this.parent.treeGrid.editCell(this.focusedRowIndex,o)):this.parent.treeGrid.grid.notify("key-pressed",e)}else this.parent.treeGrid.grid.notify("key-pressed",e);else this.parent.treeGrid.grid.notify("key-pressed",e);if((!this.parent.editModule||!this.parent.editModule.cellEditModule||t.isNullOrUndefined(this.parent.editModule.cellEditModule.editedColumn))&&a){if(r.classList.contains("e-rowcell")?this.manageFocus(r,"remove",!1):this.manageFocus(r,"remove",!0),a.classList.contains("e-rowcell")&&r.nextElementSibling||r.classList.contains("e-right-label-container")){if(!r.classList.contains("e-rowcell")){this.parent.treeGrid.grid.notify("key-pressed",e);var l=t.getValue("focusModule",this.parent.treeGrid.grid);l.currentInfo.element=a,l.currentInfo.elementToFocus=a,l.content.matrix.current=[a.parentElement.rowIndex,a.cellIndex]}this.manageFocus(a,"add",!1)}else this.manageFocus(a,"add",!0);this.parent.focusModule.setActiveElement(a)}}}else this.manageFocus(r,"remove",!0)}},e.prototype.getNextElement=function(e,i,r){for(var n=i?e.nextElementSibling:e.previousElementSibling;n&&n.parentElement.classList.contains("e-row");){if(!n.matches(".e-hide")&&!n.matches(".e-rowdragdrop"))return n;n=i?n.nextElementSibling:n.previousElementSibling}if(!t.isNullOrUndefined(n)&&(n.classList.contains("e-taskbar-main-container")||n.classList.contains("e-right-connectorpoint-outer-div"))){var a=this.parent.currentViewData[this.focusedRowIndex];!t.isNullOrUndefined(a.ganttProperties.segments)&&a.ganttProperties.segments.length>0&&(n=n.classList.contains("e-right-connectorpoint-outer-div")?n.parentElement.nextElementSibling:n.getElementsByClassName("e-gantt-child-taskbar-inner-div")[0])}if(this.validateNextElement(n))return n;var s=-1,o=null;if(e.classList.contains("e-rowcell")&&r&&this.parent.editSettings.allowNextRowEdit)return s=e.parentElement.rowIndex,o=this.getNextRowElement(s,i,!0),this.getChildElement(o,i);if(e.classList.contains("e-rowcell"))if(s=e.parentElement.rowIndex,i){if(o=this.parent.getRowByIndex(s),this.validateNextElement(o,"e-left-label-container"))return o.getElementsByClassName("e-left-label-container")[0];if(this.validateNextElement(o,"e-taskbar-main-container"))return o.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(o,"e-right-label-container"))return o.getElementsByClassName("e-right-label-container")[0]}else{if(o=this.getNextRowElement(s,i,!1),this.validateNextElement(o,"e-right-label-container"))return o.getElementsByClassName("e-right-label-container")[0];if(this.validateNextElement(o,"e-taskbar-main-container"))return o.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(o,"e-left-label-container"))return o.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")){s=t.closest(e,".e-chart-row").rowIndex,o=i?this.getNextRowElement(s,i,!0):this.parent.treeGrid.grid.getRowByIndex(s);return this.getChildElement(o,i)}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,i){if(e&&e.classList.contains("e-rowcell"))return!0;if(e&&i){var r=e.getElementsByClassName(i)[0];return!(!r||!r.hasChildNodes())}return!!e&&!(t.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,i,r){if(r){var n=null;if(e.classList.contains("e-left-label-container")||e.classList.contains("e-right-label-container"))n=e.getElementsByTagName("span")[0];else if(e.classList.contains("e-taskbar-main-container")||e.classList.contains("e-gantt-child-taskbar-inner-div")){var a=t.closest(e,".e-chart-row").rowIndex,s=this.parent.currentViewData[a],o=s.hasChildRecords?s.ganttProperties.isAutoSchedule?"e-gantt-parent-taskbar":"e-manualparent-main-container":s.ganttProperties.isMilestone?"e-gantt-milestone":!t.isNullOrUndefined(s.ganttProperties.segments)&&s.ganttProperties.segments.length>0?"e-segmented-taskbar":"e-gantt-child-taskbar";n=e.getElementsByClassName(o)[0],t.isNullOrUndefined(n)&&(n=e)}"add"!==i||t.isNullOrUndefined(n)?t.isNullOrUndefined(n)||(t.removeClass([n],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur()):(e.setAttribute("tabIndex","0"),t.addClass([n],"e-active-container"),e.focus(),this.focusedElement=n)}else"add"===i?(e.setAttribute("tabIndex","0"),t.addClass([e],["e-focused","e-focus"]),e.focus()):(e.setAttribute("tabIndex","-1"),t.removeClass([e],["e-focused","e-focus"]),e.blur())},e.prototype.getIndexByTaskBar=function(e){var i,r;if(i=e.classList.contains(F)?e:t.closest(e,"div."+F),t.isNullOrUndefined(i))i=t.closest(e,"tr."+X),r=[].slice.call(this.parent.chartRowsModule.ganttChartTableBody.childNodes).indexOf(i);else{var n=i.getAttribute("rowUniqueId"),a=this.parent.getRecordByID(n);r=this.parent.currentViewData.indexOf(a)}return r},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.scrollObject.destroy(),this.scrollObject=null},e}(),Ze=function(){return(Ze=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}).apply(this,arguments)},Qe=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&&!!t.isNullOrUndefined(this.parent.projectStartDate),this.parent.enablePersistence&&(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.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,t.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 i=this.checkCurrentZoomingLevel();this.isZoomIn=e,this.isZooming=!0;var r=e?i+1:i-1;this.parent.toolbarModule&&(e?r===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):r===this.parent.zoomingLevels[0].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!0)),r=this.parent.zoomingLevels.findIndex(function(e){return e.level===r});var n=this.parent.zoomingLevels[r],a={requestType:e?"beforeZoomIn":"beforeZoomOut",timeline:n,cancel:!1};this.parent.trigger("actionBegin",a),a.cancel||(n=a.timeline,this.changeTimelineSettings(n))},e.prototype.changeTimelineSettings=function(e){var i=this,r=this.isSingleTier?"None"===this.customTimelineSettings.topTier.unit?"topTier":"bottomTier":null;Object.keys(this.customTimelineSettings).forEach(function(n){if(n!==r)i.customTimelineSettings[n]="object"!=typeof e[n]||t.isNullOrUndefined(e[n])?e[n]:Ze({},e[n]);else{var a="topTier"===n?"bottomTier":"topTier";i.customTimelineSettings[a]=Ze({},e.bottomTier)}}),this.parent.isTimelineRoundOff=!this.isZoomToFit&&!!t.isNullOrUndefined(this.parent.projectStartDate),this.processTimelineUnit(),this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff);var n=this.parent.criticalPathModule;if(this.parent.enableCriticalPath&&n&&n.criticalConnectorLine(n.criticalPathCollection,n.detailPredecessorCollection,!0,n.predecessorCollectionTaskIds),this.isZooming||this.isZoomToFit){var a={requestType:this.isZoomIn?"AfterZoomIn":this.isZoomToFit?"AfterZoomToProject":"AfterZoomOut",timeline:this.parent.currentZoomingLevel};this.parent.trigger("actionComplete",a)}},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.dataOperation.calculateProjectDates(),this.parent.zoomingProjectStartDate>this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=new Date(this.parent.allowUnscheduledTasks?this.parent.zoomingProjectStartDate:this.parent.cloneProjectStartDate));var e,i,r,n=(this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime())/864e5,a=this.parent.ganttChartModule.chartElement.offsetWidth,s=a/n,o=this.parent.zoomingLevels.slice().sort(function(e,t){return e.perDayWidth<t.perDayWidth?1:-1});if(0!==s){for(var l=0;l<o.length;l++){if(i=o[l],l===o.length-1){e=o[l];break}if(r=o[l+1],s>=i.perDayWidth){e=o[l];break}if(s<i.perDayWidth&&s>r.perDayWidth){e=o[l+1];break}}var d=t.extend({},{},e,!0);this.roundOffDateToZoom(this.parent.cloneProjectStartDate,!0,s,d.bottomTier.unit,e),this.roundOffDateToZoom(this.parent.cloneProjectEndDate,!1,s,d.bottomTier.unit,e);var p=this.calculateNumberOfTimelineCells(d),h=this.parent.ganttChartModule.scrollElement.offsetHeight-17,c=this.parent.ganttChartModule.chartBodyContent.offsetHeight<=h?0:17;d.timelineUnitSize=Math.abs(a-c)/p;var u={requestType:"beforeZoomToProject",timeline:d};this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin",this.parent.controlId+"_zoomout"],!0),this.parent.trigger("actionBegin",u),this.changeTimelineSettings(d)}},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=["Year","Month","Week","Day","Hour","Minutes"];this.customTimelineSettings=this.customTimelineSettings?this.customTimelineSettings:this.extendFunction(this.parent.timelineSettings,["timelineViewMode","timelineUnitSize","weekStartDay","weekendBackground"],{topTier:["unit","format","count","formatter"],bottomTier:["unit","format","count","formatter"]}),-1===e.indexOf(this.customTimelineSettings.topTier.unit)&&-1===e.indexOf(this.customTimelineSettings.bottomTier.unit)?(this.customTimelineSettings.topTier.unit=-1!==e.indexOf(this.customTimelineSettings.timelineViewMode)?this.customTimelineSettings.timelineViewMode:"Week",this.customTimelineSettings.bottomTier.unit=5!==e.indexOf(this.customTimelineSettings.topTier.unit)?e[e.indexOf(this.customTimelineSettings.topTier.unit)+1]:"None"):-1!==e.indexOf(this.customTimelineSettings.topTier.unit)&&-1!==e.indexOf(this.customTimelineSettings.bottomTier.unit)&&e.indexOf(this.customTimelineSettings.topTier.unit)>e.indexOf(this.customTimelineSettings.bottomTier.unit)?this.customTimelineSettings.bottomTier.unit=this.customTimelineSettings.topTier.unit:(this.customTimelineSettings.topTier.unit=-1===e.indexOf(this.customTimelineSettings.topTier.unit)?"None":this.customTimelineSettings.topTier.unit,this.customTimelineSettings.bottomTier.unit=-1===e.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.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=this.getCurrentZoomingLevel(t,e);return this.parent.toolbarModule&&(i===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):i===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),this.parent.currentZoomingLevel=this.parent.zoomingLevels[i],i},e.prototype.getCurrentZoomingLevel=function(e,t){var i,r,n,a,s;this.parent.zoomingLevels.length||(this.parent.zoomingLevels=this.parent.getZoomingLevels());var o=this.parent.zoomingLevels.filter(function(t){return t.bottomTier.unit===e});if(0===o.length){var l=this.getClosestUnit(e,"",!1);o=this.parent.zoomingLevels.filter(function(e){return e.bottomTier.unit===l})}for(var d=o.sort(function(e,t){return e.bottomTier.count<t.bottomTier.count?1:-1}),p=0;p<d.length;p++){if(s=d[p],p===d.length-1){i=d[p].level;break}if(a=d[p+1],t>=s.bottomTier.count){r=d[p],i=(n=d.filter(function(e){return e.bottomTier.count===r.bottomTier.count})).length>1?this.checkCollectionsWidth(n):n[0].level;break}if(t<s.bottomTier.count&&t>a.bottomTier.count){r=d[p+1],i=(n=d.filter(function(e){return e.bottomTier.count===r.bottomTier.count})).length>1?this.checkCollectionsWidth(n):n[0].level;break}}return i},e.prototype.getClosestUnit=function(e,t,i){var r=["Year","Month","Week","Day","Hour","Minutes"],n=r.indexOf(e);0===n&&(i=!0),e=this.isZoomIn||i?r[n+1]:r[n-1];return 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?(t.addClass([this.parent.ganttChartModule.chartTimelineContainer],x),this.parent.treeGrid.element&&(t.addClass(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),x),t.addClass(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),x))):(t.removeClass([this.parent.ganttChartModule.chartTimelineContainer],x),this.parent.treeGrid.element&&(t.removeClass(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),x),t.removeClass(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),x))),this.previousIsSingleTier!==this.isSingleTier){var e=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.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,i,r,n,a,s=this.isSingleTier?1:2,o="None"===this.topTier?"bottomTier":"topTier";this.updateTimelineHeaderHeight(),this.topTierCollection=[],this.bottomTierCollection=[];for(var l=0;l<s;l++)n=t.createElement("table",{className:"e-timeline-header-table-container",styles:"display: block;"}),a=t.createElement("thead",{className:"e-timeline-header-table-body",styles:"display:block; border-collapse:collapse"}),e=t.createElement("tr",{innerHTML:this.createTimelineTemplate(o)}),i=t.createElement("th"),r=t.createElement("div",{styles:"width: 20px"}),i.appendChild(r),e.appendChild(i),a.appendChild(e),n.appendChild(a),this.parent.ganttChartModule.chartTimelineContainer.appendChild(n),o="bottomTier",e=null},e.prototype.validateCount=function(e,i,r){var n,a=!t.isNullOrUndefined(i)&&parseInt(i.toString(),10)>0?parseInt(i.toString(),10):1,s=Math.abs(this.timelineRoundOffEndDate.getTime()-this.timelineStartDate.getTime());switch(e){case"Year":a=a<=(n=Math.round(s/864e5/336))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Month":a=a<=(n=Math.round(s/864e5/28))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Week":a=a<=(n=Math.round(s/864e5/7))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Day":a=a<=(n=Math.round(s/864e5))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Hour":a=a<=(n=Math.round(s/36e5))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Minutes":a=a<=(n=Math.round(s/6e4))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a))}return i!==a&&this.isZooming&&this.parent.toolbarModule&&("bottomTier"===r||this.isSingleTier)&&(this.isZoomIn?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),a},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,i,r,n,a){return(a="string"==typeof a?t.getValue(a,window):a)(e,i,r,n)},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()),p=new Date(this.timelineRoundOffEndDate.toString()),h=[];do{var c={};c.startDate=new Date(d.getTime()),"Month"===o&&"bottomTier"===e&&1!=l&&0===h.length&&(r=!0),s=this.getHeaterTemplateString(new Date(d.toString()),o,e,!1,l,c,r),h.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>=p&&(s=this.getHeaterTemplateString(h[h.length-1],o,e,!0,l,c)),a+=s;var u="topTier"===e?this.topTierCollection:this.bottomTierCollection;c.endDate=new Date(d.getTime()),u.push(c)}while(d<p);return a},e.prototype.updateTimelineAfterZooming=function(e,i){var r,n,a,s=document.getElementsByClassName("e-chart-scroll-container e-content")[0];if(!t.isNullOrUndefined(s)){var o=s.offsetWidth,l=s.offsetHeight,d=document.getElementsByClassName("e-chart-rows-container")[0].offsetHeight;if(r=Math.abs(this.timelineStartDate.getTime()-e.getTime()),r/=864e5,n="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),a=l<d?n*r+17:n*r,o>=a){var p=o-a;p=Math.round(p/n),e.setDate(e.getDate()+p),this.parent.timelineModule.timelineEndDate=e,i&&this.parent.updateProjectDates(this.timelineStartDate,this.timelineEndDate,this.parent.isTimelineRoundOff)}}},e.prototype.getTimelineRoundOffEndDate=function(e){var t="None"===this.topTier?this.bottomTier:this.topTier,i=new Date(e.toString());return this.parent.isTimelineRoundOff&&("Hour"===t?i.setMinutes(60):"Minutes"===t?i.setSeconds(60):i.setHours(24,0,0,0)),(this.isZooming||this.parent.isLoad)&&this.updateTimelineAfterZooming(i,!1),i},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,r=(a=new Date(e.getFullYear()+(t-1),11,31)).getTime()-n.getTime()+864e5;break;case"Month":n=e,r=(a=new Date(e.getFullYear(),e.getMonth()+t,1)).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,i,r,n,a,s,o){var l,d="",p="",h="topTier"===r?this.parent.timelineModule.customTimelineSettings.topTier.format:this.parent.timelineModule.customTimelineSettings.bottomTier.format,c="topTier"===r?this.parent.timelineModule.customTimelineSettings.topTier.formatter:this.parent.timelineModule.customTimelineSettings.bottomTier.formatter,u=t.isNullOrUndefined(c)?this.parent.globalize.formatDate(e,{format:this.parent.getDateFormat()}):this.customFormat(e,h,r,i,c),g=l=this.getIncrement(e,a,i)/864e5*this.parent.perDayWidth;l=n||o?n?this.calculateWidthBetweenTwoDate(i,e,this.timelineRoundOffEndDate):this.calculateWidthBetweenTwoDate(i,e,this.calculateQuarterEndDate(e,a)):l;var f=this.isWeekendHeaderCell(i,r,e),m="topTier"===r?" e-gantt-top-cell-text":"",y=t.isNullOrUndefined(c)?this.formatDateHeader(h,e):this.customFormat(e,h,r,i,c);return p+=this.parent.timelineModule.isSingleTier?'<th class="e-timeline-single-header-cell ':'<th class="e-timeline-top-header-cell',p+=f?" e-weekend-header-cell":"",p+='" tabindex="-1" aria-label= "'+this.parent.localeObj.getConstant("timelineCell")+" "+u,p+='" style="width:'+l+"px;",p+=f&&this.customTimelineSettings.weekendBackground?"background-color:"+this.customTimelineSettings.weekendBackground+";":"",p+='"><div class="e-header-cell-label'+m+'" style="width:'+(l-1)+"px;"+(this.parent.timelineSettings.showTooltip?'"title="'+u:""),p+='">'+y+"</div>",d+=p,d+="</th>",!this.isSingleTier&&"topTier"!==r||n?(this.isSingleTier||"topTier"===r)&&n&&(this.totalTimelineWidth=this.totalTimelineWidth-g+l):this.totalTimelineWidth=this.totalTimelineWidth+l,s.value=y,s.isWeekend=f,s.width=g,d},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()+6+r;t.setDate(a)}"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,i){if(e[0].length>=1)for(var r=0;r<e.length;r++){var a=e[r],s=a.filter(function(e){return!t.isNullOrUndefined(e.ganttProperties.startDate)}),o=a.filter(function(e){return!t.isNullOrUndefined(e.ganttProperties.endDate)}),l=s.length>0?new Date(n.DataUtil.aggregates.min(s,"ganttProperties.startDate")):null,d=o.length>0?new Date(n.DataUtil.aggregates.max(o,"ganttProperties.endDate")):null,p=new Date(this.parent.dataOperation.checkStartDate(this.timelineStartDate).getTime()),h=new Date(this.parent.dataOperation.checkEndDate(this.timelineEndDate).getTime()),c=t.isNullOrUndefined(l)?null:this.parent.dataOperation.getTaskLeft(l,!1),u=t.isNullOrUndefined(d)?null:this.parent.dataOperation.getTaskLeft(d,!1),g=this.parent.dataOperation.getTaskLeft(p,!1),f=this.parent.dataOperation.getTaskLeft(h,!1),m=void 0;!t.isNullOrUndefined(c)&&(c<this.bottomTierCellWidth||c<=g)?(m="prevTimeSpan",l=l>this.timelineStartDate?this.timelineStartDate:l):l=this.timelineStartDate,!t.isNullOrUndefined(u)&&(u>=this.totalTimelineWidth-this.bottomTierCellWidth||u>=f)?(m="prevTimeSpan"===m?"both":"nextTimeSpan",d=d<this.timelineEndDate?this.timelineEndDate:d):d=this.timelineEndDate,m?this.performTimeSpanAction(m,i,l,d):t.isNullOrUndefined(a[0].ganttProperties.segments)||this.parent.dataOperation.updateWidthLeft(a[0]);break}},e.prototype.performTimeSpanAction=function(e,i,r,n,a){a=t.isNullOrUndefined(a)?"None"===this.parent.timelineModule.topTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier:a;var s=new Date(this.parent.cloneProjectStartDate.getTime()),o=new Date(this.parent.cloneProjectEndDate.getTime());"publicMethod"!==i&&"both"===e?(this.updateScheduleDatesByToolBar(a,"prevTimeSpan",r,n),this.updateScheduleDatesByToolBar(a,"nextTimeSpan",new Date(this.parent.cloneProjectStartDate.getTime()),n)):this.updateScheduleDatesByToolBar(a,e,r,n);var l=this.timeSpanActionEvent("actionBegin",e,i);if(l.cancel)this.parent.cloneProjectStartDate=s,this.parent.cloneProjectEndDate=o;else{if(this.parent.updateProjectDates(l.projectStartDate,l.ProjectEndDate,l.isTimelineRoundOff,i),"prevTimeSpan"===e&&"publicMethod"===i)this.parent.ganttChartModule.updateScrollLeft(0);else if("nextTimeSpan"===e&&"publicMethod"===i)this.parent.ganttChartModule.updateScrollLeft(this.parent.timelineModule.totalTimelineWidth);else if("nextTimeSpan"===e&&"TaskbarEditing"===i){var d=document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollLeft;this.parent.element.querySelector(".e-timeline-header-container").scrollLeft=d}this.parent.timelineModule.timeSpanActionEvent("actionComplete",e,i)}},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}(),Ke=function(){return function(e){this.allowEditing=!0,this.allowReordering=!0,this.allowResizing=!0,this.allowSorting=!0,this.allowFiltering=!0,this.edit={},t.merge(this,e)}}(),Je=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)},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 a.TreeGrid,this.parent.treeGrid.allowSelection=!1,this.parent.treeGrid.allowKeyboard=this.parent.allowKeyboard,this.parent.treeGrid.enableImmutableMode=this.parent.enableImmutableMode,this.treeGridColumns=[],this.validateGanttColumns(),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=t.createElement("div",{id:"treeGrid"+this.parent.element.id,className:"e-gantt-tree-grid"});var e=t.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.wireEvents()},e.prototype.composeProperties=function(){if(this.parent.treeGrid.showColumnMenu=this.parent.showColumnMenu,this.parent.treeGrid.enableCollapseAll=this.parent.collapseAllParentTasks,this.parent.treeGrid.columnMenuItems=this.parent.columnMenuItems,this.parent.treeGrid.childMapping=t.isNullOrUndefined(this.parent.taskFields.child)?"":this.parent.taskFields.child,this.parent.treeGrid.treeColumnIndex=this.parent.treeColumnIndex,this.parent.treeGrid.columns=this.treeGridColumns,this.parent.dataSource instanceof Object&&m(this.parent)){this.parent.treeGrid.hasChildMapping="isParent";var e=t.getValue("count",this.parent.dataSource);this.parent.treeGrid.dataSource={result:this.parent.flatData,count:e}}else 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;var i=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(i=this.parent.toolbarModule.element.offsetHeight),this.parent.treeGrid.height=this.parent.ganttHeight-i-46},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?t.getValue("virtualScrollModule.visualData",this.parent.treeGrid):t.getValue("result",e),this.parent.virtualScrollModule&&this.parent.enableVirtualization&&this.parent.updateContentHeight(e),t.setValue("contentModule.objectEqualityChecker",this.objectEqualityChecker,this.parent.treeGrid.grid)},e.prototype.dataBound=function(e){this.ensureScrollBar(),this.parent.treeDataBound(e),this.prevCurrentView=t.extend([],[],this.parent.currentViewData,!0)},e.prototype.dataStateChange=function(e){e.action&&"refresh"===e.action.requestType&&(this.parent.treeGrid.dataSource={result:t.getValue("result",this.parent.treeGrid.dataSource),count:t.getValue("count",this.parent.treeGrid.dataSource)}),this.parent.trigger("dataStateChange",e)},e.prototype.collapsing=function(e){new n.Deferred;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){var i=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.collapseGanttRow(i),t.setValue("cancel",t.getValue("cancel",i),e)}},e.prototype.expanding=function(e){new n.Deferred;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){var i=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.expandGanttRow(i),t.setValue("cancel",t.getValue("cancel",i),e)}},e.prototype.collapsed=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var t=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.collapsedGanttRow(t)}},e.prototype.expanded=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod&&!e.data.length){var t=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.expandedGanttRow(t)}},e.prototype.actionBegin=function(e){this.parent.notify("actionBegin",e);null!==t.getValue("doubleClickTarget",this.parent.treeGrid.editModule)&&t.setValue("doubleClickTarget",null,this.parent.treeGrid.editModule),this.parent.trigger("actionBegin",e)},e.prototype.created=function(e){this.updateKeyConfigSettings()},e.prototype.actionFailure=function(e){this.parent.trigger("actionFailure",e)},e.prototype.createExpandCollapseArgs=function(e){var i=t.getValue("data",e);return{data:i,gridRow:t.getValue("row",e),chartRow:this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(i)],cancel:!1}},e.prototype.treeActionComplete=function(e){var i=t.extend({},e);if("sorting"===t.getValue("requestType",e))this.parent.notify("updateModel",{}),t.deleteObject(i,"isFrozen");else if("filtering"===t.getValue("requestType",e)){this.parent.notify("updateModel",{});this.parent.element.querySelector(".e-treegrid").focus()}else if("save"===t.getValue("type",e)&&this.parent.editModule&&this.parent.editModule.cellEditModule){var r=t.getValue("data",e);t.isNullOrUndefined(r)||t.isNullOrUndefined(this.parent.getTaskByUniqueID(r.uniqueID))||(this.parent.getTaskByUniqueID(r.uniqueID).taskData[this.parent.taskFields.duration]=r.taskData[this.parent.taskFields.duration],t.isNullOrUndefined(r.taskData[this.parent.taskFields.resourceInfo])||(this.parent.getTaskByUniqueID(r.uniqueID).taskData[this.parent.taskFields.resourceInfo]=r.taskData[this.parent.taskFields.resourceInfo])),this.parent.editModule.cellEditModule.initiateCellEdit(e,this.currentEditRow),this.currentEditRow={}}"filterafteropen"===t.getValue("requestType",e)&&this.parent.notify("actionComplete",e),"searching"===t.getValue("requestType",e)&&this.parent.notify("actionComplete",e),t.isNullOrUndefined(t.getValue("batchChanges",e))||t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.parent.isCancelled&&(t.setValue("requestType","cancel",i),t.setValue("action","CellEditing",i),this.parent.isCancelled=!1),"refresh"===t.getValue("requestType",e)&&t.isNullOrUndefined(t.getValue("type",e))&&this.parent.addDeleteRecord&&(-1!=this.parent.selectedRowIndex?(this.parent.selectRow(this.parent.selectedRowIndex),this.parent.selectedRowIndex>this.parent.currentViewData.length-1&&(this.parent.selectedRowIndex=-1)):this.parent.selectRow(0),this.parent.addDeleteRecord=!1),this.parent.trigger("actionComplete",i)},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&&t.EventHandler.add(e,"scroll",this.scrollHandler,this),this.parent.isAdaptive&&t.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&&t.EventHandler.remove(e,"scroll",this.scrollHandler),this.parent.isAdaptive&&t.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,i=e.columns.length,r=this.parent.taskFields;this.parent.columnMapping={},this.parent.columnByField={},this.parent.customColumns=[];for(var n=["id","name","startDate","endDate","duration","dependency","progress","baselineStartDate","baselineEndDate","resourceInfo","notes","work","manual","type"],a=function(t){var i={};"string"==typeof e.columns[t]?i.field=e.columns[t]:i=e.columns[t];var a=[];if(n.length>0&&(a=n.filter(function(e){return i.field===r[e]})),0===a.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=n.indexOf(a[0]);n.splice(o,1),s.createTreeGridColumn(i,!0),s.parent.columnMapping[a[0]]=i.field},s=this,o=0;o<i;o++)a(o);for(var l=0;l<n.length;l++){var d={};t.isNullOrUndefined(r[n[l]])||(d.field=r[n[l]],this.createTreeGridColumn(d,0===i),this.parent.columnMapping[n[l]]=d.field)}if("ProjectView"!==this.parent.viewType){d={};this.composeUniqueIDColumn(d),this.createTreeGridColumn(d,!0)}},e.prototype.createTreeGridColumn=function(e,i){var r=this.parent.taskFields;if(e.disableHtmlEncode=t.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)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)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={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.endDate===e.field)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={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.duration===e.field)e.width=e.width?e.width:150,e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("duration"),e.valueAccessor=e.valueAccessor?e.valueAccessor:t.isNullOrUndefined(e.edit)?this.durationValueAccessor.bind(this):null,e.editType=e.editType?e.editType:"stringedit",e.type="string";else if(r.progress===e.field)this.composeProgressColumn(e);else if(r.dependency===e.field)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)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 a=r.baselineEndDate===e.field?"baselineEndDate":"baselineStartDate";e.width=e.width?e.width:150,e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant(a),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?(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?(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&&(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 n.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,i)},e.prototype.composeResourceColumn=function(e){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 i=t.getValue(this.parent.taskFields.resourceInfo,e.taskData),r=[];if(t.isNullOrUndefined(i))return i;for(var n=0;n<i.length;n++)r.push("object"==typeof i[n]?i[n][this.parent.resourceFields.id]:i[n]);return r},e.prototype.composeIDColumn=function(e){var t="ProjectView"===this.parent.viewType;e.isPrimaryKey=!!t,e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("id"),e.width=e.width?e.width:100,e.allowEditing=!!e.allowEditing&&e.allowEditing,e.editType=e.editType?e.editType:"numericedit",e.valueAccessor=t?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){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 s=a[n];i[s]=r[s]=e[s]}this.parent.columnByField[r.field]=r,this.parent.ganttColumns.push(new Ke(r)),t&&this.treeGridColumns.push(i)},e.prototype.durationValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":this.parent.dataOperation.getDurationString(n.duration,n.durationUnit)},e.prototype.resourceValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":n.resourceNames},e.prototype.workValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":this.parent.dataOperation.getWorkString(n.work,n.workUnit)},e.prototype.taskTypeValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":n.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){this.treeGridElement.querySelector(".e-content").scrollTop=t.getValue("top",e),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}(),$e=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)}}(),et=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},tt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $e(i,e),et([t.Property(null)],i.prototype,"from",void 0),et([t.Property(null)],i.prototype,"to",void 0),i}(t.ChildProperty),it=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)}}(),rt=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},nt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return it(i,e),rt([t.Property(null)],i.prototype,"type",void 0),rt([t.Property(null)],i.prototype,"headerText",void 0),rt([t.Property([])],i.prototype,"fields",void 0),i}(t.ChildProperty),at=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)}}(),st=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},ot=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),st([t.Property(null)],i.prototype,"type",void 0),st([t.Property(null)],i.prototype,"headerText",void 0),st([t.Property([])],i.prototype,"fields",void 0),i}(t.ChildProperty),lt=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)}}(),dt=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},pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return lt(i,e),dt([t.Property(!1)],i.prototype,"allowEditing",void 0),dt([t.Property(!1)],i.prototype,"allowAdding",void 0),dt([t.Property(!1)],i.prototype,"allowDeleting",void 0),dt([t.Property("Auto")],i.prototype,"mode",void 0),dt([t.Property("Top")],i.prototype,"newRowPosition",void 0),dt([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),dt([t.Property(!1)],i.prototype,"allowTaskbarEditing",void 0),dt([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),ht=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)}}(),ct=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},ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ht(i,e),ct([t.Property(null)],i.prototype,"day",void 0),ct([t.Property(null)],i.prototype,"label",void 0),ct([t.Property(null)],i.prototype,"cssClass",void 0),i}(t.ChildProperty),gt=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)}}(),ft=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},mt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return gt(i,e),ft([t.Collection([],r.Predicate)],i.prototype,"columns",void 0),ft([t.Property("Menu")],i.prototype,"type",void 0),ft([t.Property()],i.prototype,"operators",void 0),ft([t.Property(!1)],i.prototype,"ignoreAccent",void 0),ft([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),yt=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)}}(),vt=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},Dt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return yt(i,e),vt([t.Property([])],i.prototype,"fields",void 0),vt([t.Property(!1)],i.prototype,"ignoreCase",void 0),vt([t.Property("contains")],i.prototype,"operator",void 0),vt([t.Property("")],i.prototype,"key",void 0),vt([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),wt=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)}}(),kt=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},Tt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wt(i,e),kt([t.Property(null)],i.prototype,"from",void 0),kt([t.Property(null)],i.prototype,"to",void 0),kt([t.Property(null)],i.prototype,"label",void 0),kt([t.Property(null)],i.prototype,"cssClass",void 0),i}(t.ChildProperty),St=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)}}(),bt=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},Pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return St(i,e),bt([t.Property(null)],i.prototype,"rightLabel",void 0),bt([t.Property(null)],i.prototype,"leftLabel",void 0),bt([t.Property(null)],i.prototype,"taskLabel",void 0),i}(t.ChildProperty),Ct=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)}}(),Mt=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},Rt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ct(i,e),Mt([t.Property("Row")],i.prototype,"mode",void 0),Mt([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),Mt([t.Property("Single")],i.prototype,"type",void 0),Mt([t.Property(!1)],i.prototype,"persistSelection",void 0),Mt([t.Property(!1)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Ot=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)}}(),xt=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},It=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ot(i,e),xt([t.Property(null)],i.prototype,"position",void 0),xt([t.Property(-1)],i.prototype,"columnIndex",void 0),xt([t.Property(4)],i.prototype,"separatorSize",void 0),xt([t.Property(null)],i.prototype,"minimum",void 0),xt([t.Property("Default")],i.prototype,"view",void 0),i}(t.ChildProperty),Et=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)}}(),Ft=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},Ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Et(i,e),Ft([t.Property(null)],i.prototype,"id",void 0),Ft([t.Property(null)],i.prototype,"name",void 0),Ft([t.Property(null)],i.prototype,"parentID",void 0),Ft([t.Property(null)],i.prototype,"startDate",void 0),Ft([t.Property(null)],i.prototype,"endDate",void 0),Ft([t.Property(null)],i.prototype,"dependency",void 0),Ft([t.Property(null)],i.prototype,"progress",void 0),Ft([t.Property(null)],i.prototype,"child",void 0),Ft([t.Property(null)],i.prototype,"milestone",void 0),Ft([t.Property(null)],i.prototype,"duration",void 0),Ft([t.Property(null)],i.prototype,"durationUnit",void 0),Ft([t.Property(null)],i.prototype,"cssClass",void 0),Ft([t.Property(null)],i.prototype,"baselineStartDate",void 0),Ft([t.Property(null)],i.prototype,"baselineEndDate",void 0),Ft([t.Property(null)],i.prototype,"resourceInfo",void 0),Ft([t.Property(null)],i.prototype,"expandState",void 0),Ft([t.Property(null)],i.prototype,"indicators",void 0),Ft([t.Property(null)],i.prototype,"notes",void 0),Ft([t.Property(null)],i.prototype,"work",void 0),Ft([t.Property(null)],i.prototype,"manual",void 0),Ft([t.Property(null)],i.prototype,"type",void 0),Ft([t.Property(null)],i.prototype,"segments",void 0),Ft([t.Property(null)],i.prototype,"segmentId",void 0),i}(t.ChildProperty),Vt=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)}}(),Lt=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},Nt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),Lt([t.Property("")],i.prototype,"format",void 0),Lt([t.Property("None")],i.prototype,"unit",void 0),Lt([t.Property(1)],i.prototype,"count",void 0),Lt([t.Property(null)],i.prototype,"formatter",void 0),i}(t.ChildProperty),Bt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),Lt([t.Property("Week")],i.prototype,"timelineViewMode",void 0),Lt([t.Complex({},Nt)],i.prototype,"topTier",void 0),Lt([t.Complex({},Nt)],i.prototype,"bottomTier",void 0),Lt([t.Property(33)],i.prototype,"timelineUnitSize",void 0),Lt([t.Property(0)],i.prototype,"weekStartDay",void 0),Lt([t.Property(null)],i.prototype,"weekendBackground",void 0),Lt([t.Property(!0)],i.prototype,"showTooltip",void 0),Lt([t.Property(!0)],i.prototype,"updateTimescaleView",void 0),i}(t.ChildProperty),At=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)}}(),Ht=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},Wt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return At(i,e),Ht([t.Property(!0)],i.prototype,"showTooltip",void 0),Ht([t.Property()],i.prototype,"taskbar",void 0),Ht([t.Property()],i.prototype,"baseline",void 0),Ht([t.Property()],i.prototype,"connectorLine",void 0),Ht([t.Property()],i.prototype,"editing",void 0),i}(t.ChildProperty),jt=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)}}(),Gt=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},qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),Gt([t.Property()],i.prototype,"field",void 0),Gt([t.Property()],i.prototype,"direction",void 0),i}(t.ChildProperty),zt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),Gt([t.Collection([],qt)],i.prototype,"columns",void 0),Gt([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),_t=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)}}(),Xt=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},Yt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _t(i,e),Xt([t.Property(null)],i.prototype,"id",void 0),Xt([t.Property(null)],i.prototype,"name",void 0),Xt([t.Property(null)],i.prototype,"unit",void 0),Xt([t.Property(null)],i.prototype,"group",void 0),i}(t.ChildProperty),Zt=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)}}(),Qt=function(e){function i(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 Zt(i,e),i.prototype.initPublicProp=function(){this.ganttChartTableBody=null},i.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createChartTable,this),this.parent.on("dataReady",this.initiateTemplates,this),this.parent.on("destroy",this.destroy,this)},i.prototype.refreshChartByTimeline=function(){this.taskTable.style.width=t.formatUnit(this.parent.timelineModule.totalTimelineWidth);var e=t.getValue("prevProjectStartDate",this.parent.dataOperation),i=!1;e&&(i=e.getTime()===this.parent.cloneProjectStartDate.getTime()),this.isUpdated=!!(this.parent.isFromOnPropertyChange&&i&&t.getValue("mutableData",this.parent.treeGrid.grid.contentModule)),this.refreshGanttRows(),this.isUpdated=!0},i.prototype.createChartTable=function(){this.taskTable=t.createElement("table",{className:"e-task-table e-zero-spacing",id:"GanttTaskTable"+this.parent.element.id,styles:"z-index: 2;position: absolute;width:"+this.parent.timelineModule.totalTimelineWidth+"px;",attrs:{cellspacing:"0.25px"}});var e=t.createElement("colgroup"),i=t.createElement("col",{styles:"width:"+this.parent.timelineModule.totalTimelineWidth+"px;"});e.appendChild(i),this.taskTable.appendChild(e),this.ganttChartTableBody=t.createElement("tbody",{id:this.parent.element.id+"GanttTaskTableBody"}),this.taskTable.appendChild(this.ganttChartTableBody),this.parent.ganttChartModule.chartBodyContent.appendChild(this.taskTable)},i.prototype.initiateTemplates=function(){this.taskTable.style.width=t.formatUnit(this.parent.timelineModule.totalTimelineWidth),this.initChartHelperPrivateVariable(),this.initializeChartTemplate()},i.prototype.renderChartRows=function(){this.createTaskbarTemplate(),this.parent.isGanttChartRendered=!0},i.prototype.getIndicatorNode=function(e){var t='<label class="e-label e-indicator-span" role="LabelIndicator" style="line-height:'+this.parent.rowHeight+"px;left:"+this.getIndicatorleft(e.date)+'px;"><i class="'+e.iconClass+'"></i> </label>';return this.createDivElement(t)},i.prototype.getIndicatorleft=function(e){e=this.parent.dateValidationModule.getDateFromFormat(e);return this.parent.dataOperation.getTaskLeft(e,!1)},i.prototype.getChildTaskbarNode=function(e,i){var r=null,n=this.templateData;if(this.childTaskbarTemplateFunction)r=this.childTaskbarTemplateFunction(t.extend({index:e},n),this.parent,"TaskbarTemplate",this.getTemplateID("TaskbarTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var a="",s="",o=void 0,l=void 0;n.ganttProperties.startDate&&n.ganttProperties.endDate&&n.ganttProperties.duration&&(o=this.createDivElement('<div class="'+V+" "+ee+" "+(n.ganttProperties.isAutoSchedule?"":oe)+'"style="width:'+n.ganttProperties.width+"px;height:"+this.taskBarHeight+'px;"></div>'),l=this.createDivElement('<div class="'+L+" "+te+" "+(n.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualprogressbar")+'" style="border-style:'+(n.ganttProperties.progressWidth?"solid;":"none;")+"width:"+n.ganttProperties.progressWidth+"px;height:100%;border-top-right-radius:"+this.getBorderRadius(n.ganttProperties)+"px;border-bottom-right-radius:"+this.getBorderRadius(n.ganttProperties)+'px;"></div>'));var d=t.createElement("div");if(this.taskLabelTemplateFunction&&!t.isNullOrUndefined(l)&&l.length>0){var p=this.taskLabelTemplateFunction(t.extend({index:e},n),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,l[0]);p&&p.length>0&&(d.appendChild(p[0]),a=d.innerHTML)}else a="isCustomTemplate"===(a=this.getTaskLabel(this.parent.labelSettings.taskLabel))?this.parent.labelSettings.taskLabel:a;-1===a.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(a=""),s=isNaN(parseInt(a))?'<span class="'+U+'" style="line-height:'+(this.taskBarHeight-1)+"px; text-align: left;display:inline-block;width:"+(n.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;">'+a+"</span>":'<span class="'+U+'" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"text-align: left;":"")+ +("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+ +("ResourceView"===this.parent.viewType?n.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;">'+a+"</span>");var h=!t.isNullOrUndefined(n.ganttProperties.segments)&&n.ganttProperties.segments.length>0?this.splitTaskbar(n,a):n.ganttProperties.startDate&&n.ganttProperties.endDate&&n.ganttProperties.duration?s:!n.ganttProperties.startDate||n.ganttProperties.endDate||n.ganttProperties.duration?!n.ganttProperties.endDate||n.ganttProperties.startDate||n.ganttProperties.duration?!n.ganttProperties.duration||n.ganttProperties.startDate||n.ganttProperties.endDate?"":'<div class="'+L+" "+ee+" e-gantt-unscheduled-taskbar "+(n.ganttProperties.isAutoSchedule?"":oe)+'"style="left:'+n.ganttProperties.left+"px; width:"+n.ganttProperties.width+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+L+" "+ee+" "+ye+" "+(n.ganttProperties.isAutoSchedule?"":oe)+'"style="left:'+n.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+L+" "+ee+" "+me+" "+(n.ganttProperties.isAutoSchedule?"":oe)+'"style="left:'+n.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>';if(n.ganttProperties.startDate&&n.ganttProperties.endDate&&n.ganttProperties.duration&&(t.isNullOrUndefined(n.ganttProperties.segments)||!t.isNullOrUndefined(n.ganttProperties.segments)&&0===n.ganttProperties.segments.length)){if(""!==h&&!t.isNullOrUndefined(l)&&l.length>0){var c=this.createDivElement(h)[0],u=this.parent.labelSettings.taskLabel;u&&u.elementRef&&c.appendChild(d),l[0].appendChild(c),""!==l[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(u)&&l[0].querySelectorAll(".e-task-label")[0].children[0]&&l[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""==l[0].querySelectorAll(".e-task-label")[0].textContent&&u&&!u.elementRef&&""!==d.innerHTML&&(l[0].querySelectorAll(".e-task-label")[0].textContent=u)}!t.isNullOrUndefined(o)&&o.length>0&&o[0].appendChild([].slice.call(l)[0]),r=o}else r=this.createDivElement(h)}return r},i.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 s=0===r?"e-segment-first":r===e.ganttProperties.segments.length-1?"e-segment-last":"e-segment-inprogress";i+='<div class="'+V+" "+s+" "+ee+' e-segmented-taskbar"style="width:'+n.width+"px;position: absolute; 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="'+L+" "+te+' " style="border-style:'+(n.progressWidth?"solid;":"none;")+"display:"+(n.progressWidth>=0?"block;":"none;")+"width:"+n.progressWidth+"px;height:100%;border-top-right-radius:"+this.getSplitTaskBorderRadius(n)+"px;border-bottom-right-radius:"+this.getSplitTaskBorderRadius(n)+'px;"><span class="'+U+'" 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},i.prototype.getSplitTaskbarLeftResizerNode=function(){var e=-(this.parent.isAdaptive?12:2);return'<div class="'+Y+' e-icon" style="left:'+e+"px;height:"+this.taskBarHeight+'px;"></div>'},i.prototype.getSplitTaskbarRightResizerNode=function(e){var t=this.parent.isAdaptive?-2:-10;return'<div class="'+Z+' e-icon" style="left:'+(e.width+t)+"px;height:"+this.taskBarHeight+'px;"></div>'},i.prototype.getSplitProgressResizerNode=function(e){return'<div class="'+Q+'" style="left:'+(e.progressWidth-6)+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+K+'"><div class="'+J+'"></div><div class="'+$+'"></div></div>'},i.prototype.getSegmentIndex=function(e,i){var r=-1,n=i.ganttProperties,a=n.segments;if(!t.isNullOrUndefined(a)){a.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()});for(var s=a.length,o=0;o<s;o++){var l=a[o];if(e.getTime()===n.startDate.getTime())this.dropSplit=!0,r=0;else if(e.getTime()===l.startDate.getTime()){this.dropSplit=!0;var d=l.startDate;d.setDate(d.getDate()+1),d=l.startDate=this.parent.dataOperation.checkStartDate(d,n,!1),l.startDate=d;var p=l.endDate;p=this.parent.dataOperation.getEndDate(d,l.duration,n.durationUnit,n,!1),l.endDate=p,o===a.length-1&&this.parent.setRecordValue("endDate",p,n,!0),this.incrementSegments(a,o,i),r=l.segmentIndex}else l.endDate=this.parent.dataOperation.getEndDate(l.startDate,l.duration,n.durationUnit,n,!1),e.getTime()>=l.startDate.getTime()&&e.getTime()<=l.endDate.getTime()&&(r=l.segmentIndex);this.parent.setRecordValue("segments",n.segments,n,!0)}}return-1===r&&(this.dropSplit=!0),r},i.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,p=this.parent.dataOperation.getEndDate(o.startDate,d,n.ganttProperties.durationUnit,n.ganttProperties,!1),h={startDate:o.startDate,endDate:p,duration:d},c=t[s].firstSegmentIndex;a.splice(c,2,h),this.parent.setRecordValue("segments",a,n.ganttProperties,!0),this.parent.dataOperation.updateMappingData(n,"segments"),1===a.length?(this.parent.setRecordValue("endDate",p,n.ganttProperties,!0),this.parent.setRecordValue("EndDate",p,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")},i.prototype.refreshChartAfterSegment=function(e,i){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 r=this.ganttChartTableBody.querySelectorAll("tr")[this.parent.currentViewData.indexOf(e)],n={requestType:i,rowData:e};this.triggerQueryTaskbarInfoByIndex(r,e),this.parent.selectionModule.clearSelection();var a=n.rowData.taskData[this.parent.taskFields.segments];if(this.parent.timezone&&null!=a)for(var s=0;s<a.length;s++)a[s][this.parent.taskFields.startDate]=this.parent.dateValidationModule.remove(n.rowData.ganttProperties.segments[s].startDate,this.parent.timezone),this.parent.taskFields.endDate&&(a[s][this.parent.taskFields.endDate]=this.parent.dateValidationModule.remove(n.rowData.ganttProperties.segments[s].endDate,this.parent.timezone));this.parent.trigger("actionComplete",n),t.setValue("isEdit",!1,this.parent.contextMenuModule),t.setValue("isEdit",!1,this.parent)},i.prototype.splitTask=function(e,i){var r=this.parent.taskFields,n=i,a=this.parent.flatData.filter(function(t){return t[r.id]===e?t:null})[0],s=a.ganttProperties;this.dropSplit=!1;var o=-1,l=s.segments;if(t.isNullOrUndefined(i.length)||i.length<0){var d=this.parent.dataOperation.checkStartDate(n,s,!1);if(d.getTime()!==s.startDate.getTime()&&s.isAutoSchedule){if(t.isNullOrUndefined(l)||(o=this.getSegmentIndex(d,a)),!1===this.dropSplit&&n.getTime()>s.startDate.getTime()&&n.getTime()<s.endDate.getTime()){l=-1!==o?l:[];var p=-1!==o?l[o].startDate:new Date(s.startDate.getTime()),h=-1!==o?l[o].endDate:new Date(s.endDate.getTime()),c=this.parent.dataOperation.getDuration(p,h,s.durationUnit,s.isAutoSchedule,s.isMilestone);this.parent.setRecordValue("segments",this.splitSegmentedTaskbar(p,h,n,o,l,a,c),s,!0),-1!==o&&this.incrementSegments(l,o+1,a),this.parent.setRecordValue("endDate",l[l.length-1].endDate,s,!0),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(a,"endDate")}this.refreshChartAfterSegment(a,"splitTaskbar")}}else i.sort(function(e,t){return e.getTime()-t.getTime()}),this.parent.setRecordValue("segments",this.constructSegments(i,a.ganttProperties),a.ganttProperties,!0),this.refreshChartAfterSegment(a,"splitTask")},i.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())).setDate(e[o].getDate()+1);return a},i.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 p=new Date(i.getTime());p=this.parent.dataOperation.checkEndDate(p,o,!1);for(var h=0;h<2;h++){var c={startDate:e,endDate:p,duration:this.parent.dataOperation.getDuration(e,p,o.durationUnit,o.isAutoSchedule,o.isMilestone),offsetDuration:1},u=this.parent.nonWorkingDayIndex.indexOf(p.getDay());-1!==r&&(n.splice(r,1),r=-1),n.push(c);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),v=e.getTime()+y;e.setTime(v+d),p=new Date(t.getTime()),y=this.parent.timelineModule.getIncrement(p,f,m),v=p.getTime()+y,p.setTime(v+d)}else(e=new Date(i.getTime())).setDate(e.getDate()+1+d),this.setTime(this.parent.defaultStartTime,e),e=this.parent.dataOperation.checkStartDate(e,o,!1),(p=new Date(t.getTime())).setDate(p.getDate()+1);if(-1!==u){var D=s-c.duration;p=this.parent.dataOperation.getEndDate(e,D,o.durationUnit,o,!1)}else p=this.parent.dataOperation.checkEndDate(p,o,!1)}return n.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),n},i.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")},i.prototype.getMilestoneNode=function(e,i){var r=null,n=this.templateData;if(this.milestoneTemplateFunction)r=this.milestoneTemplateFunction(t.extend({index:e},n),this.parent,"MilestoneTemplate",this.getTemplateID("MilestoneTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var a='<div class="e-gantt-milestone" style="position:absolute;"><div class="e-milestone-top '+(n.ganttProperties.startDate||n.ganttProperties.endDate?"":"e-unscheduled-milestone-top")+'" style="border-right-width:'+this.milesStoneRadius+"px;border-left-width:"+this.milesStoneRadius+"px;border-bottom-width:"+this.milesStoneRadius+'px;"></div><div class="'+A+" "+(n.ganttProperties.startDate||n.ganttProperties.endDate?"":"e-unscheduled-milestone-bottom")+'" style="top:'+this.milesStoneRadius+"px;border-right-width:"+this.milesStoneRadius+"px; border-left-width:"+this.milesStoneRadius+"px; border-top-width:"+this.milesStoneRadius+'px;"></div></div>';r=this.createDivElement(a)}return r},i.prototype.getTaskBaselineNode=function(){var e=this.templateData,t='<div class="'+j+' " role="BaselineBar" style="margin-top:'+this.baselineTop+"px;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)},i.prototype.getMilestoneBaselineNode=function(){var e=this.templateData,t=this.parent.renderBaseline?5:2,i='<div class="e-baseline-gantt-milestone-container " style="left:'+(e.ganttProperties.baselineLeft-this.milesStoneRadius)+"px;margin-top:"+(-Math.floor(this.parent.rowHeight-this.milestoneMarginTop)+t)+'px"><div class="'+G+'"><div class="'+G+" "+q+'" style="top:'+-this.milestoneHeight+"px;border-right:"+this.milesStoneRadius+"px solid transparent;border-left:"+this.milesStoneRadius+"px solid transparent;border-top:0pxsolid transparent;border-bottom-width:"+this.milesStoneRadius+"px;border-bottom-style: solid;"+(this.baselineColor?"border-bottom-color: "+this.baselineColor+";":"")+'"></div><div class="'+G+" "+z+'" style="top:'+(this.milesStoneRadius-this.milestoneHeight)+"px;border-right:"+this.milesStoneRadius+"px solid transparent;border-left:"+this.milesStoneRadius+"px solid transparent;border-bottom:0pxsolid transparent;border-top-width:"+this.milesStoneRadius+"px;border-top-style: solid;"+(this.baselineColor?"border-top-color: "+this.baselineColor+";":"")+'"></div></div></div>';return this.createDivElement(i)},i.prototype.getLeftLabelNode=function(e){var i=this.leftLabelContainer();""!==this.generateTaskLabelAriaLabel("left")&&i[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("left"));var r=null;if(this.leftTaskLabelTemplateFunction)r=this.leftTaskLabelTemplateFunction(t.extend({index:e},this.templateData),this.parent,"LeftLabelTemplate",this.getTemplateID("LeftLabelTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var n=this.parent.labelSettings.leftLabel,a=this.getTaskLabel(n);a&&(a="isCustomTemplate"===a?n:a,r=this.getLableText(a,"e-left-label-inner-div"))}return r&&r.length>0&&("null"===r[0].data&&(r[0].data=""),i[0].appendChild([].slice.call(r)[0])),i},i.prototype.getLableText=function(e,i){var r=this.parent.renderBaseline?(this.parent.rowHeight-this.taskBarHeight)/2:this.taskBarMarginTop,n=t.createElement("div",{className:i,styles:"height:"+this.taskBarHeight+"px;margin-top:"+r+"px;"}),a=t.createElement("span",{className:fe});a[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=e,n.appendChild(a);var s=t.createElement("div");return s.appendChild(n),s.childNodes},i.prototype.getRightLabelNode=function(e){var i=this.rightLabelContainer();""!==this.generateTaskLabelAriaLabel("right")&&i[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("right"));var r=null;if(this.rightTaskLabelTemplateFunction)r=this.rightTaskLabelTemplateFunction(t.extend({index:e},this.templateData),this.parent,"RightLabelTemplate",this.getTemplateID("RightLabelTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var n=this.parent.labelSettings.rightLabel,a=this.getTaskLabel(n);a&&(a="isCustomTemplate"===a?n:a,r=this.getLableText(a,"e-right-label-inner-div"))}return r&&r.length>0&&("null"===r[0].data&&(r[0].data=""),i[0].appendChild([].slice.call(r)[0])),i},i.prototype.getManualTaskbar=function(){var e=this.templateData,t=this.taskBarHeight/2-1,i=e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration?'<div class="'+re+'" 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="'+re+" "+(e.ganttProperties.startDate?me:ye)+'" 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="'+re+' e-gantt-unscheduled-manualtask" 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="'+ie+'"style=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="height:'+t+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div><div class="e-gantt-manualparenttaskbar-right" style=left:'+(e.ganttProperties.width-t/5)+"px;height:"+t+"px;border-right-width:"+t/5+"px;border-bottom:"+t/5+"px solid transparent;></div></div>":""),n='<div class="'+ne+'" style="position:absolute;left:'+(e.ganttProperties.left-e.ganttProperties.autoLeft-this.milestoneHeight/2)+"px;width:"+2*this.milesStoneRadius+'px;"><div class="'+ae+'" style="border-right-width:'+this.milesStoneRadius+"px;border-left-width:"+this.milesStoneRadius+"px;border-bottom-width:"+this.milesStoneRadius+'px;"></div><div class="'+se+'" style="top:'+this.milesStoneRadius+"px;border-right-width:"+this.milesStoneRadius+"px; border-left-width:"+this.milesStoneRadius+"px; border-top-width:"+this.milesStoneRadius+'px;"></div></div>';return this.createDivElement(0===e.ganttProperties.width?n:r)},i.prototype.getParentTaskbarNode=function(e,i){var r=null,n=this.templateData;if(this.parentTaskbarTemplateFunction)r=this.parentTaskbarTemplateFunction(t.extend({index:e},n),this.parent,"ParentTaskbarTemplate",this.getTemplateID("ParentTaskbarTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var a="",s=void 0,o=this.taskBarHeight/5,l=this.createDivElement('<div class="e-gantt-parent-taskbar-inner-div '+this.getExpandClass(n)+" "+de+'" style="width:'+(n.ganttProperties.isAutoSchedule?n.ganttProperties.width:n.ganttProperties.autoWidth)+"px;height:"+(n.ganttProperties.isAutoSchedule?this.taskBarHeight:3*o)+"px;margin-top:"+(n.ganttProperties.isAutoSchedule?"":2*o)+'px;"></div>'),d=this.createDivElement('<div class="e-gantt-parent-progressbar-inner-div '+this.getExpandClass(n)+" "+pe+'" style="border-style:'+(n.ganttProperties.progressWidth?"solid;":"none;")+"width:"+n.ganttProperties.progressWidth+"px;border-top-right-radius:"+this.getBorderRadius(n)+"px;border-bottom-right-radius:"+this.getBorderRadius(n)+'px;height:100%;"></div>'),p=t.createElement("div");if(this.taskLabelTemplateFunction){var h=this.taskLabelTemplateFunction(t.extend({index:e},n),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,d[0]);h&&h.length>0&&(p.appendChild(h[0]),a=p.innerHTML)}else a="isCustomTemplate"===(a=this.getTaskLabel(this.parent.labelSettings.taskLabel))?this.parent.labelSettings.taskLabel:a;if(-1===a.indexOf("null")){"isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(a=""),s=isNaN(parseInt(a))?'<span class="'+U+'" style="line-height:'+(this.taskBarHeight-1)+"px; text-align: left;display:inline-block;width:"+(n.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;">'+a+"</span>":'<span class="'+U+'" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(n.ganttProperties.width-10):"")+"px; height:"+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display: inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(n.ganttProperties.width-10):"")+"px; height:"+this.taskBarHeight+'px;">'+a+"</span>";var c=this.createDivElement(s)[0],u=this.parent.labelSettings.taskLabel;u&&u.elementRef&&c.appendChild(p),d[0].appendChild(c),""!==d[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(u)&&d[0].querySelectorAll(".e-task-label")[0].children[0]&&d[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""==d[0].querySelectorAll(".e-task-label")[0].textContent&&u&&!u.elementRef&&""!==p.innerHTML&&(d[0].querySelectorAll(".e-task-label")[0].textContent=u)}var g='<div class="e-gantt-parent-milestone" style="position:absolute;"><div class="e-parent-milestone-top" style="border-right-width:'+this.milesStoneRadius+"px;border-left-width:"+this.milesStoneRadius+"px;border-bottom-width:"+this.milesStoneRadius+'px;"></div><div class="e-parent-milestone-bottom" style="top:'+this.milesStoneRadius+"px;border-right-width:"+this.milesStoneRadius+"px; border-left-width:"+this.milesStoneRadius+"px; border-top-width:"+this.milesStoneRadius+'px;"></div></div>';l[0].appendChild([].slice.call(d)[0]),r=n.ganttProperties.isMilestone?this.createDivElement(n.ganttProperties.isAutoSchedule?g:""):l}return r},i.prototype.getTableTrNode=function(){var e=t.createElement("table"),i="Horizontal"===this.parent.gridLines||"Both"===this.parent.gridLines?"e-chart-row-border":"";return e.innerHTML='<tr class="'+this.getRowClassName(this.templateData)+" "+X+'"role="ChartRow" style="display:'+this.getExpandDisplayProp(this.templateData)+";height:"+this.parent.rowHeight+'px;"><td class="'+_+" "+i+'" role="ChartCell" style="width:'+this.parent.timelineModule.totalTimelineWidth+'px;"></td></tr>',e.childNodes},i.prototype.initializeChartTemplate=function(){t.isNullOrUndefined(this.parent.parentTaskbarTemplate)||(this.parentTaskbarTemplateFunction=this.templateCompiler(this.parent.parentTaskbarTemplate)),!t.isNullOrUndefined(this.parent.labelSettings.leftLabel)&&this.isTemplate(this.parent.labelSettings.leftLabel)&&(this.leftTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.leftLabel)),!t.isNullOrUndefined(this.parent.labelSettings.rightLabel)&&this.isTemplate(this.parent.labelSettings.rightLabel)&&(this.rightTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.rightLabel)),!t.isNullOrUndefined(this.parent.labelSettings.taskLabel)&&this.isTemplate(this.parent.labelSettings.taskLabel)&&(this.taskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.taskLabel)),t.isNullOrUndefined(this.parent.taskbarTemplate)||(this.childTaskbarTemplateFunction=this.templateCompiler(this.parent.taskbarTemplate)),t.isNullOrUndefined(this.parent.milestoneTemplate)||(this.milestoneTemplateFunction=this.templateCompiler(this.parent.milestoneTemplate))},i.prototype.createDivElement=function(e){var i=t.createElement("div");return i.innerHTML=e,i.childNodes},i.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},i.prototype.getTemplateID=function(e){return this.parent.element.id+e},i.prototype.leftLabelContainer=function(){var e='<div class="'+(this.leftTaskLabelTemplateFunction?"e-left-label-container e-left-label-temp-container":I)+' " tabindex="-1" role="LeftLabel" style="height:'+(this.parent.rowHeight-2)+"px;width:"+this.taskNameWidth(this.templateData)+'"></div>';return this.createDivElement(e)},i.prototype.taskbarContainer=function(){var e=this.templateData,t=!(!this.parent.editModule||!this.parent.editSettings.allowTaskbarEditing||"ParentResizing"!==this.parent.editModule.taskbarEditModule.taskBarEditAction),i='<div class="'+F+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+" "+(e.ganttProperties.cssClass?e.ganttProperties.cssClass:"")+'" tabindex="-1" role="TaskBar" style="'+(e.ganttProperties.isMilestone&&!t?"width:"+this.milestoneHeight+"px;height:"+this.milestoneHeight+"px;margin-top:"+this.milestoneMarginTop+"px;left:"+(e.ganttProperties.left-this.milestoneHeight/2)+"px;":"width:"+e.ganttProperties.width+"px;margin-top:"+this.taskBarMarginTop+"px;left:"+(!e.hasChildRecords||e.ganttProperties.isAutoSchedule?e.ganttProperties.left:e.ganttProperties.autoLeft)+"px;height:"+this.taskBarHeight+"px;cursor:"+(e.ganttProperties.isAutoSchedule?"move;":"auto;"))+'"></div>';return this.createDivElement(i)},i.prototype.rightLabelContainer=function(){var e='<div class="'+(this.rightTaskLabelTemplateFunction?"e-right-label-container e-right-label-temp-container":E)+'" tabindex="-1" role="RightLabel" style="left:'+this.getRightLabelLeft(this.templateData)+"px; height:"+(this.parent.rowHeight-2)+'px;"></div>';return this.createDivElement(e)},i.prototype.childTaskbarLeftResizer=function(){var e=-(this.parent.isAdaptive?12:2),t='<div class="'+Y+' e-icon" role="LeftResizer" style="left:'+e+"px;height:"+this.taskBarHeight+'px;"></div>';return this.createDivElement(t)},i.prototype.childTaskbarRightResizer=function(){var e=this.parent.isAdaptive?-2:-10,t='<div class="'+Z+' e-icon" role="RightResizer" style="left:'+(this.templateData.ganttProperties.width+e)+"px;height:"+this.taskBarHeight+'px;"></div>';return this.createDivElement(t)},i.prototype.childTaskbarProgressResizer=function(){var e='<div class="'+Q+'" role="ProgressResizer" style="left:'+(this.templateData.ganttProperties.progressWidth-6)+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+K+'"><div class="'+J+'"></div><div class="'+$+'"></div></div>';return this.createDivElement(e)},i.prototype.getLeftPointNode=function(){var e=this.templateData,t=-((this.parent.isAdaptive?14:2)+this.connectorPointWidth),i=-(this.connectorPointWidth+2),r=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),n='<div class="e-left-connectorpoint-outer-div" style="'+(e.ganttProperties.isMilestone?"margin-top:"+r+"px;left:"+i+"px;":"margin-top:"+this.connectorPointMargin+"px;left:"+t+"px;")+'"><div class="'+Ue+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width: '+this.connectorPointWidth+"px;height: "+this.connectorPointWidth+'px;">'+this.touchLeftConnectorpoint+"</div></div>";return this.createDivElement(n)},i.prototype.getRightPointNode=function(){var e=this.templateData,t=this.parent.isAdaptive?10:-2,i=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),r='<div class="'+Be+'" style="'+(e.ganttProperties.isMilestone?"left:"+(this.milestoneHeight-2)+"px;margin-top:"+i+"px;":"left:"+(e.ganttProperties.width+t)+"px;margin-top:"+this.connectorPointMargin+"px;")+'"><div class="'+Ve+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width:'+this.connectorPointWidth+"px;height:"+this.connectorPointWidth+'px;">'+this.touchRightConnectorpoint+"</div></div>";return this.createDivElement(r)},i.prototype.getTaskLabel=function(e){var i=this.parent.ganttColumns.length,r=null;if(t.isNullOrUndefined(e)||""===e)r="";else if(e===this.parent.taskFields.resourceInfo)r=this.getResourceName(this.templateData);else{for(var n=0;n<i;n++)if(e===this.parent.ganttColumns[n].field){r=this.getFieldValue(this.templateData[e]).toString();break}if(t.isNullOrUndefined(r))return"isCustomTemplate"}return r},i.prototype.getExpandDisplayProp=function(e){return e=this.templateData,this.parent.getExpandStatus(e)?"table-row":"none"},i.prototype.getRowClassName=function(e){var t="gridrowtaskId",i=(e=this.templateData).parentItem;return i&&(t+=i.taskId.toString()),t+="level",t+=e.level.toString()},i.prototype.getBorderRadius=function(e){var t=(e=this.templateData).ganttProperties.width-e.ganttProperties.progressWidth;return t<=4?4-t:0},i.prototype.getSplitTaskBorderRadius=function(e){var t=e.width-e.progressWidth;return t<=4?4-t:0},i.prototype.taskNameWidth=function(e){var t,i=(e=this.templateData).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)<0&&(t=0),t+"px"},i.prototype.getRightLabelLeft=function(e){var t,i,r=(e=this.templateData).ganttProperties;return e.ganttProperties.isMilestone?e.ganttProperties.left+this.parent.getTaskbarHeight()/2:e.hasChildRecords&&!r.isAutoSchedule?(this.parent.allowUnscheduledTasks?(t=r.left<r.autoLeft?r.left:r.autoLeft,i=r.autoWidth):(t=r.autoStartDate.getTime()<r.startDate.getTime()?r.autoLeft:r.left,i=(r.autoEndDate.getTime()<r.endDate.getTime()?this.parent.dataOperation.getTaskLeft(r.endDate,r.isMilestone):this.parent.dataOperation.getTaskLeft(r.autoEndDate,r.isMilestone))-t),t+i):e.ganttProperties.left+e.ganttProperties.width},i.prototype.getExpandClass=function(e){return(e=this.templateData).expanded?"e-row-expand":!e.expanded&&e.hasChildRecords?"e-row-collapse":""},i.prototype.getFieldValue=function(e){return t.isNullOrUndefined(e)?"":e},i.prototype.getResourceName=function(e){e=this.templateData;var i=null;if(!t.isNullOrUndefined(e.ganttProperties.resourceInfo)){var r=e.ganttProperties.resourceInfo.length;if(r>0){for(var n=0;n<r;n++){var a=e.ganttProperties.resourceInfo[n][this.parent.resourceFields.name],s=e.ganttProperties.resourceInfo[n][this.parent.resourceFields.unit];100!==s&&(a+="["+s+"%]"),t.isNullOrUndefined(i)?i=a:i+=" , "+a}return i}return""}return""},i.prototype.initChartHelperPrivateVariable=function(){var e=this.parent.renderBaseline?.45:.62,i=this.parent.renderBaseline?4:2,r=this.parent.renderBaseline?1.13:.82;if(this.baselineColor=t.isNullOrUndefined(this.parent.baselineColor)||""===this.parent.baselineColor?null:this.parent.baselineColor,this.taskBarHeight=t.isNullOrUndefined(this.parent.taskbarHeight)||this.parent.taskbarHeight>=this.parent.rowHeight?Math.floor(this.parent.rowHeight*e):this.parent.taskbarHeight,this.parent.renderBaseline){var n=void 0;n=this.taskBarHeight+this.baselineHeight<=this.parent.rowHeight?this.taskBarHeight:this.taskBarHeight-(this.baselineHeight+1),this.taskBarHeight=n}this.milestoneHeight=Math.floor(this.taskBarHeight*r),this.taskBarMarginTop=Math.floor((this.parent.rowHeight-this.taskBarHeight)/i),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)},i.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)}},i.prototype.createTaskbarTemplate=function(){var e=[].slice.call(this.ganttChartTableBody.querySelectorAll("tr"));this.ganttChartTableBody.innerHTML="";var i=[],r=this.parent.treeGridModule.prevCurrentView;if(this.refreshedTr=[],this.refreshedData=[],this.parent.enableImmutableMode&&r&&r.length>0&&this.isUpdated){for(var n={},a=[],s=this.parent.treeGrid.getPrimaryKeyFieldNames()[0],o=0;o<r.length;o++)a[o]=e[o],n[r[o][s]]=o;for(var l=0;l<this.parent.currentViewData.length;l++){var d=n[this.parent.currentViewData[l][s]],p=this.parent.modifiedRecords.indexOf(this.parent.currentViewData[l]);if(t.isNullOrUndefined(d)||-1!==p){var h=this.getGanttChartRow(l,this.parent.currentViewData[l]);this.ganttChartTableBody.appendChild(h),this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[l]),this.refreshedData.push(this.parent.currentViewData[l])}else this.ganttChartTableBody.appendChild(a[d]);this.ganttChartTableBody.querySelectorAll("tr")[l].setAttribute("aria-rowindex",l.toString())}}else for(o=0;o<this.parent.currentViewData.length;o++){var c=this.parent.currentViewData[o];"ResourceView"===this.parent.viewType&&!c.expanded&&this.parent.enableMultiTaskbar&&i.push(c);h=this.getGanttChartRow(o,c);this.ganttChartTableBody.appendChild(h),this.parent.enableImmutableMode&&(this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[o]),this.refreshedData.push(this.parent.currentViewData[o])),this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.maintainSelectedRecords(parseInt(h.getAttribute("aria-rowindex"),10))}if(this.parent.renderTemplates(),this.triggerQueryTaskbarInfo(),this.parent.modifiedRecords=[],i.length)for(var u=0;u<i.length;u++)i[u].hasChildRecords&&(this.parent.isGanttChartRendered=!0,this.parent.chartRowsModule.refreshRecords([i[u]]));this.parent.renderTemplates()},i.prototype.getGanttChartRow=function(e,i){this.templateData=i;var r=null,n=this.getTableTrNode(),a=this.getLeftLabelNode(e),s=this.taskbarContainer();if(s[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),s[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID),!this.templateData.hasChildRecords){var o=this.getLeftPointNode();s[0].appendChild([].slice.call(o)[0])}if(this.templateData.hasChildRecords){var l=this.getParentTaskbarNode(e,s);if(!this.templateData.ganttProperties.isAutoSchedule){var d=this.getManualTaskbar();s[0].appendChild([].slice.call(d)[0])}l&&l.length>0&&s[0].appendChild([].slice.call(l)[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.getTaskBaselineNode())}else if(this.templateData.ganttProperties.isMilestone){var p=this.getMilestoneNode(e,s);p&&p.length>0&&s[0].appendChild([].slice.call(p)[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.getMilestoneBaselineNode())}else{var h=f(this.templateData.ganttProperties),c=null,u=null,g=null;if(!t.isNullOrUndefined(h)){(h||this.templateData.ganttProperties.duration)&&h&&(t.isNullOrUndefined(this.templateData.ganttProperties.segments)||this.templateData.ganttProperties.segments.length<=0)&&(c=this.childTaskbarProgressResizer(),g=this.childTaskbarLeftResizer(),u=this.childTaskbarRightResizer());var m=this.getChildTaskbarNode(e,s);if(g&&s[0].appendChild([].slice.call(g)[0]),m&&m.length>0)if(this.templateData.ganttProperties.segments&&this.templateData.ganttProperties.segments.length>0){var y=this.templateData.ganttProperties.segments.length,v=null;v=this.createDivElement('<div class="e-gantt-split-container-line"></div>'),s[0].appendChild([].slice.call(v)[0]);for(var D=0;D<y;D++)s[0].appendChild([].slice.call(m)[0])}else s[0].appendChild([].slice.call(m)[0]);c&&s[0].appendChild([].slice.call(c)[0]),u&&s[0].appendChild([].slice.call(u)[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.getTaskBaselineNode())}if(!this.templateData.hasChildRecords){var w=this.getRightPointNode();s[0].appendChild([].slice.call(w)[0])}var k=this.getRightLabelNode(e);if(n[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[0]),n[0].childNodes[0].childNodes[0].appendChild([].slice.call(s)[0]),this.templateData.ganttProperties.indicators&&this.templateData.ganttProperties.indicators.length>0)for(var T=void 0,S=void 0,b=this.templateData.ganttProperties.indicators,P=0;P<b.length;P++){if((T=this.getIndicatorNode(b[P]))[0].setAttribute("aria-label",b[P].name),b[P].name.indexOf("$")>-1||b[P].name.indexOf("#")>-1)S=this.templateCompiler(b[P].name)(t.extend({index:e},this.templateData),this.parent,"indicatorLabelText");else{var C=t.createElement("Text");C.innerHTML=b[P].name,S=C.childNodes}T[0].appendChild([].slice.call(S)[0]),T[0].title=t.isNullOrUndefined(b[P].tooltip)?"":b[P].tooltip,n[0].childNodes[0].childNodes[0].appendChild([].slice.call(T)[0])}k&&k.length>0&&n[0].childNodes[0].childNodes[0].appendChild([].slice.call(k)[0]),t.isNullOrUndefined(r)||n[0].childNodes[0].childNodes[0].appendChild([].slice.call(r)[0]);var M=n[0].childNodes[0];return this.setAriaRowIndex(i,M),M},i.prototype.setAriaRowIndex=function(e,i){var r=this.parent.treeGrid.getCurrentViewRecords(),n=(this.parent.virtualScrollModule&&this.parent.enableVirtualization?t.getValue("virtualScrollModule.visualData",this.parent.treeGrid):r).indexOf(e);i.setAttribute("aria-rowindex",n.toString())},i.prototype.triggerQueryTaskbarInfo=function(){if(this.parent.queryTaskbarInfo)for(var e,i,r=this.parent.enableImmutableMode?this.refreshedTr.length:this.ganttChartTableBody.querySelectorAll("tr").length,n=0;n<r;n++){e=this.parent.enableImmutableMode?this.refreshedTr[n]:this.ganttChartTableBody.querySelectorAll("tr")[n],i=this.refreshedData.length>0?this.refreshedData[n]:this.parent.currentViewData[n];var a=!t.isNullOrUndefined(i.ganttProperties.segments)&&i.ganttProperties.segments.length;if(a>0)for(var s=0;s<a;s++){var o=e.getElementsByClassName("e-segmented-taskbar")[s];this.triggerQueryTaskbarInfoByIndex(o,i)}else e&&this.triggerQueryTaskbarInfoByIndex(e,i)}},i.prototype.triggerQueryTaskbarInfoByIndex=function(e,i){var r=this,n=!t.isNullOrUndefined(i.ganttProperties.segments)&&i.ganttProperties.segments.length>0?e:e.querySelector("."+F),a={data:i,rowElement:e,taskbarElement:n,taskbarType:i.hasChildRecords?"ParentTask":i.ganttProperties.isMilestone?"Milestone":"ChildTask"},s=this.getClassName(a);if("Milestone"===a.taskbarType)a.milestoneColor=n.querySelector(s[0])?getComputedStyle(n.querySelector(s[0])).borderBottomColor:null,a.baselineColor=e.querySelector(s[1])?getComputedStyle(e.querySelector(s[1])).borderBottomColor:null;else{var o=n.querySelector(s[0]),l=n.querySelector(s[1]);a.taskbarBgColor=t.isNullOrUndefined(o)?null:n.classList.contains(ee)?getComputedStyle(n).backgroundColor:getComputedStyle(n.querySelector(s[0])).backgroundColor,a.taskbarBorderColor=t.isNullOrUndefined(o)?null:n.classList.contains(ee)?getComputedStyle(n).backgroundColor:getComputedStyle(n.querySelector(s[0])).borderColor,a.progressBarBgColor=t.isNullOrUndefined(l)?null:n.classList.contains(te)?getComputedStyle(n).backgroundColor:getComputedStyle(n.querySelector(s[1])).backgroundColor,a.baselineColor=e.querySelector("."+j)?getComputedStyle(e.querySelector("."+j)).backgroundColor:null,a.taskLabelColor=n.querySelector("."+U)?getComputedStyle(n.querySelector("."+U)).color:null}a.rightLabelColor=e.querySelector("."+E)&&e.querySelector("."+E).querySelector("."+fe)?getComputedStyle(e.querySelector("."+E).querySelector("."+fe)).color:null,a.leftLabelColor=e.querySelector("."+I)&&e.querySelector("."+I).querySelector("."+fe)?getComputedStyle(e.querySelector("."+I).querySelector("."+fe)).color:null,this.parent.trigger("queryTaskbarInfo",a,function(e){r.updateQueryTaskbarInfoArgs(e,void 0,void 0)})},i.prototype.updateQueryTaskbarInfoArgs=function(e,t,i){var r=e.rowElement,n=e.taskbarElement,a=this.getClassName(e);"Milestone"===e.taskbarType?(n.querySelector(a[0])&&getComputedStyle(n.querySelector(a[0])).borderBottomColor!==e.milestoneColor&&(n.querySelector(a[0]).style.borderBottomColor=e.milestoneColor,n.querySelector("."+A).style.borderTopColor=e.milestoneColor),r.querySelector(a[1])&&getComputedStyle(r.querySelector(a[1])).borderTopColor!==e.baselineColor&&(r.querySelector(a[1]).style.borderBottomColor=e.baselineColor,r.querySelector("."+z).style.borderTopColor=e.baselineColor)):(n.querySelector(a[0])&&getComputedStyle(n.querySelector(a[0])).backgroundColor!==e.taskbarBgColor&&(n.querySelector(a[0]).style.backgroundColor=e.taskbarBgColor),n.querySelector(a[0])&&getComputedStyle(n.querySelector(a[0])).borderColor!==e.taskbarBorderColor&&(n.querySelector(a[0]).style.borderColor=e.taskbarBorderColor),n.querySelector(a[1])&&getComputedStyle(n.querySelector(a[1])).backgroundColor!==e.progressBarBgColor&&(n.querySelector(a[1]).style.backgroundColor=e.progressBarBgColor),n.classList.contains(ee)&&getComputedStyle(n).backgroundColor!==e.taskbarBgColor&&(n.style.backgroundColor=e.taskbarBgColor),n.classList.contains(ee)&&getComputedStyle(n).borderColor!==e.taskbarBorderColor&&(n.style.borderColor=e.taskbarBorderColor),n.classList.contains(te)&&getComputedStyle(n).backgroundColor!==e.progressBarBgColor&&(n.style.backgroundColor=e.progressBarBgColor),n.querySelector("."+U)&&getComputedStyle(n.querySelector("."+U)).color!==e.taskLabelColor&&(n.querySelector("."+U).style.color=e.taskLabelColor),r.querySelector("."+j)&&getComputedStyle(r.querySelector("."+j)).backgroundColor!==e.baselineColor&&(r.querySelector("."+j).style.backgroundColor=e.baselineColor)),r.querySelector("."+I)&&r.querySelector("."+I).querySelector("."+fe)&&getComputedStyle(r.querySelector("."+I).querySelector("."+fe)).color!==e.leftLabelColor&&(r.querySelector("."+I).querySelector("."+fe).style.color=e.leftLabelColor),r.querySelector("."+E)&&r.querySelector("."+E).querySelector("."+fe)&&getComputedStyle(r.querySelector("."+E).querySelector("."+fe)).color!==e.rightLabelColor&&(r.querySelector("."+E).querySelector("."+fe).style.color=e.rightLabelColor)},i.prototype.getClassName=function(e){var t=[];return t.push("."+("ParentTask"===e.taskbarType?de:"ChildTask"===e.taskbarType?ee:"e-milestone-top")),t.push("."+("ParentTask"===e.taskbarType?pe:"ChildTask"===e.taskbarType?te:q)),t},i.prototype.templateCompiler=function(e){if(!t.isNullOrUndefined(e)&&""!==e)try{return document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim(),this.parent):t.compile(e,this.parent)}catch(i){return t.compile(e,this.parent)}return null},i.prototype.refreshRow=function(e,i){var r=this.ganttChartTableBody.childNodes[e],n=this.parent.currentViewData[e];if(-1!==e&&n){var a=n;"ResourceView"===this.parent.viewType&&a.hasChildRecords&&!a.expanded&&this.parent.enableMultiTaskbar?r.replaceChild(this.getResourceParent(a).childNodes[0],r.childNodes[0]):r.replaceChild(this.getGanttChartRow(e,a).childNodes[0],r.childNodes[0]),this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&this.parent.showOverAllocation&&(i?this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData):(this.parent.dataOperation.updateOverlappingValues(a),this.parent.ganttChartModule.renderRangeContainer([a])));var s=!t.isNullOrUndefined(a.ganttProperties.segments)&&a.ganttProperties.segments.length;if(s>0)for(var o=0;o<s;o++){var l=r.getElementsByClassName("e-segmented-taskbar")[o];this.triggerQueryTaskbarInfoByIndex(l,a)}else this.triggerQueryTaskbarInfoByIndex(r,a);var d="ProjectView"===this.parent.viewType?a.ganttProperties.taskId:a.ganttProperties.rowUniqueID;this.parent.treeGrid.grid.setRowData(d,a);var p=this.parent.ganttChartModule.tempNextElement;this.parent.ganttChartModule.isEditableElement&&p&&(this.parent.treeGrid.grid.focusModule.focus(),t.addClass([this.parent.treeGrid.getRows()[r.ariaRowIndex].children[this.parent.ganttChartModule.childrenIndex]],"e-focused"),this.parent.ganttChartModule.tempNextElement=null);this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[e].getAttribute("data-uid")).data=a}},i.prototype.getResourceParent=function(e){var i=this.parent.ganttChartModule.getChartRows();if(this.parent.initialChartRowElements)for(var r=0;r<this.parent.initialChartRowElements.length;r++)t.isNullOrUndefined(i[r])||t.isNullOrUndefined(i[r].childNodes[0].childNodes[1].childNodes[2])||t.isNullOrUndefined(this.parent.initialChartRowElements[r].childNodes[0].childNodes[1].childNodes[2])||(i[r].childNodes[0].childNodes[1].childNodes[2].innerHTML=this.parent.initialChartRowElements[r].childNodes[0].childNodes[1].childNodes[2].innerHTML);this.templateData=e;var n=this.getTableTrNode(),a=this.leftLabelContainer(),s=t.createElement("div",{className:"e-collapse-parent"});n[0].childNodes[0].childNodes[0].appendChild(s);var o=this.parent.dataOperation.setSortedChildTasks(e);this.parent.dataOperation.updateOverlappingIndex(o);for(var l=0;l<i.length;l++)if(i[l].classList.contains("gridrowtaskId"+e.ganttProperties.rowUniqueID+"level"+(e.level+1))){var d=i[l].querySelector(".e-taskbar-main-container");t.addClass([d],"collpse-parent-border");var p=i[l].querySelector("."+F).getAttribute("rowUniqueId"),h=this.parent.getRecordByID(p).ganttProperties.eOverlapIndex.toString(),c=d.cloneNode(!0);c.style.zIndex=h,n[0].childNodes[0].childNodes[0].childNodes[0].appendChild(c)}return n[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[0]),n[0].childNodes[0]},i.prototype.refreshRecords=function(e,t){if(this.parent.isGanttChartRendered){if(this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar){e=new n.DataManager(e).executeLocal((new n.Query).sortBy("expanded","Descending"))}for(var i=0;i<e.length;i++){var r=this.parent.currentViewData.indexOf(e[i]);this.refreshRow(r,t)}this.parent.ganttChartModule.updateLastRowBottomWidth()}},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("renderPanels",this.createChartTable),this.parent.off("dataReady",this.initiateTemplates),this.parent.off("destroy",this.destroy))},i.prototype.destroy=function(){this.removeEventListener()},i.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},i.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},i.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},i}(M),Kt=function(){function e(e){this.parentRecord=[],this.parentIds=[],this.parent=e,this.dateValidateModule=this.parent.dateValidationModule}return e.prototype.ensurePredecessorCollection=function(){for(var e=this.parent.predecessorsCollection,t=e.length-1;t>=0;t--){var i=e[t],r=i.ganttProperties;i.hasChildRecords||this.ensurePredecessorCollectionHelper(i,r)}},e.prototype.ensurePredecessorCollectionHelper=function(e,i){var r=i.predecessorsName;if(!r||"string"!=typeof r&&"number"!=typeof r){if(r&&"object"==typeof r&&r.length){for(var n=[],a=0;a<r.length;a++){var s=r[a],o={};o.from=t.getValue("from",s),o.to=t.getValue("to",s)?t.getValue("to",s):i.rowUniqueID,o.type=t.getValue("type",s)?t.getValue("type",s):"FS";var l=t.getValue("offset",s);if(t.isNullOrUndefined(l))o.offset=0,o.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();else if("string"==typeof l){var d=this.getOffsetDurationUnit(t.getValue("offset",s));o.offset=d.duration,o.offsetUnit=d.durationUnit}else o.offset=parseFloat(l.toString()),o.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();this.checkIsParent(o.from.toString())||n.push(o)}this.parent.setRecordValue("predecessor",n,i,!0)}}else this.parent.setRecordValue("predecessor",this.calculatePredecessor(r,e),i,!0);this.parent.setRecordValue("predecessorsName",this.getPredecessorStringValue(e),i,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,i.predecessorsName,e),this.parent.setRecordValue(this.parent.taskFields.dependency,i.predecessorsName,e)},e.prototype.updateUnscheduledDependency=function(e){for(var i=this.parent.taskFields,r=t.isNullOrUndefined(e[i.dependency])?[]:e[i.dependency].toString().split(","),n=0;n<r.length;n++){var a=parseInt(r[n],10);if(!isNaN(a)){var s=this.parent.getRecordByID(a.toString()),o=t.isNullOrUndefined(s)?null:t.extend({},{},s.taskData,!0);!t.isNullOrUndefined(o)&&t.isNullOrUndefined(o[i.startDate])&&t.isNullOrUndefined(o[i.duration])&&t.isNullOrUndefined(o[i.endDate])&&(o[i.duration]=1,o[i.startDate]=this.parent.projectStartDate,this.parent.updateRecordByID(o))}}},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=[];return e.toString().split(",").forEach(function(e){r=e.split("+"),n="+",e.indexOf("-")>=0&&(r=e.split("-"),n="-"),i=r[0].match(/(\d+|[A-z]+)/g);var l="ResourceView"===s.parent.viewType?s.parent.getTaskIds():s.parent.ids,d="ResourceView"===s.parent.viewType?l.indexOf("T"+i[0]):l.indexOf(i[0]);if(i[0]&&-1!==d){if(i.length>1){var p=i[1].toUpperCase();a="FS"===p||"FF"===p||"SF"===p||"SS"===p?p:"FS"}else a="FS";var h=r.length>1?n+""+r[1]:"0",c=s.getOffsetDurationUnit(h),u={from:i[0],type:a,isDrawn:!1,to:"ResourceView"===s.parent.viewType?t.ganttProperties.taskId.toString():t.ganttProperties.rowUniqueID.toString(),offsetUnit:c.durationUnit,offset:c.duration};s.checkIsParent(i[0])||o.push(u)}}),o},e.prototype.getPredecessorStringValue=function(e){var i=e.ganttProperties.predecessor,r=this.parent.durationUnitTexts,n="";if(i)for(var a=i.length,s=0;s<a;s++){var o=i[s],l="",d="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(o.from!==d.toString()){if(l=o.from+o.type,0!==o.offset){l+=o.offset>0?"+"+o.offset+" ":o.offset+" ";var p=1!==o.offset;"day"===o.offsetUnit?l+=p?t.getValue("days",r):t.getValue("day",r):"hour"===o.offsetUnit?l+=p?t.getValue("hours",r):t.getValue("hour",r):l+=p?t.getValue("minutes",r):t.getValue("minute",r)}n=n.length>0?n+","+l:l}}return n},e.prototype.getOffsetDurationUnit=function(e){var i=0,r=this.parent.durationUnit.toLocaleLowerCase(),n=this.parent.durationUnitEditText;if("string"==typeof e){for(var a=e.match(/[^0-9]+|[0-9]+/g),s=0;s<a.length;s++)a[s]=a[s].trim();"-"===a[0]&&a[1]?(a[1]=a[0]+a[1],a.shift()):"+"===a[0]&&a.shift(),"."!==a[1]||isNaN(parseInt(a[2],10))||(a[0]+=a[1]+a[2],a.splice(1,2)),a&&a.length<=2&&(i=parseFloat(a[0]),r=a[1]?a[1].toLowerCase().trim():"",r=-1!==t.getValue("minute",n).indexOf(r)?"minute":-1!==t.getValue("hour",n).indexOf(r)?"hour":-1!==t.getValue("day",n).indexOf(r)?"day":this.parent.durationUnit.toLocaleLowerCase())}else i=e,r=this.parent.durationUnit.toLocaleLowerCase();return isNaN(i)&&(i=0,r=this.parent.durationUnit.toLocaleLowerCase()),{duration:i,durationUnit:r}},e.prototype.updatePredecessors=function(){for(var e,t=this.parent.predecessorsCollection,i=t.length,r=0;r<i;r++)(e=t[r]).hasChildRecords||this.updatePredecessorHelper(e,t)},e.prototype.updatePredecessorHelper=function(e,i){var r,n=e.ganttProperties.predecessor,a=n.length;i=t.isNullOrUndefined(i)?[]:i;for(var s=0;s<a;s++){var o=n[s];r=this.parent.connectorLineModule.getRecordByID(o.from);var l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(o.from!==l.toString()&&r){var d=void 0;r.ganttProperties.predecessor?((d=t.extend([],r.ganttProperties.predecessor,[],!0)).push(o),this.parent.setRecordValue("predecessor",d,r.ganttProperties,!0)):((d=[]).push(o),this.parent.setRecordValue("predecessor",d,r.ganttProperties,!0),i.push(r))}}},e.prototype.updatedRecordsDateByPredecessor=function(){for(var e=this.parent.flatData,t=0;t<e.length;t++)e[t].ganttProperties.predecessor&&this.validatePredecessorDates(e[t])},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)).ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)&&this.validateChildGanttRecord(r,n)}}},e.prototype.validateChildGanttRecord=function(e,i){if(this.parent.editedTaskBarItem!==i&&!t.isNullOrUndefined(f(e.ganttProperties))&&!t.isNullOrUndefined(f(i.ganttProperties))&&this.parent.isInPredecessorValidation&&(i.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)){var r=i.ganttProperties,n="ResourceView"===this.parent.viewType?r.taskId.toString():r.rowUniqueID.toString(),a=r.predecessor.filter(function(e){return e.to===n?e:null}),s=this.getPredecessorDate(i,a);this.parent.setRecordValue("startDate",s,r,!0),this.parent.dataOperation.updateMappingData(i,"startDate");var o=i.ganttProperties.segments;t.isNullOrUndefined(o)&&this.dateValidateModule.calculateEndDate(i),this.parent.dataOperation.updateWidthLeft(i),i.parentItem&&this.parent.getParentTask(i.parentItem).ganttProperties.isAutoSchedule&&this.parent.isInPredecessorValidation&&!this.parent.isLoad&&-1===this.parentIds.indexOf(i.parentItem.uniqueID)&&(this.parentIds.push(i.parentItem.uniqueID),this.parentRecord.push(i.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 p=o[d];n=this.parent.connectorLineModule.getRecordByID(p.from),a=this.parent.connectorLineModule.getRecordByID(p.to),r=this.getValidatedStartDate(a.ganttProperties,n.ganttProperties,p),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):(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,i,r=e||this.parent.currentViewData,n=r.length;for(this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.getExpandedRecords(this.parent.updatedRecords),t=0;t<n;t++)(i=r[t].ganttProperties.predecessor)&&this.addPredecessorsCollection(i)},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){for(var r=e.ganttProperties.predecessor,n=void 0,a=null,s=void 0,o=void 0,l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),d=r.filter(function(e){return e.to===l?e:null}),p=r.filter(function(e){return e.from===l?e:null}),h=0;h<d.length;h++){s=d[h],n=this.parent.connectorLineModule.getRecordByID(s.from),a=this.parent.connectorLineModule.getRecordByID(s.to),this.parent.isInPredecessorValidation&&a.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1;var c="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;c.toString()!==s.to&&c.toString()!==s.from||i&&"predecessor"!==i||this.validateChildGanttRecord(n,a)}for(h=0;h<p.length;h++)o=p[h],n=this.parent.connectorLineModule.getRecordByID(o.from),a=this.parent.connectorLineModule.getRecordByID(o.to),this.parent.isInPredecessorValidation&&a.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1,"predecessor"!==i&&this.parent.isValidationEnabled&&this.validateChildGanttRecord(n,a),!1!==n.expanded&&a.expanded,a&&this.validatePredecessor(a,void 0,"successor")}},e.prototype.getValidPredecessor=function(e){var i=this,r=[];if(!t.isNullOrUndefined(e)){var n=e.ganttProperties.predecessor;n&&n.length>0&&(r=n.filter(function(t){var r="ResourceView"===i.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;return t.from!==r.toString()}))}return r},e}(),Jt=function(){function e(e){this.expandedRecords=[],this.parent=e,this.dependencyViewContainer=t.createElement("div",{className:ve}),this.initPublicProp()}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,i,r){var n={},a=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport?this.parent.flatData:this.expandedRecords,s=a.indexOf(e),o=a.indexOf(i),l=e.ganttProperties,d=i.ganttProperties,p=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.getExpandedRecords(this.parent.currentViewData);n.parentIndexInCurrentView=p.indexOf(e),n.childIndexInCurrentView=p.indexOf(i);if(!(this.parent.virtualScrollModule&&this.parent.enableVirtualization)&&(-1===n.parentIndexInCurrentView||-1===n.childIndexInCurrentView)||-1===n.parentIndexInCurrentView&&-1===n.childIndexInCurrentView)return null;n.parentLeft=l.isMilestone?l.left-this.parent.chartRowsModule.milestoneHeight/2:l.left,n.childLeft=d.isMilestone?d.left-this.parent.chartRowsModule.milestoneHeight/2:d.left,n.parentWidth=0===l.width||l.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):l.width,n.childWidth=0===d.width||d.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):d.width,n.parentIndex=s,n.childIndex=o;var h=!t.isNullOrUndefined(this.parent.ganttChartModule.getChartRows())&&this.parent.ganttChartModule.getChartRows()[0]&&this.parent.ganttChartModule.getChartRows()[0].getBoundingClientRect().height;n.rowHeight=h&&!isNaN(h)?h:this.parent.rowHeight,n.type=r.type;var c="ResourceView"===this.parent.viewType?l.taskId:l.rowUniqueID,u="ResourceView"===this.parent.viewType?d.taskId:d.rowUniqueID;return n.connectorLineId="parent"+c+"child"+u,n.milestoneParent=!!l.isMilestone,n.milestoneChild=!!d.isMilestone,t.isNullOrUndefined(f(l))||t.isNullOrUndefined(f(d))?null:n},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.dependencyViewContainer.innerHTML=t;for(var n=this.parent.connectorLineModule.dependencyViewContainer.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.appendChild(this.dependencyViewContainer)},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 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,i){return"border-"+e+"-width:"+i+"px;"+("border-"+e+"-style:solid;")+(t.isNullOrUndefined(this.lineColor)?"":"border-"+e+"-color:"+this.lineColor+";")},e.prototype.getConnectorLineTemplate=function(e){var i=this.getInnerChildWidthSSType2(e),r=this.getInnerElementWidthSSType2(e),n=this.getInnerElementLeftSSType2(e),a=this.getHeightValue(e),s=!!e.milestoneParent,o=!!e.milestoneChild,l="",d=this.parent.virtualScrollModule&&this.parent.enableVirtualization,p=this.getPosition(e,this.getParentPosition(e),a),h=0;this.parent.renderBaseline&&(h=e.milestoneParent&&e.milestoneChild?0:e.milestoneParent?-5:e.milestoneChild?5:0);var c=d?p.height:a+h;if(this.getParentPosition(e)){l='<div id="ConnectorLine'+e.connectorLineId+'" style="background-color:black">';var u='<div class="'+De+'" tabindex="-1" style="',g='<div class="e-line" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),f='<div class="'+be+'" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),m='<div class="'+Pe+'" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),y=m+(o?"left:0px;":"")+this.getBorderStyles("right",10)+"top:"+(-5-this.lineStroke+(this.lineStroke-1))+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',v=this.getBorderStyles("left",10)+"top:"+-6+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',D=this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>'+g+"top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-(this.lineStroke-1))+'position:relative;"></div>',w=m+"left:"+(e.childLeft+e.childWidth-e.parentLeft+10)+"px;"+this.getBorderStyles("right",10),k="top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>';"FSType1"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType1">',u=(u+=g)+"left:"+(s?-1:0)+"px;width:"+(s?e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10+1:e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:0px;"+this.getBorderStyles("right",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=f)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles("left",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FSType2"===this.getParentPosition(e)&&(u=u+"left:"+e.parentLeft+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType2">',u=(u+=g)+"left:"+(s?e.parentWidth-1:e.parentWidth)+"px;width:"+(s?11:10)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentWidth+10-this.lineStroke)+"px;"+this.getBorderStyles("left",this.lineStroke)+"width:0px;"+this.getBorderStyles("top",c-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:"+(e.parentLeft+e.parentWidth-e.childLeft+30)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:0px;"+this.getBorderStyles("top",this.getconnectorLineGap(e)-this.lineStroke)+this.getBorderStyles("left",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=f)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+10))+"px;"+this.getBorderStyles("left",10)+"border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+"px;top:"+(-6-this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FSType3"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft-20)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType3">',u=(u+=f)+"left:10px;"+this.getBorderStyles("left",10)+"border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+"px;top:"+-6+'px;width:0;height:0;position:relative;"></div>',u=(u+=g)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(6+(5+this.lineStroke)+Math.round(this.lineStroke/2))+'px;"></div>',u=(u+=g)+"width:"+this.lineStroke+"px;"+this.getBorderStyles("top",c-this.getconnectorLineGap(e)-this.lineStroke+1)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',u=(u+=g)+"width:"+(e.parentLeft+e.parentWidth-e.childLeft+30)+"px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',u=(u+=g)+"left:"+(e.parentLeft+e.parentWidth-e.childLeft+(30-this.lineStroke))+"px;width:0px;height:"+(this.getconnectorLineGap(e)-this.lineStroke)+"px;"+this.getBorderStyles("left",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',u=(u+=g)+(s?"left:"+(e.parentLeft+e.parentWidth-e.childLeft+(18-this.lineStroke))+"px;width:"+(12+this.lineStroke)+"px;":"left:"+(e.parentLeft+e.parentWidth-e.childLeft+20)+"px;width:10px;")+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div></div>'),"FSType4"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType4">',u=(u+=f)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles("left",10)+"top:"+-6+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth)-20)+"px;top:"+-(6+(5+this.lineStroke)+Math.round(this.lineStroke/2))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;left:"+(e.childLeft-(e.parentLeft+e.parentWidth)-20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke+1)+'position:relative;"></div>',u=(u+=g)+(s?"left:-1px;":"")+"top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(s?e.childLeft-(e.parentLeft+e.parentWidth+20)+1+this.lineStroke:e.childLeft-(e.parentLeft+e.parentWidth+20)+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SSType4"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft-10)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType4">',u=(u+=f)+"left:"+(e.childLeft-e.parentLeft)+"px;"+v,u=(u+=g)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:"+(e.childLeft-e.parentLeft)+"px;"+D,u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SSType3"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft-20)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType3">',u=(u+=f)+"left:10px;"+v,u=(u+=g)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:10px;"+D,u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(e.parentLeft-e.childLeft+21)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SSType2"===this.getParentPosition(e)&&(u=u+"left:"+n+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType2">',u=(u+=g)+"width:"+(i+1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:"+r+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=f)+"left:"+r+"px;"+this.getBorderStyles("left",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"SSType1"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft-20)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType1">',u=(u+=g)+"width:"+(e.parentLeft-e.childLeft+21)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=f)+"left:10px;"+this.getBorderStyles("left",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FFType1"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType1">',u=(u+=g)+"left:"+(s?e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)-1:e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth))+"px;width:"+(s?21+this.lineStroke:20+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(o?4:10)+"px;width:"+(o?e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+(16+this.lineStroke):e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+(10+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=m)+(o?"left:0px;":"")+this.getBorderStyles("right",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FFType2"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType2">',u=(u+=g)+(s?"left:-1px;":"")+"width:"+(s?e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(21+this.lineStroke):e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(20+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(o?e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+4:e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+10)+"px;width:"+(o?16+this.lineStroke:10+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=m)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth))+"px;"+this.getBorderStyles("right",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FFType3"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType3">',u+=y,u=(u+=g)+(o?"left:4px;width:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+16):"left:10px;width:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+10))+"px;top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+20)+"px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke+1)+'position:relative;"></div>',u=(u+=g)+(s?"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)-1)+"px;width:21":"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth))+"px;width:20")+"px;top:"+-(13+2*(this.lineStroke-1))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"FFType4"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType4">',u=(u+=m)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth))+"px;"+this.getBorderStyles("right",10)+"top:"+(-5-this.lineStroke+(this.lineStroke-1))+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',u=(u+=g)+(o?"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+4)+"px;width:"+(16+this.lineStroke):"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+10)+"px;width:"+(10+this.lineStroke))+"px;"+k,u=(u+=g)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+20)+"px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke+1)+'position:relative;"></div>',u=(u+=g)+(s?"left:-1px;width:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(21+this.lineStroke)):"width:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(20+this.lineStroke)))+"px;top:"+-(13+2*(this.lineStroke-1))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType4"===this.getParentPosition(e)&&(u=(u=u+"left:"+(e.parentLeft-10)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType4">')+w+"top:"+(-5-this.lineStroke+(this.lineStroke-1))+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',u=(u+=g)+"left:"+(o?e.childLeft+e.childWidth-e.parentLeft+(14+this.lineStroke)+"px;width:16":e.childLeft+e.childWidth-e.parentLeft+20+"px;width:"+(10+this.lineStroke))+"px;"+k,u=(u+=g)+"left:"+(e.childLeft+e.childWidth-e.parentLeft+30)+"px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.getconnectorLineGap(e)-(this.lineStroke-1))+'position:relative;"></div>',u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(e.childLeft+e.childWidth-e.parentLeft+(30+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType3"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType3">',u+=y,u=(u+=g)+(o?"left:4px;width:"+(16+this.lineStroke):"left:10px;width:"+(10+this.lineStroke))+"px;top:"+-(13+2*(this.lineStroke-1)-1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:20px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-(this.lineStroke-1))+'position:relative;"></div>',u=(u+=g)+"left:20px;top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(e.parentLeft-(e.childLeft+e.childWidth+20)+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType1"===this.getParentPosition(e)&&(u=u+"left:"+(e.parentLeft-10)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType1">',u=(u+=g)+"width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"width:"+(e.childLeft+e.childWidth-e.parentLeft+(30+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.childLeft+e.childWidth-e.parentLeft+30)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',u=(u=(u+=g)+(o?"left:"+(e.childLeft+e.childWidth-e.parentLeft+15)+"px;width:"+(15+this.lineStroke):"left:"+(e.childLeft+e.childWidth-e.parentLeft+20)+"px;width:"+(10+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>')+w+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;position:relative;"></div></div>'),"SFType2"===this.getParentPosition(e)&&(u=u+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType2">',u=(u+=g)+"left:"+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=g)+"left:"+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c-this.lineStroke)+'position:relative;"></div>',u=(u+=g)+(o?"left:4px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(14-this.lineStroke)):"left:10px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(20-this.lineStroke)))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',u=(u+=m)+"left:0px;"+this.getBorderStyles("right",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),l+=u,l+="</div>"}return l},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,p=-1!==e.childIndexInCurrentView,h=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&&p?i:p?e.childIndexInCurrentView*e.rowHeight+o:h*e.rowHeight+o):"SSType3"===t||"SSType4"===t||"FSType4"===t||"FFType3"===t||"FFType4"===t||"SFType4"===t||"SFType3"===t?(r=p?e.childIndexInCurrentView*e.rowHeight+l:0,n=d&&p?i:d?e.parentIndexInCurrentView*e.rowHeight+l:h*e.rowHeight+l):"FSType3"===t?(r=p?e.childIndexInCurrentView*e.rowHeight+o:0,n=d&&p?i:d?e.parentIndexInCurrentView*e.rowHeight+l:h*e.rowHeight+o):"SFType1"!==t&&"FSType1"!==t&&"FSType2"!==t||(r=d?e.parentIndexInCurrentView*e.rowHeight+l:0,n=d&&p?i:p?e.childIndexInCurrentView*e.rowHeight+l:h*e.rowHeight+l)}return{top:r,height:n}},e.prototype.createConnectorLineTooltipTable=function(){this.tooltipTable=t.createElement("table",{className:".e-tooltiptable",styles:"margin-top:0px",attrs:{cellspacing:"2px",cellpadding:"2px"}});var e=t.createElement("tbody");e.innerHTML="",this.tooltipTable.appendChild(e)},e.prototype.getConnectorLineTooltipInnerTd=function(e,t,i,r){var n='<tr id="fromPredecessor"><td >'+this.parent.localeObj.getConstant("from")+"</td><td> ";return n=n+e+" </td><td> "+this.parent.localeObj.getConstant(t)+" </td> </tr>",n=n+'<tr id="toPredecessor"><td>'+this.parent.localeObj.getConstant("to")+"</td><td> "+i,n=n+" </td><td> "+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){return t.isNullOrUndefined(e)?null:"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){for(var i,r=(i=!0===t.isObject(e))?Object.keys(e).length:e.length,n=Object.keys(e),a=0;a<r;a++){var s=void 0;if(i){s=e[n[a]]}else s=e[a];var o=s.ganttProperties&&s.ganttProperties.predecessor;if(o&&o.length>0)for(var l=0;l<o.length;l++){var d="parent"+o[l].from+"child"+o[l].to;this.removeConnectorLineById(d)}}},e.prototype.removeConnectorLineById=function(e){var i=this.parent.connectorLineModule.dependencyViewContainer.querySelector("#ConnectorLine"+e);t.isNullOrUndefined(i)||t.remove(i)},e}(),$t=function(){function e(e){this.parent=e,this.parent.on("destroy",this.destroy,this)}return e.prototype.renderSplitter=function(){var e=this,i=this.calculateSplitterPosition(this.parent.splitterSettings);this.parent.splitterElement=t.createElement("div",{className:"e-gantt-splitter"}),this.parent.treeGridPane=t.createElement("div",{className:"e-gantt-tree-grid-pane"}),this.parent.chartPane=t.createElement("div",{className:"e-gantt-chart-pane"}),this.parent.splitterElement.appendChild(this.parent.treeGridPane),this.parent.splitterElement.appendChild(this.parent.chartPane),this.splitterObject=new s.Splitter({height:null,width:this.parent.ganttWidth.toString(),enablePersistence:this.parent.enablePersistence,separatorSize:this.parent.splitterSettings.separatorSize,paneSettings:[{resizable:!0,size:i,min:this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum)},{resizable:!0}],orientation:"Horizontal",resizeStart:function(t){var i=t.pane[0],r=t.pane[1];e.splitterPreviousPositionGrid=i.scrollWidth+1+"px",e.splitterPreviousPositionChart=r.scrollWidth+1+"px";var a=new n.Deferred;return e.parent.trigger("splitterResizeStart",t,function(e){a.resolve(e)}),a},resizing:function(t){e.parent.trigger("splitterResizing",t)},resizeStop:function(t){var i=new n.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)),e.parent.timelineModule.updateTimelineAfterZooming(e.parent.timelineModule.timelineEndDate,!0),i.resolve(t)}),i}}),this.parent.element.appendChild(this.parent.splitterElement),this.splitterObject.appendTo(this.parent.splitterElement)},e.prototype.calculateSplitterPosition=function(e,i){return!t.isNullOrUndefined(this.splitterObject)&&this.parent.enablePersistence?this.splitterObject.paneSettings[0].size:"Grid"===e.view?"100%":"Chart"===e.view?"0%":t.isNullOrUndefined(e.position)||""===e.position?!t.isNullOrUndefined(e.columnIndex)&&e.columnIndex>=0?150*e.columnIndex<this.parent.ganttWidth||!this.parent.element.classList.contains("e-device")?i?this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(e.columnIndex).toString()+"px"):this.getSpliterPositionInPercentage(150*e.columnIndex+"px"):this.getSpliterPositionInPercentage(130*e.columnIndex+"px"):this.getSpliterPositionInPercentage("250px"):this.getSpliterPositionInPercentage(e.position)},e.prototype.getSpliterPositionInPercentage=function(e){var i=t.isNullOrUndefined(e)||""===e?null:e;if(!t.isNullOrUndefined(i))if(-1!==e.indexOf("px")){var r=parseInt(e,10);i=r/this.parent.ganttWidth*100<=100?r/this.parent.ganttWidth*100+"%":"25%"}else i=-1===e.indexOf("%")?e+"%":e;return i},e.prototype.getTotalColumnWidthByIndex=function(e){var t=0,i=this.parent.treeGrid.element.querySelectorAll(".e-headercell");e=i.length>e?e:i.length;for(var r=0;r<e;r++)t+=i[r].offsetWidth;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,!0);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}(),ei=function(){function e(e){this.parent=e,this.createTooltip(),this.parent.on("destroy",this.destroy,this)}return e.prototype.createTooltip=function(){this.toolTipObj=new i.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.enableHtmlSanitizer=!1,this.toolTipObj.cssClass="e-gantt-tooltip",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 i=this.parent;if(i.isOnEdit)e.cancel=!0;else{var r,a=t.closest(e.target,"div."+F);r=t.isNullOrUndefined(a)?g(e.target,_):e.target;var s,o={data:{},args:e,cancel:!1,content:""};if(e.target.classList.contains("e-header-cell-label"))i.timelineSettings.showTooltip?o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("timeline",s,i,e):e.cancel=!0;else if(i.tooltipSettings.showTooltip)if(r&&(o.data=i.ganttChartModule.getRecordByTaskBar(r),s=o.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")&&i.tooltipSettings.taskbar){var l=void 0;i.tooltipSettings.taskbar&&(l=i.tooltipModule.templateCompiler(i.tooltipSettings.taskbar,i,s,"TooltipTaskbarTemplate")),o.content=this.toolTipObj.content=l?l[0]:i.tooltipModule.getTooltipContent(s.ganttProperties.isMilestone?"milestone":"taskbar",s,i,e)}else if(e.target.classList.contains("e-baseline-bar")||e.target.classList.contains("e-baseline-gantt-milestone")){var d=void 0;i.tooltipSettings.baseline&&(d=i.tooltipModule.templateCompiler(i.tooltipSettings.baseline,i,s,"TooltipBaselineTemplate")),o.content=this.toolTipObj.content=d?d[0]:i.tooltipModule.getTooltipContent(s.ganttProperties.isMilestone?"milestone":"baseline",s,i,e)}else if(e.target.classList.contains("e-event-markers"))o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("marker",s,i,e);else if(e.target.classList.contains("e-connector-line-container")){var p=void 0;i.tooltipModule.predecessorTooltipData=i.tooltipModule.getPredecessorTooltipData(e),o.data=this.predecessorTooltipData,i.tooltipSettings.connectorLine&&(p=i.tooltipModule.templateCompiler(i.tooltipSettings.connectorLine,i,i.tooltipModule.predecessorTooltipData,"TooltipConnectorLineTemplate")),o.content=this.toolTipObj.content=p?p[0]:i.tooltipModule.getTooltipContent("connectorLine",s,i,e)}else if(e.target.classList.contains("e-indicator-span"))o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("indicator",s,i,e),t.isNullOrUndefined(o.content)&&(e.cancel=!0);else if(e.target.classList.contains("e-notes-info")){var h=this.parent.ganttChartModule.getRecordByTarget(e.event);o.content=this.toolTipObj.content=h.ganttProperties.notes,t.isNullOrUndefined(o.content)&&(e.cancel=!0)}else e.target.classList.contains("e-gantt-manualparenttaskbar")?(o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("manualtaskbar",s,i,e),t.isNullOrUndefined(o.content)&&(e.cancel=!0)):e.target.classList.contains("e-gantt-manualparent-milestone")&&(o.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("manualmilestone",s,i,e),t.isNullOrUndefined(o.content)&&(e.cancel=!0));else e.cancel=!0;if(!1===e.cancel){var c=new n.Deferred;return i.trigger("beforeTooltipRender",o,function(t){c.resolve(t),t.cancel&&(e.cancel=!0)}),this.parent.isAdaptive||"mouseover"!==e.event.type||(this.currentTarget=e.target,t.EventHandler.add(this.currentTarget,"mousemove",this.mouseMoveHandler.bind(this))),this.parent.renderTemplates(),c}}},e.prototype.tooltipCloseHandler=function(e){this.tooltipMouseEvent=null,this.parent.isAdaptive||t.EventHandler.remove(this.currentTarget,"mousemove",this.mouseMoveHandler),this.currentTarget=null},e.prototype.mouseMoveHandler=function(e){this.tooltipMouseEvent=e},e.prototype.updateTooltipPosition=function(e){if(e.element.style.visibility="visible",!t.isNullOrUndefined(this.tooltipMouseEvent)&&!e.target.classList.contains("e-notes-info")){var i=this.getPointorPosition(this.tooltipMouseEvent),r=this.parent.getOffsetRect(this.parent.chartPane),n=r.top+this.parent.chartPane.offsetHeight,a=r.left+this.parent.chartPane.offsetWidth,s=i.x,o=i.y;if(a<s+e.element.offsetWidth+10)for(;a<s+e.element.offsetWidth+10;)s=a-e.element.offsetWidth-10,e.element.style.left=s+"px";else s+=10,e.element.style.left=s+"px";window.innerHeight<e.element.offsetHeight+o&&(o=o-e.element.offsetHeight-10),n<o+e.element.offsetHeight+20?o=o-e.element.offsetHeight-10:o+=10,e.element.style.top=o+"px"}},e.prototype.getPointorPosition=function(e){var i,r;return t.isNullOrUndefined(t.getValue("pageX",e))&&t.isNullOrUndefined(t.getValue("pageY",e))?t.isNullOrUndefined(t.getValue("clientX",e))&&t.isNullOrUndefined(t.getValue("clientY",e))||(i=t.getValue("clientX",e)+document.body.scrollLeft+document.documentElement.scrollLeft,r=t.getValue("clientY",e)+document.body.scrollTop+document.documentElement.scrollTop):(i=t.getValue("pageX",e),r=t.getValue("pageY",e)),{x:i,y:r}},e.prototype.getTooltipContent=function(e,i,r,n){var a,s,o;switch(i&&(s=i.ganttProperties,o=t.isNullOrUndefined(s.taskName)?"":'<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">'+(this.parent.disableHtmlEncode?s.taskName.replace(/</g,"<").replace(/>/g,">"):s.taskName)+"</td></tr>"),e){case"milestone":var l=void 0;n.target.className.includes("e-baseline-gantt-milestone")&&!t.isNullOrUndefined(s.baselineStartDate)?l=s.baselineStartDate:t.isNullOrUndefined(s.startDate)||(l=s.startDate);a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(t.isNullOrUndefined(l)?"":'<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(l,this.parent.getDateFormat())+"</td></tr>")+"</tbody></table>";break;case"taskbar":var d=!(i.hasChildRecords&&!s.isAutoSchedule);a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(s.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(d?"startDate":"subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(d?s.startDate:s.autoStartDate,this.parent.getDateFormat())+"</td></tr>":"")+(s.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(d?"endDate":"subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(d?s.endDate:s.autoEndDate,this.parent.getDateFormat())+"</td></tr>":"")+(t.isNullOrUndefined(s.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getDurationString(d?s.duration:s.autoDuration,s.durationUnit)+"</td></tr>")+(t.isNullOrUndefined(s.progress)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+"</td><td>:</td><td>"+s.progress+"</td></tr>")+"</tbody></table>";break;case"baseline":a='<table class = "e-gantt-tooltiptable"><tbody>'+o+'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.baselineStartDate,this.parent.getDateFormat())+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.baselineEndDate,this.parent.getDateFormat())+"</td></tr></tbody></table>";break;case"marker":var p=r.tooltipModule.getMarkerTooltipData(n),h=p.label?p.label:"";a='<table class = "e-gantt-tooltiptable"><tbody><tr><td>'+this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(p.day),this.parent.getDateFormat())+"</td></tr><tr><td>"+h+"</td></tr></tbody></table>";break;case"connectorLine":a='<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">'+r.tooltipModule.predecessorTooltipData.fromName+" ("+r.tooltipModule.predecessorTooltipData.fromId+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("to")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.tooltipModule.predecessorTooltipData.toName+" ("+r.tooltipModule.predecessorTooltipData.toId+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("taskLink")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+r.tooltipModule.predecessorTooltipData.linkText+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("lag")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.tooltipModule.predecessorTooltipData.offsetString+"</td></tr></tbody></table>";break;case"indicator":n.target.title.length&&(a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+n.target.title+"</tr></tbody></table>");break;case"timeline":a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+n.target.title+"</tr></tbody></table>";break;case"manualtaskbar":var c=s.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(s.autoStartDate,this.parent.getDateFormat())+"</td></tr>":"",u=s.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.autoEndDate,this.parent.getDateFormat())+"</td></tr>":"",g=t.isNullOrUndefined(s.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getDurationString(s.duration,s.durationUnit)+"</td></tr>";a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(s.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(s.startDate,this.parent.getDateFormat())+"</td></tr>":"")+c+(s.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.endDate,this.parent.getDateFormat())+"</td></tr>":"")+u+g+"</tbody></table>";break;case"manualmilestone":var f=s.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(s.autoStartDate,this.parent.getDateFormat())+"</td></tr>":"",m=s.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.autoEndDate,this.parent.getDateFormat())+"</td></tr>":"";a='<table class = "e-gantt-tooltiptable"><tbody>'+o+('<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(s.startDate,this.parent.getDateFormat())+"</tr>")+f+m+"</tbody></table>"}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,i,r=e.target.parentElement.id.match(/\d+/g);"ResourceView"===this.parent.viewType?(t=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[0])],i=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[1])]):(t=this.parent.flatData[this.parent.ids.indexOf(r[0])],i=this.parent.flatData[this.parent.ids.indexOf(r[1])]);var n=t.ganttProperties.predecessor.filter(function(e){return e.to===r[1]});return{fromId:"ResourceView"===this.parent.viewType?t.ganttProperties.taskId:t.ganttProperties.rowUniqueID,toId:"ResourceView"===this.parent.viewType?i.ganttProperties.taskId:i.ganttProperties.rowUniqueID,fromName:t.ganttProperties.taskName,toName:i.ganttProperties.taskName,linkType:n[0].type,linkText:this.parent.getPredecessorTextValue(n[0].type),offset:n[0].offset,offsetUnit:n[0].offsetUnit,offsetString:this.parent.getDurationString(n[0].offset,n[0].offsetUnit)}},e.prototype.templateCompiler=function(e,i,r,n){var a=i.chartRowsModule.templateCompiler(e),s=i.chartRowsModule.getTemplateID(n);return a(t.extend({index:0},r),i,n,s,!0)},e.prototype.destroy=function(){this.toolTipObj.destroy()},e}(),ti=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 i=this.parent,r=i.getExpandedRecords(i.currentViewData);if(t.isNullOrUndefined(this.parent.focusModule.getActiveElement())&&("expandAll"===e.action||"collapseAll"===e.action)){this.parent.element.querySelector(".e-treegrid").focus()}var n=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||t.isNullOrUndefined(i.editModule)||t.isNullOrUndefined(i.editModule.cellEditModule)||!0!==i.editModule.cellEditModule.isCellEdit)switch(i.isAdaptive&&("addRowDialog"!==e.action&&"editRowDialog"!==e.action&&"delete"!==e.action&&"addRow"!==e.action||i.selectionModule&&"Multiple"===i.selectionSettings.type&&(i.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),e.action){case"home":if(i.selectionModule&&"Cell"!==i.selectionSettings.mode){if(0===i.selectedRowIndex)return;i.selectionModule.selectRow(0,!1,!0)}break;case"end":if(i.selectionModule&&"Cell"!==i.selectionSettings.mode){var a=r[r.length-1];if(i.selectedRowIndex===i.flatData.indexOf(a))return;i.selectionModule.selectRow(i.flatData.indexOf(a),!1,!0)}break;case"downArrow":case"upArrow":(f=i.element.querySelector("#"+i.element.id+"_searchbar"))&&f.parentElement.classList.contains("e-input-focus")&&i.selectionModule.clearSelection(),i.element.classList.contains("e-scroll-disabled")||(this.upDownKeyNavigate(e),t.isNullOrUndefined(n)||t.isNullOrUndefined(n.closest(".e-chart-row"))||i.ganttChartModule.manageFocus(this.getActiveElement(),"remove",!0));break;case"expandAll":i.ganttChartModule.expandCollapseAll("expand");break;case"collapseAll":i.ganttChartModule.expandCollapseAll("collapse");break;case"expandRow":case"collapseRow":this.expandCollapseKey(e);break;case"saveRequest":if(!t.isNullOrUndefined(i.editModule)&&!t.isNullOrUndefined(i.editModule.cellEditModule)&&i.editModule.cellEditModule.isCellEdit){var s=i.editModule.cellEditModule.editedColumn;if(s.field===i.columnMapping.duration&&!t.isNullOrUndefined(s.edit)&&!t.isNullOrUndefined(s.edit.read)){var o=e.target.ej2_instances[0],l=e.target.value,d=i.currentViewData[i.selectedRowIndex].ganttProperties;s.field===i.columnMapping.duration&&l!==(t.isNullOrUndefined(s.edit)||t.isNullOrUndefined(s.edit.read)?t.isNullOrUndefined(s.valueAccessor)?i.dataOperation.getDurationString(d.duration,d.durationUnit):s.valueAccessor(i.columnMapping.duration,i.editedRecords,s):s.edit.read()).toString()&&(o.value=l,o.dataBind())}if(i.editModule.dialogModule.dialogObj&&t.getValue("dialogOpen",i.editModule.dialogModule.dialogObj))return;i.editModule.cellEditModule.isCellEdit=!1,i.treeGrid.grid.saveCell();i.element.querySelector(".e-treegrid").focus()}if(!t.isNullOrUndefined(this.parent.onTaskbarClick)&&!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(n.closest(".e-chart-row"))){var p=e.target,h=n.querySelector(".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");h&&this.parent.ganttChartModule.onTaskbarClick(e,p,h)}break;case"cancelRequest":t.isNullOrUndefined(i.editModule)||t.isNullOrUndefined(i.editModule.cellEditModule)||(i.editModule.cellEditModule.isCellEdit=!1,t.isNullOrUndefined(i.toolbarModule)||i.toolbarModule.refreshToolbarItems());break;case"addRow":if(t.isNullOrUndefined(document.getElementById(this.parent.element.id+"_dialog"))){e.preventDefault(),i.addRecord(void 0,this.parent.editSettings.newRowPosition);i.element.focus()}break;case"addRowDialog":if(e.preventDefault(),i.editModule&&i.editModule.dialogModule&&i.editSettings.allowAdding){if(i.editModule.dialogModule.dialogObj&&t.getValue("dialogOpen",i.editModule.dialogModule.dialogObj))return;i.editModule.dialogModule.openAddDialog()}break;case"editRowDialog":e.preventDefault();if(i.element.querySelector(".e-treegrid").focus(),i.editModule&&i.editModule.dialogModule&&i.editSettings.allowEditing){if(i.editModule.dialogModule.dialogObj&&t.getValue("dialogOpen",i.editModule.dialogModule.dialogObj))return;i.editModule.dialogModule.openToolbarEditDialog()}break;case"delete":i.selectionModule&&i.editModule&&i.editModule.dialogModule&&(!i.editModule.dialogModule.dialogObj||i.editModule.dialogModule.dialogObj&&!i.editModule.dialogModule.dialogObj.visible)&&(!i.editSettings.allowTaskbarEditing||i.editSettings.allowTaskbarEditing&&!i.editModule.taskbarEditModule.touchEdit)&&("Cell"!==i.selectionSettings.mode&&i.selectionModule.selectedRowIndexes.length||"Cell"===i.selectionSettings.mode&&i.selectionModule.getSelectedRowCellIndexes().length)&&i.editModule.startDeleteAction();break;case"focusTask":e.preventDefault();var c=void 0;if(i.selectionModule){var u=i.currentViewData;if("Cell"===i.selectionSettings.mode||t.isNullOrUndefined(u[i.selectedRowIndex])){if("Cell"===i.selectionSettings.mode&&i.selectionModule.getSelectedRowCellIndexes().length>0){var g=i.selectionModule.getSelectedRowCellIndexes();c=u[g[g.length-1].rowIndex].ganttProperties.rowUniqueID}}else c=i.currentViewData[i.selectedRowIndex].ganttProperties.rowUniqueID}c&&i.scrollToTask(c.toString());break;case"focusSearch":if(i.element.querySelector("#"+i.element.id+"_searchbar")){var f;(f=i.element.querySelector("#"+i.element.id+"_searchbar")).setAttribute("tabIndex","-1"),f.focus()}break;case"tab":case"shiftTab":i.element.classList.contains("e-scroll-disabled")||i.ganttChartModule.onTabAction(e);break;case"contextMenu":var m=document.getElementById(this.parent.element.id+"_contextmenu").ej2_instances[0],y=this.parent.getOffsetRect(e.target),v=y.top+y.height/2,D=y.left+y.width/2;this.setActiveElement(e.target),m.open(v,D),e.preventDefault();break;default:var w={requestType:"keyPressed",action:e.action,keyEvent:e};i.trigger("actionComplete",w)}},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,a=n>-1?n:i.indexOf(r),s="downArrow"===e.action?i[a+1]:i[a-1];t.selectionModule.selectRow(t.currentViewData.indexOf(s),!1,!0)}else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var o=t.selectionModule.getSelectedRowCellIndexes(),l=o[o.length-1],d=l.cellIndexes[l.cellIndexes.length-1],p=(r=t.currentViewData[l.rowIndex],a=i.indexOf(r),s="downArrow"===e.action?i[a+1]:i[a-1],{rowIndex:t.currentViewData.indexOf(s),cellIndex:d});t.selectionModule.selectCell(p)}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}(),ii=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)}}(),ri=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},ni=function(e){function n(i,r){var n=e.call(this,i,r)||this;return n.isCancelled=!1,n.previousRecords={},n.editedRecords=[],n.modifiedRecords=[],n.isOnEdit=!1,n.isOnDelete=!1,n.isExpandCollapseLevelMethod=!1,n.isDynamicData=!1,n.isConnectorLineUpdate=!1,n.staticSelectedRowIndex=-1,n.needsID=!0,n.showActiveElement=!0,n.addDeleteRecord=!1,n.enableHeaderFocus=!0,n.enableValidation=!0,n.isTreeGridRendered=!1,n.isFromOnPropertyChange=!1,n.isGanttChartRendered=!1,n.isEdit=!1,t.setValue("mergePersistData",n.mergePersistGanttData,n),n}return ii(n,e),n.prototype.getModuleName=function(){return"gantt"},n.prototype.preRender=function(){this.initProperties()},n.prototype.initProperties=function(){this.globalize=new t.Internationalization(this.locale),this.isAdaptive=t.Browser.isDevice,this.flatData=[],this.currentViewData=[],this.updatedRecords=[],this.ids=[],this.ganttColumns=[],this.localeObj=new t.L10n(this.getModuleName(),this.getDefaultLocale(),this.locale),this.dataOperation=new O(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 Ye(this),this.timelineModule=new Qe(this),this.chartRowsModule=new Qt(this),this.treeGridModule=new Je(this),this.dateValidationModule=new M(this),this.predecessorModule=new Kt(this),this.connectorLineModule=new Jt(this),this.splitterModule=new $t(this),this.tooltipModule=new ei(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 ti(this),this.zoomingLevels=this.getZoomingLevels(),this.resourceFieldsMapping(),t.isNullOrUndefined(this.resourceFields.unit)&&(this.resourceFields.unit="unit"),t.isNullOrUndefined(this.taskFields.work)||(this.taskType="FixedWork"),this.taskIds=[]},n.prototype.getDateFormat=function(){if(t.isNullOrUndefined(this.dateFormat)){return this.globalize.getDatePattern({skeleton:"yMd"})}return this.dateFormat},n.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())},n.prototype.isInDst=function(e){return e.getTimezoneOffset()<this.getDefaultTZOffset()},n.prototype.resourceFieldsMapping=function(){var e=this.resourceFields;e.id=t.isNullOrUndefined(e.id)?this.resourceIDMapping:e.id,e.name=t.isNullOrUndefined(e.name)?this.resourceNameMapping:e.name},n.prototype.validateDimentionValue=function(e){return t.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()},n.prototype.calculateDimensions=function(){var e=this.validateDimentionValue(this.height),i=this.validateDimentionValue(this.width);t.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(i=this.width);var r=this.element.style.height,n=this.element.style.width;i&&(this.element.style.width=i),e&&(this.element.style.height=e),e||r||(this.element.style.height="auto"),i||n||(this.element.style.width="auto"),this.ganttHeight=this.element.offsetHeight,this.ganttWidth=this.element.offsetWidth},n.prototype.render=function(){this.isReact&&(this.treeGrid.isReact=!0,this.treeGrid.grid.isReact=!0),i.createSpinner({target:this.element},this.createElement),this.trigger("load",{}),this.element.classList.add("e-gantt"),this.isAdaptive?this.element.classList.add("e-device"):this.element.classList.remove("e-device"),this.calculateDimensions(),t.isNullOrUndefined(this.toolbarModule)||this.renderToolbar(),this.splitterModule.renderSplitter(),this.notify("renderPanels",null),this.showSpinner(),this.dataOperation.checkDataBinding()},n.prototype.showSpinner=function(){i.showSpinner(this.element)},n.prototype.hideSpinner=function(){i.hideSpinner(this.element)},n.prototype.processTimeline=function(){this.timelineModule.processTimelineUnit(),this.timelineModule.calculateZoomingLevelsPerDayWidth()},n.prototype.renderGantt=function(e){if(this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors(),this.isInPredecessorValidation&&this.enableValidation&&this.predecessorModule.updatedRecordsDateByPredecessor()),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp()),e)if(this.isFromOnPropertyChange=e,this.enableValidation&&this.dataOperation.updateGanttData(),this.dataSource instanceof Object&&m(this)){var i=t.getValue("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:i}}else this.treeGrid.setProperties({dataSource:this.flatData},!1);else this.enableValidation&&this.dataOperation.updateGanttData(),this.treeGridPane.classList.remove("e-temp-content"),t.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.splitterModule.updateSplitterPosition(),"Vertical"!==this.gridLines&&"Both"!==this.gridLines||this.renderChartVerticalLines()},n.prototype.wireEvents=function(){this.allowKeyboard&&(this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfig,eventName:"keydown"})),t.EventHandler.add(window,"resize",this.windowResize,this)},n.prototype.windowResize=function(){if(!t.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)),this.enableCriticalPath)){var e=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds)}},n.prototype.keyActionHandler=function(e){this.focusModule.onKeyPress(e)},n.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}},n.prototype.renderToolbar=function(){t.isNullOrUndefined(this.toolbarModule)||(this.toolbarModule.renderToolbar(),this.toolbarModule.refreshToolbarItems())},n.prototype.renderTreeGrid=function(){this.treeGridModule.renderTreeGrid()},n.prototype.updateCurrentViewData=function(){this.currentViewData=this.treeGrid.getCurrentViewRecords().slice()},n.prototype.getRecordFromFlatdata=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getTaskByUniqueID(e[i].uniqueID));return t},n.prototype.updateContentHeight=function(e){if(this.virtualScrollModule&&this.enableVirtualization&&!t.isNullOrUndefined(e)){var i=t.getValue("result.length",e);this.contentHeight=i*this.rowHeight}else{var r=this.virtualScrollModule&&this.enableVirtualization?this.currentViewData:this.getExpandedRecords(this.currentViewData),n=void 0,a=t.isNullOrUndefined(this.ganttChartModule.getChartRows())?null:this.ganttChartModule.getChartRows()[0];n=!t.isNullOrUndefined(a)&&a.getBoundingClientRect().height>0?a.getBoundingClientRect().height:this.rowHeight,this.contentHeight=r.length*n}},n.prototype.getExpandStatus=function(e){var i=this.getParentTask(e.parentItem);if(t.isNullOrUndefined(i))return!0;if(!1===i.expanded)return!1;if(i.parentItem){return!1!==this.getParentTask(i.parentItem).expanded&&this.getExpandStatus(this.getParentTask(i.parentItem))}return!0},n.prototype.getExpandedRecords=function(e){var i=this;if(t.isNullOrUndefined(e))return[];return e.filter(function(e){return!0===i.getExpandStatus(e)})},n.prototype.getZoomingLevels=function(){return[{topTier:{unit:"Year",format:"yyyy",count:50},bottomTier:{unit:"Year",format:"yyyy",count:10},timelineUnitSize:99,level:0,timelineViewMode:"Year",weekStartDay:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,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:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0}]},n.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"},n.prototype.displayHalfValue=function(e){var t=e.getMonth();return t>=0&&t<=5?"H1":"H2"},n.prototype.getFormatedDate=function(e,i){return t.isNullOrUndefined(e)?null:(t.isNullOrUndefined(i)&&(i=this.getDateFormat()),this.globalize.formatDate(e,{format:i}))},n.prototype.getDurationString=function(e,t){return this.dateValidationModule.getDurationString(e,t)},n.prototype.getWorkString=function(e,t){return this.dateValidationModule.getWorkString(e,t)},n.prototype.updateTreeColumns=function(){var e,i=this.treeGrid.grid.getColumns();-1!==this.treeColumnIndex&&this.columns[this.treeColumnIndex]&&!t.isNullOrUndefined(this.columns[this.treeColumnIndex].template)&&(e=this.columns[this.treeColumnIndex].template,this.columns[this.treeColumnIndex].field);for(var r,n=0;n<i.length;n++){r={};for(var a=0;a<this.columns.length;a++)if(this.columns[a].field==i[n].field){for(var s=0,o=Object.keys(this.columns[a]);s<o.length;s++){var l=o[s];t.isUndefined(this.columns[a][l])||(r[l]=i[n][l]),r.visible=i[n].visible,r.width=i[n].width}this.columns[a]=r,"checkbox"===this.columns[a].type||t.isNullOrUndefined(e)||""===e||(this.columns[a].template=e)}}this.columns.length>0&&this.treeGrid.setProperties({columns:this.columns},!0)},n.prototype.treeDataBound=function(e){this.element.getElementsByClassName("e-chart-root-container")[0].style.height="100%";this.element.getElementsByClassName("e-gridcontent")[0].style.height;var i=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight;if("calc(100% - "+i+"px)",this.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+i+"px)",t.isNullOrUndefined(this.toolbarModule)||t.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;t.isNullOrUndefined(this.toolbarModule)||t.isNullOrUndefined(this.toolbarModule.element)||this.toolbarModule.element.offsetHeight,this.timelineModule.isSingleTier?(t.addClass(this.treeGrid.element.querySelectorAll(".e-headercell"),x),t.addClass(this.treeGrid.element.querySelectorAll(".e-columnheader"),x)):(t.removeClass(this.treeGrid.element.querySelectorAll(".e-headercell"),x),t.removeClass(this.treeGrid.element.querySelectorAll(".e-columnheader"),x)),this.treeGrid.height="100%",this.notify("tree-grid-created",{}),this.createGanttPopUpElement(),this.hideSpinner(),t.setValue("isGanttCreated",!0,e),this.renderComplete()}}else this.getCurrentRecords(e);if(this.enableCriticalPath&&this.criticalPathModule&&this.criticalPathModule.showCriticalPath(this.enableCriticalPath),this.notify("recordsUpdated",{}),this.enableCriticalPath&&this.criticalPathModule){var r=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(r.criticalPathCollection,r.detailPredecessorCollection,!0,r.predecessorCollectionTaskIds)}this.initialChartRowElements=this.ganttChartModule.getChartRows(),this.isLoad=!1,this.trigger("dataBound",e)},n.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())},n.prototype.onPropertyChanged=function(e,i){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=r.getActualProperties(this.columnMenuItems);break;case"eventMarkers":case"highlightWeekends":this.notify("ui-update",{module:"day-markers",properties:e});break;case"sortSettings":this.treeGrid.sortSettings=r.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":case"enableCriticalPath":this.dataOperation.checkDataBinding(!0);break;case"filterSettings":this.treeGrid.filterSettings=r.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=r.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=r.getActualProperties(this.searchSettings),this.treeGrid.grid.dataBind()),this.treeGrid.searchSettings=r.getActualProperties(this.searchSettings),this.treeGrid.dataBind(),this.toolbarModule&&this.toolbarModule.updateSearchTextBox();break;case"labelSettings":case"renderBaseline":case"baselineColor":this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"resourceIDMapping":case"resourceNameMapping":case"resources":this.dataOperation.reUpdateResources(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"includeWeekend":case"dayWorkingTime":case"allowUnscheduledTasks":case"holidays":"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();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,t.isNullOrUndefined(this.editModule)||this.editModule.reUpdateEditModules(),t.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.dataOperation.calculateProjectDates(),this.updateProjectDates(this.cloneProjectStartDate,this.cloneProjectEndDate,this.isTimelineRoundOff);break;case"selectedRowIndex":t.isNullOrUndefined(this.selectionModule)||this.selectionModule.selectRowByIndex();break;case"dataSource":if(this.closeGanttActions(),this.dataSource instanceof Object&&m(this)){this.treeGrid.hasChildMapping="isParent";var l=t.getValue("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:l}}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":n=!0;break;case"validateManualTasksOnLinking":this.validateManualTasksOnLinking=e.validateManualTasksOnLinking;break;case"showOverAllocation":this.updateOverAllocationCotainer()}}n&&this.refresh()},n.prototype.updateOverAllocationCotainer=function(){if(this.showOverAllocation&&"ResourceView"===this.viewType)this.ganttChartModule.renderOverAllocationContainer();else{var e=this.element.querySelector("."+ze);e&&(e.innerHTML="")}},n.prototype.getPersistData=function(){for(var e=["sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","currentZoomingLevel","cloneProjectStartDate","cloneProjectEndDate"],i={filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[]},r=0;r<e.length;r++)for(var n=this[e[r]],a=0,s=i[e[r]];!t.isNullOrUndefined(s)&&a<s.length;a++){delete n[s[a]]}return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},n.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)this.ignoreInColumn(e,t[i])},n.prototype.ignoreInColumn=function(e,t){for(var i=0;i<e.length;i++)delete t[e[i]],t.filter={}},n.prototype.destroy=function(){this.notify("destroy",{}),t.isNullOrUndefined(this.validationDialogElement)||this.validationDialogElement.isDestroyed||this.validationDialogElement.destroy();for(var i=["ganttChartModule","timelineModule","chartRowsModule","treeGridModule","ganttDataUpdatesModule","dateValidationModule","tooltipModule"],r=0;r<i.length;r++)this[i[r]]&&(this[i[r]]=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="",t.removeClass([this.element],"e-gantt"),this.element.innerHTML="",this.isTreeGridRendered=!1,this.resetTemplates(),t.EventHandler.remove(window,"resize",this.windowResize)},n.prototype.getTaskbarHeight=function(){return this.chartRowsModule.taskBarHeight},n.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&&e.push({member:"rowDragAndDrop",args:[this]}),this.enableCriticalPath&&e.push({member:"criticalPath",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),this.toolbar&&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)},n.prototype.sortColumn=function(e,t,i){this.sortModule&&this.allowSorting&&this.sortModule.sortColumn(e,t,i)},n.prototype.mergePersistGanttData=function(){this.treeGrid||(this.treeGrid=new a.TreeGrid);this.treeGrid.grid.mergePersistGridData.apply(this)},n.prototype.mergeColumns=function(e,t){this.treeGrid.grid.mergeColumns.apply(this,[e,t])},n.prototype.clearSorting=function(){this.sortModule.clearSorting()},n.prototype.renderChartGridLines=function(){var e="e-chart-row-border",i=this.chartVerticalLineContainer,r=document.getElementById(this.element.id+"GanttTaskTableBody").querySelectorAll("td");if("Vertical"===this.gridLines){if(t.isNullOrUndefined(i)?this.renderChartVerticalLines():"none"===i.style.display&&(i.style.display="block"),r[0].classList.contains(e))for(var n=0;n<r.length;n++)t.removeClass([r[n]],e)}else if("Horizontal"===this.gridLines){if(t.isNullOrUndefined(i)||(i.style.display="none"),!r[0].classList.contains(e))for(n=0;n<r.length;n++)t.addClass([r[n]],e)}else if("Both"===this.gridLines){if(t.isNullOrUndefined(i)?this.renderChartVerticalLines():"none"===i.style.display&&(i.style.display="block"),!r[0].classList.contains(e))for(n=0;n<r.length;n++)t.addClass([r[n]],e)}else if("None"===this.gridLines&&(t.isNullOrUndefined(i)||"none"===i.style.display||(i.style.display="none"),r[0].classList.contains(e)))for(n=0;n<r.length;n++)t.removeClass([r[n]],e)},n.prototype.updateGridLineContainerHeight=function(){this.chartVerticalLineContainer&&(this.chartVerticalLineContainer.style.height=t.formatUnit(this.getContentHeight()))},n.prototype.getContentHeight=function(){var e=this.ganttChartModule.scrollElement.offsetHeight-16,t=this.ganttChartModule.chartBodyContent.offsetHeight;return t<e?t:e},n.prototype.reUpdateDimention=function(){var e=0;if(this.calculateDimensions(),t.isNullOrUndefined(this.toolbarModule)||t.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(),t.isNullOrUndefined(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer.style.height=this.ganttHeight+"px"),!t.isNullOrUndefined(this.dayMarkersModule)){var i=t.getValue("nonworkingDayRender.holidayContainer",this.dayMarkersModule),r=t.getValue("nonworkingDayRender.weekendContainer",this.dayMarkersModule),n=t.getValue("eventMarkerRender.eventMarkersContainer",this.dayMarkersModule);i&&(i.style.height=this.ganttHeight+"px"),r&&(r.style.height=this.ganttHeight+"px"),n&&(n.style.height=this.ganttHeight+"px")}this.splitterModule.splitterObject.width=this.ganttWidth.toString(),this.ganttChartModule.scrollObject.setHeight(this.ganttHeight-this.ganttChartModule.chartTimelineContainer.offsetHeight-e)},n.prototype.renderChartVerticalLines=function(){this.element.contains(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer=t.createElement("div",{id:this.element.id+"line-container",styles:"position:absolute;height:100%;z-index:1"}),this.ganttChartModule.chartBodyContent.appendChild(this.chartVerticalLineContainer)),this.chartVerticalLineContainer.innerHTML="";var e=this.element.getElementsByClassName("e-timeline-header-table-container")[1];t.isNullOrUndefined(e)&&(e=this.element.getElementsByClassName("e-timeline-header-table-container")[0]);for(var i,r=e.getElementsByTagName("th"),n=r.length,a=0,s=t.createElement("div"),o=0;o<n;o++){a=0===o?-1:a+parseFloat(i),i=r[o].style.width;var l=t.createElement("div",{className:"e-line-container-cell",styles:"left:"+a+"px"});s.appendChild(l)}this.chartVerticalLineContainer.innerHTML=s.innerHTML},n.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"}},n.prototype.removeSortColumn=function(e){this.sortModule.removeSortColumn(e)},n.prototype.actionBeginTask=function(e){this.trigger("actionBegin",e)},n.prototype.scrollToDate=function(e){var t=this.dateValidationModule.getDateFromFormat(e),i=this.dataOperation.getTaskLeft(t,!1);this.ganttChartModule.updateScrollLeft(i)},n.prototype.scrollToTask=function(e){if(-1!==this.ids.indexOf(e)){var t=this.flatData[this.ids.indexOf(e)].ganttProperties.left;this.ganttChartModule.updateScrollLeft(t)}},n.prototype.updateChartScrollOffset=function(e,i){t.isNullOrUndefined(e)||(e=this.ganttChartModule.scrollElement.scrollWidth<=e?this.ganttChartModule.scrollElement.scrollWidth:e,this.ganttChartModule.scrollObject.setScrollLeft(e)),t.isNullOrUndefined(i)||(i=this.ganttChartModule.scrollElement.scrollHeight<=i?this.ganttChartModule.scrollElement.scrollHeight:i,this.ganttChartModule.scrollObject.setScrollTop(i))},n.prototype.getParentTask=function(e){if(t.isNullOrUndefined(e))return null;var i=this.flatData.filter(function(t){return e.uniqueID===t.uniqueID});return i.length>0?i[0]:null},n.prototype.getRootParent=function(e,t){return e.level===t?e:this.getRootParent(this.getParentTask(e.parentItem),t)},n.prototype.filterByColumn=function(e,t,i,r,n,a){this.treeGrid.filterByColumn(e,t,i,r,n,a)},n.prototype.excelExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.excelExport(e,t,i,r):null},n.prototype.csvExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.csvExport(e,t,i,r):null},n.prototype.pdfExport=function(e,t,i){return this.pdfExportModule?this.pdfExportModule.export(e,t,i):null},n.prototype.clearFiltering=function(e){this.treeGrid.grid.clearFiltering(e)},n.prototype.removeFilteredColsByField=function(e){this.treeGrid.removeFilteredColsByField(e,!1)},n.prototype.renderWorkingDayCell=function(e){var t="Auto"!==this.taskMode||!!this.includeWeekend?[]:this.nonWorkingDayIndex,i=this.totalHolidayDates;if(t.length>0&&-1!==t.indexOf(e.date.getDay()))e.isDisabled=!0;else if(i.length>0){var r=new Date(e.date.getTime());r.setHours(0,0,0),-1!==i.indexOf(r.getTime())&&(e.isDisabled=!0)}},n.prototype.previousTimeSpan=function(e){this.timelineModule.performTimeSpanAction("prevTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},n.prototype.nextTimeSpan=function(e){this.timelineModule.performTimeSpanAction("nextTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},n.prototype.updateProjectDates=function(e,i,r,n){this.timelineModule.totalTimelineWidth=0,this.cloneProjectStartDate=e,this.cloneProjectEndDate=i,this.isTimelineRoundOff=r,this.timelineModule.refreshTimelineByTimeSpan(),this.dataOperation.reUpdateGanttDataPosition(),this.timelineModule.updateChartByNewTimeline(),this.ganttChartModule.chartBodyContent.style.width=t.formatUnit(this.timelineModule.totalTimelineWidth),this.ganttChartModule.updateLastRowBottomWidth(),"Vertical"!==this.gridLines&&"Both"!==this.gridLines||this.renderChartVerticalLines(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines(),"beforeAdd"!==n&&this.notify("selectRowByIndex",{})},n.prototype.splitTask=function(e,t){this.isEdit=!0,this.chartRowsModule.splitTask(e,t)},n.prototype.mergeTask=function(e,t){this.chartRowsModule.mergeTask(e,t)},n.prototype.reorderColumns=function(e,t){this.treeGrid.reorderColumns(e,t)},n.prototype.initiateEditAction=function(e){this.isOnEdit=e,this.previousRecords={},this.editedRecords=[]},n.prototype.setRecordValue=function(e,i,r,n){if(this.isOnEdit||this.isOnDelete){this.makeCloneData(e,r,n);var a=n?r.rowUniqueID:r.ganttProperties.rowUniqueID,s=this.getRecordByID(a);s&&-1===this.editedRecords.indexOf(s)&&(this.editedRecords.push(s),this.enableImmutableMode&&this.modifiedRecords.push(s))}i=t.isUndefined(i)?null:i,t.setValue(e,i,r)},n.prototype.makeCloneData=function(e,i,r){var n,a,s,o=t.getValue(e,i);if(r&&(e="ganttProperties."+e),t.isNullOrUndefined(this.previousRecords[i.uniqueID])){this.previousRecords[i.uniqueID]={}}n=this.previousRecords[i.uniqueID],a=t.getValue(e,n),t.isUndefined(a)&&(s=o instanceof Date?new Date(o.getTime()):t.isObjectArray(o)?t.extend([],o,[],!0):t.isObject(o)?t.extend({},{},o,!0):o,t.isUndefined(s)?t.setValue(e,null,n):t.setValue(e,s,n))},n.prototype.closeGanttActions=function(){this.editModule&&(this.editModule.cellEditModule&&this.editModule.cellEditModule.isCellEdit?(this.treeGrid.closeEdit(),this.editModule.cellEditModule.isCellEdit=!1,t.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()))},n.prototype.getTaskByUniqueID=function(e){var t=this.flatData.filter(function(t){return t.uniqueID===e});return t.length>0?t[0]:null},n.prototype.getRecordByID=function(e){return t.isNullOrUndefined(e)?null:this.flatData[this.ids.indexOf(e.toString())]},n.prototype.setSplitterPosition=function(e,t){var i={};i[t]=e;var r=this.splitterModule.calculateSplitterPosition(i,!0),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()},n.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)}},n.prototype.expandByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)},n.prototype.collapseByIndex=function(e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},n.prototype.collapseByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},n.prototype.addRecord=function(e,i,r){if(this.editModule&&this.editSettings.allowAdding)if("ResourceView"===this.viewType){this.editModule.addRowPosition=i,this.editModule.addRowIndex=r;var n=e[this.taskFields.resourceInfo],a=void 0,s=void 0;if(!t.isNullOrUndefined(n)&&n.length){for(var o=0;o<n.length&&(a="object"==typeof n[o]?n[o][this.resourceFields.id]:n[0],!(s=this.flatData[this.getTaskIds().indexOf("R"+a)]));o++);if(s&&s.childRecords.length||0===s.level){var l=s.childRecords[r];if(l){var d="Above"===i||"Below"===i?i:"Child";"Child"===d?this.editModule.addRecord(e,d,this.getTaskIds().indexOf("R"+a)):this.editModule.addRecord(e,d,this.flatData.indexOf(l))}else this.editModule.addRecord(e,"Child",this.getTaskIds().indexOf("R"+a))}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,i,r)},n.prototype.updateRecordByID=function(e){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateRecordByID(e)},n.prototype.updateTaskId=function(e,t){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateTaskId(e,t)},n.prototype.expandAtLevel=function(e){this.enableVirtualization&&(this.isExpandCollapseLevelMethod=!0),this.ganttChartModule.expandAtLevel(e)},n.prototype.indent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.indent()},n.prototype.outdent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.outdent()},n.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)}},n.prototype.getCriticalTasks=function(){return!t.isNullOrUndefined(this.criticalPathModule)&&this.enableCriticalPath?this.criticalPathModule.getCriticalTasks():null},n.prototype.zoomIn=function(){this.timelineModule.processZooming(!0)},n.prototype.zoomOut=function(){this.timelineModule.processZooming(!1)},n.prototype.fitToProject=function(){this.timelineModule.processZoomToFit(),this.ganttChartModule.updateScrollLeft(0)},n.prototype.reorderRows=function(e,t,i){this.rowDragAndDropModule.reorderRows(e,t,i)},n.prototype.updateRecordByIndex=function(e,i){if(this.editModule&&this.editSettings.allowEditing){var r=this.taskFields,n=this.updatedRecords.length>0?t.isNullOrUndefined(this.updatedRecords[e])?null:this.updatedRecords[e]:null;t.isNullOrUndefined(n)||(i[r.id]=n[r.id],this.editModule.updateRecordByID(i))}},n.prototype.addPredecessor=function(e,i){var r=this.getRecordByID(e.toString());this.editModule&&!t.isNullOrUndefined(r)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.addPredecessor(r,i)},n.prototype.removePredecessor=function(e){var i=this.getRecordByID(e.toString());this.editModule&&!t.isNullOrUndefined(i)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.removePredecessor(i)},n.prototype.updatePredecessor=function(e,i){var r=this.getRecordByID(e.toString());this.editModule&&!t.isNullOrUndefined(r)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.updatePredecessor(r,i)},n.prototype.openAddDialog=function(){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowAdding&&this.editModule.dialogModule.openAddDialog()},n.prototype.openEditDialog=function(e){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowEditing&&this.editModule.dialogModule.openEditDialog(e)},n.prototype.contructExpandCollapseArgs=function(e,i){var r,n,a;t.isNullOrUndefined(i)?(n=this.getRecordByID(e.toString()),r=this.getRowByID(e),a=t.getValue("rowIndex",r)):t.isNullOrUndefined(i)||(r=this.getRowByIndex(i),a=t.getValue("rowIndex",r),n=this.currentViewData[a]);return{data:n,gridRow:this.treeGrid.getRows()[a],chartRow:r,cancel:!1}},n.prototype.getRowByIndex=function(e){try{var i=this.element.querySelectorAll(".e-chart-row");return t.isNullOrUndefined(e)?null:i[e]}catch(e){return null}},n.prototype.getRowByID=function(e){var t=this.getRecordByID(e.toString()),i=this.updatedRecords.indexOf(t);return-1!==i?this.getRowByIndex(i):null},n.prototype.getUnscheduledTaskClass=function(e){return t.isNullOrUndefined(e.startDate)&&t.isNullOrUndefined(e.endDate)&&t.isNullOrUndefined(e.duration)?" "+he:t.isNullOrUndefined(e.startDate)||t.isNullOrUndefined(e.endDate)||t.isNullOrUndefined(e.duration)?" "+he:""},n.prototype.isUnscheduledTask=function(e){return!!(t.isNullOrUndefined(e.startDate)||t.isNullOrUndefined(e.endDate)||t.isNullOrUndefined(e.duration))},n.prototype.createGanttPopUpElement=function(){var e=this.createElement("div",{className:"e-ganttpopup",styles:"display:none;"}),i=this.createElement("div",{className:"e-content",attrs:{tabIndex:"-1"}});t.append([i,this.createElement("div",{className:"e-uptail e-tail"})],e),i.appendChild(this.createElement("span")),t.append([i,this.createElement("div",{className:"e-downtail e-tail"})],e),document.getElementById(this.element.id+"GanttChart").appendChild(e)},n.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},n.prototype.search=function(e){this.filterModule&&(this.searchSettings.key=e,this.dataBind())},n.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=t.left+r-a;return{top:Math.round(s),left:Math.round(o),width:t.width,height:t.height}},n.prototype.expandAll=function(){this.ganttChartModule.expandCollapseAll("expand")},n.prototype.updateDataSource=function(e,i){if(this.isDynamicData=!0,!t.isNullOrUndefined(i))for(var r=0,n=Object.keys(i);r<n.length;r++){var a=n[r];switch(a){case"projectStartDate":this.setProperties({projectStartDate:i[a]},!0);break;case"projectEndDate":this.setProperties({projectEndDate:i[a]},!0)}}this.dataSource=e},n.prototype.collapseAll=function(){this.ganttChartModule.expandCollapseAll("collapse")},n.prototype.getGridColumns=function(){return this.treeGrid.getColumns()},n.prototype.getColumnByField=function(e,t){var i=t.filter(function(t){return t.field===e});return i.length>0?i[0]:null},n.prototype.getGanttColumns=function(){return this.ganttColumns},n.prototype.showColumn=function(e,t){this.treeGrid.showColumns(e,t)},n.prototype.hideColumn=function(e,t){this.treeGrid.hideColumns(e,t)},n.prototype.setScrollTop=function(e){this.ganttChartModule.scrollObject.setScrollTop(e)},n.prototype.cancelEdit=function(){this.isCancelled=!0,this.closeGanttActions()},n.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},n.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},n.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},n.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},n.prototype.deleteRecord=function(e){this.editModule&&this.editModule.deleteRecord(e)},n.prototype.enableItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},n.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},n.prototype.updateDataArgs=function(e){if(!Array.isArray(e.data)){var i=[];i.push(e.data),t.setValue("data",i,e)}return e},n.prototype.convertToMilestone=function(e){var i=this.getRecordByID(e);if(!t.isNullOrUndefined(i)){var r=t.extend({},{},i.taskData,!0),n=this.taskFields;if(r[n.startDate]&&this.setRecordValue(n.startDate,i.ganttProperties.startDate,r,!0),t.isNullOrUndefined(n.duration)?(r[n.startDate]=new Date(i.ganttProperties.startDate),r[n.endDate]=new Date(i.ganttProperties.endDate)):r[n.duration]=0,t.isNullOrUndefined(n.milestone)||!1===r[n.milestone]&&(r[n.milestone]=!0),t.isNullOrUndefined(n.progress)||(r[n.progress]=0),!t.isNullOrUndefined(n.child)&&r[n.child]&&(r[n.child]=[]),!t.isNullOrUndefined(n.parentID)&&r[n.parentID]&&(r[n.parentID]=null),t.isNullOrUndefined(n.segments)||(r[n.segments]=null),!t.isNullOrUndefined(this.contextMenuModule)&&this.contextMenuModule.isOpen&&"Milestone"===this.contextMenuModule.item){t.isNullOrUndefined(n.dependency)||(r[n.dependency]=null);this.addRecord(r,"Below")}else i.hasChildRecords||i.ganttProperties.isMilestone||this.updateRecordByID(r)}},n.prototype.changeTaskMode=function(e){var i=this.taskFields,r=this.getRecordByID(e[i.id]),n=r.ganttProperties;this.isOnEdit=!0,this.setRecordValue("isAutoSchedule",!n.isAutoSchedule,n,!0),t.isNullOrUndefined(this.taskFields.manual)||(this.setRecordValue("taskData."+i.manual,!n.isAutoSchedule,r),this.setRecordValue(i.manual,!n.isAutoSchedule,r)),this.editModule.updateTaskScheduleModes(r);var a={data:r};this.editModule.initiateUpdateAction(a)},n.prototype.getTaskIds=function(){return this.taskIds},n.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)}},n.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},n.prototype.resetTemplates=function(){this.isReact&&this.clearTemplate()},ri([t.Property(!0)],n.prototype,"allowKeyboard",void 0),ri([t.Property(!1)],n.prototype,"enableImmutableMode",void 0),ri([t.Property(!0)],n.prototype,"disableHtmlEncode",void 0),ri([t.Property(!0)],n.prototype,"autoFocusTasks",void 0),ri([t.Property(!0)],n.prototype,"allowSelection",void 0),ri([t.Property(!1)],n.prototype,"allowSorting",void 0),ri([t.Property(!0)],n.prototype,"enablePredecessorValidation",void 0),ri([t.Property(!1)],n.prototype,"showColumnMenu",void 0),ri([t.Property()],n.prototype,"columnMenuItems",void 0),ri([t.Property()],n.prototype,"timezone",void 0),ri([t.Property(!1)],n.prototype,"collapseAllParentTasks",void 0),ri([t.Property(!1)],n.prototype,"highlightWeekends",void 0),ri([t.Property(0)],n.prototype,"treeColumnIndex",void 0),ri([t.Property([])],n.prototype,"dataSource",void 0),ri([t.Property("day")],n.prototype,"durationUnit",void 0),ri([t.Property(null)],n.prototype,"query",void 0),ri([t.Property(null)],n.prototype,"dateFormat",void 0),ri([t.Property("auto")],n.prototype,"height",void 0),ri([t.Property(!1)],n.prototype,"renderBaseline",void 0),ri([t.Property("Horizontal")],n.prototype,"gridLines",void 0),ri([t.Complex({},Pt)],n.prototype,"labelSettings",void 0),ri([t.Property(null)],n.prototype,"taskbarTemplate",void 0),ri([t.Property(null)],n.prototype,"parentTaskbarTemplate",void 0),ri([t.Property(null)],n.prototype,"milestoneTemplate",void 0),ri([t.Property()],n.prototype,"baselineColor",void 0),ri([t.Property("auto")],n.prototype,"width",void 0),ri([t.Property(!1)],n.prototype,"enableVirtualization",void 0),ri([t.Property()],n.prototype,"toolbar",void 0),ri([t.Property(["Monday","Tuesday","Wednesday","Thursday","Friday"])],n.prototype,"workWeek",void 0),ri([t.Property(!1)],n.prototype,"includeWeekend",void 0),ri([t.Property(!1)],n.prototype,"allowUnscheduledTasks",void 0),ri([t.Property(!1)],n.prototype,"showInlineNotes",void 0),ri([t.Property(36)],n.prototype,"rowHeight",void 0),ri([t.Property(null)],n.prototype,"taskbarHeight",void 0),ri([t.Property(null)],n.prototype,"projectStartDate",void 0),ri([t.Property(null)],n.prototype,"projectEndDate",void 0),ri([t.Property(null)],n.prototype,"resourceIDMapping",void 0),ri([t.Property(null)],n.prototype,"resourceNameMapping",void 0),ri([t.Property([])],n.prototype,"resources",void 0),ri([t.Property([])],n.prototype,"segmentData",void 0),ri([t.Property(null)],n.prototype,"connectorLineBackground",void 0),ri([t.Property(1)],n.prototype,"connectorLineWidth",void 0),ri([t.Property([])],n.prototype,"columns",void 0),ri([t.Property([])],n.prototype,"addDialogFields",void 0),ri([t.Property([])],n.prototype,"editDialogFields",void 0),ri([t.Property(-1)],n.prototype,"selectedRowIndex",void 0),ri([t.Property("hour")],n.prototype,"workUnit",void 0),ri([t.Property("FixedUnit")],n.prototype,"taskType",void 0),ri([t.Property("ProjectView")],n.prototype,"viewType",void 0),ri([t.Collection([{from:8,to:12},{from:13,to:17}],tt)],n.prototype,"dayWorkingTime",void 0),ri([t.Collection([],Tt)],n.prototype,"holidays",void 0),ri([t.Collection([],ut)],n.prototype,"eventMarkers",void 0),ri([t.Complex({},Ut)],n.prototype,"taskFields",void 0),ri([t.Complex({},Yt)],n.prototype,"resourceFields",void 0),ri([t.Complex({},Bt)],n.prototype,"timelineSettings",void 0),ri([t.Complex({},zt)],n.prototype,"sortSettings",void 0),ri([t.Complex({},pt)],n.prototype,"editSettings",void 0),ri([t.Complex({},Wt)],n.prototype,"tooltipSettings",void 0),ri([t.Complex({},Rt)],n.prototype,"selectionSettings",void 0),ri([t.Property(!1)],n.prototype,"allowFiltering",void 0),ri([t.Property(!1)],n.prototype,"allowExcelExport",void 0),ri([t.Property(!1)],n.prototype,"allowRowDragAndDrop",void 0),ri([t.Property(!1)],n.prototype,"allowReordering",void 0),ri([t.Property(!1)],n.prototype,"readOnly",void 0),ri([t.Property(!1)],n.prototype,"allowResizing",void 0),ri([t.Property(!1)],n.prototype,"enableContextMenu",void 0),ri([t.Property(!1)],n.prototype,"enableCriticalPath",void 0),ri([t.Property()],n.prototype,"contextMenuItems",void 0),ri([t.Property(!1)],n.prototype,"allowPdfExport",void 0),ri([t.Property(!1)],n.prototype,"validateManualTasksOnLinking",void 0),ri([t.Property(!1)],n.prototype,"enableMultiTaskbar",void 0),ri([t.Property(!1)],n.prototype,"showOverAllocation",void 0),ri([t.Property("Auto")],n.prototype,"taskMode",void 0),ri([t.Complex({},mt)],n.prototype,"filterSettings",void 0),ri([t.Complex({},Dt)],n.prototype,"searchSettings",void 0),ri([t.Complex({},It)],n.prototype,"splitterSettings",void 0),ri([t.Event()],n.prototype,"queryTaskbarInfo",void 0),ri([t.Event()],n.prototype,"beforeExcelExport",void 0),ri([t.Event()],n.prototype,"excelExportComplete",void 0),ri([t.Event()],n.prototype,"excelQueryCellInfo",void 0),ri([t.Event()],n.prototype,"excelHeaderQueryCellInfo",void 0),ri([t.Event()],n.prototype,"rowDrag",void 0),ri([t.Event()],n.prototype,"rowDragStart",void 0),ri([t.Event()],n.prototype,"rowDragStartHelper",void 0),ri([t.Event()],n.prototype,"rowDrop",void 0),ri([t.Event()],n.prototype,"collapsing",void 0),ri([t.Event()],n.prototype,"collapsed",void 0),ri([t.Event()],n.prototype,"expanding",void 0),ri([t.Event()],n.prototype,"expanded",void 0),ri([t.Event()],n.prototype,"actionBegin",void 0),ri([t.Event()],n.prototype,"actionComplete",void 0),ri([t.Event()],n.prototype,"actionFailure",void 0),ri([t.Event()],n.prototype,"dataStateChange",void 0),ri([t.Event()],n.prototype,"taskbarEdited",void 0),ri([t.Event()],n.prototype,"endEdit",void 0),ri([t.Event()],n.prototype,"cellEdit",void 0),ri([t.Event()],n.prototype,"load",void 0),ri([t.Event()],n.prototype,"created",void 0),ri([t.Event()],n.prototype,"destroyed",void 0),ri([t.Event()],n.prototype,"taskbarEditing",void 0),ri([t.Event()],n.prototype,"dataBound",void 0),ri([t.Event()],n.prototype,"resizeStart",void 0),ri([t.Event()],n.prototype,"resizing",void 0),ri([t.Event()],n.prototype,"resizeStop",void 0),ri([t.Event()],n.prototype,"splitterResizeStart",void 0),ri([t.Event()],n.prototype,"splitterResizing",void 0),ri([t.Event()],n.prototype,"splitterResized",void 0),ri([t.Event()],n.prototype,"columnDragStart",void 0),ri([t.Event()],n.prototype,"columnDrag",void 0),ri([t.Event()],n.prototype,"columnDrop",void 0),ri([t.Event()],n.prototype,"beforeTooltipRender",void 0),ri([t.Event()],n.prototype,"rowSelecting",void 0),ri([t.Event()],n.prototype,"rowSelected",void 0),ri([t.Event()],n.prototype,"rowDeselecting",void 0),ri([t.Event()],n.prototype,"rowDeselected",void 0),ri([t.Event()],n.prototype,"cellSelecting",void 0),ri([t.Event()],n.prototype,"cellSelected",void 0),ri([t.Event()],n.prototype,"cellDeselecting",void 0),ri([t.Event()],n.prototype,"cellDeselected",void 0),ri([t.Event()],n.prototype,"queryCellInfo",void 0),ri([t.Event()],n.prototype,"headerCellInfo",void 0),ri([t.Event()],n.prototype,"rowDataBound",void 0),ri([t.Event()],n.prototype,"columnMenuOpen",void 0),ri([t.Event()],n.prototype,"toolbarClick",void 0),ri([t.Event()],n.prototype,"columnMenuClick",void 0),ri([t.Event()],n.prototype,"contextMenuOpen",void 0),ri([t.Event()],n.prototype,"contextMenuClick",void 0),ri([t.Event()],n.prototype,"onTaskbarClick",void 0),ri([t.Event()],n.prototype,"recordDoubleClick",void 0),ri([t.Event()],n.prototype,"onMouseMove",void 0),ri([t.Event()],n.prototype,"beforePdfExport",void 0),ri([t.Event()],n.prototype,"pdfExportComplete",void 0),ri([t.Event()],n.prototype,"pdfQueryCellInfo",void 0),ri([t.Event()],n.prototype,"pdfQueryTaskbarInfo",void 0),ri([t.Event()],n.prototype,"pdfQueryTimelineCellInfo",void 0),ri([t.Event()],n.prototype,"pdfColumnHeaderQueryCellInfo",void 0),n=ri([t.NotifyPropertyChanges],n)}(t.Component);!function(e){e[e.NextPage=0]="NextPage",e[e.LastPage=1]="LastPage"}(e.PdfHorizontalOverflowType||(e.PdfHorizontalOverflowType={}));var ai=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&&a.TreeGrid.Inject(a.Edit)},e.prototype.ensureEditCell=function(e){var i=this,r=e.rowData,a=e.columnName;this.editedColumn=this.parent.getColumnByField(a,this.parent.ganttColumns);var s=this.parent.taskFields;if(this.parent.readOnly)e.cancel=!0;else if("Dialog"!==this.parent.editSettings.mode){if(!r.hasChildRecords||(a!==s.endDate||(t.isNullOrUndefined(r.isManual)||!1!==r.isManual)&&"Auto"!==this.parent.taskMode)&&a!==s.duration&&a!==s.dependency&&a!==s.progress&&a!==s.work&&"taskType"!==a){var o=new n.Deferred;return this.parent.trigger("cellEdit",e,function(e){0===r.level&&"ResourceView"===i.parent.viewType&&(e.cancel=!0),o.resolve(e),e.cancel||(e.columnName===i.parent.taskFields.notes?i.openNotesEditor(e):(i.isCellEdit=!0,t.isNullOrUndefined(i.parent.toolbarModule)||i.parent.toolbarModule.refreshToolbarItems()))}),o}e.cancel=!0}else 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}).indexOf("Notes");if(-1!==n){this.parent.editModule.dialogModule.openEditDialog(i.ganttProperties.rowUniqueID);document.getElementById(this.parent.element.id+"_Tab").ej2_instances[0].selectedItem=n}}r===t.notes&&!0===this.parent.showInlineNotes&&(this.isCellEdit=!0)},e.prototype.isValueChange=function(e,i){var r=t.getValue("data",e),n=r[i],a=t.getValue("previousData",e);if(t.isNullOrUndefined(n)&&!t.isNullOrUndefined(a)||!t.isNullOrUndefined(n)&&t.isNullOrUndefined(a))return!0;if(!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(a)){if(n instanceof Date)return n.getTime()!==r.taskData[i].getTime();if(i===this.parent.taskFields.resourceInfo)return n!==a;if(n!==r.taskData[i])return!0}return!1},e.prototype.initiateCellEdit=function(e,i){var r=t.getValue("column",e),n=t.getValue("data",e),a={};a.action="CellEditing",a.data=this.parent.getTaskByUniqueID(n.uniqueID);var s=t.getValue("previousData",e),o=this.parent.allowUnscheduledTasks?n[r.field]:!t.isNullOrUndefined(n[r.field])&&""!==n[r.field]||this.parent.taskFields.duration!==r.field&&this.parent.taskFields.startDate!==r.field&&this.parent.taskFields.endDate!==r.field?n[r.field]:s;t.isNullOrUndefined(n)?this.parent.editModule.endEditAction(e):(n[r.field]=s,a.data[r.field]=s,this.parent.initiateEditAction(!0),this.parent.setRecordValue(r.field,o,a.data),r.field===this.parent.taskFields.name?this.taskNameEdited(a):r.field===this.parent.taskFields.startDate?this.startDateEdited(a):r.field===this.parent.taskFields.endDate?this.endDateEdited(a):r.field===this.parent.taskFields.duration?this.durationEdited(a):r.field===this.parent.taskFields.resourceInfo?this.resourceEdited(a,i,n):r.field===this.parent.taskFields.progress?this.progressEdited(a):r.field===this.parent.taskFields.baselineStartDate||r.field===this.parent.taskFields.baselineEndDate?this.baselineEdited(a):r.field===this.parent.taskFields.dependency?this.dependencyEdited(a,s):r.field===this.parent.taskFields.notes?this.notedEdited(a):r.field===this.parent.taskFields.work?this.workEdited(a):"taskType"!==r.field||t.isNullOrUndefined(this.parent.taskFields.work)?r.field===this.parent.taskFields.manual?this.taskmodeEdited(a):(this.parent.setRecordValue("taskData."+r.field,a.data[r.field],a.data),this.parent.editModule.initiateSaveAction(a)):this.typeEdited(a,i)),this.isCellEdit=!1,t.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 i=e.data,r=e.data.ganttProperties,n=e.data[this.parent.taskFields.startDate];n=n?new Date(n.getTime()):null,n=this.parent.dateValidationModule.checkStartDate(n,i.ganttProperties,i.ganttProperties.isMilestone),t.isNullOrUndefined(n)?i.hasChildRecords||(this.parent.setRecordValue("startDate",null,r,!0),this.parent.setRecordValue("duration",null,r,!0),this.parent.setRecordValue("isMilestone",!1,r,!0),this.parent.allowUnscheduledTasks&&t.isNullOrUndefined(this.parent.taskFields.endDate)&&this.parent.setRecordValue("endDate",null,r,!0)):r.endDate||!t.isNullOrUndefined(r.duration)?(this.parent.setRecordValue("startDate",new Date(n.getTime()),r,!0),this.parent.dateValidationModule.calculateEndDate(i)):t.isNullOrUndefined(r.endDate)&&t.isNullOrUndefined(r.duration)&&this.parent.setRecordValue("startDate",new Date(n.getTime()),r,!0),this.parent.setRecordValue("isMilestone",0===r.duration,r,!0),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(i,"startDate"),this.parent.dataOperation.updateMappingData(i,"endDate"),this.parent.dataOperation.updateMappingData(i,"duration"),this.updateEditedRecord(e)},e.prototype.validateEndDateWithSegments=function(e){for(var i=[],r=e.segments,n=0;n<r.length;n++){var a=r[n],s=a.endDate;s=!t.isNullOrUndefined(e.endDate)&&s.getTime()<e.endDate.getTime()&&n!==r.length-1?s:e.endDate,a.duration=this.parent.dataOperation.getDuration(a.startDate,s,e.durationUnit,e.isAutoSchedule,e.isMilestone),r.length>0&&s.getTime()<a.startDate.getTime()&&s.getTime()<=e.endDate.getTime()?r[n-1].duration=this.parent.dataOperation.getDuration(r[n-1].startDate,e.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone):i.push(a)}return i},e.prototype.endDateEdited=function(e){var i=e.data.ganttProperties,r=e.data[this.parent.taskFields.endDate];r=r?new Date(r.getTime()):null,t.isNullOrUndefined(r)?(this.parent.setRecordValue("endDate",r,i,!0),this.parent.setRecordValue("duration",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0)):(0===r.getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,r),r=this.parent.dateValidationModule.checkEndDate(r,i),this.parent.setRecordValue("endDate",r,i,!0),!t.isNullOrUndefined(i.startDate)&&t.isNullOrUndefined(i.duration)?-1===this.parent.dateValidationModule.compareDates(i.endDate,i.startDate)&&(this.parent.setRecordValue("endDate",new Date(i.startDate.getTime()),i,!0),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,i.endDate)):!t.isNullOrUndefined(i.duration)&&t.isNullOrUndefined(i.startDate)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(i.endDate,i.duration,i.durationUnit,i),i,!0),t.isNullOrUndefined(i.segments)||(i.segments=this.validateEndDateWithSegments(i)),-1===this.compareDatesFromRecord(i)?this.parent.dateValidationModule.calculateDuration(e.data):this.parent.editModule.revertCellEdit(e),this.parent.setRecordValue("isMilestone",0===i.duration,i,!0),i.isMilestone&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(i.startDate,i),i,!0)),!t.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){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 i=e.data.ganttProperties,r=this.parent.dateValidationModule.getDateFromFormat(i.endDate),n=this.parent.dateValidationModule.getDateFromFormat(i.startDate),a=i.duration;t.isNullOrUndefined(a)?(this.parent.setRecordValue("isMilestone",!1,i,!0),null!=e.data[this.parent.taskFields.duration]&&this.parent.setRecordValue("endDate",null,i,!0)):(t.isNullOrUndefined(n)&&!t.isNullOrUndefined(r)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(r,a,i.durationUnit,i),i,!0),0!==a&&i.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,i,!0),this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(i.startDate,i),i,!0)),!t.isNullOrUndefined(i.segments)&&i.segments.length>0&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),i,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),this.parent.setRecordValue("isMilestone",0===i.duration,i,!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 i=e.data;if(this.parent.setRecordValue("progress",i[this.parent.taskFields.progress]>100?100:i[this.parent.taskFields.progress],i.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.progress,i[this.parent.taskFields.progress]>100?100:i[this.parent.taskFields.progress],e.data),i.ganttProperties.isAutoSchedule||this.parent.setRecordValue("autoWidth",this.parent.dataOperation.calculateWidth(i,!1),i.ganttProperties,!0),!t.isNullOrUndefined(e.data.ganttProperties.segments)&&e.data.ganttProperties.segments.length>0&&!t.isNullOrUndefined(this.parent.editModule.taskbarEditModule)&&this.parent.editModule.taskbarEditModule.updateSegmentProgress(e.data.ganttProperties),!e.data.hasChildRecords){var r=i.ganttProperties.isAutoSchedule?i.ganttProperties.width:i.ganttProperties.autoWidth;this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(r,i.ganttProperties.progress),i.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,i,r){var n=this.parent.resourceFields,a=i[this.parent.taskFields.resourceInfo];if(a){this.isResourceCellEdited=!0;for(var s=this.parent.dataOperation.setResourceInfo(i).length,o=r.ganttProperties.resourceInfo,l=void 0,d=[],p=this.parent.resources,h=void 0,c=function(e){if(o){var i=o.length;for(h=0;h<i;h++){if(o[h][n.id]===a[e]){l=h;break}l=-1}}if(t.isNullOrUndefined(l)||-1===l){var r=p.filter(function(t){return a[e]===t[n.id]}),s=t.extend({},r[0]);s[n.unit]=100,d.push(s)}else d.push(o[l])},u=0;u<s;u++)c(u);e.data.ganttProperties.resourceInfo=d,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=o),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}(),si=function(){function e(e,t){this.parent=e,this.taskbarEdit=t}return e.prototype.createTooltip=function(e,t,r){var n=this;this.toolTipObj=new i.Tooltip({opensOn:e,position:"TopRight",mouseTrail:t,cssClass:"e-gantt-tooltip",target:r||null,animation:{open:{effect:"None"},close:{effect:"None"}}}),this.toolTipObj.beforeRender=function(e){var t={data:n.taskbarEdit.taskBarEditRecord,args:e,content:n.toolTipObj.content};n.parent.trigger("beforeTooltipRender",t)},this.toolTipObj.afterOpen=function(e){n.updateTooltipPosition(e)},this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.chartPane)},e.prototype.updateTooltipPosition=function(e){var t=this.parent.getOffsetRect(this.parent.chartPane).left+this.parent.chartPane.offsetWidth,i=e.element.offsetLeft;t<i+e.element.offsetWidth&&(i+=t-(i+e.element.offsetWidth)),e.element.style.left=i+"px",e.element.style.visibility="visible"},e.prototype.showHideTaskbarEditTooltip=function(e,i){e&&this.parent.tooltipSettings.showTooltip?(this.createTooltip("Custom",!1),this.parent.tooltipModule.toolTipObj.close(),this.updateTooltip(i),"ConnectorPointLeftDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+Ue)):"ConnectorPointRightDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+Ve)):this.toolTipObj.open(this.taskbarEdit.taskBarEditElement)):t.isNullOrUndefined(this.toolTipObj)||(this.toolTipObj.destroy(),this.toolTipObj=null)},e.prototype.updateTooltip=function(e){var i=this.taskbarEdit.taskBarEditRecord.ganttProperties,r=-1===e?i.width:i.segments[e].width,n=-1===e?i.progressWidth:i.segments[e].progressWidth,a=-1===e?i.left:i.left+i.segments[e].left;t.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.toolTipObj.offsetX=-r:"RightResizing"===this.taskbarEdit.taskBarEditAction||"ParentResizing"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=0:"ProgressResizing"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-(r-n):"MilestoneDrag"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-this.parent.chartRowsModule.milestoneHeight/2:r>5&&(this.toolTipObj.offsetX=-(r+a-this.taskbarEdit.tooltipPositionX))))},e.prototype.getTooltipText=function(e){var i="",r=this.parent.globalize,n=this.taskbarEdit.taskBarEditRecord.ganttProperties;if(!t.isNullOrUndefined(n.segments)&&n.segments.length>0&&-1!==e&&"ProgressResizing"!==this.taskbarEdit.taskBarEditAction&&(n=n.segments[e]),this.parent.tooltipSettings.editing){var a=this.parent.tooltipModule.templateCompiler(this.parent.tooltipSettings.editing,this.parent,this.taskbarEdit.taskBarEditRecord,"TooltipEditingTemplate");t.getValue("tooltipEle",this.toolTipObj)&&this.parent.renderTemplates(),i=a[0]}else{var s=void 0,o=void 0,l=void 0;switch(t.isNullOrUndefined(n.startDate)||(s='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.formatDate(n.startDate,{format:this.parent.getDateFormat()})+"</td></tr>"),t.isNullOrUndefined(n.endDate)||(o='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.formatDate(n.endDate,{format:this.parent.getDateFormat()})+"</td></tr>"),t.isNullOrUndefined(n.duration)||(l='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getDurationString(n.duration,n.durationUnit)+"</td></tr>"),this.taskbarEdit.taskBarEditAction){case"ProgressResizing":i='<table class = "e-gantt-tooltiptable"><tbody>'+('<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+n.progress+"</td></tr>")+"</tbody></table>";break;case"LeftResizing":i='<table class = "e-gantt-tooltiptable"><tbody>'+s+l+"</tbody></table>";break;case"RightResizing":case"ParentResizing":i='<table class = "e-gantt-tooltiptable"><tbody>'+o+l+"</tbody></table>";break;case"ChildDrag":case"ParentDrag":case"MilestoneDrag":case"ManualParentDrag":var d="",p="";t.isNullOrUndefined(this.taskbarEdit.taskBarEditRecord.ganttProperties.startDate)||(d=s),t.isNullOrUndefined(this.taskbarEdit.taskBarEditRecord.ganttProperties.endDate)||(p=o),i='<table class = "e-gantt-tooltiptable"><tbody>'+d+p+"</tbody></table>";break;case"ConnectorPointLeftDrag":case"ConnectorPointRightDrag":i=this.parent.connectorLineModule.tooltipTable,t.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 i},e}(),oi=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)}}(),li=function(){return(li=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}).apply(this,arguments)},di=function(e){function i(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.parent=t,i.initPublicProp(),i.wireEvents(),i.editTooltip=new si(i.parent,i),i}return oi(i,e),i.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)},i.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},i.prototype.mouseDownHandler=function(e){if(this.parent.editSettings.allowTaskbarEditing&&!this.parent.readOnly)if(this.canDrag=!1,this.parent.isAdaptive&&this.taskBarEditElement){var t=this.getElementByPosition(e),i=g(t,F);!i||i.innerHTML!==this.taskBarEditElement.innerHTML||t.classList.contains(Ue)||t.classList.contains(Ve)||this.tapPointOnFocus||(this.updateTaskBarEditElement(e),this.canDrag=!0,e.preventDefault())}else this.parent.isAdaptive||this.updateTaskBarEditElement(e)},i.prototype.mouseClickHandler=function(e){var t=this.getElementByPosition(e),i=g(t,F);this.parent.selectionModule&&this.parent.selectionModule.enableSelectMultiTouch?this.tapPointOnFocus&&this.updateTaskBarEditElement(e):this.tapPointOnFocus&&i&&i.innerHTML!==this.taskBarEditElement.innerHTML?(this.connectorSecondRecord=this.parent.ganttChartModule.getRecordByTaskBar(i),this.connectorSecondAction="ConnectorPointLeftDrag",this.connectorSecondElement=i,this.fromPredecessorText="Finish",this.validateConnectorPoint()&&this.taskBarEditingAction(e,!0),this.showHideActivePredecessors(!1),this.initPublicProp()):t.classList.contains(Le)||t.classList.contains(Ne)?(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(i,this.taskBarEditElement)),this.updateTaskBarEditElement(e))},i.prototype.showHideActivePredecessors=function(e){var i=this.taskBarEditRecord.ganttProperties,r=i.predecessor,n="ResourceView"===this.parent.viewType?i.taskId:i.rowUniqueID;if(r)for(var a=0;a<r.length;a++){var s=r[a];n.toString()!==s.from&&n.toString()!==s.to||this.applyActiveColor(s.from,s.to,e)}var o=this.parent.ganttChartModule.chartBodyContainer;e?(t.addClass([this.taskBarEditElement],[je]),t.addClass([o],[qe])):(t.removeClass([this.taskBarEditElement],[je]),t.removeClass([o],[qe])),this.touchEdit=e,t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},i.prototype.applyActiveColor=function(e,i,r){var n=("ProjectView"===this.parent.viewType?this.taskBarEditRecord.ganttProperties.taskId.toString():this.taskBarEditRecord.ganttProperties.rowUniqueID.toString())===e?this.parent.connectorLineModule.getRecordByID(i):this.parent.connectorLineModule.getRecordByID(e),a=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(n)];if(!t.isNullOrUndefined(a)){var s=a.querySelector("."+F),o=this.parent.element.querySelector("#ConnectorLineparent"+e+"child"+i);r?(t.addClass([s],[Ge]),o&&t.addClass([o],[Ge])):(t.removeClass([s],[Ge]),o&&t.removeClass([o],[Ge]))}},i.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},i.prototype.mouseLeaveHandler=function(e){this.dragMouseLeave=!0},i.prototype.updateTaskBarEditElement=function(e){var i,r=this.getElementByPosition(e);if(r.classList.contains(le)||r.classList.contains(ie)||r.classList.contains(re))i=g(r,ie);else if(r.classList.contains(ae)||r.classList.contains(se)||r.classList.contains(ne))i=g(r,ne);else if(i=g(r,F),!t.isNullOrUndefined(i)&&!r.classList.contains("e-connectorpoint-left")&&!r.classList.contains("e-connectorpoint-right")){var n=this.parent.ganttChartModule.getRecordByTaskBar(i);!t.isNullOrUndefined(n.ganttProperties.segments)&&n.ganttProperties.segments.length>0&&(i=g(r,V))}if(this.parent.editSettings.allowTaskbarEditing&&i){this.showHideTaskBarEditingElements(i,this.taskBarEditElement),this.editElement=i,this.taskBarEditElement=i;var a=this.taskBarEditElement.getAttribute("data-segment-index");if(t.isNullOrUndefined(a)?this.segmentIndex=-1:this.segmentIndex=Number(a),this.taskBarEditRecord=this.parent.ganttChartModule.getRecordByTaskBar(this.taskBarEditElement),("mousedown"===e.type||"touchstart"===e.type||"click"===e.type)&&(this.roundOffDuration=!0,this.taskBarEditAction=this.getTaskBarAction(e),"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||!t.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 s=this.parent.getTaskByUniqueID(this.taskBarEditRecord.parentItem.uniqueID);t.isNullOrUndefined(s)||s.expanded||(this.prevZIndex=this.taskBarEditElement.style.zIndex,this.taskBarEditElement.style.zIndex="1000",t.addClass([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"))}}}else this.parent.isAdaptive?(this.taskBarEditElement&&this.showHideTaskBarEditingElements(i,this.taskBarEditElement),this.initPublicProp()):this.showHideTaskBarEditingElements(i,this.taskBarEditElement)},i.prototype.showHideTaskBarEditingElements=function(e,i,r){i=i||this.editElement;var n=!!this.parent.taskFields.progress,a=!0;if(!this.parent.readOnly){if("ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar&&e){var s=this.parent.ganttChartModule.getRecordByTaskBar(e),o=this.parent.getParentTask(s.parentItem);t.isNullOrUndefined(o)||o.expanded||(n=!1,a=!1)}if(e){if(e.querySelector("."+Y)){if(t.addClass([e.querySelector("."+Y)],[ce]),t.addClass([e.querySelector("."+Z)],[ue]),n){!t.isNullOrUndefined(e.querySelector("."+Q))&&t.addClass([e.querySelector("."+Q)],[ge])}}else if(this.parent.isAdaptive&&n){(s=this.parent.ganttChartModule.getRecordByTaskBar(e)).hasChildRecords&&t.addClass([e],[We])}if(t.addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+De),[Ce]),!t.isNullOrUndefined(this.parent.taskFields.dependency)&&(e.querySelector("."+Ue)||e.parentElement.querySelector("."+Ue))&&a){var l=t.isNullOrUndefined(e.querySelector("."+Ue))?e.parentElement:e;t.addClass([l.querySelector("."+Ue)],[Le]),t.addClass([l.querySelector("."+Ve)],[Ne])}}else r||t.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+De),[Ce]);if(i&&e!==i){if(i.querySelector("."+Y)&&(t.removeClass([i.querySelector("."+Y)],[ce]),t.removeClass([i.querySelector("."+Z)],[ue]),i.querySelector("."+Q)&&t.removeClass([i.querySelector("."+Q)],[ge])),t.isNullOrUndefined(this.parent.taskFields.dependency)||!i.querySelector("."+Ue)&&!i.parentElement.querySelector("."+Ue)){if(this.parent.isAdaptive){(s=this.parent.ganttChartModule.getRecordByTaskBar(i))&&s.hasChildRecords&&t.removeClass([i],[We])}}else{l=t.isNullOrUndefined(i.querySelector("."+Ue))?i.parentElement:i;t.removeClass([l.querySelector("."+Ue)],[Le]),t.removeClass([l.querySelector("."+Ve)],[Ne])}this.editElement=null}}},i.prototype.getTaskBarAction=function(e){var i=this.getElementByPosition(e),r=this.taskBarEditRecord,n="";return i.classList.contains(Y)?n="LeftResizing":i.classList.contains(Z)?n="RightResizing":(i.classList.contains(Q)||t.closest(i,"."+Q))&&this.parent.taskFields.progress?n="ProgressResizing":i.classList.contains(Ue)?n="ConnectorPointLeftDrag":i.classList.contains(Ve)?n="ConnectorPointRightDrag":i.classList.contains(le)?n="ParentResizing":i.classList.contains(re)||i.classList.contains(ie)||i.classList.contains(ne)||i.classList.contains(ae)||i.classList.contains(se)||i.classList.contains(ne)?n="ManualParentDrag":r&&(n=r.hasChildRecords?"Auto"===this.parent.taskMode?"ParentDrag":"":r.ganttProperties.isMilestone?"MilestoneDrag":"ChildDrag"),n},i.prototype.updateMouseDownProperties=function(e){var t=this.getCoordinate(e);if(t.pageX||t.pageY){var i=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.mouseDownX=t.pageX-i.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseDownX,this.mouseDownY=t.pageY-i.top+this.parent.ganttChartModule.scrollObject.previousScroll.top}"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,"",""))},i.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&&this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),this.taskBarEditElement.setAttribute("aria-grabbed","true")}},i.prototype.mouseMoveAction=function(e){var t=this;if(this.parent.isAdaptive){if(!this.canDrag)return;this.multipleSelectionEnabled()}var i=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),r=this.getCoordinate(e);if(this.mouseMoveX=r.pageX-i.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.mouseMoveY=r.pageY-i.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.dragMouseLeave=!1,this.isMouseDragCheck(),this.isMouseDragged&&this.taskBarEditAction){var n={cancel:!1,requestType:"taskbarediting",taskBarEditAction:this.taskBarEditAction,data:this.taskBarEditRecord};-1!==this.segmentIndex&&(n.requestType="mergeSegment"),this.parent.trigger("actionBegin",n,function(i){!1===i.cancel&&t.taskBarEditingAction(e,!1)})}else this.parent.isAdaptive||this.taskBarEditAction||this.updateTaskBarEditElement(e)},i.prototype.taskBarEditingAction=function(e,i){var r=this,n={},a=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement);if(null!==this.taskBarEditRecord){if(n.editingFields=this.taskBarEditRecord.ganttProperties,n.data=this.taskBarEditRecord,"ResourceView"===this.parent.viewType&&0===n.data.level)return;n.recordIndex=a,n.taskBarEditAction=this.taskBarEditAction,n.roundOffDuration=this.roundOffDuration,n.cancel=!1,n.previousData=this.previousItem,n.segmentIndex=this.segmentIndex,this.roundOffDuration=n.roundOffDuration,this.targetElement=n.target=t.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.parent.isAdaptive||this.drawFalseLine()),this.setItemPosition(),this.updateEditedItem(),this.editTooltip.updateTooltip(this.segmentIndex),i&&this.taskBarEditedAction(e),this.parent.trigger("taskbarEditing",n,function(e){e.cancel&&null!==r.taskBarEditRecord&&(r.tapPointOnFocus=!1,t.merge(r.taskBarEditRecord.ganttProperties,e.previousData))})}},i.prototype.updateMouseMoveProperties=function(e){var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),i=this.getCoordinate(e);(i.pageX||i.pageY)&&(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 r="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)||r){var n=this.mouseMoveX-this.parent.ganttChartModule.scrollObject.previousScroll.left+t.left,a=this.mouseMoveY-this.parent.ganttChartModule.scrollObject.previousScroll.top+t.top;n+20>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):n-20<t.left?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("left")):r&&a+80>t.top+this.parent.ganttChartModule.chartBodyContainer.offsetHeight?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("bottom")):r&&a-20<t.top?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("top")):this.stopScrollTimer()}else this.stopScrollTimer()},i.prototype.startScrollTimer=function(e){var t=this;this.stopScrollTimer(),this.scrollTimer=window.setInterval(function(){t.timerCount="right"===e||"bottom"===e?t.timerCount+1>=t.parent.timelineModule.totalTimelineWidth?t.parent.timelineModule.totalTimelineWidth: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),"ConnectorPointLeftDrag"!==t.taskBarEditAction&&"ConnectorPointRightDrag"!==t.taskBarEditAction||t.drawFalseLine()},0)},i.prototype.stopScrollTimer=function(){window.clearInterval(this.scrollTimer),this.scrollTimer=null},i.prototype.enableDragging=function(e){var i=this.taskBarEditRecord.ganttProperties,r=0;if(this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&!this.taskBarEditElement.classList.contains("e-segment-first")){var n=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return li({},e)}),a=n[this.segmentIndex];this.mouseDownX>this.mouseMoveX?(r=t.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,a.left=a.left-r):(r=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,a.left=a.left+r);var s=n[this.segmentIndex-1],o=n[this.segmentIndex+1],l=void 0;l=this.taskBarEditElement.classList.contains("e-segment-inprogress")?a.left<s.left+s.width?s.left+s.width:a.width+a.left>o.left?o.left-a.width:a.left:a.left<s.left+s.width?s.left+s.width:i.left+a.width+a.left>=this.parent.timelineModule.totalTimelineWidth?this.parent.timelineModule.totalTimelineWidth-a.width:a.left,a.left=l,this.parent.setRecordValue("segments",n,i,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")}else{this.mouseDownX>this.mouseMoveX?(r=this.mouseDownX-this.mouseMoveX)>0&&this.parent.setRecordValue("left",this.previousItem.left-r,i,!0):(r=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+r,i,!0));l=i.left<0?0:i.left+i.width>=this.parent.timelineModule.totalTimelineWidth?this.parent.timelineModule.totalTimelineWidth-i.width:i.left;this.parent.setRecordValue("left",l,i,!0)}},i.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},i.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))},i.prototype.enableSplitTaskLeftResize=function(e){var i=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return li({},e)}),r=i[this.segmentIndex],n=0;if(this.mouseDownX>this.mouseMoveX)if(this.mouseMoveX<e.left+r.width+r.left){if(n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,r.left>0){if(r.left=r.left-n,r.width=r.width+n,0!==this.segmentIndex){var a=i[this.segmentIndex-1];if(e.left+r.left<e.left+a.left+a.width){var s=e.left+a.left+a.width-(e.left+r.left);r.width-=s,r.left=r.left+s}}}else if(r.left<=0&&0===this.segmentIndex){this.parent.setRecordValue("left",e.left-n,e,!0),this.parent.setRecordValue("width",e.width+n,e,!0),r.width=r.width+n;for(var o=1;o<e.segments.length;o++){var l=i[o];l.left=l.left+n}}}else this.mouseMoveX>e.left+r.width+r.left&&(n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,r.left=r.left-n,r.width=this.parent.perDayWidth);else if(this.mouseMoveX<e.left+r.width+r.left-this.parent.perDayWidth)if(n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,0===this.segmentIndex&&r.left<=0){this.parent.setRecordValue("left",e.left+n,e,!0),this.parent.setRecordValue("width",e.width-n,e,!0),r.width=r.width-n;for(o=1;o<e.segments.length;o++){var d=i[o];d.left=d.left-n}}else r.left<r.left+r.width&&r.left+n<=r.left+r.width&&(r.left=r.left+n,r.width=r.width-n);else if(this.mouseMoveX<e.left+r.left+r.width&&r.width>this.parent.perDayWidth){n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX;if(n-=r.width-n<this.parent.perDayWidth?this.parent.perDayWidth>r.width?this.parent.perDayWidth-r.width:r.width-this.parent.perDayWidth:0,0===this.segmentIndex){this.parent.setRecordValue("width",e.width-n,e,!0),this.parent.setRecordValue("left",e.left+n,e,!0);for(o=1;o<e.segments.length;o++){var p=i[o];p.left=p.left-n}}else r.left=r.left+n,r.width=r.width-n}this.parent.setRecordValue("segments",i,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},i.prototype.updateEditPosition=function(e,t){this.updateIsMilestone(t),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.width,t.progress),t,!0)},i.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))},i.prototype.enableRightResizing=function(e){var i=this.taskBarEditRecord.ganttProperties,r=0;if(this.taskBarEditElement.classList.contains("e-segmented-taskbar")){var n=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return li({},e)}),a=n[this.segmentIndex];this.mouseDownX>this.mouseMoveX?this.mouseMoveX>i.left+a.left&&this.mouseDownX-this.mouseMoveX>3?(r=t.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,a.width=a.width-r):this.mouseMoveX<i.left+a.left&&(a.width=this.parent.perDayWidth):this.mouseMoveX>a.left&&(r=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,a.width=a.width+r);var s=void 0,o=this.segmentIndex!==n.length-1?n[this.segmentIndex+1]:null;t.isNullOrUndefined(o)||(this.taskBarEditElement.classList.contains("e-segment-last")||(s=a.left+a.width>o.left?o.left-a.left:a.width),a.width=s),this.segmentIndex===i.segments.length-1&&0===this.segmentIndex&&this.parent.setRecordValue("width",a.width,i,!0),this.parent.setRecordValue("segments",n,i,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")}else this.mouseDownX>this.mouseMoveX?this.mouseMoveX>i.left&&this.mouseDownX-this.mouseMoveX>3?(r=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("width",this.previousItem.width-r,i,!0)):this.mouseMoveX<i.left&&this.parent.setRecordValue("width",3,i,!0):this.mouseMoveX>i.left&&(r=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("width",this.previousItem.width+r,i,!0)),this.updateEditPosition(e,i)},i.prototype.updateEditedItem=function(){var e,i,r,n,a=this.taskBarEditRecord.ganttProperties;switch(this.taskBarEditAction){case"ProgressResizing":this.parent.setRecordValue("progress",this.getProgressPercent(a.width,a.progressWidth),a,!0);break;case"LeftResizing":-1===this.segmentIndex?(e=this.getRoundOffStartLeft(a,this.roundOffDuration),i=this.getDateByLeft(e),t.isNullOrUndefined(a.endDate)&&(r=this.parent.dateValidationModule.getValidEndDate(a),this.parent.setRecordValue("endDate",r,a,!0)),n=this.parent.dateValidationModule.checkStartDate(i,a,null),this.parent.setRecordValue("startDate",new Date(n.getTime()),a,!0),0===this.parent.dateValidationModule.compareDates(a.startDate,a.endDate)&&t.isNullOrUndefined(a.isMilestone)&&!1===a.isMilestone&&0===a.duration&&this.parent.setRecordValue("duration",1,a,!0),a.isMilestone&&this.parent.setRecordValue("endDate",new Date(n.getTime()),a,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")):this.updateSplitLeftResize(a);break;case"RightResizing":case"ParentResizing":if(-1===this.segmentIndex){e=this.getRoundOffEndLeft(a,this.roundOffDuration);var s=this.getDateByLeft(e);t.isNullOrUndefined(a.startDate)&&(n=this.parent.dateValidationModule.getValidStartDate(a),this.parent.setRecordValue("startDate",n,a,!0));var o=t.isNullOrUndefined(a.startDate)?n:a.startDate;r=a.isMilestone?o:this.parent.dateValidationModule.checkEndDate(s,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",new Date(r.getTime()),a,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")}else this.updateSplitRightResizing(a);break;case"ParentDrag":case"ChildDrag":case"MilestoneDrag":case"ManualParentDrag":-1===this.segmentIndex||0===this.segmentIndex?this.updateChildDrag(a):this.setSplitTaskDrag(a)}},i.prototype.updateChildDrag=function(e){var i,r=this.getRoundOffStartLeft(e,this.roundOffDuration),n=this.getDateByLeft(r);0===this.segmentIndex?(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(n,e,null),e,!0),e.segments[0].startDate=n,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)):!t.isNullOrUndefined(e.endDate)&&t.isNullOrUndefined(e.startDate)?(i=this.parent.dateValidationModule.checkStartDate(n,e,null),i=this.parent.dateValidationModule.checkEndDate(i,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",i,e,!0)):(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(n,e,null),e,!0),t.isNullOrUndefined(e.duration)||this.parent.dateValidationModule.calculateEndDate(this.taskBarEditRecord))},i.prototype.updateSplitLeftResize=function(e){var i=e.segments[this.segmentIndex],r=0===this.segmentIndex?this.getRoundOffStartLeft(e,this.roundOffDuration):this.getRoundOffStartLeft(i,this.roundOffDuration),n=0===this.segmentIndex?this.getDateByLeft(r):this.getDateByLeft(e.left+r),a=this.parent.dataOperation.checkStartDate(n,e,!1),s=this.parent.dataOperation.getDuration(a,i.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);if(i.startDate=new Date(a.getTime()),i.duration=s,this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),0===this.segmentIndex&&this.parent.setRecordValue("startDate",i.startDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration"),!t.isNullOrUndefined(e.segments[this.segmentIndex-1])){var o=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);i.offsetDuration=o}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},i.prototype.updateSplitRightResizing=function(e){var i=e.segments[this.segmentIndex],r=this.getRoundOffEndLeft(e,this.roundOffDuration),n=this.getDateByLeft(r),a=this.parent.dataOperation.checkEndDate(n,e,!1),s=this.parent.dataOperation.getDuration(i.startDate,a,e.durationUnit,e.isAutoSchedule,e.isMilestone);if(i.endDate=new Date(a.getTime()),i.duration=s,!t.isNullOrUndefined(e.segments[this.segmentIndex+1])){var o=e.segments[this.segmentIndex+1],l=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,o.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);i.offsetDuration=l}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")},i.prototype.sumOfDuration=function(e){for(var t=0,i=0;i<e.length;i++){t+=e[i].duration}return t},i.prototype.setSplitTaskDrag=function(e){var i=e.segments[this.segmentIndex],r=this.getRoundOffStartLeft(i,this.roundOffDuration),n=this.getDateByLeft(e.left+r);if(n=this.parent.dateValidationModule.checkStartDate(n,e,null),i.startDate=n,i.endDate=this.parent.dataOperation.getEndDate(i.startDate,i.duration,e.durationUnit,e,!1),i.duration=this.parent.dataOperation.getDuration(i.startDate,i.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),t.isNullOrUndefined(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"endDate"),!t.isNullOrUndefined(e.segments[this.segmentIndex-1])){var a=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==i.startDate.getDay()||0!==a||this.parent.includeWeekend||(a=1),i.offsetDuration=a}if(!t.isNullOrUndefined(e.segments[this.segmentIndex+1])){var s=e.segments[this.segmentIndex+1];a=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,s.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==s.startDate.getDay()||0!==a||this.parent.includeWeekend||(a=1),s.offsetDuration=a}this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},i.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),0!==(s=this.parent.perDayWidth/24-this.parent.perDayWidth/24/a)&&(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),0!==(s=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/a)&&(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},i.prototype.getRoundOffStartLeft=function(e,i){var r=(t.isNullOrUndefined(e),e.left),n="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,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;return void 0===i&&(i=!1),i?i&&("Hour"===n?(a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Hour")/36e5),r-=s=this.parent.perDayWidth/24-this.parent.perDayWidth/24/a):"Minutes"===n?(a=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Minutes")/6e4),r-=s=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/a):r-=s):"Hour"!==n&&"Minutes"!==n&&(o<=.5?r-=s:o>.5&&(r=r-s+this.parent.perDayWidth/2)),r},i.prototype.getDateByLeft=function(e){var t=new Date(this.parent.timelineModule.timelineStartDate.toString()),i=864e5/this.parent.perDayWidth;t.setTime(t.getTime()+e*i);var r="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier;return"Hour"!==r&&"Minutes"!==r&&(this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&!this.parent.isInDst(t)?t.setTime(t.getTime()+36e5):!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&this.parent.isInDst(t)&&t.setTime(t.getTime()-36e5)),t},i.prototype.setItemPosition=function(){var e=this.taskBarEditRecord.ganttProperties,i=t.isNullOrUndefined(e.segments)?null:e.segments[this.segmentIndex],r="MilestoneDrag"===this.taskBarEditAction||e.isMilestone?this.parent.chartRowsModule.milestoneHeight:e.width,n=this.parent.isAdaptive?r-2:r-10;t.isNullOrUndefined(i)||(n=this.parent.isAdaptive?i.width-2:i.width-10);var a=this.taskBarEditElement.classList.contains(F)?this.taskBarEditElement:t.closest(this.taskBarEditElement,"tr."+X).querySelector("."+F),s=this.taskBarEditElement.classList.contains("e-segmented-taskbar"),o=t.closest(this.taskBarEditElement,"tr."+X).querySelector("."+I),l=t.closest(this.taskBarEditElement,"tr."+X).querySelector("."+E),d=this.taskBarEditElement.querySelector("."+te),p=this.taskBarEditElement.querySelector("."+ee),h=this.taskBarEditElement.querySelector("."+Q),c=this.taskBarEditElement.querySelector("."+Z),u=this.taskBarEditElement.querySelector("."+de),g=this.taskBarEditElement.querySelector("."+pe),f=this.taskBarEditElement.querySelector("."+Be),m=this.taskBarEditElement,y=this.taskBarEditElement.querySelector("."+re),v=this.taskBarEditElement.querySelector("."+le),D=this.taskBarEditElement.querySelector(".e-gantt-manualparenttaskbar-left");if("ConnectorPointRightDrag"!==this.taskBarEditAction&&"ConnectorPointLeftDrag"!==this.taskBarEditAction){if("ParentResizing"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction){if(!s||t.isNullOrUndefined(e.segments)||"RightResizing"!==this.taskBarEditAction&&0===this.segmentIndex||(this.taskBarEditElement.style.width=i.width+"px",this.taskBarEditElement.style.left=i.left+"px"),a.style.width=r+"px",a.style.left=e.left+"px",o.style.width=e.left+"px","LeftResizing"===this.taskBarEditAction&&0===this.segmentIndex)for(var w=this.taskBarEditElement.parentElement.getElementsByClassName("e-segmented-taskbar"),k=0;k<e.segments.length;k++){var T=e.segments[k],S=w[k];S.style.width=T.width+"px",S.style.left=T.left+"px"}t.isNullOrUndefined(l)||(l.style.left=e.left+r+"px")}f&&(f.style.left=(this.parent.isAdaptive?r+10:r+2)+"px"),"MilestoneDrag"===this.taskBarEditAction||e.isMilestone?(a.style.left=e.left-r/2+"px",o.style.width=e.left-r/2+"px",t.isNullOrUndefined(l)||(l.style.left=e.left+r/2+"px")):"ProgressResizing"===this.taskBarEditAction?-1===this.segmentIndex?(p.style.left=e.left+e.progressWidth-10+"px",t.isNullOrUndefined(d)||(d.style.width=e.progressWidth+"px",d.style.borderBottomRightRadius=this.progressBorderRadius+"px",d.style.borderTopRightRadius=this.progressBorderRadius+"px",h.style.left=e.progressWidth-8+"px")):(this.updateSegmentProgress(this.taskBarEditRecord.ganttProperties),d.style.width=e.segments[this.segmentIndex].progressWidth+"px",d.style.borderBottomRightRadius=this.progressBorderRadius+"px",d.style.borderTopRightRadius=this.progressBorderRadius+"px",h.style.left=e.segments[this.segmentIndex].progressWidth-8+"px"):"RightResizing"!==this.taskBarEditAction||t.isNullOrUndefined(p)?"ParentDrag"===this.taskBarEditAction?(t.isNullOrUndefined(u)||(u.style.width=r+"px"),t.isNullOrUndefined(d)||(g.style.width=e.progressWidth+"px")):"ParentResizing"===this.taskBarEditAction?(m.style.width=y.style.width=e.width+"px",v.style.left=e.width-D.offsetLeft+"px"):"ManualParentDrag"===this.taskBarEditAction?m.style.left=e.left-e.autoLeft+"px":(t.isNullOrUndefined(p)||s||(p.style.width=r+"px"),t.isNullOrUndefined(d)||(c.style.left=n+"px",d.style.width=e.progressWidth+"px",t.isNullOrUndefined(h)||(h.style.left=e.progressWidth-10+"px")),s&&(c.style.left=n+"px",d.style.width=i.progressWidth+"px",t.isNullOrUndefined(h)||(h.style.left=i.progressWidth-10+"px"))):(p.style.width=r+"px",t.isNullOrUndefined(d)||(d.style.width=e.progressWidth+"px",c.style.left=n+"px",t.isNullOrUndefined(h)||(h.style.left=e.progressWidth-10+"px")))}},i.prototype.mouseUpHandler=function(e){var i=this.isMouseDragged;if(this.previousMouseMove=null,this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),this.taskBarEditAction&&this.isMouseDragged)if(!this.dragMouseLeave&&this.taskBarEditedAction)this.taskBarEditedAction(e),this.isMouseDragged=!1;else if(this.parent.isOnEdit=!1,this.cancelTaskbarEditActionInMouseLeave(),this.parent.enableCriticalPath&&this.parent.criticalPathModule){var r=this.parent.criticalPathModule;r.criticalConnectorLine(r.criticalPathCollection,r.detailPredecessorCollection,!0,r.predecessorCollectionTaskIds)}"ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar&&!t.isNullOrUndefined(this.taskBarEditElement)&&(t.isNullOrUndefined(this.taskBarEditElement.querySelector(".e-gantt-child-taskbar"))||this.taskBarEditElement.querySelector(".e-gantt-child-taskbar").classList.contains("e-collapsed-taskbar-drag")&&(t.removeClass([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"),this.taskBarEditElement.style.zIndex=this.prevZIndex,this.prevZIndex="")),this.parent.isAdaptive&&!i||this.initPublicProp(),this.stopScrollTimer()},i.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).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?(i!==s||Math.abs(r-o)>=(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.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord,this.finalPredecessor)},i.prototype.cancelTaskbarEditActionInMouseLeave=function(){this.parent.editModule.reUpdatePreviousRecords(!0)},i.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)}},i.prototype.taskbarEdited=function(e){var i=t.extend({},e),r=i.data,n=r.ganttProperties;if("ProgressResizing"===i.taskBarEditAction)i.previousData.progress!==n.progress&&(this.parent.setRecordValue("progress",this.getProgressPercent(n.width,n.progressWidth),n,!0),r.parentItem&&this.parent.editModule.updateParentProgress(r.parentItem),t.isNullOrUndefined(n.segments)||this.updateSegmentProgress(n));else{var a=i.data.ganttProperties.segments;if(!t.isNullOrUndefined(a)&&a.length>0&&("LeftResizing"===this.taskBarEditAction&&0!==this.segmentIndex||"ChildDrag"===this.taskBarEditAction&&0!==this.segmentIndex||"RightResizing"===this.taskBarEditAction)){var s=a[this.segmentIndex],o=this.taskBarEditRecord.ganttProperties,l=0===this.segmentIndex?null:a[this.segmentIndex-1],d=this.segmentIndex===a.length-1?null:a[this.segmentIndex+1],p=t.isNullOrUndefined(d)?this.parent.cloneProjectEndDate:new Date(d.startDate.getTime()),h=t.isNullOrUndefined(l)?this.parent.cloneProjectStartDate:new Date(l.endDate.getTime());p.setHours(0,0,0,0),h.setHours(0,0,0,0);var c=new Date(s.startDate.getTime()),u=new Date(s.endDate.getTime());if(c.setDate(c.getDate()-1),u.setDate(u.getDate()+1),c.setHours(0,0,0,0),u.setHours(0,0,0,0),c.getTime()<=h.getTime()&&!t.isNullOrUndefined(l)&&!t.isNullOrUndefined(s)){var g=[{firstSegmentIndex:l.segmentIndex,secondSegmentIndex:s.segmentIndex}];this.parent.chartRowsModule.mergeTask(o.taskId,g)}else if(u.getTime()>=p.getTime()&&this.segmentIndex!==a.length-1){g=[{firstSegmentIndex:s.segmentIndex,secondSegmentIndex:d.segmentIndex}];this.parent.chartRowsModule.mergeTask(o.taskId,g)}else if(u.getTime()>=p.getTime()){s.endDate.setDate(this.parent.cloneProjectEndDate.getDate()-1),s.startDate=this.parent.dataOperation.getStartDate(s.endDate,s.duration,o.durationUnit,o);for(var f=a.length-2;f>=0;f++){var m=a[f],y=m.endDate;y.setDate(y.getDate()-m.offsetDuration),m.endDate=y,m.startDate=this.parent.dataOperation.getStartDate(m.endDate,m.duration,o.durationUnit,o)}}}this.parent.dataOperation.updateWidthLeft(i.data)}this.parent.dataOperation.updateTaskData(r),this.parent.editModule.initiateUpdateAction(i)},i.prototype.getProgressPercent=function(e,t){return Math.ceil(t/e*100)},i.prototype.drawFalseLine=function(){var e,i=this.mouseDownX,r=this.mouseDownY,n=this.mouseMoveX,a=this.mouseMoveY,s=Math.sqrt((i-n)*(i-n)+(r-a)*(r-a)),o="rotate("+180*Math.atan2(a-r,n-i)/Math.PI+"deg)";"ConnectorPointLeftDrag"===this.taskBarEditAction&&(e=this.elementOffsetLeft-this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),"ConnectorPointRightDrag"===this.taskBarEditAction&&(e=this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left);var l=this.elementOffsetTop+this.elementOffsetHeight/2+this.parent.ganttChartModule.chartBodyContainer.offsetTop-this.parent.ganttChartModule.scrollObject.previousScroll.top;this.removeFalseLine(!1),this.falseLine=t.createElement("div",{className:"e-gantt-false-line",id:"ganttfalseline"+this.parent.element.id,styles:"transform-origin: 0% 100%;right: auto;position: absolute;transform:"+o+";border-top-width: 1px;border-top-style: dashed;z-index: 5;width:"+(s-3)+"px;left:"+e+"px;top:"+l+"px;"}),this.parent.ganttChartModule.chartBodyContainer.appendChild(this.falseLine)},i.prototype.removeFalseLine=function(e){this.falseLine&&(t.remove(this.falseLine),this.falseLine=null,e&&(this.elementOffsetLeft=0,this.elementOffsetTop=0,this.elementOffsetWidth=0,this.elementOffsetHeight=0,t.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+De),[Ce])))},i.prototype.updateConnectorLineSecondProperties=function(e){var i=this.getElementByPosition(e),r=g(i,F);this.connectorSecondAction=null;var n=0;if(g(i,Ue)?(this.connectorSecondAction="ConnectorPointLeftDrag",this.toPredecessorText="Start"):g(i,Ve)?(this.connectorSecondAction="ConnectorPointRightDrag",this.toPredecessorText="Finish"):(this.connectorSecondAction=null,this.toPredecessorText=null),this.taskBarEditElement!==r&&this.taskBarEditElement!==this.highlightedSecondElement){if(this.parent.virtualScrollModule&&this.parent.enableVirtualization){n=this.parent.virtualScrollModule.getTopPosition()}(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&!this.elementOffsetLeft||!this.parent.enableVirtualization)&&(this.elementOffsetLeft=this.taskBarEditElement.offsetLeft,this.elementOffsetTop=this.taskBarEditElement.offsetTop+n,this.elementOffsetWidth=this.taskBarEditElement.offsetWidth,this.elementOffsetHeight=this.taskBarEditElement.offsetHeight),this.showHideTaskBarEditingElements(r,this.highlightedSecondElement,!0)}t.isNullOrUndefined(this.connectorSecondAction)&&!t.isNullOrUndefined(this.connectorSecondElement)&&(this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),t.removeClass([this.connectorSecondElement.querySelector("."+Ue)],[Ae]),t.removeClass([this.connectorSecondElement.querySelector("."+Ve)],[Ae])),this.connectorSecondElement=this.connectorSecondAction?r:null,this.highlightedSecondElement=r,this.connectorSecondRecord=t.isNullOrUndefined(this.connectorSecondElement)?null:this.parent.ganttChartModule.getRecordByTaskBar(this.connectorSecondElement)},i.prototype.triggerDependencyEvent=function(e,i){var r,n,a=this.taskBarEditRecord.ganttProperties,s=this.connectorSecondRecord?this.connectorSecondRecord.ganttProperties:null,o=this.getElementByPosition(e),l=o,d="ResourceView"===this.parent.viewType?a.taskId:a.rowUniqueID;if("ConnectorPointLeftDrag"===this.taskBarEditAction?r=d+"S":"ConnectorPointRightDrag"===this.taskBarEditAction&&(r=d+"F"),this.connectorSecondAction&&("ConnectorPointLeftDrag"===this.connectorSecondAction?(r+="S",n="start"):"ConnectorPointRightDrag"===this.connectorSecondAction&&(r+="F",n="finish")),t.isNullOrUndefined(s))this.drawPredecessor=!1;else{s.predecessorsName?this.finalPredecessor=s.predecessorsName+","+r:this.finalPredecessor=r;var p=this.parent.connectorLineEditModule.validatePredecessorRelation(this.connectorSecondRecord,this.finalPredecessor),h=this.parent.predecessorModule.calculatePredecessor(r,this.connectorSecondRecord),c={};if(c.fromItem=a,c.toItem=s,c.newPredecessorString=this.finalPredecessor,c.predecessor=h&&h[0],c.isValidLink=p,c.requestType="ValidateDependency",this.parent.trigger("actionBegin",c),c.isValidLink=!(!p&&c.isValidLink)&&c.isValidLink,c.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 u=this.parent.connectorLineModule.tooltipTable.querySelector("#toPredecessor").querySelectorAll("td");u[1].innerText=s.taskName,u[2].innerText=this.parent.localeObj.getConstant(n);var g=this.parent.connectorLineModule.tooltipTable.parentElement.parentElement;g.offsetTop+g.offsetHeight>e.pageY&&(g.style.top=e.pageY-g.offsetHeight-20+"px")}this.drawPredecessor=!0}else this.parent.isAdaptive?(o.classList.contains(Ue)||o.classList.contains(Ve))&&this.showHideActivePredecessors(!0):t.addClass([l],[Ae]),this.drawPredecessor=!1}},i.prototype.getCoordinate=function(e){var t={};if(this.parent.isAdaptive&&e&&"click"!==e.type){"touchmove"!==(i=e).type&&"touchstart"!==i.type&&"touchend"!==i.type||(t.pageX=i.changedTouches[0].pageX,t.pageY=i.changedTouches[0].pageY)}else if(e){var i=e;t.pageX=i.pageX,t.pageY=i.pageY}return t},i.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},i.prototype.multipleSelectionEnabled=function(){this.parent.selectionModule&&"Cell"!==this.parent.selectionSettings.mode&&"Multiple"===this.parent.selectionSettings.type&&this.parent.selectionModule.hidePopUp()},i.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))},i.prototype.destroy=function(){this.unWireEvents(),this.stopScrollTimer(),this.parent.editModule.taskbarEditModule=void 0},i}(M),pi=function(){function e(e){this.updatedEditFields=null,this.updatedAddFields=null,this.addedRecord=null,this.dialogEditValidationFlag=!1,this.ganttResources=[],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:p.CheckBox,dropdownedit:c.DropDownList,datepickeredit:h.DatePicker,datetimepickeredit:h.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 i=this.parent.ganttChartModule.getRecordByTarget(e);!t.isNullOrUndefined(i)&&this.parent.editModule&&this.parent.editSettings.allowEditing&&this.openEditDialog(i)},e.prototype.processDialogFields=function(){t.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),t.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 i=[],n=0,a=0;a<e.length;a++){var s=r.getActualProperties(e[a]);"General"!==s.type||!t.isNullOrUndefined(s.fields)&&0!==s.fields.length||(s.fields=this.getGeneralColumnFields()),"Dependency"===s.type&&t.isNullOrUndefined(this.parent.taskFields.dependency)||"Resources"===s.type&&t.isNullOrUndefined(this.parent.taskFields.resourceInfo)||"Notes"===s.type&&t.isNullOrUndefined(this.parent.taskFields.notes)||("Custom"!==s.type||!t.isNullOrUndefined(s.fields)&&0!==s.fields.length||(n+=1,s.fields=this.getCustomColumnFields()),n>1||i.push(s))}return i},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=[],i={},r=this.parent.taskFields,n=this.parent.columnMapping;return 0!==Object.keys(n).length&&(i.type="General",e.push(i)),t.isNullOrUndefined(t.getValue("dependency",n))||(i={},!1!==this.parent.columnByField[n.dependency.valueOf()].visible&&(i.type="Dependency"),e.push(i)),t.isNullOrUndefined(t.getValue("resourceInfo",n))||(i={},!1!==this.parent.columnByField[n.resourceInfo.valueOf()].visible&&(i.type="Resources"),e.push(i)),t.isNullOrUndefined(t.getValue("notes",n))||(i={},!1!==this.parent.columnByField[n.notes.valueOf()].visible&&(i.type="Notes"),e.push(i)),t.isNullOrUndefined(t.getValue("segments",r))||((i={}).type="Segments",e.push(i)),this.parent.customColumns.length>0&&((i={}).type="Custom",e.push(i)),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=t.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 i=this.parent.ganttColumns,r=this.parent.taskFields,n=this.parent.editModule.getNewTaskId(),a=0;a<i.length;a++){var s=i[a].field;s===r.id?(e[s]=n,e.ganttProperties.rowUniqueID=e[s]):i[a].field===r.startDate?(t.isNullOrUndefined(e[r.endDate])?e[s]=this.getMinimumStartDate():e[s]=new Date(e[r.endDate]),this.parent.timezone&&(e[s]=this.parent.dateValidationModule.remove(e[s],this.parent.timezone)),e.ganttProperties.startDate=new Date(e[s])):i[a].field===r.endDate?(t.isNullOrUndefined(e[r.startDate])?e[s]=this.getMinimumStartDate():e[s]=new Date(e[r.startDate]),this.parent.timezone&&(e[s]=this.parent.dateValidationModule.remove(e[s],this.parent.timezone)),e.ganttProperties.endDate=new Date(e[s])):i[a].field===r.duration?(e[s]=1,e.ganttProperties.duration=e[s],e.ganttProperties.durationUnit=this.parent.durationUnit.toLocaleLowerCase()):i[a].field===r.name?(e[s]=this.localeObj.getConstant("addDialogTitle")+" "+n,e.ganttProperties.taskName=e[s]):i[a].field===r.progress?(e[s]=0,e.ganttProperties.progress=e[s]):i[a].field===r.work?(e[s]=0,e.ganttProperties.work=e[s]):"taskType"===i[a].field?(e[s]=this.parent.taskType,e.ganttProperties.taskType=e[s]):e[this.parent.ganttColumns[a].field]=""}return e.ganttProperties.isAutoSchedule="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[r.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 i=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;t.isNullOrUndefined(i)||this.openEditDialog(i)}},e.prototype.openEditDialog=function(e){var i=this.parent;"object"!=typeof e||t.isNullOrUndefined(e)?t.isNullOrUndefined(e)?i.selectedRowIndex>-1&&(this.rowData=i.currentViewData[i.selectedRowIndex],this.rowIndex=i.selectedRowIndex):(this.rowIndex=i.ids.indexOf(e.toString()),this.rowIndex>-1&&(this.rowData=i.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=t.extend({},{},this.rowData,!0),this.createDialog())},e.prototype.createDialog=function(){var e=this,i=this.parent,r={};this.beforeOpenArgs.dialogModel=r,this.beforeOpenArgs.rowData=this.editedRecord,this.beforeOpenArgs.rowIndex=this.rowIndex;var n=this.parent.isAdaptive?"":"600px",a=this.parent.createElement("div",{id:i.element.id+"_dialog",styles:"max-width:"+n});i.element.appendChild(a),r.animationSettings={effect:"None"},r.header=this.localeObj.getConstant(this.isEdit?"editDialogTitle":"addDialogTitle"),r.isModal=!0,r.cssClass="e-gantt-dialog",r.allowDragging=!this.parent.isAdaptive,r.showCloseIcon=!0;var s=this.parent.isAdaptive?{X:"top",Y:"left"}:{X:"center",Y:"center"};r.position=s,r.height=this.parent.isAdaptive?"100%":"auto",r.target=document.body,r.close=this.dialogClose.bind(this),r.closeOnEscape=!0,r.beforeClose=function(e){"escape"==e.closedBy&&"key-pressed"==e.event.name&&"INPUT"==e.event.target.nodeName&&(e.cancel=!0)},r.open=function(i){var r=t.getValue("element",i),n=r.querySelector("#"+e.parent.element.id+"GeneralTabContainer");n&&n.scrollHeight>n.offsetHeight&&n.classList.add("e-scroll"),0===e.tabObj.selectedItem&&e.tabObj.select(0),e.parent.isAdaptive&&(r.style.maxHeight="none"),e.parent.focusModule&&e.parent.focusModule.setActiveElement(r)},r.locale=this.parent.locale,r.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(r,a)},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(),t.isNullOrUndefined(this.parent.focusModule)||t.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(),t.remove(this.dialog))},e.prototype.destroyDialogInnerElements=function(){for(var e=this.parent,i=this.beforeOpenArgs.tabModel.items,r=0;r<i.length;r++){var n=i[r].content,a=n.id;if(!t.isNullOrUndefined(a)||""!==a)if(a=a.replace(e.element.id,""),"General"===(a=a.replace("TabContainer","")))this.destroyCustomField(n);else if("Dependency"===a){n.ej2_instances[0].destroy()}else if("Notes"===a){n.ej2_instances[0].destroy()}else if("Resources"===a){n.ej2_instances[0].destroy()}else-1!==a.indexOf("Custom")&&this.destroyCustomField(n)}},e.prototype.destroyCustomField=function(e){for(var i=e.childNodes,n=this.parent,a=0;a<i.length;a++){var s=i[a],o=s.querySelector('input[id^="'+n.element.id+'"]');if(o){var l=o.id.replace(n.element.id,""),d=s.querySelector("#"+n.element.id+l).ej2_instances[0];if(!t.isNullOrUndefined(d)){var p=n.columnByField[l];if(!t.isNullOrUndefined(p.edit)&&t.isNullOrUndefined(p.edit.params)){var h=p.edit.destroy;"string"==typeof h?(h=r.getObject(h,window))():p.edit.destroy()}else d.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,r){var n,a=this,s=this.parent,l={},d=[],p=this.getEditFields(),h=s.taskFields,c=p.length;l.items=d,l.locale=this.parent.locale,this.beforeOpenArgs.tabModel=l;var u=0;if(c>0)for(var g=0;g<c;g++){var f=p[g],m={};if("General"===f.type){if(0===Object.keys(s.columnMapping).length)continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("generalTab")),m.content="General",this.beforeOpenArgs[m.content]=this.getFieldsModel(f.fields)}else if("Segments"===f.type){if(t.isNullOrUndefined(h.segments))continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("segments")),m.content="Segments",this.beforeOpenArgs[m.content]=this.getSegmentsModel(f.fields)}else if("Dependency"===f.type){if(t.isNullOrUndefined(h.dependency))continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("dependency")),m.content="Dependency",this.beforeOpenArgs[m.content]=this.getPredecessorModel(f.fields)}else if("Resources"===f.type){if(t.isNullOrUndefined(h.resourceInfo))continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("resourceName")),m.content="Resources",this.beforeOpenArgs[m.content]=this.getResourcesModel(f.fields)}else if("Notes"===f.type){if(t.isNullOrUndefined(h.notes))continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("notes")),m.content="Notes",this.beforeOpenArgs[m.content]=this.getNotesModel(f.fields)}else{if(t.isNullOrUndefined(f.fields)||0===f.fields.length)continue;t.isNullOrUndefined(f.headerText)&&(f.headerText=this.localeObj.getConstant("customTab")),m.content="Custom"+u++,this.beforeOpenArgs[m.content]=this.getFieldsModel(f.fields)}m.header={text:f.headerText},d.push(m)}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(t){if(a.renderTabItems(),!t.cancel){l.selected=a.tabSelectedEvent.bind(a),l.height=a.parent.isAdaptive?"100%":"auto",l.overflowMode="Scrollable",a.tabObj=new o.Tab(l),a.tabObj.isStringTemplate=!0,n=a.parent.createElement("div",{id:s.element.id+"_Tab"}),a.tabObj.appendTo(n),e.content=n,a.dialog=r,a.dialogObj=new i.Dialog(e),a.dialogObj.isStringTemplate=!0,a.dialogObj.appendTo(a.dialog);var d={action:"OpenDialog",requestType:a.isEdit?"openEditDialog":"openAddDialog",data:a.beforeOpenArgs.rowData,element:a.dialog,cancel:!1};a.parent.trigger("actionComplete",d,function(e){e.cancel&&a.resetValues()})}})},e.prototype.tabSelectedEvent=function(e){var i=this.parent,r=e.selectedContent.childNodes[0].id;if(this.parent.isAdaptive&&this.responsiveTabContent(r,i),r===i.element.id+"ResourcesTabContainer")this.resourceSelection(r);else if(r===i.element.id+"NotesTabContainer"){document.getElementById(r).ej2_instances[0].refresh();document.querySelector("#"+this.parent.element.id+"NotesTabContainer").style.overflow="scroll"}else r===i.element.id+"SegmentsTabContainer"&&(t.isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)?document.getElementById(r).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!1):document.getElementById(r).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 i={},r=this.parent.columnByField,n=0;n<e.length;n++)if(e[n]!==this.parent.taskFields.dependency&&e[n]!==this.parent.taskFields.resourceInfo&&e[n]!==this.parent.taskFields.notes&&!t.isNullOrUndefined(r[e[n]])){var a=e[n];this.createInputModel(r[a],i)}return i},e.prototype.createInputModel=function(e,i){var r=this,n=this.parent,a=this.parent.locale,s=this.parent.taskFields,o={placeholder:e.headerText,floatLabelType:"Auto"};switch(e.editType){case"booleanedit":var l={label:e.headerText,locale:a};i[e.field]=l;break;case"defaultedit":case"stringedit":var d=o;e.field!==n.columnMapping.duration&&e.field!==n.columnMapping.startDate&&e.field!==n.columnMapping.endDate||(d.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=o;break;case"numericedit":var p=o;s.progress===e.field&&(p.min=0,p.max=100),s.work===e.field&&(p.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=p;break;case"datepickeredit":var h=o;h.format=this.parent.getDateFormat(),h.strictMode=!0,h.firstDayOfWeek=n.timelineModule.customTimelineSettings.weekStartDay,e.field!==n.columnMapping.startDate&&e.field!==n.columnMapping.endDate||(h.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),h.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=h;break;case"datetimepickeredit":var c=o;c.format=this.parent.getDateFormat(),c.strictMode=!0,c.firstDayOfWeek=n.timelineModule.customTimelineSettings.weekStartDay,e.field!==n.columnMapping.startDate&&e.field!==n.columnMapping.endDate||(c.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),c.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=c;break;case"dropdownedit":if("taskType"===e.field||e.field===n.columnMapping.manual){o.dataSource=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}],o.fields={value:"Value"};o.change=function(t){e.field===s.manual&&(r.editedRecord.ganttProperties.isAutoSchedule=!t.value),r.validateScheduleFields(t,e,n)}}i[e.field]=o;break;case"maskededit":i[e.field]=o}return t.isNullOrUndefined(e.edit)||t.isNullOrUndefined(e.edit.params)||t.extend(i[e.field],e.edit.params),i},e.prototype.validateScheduleFields=function(e,i,r){var n,a=r.editModule.dialogModule.dialog,s=null,o=r.editModule.dialogModule.editedRecord,l=null,d=null;if(t.isNullOrUndefined(e.element)?t.isNullOrUndefined(e.container)?t.isNullOrUndefined(e.event)||t.isNullOrUndefined(e.event.path[1])||(s=(n=e.event.path[1]).querySelector("input").getAttribute("id"),n=n.querySelector("#"+s)):(s=(n=e.container).querySelector("input").getAttribute("id"),n=n.querySelector("#"+s)):s=(n=e.element).getAttribute("id"),t.isNullOrUndefined(n)?(l=e.value,d=i.field):(l=n.value,d=s.replace(r.element.id,"")),0===d.search("Segments"))return d=d.replace("SegmentsTabContainer",""),this.validateSegmentFields(r,d,l,e),!0;this.validateScheduleValuesByCurrentField(d,l,this.editedRecord);var p=o.ganttProperties,h=r.taskFields;return t.isNullOrUndefined(h.startDate)||h.startDate===d||this.updateScheduleFields(a,p,"startDate"),t.isNullOrUndefined(h.endDate)||h.endDate===d||this.updateScheduleFields(a,p,"endDate"),t.isNullOrUndefined(h.duration)||h.duration===d||this.updateScheduleFields(a,p,"duration"),t.isNullOrUndefined(h.work)||h.work===d||this.updateScheduleFields(a,p,"work"),this.dialogEditValidationFlag=!1,!0},e.prototype.updateScheduleFields=function(e,i,r){var n,a=this.parent,s=a.element.id,o=t.getValue(r,a.columnMapping),l=a.columnByField[o],d=this.parent.taskFields;if("stringedit"===l.editType){var p=e.querySelector("#"+s+o).ej2_instances[0];n=t.isNullOrUndefined(l.edit)||t.isNullOrUndefined(l.edit.read)?t.isNullOrUndefined(l.valueAccessor)?this.parent.dataOperation.getDurationString(i.duration,i.durationUnit):l.valueAccessor(o,a.editModule.dialogModule.editedRecord,l):l.edit.read(),p.value!==n.toString()&&d.duration===o?(p.value=n,p.dataBind()):d.startDate!==o&&d.endDate!==o||(p.value=d.startDate===o?i.startDate.toString():i.endDate.toString(),p.dataBind())}else if("datepickeredit"===l.editType||"datetimepickeredit"===l.editType){var h=(l.editType,e.querySelector("#"+s+o).ej2_instances[0]);n=i[r],(t.isNullOrUndefined(h.value)&&!t.isNullOrUndefined(n)||t.isNullOrUndefined(n)&&!t.isNullOrUndefined(h.value)||h.value!==n&&!t.isNullOrUndefined(h.value)&&!t.isNullOrUndefined(n)&&h.value.toString()!==n.toString())&&(h.value=n,h.dataBind())}else if("numericedit"===l.editType){var c=e.querySelector("#"+s+o).ej2_instances[0];n=i[r],t.isNullOrUndefined(n)||c.value===n||(c.value=n,c.dataBind())}},e.prototype.validateDuration=function(e){var i=e.ganttProperties;if(!this.dialogEditValidationFlag){t.isNullOrUndefined(i.duration)?(this.parent.setRecordValue("endDate",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0)):f(i)||!t.isNullOrUndefined(i.startDate)?(e.ganttProperties.isMilestone&&0!==e.ganttProperties.duration&&this.parent.dateValidationModule.checkStartDate(i.startDate),this.parent.dateValidationModule.calculateEndDate(e)):f(i)||t.isNullOrUndefined(i.endDate)||this.parent.dateValidationModule.calculateStartDate(e);var r=0===i.duration;this.parent.setRecordValue("isMilestone",r,i,!0),this.dialogEditValidationFlag=!0}},e.prototype.validateStartDate=function(e){var i=e.ganttProperties,r=this.parent.taskFields;this.dialogEditValidationFlag||(t.isNullOrUndefined(i.startDate)?(this.parent.setRecordValue("duration",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0),this.parent.allowUnscheduledTasks&&t.isNullOrUndefined(r.endDate)&&this.parent.setRecordValue("endDate",null,i,!0)):f(i)?t.isNullOrUndefined(r.duration)?this.parent.dateValidationModule.calculateDuration(e):(t.isNullOrUndefined(r.endDate),this.parent.dateValidationModule.calculateEndDate(e)):t.isNullOrUndefined(i.endDate)?t.isNullOrUndefined(i.duration)||this.parent.dateValidationModule.calculateEndDate(e):this.parent.dateValidationModule.calculateDuration(e),this.dialogEditValidationFlag=!0)},e.prototype.validateEndDate=function(e){var i=e.ganttProperties,r=this.parent.taskFields;this.dialogEditValidationFlag||(t.isNullOrUndefined(i.endDate)?(this.parent.setRecordValue("duration",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0)):f(i)?t.isNullOrUndefined(r.duration)?this.parent.dateValidationModule.calculateDuration(e):t.isNullOrUndefined(i.startDate)?this.parent.dateValidationModule.calculateStartDate(e):(!t.isNullOrUndefined(i.segments)&&i.segments.length>0&&(i.segments=this.parent.editModule.cellEditModule.validateEndDateWithSegments(i)),this.parent.dateValidationModule.calculateDuration(e)):t.isNullOrUndefined(i.duration)?t.isNullOrUndefined(i.startDate)||this.parent.dateValidationModule.calculateDuration(e):this.parent.dateValidationModule.calculateStartDate(e),this.dialogEditValidationFlag=!0)},e.prototype.validateScheduleValuesByCurrentField=function(e,i,r){var n=this.parent,a=r.ganttProperties,s=n.taskFields;if(s.duration===e&&(t.isNullOrUndefined(i)||""===i?n.allowUnscheduledTasks&&this.parent.setRecordValue("duration",null,a,!0):n.dataOperation.updateDurationValue(i,a),this.validateDuration(r),this.parent.editModule.updateResourceRelatedFields(r,"duration")),s.startDate===e){if(""!==i){var o=this.parent.dateValidationModule.getDateFromFormat(i);o=this.parent.dateValidationModule.checkStartDate(o,a),this.parent.setRecordValue("startDate",o,a,!0)}else n.allowUnscheduledTasks&&!r.hasChildRecords&&this.parent.setRecordValue("startDate",null,a,!0);this.validateStartDate(r)}if(s.endDate===e){if(""!==i){var l=this.parent.dateValidationModule.getDateFromFormat(i);0===l.getHours()&&86400!==n.defaultEndTime&&this.parent.dateValidationModule.setTime(n.defaultEndTime,l),l=this.parent.dateValidationModule.checkEndDate(l,a),(t.isNullOrUndefined(a.startDate)||l.getTime()>a.startDate.getTime())&&this.parent.setRecordValue("endDate",l,a,!0)}else n.allowUnscheduledTasks&&this.parent.setRecordValue("endDate",null,a,!0);this.validateEndDate(r)}return s.work===e&&(t.isNullOrUndefined(i)||""===i||(this.parent.setRecordValue("work",i,a,!0),this.parent.editModule.updateResourceRelatedFields(r,"work"),this.validateDuration(r))),"taskType"===e&&this.parent.setRecordValue("taskType",i,a,!0),s.manual===e&&this.parent.editModule.updateTaskScheduleModes(r),!0},e.prototype.getSegmentsModel=function(e){var i=this,r=this.parent.taskFields;(t.isNullOrUndefined(e)||0===e.length)&&(e=[],t.isNullOrUndefined(r.startDate)||e.push("startDate"),t.isNullOrUndefined(r.endDate)||e.push("endDate"),t.isNullOrUndefined(r.duration)||e.push("duration"));var n={};n.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal",newRowPosition:"Bottom"},n.locale=this.parent.locale,n.dataSource=[],n.rowHeight=this.parent.isAdaptive?48:null,n.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 a=[],s=function(r){var n={};switch(e[r]){case"startDate":case"endDate":n={field:e[r],headerText:o.localeObj.getConstant(e[r]),editType:"stringedit",width:"200px",edit:{write:function(n){var a;if(t.isNullOrUndefined(i.beforeOpenArgs.General)){var s=i.getGeneralColumnFields();a=i.getFieldsModel(s)[i.parent.taskFields[e[r]]]}else a=i.beforeOpenArgs.General[i.parent.taskFields[e[r]]];var o=n.rowData[n.column.field];t.setValue("value",o,a);new i.inputs[i.parent.columnByField[i.parent.taskFields[e[r]]].editType](a).appendTo(n.element)},read:function(e){return e.ej2_instances[0].value}},format:o.parent.getDateFormat()},"startDate"===e[r]&&(n.validationRules={required:!0}),a.push(n);break;case"duration":n={field:e[r],headerText:o.localeObj.getConstant(e[r]),editType:"stringedit",width:"100px",edit:{write:function(n){var a;if(t.isNullOrUndefined(i.beforeOpenArgs.General)){var s=i.getGeneralColumnFields();a=i.getFieldsModel(s)[i.parent.taskFields[e[r]]]}else a=i.beforeOpenArgs.General[i.parent.taskFields[e[r]]];a.floatLabelType="Never";var o=n.rowData[n.column.field];t.isNullOrUndefined(o)?t.setValue("value",null,a):t.setValue("value",o,a),t.setValue("value",o,a);new d.TextBox(a).appendTo(n.element)},read:function(e){return e.ej2_instances[0].value.toString()}}},a.push(n)}},o=this,l=0;l<e.length;l++)s(l);return n.columns=a,n.height=this.parent.isAdaptive?"100%":"153px",n},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,i,r){var n,a=this.parent.editModule.dialogModule.dialog,s=t.getValue("Segments",this.beforeOpenArgs),o=this.getGridColumnByField(e,s.columns),l=this.parent.element.id,d=r[e];"stringedit"===o.editType?n=a.querySelector("#"+l+"SegmentsTabContainer"+e).ej2_instances[0]:"datepickeredit"===o.editType&&(n=a.querySelector("#"+l+"SegmentsTabContainer"+e).ej2_instances[0]),n.value.toString()!==d.toString()&&(n.value=d,n.dataBind())},e.prototype.validateSegmentFields=function(e,i,r,n){var a=this.parent.taskFields;if(!t.isNullOrUndefined(a.duration)&&a.duration.toLowerCase()===i.toLowerCase()&&!t.isNullOrUndefined(r)&&""!==r){this.selectedSegment.duration=Number(r);var s=e.dataOperation.getEndDate(this.selectedSegment.startDate,Number(r),this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1);s=e.dataOperation.checkEndDate(s,this.editedRecord.ganttProperties,!1),this.selectedSegment.endDate=s}if(!t.isNullOrUndefined(a.startDate)&&a.startDate.toLowerCase()===i.toLowerCase()&&""!==r){var o=this.parent.dateValidationModule.getDateFromFormat(r);o=this.parent.dateValidationModule.checkStartDate(o),this.selectedSegment.startDate=o,t.isNullOrUndefined(a.endDate)||(this.selectedSegment.endDate=this.parent.dataOperation.getEndDate(o,this.selectedSegment.duration,this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1))}if(!t.isNullOrUndefined(a.endDate)&&a.endDate.toLowerCase()===i.toLowerCase()&&""!==r){0===(s=this.parent.dateValidationModule.getDateFromFormat(r)).getHours()&&86400!==e.defaultEndTime&&this.parent.dateValidationModule.setTime(e.defaultEndTime,s),s=this.parent.dateValidationModule.checkEndDate(s,this.editedRecord.ganttProperties),this.selectedSegment.endDate=s,this.selectedSegment.duration=this.parent.dataOperation.getDuration(this.selectedSegment.startDate,this.selectedSegment.endDate,this.editedRecord.ganttProperties.durationUnit,!0,!1,!0)}t.isNullOrUndefined(a.startDate)||this.updateSegmentField("startDate",n,this.selectedSegment),t.isNullOrUndefined(a.endDate)||this.updateSegmentField("endDate",n,this.selectedSegment),t.isNullOrUndefined(a.duration)||this.updateSegmentField("duration",n,this.selectedSegment)},e.prototype.getPredecessorModel=function(e){(t.isNullOrUndefined(e)||0===e.length)&&(e=["ID","Name","Type","Offset","UniqueId"]);var i={};i.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal"},i.locale=this.parent.locale,i.dataSource=[],i.rowHeight=this.parent.isAdaptive?48:null,i.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 r=[],n=0;n<e.length;n++){var a={};"id"===e[n].toLowerCase()?(a={field:"id",headerText:this.localeObj.getConstant("id"),allowEditing:!1,width:"70px"},r.push(a)):"name"===e[n].toLowerCase()?(a={field:"name",headerText:this.localeObj.getConstant("name"),editType:"stringedit",width:"250px",validationRules:{required:!0}},r.push(a)):"type"===e[n].toLowerCase()?(a={field:"type",headerText:this.localeObj.getConstant("type"),editType:"dropdownedit",dataSource:this.types,foreignKeyField:"id",foreignKeyValue:"text",defaultValue:"FS",validationRules:{required:!0},width:"150px"},r.push(a)):"offset"===e[n].toLowerCase()?(a={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"},r.push(a)):"uniqueid"===e[n].toLowerCase()&&(a={field:"uniqueId",isPrimaryKey:!0,visible:!1,defaultValue:P().toString()},r.push(a))}return i.columns=r,i.height=this.parent.isAdaptive?"100%":"153px",i},e.prototype.getResourcesModel=function(e){var i=this.parent.resourceFields;(t.isNullOrUndefined(e)||0===e.length)&&(e=[i.id,i.name,i.unit,i.group]);for(var r={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"}},n=[{type:"checkbox",allowEditing:!1,allowSorting:!1,allowFiltering:!1,width:60}],a=0;a<e.length;a++){var s={};e[a]===i.id?(s={field:i.id,headerText:this.localeObj.getConstant("id"),isPrimaryKey:!0,width:"100px",allowEditing:!1},n.push(s)):e[a]===i.name?(s={field:i.name,headerText:this.localeObj.getConstant("name"),allowEditing:!1},n.push(s)):e[a]===i.unit?(s={field:i.unit,headerText:this.localeObj.getConstant("unit"),editType:"numericedit",edit:{params:{min:0}}},n.push(s)):e[a]!==i.group||t.isNullOrUndefined(i.group)||(s={field:i.group,headerText:this.localeObj.getConstant("group"),allowEditing:!1},n.push(s))}return r.columns=n,r.height=this.parent.isAdaptive?"100%":"196px",r},e.prototype.getNotesModel=function(e){(t.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"]);return{placeholder:this.localeObj.getConstant("writeNotes"),toolbarSettings:{items:e},height:this.parent.isAdaptive?"100%":"auto",locale:this.parent.locale}},e.prototype.createDivElement=function(e,i){return t.createElement("div",{className:e,id:i})},e.prototype.createInputElement=function(e,i,r,n){return t.createElement(n||"input",{className:e,attrs:{type:"text",id:i,name:r,title:r}})},e.prototype.renderTabItems=function(){for(var e=this.beforeOpenArgs.tabModel.items,t=0,i=0;i<e.length;i++){var r=e[i];r.content instanceof HTMLElement||("General"===r.content?r.content=this.renderGeneralTab(r.content):"Dependency"===r.content?(this.editedRecord.hasChildRecords&&(r.disabled=!0),r.content=this.renderPredecessorTab(r.content)):"Resources"===r.content?r.content=this.renderResourceTab(r.content):r.content==="Custom"+t?(r.content=this.renderCustomTab(r.content),t++):"Notes"===r.content?r.content=this.renderNotesTab(r.content):"Segments"===r.content&&(this.editedRecord.hasChildRecords&&(r.disabled=!0),r.content=this.renderSegmentsTab(r.content)))}},e.prototype.segmentGridActionBegin=function(e){var i=this.parent.taskFields,r=this.beforeOpenArgs.Segments;if("add"===e.requestType||"beginEdit"===e.requestType||"save"===e.requestType){var n=r.dataSource,a=t.getValue("rowData",e),s=this.beforeOpenArgs.rowData.ganttProperties.startDate;if(!t.isNullOrUndefined(s)&&"add"===e.requestType){var o={},l=t.getValue("startDate",a),d=t.getValue("endDate",a),p=(t.getValue("duration",a),!t.isNullOrUndefined(n)&&n.length>0?t.isNullOrUndefined(i.endDate)?new Date(t.getValue("startDate",n[0]).getTime()):new Date(t.getValue("endDate",n[0]).getTime()):!t.isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)&&new Date(this.beforeOpenArgs.rowData.ganttProperties.startDate.getTime()));p.setHours(0,0,0,0),!t.isNullOrUndefined(n)&&n.length>0&&p.setDate(p.getDate()+2),l=this.parent.dataOperation.checkStartDate(p),0===(d=this.parent.dateValidationModule.getDateFromFormat(l)).getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,d),o={startDate:l,endDate:d=!t.isNullOrUndefined(i.endDate)&&!t.isNullOrUndefined(n)&&n.length<=0?this.beforeOpenArgs.rowData.ganttProperties.endDate:d,duration:!t.isNullOrUndefined(i.duration)&&!t.isNullOrUndefined(n)&&n.length<=0?this.beforeOpenArgs.rowData.ganttProperties.duration:1},e.rowData=o}this.selectedSegment=e.rowData}},e.prototype.renderSegmentsTab=function(e){var i=this.parent,n=this.beforeOpenArgs[e],a=this.beforeOpenArgs.rowData,s=[];this.isEdit&&(s=t.isNullOrUndefined(a.ganttProperties.segments)?[]:a.ganttProperties.segments),n.dataSource=s,n.actionBegin=this.segmentGridActionBegin.bind(this),r.Grid.Inject(r.Edit,r.Page,r.Toolbar,r.ForeignKey);var o=new r.Grid(n),l=this.createDivElement("",i.element.id+""+e+"TabContainer");return o.appendTo(l),l},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 i=!1;return(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)&&(-1!==this.parent.customColumns.indexOf(e.field)?i=!0: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&&"taskType"!==e.field||(i=!0)),this.isEdit&&(e.field===this.parent.taskFields.id&&(i=!0),this.editedRecord.hasChildRecords&&(e.field===this.parent.taskFields.endDate&&(!t.isNullOrUndefined(this.editedRecord.isManual)&&0==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||"taskType"===e.field)&&(i=!0)),i},e.prototype.renderPredecessorTab=function(e){var i=this,a=this.parent,s=this.beforeOpenArgs[e],o=this.parent.columnByField[this.parent.taskFields.dependency];(!1===o.allowEditing||o.isPrimaryKey||this.parent.readOnly)&&(s.editSettings.allowEditing=!1,s.editSettings.allowAdding=!1,s.editSettings.allowDeleting=!1);var l=this.beforeOpenArgs.rowData,d=[];this.taskNameCollection(),this.isEdit&&(d=this.predecessorEditCollection(l),this.updatePredecessorDropDownData(l)),s.dataSource=d,s.actionBegin=this.gridActionBegin.bind(this);s.columns[1].edit={write:function(e){"add"===t.getValue("requestType",e)&&t.setValue("rowData.uniqueId",P(),e);new c.ComboBox({dataSource:new n.DataManager(i.idCollection),popupHeight:"180px",allowCustom:!1,fields:{value:"text"},value:e.rowData.name,change:function(e){var r=t.closest(e.element,"tr").querySelector("#"+i.parent.element.id+"DependencyTabContainerid");r&&(t.isNullOrUndefined(e.itemData)||t.isNullOrUndefined(e.item)?r.value="":r.value=e.itemData.id)},autofill:!0}).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value}},r.Grid.Inject(r.Edit,r.Page,r.Toolbar,r.ForeignKey);var p=new r.Grid(s),h=this.createDivElement("e-dependent-div",a.element.id+""+e+"TabContainer");return p.appendTo(h),h},e.prototype.gridActionBegin=function(e){var i=this,r=this.beforeOpenArgs.Dependency;if("add"===e.requestType||"beginEdit"===e.requestType){var n="add"!==e.requestType;this.idCollection=t.extend([],[],this.preTableCollection,!0);for(var a=r.dataSource,s=function(r){o.idCollection.forEach(function(s,o){if(s.id===t.getValue("id",a[r])){var l=t.getValue("rowData",e);if(n&&t.getValue("id",l)===s.id)return;i.idCollection.splice(i.idCollection.indexOf(s),1)}})},o=this,l=0;l<=a.length;l++)s(l)}},e.prototype.updateResourceCollection=function(e,i){if(!t.isNullOrUndefined(e.data)&&Object.keys(e.data).length){this.parent;var r=document.querySelector("#"+i).ej2_instances[0];if(!t.isNullOrUndefined(r)&&r.getSelectedRecords().length>0){var n=r.getSelectedRecords(),a=void 0,s=[];for(a=0;a<n.length;a++)s.push(n[a].taskData);this.ganttResources=t.extend([],s)}else this.ganttResources=[]}else this.ganttResources=[]},e.prototype.renderResourceTab=function(e){var i=this,r=this.parent,n=r.resourceFields,s=this.beforeOpenArgs.rowData,o=s.ganttProperties.resourceInfo,l=this.beforeOpenArgs[e],d=r.element.id+""+e+"TabContainer",p=t.extend([],[],r.resources,!0);if(this.parent.dataOperation.updateResourceUnit(p),!t.isNullOrUndefined(o)){var h=void 0,c=o.length,u=void 0,g=p.length;for(h=0;h<c;h++)for(u=0;u<g;u++)o[h][n.id]===p[u][n.id]&&(p[u][n.unit]=o[h][n.unit])}l.dataSource=p;var f=s.ganttProperties.resourceInfo;if(this.isEdit&&!t.isNullOrUndefined(f))for(var m=0;m<f.length;m++)this.ganttResources.push(f[m]);l.rowSelected=function(e){i.updateResourceCollection(e,d)},l.rowDeselected=function(e){i.updateResourceCollection(e,d)};var y=this.createDivElement("e-resource-div",d);a.TreeGrid.Inject(a.Selection,a.Filter,a.Edit,a.VirtualScroll);var v=new a.TreeGrid(l),D=this.parent.columnByField[this.parent.taskFields.resourceInfo];return(!1===D.allowEditing||D.isPrimaryKey||this.parent.readOnly)&&(v.allowSelection=!1,v.allowFiltering=!1,v.editSettings.allowEditing=!1),v.dataBound=function(){if(i.parent.editDialogFields.length>=1&&"Resources"===i.parent.editDialogFields[0].type){var e=i.parent.element.id+"ResourcesTabContainer";i.resourceSelection(e)}},v.appendTo(y),y},e.prototype.resourceSelection=function(e){var i=this,r=document.querySelector("#"+e).ej2_instances[0],n=r.getCurrentViewRecords(),a=this.ganttResources;a&&a.length>0&&n.forEach(function(e,n){for(var s=0;s<a.length;s++)e.taskData[i.parent.resourceFields.id]!==a[s][i.parent.resourceFields.id]||t.isNullOrUndefined(r.selectionModule)||-1!==r.getSelectedRowIndexes().indexOf(n)||r.selectRow(n)})},e.prototype.renderCustomTab=function(e){return this.renderGeneralTab(e)},e.prototype.renderNotesTab=function(e){var t=this.parent,i=this.beforeOpenArgs[e],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];(!1===a.allowEditing||a.isPrimaryKey||this.parent.readOnly)&&(i.enabled=!1);return new l.RichTextEditor(i).appendTo(n),n},e.prototype.renderInputElements=function(e,i){var n,a=this,s=this.parent.element.id,o=this.editedRecord,l=this.createDivElement("e-edit-form-column"),d={column:i,data:o};if(!t.isNullOrUndefined(i.edit)&&t.isNullOrUndefined(i.edit.params)){var p=i.edit.create;(n="string"==typeof p?(p=r.getObject(p,window))(d):i.edit.create(d)).className="",n.setAttribute("type","text"),n.setAttribute("id",s+""+i.field),n.setAttribute("name",i.field),n.setAttribute("title",i.field),l.appendChild(n)}else n=this.createInputElement("",s+""+i.field,i.field),l.appendChild(n);if(e.enabled=!this.isCheckIsDisabled(i),i.field===this.parent.taskFields.duration)if(t.isNullOrUndefined(i.valueAccessor)){if(t.isNullOrUndefined(i.edit)){var h=o.ganttProperties;e.value=this.parent.dataOperation.getDurationString(h.duration,h.durationUnit)}}else if("string"==typeof i.valueAccessor){var c=r.getObject(i.valueAccessor,window);e.value=c(i.field,o,i)}else e.value=i.valueAccessor(i.field,o,i);else"booleanedit"===i.editType?!0===o[i.field]?e.checked=!0:e.checked=!1:e.value=o[i.field];if(!t.isNullOrUndefined(i.edit)&&t.isNullOrUndefined(i.edit.params)){var u=i.edit.write,g=void 0;g="string"==typeof u?(u=r.getObject(u,window))({column:i,rowData:o,element:n}):i.edit.write({column:i,rowData:o,element:n}),i.field===this.parent.taskFields.duration&&(g.change=function(e){a.validateScheduleFields(e,i,a.parent)})}else{(g=new this.inputs[i.editType](e)).appendTo(n)}return l},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(!i.hasChildRecords){var r="ResourceView"===this.parent.viewType?i.ganttProperties.taskId.toString():i.ganttProperties.rowUniqueID.toString(),n={id:r,text:r+"-"+i.ganttProperties.taskName,value:r};this.preTaskIds.push(n.id),this.preTableCollection.push(n)}}},e.prototype.predecessorEditCollection=function(e){var i=[],r=e.ganttProperties;if(this.isEdit&&!t.isNullOrUndefined(this.parent.taskFields.dependency)&&!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(r.predecessor))for(var n=r.predecessor,a=this.preTableCollection,s=0;s<n.length;s++){var o=n[s].from.toString(),l={};if(("ResourceView"===this.parent.viewType?r.taskId:r.rowUniqueID).toString()!==o){l.id=o;for(var d=0;d<a.length;d++)if(a[d].value===o){l.name=a[d].text;break}l.type=n[s].type;var p=n[s].offset,h=n[s].offsetUnit;l.offset=this.parent.dataOperation.getDurationString(p,h),l.uniqueId=P(),i.push(l)}}return i},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))>-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,i=this.beforeOpenArgs.tabModel.items,r=0;r<i.length;r++){var n=i[r].content,a=n.id;t.isNullOrUndefined(a)&&""===a||("General"===(a=(a=a.replace(e.element.id,"")).replace("TabContainer",""))?this.updateGeneralTab(n,!1):"Dependency"===a?this.updatePredecessorTab(n):"Notes"===a?this.updateNotesTab(n):"Resources"===a?this.updateResourceTab(n):-1!==a.indexOf("Custom")?this.updateCustomTab(n):"Segments"===a&&this.updateSegmentsData(n,this.beforeOpenArgs.rowData))}if(this.isEdit){this.parent.dataOperation.updateWidthLeft(this.rowData);var s={data:this.rowData,action:"DialogEditing"};this.parent.editModule.initiateUpdateAction(s)}else if("ResourceView"===this.parent.viewType){var o=t.extend({},this.addedRecord,!0);if(o[this.parent.taskFields.resourceInfo].length)for(r=0;r<o[this.parent.taskFields.resourceInfo].length;r++){a=o[this.parent.taskFields.resourceInfo][r].toString();var l=this.parent.getTaskIds().indexOf("R"+a.toString());if(-1!==l){this.parent.editModule.addRecord(this.addedRecord,"Child",l);break}}else this.parent.editModule.addRecord(this.addedRecord,"Bottom")}else this.parent.editModule.addRecord(this.addedRecord,this.parent.editSettings.newRowPosition);return!0},e.prototype.updateSegmentTaskData=function(e){for(var i=[],r=this.parent.taskFields,n=0;n<e.length;n++){var a={};t.isNullOrUndefined(r.startDate)||(a[this.parent.taskFields.startDate]=e[n].startDate),t.isNullOrUndefined(r.endDate)||(a[this.parent.taskFields.endDate]=e[n].endDate),t.isNullOrUndefined(r.duration)||(a[this.parent.taskFields.duration]=Number(e[n].duration),e[n].duration=a[this.parent.taskFields.duration]),i.push(a)}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,i,this.rowData),e.length<=0&&this.validateDuration(this.rowData)):this.addedRecord[r.segments]=i},e.prototype.updateSegmentsData=function(e,t){var i=e.ej2_instances[0];i.isEdit&&i.endEdit();var r=i.currentViewData;this.updateSegmentTaskData(r)},e.prototype.updateGeneralTab=function(e,i){var n=this.parent,a=e.childNodes,s={};this.isEdit||(s=this.addedRecord);for(var o=0;o<a.length;o++){var l=a[o],d=l.querySelector('input[id^="'+n.element.id+'"]');if(d){var p=d.id.replace(n.element.id,""),h=l.querySelector("#"+n.element.id+p).ej2_instances[0],c=n.columnByField[p];if(!t.isNullOrUndefined(c.edit)&&t.isNullOrUndefined(c.edit.params)){var u=c.edit.read;"string"==typeof u?(u=r.getObject(u,window),s[p]=u(d,h.value)):s[p]=c.edit.read(d,h.value)}else i&&"booleanedit"===c.editType?!0===d.checked?s[p]=!0:s[p]=!1:s[p]=h.value}}this.isEdit&&(this.updateScheduleProperties(this.editedRecord,this.rowData),n.editModule.validateUpdateValues(s,this.rowData,!0))},e.prototype.updateScheduleProperties=function(e,i){this.parent.setRecordValue("startDate",e.ganttProperties.startDate,i.ganttProperties,!0),this.parent.setRecordValue("endDate",e.ganttProperties.endDate,i.ganttProperties,!0),this.parent.setRecordValue("duration",e.ganttProperties.duration,i.ganttProperties,!0),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,i.ganttProperties,!0),this.parent.setRecordValue("work",e.ganttProperties.work,i.ganttProperties,!0),t.isNullOrUndefined(this.parent.taskFields.startDate)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.startDate),t.isNullOrUndefined(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.endDate),t.isNullOrUndefined(this.parent.taskFields.duration)||(this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.duration),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,this.rowData,!0),0===this.rowData.ganttProperties.duration?this.parent.setRecordValue("isMilestone",!0,this.rowData.ganttProperties,!0):this.parent.setRecordValue("isMilestone",!1,this.rowData.ganttProperties,!0)),t.isNullOrUndefined(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.work),t.isNullOrUndefined(this.parent.taskFields.manual)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.manual)},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],d=l.name.split("-")[0];if(l.id!==d&&(l.id=d),-1===s.indexOf(l.id)){var p=l.id+l.type;l.offset&&-1!==l.offset.indexOf("-")?p+=l.offset:p+="+"+l.offset,r.push(p),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 i=e.ej2_instances[0];i&&i.grid.endEdit();var r=this.ganttResources;"ResourceView"!==this.parent.viewType||t.isNullOrUndefined(this.rowData.ganttProperties)||(JSON.stringify(this.ganttResources)!==JSON.stringify(this.rowData.ganttProperties.resourceInfo)?(this.isResourceUpdate=!0,this.previousResource=t.isNullOrUndefined(this.rowData.ganttProperties.resourceInfo)?[]:this.rowData.ganttProperties.resourceInfo.slice()):this.isResourceUpdate=!1);var n=[];if(this.isEdit)this.parent.setRecordValue("resourceInfo",r,this.rowData.ganttProperties,!0),this.parent.dataOperation.updateMappingData(this.rowData,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(this.rowData,"resource"),this.validateDuration(this.rowData);else{for(var a=0;a<r.length;a++)n.push(r[a][this.parent.resourceFields.id]),this.isAddNewResource=!0;this.addedRecord[this.parent.taskFields.resourceInfo]=n}},e.prototype.updateNotesTab=function(e){var t=this.parent,i=e.ej2_instances[0];this.isEdit?(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}(),hi=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 i=this.getConnectorLineHoverElement(e.target);t.getValue("editModule.taskbarEditModule.taskBarEditAction",this.parent)||this.highlightConnectorLineElements(i)},e.prototype.getConnectorLineHoverElement=function(e){var t=g(e,we),i=g(e,be),r=g(e,Pe);return t||i||r?g(e,De):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,t.addClass([e],[Oe]),e.querySelectorAll(".e-line")[0].classList.contains("e-criticalconnector-line")?(t.addClass(e.querySelectorAll(".e-line"),[Re]),t.addClass(e.querySelectorAll("."+be),[Ee]),t.addClass(e.querySelectorAll("."+Pe),[Fe])):(t.addClass(e.querySelectorAll(".e-line"),[Me]),t.addClass(e.querySelectorAll("."+be),[xe]),t.addClass(e.querySelectorAll("."+Pe),[Ie]))},e.prototype.removeHighlight=function(){t.isNullOrUndefined(this.connectorLineElement)||(t.removeClass([this.connectorLineElement],[Oe]),this.connectorLineElement.querySelectorAll(".e-line")[0].classList.contains(Re)?(t.removeClass(this.connectorLineElement.querySelectorAll(".e-line"),[Re]),t.removeClass(this.connectorLineElement.querySelectorAll("."+be),[Ee]),t.removeClass(this.connectorLineElement.querySelectorAll("."+Pe),[Fe])):(t.removeClass(this.connectorLineElement.querySelectorAll(".e-line"),[Me]),t.removeClass(this.connectorLineElement.querySelectorAll("."+be),[xe]),t.removeClass(this.connectorLineElement.querySelectorAll("."+Pe),[Ie])),this.connectorLineElement=null)},e.prototype.getEditedConnectorLineString=function(e){for(var i,r,n,a,s,o,l=[],d=[],p="",h=0;h<e.length;h++)if(i=e[h],r=i.ganttProperties.predecessor){for(var c=0;c<r.length;c++){n=r[c];if(this.parent.connectorLineModule.removeConnectorLineById("parent"+n.from+"child"+n.to),a=this.parent.connectorLineModule.getRecordByID(n.from),s=this.parent.connectorLineModule.getRecordByID(n.to),(a&&!0===a.expanded||s&&!0===s.expanded)&&(o=this.parent.predecessorModule.updateConnectorLineObject(a,s,n),!t.isNullOrUndefined(o))){var u=l.indexOf(o.connectorLineId),g=this.parent.connectorLineModule.getConnectorLineTemplate(o);-1!==u?d[u]=g:(l.push(o.connectorLineId),d.push(g))}}p=d.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.dependencyViewContainer.innerHTML=this.parent.connectorLineModule.dependencyViewContainer.innerHTML+t},e.prototype.idFromPredecessor=function(e){for(var i=e.split(","),r=[],n=0;n<i.length;n++){for(var a=[],s=0;s<i[n].length&&(!t.isNullOrUndefined(i[n].charAt(s))&&"NaN"!==parseInt(i[n].charAt(s),10).toString());s++)a.push(i[n].charAt(s));r.push(a.join(""))}return r},e.prototype.predecessorValidation=function(e,i){for(var r,n,a=i.rowUniqueID,s=0;s<e.length;s++){r=e[s];var o=[];e.slice(0).splice(s,1);for(var l=function(){var e=[];return-1!==o.indexOf(r)?"break":t.isNullOrUndefined(d.parent.connectorLineModule.getRecordByID(r))?{value:!1}:(n=d.parent.connectorLineModule.getRecordByID(r).ganttProperties,!t.isNullOrUndefined(n.predecessor)&&n.predecessor.length>0&&n.predecessor.forEach(function(t){n.rowUniqueID.toString()!==t.from&&e.push(t.from.toString())}),a.toString()===n.rowUniqueID.toString()||-1!==e.indexOf(a.toString())?{value:!1}:(o.push(r),!t.isNullOrUndefined(n.predecessor)&&n.predecessor.length>0?void(r=n.predecessor[0].from):"break"))},d=this;null!==r;){var p=l();if("object"==typeof p)return p.value;if("break"===p)break}}return!0},e.prototype.validatePredecessorRelation=function(e,i){var r,n,a="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(!t.isNullOrUndefined(i)&&i.length>0){r=this.idFromPredecessor(i);for(var s=function(i){if(!o.checkParentRelation(e,r))return{value:!1};var s=[],l=!0;if(r.slice(0).forEach(function(e){-1===s.indexOf(e)?s.push(e):l=!1}),!l)return{value:!1};n=r[i];var d=[];r.slice(0).splice(i,1);for(var p=function(){var i,r,s=[];if(-1!==d.indexOf(n))return"break";if(t.isNullOrUndefined(o.parent.connectorLineModule.getRecordByID(n.toString())))return{value:!1};if(r=o.parent.connectorLineModule.getRecordByID(n.toString()).ganttProperties,!t.isNullOrUndefined(r.predecessor)&&r.predecessor.length>0&&r.predecessor.forEach(function(e,t){r.rowUniqueID.toString()!==e.from&&(s.push(e.from.toString()),i=t)}),a.toString()===r.rowUniqueID.toString()||-1!==s.indexOf(a.toString()))return{value:!1};if(d.push(n),t.isNullOrUndefined(r.predecessor)||!(r.predecessor.length>0))return"break";var l=void 0;return s.length>1?l=o.predecessorValidation(s,e.ganttProperties):1===s.length&&(n=r.predecessor[i].from),!1===l?{value:!1}:void 0};null!==n;){var h=p();if("object"==typeof h)return h;if("break"===h)break}},o=this,l=0;l<r.length;l++){var d=s(l);if("object"==typeof d)return d.value}}return!0},e.prototype.addPredecessor=function(e,i){var r=t.isNullOrUndefined(e.ganttProperties.predecessorsName)||""===e.ganttProperties.predecessorsName?i:e.ganttProperties.predecessorsName+","+i;this.updatePredecessorHelper(e,r)},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,i,r){if(t.isUndefined(i)||this.validatePredecessorRelation(e,i)){this.parent.isOnEdit=!0;var n=[];t.isNullOrUndefined(i)||""===i||(n=this.parent.predecessorModule.calculatePredecessor(i,e)),this.parent.setRecordValue("predecessor",n,e.ganttProperties,!0);var a=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",a,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,e),this.parent.setRecordValue(this.parent.taskFields.dependency,a,e);var s={};return s.action=r&&r.action&&"CellEditing"===r.action?r.action:"DrawConnectorLine",s.data=e,this.parent.editModule.initiateUpdateAction(s),!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=function(e){var i=n.parent.currentViewData.filter(function(i){return i&&i.ganttProperties.rowUniqueID.toString()===t[e].toString()});if(i[0]&&i[0].hasChildRecords)return{value:!1}},n=this,a=0;a<t.length;a++){var s=r(a);if("object"==typeof s)return s.value}return!0},e.prototype.initPredecessorValidationDialog=function(){if(this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation){var e=t.createElement("div",{id:this.parent.element.id+"_dialogValidationRule"});this.parent.element.appendChild(e),this.renderValidationDialog()}},e.prototype.renderValidationDialog=function(){var e=new i.Dialog({header:"Validate Editing",isModal:!0,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){t.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.removePredecessors(t,this.validationPredecessor),this.parent.editModule.updateEditedTask(e.editEventArgs)):e.validateMode.preserveLinkWithEditing&&(this.calculateOffset(t),this.parent.editModule.updateEditedTask(e.editEventArgs))},e.prototype.calculateOffset=function(e){for(var i=t.extend([],e.ganttProperties.predecessor,[],!0),r=this.parent.predecessorModule.getValidPredecessor(e),n=0;n<r.length;n++){var a=r[n],s=this.parent.connectorLineModule.getRecordByID(a.from),o=void 0;if(f(s.ganttProperties)&&f(e.ganttProperties)){var l=void 0,d=void 0,p=void 0,h=void 0;switch(a.type){case"FS":l=new Date(s.ganttProperties.endDate.getTime()),d=new Date(e.ganttProperties.startDate.getTime());break;case"SS":l=new Date(s.ganttProperties.startDate.getTime()),d=new Date(e.ganttProperties.startDate.getTime());break;case"SF":l=new Date(s.ganttProperties.startDate.getTime()),d=new Date(e.ganttProperties.endDate.getTime());break;case"FF":l=new Date(s.ganttProperties.endDate.getTime()),d=new Date(e.ganttProperties.endDate.getTime())}if(l.getTime()<d.getTime())l=this.dateValidateModule.checkStartDate(l),d=this.dateValidateModule.checkEndDate(d,null),h=!1;else{var c=new Date(l.getTime());l=this.dateValidateModule.checkStartDate(d),d=this.dateValidateModule.checkEndDate(c,null),h=!0}l.getTime()<d.getTime()?(p=this.dateValidateModule.getDuration(l,d,a.offsetUnit,!0,!1),o=h?-1*p:p):o=0}else o=0;i[T(a,"from",i,"to")].offset=o;var u=t.extend([],s.ganttProperties.predecessor,[],!0);u[T(a,"from",u,"to")].offset=o,this.parent.setRecordValue("predecessor",u,s.ganttProperties,!0)}this.parent.setRecordValue("predecessor",i,e.ganttProperties,!0);var g=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,g,e),this.parent.setRecordValue(this.parent.taskFields.dependency,g,e),this.parent.setRecordValue("predecessorsName",g,e.ganttProperties,!0)},e.prototype.removePredecessors=function(e,i){for(var r=t.extend([],[],e.ganttProperties.predecessor,!0),n=i.length,a=0;a<n;a++){var s=this.parent.connectorLineModule.getRecordByID(i[a].from),o=t.extend([],[],s.ganttProperties.predecessor,!0),l=T(i[a],"from",r,"to");r.splice(l,1);var d=T(i[a],"from",o,"to");o.splice(d,1),this.parent.setRecordValue("predecessor",o,s.ganttProperties,!0)}if(r.length!==e.ganttProperties.predecessor.length){this.parent.setRecordValue("predecessor",r,e.ganttProperties,!0);var p=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",p,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,p,e),this.parent.setRecordValue(this.parent.taskFields.dependency,p,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 i,r=this.parent.element.id,n=t.createElement("div",{className:"e-ValidationContent"}),a=t.getValue("task",e),s=t.getValue("parentTask",e),o=t.getValue("violationType",e),l=a.ganttProperties.taskName,d=this.parent.getFormatedDate(a.ganttProperties.startDate,"MM/dd/yyyy"),p=[l,s.ganttProperties.taskName];"taskBeforePredecessor_FS"===o?i=this.parent.localeObj.getConstant("taskBeforePredecessor_FS"):"taskAfterPredecessor_FS"===o?i=this.parent.localeObj.getConstant("taskAfterPredecessor_FS"):"taskBeforePredecessor_SS"===o?i=this.parent.localeObj.getConstant("taskBeforePredecessor_SS"):"taskAfterPredecessor_SS"===o?i=this.parent.localeObj.getConstant("taskAfterPredecessor_SS"):"taskBeforePredecessor_FF"===o?i=this.parent.localeObj.getConstant("taskBeforePredecessor_FF"):"taskAfterPredecessor_FF"===o?i=this.parent.localeObj.getConstant("taskAfterPredecessor_FF"):"taskBeforePredecessor_SF"===o?i=this.parent.localeObj.getConstant("taskBeforePredecessor_SF"):"taskAfterPredecessor_SF"===o&&(i=this.parent.localeObj.getConstant("taskAfterPredecessor_SF"));var h='<div id="'+r+'_ValidationText">'+(i=k(i,p))+"<div>",c='<table><tr><td><input type="radio" id="'+r+'_ValidationCancel" name="ValidationRule" checked/><label for="'+r+'_ValidationCancel" id= "'+r+'_cancelLink">Cancel, keep the existing link</label></td></tr><tr><td><input type="radio" id="'+r+'_ValidationRemoveline" name="ValidationRule"/><label for="'+r+'_ValidationRemoveline" id="'+r+'_removeLink">Remove the link and move <b>'+l+"</b> to start on <b>"+d+'</b>.</label></td></tr><tr><td><input type="radio" id="'+r+'_ValidationAddlineOffset" name="ValidationRule"/><label for="'+r+'_ValidationAddlineOffset" id="'+r+'_preserveLink">Move the <b>'+l+"</b> to start on <b>"+d+"</b> and keep the link.</label></td></tr></table>";return n.innerHTML=h+c,n},e.prototype.validateTypes=function(e){var i,r=this.parent.predecessorModule.getValidPredecessor(e);this.validationPredecessor=[];for(var n,a,s=this.parent.predecessorModule.getPredecessorDate(e,r),o=e.ganttProperties,l=this.parent.allowUnscheduledTasks&&t.isNullOrUndefined(s)?o.endDate:this.dateValidateModule.getEndDate(s,o.duration,o.durationUnit,o,!1),d=0;d<r.length;d++){i=this.parent.connectorLineModule.getRecordByID(r[d].from);var p=null;"FS"===r[d].type?o.startDate<s?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_FS"):o.startDate>s&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_FS"):"SS"===r[d].type?o.startDate<s?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_SS"):o.startDate>s&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_SS"):"FF"===r[d].type?l<=i.ganttProperties.endDate?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_FF"):l>i.ganttProperties.endDate&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_FF"):"SF"===r[d].type&&(l<i.ganttProperties.startDate?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_SF"):l>=i.ganttProperties.startDate&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_SF")),!t.isNullOrUndefined(p)&&t.isNullOrUndefined(a)&&(n=i,a=p)}return{parentTask:n,task:e,violationType:a}},e.prototype.addRemovePredecessor=function(e){var i=this.parent.previousRecords[e.uniqueID],r=e.ganttProperties.predecessor.slice();if(i&&i.ganttProperties&&i.ganttProperties.hasOwnProperty("predecessor")){var n=i.ganttProperties.predecessor;if(!t.isNullOrUndefined(n))for(var a=0;a<n.length;a++){if((d=this.parent.connectorLineModule.getRecordByID(n[a].from))===e)e.ganttProperties.predecessor.push(n[a]);else{var s=t.extend([],[],d.ganttProperties.predecessor,!0),o=T(n[a],"from",s,"to");-1!==o&&(s.splice(o,1),this.parent.setRecordValue("predecessor",s,d.ganttProperties,!0))}}if(!t.isNullOrUndefined(r))for(var l=0;l<r.length;l++){var d=this.parent.connectorLineModule.getRecordByID(r[l].from);(s=t.extend([],[],d.ganttProperties.predecessor,!0)).push(r[l]),this.parent.setRecordValue("predecessor",s,d.ganttProperties,!0)}}},e.prototype.removePredecessorByIndex=function(e,t){var i=e.ganttProperties.predecessor,r=i.splice(t,1),n=this.parent.connectorLineModule.getRecordByID(r[0].from).ganttProperties.predecessor,a=T(r[0],"from",n,"to");n.splice(a,1);var s=this.parent.predecessorModule.getPredecessorStringValue(e);i.push(r[0]),this.parent.connectorLineEditModule.updatePredecessor(e,s)},e.prototype.renderPredecessorDeleteConfirmDialog=function(){this.confirmPredecessorDialog=new i.Dialog({width:"320px",isModal:!0,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=t.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}(),ci=function(){function e(e){if(this.isFromDeleteMethod=!1,this.targetedRecords=[],this.updateParentRecords=[],this.isaddtoBottom=!1,this.confirmDialog=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,this.isBreakLoop=!1,this.deletedTaskDetails=[],this.parent=e,this.validatedChildItems=[],this.parent.editSettings.allowEditing&&"Auto"===this.parent.editSettings.mode&&(this.cellEditModule=new ai(this.parent)),this.parent.taskFields.dependency&&(this.parent.connectorLineEditModule=new hi(this.parent)),(this.parent.editSettings.allowAdding||this.parent.editSettings.allowEditing&&("Dialog"===this.parent.editSettings.mode||"Auto"===this.parent.editSettings.mode))&&(this.dialogModule=new pi(this.parent)),this.parent.editSettings.allowTaskbarEditing&&(this.taskbarEditModule=new di(this.parent)),this.parent.editSettings.allowDeleting){var i=t.createElement("div",{id:this.parent.element.id+"_deleteConfirmDialog"});this.parent.element.appendChild(i),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"],i=0;i<e.length;i++)if(!t.isNullOrUndefined(e[i])&&e[i].length>0){var r=this.parent.getColumnByField(e[i],this.parent.treeGridModule.treeGridColumns);r&&(r.field===this.parent.taskFields.id?this.updateIDColumnEditParams(r):r.field===this.parent.taskFields.progress&&t.isNullOrUndefined(r.edit)?this.updateProgessColumnEditParams(r):r.field===this.parent.taskFields.resourceInfo?this.updateResourceColumnEditor(r):"taskType"===r.field&&this.updateTaskTypeColumnEditor(r))}},e.prototype.updateIDColumnEditParams=function(e){this.updateEditParams(e,{min:0,decimals:0,validateDecimalOnType:!0,format:"n0",showSpinButton:!1})},e.prototype.updateProgessColumnEditParams=function(e){this.updateEditParams(e,{min:0,decimals:0,validateDecimalOnType:!0,max:100,format:"n0"})},e.prototype.updateEditParams=function(e,i){t.isNullOrUndefined(e.edit)?(e.edit={},e.edit.params={}):t.isNullOrUndefined(e.edit.params)&&(e.edit.params={}),t.extend(i,e.edit.params),e.edit.params=i;this.parent.getColumnByField(e.field,this.parent.ganttColumns).edit=e.edit},e.prototype.updateResourceColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&t.isNullOrUndefined(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getResourceEditor();var i=this.parent.getColumnByField(e.field,this.parent.ganttColumns);i.editType="dropdownedit",i.edit=e.edit}},e.prototype.getResourceEditor=function(){var e,i=this,r=this.parent.resourceFields,a={};return c.MultiSelect.Inject(c.CheckBoxSelection),a.write=function(t){i.parent.treeGridModule.currentEditRow={},(e=new c.MultiSelect({dataSource:new n.DataManager(i.parent.resources),fields:{text:r.name,value:r.id},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"350px",delimiterChar:",",value:i.parent.treeGridModule.getResourceIds(t.rowData)})).appendTo(t.element)},a.read=function(e){var n=e.ej2_instances[0].value,a=[];t.isNullOrUndefined(n)&&(n=[]);for(var s=0;s<n.length;s++)for(var o=0;o<i.parent.resources.length;o++)if(i.parent.resources[o][r.id]===n[s]){a.push(i.parent.resources[o][r.name]);break}return i.parent.treeGridModule.currentEditRow[i.parent.taskFields.resourceInfo]=n,a.join(",")},a.destroy=function(){e&&e.destroy()},a},e.prototype.updateTaskTypeColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&t.isNullOrUndefined(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getTaskTypeEditor();var i=this.parent.getColumnByField(e.field,this.parent.ganttColumns);i.editType="dropdownedit",i.edit=e.edit}},e.prototype.getTaskTypeEditor=function(){var e,i=this,r={},a=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];return r.write=function(r){i.parent.treeGridModule.currentEditRow={},(e=new c.DropDownList({dataSource:new n.DataManager(a),fields:{value:"Value"},popupHeight:"350px",value:t.getValue("taskType",r.rowData.ganttProperties)})).appendTo(r.element)},r.read=function(e){var t=e.ej2_instances[0].value;return i.parent.treeGridModule.currentEditRow.taskType=t,t},r.destroy=function(){e&&e.destroy()},r},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)):t.isNullOrUndefined(this.parent.editModule.cellEditModule)&&"Auto"===e.mode&&(this.cellEditModule=new ai(this.parent)),this.parent.editModule.dialogModule&&"Auto"===e.mode?this.parent.treeGrid.recordDoubleClick=void 0:t.isNullOrUndefined(this.parent.editModule.dialogModule)&&(this.dialogModule=new pi(this.parent))):(this.cellEditModule&&this.cellEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy()),e.allowDeleting&&e.showDeleteConfirmDialog){if(t.isNullOrUndefined(this.confirmDialog)){var i=t.createElement("div",{id:this.parent.element.id+"_deleteConfirmDialog"});this.parent.element.appendChild(i),this.renderDeleteConfirmDialog()}}else e.allowDeleting&&e.showDeleteConfirmDialog||this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy();e.allowTaskbarEditing?t.isNullOrUndefined(this.parent.editModule.taskbarEditModule)&&(this.taskbarEditModule=new di(this.parent)):this.taskbarEditModule&&this.taskbarEditModule.destroy()},e.prototype.recordDoubleClick=function(e){if(this.parent.editSettings.allowEditing&&"Dialog"===this.parent.editSettings.mode){var i=void 0;if(e.row){var r=t.getValue("rowIndex",e.row);i=this.parent.currentViewData[r]}t.isNullOrUndefined(i)||this.dialogModule.openEditDialog(i)}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 i=this.parent.taskFields;if(t.isNullOrUndefined(e)||t.isNullOrUndefined(e[i.id]))return;var r="ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf("T"+e[i.id])]:this.parent.getRecordByID(e[i.id]);if(!t.isNullOrUndefined(this.parent.editModule)&&r){this.parent.isOnEdit=!0,this.validateUpdateValues(e,r,!0),e[this.parent.taskFields.resourceInfo]&&(0===r.ganttProperties.duration&&this.parent.dataOperation.updateWorkWithDuration(r),this.updateResourceRelatedFields(r,"resource"),this.parent.dateValidationModule.calculateEndDate(r));var n=Object.keys(e);if(-1===n.indexOf(i.startDate)&&-1===n.indexOf(i.endDate)&&-1===n.indexOf(i.duration)||this.parent.dataOperation.calculateScheduledValues(r,r.taskData,!1),this.parent.dataOperation.updateWidthLeft(r),t.isUndefined(e[this.parent.taskFields.dependency])||e[this.parent.taskFields.dependency]===r.ganttProperties.predecessorsName){var a={};a.data=r,"ResourceView"===this.parent.viewType&&(a.action="methodUpdate"),this.parent.editModule.initiateUpdateAction(a)}else this.parent.connectorLineEditModule.updatePredecessor(r,e[this.parent.taskFields.dependency])}}},e.prototype.validateUpdateValues=function(e,i,r){for(var n=this.parent,a=n.taskFields,s=y(n.columnMapping),o=[],l=!1,d=0,p=Object.keys(e);d<p.length;d++){var h=p[d];if(-1!==[a.startDate,a.endDate,a.duration].indexOf(h)){if(t.isNullOrUndefined(e[h])&&!n.allowUnscheduledTasks)continue;if(r)if(a.duration===h)n.dataOperation.updateDurationValue(e[h],i.ganttProperties),i.ganttProperties.duration>0&&i.ganttProperties.isMilestone&&this.parent.setRecordValue("isMilestone",!1,i.ganttProperties,!0),n.dataOperation.updateMappingData(i,s[h]);else{var c="string"==typeof e[h]?new Date(e[h]):e[h];n.setRecordValue(s[h],c,i.ganttProperties,!0),n.dataOperation.updateMappingData(i,s[h])}else o.push(h),l=!0}else if(a.resourceInfo===h){var u=n.dataOperation.setResourceInfo(e);"ResourceView"===this.parent.viewType&&(JSON.stringify(u)!==JSON.stringify(i.ganttProperties.resourceInfo)?(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=t.isNullOrUndefined(i.ganttProperties.resourceInfo)?[]:i.ganttProperties.resourceInfo.slice()):this.parent.editModule.dialogModule.isResourceUpdate=!1),i.ganttProperties.resourceInfo=u,n.dataOperation.updateMappingData(i,"resourceInfo")}else if(a.dependency===h);else if(-1!==[a.progress,a.notes,a.durationUnit,a.expandState,a.milestone,a.name,a.baselineStartDate,a.baselineEndDate,a.id,a.segments].indexOf(h)){var g=n.columnByField[h],f=e[h];t.isNullOrUndefined(g)||"datepickeredit"!==g.editType&&"datetimepickeredit"!==g.editType||(f=n.dataOperation.getDateFromFormat(f));var m=s[h];if(h===a.id)m="taskId";else if(h===a.name)m="taskName";else if(h===a.segments&&(m="segments",e&&!t.isNullOrUndefined(e[this.parent.taskFields.segments])&&e[this.parent.taskFields.segments].length>0)){for(var v=0,D=0;D<i.ganttProperties.segments.length;D++)v+=i.ganttProperties.segments[D].duration;var w=i.ganttProperties.startDate,k=this.parent.dataOperation.getEndDate(w,v,i.ganttProperties.durationUnit,i.ganttProperties,!1);n.setRecordValue("endDate",n.dataOperation.getDateFromFormat(k),i.ganttProperties,!0)}t.isNullOrUndefined(m)||n.setRecordValue(m,f,i.ganttProperties,!0),(h===a.baselineStartDate||h===a.baselineEndDate)&&i.ganttProperties.baselineStartDate&&i.ganttProperties.baselineEndDate&&(n.setRecordValue("baselineStartDate",n.dataOperation.checkBaselineStartDate(i.ganttProperties.baselineStartDate),i.ganttProperties,!0),n.dataOperation.setTime(this.parent.defaultEndTime,i.ganttProperties.baselineEndDate),n.setRecordValue("baselineEndDate",n.dataOperation.checkBaselineEndDate(i.ganttProperties.baselineEndDate),i.ganttProperties,!0),n.setRecordValue("baselineLeft",n.dataOperation.calculateBaselineLeft(i.ganttProperties),i.ganttProperties,!0),n.setRecordValue("baselineWidth",n.dataOperation.calculateBaselineWidth(i.ganttProperties),i.ganttProperties,!0)),n.setRecordValue("taskData."+h,f,i),h===a.segments&&e&&!t.isNullOrUndefined(e[this.parent.taskFields.segments])&&e[this.parent.taskFields.segments].length>0&&n.dataOperation.setSegmentsInfo(i,!0),n.setRecordValue(h,f,i)}else if(a.indicators===h){f=e[h];n.setRecordValue("indicators",f,i.ganttProperties,!0),n.setRecordValue("taskData."+h,f,i),n.setRecordValue(h,f,i)}else if(a.work===h)n.setRecordValue("work",e[h],i.ganttProperties,!0),this.parent.dataOperation.updateMappingData(i,"work"),this.parent.dataOperation.updateMappingData(i,"duration"),this.parent.dataOperation.updateMappingData(i,"endDate");else if("taskType"===h)n.setRecordValue("taskType",e[h],i.ganttProperties,!0);else if(-1!==n.customColumns.indexOf(h)){g=n.columnByField[h],f=e[h];t.isNullOrUndefined(g.edit)&&("datepickeredit"!==g.editType&&"datetimepickeredit"!==g.editType||(f=n.dataOperation.getDateFromFormat(f))),n.setRecordValue("taskData."+h,f,i),n.setRecordValue(h,f,i)}else a.manual===h&&(n.setRecordValue("isAutoSchedule",!e[h],i.ganttProperties,!0),this.parent.setRecordValue(h,e[h],i),this.updateTaskScheduleModes(i))}l&&this.validateScheduleValues(o,i,e)},e.prototype.updateResourceRelatedFields=function(e,i){var r=e.ganttProperties,n=r.taskType,a=r.isAutoSchedule;if(!t.isNullOrUndefined(r.resourceInfo))if(r.work>0||"work"===i)switch(n){case"FixedUnit":if(0===r.resourceInfo.length)return;a&&r.resourceInfo.length&&("work"===i||"resource"===i)?this.parent.dataOperation.updateDurationWithWork(e):a||"work"!==i?this.parent.dataOperation.updateWorkWithDuration(e):this.parent.dataOperation.updateUnitWithWork(e);break;case"FixedWork":if(0===r.resourceInfo.length)return;a?"duration"===i||"endDate"===i?(this.parent.dataOperation.updateUnitWithWork(e),0===r.duration&&(this.parent.setRecordValue("work",0,r,!0),t.isNullOrUndefined(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(e,"work"))):this.parent.dataOperation.updateDurationWithWork(e):"work"===i?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e);break;case"FixedDuration":r.resourceInfo.length&&"work"===i?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 i=!1,r=e.ganttProperties,n=this.parent.previousRecords&&this.parent.previousRecords[e.uniqueID];if(n&&n.ganttProperties){var a=t.getValue("ganttProperties.startDate",n),s=t.getValue("ganttProperties.endDate",n),o=t.getValue("ganttProperties.duration",n),l=t.getValue("ganttProperties.durationUnit",n),d=Object.keys(n.ganttProperties);-1===d.indexOf("startDate")&&-1===d.indexOf("endDate")&&-1===d.indexOf("duration")&&-1===d.indexOf("durationUnit")||(t.isNullOrUndefined(a)&&!t.isNullOrUndefined(r.startDate)||t.isNullOrUndefined(s)&&!t.isNullOrUndefined(r.endDate)||t.isNullOrUndefined(r.startDate)&&!t.isNullOrUndefined(a)||t.isNullOrUndefined(r.endDate)&&!t.isNullOrUndefined(s)||a&&a.getTime()!==r.startDate.getTime()||s&&s.getTime()!==r.endDate.getTime()||!t.isNullOrUndefined(o)&&o!==r.duration||!t.isNullOrUndefined(o)&&o===r.duration&&l!==r.durationUnit)&&(i=!0)}return i},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 i=this.isCheckPredecessor(e.data);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 r={};if(i)if(r=this.parent.connectorLineEditModule.validateTypes(e.data),this.parent.isConnectorLineUpdate=!0,t.isNullOrUndefined(t.getValue("violationType",r)))this.updateEditedTask(e);else{var n=this.validateTaskEvent(e);!1===n.validateMode.preserveLinkWithEditing&&!1===n.validateMode.removeLink&&!1===n.validateMode.respectLink?this.parent.connectorLineEditModule.openValidationDialog(r):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.updateParentChildRecord(t),this.parent.isConnectorLineUpdate){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,[],""))}t.ganttProperties.predecessor&&(this.parent.isMileStoneEdited=t.ganttProperties.isMilestone,this.taskbarMoved&&(this.parent.editedTaskBarItem=t),this.parent.predecessorModule.validatePredecessor(t,[],"")),this.updateParentItemOnEditing()}t.parentItem&&this.parent.dataOperation.updateParentItems(t,!0),this.initiateSaveAction(e)},e.prototype.updateParentItemOnEditing=function(){for(var e=t.getValue("parentRecord",this.parent.predecessorModule),i=0;i<e.length;i++)this.parent.dataOperation.updateParentItems(e[i]);t.setValue("parentRecord",[],this.parent.predecessorModule),t.setValue("parentIds",[],this.parent.predecessorModule)},e.prototype.updateParentChildRecord=function(e){var i=e;i.hasChildRecords&&this.taskbarMoved&&"Auto"===this.parent.taskMode&&!t.isNullOrUndefined(this.parent.editModule.cellEditModule)&&!this.parent.editModule.cellEditModule.isResourceCellEdited&&this.updateChildItems(i),t.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("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.startDate,i,!0),this.parent.setRecordValue("autoEndDate",i.endDate,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,i){var r=e,n=r.ganttProperties,a=new Date(i.getTime());if(!t.isNullOrUndefined(n.endDate)&&t.isNullOrUndefined(n.startDate)){var s=this.parent.dateValidationModule.checkStartDate(a,n,null);this.parent.setRecordValue("endDate",this.parent.dateValidationModule.checkEndDate(s,r.ganttProperties),n,!0)}else this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(a,n,!1),n,!0),t.isNullOrUndefined(n.duration)||this.parent.dateValidationModule.calculateEndDate(r);this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(r)},e.prototype.updateParentProgress=function(e){var i=0,r=this.parent.getParentTask(e),n=r.childRecords,a=n?n.length:0,s=0,o=0,l=0,d={};if(n){for(var p=0;p<a;p++)n[p].ganttProperties.isMilestone&&!n[p].hasChildRecords||!f(n[p].ganttProperties)?o+=1:(d=this.parent.dataOperation.getParentProgress(n[p]),s+=t.getValue("totalProgress",d),l+=t.getValue("totalDuration",d));i=a-o>0?Math.round(s/l):0,isNaN(i)&&(i=0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(r.ganttProperties.isAutoSchedule?r.ganttProperties.width:r.ganttProperties.autoWidth,i),r.ganttProperties,!0),this.parent.setRecordValue("progress",Math.floor(i),r.ganttProperties,!0),this.parent.setRecordValue("totalProgress",s,r.ganttProperties,!0),this.parent.setRecordValue("totalDuration",l,r.ganttProperties,!0)}this.parent.dataOperation.updateTaskData(r),r.parentItem&&this.updateParentProgress(r.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,i){t.isNullOrUndefined(i)||t.extend(e,i)},e.prototype.updateScheduleDatesOnEditing=function(e){},e.prototype.updateChildItems=function(e){var i,r=this.parent.previousRecords[e.uniqueID];i=t.isNullOrUndefined(r)||t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.ganttProperties)?new Date(e.ganttProperties.startDate.getTime()):new Date(r.ganttProperties.startDate.getTime());var n,a,s,o,l,d=e.ganttProperties.startDate,p=[];if(this.getUpdatableChildRecords(e,p),0!==p.length){i.getTime()>d.getTime()?(n=this.parent.dateValidationModule.checkStartDate(d),a=this.parent.dateValidationModule.checkEndDate(i,e.ganttProperties),o=!1):(n=this.parent.dateValidationModule.checkStartDate(i),a=this.parent.dateValidationModule.checkEndDate(d,e.ganttProperties),o=!0),l=n.getTime()>=a.getTime()?0:this.parent.dateValidationModule.getDuration(n,a,"minute",!0,!1);for(var h=0;h<p.length;h++)if(p[h].ganttProperties.isAutoSchedule)if(l>0){var c=f(p[h].ganttProperties)?p[h].ganttProperties.startDate:p[h].ganttProperties.startDate?p[h].ganttProperties.startDate:p[h].ganttProperties.endDate?p[h].ganttProperties.endDate:new Date(i.toString());s=o?this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(c,p[h].ganttProperties,p[h].ganttProperties.isMilestone),l,"minute",p[h].ganttProperties,!1):this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(c,p[h].ganttProperties),l,"minute",p[h].ganttProperties),this.calculateDateByRoundOffDuration(p[h],s),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(p[h])&&this.validatedChildItems.push(p[h])}else t.isNullOrUndefined(r)&&(s=i,this.calculateDateByRoundOffDuration(p[h],s),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(p[h])&&this.validatedChildItems.push(p[h]));p.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 i=this;this.parent.showSpinner();var r={};r.requestType="beforeSave",r.data=e.data,r.cancel=!1,r.modifiedRecords=this.parent.editedRecords,t.isNullOrUndefined(e.target)||(r.target=e.target),r.modifiedTaskData=D(this.parent.editedRecords,!0),e.action&&"DrawConnectorLine"===e.action&&(r.action="DrawConnectorLine"),this.parent.trigger("actionBegin",r,function(t){if(t.cancel)i.reUpdatePreviousRecords(),i.parent.chartRowsModule.refreshRecords([e.data]),i.resetEditProperties(r);else if(t.modifiedTaskData=D(t.modifiedRecords,null,null,i.parent),v(i.parent.dataSource)){var a=i.parent.dataSource,s={changedRecords:t.modifiedTaskData},o=i.parent.query instanceof n.Query?i.parent.query:new n.Query,l=null,d=a.adaptor;if(d instanceof n.WebApiAdaptor&&d instanceof n.ODataAdaptor&&!a.dataSource.batchUrl){l=a.update(i.parent.taskFields.id,s.changedRecords,null,o)}else l=a.saveChanges(s,i.parent.taskFields.id,null,o);l.then(function(t){return i.dmSuccess(t,e)}).catch(function(t){return i.dmFailure(t,e)})}else i.saveSuccess(e)})},e.prototype.dmSuccess=function(e,t){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 i=e.ganttProperties.sharedTaskUniqueIds,r=0;r<i.length;r++){var n=this.parent.flatData[this.parent.ids.indexOf(i[r].toString())];n.uniqueID!==e.uniqueID&&(this.updateGanttProperties(e,n),this.parent.setRecordValue("taskData",e.taskData,n,!0),this.parent.dataOperation.updateTaskData(n),this.parent.dataOperation.updateResourceName(n),t.isNullOrUndefined(n.parentItem)||this.parent.dataOperation.updateParentItems(n.parentItem))}},e.prototype.saveSuccess=function(e){var i={};if(this.parent.timelineSettings.updateTimescaleView){var r=this.parent.editedRecords;this.parent.timelineModule.updateTimeLineOnEditing([r],e.action)}if("ResourceView"===this.parent.viewType){"TaskbarEditing"===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 n=0;n<this.updateParentRecords.length;n++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[n]);this.updateParentRecords=[],this.parent.editModule.dialogModule.isResourceUpdate=!1,this.parent.editModule.dialogModule.previousResource=[]}if(this.isTreeGridRefresh||(this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords),this.parent.isConnectorLineUpdate&&!t.isNullOrUndefined(this.parent.connectorLineEditModule)&&(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.editedRecords),this.updateScheduleDatesOnEditing(e))),!this.parent.editSettings.allowTaskbarEditing||this.parent.editSettings.allowTaskbarEditing&&!this.taskbarEditModule.dependencyCancel){if(i.requestType="save",i.data=e.data,i.modifiedRecords=this.parent.editedRecords,i.modifiedTaskData=D(this.parent.editedRecords,null,null,this.parent),t.isNullOrUndefined(e.action)||t.setValue("action",e.action,i),"TaskbarEditing"===e.action&&(i.taskBarEditAction=e.taskBarEditAction),this.endEditAction(e),this.parent.enableCriticalPath){var a=this.parent.criticalPathModule;a.showCriticalPath(!0),a.criticalConnectorLine(a.criticalPathCollection,a.detailPredecessorCollection,!0,a.predecessorCollectionTaskIds)}this.parent.trigger("actionComplete",i)}else 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++){for(var o=[],l=parseInt(t[s][this.parent.resourceFields.id],10),d=0;d<e.length;d++)if(parseInt(e[d][this.parent.resourceFields.id],10)===l){o.push(d);break}if(0===o.length){var p=r[this.parent.getTaskIds().indexOf("R"+l)];p&&this.addNewRecord(i,p)}else e.splice(parseInt(o[0].toString(),10),1)}var h=e?e.length:0;for(s=0;s<h;s++)for(var c=i.ganttProperties.taskId,u=(l=e[s][this.parent.resourceFields.id],r[this.parent.getTaskIds().indexOf("R"+l)]),g=0;g<u.childRecords.length;g++)u.childRecords[g].ganttProperties.taskId===c&&this.removeChildRecord(u.childRecords[g]);if(n>0){var f=this.parent.getParentTask(i.parentItem);f&&f.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.removeChildRecord(i)}0===n&&this.checkWithUnassignedTask(i)}},e.prototype.checkWithUnassignedTask=function(e){for(var i=null,r=0;r<this.parent.flatData.length;r++)this.parent.flatData[r].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&(i=this.parent.flatData[r]);if(t.isNullOrUndefined(i)){var n={};n[this.parent.taskFields.id]=0,n[this.parent.taskFields.name]=this.parent.localeObj.getConstant("unassignedTask");var a=this.parent.isOnEdit;this.parent.isOnEdit=!1;var s=this.parent.dataOperation.createRecord(n,0);this.parent.isOnEdit=a,this.addRecordAsBottom(s);var o=this.parent.flatData[this.parent.flatData.length-1];this.addNewRecord(e,o)}else this.addNewRecord(e,i)},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,i){var n=null;n=t.extend({},{},e,!0),this.parent.setRecordValue("uniqueID",r.getUid(this.parent.element.id+"_data_"),n),this.parent.setRecordValue("uniqueID",n.uniqueID,n.ganttProperties,!0);var a=n.uniqueID.replace(this.parent.element.id+"_data_","");this.parent.setRecordValue("rowUniqueID",a,n),this.parent.setRecordValue("rowUniqueID",a,n.ganttProperties,!0),this.parent.setRecordValue("level",1,n),this.parent.taskFields.parentID&&this.parent.setRecordValue("parentId",i.ganttProperties.taskId,n.ganttProperties,!0),this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(i),n);var s=n.parentItem?n.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",s,n),e.ganttProperties.sharedTaskUniqueIds.push(a),n.ganttProperties.sharedTaskUniqueIds=e.ganttProperties.sharedTaskUniqueIds,this.addRecordAsChild(i,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 p=[];p.push(a.ganttProperties.rowUniqueID.toString()),this.parent.editModule.removeFromDataSource(p)}var h=this.parent.flatData.indexOf(a);if(t.taskFields.parentID){for(var c=void 0,u=this.parent.currentViewData,g=0;g<u.length;g++)u[g].ganttProperties.rowUniqueID===a.ganttProperties.rowUniqueID&&(c=g);-1!==c&&(r.length>0&&r.splice(c,1),i.splice(c,1),this.parent.flatData.splice(h,1),this.parent.ids.splice(h,1),this.parent.getTaskIds().splice(h,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(h,m+1),this.parent.ids.splice(h,m+1),this.parent.getTaskIds().splice(h,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,i){var r,n=this.parent,a=this.parent.flatData.indexOf(e),s=this.parent.editModule.getChildCount(e,0);if(!t.isNullOrUndefined(this.addRowIndex)&&this.addRowPosition&&e.childRecords&&"Child"!==this.addRowPosition){var o=e.childRecords[this.addRowIndex],l="Above"===this.addRowPosition||"Below"===this.addRowPosition?this.addRowPosition:"Child";r=o?this.addRowIndex+a+1:s+a+1,r="Above"===l?r:r+1}else r=t.isNullOrUndefined(s)||0===s?a+1:s+a+1;this.parent.currentViewData.splice(r,0,i),this.parent.flatData.splice(r,0,i),this.parent.ids.splice(r,0,i.ganttProperties.rowUniqueID.toString()),this.updateTreeGridUniqueID(i,"add");var d=0===i.level?"R"+i.ganttProperties.taskId:"T"+i.ganttProperties.taskId;this.parent.getTaskIds().splice(r,0,d),e.hasChildRecords||(this.parent.setRecordValue("hasChildRecords",!0,e),this.parent.setRecordValue("expanded",!0,e),e.childRecords.length||(e.childRecords=[],!n.taskFields.parentID&&t.isNullOrUndefined(e.taskData[this.parent.taskFields.child])&&(e.taskData[this.parent.taskFields.child]=[]))),e.childRecords.splice(e.childRecords.length,0,i),t.isNullOrUndefined(i)||this.parent.taskFields.parentID||t.isNullOrUndefined(e.taskData[this.parent.taskFields.child])||e.taskData[this.parent.taskFields.child].splice(e.childRecords.length,0,i.taskData),t.isNullOrUndefined(i.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,t.isNullOrUndefined(this.dialogModule)||!t.isNullOrUndefined(e)&&(t.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 i.Dialog({width:"320px",isModal:!0,visible:!1,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();this.parent.element.querySelector(".e-treegrid").focus()}},e.prototype.deleteResourceRecords=function(e){for(var t=[],i=0;i<e.length;i++)if(e[i].parentItem)for(var r=e[i].ganttProperties.sharedTaskUniqueIds,n=0;n<r.length;n++)t.push(this.parent.flatData[this.parent.ids.indexOf(r[n].toString())]);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 i=typeof e;switch(this.targetedRecords=[],i){case"number":case"string":var r=e.toString();"ResourceView"===this.parent.viewType?t.isNullOrUndefined(r)||-1===this.parent.getTaskIds().indexOf("T"+r)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r)]):t.isNullOrUndefined(r)||-1===this.parent.ids.indexOf(r)||this.targetedRecords.push(this.parent.getRecordByID(r));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 i=0;i<e.length;i++){var r=e[i].toString();"ResourceView"===this.parent.viewType?t.isNullOrUndefined(r)||-1===this.parent.getTaskIds().indexOf("T"+r)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r)]):t.isNullOrUndefined(r)||-1===this.parent.ids.indexOf(r)||this.targetedRecords.push(this.parent.getRecordByID(r))}}},e.prototype.deleteRow=function(e){var i=e&&e.length?e:this.parent.selectionModule.getSelectedRecords();if(this.parent.addDeleteRecord=!0,i.length){this.parent.isOnDelete=!0,i.forEach(function(e){e.isDelete=!0}),"ResourceView"!==this.parent.viewType||e.length||(i=[]);for(var r=0;r<i.length;r++){var n=i[r];if(-1===this.deletedTaskDetails.indexOf(n)){if(n.parentItem){var a=this.parent.getParentTask(n.parentItem).childRecords;(1===a.length?a:a.filter(function(e){return!e.isDelete})).length>0&&this.parent.dataOperation.updateParentItems(n.parentItem)}var s=n.ganttProperties.predecessor;s&&s.length&&this.removePredecessorOnDelete(n),this.deletedTaskDetails.push(n),n.hasChildRecords&&this.deleteChildRecords(n)}}this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.clearSelection();var o={};o.deletedRecordCollection=this.deletedTaskDetails,o.updatedRecordCollection=this.parent.editedRecords,o.cancel=!1,o.action="delete",this.initiateDeleteAction(o),this.parent.isOnDelete=!1}t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.removePredecessorOnDelete=function(e){for(var i=e.ganttProperties.predecessor,r=0;r<i.length;r++){var n=i[r],a="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(n.from.toString()===a.toString()){var s=this.parent.connectorLineModule.getRecordByID(n.to.toString());if(!t.isNullOrUndefined(s)){for(var o=t.extend([],[],s.ganttProperties.predecessor,!0),l=void 0,d=0;d<o.length;d++){var p="ResourceView"===this.parent.viewType?s.ganttProperties.taskId:s.ganttProperties.rowUniqueID;if(o[d].to.toString()===p.toString()&&o[d].from.toString()===a.toString()){l=d;break}}o.splice(l,1),this.updatePredecessorValues(s,o)}}else if(n.to.toString()===a.toString()){var h=this.parent.connectorLineModule.getRecordByID(n.from.toString());if(!t.isNullOrUndefined(h)){var c=t.extend([],[],h.ganttProperties.predecessor,!0);for(l=void 0,d=0;d<c.length;d++){var u="ResourceView"===this.parent.viewType?h.ganttProperties.taskId:h.ganttProperties.rowUniqueID;if(c[d].from.toString()===u.toString()&&c[d].to.toString()===a.toString()){l=d;break}}c.splice(l,1),this.updatePredecessorValues(h,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,i){if(!this.parent.readOnly){var r="number"==typeof e?e.toString():e,n="number"==typeof i?i.toString():i,a=this.parent.ids;if(!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(n)){var s=a.indexOf(r),o=a.indexOf(n);if(-1===s||o>-1)return;var l=this.parent.flatData[s];if(l.ganttProperties.taskId=l.ganttProperties.rowUniqueID=n,l.taskData[this.parent.taskFields.id]=n,l[this.parent.taskFields.id]=n,a[s]=n,l.hasChildRecords&&this.parent.taskFields.parentID)for(var d=l.childRecords,p=0;p<d.length;p++){var h=d[p];h[this.parent.taskFields.parentID]=i,this.parent.chartRowsModule.refreshRecords([h])}if(this.parent.taskFields.dependency&&!t.isNullOrUndefined(l.ganttProperties.predecessor))for(var c=l.ganttProperties.predecessor,u=void 0,g=0;g<c.length;g++){var f=c[g];f.to===r?u=this.parent.flatData[a.indexOf(f.from)]:f.from===r&&(u=this.parent.flatData[a.indexOf(f.to)]),this.updatePredecessorOnUpdateId(u,r,n)}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;n&&n.length&&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,i){for(var r=0;r<e.length&&!this.isBreakLoop;r++)if(-1!==i.indexOf(t.getValue(this.parent.taskFields.id,e[r]).toString())){if(e[r][this.parent.taskFields.child]){var n=e[r][this.parent.taskFields.child];this.removeData(n,i)}if(i.splice(i.indexOf(t.getValue(this.parent.taskFields.id,e[r]).toString()),1),e.splice(r,1),0===i.length){this.isBreakLoop=!0;break}}else if(e[r][this.parent.taskFields.child]){n=e[r][this.parent.taskFields.child];this.removeData(n,i)}},e.prototype.initiateDeleteAction=function(e){var t=this;this.parent.showSpinner();var i={};i.requestType="beforeDelete",i.data=e.deletedRecordCollection,i.modifiedRecords=e.updatedRecordCollection,i.modifiedTaskData=D(e.updatedRecordCollection,null,null,this.parent),this.parent.trigger("actionBegin",i,function(i){if(i.cancel){for(var r=t.deletedTaskDetails,a=0;a<r.length;a++)r[a].isDelete=!1;t.deletedTaskDetails=[],t.reUpdatePreviousRecords(),t.parent.initiateEditAction(!1),t.parent.hideSpinner()}else if(v(t.parent.dataSource)){var s=t.parent.dataSource;t.parent.timezone&&w(i.modifiedTaskData,t.parent);var o={deletedRecords:D(i.data,null,null,t.parent),changedRecords:i.modifiedTaskData},l=s.adaptor,d=t.parent.query instanceof n.Query?t.parent.query:new n.Query;if(l instanceof n.WebApiAdaptor&&l instanceof n.ODataAdaptor&&!s.dataSource.batchUrl){for(var p=null,h=0;h<o.deletedRecords.length;h++)p=s.remove(t.parent.taskFields.id,o.deletedRecords[h],null,d);p.then(function(){s.update(t.parent.taskFields.id,o.changedRecords,null,d).then(function(){return t.deleteSuccess(e)}).catch(function(i){return t.dmFailure(i,e)})}).catch(function(i){return t.dmFailure(i,e)})}else{s.saveChanges(o,t.parent.taskFields.id,null,d).then(function(){return t.deleteSuccess(e)}).catch(function(i){return t.dmFailure(i,e)})}}else t.deleteSuccess(e)})},e.prototype.deleteSuccess=function(e){var i=this.parent.flatData,r=this.parent.currentViewData,n=this.parent.getRecordFromFlatdata(e.deletedRecordCollection),a=[];n.length>0&&(this.parent.selectedRowIndex=n[n.length-1].index);for(var s=0;s<n.length;s++){var o=n[s],l=r.indexOf(o),d=i.indexOf(o),p=this.parent.treeGrid.parentData.indexOf(o),h=t.getValue("dataOperation.dataArray",this.parent),c=h.indexOf(o.taskData),u=void 0;if(-1!==l&&r.splice(l,1),-1!==d&&i.splice(d,1),-1!==c&&h.splice(c,1),!t.isNullOrUndefined(o)){if(a.push(o.ganttProperties.taskId.toString()),-1!==d&&(this.parent.ids.splice(d,1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(d,1)),0===o.level&&-1!==p&&this.parent.treeGrid.parentData.splice(p,1),o.parentItem){var g=this.parent.getParentTask(o.parentItem);if(g){var f=g.childRecords;-1!==(u=f.indexOf(o))&&f.splice(u,1),f.length||this.parent.setRecordValue("hasChildRecords",!1,g)}}this.updateTreeGridUniqueID(o,"delete")}}a.length>0&&this.removeFromDataSource(a);var m={};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(),m.requestType="delete",m.data=e.deletedRecordCollection,m.modifiedRecords=e.updatedRecordCollection,m.modifiedTaskData=D(e.updatedRecordCollection,null,null,this.parent),t.setValue("action",e.action,m),this.parent.isOnDelete=!1,this.parent.trigger("actionComplete",m),this.deletedTaskDetails=[],this.parent.initiateEditAction(!1),this.parent.hideSpinner()},e.prototype.getNewTaskId=function(){var e=n.DataUtil.aggregates.max(this.parent.flatData,this.parent.taskFields.id);return t.isNullOrUndefined(e)?1:parseInt(e.toString(),10)+1},e.prototype.prepareNewlyAddedData=function(e,i){var r,n=this.parent.taskFields,a=this.parent.ids;if(e[n.id]&&(-1!==a.indexOf(e[n.id].toString())?e[n.id]=null:e[n.id]=t.isNullOrUndefined(e[n.id])?null:parseInt(e[n.id],10)),e[n.id]||(r=this.getNewTaskId(),e[n.id]=r),this.parent.allowUnscheduledTasks||e[n.startDate]||(e[n.startDate]=this.parent.projectStartDate),!this.parent.allowUnscheduledTasks&&n.duration&&t.isNullOrUndefined(e[n.duration])&&(e[n.endDate]||(e[n.duration]="5")),n.progress&&(e[n.progress]=e[n.progress]?e[n.progress]>100?100:e[n.progress]:0),!this.parent.allowUnscheduledTasks&&!e[n.endDate]&&n.endDate&&!e[n.duration]){var s=this.parent.dataOperation.getDateFromFormat(this.parent.projectStartDate);s.setDate(s.getDate()+4),e[n.endDate]=this.parent.getFormatedDate(s,this.parent.getDateFormat())}},e.prototype.updateNewlyAddedDataBeforeAjax=function(e,i,r,n){var a=this.parent.dataOperation.createRecord(e,i);if(a.index=parseInt(a.ganttProperties.rowUniqueID.toString(),10)-1,!t.isNullOrUndefined(n)){this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(n),a);var s=a.parentItem?a.parentItem.index:null;this.parent.setRecordValue("parentIndex",s,a);var o=a.parentItem?a.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",o,a),t.isNullOrUndefined(this.parent.taskFields.id)||t.isNullOrUndefined(this.parent.taskFields.parentID)||!a.parentItem||("ProjectView"===this.parent.viewType&&this.parent.setRecordValue(this.parent.taskFields.parentID,a.parentItem.taskId,a.taskData,!0),this.parent.setRecordValue("parentId",a.parentItem.taskId,a.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.parentID,a.parentItem.taskId,a,!0))}return this.parent.isOnEdit=!0,this.backUpAndPushNewlyAddedRecord(a,r,n),this.parent.taskFields.dependency&&a.ganttProperties.predecessorsName&&(this.parent.predecessorModule.ensurePredecessorCollectionHelper(a,a.ganttProperties),this.parent.predecessorModule.updatePredecessorHelper(a),this.parent.predecessorModule.validatePredecessorDates(a)),a.parentItem&&this.parent.getParentTask(a.parentItem).ganttProperties.isAutoSchedule&&this.parent.dataOperation.updateParentItems(a.parentItem),this.parent.isOnEdit=!1,a},e.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)t++,(i=e.childRecords[r]).hasChildRecords&&(t=this.getChildCount(i,t));return t},e.prototype.getVisibleChildRecordCount=function(e,t,i){var r,n;if(e.hasChildRecords){n=(r=e.childRecords).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 i,r,n=e.ganttProperties.predecessor.length,a=e.ganttProperties,s=a.predecessor,o=0;o<n;o++)if(s[o].to===a.rowUniqueID.toString()){i=this.parent.getRecordByID(s[o].from),r=T(s[o],"from",i.ganttProperties.predecessor,"to");var l=t.extend([],i.ganttProperties.predecessor,[],!0);l.splice(r,1),this.parent.setRecordValue("predecessor",l,i.ganttProperties,!0)}else if(s[o].from===a.rowUniqueID.toString()){var d=(i=this.parent.getRecordByID(s[o].to)).ganttProperties.predecessorsName.toString().split(","),p=s[o].from+s[o].type,h=d.indexOf(p);d.splice(h,1),this.parent.setRecordValue("predecessorsName",d.join(","),i.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.dependency,d.join(","),i),r=T(s[o],"from",i.ganttProperties.predecessor,"to");var c=t.extend([],i.ganttProperties.predecessor,[],!0);c.splice(r,1),this.parent.setRecordValue("predecessor",c,i.ganttProperties,!0),this.parent.predecessorModule.validatePredecessorDates(i)}this.parent.setRecordValue("predecessor",[],e.ganttProperties,!0),this.parent.setRecordValue("predecessorsName","",e.ganttProperties,!0)},e.prototype.predecessorToString=function(e,t){for(var i=[],r=0,n=e.length;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,i,r){var n,a,s,o=this.parent.flatData,l=this.parent.currentViewData,d=this.parent.ids;switch(i){case"Top":o.splice(0,0,e),l.splice(0,0,e),d.splice(0,0,e.ganttProperties.rowUniqueID.toString());break;case"Bottom":if(o.push(e),l.push(e),d.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":a=o.indexOf(this.addRowSelectedItem),s=l.indexOf(this.addRowSelectedItem),this.recordCollectionUpdate(void 0,a,s,e,r,i);break;case"Below":if(n=o.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){a=n+this.getChildCount(this.addRowSelectedItem,0)+1,s=l.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,l)+1}else a=n+1,s=l.indexOf(this.addRowSelectedItem)+1;this.recordCollectionUpdate(NaN,a,s,e,r,i);break;case"Child":if(n=o.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){a=n+this.getChildCount(this.addRowSelectedItem,0)+1,this.addRowSelectedItem.expanded||this.parent.enableMultiTaskbar||this.parent.expandByID(Number(this.addRowSelectedItem.ganttProperties.rowUniqueID)),s=l.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,l)+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),a=n+1,s=l.indexOf(this.addRowSelectedItem)+1,this.addRowSelectedItem.ganttProperties.predecessor&&this.updatePredecessorOnIndentOutdent(this.addRowSelectedItem),t.isNullOrUndefined(this.addRowSelectedItem.ganttProperties.segments)||(this.addRowSelectedItem.ganttProperties.segments=null);this.recordCollectionUpdate(NaN,a,s,e,r,i)}this.newlyAddedRecordBackup=e},e.prototype.recordCollectionUpdate=function(e,i,r,a,s,o){var l=this.parent.flatData,d=this.parent.currentViewData,p=this.parent.ids;if(l.splice(i,0,a),d.splice(r,0,a),p.splice(i,0,a.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var h=0===a.level?"R"+a.ganttProperties.taskId:"T"+a.ganttProperties.taskId;this.parent.getTaskIds().splice(i,0,h)}if(!t.isNullOrUndefined(s)&&(e="Above"==o?s.childRecords.indexOf(this.addRowSelectedItem):"Below"==o?s.childRecords.indexOf(this.addRowSelectedItem)+1:s.childRecords.length,s.childRecords.splice(e,0,a),this.parent.dataSource instanceof n.DataManager&&t.isNullOrUndefined(s.taskData[this.parent.taskFields.parentID])||!t.isNullOrUndefined(this.parent.dataSource))){var c=this.parent.taskFields.child;s.taskData[c]&&s.taskData[c].length>0?"Above"===o||"Below"===o?s.taskData[c].splice(e,0,a.taskData):s.taskData[c].push(a.taskData):(s.taskData[c]=[],s.taskData[c].push(a.taskData))}},e.prototype.constructTaskAddedEventArgs=function(e,t,i){var r={};if(r.action=r.requestType=i,e.length>1){r.data=[],r.newTaskData=[],r.recordIndex=[];for(var n=0;n<e.length;n++)r.data[n]=e[n],r.newTaskData[n]=D([e[n]],r.data[n],r,this.parent),r.recordIndex[n]=e[n].index}else if(1===e.length)for(n=0;n<e.length;n++)r.data=e[n],r.newTaskData=D([e[n]],r.data,r,this.parent),r.recordIndex=e[n].index;return r.modifiedRecords=t,r.modifiedTaskData=D(t,null,null,this.parent),r},e.prototype.addSuccess=function(e){this.parent.treeGrid.parentData=[],this.parent.addDeleteRecord=!0,this.parent.selectedRowIndex=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,i){if(!i&&!t.isNullOrUndefined(e))for(var r=e[0].index+1;r<this.parent.currentViewData.length&&e[0].level<this.parent.currentViewData[r].level;r++)this.parent.modifiedRecords.push(this.parent.currentViewData[r]);var n,a=function(e){var t=s.parent.modifiedRecords[e],i=s.parent.allowRowDragAndDrop?1:0,r=s.parent.taskFields.id;n=s.parent.currentViewData.findIndex(function(e){return e[r]==t[r]}),s.parent.treeGrid.getRows()[n]&&(s.parent.treeGrid.renderModule.cellRender({data:t,cell:s.parent.treeGrid.getRows()[n].cells[s.parent.treeColumnIndex+i],column:s.parent.treeGrid.grid.getColumns()[s.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),s.parent.treeGrid.renderModule.RowModifier({data:t,row:s.parent.treeGrid.getRows()[n],rowHeight:s.parent.rowHeight}))},s=this;for(r=0;r<this.parent.modifiedRecords.length;r++)a(r)},e.prototype.updateRealDataSource=function(e,i){var r=this.parent.taskFields,a=m(this.parent)?t.getValue("result",this.parent.dataSource):this.parent.dataSource;this.parent.dataSource instanceof n.DataManager&&(a=this.parent.dataSource.dataSource.json);for(var s=0;s<e.length;s++)(t.isNullOrUndefined(i)||t.isNullOrUndefined(this.addRowSelectedItem))&&(i="Bottom"===i?"Bottom":"Top"),"Top"===i?a.splice(0,0,e[s].taskData):"Bottom"===i?a.push(e[s].taskData):t.isNullOrUndefined(r.id)||t.isNullOrUndefined(r.parentID)?this.addDataInRealDataSource(a,e[s].taskData,i):a.push(e[s].taskData),this.isBreakLoop=!1},e.prototype.addDataInRealDataSource=function(e,i,r){for(var n=0;n<e.length;n++){var a=this.parent.taskFields.child;if(this.isBreakLoop)break;if(t.getValue(this.parent.taskFields.id,e[n]).toString()===this.addRowSelectedItem.ganttProperties.rowUniqueID.toString()){"Above"===r?e.splice(n,0,i):"Below"===r?e.splice(n+1,0,i):"Child"===r&&(e[n][a]&&e[n][a].length>0?e[n][a].push(i):(e[n][a]=[],e[n][a].push(i))),this.isBreakLoop=!0;break}if(e[n][a]){var s=e[n][a];this.addDataInRealDataSource(s,i,r)}}},e.prototype.addRecord=function(e,i,r){var a=this;if(this.parent.editModule&&this.parent.editSettings.allowAdding){this.parent.isDynamicData=!0;var s=[];if(t.isNullOrUndefined(e))this.validateTaskPosition(e,i,r,s);else if(e instanceof Array)for(var o=0;o<e.length;o++)this.validateTaskPosition(e[o],i,r,s);else{if("object"!=typeof e)return;this.validateTaskPosition(e,i,r,s)}var l={};l=this.constructTaskAddedEventArgs(s,this.parent.editedRecords,"beforeAdd"),this.parent.showSpinner(),this.parent.trigger("actionBegin",l,function(e){if(e.cancel)e=e,a.removeAddedRecord(),a.reUpdatePreviousRecords(),a._resetProperties();else if(v(a.parent.dataSource)){var r=a.parent.dataSource,o={addedRecords:[e.newTaskData],changedRecords:e.modifiedTaskData},l=e.data.ganttProperties.taskId.toString(),d=a.parent.query instanceof n.Query?a.parent.query:new n.Query,p=r.adaptor;if(p instanceof n.WebApiAdaptor&&p instanceof n.ODataAdaptor&&!r.dataSource.batchUrl){r.insert(o.addedRecords,null,d).then(function(i){var n;n=t.isNullOrUndefined(i[0])?o.addedRecords[0]:i[0];r.update(a.parent.taskFields.id,o.changedRecords,null,d).then(function(){if(a.parent.taskFields.id&&!t.isNullOrUndefined(n[a.parent.taskFields.id])&&n[a.parent.taskFields.id].toString()!==l){a.parent.setRecordValue("taskId",n[a.parent.taskFields.id],e.data.ganttProperties,!0),a.parent.setRecordValue("taskData."+a.parent.taskFields.id,n[a.parent.taskFields.id],e.data),a.parent.setRecordValue(a.parent.taskFields.id,n[a.parent.taskFields.id],e.data),a.parent.setRecordValue("rowUniqueID",n[a.parent.taskFields.id].toString(),e.data.ganttProperties,!0);var i=a.parent.ids.indexOf(l);-1!==i&&(a.parent.ids[i]=n[a.parent.taskFields.id].toString())}a.updateNewRecord(s,e)}).catch(function(t){a.removeAddedRecord(),a.dmFailure(t,e),a._resetProperties()})}).catch(function(t){a.removeAddedRecord(),a.dmFailure(t,e),a._resetProperties()})}else{r.saveChanges(o,a.parent.taskFields.id,null,d).then(function(i){if(a.parent.taskFields.id&&!t.isNullOrUndefined(i.addedRecords[0][a.parent.taskFields.id])&&i.addedRecords[0][a.parent.taskFields.id].toString()!==l){a.parent.setRecordValue("taskId",i.addedRecords[0][a.parent.taskFields.id],e.data.ganttProperties,!0),a.parent.setRecordValue("taskData."+a.parent.taskFields.id,i.addedRecords[0][a.parent.taskFields.id],e.data),a.parent.setRecordValue(a.parent.taskFields.id,i.addedRecords[0][a.parent.taskFields.id],e.data),a.parent.setRecordValue("rowUniqueID",i.addedRecords[0][a.parent.taskFields.id].toString(),e.data.ganttProperties,!0);var r=a.parent.ids.indexOf(l);-1!==r&&(a.parent.ids[r]=i.addedRecords[0][a.parent.taskFields.id].toString())}a.updateNewRecord(s,e)}).catch(function(t){a.removeAddedRecord(),a.dmFailure(t,e),a._resetProperties()})}}else{if("ProjectView"===a.parent.viewType){if("Top"===i||"Bottom"===i||("Above"===i||"Below"===i||"Child"===i)&&!e.data.parentItem)if(e.data instanceof Array)a.updateRealDataSource(e.data,i);else{var h=[];h.push(e.data),a.updateRealDataSource(h,i)}}else{(m(a.parent)?t.getValue("result",a.parent.dataSource):a.parent.dataSource).push(e.data.taskData)}0===s.level&&a.parent.treeGrid.parentData.splice(0,0,s),a.updateTreeGridUniqueID(s,"add"),a.refreshNewlyAddedRecord(e,s),a._resetProperties()}})}},e.prototype.createNewRecord=function(){for(var e={},i=this.parent.ganttColumns,r=this.parent.taskFields,n=this.parent.editModule.getNewTaskId(),a=0;a<i.length;a++){var s=i[a].field;s===r.id?e[s]=n:i[a].field===r.startDate?(t.isNullOrUndefined(e[r.endDate])?e[s]=this.parent.editModule.dialogModule.getMinimumStartDate():e[s]=new Date(e[r.endDate]),this.parent.timezone&&(e[s]=this.parent.dateValidationModule.remove(e[s],this.parent.timezone))):i[a].field===r.endDate?(t.isNullOrUndefined(e[r.startDate])?e[s]=this.parent.editModule.dialogModule.getMinimumStartDate():e[s]=new Date(e[r.startDate]),this.parent.timezone&&(e[s]=this.parent.dateValidationModule.remove(e[s],this.parent.timezone))):i[a].field===r.duration?e[s]=1:i[a].field===r.name?e[s]=this.parent.editModule.dialogModule.localeObj.getConstant("addDialogTitle")+" "+n:i[a].field===r.progress?e[s]=0:i[a].field===r.work?e[s]=0:"taskType"===i[a].field?e[s]=this.parent.taskType:e[this.parent.ganttColumns[a].field]=""}return e},e.prototype.validateTaskPosition=function(e,i,r,n){var a=t.isNullOrUndefined(r)||isNaN(parseInt(r.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:r;this.addRowSelectedItem=t.isNullOrUndefined(a)?null:this.parent.updatedRecords[a],i=t.isNullOrUndefined(i)?this.parent.editSettings.newRowPosition:i,e=t.isNullOrUndefined(e)?this.createNewRecord():e,((t.isNullOrUndefined(a)||a<0||t.isNullOrUndefined(this.addRowSelectedItem))&&("Above"===i||"Below"===i||"Child"===i)||!i||"Above"!==i&&"Below"!==i&&"Child"!==i&&"Top"!==i&&"Bottom"!==i)&&(i="Top");var s,o=0;switch(i){case"Top":case"Bottom":o="ResourceView"===this.parent.viewType?1:0;break;case"Above":case"Below":o=this.addRowSelectedItem.level,s=this.parent.getParentTask(this.addRowSelectedItem.parentItem);break;case"Child":o=this.addRowSelectedItem.level+1,s=this.addRowSelectedItem}this.prepareNewlyAddedData(e,i);var l=this.updateNewlyAddedDataBeforeAjax(e,o,i,s);n.push(l)},e.prototype.updateNewRecord=function(e,i){if(0===e.level){this.parent.treeGrid.parentData.splice(0,0,e);t.getValue("dataOperation.dataArray",this.parent).splice(0,0,e.taskData)}this.updateTreeGridUniqueID(e,"add"),this.refreshNewlyAddedRecord(i,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,i){"add"===i?t.setValue("uniqueIDCollection."+e.uniqueID,e,this.parent.treeGrid):"delete"===i&&t.deleteObject(t.getValue("uniqueIDCollection",this.parent.treeGrid),e.uniqueID)},e.prototype.refreshNewlyAddedRecord=function(e,i){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 r=[];e.modifiedRecords.length>0?(r=e.data.length>0?e.data:[e.data]).push.apply(r,e.modifiedRecords):r=e.data.length>0?e.data:[e.data],this.parent.timelineModule.updateTimeLineOnEditing([r],e.action)}if(this.addSuccess(e),e=this.constructTaskAddedEventArgs(i,e.modifiedRecords,"add"),this.dialogModule.isAddNewResource&&!this.parent.isEdit&&this.parent.taskFields.work&&this.parent.dataOperation.updateWorkWithDuration(i[0]),this.parent.trigger("actionComplete",e),this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose(),"ResourceView"===this.parent.viewType)if(i.length>1)for(var n=0;n<i.length;n++){if(e.data[n].ganttProperties.sharedTaskUniqueIds.push(e.data[n].ganttProperties.rowUniqueID),e.data[n].ganttProperties.resourceInfo){(s=t.extend([],[],e.data[n].ganttProperties.resourceInfo,!0)).splice(0,1),this.updateResoures([],s,e.data[n])}else this.removeChildRecord(e.data[n]),this.parent.editModule.checkWithUnassignedTask(e.data[n]);for(var a=0;a<this.updateParentRecords.length;a++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[a]);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;(s=t.extend([],[],e.data.ganttProperties.resourceInfo,!0)).splice(0,1),this.updateResoures([],s,e.data)}}else this.removeChildRecord(e.data),this.parent.editModule.checkWithUnassignedTask(e.data);for(a=0;a<this.updateParentRecords.length;a++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[a]);this.updateParentRecords=[]}},e.prototype.removeAddedRecord=function(){var e=this.parent.flatData,i=this.parent.currentViewData,r=this.parent.ids,n=e.indexOf(this.newlyAddedRecordBackup),a=i.indexOf(this.newlyAddedRecordBackup),s=r.indexOf(this.newlyAddedRecordBackup.ganttProperties.rowUniqueID.toString());if(t.deleteObject(this.parent.previousRecords,e[n].uniqueID),this.newlyAddedRecordBackup.parentItem){var o=this.parent.getParentTask(this.newlyAddedRecordBackup.parentItem),l=o.childRecords.indexOf(this.newlyAddedRecordBackup);o.childRecords.splice(l,1)}e.splice(n,1),i.splice(a,1),r.splice(s,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,i){var r=this;e[0],"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var n=void 0,a=[],s=0;s<e.length;s++)a[s]=this.parent.updatedRecords[e[s]];var o={data:a,dropIndex:t,dropPosition:this.dropPosition};"middleSegment"===this.dropPosition?n="indenting":"bottomSegment"===this.dropPosition&&(n="outdenting");var l={action:n,data:a[0],cancel:!1};this.parent.trigger("actionBegin",l,function(e){e.cancel||r.reArrangeRows(o,!0)})},e.prototype.reArrangeRows=function(e,i){if(this.dropPosition=e.dropPosition,"Invalid"!==e.dropPosition&&this.parent.editModule){var r=this.parent,n=void 0;this.droppedRecord=r.updatedRecords[e.dropIndex];var a=[],s=this.droppedRecord;e.data[0]?a=e.data:a.push(e.data);for(var o=0,l=a.length,d=0;d<l;d++){if(this.parent.isOnEdit=!0,n=a[d],this.draggedRecord=n,"Invalid"!==this.dropPosition){i&&this.deleteDragRow();var p=this.treeGridData.indexOf(s);if("bottomSegment"===this.dropPosition){if(s.hasChildRecords){o=this.parent.editModule.getChildCount(s,0),this.parent.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(p+o+1,0,this.draggedRecord.taskData),this.treeGridData.splice(p+o+1,0,this.draggedRecord),this.parent.ids.splice(p+o+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString());var h=this.parent.ids.indexOf(this.draggedRecord[this.parent.taskFields.id].toString());h!==p+o+1&&(this.parent.ids.splice(h,1),this.parent.ids.splice(p+o+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,n),this.parent.setRecordValue("parentUniqueID",this.treeGridData[p].parentUniqueID,n),this.parent.setRecordValue("level",this.treeGridData[p].level,n),n.hasChildRecords){this.updateChildRecordLevel(n,1),this.updateChildRecord(n,p+o+1)}if(s.parentItem){var c=this.parent.getParentTask(s.parentItem).childRecords,u=c.indexOf(s)+1;c.splice(u,0,n)}}"middleSegment"===this.dropPosition&&this.dropMiddle(p),t.isNullOrUndefined(n.parentItem&&-1!==this.updateParentRecords.indexOf(n.parentItem))||this.updateParentRecords.push(n.parentItem)}if(t.isNullOrUndefined(n.parentItem)){var g=this.parent.treeGrid.parentData,f=g.indexOf(this.droppedRecord);"bottomSegment"===this.dropPosition&&g.splice(f+1,0,n)}this.refreshDataSource()}"middleSegment"===this.dropPosition&&(s.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(s),s.ganttProperties.predecessor=null,s.ganttProperties.predecessorsName=null,s[this.parent.taskFields.dependency]=null,s.taskData[this.parent.taskFields.dependency]=null),s.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,s.ganttProperties,!0),t.isNullOrUndefined(s.taskData[this.parent.taskFields.milestone])||!0===s.taskData[this.parent.taskFields.milestone]&&(s.taskData[this.parent.taskFields.milestone]=!1)));for(var m=0;m<this.updateParentRecords.length;m++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[m]);this.updateParentRecords=[],this.parent.isOnEdit=!1}this.refreshRecord(e)},e.prototype.refreshRecord=function(e,t){var i=this;if(v(this.parent.dataSource)){var r=this.parent.dataSource,a={changedRecords:D(this.parent.editedRecords,null,null,this.parent)},s=this.parent.query instanceof n.Query?this.parent.query:new n.Query,o=null,l=r.adaptor;if(l instanceof n.WebApiAdaptor&&l instanceof n.ODataAdaptor&&!r.dataSource.batchUrl){o=r.update(this.parent.taskFields.id,a.changedRecords,null,s)}else o=r.saveChanges(a,this.parent.taskFields.id,null,s);o.then(function(r){return i.indentSuccess(r,e,t)}).catch(function(e){return i.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 i=0;i<e.modifiedRecords.length;i++)w(e.modifiedRecords[i],this.parent);this.parent.trigger("actionComplete",e),this.parent.editedRecords=[]},e.prototype.refreshDataSource=function(){var e,i,r=this.draggedRecord,a=this.droppedRecord,s=this.parent;if((e=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):s.dataSource).length>0&&!t.isNullOrUndefined(a)&&!a.parentItem){for(var o=0;o<Object.keys(e).length;o++)e[o][this.parent.taskFields.child]===a.taskData[this.parent.taskFields.child]&&(i=o);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(i,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(i+1,0,r.taskData))}else if(!this.parent.taskFields.parentID&&!t.isNullOrUndefined(a)&&a.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var l="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=a,this.parent.editModule.updateRealDataSource(r,l),delete this.parent.editModule.addRowSelectedItem}this.parent.taskFields.parentID&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID],r.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID],r.ganttProperties.parentId=a[this.parent.taskFields.parentID]):(r[this.parent.taskFields.parentID]=a[this.parent.taskFields.id],r.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.id],r.ganttProperties.parentId=a[this.parent.taskFields.id]):(r[this.parent.taskFields.parentID]=null,r.taskData[this.parent.taskFields.parentID]=null,r.ganttProperties.parentId=null))},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof n.DataManager?this.ganttData=t.getValue("dataOperation.dataArray",this.parent):this.ganttData=m(this.parent)?t.getValue("result",this.parent.dataSource):this.parent.dataSource,this.treeGridData=m(this.parent)?t.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 i=this.parent,r=this.parent.editModule.getChildCount(this.droppedRecord,0),n=t.isNullOrUndefined(r)||0===r?e+1:r+e+1;if("middleSegment"===this.dropPosition){if(i.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(n,0,this.draggedRecord.taskData),this.treeGridData.splice(n,0,this.draggedRecord),this.parent.ids.splice(n,0,this.draggedRecord[this.parent.taskFields.id].toString()),this.recordLevel(),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,n,this.droppedRecord.expanded),this.parent.enableImmutableMode)){var a=this.draggedRecord;this.updateIndentedChildRecords(a)}t.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 i,r=this.parent;i=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource;var a=e,s=this.parent.getParentTask(a.parentItem);if(a){if(a.parentItem){var o=s?s.childRecords:[],l=0;o&&o.length>0&&(l=o.indexOf(a),s.childRecords.splice(l,1),this.parent.taskFields.parentID||s.taskData[this.parent.taskFields.child].splice(l,1),this.updateParentRecords.push(s))}if(r.taskFields.parentID){a.hasChildRecords&&a.childRecords.length>0&&this.removeChildItem(a);for(var d=void 0,p=i.length>0?i:this.parent.currentViewData,h=0;h<p.length;h++)p[h][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(d=h);if(-1!==d){i.length>0&&i.splice(d,1);var c=void 0;for(h=0;h<this.treeGridData.length;h++)this.treeGridData[h][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(c=h);this.treeGridData.splice(c,1),this.parent.ids.splice(c,1),-1!==this.parent.treeGrid.parentData.indexOf(a)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(a),1)}}var u=this.treeGridData.indexOf(a);if(!r.taskFields.parentID){var g=this.getChildCount(a,0);this.treeGridData.splice(u,g+1),this.parent.ids.splice(u,g+1);var f=this.ganttData.indexOf(a.taskData);-1!==f&&(this.ganttData.splice(f,1),this.parent.treeGrid.parentData.splice(f,1))}a.parentItem&&s&&s.childRecords&&!s.childRecords.length&&(this.parent.setRecordValue("expanded",!1,s),this.parent.setRecordValue("hasChildRecords",!1,s))}},e.prototype.removeChildItem=function(e){for(var i,r,a=0;a<e.childRecords.length;a++){i=e.childRecords[a];var s=void 0;s=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource;for(var o=0;o<s.length;o++)s[o][this.parent.taskFields.id]===i.taskData[this.parent.taskFields.id]&&(r=o);if(-1!==r){s.length>0&&s.splice(r,1);for(var l=void 0,d=0;d<this.treeGridData.length;d++)this.treeGridData[d][this.parent.taskFields.id]===i.taskData[this.parent.taskFields.id]&&(l=d);this.treeGridData.splice(l,1),this.parent.ids.splice(l,1)}i.hasChildRecords&&this.removeChildItem(i)}},e.prototype.recordLevel=function(){var e=this.parent,i=this.draggedRecord,r=this.droppedRecord,n=e.taskFields.child;if(r.hasChildRecords||(r.hasChildRecords=!0,r.childRecords.length||(r.childRecords=[],!e.taskFields.parentID&&t.isNullOrUndefined(r.taskData[n])&&(r.taskData[n]=[]))),"middleSegment"===this.dropPosition){var a=t.extend({},r);delete a.childRecords;var s={uniqueID:a.uniqueID,expanded:a.expanded,level:a.level,index:a.index,taskId:a.ganttProperties.rowUniqueID};if(this.parent.setRecordValue("parentItem",s,i),this.parent.setRecordValue("parentUniqueID",r.uniqueID,i),r.childRecords.splice(r.childRecords.length,0,i),t.isNullOrUndefined(i)||e.taskFields.parentID||t.isNullOrUndefined(r.taskData[n])||r.taskData[e.taskFields.child].splice(r.childRecords.length,0,i.taskData),!t.isNullOrUndefined(r.ganttProperties.segments)&&r.ganttProperties.segments.length>0&&(r.ganttProperties.segments=null,r.taskData[e.taskFields.segments]=null),i.hasChildRecords){i.level=r.level+1,this.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e}(),ui=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.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}(),gi=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.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}(),fi=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.Filter),this.parent.treeGrid.allowFiltering=this.parent.allowFiltering,this.updateCustomFilters(),this.parent.treeGrid.filterSettings=r.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.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&&!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.getDatePickerFilter=function(e){var i,n=this,a=this.parent,s=e===a.taskFields.startDate||e===a.taskFields.baselineStartDate?a.defaultStartTime:a.defaultEndTime;return{create:function(e){var a=r.getCustomDateFormat(e.column.format,e.column.type),s=t.createElement("input",{className:"flm-input"});e.target.appendChild(s),(i=new h.DatePicker({placeholder:n.parent.localeObj.getConstant("enterValue"),format:a})).appendTo(s)},write:function(e){i.value=e.filteredValue},read:function(e){i.value&&i.value.setSeconds(s),e.fltrObj.filterByColumn(e.column.field,e.operator,i.value)}}},e.prototype.getDateTimePickerFilter=function(){var e,i=this;return{create:function(n){var a=r.getCustomDateFormat(n.column.format,n.column.type),s=t.createElement("input",{className:"flm-input"});n.target.appendChild(s),(e=new h.DateTimePicker({placeholder:i.parent.localeObj.getConstant("enterValue"),format:a})).appendTo(s)},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,i=this,r=this.parent,n="";return{create:function(r){var n=t.createElement("input",{className:"e-input"});n.setAttribute("placeholder",i.parent.localeObj.getConstant("enterValue")),r.target.appendChild(n),(e=new d.TextBox).appendTo(n)},write:function(t){e.value=t.filteredValue?n:""},read:function(a){var s=i.parent.dataOperation.getDurationValue(e.value),o=t.getValue("duration",s),l=t.getValue("durationUnit",s);if(o>=0){var d=void 0;"minute"===l?d=60*o/r.secondsPerDay:"hour"===l?d=60*o*60/r.secondsPerDay:(d=o,l="day"),a.fltrObj.filterByColumn(a.column.field,a.operator,d),n=i.parent.dataOperation.getDurationString(o,l)}else a.fltrObj.filterByColumn(a.column.field,a.operator,null),n=null}}},e.prototype.columnMenuOpen=function(e){this.filterMenuElement&&document.body.contains(this.filterMenuElement)&&t.remove(this.filterMenuElement),this.filterMenuElement=null},e.prototype.actionBegin=function(e){},e.prototype.closeFilterOnContextClick=function(e){var i=document.querySelector("body > div.e-datepicker"),r=document.querySelector("body > div.e-datetimepicker");if(this.filterMenuElement&&document.body.contains(this.filterMenuElement)){var n=t.closest(e,"#"+this.parent.element.id)||e.querySelector("#"+this.parent.element.id);(!this.filterMenuElement.contains(e)&&!t.isNullOrUndefined(n)||!this.filterMenuElement.contains(e)&&t.isNullOrUndefined(i)&&t.isNullOrUndefined(r)&&("DIV"===e.nodeName||"HTML"===e.nodeName||"SPAN"===e.nodeName||"BUTTON"===e.nodeName))&&(t.remove(this.filterMenuElement),this.parent.treeGrid.grid.notify("filter-menu-close",{isOpen:!1}),this.filterMenuElement=null)}},e.prototype.actionComplete=function(e){if(e.requestType===r.filterAfterOpen){"Menu"===this.parent.treeGrid.filterSettings.type?this.filterMenuElement=t.getValue("filterModel.dlgObj.element",e):this.filterMenuElement=t.getValue("filterModel.dialogObj.element",e),this.updateFilterMenuPosition(this.filterMenuElement,e);var i=this.parent.taskFields.id,n=this.parent.taskFields.dependency,a=this.parent.taskFields.resourceInfo,s=this.parent.treeGrid.grid.filterModule,o=t.getValue("values",s);if(e.columnName===n&&t.isNullOrUndefined(t.getValue(n,o))||e.columnName===a&&t.isNullOrUndefined(t.getValue(a,o))){var l=this.filterMenuElement.querySelector(".e-dropdownlist");(d=t.getValue("ej2_instances[0]",l)).index=2,d.dataBind()}else if(e.columnName===i&&t.isNullOrUndefined(t.getValue(i,o))&&"Menu"===this.parent.treeGrid.filterSettings.type){l=this.filterMenuElement.querySelector(".e-numerictextbox");var d=t.getValue("ej2_instances[0]",l);!t.isNullOrUndefined(d)&&t.isNullOrUndefined(this.parent.columnByField[e.columnName].format)&&(d.format="n")}}},e.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),r=e.getBoundingClientRect(),n=r.right+window.scrollX,a=r.top+window.scrollY;i.right<n+t.offsetWidth&&(r.left-t.offsetWidth>i.left?n=r.left-t.offsetWidth:n-=n+t.offsetWidth-i.right),t.style.top=a+"px",t.style.left=n+"px"},e.prototype.updateFilterMenuPosition=function(e,i){t.addClass([e],"e-gantt"),document.querySelector("#"+this.parent.controlId).appendChild(e);var n;this.parent.showColumnMenu?(n=document.querySelector("#treeGrid"+this.parent.controlId+"_gridcontrol_colmenu_Filter"),e.style.zIndex=n.parentElement.style.zIndex,"Menu"===this.parent.treeGrid.filterSettings.type?this.setPosition(n,t.getValue("filterModel.dlgObj.element",i)):this.setPosition(n,t.getValue("filterModel.dialogObj.element",i))):(n=this.parent.treeGrid.grid.getColumnHeaderByField(i.columnName).querySelector(".e-filtermenudiv"),"Menu"===this.parent.treeGrid.filterSettings.type?r.getFilterMenuPostion(n,t.getValue("filterModel.dlgObj",i)):r.getFilterMenuPostion(n,t.getValue("filterModel.dialogObj",i))),"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()},e}(),mi=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.Sort),this.parent.treeGrid.allowSorting=this.parent.allowSorting,this.parent.treeGrid.sortSettings=r.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}(),yi=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=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){this.parent.isGanttChartRendered?(e.isCtrlPressed=this.isMultiCtrlRequest,e.isShiftPressed=this.isMultiShiftRequest,e.target=this.actualTarget,t.isNullOrUndefined(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.parent.trigger("rowSelecting",e)):e.cancel=!0},e.prototype.rowSelected=function(e){var i="Multiple"!==this.parent.selectionSettings.type||t.isNullOrUndefined(e.rowIndexes)?[e.rowIndex]:e.rowIndexes;this.addRemoveClass(i),this.selectedRowIndexes=t.extend([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:this.parent.treeGrid.grid.selectedRowIndex},!0),this.isMultiShiftRequest&&(this.selectedRowIndexes=i),this.parent.autoFocusTasks&&this.parent.ganttChartModule.updateScrollLeft(t.getValue("data.ganttProperties.left",e)),e.target=this.actualTarget,t.isNullOrUndefined(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.prevRowIndex=e.rowIndex,t.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 i,r;if(0!==this.multipleIndexes.length)i=this.multipleIndexes;else if(t.isNullOrUndefined(e.rowIndexes))i=[e.rowIndex];else{for(var n=0;n<e.rowIndexes.length;n++)e.rowIndexes[n]===e.rowIndex&&(r=!0);i=r?e.rowIndexes:[e.rowIndex]}this.addRemoveClass(i),this.selectedRowIndexes=t.extend([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:-1},!0),1===this.selectedRowIndexes.length&&this.parent.setProperties({selectedRowIndex:this.selectedRowIndexes[0]},!0),t.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 n.Deferred;return this.parent.trigger("cellSelecting",e,function(e){t.resolve(e)}),t},e.prototype.cellSelected=function(e){this.parent.trigger("cellSelected",e),t.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),t.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,i,r){var n,a=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children).filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e})[0];-1===e||t.isNullOrUndefined(a)||"Cell"===this.parent.selectionSettings.mode||(this.parent.showActiveElement&&!r?this.parent.treeGrid.grid.selectionModule.preventFocus=!0:this.parent.treeGrid.grid.selectionModule.preventFocus=!1,t.isNullOrUndefined(this.selectedClass)||this.selectedClass!==a||i||(n=!0),!0!==n&&this.parent.treeGrid.selectRow(e,i),this.parent.treeGrid.grid.selectionModule.preventFocus=!0!==this.parent.treeGrid.grid.selectionModule.preventFocus&&this.parent.treeGrid.grid.selectionModule.preventFocus,this.prevRowIndex=e,this.selectedClass=a)},e.prototype.selectRows=function(e){!t.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(){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,t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.isInteracted=!1},e.prototype.highlightSelectedRows=function(e,i){if(this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch,this.isMultiShiftRequest=e.shiftKey,this.actualTarget=e.target,this.isInteracted=!0,this.isSelectionFromChart=i,i){var r=t.closest(e.target,"tr.e-chart-row"),n=parseInt(r.getAttribute("aria-rowindex"),10),a=this.parent.selectionSettings.enableToggle;if("Single"===this.parent.selectionSettings.type||!this.isMultiCtrlRequest&&!this.isMultiShiftRequest)this.selectRow(n,a);else if(this.isMultiShiftRequest)this.selectRowsByRange(t.isNullOrUndefined(this.prevRowIndex)?n:this.prevRowIndex,n);else{t.setValue("isMultiCtrlRequest",!0,this.parent.treeGrid.grid.selectionModule),this.parent.treeGrid.grid.selectionModule.addRowsToSelection([n]);this.selectedRowIndexes.indexOf(n)>-1&&this.addRemoveClass([n])}}},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){for(var i=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),r=function(r){var a=i.filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e[r]})[0];t.isNullOrUndefined(a)||(n.getSelectedRowIndexes().indexOf(e[r])>-1?n.addClass(a):n.removeClass(a))},n=this,a=0;a<e.length;a++)r(a)},e.prototype.addClass=function(e){t.addClass([e],"e-active"),e.setAttribute("aria-selected","true")},e.prototype.removeClass=function(e){t.removeClass([e],"e-active"),e.removeAttribute("aria-selected")},e.prototype.showPopup=function(e){this.isSelectionFromChart?(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 i=e.target,r=this.parent.treeGrid.grid,n=t.closest(i,".e-ganttpopup")?t.closest(i,".e-ganttpopup"):t.closest(i,".e-gridpopup");if(n){var a=n.querySelector(".e-rowselect");t.closest(i,".e-ganttpopup")&&!a.classList.contains("e-spanclicked")?(this.enableSelectMultiTouch=!0,a.classList.add("e-spanclicked")):t.closest(i,".e-gridpopup")&&a.classList.contains("e-spanclicked")?(this.openPopup=!0,this.enableSelectMultiTouch=!0):(this.hidePopUp(),this.enableSelectMultiTouch=!1,t.closest(i,".e-ganttpopup")&&a.classList.remove("e-spanclicked"))}else if("Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive){t.closest(i,".e-rowcell")&&0===this.selectedRowIndexes.length&&this.hidePopUp()}r&&t.setValue("enableSelectMultiTouch",this.enableSelectMultiTouch,r.selectionModule)},e.prototype.mouseUpHandler=function(e){var i=!1,n=null;if(e.target.closest(".e-rowcell")?n=e.target:e.target.closest(".e-chart-row")&&(n=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(n),this.parent.editModule&&this.parent.editSettings.allowTaskbarEditing&&this.parent.editModule.taskbarEditModule){var a=this.parent.editModule.taskbarEditModule;(a.isMouseDragged||a.tapPointOnFocus)&&(i=!0)}if(!i&&this.parent.element.contains(e.target)){var s=r.parentsUntil(e.target,"e-chart-row"),o=e.target.classList.contains("e-rowcell")||e.target.classList.contains("e-row")||e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||!t.isNullOrUndefined(s);this.popUpClickHandler(e),"Cell"!==this.parent.selectionSettings.mode&&o?(t.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}(),vi=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=t.createElement("div",{id:this.parent.controlId+"_Gantt_Toolbar",className:"e-gantt-toolbar"}),this.parent.treeGrid.grid.headerModule?this.parent.element.insertBefore(this.element,this.parent.treeGridPane.offsetParent):this.parent.element.appendChild(this.element);for(var e=0,i=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath"];e<i.length;e++){var r=i[e],n=void 0,a=void 0;"CriticalPath"===r?(n="critical-path",a="criticalPath"):(n=r.toLowerCase(),a=r[0].toLowerCase()+r.slice(1)),this.predefinedItems[r]={id:this.parent.element.id+"_"+n,prefixIcon:"e-"+n,text:this.parent.isAdaptive?"":this.parent.localeObj.getConstant(a),tooltipText:this.parent.localeObj.getConstant(a)+("add"===a||"edit"===a||"delete"===a?this.parent.localeObj.getConstant("task"):"expandAll"===a||"collapseAll"===a?this.parent.localeObj.getConstant("tasks"):""),align:this.parent.isAdaptive?"Right":"Left"}}var s=this.parent.localeObj.getConstant("search");this.parent.isAdaptive?this.predefinedItems.Search={id:this.id+"_searchbutton",prefixIcon:"e-search-icon",tooltipText:s,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= "'+s+'"/><span id="'+this.id+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"tabindex="-1" title="'+s+'" aria-label= "search"></span></div>',tooltipText:s,align:"Right",cssClass:"e-search-wrapper"},this.createToolbar()}},e.prototype.createToolbar=function(){var e=this.getItems();this.toolbar=new o.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),height:this.parent.isAdaptive?48:"auto"}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.element);var i=this.element.querySelector("#"+this.parent.element.id+"_cancel"),r=this.element.querySelector("#"+this.parent.element.id+"_update");if(i&&t.addClass([i],"e-grid"),r&&t.addClass([r],"e-grid"),this.parent.isAdaptive){this.element.insertBefore(this.getSearchBarElement(),this.element.childNodes[0]),this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar");new d.TextBox({placeholder:this.parent.localeObj.getConstant("search"),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,i=t.createElement("div",{className:"e-adaptive-searchbar",styles:"display: none"}),r=t.createElement("input",{attrs:{type:"text"},id:this.parent.element.id+"_searchbar"}),n=t.createElement("span",{className:"e-backarrowspan e-icons"});return n.onclick=function(){i.style.display="none",e.element.childNodes[1].style.display="block"},i.appendChild(n),i.appendChild(r),i},e.prototype.wireEvent=function(){this.searchElement&&(t.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.searchElement,"focus",this.focusHandler,this),t.EventHandler.add(this.searchElement,"blur",this.blurHandler,this))},e.prototype.propertyChanged=function(e){t.getValue("module",e)===this.getModuleName()&&this.parent.toolbar&&(this.element&&this.element.parentNode&&t.remove(this.element),this.renderToolbar(),this.refreshToolbarItems())},e.prototype.unWireEvent=function(){this.searchElement&&(t.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),t.EventHandler.remove(this.searchElement,"focus",this.focusHandler),t.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 i=this.predefinedItems[e.text];return i?t.extend(i,i,e):e},e.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.id+"_"+e}},e.prototype.toolbarClickHandler=function(e){var i=this,r=this.parent,n=this.id;t.extend(e,{cancel:!1}),r.trigger("toolbarClick",e,function(e){if(!e.cancel)switch(!0===i.parent.isAdaptive&&(e.item.id!==n+"_edit"&&e.item.id!==n+"_add"&&e.item.id!==n+"_delete"&&e.item.id!==n+"_searchbutton"&&e.item.id!==n+"_expandall"&&e.item.id!==n+"_collapseall"||i.parent.selectionModule&&"Multiple"===i.parent.selectionSettings.type&&(i.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),!t.isNullOrUndefined(e.item)&&e.item.id){case n+"_edit":r.editModule&&r.editSettings.allowEditing&&r.editModule.dialogModule.openToolbarEditDialog();break;case n+"_indent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.indent();break;case n+"_critical-path":r.enableCriticalPath?r.enableCriticalPath=!1:r.enableCriticalPath=!0;break;case n+"_outdent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.outdent();break;case n+"_update":r.editModule.cellEditModule.isCellEdit=!1,r.treeGrid.grid.saveCell();break;case n+"_cancel":r.cancelEdit();break;case n+"_add":r.editModule&&r.editSettings.allowAdding&&r.editModule.dialogModule.openAddDialog();break;case n+"_delete":i.parent.selectionModule&&i.parent.editModule&&("Cell"!==i.parent.selectionSettings.mode&&i.parent.selectionModule.selectedRowIndexes.length||"Cell"===i.parent.selectionSettings.mode&&i.parent.selectionModule.getSelectedRowCellIndexes().length)&&i.parent.editModule.startDeleteAction();break;case n+"_search":if(t.getValue("originalEvent.target.id",e)===i.parent.element.id+"_searchbutton"&&i.parent.filterModule){var a=i.element.querySelector("#"+i.parent.element.id+"_searchbar").value;i.parent.searchSettings.key!==a&&(i.parent.searchSettings.key=a,i.parent.dataBind())}break;case n+"_searchbutton":var s=i.element.querySelector(".e-adaptive-searchbar");s.parentElement.childNodes[1].style.display="none",s.style.display="block";break;case n+"_expandall":i.parent.ganttChartModule.expandCollapseAll("expand");break;case n+"_collapseall":i.parent.ganttChartModule.expandCollapseAll("collapse");break;case n+"_prevtimespan":i.parent.previousTimeSpan();break;case n+"_nexttimespan":i.parent.nextTimeSpan();break;case n+"_zoomin":i.zoomIn();break;case n+"_zoomout":i.zoomOut();break;case n+"_zoomtofit":i.zoomToFit()}})},e.prototype.zoomIn=function(){this.parent.timelineModule.processZooming(!0)},e.prototype.zoomToFit=function(){this.parent.timelineModule.processZoomToFit(),this.parent.ganttChartModule.updateScrollLeft(0)},e.prototype.zoomOut=function(){this.parent.timelineModule.processZooming(!1)},e.prototype.refreshToolbarItems=function(e){var i,r=this.parent,n=[],a=[],s=r.editSettings,o=this.id,l=r.selectedRowIndex,d=!!r.selectionModule&&(1===r.selectionModule.selectedRowIndexes.length||1===r.selectionModule.getSelectedRowCellIndexes().length),p=this.toolbar?this.toolbar.items:[],h=[o+"_add",o+"_edit",o+"_delete",o+"_update",o+"_cancel",o+"_indent",o+"_outdent"],c="ResourceView"===this.parent.viewType&&0!==t.getValue("data.level",e)||"ProjectView"===this.parent.viewType;if(t.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 u=!!r.editModule.taskbarEditModule&&r.editModule.taskbarEditModule.touchEdit,g=r.flatData&&r.flatData.length;s.allowAdding&&!u?n.push(o+"_add"):a.push(o+"_add"),s.allowEditing&&c&&g&&d&&!u?n.push(o+"_edit"):a.push(o+"_edit"),s.allowEditing&&0!==l&&-1!==l&&g&&d&&"ResourceView"!==this.parent.viewType?0===r.updatedRecords[l].level&&g&&!u?(n.push(o+"_indent"),a.push(o+"_outdent")):(i=r.updatedRecords[l-1],r.updatedRecords[l].level-i.level==1&&-1!==l?(a.push(o+"_indent"),n.push(o+"_outdent")):-1!==l&&(n.push(o+"_indent"),n.push(o+"_outdent"))):(a.push(o+"_indent"),a.push(o+"_outdent"));var f=!!r.selectionModule&&(r.selectionModule.selectedRowIndexes.length>0||r.selectionModule.getSelectedRowCellIndexes().length>0);if(s.allowDeleting&&c&&g&&f&&!u?n.push(o+"_delete"):a.push(o+"_delete"),"Auto"===r.editSettings.mode&&!t.isNullOrUndefined(r.editModule.cellEditModule)&&r.editModule.cellEditModule.isCellEdit){(n=[]).push(o+"_update",o+"_cancel"),a=[];for(var m=0;m<p.length;m++)p[m].id!==o+"_update"&&p[m].id!==o+"_cancel"&&-1!==h.indexOf(p[m].id)&&a.push(p[m].id)}else{a.push(o+"_update",o+"_cancel");for(m=0;m<p.length;m++)-1===n.indexOf(p[m].id)&&-1===a.indexOf(p[m].id)&&n.push(p[m].id)}}for(var y=0;y<n.length;y++){var v=void 0;for(m=0;m<p.length;m++)if(p[m].id===n[y]){v=m;break}p.length>0&&this.toolbar.hideItem(v,!1)}for(var D=0;D<a.length;D++){for(v=void 0,m=0;m<p.length;m++)if(p[m].id===a[D]){v=m;break}p.length>0&&this.toolbar.hideItem(v,!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.destroy(),this.parent.filterModule&&this.unWireEvent(),t.remove(this.element))},e}(),Di=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=t.createElement("div",{className:"e-nonworking-day-container"}),this.nonworkingContainer.setAttribute("role","NonWorkingDays"),this.parent.ganttChartModule.chartBodyContent.appendChild(this.nonworkingContainer))},e.prototype.renderHolidays=function(){this.parent.holidays&&this.parent.holidays.length>0?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.holidayContainer)||(this.holidayContainer=t.createElement("div",{className:"e-holiday-container"}),this.nonworkingContainer.appendChild(this.holidayContainer)),this.holidayContainer.innerHTML=this.getHolidaysElement().innerHTML):this.holidayContainer&&this.holidayContainer.parentNode&&(t.remove(this.holidayContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&t.remove(this.nonworkingContainer))},e.prototype.getHolidaysElement=function(){var e,i,r=t.createElement("div"),n=this.parent.contentHeight,a=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(a=this.parent.toolbarModule.element.offsetHeight);for(var s=this.parent.ganttHeight-a-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,o=0;o<this.parent.holidays.length;o++){this.parent.holidays[o].from&&this.parent.holidays[o].to?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[o].from),(i=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[o].to)).setDate(i.getDate()+1),e.setHours(0,0,0,0),i.setHours(0,0,0,0)):this.parent.holidays[o].from?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[o].from)).setHours(0,0,0,0):this.parent.holidays[o].to&&(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[o].to)).setHours(0,0,0,0);var l=this.parent.holidays[o].from&&this.parent.holidays[o].to?this.parent.dataOperation.getTaskWidth(e,i):this.parent.perDayWidth,d=this.parent.dataOperation.getTaskLeft(e,!1),p=t.createElement("div",{className:"e-holiday",styles:"left:"+d+"px; width:"+l+"px; height:100%;"}),h=s<n?s/2:n/2,c=t.createElement("span",{className:"e-span",styles:"top:"+h+"px;left:"+l/2+"px;"});c[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=this.parent.holidays[o].label?this.parent.holidays[o].label:"",p.appendChild(c),this.parent.holidays[o].cssClass&&p.classList.add(this.parent.holidays[o].cssClass),r.appendChild(p)}return r},e.prototype.renderWeekends=function(){this.parent.highlightWeekends?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.weekendContainer)||(this.weekendContainer=t.createElement("div",{className:"e-weekend-container"}),this.nonworkingContainer.appendChild(this.weekendContainer)),this.weekendContainer.innerHTML=this.getWeekendElements().innerHTML):this.weekendContainer&&(t.remove(this.weekendContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&t.remove(this.nonworkingContainer))},e.prototype.getWeekendElements=function(){var e=t.createElement("div"),i=new Date(this.parent.timelineModule.timelineStartDate.getTime()),r=new Date(this.parent.timelineModule.timelineEndDate.getTime()),n=this.parent.nonWorkingDayIndex,a=!0;do{if(-1!==n.indexOf(i.getDay())){var s=this.parent.dataOperation.getTaskLeft(i,!1),o=this.parent.perDayWidth;if(a){var l=new Date(i.getTime()),d=new Date(l.getTime());d.setDate(d.getDate()+1),d.setHours(0,0,0,0),o=this.parent.dataOperation.getTaskWidth(l,d),a=!1}var p=new Date(i);p.setDate(p.getDate()+1),p.getTimezoneOffset()==this.parent.timelineModule.timelineStartDate.getTimezoneOffset()||this.weekendWidthUpdated||"Hour"==this.parent.timelineModule.bottomTier&&1===this.parent.timelineSettings.bottomTier.count&&(o-=this.parent.timelineSettings.timelineUnitSize,this.weekendWidthUpdated=!0);var h=t.createElement("div",{className:"e-weekend",styles:"left:"+s+"px;width:"+o+"px;height:100%;"});e.appendChild(h)}i.setDate(i.getDate()+1),i.setHours(0,0,0,0)}while(i<r);return e},e.prototype.updateHolidayLabelHeight=function(){var e=this.parent.getContentHeight(),i=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(i=this.parent.toolbarModule.element.offsetHeight);for(var r=this.parent.ganttHeight-i-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,n=r<e?r/2:e/2,a=this.holidayContainer.querySelectorAll(".e-span"),s=0;s<a.length;s++)a[s].style.top=t.formatUnit(n)},e.prototype.updateContainerHeight=function(){var e=this.parent.getContentHeight();this.holidayContainer&&(this.holidayContainer.style.height=t.formatUnit(e),this.updateHolidayLabelHeight()),this.weekendContainer&&(this.weekendContainer.style.height=t.formatUnit(e))},e.prototype.removeContainers=function(){this.holidayContainer&&t.remove(this.holidayContainer),this.weekendContainer&&t.remove(this.weekendContainer),this.nonworkingContainer&&t.remove(this.nonworkingContainer)},e}(),wi=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=t.createElement("div",{className:"e-event-markers-container"}),this.eventMarkersContainer.setAttribute("role","EventMarker"),this.parent.ganttChartModule.chartBodyContent.appendChild(this.eventMarkersContainer)),this.eventMarkersContainer.innerHTML="",this.getEventMarkersElements(this.eventMarkersContainer)):this.removeContainer()},e.prototype.removeContainer=function(){this.eventMarkersContainer&&(t.remove(this.eventMarkersContainer),this.eventMarkersContainer=null)},e.prototype.getEventMarkersElements=function(e){for(var i,r,n,a,s=0;s<this.parent.eventMarkers.length;s++){if(i=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(this.parent.eventMarkers[s].day,!0),!1),r=t.createElement("div",{className:"e-event-markers",styles:"left:"+i+"px; height:100%;",id:"stripline"+s}),this.parent.eventMarkers[s].label){(n=t.createElement("div",{className:"e-span-label"}))[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=this.parent.eventMarkers[s].label,r.appendChild(n),a=t.createElement("div",{className:"e-gantt-right-arrow"}),r.appendChild(a)}this.parent.eventMarkers[s].cssClass&&r.classList.add(this.parent.eventMarkers[s].cssClass),r.setAttribute("tabindex","-1"),t.isNullOrUndefined(this.parent.eventMarkers[s].day)||r.setAttribute("aria-label",this.parent.localeObj.getConstant("eventMarkers")+" "+("string"==typeof this.parent.eventMarkers[s].day?this.parent.eventMarkers[s].day:this.parent.getFormatedDate(this.parent.eventMarkers[s].day))+" "+this.parent.eventMarkers[s].label),e.appendChild(r)}},e.prototype.updateContainerHeight=function(){this.eventMarkersContainer&&(this.eventMarkersContainer.style.height=t.formatUnit(this.parent.getContentHeight()))},e}(),ki=function(){function e(e){this.parent=e,this.nonworkingDayRender=new Di(this.parent),this.eventMarkerRender=new wi(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 i=Object.keys(t.getValue("properties",e)),r=0;r<i.length;r++){switch(i[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.eventMarkerRender.renderEventMarkers(),this.nonworkingDayRender.renderWeekends(),this.nonworkingDayRender.renderHolidays()},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}(),Ti=function(){function e(e){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.enableMultiTaskbar){this.parent.enableCriticalPath=!0;var r=this.parent.treeGrid.parentData,n=r[0].ganttProperties.endDate,a=0,s=[],o=[],l=[],d=0,p=[],h=[],c=[],u=[],g=[],f=[];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(parseInt(i[y].ganttProperties.taskId,10)),i[y].ganttProperties.predecessor&&0!==i[y].ganttProperties.predecessor.length&&(o.push(i[y]),l.push(parseInt(i[y].ganttProperties.taskId,10)));if("ResourceView"===this.parent.viewType)for(m=0;m<this.parent.taskIds.length;m++)this.resourceCollectionIds[m]=this.parent.taskIds[m].slice(1);for(var v=0;v<s.length;v++)-1===l.indexOf(s[v])?(i[d="ProjectView"===this.parent.viewType?t.indexOf(s[v].toString()):this.resourceCollectionIds.indexOf(s[v].toString())].ganttProperties.progress<100&&(i[d].isCritical=!0,i[d].ganttProperties.isCritical=!0),i[d].slack="0 "+i[d].ganttProperties.durationUnit,p.push(s[v])):h.push(s[v]);for(var D=o.length,w=[],k=0;k<D;k++){for(var T=-1,S=-1,b=-1,P=-1,C=k,M=o[k].ganttProperties.predecessor,R=o[k].ganttProperties.predecessor.length,O=parseInt(o[k].ganttProperties.taskId,10),x=0;x<R;x++)parseInt(M[x].from,10)===O&&(-1===T?M[x].offset?(T=M[x].to+":"+M[x].offset+M[x].offsetUnit,b=M[x].type):(T=M[x].to,b=M[x].type):M[x].offset?(T=T+","+M[x].to+":"+M[x].offset+M[x].offsetUnit,b=b+","+M[x].type):(T=T+","+M[x].to,b=b+","+M[x].type)),parseInt(M[x].to,10)===O&&(-1===S?M[x].offset?(S=M[x].from+":"+M[x].offset+M[x].offsetUnit,P=M[x].type):(S=M[x].from,P=M[x].type):M[x].offset?(S=S+","+M[x].from+":"+M[x].offset+M[x].offsetUnit,P=P+","+M[x].type):(S=S+","+M[x].from,P=P+","+M[x].type));-1===S&&(S=null,P=null),-1===T&&(T=null,b=null),c.push({from:S,fromPredecessor:P,taskid:O,to:T,toPredecessor:b,currentIndex:C,slack:null,enddate:null}),u.push(O)}for(var I=c.length,E=void 0,F=0;F<I;F++)if(!c[F].to){E=c[F].taskid;var U=i["ProjectView"===this.parent.viewType?t.indexOf(E.toString()):this.resourceCollectionIds.indexOf(E.toString())].ganttProperties;a=this.parent.dataOperation.getDuration(U.endDate,n,"minute",U.isAutoSchedule,U.isMilestone),c[F].slack=a,c[F].fs=-1,c[F].enddate=U.endDate,w.push({fromdata:c[F].from,todateID:c[F].taskid,fromDataPredecessor:c[F].fromPredecessor})}for(v=0;v<w.length;v++)g.push(w[v]),this.slackCalculation(g,c,u,n,i,t);f=this.finalCriticalPath(c,p,i,t,n),this.criticalPathCollection=f,this.detailPredecessorCollection=c,this.predecessorCollectionTaskIds=u}if(!1===e&&this.parent.flatData.length>0&&!this.parent.enableMultiTaskbar){this.parent.enableCriticalPath=!1;for(F=0;F<this.criticalPathCollection.length;F++)i[t.indexOf(this.criticalPathCollection[F].toString())].isCritical=!1;this.criticalPathCollection=[],this.detailPredecessorCollection=[],this.predecessorCollectionTaskIds=[]}},e.prototype.slackCalculation=function(e,i,r,n,a,s){for(var o,l,d,p,h,c,u,g,f=e[0].fromdata.split(","),m=e[0].fromDataPredecessor.split(","),y=[],v=0;v<f.length;v++){y=f[v].split(":"),o=r.indexOf(parseInt(y[0],10)),p=r.indexOf(parseInt(e[0].todateID,10)),"ProjectView"===this.parent.viewType?(l=s.indexOf(y[0].toString()),d=s.indexOf(e[0].todateID.toString())):(l=this.resourceCollectionIds.indexOf(y[0].toString()),d=this.resourceCollectionIds.indexOf(e[0].todateID.toString()));var D=a[l].ganttProperties,w=a[d].ganttProperties;y.length>1&&(u=-1!==y[1].indexOf("hour")?60*parseFloat(y[1]):-1!==y[1].indexOf("day")?parseFloat(y[1])*(this.parent.secondsPerDay/3600)*60:parseFloat(y[1])),"FS"===m[v]&&(h=D.endDate>w.startDate?-this.parent.dataOperation.getDuration(w.startDate,D.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.parent.dataOperation.getDuration(D.endDate,w.startDate,"minute",D.isAutoSchedule,D.isMilestone),t.isNullOrUndefined(i[o].slack)?y.length<=1&&(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h):i[o].slack>h&&0!==i[o].slack&&y.length<=1&&(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h),y.length>1&&(i[o].slack=i[p].slack+h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0)),i[o].fs=1,i[o].fsslack=i[o].slack,i[o].enddate=D.startDate,D.endDate>=n&&D.endDate<=n&&(i[o].slack=0)),"SS"===m[v]&&(D.isAutoSchedule?(h=D.startDate>w.startDate?-this.parent.dataOperation.getDuration(w.endDate,D.startDate,"minute",D.isAutoSchedule,D.isMilestone):this.parent.dataOperation.getDuration(D.startDate,w.startDate,"minute",D.isAutoSchedule,D.isMilestone),t.isNullOrUndefined(i[o].slack)?y.length<=1&&(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h):i[o].slack>h&&0!==i[o].slack&&y.length<=1&&(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h),y.length>1&&(i[o].slack=i[p].slack+h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0)),i[o].fs=1,i[o].fsslack=i[o].slack,i[o].enddate=D.startDate):D.isAutoSchedule||(h=this.getSlackDuration(D.endDate,n,"minute",a[l]),t.isNullOrUndefined(i[o].slack)?i[o].slack=h:i[o].slack>h&&0!==i[o].slack&&(i[o].slack=h)),D.endDate>=n&&D.endDate<=n&&(i[o].slack=0)),"FF"===m[v]&&(1!==i[p].fs&&1!==i[p].ff&&-1!==i[p].fs||(1!==i[p].fs&&1!==i[p].ff||(c=w.endDate,g=i[p].slack),-1===i[p].fs&&(c=i[p].enddate,g=i[p].slack),h=c>D.endDate?-this.getSlackDuration(D.endDate,c,"minute",a[l]):this.getSlackDuration(c,D.endDate,"minute",a[l]),t.isNullOrUndefined(i[o].slack)?y.length<=1&&(i[o].slack=g-h<0?0:g-h):i[o].slack>h&&0!==i[o].slack&&y.length<=1&&(i[o].slack=g-h<0?0:g-h),y.length>1&&(i[o].slack=i[p].slack-h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0)),i[o].ff=1,i[o].enddate=c,i[o].fsslack=g),D.endDate>=n&&D.endDate<=n&&(i[o].slack=0)),"SF"===m[v]&&(D.isAutoSchedule?t.isNullOrUndefined(i[o].slack)?(y.length<=1?t.isNullOrUndefined(i[p].to)?(h=this.getSlackDuration(D.endDate,n,"minute",a[l]),i[o].slack=h):t.isNullOrUndefined(i[p].to)||(h=w.endDate>D.startDate?-this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(w.endDate,D.startDate,"minute",a[l]),i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h):y.length>1&&(h=w.endDate>=D.endDate?D.startDate>w.endDate?-this.getSlackDuration(w.endDate,D.startDate,"minute",a[l]):this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(D.endDate,n,"minute",a[l]),i[o].slack=i[p].slack+h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0)),i[o].fs=1,i[o].fsslack=i[o].slack,i[o].enddate=D.startDate):(y.length<=1?(t.isNullOrUndefined(i[p].to)?h=this.getSlackDuration(D.endDate,n,"minute",a[l]):t.isNullOrUndefined(i[p].to)||(h=w.endDate>D.startDate?-this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(w.endDate,D.startDate,"minute",a[l])),i[o].slack>h&&0!==i[o].slack&&(t.isNullOrUndefined(i[p].to)?i[o].slack=h:t.isNullOrUndefined(i[p].to)||(i[p].slack+h<0?i[o].slack=0:i[o].slack=i[p].slack+h))):y.length>1&&(h=w.endDate>D.endDate?D.startDate>w.endDate?-this.getSlackDuration(w.endDate,D.startDate,"minute",a[l]):this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(D.endDate,n,"minute",a[l]),i[o].slack>h&&0!==i[o].slack&&(i[o].slack=i[p].slack+h,i[o].slack=i[o].slack-u,i[o].slack<0&&(i[o].slack=0))),i[o].fs=1,i[o].fsslack=i[o].slack,i[o].enddate=D.startDate):D.isAutoSchedule||(h=this.getSlackDuration(D.endDate,n,"minute",a[l]),t.isNullOrUndefined(i[o].slack)?i[o].slack=h:i[o].slack>h&&0!==i[o].slack&&(i[o].slack=h)),D.endDate>=n&&D.endDate<=n&&(i[o].slack=0)),i[o].from&&e.push({fromdata:i[o].from,todateID:i[o].taskid,fromDataPredecessor:i[o].fromPredecessor})}e&&(e.splice(0,1),e.length>0&&this.slackCalculation(e,i,r,n,a,s))},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.finalCriticalPath=function(e,t,i,r,n){for(var a,s=[],o=e.length-1;o>=0;o--){for(var l=i[a="ProjectView"===this.parent.viewType?r.indexOf(e[o].taskid.toString()):this.resourceCollectionIds.indexOf(e[o].taskid.toString())].ganttProperties.predecessor,d="0 "+i[a].ganttProperties.durationUnit,p=0;p<l.length;p++){var h=void 0;h="ProjectView"===this.parent.viewType?this.parent.ids.indexOf(l[p].to):this.resourceCollectionIds.indexOf(l[p].to);var c=void 0,u=i[a].ganttProperties;"FS"===l[p].type?0===(c=this.parent.dataOperation.getDuration(u.endDate,i[h].ganttProperties.startDate,u.durationUnit,u.isAutoSchedule,u.isMilestone))&&a!==h&&i[a].slack!==d?(i[a].slack=i[h].slack,i[a].ganttProperties.slack=i[h].slack):0!==c&&a!==h&&i[h].isCritical&&(i[a].slack=c+" "+i[a].ganttProperties.durationUnit,i[a].ganttProperties.slack=c+" "+i[a].ganttProperties.durationUnit):c="SF"===l[p].type?this.parent.dataOperation.getDuration(u.startDate,i[h].ganttProperties.endDate,u.durationUnit,u.isAutoSchedule,u.isMilestone):"SS"===l[p].type?this.parent.dataOperation.getDuration(u.startDate,i[h].ganttProperties.startDate,u.durationUnit,u.isAutoSchedule,u.isMilestone):this.parent.dataOperation.getDuration(u.endDate,i[h].ganttProperties.endDate,u.durationUnit,u.isAutoSchedule,u.isMilestone),parseInt(l[p].from,10)===i[a][this.parent.taskFields.id]&&i[h].slack===d&&c<=0&&(i[a].slack=d,i[a].ganttProperties.slack=d)}i[a].slack===d&&i[a].ganttProperties.progress<100&&(i[a].isCritical=!0,i[a].ganttProperties.isCritical=!0,this.criticalTasks.push(i[a]),s.push(e[o].taskid))}if(t.length>0)for(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]),s=s.concat(t[p]));return s},e.prototype.criticalConnectorLine=function(e,i,r,n){var a=this.parent.ganttChartModule.chartElement;t.removeClass(a.querySelectorAll(".e-gantt-child-taskbar-inner-div"),N),t.removeClass(a.querySelectorAll(".e-gantt-child-progressbar-inner-div"),B),t.removeClass(a.querySelectorAll(".e-milestone-top"),H),t.removeClass(a.querySelectorAll(".e-milestone-bottom"),W);for(var s=0;s<e.length;s++){var o=void 0;o="ProjectView"===this.parent.viewType?this.parent.flatData[this.parent.ids.indexOf(e[s].toString())]:this.parent.flatData[this.resourceCollectionIds.indexOf(e[s].toString())];var l=this.parent.currentViewData.indexOf(o),d=this.parent.getRowByIndex(l),p=void 0,h=this.parent.taskFields;p=this.parent.allowUnscheduledTasks&&!o[h.startDate]&&!o[h.endDate]&&o[h.duration]?"e-gantt-critical-unscheduled-taskbar":B,d&&(d.getElementsByClassName("e-milestone-top")[0]&&t.addClass(d.querySelectorAll(".e-milestone-top"),H),d.getElementsByClassName("e-milestone-bottom")[0]&&t.addClass(d.querySelectorAll(".e-milestone-bottom"),W),d.getElementsByClassName("e-gantt-child-taskbar-inner-div").length>0&&t.addClass(d.querySelectorAll(".e-gantt-child-taskbar-inner-div"),N),d.getElementsByClassName("e-gantt-child-progressbar-inner-div").length>0&&t.addClass(d.querySelectorAll(".e-gantt-child-progressbar-inner-div"),p))}if(t.removeClass(this.parent.element.querySelectorAll(".e-line"),ke),t.removeClass(this.parent.element.querySelectorAll(".e-connector-line-right-arrow"),Te),t.removeClass(this.parent.element.querySelectorAll(".e-connector-line-left-arrow"),Se),0!==i.length){l=0;var c=void 0,u=[],g=void 0;for(s=0;s<this.criticalPathCollection.length;s++)if(l=n.indexOf(this.criticalPathCollection[s]),c=i[l],-1!==l&&c.to){u=c.to.split(",");for(var f=0;f<u.length;f++)if(g=parseInt(u[f],10),-1!==e.indexOf(g)){this.parent.element.querySelectorAll("#ConnectorLineparent"+c.taskid+"child"+g).length>0&&(t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+c.taskid+"child"+g)[0].querySelectorAll(".e-line"),ke),t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+c.taskid+"child"+g)[0].querySelectorAll(".e-connector-line-right-arrow"),Te),t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+c.taskid+"child"+g)[0].querySelectorAll(".e-connector-line-left-arrow"),Se))}}}},e.prototype.getModuleName=function(){return"criticalPath"},e.prototype.destroy=function(){!this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(this.parent.criticalPathModule=void 0)},e}(),Si=function(){function e(e){var i=this;this.segmentIndex=-1,this.headerContextMenuClick=function(e){var r=t.closest(e.event.target,".e-row"),n=t.closest(e.event.target,".e-chart-row");t.isNullOrUndefined(r)&&t.isNullOrUndefined(n)&&(e.type="Header",i.parent.trigger("contextMenuClick",e))},this.headerContextMenuOpen=function(e){var r=t.closest(e.event.target,".e-row"),n=t.closest(e.event.target,".e-chart-row");t.isNullOrUndefined(r)&&t.isNullOrUndefined(n)?(e.type="Header",i.parent.trigger("contextMenuOpen",e)):e.cancel=!0},this.parent=e,this.ganttID=e.element.id,a.TreeGrid.Inject(a.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(),t.remove(this.element)),this.resetItems(),this.render())},e.prototype.render=function(){this.element=this.parent.createElement("ul",{id:this.ganttID+"_contextmenu",className:"e-grid"}),this.parent.element.appendChild(this.element);var e="#"+this.ganttID;this.contextMenu=new o.ContextMenu({items:this.getMenuItems(),locale:this.parent.locale,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 i,r,n,a=t.getValue("parentObj",e.item),s=-1;switch(a&&!t.isNullOrUndefined(a.id)&&"DeleteDependency"===this.getKeyFromId(a.id)&&(s=a.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":this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID));break;case"Above":case"Below":case"Child":if(i=this.item,r=t.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),t.isNullOrUndefined(n.dependency)||(r[n.dependency]=null),!t.isNullOrUndefined(n.child)&&r[n.child]&&delete r[n.child],!t.isNullOrUndefined(n.parentID)&&r[n.parentID]&&(r[n.parentID]=null),this.rowData){var o=this.parent.updatedRecords.indexOf(this.rowData);this.parent.addRecord(r,i,o)}break;case"Milestone":case"ToMilestone":this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);break;case"DeleteTask":this.parent.editModule.deleteRecord(this.rowData);break;case"ToTask":if(r=t.extend({},{},this.rowData.taskData,!0),n=this.parent.taskFields,t.isNullOrUndefined(n.duration)){r[n.startDate]=new Date(this.rowData.taskData[n.startDate]);var l=new Date(this.rowData.taskData[n.startDate]);l.setDate(l.getDate()+1),r[n.endDate]=l}else{var d=this.rowData.ganttProperties;r[n.duration]="1 "+d.durationUnit}t.isNullOrUndefined(r[n.milestone])||!0===r[n.milestone]&&(r[n.milestone]=!1),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"+s:this.parent.connectorLineEditModule.removePredecessorByIndex(this.rowData,s);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 i=this;this.isEdit=!0;var r=this.parent.taskFields,n=this.getClickedDate(e.element);t.isNullOrUndefined(this.parent.timelineSettings.bottomTier)&&"Hour"!==this.parent.timelineSettings.bottomTier.unit&&n.setHours(0,0,0,0);var a={rowData:this.rowData,requestType:"splitTaskbar",splitDate:n,cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",a,function(e){i.parent.chartRowsModule.splitTask(i.rowData[r.id],n)})},e.prototype.mergeCall=function(e){var t=this;this.isEdit=!0;var i=this.parent.taskFields,r=this.rowData.ganttProperties.segments,n=[{firstSegmentIndex:"Right"===e?this.segmentIndex:r[this.segmentIndex-1].segmentIndex,secondSegmentIndex:"Left"===e?this.segmentIndex:r[this.segmentIndex+1].segmentIndex}],a={rowData:this.rowData,mergeSegmentIndexes:n,requestType:"mergeSegment",cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",a,function(e){!1===e.cancel&&t.parent.chartRowsModule.mergeTask(t.rowData[i.id],n)})},e.prototype.getClickedDate=function(e){var i=this.parent.getOffsetRect(this.parent.element).left+this.parent.ganttChartModule.chartElement.offsetLeft+this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft,r=this.clickedPosition-i,n=Math.ceil(r/this.parent.perDayWidth),a=this.rowData.ganttProperties.startDate;t.isNullOrUndefined(this.parent.timelineSettings.bottomTier)||"Hour"!==this.parent.timelineSettings.bottomTier.unit||(n=Math.ceil(r/this.parent.timelineSettings.timelineUnitSize),n-=1);return this.parent.dataOperation.getEndDate(a,n,this.rowData.ganttProperties.durationUnit,this.rowData,!1)},e.prototype.contextMenuBeforeOpen=function(e){var i=this,r=e.event?e.event.target:this.parent.focusModule?this.parent.ganttChartModule.targetElement:this.parent.focusModule.getActiveElement();!t.isNullOrUndefined(this.parent.editModule)&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&r.parentElement.classList.contains("e-row")&&this.parent.treeGrid.closeEdit(),t.isNullOrUndefined(e.element)||e.element.id!==this.parent.element.id+"_contextmenu"||(this.clickedPosition=t.getValue("event",e).clientX);var a=t.closest(r,".e-gantt-child-taskbar");a&&(this.targetElement=e.target=a),e.gridRow=t.closest(r,".e-row"),e.chartRow=t.closest(r,".e-chart-row");var s=t.closest(r,".e-gantt");if(!t.closest(r,".e-gridform")&&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),(t.isNullOrUndefined(e.gridRow)&&t.isNullOrUndefined(e.chartRow)||0===this.contentMenuItems.length)&&(t.isNullOrUndefined(e.parentItem)||t.isNullOrUndefined(s)?e.cancel=!0:e.cancel=!1),!e.cancel){var o=-1;e.gridRow?o=parseInt(e.gridRow.getAttribute("data-rowindex"),0):e.chartRow&&(o=parseInt(e.chartRow.getAttribute("aria-rowindex"),0)),this.parent.selectionModule&&this.parent.allowSelection&&!e.parentItem&&!t.isNullOrUndefined(e.chartRow)&&this.parent.selectionModule.selectRow(o),e.parentItem||(this.rowData=this.parent.updatedRecords[o]);for(var l=0,d=e.items;l<d.length;l++){var p=d[l];p.separator||(!r.classList.contains("e-gantt-unscheduled-taskbar")||p.text!==this.getLocale("splitTask")&&p.text!==this.getLocale("mergeTask")?this.updateItemStatus(p,r,o):this.hideItems.push(p.text))}if(e.rowData=this.rowData,e.type="Content",e.disableItems=this.disableItems,e.hideItems=this.hideItems,e.hideChildItems=[],0===e.rowData.level&&"ResourceView"===this.parent.viewType)return void(e.cancel=!0);var h=new n.Deferred;return this.parent.trigger("contextMenuOpen",e,function(t){h.resolve(t),i.hideItems=t.hideItems,i.disableItems=t.disableItems,t.parentItem||t.hideItems.length!==t.items.length||(i.revertItemStatus(),t.cancel=!0),i.hideItems.length>0&&i.contextMenu.hideItems(i.hideItems),i.disableItems.length>0&&i.contextMenu.enableItems(i.disableItems,!1),e.hideChildItems.length>0&&i.contextMenu.hideItems(e.hideChildItems)}),h}},e.prototype.updateItemStatus=function(e,i,r){var n=this.getKeyFromId(e.id),a=t.closest(i,".e-gridform"),s=[],o=t.closest(i,".e-gantt-child-taskbar");if(a)"Save"!==n&&"Cancel"!==n&&this.hideItems.push(e.text);else switch(n){case"TaskInformation":this.parent.editSettings.allowEditing&&this.parent.editModule||this.updateItemVisibility(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":this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowEditing&&this.parent.editModule?(this.rowData.ganttProperties.isMilestone?s.push(this.createItemModel(He,"ToTask",this.getLocale("toTask"))):s.push(this.createItemModel(He,"ToMilestone",this.getLocale("toMilestone"))),e.items=s):this.updateItemVisibility(e.text);break;case"DeleteDependency":var l=this.getPredecessorsItems();this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowDeleting&&0!==l.length&&this.parent.editModule?l.length>0&&(e.items=l):this.updateItemVisibility(e.text);break;case"DeleteTask":this.parent.editSettings.allowDeleting&&this.parent.editModule||this.updateItemVisibility(e.text);break;case"TaskMode":"Custom"!==this.parent.taskMode?this.updateItemVisibility(e.text):(this.rowData.ganttProperties.isAutoSchedule?s.push(this.createItemModel(He,"Manual",this.getLocale("manual"))):s.push(this.createItemModel(He,"Auto",this.getLocale("auto"))),e.items=s);break;case"Indent":if(this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings){var d=this.parent.selectedRowIndex,p=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),h=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1];this.parent.editSettings.allowEditing&&0!==d&&-1!==d&&p&&"ResourceView"!==this.parent.viewType&&this.parent.updatedRecords[d].level-h.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 c=this.parent.selectionModule.getSelectedRowIndexes()[0],u=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length);this.parent.editSettings.allowEditing&&-1!==c&&0!==c&&u&&"ResourceView"!==this.parent.viewType&&0!==this.parent.updatedRecords[c].level||this.updateItemVisibility(e.text)}else this.hideItems.push(e.text);break;case"SplitTask":var g=this.parent.taskFields;(this.parent.readOnly||!o||t.isNullOrUndefined(g.segments)||this.parent.currentViewData[r].hasChildRecords)&&this.updateItemVisibility(e.text);break;case"MergeTask":this.parent.readOnly||!o?this.updateItemVisibility(e.text):this.mergeItemVisiblity(i,e)}},e.prototype.mergeItemVisiblity=function(e,i){var r=[],n=this.parent.taskFields,a=this.getClickedDate(e);this.segmentIndex=this.parent.chartRowsModule.getSegmentIndex(a,this.rowData);var s=this.rowData.ganttProperties.segments;!t.isNullOrUndefined(s)&&s.length>0?t.isNullOrUndefined(n.segments)&&-1===this.segmentIndex?this.updateItemVisibility(i.text):(0===this.segmentIndex?r.push(this.createItemModel(He,"Right",this.getLocale("right"))):this.segmentIndex===s.length-1?r.push(this.createItemModel(He,"Left",this.getLocale("left"))):(r.push(this.createItemModel(He,"Right",this.getLocale("right"))),r.push(this.createItemModel(He,"Left",this.getLocale("left")))),i.items=r):this.hideItems.push(i.text)},e.prototype.updateItemVisibility=function(e){!!t.isNullOrUndefined(this.parent.contextMenuItems)?this.hideItems.push(e):this.disableItems.push(e)},e.prototype.contextMenuOpen=function(e){this.isOpen=!0;var i=e.element.querySelectorAll("li:not(.e-menu-hide):not(.e-disabled)")[0];t.addClass([i],"e-focused")},e.prototype.getMenuItems=function(){for(var e=0,i=t.isNullOrUndefined(this.parent.contextMenuItems)?this.getDefaultItems():this.parent.contextMenuItems;e<i.length;e++){var r=i[e];"string"==typeof r&&-1!==this.getDefaultItems().indexOf(r)?this.buildDefaultItems(r):"string"!=typeof r&&(-1!==this.getDefaultItems().indexOf(r.text)?this.buildDefaultItems(r.text,r.iconCss):".e-gridheader"===r.target?this.headerMenuItems.push(r):this.contentMenuItems.push(r))}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(He,e,this.getLocale("taskInformation"),this.getIconCSS("e-edit",t));break;case"Indent":i=this.createItemModel(He,e,this.getLocale("indent"),this.getIconCSS("e-indent",t));break;case"Outdent":i=this.createItemModel(He,e,this.getLocale("outdent"),this.getIconCSS("e-outdent",t));break;case"Save":i=this.createItemModel("e-edit",e,this.getLocale("save"),this.getIconCSS("e-save",t));break;case"Cancel":i=this.createItemModel("e-edit",e,this.getLocale("cancel"),this.getIconCSS("e-cancel",t));break;case"Add":(i=this.createItemModel(He,e,this.getLocale("add"),this.getIconCSS("e-add",t))).items=[],i.items.push(this.createItemModel(He,"Above",this.getLocale("above"),this.getIconCSS("e-add-above",t))),i.items.push(this.createItemModel(He,"Below",this.getLocale("below"),this.getIconCSS("e-add-below",t))),"ResourceView"!==this.parent.viewType&&i.items.push(this.createItemModel(He,"Child",this.getLocale("child"))),i.items.push(this.createItemModel(He,"Milestone",this.getLocale("milestone")));break;case"DeleteTask":i=this.createItemModel(He,e,this.getLocale("deleteTask"),this.getIconCSS("e-delete",t));break;case"DeleteDependency":(i=this.createItemModel(He,e,this.getLocale("deleteDependency"))).items=[],i.items.push({});break;case"Convert":(i=this.createItemModel(He,e,this.getLocale("convert"))).items=[],i.items.push({});break;case"TaskMode":(i=this.createItemModel(He,e,this.getLocale("changeScheduleMode"))).items=[],i.items.push({});break;case"SplitTask":i=this.createItemModel(He,e,this.getLocale("splitTask"));break;case"MergeTask":(i=this.createItemModel(He,e,this.getLocale("mergeTask"))).items=[],i.items.push({})}i&&this.contentMenuItems.push(i)},e.prototype.getIconCSS=function(e,i){return t.isNullOrUndefined(i)?e:i},e.prototype.getPredecessorsItems=function(){this.predecessors=this.parent.predecessorModule.getValidPredecessor(this.rowData);for(var e,t=[],i=0,r=0,n=this.predecessors;r<n.length;r++){var a=n[r],s=this.parent.getRecordByID(a.from).ganttProperties,o=s.rowUniqueID+" - "+s.taskName,l="Dependency"+i++;e=this.createItemModel(He,l,o),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(),t.remove(this.element),this.removeEventListener(),this.contextMenu=null,this.element=null},e}(),bi=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.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)},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)}},e}(),Pi=function(){function e(e){a.TreeGrid.Inject(a.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}(),Ci=function(){function e(e){this.isTest=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.isSharedTask=!1,this.canDrop=!0,this.parent=e,a.TreeGrid.Inject(a.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 i=document.createElement("div");t.classList(i,["e-errorcontainer"],[]),t.classList(i,["e-icons","e-errorelem"],[]);var r=e.querySelector(".errorValue"),n=e.querySelector(".e-rowcell").innerHTML;r&&(n=r.innerHTML,r.parentNode.removeChild(r)),e.querySelector(".e-rowcell").innerHTML="";var a=document.createElement("span");a.className="errorValue",a.style.paddingLeft="16px",a.innerHTML=n,e.querySelector(".e-rowcell").appendChild(i),e.querySelector(".e-rowcell").appendChild(a)}},e.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem");e&&e.remove()},e.prototype.rowDrag=function(e){var i=this.parent.element.querySelector(".e-cloneproperties");i.style.display="none";var r=i.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&&t.addClass(this.parent.element.querySelectorAll(".e-ganttdrag .e-rowcell"),["e-bothganttlines"]);var n=this.parent.element.querySelector(".e-ganttdrag"),a=this.parent.element.getClientRects()[0].top,s=this.parent.element.getClientRects()[0].left,o=t.getValue("event",e.originalEvent).clientX-s,l=t.getValue("event",e.originalEvent).clientY-a;n.style.left=o+20+"px",n.style.top=l+20+"px",this.parent.trigger("rowDrag",e)},e.prototype.rowDragStartHelper=function(e){this.parent.trigger("rowDragStartHelper",e),(this.parent.readOnly||this.parent.filterSettings.columns.length>0)&&(e.cancel=!0),"ResourceView"===this.parent.viewType&&0===t.getValue("level",e.data[0])&&(e.cancel=!0)},e.prototype.rowDrop=function(e){var i=document.querySelector(".e-ganttdrag");i&&i.remove();var r=t.closest(e.target,".e-row"),n=r?parseInt(r.getAttribute("data-rowindex"),10):e.dropIndex;e.dropIndex=n,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!==t.getValue("parentItem",e.data[0]).uniqueID||(e.cancel=!0)),"middleSegment"!==e.dropPosition&&(0!==e.dropRecord.level&&t.getValue("parentItem",e.data[0]).uniqueID!==e.dropRecord.parentItem.uniqueID||(e.cancel=!0))),e.cancel||(e.requestType="beforeDrop",this.parent.trigger("actionBegin",e),e.cancel||(this.dropRows(e,!0),e.cancel=!0))},e.prototype.dropRows=function(e,i){if(!this.parent.readOnly){if(this.dropPosition=e.dropPosition,"Invalid"!==e.dropPosition&&this.parent.editModule){var r=this.parent,n=void 0;this.droppedRecord=r.updatedRecords[e.dropIndex];var a=[],s=this.droppedRecord;e.data[0]?a=e.data:a.push(e.data);for(var o=0,l=a.length,d=function(e){if(p.parent.isOnEdit=!0,n=a[e],p.draggedRecord=n,"Invalid"!==p.dropPosition){if("ResourceView"===p.parent.viewType&&(p.checkisSharedTask(),p.previousParent=p.draggedRecord.parentItem.uniqueID),p.isSharedTask)return{value:void 0};i&&p.deleteDragRow();var l=p.treeGridData.indexOf(s);if("topSegment"===p.dropPosition&&p.dropAtTop(l),"bottomSegment"===p.dropPosition&&!p.isSharedTask){if(s.hasChildRecords){if(o=p.parent.editModule.getChildCount(s,0),p.parent.taskFields.parentID&&p.ganttData.length>0&&p.ganttData.splice(l+o+1,0,p.draggedRecord.taskData),p.treeGridData.splice(l+o+1,0,p.draggedRecord),p.parent.ids.splice(l+o+1,0,p.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===p.parent.viewType){var d=0===p.draggedRecord.level?"R"+p.draggedRecord.ganttProperties.taskId:"T"+p.draggedRecord.ganttProperties.taskId;p.parent.getTaskIds().splice(l+o+1,0,d)}}else if(p.parent.taskFields.parentID&&p.ganttData.length>0&&p.ganttData.splice(l+1,0,p.draggedRecord.taskData),p.treeGridData.splice(l+1,0,p.draggedRecord),p.parent.ids.splice(l+1,0,p.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===p.parent.viewType){var h=0===p.draggedRecord.level?"R"+p.draggedRecord.ganttProperties.taskId:"T"+p.draggedRecord.ganttProperties.taskId;p.parent.getTaskIds().splice(l+1,0,h)}if(p.parent.setRecordValue("parentItem",p.treeGridData[l].parentItem,n),p.parent.setRecordValue("parentUniqueID",p.treeGridData[l].parentUniqueID,n),p.parent.setRecordValue("level",p.treeGridData[l].level,n),n.hasChildRecords){p.updateChildRecordLevel(n,1),p.updateChildRecord(n,l+o+1)}if(s.parentItem){var c=p.parent.getParentTask(s.parentItem).childRecords,u=c.indexOf(s)+1;c.splice(u,0,n)}}"middleSegment"===p.dropPosition&&(p.dropMiddle(l),s.childRecords.length>0&&(delete s.ganttProperties.segments,delete s.taskData[p.parent.taskFields.segments])),t.isNullOrUndefined(n.parentItem&&-1!==p.updateParentRecords.indexOf(n.parentItem))||p.updateParentRecords.push(n.parentItem)}if(!p.parent.enableVirtualization){var g=r.flatData,f=void 0,m=void 0,y=p.parent.dataSource,v=p.parent.taskFields.id;if(n.index<s.index){f=n.index;for(var D=function(e){var t=p.parent.currentViewData.filter(function(t){return t[v]===y[e][v]})[0];if(t.index>s.index)return m=t.index,"break"},w=0;w<y.length;w++){if("break"===D(w))break}}else{f=s.index;for(var k=function(e){var t=p.parent.currentViewData.filter(function(t){return t[v]===y[e][v]})[0];if(t.index>n.index)return m=t.index,"break"},T=0;T<y.length;T++){if("break"===k(T))break}}for(var S=function(e){if(!t.isNullOrUndefined(g[e])&&(g[e].index=e,!t.isNullOrUndefined(g[e].parentItem))){var i=g.filter(function(t){return t.uniqueID===g[e].parentUniqueID})[0];g[e].parentItem.index=i.index}},b=f;b<=m;b++)S(b)}r.rowDragAndDropModule.refreshDataSource()},p=this,h=0;h<l;h++){var c=d(h);if("object"==typeof c)return c.value}if("middleSegment"===this.dropPosition&&(s.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(s),s.ganttProperties.predecessor=null,s.ganttProperties.predecessorsName=null,s[this.parent.taskFields.dependency]=null,s.taskData[this.parent.taskFields.dependency]=null),s.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,s.ganttProperties,!0),t.isNullOrUndefined(s.taskData[this.parent.taskFields.milestone])||!0===s.taskData[this.parent.taskFields.milestone]&&(s.taskData[this.parent.taskFields.milestone]=!1))),"ResourceView"===this.parent.viewType&&!this.isSharedTask){var u=void 0;u="middleSegment"===this.dropPosition?this.droppedRecord.uniqueID:this.droppedRecord.parentItem.uniqueID;var g=this.parent.getTaskByUniqueID(u),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;t.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()}for(var v=0;v<this.updateParentRecords.length;v++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[v]);this.updateParentRecords=[],this.parent.isOnEdit=!1}t.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]),t.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]),t.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 i=this.parent.getTaskByUniqueID(this.draggedRecord.parentItem.uniqueID);if(e.ganttProperties.resourceInfo&&e.ganttProperties.resourceInfo.length>1){var r=this._getExistingTaskWithID(e),n=void 0;if(null==r)return;for(var a=0;a<r.length;a++)for(var s=(n=r[a]).ganttProperties.resourceInfo,o=0;o<s.length;o++)if(s[o][this.parent.resourceFields.id]===i.ganttProperties.taskId){s.splice(o,1),this.parent.setRecordValue("resourceInfo",s,n.ganttProperties,!0),this.updateCurrentTask(n),t.isNullOrUndefined(n.parentItem&&-1!==this.updateParentRecords.indexOf(n.parentItem))||this.updateParentRecords.push(n.parentItem);break}}},e.prototype.refreshDataSource=function(){var e,i,r=this.draggedRecord,a=this.droppedRecord,s=this.parent,o=this.parent.taskFields;if((e=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):s.dataSource).length>0&&!t.isNullOrUndefined(a)&&!a.parentItem){for(var l=0;l<Object.keys(e).length;l++)t.isNullOrUndefined(a.taskData[o.child])||e[l][o.child]!==a.taskData[o.child]?t.isNullOrUndefined(a.taskData[o.child])&&a.taskData[o.id]===e[l][o.id]&&(i=l):i=l;"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(i,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(i+1,0,r.taskData))}else if(!this.parent.taskFields.parentID&&!t.isNullOrUndefined(a)&&a.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var d="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=a,this.parent.editModule.updateRealDataSource([r],d),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]=a[p],r.ganttProperties.parentId=a[p],("ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition||"ProjectView"===this.parent.viewType)&&(r.taskData[this.parent.taskFields.parentID]=a.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 i=this.parent,r=this.parent.editModule.getChildCount(this.droppedRecord,0),n=t.isNullOrUndefined(r)||0===r?e+1:r+e+1;if("middleSegment"===this.dropPosition&&!this.isSharedTask){if(i.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(n,0,this.draggedRecord.taskData),this.treeGridData.splice(n,0,this.draggedRecord),this.parent.ids.splice(n,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var a=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId;this.parent.getTaskIds().splice(n,0,a)}this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,n,this.droppedRecord.expanded),this.recordLevel(),t.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,i=this.draggedRecord,r=this.droppedRecord,n=e.taskFields.child;if(r.hasChildRecords||(r.hasChildRecords=!0,r.childRecords.length||(r.childRecords=[],!e.taskFields.parentID&&t.isNullOrUndefined(r.taskData[n])&&(r.taskData[n]=[]))),"middleSegment"===this.dropPosition){var a=t.extend({},r);delete a.childRecords;var s={uniqueID:a.uniqueID,expanded:a.expanded,level:a.level,index:a.index,taskId:a.ganttProperties.rowUniqueID};if(this.parent.setRecordValue("parentItem",s,i),this.parent.setRecordValue("parentUniqueID",r.uniqueID,i),r.childRecords.splice(r.childRecords.length,0,i),t.isNullOrUndefined(i)||e.taskFields.parentID||t.isNullOrUndefined(r.taskData[n])||r.taskData[e.taskFields.child].splice(r.childRecords.length,0,i.taskData),i.hasChildRecords){i.level=r.level+1,this.parent.setRecordValue("level",this.draggedRecord.level,this.draggedRecord),this.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.treeGridData=m(this.parent)?t.getValue("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource,this.parent.dataSource instanceof n.DataManager?this.ganttData=t.getValue("dataOperation.dataArray",this.parent):this.ganttData=m(this.parent)?t.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).childRecords,r=0;r<i.length;r++)"T"+this.draggedRecord.ganttProperties.taskId=="T"+i[r].ganttProperties.taskId&&(this.isSharedTask=!0,e=i[r]);this.isSharedTask&&this.removeResourceInfo(e)},e.prototype.dropAtTop=function(e){var i=this.parent;if(!this.isSharedTask){if(i.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 n=this.parent.getParentTask(this.droppedRecord.parentItem).childRecords,a=n.indexOf(this.droppedRecord);n.splice(a,0,this.draggedRecord)}t.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 i,r=this.parent;i=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource;var a=e,s=this.parent.getParentTask(a.parentItem);if(a){if(a.parentItem){var o=s?s.childRecords:[],l=0;o&&o.length>0&&("ResourceView"===this.parent.viewType&&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.parent.taskFields.parentID&&s.taskData[this.parent.taskFields.child]&&s.taskData[this.parent.taskFields.child].splice(l,1),this.updateParentRecords.push(s))}if(!this.parent.taskFields.parentID){var d=[];d.push(a.ganttProperties.taskId.toString()),("ProjectView"===this.parent.viewType||"ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition)&&this.parent.editModule.removeFromDataSource(d)}if(r.taskFields.parentID){a.hasChildRecords&&a.childRecords.length>0&&this.removeChildItem(a);for(var p=void 0,h=i.length>0&&"ResourceView"!==this.parent.viewType?i:this.parent.updatedRecords,c=0;c<h.length;c++)"ResourceView"===this.parent.viewType?h[c].ganttProperties.rowUniqueID===a.ganttProperties.rowUniqueID&&(p=c):h[c][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(p=c);if(-1!==p){i.length>0&&i.splice(p,1);var u=this.treeGridData.indexOf(a);this.treeGridData.splice(u,1),this.parent.ids.splice(u,1),-1!==this.parent.treeGrid.parentData.indexOf(a)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(a),1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(p,1)}}var g=this.treeGridData.indexOf(a);if(!r.taskFields.parentID){var f=this.parent.editModule.getChildCount(a,0);this.treeGridData.splice(g,f+1),this.parent.ids.splice(g,f+1);var m=this.ganttData.indexOf(a.taskData);-1!==m&&(this.ganttData.splice(m,1),this.parent.treeGrid.parentData.splice(m,1)),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(g,f+1)}a.parentItem&&s&&s.childRecords&&!s.childRecords.length&&(s.expanded=!1,s.hasChildRecords=!1)}},e.prototype.removeChildItem=function(e){for(var i,r,a=0;a<e.childRecords.length;a++){i=e.childRecords[a];var s=void 0;s=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource;for(var o=0;o<s.length;o++)s[o][this.parent.taskFields.id]===i.taskData[this.parent.taskFields.id]&&(r=o);if(-1!==r){s.length>0&&s.splice(r,1);var l=this.treeGridData.indexOf(i);this.treeGridData.splice(l,1),this.parent.ids.splice(l,1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(r,1)}i.hasChildRecords&&this.removeChildItem(i)}},e.prototype.reorderRows=function(e,t,i){if(!this.parent.readOnly){e[0],"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}(),Mi=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 u.PdfColor(0,0,0),e.columnHeader.fontColor.gray=.2,e.columnHeader.backgroundColor=new u.PdfColor(255,255,255),e.columnHeader.borderColor=new u.PdfColor(234,234,234),e.columnHeader.format.lineAlignment=1,e.columnHeader.format.alignment=0,e.fontFamily=u.PdfFontFamily.Helvetica,e.cell.fontSize=9.5,e.cell.backgroundColor=new u.PdfColor(255,255,255),e.cell.borderColor=new u.PdfColor(234,234,234),e.cell.fontColor=new u.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 u.PdfColor(252,252,252),e.timeline.fontColor=new u.PdfColor(40,40,39),e.chartGridLineColor=new u.PdfColor(206,206,206),e.timeline.borderColor=new u.PdfColor(206,206,206),t){case"Bootstrap":e.taskbar.taskColor=new u.PdfColor(49,122,185),e.taskbar.progressColor=new u.PdfColor(33,82,125),e.taskbar.criticalTaskColor=new u.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new u.PdfColor(255,85,85),e.criticalConnectorLineColor=new u.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new u.PdfColor(255,85,85),e.taskbar.parentTaskColor=new u.PdfColor(119,119,119),e.taskbar.parentProgressColor=new u.PdfColor(85,85,85),e.taskbar.taskBorderColor=new u.PdfColor(33,82,125),e.taskbar.parentTaskBorderColor=new u.PdfColor(85,85,85),e.taskbar.milestoneColor=new u.PdfColor(85,85,85),e.footer.fontColor=new u.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new u.PdfColor(33,82,125),e.footer.backgroundColor=new u.PdfColor(255,255,255),e.taskbar.progressFontColor=new u.PdfColor(255,255,255),e.label.fontColor=new u.PdfColor(0,0,0);break;case"Bootstrap 4":e.taskbar.taskColor=new u.PdfColor(0,123,255),e.taskbar.progressColor=new u.PdfColor(0,86,179),e.taskbar.criticalTaskColor=new u.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new u.PdfColor(255,85,85),e.criticalConnectorLineColor=new u.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new u.PdfColor(255,85,85),e.taskbar.parentTaskColor=new u.PdfColor(108,117,125),e.taskbar.parentProgressColor=new u.PdfColor(73,80,87),e.taskbar.taskBorderColor=new u.PdfColor(0,86,179),e.taskbar.parentTaskBorderColor=new u.PdfColor(73,80,87),e.taskbar.milestoneColor=new u.PdfColor(73,80,87),e.footer.fontColor=new u.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new u.PdfColor(0,86,179),e.footer.backgroundColor=new u.PdfColor(255,255,255),e.taskbar.progressFontColor=new u.PdfColor(255,255,255),e.label.fontColor=new u.PdfColor(33,37,41);break;case"Fabric":e.columnHeader.fontColor=new u.PdfColor(102,102,102),e.cell.fontColor=new u.PdfColor(51,51,51),e.taskbar.taskColor=new u.PdfColor(0,120,214),e.taskbar.progressColor=new u.PdfColor(0,91,163),e.taskbar.criticalTaskColor=new u.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new u.PdfColor(255,85,85),e.criticalConnectorLineColor=new u.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new u.PdfColor(255,85,85),e.taskbar.parentTaskColor=new u.PdfColor(118,118,118),e.taskbar.parentProgressColor=new u.PdfColor(80,80,80),e.taskbar.taskBorderColor=new u.PdfColor(0,91,163),e.taskbar.parentTaskBorderColor=new u.PdfColor(80,80,80),e.taskbar.milestoneColor=new u.PdfColor(80,80,80),e.footer.fontColor=new u.PdfColor(51,51,51),e.footer.fontColor.gray=.2,e.connectorLineColor=new u.PdfColor(0,69,122),e.footer.backgroundColor=new u.PdfColor(255,255,255),e.taskbar.progressFontColor=new u.PdfColor(255,255,255),e.label.fontColor=new u.PdfColor(51,51,51);break;default:e.taskbar.taskColor=new u.PdfColor(88,105,197),e.taskbar.progressColor=new u.PdfColor(63,81,181),e.taskbar.criticalTaskColor=new u.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new u.PdfColor(255,85,85),e.criticalConnectorLineColor=new u.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new u.PdfColor(255,85,85),e.taskbar.parentTaskColor=new u.PdfColor(132,132,132),e.taskbar.parentProgressColor=new u.PdfColor(97,97,97),e.taskbar.taskBorderColor=new u.PdfColor(63,81,181),e.taskbar.parentTaskBorderColor=new u.PdfColor(51,51,51),e.taskbar.milestoneColor=new u.PdfColor(97,97,97),e.footer.fontColor=new u.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new u.PdfColor(63,81,181),e.footer.backgroundColor=new u.PdfColor(255,255,255),e.taskbar.progressFontColor=new u.PdfColor(255,255,255),e.label.fontColor=new u.PdfColor(51,51,51)}},e.prototype.initStyles=function(e){e.columnHeader={},e.columnHeader.format=new u.PdfStringFormat,e.cell={},e.cell.format=new u.PdfStringFormat,e.timeline={},e.footer={},e.footer.format=new u.PdfStringFormat,e.label={},e.taskbar={}},e}(),Ri=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}(),Oi=function(){function e(){var e=new u.PdfPen(new u.PdfColor(0,0,0));e.dashStyle=u.PdfDashStyle.Solid;var t=new u.PdfPen(new u.PdfColor(0,0,0));t.dashStyle=u.PdfDashStyle.Solid;var i=new u.PdfPen(new u.PdfColor(0,0,0));i.dashStyle=u.PdfDashStyle.Solid;var r=new u.PdfPen(new u.PdfColor(0,0,0));r.dashStyle=u.PdfDashStyle.Solid,this.leftPen=e,this.rightPen=t,this.topPen=i,this.bottomPen=r}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}(),xi=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}(),Ii=function(){return function(){this.cellSpacing=0,this.borderOverlapStyle=u.PdfBorderOverlapStyle.Overlap,this.allowHorizontalOverflow=!1,this.horizontalOverflowType=e.PdfHorizontalOverflowType.LastPage,this.cellPadding=new xi}}(),Ei=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)}}(),Fi=function(i){function r(e){var t=i.call(this,e)||this;return t.columnRanges=[],t.repeatRowIndex=-1,t.currentBounds=new u.RectangleF(0,0,0,0),t}return Ei(r,i),Object.defineProperty(r.prototype,"treegrid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),r.prototype.layoutInternal=function(e){if(t.isNullOrUndefined(e))throw Error("Argument Null Expection");this.currentPage=e.page;var i=e.format;if(null!==this.currentPage&&(this.currentPageBounds=this.currentPage.getClientSize()),this.currentGraphics=this.currentPage.graphics,null!==i&&i.break===u.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new u.RectangleF(new u.PointF(e.bounds.x,e.bounds.y),new u.SizeF(this.treegrid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new u.RectangleF(new u.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 u.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)},r.prototype.determineColumnDrawRanges=function(){for(var e=0,t=0,i=0,r=this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.treegrid.columns.count;n++)if((i+=this.treegrid.columns.getColumn(n).width)>=r){for(var a=0,s=e;s<=n&&!((a+=this.treegrid.columns.getColumn(s).width)>r);s++)t=s;this.columnRanges.push([e,t]),e=t+1,i=t<=n?this.treegrid.columns.getColumn(n).width:0}this.columnRanges.push([e,this.treegrid.columns.count-1])},r.prototype.getFormat=function(e){return e},r.prototype.layoutOnPage=function(t){for(var i=this.getFormat(t.format),r=null,n=new Ri,a=t.page,s=0;s<this.columnRanges.length;s++){var o=this.columnRanges[s];this.cellStartIndex=o[0],this.cellEndIndex=o[1];for(var l=this.treegrid.rows.count,d=0,p=!1,h=0;h<l;h++){var c=this.treegrid.rows.getRow(h);d++;var g=this.currentBounds.y;null===this.currentPage||n.containsKey(this.currentPage)||n.add(this.currentPage,o);var f=this.drawRow(c);for(g===this.currentBounds.y?(p=!0,this.repeatRowIndex=this.treegrid.rows.rowCollection.indexOf(c)):(p=!1,this.repeatRowIndex=-1);!f.isFinish&&null!==a;)if(this.treegrid.allowRowBreakAcrossPages)this.currentPage=this.getNextPageFormat(i),this.treegrid.enableHeader&&this.drawHeader(),this.checkBounds(i),f=this.drawRow(c);else{if(!this.treegrid.allowRowBreakAcrossPages&&d<length){this.currentPage=this.getNextPageFormat(i),this.treegrid.enableHeader&&this.drawHeader();break}if(d>=length)break}!f.isFinish&&null!==a&&i.layout!==u.PdfLayoutType.OnePage&&p&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageFormat(i),this.treegrid.enableHeader&&this.drawHeader(),this.startLocation.y=this.currentBounds.y,i.paginateBounds===new u.RectangleF(0,0,0,0)&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===Oi.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.drawRow(c),null===this.currentPage||n.containsKey(this.currentPage)||n.add(this.currentPage,o))}this.columnRanges.indexOf(o)<this.columnRanges.length-1&&null!==a&&i.layout!==u.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageFormat(i),this.checkBounds(i))}return r=this.getLayoutResult(),this.treegrid.style.allowHorizontalOverflow&&this.treegrid.style.horizontalOverflowType===e.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(n),r},r.prototype.checkBounds=function(e){var t=new u.PointF(Oi.default.right.width/2,Oi.default.top.width/2);e.paginateBounds===new u.RectangleF(0,0,0,0)&&this.startLocation===t&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)},r.prototype.drawHeader=function(){this.drawRow(this.treegrid.rows.getRow(0))},r.prototype.reArrangePages=function(e){for(var t=this.currentPage.document,i=[],r=e.keys(),n=0;n<r.length;n++){(o=r[n]).section=null,i.push(o),t.pages.remove(o)}for(n=0;n<e.size();n++)for(var a=e.size()/this.columnRanges.length,s=n;s<e.size();s+=a){var o=i[s];-1===t.pages.indexOf(o)&&t.pages.add(o)}},r.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 u.RectangleF(new u.PointF(0,0),i.getClientSize()),i},r.prototype.getLayoutResult=function(){var e=new u.RectangleF(this.startLocation,new u.SizeF(this.currentBounds.width,this.currentBounds.y-this.startLocation.y));return new Ui(this.currentPage,e)},r.prototype.checkIfDefaultFormat=function(e){var t=new u.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},r.prototype.drawRow=function(e,i,r){if(t.isNullOrUndefined(i)){var n=new u.RowLayoutResult;return(r=e.rowBreakHeight>0?e.rowBreakHeight:e.height)>this.currentPageBounds.height?this.treegrid.allowRowBreakAcrossPages?(n.isFinish=!0,this.drawRowWithBreak(n,e,r)):(n.isFinish=!1,this.drawRow(e,n,r)):this.currentBounds.y+r>this.currentPageBounds.height||this.currentBounds.y+r>this.currentBounds.height?this.repeatRowIndex>-1&&this.repeatRowIndex===e.rowIndex?this.treegrid.allowRowBreakAcrossPages?(n.isFinish=!0,this.drawRowWithBreak(n,e,r)):(n.isFinish=!1,this.drawRow(e,n,r)):n.isFinish=!1:(n.isFinish=!0,this.drawRow(e,n,r)),n}var a=new u.PointF(this.currentBounds.x,this.currentBounds.y);i.bounds=new u.RectangleF(a,new u.SizeF(0,0));var s=0;r=this.reCalculateHeight(e,r);for(var o=this.cellStartIndex;o<=this.cellEndIndex;o++){var l=e.cells.getCell(o),d=this.treegrid.columns.getColumn(o);d.isTreeColumn&&(s=10*e.level);var p=o>this.cellEndIndex+1&&l.columnSpan>1;if(!p)for(var h=1;h<l.columnSpan;h++)e.cells.getCell(o+h).isCellMergeContinue=!0;var c=new u.SizeF(d.width,r);!this.checkIfDefaultFormat(d.format)&&this.checkIfDefaultFormat(l.style.format)&&(l.style.format=d.format),l.draw(this.currentGraphics,new u.RectangleF(a,c),p,s),e.treegrid.style.allowHorizontalOverflow&&(l.columnSpan>this.cellEndIndex||o+l.columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),a.x+=d.width,s=0}return this.currentBounds.y+=r,i.bounds=new u.RectangleF(new u.PointF(i.bounds.x,i.bounds.y),new u.SizeF(a.x,a.y)),null},r.prototype.drawRowWithBreak=function(e,t,i){var r=new u.PointF(this.currentBounds.x,this.currentBounds.y);e.bounds=new u.RectangleF(r,new u.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++){(l=t.cells.getCell(a)).measureHeight()===i&&null===l.value&&(t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height)}for(var s=this.cellStartIndex;s<=this.cellEndIndex;s++){var o=this.treegrid.columns.getColumn(s);o.isTreeColumn&&(n=10*t.level);var l,d=(l=t.cells.getCell(s)).columnSpan+s>this.cellEndIndex+1&&l.columnSpan>1;if(!d)for(var p=1;p<l.columnSpan;p++)t.cells.getCell(s+p).isCellMergeContinue=!0;var h=this.treegridHeight>0?this.treegridHeight:this.currentBounds.height,c=new u.SizeF(o.width,h);!this.checkIfDefaultFormat(o.format)&&this.checkIfDefaultFormat(l.style.format)&&(l.style.format=o.format),l.draw(this.currentGraphics,new u.RectangleF(r,c),d,n),e.isFinish=e.isFinish?l.finishedDrawingCell:e.isFinish,r.x+=o.width,n=0,this.currentBounds.y+=this.treegridHeight>0?this.treegridHeight:i,e.bounds=new u.RectangleF(new u.PointF(e.bounds.x,e.bounds.y),new u.SizeF(r.x,r.y))}},r.prototype.reCalculateHeight=function(e,i){for(var r=0,n=this.cellStartIndex;n<=this.cellEndIndex;n++)t.isNullOrUndefined(e.cells.getCell(n).remainingString)&&""!==e.cells.getCell(n).remainingString||(r=Math.max(r,e.cells.getCell(n).measureHeight()));return Math.max(i,r)},r}(u.ElementLayouter),Ui=function(e){function t(t,i){return e.call(this,t,i)||this}return Ei(t,e),t}(u.PdfLayoutResult),Vi=function(e){function t(t){return void 0===t?e.call(this)||this:e.call(this,t)||this}return Ei(t,e),t}(u.PdfLayoutFormat),Li=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)}}(),Ni=function(e){function t(){var t=e.call(this)||this;return t.treeGridSize=new u.SizeF(0,0),t.treeColumnIndex=0,t.allowRowBreakAcrossPages=!0,t.enableHeader=!0,t.isFitToWidth=!1,t.columns=new qi(t),t.rows=new Wi(t),t.headers=new ji(t),t.style=new Ii,t.rowHeight=0,t}return Li(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 u.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 u.RectangleF&&void 0!==t.width&&void 0===i)return this.drawHelper(e,t,null);if(t instanceof u.PointF&&void 0===t.width&&i instanceof u.PdfLayoutFormat)return this.drawHelper(e,t.x,t.y,i);if("number"==typeof t&&"number"==typeof i&&(r instanceof u.PdfLayoutFormat||null==r)){var n=e.graphics.clientSize.width-t,a=new u.RectangleF(t,i,n,0);return this.drawHelper(e,a,r)}return t instanceof u.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{t=[];var r=0,n=0,a=this.columns.count;for(i=0;i<a;i++){for(var s=this.rows.count,o=0;o<s;o++){var l=this.rows.getRow(o).cells.getCell(i).width,d=this.initialWidth>0?Math.min(this.initialWidth,l):l;r=Math.max(r,d),r=Math.max(this.columns.getColumn(i).width,r),this.columns.getColumn(i).isTreeColumn&&(n=Math.max(n,this.rows.getRow(o).level))}this.columns.getColumn(i).isTreeColumn?t.push(r+10*n):t.push(r),r=0}for(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++){e+=this.headers.getHeader(i).height}for(i=0;i<this.rows.count;i++){e+=this.rows.getRow(i).height}return new u.SizeF(t,e)},t.prototype.drawGrid=function(e,t,i,r){this.initialWidth=e.graphics.clientSize.width;var n=new u.RectangleF(0,0,e.getClientSize().height,0);return this.draw(e,n,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,r=t.borders.top.width/2;if(e.bounds.x===Oi.default.right.width/2&&e.bounds.y===Oi.default.right.width/2){var n=new u.RectangleF(new u.PointF(i,r),new u.SizeF(this.size.width,this.size.height));e.bounds=n}}}this.setSpan(),this.layouter=new Fi(this);return 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++){n=0;for(var o=(p=this.headers.getHeader(s)).cells.count,l=0;l<o;l++){var d=p.cells.getCell(l);if(n=Math.max(n,d.rowSpan),!d.isCellMergeContinue&&!d.isRowMergeContinue&&(d.columnSpan>1||d.rowSpan>1)){if(d.columnSpan+l>p.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(d.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+s.toString());if(d.columnSpan>1&&d.rowSpan>1){for(e=d.columnSpan,t=d.rowSpan,i=l,r=s,d.isCellMergeStart=!0,d.isRowMergeStart=!0;e>1;)i++,p.cells.getCell(i).isCellMergeContinue=!0,p.cells.getCell(i).isRowMergeContinue=!0,p.cells.getCell(i).rowSpan=t,e--;for(i=l,e=d.columnSpan;t>1;){for(r++,this.headers.getHeader(r).cells.getCell(l).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=d.columnSpan,i=l}}else if(d.columnSpan>1&&1===d.rowSpan)for(e=d.columnSpan,i=l,d.isCellMergeStart=!0;e>1;)i++,p.cells.getCell(i).isCellMergeContinue=!0,e--;else if(1===d.columnSpan&&d.rowSpan>1)for(t=d.rowSpan,r=s;t>1;)r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,t--}}p.maximumRowSpan=n}e=t=1,i=r=0,a=this.rows.count;for(s=0;s<a;s++){var p,h=(p=this.rows.getRow(s)).cells.count;for(l=0;l<h;l++){if(!(d=p.cells.getCell(l)).isCellMergeContinue&&!d.isRowMergeContinue&&(d.columnSpan>1||d.rowSpan>1)){if(d.columnSpan+l>p.cells.count)throw new Error("Invalid span specified at row {0} column {1} "+l.toString());if(d.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row {0} column {1} "+l.toString());if(d.columnSpan>1&&d.rowSpan>1){for(e=d.columnSpan,t=d.rowSpan,i=l,r=s,d.isCellMergeStart=!0,d.isRowMergeStart=!0;e>1;)i++,p.cells.getCell(i).isCellMergeContinue=!0,e--;for(i=l,e=d.columnSpan;t>1;){for(r++,this.rows.getRow(r).cells.getCell(l).isRowMergeContinue=!0,t--;e>1;)i++,this.rows.getRow(r).cells.getCell(i).isCellMergeContinue=!0,e--;e=d.columnSpan,i=l}}else if(d.columnSpan>1&&1===d.rowSpan)for(e=d.columnSpan,i=l,d.isCellMergeStart=!0;e>1;)i++,p.cells.getCell(i).isCellMergeContinue=!0,e--;else if(1===d.columnSpan&&d.rowSpan>1)for(t=d.rowSpan,r=s;t>1;)r++,this.rows.getRow(r).cells.getCell(l).isRowMergeContinue=!0,t--}}}},t}(u.PdfLayoutElement),Bi=function(){function e(e){this.cellWidth=0,this.cellHeight=0,this.finishedDrawingCell=!0,t.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 u.PdfStringLayouter;if("string"==typeof this.value){var i=new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);e+=t.layout(this.value,i,this.style.format,new u.SizeF(Number.MAX_VALUE,Number.MAX_VALUE),!1,new u.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,i=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 n=new u.PdfStringLayouter;if("string"==typeof this.value||"string"==typeof this.remainingString){var a=this.value;this.finishedDrawingCell||(a=t.isNullOrUndefined(this.remainingString)||""===this.remainingString?this.value:this.remainingString);var s=new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);i+=n.layout(a,s,this.style.format,new u.SizeF(r,0),!1,new u.SizeF(0,0)).actualSize.height,i+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}return i+=this.row.treegrid.style.cellPadding.top+this.row.treegrid.style.cellPadding.bottom,(i+=this.row.treegrid.style.cellSpacing)>e?i: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 a=this.row.cells.indexOf(this),s=a+1;s<=a+this.columnSpan;s++)this.row.cells.getCell(s).isCellMergeContinue=!1,this.row.cells.getCell(s).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 o=new u.PdfSolidBrush(this.style.fontColor),l=null;l=this.row.isParentRow?new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,u.PdfFontStyle.Bold):new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);var d=t;if(this.isHeaderCell||(d.x=d.x,d.width=d.width),d.height>=e.clientSize.height&&(this.row.treegrid.allowRowBreakAcrossPages?(d.height-=d.y,t.height-=t.y):(d.height=e.clientSize.height,t.height=e.clientSize.height)),d=this.adjustContentLayoutArea(d),"string"==typeof this.value||"string"==typeof this.remainingString){var p=null;this.finishedDrawingCell?(p=""===this.remainingString?this.remainingString:this.value,e.drawString(p,l,null,o,d.x+r,d.y,d.width-r-10,d.height-10,this.style.format)):e.drawString(this.remainingString,l,null,o,d.x+r,d.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 u.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 u.RectangleF(new u.PointF(e.x,e.y),new u.SizeF(e.width,e.height)),i=this.style.padding;if(this.value instanceof Ni){var r=this.value.size;this.style.format.alignment===u.PdfTextAlignment.Center?(t.x+=i.left+(t.width-r.width)/2,t.y+=i.top+(t.height-r.height)/2):this.style.format.alignment===u.PdfTextAlignment.Left?(t.x+=i.left,t.y+=i.top):this.style.format.alignment===u.PdfTextAlignment.Right&&(t.x+=i.left+(t.width-r.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===u.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 u.PointF(t.x,t.y+t.height),r=new u.PointF(t.x,t.y),n=this.style.borders.left;this.style.borders.left.dashStyle===u.PdfDashStyle.Solid&&(n.lineCap=u.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new u.PointF(t.x+t.width,t.y),r=new u.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 u.PointF(e.clientSize.width-n.width/2,t.y),r=new u.PointF(e.clientSize.width-n.width/2,t.y+t.height)),this.style.borders.right.dashStyle===u.PdfDashStyle.Solid&&(n.lineCap=u.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new u.PointF(t.x,t.y),r=new u.PointF(t.x+t.width,t.y),n=this.style.borders.top,this.style.borders.top.dashStyle===u.PdfDashStyle.Solid&&(n.lineCap=u.PdfLineCap.Square),e.drawLine(n,i,r),e.restore(),i=new u.PointF(t.x+t.width,t.y+t.height),r=new u.PointF(t.x,t.y+t.height),n=this.style.borders.bottom,t.y+t.height>e.clientSize.height-n.width/2&&(i=new u.PointF(t.x+t.width,e.clientSize.height-n.width/2),r=new u.PointF(t.x,e.clientSize.height-n.width/2)),this.style.borders.bottom.dashStyle===u.PdfDashStyle.Solid&&(n.lineCap=u.PdfLineCap.Square),e.drawLine(n,i,r),e.restore()},e}(),Ai=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 Bi;return this.add(t),e}e.row=this.treegridRow,this.cells.push(e)},e.prototype.indexOf=function(e){return this.cells.indexOf(e)},e}(),Hi=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 t.isNullOrUndefined(this.treegridCells)&&(this.treegridCells=new Ai(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}(),Wi=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 Hi(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 Bi);this.rows.push(e)},e.prototype.getRow=function(e){return this.rows[e]},e}(),ji=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}(),Gi=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 u.PdfStringFormat),this.stringFormat},set:function(e){this.stringFormat=e},enumerable:!0,configurable:!0}),e}(),qi=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 Gi(this.treegrid));for(var i=0;i<this.treegrid.rows.count;i++){var r=this.treegrid.rows.getRow(i),n=new Bi;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(r=0;r<this.count;r++){var n=e/i;t[r]<=0&&(t[r]=n)}return t},e}(),zi=function(){function e(e){this.parent=e}return e.prototype.processGridExport=function(e,t,i){this.flatData=e,this.gantt=t,this.exportValueFormatter=new _i(this.parent.locale),this.exportProps=i,this.rowIndex=0,this.colIndex=0,this.columns=this.parent.treeGrid.columns,this.gantt.treeColumnIndex=this.parent.treeColumnIndex,this.gantt.rowHeight=S(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.processHeaderContent(),this.processGanttContent(),this.processTimeline(),this.processTaskbar(),this.processPredecessor()},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 i=this.gantt.columns.getColumn(t);this.parent.treeColumnIndex===t&&(i.isTreeColumn=!0);var r=parseInt(e.width,10);i.width=S(r),this.totalColumnWidth+=i.width,i.headerText=e.headerText,i.field=e.field;var n=this.row.cells.getCell(t);n.value=e.headerText,n.isHeaderCell=!0;var a=this.parent.timelineModule.isSingleTier?45:60;this.copyStyles(this.ganttStyle.columnHeader,n,!1),this.row.height=S(a),e.headerTextAlign&&(n.style.format.alignment=u.PdfTextAlignment[e.headerTextAlign]);var s={cell:n,style:n.style,value:n.value,column:e};this.parent.pdfColumnHeaderQueryCellInfo&&this.parent.trigger("pdfColumnHeaderQueryCellInfo",s),n.value=s.value},e.prototype.isColumnVisible=function(e){var i=e.visible||this.exportProps.includeHiddenColumn,r=!!t.isNullOrUndefined(e.template);return i&&r},e.prototype.processGanttContent=function(){var e=this;0===this.flatData.length?this.renderEmptyGantt():this.flatData.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.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=t.extend([],[],e.topTierCollection,!0),this.gantt.chartHeader.bottomTier=t.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;(t.isNullOrUndefined(this.exportProps.showPredecessorLines)||this.exportProps.showPredecessorLines)&&(this.parent.pdfExportModule.isPdfExport=!0,this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.updatedConnectorLineCollection.forEach(function(t){var i=e.gantt.predecessor.add();i.parentLeft=t.parentLeft,i.childLeft=t.childLeft,i.parentWidth=t.parentWidth,i.childWidth=t.childWidth,i.parentIndex=t.parentIndex,i.childIndex=t.childIndex,i.rowHeight=t.rowHeight,i.type=t.type,i.milestoneParent=t.milestoneParent,i.milestoneChild=t.milestoneChild,i.lineWidth=e.parent.connectorLineWidth>5?S(5):S(e.parent.connectorLineWidth),t.isCritical?i.connectorLineColor=e.ganttStyle.criticalConnectorLineColor:i.connectorLineColor=e.ganttStyle.connectorLineColor,i.connectorLineColor=e.ganttStyle.connectorLineColor,e.gantt.predecessorCollection.push(i)}),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,i,r){var n=r.cells.getCell(this.colIndex),a=this.parent.taskFields,s=e.ganttProperties;"datepickeredit"===i.editType||"datetimepickeredit"===i.editType?n.value=e[i.field]:i.field===a.duration?n.value=this.parent.getDurationString(s.duration,s.durationUnit):i.field===a.resourceInfo?n.value=s.resourceNames:i.field===a.work?n.value=this.parent.getWorkString(s.work,s.workUnit):n.value=t.isNullOrUndefined(e[i.field])?"":e[i.field].toString(),n.isHeaderCell=!1,n.style.padding=new xi,this.copyStyles(this.ganttStyle.cell,n,r.isParentRow),this.colIndex!==this.parent.treeColumnIndex?n.style.format.alignment=u.PdfTextAlignment[i.textAlign]:n.style.format.paragraphIndent=10*n.row.level;var o={data:e,value:n.value,column:i,style:n.style,cell:n};o.value=this.exportValueFormatter.formatCellValue(o),this.parent.pdfQueryCellInfo&&this.parent.trigger("pdfQueryCellInfo",o),n.value=o.value},e.prototype.processTaskbar=function(){var e=this;this.flatData.forEach(function(i){var r=e.gantt.taskbar.add(),n=i.ganttProperties;r.left=n.left,r.width=n.width,r.left<0&&(r.width=r.width+r.left,r.left=0),r.progress=n.progress,r.isScheduledTask=f(n),f?t.isNullOrUndefined(n.endDate)&&t.isNullOrUndefined(n.duration)?r.unscheduledTaskBy="startDate":t.isNullOrUndefined(n.startDate)&&t.isNullOrUndefined(n.duration)?r.unscheduledTaskBy="endDate":(r.unscheduledTaskBy="duration",r.unscheduleStarteDate=e.parent.dateValidationModule.getValidStartDate(i.ganttProperties),r.unscheduleEndDate=e.parent.dateValidationModule.getValidEndDate(i.ganttProperties)):(r.unscheduleStarteDate=null,r.unscheduleEndDate=null),r.startDate=n.startDate,r.endDate=n.endDate,r.height=e.parent.chartRowsModule.taskBarHeight,r.isMilestone=n.isMilestone,r.milestoneColor=new u.PdfColor(e.ganttStyle.taskbar.milestoneColor),r.isParentTask=i.hasChildRecords,n.isMilestone&&(r.height=n.width),i[e.parent.labelSettings.leftLabel]&&(r.leftTaskLabel.value=i[e.parent.labelSettings.leftLabel].toString()),i[e.parent.labelSettings.rightLabel]&&(r.rightTaskLabel.value=i[e.parent.labelSettings.rightLabel].toString()),i[e.parent.labelSettings.taskLabel]&&(r.taskLabel=i[e.parent.labelSettings.taskLabel].toString());var a=n.isMilestone?Math.floor(e.parent.chartRowsModule.taskBarHeight/2)+33:33;r.rightTaskLabel.left=n.left+n.width+a,r.fontFamily=e.ganttStyle.fontFamily,r.progressWidth=n.progressWidth,r.labelColor=new u.PdfColor(e.ganttStyle.label.fontColor),r.progressFontColor=new u.PdfColor(e.ganttStyle.taskbar.progressFontColor),r.isParentTask?(r.taskColor=new u.PdfColor(e.ganttStyle.taskbar.parentTaskColor),r.taskBorderColor=new u.PdfColor(e.ganttStyle.taskbar.parentTaskBorderColor),r.progressColor=new u.PdfColor(e.ganttStyle.taskbar.parentProgressColor)):i.isCritical?(r.taskColor=new u.PdfColor(e.ganttStyle.taskbar.criticalTaskColor),r.progressColor=new u.PdfColor(e.ganttStyle.taskbar.criticalProgressColor),r.taskBorderColor=new u.PdfColor(e.ganttStyle.taskbar.criticalTaskBorderColor)):(r.taskColor=new u.PdfColor(e.ganttStyle.taskbar.taskColor),r.progressColor=new u.PdfColor(e.ganttStyle.taskbar.progressColor),r.taskBorderColor=new u.PdfColor(e.ganttStyle.taskbar.taskBorderColor)),r.gridLineColor=new u.PdfColor(e.ganttStyle.chartGridLineColor),e.gantt.taskbarCollection.push(r);var s={};s.progressFontColor=r.progressFontColor,s.taskColor=r.taskColor,s.taskBorderColor=r.taskBorderColor,s.progressColor=r.progressColor,s.milestoneColor=r.milestoneColor;var o={taskbar:s,data:i};e.parent.pdfQueryTaskbarInfo&&(e.parent.trigger("pdfQueryTaskbarInfo",o),r.progressFontColor=o.taskbar.progressFontColor,r.taskColor=o.taskbar.taskColor,r.taskBorderColor=o.taskbar.taskBorderColor,r.progressColor=o.taskbar.progressColor,r.milestoneColor=o.taskbar.milestoneColor)})},e.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new u.PdfStringFormat),e){case"Right":t.alignment=u.PdfTextAlignment.Right;break;case"Center":t.alignment=u.PdfTextAlignment.Center;break;case"Justify":t.alignment=u.PdfTextAlignment.Justify;break;case"Left":t.alignment=u.PdfTextAlignment.Left}return t},e.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new u.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=u.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=u.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=u.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 i=t.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,r=t.isNullOrUndefined(e.style.fontFamily)?u.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),n=u.PdfFontStyle.Regular;return!t.isNullOrUndefined(e.style.bold)&&e.style.bold&&(n|=u.PdfFontStyle.Bold),!t.isNullOrUndefined(e.style.italic)&&e.style.italic&&(n|=u.PdfFontStyle.Italic),!t.isNullOrUndefined(e.style.underline)&&e.style.underline&&(n|=u.PdfFontStyle.Underline),!t.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(n|=u.PdfFontStyle.Strikeout),new u.PdfStandardFont(r,i,n)},e.prototype.renderEmptyGantt=function(){var e=this.gantt.rows.addRow();e.cells.getCell(0).isHeaderCell=!1,e.height=S(this.parent.rowHeight),this.copyStyles(this.ganttStyle.columnHeader,e.cells.getCell(0),e.isParentRow);var t=this.columns.length;this.mergeCells(0,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 u.PdfColor(e.fontColor),t.style.backgroundColor=new u.PdfColor(e.backgroundColor),t.style.borderColor=new u.PdfColor(e.borderColor),t.style.fontSize=e.fontSize,t.style.fontStyle=e.fontStyle,t.style.format=Object.assign(new u.PdfStringFormat,e.format),t.style.borders=new Oi,t.style.borders.all=new u.PdfPen(t.style.borderColor),t.style.padding=new xi;var r=0;r=t.isHeaderCell?this.parent.timelineModule.isSingleTier?22.5:30:this.parent.rowHeight/2,t.style.padding.top=r-e.fontSize,t.style.padding.bottom=r-e.fontSize,t.style.padding.left=10,t.style.padding.right=10},e.prototype.initializePdf=function(e){this.pdfDoc=e;var i=[],r=this.pdfDoc.pageSettings.width-82;if(this.totalColumnWidth>this.pdfDoc.pageSettings.width-82?this.gantt.style.allowHorizontalOverflow=!0:r/this.columns.length<i[0]&&(this.gantt.columns.getColumn(0).width=i[0]),this.exportProps.enableFooter||t.isNullOrUndefined(this.exportProps.enableFooter)){var n=new u.RectangleF(0,0,e.pageSettings.width,35),a=new u.PdfPen(this.ganttStyle.chartGridLineColor),s=new u.PdfPageTemplateElement(n),o=new u.PdfSolidBrush(this.ganttStyle.footer.backgroundColor);s.graphics.drawRectangle(a,o,0,0,e.pageSettings.width,35);var l=new u.PdfStandardFont(this.ganttStyle.fontFamily,this.ganttStyle.footer.fontSize,this.ganttStyle.footer.fontStyle),d=new u.PdfSolidBrush(this.ganttStyle.footer.fontColor),p=new u.PdfPageNumberField(l),h=new u.PdfPageCountField(l,d),c=new u.PdfCompositeField(l,d,"Page {0}",p,h);c.stringFormat=this.ganttStyle.footer.format,c.bounds=n,c.draw(s.graphics,new u.PointF(0,0)),e.template.bottom=s}},e}(),_i=function(){function e(e){this.valueFormatter=new r.ValueFormatter(e),this.internationalization=new t.Internationalization(e)}return e.prototype.returnFormattedValue=function(e,i){return!t.isNullOrUndefined(e.value)&&e.value?this.valueFormatter.getFormatFunction(i)(e.value):""},e.prototype.formatCellValue=function(e){if(e.isForeignKey&&(e.value=t.getValue(e.column.foreignKeyValue,r.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(t.isNullOrUndefined(e.column.type)||t.isNullOrUndefined(e.value))&&t.isNullOrUndefined(e.value)?"":e.value.toString();if("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format){var i=void 0;return i="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,i)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var n=void 0;return n="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,n)},e}(),Xi=function(){return(Xi=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}).apply(this,arguments)},Yi=function(){function e(e){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,i,r,n,a,s){var o=e.graphics,l=!1,d=e.getClientSize();i.y+a>d.height&&(o=(e=this.GetNextPage(e)).graphics,i.y=0,this.parent.pdfExportModule.gantt.enableHeader&&(this.parent.pdfExportModule.gantt.chartHeader.drawPageTimeline(e,i,r),i.y=S(this.parent.timelineModule.isSingleTier?45:60)),l=!0),this.drawLeftLabel(e,i,r,n);var p=new u.PdfStandardFont(this.fontFamily,9,u.PdfFontStyle.Regular),h=new u.PdfSolidBrush(this.progressFontColor),c=new u.PdfStringFormat;c.lineAlignment=u.PdfVerticalAlignment.Middle,c.alignment=u.PdfTextAlignment.Right;var g,f=!1;/^[a-zA-Z]/.test(this.taskLabel)&&(f=!0,c.alignment=u.PdfTextAlignment.Left);var m=-1;if(s.isMilestone)this.drawMilestone(e,i,r,n);else{var y=new u.PdfPen(s.taskBorderColor),v=new u.PdfSolidBrush(s.taskColor),D=new u.PdfPen(s.progressColor),w=new u.PdfSolidBrush(s.progressColor),k=S((this.parent.rowHeight-this.height)/2);m=e.section.indexOf(e);var T=t.isNullOrUndefined(this.unscheduleStarteDate)?this.startDate:this.unscheduleStarteDate,b=t.isNullOrUndefined(this.unscheduleEndDate)?this.endDate:this.unscheduleEndDate;if(r.startDate<=T&&b<=r.endDate)this.isStartPoint||(this.taskStartPoint=Xi({},i),this.isStartPoint=!0),this.isScheduledTask||"duration"===this.unscheduledTaskBy?(o.drawRectangle(y,v,i.x+S(this.left-n)+.5,i.y+k,S(s.width),S(s.height)),this.isScheduledTask&&(o.drawRectangle(D,w,i.x+S(this.left-n)+.5,i.y+k,S(s.progressWidth),S(s.height)),t.isNullOrUndefined(this.parent.labelSettings.taskLabel)||t.isNullOrUndefined(this.taskLabel)||(g=this.progressWidth,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+S(this.left-n),i.y+k,S(g),S(this.height),c)))):this.drawUnscheduledTask(o,i,n,k),this.isCompleted=!0,this.startPage=m,this.endPage=m;else if(r.startDate<=T&&r.endDate>=T&&b>=r.endDate){this.isStartPoint||(this.taskStartPoint=Xi({},i),this.isStartPoint=!0);var P=0;if(f||(this.width=this.width-(r.totalWidth-(this.left-n))),P=r.totalWidth-(this.left-n),this.isScheduledTask||"duration"===this.unscheduledTaskBy){if(o.drawRectangle(y,v,i.x+S(this.left-n)+.5,i.y+k,S(P),S(s.height)),this.isScheduledTask){var C=0;C=this.progressWidth<=P?this.progressWidth:P,o.drawRectangle(D,w,i.x+S(this.left-n)+.5,i.y+k,S(C),S(s.height)),this.progressWidth-=C,this.parent.labelSettings.taskLabel&&!t.isNullOrUndefined(this.taskLabel)&&(g=C,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+S(this.left-n),i.y+k,S(g),S(this.height),c))}}else this.drawUnscheduledTask(o,i,n,k);this.left=0,this.isCompleted=!1,this.startPage=m}else if(b<=r.endDate&&r.startDate<=b&&!this.isCompleted)this.isStartPoint||(this.taskStartPoint=Xi({},i),this.isStartPoint=!0),o.drawRectangle(y,v,i.x+S(s.left+.5),i.y+k,S(s.width),S(s.height)),this.isScheduledTask&&(o.drawRectangle(D,w,i.x+S(s.left+.5),i.y+k,S(s.progressWidth),S(s.height)),t.isNullOrUndefined(this.taskLabel)||(g=this.progressWidth,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+S(this.left),i.y+k,S(g),S(this.height),c))),this.isCompleted=!0,this.endPage=m;else if(T<r.startDate&&b>r.endDate){if(this.isStartPoint||(this.taskStartPoint=Xi({},i),this.isStartPoint=!0),o.drawRectangle(y,v,i.x+S(s.left)+.5,i.y+k,S(r.totalWidth),S(s.height)),this.isScheduledTask){C=0;C=this.progressWidth<=r.totalWidth?this.progressWidth:r.totalWidth,o.drawRectangle(D,w,i.x+S(s.left)+.5,i.y+k,S(C),S(s.height)),this.progressWidth-=C,t.isNullOrUndefined(this.taskLabel)||(g=C,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+S(this.left),i.y+k,S(g),S(this.height),c))}this.isCompleted=!1,this.width-=r.totalWidth}}return this.drawRightLabel(e,i,r,n),l},e.prototype.drawRightLabel=function(e,i,r,n){var a,s=e.graphics,o=(a=this.rightTaskLabel.isLeftCalculated?this.rightTaskLabel.left:S(this.rightTaskLabel.left))-S(n)+i.x;if(r.startPoint<=a&&a<r.endPoint&&!t.isNullOrUndefined(this.rightTaskLabel.value)&&!this.rightTaskLabel.isCompleted){var l=this.getWidth(this.rightTaskLabel.value,r.endPoint-a,15),d=new u.PdfStandardFont(this.fontFamily,9),p=(S(this.parent.rowHeight)-l.actualSize.height)/2,h=new u.PointF(o,i.y+p),c=new u.SizeF(l.actualSize.width,l.actualSize.height),g=new u.RectangleF(h,c),f=new u.PdfStringFormat;if(f.alignment=u.PdfTextAlignment.Right,f.lineAlignment=u.PdfVerticalAlignment.Middle,l.actualSize.width>0){var m=new u.PdfSolidBrush(this.labelColor);s.drawString(l.lines[0].text,d,null,m,g.x,g.y,l.actualSize.width,l.actualSize.height,f),null!==l.remainder?(this.rightTaskLabel.value=l.remainder,this.rightTaskLabel.left=r.endPoint,this.rightTaskLabel.isLeftCalculated=!0):this.rightTaskLabel.isCompleted=!0}else this.rightTaskLabel.left=r.endPoint}},e.prototype.drawLeftLabel=function(e,i,r,n){var a,s=e.graphics;if(!t.isNullOrUndefined(this.leftTaskLabel.value)){var o=0;if(o=this.left,this.leftTaskLabel.isLeftCalculated)a=this.leftTaskLabel.left;else{var l=this.getWidth(this.leftTaskLabel.value,Number.MAX_VALUE,15);a=S(o-(this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33))-l.actualSize.width,this.leftTaskLabel.left=a,this.leftTaskLabel.isLeftCalculated=!0}var d=a-S(n)+i.x;if(r.startPoint<=a&&a<r.endPoint&&!t.isNullOrUndefined(this.leftTaskLabel.value)&&!this.leftTaskLabel.isCompleted){l=this.getWidth(this.leftTaskLabel.value,r.endPoint-a,15);var p=new u.PdfStandardFont(this.fontFamily,9),h=(S(this.parent.rowHeight)-l.actualSize.height)/2,c=new u.PointF(d,i.y+h),g=new u.SizeF(l.actualSize.width,l.actualSize.height),f=new u.RectangleF(c,g),m=new u.PdfStringFormat;if(m.alignment=u.PdfTextAlignment.Right,m.lineAlignment=u.PdfVerticalAlignment.Middle,l.actualSize.width>0){var y=new u.PdfSolidBrush(this.labelColor);s.drawString(l.lines[0].text,p,null,y,f.x,f.y,l.actualSize.width,l.actualSize.height,m),null!==l.remainder?(this.leftTaskLabel.value=l.remainder,this.leftTaskLabel.left=r.endPoint):this.leftTaskLabel.isCompleted=!0}else this.leftTaskLabel.left=r.endPoint}}},e.prototype.getWidth=function(e,t,i){var r=new u.PdfStandardFont(this.fontFamily,9),n=new u.PdfStringLayouter,a=new u.PdfStringFormat;a.alignment=u.PdfTextAlignment.Left,a.wordWrap=u.PdfWordWrapType.Character,a.lineAlignment=u.PdfVerticalAlignment.Middle;return n.layout(e,r,a,new u.SizeF(t,i),!1,new u.SizeF(t,i))},e.prototype.drawUnscheduledTask=function(e,t,i,r){var n=new u.PdfSolidBrush(this.taskColor);e.drawRectangle(n,t.x+S(this.left-i),t.y+r,S(3),S(this.height))},e.prototype.drawMilestone=function(e,t,i,r){if(i.startDate<=this.startDate&&this.startDate<=i.endDate){var n=e.graphics,a=e.section.indexOf(e);this.taskStartPoint=Xi({},t);var s=new u.PdfPen(this.milestoneColor),o=S((this.parent.rowHeight-this.height)/2),l=new u.PdfSolidBrush(this.milestoneColor);n.save();var d=Math.floor(.6*this.parent.chartRowsModule.taskBarHeight);n.translateTransform(t.x+S(this.left-r),t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2),n.rotateTransform(45),n.drawRectangle(s,l,0,0,S(d),S(d)),n.restore(),this.endPage=this.startPage=a}},e}(),Zi=function(){function e(e){this.width=0,this.gantt=e,this.parent=e.parent,this.topTierPoint=new u.PointF,this.bottomTierPoint=new u.PointF,this.topTierIndex=0,this.bottomTierIndex=0,this.prevTopTierIndex=0,this.prevBottomTierIndex=0}return e.prototype.drawTimeline=function(e,t,i){var r=Math.floor(i.totalWidth),n=0;for(this.topTierPoint.x=t.x,this.topTierPoint.y=t.y,this.prevTopTierIndex=this.topTierIndex,this.prevBottomTierIndex=this.bottomTierIndex;r>0;){var a=this.topTier[this.topTierIndex];if(this.topTier.length>this.topTierIndex){var s=!1;this.topTier[this.topTierIndex].isFinished||(r>=a.width?(n=a.width,a.isFinished=!0,a.completedWidth=n,s=!0):(n=r,s=!1,a.isFinished=!1,a.width=a.width-r,a.completedWidth=n)),this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,n,a.value,!0),this.topTierPoint.x+=S(n),r-=n,s&&this.topTierIndex++}else r=0}r=Math.floor(i.totalWidth);var o=this.parent.timelineModule.isSingleTier?0:this.topTierHeight;for(this.bottomTierPoint=new u.PointF(t.x,S(t.y+o));r>0;){var l=this.bottomTier[this.bottomTierIndex];if(this.bottomTier.length>this.bottomTierIndex){s=!0;var d=l.width;r<d&&(d=r,s=!1,l.completedWidth=d),this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,d,l.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+S(d),r-=d,l.completedWidth=d,s&&this.bottomTierIndex++}else r=0}},e.prototype.drawPageTimeline=function(e,i,r){this.topTierPoint=t.extend({},{},i,!0);for(var n=this.prevTopTierIndex;n<=this.topTierIndex;n++)if(this.topTier.length>n){var a=this.topTier[n];a.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,a.completedWidth,a.value,!0),this.topTierPoint.x+=S(a.completedWidth))}this.bottomTierPoint.x=i.x,this.bottomTierPoint.y=S(i.y+this.topTierHeight);for(n=this.prevBottomTierIndex;n<=this.bottomTierIndex;n++)if(this.bottomTier.length>n){var s=this.bottomTier[n];s.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,s.width,s.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+S(s.width))}},e.prototype.triggerQueryTimelinecell=function(e,i,r,n,a,s,o){var l=e.graphics,d={},p=this.gantt.ganttStyle;d.borderColor=new u.PdfColor(p.timeline.borderColor),d.fontColor=new u.PdfColor(p.timeline.fontColor),d.fontSize=p.timeline.fontSize,d.fontStyle=p.timeline.fontStyle,d.backgroundColor=new u.PdfColor(p.timeline.backgroundColor),p.timeline.padding&&(d.padding=p.timeline.padding);var h=new u.PdfStringFormat;t.isNullOrUndefined(p.timeline.format)?o?(h.lineAlignment=u.PdfVerticalAlignment.Middle,h.alignment=u.PdfTextAlignment.Left):(h.lineAlignment=u.PdfVerticalAlignment.Middle,h.alignment=u.PdfTextAlignment.Center,h.wordWrap=u.PdfWordWrapType.Character):h=p.timeline.format,d.format=h;var c={timelineCell:d,value:s};this.parent.pdfQueryTimelineCellInfo&&this.parent.trigger("pdfQueryTimelineCellInfo",c);var g=c.timelineCell,f=new u.PdfPen(c.timelineCell.borderColor),m=new u.PdfSolidBrush(c.timelineCell.backgroundColor);l.drawRectangle(f,m,i,r,S(a),S(n));var y=new u.PdfStandardFont(p.fontFamily,g.fontSize,g.fontStyle),v=new u.PdfSolidBrush(c.timelineCell.fontColor),D=p.timeline.padding?c.timelineCell.padding.left:0,w=p.timeline.padding?c.timelineCell.padding.top:0;l.drawString(c.value,y,null,v,i+D,r+w,S(a),S(n),g.format)},e}(),Qi=function(){return(Qi=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}).apply(this,arguments)},Ki=function(){function e(e,t){this.parent=e,this.pdfGantt=t}return e.prototype.add=function(){return new e(this.parent)},e.prototype.drawPredecessor=function(e){this.pdfGantt=e;var t,i,r=e.result.page.section.getPages(),n=e.taskbarCollection[this.parentIndex],a=e.taskbarCollection[this.childIndex],s=new u.PdfPage,o=new u.PdfPage,l="",d=0,p=0;switch(this.type){case"FS":if(!(a.startPage>-1&&n.endPage>-1))return;s=r[n.endPage],o=r[a.startPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[a.startPage-e.chartPageIndex],l=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(!(a.endPage>-1&&n.startPage>-1))return;s=r[n.startPage],o=r[a.endPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[a.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>this.childLeft+this.childWidth?"SFType1":"SFType2":this.parentLeft>this.childLeft+this.childWidth?"SFType3":"SFType4";break;case"FF":if(!(a.endPage>-1&&n.endPage>-1))return;s=r[n.endPage],o=r[a.endPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[a.endPage-e.chartPageIndex],l=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(!(a.startPage>-1&&n.startPage>-1))return;s=r[n.startPage],o=r[a.startPage],t=e.pdfPageDetail[n.startPage-e.chartPageIndex],i=e.pdfPageDetail[a.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>=this.childLeft?"SSType1":"SSType2":this.parentLeft>=this.childLeft?"SSType3":"SSType4"}var h=Math.round((this.parent.rowHeight-1)/2);h=S(h);var c,g,f,m,y,v;c=g=f=m=y=v=new u.PointF;var D=Qi({},n.taskStartPoint),w=Qi({},a.taskStartPoint);d=D.y+t.startPoint.y,p=w.y+i.startPoint.y;var k=new u.PointF(S(this.parentLeft+this.parentWidth),d+h),T=new u.PointF(S(this.parentLeft)-1,d+h),b=new u.PointF(S(this.childLeft-20),p+h),P=new u.PointF(S(this.childLeft-6-this.lineWidth)-1,p+h),C=new u.PointF(S(this.childLeft+this.childWidth+6+this.lineWidth)+1,p+h);switch(l){case"FSType1":case"FSType3":c=k,g=new u.PointF(S(this.childLeft-20),d+h),f=b,m=P,this.connectLines(s,o,c,g,f,m,a,h);break;case"FSType2":c=k,g=new u.PointF(c.x+10,d+h),f=new u.PointF(c.x+10,p+2),m=new u.PointF(S(this.childLeft-20),p+2),y=b,v=P,this.connectLines(s,o,c,g,f,m,a,h,y,v);break;case"FSType4":c=k,g=new u.PointF(c.x+10,d+h),f=new u.PointF(c.x+10,d+2),m=new u.PointF(S(this.childLeft-20),d+2),y=b,v=P,this.connectLines(s,o,c,g,f,m,a,h,y,v);break;case"FFType1":case"FFType3":c=new u.PointF(S(this.parentLeft+this.parentWidth)+1,d+h),g=new u.PointF(S(this.childLeft+this.childWidth+20),d+h),f=new u.PointF(g.x,p+h),m=C,this.connectLines(s,o,c,g,f,m,a,h);break;case"FFType2":case"FFType4":c=new u.PointF(S(this.parentLeft+this.parentWidth)+1,d+h),g=new u.PointF(S(this.parentLeft+this.parentWidth+20),d+h),f=new u.PointF(g.x,p+h),m=C,this.connectLines(s,o,c,g,f,m,a,h);break;case"SSType1":case"SSType3":c=T,g=new u.PointF(S(this.childLeft-20),d+h),f=new u.PointF(g.x,p+h),m=P,this.connectLines(s,o,c,g,f,m,a,h);break;case"SSType2":case"SSType4":c=T,g=new u.PointF(S(this.parentLeft-20),d+h),f=new u.PointF(g.x,p+h),m=P,this.connectLines(s,o,c,g,f,m,a,h);break;case"SFType1":case"SFType3":c=T,g=new u.PointF(S(this.childLeft+this.childWidth+20),d+h),f=new u.PointF(g.x,p+h),m=C,this.connectLines(s,o,c,g,f,m,a,h);break;case"SFType2":c=T,g=new u.PointF(S(this.parentLeft-20),d+h),f=new u.PointF(g.x,p+2),m=new u.PointF(S(this.childLeft+this.childWidth+20),p+2),y=new u.PointF(m.x,p+h),v=C,this.connectLines(s,o,c,g,f,m,a,h,y,v);break;case"SFType4":c=T,g=new u.PointF(S(this.parentLeft-20),d+h),f=new u.PointF(g.x,d+2),m=new u.PointF(S(this.childLeft+this.childWidth+20),d+2),y=new u.PointF(m.x,p+h),v=C,this.connectLines(s,o,c,g,f,m,a,h,y,v)}},e.prototype.connectLines=function(e,i,r,n,a,s,o,l,d,p){this.drawLine(e,r,n),this.drawLine(e,n,a),this.drawLine(e,a,s),t.isNullOrUndefined(d)||t.isNullOrUndefined(p)||(this.drawLine(e,s,d),this.drawLine(e,d,p)),this.drawArrow(i,o,l)},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 r=this.pdfGantt.pdfPageDetail[i],n=new u.RectangleF(r.startPoint.x,r.startPoint.y,r.width,r.height);if(this.contains(n,e.x,e.y)){t=i;break}}return t},e.prototype.drawLine=function(e,t,i){var r=this.pdfGantt.result.page.section.getPages(),n=e.graphics,a=Qi({},i),s=Qi({},i),o=Qi({},i),l=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],d=new u.RectangleF(l.startPoint.x,l.startPoint.y,l.width,l.height),p=this.contains(d,t.x,t.y),h=this.contains(d,i.x,i.y),c=-1;if(t=new u.PointF(t.x,t.y),i=new u.PointF(i.x,i.y),!p&&!h||h&&!p)(c=this.findPageIndex(t))>-1&&(l=this.pdfGantt.pdfPageDetail[c],s=t,a=i,this.drawLine(r[c+this.pdfGantt.chartPageIndex],s,a));else if(!h&&p){var g=d.x,f=d.x+d.width,m=d.y+d.height,y=d.y;g>i.x?(o.x=i.x=g-1,s.x=g-1):f<i.x?(o.x=i.x=f,s.x=f,o.x+=1):m<i.y?(o.y=i.y=m,s.y=m,o.y+=1,this.pdfGantt.enableHeader&&(s.y+=this.parent.timelineModule.isSingleTier?S(45):S(62))):y>i.y&&(s.y=o.y=y-1,i.y=y,this.pdfGantt.enableHeader&&(o.y+=this.parent.timelineModule.isSingleTier?S(45):S(62),i.y+=this.parent.timelineModule.isSingleTier?S(45):S(62))),-1!==(c=this.findPageIndex(o))&&this.drawLine(r[c+this.pdfGantt.chartPageIndex],s,a)}if(p){t=new u.PointF(t.x,t.y),i=new u.PointF(i.x,i.y),t.x=t.x+l.pageStartX-l.startPoint.x,t.y=t.y-l.startPoint.y,i.x=i.x+l.pageStartX-l.startPoint.x,i.y=i.y-l.startPoint.y;var v=new u.PdfSolidBrush(this.connectorLineColor),D=new u.PdfPen(v,S(this.lineWidth));n.drawLine(D,t,i)}},e.prototype.drawArrow=function(e,t,i){var r,n=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],a=new u.RectangleF(new u.PointF(n.startPoint.x,n.startPoint.y),new u.SizeF(n.width,n.height)),s=new u.PointF,o=e.section.getPages(),l=6+this.lineWidth;s="FS"===this.type||"SS"===this.type?new u.PointF(S(this.childLeft)-1,t.taskStartPoint.y+n.startPoint.y):new u.PointF(S(this.childLeft+this.childWidth)+1,t.taskStartPoint.y+n.startPoint.y);if(!this.contains(a,s.x,s.y)){var d=this.findPageIndex(s);d>-1&&(n=this.pdfGantt.pdfPageDetail[d],e=o[d+this.pdfGantt.chartPageIndex])}var p=e.graphics;s.x=s.x-n.startPoint.x+n.pageStartX,s.y=s.y-n.startPoint.y;var h=new u.PointF(s.x,s.y+i);r="FS"===this.type||"SS"===this.type?new u.PointF(h.x-S(l),h.y-S(l)):new u.PointF(h.x+S(l),h.y-S(l));var c=new u.PointF(r.x,r.y+S(2*l)),g=new u.PdfSolidBrush(this.connectorLineColor),f=new u.PdfPen(g,S(this.lineWidth));p.drawLine(f,h,r),p.drawLine(f,r,c),p.drawLine(f,c,h)},e}(),Ji=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)}}(),$i=function(){return($i=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}).apply(this,arguments)},er=function(e){function i(t){var i=e.call(this)||this;return i.exportProps={},i.parent=t,i.chartHeader=new Zi(i),i.predecessor=new Ki(t,i),i.headerDetails=[],i.pdfPageDetail=[],i.taskbarCollection=[],i.predecessorCollection=[],i}return Ji(i,e),Object.defineProperty(i.prototype,"taskbar",{get:function(){return t.isNullOrUndefined(this.taskbars)&&(this.taskbars=new Yi(this.parent)),this.taskbars},enumerable:!0,configurable:!0}),i.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()},i.prototype.calculateRange=function(){for(var e=this.layouter.columnRanges[this.layouter.columnRanges.length-1],i=0,r=!0,n=0,a=0,s=0,o=S(this.chartHeader.width),l=this.parent.timelineModule,d=e[0];d<=e[1];d++)i+=this.layouter.treegrid.columns.getColumn(d).width;for((i+=.5)+100<this.result.page.getClientSize().width?(a=this.result.page.getClientSize().width-i,this.chartPageIndex=this.startPageIndex=this.totalPages-this.perColumnPages,r=!1,this.startPoint=new u.PointF(i,0)):(this.result.page.section.add(),this.chartPageIndex=this.startPageIndex=this.totalPages,r=!0,this.startPoint=new u.PointF(s,0));Math.round(s)<Math.round(o);){r?n=this.result.page.getClientSize().width:(n=a,r=!0);var p={},h=[],c=S(this.chartHeader.bottomTierCellWidth),g=0;0!==this.chartHeader.bottomTierCellWidth&&(g=Math.floor(n/c)*c),h[0]=s,o-s<=g?(h[1]=o,p.totalWidth=b(o-s)):(h[1]=s+g,p.totalWidth=b(g)),p.startPoint=h[0],p.endPoint=h[1],0===this.parent.cloneProjectStartDate.getHours()&&0===this.parent.cloneProjectStartDate.getMinutes()&&0===this.parent.cloneProjectStartDate.getSeconds()&&this.parent.cloneProjectStartDate.setHours(8);var f=this.parent.dataOperation.getDateFromFormat(this.parent.cloneProjectStartDate),m=t.isNullOrUndefined(l.customTimelineSettings.bottomTier.count)?l.customTimelineSettings.topTier.count:l.customTimelineSettings.bottomTier.count;switch("None"===l.customTimelineSettings.bottomTier.unit?l.customTimelineSettings.topTier.unit:l.customTimelineSettings.bottomTier.unit){case"Minutes":p.startDate=new Date(f.getTime());var y=Math.floor(b(p.startPoint)/this.chartHeader.bottomTierCellWidth);p.startDate.setMinutes(p.startDate.getMinutes()+y*m),p.startDate.setSeconds(p.startDate.getSeconds()+1),p.endDate=new Date(p.startDate.getTime());var v=Math.floor(b(p.endPoint-p.startPoint)/this.chartHeader.bottomTierCellWidth);p.endDate.setMinutes(p.endDate.getMinutes()+v*m);break;case"Hour":p.startDate=new Date(f.getTime());var D=Math.floor(b(p.startPoint)/this.chartHeader.bottomTierCellWidth);p.startDate.setHours(p.startDate.getHours()+D*m),p.startDate.setMinutes(p.startDate.getMinutes()+1),p.endDate=new Date(p.startDate.getTime());var w=Math.floor(b(p.endPoint-p.startPoint)/this.chartHeader.bottomTierCellWidth);p.endDate.setHours(p.endDate.getHours()+w*m);break;case"Day":p.startDate=new Date(f.getTime());var k=Math.round(p.startPoint/S(this.chartHeader.bottomTierCellWidth));p.startDate.setDate(p.startDate.getDate()+k*m);var T=Math.round((p.endPoint-p.startPoint)/S(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+T*m);break;case"Week":p.startDate=new Date(f.getTime());var P=p.startPoint/S(this.chartHeader.bottomTierCellWidth)*7;p.startDate.setDate(p.startDate.getDate()+P*m);var C=7*Math.round((p.endPoint-p.startPoint)/S(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+C*m);break;case"Month":p.startDate=new Date(f.getTime());var M=p.startPoint/S(this.chartHeader.bottomTierCellWidth)*31;p.startDate.setDate(p.startDate.getDate()+M*m);var R=31*Math.round((p.endPoint-p.startPoint)/S(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+R*m);break;case"Year":p.startDate=new Date(f.getTime());var O=p.startPoint/S(this.chartHeader.bottomTierCellWidth)*365;p.startDate.setDate(p.startDate.getDate()+O*m);var x=365*Math.round((p.endPoint-p.startPoint)/S(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+x*m)}this.headerDetails.push(p),s+=g}},i.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(),a=new u.PdfPen(new u.PdfColor(206,206,206));r.drawRectangle(a,0,0,n.width,n.height)}},i.prototype.drawGantttChart=function(){var e,t=this,i=this.startPoint,r=new u.PointF,n=0,a=0,s=0;this.headerDetails.forEach(function(o,l){var d=t.result.page.section.getPages()[t.startPageIndex];t.chartHeader.drawTimeline(d,t.startPoint,o),i.y=i.y+S(t.parent.timelineModule.isSingleTier?45:60),n=i.x,s=S(t.parent.timelineModule.isSingleTier?45:60),t.headerDetails[t.headerDetails.indexOf(o)].startIndex=t.startPageIndex,t.headerDetails[t.headerDetails.indexOf(o)].pageStartPoint=i;for(var p=0;p<t.taskbarCollection.length;p++){var h=t.taskbarCollection[p],c=t.rows.getRow(p+1).height,g=t.result.page.section.getPages()[t.startPageIndex];h.drawTaskbar(g,i,o,a,c,t.taskbarCollection[p])&&(t.enableHeader?i.y=S(t.parent.timelineModule.isSingleTier?45:60):i.y=0,t.startPageIndex++,(e={}).height=s,e.pageStartX=n,e.startPoint=$i({},r),e.width=S(o.totalWidth),t.pdfPageDetail.push(e),r.y+=e.height,t.enableHeader?s=t.chartHeader.height:(i.y=0,s=0)),i.y+=c,s+=c}t.headerDetails[l].endIndex=t.startPageIndex,a+=o.totalWidth,(e={}).height=s,e.pageStartX=n,e.startPoint=$i({},r),e.width=S(o.totalWidth),t.pdfPageDetail.push(e),r.x+=e.width,r.y=0,t.enableHeader?s=t.chartHeader.height:i.y=0,t.headerDetails.indexOf(o)!==t.headerDetails.length-1&&(t.result.page.section.add(),t.startPageIndex=t.result.page.section.count-1,i=t.startPoint=new u.PointF(0,0))});for(var o=0;o<this.predecessorCollection.length;o++){this.predecessorCollection[o].drawPredecessor(this)}},i}(Ni),tr=function(){function e(e){this.isPdfExport=!1,this.parent=e,this.helper=new zi(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 er(this.parent)},e.prototype.export=function(e,i,r){var n=this,a={requestType:"beforePdfExport",ganttObject:this.parent,cancel:!1};return this.parent.trigger("beforePdfExport",a),t.getValue("cancel",a)?new Promise(function(e,t){return e()}):new Promise(function(t,a){n.exportWithData(r,t,e,i)})},e.prototype.exportWithData=function(e,i,r,n){var a=this,s=[];t.isNullOrUndefined(r)&&(r={}),s="CurrentViewData"===r.exportType?this.parent.currentViewData:this.parent.flatData,this.initGantt(),t.isNullOrUndefined(e)?this.pdfDocument=new u.PdfDocument:this.pdfDocument=e,this.processExport(s,r,n).then(function(){a.parent.trigger("pdfExportComplete",{}),i(a.pdfDocument)})},e.prototype.processExport=function(e,i,r){var n=this,a=this.pdfDocument.sections.add();this.processSectionExportProperties(a,i);var s=a.pages.add();return new Promise(function(t,r){n.helper.processGridExport(e,n.gantt,i),n.helper.initializePdf(n.pdfDocument),t()}).then(function(){var e=new Vi;e.break=u.PdfLayoutBreakType.FitElement;var a=n.gantt.drawGrid(s,0,0,e);return n.gantt.drawChart(a),r||(!t.isNullOrUndefined(i)&&i.fileName?n.pdfDocument.save(i.fileName):n.pdfDocument.save("Export.pdf"),n.pdfDocument.destroy()),n.pdfDocument})},e.prototype.processSectionExportProperties=function(e,i){if(t.isNullOrUndefined(i))this.gantt.ganttStyle=new Mi(i.theme).style;else{var r=new u.PdfPageSettings;if(t.isNullOrUndefined(i.pageOrientation)||"Portrait"!==i.pageOrientation?r.orientation=u.PdfPageOrientation.Landscape:r.orientation=u.PdfPageOrientation.Portrait,t.isNullOrUndefined(i.pageSize)||(r.size=this.getPageSize(i.pageSize)),e.setPageSettings(r),t.isNullOrUndefined(i.ganttStyle))this.gantt.ganttStyle=new Mi(i.theme).style;else{var n=new Mi(i.theme).style;this.gantt.ganttStyle=t.extend({},n,i.ganttStyle,!0)}}},e.prototype.getPageSize=function(e){switch(e){case"Letter":return new u.SizeF(612,792);case"Note":return new u.SizeF(540,720);case"Legal":return new u.SizeF(612,1008);case"A0":return new u.SizeF(2380,3368);case"A1":return new u.SizeF(1684,2380);case"A2":return new u.SizeF(1190,1684);case"A3":return new u.SizeF(842,1190);case"A5":return new u.SizeF(421,595);case"A6":return new u.SizeF(297,421);case"A7":return new u.SizeF(210,297);case"A8":return new u.SizeF(148,210);case"A9":return new u.SizeF(105,148);case"B0":return new u.SizeF(2836,4008);case"B1":return new u.SizeF(2004,2836);case"B2":return new u.SizeF(1418,2004);case"B3":return new u.SizeF(1002,1418);case"B4":return new u.SizeF(709,1002);case"B5":return new u.SizeF(501,709);case"Archa":return new u.SizeF(648,864);case"Archb":return new u.SizeF(864,1296);case"Archc":return new u.SizeF(1296,1728);case"Archd":return new u.SizeF(1728,2592);case"Arche":return new u.SizeF(2592,3456);case"Flsa":return new u.SizeF(612,936);case"HalfLetter":return new u.SizeF(396,612);case"Letter11x17":return new u.SizeF(792,1224);case"Ledger":return new u.SizeF(1224,792);default:return new u.SizeF(595,842)}},e}(),ir=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,a.TreeGrid.Inject(a.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}();e.Gantt=ni,e.parentsUntil=g,e.isScheduledTask=f,e.isCountRequired=m,e.getSwapKey=y,e.isRemoteData=v,e.getTaskData=D,e.updateDates=w,e.formatString=k,e.getIndex=T,e.pixelToPoint=S,e.pointToPixel=b,e.getUid=P,e.load="load",e.rowDataBound="rowDataBound",e.queryCellInfo="queryCellInfo",e.toolbarClick="toolbarClick",e.keyPressed="key-pressed",e.Edit=ci,e.Reorder=ui,e.Resize=gi,e.Filter=fi,e.Sort=mi,e.Dependency=Kt,e.Selection=yi,e.Toolbar=vi,e.DayMarkers=ki,e.CriticalPath=Ti,e.ContextMenu=Si,e.ExcelExport=bi,e.ColumnMenu=Pi,e.RowDD=Ci,e.PdfExport=tr,e.VirtualScroll=ir,e.Column=Ke,e.DayWorkingTime=tt,e.AddDialogFieldSettings=nt,e.EditDialogFieldSettings=ot,e.EditSettings=pt,e.EventMarker=ut,e.FilterSettings=mt,e.SearchSettings=Dt,e.Holiday=Tt,e.LabelSettings=Pt,e.SelectionSettings=Rt,e.SplitterSettings=It,e.TaskFields=Ut,e.TimelineTierSettings=Nt,e.TimelineSettings=Bt,e.TooltipSettings=Wt,e.SortDescriptor=qt,e.SortSettings=zt,e.ResourceFields=Yt,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-gantt.umd.min.js.map
|