@syncfusion/ej2-gantt 21.2.8 → 21.2.9
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 +20 -0
- package/dist/ej2-gantt.min.js +2 -2
- 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 +132 -50
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +127 -45
- 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 +15 -15
- package/src/gantt/actions/dependency.js +9 -0
- package/src/gantt/actions/edit.d.ts +1 -0
- package/src/gantt/actions/edit.js +13 -3
- package/src/gantt/base/gantt-chart.js +13 -2
- package/src/gantt/base/task-processor.js +44 -17
- package/src/gantt/base/tree-grid.js +2 -2
- package/src/gantt/export/export-helper.js +3 -0
- package/src/gantt/renderer/chart-rows.d.ts +1 -0
- package/src/gantt/renderer/chart-rows.js +39 -19
- package/src/gantt/renderer/timeline.js +4 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-gantt.min.js
|
|
3
|
-
* version : 21.2.
|
|
3
|
+
* version : 21.2.9
|
|
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
|
-
this.ej=this.ej||{},this.ej.gantt=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++){o=void 0;a=o=i?e[s].taskData:t.extend({},e[s].taskData,{},!0)}return a}for(var a=[],s=0;s<e.length;s++){var 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 b(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 T(e){return 76*e/92}function S(e){return 92*e/76}function P(){return C++}var C=0,R=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;if(this.parent.autoCalculateDateScheduling){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())}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;if(this.parent.autoCalculateDateScheduling){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())}return t.isNullOrUndefined(n)||this.setTime(this.parent.defaultEndTime,n),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 i&&i.baselineStartDate&&r&&i.baselineStartDate.getTime()>r.getTime()&&r.setDate(r.getDate()+1),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))r=e[this.parent.taskFields.endDate],t.isNullOrUndefined(r)||this.setTime(this.parent.defaultEndTime,r),this.parent.setRecordValue("endDate",r,i,!0);else{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(this.parent.taskFields.milestone)||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&&this.parent.autoCalculateDateScheduling&&r?this.getWeekendCount(e,i):0,s=this.getNumberOfSeconds(e,i,n),o=r&&this.parent.autoCalculateDateScheduling?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.toLocaleLowerCase()?"hour"===t.toLocaleLowerCase()?3600*e:60*e:this.parent.secondsPerDay*e},e.prototype.getEndDate=function(e,t,i,r,n){for(var a=new Date(e.getTime()),s=new Date(e.getTime()),o=this.getDurationAsSeconds(t,i);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,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(s,a,r.isAutoSchedule,!0))>0&&(a=this.checkEndDate(s,r)),a=new Date(s.getTime());return n&&r.isMilestone&&(s.setDate(s.getDate()-1),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,s),s=this.parent.dateValidationModule.checkStartDate(s,r,!0)),s},e.prototype.getProjectStartDate=function(e,i){if(!t.isNullOrUndefined(this.parent.cloneProjectStartDate)){"string"==typeof this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate));o=this.checkStartDate(this.parent.cloneProjectStartDate);return this.parent.cloneProjectStartDate=o,new Date(o.getTime())}if(t.isNullOrUndefined(this.parent.projectStartDate)){if(t.isNullOrUndefined(i))return null;var r=this.parent.flatData,n=void 0;r.length>0?n=r[0].ganttProperties.startDate:(n=new Date).setHours(0,0,0,0);for(var a=1;a<r.length;a++){var s=r[a].ganttProperties.startDate;t.isNullOrUndefined(s)||-1!==this.compareDates(s,n)||(n=s)}this.parent.cloneProjectStartDate=this.checkStartDate(n,e)}else{var o=this.getDateFromFormat(this.parent.projectStartDate);this.parent.cloneProjectStartDate=this.checkStartDate(o)}return new Date(this.parent.cloneProjectStartDate.getTime())},e.prototype.getValidStartDate=function(e,i){var r=this,n=null,a=i?e.autoStartDate:e.startDate,s=i?e.autoEndDate:e.endDate,o=!e.isAutoSchedule&&e.autoDuration?e.autoDuration:e.duration;return t.isNullOrUndefined(a)?t.isNullOrUndefined(s)?t.isNullOrUndefined(o)||this.parent.flatData.map(function(i){i.ganttProperties.taskId==e.taskId&&(!t.isNullOrUndefined(i.parentItem)&&i.parentItem.taskId?r.parent.flatData.map(function(a){a.ganttProperties.taskId===i.parentItem.taskId?t.isNullOrUndefined(a.ganttProperties.startDate)||(n=a.ganttProperties.startDate):n=r.getProjectStartDate(e)}):n=r.getProjectStartDate(e))}):(n=new Date(s.getTime()),this.setTime(this.parent.defaultStartTime,n)):n=new Date(a.getTime()),n},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,this.parent.autoCalculateDateScheduling||(i=!0),!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.parent.autoCalculateDateScheduling)&&this.isOnHolidayOrWeekEnd(e,null),d=!(!i||!this.parent.autoCalculateDateScheduling)&&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 d?o+=n-r: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){o=s-i;r.setTime(r.getTime()+60*o*1e3)}else if(s>=0){var o=i-s;r.setTime(r.getTime()-60*o*1e3)}}},e.prototype.getSecondsInDecimal=function(e){return 60*e.getHours()*60+60*e.getMinutes()+e.getSeconds()+e.getMilliseconds()/1e3},e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var r=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(r.getTime())?0:(e.getTime()-r.getTime())/6e4+i}catch(e){return 0}},e.prototype.remove=function(e,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}return!t.isNullOrUndefined(this.parent.timezone)&&i?this.convert(r,this.parent.timezone):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){(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))}),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}(),M=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 M(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=this,n=0;n<t.length;n++)!function(n){var a=t[n],s=null!=r.parent.taskFields.child?r.parent.taskFields.child:r.parent.taskFields.child="Children",o=a&&a[r.parent.taskFields.resourceInfo],l=r.parent.resourceFields.id;a[s]&&0!==a[s].length||!o||!o.length?(!a[s]||a[s]&&0===a[s].length)&&i.push(a):o.forEach(function(t){for(var i="object"==typeof t?t[l]:t,r=0;r<e.length;r++)if(e[r][l].toString()===i.toString()){e[r][s]?e[r][s].push(a):e[r][s]=[a];break}}),a[r.parent.taskFields.child]&&a[r.parent.taskFields.child].length&&r.constructResourceViewDataSource(e,a[r.parent.taskFields.child],i)}(n)},i.prototype.prepareDataSource=function(e){this.prepareRecordCollection(e,0),this.parent.initialLoadData=t.extend({},{},this.parent.flatData,!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=this,t=0;t<this.parent.getTaskIds().length;t++)!function(t){var i=[];if(i[0]=e.parent.getTaskIds()[t][0],i[1]=e.parent.getTaskIds()[t].slice(1),"R"!==i[0]){var r=[],n=[];e.parent.flatData.filter(function(e){e.ganttProperties.taskId.toString()===i[1]&&0!==e.level&&(n.push(e.ganttProperties.rowUniqueID),r.push(e))});for(var a=0;a<r.length;a++)r[a].ganttProperties.sharedTaskUniqueIds=n}}(t)},i.prototype.prepareRecordCollection=function(e,i,r){for(var n=this,a=e.length,s=this,o=0;o<a;o++)!function(a){var o=e[a];if(!t.isNullOrUndefined(s.parent.taskFields.segmentId)){var l=s.segmentCollection.filter(function(e){return e.key===o[n.parent.taskFields.id]});l.length>0&&(o[s.parent.taskFields.segments]=l[0].items)}var d=s.createRecord(o,i,r,!0);s.parent.enableValidation&&s.parent.autoCalculateDateScheduling||s.updateTaskLeftWidth(d),d.index=s.recordIndex++,s.parent.ids[d.index]=d.ganttProperties.rowUniqueID,s.parent.flatData.push(d),s.parent.setTaskIds(d);var p=o[s.parent.taskFields.child];if("ResourceView"===s.parent.viewType&&t.isNullOrUndefined(p)&&t.isNullOrUndefined(d.parentItem)&&0===d.level){var h=d.ganttProperties,c=d;s.parent.setRecordValue(h.isAutoSchedule?"startDate":"autoStartDate",null,c.ganttProperties,!0),s.parent.setRecordValue(h.isAutoSchedule?"endDate":"autoEndDate",null,c.ganttProperties,!0);var u=c.ganttProperties;s.parent.setRecordValue("isMilestone",!1,u,!0),u.isAutoSchedule&&s.calculateDuration(c),s.updateWorkWithDuration(c);var g=u.work;s.parent.setRecordValue("work",g,u,!0),s.parent.setRecordValue("taskType","FixedDuration",u,!0),t.isNullOrUndefined(s.parent.taskFields.type)||s.updateMappingData(c,"type"),s.parent.setRecordValue("progress",Math.floor(0),u,!0),s.parent.setRecordValue("totalProgress",0,u,!0),s.parent.setRecordValue("totalDuration",0,u,!0),u.isAutoSchedule||(s.parent.setRecordValue("autoDuration",s.calculateAutoDuration(u),u,!0),s.updateAutoWidthLeft(c)),s.parent.allowParentDependency||s.resetDependency(c),s.updateWidthLeft(c),s.updateTaskData(c)}!t.isNullOrUndefined(p)&&p.length>0&&s.prepareRecordCollection(p,d.level+1,d)}(o)},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])||"ResourceView"===this.parent.viewType&&0==i)&&"Unassigned Task"!==e[s.name]?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()||!t.isNullOrUndefined(y.baselineStartDate)&&!t.isNullOrUndefined(y.startDate)&&y.baselineStartDate.getTime()===y.startDate.getTime()&&!t.isNullOrUndefined(g)&&!t.isNullOrUndefined(y.endDate)&&g.toLocaleDateString()===y.endDate.toLocaleDateString()&&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.parent.allowParentDependency||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_","");"ResourceView"===this.parent.viewType&&"string"==typeof f.ganttProperties.taskId&&(w=y.taskId.toString()),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),t.isNullOrUndefined(a[a.length-1])||this.parent.setRecordValue("endDate",a[a.length-1].endDate,e.ganttProperties,!0),t.isNullOrUndefined(n.endDate)||t.isNullOrUndefined(a[a.length-1])||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||t.isNullOrUndefined(i[n.segments])&&t.isNullOrUndefined(e.taskData)?null:i[n.segments]||e.taskData[n.segments],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(this.parent.autoCalculateDateScheduling||(t.isNullOrUndefined(e.ganttProperties.startDate)||(e[this.parent.taskFields.startDate]=e.ganttProperties.startDate,e.taskData[this.parent.taskFields.startDate]=e.ganttProperties.startDate),t.isNullOrUndefined(e.ganttProperties.endDate)||(e[this.parent.taskFields.endDate]=e.ganttProperties.endDate,e.taskData[this.parent.taskFields.endDate]=e.ganttProperties.endDate)),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,r):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=!t.isNullOrUndefined(a)||!this.parent.allowUnscheduledTasks):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,i){var r=new Date(e.getTime()),n=new Date(t.getTime()),a="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,s=!1,o=new Date(e.getTime()),l=0;i&&"hour"==i.durationUnit&&(o=new Date(o.getTime()+60*i.duration*60*1e3)),i&&"minute"==i.durationUnit&&(o=new Date(o.getTime()+60*i.duration*60*60*1e3));for(var d=0;d<this.parent.dayWorkingTime.length;d++)l=l+this.parent.dayWorkingTime[d].to-this.parent.dayWorkingTime[d].from;var p=o.getTime()-r.getTime();return"Day"===a?((Math.floor(p/36e5%24)>=l||0===p)&&(s=!0),this.getSecondsInDecimal(r)===this.parent.defaultStartTime&&s&&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)):s=!0,r.getTime()===n.getTime()?this.parent.perDayWidth:s?this.getTimeDifference(r,n)/864e5*this.parent.perDayWidth:this.getTimeDifference(r,n)/(36e5*l)*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):this.getSecondsInDecimal(i)===this.parent.defaultEndTime&&this.parent.allowUnscheduledTasks&&i.setHours(22));var r=this.parent.timelineModule.timelineStartDate;return r?(i.getTime()-r.getTime())/864e5*this.parent.perDayWidth:0},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=0;d<r.length;d++)!function(e){i.filter(function(t){t[n.id]===r[e][n.id]&&l.push(r[e])})}(d);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.setDataSource=function(e){for(var i=[],r=e.length,n=0;n<r;n++){var a=e[n];i.push(a),t.isNullOrUndefined(e[n][this.parent.taskFields.child])||this.setDataSource(e[n][this.parent.taskFields.child])}return i},i.prototype.setStartDate=function(e){var i=this;(t.isNullOrUndefined(this.parent.taskFields.parentID)||t.isNullOrUndefined(this.parent.taskFields.id)?this.parent.dataSource:this.setDataSource(this.parent.dataSource)).map(function(r){e.ganttProperties.taskId===r[i.parent.taskFields.id]&&(t.isNullOrUndefined(i.parent.taskFields.startDate)||(e[i.parent.taskFields.startDate]=r[i.parent.taskFields.startDate]),t.isNullOrUndefined(i.parent.taskFields.endDate)||(e[i.parent.taskFields.endDate]=r[i.parent.taskFields.endDate]))})},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.isLoad||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.isLoad||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.isLoad||this.parent.setRecordValue("taskData."+i.notes,r.notes,e),this.parent.setRecordValue(i.notes,r.notes,e)),i.cssClass&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.cssClass,r.cssClass,e),this.parent.setRecordValue(i.cssClass,r.cssClass,e)),i.indicators&&(this.parent.isLoad||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.isLoad||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.isLoad||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])&&"string"==typeof i&&(i=i.split(","));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.name,s=this.parent.resourceFields.unit,o=this.parent.resourceFields.group,l=[],d=0;d<i.length;d++)!function(e){var d=r.filter(function(t){return"object"==typeof i[e]&&i[e][n]===t[n]||(i[e]===t[n]||i[e]===t[a])}),p=t.extend({},d[0]);l.push(p),t.isNullOrUndefined(s)||t.isNullOrUndefined(i[e][s])||(p[s]=i[e][s]),t.isNullOrUndefined(o)||t.isNullOrUndefined(i[e][o])||(p[o]=i[e][o])}(d);return this.updateResourceUnit(l),l},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=[],n=this.parent.taskFields;if(i){var a=i.length,s=t.extend([],[],e.taskData[this.parent.taskFields.resourceInfo],!0);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e);for(var o=0;o<a;o++){var l=i[o],d=l[this.parent.resourceFields.name],p=l[this.parent.resourceFields.unit];if(100!==p&&(d+="["+p+"%]"),r.push(d),e.taskData){var h=n.resourceInfo;s[o],e.taskData[h].push(s[o])}}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.parent.isLoad&&this.setStartDate(i),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)return void(e.ganttProperties.workTimelineRanges=[]);i=this.setSortedChildTasks(e),this.updateOverlappingIndex(i);for(var n=1;n<i.length;n++){t=i[n];for(var a=new Date(t.ganttProperties.startDate.getTime()),s=new Date(t.ganttProperties.endDate.getTime()),o=[],l=0;l<n;l++){var d=i[l].ganttProperties.startDate,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.parent.autoCalculateDateScheduling||this.updateWidthLeft(e),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(t),t,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(t),t,!0);var i,r=[];e.parentItem&&(r=(i=this.parent.getParentTask(e.parentItem)).childRecords),i&&r.indexOf(e)===r.length-1&&!e.hasChildRecords&&this.parent.enableValidation?((this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType)&&this.updateParentItems(i),this.parent.autoCalculateDateScheduling||this.updateWidthLeft(i)):i&&!this.parent.enableValidation&&this.updateWidthLeft(i)},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?e.ganttProperties.totalDuration:0,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(this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType){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),v[this.parent.taskFields.duration]<1?(p+=t.getValue("totalDuration",h),p=Number(p.toFixed(4))):p+=t.getValue("totalDuration",h)):g++,y+=v.ganttProperties.work}if(!n){var b=void 0,T=(b=this.parent.isOnDelete&&v.isDelete?d-g-1:d-g)>0&&p>0?Number((m/p).toFixed(2)):0,S=r.ganttProperties,P=!(0!==b||!c||!u||c.getTime()!==u.getTime());0!==this.compareDates(s,c)&&(this.parent.setRecordValue(a.isAutoSchedule?"startDate":"autoStartDate",c,r.ganttProperties,!0),(t.isNullOrUndefined(a.autoDuration)?0===a.duration:0===a.autoDuration)&&r.isManual&&P&&r.hasChildRecords&&r.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("startDate",c,r.ganttProperties,!0)),0!==this.compareDates(o,u)&&(this.parent.setRecordValue(a.isAutoSchedule?"endDate":"autoEndDate",u,r.ganttProperties,!0),(t.isNullOrUndefined(a.autoDuration)?0===a.duration:0===a.autoDuration)&&r.isManual&&P&&r.hasChildRecords&&r.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("endDate",u,r.ganttProperties,!0)),this.parent.setRecordValue("isMilestone",P,S,!0),S.isAutoSchedule&&this.calculateDuration(r),this.updateWorkWithDuration(r);var C=S.work;C=this.parent.isOnEdit?C:C+y,this.parent.setRecordValue("work",C,S,!0),this.parent.setRecordValue("taskType","FixedDuration",S,!0),t.isNullOrUndefined(this.parent.taskFields.type)||this.updateMappingData(r,"type"),this.parent.setRecordValue("progress",Math.floor(T),S,!0),this.parent.setRecordValue("totalProgress",m,S,!0),this.parent.setRecordValue("totalDuration",p,S,!0),S.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(S),S,!0),this.updateAutoWidthLeft(r)),this.parent.allowParentDependency||this.resetDependency(r),this.updateWidthLeft(r),this.updateTaskData(r)}}}else r.ganttProperties.endDate=r.taskData[this.parent.taskFields.endDate];n&&1===r.childRecords.length&&0===r.ganttProperties.duration&&(this.parent.setRecordValue("isMilestone",!0,r.ganttProperties,!0),this.updateWidthLeft(r),this.updateTaskData(r));var R=this.parent.getParentTask(r.parentItem);R&&(this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType)&&this.updateParentItems(R),n=!1},i}(R),x="e-timeline-single-header-outer-div",I="e-left-label-container",E="e-right-label-container",N="e-taskbar-main-container",F="e-task-label",U="e-gantt-child-progressbar-inner-div",V="e-baseline-bar",L="e-chart-row",B="e-child-progress-resizer",A="e-gantt-child-taskbar",H="e-gantt-manualparenttaskbar",W="e-label",j="e-gantt-dependency-view-container",q="e-connectorpoint-left",G=".e-content",z="e-rangecontainer",_=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),this.parent.treeGrid.grid.on("showGanttShimmer",this.updateShimmer,this),this.parent.treeGrid.grid.on("removeGanttShimmer",this.removeShimmer,this)},e.prototype.removeEventListeners=function(){t.EventHandler.remove(this.element,"scroll",this.onScroll),this.parent.off("grid-scroll",this.gridScrollHandler),this.parent.treeGrid.grid.off("showGanttShimmer",this.updateShimmer),this.parent.treeGrid.grid.off("removeGanttShimmer",this.removeShimmer)},e.prototype.gridScrollHandler=function(e){this.element.scrollTop=t.getValue("top",e),this.isFromTreeGrid=!0},e.prototype.updateTopPosition=function(){var e,i=this.parent.treeGrid.element.querySelector(".e-content").scrollTop;if(e=this.parent.virtualScrollModule&&this.parent.enableVirtualization?i-this.parent.virtualScrollModule.getTopPosition():i,!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.removeShimmer=function(){var e=this.parent;setTimeout(function(){if(e.hideMaskRow(),"ResourceView"===e.viewType&&!e.allowTaskbarOverlap&&e.showOverAllocation){for(var t=0;t<e.currentViewData.length;t++){var i=e.chartRowsModule.ganttChartTableBody.childNodes[t];"none"!==i.style.display&&e.currentViewData[t].hasChildRecords&&!e.currentViewData[t].expanded&&(e.treeGrid.getRowByIndex(t).style.height=i.style.height)}e.contentHeight=e.enableRtl?e.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:e.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=e.contentHeight+"px"}},0)},e.prototype.updateShimmer=function(){var e=this.parent;setTimeout(function(){e.showMaskRow()},0)},e.prototype.updateSpinner=function(){var e=this.parent;this.parent.showSpinner(),window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(function(){e.hideSpinner()},200)},e.prototype.onScroll=function(){var e={};this.element.scrollTop!==this.previousScroll.top&&(this.isFromTreeGrid?this.isFromTreeGrid=!1:this.parent.notify("chartScroll",{top:this.element.scrollTop}),e.previousScrollTop=this.previousScroll.top,this.previousScroll.top=this.element.scrollTop,e.scrollTop=this.element.scrollTop,e.scrollDirection="Vertical",e.action="VerticalScroll",this.updateTopPosition()),this.element.scrollLeft!==this.previousScroll.left&&(this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,e.previousScrollLeft=this.previousScroll.left,this.previousScroll.left=this.element.scrollLeft,e.scrollLeft=this.element.scrollLeft,e.scrollDirection="Horizontal",e.action="HorizontalScroll"),"Horizontal"===e.scrollDirection||t.isNullOrUndefined(e.scrollDirection)||!0!==this.parent.enableVirtualization||!this.parent.isToolBarClick&&!t.isNullOrUndefined(this.parent.isToolBarClick)||(this.parent.isVirtualScroll=!0,(this.parent.showIndicator||t.isNullOrUndefined(this.parent.showIndicator))&&!this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization&&"Spinner"===this.parent.loadingIndicator.indicatorType&&this.updateSpinner()),this.parent.isToolBarClick=!0,e.requestType="scroll",this.parent.trigger("actionComplete",e)},e.prototype.setHeight=function(e){this.element.style.height=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,t){t&&(e=-1===t&&this.parent.enableRtl?-e:e),this.element.scrollLeft=e,this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,this.previousScroll.left=this.element.scrollLeft},e.prototype.destroy=function(){this.removeEventListeners()},e}(),X=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}(),Y=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:z}),this.rangeViewContainer.setAttribute("role","RangeContainer"),this.virtualRender=new X(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("."+z);i&&(i.innerHTML=""),0===this.parent.treeGrid.grid.filterSettings.columns.length&&this.renderRangeContainer(this.parent.currentViewData)},e.prototype.renderChartElements=function(){if(this.parent.isFromOnPropertyChange)this.rangeViewContainer.innerHTML="",this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff),this.parent.isFromOnPropertyChange=!1;else{this.parent.chartRowsModule.renderChartRows(),this.parent.predecessorModule&&this.parent.taskFields.dependency&&(this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection()),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);for(var e=0;e<this.parent.chartRowsModule.ganttChartTableBody.children.length;e++)this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4]?(this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[2].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4].setAttribute("tabindex","-1")):"ProjectView"===this.parent.viewType?t.isNullOrUndefined(this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[1])||this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"):this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[0]&&this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[0].setAttribute("tabindex","-1");if(this.parent.enableCriticalPath){var i=this.parent.criticalPathModule;this.parent.criticalPathModule.criticalConnectorLine(i.criticalPathCollection,i.detailPredecessorCollection,this.parent.enableCriticalPath,i.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=0,n=this.parent.currentViewData.indexOf(i);r=!this.parent.allowTaskbarOverlap&&this.parent.enableMultiTaskbar?i.expanded?this.parent.getRowByIndex(n).offsetTop+this.parent.rowHeight:this.parent.getRowByIndex(n).offsetTop:this.getTopValue(i);var a=this.rangeViewContainer.querySelector(".rangeContainer"+i.ganttProperties.rowUniqueID);a&&a.remove();var s=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 o=0;o<e.length;o++){var l=void 0;l=this.parent.allowTaskbarOverlap||i.expanded||!this.parent.enableMultiTaskbar?this.getRangeHeight(i):parseInt(this.parent.chartRowsModule.ganttChartTableBody.childNodes[n].style.height)-(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight);var d=t.createElement("div",{className:"e-rg-rangdiv e-leftarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[o].left+e[o].width-5:e[o].left)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px;\n height: "+(l+1)+"px; border-right: 0px"}),p=t.createElement("div",{className:"e-rg-rangdiv e-rightarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[o].left:e[o].left+e[o].width-5)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px; height: "+(l+1)+"px;\n border-left: 0px"});s.appendChild(d),s.appendChild(p),this.rangeViewContainer.appendChild(s)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.rangeViewContainer)}},e.prototype.renderTimelineContainer=function(){this.chartTimelineContainer=t.createElement("div",{className:"e-timeline-header-container"}),this.parent.enableRtl&&(this.chartTimelineContainer.style.borderLeftWidth="1px",this.chartTimelineContainer.style.borderRightWidth="0px"),this.chartTimelineContainer.setAttribute("role","presentation"),this.chartElement.appendChild(this.chartTimelineContainer)},e.prototype.renderBodyContainers=function(){this.chartBodyContainer=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 _(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.treeGrid.element.getElementsByClassName("e-virtualtrack")[0].style.height;var e=t.getValue("wrapper",this.parent.ganttChartModule.virtualRender),i=this.parent.treeGrid.element.getElementsByClassName("e-virtualtable")[0].style.transform;e.style.transform=i}},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),this.parent.editSettings.allowEditing&&this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length>0&&this.parent.treeGrid.endEdit()},e.prototype.ganttChartMouseClick=function(e){this.parent.autoFocusTasks&&this.scrollToTarget(e),this.parent.notify("chartMouseClick",e)},e.prototype.ganttChartMouseUp=function(e){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,this.parent.enableRtl?-1:0)},e.prototype.mouseUp=function(e){if(t.isNullOrUndefined(this.parent.editModule)||t.isNullOrUndefined(this.parent.editModule.taskbarEditModule)||this.parent.editModule.taskbarEditModule.removeFalseLine(!1),this.parent.allowRowDragAndDrop){var i=this.parent.element.querySelector(".e-ganttdrag");i&&i.remove()}this.isGanttElement||this.parent.notify("chartMouseUp",e),this.isGanttElement=!1},e.prototype.documentMouseUp=function(e){if(this.isGanttElement=!0,(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse"))&&!0===t.getValue("isEditCollapse",this.parent.treeGrid)&&t.setValue("isEditCollapse",!1,this.parent.treeGrid),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.parent.showIndicator=!0,t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.focusedElement&&!e.target.classList.contains("e-split-bar")&&(this.focusedElement.tabIndex=0===this.focusedElement.tabIndex?-1:this.focusedElement.tabIndex,t.removeClass([this.focusedElement],"e-active-container"))),!r){var n=e.target,a=e.target.classList.contains(N)||t.closest(e.target,"."+N);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){var n=e.target,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)),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."+N);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(){if(this.parent.connectorLineModule.dependencyViewContainer.innerHTML="",this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection),this.parent.enableCriticalPath&&this.parent.criticalPathModule){var e=this.parent.criticalPathModule;e.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds)}},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){if(!(t.isNullOrUndefined(e.gridRow)&&this.parent.enableVirtualization||t.isNullOrUndefined(e.chartRow))){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||t.isNullOrUndefined(e.chartRow))){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(var 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)||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)return void this.manageFocus(r,"remove",!0);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("data-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),i&&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)}}}},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"))return s=t.closest(e,".e-chart-row").rowIndex,o=i?this.getNextRowElement(s,i,!0):this.parent.treeGrid.grid.getRowByIndex(s),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)}(e.classList.contains("e-right-label-temp-container")||e.classList.contains("e-left-label-temp-container")||e.classList.contains("e-indicator-span"))&&("add"===i?(e.setAttribute("tabIndex","0"),t.addClass([e],"e-active-container"),e.focus()):(t.removeClass([e],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur())),"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(N)?e:t.closest(e,"div."+N),t.isNullOrUndefined(i))i=t.closest(e,"tr."+L),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}(),Z=function(){return(Z=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)},Q=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.isLoad&&(this.parent.timelineSettings=this.parent.currentZoomingLevel)},e.prototype.validateTimelineProp=function(){this.roundOffDays(),this.processTimelineProperty(),this.timelineWidthCalculation()},e.prototype.refreshTimeline=function(){this.initProperties(),this.processTimelineUnit(),this.parent.dataOperation.calculateProjectDates(),this.parent.isFromOnPropertyChange||this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff)},e.prototype.refreshTimelineByTimeSpan=function(){this.validateTimelineProp(),this.parent.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)):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)):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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),a.cancel||(n=a.timeline,this.changeTimelineSettings(n))},e.prototype.changeTimelineSettings=function(e){var i=this;this.isZoomToFit?this.isSingleTier="None"===this.customTimelineSettings.topTier.unit||"None"===this.customTimelineSettings.bottomTier.unit:this.isZoomIn||(this.isSingleTier="None"===e.topTier.unit||"None"===e.bottomTier.unit);var 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]:Z({},e[n]);else{var a="topTier"===n?"bottomTier":"topTier";"None"!=e.bottomTier.unit&&(i.customTimelineSettings[a]=Z({},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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()}},e.prototype.processZoomToFit=function(){this.isZoomToFit=!0,this.isZooming=!1,this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.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?e.perDayWidth<t.perDayWidth?1:-1:0});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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),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=["timelineViewMode","timelineUnitSize","weekStartDay","weekendBackground"],t={topTier:["unit","format","count","formatter"],bottomTier:["unit","format","count","formatter"]},i=["Year","Month","Week","Day","Hour","Minutes"];this.customTimelineSettings=this.customTimelineSettings?this.customTimelineSettings:this.extendFunction(this.parent.timelineSettings,e,t),-1===i.indexOf(this.customTimelineSettings.topTier.unit)&&-1===i.indexOf(this.customTimelineSettings.bottomTier.unit)?(this.customTimelineSettings.topTier.unit=-1!==i.indexOf(this.customTimelineSettings.timelineViewMode)?this.customTimelineSettings.timelineViewMode:"Week",this.customTimelineSettings.bottomTier.unit=5!==i.indexOf(this.customTimelineSettings.topTier.unit)?i[i.indexOf(this.customTimelineSettings.topTier.unit)+1]:"None"):-1!==i.indexOf(this.customTimelineSettings.topTier.unit)&&-1!==i.indexOf(this.customTimelineSettings.bottomTier.unit)&&i.indexOf(this.customTimelineSettings.topTier.unit)>i.indexOf(this.customTimelineSettings.bottomTier.unit)?this.customTimelineSettings.bottomTier.unit=this.customTimelineSettings.topTier.unit:(this.customTimelineSettings.topTier.unit=-1===i.indexOf(this.customTimelineSettings.topTier.unit)?"None":this.customTimelineSettings.topTier.unit,this.customTimelineSettings.bottomTier.unit=-1===i.indexOf(this.customTimelineSettings.bottomTier.unit)?"None":this.customTimelineSettings.bottomTier.unit),this.topTier=this.customTimelineSettings.topTier.unit,this.bottomTier=this.customTimelineSettings.bottomTier.unit,this.previousIsSingleTier=this.isSingleTier,this.isSingleTier="None"===this.topTier||"None"===this.bottomTier},e.prototype.processTimelineProperty=function(){this.customTimelineSettings.topTier.count="None"===this.topTier?1:this.validateCount(this.customTimelineSettings.topTier.unit,this.customTimelineSettings.topTier.count,"topTier"),this.customTimelineSettings.bottomTier.count="None"===this.customTimelineSettings.bottomTier.unit?1:this.validateCount(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.count,"bottomTier"),this.customTimelineSettings.bottomTier.format=this.validateFormat(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.format),this.customTimelineSettings.topTier.format=this.validateFormat(this.topTier,this.customTimelineSettings.topTier.format),this.customTimelineSettings.weekStartDay=this.customTimelineSettings.weekStartDay>=0&&this.customTimelineSettings.weekStartDay<=6?this.customTimelineSettings.weekStartDay:0,this.checkCurrentZoomingLevel()},e.prototype.calculateZoomingLevelsPerDayWidth=function(){for(var e=this.parent.zoomingLevels,t=0;t<e.length;t++){var i=this.getPerDayWidth(e[t].timelineUnitSize,e[t].bottomTier.count,e[t].bottomTier.unit);e[t].perDayWidth=i}},e.prototype.checkCurrentZoomingLevel=function(){var e="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.count:this.customTimelineSettings.topTier.count,t="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.unit:this.customTimelineSettings.topTier.unit,i="None"!==this.customTimelineSettings.bottomTier.unit?"bottomTier":"topTier",r=this.getCurrentZoomingLevel(t,e,i);return this.parent.toolbarModule&&(r===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):r===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),this.parent.currentZoomingLevel=this.parent.zoomingLevels[r],r},e.prototype.getCurrentZoomingLevel=function(e,t,i){var r,n,a,s,o;this.parent.zoomingLevels.length||(this.parent.zoomingLevels=this.parent.getZoomingLevels());var l=this.parent.zoomingLevels.filter(function(t){return"bottomTier"===i?t.bottomTier.unit===e:t.topTier.unit===e});if(0===l.length){var d=this.getClosestUnit(e,"",!1);l=this.parent.zoomingLevels.filter(function(e){return"bottomTier"===i?e.bottomTier.unit===d:e.topTier.unit===d})}for(var p=l.sort(function(e,t){return"bottomTier"===i?e.bottomTier.count&&t.bottomTier.count?e.bottomTier.count<t.bottomTier.count?1:-1:0:e.topTier.count&&t.topTier.count?e.topTier.count<t.topTier.count?1:-1:0}),h=0;h<p.length;h++){if(o=p[h],h===p.length-1){r=p[h].level;break}if(s=p[h+1],t>=o[""+i].count){n=p[h],r=(a=p.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count})).length>1?this.checkCollectionsWidth(a):a[0].level;break}if(t<o[""+i].count&&t>s[""+i].count){n=p[h+1],r=(a=p.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count})).length>1?this.checkCollectionsWidth(a):a[0].level;break}}return r},e.prototype.getClosestUnit=function(e,t,i){var r=["Year","Month","Week","Day","Hour","Minutes"],n=r.indexOf(e);return 0===n&&(i=!0),e=this.isZoomIn||i?r[n+1]:r[n-1],0===this.parent.zoomingLevels.filter(function(t){return t.bottomTier.unit===e}).length?("Year"===e&&(i=!0),t=e,this.getClosestUnit(e,t,i)):e},e.prototype.checkCollectionsWidth=function(e){for(var t,i,r,n=e,a=this.customTimelineSettings.timelineUnitSize,s=n.sort(function(e,t){return e.timelineUnitSize<t.timelineUnitSize?1:-1}),o=0;o<s.length;o++){if(r=s[o],o===s.length-1){t=s[o].level;break}if(i=s[o+1],a>=r.timelineUnitSize){t=s[o].level;break}if(a<r.timelineUnitSize&&a>i.timelineUnitSize){t=s[o+1].level;break}}return t},e.prototype.updateTimelineHeaderHeight=function(){if(this.parent.timelineModule.isSingleTier?(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: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 i="None"===this.topTier?this.bottomTier:this.topTier,r=new Date(e.toString());return this.parent.isTimelineRoundOff&&("Hour"===i?r.setMinutes(60):"Minutes"===i?r.setSeconds(60):r.setHours(24,0,0,0)),t.isNullOrUndefined(this.parent.projectEndDate)&&this.updateTimelineAfterZooming(r,!1),r},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)&&(l<this.timelineStartDate||!t.isNullOrUndefined(this.parent.editModule.taskbarEditModule)&&!t.isNullOrUndefined(this.parent.editModule.taskbarEditModule.taskBarEditAction))&&(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}(),K=function(){function e(e){this.allowEditing=!0,this.allowReordering=!0,this.allowResizing=!0,this.allowSorting=!0,this.allowFiltering=!0,this.edit={},t.merge(this,e)}return e}(),J=function(){function e(e){var i=this;this.previousScroll={top:0,left:0},this.queryCellInfo=function(e){i.parent.trigger("queryCellInfo",e)},this.headerCellInfo=function(e){i.parent.trigger("headerCellInfo",e)},this.rowDataBound=function(e){i.parent.trigger("rowDataBound",e)},this.columnMenuOpen=function(e){i.parent.notify("columnMenuOpen",e),i.parent.trigger("columnMenuOpen",e),document.querySelector(".e-colmenu").addEventListener("mousemove",function(e){var r=document.querySelector(".e-filter-popup"),n=document.querySelector(".e-filter-item");t.isNullOrUndefined(r)||n.classList.contains("e-focused")||t.remove(i.parent.filterModule.filterMenuElement)})},this.columnMenuClick=function(e){i.parent.trigger("columnMenuClick",e)},this.objectEqualityChecker=function(e,t){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]])!==(t[r[s]]instanceof Date?new Date(t[r[s]]).getTime():t[r[s]])&&-1===a.indexOf(r[s])){i.parent.modifiedRecords.push(t),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["${enableHtmlSanitizer}"]=this.parent.enableHtmlSanitizer,this.parent.treeGrid.enableImmutableMode=this.parent.enableImmutableMode,this.treeGridColumns=[],!this.parent.isLocaleChanged&&this.parent.isLoad&&(this.parent.previousGanttColumns=t.extend([],[],this.parent.columns,!0)),this.validateGanttColumns(),this.parent.isLocaleChanged&&(this.parent.isLocaleChanged=!1),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createContainer,this),this.parent.on("chartScroll",this.updateScrollTop,this),this.parent.on("destroy",this.destroy,this),this.parent.treeGrid.on("renderReactTemplate",this.renderReactTemplate,this)},e.prototype.renderReactTemplate=function(e){this.parent.portals=e,this.parent.renderTemplates()},e.prototype.createContainer=function(){this.treeGridElement=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.enableRtl=this.parent.enableRtl,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.treeGrid.loadingIndicator=this.parent.loadingIndicator,this.parent.treeGrid.enableVirtualMaskRow=this.parent.enableVirtualMaskRow,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;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||this.parent.toolbarModule.element.offsetHeight,this.parent.treeGrid.height=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].offsetHeight-19},e.prototype.getContentDiv=function(){return this.treeGridElement.querySelector(".e-content")},e.prototype.getHeaderDiv=function(){return this.treeGridElement.querySelector(".e-headercontent")},e.prototype.getScrollbarWidth=function(){var e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar";var t=document.createElement("div");e.appendChild(t),this.parent.element.appendChild(e);var i=e.offsetWidth-t.offsetWidth;return e.parentNode.removeChild(e),i},e.prototype.ensureScrollBar=function(){var e=this.getContentDiv(),t=this.getHeaderDiv(),i=this.getScrollbarWidth(),r=/Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);0!==i?e.style.cssText+="width: calc(100% + "+(i+1)+"px);":e.classList.add("e-gantt-scroll-padding"),0===i&&r&&(t.style.cssText+="width: calc(100% + 17px);")},e.prototype.bindEvents=function(){this.parent.treeGrid.dataBound=this.dataBound.bind(this),this.parent.treeGrid.collapsing=this.collapsing.bind(this),this.parent.treeGrid.collapsed=this.collapsed.bind(this),this.parent.treeGrid.expanding=this.expanding.bind(this),this.parent.treeGrid.expanded=this.expanded.bind(this),this.parent.treeGrid.actionBegin=this.actionBegin.bind(this),this.parent.treeGrid.actionComplete=this.treeActionComplete.bind(this),this.parent.treeGrid.created=this.created.bind(this),this.parent.treeGrid.actionFailure=this.actionFailure.bind(this),this.parent.treeGrid.queryCellInfo=this.queryCellInfo.bind(this),this.parent.treeGrid.headerCellInfo=this.headerCellInfo.bind(this),this.parent.treeGrid.rowDataBound=this.rowDataBound.bind(this),this.parent.treeGrid.columnMenuOpen=this.columnMenuOpen.bind(this),this.parent.treeGrid.columnMenuClick=this.columnMenuClick.bind(this),this.parent.treeGrid.beforeDataBound=this.beforeDataBound.bind(this),this.parent.treeGrid.dataStateChange=this.dataStateChange.bind(this)},e.prototype.beforeDataBound=function(e){this.parent.updatedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?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.parent.isVirtualScroll&&((this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization||this.parent.enableVirtualization&&!this.parent.enableVirtualMaskRow&&"Shimmer"===this.parent.loadingIndicator.indicatorType||"Shimmer"===this.parent.loadingIndicator.indicatorType)&&this.parent.hideMaskRow(),this.parent.isVirtualScroll=!1),this.prevCurrentView=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 i=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.collapsedGanttRow(i),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&i.gridRow&&(i.gridRow.style.height=i.chartRow.style.height,this.parent.contentHeight=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.expanded=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod&&!e.data.length){var i=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.expandedGanttRow(i),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&e.row&&(e.row.style.height=this.parent.rowHeight+"px",this.parent.contentHeight=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},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),"virtualscroll"!=e.requestType&&"edit"!=e.type&&"beginEdit"!=e.requestType&&(t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow())},e.prototype.created=function(e){this.updateKeyConfigSettings()},e.prototype.actionFailure=function(e){this.parent.trigger("actionFailure",e)},e.prototype.createExpandCollapseArgs=function(e){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={}}if("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),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation){for(var n=0;n<this.parent.currentViewData.length;n++)this.parent.currentViewData[n].hasChildRecords&&!this.parent.currentViewData[n].expanded&&this.parent.chartRowsModule.updateDragDropRecords(this.parent.currentViewData[n]);this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.updateKeyConfigSettings=function(){delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.delete,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.insert,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlHome,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlEnd,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.shiftTab,delete this.parent.treeGrid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.keyboardModule.keyConfigs.shiftTab},e.prototype.wireEvents=function(){var e=this.parent.treeGrid.element.querySelector(".e-content");e&&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=this,s=0;s<i;s++)!function(t){var i={};"string"==typeof e.columns[t]?i.field=e.columns[t]:i=e.columns[t];var s=[];if(n.length>0&&(s=n.filter(function(e){return i.field===r[e]})),0===s.length)return i.field===a.parent.resourceFields.group?"continue":(a.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",a.bindTreeGridColumnProperties(i,!0),"continue");var o=n.indexOf(s[0]);n.splice(o,1),a.createTreeGridColumn(i,!0),a.parent.columnMapping[s[0]]=i.field}(s);for(var o=0;o<n.length;o++){l={};t.isNullOrUndefined(r[n[o]])||(l.field=r[n[o]],this.createTreeGridColumn(l,0===i),this.parent.columnMapping[n[o]]=l.field)}if("ProjectView"!==this.parent.viewType){var l={};this.composeUniqueIDColumn(l),this.createTreeGridColumn(l,!0)}},e.prototype.createTreeGridColumn=function(e,i){var r=this.parent.taskFields,a=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];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)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("name"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("name"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type=e.type?e.type:"string";else if(r.startDate===e.field)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("startDate"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("startDate"),e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.width=e.width?e.width:150,e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.endDate===e.field)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("endDate"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("endDate"),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.width=e.width?e.width:150,e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.duration===e.field)e.width=e.width?e.width:150,this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("duration"):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=e.type?e.type:"string";else if(r.progress===e.field)this.composeProgressColumn(e);else if(r.dependency===e.field)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("dependency"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("dependency"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type="string",e.allowFiltering=!1!==e.allowFiltering;else if(r.resourceInfo===e.field)this.composeResourceColumn(e);else if(r.notes===e.field)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("notes"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("notes"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",this.parent.showInlineNotes||e.template||(e.template='<div class="e-ganttnotes-info"><span class="e-icons e-notes-info"></span></div>');else if(r.baselineStartDate===e.field||r.baselineEndDate===e.field){var s=r.baselineEndDate===e.field?"baselineEndDate":"baselineStartDate";e.width=e.width?e.width:150,this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant(s):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant(s),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"}else r.work===e.field?(this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("work"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("work"),e.width=e.width?e.width:150,e.valueAccessor=e.valueAccessor?e.valueAccessor:this.workValueAccessor.bind(this),e.editType=e.editType?e.editType:"numericedit"):r.type===e.field?(this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("taskType"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskType"),e.width=e.width?e.width:150,e.editType="dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.taskTypeValueAccessor.bind(this)):r.manual===e.field&&"Custom"===this.parent.taskMode&&(this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("taskMode"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskMode"),e.width=e.width?e.width:120,e.editType=e.editType?e.editType:"dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.modeValueAccessor.bind(this),e.edit={params:{query:new 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){var t=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];this.parent.isLocaleChanged&&t?e.headerText=t.headerText?t.headerText:this.parent.localeObj.getConstant("resourceName"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("resourceName"),e.width=e.width?e.width:150,e.type="string",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.resourceValueAccessor.bind(this),e.allowFiltering=!1!==e.allowFiltering},e.prototype.getResourceIds=function(e){var 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 i,r="ProjectView"===this.parent.viewType,n=this.parent.dataSource.length;if(e.isPrimaryKey=!!r,this.parent.isLocaleChanged){var a=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];a&&(e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("id"))}else e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("id");e.width=e.width?e.width:100;for(var s=0;s<n;s++)if(!t.isNullOrUndefined(this.parent.dataSource[s][this.parent.taskFields.id])){i=this.parent.dataSource[s][this.parent.taskFields.id];break}"string"==typeof i||t.isNullOrUndefined(i)?("ResourceView"===this.parent.viewType?e.allowEditing=!!e.allowEditing&&e.allowEditing:e.allowEditing=!e.allowEditing||e.allowEditing,e.editType=e.editType?e.editType:"stringedit"):(e.allowEditing=!!e.allowEditing&&e.allowEditing,e.editType=e.editType?e.editType:"numericedit"),e.valueAccessor=r?null:this.idValueAccessor.bind(this)},e.prototype.composeUniqueIDColumn=function(e){e.field="rowUniqueID",e.isPrimaryKey=!0,e.headerText="UniqueID",e.allowEditing=!1,e.visible=!1},e.prototype.composeProgressColumn=function(e){var t=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];this.parent.isLocaleChanged&&t?e.headerText=t.headerText?t.headerText:this.parent.localeObj.getConstant("progress"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("progress"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"numericedit"},e.prototype.bindTreeGridColumnProperties=function(e,t){for(var i={},r={},n=0,a=Object.keys(e);n<a.length;n++){var s=a[n];i[s]=r[s]=e[s]}this.parent.columnByField[r.field]=r,this.parent.ganttColumns.push(new K(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){var i;i=t.getValue("top",e)>this.parent.flatData.length*this.parent.rowHeight?t.getValue("top",e)-document.getElementsByClassName("e-chart-scroll-container e-content")[0].offsetHeight:t.getValue("top",e),this.treeGridElement.querySelector(".e-content").scrollTop=i,this.previousScroll.top=this.treeGridElement.querySelector(".e-content").scrollTop},e.prototype.treeGridClickHandler=function(e){this.parent.notify("treeGridClick",e)},e.prototype.removeEventListener=function(){this.parent.off("renderPanels",this.createContainer),this.parent.off("chartScroll",this.updateScrollTop),this.parent.off("destroy",this.destroy),this.parent.treeGrid.off("reactTemplateRender",this.renderReactTemplate)},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.parent.treeGrid.element&&this.parent.treeGrid.destroy()},e}(),$=function(){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)}}(),ee=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},te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Property(null)],i.prototype,"from",void 0),ee([t.Property(null)],i.prototype,"to",void 0),i}(t.ChildProperty),ie=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)}}(),re=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},ne=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ie(i,e),re([t.Property(null)],i.prototype,"type",void 0),re([t.Property(null)],i.prototype,"headerText",void 0),re([t.Property([])],i.prototype,"fields",void 0),i}(t.ChildProperty),ae=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)}}(),se=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},oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"type",void 0),se([t.Property(null)],i.prototype,"headerText",void 0),se([t.Property([])],i.prototype,"fields",void 0),i}(t.ChildProperty),le=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)}}(),de=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},pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return le(i,e),de([t.Property(!1)],i.prototype,"allowEditing",void 0),de([t.Property(!1)],i.prototype,"allowAdding",void 0),de([t.Property(!1)],i.prototype,"allowDeleting",void 0),de([t.Property("Auto")],i.prototype,"mode",void 0),de([t.Property("Top")],i.prototype,"newRowPosition",void 0),de([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),de([t.Property(!1)],i.prototype,"allowTaskbarEditing",void 0),de([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),he=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)}}(),ce=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},ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),ce([t.Property(null)],i.prototype,"day",void 0),ce([t.Property(null)],i.prototype,"label",void 0),ce([t.Property(null)],i.prototype,"cssClass",void 0),i}(t.ChildProperty),ge=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)}}(),fe=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},me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ge(i,e),fe([t.Collection([],r.Predicate)],i.prototype,"columns",void 0),fe([t.Property("Menu")],i.prototype,"type",void 0),fe([t.Property()],i.prototype,"operators",void 0),fe([t.Property(!1)],i.prototype,"ignoreAccent",void 0),fe([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),ye=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)}}(),ve=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},De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ye(i,e),ve([t.Property([])],i.prototype,"fields",void 0),ve([t.Property(!1)],i.prototype,"ignoreCase",void 0),ve([t.Property("contains")],i.prototype,"operator",void 0),ve([t.Property("")],i.prototype,"key",void 0),ve([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),we=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)}}(),ke=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},be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),ke([t.Property(null)],i.prototype,"from",void 0),ke([t.Property(null)],i.prototype,"to",void 0),ke([t.Property(null)],i.prototype,"label",void 0),ke([t.Property(null)],i.prototype,"cssClass",void 0),i}(t.ChildProperty),Te=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)}}(),Se=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},Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),Se([t.Property(null)],i.prototype,"rightLabel",void 0),Se([t.Property(null)],i.prototype,"leftLabel",void 0),Se([t.Property(null)],i.prototype,"taskLabel",void 0),i}(t.ChildProperty),Ce=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)}}(),Re=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},Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ce(i,e),Re([t.Property("Row")],i.prototype,"mode",void 0),Re([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),Re([t.Property("Single")],i.prototype,"type",void 0),Re([t.Property(!1)],i.prototype,"persistSelection",void 0),Re([t.Property(!1)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Oe=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)}}(),xe=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},Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Oe(i,e),xe([t.Property(null)],i.prototype,"position",void 0),xe([t.Property(-1)],i.prototype,"columnIndex",void 0),xe([t.Property(4)],i.prototype,"separatorSize",void 0),xe([t.Property(null)],i.prototype,"minimum",void 0),xe([t.Property("Default")],i.prototype,"view",void 0),i}(t.ChildProperty),Ee=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)}}(),Ne=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},Fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ee(i,e),Ne([t.Property(null)],i.prototype,"id",void 0),Ne([t.Property(null)],i.prototype,"name",void 0),Ne([t.Property(null)],i.prototype,"parentID",void 0),Ne([t.Property(null)],i.prototype,"startDate",void 0),Ne([t.Property(null)],i.prototype,"endDate",void 0),Ne([t.Property(null)],i.prototype,"dependency",void 0),Ne([t.Property(null)],i.prototype,"progress",void 0),Ne([t.Property(null)],i.prototype,"child",void 0),Ne([t.Property(null)],i.prototype,"milestone",void 0),Ne([t.Property(null)],i.prototype,"duration",void 0),Ne([t.Property(null)],i.prototype,"durationUnit",void 0),Ne([t.Property(null)],i.prototype,"cssClass",void 0),Ne([t.Property(null)],i.prototype,"baselineStartDate",void 0),Ne([t.Property(null)],i.prototype,"baselineEndDate",void 0),Ne([t.Property(null)],i.prototype,"resourceInfo",void 0),Ne([t.Property(null)],i.prototype,"expandState",void 0),Ne([t.Property(null)],i.prototype,"indicators",void 0),Ne([t.Property(null)],i.prototype,"notes",void 0),Ne([t.Property(null)],i.prototype,"work",void 0),Ne([t.Property(null)],i.prototype,"manual",void 0),Ne([t.Property(null)],i.prototype,"type",void 0),Ne([t.Property(null)],i.prototype,"segments",void 0),Ne([t.Property(null)],i.prototype,"segmentId",void 0),i}(t.ChildProperty),Ue=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)}}(),Ve=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},Le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),Ve([t.Property("")],i.prototype,"format",void 0),Ve([t.Property("None")],i.prototype,"unit",void 0),Ve([t.Property(1)],i.prototype,"count",void 0),Ve([t.Property(null)],i.prototype,"formatter",void 0),i}(t.ChildProperty),Be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),Ve([t.Property("Week")],i.prototype,"timelineViewMode",void 0),Ve([t.Complex({},Le)],i.prototype,"topTier",void 0),Ve([t.Complex({},Le)],i.prototype,"bottomTier",void 0),Ve([t.Property(33)],i.prototype,"timelineUnitSize",void 0),Ve([t.Property(0)],i.prototype,"weekStartDay",void 0),Ve([t.Property(null)],i.prototype,"weekendBackground",void 0),Ve([t.Property(!0)],i.prototype,"showTooltip",void 0),Ve([t.Property(!0)],i.prototype,"updateTimescaleView",void 0),i}(t.ChildProperty),Ae=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)}}(),He=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},We=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ae(i,e),He([t.Property(!0)],i.prototype,"showTooltip",void 0),He([t.Property()],i.prototype,"taskbar",void 0),He([t.Property()],i.prototype,"baseline",void 0),He([t.Property()],i.prototype,"connectorLine",void 0),He([t.Property()],i.prototype,"editing",void 0),i}(t.ChildProperty),je=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)}}(),qe=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},Ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return je(i,e),qe([t.Property()],i.prototype,"field",void 0),qe([t.Property()],i.prototype,"direction",void 0),i}(t.ChildProperty),ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return je(i,e),qe([t.Collection([],Ge)],i.prototype,"columns",void 0),qe([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),_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)}}(),Xe=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},Ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _e(i,e),Xe([t.Property(null)],i.prototype,"id",void 0),Xe([t.Property(null)],i.prototype,"name",void 0),Xe([t.Property(null)],i.prototype,"unit",void 0),Xe([t.Property(null)],i.prototype,"group",void 0),i}(t.ChildProperty),Ze=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)}}(),Qe=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},Ke=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ze(i,e),Qe([t.Property("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),Je=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)}}(),$e=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 Je(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"style="line-height:'+this.parent.rowHeight+"px;"+(this.parent.enableRtl?"right:":"left:")+this.getIndicatorleft(e.date)+'px;"><i class="'+e.iconClass+'"></i> </label>';return this.createDivElement(t)},i.prototype.getIndicatorleft=function(e){return e=this.parent.dateValidationModule.getDateFromFormat(e),this.parent.dataOperation.getTaskLeft(e,!1)},i.prototype.getChildTaskbarNode=function(e,i){var r,n=null,a=this.templateData;if(r=this.parent.enableRtl?"right:":"left:",this.childTaskbarTemplateFunction)n=this.childTaskbarTemplateFunction(t.extend({index:e},a),this.parent,"TaskbarTemplate",this.getTemplateID("TaskbarTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var s="",o="",l=void 0,d=void 0;a.ganttProperties.startDate&&a.ganttProperties.endDate&&a.ganttProperties.duration&&(l=this.createDivElement('<div class="e-gantt-child-taskbar-inner-div e-gantt-child-taskbar '+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualtaskbar")+'"style="width:'+a.ganttProperties.width+"px;height:"+this.taskBarHeight+'px;"></div>'),d=this.createDivElement('<div class="'+U+" e-gantt-child-progressbar "+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualprogressbar")+'" style="border-style:'+(a.ganttProperties.progressWidth?"solid;":"none;")+"width:"+a.ganttProperties.progressWidth+"px;height:100%;border-top-right-radius:"+this.getBorderRadius(a.ganttProperties)+"px;border-bottom-right-radius:"+this.getBorderRadius(a.ganttProperties)+'px;"></div>'));var p=t.createElement("div");if(this.taskLabelTemplateFunction&&!t.isNullOrUndefined(d)&&d.length>0){var h=this.taskLabelTemplateFunction(t.extend({index:e},a),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,d[0]);h&&h.length>0&&(t.append(h,p),s=p.innerHTML)}else{var c=this.parent.labelSettings.taskLabel;s="isCustomTemplate"===(s=this.getTaskLabel(c))?this.parent.labelSettings.taskLabel:s,this.parent.enableHtmlSanitizer&&"string"==typeof s&&(s=t.SanitizeHtmlHelper.sanitize(s))}-1===s.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(s=""),o=isNaN(parseInt(s))?'<span class="e-task-label" style="line-height:'+(this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(a.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="e-task-label" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"text-align:"+(this.parent.enableRtl?"right;":"left;"):"")+ +("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+ +("ResourceView"===this.parent.viewType?a.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;"></span>');var u=!t.isNullOrUndefined(a.ganttProperties.segments)&&a.ganttProperties.segments.length>0?this.splitTaskbar(a,s):a.ganttProperties.startDate&&a.ganttProperties.endDate&&a.ganttProperties.duration?o:!a.ganttProperties.startDate||a.ganttProperties.endDate||a.ganttProperties.duration?!a.ganttProperties.endDate||a.ganttProperties.startDate||a.ganttProperties.duration?!a.ganttProperties.duration||a.ganttProperties.startDate||a.ganttProperties.endDate?"":'<div class="'+U+" "+A+" e-gantt-unscheduled-taskbar "+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualtaskbar")+'"style="'+r+a.ganttProperties.left+"px; width:"+a.ganttProperties.width+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+U+" "+A+" e-gantt-unscheduled-taskbar-right "+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualtaskbar")+'"style="'+r+a.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+U+" "+A+" e-gantt-unscheduled-taskbar-left "+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualtaskbar")+'"style="'+r+a.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>';if(a.ganttProperties.startDate&&a.ganttProperties.endDate&&a.ganttProperties.duration&&(t.isNullOrUndefined(a.ganttProperties.segments)||!t.isNullOrUndefined(a.ganttProperties.segments)&&0===a.ganttProperties.segments.length)){if(""!==u&&!t.isNullOrUndefined(d)&&d.length>0){var g=this.createDivElement(u)[0];this.parent.disableHtmlEncode?g.innerText=s:g.innerHTML=s;var f=this.parent.labelSettings.taskLabel;f&&f.elementRef&&g.appendChild(p),d[0].appendChild(g),""!==d[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(f)&&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&&f&&!f.elementRef&&""!==p.innerHTML&&(d[0].querySelectorAll(".e-task-label")[0].textContent=f)}!t.isNullOrUndefined(l)&&l.length>0&&l[0].appendChild([].slice.call(d)[0]),n=l}else n=this.createDivElement(u)}return this.parent.enableRtl&&n[0]&&n[0].querySelector(".e-task-label")&&(n[0].querySelector(".e-task-label").style.marginLeft="15px",n[0].querySelector(".e-task-label").style.marginRight="8px",n[0].querySelector(".e-gantt-child-progressbar")&&(n[0].querySelector(".e-gantt-child-progressbar").style.textAlign="left")),n},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",i+='<div class="e-gantt-child-taskbar-inner-div '+(0===r?"e-segment-first":r===e.ganttProperties.segments.length-1?"e-segment-last":"e-segment-inprogress")+" "+A+' e-segmented-taskbar"style="width:'+n.width+"px;position: absolute;"+(this.parent.enableRtl?"right:":"left:")+n.left+"px;height:"+this.taskBarHeight+"px; overflow:"+a+';" data-segment-index = "'+r+'" aria-label = "'+this.generateSpiltTaskAriaLabel(n,e.ganttProperties)+'"> '+this.getSplitTaskbarLeftResizerNode()+'<div class="'+U+' e-gantt-child-progressbar " style="border-style:'+(n.progressWidth?"solid;":"none;")+"display:"+(n.progressWidth>=0?"block;":"none;")+"width:"+n.progressWidth+"px;height:100%;text-align:"+(this.parent.enableRtl?"left;":"right;")+"border-top-right-radius:"+this.getSplitTaskBorderRadius(n)+"px;border-bottom-right-radius:"+this.getSplitTaskBorderRadius(n)+'px;"><span class="'+F+'" 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="e-taskbar-left-resizer e-icon" style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;"></div>'},i.prototype.getSplitTaskbarRightResizerNode=function(e){var t=this.parent.isAdaptive?-2:-10;return'<div class="e-taskbar-right-resizer e-icon" style="'+(this.parent.enableRtl?"right:":"left:")+(e.width+t)+"px;height:"+this.taskBarHeight+'px;"></div>'},i.prototype.getSplitProgressResizerNode=function(e){var t=this.parent.enableRtl?e.progressWidth+8:e.progressWidth-6;return'<div class="e-child-progress-resizer" style="'+(this.parent.enableRtl?"right:":"left:")+t+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="e-progressbar-handler"><div class="e-progressbar-handler-element"></div><div class="e-progressbar-handler-after"></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.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),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)&&l.length>0&&(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="e-milestone-bottom '+(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="e-baseline-bar " role="term" style="margin-top:'+this.baselineTop+"px;"+(this.parent.enableRtl?"right:":"left:")+e.ganttProperties.baselineLeft+"px;width:"+e.ganttProperties.baselineWidth+"px;height:"+this.baselineHeight+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+'"></div>';return this.createDivElement(t)},i.prototype.getMilestoneBaselineNode=function(){var e=this.templateData,t=this.parent.renderBaseline?5:2,i='<div class="e-baseline-gantt-milestone-container " style="'+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.baselineLeft-this.milesStoneRadius)+"px;margin-top:"+(-Math.floor(this.parent.rowHeight-this.milestoneMarginTop)+t)+'px"><div class="e-baseline-gantt-milestone"><div class="e-baseline-gantt-milestone e-baseline-milestone-top" 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="e-baseline-gantt-milestone e-baseline-milestone-bottom" 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"),this.parent.enableHtmlSanitizer&&"string"==typeof a&&(a="isCustomTemplate"===(a=t.SanitizeHtmlHelper.sanitize(a))?n:a,r=this.getLableText(a,"e-left-label-inner-div")))}return r&&r.length>0&&("null"===r[0].data&&(r[0].data=""),t.append(r,i[0])),this.parent.enableRtl&&(i[0].style.paddingLeft="25px",i[0].style.paddingRight="0px"),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:W});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"),this.parent.enableHtmlSanitizer&&"string"==typeof a&&(a="isCustomTemplate"===(a=t.SanitizeHtmlHelper.sanitize(a))?n:a,r=this.getLableText(a,"e-right-label-inner-div")))}return r&&r.length>0&&("null"===r[0].data&&(r[0].data=""),t.append(r,i[0])),this.parent.enableRtl&&(i[0].style.marginLeft="0px",i[0].style.paddingRight="25px"),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="'+H+'" 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="'+H+" "+(e.ganttProperties.startDate?"e-gantt-unscheduled-taskbar-left":"e-gantt-unscheduled-taskbar-right")+'" 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="'+H+' 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="e-manualparent-main-container"style='+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-e.ganttProperties.autoLeft)+"px;width:"+e.ganttProperties.width+"px;height:"+t+"px;>"+i+(e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration||e.ganttProperties.duration?'<div class="e-gantt-manualparenttaskbar-left" style='+(this.parent.enableRtl?"margin-right:0px;":"")+'"height:'+(t/5+8)+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div><div class="e-gantt-manualparenttaskbar-right" style='+(this.parent.enableRtl?"margin-right:-8px;":"")+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.width-Math.floor((t/5+8)/5))+"px;height:"+(t/5+8)+"px;border-right-width:"+t/5+"px;border-bottom:"+t/5+"px solid transparent;></div></div>":""),n='<div class="e-gantt-manualparent-milestone" style="position:absolute;'+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-e.ganttProperties.autoLeft-this.milestoneHeight/2)+"px;width:"+2*this.milesStoneRadius+'px;"><div class="e-manualparent-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-manualparent-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>';return this.createDivElement(0!==e.ganttProperties.duration?r:n)},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)+' e-gantt-parent-taskbar" 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)+' e-gantt-parent-progressbar" 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,this.parent.enableHtmlSanitizer&&"string"==typeof a&&(a=t.SanitizeHtmlHelper.sanitize(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="e-task-label" style="line-height:'+(n.isManual&&n.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(n.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="e-task-label" style="line-height:'+(n.isManual&&n.hasChildRecords?Math.floor(.6*this.taskBarHeight):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;"></span>';var c=this.createDivElement(s)[0];this.parent.disableHtmlEncode?c.innerText=a:c.innerHTML=a;var 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 this.parent.enableRtl&&r[0]&&r[0].querySelector(".e-task-label")&&(r[0].querySelector(".e-task-label").style.marginLeft="15px",r[0].querySelector(".e-task-label").style.marginRight="8px",r[0].querySelector(".e-gantt-parent-progressbar")&&(r[0].querySelector(".e-gantt-parent-progressbar").style.textAlign="left")),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)+" "+L+'"style="display:'+this.getExpandDisplayProp(this.templateData)+";height:"+this.parent.rowHeight+'px;"><td class="e-chart-row-cell '+i+'"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="term" 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="e-taskbar-main-container '+this.parent.getUnscheduledTaskClass(e.ganttProperties)+" "+(e.ganttProperties.cssClass?e.ganttProperties.cssClass:"")+'" tabindex="-1" role="term" style="'+(!e.ganttProperties.isMilestone||t||e.hasChildRecords&&!e.ganttProperties.isAutoSchedule?"width:"+e.ganttProperties.width+"px;margin-top:"+this.taskBarMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(!e.hasChildRecords||e.ganttProperties.isAutoSchedule?e.ganttProperties.left:e.ganttProperties.autoLeft)+"px;height:"+this.taskBarHeight+"px;cursor:"+(e.ganttProperties.isAutoSchedule?"move;":"auto;"):"width:"+this.milestoneHeight+"px;height:"+this.milestoneHeight+"px;margin-top:"+this.milestoneMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-this.milestoneHeight/2)+"px;")+'"></div>';return this.createDivElement(i)},i.prototype.rightLabelContainer=function(){var e='<div class="'+(this.rightTaskLabelTemplateFunction?"e-right-label-container e-right-label-temp-container":E)+'" tabindex="-1" role="term" style="'+(this.parent.enableRtl?"right:":"left:")+this.getRightLabelLeft(this.templateData)+"px; height:"+(this.parent.rowHeight-2)+'px;"></div>';return this.createDivElement(e)},i.prototype.childTaskbarLeftResizer=function(){var e=-(this.parent.isAdaptive?12:2),t='<div class="e-taskbar-left-resizer e-icon"style="'+(this.parent.enableRtl?"right:":"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="e-taskbar-right-resizer e-icon"style="'+(this.parent.enableRtl?"right:":"left:")+(this.templateData.ganttProperties.width+e)+"px;height:"+this.taskBarHeight+'px;"></div>';return this.createDivElement(t)},i.prototype.childTaskbarProgressResizer=function(){var e=this.parent.enableRtl?this.templateData.ganttProperties.progressWidth+8:this.templateData.ganttProperties.progressWidth-6,t='<div class="e-child-progress-resizer"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="e-progressbar-handler"><div class="e-progressbar-handler-element"></div><div class="e-progressbar-handler-after"></div></div>';return this.createDivElement(t)},i.prototype.getLeftPointNode=function(){var e,t=this.templateData,i=-((this.parent.isAdaptive?14:2)+this.connectorPointWidth),r=-(this.connectorPointWidth+2),n=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2);e=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px";var a='<div class="e-left-connectorpoint-outer-div" style="'+(t.ganttProperties.isMilestone?"margin-top:"+n+"px;left:"+r+"px;":e+";left:"+i+"px;")+'"><div class="'+q+" "+this.parent.getUnscheduledTaskClass(t.ganttProperties)+'" style="width: '+this.connectorPointWidth+"px;"+(this.parent.enableRtl?"margin-right:2px;":"")+"height: "+this.connectorPointWidth+'px;">'+this.touchLeftConnectorpoint+"</div></div>";return this.createDivElement(a)},i.prototype.getRightPointNode=function(){var e,t=this.templateData,i=this.parent.isAdaptive?10:-2,r=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2);e=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px";var n='<div class="e-right-connectorpoint-outer-div" style="'+(t.ganttProperties.isMilestone?"left:"+(this.milestoneHeight-2)+"px;margin-top:"+r+"px;":"left:"+(t.ganttProperties.width+i)+"px;"+e+";")+'"><div class="e-connectorpoint-right '+this.parent.getUnscheduledTaskClass(t.ganttProperties)+'" style="width:'+this.connectorPointWidth+"px;height:"+this.connectorPointWidth+'px;">'+this.touchRightConnectorpoint+"</div></div>";return this.createDivElement(n)},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,e.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)}this.parent.ganttChartModule.updateLastRowBottomWidth()},i.prototype.createTaskbarTemplate=function(){var e,i=[].slice.call(this.ganttChartTableBody.querySelectorAll("tr"));this.ganttChartTableBody.innerHTML="";var r=[],n=this.parent.treeGridModule.prevCurrentView;if(this.refreshedTr=[],this.refreshedData=[],this.parent.enableImmutableMode&&n&&n.length>0&&this.isUpdated){for(var a={},s=[],o=this.parent.treeGrid.getPrimaryKeyFieldNames()[0],l=0;l<n.length;l++)s[l]=i[l],a[n[l][o]]=l;for(var d=0;d<this.parent.currentViewData.length;d++){var p=a[this.parent.currentViewData[d][o]],h=this.parent.modifiedRecords.indexOf(this.parent.currentViewData[d]);if(t.isNullOrUndefined(p)||-1!==h||this.parent.isFromRenderBaseline){g=this.getGanttChartRow(d,this.parent.currentViewData[d]);this.ganttChartTableBody.appendChild(g),this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[d]),this.refreshedData.push(this.parent.currentViewData[d])}else this.ganttChartTableBody.appendChild(s[p]);this.ganttChartTableBody.querySelectorAll("tr")[d].setAttribute("aria-rowindex",d.toString())}}else{var c=void 0;c=t.createElement("tbody",{id:this.parent.element.id+"GanttTaskTableBody"});for(l=0;l<this.parent.currentViewData.length;l++){var u=this.parent.currentViewData[l];"ResourceView"===this.parent.viewType&&((this.parent.editModule&&this.parent.editModule.isResourceTaskDeleted||this.parent.isFromOnPropertyChange)&&(this.parent.initialChartRowElements=this.parent.ganttChartModule.getChartRows(),this.parent.editModule.isResourceTaskDeleted=!1),!u.expanded&&this.parent.enableMultiTaskbar&&r.push(u));var g=this.getGanttChartRow(l,u);c.appendChild(g),this.parent.enableImmutableMode&&(this.refreshedTr.push(c.querySelectorAll("tr")[l]),this.refreshedData.push(this.parent.currentViewData[l])),this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.maintainSelectedRecords(parseInt(g.getAttribute("aria-rowindex"),10))}(e=this.ganttChartTableBody).replaceChildren.apply(e,c.childNodes)}if(this.parent.renderTemplates(),this.triggerQueryTaskbarInfo(),this.parent.modifiedRecords=[],"ResourceView"==this.parent.viewType&&this.parent.showOverAllocation&&this.updateOverlapped(),r.length)for(var f=0;f<r.length;f++)r[f].hasChildRecords&&(this.parent.isGanttChartRendered=!0,this.parent.chartRowsModule.refreshRecords([r[f]]));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();s[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),s[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID);var o;if(this.templateData.hasChildRecords||this.parent.allowParentDependency)this.parent.allowParentDependency&&(o=this.getLeftPointNode(),(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)&&s[0].appendChild([].slice.call(o)[0]));else{var l=this.getLeftPointNode();s[0].appendChild([].slice.call(l)[0])}if(this.templateData.hasChildRecords){var d=this.getParentTaskbarNode(e,s);if(!this.templateData.ganttProperties.isAutoSchedule){var p=this.getManualTaskbar();if(!t.isNullOrUndefined(p[0])){if(this.parent.allowParentDependency){p[0].appendChild([].slice.call(o)[0]);var h=this.getRightPointNode();p[0].appendChild([].slice.call(h)[0])}s[0].appendChild([].slice.call(p)[0])}}0!==this.templateData.ganttProperties.autoDuration&&!this.templateData.ganttProperties.isMilestone&&d&&d.length>0?t.append(d,s[0]):0===this.templateData.ganttProperties.duration&&this.templateData.ganttProperties.isMilestone&&this.templateData.ganttProperties.isAutoSchedule&&(c=this.getMilestoneNode(e,s))&&c.length>0&&t.append(c,s[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(t.isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate)||t.isNullOrUndefined(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||t.isNullOrUndefined(this.templateData.ganttProperties.baselineEndDate)||t.isNullOrUndefined(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.toLocaleDateString()!==this.templateData.ganttProperties.endDate.toLocaleDateString()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}else if(this.templateData.ganttProperties.isMilestone){var c=this.getMilestoneNode(e,s);c&&c.length>0&&s[0].appendChild([].slice.call(c)[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(t.isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate)||t.isNullOrUndefined(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||t.isNullOrUndefined(this.templateData.ganttProperties.baselineEndDate)||t.isNullOrUndefined(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.toLocaleDateString()!==this.templateData.ganttProperties.endDate.toLocaleDateString()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}else{var u=f(this.templateData.ganttProperties),g=null,m=null,y=null;if(!t.isNullOrUndefined(u)){(u||this.templateData.ganttProperties.duration)&&u&&(t.isNullOrUndefined(this.templateData.ganttProperties.segments)||this.templateData.ganttProperties.segments.length<=0)&&(g=this.childTaskbarProgressResizer(),y=this.childTaskbarLeftResizer(),m=this.childTaskbarRightResizer());var v=this.getChildTaskbarNode(e,s);if(y&&s[0].appendChild([].slice.call(y)[0]),v&&v.length>0)if(this.templateData.ganttProperties.segments&&this.templateData.ganttProperties.segments.length>0){var D=this.templateData.ganttProperties.segments.length,w=null;w=this.createDivElement('<div class="e-gantt-split-container-line"></div>'),s[0].appendChild([].slice.call(w)[0]);for(var k=0;k<D;k++)s[0].appendChild([].slice.call(v)[0])}else t.append(v,s[0]);g&&s[0].appendChild([].slice.call(g)[0]),m&&s[0].appendChild([].slice.call(m)[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(t.isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate)||t.isNullOrUndefined(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||t.isNullOrUndefined(this.templateData.ganttProperties.baselineEndDate)||t.isNullOrUndefined(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.toLocaleDateString()!==this.templateData.ganttProperties.endDate.toLocaleDateString()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}var b;this.parent.allowParentDependency&&(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)?(b=this.getRightPointNode(),s[0].appendChild([].slice.call(b)[0])):this.parent.allowParentDependency||(b=this.getRightPointNode(),s[0].appendChild([].slice.call(b)[0]));var T=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 S=void 0,P=void 0,C=this.templateData.ganttProperties.indicators,R=0;R<C.length;R++){if((S=this.getIndicatorNode(C[R]))[0].setAttribute("aria-label",C[R].name),C[R].name.indexOf("$")>-1||C[R].name.indexOf("#")>-1)P=this.templateCompiler(C[R].name)(t.extend({index:e},this.templateData),this.parent,"indicatorLabelText");else{var M=t.createElement("Text");M.innerHTML=C[R].name,this.parent.enableHtmlSanitizer&&"string"==typeof C[R].name&&(C[R].name=t.SanitizeHtmlHelper.sanitize(C[R].name),M.innerText=C[R].name),P=M.childNodes}S[0].appendChild([].slice.call(P)[0]),S[0].title=t.isNullOrUndefined(C[R].tooltip)?"":C[R].tooltip,n[0].childNodes[0].childNodes[0].appendChild([].slice.call(S)[0])}T&&T.length>0&&n[0].childNodes[0].childNodes[0].appendChild([].slice.call(T)[0]),t.isNullOrUndefined(r)||n[0].childNodes[0].childNodes[0].appendChild([].slice.call(r)[0]);var O=n[0].childNodes[0];return this.setAriaRowIndex(i,O),O},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,n=this,a=!t.isNullOrUndefined(i.ganttProperties.segments)&&i.ganttProperties.segments.length>0?e:e.querySelector("."+N);i.ganttProperties.segments&&i.ganttProperties.segments.length>0&&(r=e.parentElement.parentElement.parentElement);var s={data:i,rowElement:e,taskbarElement:a,taskbarType:i.hasChildRecords?"ParentTask":i.ganttProperties.isMilestone?"Milestone":"ChildTask"},o=this.getClassName(s);if("Milestone"===s.taskbarType)s.milestoneColor=a.querySelector(o[0])?getComputedStyle(a.querySelector(o[0])).borderBottomColor:null,s.baselineColor=e.querySelector(o[1])?getComputedStyle(e.querySelector(o[1])).borderBottomColor:e.querySelector("."+V)?getComputedStyle(e.querySelector("."+V)).backgroundColor:null;else if(a){var l=a.querySelector(o[0]),d=a.querySelector(o[1]);s.taskbarBgColor=t.isNullOrUndefined(l)?null:a.classList.contains(A)?getComputedStyle(a).backgroundColor:getComputedStyle(a.querySelector(o[0])).backgroundColor,s.taskbarBorderColor=t.isNullOrUndefined(l)?null:a.classList.contains(A)?getComputedStyle(a).backgroundColor:getComputedStyle(a.querySelector(o[0])).borderColor,s.progressBarBgColor=t.isNullOrUndefined(d)?null:a.classList.contains("e-gantt-child-progressbar")?getComputedStyle(a).backgroundColor:getComputedStyle(a.querySelector(o[1])).backgroundColor,s.baselineColor=r?r.querySelector("."+V)?getComputedStyle(r.querySelector("."+V)).backgroundColor:null:e.querySelector("."+V)?getComputedStyle(e.querySelector("."+V)).backgroundColor:null,s.taskLabelColor=a.querySelector("."+F)?getComputedStyle(a.querySelector("."+F)).color:null}r?(s.rightLabelColor=r.querySelector("."+E)&&r.querySelector("."+E).querySelector("."+W)?getComputedStyle(r.querySelector("."+E).querySelector("."+W)).color:null,s.leftLabelColor=r.querySelector("."+I)&&r.querySelector("."+I).querySelector("."+W)?getComputedStyle(r.querySelector("."+I).querySelector("."+W)).color:null):(s.rightLabelColor=e.querySelector("."+E)&&e.querySelector("."+E).querySelector("."+W)?getComputedStyle(e.querySelector("."+E).querySelector("."+W)).color:null,s.leftLabelColor=e.querySelector("."+I)&&e.querySelector("."+I).querySelector("."+W)?getComputedStyle(e.querySelector("."+I).querySelector("."+W)).color:null),this.parent.trigger("queryTaskbarInfo",s,function(e){n.updateQueryTaskbarInfoArgs(e,void 0,void 0)})},i.prototype.updateQueryTaskbarInfoArgs=function(e,t,i){var r,n=e.rowElement,a=e.taskbarElement,s=this.getClassName(e);e.data.ganttProperties.segments&&e.data.ganttProperties.segments.length>0&&(r=n.parentElement.parentElement.parentElement),"Milestone"===e.taskbarType?(a.querySelector(s[0])&&getComputedStyle(a.querySelector(s[0])).borderBottomColor!==e.milestoneColor&&(a.querySelector(s[0]).style.borderBottomColor=e.milestoneColor,a.querySelector(".e-milestone-bottom").style.borderTopColor=e.milestoneColor),n.querySelector(s[1])&&getComputedStyle(n.querySelector(s[1])).borderTopColor!==e.baselineColor&&(n.querySelector(s[1]).style.borderBottomColor=e.baselineColor,n.querySelector(".e-baseline-milestone-bottom").style.borderTopColor=e.baselineColor),n.querySelector("."+V)&&getComputedStyle(n.querySelector("."+V)).borderTopColor!==e.baselineColor&&(n.querySelector("."+V).style.backgroundColor=e.baselineColor)):a&&(a.querySelector(s[0])&&getComputedStyle(a.querySelector(s[0])).backgroundColor!==e.taskbarBgColor&&(a.querySelector(s[0]).style.backgroundColor=e.taskbarBgColor),a.querySelector(s[0])&&getComputedStyle(a.querySelector(s[0])).borderColor!==e.taskbarBorderColor&&(a.querySelector(s[0]).style.borderColor=e.taskbarBorderColor),a.querySelector(s[1])&&getComputedStyle(a.querySelector(s[1])).backgroundColor!==e.progressBarBgColor&&(a.querySelector(s[1]).style.backgroundColor=e.progressBarBgColor),a.classList.contains(A)&&getComputedStyle(a).backgroundColor!==e.taskbarBgColor&&(a.style.backgroundColor=e.taskbarBgColor),a.classList.contains(A)&&getComputedStyle(a).borderColor!==e.taskbarBorderColor&&(a.style.borderColor=e.taskbarBorderColor),a.classList.contains("e-gantt-child-progressbar")&&getComputedStyle(a).backgroundColor!==e.progressBarBgColor&&(a.style.backgroundColor=e.progressBarBgColor),a.querySelector("."+F)&&getComputedStyle(a.querySelector("."+F)).color!==e.taskLabelColor&&(a.querySelector("."+F).style.color=e.taskLabelColor),r?r.querySelector("."+V)&&getComputedStyle(r.querySelector("."+V)).backgroundColor!==e.baselineColor&&(r.querySelector("."+V).style.backgroundColor=e.baselineColor):n.querySelector("."+V)&&getComputedStyle(n.querySelector("."+V)).backgroundColor!==e.baselineColor&&(n.querySelector("."+V).style.backgroundColor=e.baselineColor)),r?(r.querySelector("."+I)&&r.querySelector("."+I).querySelector("."+W)&&getComputedStyle(r.querySelector("."+I).querySelector("."+W)).color!==e.leftLabelColor&&(r.querySelector("."+I).querySelector("."+W).style.color=e.leftLabelColor),r.querySelector("."+E)&&r.querySelector("."+E).querySelector("."+W)&&getComputedStyle(r.querySelector("."+E).querySelector("."+W)).color!==e.rightLabelColor&&(r.querySelector("."+E).querySelector("."+W).style.color=e.rightLabelColor)):(n.querySelector("."+I)&&n.querySelector("."+I).querySelector("."+W)&&getComputedStyle(n.querySelector("."+I).querySelector("."+W)).color!==e.leftLabelColor&&(n.querySelector("."+I).querySelector("."+W).style.color=e.leftLabelColor),n.querySelector("."+E)&&n.querySelector("."+E).querySelector("."+W)&&getComputedStyle(n.querySelector("."+E).querySelector("."+W)).color!==e.rightLabelColor&&(n.querySelector("."+E).querySelector("."+W).style.color=e.rightLabelColor))},i.prototype.getClassName=function(e){var t=[];return t.push("."+("ParentTask"===e.taskbarType?"e-gantt-parent-taskbar":"ChildTask"===e.taskbarType?A:"e-milestone-top")),t.push("."+("ParentTask"===e.taskbarType?"e-gantt-parent-progressbar":"ChildTask"===e.taskbarType?"e-gantt-child-progressbar":"e-baseline-milestone-top")),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.updateOverlapped=function(){for(var e=0;e<this.parent.treeGrid.parentData.length;e++)for(var i=this.parent.treeGrid.parentData[e].childRecords,r=0;r<i.length;r++){i[r+1]&&(i[r].ganttProperties.eOverlapped=void 0);for(var n=r+1;n<i.length;n++)i[n].ganttProperties.eOverlapped=void 0,i[r].ganttProperties.startDate.getTime()<i[n].ganttProperties.endDate.getTime()&&i[r].ganttProperties.endDate.getTime()>i[n].ganttProperties.startDate.getTime()?(i[n].ganttProperties.eOverlapped=!0,i[r].ganttProperties.eOverlapped=!0):(t.isNullOrUndefined(i[n].ganttProperties.eOverlapped)&&(i[n].ganttProperties.eOverlapped=!1),t.isNullOrUndefined(i[r].ganttProperties.eOverlapped)&&(i[r].ganttProperties.eOverlapped=!1))}},i.prototype.updateDragDropRecords=function(e,t){var i=e.childRecords,r=this.parent.currentViewData.indexOf(e),n=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight;t||(t=this.ganttChartTableBody.childNodes[r]),t.style.height=this.parent.treeGrid.getRowByIndex(r).style.height=this.parent.rowHeight+"px",this.parent.contentHeight=n;var a=[],s=0;if(e){for(var o=0;o<i.length;o++)for(var l=o+1;l<i.length;l++)for(var d=t.getElementsByClassName("e-taskbar-main-container"),p=0;p<d.length;p++)i[o].ganttProperties.startDate.getTime()<i[l].ganttProperties.endDate.getTime()&&i[o].ganttProperties.endDate.getTime()>i[l].ganttProperties.startDate.getTime()?d[p].getAttribute("rowuniqueid")===i[l].rowUniqueID&&-1==a.indexOf(i[l].rowUniqueID)&&(a.push(i[l].rowUniqueID),s++,t.children[0].style.verticalAlign="baseline",t.getElementsByClassName("e-taskbar-main-container")[p].style.marginTop=s*this.parent.rowHeight+this.taskBarMarginTop+"px",t.style.height=this.parent.treeGrid.getRowByIndex(r).style.height=parseInt(t.style.height)+this.parent.rowHeight+"px"):d[p].getAttribute("rowuniqueid")===i[l].rowUniqueID&&-1==a.indexOf(i[l].rowUniqueID)&&this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.draggedRecord&&d[p].getAttribute("rowuniqueid")===this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID&&this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID===i[l].rowUniqueID&&(t.getElementsByClassName("e-taskbar-main-container")[p].style.marginTop=this.parent.editModule.taskbarEditModule.draggedRecordMarginTop);this.parent.contentHeight=n,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px"}},i.prototype.refreshRow=function(e,i){var r=this.ganttChartTableBody.childNodes[e],n=this.parent.currentViewData[e];if(-1!==e&&n){var a=n;!this.parent.allowTaskbarOverlap&&"ResourceView"===this.parent.viewType&&a.expanded&&(r.style.height=this.parent.treeGrid.getRowByIndex(e).style.height=this.parent.rowHeight+"px"),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&!a.expanded&&this.parent.enableMultiTaskbar?r.replaceChild(this.getResourceParent(a).childNodes[0],r.childNodes[0]):"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&!a.expanded?r.replaceWith(this.getGanttChartRow(e,a)):r.replaceChild(this.getGanttChartRow(e,a).childNodes[0],r.childNodes[0]),this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&this.parent.showOverAllocation&&this.parent.allowTaskbarOverlap&&(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),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&!a.expanded&&this.parent.enableMultiTaskbar&&!this.parent.allowTaskbarOverlap&&this.updateDragDropRecords(n,r),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap&&this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);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);var h=this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[e].getAttribute("data-uid"));t.isNullOrUndefined(h)||(h.data=a)}},i.prototype.getResourceParent=function(e){var i=this.parent.ganttChartModule.getChartRows();if(this.parent.initialChartRowElements&&!this.parent.allowTaskbarDragAndDrop&&this.parent.allowTaskbarOverlap)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("."+N).getAttribute("rowUniqueId"),h=this.parent.getRecordByID(p),c="";h&&!t.isNullOrUndefined(h.ganttProperties.eOverlapIndex)&&(c=h.ganttProperties.eOverlapIndex.toString());var u=d.cloneNode(!0);u.style.zIndex=c,n[0].childNodes[0].childNodes[0].childNodes[0].appendChild(u)}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.generateBaselineAriaLabel=function(e){e=this.templateData;var t="",i=this.parent.localeObj.getConstant("name"),r=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),a=e.ganttProperties.taskName,s=e.ganttProperties.baselineStartDate,o=e.ganttProperties.baselineEndDate;return t+="Baseline ",t+=i+" "+a+" ",t+=r+" "+this.parent.getFormatedDate(s)+" ",t+=n+" "+this.parent.getFormatedDate(o)+" "},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}(R),et=function(){function e(e){this.parentRecord=[],this.parentIds=[],this.parentPredecessors=[],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.parent.allowParentDependency||this.parent.allowParentDependency)&&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=[];var l="ResourceView"===s.parent.viewType?s.parent.getTaskIds():s.parent.ids;-1!==("ResourceView"===s.parent.viewType?l.indexOf("T"+r[0]):l.indexOf(r[0]))?i[0]=r[0]:-1===l.indexOf(r[0])?1===(i=r[0].split(" ")).length&&(-1!=i[0].indexOf(" ")?i=r[0].match(/(\d+|[A-z]+)/g):(i[0]=r[0].slice(0,-2),i[1]=r[0].slice(-2))):i[0]=r[0];var d="ResourceView"===s.parent.viewType?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},g=s.checkIsParent(i[0]);if(s.parent.allowParentDependency){var f=s.parent.connectorLineModule.getRecordByID(u.to),m=s.parent.connectorLineModule.getRecordByID(u.from);s.parent.connectorLineEditModule&&m&&f?s.parent.connectorLineEditModule.validateParentPredecessor(m,f)&&o.push(u):o.push(u),i.splice(0)}else g||o.push(u)}}),o},e.prototype.getPredecessorStringValue=function(e){var i,r,n=e.ganttProperties.predecessor,a=this.parent.durationUnitTexts,s="";if(r=[],n)for(var o=n.length,l=0;l<o;l++){var d=n[l],p="",h="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(d.from!==h.toString()){if(p=d.from+d.type,"string"==typeof e.ganttProperties.taskId?(r[0]=p.slice(0,-2),r[1]=p.slice(-2),i=r[0]+" "+r[1]):i=p,p=i,0!==d.offset){p+=d.offset>0?"+"+d.offset+" ":d.offset+" ";var c=1!==d.offset;"day"===d.offsetUnit?p+=c?t.getValue("days",a):t.getValue("day",a):"hour"===d.offsetUnit?p+=c?t.getValue("hours",a):t.getValue("hour",a):p+=c?t.getValue("minutes",a):t.getValue("minute",a)}s=s.length>0?s+","+p:p}}return s},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.parent.allowParentDependency||this.parent.allowParentDependency)&&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(){if(this.parent.autoCalculateDateScheduling)for(var e=this.parent.flatData,t=this.parent.flatData.length,i=0;i<t;i++)e[i].ganttProperties.predecessorsName&&(this.validatePredecessorDates(e[i]),e[i].hasChildRecords&&this.parent.editModule&&!this.parent.allowUnscheduledTasks&&this.parent.allowParentDependency&&this.parent.editModule.updateChildItems(e[i]))},e.prototype.updateParentPredecessor=function(){if(this.parent.enablePredecessorValidation)for(var e=this.parentPredecessors.length-1;e>=0;e--){var t=this.parentPredecessors[e];this.validatePredecessorDates(t),t.ganttProperties.startDate&&this.parent.editModule.updateChildItems(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),this.parent.allowParentDependency&&this.parent.isLoad&&-1==this.parentPredecessors.indexOf(e)&&(e.hasChildRecords||n.hasChildRecords)&&this.parentPredecessors.push(e),(n.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)&&this.validateChildGanttRecord(r,n)}}},e.prototype.validateChildGanttRecord=function(e,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),!this.parent.isLoad&&!this.parent.isFromOnPropertyChange&&i.parentItem&&this.parent.isInPredecessorValidation&&this.parent.getParentTask(i.parentItem).ganttProperties.isAutoSchedule&&-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,!0):(r=this.dateValidateModule.getEndDate(e,n,a,i,!1),i.isMilestone||(r=this.dateValidateModule.checkStartDate(r,i))),r},e.prototype.createConnectorLinesCollection=function(e){var t,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){var r=this.parent.editModule.taskbarEditModule,n=void 0;r&&(n=r.taskBarEditRecord);for(var a=e.ganttProperties.predecessor,s=void 0,o=null,l=void 0,d=void 0,p="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),h=a.filter(function(e){return e.to===p?e:null}),c=a.filter(function(e){return e.from===p?e:null}),u=0;u<h.length;u++){l=h[u],s=this.parent.connectorLineModule.getRecordByID(l.from),o=this.parent.connectorLineModule.getRecordByID(l.to),this.parent.isInPredecessorValidation&&o.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1;var g="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;g.toString()!==l.to&&g.toString()!==l.from||i&&"predecessor"!==i||this.validateChildGanttRecord(s,o)}for(u=0;u<c.length;u++)d=c[u],s=this.parent.connectorLineModule.getRecordByID(d.from),o=this.parent.connectorLineModule.getRecordByID(d.to),this.parent.isInPredecessorValidation&&o.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1,"predecessor"!==i&&this.parent.isValidationEnabled&&this.validateChildGanttRecord(s,o),!1!==s.expanded&&o.expanded,o&&this.validatePredecessor(o,void 0,"successor");if(o&&o.ganttProperties.taskId!==this.isValidatedParentTaskID&&n){var f=!1,m=n.ganttProperties.predecessorsName?n.ganttProperties.predecessorsName.split(",").length:n.ganttProperties.predecessorsName,y=n.ganttProperties.predecessor?n.ganttProperties.predecessor.length:n.ganttProperties.predecessor;y&&m!==y?f=!0:o.hasChildRecords&&o.ganttProperties.predecessor.length>0&&n.hasChildRecords&&!n.ganttProperties.predecessor&&(f=!0),"ParentDrag"!==r.taskBarEditAction&&"ChildDrag"!==r.taskBarEditAction?!n.hasChildRecords&&o.hasChildRecords&&(this.parent.editModule.updateChildItems(o),this.isValidatedParentTaskID=o.ganttProperties.taskId):(o.hasChildRecords&&"ChildDrag"==r.taskBarEditAction||f&&"ParentDrag"==r.taskBarEditAction)&&(this.parent.editModule.updateChildItems(o),this.isValidatedParentTaskID=o.ganttProperties.taskId),n.hasChildRecords||this.parent.dataOperation.updateParentItems(o,!0)}else o&&o.hasChildRecords&&!n&&this.parent.editModule.updateChildItems(o)}},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}(),tt=function(){function e(e){this.expandedRecords=[],this.parent=e,this.dependencyViewContainer=t.createElement("div",{className:j}),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);if(n.parentIndexInCurrentView=p.indexOf(e),n.childIndexInCurrentView=p.indexOf(i),!(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);for(a=0;a<this.dependencyViewContainer.children.length;a++)this.dependencyViewContainer.children[a].children[0].setAttribute("tabindex","-1")},e.prototype.getParentPosition=function(e){if(e.parentIndex<e.childIndex){if("FF"===e.type)return e.childLeft+e.childWidth>=e.parentLeft+e.parentWidth?"FFType2":"FFType1";if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth+25){if("FS"===e.type)return"FSType1";if("SF"===e.type)return"SFType1";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType2"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.parentLeft>e.childLeft+e.childWidth+25&&"SF"===e.type)return"SFType2";if(e.parentLeft>e.childLeft){if("SS"===e.type)return"SSType1";if("SF"===e.type)return"SFType1";if("FF"===e.type)return"FFType1"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType2";if("FS"===e.type)return"FSType2";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType1";if("SF"===e.type)return"SFType1"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType2";if("FF"===e.type)return"FFType2";if("SS"===e.type)return"SSType2";if("SF"===e.type)return"SFType1"}}else if(e.parentIndex>e.childIndex)if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth){if("FS"===e.type)return 30>=e.childLeft-(e.milestoneParent?e.parentLeft+e.parentWidth+4:e.parentLeft+e.parentWidth)?"FSType3":"FSType4";if(e.parentLeft<e.childLeft||e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType4"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.childLeft+e.childWidth<=e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType3";if("SF"===e.type)return e.childLeft+e.childWidth+25<e.parentLeft?"SFType3":"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}if("FS"===e.type)return"FSType3"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType3";if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}return null},e.prototype.getHeightValue=function(e){return"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap?e.parentIndex*this.parent.rowHeight>e.childIndex*this.parent.rowHeight?e.parentIndex*this.parent.rowHeight-e.childIndex*this.parent.rowHeight:e.childIndex*this.parent.rowHeight-e.parentIndex*this.parent.rowHeight:e.parentIndex*e.rowHeight>e.childIndex*e.rowHeight?e.parentIndex*e.rowHeight-e.childIndex*e.rowHeight:e.childIndex*e.rowHeight-e.parentIndex*e.rowHeight},e.prototype.getInnerElementWidthSSType2=function(e){return e.parentLeft===e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getInnerElementLeftSSType2=function(e){return e.parentLeft===e.childLeft?e.parentLeft-20:e.parentLeft-10},e.prototype.getInnerChildWidthSSType2=function(e){return e.parentLeft+e.parentWidth<e.childLeft?10:e.parentLeft===e.childLeft?20:e.parentLeft+e.parentWidth>=e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getBorderStyles=function(e,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,u=0,g=0,f=0,m=0,y=0;if("ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap){for(var v=0;v<this.parent.currentViewData.length;v++)"none"!=this.parent.getRowByIndex(v).style.display&&y<e.parentIndex&&(y++,f+=this.parent.getRowByIndex(v).offsetHeight);y=0;for(var D=0;D<this.parent.currentViewData.length;D++)"none"!=this.parent.getRowByIndex(D).style.display&&y<e.childIndex&&(y++,m+=this.parent.getRowByIndex(D).offsetHeight);c=Math.abs(f-m)}if(this.parent.currentViewData[e.parentIndex]&&this.parent.currentViewData[e.childIndex]&&this.parent.allowParentDependency){var w=this.parent.currentViewData[e.parentIndex].hasChildRecords,k=this.parent.currentViewData[e.childIndex].hasChildRecords,b=this.parent.currentViewData[e.parentIndex].ganttProperties.isAutoSchedule,T=this.parent.currentViewData[e.childIndex].ganttProperties.isAutoSchedule,S=!0;(w&&b&&!k||k&&T&&!w||w&&b&&T&&k||!w&&!k)&&(S=!1),S&&(w&&!b&&k&&!T?g=-11:w&&!b&&k&&!T||(e.childIndex>e.parentIndex?!w&&k?u=-11:(u=11,g=-11):w&&!k?u=-11:(u=11,g=-11)),this.parent.currentViewData[e.parentIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(g=-5,u=10):"SS"!==e.type&&"FF"!==e.type||(g=-5):this.parent.currentViewData[e.childIndex].ganttProperties.isMilestone&&(e.parentIndex>e.childIndex?(g=5,u=-10):"SS"!==e.type&&"FF"!==e.type||(g=5)))}if(this.getParentPosition(e)){l='<div id="ConnectorLine'+e.connectorLineId+'" style="background-color:black">';var P='<div class="e-connector-line-container" tabindex="-1" style="',C=this.parent.enableRtl?"right:":"left:",R='<div class="e-line" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),M=void 0,O=void 0;this.parent.enableRtl?(O='<div class="e-connector-line-right-arrow" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),M='<div class="e-connector-line-left-arrow" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";")):(M='<div class="e-connector-line-right-arrow" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),O='<div class="e-connector-line-left-arrow" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"));var x=O+(o?this.parent.enableRtl?"right:0px;":"left:0px;":"")+this.getBorderStyles(this.parent.enableRtl?"left":"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>',I=this.getBorderStyles(this.parent.enableRtl?"right":"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>',E=this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>'+R+"top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-(this.lineStroke-1))+'position:relative;"></div>',N=O+(this.parent.enableRtl?"right:":"left:")+(e.childLeft+e.childWidth-e.parentLeft+10)+"px;"+this.getBorderStyles(this.parent.enableRtl?"left":"right",10),F="top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>';"FSType1"===this.getParentPosition(e)&&(P=P+C+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType1">',P=(P+=R)+C+(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>',P=(P+=R)+C+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:0px;"+this.getBorderStyles("right",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=M)+C+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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)&&(P=P+C+e.parentLeft+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType2">',P=(P+=R)+C+(s?e.parentWidth-1:e.parentWidth)+"px;width:"+(s?11:10)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(e.parentWidth+10-this.lineStroke)+"px;"+this.getBorderStyles("left",this.lineStroke)+"width:0px;"+this.getBorderStyles("top",c+u-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(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>',P=(P+=R)+C+(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>',P=(P+=R)+C+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=M)+C+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+10))+"px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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)&&(P=P+C+(e.childLeft-20)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType3">',P=(P+=M)+C+"10px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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>',P=(P+=R)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(6+(5+this.lineStroke)+Math.round(this.lineStroke/2))+'px;"></div>',P=(P+=R)+"width:"+this.lineStroke+"px;"+this.getBorderStyles("top",c+u-this.getconnectorLineGap(e)-this.lineStroke+1)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',P=(P+=R)+"width:"+(e.parentLeft+e.parentWidth-e.childLeft+30)+"px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',P=(P+=R)+C+(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>',P=(P+=R)+(s?C+(e.parentLeft+e.parentWidth-e.childLeft+(18-this.lineStroke))+"px;width:"+(12+this.lineStroke)+"px;":C+(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)&&(P=P+C+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType4">',P=(P+=M)+C+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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>',P=(P+=R)+C+(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>',P=(P+=R)+"top:"+-(13+2*(this.lineStroke-1))+"px;"+C+(e.childLeft-(e.parentLeft+e.parentWidth)-20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke+1)+'position:relative;"></div>',P=(P+=R)+(s?C+"-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)&&(P=P+C+(e.parentLeft-10)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType4">',P=(P+=M)+C+(e.childLeft-e.parentLeft)+"px;"+I,P=(P+=R)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:"+(e.childLeft-e.parentLeft)+"px;"+E,P=(P+=R)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SSType3"===this.getParentPosition(e)&&(P=P+C+(e.childLeft-20)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType3">',P=(P+=M)+C+"10px;"+I,P=(P+=R)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:10px;"+E,P=(P+=R)+"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)&&(P=P+C+n+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType2">',P=(P+=R)+"width:"+(i+1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:"+r+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=M)+C+r+"px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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)&&(P=P+C+(e.childLeft-20)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType1">',P=(P+=R)+"width:"+(e.parentLeft-e.childLeft+21)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=M)+C+"10px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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)&&(P=P+C+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType1">',P=(P+=R)+C+(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>',P=(P+=R)+C+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(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>',P=(P+=O)+(o?C+"0px;":"")+this.getBorderStyles(this.parent.enableRtl?"left":"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)&&(P=P+C+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType2">',P=(P+=R)+(s?C+"-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>',P=(P+=R)+C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(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>',P=(P+=O)+C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth))+"px;"+this.getBorderStyles(this.parent.enableRtl?"left":"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)&&(P=P+C+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType3">',P+=x,P=(P+=R)+(o?C+"4px;width:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+16):C+"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>',P=(P+=R)+C+(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+u-this.lineStroke+1)+'position:relative;"></div>',P=(P+=R)+(s?C+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)-1)+"px;width:21":C+(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)&&(P=P+C+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType4">',P=(P+=O)+(C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)))+"px;"+this.getBorderStyles(this.parent.enableRtl?"left":"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>',P=(P+=R)+(o?C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+4)+"px;width:"+(16+this.lineStroke):C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+10)+"px;width:"+(10+this.lineStroke))+"px;"+F,P=(P+=R)+C+(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+u-this.lineStroke+1)+'position:relative;"></div>',P=(P+=R)+(s?C+"-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)&&(P=(P=P+C+(e.parentLeft-10)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType4">')+N+"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>',P=(P+=R)+C+(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;"+F,P=(P+=R)+C+(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+u-this.getconnectorLineGap(e)-(this.lineStroke-1))+'position:relative;"></div>',P=(P+=R)+"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>',P=(P+=R)+"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>',P=(P+=R)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType3"===this.getParentPosition(e)&&(P=P+C+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType3">',P+=x,P=(P+=R)+(o?C+"4px;width:"+(16+this.lineStroke):C+"10px;width:"+(10+this.lineStroke))+"px;top:"+-(13+2*(this.lineStroke-1)-1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+"20px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-(this.lineStroke-1))+'position:relative;"></div>',P=(P+=R)+C+"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)&&(P=P+C+(e.parentLeft-10)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType1">',P=(P+=R)+"width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:"+(e.childLeft+e.childWidth-e.parentLeft+(30+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(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>',P=(P=(P+=R)+(o?C+(e.childLeft+e.childWidth-e.parentLeft+15)+"px;width:"+(15+this.lineStroke):C+(e.childLeft+e.childWidth-e.parentLeft+20)+"px;width:"+(10+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>')+N+"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)&&(P=P+C+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType2">',P=(P+=R)+C+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+(o?C+"4px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(14-this.lineStroke)):C+"10px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(20-this.lineStroke)))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=O)+C+"0px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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>'),l+=P,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,o=(s=i?e[n[a]]:e[a]).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}(),it=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.enableRtl?(this.parent.splitterElement.appendChild(this.parent.chartPane),this.parent.splitterElement.appendChild(this.parent.treeGridPane)):(this.parent.splitterElement.appendChild(this.parent.treeGridPane),this.parent.splitterElement.appendChild(this.parent.chartPane)),this.splitterObject=new s.Splitter({height:null,width:this.parent.ganttWidth.toString(),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,separatorSize:this.parent.splitterSettings.separatorSize,paneSettings:[{resizable:!0,size:i,min:this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum)},{resizable:!0}],orientation:"Horizontal",resizeStart:function(t){e.parent.contextMenuModule&&e.parent.contextMenuModule.isOpen&&e.parent.contextMenuModule.contextMenu.close();var i=t.pane[0],r=t.pane[1];e.splitterPreviousPositionGrid=i.scrollWidth+1+"px",e.splitterPreviousPositionChart=r.scrollWidth+1+"px";var 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(i){var r=i.pane[0];e.splitterPreviousPositionGrid=r.scrollWidth+1+"px",e.splitterObject.paneSettings[0].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionGrid);var a=new n.Deferred;return e.parent.trigger("splitterResized",i,function(i){!0===i.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)),t.isNullOrUndefined(e.parent.projectEndDate)&&e.parent.timelineModule.updateTimelineAfterZooming(e.parent.timelineModule.timelineEndDate,!0),a.resolve(i)}),a}}),this.parent.element.appendChild(this.parent.splitterElement),this.splitterObject.appendTo(this.parent.splitterElement)},e.prototype.calculateSplitterPosition=function(e){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")?this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(e.columnIndex).toString()+"px"):this.getSpliterPositionInPercentage(130*e.columnIndex+"px"):this.getSpliterPositionInPercentage("250px"):this.getSpliterPositionInPercentage(e.position)},e.prototype.getSpliterPositionInPercentage=function(e){var 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.ganttColumns;e=i.length>e?e:i.length;for(var r=0;r<e;r++)t+=parseInt(i[r].width);return t},e.prototype.updateSplitterPosition=function(){this.splitterObject.separatorSize=this.parent.splitterSettings.separatorSize>=4?this.parent.splitterSettings.separatorSize:4;var e=this.calculateSplitterPosition(this.parent.splitterSettings);this.splitterObject.paneSettings[0].min=this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum),this.splitterObject.dataBind(),this.splitterObject.paneSettings[0].size=e},e.prototype.triggerCustomResizedEvent=function(){var e=this.splitterObject.element.querySelectorAll(".e-pane")[0],t=this.splitterObject.element.querySelectorAll(".e-pane")[1],i={event:null,element:this.splitterObject.element,pane:[e,t],index:[0,1],separator:this.splitterObject.element.querySelector(".e-split-bar"),paneSize:[e.offsetWidth,t.offsetWidth]};this.parent.trigger("splitterResized",i),!0===i.cancel&&(this.splitterObject.paneSettings[0].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionGrid),this.splitterObject.paneSettings[1].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionChart))},e.prototype.destroy=function(){this.splitterObject.destroy(),this.parent.off("destroy",this.destroy)},e}(),rt=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.enableRtl=this.parent.enableRtl,this.toolTipObj.enableHtmlSanitizer=this.parent.enableHtmlSanitizer,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)return void(e.cancel=!0);var r,a=t.closest(e.target,"div."+N);r=t.isNullOrUndefined(a)?g(e.target,"e-chart-row-cell"):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.toolTipObj.content=o.content,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;if(i){var l=(s=i.ganttProperties).taskName;this.parent.enableHtmlSanitizer&&"string"==typeof l&&(l=t.SanitizeHtmlHelper.sanitize(l)),o=t.isNullOrUndefined(l)?"":'<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">'+(this.parent.disableHtmlEncode?l.replace(/</g,"<").replace(/>/g,">"):l)+"</td></tr>"}switch(e){case"milestone":var d=void 0;n.target.className.includes("e-baseline-gantt-milestone")&&!t.isNullOrUndefined(s.baselineStartDate)?d=s.baselineStartDate:t.isNullOrUndefined(s.startDate)||(d=s.startDate);var p=this.parent.getFormatedDate(d,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&"string"==typeof p&&(p=t.SanitizeHtmlHelper.sanitize(p)),a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(t.isNullOrUndefined(d)?"":'<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+p+"</td></tr>")+"</tbody></table>";break;case"taskbar":var h=!(i.hasChildRecords&&!s.isAutoSchedule),c=this.parent.getFormatedDate(h?s.startDate:s.autoStartDate,this.parent.getDateFormat()),u=this.parent.getFormatedDate(h?s.endDate:s.autoEndDate,this.parent.getDateFormat()),g=this.parent.getDurationString(h?s.duration:s.autoDuration,s.durationUnit),f=s.progress;this.parent.enableHtmlSanitizer&&(c="string"==typeof c?t.SanitizeHtmlHelper.sanitize(c):c,u="string"==typeof u?t.SanitizeHtmlHelper.sanitize(u):u,g="string"==typeof g?t.SanitizeHtmlHelper.sanitize(g):g,f="string"==typeof f?t.SanitizeHtmlHelper.sanitize(f):f),a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(s.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(h?"startDate":"subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+c+"</td></tr>":"")+(s.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(h?"endDate":"subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+u+"</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"> '+g+"</td></tr>")+(t.isNullOrUndefined(s.progress)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+"</td><td>:</td><td>"+f+"</td></tr>")+"</tbody></table>";break;case"baseline":var m=this.parent.getFormatedDate(s.baselineStartDate,this.parent.getDateFormat()),y=this.parent.getFormatedDate(s.baselineEndDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(m="string"==typeof m?t.SanitizeHtmlHelper.sanitize(m):m,y="string"==typeof y?t.SanitizeHtmlHelper.sanitize(y):y),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">'+m+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+y+"</td></tr></tbody></table>";break;case"marker":var v=r.tooltipModule.getMarkerTooltipData(n),D=this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(v.day),this.parent.getDateFormat()),w=v.label?v.label:"";this.parent.enableHtmlSanitizer&&(w="string"==typeof w?t.SanitizeHtmlHelper.sanitize(w):w,D="string"==typeof D?t.SanitizeHtmlHelper.sanitize(D):D),a='<table class = "e-gantt-tooltiptable"><tbody><tr><td>'+D+"</td></tr><tr><td>"+(this.parent.disableHtmlEncode?w.replace(/</g,"<").replace(/>/g,">"):w)+"</td></tr></tbody></table>";break;case"connectorLine":var k=r.tooltipModule.predecessorTooltipData.fromName,b=r.tooltipModule.predecessorTooltipData.fromId,T=r.tooltipModule.predecessorTooltipData.toName,S=r.tooltipModule.predecessorTooltipData.toId,P=r.tooltipModule.predecessorTooltipData.linkText,C=r.tooltipModule.predecessorTooltipData.offsetString;this.parent.enableHtmlSanitizer&&(k="string"==typeof k?t.SanitizeHtmlHelper.sanitize(k):k,b="string"==typeof b?t.SanitizeHtmlHelper.sanitize(b):b,T="string"==typeof T?t.SanitizeHtmlHelper.sanitize(T):T,S="string"==typeof S?t.SanitizeHtmlHelper.sanitize(S):S,P="string"==typeof P?t.SanitizeHtmlHelper.sanitize(P):P,C="string"==typeof C?t.SanitizeHtmlHelper.sanitize(C):C),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">'+(this.parent.disableHtmlEncode?k.replace(/</g,"<").replace(/>/g,">"):k)+" ("+(this.parent.disableHtmlEncode&&"string"==typeof b?b.replace(/</g,"<").replace(/>/g,">"):b)+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("to")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?T.replace(/</g,"<").replace(/>/g,">"):T)+" ("+S+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("taskLink")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+P+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("lag")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+C+"</td></tr></tbody></table>";break;case"indicator":if(n.target.title.length){var R=n.target.title;this.parent.enableHtmlSanitizer&&"string"==typeof R&&(R=t.SanitizeHtmlHelper.sanitize(R)),a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+R+"</tr></tbody></table>"}break;case"timeline":var M=n.target.title;this.parent.enableHtmlSanitizer&&"string"==typeof M&&(M=t.SanitizeHtmlHelper.sanitize(M)),a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+M+"</tr></tbody></table>";break;case"manualtaskbar":var O=this.parent.getFormatedDate(s.autoStartDate,this.parent.getDateFormat()),x=this.parent.getFormatedDate(s.autoEndDate,this.parent.getDateFormat()),I=this.parent.getDurationString(s.duration,s.durationUnit),E=this.parent.getFormatedDate(s.startDate,this.parent.getDateFormat()),N=this.parent.getFormatedDate(s.endDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(O="string"==typeof O?t.SanitizeHtmlHelper.sanitize(O):O,x="string"==typeof x?t.SanitizeHtmlHelper.sanitize(x):x,I="string"==typeof I?t.SanitizeHtmlHelper.sanitize(I):I,E="string"==typeof E?t.SanitizeHtmlHelper.sanitize(E):E,N="string"==typeof N?t.SanitizeHtmlHelper.sanitize(N):N);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"> '+O+"</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">'+x+"</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"> '+I+"</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"> '+E+"</td></tr>":"")+F+(s.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+N+"</td></tr>":"")+U+g+"</tbody></table>";break;case"manualmilestone":var V=this.parent.getFormatedDate(s.autoStartDate,this.parent.getDateFormat()),L=this.parent.getFormatedDate(s.autoEndDate,this.parent.getDateFormat()),B=this.parent.getFormatedDate(s.startDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(V="string"==typeof V?t.SanitizeHtmlHelper.sanitize(V):V,L="string"==typeof L?t.SanitizeHtmlHelper.sanitize(L):L,B="string"==typeof B?t.SanitizeHtmlHelper.sanitize(B):B),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">'+B+"</tr>")+(s.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+V+"</td></tr>":"")+(s.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+L+"</td></tr>":"")+"</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 i=e.target.parentElement.id;this.parent.enableHtmlSanitizer&&"string"==typeof i&&(i=t.SanitizeHtmlHelper.sanitize(i));var r=i.match(/ConnectorLineparent(.*)child(.*)/);r.shift();var n,a;"ResourceView"===this.parent.viewType?(n=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[0])],a=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[1])]):(n=this.parent.flatData[this.parent.ids.indexOf(r[0])],a=this.parent.flatData[this.parent.ids.indexOf(r[1])]);var s=n.ganttProperties.predecessor.filter(function(e){return e.to===r[1]});return{fromId:"ResourceView"===this.parent.viewType?n.ganttProperties.taskId:n.ganttProperties.rowUniqueID,toId:"ResourceView"===this.parent.viewType?a.ganttProperties.taskId:a.ganttProperties.rowUniqueID,fromName:n.ganttProperties.taskName,toName:a.ganttProperties.taskName,linkType:s[0].type,linkText:this.parent.getPredecessorTextValue(s[0].type),offset:s[0].offset,offsetUnit:s[0].offsetUnit,offsetString:this.parent.getDurationString(s[0].offset,s[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}(),nt=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);!t.isNullOrUndefined(this.parent.focusModule.getActiveElement())||"expandAll"!==e.action&&"collapseAll"!==e.action||(c=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":(m=i.element.querySelector("#"+i.element.id+"_searchbar"))&&m.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(),(c=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(i.editModule&&i.editModule.cellEditModule&&i.editModule.cellEditModule.isCellEdit)e.stopPropagation();else if(t.isNullOrUndefined(document.getElementById(this.parent.element.id+"_dialog"))){e.preventDefault(),i.addRecord(void 0,this.parent.editSettings.newRowPosition);var c=i.element;c.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":if(e.preventDefault(),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)&&(t.isNullOrUndefined(e.target)?i.editModule.startDeleteAction():"INPUT"!==e.target.tagName&&i.editModule.startDeleteAction());break;case"focusTask":e.preventDefault();var u=void 0;if(i.selectionModule){var g=i.currentViewData;if("Cell"===i.selectionSettings.mode||t.isNullOrUndefined(g[i.selectedRowIndex])){if("Cell"===i.selectionSettings.mode&&i.selectionModule.getSelectedRowCellIndexes().length>0){var f=i.selectionModule.getSelectedRowCellIndexes();u=g[f[f.length-1].rowIndex].ganttProperties.rowUniqueID}}else u=i.currentViewData[i.selectedRowIndex].ganttProperties.rowUniqueID}u&&i.scrollToTask(u.toString());break;case"focusSearch":if(i.element.querySelector("#"+i.element.id+"_searchbar")){var m=i.element.querySelector("#"+i.element.id+"_searchbar");m.setAttribute("tabIndex","-1"),m.focus()}break;case"tab":case"shiftTab":i.element.classList.contains("e-scroll-disabled")||i.ganttChartModule.onTabAction(e);break;case"contextMenu":var y=document.getElementById(this.parent.element.id+"_contextmenu").ej2_instances[0],v=this.parent.getOffsetRect(e.target),D=v.top+v.height/2,w=v.left+v.width/2;this.setActiveElement(e.target),y.open(D,w),e.preventDefault();break;default:var k={requestType:"keyPressed",action:e.action,keyEvent:e};i.trigger("actionComplete",k)}},e.prototype.upDownKeyNavigate=function(e){e.preventDefault();var t=this.parent,i=t.getExpandedRecords(t.currentViewData);if(t.selectionModule){if("Cell"!==t.selectionSettings.mode&&-1!==t.selectedRowIndex){var r=t.currentViewData[t.selectedRowIndex],n=(this.parent.ganttChartModule.focusedRowIndex,i.indexOf(r)),a="downArrow"===e.action?i[n+1]:i[n-1];t.selectionModule.selectRow(t.currentViewData.indexOf(a),!1,!0)}else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var s=t.selectionModule.getSelectedRowCellIndexes(),o=s[s.length-1],l=o.cellIndexes[o.cellIndexes.length-1],r=t.currentViewData[o.rowIndex],n=i.indexOf(r),a="downArrow"===e.action?i[n+1]:i[n-1],d={rowIndex:t.currentViewData.indexOf(a),cellIndex:l};t.selectionModule.selectCell(d)}this.parent.ganttChartModule.focusedRowIndex=this.parent.selectedRowIndex}},e.prototype.expandCollapseKey=function(e){var t=this.parent;if(t.selectionModule&&-1!==t.selectedRowIndex){var i=void 0;if("Cell"!==t.selectionSettings.mode)i=t.selectedRowIndex;else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var r=t.selectionModule.getSelectedRowCellIndexes();i=r[r.length-1].rowIndex}"expandRow"===e.action?t.expandByIndex(i):t.collapseByIndex(i)}},e}(),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 n(i,r){var n=e.call(this,i,r)||this;return n.showIndicator=!0,n.singleTier=0,n.isLocaleChanged=!1,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.isFromRenderBaseline=!1,n.isGanttChartRendered=!1,n.isEdit=!1,t.setValue("mergePersistData",n.mergePersistGanttData,n),n}return at(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 Y(this),this.timelineModule=new Q(this),this.chartRowsModule=new $e(this),this.treeGridModule=new J(this),this.dateValidationModule=new R(this),this.predecessorModule=new et(this),this.connectorLineModule=new tt(this),this.splitterModule=new it(this),this.tooltipModule=new rt(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 nt(this),0===this.zoomingLevels.length&&(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(){return t.isNullOrUndefined(this.dateFormat)?this.globalize.getDatePattern({skeleton:"yMd"}):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),this.isVue&&(this.treeGrid.isVue=!0,this.treeGrid.grid.isVue=!0,this.treeGrid.vueInstance=this.vueInstance,this.treeGrid.grid.vueInstance=this.vueInstance),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),t.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow(),this.dataOperation.checkDataBinding()},n.prototype.hideMaskRow=function(){var e=this.element.querySelectorAll(".e-masked-table").length;if(!t.isNullOrUndefined(this.contentMaskTable)&&(0!=e||this.contentMaskTable)){i=this.contentMaskTable;t.remove(i),this.contentMaskTable=null}if(e=this.element.querySelectorAll(".e-masked-table").length,!t.isNullOrUndefined(this.headerMaskTable)&&(0!=e||this.headerMaskTable)){var i=this.headerMaskTable;t.remove(i),this.headerMaskTable=null}for(;0!=this.element.querySelectorAll(".e-table-background").length;)this.element.querySelectorAll(".e-table-background")[0].remove();for(;0!=this.element.querySelectorAll(".e-temp-timeline").length;)this.element.querySelectorAll(".e-temp-timeline")[0].remove();if(0!=this.element.querySelectorAll(".e-timeline-header-table-container").length)for(var r=0;r<this.singleTier;r++)t.isNullOrUndefined(this.element.querySelectorAll(".e-timeline-header-table-container")[parseInt(r.toString(),10)])||(this.element.querySelectorAll(".e-timeline-header-table-container")[parseInt(r.toString(),10)].style.visibility="visible");t.isNullOrUndefined(this.element.querySelector(".e-timeline-header-container"))||(this.element.querySelector(".e-timeline-header-container").style.position="relative"),t.isNullOrUndefined(this.element.getElementsByClassName("e-chart-rows-container")[0])||(this.element.getElementsByClassName("e-chart-rows-container")[0].style.visibility="visible")},n.prototype.showMaskRow=function(){var e=this.chartPane.childNodes[0].childNodes[0];this.scrollLeftValue=this.chartPane.childNodes[0].childNodes[0].scrollLeft;var t=this.chartPane.childNodes[0].childNodes[1];if(this.treeGrid.element&&this.ganttChartModule.setVirtualHeight(),!this.contentMaskTable){if(t){r=t;if(this.renderBackGround(r),0!=this.element.querySelectorAll(".e-timeline-header-table-container").length){this.singleTier=this.timelineModule.isSingleTier?1:2;for(var i=0;i<this.singleTier;i++)this.element.querySelectorAll(".e-timeline-header-table-container")[parseInt(i.toString(),10)].style.visibility="hidden"}0===this.singleTier&&(this.singleTier=2),this.element.getElementsByClassName("e-chart-rows-container")[0].style.visibility="hidden",this.contentMaskTable=this.contentMaskTable=this.createMaskTable(r)}if(e){this.element.querySelector(".e-timeline-header-container").style.position="static";var r=e;this.renderHeaderBackground(r),this.headerMaskTable=this.headerMaskTable=this.createMaskTable(r)}}},n.prototype.renderHeaderBackground=function(e){var i=e,r=e.getBoundingClientRect().height;if(!!t.closest(i,".e-timeline-header-container")){for(var n=this.createElement("div",{className:"e-table-background"}),a=(this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+r+"px;"}}),0),s=Math.round(e.getBoundingClientRect().width),o=0;o<3;o++)this.enableRtl?n.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(s-=160)+"px; top:0px;"}})):n.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(a+=160)+"px; top:0px;"}}));i.insertBefore(n,i.firstChild)}},n.prototype.renderBackGround=function(e){var i=e,r=e.getBoundingClientRect().height;if(!!t.closest(i,".e-chart-root-container")){for(var n=this.createElement("div",{className:"e-table-background"}),a=(this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+r+"px;"}}),0),s=Math.round(e.getBoundingClientRect().width),o=0;o<3;o++)this.enableRtl?n.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(s-=160)+"px;z-index:1;"}})):n.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(a+=160)+"px;z-index:1;"}}));i.insertBefore(n,i.firstChild)}},n.prototype.createMaskTable=function(e){var i,r=e,n=e.getBoundingClientRect().height,a=!!t.closest(r,".e-timeline-header-container");if(a?((i=this.createEmptyTimeLineTable(n)).style.position="sticky",i.style.left="0px",this.enableRtl&&i.style.removeProperty("left")):((i=this.createEmptyMaskTable(n)).style.position="absolute",i.style.zIndex=1),a){i.style.height=e.getBoundingClientRect().height+"px";var s=this.createElement("div",{className:"e-temp-timeline"});s.style.width="614px",s.style.position="sticky",this.enableRtl?s.style["margin-right"]=Math.abs(this.scrollLeftValue)+"px":s.style["margin-left"]=this.scrollLeftValue+"px",s.appendChild(i),r.insertBefore(s,r.firstChild)}else i.style.height=e.getBoundingClientRect().height+"px",r.insertBefore(i,r.firstChild);return i},n.prototype.createEmptyTimeLineTable=function(e){for(var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),r=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/2+"px;"}}),a=0;a<this.singleTier;a++)r.push(n.cloneNode(!0));this.topBottomHeader=0;for(a=0;a<r.length;a++)i.appendChild(this.applyTimelineMaskRow(r[parseInt(a.toString(),10)])),this.topBottomHeader=this.topBottomHeader+1;return t.appendChild(i),t.style.width="100%",t},n.prototype.applyTimelineMaskRow=function(e){var t=e;t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(r=0;r<t.childNodes.length-1;r++)t.childNodes[parseInt(r.toString(),10)].style.width="166px";for(var i=[].slice.call(t.childNodes),r=0;r<i.length;r++){var n=i[parseInt(r.toString(),10)];switch(this.topBottomHeader){case 0:this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>',n.children[0].style.left="-20px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>';break;case 1:n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(var a=[].slice.call(n.childNodes),s=0;s<a.length;s++){var o=a[parseInt(s.toString(),10)];0===s?this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>',o.children[0].style.left="-14px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>':1===s?this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>',o.children[0].style.left="-30px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>':this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>',o.children[0].style.left="-60px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>'}}}return t},n.prototype.createEmptyMaskTable=function(e){var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),r=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/7+"px;"}});this.columnLoop=0;for(var a=0;a<6;a++)r.push(n.cloneNode(!0));for(var s=0;s<r.length;s++)this.columnLoop<4?this.columnLoop=this.columnLoop+1:4===this.columnLoop&&(this.columnLoop=1),i.appendChild(this.applyMaskRow(r[parseInt(s.toString(),10)]));t.appendChild(i),t.style.width="100%";var o=this.createElement("div",{className:"e-temp-container"});return o.style.width="calc(100% - 17px)",o.style.overflow="hidden",o.appendChild(t),o},n.prototype.applyMaskRow=function(e){var t=e;this.columnLoop<4?(t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"})),t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}))):t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}));for(var i=[].slice.call(t.childNodes),r=0;r<i.length;r++){var n=i[parseInt(r.toString(),10)];switch(this.columnLoop){case 1:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>',n.children[0].style.left="-14px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>':n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell02"></span>';break;case 2:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>',n.children[0].style.left="-14px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>':n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell04"></span>';break;case 3:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>',n.children[0].style.left="-64px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>':this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>',n.children[0].style.left="-192px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>';break;case 4:this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>',n.children[0].style.left="-388px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>'}}return t},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(e&&(this.isFromOnPropertyChange=e),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors(),this.isInPredecessorValidation&&this.enableValidation&&this.autoCalculateDateScheduling&&this.predecessorModule.updatedRecordsDateByPredecessor()),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp()),e)if(this.enableValidation&&this.dataOperation.updateGanttData(),this.allowParentDependency&&this.predecessorModule.updateParentPredecessor(),this.dataSource instanceof Object&&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.allowParentDependency&&this.predecessorModule.updateParentPredecessor(),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.removeCriticalPathStyles=function(){var e=this.ganttChartModule.chartElement;t.removeClass(e.querySelectorAll(".e-gantt-child-taskbar-inner-div"),"e-gantt-child-critical-taskbar-inner-div"),t.removeClass(e.querySelectorAll(".e-gantt-child-progressbar-inner-div"),"e-gantt-child-critical-progressbar-inner-div"),t.removeClass(e.querySelectorAll(".e-milestone-top"),"e-critical-milestone-top"),t.removeClass(e.querySelectorAll(".e-milestone-bottom"),"e-critical-milestone-bottom"),t.removeClass(this.element.querySelectorAll(".e-line"),"e-criticalconnector-line"),t.removeClass(this.element.querySelectorAll(".e-connector-line-right-arrow"),"e-criticalconnector-line-right-arrow"),t.removeClass(this.element.querySelectorAll(".e-connector-line-left-arrow"),"e-criticalconnector-line-left-arrow")},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.allowTaskbarOverlap||"ResourceView"!==this.viewType||this.isLoad)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);return!!t.isNullOrUndefined(i)||!1!==i.expanded&&(!i.parentItem||!1!==this.getParentTask(i.parentItem).expanded&&this.getExpandStatus(this.getParentTask(i.parentItem)))},n.prototype.getExpandedRecords=function(e){var i=this;return t.isNullOrUndefined(e)?[]:e.filter(function(e){return!0===i.getExpandStatus(e)})},n.prototype.getZoomingLevels=function(){var e=this.timelineSettings.weekStartDay;return[{topTier:{unit:"Year",format:"yyyy",count:50},bottomTier:{unit:"Year",format:"yyyy",count:10},timelineUnitSize:99,level:0,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:20},bottomTier:{unit:"Year",format:"yyyy",count:5},timelineUnitSize:99,level:1,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:5},bottomTier:{unit:"Year",format:"yyyy",count:1},timelineUnitSize:99,level:2,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:66,level:3,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:99,level:4,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:66,level:5,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:99,level:6,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",format:"MMM yyyy",count:1},timelineUnitSize:99,level:7,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yy",count:1},bottomTier:{unit:"Week",format:"dd",count:1},timelineUnitSize:33,level:8,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:66,level:9,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:99,level:10,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:33,level:11,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:66,level:12,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:99,level:13,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:66,level:14,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:99,level:15,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:66,level:16,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:99,level:17,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:66,level:18,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:99,level:19,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:66,level:20,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:99,level:21,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:30},timelineUnitSize:66,level:22,timelineViewMode:"Hour",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:15},timelineUnitSize:66,level:23,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:1},timelineUnitSize:66,level:24,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0}]},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(),t.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),t.setValue("isGanttCreated",!0,e),this.renderComplete()}}else this.getCurrentRecords(e);this.enableCriticalPath&&this.criticalPathModule&&this.criticalPathModule.showCriticalPath(this.enableCriticalPath),this.notify("recordsUpdated",{});for(var r=0;r<document.getElementsByClassName("e-timeline-header-table-container").length;r++)for(var n=0;n<document.getElementsByClassName("e-timeline-header-table-container")[r].children[0].children[0].children.length;n++)document.getElementsByClassName("e-timeline-header-table-container")[r].children[0].children[0].children[n].children[0].setAttribute("tabindex","-1");if(this.enableCriticalPath&&this.criticalPathModule){var a=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(a.criticalPathCollection,a.detailPredecessorCollection,!0,a.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":this.dataOperation.checkDataBinding(!0);break;case"enableCriticalPath":if(t.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),this.enableCriticalPath&&this.criticalPathModule){this.criticalPathModule.showCriticalPath(this.enableCriticalPath);var l=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(l.criticalPathCollection,l.detailPredecessorCollection,!0,l.predecessorCollectionTaskIds)}else this.removeCriticalPathStyles();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.isFromRenderBaseline=!0,this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isFromRenderBaseline=!1;break;case"resourceIDMapping":case"resourceNameMapping":case"resources":this.dataOperation.reUpdateResources(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"includeWeekend":case"allowUnscheduledTasks":case"holidays":this.isLoad=!0,"holidays"===o&&(this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.notify("ui-update",{module:"day-markers",properties:e})),this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1;break;case"dayWorkingTime":this.isLoad=!0,this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1;break;case"addDialogFields":case"editDialogFields":this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.processDialogFields();break;case"columns":this.treeGridModule.treeGridColumns=[],this.treeGridModule.validateGanttColumns(),this.treeGrid.columns=this.treeGridModule.treeGridColumns,this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline();break;case"width":case"height":this.reUpdateDimention();break;case"editSettings":this.treeGrid.editSettings.allowAdding=this.editSettings.allowAdding,this.treeGrid.editSettings.allowDeleting=this.editSettings.allowDeleting,this.treeGrid.editSettings.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,this.treeGrid.editSettings.allowEditing=this.editSettings.allowEditing,this.treeGrid.editSettings.allowNextRowEdit=this.editSettings.allowNextRowEdit,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 d=t.getValue("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:d}}else this.treeGrid.hasChildMapping=null;this.dataOperation.checkDataBinding(!0);break;case"enableContextMenu":case"contextMenuItems":this.enableContextMenu||"contextMenuItems"===o?this.notify("reRender-contextMenu",{module:"contextMenu",enable:this.contextMenuItems}):this.treeGrid.contextMenuItems=[],this.treeGrid.dataBind();break;case"currencyCode":case"locale":case"enableRtl":case"readOnly":case"viewType":case"taskFields":case"allowTaskbarDragAndDrop":case"allowTaskbarOverlap":case"allowParentDependency":"locale"===o&&(this.isLocaleChanged=!0),n=!0;break;case"validateManualTasksOnLinking":this.validateManualTasksOnLinking=e.validateManualTasksOnLinking;break;case"showOverAllocation":this.updateOverAllocationCotainer()}}n&&(this.isLoad&&this.contentMaskTable&&(this.contentMaskTable=null),this.refresh())},n.prototype.updateOverAllocationCotainer=function(){if(this.showOverAllocation&&"ResourceView"===this.viewType)this.ganttChartModule.renderOverAllocationContainer();else{var e=this.element.querySelector("."+z);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=["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],n=0;n<e.length;n++)for(var a=this[e[n]],s=0,o=i[e[n]];!t.isNullOrUndefined(o)&&s<o.length;s++)delete a[o[s]];return this.ignoreInArrays(r,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||this.allowTaskbarDragAndDrop)&&e.push({member:"rowDragAndDrop",args:[this]}),this.enableCriticalPath&&e.push({member:"criticalPath",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),this.toolbar&&this.toolbar.length>0&&e.push({member:"toolbar",args:[this]}),(this.editSettings.allowAdding||this.editSettings.allowEditing||this.editSettings.allowDeleting||this.editSettings.allowTaskbarEditing||this.allowRowDragAndDrop)&&e.push({member:"edit",args:[this]}),this.allowSelection&&e.push({member:"selection",args:[this]}),this.tooltipSettings.showTooltip&&e.push({member:"tooltip",args:[this]}),(this.highlightWeekends||this.holidays&&this.holidays.length>0||this.eventMarkers&&this.eventMarkers.length>0)&&e.push({member:"dayMarkers",args:[this]}),this.enableContextMenu&&e.push({member:"contextMenu",args:[this]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this]}),this.allowPdfExport&&e.push({member:"pdfExport",args:[this]}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this]}),e)},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(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(var 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:(this.enableRtl?"right:"+(a+1):"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),t.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow()},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,this.enableRtl?-1:0)),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,r){return this.pdfExportModule?this.pdfExportModule.export(e,t,i,r):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.autoCalculateDateScheduling)?[]: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())&&(this.autoCalculateDateScheduling?e.isDisabled=!0:e.isDisabled=!1)}},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(i=t.isUndefined(i)?null:i,this.isOnEdit||this.isOnDelete){this.makeCloneData(e,r,n);var a=n?r:r.ganttProperties,s=a.rowUniqueID,o=this.getRecordByID(s),l=!1;(t.isNullOrUndefined(i)||!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(r[""+e])&&(i instanceof Date?i.getTime()!==r[""+e].getTime():r[""+e]!==i))&&(l=!0),o&&(-1===this.editedRecords.indexOf(o)&&l||0===this.editedRecords.length)&&(this.editModule.draggedRecord&&this.editModule.draggedRecord.ganttProperties.taskId===a.taskId?this.editedRecords.splice(0,0,o):this.editedRecords.push(o),this.enableImmutableMode&&this.modifiedRecords.push(o))}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])){var l={};this.previousRecords[i.uniqueID]=l}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),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){r=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(r)}else for(var t=0;t<e.length;t++)if("number"==typeof e[t]){var i=e[t],r=this.contructExpandCollapseArgs(null,i);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(r)}},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=void 0;t.isNullOrUndefined(e)||(n=e[this.taskFields.resourceInfo]);var 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;return t.isNullOrUndefined(i)?(n=this.getRecordByID(e.toString()),r=this.getRowByID(e),t.isNullOrUndefined(r)||(a=t.getValue("rowIndex",r))):t.isNullOrUndefined(i)||(r=this.getRowByIndex(i),a=t.getValue("rowIndex",r),n=this.currentViewData[a]),{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)?" e-gantt-unscheduled-task":t.isNullOrUndefined(e.startDate)||t.isNullOrUndefined(e.endDate)||t.isNullOrUndefined(e.duration)?" e-gantt-unscheduled-task":""},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=this.enableRtl?t.right+r-a:t.left+r-a;return{top:Math.round(s),left:Math.round(o),width:t.width,height:t.height}},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),this.updateTreeColumns()},n.prototype.hideColumn=function(e,t){this.treeGrid.hideColumns(e,t),this.updateTreeColumns()},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()},st([t.Property(!0)],n.prototype,"allowKeyboard",void 0),st([t.Property(!1)],n.prototype,"enableImmutableMode",void 0),st([t.Property(!0)],n.prototype,"allowParentDependency",void 0),st([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),st([t.Property(!0)],n.prototype,"disableHtmlEncode",void 0),st([t.Complex({},Ke)],n.prototype,"loadingIndicator",void 0),st([t.Property(!0)],n.prototype,"enableVirtualMaskRow",void 0),st([t.Property(!0)],n.prototype,"UpdateOffsetOnTaskbarEdit",void 0),st([t.Property(!0)],n.prototype,"autoCalculateDateScheduling",void 0),st([t.Property(!0)],n.prototype,"autoFocusTasks",void 0),st([t.Property(!0)],n.prototype,"allowSelection",void 0),st([t.Property(!1)],n.prototype,"allowSorting",void 0),st([t.Property(!0)],n.prototype,"enablePredecessorValidation",void 0),st([t.Property(!1)],n.prototype,"showColumnMenu",void 0),st([t.Property()],n.prototype,"columnMenuItems",void 0),st([t.Property()],n.prototype,"timezone",void 0),st([t.Property(!1)],n.prototype,"collapseAllParentTasks",void 0),st([t.Property(!1)],n.prototype,"highlightWeekends",void 0),st([t.Property(0)],n.prototype,"treeColumnIndex",void 0),st([t.Property([])],n.prototype,"dataSource",void 0),st([t.Property("day")],n.prototype,"durationUnit",void 0),st([t.Property(null)],n.prototype,"query",void 0),st([t.Property(null)],n.prototype,"dateFormat",void 0),st([t.Property("auto")],n.prototype,"height",void 0),st([t.Property(!1)],n.prototype,"renderBaseline",void 0),st([t.Property(!1)],n.prototype,"allowTaskbarDragAndDrop",void 0),st([t.Property(!0)],n.prototype,"allowTaskbarOverlap",void 0),st([t.Property("Horizontal")],n.prototype,"gridLines",void 0),st([t.Complex({},Pe)],n.prototype,"labelSettings",void 0),st([t.Property(null)],n.prototype,"taskbarTemplate",void 0),st([t.Property(null)],n.prototype,"parentTaskbarTemplate",void 0),st([t.Property(null)],n.prototype,"milestoneTemplate",void 0),st([t.Property()],n.prototype,"baselineColor",void 0),st([t.Property("auto")],n.prototype,"width",void 0),st([t.Property(!1)],n.prototype,"enableVirtualization",void 0),st([t.Property()],n.prototype,"toolbar",void 0),st([t.Property(["Monday","Tuesday","Wednesday","Thursday","Friday"])],n.prototype,"workWeek",void 0),st([t.Property(!1)],n.prototype,"includeWeekend",void 0),st([t.Property(!1)],n.prototype,"allowUnscheduledTasks",void 0),st([t.Property(!1)],n.prototype,"showInlineNotes",void 0),st([t.Property(36)],n.prototype,"rowHeight",void 0),st([t.Property(null)],n.prototype,"taskbarHeight",void 0),st([t.Property(null)],n.prototype,"projectStartDate",void 0),st([t.Property(null)],n.prototype,"projectEndDate",void 0),st([t.Property(null)],n.prototype,"resourceIDMapping",void 0),st([t.Property(null)],n.prototype,"resourceNameMapping",void 0),st([t.Property([])],n.prototype,"resources",void 0),st([t.Property([])],n.prototype,"segmentData",void 0),st([t.Property(null)],n.prototype,"connectorLineBackground",void 0),st([t.Property(1)],n.prototype,"connectorLineWidth",void 0),st([t.Property([])],n.prototype,"columns",void 0),st([t.Property([])],n.prototype,"addDialogFields",void 0),st([t.Property([])],n.prototype,"editDialogFields",void 0),st([t.Property(-1)],n.prototype,"selectedRowIndex",void 0),st([t.Property("hour")],n.prototype,"workUnit",void 0),st([t.Property("FixedUnit")],n.prototype,"taskType",void 0),st([t.Property("ProjectView")],n.prototype,"viewType",void 0),st([t.Collection([{from:8,to:12},{from:13,to:17}],te)],n.prototype,"dayWorkingTime",void 0),st([t.Collection([],be)],n.prototype,"holidays",void 0),st([t.Collection([],ue)],n.prototype,"eventMarkers",void 0),st([t.Complex({},Fe)],n.prototype,"taskFields",void 0),st([t.Complex({},Ye)],n.prototype,"resourceFields",void 0),st([t.Complex({},Be)],n.prototype,"timelineSettings",void 0),st([t.Property([])],n.prototype,"zoomingLevels",void 0),st([t.Complex({},ze)],n.prototype,"sortSettings",void 0),st([t.Complex({},pe)],n.prototype,"editSettings",void 0),st([t.Complex({},We)],n.prototype,"tooltipSettings",void 0),st([t.Complex({},Me)],n.prototype,"selectionSettings",void 0),st([t.Property(!1)],n.prototype,"allowFiltering",void 0),st([t.Property(!1)],n.prototype,"allowExcelExport",void 0),st([t.Property(!1)],n.prototype,"allowRowDragAndDrop",void 0),st([t.Property(!1)],n.prototype,"allowReordering",void 0),st([t.Property(!1)],n.prototype,"readOnly",void 0),st([t.Property(!1)],n.prototype,"allowResizing",void 0),st([t.Property(!1)],n.prototype,"enableContextMenu",void 0),st([t.Property(!1)],n.prototype,"enableCriticalPath",void 0),st([t.Property()],n.prototype,"contextMenuItems",void 0),st([t.Property(!1)],n.prototype,"allowPdfExport",void 0),st([t.Property(!1)],n.prototype,"validateManualTasksOnLinking",void 0),st([t.Property(!1)],n.prototype,"enableMultiTaskbar",void 0),st([t.Property(!1)],n.prototype,"showOverAllocation",void 0),st([t.Property("Auto")],n.prototype,"taskMode",void 0),st([t.Complex({},me)],n.prototype,"filterSettings",void 0),st([t.Complex({},De)],n.prototype,"searchSettings",void 0),st([t.Complex({},Ie)],n.prototype,"splitterSettings",void 0),st([t.Event()],n.prototype,"queryTaskbarInfo",void 0),st([t.Event()],n.prototype,"beforeExcelExport",void 0),st([t.Event()],n.prototype,"excelExportComplete",void 0),st([t.Event()],n.prototype,"excelQueryCellInfo",void 0),st([t.Event()],n.prototype,"excelHeaderQueryCellInfo",void 0),st([t.Event()],n.prototype,"rowDrag",void 0),st([t.Event()],n.prototype,"rowDragStart",void 0),st([t.Event()],n.prototype,"rowDragStartHelper",void 0),st([t.Event()],n.prototype,"rowDrop",void 0),st([t.Event()],n.prototype,"collapsing",void 0),st([t.Event()],n.prototype,"collapsed",void 0),st([t.Event()],n.prototype,"expanding",void 0),st([t.Event()],n.prototype,"expanded",void 0),st([t.Event()],n.prototype,"actionBegin",void 0),st([t.Event()],n.prototype,"actionComplete",void 0),st([t.Event()],n.prototype,"actionFailure",void 0),st([t.Event()],n.prototype,"dataStateChange",void 0),st([t.Event()],n.prototype,"taskbarEdited",void 0),st([t.Event()],n.prototype,"endEdit",void 0),st([t.Event()],n.prototype,"cellEdit",void 0),st([t.Event()],n.prototype,"load",void 0),st([t.Event()],n.prototype,"created",void 0),st([t.Event()],n.prototype,"destroyed",void 0),st([t.Event()],n.prototype,"taskbarEditing",void 0),st([t.Event()],n.prototype,"dataBound",void 0),st([t.Event()],n.prototype,"resizeStart",void 0),st([t.Event()],n.prototype,"resizing",void 0),st([t.Event()],n.prototype,"resizeStop",void 0),st([t.Event()],n.prototype,"splitterResizeStart",void 0),st([t.Event()],n.prototype,"splitterResizing",void 0),st([t.Event()],n.prototype,"splitterResized",void 0),st([t.Event()],n.prototype,"columnDragStart",void 0),st([t.Event()],n.prototype,"columnDrag",void 0),st([t.Event()],n.prototype,"columnDrop",void 0),st([t.Event()],n.prototype,"beforeTooltipRender",void 0),st([t.Event()],n.prototype,"rowSelecting",void 0),st([t.Event()],n.prototype,"rowSelected",void 0),st([t.Event()],n.prototype,"rowDeselecting",void 0),st([t.Event()],n.prototype,"rowDeselected",void 0),st([t.Event()],n.prototype,"cellSelecting",void 0),st([t.Event()],n.prototype,"cellSelected",void 0),st([t.Event()],n.prototype,"cellDeselecting",void 0),st([t.Event()],n.prototype,"cellDeselected",void 0),st([t.Event()],n.prototype,"queryCellInfo",void 0),st([t.Event()],n.prototype,"headerCellInfo",void 0),st([t.Event()],n.prototype,"rowDataBound",void 0),st([t.Event()],n.prototype,"columnMenuOpen",void 0),st([t.Event()],n.prototype,"toolbarClick",void 0),st([t.Event()],n.prototype,"columnMenuClick",void 0),st([t.Event()],n.prototype,"contextMenuOpen",void 0),st([t.Event()],n.prototype,"contextMenuClick",void 0),st([t.Event()],n.prototype,"onTaskbarClick",void 0),st([t.Event()],n.prototype,"recordDoubleClick",void 0),st([t.Event()],n.prototype,"onMouseMove",void 0),st([t.Event()],n.prototype,"beforePdfExport",void 0),st([t.Event()],n.prototype,"pdfExportComplete",void 0),st([t.Event()],n.prototype,"pdfQueryCellInfo",void 0),st([t.Event()],n.prototype,"pdfQueryTaskbarInfo",void 0),st([t.Event()],n.prototype,"pdfQueryTimelineCellInfo",void 0),st([t.Event()],n.prototype,"pdfColumnHeaderQueryCellInfo",void 0),n=st([t.NotifyPropertyChanges],n)}(t.Component);!function(e){e[e.NextPage=0]="NextPage",e[e.LastPage=1]="LastPage"}(e.PdfHorizontalOverflowType||(e.PdfHorizontalOverflowType={}));var lt=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)return void(e.cancel=!0);if("Dialog"===this.parent.editSettings.mode)return void(e.cancel=!0);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}(a===s.dependency&&!this.parent.allowParentDependency||a!==s.dependency)&&(e.cancel=!0)},e.prototype.openNotesEditor=function(e){var t=this.parent.taskFields,i=e.rowData,r=e.columnName;if(r===t.notes&&!this.parent.showInlineNotes){e.cancel=!0;var n=this.parent.editModule.dialogModule.updatedEditFields.map(function(e){return e.type}).indexOf("Notes");-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.editModule.cellEditModule.editedColumn)||(this.parent.editModule.cellEditModule.editedColumn=null),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[parseInt(n.toString(),10)],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=0;c<s;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[parseInt(l.toString(),10)])}(c);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}(),dt=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",enableRtl:this.parent.enableRtl,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("."+q)):"ConnectorPointRightDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector(".e-connectorpoint-right")):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.parent.enableRtl?this.toolTipObj.offsetX=0:this.toolTipObj.offsetX=-r:"RightResizing"===this.taskbarEdit.taskBarEditAction||"ParentResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-r:this.toolTipObj.offsetX=0:"ProgressResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-n: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}(),pt=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(){return(ht=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)},ct=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.currentItemTop=0,i.currentItemPrevTop=0,i.topValue=0,i.draggedRecordMarginTop=0,i.parent=t,i.initPublicProp(),i.wireEvents(),i.editTooltip=new dt(i.parent,i),i}return pt(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,N);!i||i.innerHTML!==this.taskBarEditElement.innerHTML||t.classList.contains(q)||t.classList.contains("e-connectorpoint-right")||this.tapPointOnFocus||(this.updateTaskBarEditElement(e),this.canDrag=!0,e.preventDefault())}else this.parent.isAdaptive||this.updateTaskBarEditElement(e)},i.prototype.mouseClickHandler=function(e){if(this.parent.editSettings.allowTaskbarEditing){var t=this.getElementByPosition(e),i=g(t,N);if(this.parent.selectionModule&&this.parent.selectionModule.enableSelectMultiTouch)return void(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("e-connectorpoint-left-hover")||t.classList.contains("e-connectorpoint-right-hover")?(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],["e-active-child-task"]),t.addClass([o],["e-predecessor-touch-mode"])):(t.removeClass([this.taskBarEditElement],["e-active-child-task"]),t.removeClass([o],["e-predecessor-touch-mode"])),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("."+N),o=this.parent.element.querySelector("#ConnectorLineparent"+e+"child"+i);r?(t.addClass([s],["e-active-connected-task"]),o&&t.addClass([o],["e-active-connected-task"])):(t.removeClass([s],["e-active-connected-task"]),o&&t.removeClass([o],["e-active-connected-task"]))}},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("e-gantt-manualparenttaskbar-right")||r.classList.contains("e-manualparent-main-container")||r.classList.contains(H))i=g(r,"e-manualparent-main-container");else if(r.classList.contains("e-manualparent-milestone-top")||r.classList.contains("e-manualparent-milestone-bottom")||r.classList.contains("e-gantt-manualparent-milestone"))i=g(r,"e-gantt-manualparent-milestone");else if(i=g(r,N),!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,"e-gantt-child-taskbar-inner-div"))}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",this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")&&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(".e-taskbar-left-resizer")?(t.addClass([e.querySelector(".e-taskbar-left-resizer")],["e-left-resize-gripper"]),t.addClass([e.querySelector(".e-taskbar-right-resizer")],["e-right-resize-gripper"]),n&&!t.isNullOrUndefined(e.querySelector("."+B))&&t.addClass([e.querySelector("."+B)],["e-progress-resize-gripper"])):this.parent.isAdaptive&&n&&(s=this.parent.ganttChartModule.getRecordByTaskBar(e)).hasChildRecords&&t.addClass([e],["e-active-parent-task"]),t.addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll(".e-connector-line-container"),["e-connector-line-z-index"]),!t.isNullOrUndefined(this.parent.taskFields.dependency)&&(e.querySelector("."+q)||e.parentElement.querySelector("."+q))&&a){l=t.isNullOrUndefined(e.querySelector("."+q))?e.parentElement:e;t.addClass([l.querySelector("."+q)],["e-connectorpoint-left-hover"]),t.addClass([l.querySelector(".e-connectorpoint-right")],["e-connectorpoint-right-hover"])}}else r||t.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll(".e-connector-line-container"),["e-connector-line-z-index"]);if(i&&e!==i){if(i.querySelector(".e-taskbar-left-resizer")&&(t.removeClass([i.querySelector(".e-taskbar-left-resizer")],["e-left-resize-gripper"]),t.removeClass([i.querySelector(".e-taskbar-right-resizer")],["e-right-resize-gripper"]),i.querySelector("."+B)&&t.removeClass([i.querySelector("."+B)],["e-progress-resize-gripper"])),t.isNullOrUndefined(this.parent.taskFields.dependency)||!i.querySelector("."+q)&&!i.parentElement.querySelector("."+q))this.parent.isAdaptive&&(s=this.parent.ganttChartModule.getRecordByTaskBar(i))&&s.hasChildRecords&&t.removeClass([i],["e-active-parent-task"]);else{var l=t.isNullOrUndefined(i.querySelector("."+q))?i.parentElement:i;t.removeClass([l.querySelector("."+q)],["e-connectorpoint-left-hover"]),t.removeClass([l.querySelector(".e-connectorpoint-right")],["e-connectorpoint-right-hover"])}this.editElement=null}}},i.prototype.getTaskBarAction=function(e){var i=this.getElementByPosition(e),r=this.taskBarEditRecord,n="";return i.classList.contains("e-taskbar-left-resizer")?n="LeftResizing":i.classList.contains("e-taskbar-right-resizer")?n="RightResizing":(i.classList.contains(B)||t.closest(i,"."+B))&&this.parent.taskFields.progress?n="ProgressResizing":i.classList.contains(q)?n="ConnectorPointLeftDrag":i.classList.contains("e-connectorpoint-right")?n="ConnectorPointRightDrag":i.classList.contains("e-gantt-manualparenttaskbar-right")?n="ParentResizing":i.classList.contains(H)||i.classList.contains("e-manualparent-main-container")||i.classList.contains("e-gantt-manualparent-milestone")||i.classList.contains("e-manualparent-milestone-top")||i.classList.contains("e-manualparent-milestone-bottom")||i.classList.contains("e-gantt-manualparent-milestone")?n="ManualParentDrag":r&&(n=r.hasChildRecords?"Auto"===this.parent.taskMode?"ParentDrag":"":r.ganttProperties.isMilestone?"MilestoneDrag":"ChildDrag"),n},i.prototype.updateMouseDownProperties=function(e){var i=this.getCoordinate(e);if(i.pageX||i.pageY){var r=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.parent.enableRtl?this.mouseDownX=Math.abs(i.pageX-(r.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseDownX=i.pageX-r.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseDownX,this.mouseDownY=this.dragMoveY=i.pageY-r.top+this.parent.ganttChartModule.scrollObject.previousScroll.top}if("ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop){var n=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(n=this.parent.toolbarModule.element.offsetHeight),this.topValue=this.parent.getOffsetRect(e.target).top-this.parent.getOffsetRect(this.parent.element).top-parseInt(t.closest(e.target,".e-taskbar-main-container").style.marginTop)-this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight-n+document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollTop,this.currentItemPrevTop=this.currentItemTop=this.topValue}"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.fromPredecessorText="ConnectorPointLeftDrag"===this.taskBarEditAction?"start":"finish",this.parent.connectorLineModule.tooltipTable.innerHTML=this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName,this.fromPredecessorText,"",""))},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 i=this;if(this.parent.isAdaptive){if(!this.canDrag)return;this.multipleSelectionEnabled()}var r=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),n=this.getCoordinate(e);if(this.parent.enableRtl?this.mouseMoveX=Math.abs(n.pageX-(r.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=n.pageX-r.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.mouseMoveY=n.pageY-r.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.dragMouseLeave=!1,this.isMouseDragCheck(),this.isMouseDragged&&this.taskBarEditAction){var a={cancel:!1,requestType:"taskbarediting",taskBarEditAction:this.taskBarEditAction,data:this.taskBarEditRecord};-1!==this.segmentIndex&&(a.requestType="mergeSegment"),this.parent.trigger("actionBegin",a,function(r){"ConnectorPointRightDrag"!==a.taskBarEditAction&&"ConnectorPointLeftDrag"!==a.taskBarEditAction&&"LeftResizing"!==a.taskBarEditAction&&"RightResizing"!==a.taskBarEditAction&&"ProgressResizing"!==a.taskBarEditAction&&"ChildDrag"!==a.taskBarEditAction&&"ParentDrag"!==a.taskBarEditAction&&"MilestoneDrag"!==a.taskBarEditAction&&"ManualParentDrag"!==a.taskBarEditAction||(i.parent.showIndicator=!1),!t.isNullOrUndefined(i.parent.loadingIndicator)&&"Shimmer"===i.parent.loadingIndicator.indicatorType&&i.parent.showIndicator?i.parent.showMaskRow():i.parent.showIndicator&&i.parent.showSpinner(),!1===r.cancel&&i.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;if(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()),"ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop){this.dragMoveY>this.mouseMoveY?(this.mouseMoveY=this.dragMoveY-this.mouseMoveY,this.currentItemTop=this.currentItemTop-this.mouseMoveY):(this.mouseMoveY-=this.dragMoveY,this.currentItemTop=this.currentItemTop+this.mouseMoveY);var s=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.dragMoveY=e.pageY-s.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.topValue=this.currentItemTop,this.currentItemPrevTop=0===this.currentItemPrevTop||this.topValue==this.currentItemTop?this.topValue:this.currentItemPrevTop}this.setItemPosition(),this.updateEditedItem(),this.editTooltip.updateTooltip(this.segmentIndex),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))}),this.parent.flatData.map(function(e){t.isNullOrUndefined(r.taskBarEditRecord.parentItem)||e.ganttProperties.taskId!==r.taskBarEditRecord.parentItem.taskId||e.childRecords.map(function(e){(t.isNullOrUndefined(e.ganttProperties.startDate)||t.isNullOrUndefined(e.ganttProperties.endDate)||t.isNullOrUndefined(e.ganttProperties.duration))&&r.parent.dataOperation.updateGanttData()})})}},i.prototype.updateMouseMoveProperties=function(e){var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),i=this.getCoordinate(e);(i.pageX||i.pageY)&&(this.parent.enableRtl?this.mouseMoveX=Math.abs(i.pageX-(t.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=i.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseMoveX,this.mouseMoveY=i.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top);var 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=0;n=this.parent.enableRtl?Math.abs(Math.abs(this.mouseMoveX)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left)+t.left):this.mouseMoveX-this.parent.ganttChartModule.scrollObject.previousScroll.left+t.left;var 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+40>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth&&this.parent.enableRtl&&0==this.parent.ganttChartModule.scrollObject.previousScroll.left?(this.parent.ganttChartModule.scrollObject.previousScroll.left=-1,this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):n-20<t.left?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("left")):a+80>t.top+this.parent.ganttChartModule.chartBodyContainer.offsetHeight?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("bottom")):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();var i=0;this.scrollTimer=window.setInterval(function(){-1==Math.sign(t.timerCount)&&(i=-1,t.timerCount=Math.abs(t.timerCount)),t.timerCount="right"===e?t.timerCount+1>=t.parent.timelineModule.totalTimelineWidth?t.parent.timelineModule.totalTimelineWidth:t.timerCount+1:"bottom"===e?t.timerCount+1:t.timerCount-1<0?0:t.timerCount-1,"bottom"===e||"top"===e?t.parent.ganttChartModule.scrollObject.setScrollTop(t.timerCount):t.parent.ganttChartModule.scrollObject.setScrollLeft(t.timerCount,i),"ConnectorPointLeftDrag"!==t.taskBarEditAction&&"ConnectorPointRightDrag"!==t.taskBarEditAction||t.drawFalseLine()},0)},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 ht({},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 ht({},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(d=1;d<e.segments.length;d++){var o=i[d];o.left=o.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(d=1;d<e.segments.length;d++){var l=i[d];l.left=l.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)if(n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,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(var d=1;d<e.segments.length;d++){var p=i[d];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 ht({},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,e.isMilestone,e);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])){s=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!==s||this.parent.includeWeekend||(s=1),i.offsetDuration=s}if(!t.isNullOrUndefined(e.segments[this.segmentIndex+1])){var a=e.segments[this.segmentIndex+1],s=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,a.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==a.startDate.getDay()||0!==s||this.parent.includeWeekend||(s=1),a.offsetDuration=s}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,t.isNullOrUndefined(e)?e.isMilestone:null,e),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,i,r){var n=new Date(this.parent.timelineModule.timelineStartDate.toString()),a=864e5/this.parent.perDayWidth;n.setTime(n.getTime()+e*a),i&&!t.isNullOrUndefined(r.predecessor)&&r.predecessor.length>0&&(n.setDate(n.getDate()-1),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,n),n=this.parent.dateValidationModule.checkStartDate(n,r,!0));var s="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier;return"Hour"!==s&&"Minutes"!==s&&(this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&!this.parent.isInDst(n)?n.setTime(n.getTime()+36e5):!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&this.parent.isInDst(n)&&n.setTime(n.getTime()-36e5)),n},i.prototype.setItemPosition=function(){var e=this.taskBarEditRecord.ganttProperties,i=this.parent.enableRtl?"right":"left",r=t.isNullOrUndefined(e.segments)?null:e.segments[this.segmentIndex],n="MilestoneDrag"===this.taskBarEditAction||e.isMilestone?this.parent.chartRowsModule.milestoneHeight:e.width,a=this.parent.isAdaptive?n-2:n-10;t.isNullOrUndefined(r)||(a=this.parent.isAdaptive?r.width-2:r.width-10);var s=this.taskBarEditElement.classList.contains(N)?this.taskBarEditElement:t.closest(this.taskBarEditElement,"tr."+L).querySelector("."+N),o=this.taskBarEditElement.classList.contains("e-segmented-taskbar"),l=t.closest(this.taskBarEditElement,"tr."+L).querySelector("."+I),d=t.closest(this.taskBarEditElement,"tr."+L).querySelector("."+E),p=this.taskBarEditElement.querySelector(".e-gantt-child-progressbar"),h=this.taskBarEditElement.querySelector("."+A),c=this.taskBarEditElement.querySelector("."+B),u=this.taskBarEditElement.querySelector(".e-taskbar-right-resizer"),g=this.taskBarEditElement.querySelector(".e-gantt-parent-taskbar"),f=this.taskBarEditElement.querySelector(".e-gantt-parent-progressbar"),m=this.taskBarEditElement.querySelector(".e-right-connectorpoint-outer-div"),y=this.taskBarEditElement,v=this.taskBarEditElement.querySelector("."+H),D=this.taskBarEditElement.querySelector(".e-gantt-manualparenttaskbar-right"),w=this.taskBarEditElement.querySelector(".e-gantt-manualparenttaskbar-left");if("ConnectorPointRightDrag"!==this.taskBarEditAction&&"ConnectorPointLeftDrag"!==this.taskBarEditAction){if("ParentResizing"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction){if(!o||t.isNullOrUndefined(e.segments)||"RightResizing"!==this.taskBarEditAction&&0===this.segmentIndex||(this.taskBarEditElement.style.width=r.width+"px",this.parent.enableRtl?this.taskBarEditElement.style.right=r.left+"px":this.taskBarEditElement.style.left=r.left+"px"),s.style.width=n+"px",l.style.width=e.left+"px",s.style.setProperty(i,e.left+"px"),"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&("ChildDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction)&&(s.style.setProperty("top",this.topValue+"px"),s.style.zIndex="4"),"LeftResizing"===this.taskBarEditAction&&0===this.segmentIndex)for(var k=this.taskBarEditElement.parentElement.getElementsByClassName("e-segmented-taskbar"),b=0;b<e.segments.length;b++){var T=e.segments[b],S=k[b];S.style.width=T.width+"px",this.parent.enableRtl?S.style.right=T.left+"px":S.style.left=T.left+"px"}t.isNullOrUndefined(d)||d.style.setProperty(i,e.left+n+"px")}if(m&&(this.parent.enableRtl?m.style.left=(this.parent.isAdaptive?n+10:n-2)+"px":m.style.left=(this.parent.isAdaptive?n+10:n+2)+"px"),"MilestoneDrag"===this.taskBarEditAction||e.isMilestone)s.style.setProperty(i,e.left-n/2+"px"),l.style.width=e.left-n/2+"px",t.isNullOrUndefined(d)||d.style.setProperty(i,e.left+n/2+"px");else if("ProgressResizing"===this.taskBarEditAction)if(-1===this.segmentIndex){if(h.style.setProperty(i,e.left+e.progressWidth-10+"px"),!t.isNullOrUndefined(p)){p.style.width=e.progressWidth+"px",p.style.borderBottomRightRadius=this.progressBorderRadius+"px",p.style.borderTopRightRadius=this.progressBorderRadius+"px";var P=this.parent.enableRtl?e.progressWidth+8:e.progressWidth-8;c.style.setProperty(i,P+"px")}}else{this.updateSegmentProgress(this.taskBarEditRecord.ganttProperties),p.style.width=e.segments[this.segmentIndex].progressWidth+"px",p.style.borderBottomRightRadius=this.progressBorderRadius+"px",p.style.borderTopRightRadius=this.progressBorderRadius+"px";var C=this.parent.enableRtl?e.segments[this.segmentIndex].progressWidth+8:e.segments[this.segmentIndex].progressWidth-8;c.style.setProperty(i,C+"px")}else"RightResizing"!==this.taskBarEditAction||t.isNullOrUndefined(h)?"ParentDrag"===this.taskBarEditAction?(t.isNullOrUndefined(g)||(g.style.width=n+"px"),t.isNullOrUndefined(p)||(f.style.width=e.progressWidth+"px")):"ParentResizing"===this.taskBarEditAction?(y.style.width=v.style.width=e.width+"px",D.style.setProperty(i,e.width-w.offsetLeft+"px")):"ManualParentDrag"===this.taskBarEditAction?y.style.setProperty(i,e.left-e.autoLeft+"px"):(t.isNullOrUndefined(h)||o||(h.style.width=n+"px"),t.isNullOrUndefined(p)||(u.style.setProperty(i,a+"px"),p.style.width=e.progressWidth+"px",t.isNullOrUndefined(c)||c.style.setProperty(i,e.progressWidth-10+"px")),o&&(u.style.setProperty(i,a+"px"),p.style.width=r.progressWidth+"px",t.isNullOrUndefined(c)||c.style.setProperty(i,r.progressWidth-10+"px"))):(h.style.width=n+"px",t.isNullOrUndefined(p)||(p.style.width=e.progressWidth+"px",u.style.setProperty(i,a+"px"),t.isNullOrUndefined(c)||c.style.setProperty(i,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||"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop)this.taskBarEditedAction(e),this.isMouseDragged=!1;else if(this.parent.isOnEdit=!1,this.cancelTaskbarEditActionInMouseLeave(),this.parent.enableCriticalPath&&this.parent.criticalPathModule){var 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&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)?(this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord,this.finalPredecessor),this.parent.UpdateOffsetOnTaskbarEdit&&this.parent.connectorLineEditModule.calculateOffset(this.connectorSecondRecord)):(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))},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,a=this.parent.currentViewData.indexOf(r);if(("MilestoneDrag"===i.taskBarEditAction||"ChildDrag"===i.taskBarEditAction)&&"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&this.dragMoveY>0){if(this.parent.rowDragAndDropModule){var s=this.parent.currentViewData;s[this.taskBarEditRecord.parentItem.index]&&-1===this.parent.editedRecords.indexOf(s[this.taskBarEditRecord.parentItem.index])&&this.parent.editedRecords.push(s[this.taskBarEditRecord.parentItem.index]);for(var o,l=0,d=0,p=void 0,h=this.parent.treeGrid.getRows().length,c=0;c<h;c++)l<this.dragMoveY&&"none"!==this.parent.getRowByIndex(c).style.display&&(d=c,l+=parseInt(this.parent.getRowByIndex(c).style.height),s[c].parentItem?this.parent.getRecordByID(s[c].parentItem.taskId):s[c]);for(var u=this.parent.getRowByIndex(a).getElementsByClassName("e-taskbar-main-container"),g=this.parent.getRowByIndex(d).getElementsByClassName("e-taskbar-main-container"),f=0;f<g.length;f++)g[f].offsetTop<this.dragMoveY&&u[0].getAttribute("rowuniqueid")!==g[f].getAttribute("rowuniqueid")&&(this.draggedRecordMarginTop=g[f].style.marginTop,o=g[f].getAttribute("rowuniqueid"));if(o&&(p=this.parent.currentViewData.filter(function(e){return e.rowUniqueID===o?e:null})),p){var m=this.parent.currentViewData.indexOf(p[0]),y=p[0].hasChildRecords||!p[0].parentItem&&0==p[0].childRecords.length?"child":"below";this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.reorderRows([a],m,y),this.dragMoveY=0}}"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.parent.ganttChartModule.renderOverAllocationContainer()}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 v=i.data.ganttProperties.segments;if(!t.isNullOrUndefined(v)&&v.length>0&&("LeftResizing"===this.taskBarEditAction&&0!==this.segmentIndex||"ChildDrag"===this.taskBarEditAction&&0!==this.segmentIndex||"RightResizing"===this.taskBarEditAction)){var D=v[this.segmentIndex],w=this.taskBarEditRecord.ganttProperties,k=0===this.segmentIndex?null:v[this.segmentIndex-1],b=this.segmentIndex===v.length-1?null:v[this.segmentIndex+1],T=t.isNullOrUndefined(b)?this.parent.cloneProjectEndDate:new Date(b.startDate.getTime()),S=t.isNullOrUndefined(k)?this.parent.cloneProjectStartDate:new Date(k.endDate.getTime()),P=new Date(D.startDate.getTime()),C=new Date(D.endDate.getTime());if("Day"===this.parent.timelineModule.topTier&&"Hour"===this.parent.timelineModule.bottomTier?(P.setHours(P.getHours()-1),C.setHours(C.getHours()+1)):(T.setHours(0,0,0,0),S.setHours(0,0,0,0),P.setDate(P.getDate()-1),C.setDate(C.getDate()+1),P.setHours(0,0,0,0),C.setHours(0,0,0,0)),P.getTime()<=S.getTime()&&!t.isNullOrUndefined(k)&&!t.isNullOrUndefined(D)){R=[{firstSegmentIndex:k.segmentIndex,secondSegmentIndex:D.segmentIndex}];this.parent.chartRowsModule.mergeTask(w.taskId,R)}else if(C.getTime()>=T.getTime()&&this.segmentIndex!==v.length-1){var R=[{firstSegmentIndex:D.segmentIndex,secondSegmentIndex:b.segmentIndex}];this.parent.chartRowsModule.mergeTask(w.taskId,R)}else if(C.getTime()>=T.getTime()){D.endDate.setDate(this.parent.cloneProjectEndDate.getDate()-1),D.startDate=this.parent.dataOperation.getStartDate(D.endDate,D.duration,w.durationUnit,w);for(c=v.length-2;c>=0;c++){var M=v[c],O=M.endDate;O.setDate(O.getDate()-M.offsetDuration),M.endDate=O,M.startDate=this.parent.dataOperation.getStartDate(M.endDate,M.duration,w.durationUnit,w)}}}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=180*Math.atan2(a-r,n-i)/Math.PI,l="rotate("+(this.parent.enableRtl?-o:o)+"deg)",d=0;t.isNullOrUndefined(document.querySelectorAll(".e-chart-row")[0])||(d=document.querySelectorAll(".e-chart-row")[0].offsetWidth),"ConnectorPointLeftDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?d-(this.elementOffsetLeft+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft-this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),"ConnectorPointRightDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?d-(this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left));var p=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:"position: absolute;transform:"+l+";border-top-width: 1px;border-top-style: dashed;z-index: 5;width:"+(s-3)+"px;top:"+p+"px;"}),this.parent.enableRtl?(this.falseLine.style.left="auto",this.falseLine.style.right=e+"px",this.falseLine.style.transformOrigin="100% 0%"):(this.falseLine.style.right="auto",this.falseLine.style.left=e+"px",this.falseLine.style.transformOrigin="0% 100%"),this.parent.ganttChartModule.chartBodyContainer.appendChild(this.falseLine)},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(".e-connector-line-container"),["e-connector-line-z-index"])))},i.prototype.updateConnectorLineSecondProperties=function(e){var i=this.getElementByPosition(e),r=g(i,N);this.connectorSecondAction=null;var n=0;g(i,q)?(this.connectorSecondAction="ConnectorPointLeftDrag",this.toPredecessorText="Start"):g(i,"e-connectorpoint-right")?(this.connectorSecondAction="ConnectorPointRightDrag",this.toPredecessorText="Finish"):(this.connectorSecondAction=null,this.toPredecessorText=null),this.taskBarEditElement!==r&&this.taskBarEditElement!==this.highlightedSecondElement&&(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&(n=this.parent.virtualScrollModule.getTopPosition()),(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&!this.elementOffsetLeft||!this.parent.enableVirtualization)&&(this.parent.allowParentDependency&&this.taskBarEditElement.children[0].classList.contains("e-manualparent-main-container")?(this.elementOffsetLeft=this.taskBarEditElement.children[0].offsetLeft+this.taskBarEditElement.offsetLeft,this.elementOffsetTop=this.taskBarEditElement.offsetTop-5+this.taskBarEditElement.children[0].offsetTop+n):(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.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)&&(this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),t.removeClass([this.connectorSecondElement.querySelector("."+q)],["e-connectorpoint-allow-block"]),t.removeClass([this.connectorSecondElement.querySelector(".e-connectorpoint-right")],["e-connectorpoint-allow-block"])),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+(this.parent.enableRtl?"F":"S"):"ConnectorPointRightDrag"===this.taskBarEditAction&&(r=d+(this.parent.enableRtl?"S":"F")),this.connectorSecondAction&&("ConnectorPointLeftDrag"===this.connectorSecondAction?(r+=this.parent.enableRtl?"F":"S",n=this.parent.enableRtl?"finish":"start"):"ConnectorPointRightDrag"===this.connectorSecondAction&&(r+=this.parent.enableRtl?"S":"F",n=this.parent.enableRtl?"start":"finish")),t.isNullOrUndefined(s))return void(this.drawPredecessor=!1);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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||"ValidateDependency"==c.requestType?"ValidateDependency"!=c.requestType&&this.parent.showSpinner():this.parent.showMaskRow(),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(q)||o.classList.contains("e-connectorpoint-right"))&&this.showHideActivePredecessors(!0):t.addClass([l],["e-connectorpoint-allow-block"]),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}(R),ut=function(){function e(e){this.updatedEditFields=null,this.updatedAddFields=null,this.addedRecord=null,this.dialogEditValidationFlag=!1,this.ganttResources=[],this.isValidData=!0,this.previousResource=[],this.isResourceUpdate=!1,this.parent=e,this.localeObj=this.parent.localeObj,this.beforeOpenArgs={cancel:!1},this.types=this.getPredecessorType(),this.rowData={},this.editedRecord={},this.inputs={booleanedit: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]):i[a].field===r.type?(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;t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.ganttProperties)||("string"==typeof e.ganttProperties.taskId?this.numericOrString="stringedit":this.numericOrString="numericedit"),t.isNullOrUndefined(e.ganttProperties)&&!t.isNullOrUndefined(e)&&(isNaN(Number(e))||"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?this.numericOrString="stringedit":this.numericOrString="numericedit")),"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});a.classList.add("e-gantt-dialog"),i.element.appendChild(a),r.animationSettings={effect:"None"},r.header=this.localeObj.getConstant(this.isEdit?"editDialogTitle":"addDialogTitle"),r.isModal=!0,r.enableRtl=this.parent.enableRtl,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;t.isNullOrUndefined(a)&&""===a||("General"===(a=(a=a.replace(e.element.id,"")).replace("TabContainer",""))?this.destroyCustomField(n):"Dependency"===a?n.ej2_instances[0].destroy():"Notes"===a?n.ej2_instances[0].destroy():"Resources"===a?n.ej2_instances[0].destroy():-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,l.enableRtl=this.parent.enableRtl,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(d){if(t.isNullOrUndefined(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.showSpinner():a.parent.showMaskRow(),a.renderTabItems(),!d.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 p={action:"OpenDialog",requestType:a.isEdit?"openEditDialog":"openAddDialog",data:a.beforeOpenArgs.rowData,element:a.dialog,cancel:!1};a.parent.trigger("actionComplete",p,function(e){t.isNullOrUndefined(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.hideSpinner():a.parent.hideMaskRow(),e.cancel&&a.resetValues()})}})},e.prototype.tabSelectedEvent=function(e){var i=this.parent,r=e.selectedContent.childNodes[0].id;this.parent.isAdaptive&&this.responsiveTabContent(r,i),r===i.element.id+"ResourcesTabContainer"?this.resourceSelection(r):r===i.element.id+"NotesTabContainer"?(document.getElementById(r).ej2_instances[0].refresh(),document.querySelector("#"+this.parent.element.id+"NotesTabContainer").style.overflow="scroll"):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(t.isNullOrUndefined(this.parent.taskFields.id)||t.isNullOrUndefined(this.parent.columnMapping.id)||t.isNullOrUndefined(this.numericOrString)||s.id===e.field&&(e.editType=this.numericOrString),e.editType){case"booleanedit":var l={label:e.headerText,locale:a,enableRtl:this.parent.enableRtl};i[e.field]=l;break;case"defaultedit":case"stringedit":var d=o;d.enableRtl=this.parent.enableRtl,e.field!==n.columnMapping.duration&&e.field!==n.columnMapping.id&&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;p.enableRtl=this.parent.enableRtl,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.enableRtl=this.parent.enableRtl,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.enableRtl=this.parent.enableRtl,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(e.field===n.columnMapping.type||e.field===n.columnMapping.manual){var u=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];o.dataSource=u,o.fields={value:"Value"};var g=o;g.enableRtl=this.parent.enableRtl,g.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;t.isNullOrUndefined(r.editModule.dialogModule.dialog)||(a=r.editModule.dialogModule.dialog);var s,o=null,l=r.editModule.dialogModule.editedRecord,p=null,h=null,c="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,u=this.parent.viewType;if(t.isNullOrUndefined(e.element)?t.isNullOrUndefined(e.container)?t.isNullOrUndefined(e.event)||t.isNullOrUndefined(e.event.path)||t.isNullOrUndefined(e.event.path)[1]||(o=(s=e.event.path[1]).querySelector("input").getAttribute("id"),s=s.querySelector("#"+o)):(o=(s=e.container).querySelector("input").getAttribute("id"),s=s.querySelector("#"+o)):o=(s=e.element).getAttribute("id"),t.isNullOrUndefined(s))p=e.value,h=i.field;else if(p=s.value,h=o.replace(r.element.id,""),"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType){var g=function(e){return"ResourceView"===u?-1===c.indexOf("T"+e.value)&&-1===c.indexOf("R"+e.value):-1===c.indexOf(e.value)},f={rules:(n={},n[this.parent.taskFields.id]={required:!0,minLength:[g,"ID is already present, please enter new value"]},n)};new d.FormValidator("#"+this.parent.element.id+"GeneralTabContainer",f)}if(0===h.search("Segments"))return h=h.replace("SegmentsTabContainer",""),this.validateSegmentFields(r,h,p,e),!0;this.validateScheduleValuesByCurrentField(h,p,this.editedRecord);var m=l.ganttProperties,y=r.taskFields;return t.isNullOrUndefined(y.startDate)||y.startDate===h||this.updateScheduleFields(a,m,"startDate"),y.endDate===h&&!t.isNullOrUndefined(m.startDate)&&!t.isNullOrUndefined(e.value)&&m.startDate.getTime()>e.value&&this.updateScheduleFields(a,m,"endDate"),t.isNullOrUndefined(y.endDate)||y.endDate===h||this.updateScheduleFields(a,m,"endDate"),t.isNullOrUndefined(y.duration)||y.duration===h||this.updateScheduleFields(a,m,"duration"),t.isNullOrUndefined(y.work)||y.work===h||this.updateScheduleFields(a,m,"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.parent.setRecordValue(s.duration,i,r),this.parent.setRecordValue("taskData."+s.duration,a.duration,r)),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);t.isNullOrUndefined(a.startDate)&&t.isNullOrUndefined(l)&&a.startDate.getTime()>l.getTime()&&(l=a.endDate),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))),e===s.type&&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=this,o=0;o<e.length;o++)!function(r){var n={};switch(e[r]){case"startDate":case"endDate":n={field:e[r],headerText:s.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:s.parent.getDateFormat()},"startDate"===e[r]&&(n.validationRules={required:!0}),a.push(n);break;case"duration":n={field:e[r],headerText:s.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);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]),t.isNullOrUndefined(n.value)||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))}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){return(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"]),{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&&!this.parent.allowParentDependency&&(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,r=!1;if(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)if(-1!==this.parent.customColumns.indexOf(e.field))r=!0;else if(e.field===this.parent.taskFields.id||e.field===this.parent.taskFields.name||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.startDate||e.field===this.parent.taskFields.endDate||e.field===this.parent.taskFields.baselineStartDate||e.field===this.parent.taskFields.baselineEndDate||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type){for(var n=0;n<this.parent.currentViewData.length;n++)if(!t.isNullOrUndefined(this.parent.currentViewData[n].ganttProperties.taskId)){i=this.parent.currentViewData[n].ganttProperties.taskId;break}r="string"!=typeof i}return this.isEdit&&(e.field===this.parent.taskFields.id&&(r=!0),this.editedRecord.hasChildRecords&&(e.field===this.parent.taskFields.endDate&&(!t.isNullOrUndefined(this.editedRecord.isManual)&&!1===this.editedRecord.isManual||"Auto"===this.parent.taskMode)||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type)&&(r=!0)),r},e.prototype.isParentValid=function(e){if(e.length>0)for(var t=0;t<e.length;t++){if(e[t].uniqueID==this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}if(e[t].hasChildRecords&&this.isParentValid(e[t].childRecords),!this.isValidData)break}return this.isValidData},e.prototype.renderPredecessorTab=function(e){var 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,enableRtl:i.parent.enableRtl,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=this,o=0;o<=a.length;o++)!function(r){s.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)}},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=[];if("ResourceView"===this.parent.viewType)for(y=0;y<r.currentViewData.length;y++)for(var h=0;h<r.resources.length;h++)r.currentViewData[y][r.taskFields.id]===r.resources[h][n.id]&&(r.currentViewData[y].hasChildRecords||t.isNullOrUndefined(r.currentViewData[y].parentItem))&&p.push(r.resources[h]);else p=t.extend([],[],r.resources,!0);if(this.parent.dataOperation.updateResourceUnit(p),!t.isNullOrUndefined(o)){var c=void 0,u=o.length,g=void 0,f=p.length;for(c=0;c<u;c++)for(g=0;g<f;g++)o[c][n.id]===p[g][n.id]&&(p[g][n.unit]=o[c][n.unit])}l.dataSource=p;var m=s.ganttProperties.resourceInfo;if(this.isEdit&&!t.isNullOrUndefined(m))for(var y=0;y<m.length;y++)this.ganttResources.push(m[y]);l.rowSelected=function(e){i.updateResourceCollection(e,d)},l.rowDeselected=function(e){i.updateResourceCollection(e,d)};var v=this.createDivElement("e-resource-div",d);a.TreeGrid.Inject(a.Selection,a.Filter,a.Edit,a.VirtualScroll);var D=new a.TreeGrid(l),w=this.parent.columnByField[this.parent.taskFields.resourceInfo];return(!1===w.allowEditing||w.isPrimaryKey||this.parent.readOnly)&&(D.allowSelection=!1,D.allowFiltering=!1,D.editSettings.allowEditing=!1),D.dataBound=function(){if(i.parent.editDialogFields.length>=1&&"Resources"===i.parent.editDialogFields[0].type){var e=i.parent.element.id+"ResourcesTabContainer";i.resourceSelection(e)}},D.appendTo(v),v},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];i.enableHtmlSanitizer=this.parent.enableHtmlSanitizer;var r=this.editedRecord.ganttProperties,n=this.createDivElement("",t.element.id+""+e+"TabContainer");l.RichTextEditor.Inject(l.Toolbar,l.Link,l.HtmlEditor,l.QuickToolbar,l.Count),i.value=r.notes;var a=this.parent.columnByField[this.parent.taskFields.notes];return(!1===a.allowEditing||a.isPrimaryKey||this.parent.readOnly)&&(i.enabled=!1),new l.RichTextEditor(i).appendTo(n),n},e.prototype.renderInputElements=function(e,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=t.isNullOrUndefined(e.enabled)?!this.isCheckIsDisabled(i):e.enabled,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(this.parent.allowParentDependency){var r=i;if(i.parentUniqueID===this.beforeOpenArgs.rowData.uniqueID)this.isValidData=!1;else do{if(r.parentItem&&(r=this.parent.flatData[this.parent.ids.indexOf(r.parentItem.taskId)]).uniqueID===this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}}while(r.parentItem);if(i.hasChildRecords&&this.isValidData&&(this.isValidData=this.isParentValid(i.childRecords)),!this.isValidData){this.isValidData=!0;continue}}else if(i.hasChildRecords)continue;var n="ResourceView"===this.parent.viewType?i.ganttProperties.taskId.toString():i.ganttProperties.rowUniqueID.toString(),a={id:n,text:n+"-"+i.ganttProperties.taskName,value:n};this.preTaskIds.push(a.id),this.preTableCollection.push(a)}},e.prototype.predecessorEditCollection=function(e){var 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++){var a=o[this.parent.taskFields.resourceInfo][r].toString(),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,r=e.ej2_instances[0],n=r.isEdit;r.isEdit&&r.endEdit(),i=n&&r.currentViewData.length!=r.dataSource.length?r.dataSource:r.currentViewData,this.updateSegmentTaskData(i)},e.prototype.updateGeneralTab=function(e,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];if("stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType&&p===this.parent.taskFields.id){var c=h.value.toString();h.value=c}var u=n.columnByField[p];if(!t.isNullOrUndefined(u.edit)&&t.isNullOrUndefined(u.edit.params)){var g=u.edit.read;"string"==typeof g?(g=r.getObject(g,window),s[p]=g(d,h.value)):s[p]=u.edit.read(d,h.value)}else i&&"booleanedit"===u.editType?!0===d.checked?s[p]=!0:s[p]=!1:(s[p]=h.value,this.parent.enableHtmlSanitizer&&"string"==typeof h.value&&(h.value=t.SanitizeHtmlHelper.sanitize(h.value),s[p]=h.value))}}this.isEdit&&(i||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),this.parent.setRecordValue("type",e.ganttProperties.taskType,i.ganttProperties,!0),this.parent.setRecordValue("resourceNames",e.ganttProperties.resourceNames,i.ganttProperties,!0),this.parent.setRecordValue("resourceInfo",e.ganttProperties.resourceInfo,i.ganttProperties,!0),t.isNullOrUndefined(this.parent.taskFields.startDate)||this.parent.dataOperation.updateMappingData(i,this.parent.taskFields.startDate),t.isNullOrUndefined(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(i,this.parent.taskFields.endDate),t.isNullOrUndefined(this.parent.taskFields.duration)||(this.parent.dataOperation.updateMappingData(i,this.parent.taskFields.duration),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,this.rowData,!0),0===this.rowData.ganttProperties.duration?this.parent.setRecordValue("isMilestone",!0,i.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),t.isNullOrUndefined(this.parent.taskFields.type)||this.parent.dataOperation.updateMappingData(this.rowData,"type"),t.isNullOrUndefined(this.parent.taskFields.resourceInfo)||this.parent.dataOperation.updateMappingData(this.rowData,"resourceInfo")},e.prototype.updatePredecessorTab=function(e){var t=e.ej2_instances[0];t.isEdit&&t.endEdit();for(var i=t.dataSource,r=[],n=[],a="",s=[],o=0;o<i.length;o++){var l=i[o];if(-1===s.indexOf(l.id)){var d=l.id+l.type;l.offset&&-1!==l.offset.indexOf("-")?d+=l.offset:d+="+"+l.offset,r.push(d),s.push(l.id)}}this.isEdit?(r.length>0?(n=this.parent.predecessorModule.calculatePredecessor(r.join(","),this.rowData),this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=this.parent.predecessorModule.getPredecessorStringValue(this.rowData)):(n=[],this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=""),this.parent.setRecordValue("predecessorsName",a,this.rowData.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,this.rowData),this.parent.setRecordValue(this.parent.taskFields.dependency,a,this.rowData),this.parent.predecessorModule.updateUnscheduledDependency(this.rowData)):this.addedRecord[this.parent.taskFields.dependency]=r.length>0?r.join(","):""},e.prototype.updateResourceTab=function(e){var 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.editedRecord.ganttProperties,!0),this.parent.dataOperation.updateMappingData(this.editedRecord,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(this.editedRecord,"resource"),this.validateDuration(this.editedRecord),this.updateScheduleProperties(this.editedRecord,this.rowData);else{for(var 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?(!1===t.columnByField[t.taskFields.notes].disableHtmlEncode?this.parent.setRecordValue("notes",i.getHtml(),this.rowData.ganttProperties,!0):this.parent.setRecordValue("notes",i.getText(),this.rowData.ganttProperties,!0),t.dataOperation.updateMappingData(this.rowData,"notes")):this.addedRecord[this.parent.taskFields.notes]=i.getHtml()},e.prototype.updateCustomTab=function(e){this.updateGeneralTab(e,!0)},e}(),gt=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,"e-line"),i=g(e,"e-connector-line-right-arrow"),r=g(e,"e-connector-line-left-arrow");return t||i||r?g(e,"e-connector-line-container"):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],["e-connector-line-hover-z-index"]),e.querySelectorAll(".e-line")[0].classList.contains("e-criticalconnector-line")?(t.addClass(e.querySelectorAll(".e-line"),["e-critical-connector-line-hover"]),t.addClass(e.querySelectorAll(".e-connector-line-right-arrow"),["e-critical-connector-line-right-arrow-hover"]),t.addClass(e.querySelectorAll(".e-connector-line-left-arrow"),["e-critical-connector-line-left-arrow-hover"])):(t.addClass(e.querySelectorAll(".e-line"),["e-connector-line-hover"]),t.addClass(e.querySelectorAll(".e-connector-line-right-arrow"),["e-connector-line-right-arrow-hover"]),t.addClass(e.querySelectorAll(".e-connector-line-left-arrow"),["e-connector-line-left-arrow-hover"]))},e.prototype.removeHighlight=function(){t.isNullOrUndefined(this.connectorLineElement)||(t.removeClass([this.connectorLineElement],["e-connector-line-hover-z-index"]),this.connectorLineElement.querySelectorAll(".e-line")[0].classList.contains("e-critical-connector-line-hover")?(t.removeClass(this.connectorLineElement.querySelectorAll(".e-line"),["e-critical-connector-line-hover"]),t.removeClass(this.connectorLineElement.querySelectorAll(".e-connector-line-right-arrow"),["e-critical-connector-line-right-arrow-hover"]),t.removeClass(this.connectorLineElement.querySelectorAll(".e-connector-line-left-arrow"),["e-critical-connector-line-left-arrow-hover"])):(t.removeClass(this.connectorLineElement.querySelectorAll(".e-line"),["e-connector-line-hover"]),t.removeClass(this.connectorLineElement.querySelectorAll(".e-connector-line-right-arrow"),["e-connector-line-right-arrow-hover"]),t.removeClass(this.connectorLineElement.querySelectorAll(".e-connector-line-left-arrow"),["e-connector-line-left-arrow-hover"])),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),(!this.parent.allowParentDependency&&a&&!0===a.expanded||s&&!0===s.expanded||this.parent.allowParentDependency&&(a||s))&&(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,r=e.split(","),n=[],a=[],s=0;s<r.length;s++){var o=[];i=r[s].split("+"),r[s].indexOf("-")>=0&&(i=r[s].split("-")),t.isNullOrUndefined(i[0])||(-1===("ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids).indexOf(i[0])?-1!==i[0].indexOf(" ")?(1===(a=i[0].split(" ")).length&&(a=i[0].match(/(\d+|[A-z]+)/g)),o.push(a[0])):1===i[0].length||2===i[0].length?o.push(i[0]):o.push(i[0].slice(0,-2)):o.push(i[0])),n.push(o.join(""))}return n},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=this;null!==r;){var d=function(){var e=[];return-1!==o.indexOf(r)?"break":t.isNullOrUndefined(l.parent.connectorLineModule.getRecordByID(r))?{value:!1}:(n=l.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"))}();if("object"==typeof d)return d.value;if("break"===d)break}}return!0},e.prototype.getRootParent=function(e){var t=e;return e.parentItem?((t=this.parent.flatData.filter(function(t){return t.uniqueID===e.parentUniqueID})[0]).parentItem&&(t=this.getRootParent(t)),t):t},e.prototype.validateParentPredecessor=function(e,t){if(t.hasChildRecords&&!e.hasChildRecords){if(e.parentUniqueID===t.uniqueID)return!1;do{if(e.parentItem&&(e=this.parent.flatData[this.parent.ids.indexOf(e.parentItem.taskId)]).uniqueID===t.uniqueID)return!1}while(e.parentItem)}else if(!t.hasChildRecords&&e.hasChildRecords){if(t.parentUniqueID===e.uniqueID)return!1;do{if(t.parentItem&&(t=this.parent.flatData[this.parent.ids.indexOf(t.parentItem.taskId)]).uniqueID===e.uniqueID)return!1}while(t.parentItem)}else if(t.hasChildRecords&&e.hasChildRecords)if(t.parentItem&&e.parentItem){if(e.parentUniqueID===t.uniqueID||e.uniqueID===t.parentUniqueID)return!1}else if(!t.parentItem&&e.parentItem){if(this.parent.connectorLineEditModule.getRootParent(e).uniqueID===t.uniqueID)return!1}else if(t.parentItem&&!e.parentItem&&this.parent.connectorLineEditModule.getRootParent(t).uniqueID===e.uniqueID)return!1;return!0},e.prototype.validatePredecessorRelation=function(e,i){var r,n,a=!0,s="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(!t.isNullOrUndefined(i)&&i.length>0){r=this.idFromPredecessor(i);for(var o=this,l=0;l<r.length;l++){var d=function(i){if(o.parent.allowParentDependency){if(parseInt(r[r.length-1])!==e[o.parent.taskFields.id]){var l=o.parent.ids.indexOf(r[r.length-1]),d=o.parent.currentViewData[l];d&&e&&(a=o.validateParentPredecessor(d,e))}}else if(!o.checkParentRelation(e,r))return{value:!1};var p=[],h=!0;if(r.slice(0).forEach(function(e){-1===p.indexOf(e)?p.push(e):h=!1}),!h)return{value:!1};n=r[i];var c=[];r.slice(0).splice(i,1);for(;null!==n;){var u=function(){var i,r,a=[];if(-1!==c.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&&(a.push(e.from.toString()),i=t)}),s.toString()===r.rowUniqueID.toString()||-1!==a.indexOf(s.toString()))return{value:!1};if(c.push(n),t.isNullOrUndefined(r.predecessor)||!(r.predecessor.length>0))return"break";var l=void 0;return a.length>1?l=o.predecessorValidation(a,e.ganttProperties):1===a.length&&(n=r.predecessor[i].from),!1===l?{value:!1}:void 0}();if("object"==typeof u)return u;if("break"===u)break}}(l);if("object"==typeof d)return d.value}}return a},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=this,n=0;n<t.length;n++){var a=function(e){var i=r.parent.currentViewData.filter(function(i){return i&&i.ganttProperties.rowUniqueID.toString()===t[e].toString()});if(i[0]&&i[0].hasChildRecords)return{value:!1}}(n);if("object"==typeof a)return a.value}return!0},e.prototype.initPredecessorValidationDialog=function(){if(this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation){var e=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,enableRtl:this.parent.enableRtl,visible:!1,width:"50%",showCloseIcon:!0,close:this.validationDialogClose.bind(this),content:"",buttons:[{click:this.validationDialogOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.validationDialogCancelButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});document.getElementById(this.parent.element.id+"_dialogValidationRule").innerHTML="",e.isStringTemplate=!0,e.appendTo("#"+this.parent.element.id+"_dialogValidationRule"),this.parent.validationDialogElement=e},e.prototype.validationDialogOkButton=function(){var e=this.parent.currentEditedArgs;e.validateMode.preserveLinkWithEditing=document.getElementById(this.parent.element.id+"_ValidationAddlineOffset").checked,e.validateMode.removeLink=document.getElementById(this.parent.element.id+"_ValidationRemoveline").checked,e.validateMode.respectLink=document.getElementById(this.parent.element.id+"_ValidationCancel").checked,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogCancelButton=function(){this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogClose=function(e){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.checkChildRecords(t),this.parent.editModule.updateEditedTask(e.editEventArgs)):e.validateMode.preserveLinkWithEditing&&(this.parent.UpdateOffsetOnTaskbarEdit&&this.calculateOffset(t),this.parent.editModule.updateEditedTask(e.editEventArgs))},e.prototype.checkChildRecords=function(e){if(this.validationPredecessor=e.ganttProperties.predecessor,t.isNullOrUndefined(this.validationPredecessor)||this.removePredecessors(e,this.validationPredecessor),e.childRecords.length>0)for(var i=0;i<e.childRecords.length;i++){var r=e.childRecords[i];this.validationPredecessor=r.ganttProperties.predecessor,t.isNullOrUndefined(this.validationPredecessor)||this.removePredecessors(r,this.validationPredecessor),r.childRecords.length>0&&this.checkChildRecords(r)}else if(!t.isNullOrUndefined(e.parentItem)){var n=this.parent.getRecordByID(e.parentItem.taskId);this.validationPredecessor=n.ganttProperties.predecessor,this.removePredecessors(n,this.validationPredecessor)}},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[parseInt(n.toString(),10)],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[b(a,"from",i,"to")].offset=o;var u=t.extend([],s.ganttProperties.predecessor,[],!0);u[b(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){var r=t.extend([],[],e.ganttProperties.predecessor,!0);if(!t.isNullOrUndefined(i)){for(var 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=b(i[a],"from",r,"to");r.splice(l,1);var d=b(i[parseInt(a.toString(),10)],"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,i){var r,n,a=this.parent.predecessorModule.getValidPredecessor(e);this.validationPredecessor=[];var s,o,l=this.parent.predecessorModule.getPredecessorDate(e,a);n=i?i.ganttProperties:e.ganttProperties;for(var d=this.parent.allowUnscheduledTasks&&t.isNullOrUndefined(l)?n.endDate:this.dateValidateModule.getEndDate(l,n.duration,n.durationUnit,n,!1),p=0;p<a.length;p++){r=this.parent.connectorLineModule.getRecordByID(a[p].from);var h=null;"FS"===a[p].type?n.startDate<l?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskBeforePredecessor_FS"):n.startDate>l&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskAfterPredecessor_FS"):"SS"===a[p].type?n.startDate<l?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskBeforePredecessor_SS"):n.startDate>l&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskAfterPredecessor_SS"):"FF"===a[p].type?d<=r.ganttProperties.endDate?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskBeforePredecessor_FF"):d>r.ganttProperties.endDate&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskAfterPredecessor_FF"):"SF"===a[p].type&&(d<r.ganttProperties.startDate?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskBeforePredecessor_SF"):d>=r.ganttProperties.startDate&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskAfterPredecessor_SF")),!t.isNullOrUndefined(h)&&t.isNullOrUndefined(o)&&(s=r,o=h)}return{parentTask:s,task:e,violationType:o}},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[parseInt(a.toString(),10)].from))===e)e.ganttProperties.predecessor.push(n[parseInt(a.toString(),10)]);else{var s=t.extend([],[],d.ganttProperties.predecessor,!0),o=b(n[parseInt(a.toString(),10)],"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[parseInt(l.toString(),10)].from);(s=t.extend([],[],d.ganttProperties.predecessor,!0)).push(r[parseInt(l.toString(),10)]),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=b(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,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmPredecessorDelete"),buttons:[{click:this.confirmOkDeleteButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.confirmCloseDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});var e=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}(),ft=function(){function e(e){if(this.isFromDeleteMethod=!1,this.targetedRecords=[],this.isNewRecordAdded=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.confirmDialog=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,this.isBreakLoop=!1,this.isResourceTaskDeleted=!1,this.deletedTaskDetails=[],this.parent=e,this.validatedChildItems=[],this.parent.editSettings.allowEditing&&"Auto"===this.parent.editSettings.mode&&(this.cellEditModule=new lt(this.parent)),this.parent.taskFields.dependency&&(this.parent.connectorLineEditModule=new gt(this.parent)),(this.parent.editSettings.allowAdding||this.parent.editSettings.allowEditing&&("Dialog"===this.parent.editSettings.mode||"Auto"===this.parent.editSettings.mode))&&(this.dialogModule=new ut(this.parent)),this.parent.editSettings.allowTaskbarEditing&&(this.taskbarEditModule=new ct(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){var t={min:0,decimals:0,enableRtl:this.parent.enableRtl,validateDecimalOnType:!0,format:"n0",showSpinButton:!1};this.updateEditParams(e,t)},e.prototype.updateProgessColumnEditParams=function(e){var t={min:0,enableRtl:this.parent.enableRtl,decimals:0,validateDecimalOnType:!0,max:100,format:"n0"};this.updateEditParams(e,t)},e.prototype.updateEditParams=function(e,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},enableRtl:i.parent.enableRtl,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),enableRtl:i.parent.enableRtl,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 lt(this.parent)),this.parent.editModule.dialogModule&&"Auto"===e.mode?this.parent.treeGrid.recordDoubleClick=void 0:t.isNullOrUndefined(this.parent.editModule.dialogModule)&&(this.dialogModule=new ut(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 ct(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,a.cssClass].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.cssClass)m="cssClass";else if(h===a.segments&&!t.isNullOrUndefined(i.ganttProperties.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),i.ganttProperties.baselineEndDate&&0===i.ganttProperties.baselineEndDate.getHours()&&86400!==this.parent.defaultEndTime&&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(h===a.type)n.setRecordValue("taskType",e[h],i.ganttProperties,!0);else if(-1!==n.customColumns.indexOf(h)){var 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&&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,r,n=this.isCheckPredecessor(e.data);if(t.isNullOrUndefined(e.data.parentItem)||n){if(e.data.childRecords.length>0&&!n&&!(n=this.isCheckPredecessor(e.data))&&this.isTaskbarMoved(e.data))for(var a=0;a<e.data.childRecords.length;a++)this.parent.predecessorModule.getValidPredecessor(e.data.childRecords[a]).length>0&&(r=a,n=!0)}else i=this.parent.getRecordByID(e.data.parentItem.taskId),n=!!(this.isTaskbarMoved(e.data)&&this.parent.predecessorModule.getValidPredecessor(i).length>0&&this.parent.isInPredecessorValidation);this.taskbarMoved=this.isTaskbarMoved(e.data),this.predecessorUpdated=this.isPredecessorUpdated(e.data),this.predecessorUpdated&&(this.parent.isConnectorLineUpdate=!0,this.parent.connectorLineEditModule.addRemovePredecessor(e.data));var s={};if(n)if(s=t.isNullOrUndefined(i)?t.isNullOrUndefined(r)?this.parent.connectorLineEditModule.validateTypes(e.data):this.parent.connectorLineEditModule.validateTypes(e.data.childRecords[r],e.data):this.parent.connectorLineEditModule.validateTypes(i,e.data),this.parent.isConnectorLineUpdate=!0,t.isNullOrUndefined(t.getValue("violationType",s)))this.updateEditedTask(e);else{var o=this.validateTaskEvent(e);!1===o.validateMode.preserveLinkWithEditing&&!1===o.validateMode.removeLink&&!1===o.validateMode.respectLink?this.parent.connectorLineEditModule.openValidationDialog(s):this.parent.connectorLineEditModule.applyPredecessorOption()}else this.taskbarMoved&&(this.parent.isConnectorLineUpdate=!0),this.updateEditedTask(e)},e.prototype.validateTaskEvent=function(e){var t={};return this.resetValidateArgs(),this.parent.currentEditedArgs=t,t.cancel=!1,t.data=e.data,t.requestType="validateLinkedTask",t.validateMode=this.parent.dialogValidateMode,t.editEventArgs=e,this.parent.actionBeginTask(t),t},e.prototype.resetValidateArgs=function(){this.parent.dialogValidateMode.preserveLinkWithEditing=!0,this.parent.dialogValidateMode.removeLink=!1,this.parent.dialogValidateMode.respectLink=!1},e.prototype.updateEditedTask=function(e){var t=e.data;if(this.parent.autoCalculateDateScheduling&&this.updateParentChildRecord(t),this.parent.isConnectorLineUpdate&&this.parent.autoCalculateDateScheduling){for(var i=0;i<this.validatedChildItems.length;i++){var r=this.validatedChildItems[i];r.ganttProperties.predecessor&&r.ganttProperties.predecessor.length>0&&(this.parent.editedTaskBarItem=r,this.parent.predecessorModule.validatePredecessor(r,[],""))}this.parent.predecessorModule.isValidatedParentTaskID="",t.ganttProperties.predecessor&&(this.parent.isMileStoneEdited=t.ganttProperties.isMilestone,this.taskbarMoved&&(this.parent.editedTaskBarItem=t),this.parent.predecessorModule.validatePredecessor(t,[],""),this.parent.predecessorModule.isValidatedParentTaskID=""),(this.parent.allowParentDependency&&t.hasChildRecords&&this.parent.previousRecords[t.uniqueID].ganttProperties.startDate&&"DrawConnectorLine"===e.action||"DialogEditing"===e.action)&&this.updateChildItems(t),this.updateParentItemOnEditing()}if(t.parentItem){this.parent.autoCalculateDateScheduling&&this.parent.dataOperation.updateParentItems(t,!0);var n=this.parent.getRecordByID(t.parentItem.taskId);n.ganttProperties.predecessorsName||(this.parent.predecessorModule.validatePredecessor(n,[],""),this.updateParentItemOnEditing())}this.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];t.isNullOrUndefined(r)||t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.ganttProperties)?i=new Date(e.ganttProperties.startDate.getTime()):t.isNullOrUndefined(r.ganttProperties.startDate)||(i=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){!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(d)&&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=!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(a)&&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 if(t.isNullOrUndefined(r)){s=i;var u=this.parent.initialLoadData[p[h].index];this.parent.isLoad?this.calculateDateByRoundOffDuration(u,s):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),this.parent.dataOperation.updateGanttData())}},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,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(a){if(t.isNullOrUndefined(i.parent.loadingIndicator)||"Shimmer"!==i.parent.loadingIndicator.indicatorType?i.parent.showSpinner():i.parent.showMaskRow(),a.cancel)i.reUpdatePreviousRecords(),i.parent.chartRowsModule.refreshRecords([e.data]),i.resetEditProperties(r);else if(a.modifiedTaskData=D(a.modifiedRecords,null,null,i.parent),v(i.parent.dataSource)){var s=i.parent.dataSource,o={changedRecords:a.modifiedTaskData},l=i.parent.query instanceof n.Query?i.parent.query:new n.Query,d=null,p=s.adaptor;if(p instanceof n.WebApiAdaptor&&p instanceof n.ODataAdaptor&&!s.dataSource.batchUrl){d=s.update(i.parent.taskFields.id,o.changedRecords,null,l)}else d=s.saveChanges(o,i.parent.taskFields.id,null,l);d.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){var i,r;i=e.changedRecords?e.changedRecords.length:e.length;for(var n=0;n<i;n++){r=e.changedRecords?e.changedRecords[parseInt(n.toString(),10)]:e[parseInt(n.toString(),10)];for(var a=Object.keys(r).length,s=0,o=Object.keys(r);s<a;s++){var l=o[parseInt(s.toString(),10)];this.parent.editedRecords[parseInt(n.toString(),10)][""+l]=r[""+l],this.parent.editedRecords[parseInt(n.toString(),10)].taskData[""+l]=r[""+l]}null!==this.parent.taskFields.id&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.taskId=r[this.parent.taskFields.id]),null!==this.parent.taskFields.name&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.taskName=r[this.parent.taskFields.name]),null!==this.parent.taskFields.startDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.startDate=r[this.parent.taskFields.startDate]),null!==this.parent.taskFields.endDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.endDate=r[this.parent.taskFields.endDate]),null!==this.parent.taskFields.duration&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.duration=parseInt(r[this.parent.taskFields.duration])),null!==this.parent.taskFields.durationUnit&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.durationUnit=r[this.parent.taskFields.durationUnit]),null!==this.parent.taskFields.progress&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.progress=r[this.parent.taskFields.progress]),null!==this.parent.taskFields.dependency&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.dependency=r[this.parent.taskFields.dependency]),null!==this.parent.taskFields.parentID&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.parentID=r[this.parent.taskFields.parentID]),null!==this.parent.taskFields.baselineEndDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.baselineEndDate=r[this.parent.taskFields.baselineEndDate]),null!==this.parent.taskFields.baselineStartDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.baselineStartDate=r[this.parent.taskFields.baselineStartDate]),null!==this.parent.taskFields.resourceInfo&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.resources=r[this.parent.taskFields.resourceInfo])}this.saveSuccess(t)},e.prototype.dmFailure=function(e,t){if(this.deletedTaskDetails.length){for(var i=this.deletedTaskDetails,r=0;r<i.length;r++)i[r].isDelete=!1;this.deletedTaskDetails=[]}this.reUpdatePreviousRecords(!0,!0),this.resetEditProperties(),this.parent.trigger("actionFailure",{error:e})},e.prototype.updateSharedTask=function(e){for(var i=e.ganttProperties.sharedTaskUniqueIds,r=0;r<i.length;r++){var n=this.parent.flatData[this.parent.ids.indexOf(i[r].toString())];n&&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),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation&&(this.parent.contentHeight=this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,this.parent.ganttChartModule.chartBodyContent.style.height=this.parent.contentHeight+"px",this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData),this.parent.taskFields.dependency&&this.parent.ganttChartModule.reRenderConnectorLines()),this.parent.isConnectorLineUpdate&&!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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()}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(c=0;c<n;c++){var s=[];"NaN"===(g=parseInt(t[c][this.parent.resourceFields.id],10).toString())&&(g=t[c][this.parent.resourceFields.id]);for(var o=0;o<e.length;o++){var l=parseInt(e[o][this.parent.resourceFields.id],10).toString();if("NaN"===l&&(l=e[o][this.parent.resourceFields.id]),l===g){s.push(o);break}}if(0===s.length){var d=r[this.parent.getTaskIds().indexOf("R"+g)];d&&this.addNewRecord(i,d)}else{var p=parseInt(s[0].toString(),10);"NaN"===p.toString()&&(p=s[0].toString()),e.splice(p,1)}}for(var h=e?e.length:0,c=0;c<h;c++)for(var u=i.ganttProperties.taskId,g=e[c][this.parent.resourceFields.id],f=r[this.parent.getTaskIds().indexOf("R"+g)],m=0;m<f.childRecords.length;m++)f.childRecords[m].ganttProperties.taskId===u&&this.removeChildRecord(f.childRecords[m]);if(n>0){var y=this.parent.getParentTask(i.parentItem);y&&y.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.removeChildRecord(i)}0===n&&this.checkWithUnassignedTask(i)}},e.prototype.checkWithUnassignedTask=function(e){for(var 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),this.parent.dataSource.push(e.taskData)}else this.addNewRecord(e,i);var l=this.parent.currentViewData.filter(function(t){return t.ganttProperties.taskId===e.ganttProperties.taskId&&t.hasChildRecords===e.hasChildRecords})[0];e.parentItem=l.parentItem,e.parentUniqueID=l.parentUniqueID},e.prototype.addRecordAsBottom=function(e){var t=this.parent.flatData.length;this.parent.currentViewData.splice(t+1,0,e),this.parent.flatData.splice(t+1,0,e),this.parent.ids.splice(t+1,0,e.ganttProperties.rowUniqueID.toString());var i=0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId;this.parent.getTaskIds().splice(t+1,0,i),this.updateTreeGridUniqueID(e,"add")},e.prototype.addNewRecord=function(e,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,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmDelete"),buttons:[{click:this.confirmDeleteOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.closeConfirmDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});e.appendTo("#"+this.parent.element.id+"_deleteConfirmDialog"),this.confirmDialog=e},e.prototype.closeConfirmDialog=function(){this.confirmDialog.hide()},e.prototype.confirmDeleteOkButton=function(){this.deleteSelectedItems(),this.confirmDialog.hide(),this.parent.element.querySelector(".e-treegrid").focus()},e.prototype.startDeleteAction=function(){this.parent.editSettings.allowDeleting&&!this.parent.readOnly&&(this.parent.editSettings.showDeleteConfirmDialog?this.confirmDialog.show():(this.deleteSelectedItems(),this.parent.element.querySelector(".e-treegrid").focus()))},e.prototype.deleteResourceRecords=function(e){for(var t=[],i=this,r=0;r<e.length;r++)!function(r){if(e[r].parentItem){if(1===e[r].ganttProperties.sharedTaskUniqueIds.length){for(var n=e[r],a=n.ganttProperties.sharedTaskUniqueIds,s=0;s<a.length;s++)-1!==i.parent.ids.indexOf(a[s].toString())&&t.push(i.parent.flatData[i.parent.ids.indexOf(a[s].toString())]);-1!==i.parent.ids.indexOf(n.ganttProperties.rowUniqueID)&&t.push(i.parent.flatData[i.parent.ids.indexOf(n.ganttProperties.rowUniqueID)])}}else{var o=i.parent.flatData.filter(function(t){return t.ganttProperties.taskId===e[r].ganttProperties.taskId&&t.hasChildRecords})[0];t.push(o)}}(r);this.deleteRow(t)},e.prototype.deleteSelectedItems=function(){if(this.isFromDeleteMethod)this.targetedRecords.length&&("ResourceView"===this.parent.viewType?this.deleteResourceRecords(this.targetedRecords):this.deleteRow(this.targetedRecords)),this.isFromDeleteMethod=!1;else{var e=[];"Cell"!==this.parent.selectionSettings.mode?e=this.parent.selectionModule.getSelectedRecords():"Cell"===this.parent.selectionSettings.mode&&(e=this.parent.selectionModule.getCellSelectedRecords()),"ResourceView"===this.parent.viewType?this.deleteResourceRecords(e):this.deleteRow(e)}},e.prototype.deleteRecord=function(e){this.isFromDeleteMethod=!0;var 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)){var a=this.parent.getParentTask(n.parentItem);if(n.parentItem){var s=a.childRecords;(1===s.length?s:s.filter(function(e){return!e.isDelete})).length>0&&this.parent.dataOperation.updateParentItems(n.parentItem)}var o=n.ganttProperties.predecessor,l=!0;"ResourceView"===this.parent.viewType&&a&&a.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(l=!1),o&&o.length&&l&&this.removePredecessorOnDelete(n),this.deletedTaskDetails.push(n),n.hasChildRecords&&this.deleteChildRecords(n)}}this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.clearSelection();var d={};d.deletedRecordCollection=this.deletedTaskDetails,d.updatedRecordCollection=this.parent.editedRecords,d.cancel=!1,d.action="delete",this.initiateDeleteAction(d),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)){for(var c=t.extend([],[],h.ganttProperties.predecessor,!0),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,a=!0,s=this.parent.getParentTask(r.parentItem);"ResourceView"===this.parent.viewType&&s&&s.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(a=!1),n&&n.length&&a&&this.removePredecessorOnDelete(r),this.deletedTaskDetails.push(r),r.hasChildRecords&&this.deleteChildRecords(r)}}},e.prototype.removeFromDataSource=function(e){var t;t=this.parent.dataSource instanceof n.DataManager?this.parent.dataSource.dataSource.json:this.parent.dataSource,this.removeData(t,e),this.isBreakLoop=!1},e.prototype.removeData=function(e,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]){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]){var n=e[r][this.parent.taskFields.child];this.removeData(n,i)}},e.prototype.initiateDeleteAction=function(e){var i=this;this.parent.showSpinner();var r={};r.requestType="beforeDelete",r.data=e.deletedRecordCollection,r.modifiedRecords=e.updatedRecordCollection,r.modifiedTaskData=D(e.updatedRecordCollection,null,null,this.parent),this.parent.trigger("actionBegin",r,function(r){if(t.isNullOrUndefined(i.parent.loadingIndicator)||"Shimmer"!==i.parent.loadingIndicator.indicatorType?i.parent.showSpinner():i.parent.showMaskRow(),r.cancel){for(var a=i.deletedTaskDetails,s=0;s<a.length;s++)a[s].isDelete=!1;i.deletedTaskDetails=[],i.reUpdatePreviousRecords(),i.parent.initiateEditAction(!1),i.parent.hideSpinner()}else if(v(i.parent.dataSource)){var o=i.parent.dataSource;i.parent.timezone&&w(r.modifiedTaskData,i.parent);var l={deletedRecords:D(r.data,null,null,i.parent),changedRecords:r.modifiedTaskData},d=o.adaptor,p=i.parent.query instanceof n.Query?i.parent.query:new n.Query;if(d instanceof n.WebApiAdaptor&&d instanceof n.ODataAdaptor&&!o.dataSource.batchUrl){for(var h=null,c=0;c<l.deletedRecords.length;c++)h=o.remove(i.parent.taskFields.id,l.deletedRecords[c],null,p);h.then(function(){o.update(i.parent.taskFields.id,l.changedRecords,null,p).then(function(){return i.deleteSuccess(e)}).catch(function(t){return i.dmFailure(t,e)})}).catch(function(t){return i.dmFailure(t,e)})}else o.saveChanges(l,i.parent.taskFields.id,null,p).then(function(){return i.deleteSuccess(e)}).catch(function(t){return i.dmFailure(t,e)})}else i.deleteSuccess(e)})},e.prototype.deleteSuccess=function(e){var i=this,r=this.parent.flatData,n=this.parent.currentViewData,a=this.parent.getRecordFromFlatdata(e.deletedRecordCollection),s=[];a.length>0&&(this.parent.selectedRowIndex=a[a.length-1].index);for(w=0;w<a.length;w++){var o=a[w],l=n.indexOf(o),d=r.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&&n.splice(l,1),-1!==d&&r.splice(d,1),-1!==c&&h.splice(c,1),!t.isNullOrUndefined(o)){if(s.push(o.ganttProperties.taskId.toString()),-1!==d&&(this.parent.ids.splice(d,1),"ResourceView"===this.parent.viewType&&(this.parent.getTaskIds().splice(d,1),this.isResourceTaskDeleted=!0,o.hasChildRecords||(o.ganttProperties.resourceInfo=null,delete o.ganttProperties.resourceNames,o[this.parent.taskFields.resourceInfo]=null,o.ganttProperties.sharedTaskUniqueIds=[],delete o.taskData[this.parent.taskFields.resourceInfo]))),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")}}s.length>0&&this.removeFromDataSource(s);var m={};if(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(),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,"ResourceView"===this.parent.viewType)for(var y=m.data.filter(function(e){return!e.hasChildRecords}),v=this,w=0;w<y.length;w++)!function(e){var t=v.parent.flatData.filter(function(e){return e.ganttProperties.taskName===i.parent.localeObj.getConstant("unassignedTask")})[0],r=[];t&&(r=t.childRecords.filter(function(t){return t.ganttProperties.taskId===y[e].ganttProperties.taskId}));var n=v.parent.getParentTask(y[e].parentItem);n&&n.ganttProperties.taskName!==v.parent.localeObj.getConstant("unassignedTask")&&0===r.length?v.checkWithUnassignedTask(y[e]):n||r&&0!==r.length||v.checkWithUnassignedTask(y[e]),t=v.parent.flatData.filter(function(e){return e.ganttProperties.taskName===i.parent.localeObj.getConstant("unassignedTask")})[0];var a=v.parent.currentViewData.filter(function(i){return i.ganttProperties.taskId==y[e].ganttProperties.taskId&&!i.hasChildRecords&&i.parentItem&&t.uniqueID===i.parentItem.uniqueID?i:null});a[0]&&v.parent.dataOperation.updateParentItems(a[0])}(w);this.parent.trigger("actionComplete",m),this.deletedTaskDetails=[],this.parent.initiateEditAction(!1),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.getNewTaskId=function(){var e="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,t=e.length+1;if("ResourceView"===this.parent.viewType){if((-1!==e.indexOf("T"+t)||-1!==e.indexOf("R"+t))&&(t+=1,-1!==e.indexOf("T"+t)||-1!==e.indexOf("R"+t)))do{t+=1}while(-1!==e.indexOf("T"+t)||-1!==e.indexOf("R"+t))}else if(-1!=e.indexOf(t.toString())&&(t+=1,-1!=e.indexOf(t.toString())))do{t+=1}while(-1!=e.indexOf(t.toString()));return"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?t=t.toString():t},e.prototype.prepareNewlyAddedData=function(e,i){var r,n,a=this.parent.taskFields,s=this.parent.ids;if(e[a.id]&&(-1!==s.indexOf(e[a.id].toString())?e[a.id]=null:(n="string"==typeof e[a.id]?e[a.id]:parseInt(e[a.id],10),e[a.id]=t.isNullOrUndefined(n)?null:n)),e[a.id]||(r=this.getNewTaskId(),e[a.id]=r),this.parent.allowUnscheduledTasks||e[a.startDate]||(e[a.startDate]=this.parent.projectStartDate),!this.parent.allowUnscheduledTasks&&a.duration&&t.isNullOrUndefined(e[a.duration])&&(e[a.endDate]||(e[a.duration]="5")),a.progress&&(e[a.progress]=e[a.progress]?e[a.progress]>100?100:e[a.progress]:0),!this.parent.allowUnscheduledTasks&&!e[a.endDate]&&a.endDate&&!e[a.duration]){var o=this.parent.dataOperation.getDateFromFormat(this.parent.projectStartDate);o.setDate(o.getDate()+4),e[a.endDate]=this.parent.getFormatedDate(o,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=[],l=0;l<n;l++)if(s[l].to===a.rowUniqueID.toString()){i=this.parent.getRecordByID(s[l].from),r=b(s[l],"from",i.ganttProperties.predecessor,"to");var d=t.extend([],i.ganttProperties.predecessor,[],!0);d.splice(r,1),this.parent.setRecordValue("predecessor",d,i.ganttProperties,!0)}else if(s[l].from===a.rowUniqueID.toString()){var p=(i=this.parent.getRecordByID(s[l].to)).ganttProperties.predecessorsName.toString().split(","),h=s[l].from+s[l].type,c=p.indexOf(h);p.splice(c,1),this.parent.setRecordValue("predecessorsName",p.join(","),i.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.dependency,p.join(","),i),r=b(s[l],"from",i.ganttProperties.predecessor,"to");var u=t.extend([],i.ganttProperties.predecessor,[],!0);u.splice(r,1),this.parent.setRecordValue("predecessor",u,i.ganttProperties,!0),this.parent.predecessorModule.validatePredecessorDates(i)}this.parent.setRecordValue("predecessor",o,e.ganttProperties,!0),this.parent.setRecordValue("predecessorsName","",e.ganttProperties,!0)},e.prototype.predecessorToString=function(e,t){var i=[],r=0,n=e.length;for(r;r<n;r++)if(t.ganttProperties.rowUniqueID.toString()!==e[r].from){var a=e[r].from+e[r].type;e[r].offset=isNaN(e[r].offset)?0:e[r].offset,0!==e[r].offset&&(e[r].offset<0?a+=e[r].offset.toString()+"d":e[r].offset>0&&(a+="+"+e[r].offset.toString()+"d")),i.push(a)}return i.join(",")},e.prototype.backUpAndPushNewlyAddedRecord=function(e,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":n=o.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords?(a=n+(h=this.getChildCount(this.addRowSelectedItem,0))+1,s=l.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,l)+1):(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){var h=this.getChildCount(this.addRowSelectedItem,0);a=n+h+1,this.addRowSelectedItem.expanded||this.parent.enableMultiTaskbar||this.parent.expandByID(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),"ResourceView"===this.parent.viewType&&"number"==typeof a.ganttProperties.taskId){var h=a.ganttProperties.taskId;p.push(h.toString())}if(p.splice(i,0,a.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var c=0===a.level?"R"+a.ganttProperties.taskId:"T"+a.ganttProperties.taskId;this.parent.getTaskIds().splice(i,0,c)}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.taskFields.child||(this.parent.taskFields.child="Children"),this.parent.dataSource instanceof n.DataManager&&t.isNullOrUndefined(s.taskData[this.parent.taskFields.parentID])||!t.isNullOrUndefined(this.parent.dataSource))){var u=this.parent.taskFields.child;s.taskData[u]&&s.taskData[u].length>0?"Above"===o||"Below"===o?s.taskData[u].splice(e,0,a.taskData):s.taskData[u].push(a.taskData):(s.taskData[u]=[],s.taskData[u].push(a.taskData)),this.isNewRecordAdded=!0}},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(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(var 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(n=e[0].index+1;n<this.parent.currentViewData.length&&e[0].level<this.parent.currentViewData[n].level;n++)this.parent.modifiedRecords.push(this.parent.currentViewData[n]);for(var r=this,n=0;n<this.parent.modifiedRecords.length;n++)!function(e){var t=r.parent.modifiedRecords[e],i=r.parent.allowRowDragAndDrop?1:0,n=r.parent.taskFields.id,a=r.parent.currentViewData.findIndex(function(e){return e[n]===t[n]});r.parent.treeGrid.getRows()[a]&&(r.parent.treeGrid.renderModule.cellRender({data:t,cell:r.parent.treeGrid.getRows()[a].cells[r.parent.treeColumnIndex+i],column:r.parent.treeGrid.grid.getColumns()[r.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),r.parent.treeGrid.renderModule.RowModifier({data:t,row:r.parent.treeGrid.getRows()[a],rowHeight:r.parent.rowHeight}))}(n)},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.isNewRecordAdded||this.addDataInRealDataSource(a,e[s].taskData,i),this.isNewRecordAdded=!1):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,s=this.parent.taskFields.id;if(this.parent.editModule&&this.parent.editSettings.allowAdding){this.parent.isDynamicData=!0;var o=[];if(t.isNullOrUndefined(e))this.validateTaskPosition(e,i,r,o);else if(e instanceof Array)for(var l=0;l<e.length;l++)this.validateTaskPosition(e[l],i,r,o);else{if("object"!=typeof e)return;this.validateTaskPosition(e,i,r,o)}var d={};d=this.constructTaskAddedEventArgs(o,this.parent.editedRecords,"beforeAdd"),this.parent.trigger("actionBegin",d,function(e){a.parent.previousRecords={},t.isNullOrUndefined(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.showSpinner():a.parent.showMaskRow();var r=a.parent.taskFields,l="ResourceView"===a.parent.viewType?a.parent.flatData[a.parent.getTaskIds().indexOf("T"+e.data[r.id])]:a.parent.getRecordByID(e.data[r.id]);if(t.isNullOrUndefined(l)||a.validateUpdateValues(e.newTaskData,l,!0),t.isNullOrUndefined(e.data[""+s])||e.data[s]!=e.data.ganttProperties.taskId&&(e.data.ganttProperties.taskId=e.data[s],e.newTaskData[s]=e.data[s]),e.cancel)e=e,a.removeAddedRecord(),a.reUpdatePreviousRecords(),a._resetProperties();else if(v(a.parent.dataSource)){var d=a.parent.dataSource,p={addedRecords:[e.newTaskData],changedRecords:e.modifiedTaskData},h=e.data.ganttProperties.taskId.toString(),c=a.parent.query instanceof n.Query?a.parent.query:new n.Query,u=d.adaptor;if(u instanceof n.WebApiAdaptor&&u instanceof n.ODataAdaptor&&!d.dataSource.batchUrl){d.insert(p.addedRecords,null,c).then(function(i){t.isNullOrUndefined(i[0])?p.addedRecords[0]:i[0],a.updateNewRecord(o,e)}).catch(function(t){a.removeAddedRecord(),a.dmFailure(t,e),a._resetProperties()})}else d.saveChanges(p,a.parent.taskFields.id,null,c).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()==h){a.parent.setRecordValue("taskId",i.addedRecords[0][a.parent.taskFields.id],e.data.ganttProperties,!0),a.parent.setRecordValue("taskData",i.addedRecords[0],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(h);-1!==r&&(a.parent.ids[r]=i.addedRecords[0][a.parent.taskFields.id].toString())}a.updateNewRecord(o,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||t.isNullOrUndefined(i)&&!e.data.parentItem)if(e.data instanceof Array)a.updateRealDataSource(e.data,i);else{var g=[];g.push(e.data),a.updateRealDataSource(g,i)}}else(m(a.parent)?t.getValue("result",a.parent.dataSource):a.parent.dataSource).push(e.data.taskData);0===o.level&&a.parent.treeGrid.parentData.splice(0,0,o),a.updateTreeGridUniqueID(o,"add"),a.refreshNewlyAddedRecord(e,o),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){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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose(),"ResourceView"===this.parent.viewType)if(i.length>1)for(var n=0;n<i.length;n++){e.data[n].ganttProperties.sharedTaskUniqueIds.push(e.data[n].ganttProperties.rowUniqueID),e.data[n].ganttProperties.resourceInfo?((a=t.extend([],[],e.data[n].ganttProperties.resourceInfo,!0)).splice(0,1),this.updateResoures([],a,e.data[n])):(this.removeChildRecord(e.data[n]),this.parent.editModule.checkWithUnassignedTask(e.data[n]));for(s=0;s<this.updateParentRecords.length;s++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[s]);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 a=t.extend([],[],e.data.ganttProperties.resourceInfo,!0);a.splice(0,1),this.updateResoures([],a,e.data)}}else this.removeChildRecord(e.data),this.parent.editModule.checkWithUnassignedTask(e.data);for(var s=0;s<this.updateParentRecords.length;s++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[s]);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,i,r){var n=this;if(e[0],!0){"above"===r&&(this.dropPosition="topSegment"),"below"===r&&(this.dropPosition="bottomSegment"),"child"===r&&(this.dropPosition="middleSegment");for(var a=void 0,s=[],o=0;o<e.length;o++)s[o]=this.parent.updatedRecords[e[o]];var l={data:s,dropIndex:i,dropPosition:this.dropPosition};"middleSegment"===this.dropPosition?a="indenting":"bottomSegment"===this.dropPosition&&(a="outdenting");var d={action:a,data:s[0],cancel:!1};this.parent.trigger("actionBegin",d,function(e){t.isNullOrUndefined(n.parent.loadingIndicator)||"Shimmer"!==n.parent.loadingIndicator.indicatorType?n.parent.showSpinner():n.parent.showMaskRow(),e.cancel||n.reArrangeRows(l,!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,i){if(this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(e.data,i),i?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 r=0;r<e.modifiedRecords.length;r++)w(e.modifiedRecords[r],this.parent);this.parent.trigger("actionComplete",e),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),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;var d=[];Array.isArray(r)?d=r:d[0]=r,this.parent.editModule.updateRealDataSource(d,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);for(var c=void 0,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}(),mt=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}(),yt=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}(),vt=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.wireEvents=function(e){t.EventHandler.add(document.getElementById(e),"click",this.mouseClickHandler,this)},e.prototype.initiateFiltering=function(e){var t=this.parent.getColumnByField(e.field,this.parent.treeGridModule.treeGridColumns);e.allowFiltering=!1!==e.allowFiltering,!e.allowFiltering||"Menu"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||e.filter||(e.filter={ui:this.getCustomFilterUi(e)}),t&&(t.allowFiltering=e.allowFiltering,t.filter=e.allowFiltering?e.filter:{})},e.prototype.getCustomFilterUi=function(e){var t=this.parent.taskFields,i={};return"datepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?"datetimepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?e.field===t.duration&&"stringedit"===e.editType&&(i=this.getDurationFilter()):i=this.getDateTimePickerFilter():i=this.getDatePickerFilter(e.field),i},e.prototype.mouseClickHandler=function(e){t.closest(e.target,".e-excelfilter")&&this.parent.treeGrid.grid.notify("click",e)},e.prototype.unWireEvents=function(){t.EventHandler.remove(this.parent.element,"click",this.mouseClickHandler)},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})).enableRtl=n.parent.enableRtl,i.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})).enableRtl=i.parent.enableRtl,e.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).enableRtl=i.parent.enableRtl,e.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(t.isNullOrUndefined(e.filterModel)||t.isNullOrUndefined(e.filterModel.dialogObj)||t.isNullOrUndefined(e.filterModel.dialogObj.element)||"Excel"===this.parent.filterSettings.type&&this.wireEvents(e.filterModel.dialogObj.element.id),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=void 0;t.isNullOrUndefined(l)||((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){var l=this.filterMenuElement.querySelector(".e-flmenu-input"),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,i){var r,n,a,s,o,l,d,p=this.parent.element.getBoundingClientRect(),h=p.top,c=p.left;if(!t.isNullOrUndefined(this.parent.element.parentNode)&&"BODY"!=this.parent.element.parentNode.tagName){for(n=(r=this.parent.element.parentNode).getBoundingClientRect().top,l=r.style.marginTop;;){if(Math.abs(h)>Math.abs(n)){s=h-n;break}t.isNullOrUndefined(this.parent.element.parentNode)||(l=(r=r.parentNode).parentNode.style.marginTop),n=r.getBoundingClientRect().top}for(a=r.getBoundingClientRect().left,d=r.style.marginLeft;;){if(Math.abs(c)>Math.abs(a)){o=c-a;break}t.isNullOrUndefined(this.parent.element.parentNode)||(d=(r=r.parentNode).style.marginLeft),a=r.getBoundingClientRect().left}}var u=e.getBoundingClientRect(),g=u.right+window.scrollX,f=u.top+window.scrollY;p.right<g+i.offsetWidth?u.left-i.offsetWidth>p.left?g=u.left-i.offsetWidth:g-=g+i.offsetWidth-p.right:t.isNullOrUndefined(s)||t.isNullOrUndefined(o)||(g=Math.abs(u.right-p.left),f=Math.abs(u.top-p.top)),t.isNullOrUndefined(s)||t.isNullOrUndefined(o)?(i.style.top=f+"px",i.style.left=g+"px"):(i.style.top="string"==typeof parseInt(l)?f+s+parseInt(l)+"px":f+s+"px",i.style.left="string"==typeof parseInt(d)?g+o+parseInt(d)+8+"px":g+o+"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(),this.unWireEvents()},e}(),Dt=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}(),wt=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){if(!this.parent.isGanttChartRendered)return void(e.cancel=!0);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.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;"Single"===this.parent.selectionSettings.type||!this.isMultiCtrlRequest&&!this.isMultiShiftRequest?(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&!this.parent.rowDragAndDropModule.draggedRecord)&&this.selectRow(n,a):this.isMultiShiftRequest?this.selectRowsByRange(t.isNullOrUndefined(this.prevRowIndex)?n:this.prevRowIndex,n):(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){"number"==typeof e&&(e=[e]);for(var i=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),r=this,n=0;n<e.length;n++)!function(n){var a=i.filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e[n]})[0];t.isNullOrUndefined(a)||(r.getSelectedRowIndexes().indexOf(e[n])>-1?r.addClass(a):r.removeClass(a))}(n)},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"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}(),kt=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"},this.parent.enableRtl&&("PrevTimeSpan"===r&&(this.predefinedItems[r].prefixIcon="e-nexttimespan"),"NextTimeSpan"===r&&(this.predefinedItems[r].prefixIcon="e-prevtimespan"))}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,enableRtl:this.parent.enableRtl,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");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"),enableRtl:this.parent.enableRtl,floatLabelType:"Never",showClearButton:!0}).appendTo(this.searchElement)):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;this.parent.isToolBarClick=!1,t.extend(e,{cancel:!1}),e.item.properties.id!==this.parent.element.id+"_pdfexport"&&e.item.properties.id!==this.parent.element.id+"_critical-path"||(t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow()),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.isZoomIn&&(this.parent.timelineModule.isZoomIn=!1),this.parent.timelineModule.processZoomToFit(),this.parent.ganttChartModule.updateScrollLeft(0)},e.prototype.zoomOut=function(){this.parent.timelineModule.processZooming(!1)},e.prototype.refreshToolbarItems=function(e){var 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&&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(v=0;v<p.length;v++)p[v].id!==o+"_update"&&p[v].id!==o+"_cancel"&&-1!==h.indexOf(p[v].id)&&a.push(p[v].id)}else{a.push(o+"_update",o+"_cancel");for(v=0;v<p.length;v++)-1===n.indexOf(p[v].id)&&-1===a.indexOf(p[v].id)&&n.push(p[v].id)}}for(var m=0;m<n.length;m++){for(var y=void 0,v=0;v<p.length;v++)if(p[v].id===n[m]){y=v;break}p.length>0&&this.toolbar.hideItem(y,!1)}for(var D=0;D<a.length;D++){for(var y=void 0,v=0;v<p.length;v++)if(p[v].id===a[D]){y=v;break}p.length>0&&this.toolbar.hideItem(y,!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}(),bt=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.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=this.parent.enableRtl?"right:"+d+"px;":"left:"+d+"px;",h=t.createElement("div",{className:"e-holiday",styles:p+" width:"+l+"px; height:100%;"}),c=s<n?s/2:n/2,u=t.createElement("span",{className:"e-span",styles:"top:"+c+"px;left:"+l/2+"px;"}),g=this.parent.disableHtmlEncode?"textContent":"innerHTML";u[g]=this.parent.holidays[o].label?this.parent.holidays[o].label:"",this.parent.enableHtmlSanitizer&&"string"==typeof u[g]&&(u[g]=t.SanitizeHtmlHelper.sanitize(u[g])),h.appendChild(u),this.parent.holidays[o].cssClass&&h.classList.add(this.parent.holidays[o].cssClass),r.appendChild(h)}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=this.parent.enableRtl?"right:"+s+"px;":"left:"+s+"px;",c=t.createElement("div",{className:"e-weekend",styles:h+" width:"+o+"px;height:100%;"});e.appendChild(c)}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=this.parent.element,r=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(r=this.parent.toolbarModule.element.offsetHeight);for(var n="auto"===this.parent.height?i.offsetHeight-r-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight:this.parent.ganttHeight-r-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,a=n<e?n/2:e/2,s=this.holidayContainer.querySelectorAll(".e-span"),o=0;o<s.length;o++)s[o].style.top=t.formatUnit(a)},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}(),Tt=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","term"),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++){i=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(this.parent.eventMarkers[s].day,!0),!1);var o=void 0;if(o=this.parent.enableRtl?"right:"+i+"px;":"left:"+i+"px;",r=t.createElement("div",{className:"e-event-markers",styles:o+" height:100%;",id:"stripline"+s}),this.parent.eventMarkers[s].label){n=t.createElement("div",{className:"e-span-label"});var l=this.parent.disableHtmlEncode?"textContent":"innerHTML";n[l]=this.parent.eventMarkers[s].label,this.parent.enableHtmlSanitizer&&"string"==typeof n[l]&&(n[l]=t.SanitizeHtmlHelper.sanitize(n[l])),this.parent.enableRtl?n.style.right="5px":n.style.left="5px",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}(),St=function(){function e(e){this.parent=e,this.nonworkingDayRender=new bt(this.parent),this.eventMarkerRender=new Tt(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}(),Pt=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.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(y=1;y<r.length;y++)r[y].ganttProperties.endDate>=n&&(n=r[y].ganttProperties.endDate,r[y].ganttProperties.taskId),r[y].ganttProperties.isAutoSchedule||r[y].ganttProperties.autoEndDate>=n&&(n=r[y].ganttProperties.autoEndDate,r[y].ganttProperties.taskId);this.maxEndDate=n;for(var m=0;m<i.length;m++)i[m].isCritical=!1,i[m].ganttProperties.isCritical=!1,a=this.parent.dataOperation.getDuration(i[m].ganttProperties.endDate,n,i[m].ganttProperties.durationUnit,i[m].ganttProperties.isAutoSchedule,i[m].ganttProperties.isMilestone),i[m].slack=a+" "+i[m].ganttProperties.durationUnit,i[m].ganttProperties.slack=a+" "+i[m].ganttProperties.durationUnit,i[m].ganttProperties.endDate>=n&&s.push(i[m].ganttProperties.taskId),i[m].ganttProperties.predecessor&&0!==i[m].ganttProperties.predecessor.length&&(o.push(i[m]),l.push(i[m].ganttProperties.taskId));if("ResourceView"===this.parent.viewType)for(var y=0;y<this.parent.taskIds.length;y++)this.resourceCollectionIds[y]=this.parent.taskIds[y].slice(1);for(var v=this,D=0;D<s.length;D++)!function(e){if(-1===l.indexOf(s[e])){if("ProjectView"===v.parent.viewType)d=t.indexOf(s[e].toString());else for(var r=v.parent.currentViewData.filter(function(t){return parseInt(t.ganttProperties.taskId)===s[e]}),n=0;n<r.length;n++)!r[n].hasChildRecords&&r[n].ganttProperties.endDate>=v.maxEndDate&&(d=r[n].index);i[d].ganttProperties.progress<100&&(i[d].isCritical=!0,i[d].ganttProperties.isCritical=!0),i[d].slack="0 "+i[d].ganttProperties.durationUnit,p.push(s[e])}else h.push(s[e])}(D);for(var w=o.length,k=[],b=0;b<w;b++){for(var T=-1,S=-1,P=-1,C=-1,R=b,M=o[b].ganttProperties.predecessor,O=o[b].ganttProperties.predecessor.length,x=o[b].ganttProperties.taskId,I=0;I<O;I++)(isNaN(Number(M[I].from))||"string"==typeof x?(isNaN(Number(M[I].from)),M[I].from):parseInt(M[I].from,10))===x&&(-1===T?M[I].offset?(T=M[I].to+":"+M[I].offset+M[I].offsetUnit,P=M[I].type):(T=M[I].to,P=M[I].type):M[I].offset?(T=T+","+M[I].to+":"+M[I].offset+M[I].offsetUnit,P=P+","+M[I].type):(T=T+","+M[I].to,P=P+","+M[I].type)),(isNaN(Number(M[I].to))||"string"==typeof x?(isNaN(Number(M[I].to)),M[I].to):parseInt(M[I].to,10))===x&&(-1===S?M[I].offset?(S=M[I].from+":"+M[I].offset+M[I].offsetUnit,C=M[I].type):(S=M[I].from,C=M[I].type):M[I].offset?(S=S+","+M[I].from+":"+M[I].offset+M[I].offsetUnit,C=C+","+M[I].type):(S=S+","+M[I].from,C=C+","+M[I].type));-1===S&&(S=null,C=null),-1===T&&(T=null,P=null),c.push({from:S,fromPredecessor:C,taskid:x,to:T,toPredecessor:P,currentIndex:R,slack:null,enddate:null}),u.push(x)}for(var E=c.length,N=0,F=void 0,U=0;U<E;U++)if(!c[U].to){F=c[U].taskid,N="ProjectView"===this.parent.viewType?t.indexOf(F.toString()):this.resourceCollectionIds.indexOf(F.toString());var V=i[N].ganttProperties;a=this.parent.dataOperation.getDuration(V.endDate,n,"minute",V.isAutoSchedule,V.isMilestone),c[U].slack=a,c[U].fs=-1,c[U].enddate=V.endDate,k.push({fromdata:c[U].from,todateID:c[U].taskid,fromDataPredecessor:c[U].fromPredecessor})}for(D=0;D<k.length;D++)g.push(k[D]),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){var L=void 0;this.parent.enableCriticalPath=!1;for(U=0;U<this.criticalPathCollection.length;U++)L=t.indexOf(this.criticalPathCollection[U].toString()),i[L].isCritical=!1;this.criticalPathCollection=[],this.detailPredecessorCollection=[],this.predecessorCollectionTaskIds=[]}},e.prototype.slackCalculation=function(e,i,r,n,a,s){var o=e[0].fromdata.split(","),l=e[0].fromDataPredecessor.split(",");r=(r=r.toString()).split(",");for(var d,p,h,c,u,g,f,m,y=[],v=0;v<o.length;v++){y=o[v].split(":"),d=r.indexOf(y[0].toString()),c=r.indexOf(e[0].todateID.toString()),"ProjectView"===this.parent.viewType?(p=s.indexOf(y[0].toString()),h=s.indexOf(e[0].todateID.toString())):(p=this.resourceCollectionIds.indexOf(y[0].toString()),h=this.resourceCollectionIds.indexOf(e[0].todateID.toString()));var D=a[p].ganttProperties,w=a[h].ganttProperties;y.length>1&&(f=-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"===l[v]&&(u=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[d].slack)?y.length<=1&&(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u):i[d].slack>u&&0!==i[d].slack&&y.length<=1&&(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u),y.length>1&&(i[d].slack=i[c].slack+u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0)),i[d].fs=1,i[d].fsslack=i[d].slack,i[d].enddate=D.startDate,D.endDate>=n&&D.endDate<=n&&(i[d].slack=0)),"SS"===l[v]&&(D.isAutoSchedule?(u=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[d].slack)?y.length<=1&&(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u):i[d].slack>u&&0!==i[d].slack&&y.length<=1&&(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u),y.length>1&&(i[d].slack=i[c].slack+u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0)),i[d].fs=1,i[d].fsslack=i[d].slack,i[d].enddate=D.startDate):D.isAutoSchedule||(u=this.getSlackDuration(D.endDate,n,"minute",a[p]),t.isNullOrUndefined(i[d].slack)?i[d].slack=u:i[d].slack>u&&0!==i[d].slack&&(i[d].slack=u)),D.endDate>=n&&D.endDate<=n&&(i[d].slack=0)),"FF"===l[v]&&(1!==i[c].fs&&1!==i[c].ff&&-1!==i[c].fs||(1!==i[c].fs&&1!==i[c].ff||(g=w.endDate,m=i[c].slack),-1===i[c].fs&&(g=i[c].enddate,m=i[c].slack),u=g>D.endDate?-this.getSlackDuration(D.endDate,g,"minute",a[p]):this.getSlackDuration(g,D.endDate,"minute",a[p]),t.isNullOrUndefined(i[d].slack)?y.length<=1&&(i[d].slack=m-u<0?0:m-u):i[d].slack>u&&0!==i[d].slack&&y.length<=1&&(i[d].slack=m-u<0?0:m-u),y.length>1&&(i[d].slack=i[c].slack-u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0)),i[d].ff=1,i[d].enddate=g,i[d].fsslack=m),D.endDate>=n&&D.endDate<=n&&(i[d].slack=0)),"SF"===l[v]&&(D.isAutoSchedule?t.isNullOrUndefined(i[d].slack)?(y.length<=1?t.isNullOrUndefined(i[c].to)?(u=this.getSlackDuration(D.endDate,n,"minute",a[p]),i[d].slack=u):t.isNullOrUndefined(i[c].to)||(u=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[p]),i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u):y.length>1&&(u=w.endDate>=D.endDate?D.startDate>w.endDate?-this.getSlackDuration(w.endDate,D.startDate,"minute",a[p]):this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(D.endDate,n,"minute",a[p]),i[d].slack=i[c].slack+u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0)),i[d].fs=1,i[d].fsslack=i[d].slack,i[d].enddate=D.startDate):(y.length<=1?(t.isNullOrUndefined(i[c].to)?u=this.getSlackDuration(D.endDate,n,"minute",a[p]):t.isNullOrUndefined(i[c].to)||(u=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[p])),i[d].slack>u&&0!==i[d].slack&&(t.isNullOrUndefined(i[c].to)?i[d].slack=u:t.isNullOrUndefined(i[c].to)||(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u))):y.length>1&&(u=w.endDate>D.endDate?D.startDate>w.endDate?-this.getSlackDuration(w.endDate,D.startDate,"minute",a[p]):this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(D.endDate,n,"minute",a[p]),i[d].slack>u&&0!==i[d].slack&&(i[d].slack=i[c].slack+u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0))),i[d].fs=1,i[d].fsslack=i[d].slack,i[d].enddate=D.startDate):D.isAutoSchedule||(u=this.getSlackDuration(D.endDate,n,"minute",a[p]),t.isNullOrUndefined(i[d].slack)?i[d].slack=u:i[d].slack>u&&0!==i[d].slack&&(i[d].slack=u)),D.endDate>=n&&D.endDate<=n&&(i[d].slack=0)),i[d].from&&e.push({fromdata:i[d].from,todateID:i[d].taskid,fromDataPredecessor:i[d].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),("number"==typeof i[a][this.parent.taskFields.id]?parseInt(l[p].from,10):l[p].from)===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){this.parent.ganttChartModule.chartElement;this.parent.removeCriticalPathStyles();for(var a=this,s=0;s<e.length;s++)!function(i){var r;if("ProjectView"===a.parent.viewType)r=a.parent.flatData[a.parent.ids.indexOf(e[i].toString())];else for(var n=a.parent.flatData.filter(function(t){return t.ganttProperties.taskId.toString()===e[i].toString()}),s=0;s<n.length;s++)(n[s].ganttProperties.isCritical||n[s].ganttProperties.endDate>=a.maxEndDate)&&(r=n[s]);var o=a.parent.currentViewData.indexOf(r),l=a.parent.getRowByIndex(o),d=void 0,p=a.parent.taskFields;if(r&&r.parentItem){var h=a.parent.currentViewData.filter(function(e){return r.parentItem.uniqueID===e.uniqueID}),c=a.parent.flatData.indexOf(h[0]),u=a.parent.getRowByIndex(c);if(u)for(var g=u.querySelectorAll(".e-taskbar-main-container"),f=0;f<g.length;f++)g[f].getAttribute("rowuniqueid")===r.rowUniqueID&&t.addClass(g[f].querySelectorAll(".e-gantt-child-taskbar-inner-div"),"e-gantt-child-critical-taskbar-inner-div")}d=a.parent.allowUnscheduledTasks&&!r[p.startDate]&&!r[p.endDate]&&r[p.duration]?"e-gantt-critical-unscheduled-taskbar":"e-gantt-child-critical-progressbar-inner-div",l&&("ProjectView"===a.parent.viewType||"ResourceView"===a.parent.viewType&&!r.hasChildRecords)&&(l.getElementsByClassName("e-milestone-top")[0]&&t.addClass(l.querySelectorAll(".e-milestone-top"),"e-critical-milestone-top"),l.getElementsByClassName("e-milestone-bottom")[0]&&t.addClass(l.querySelectorAll(".e-milestone-bottom"),"e-critical-milestone-bottom"),l.getElementsByClassName("e-gantt-child-taskbar-inner-div").length>0&&t.addClass(l.querySelectorAll(".e-gantt-child-taskbar-inner-div"),"e-gantt-child-critical-taskbar-inner-div"),l.getElementsByClassName("e-gantt-child-progressbar-inner-div").length>0&&t.addClass(l.querySelectorAll(".e-gantt-child-progressbar-inner-div"),d))}(s);if(0!==i.length)for(var o=0,l=void 0,d=[],p=void 0,h=void 0,s=0;s<this.criticalPathCollection.length;s++)if(o=n.indexOf(this.criticalPathCollection[s]),l=i[o],-1!==o&&l.to){d=l.to.split(",");for(var c=0;c<d.length;c++)h=d[c].split("+"),d[c].indexOf("-")>=0&&(h=d[c].split("-")),p=h[0].replace(":",""),"number"==typeof e[c]&&(p=parseInt(h[0],10)),-1!==e.indexOf(p)&&this.parent.element.querySelectorAll("#ConnectorLineparent"+l.taskid+"child"+p).length>0&&(t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+l.taskid+"child"+p)[0].querySelectorAll(".e-line"),"e-criticalconnector-line"),t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+l.taskid+"child"+p)[0].querySelectorAll(".e-connector-line-right-arrow"),"e-criticalconnector-line-right-arrow"),t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+l.taskid+"child"+p)[0].querySelectorAll(".e-connector-line-left-arrow"),"e-criticalconnector-line-left-arrow"))}},e.prototype.getModuleName=function(){return"criticalPath"},e.prototype.destroy=function(){!this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(this.parent.criticalPathModule=void 0)},e}(),Ct=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,enableRtl:this.parent.enableRtl,target:e,animationSettings:{effect:"None"},select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-gantt"}),this.contextMenu.appendTo(this.element),this.parent.treeGrid.contextMenuItems=this.headerMenuItems},e.prototype.contextMenuItemClick=function(e){this.item=this.getKeyFromId(e.item.id);var 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":isNaN(Number(this.rowData.ganttProperties.rowUniqueID))?this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID):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){t.isNullOrUndefined(i.parent.loadingIndicator)||"Shimmer"!==i.parent.loadingIndicator.indicatorType?i.parent.showSpinner():i.parent.showMaskRow(),i.parent.chartRowsModule.splitTask(i.rowData[r.id],n)})},e.prototype.mergeCall=function(e){var i=this;this.isEdit=!0;var r=this.parent.taskFields,n=this.rowData.ganttProperties.segments,a=[{firstSegmentIndex:"Right"===e?this.segmentIndex:n[this.segmentIndex-1].segmentIndex,secondSegmentIndex:"Left"===e?this.segmentIndex:n[this.segmentIndex+1].segmentIndex}],s={rowData:this.rowData,mergeSegmentIndexes:a,requestType:"mergeSegment",cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",s,function(e){t.isNullOrUndefined(i.parent.loadingIndicator)||"Shimmer"!==i.parent.loadingIndicator.indicatorType?i.parent.showSpinner():i.parent.showMaskRow(),!1===e.cancel&&i.parent.chartRowsModule.mergeTask(i.rowData[r.id],a)})},e.prototype.getClickedDate=function(e){var i;if(this.parent.enableRtl){var r=this.parent.element.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,a=document.documentElement.clientLeft||document.body.clientLeft||0;i=r.left+n-a}else i=this.parent.getOffsetRect(this.parent.element).left;var s,o;this.parent.enableRtl?(s=Math.abs(i+this.parent.ganttChartModule.chartElement.offsetWidth-this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft),o=Math.abs(this.clickedPosition-s)):(s=i+this.parent.ganttChartModule.chartElement.offsetLeft+this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft,o=this.clickedPosition-s);var l=Math.ceil(o/this.parent.perDayWidth),d=this.rowData.ganttProperties.startDate;return t.isNullOrUndefined(this.parent.timelineSettings.bottomTier)||"Hour"!==this.parent.timelineSettings.bottomTier.unit||(l=Math.ceil(o/this.parent.timelineSettings.timelineUnitSize),l-=1),this.parent.dataOperation.getEndDate(d,l,"None"!==this.parent.timelineSettings.bottomTier.unit?this.parent.timelineSettings.bottomTier.unit.toLocaleLowerCase():this.parent.timelineSettings.topTier.unit.toLocaleLowerCase(),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")||r.parentElement.classList.contains("e-treecolumn-container"))&&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[parseInt(o.toString(),10)]);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(G,"ToTask",this.getLocale("toTask"))):s.push(this.createItemModel(G,"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(G,"Manual",this.getLocale("manual"))):s.push(this.createItemModel(G,"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[parseInt(d.toString(),10)].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[parseInt(c.toString(),10)].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[parseInt(r.toString(),10)].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(G,"Right",this.getLocale("right"))):this.segmentIndex===s.length-1?r.push(this.createItemModel(G,"Left",this.getLocale("left"))):(r.push(this.createItemModel(G,"Right",this.getLocale("right"))),r.push(this.createItemModel(G,"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.isNullOrUndefined(i)||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(G,e,this.getLocale("taskInformation"),this.getIconCSS("e-edit",t));break;case"Indent":i=this.createItemModel(G,e,this.getLocale("indent"),this.getIconCSS("e-indent",t));break;case"Outdent":i=this.createItemModel(G,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(G,e,this.getLocale("add"),this.getIconCSS("e-add",t))).items=[],i.items.push(this.createItemModel(G,"Above",this.getLocale("above"),this.getIconCSS("e-add-above",t))),i.items.push(this.createItemModel(G,"Below",this.getLocale("below"),this.getIconCSS("e-add-below",t))),"ResourceView"!==this.parent.viewType&&i.items.push(this.createItemModel(G,"Child",this.getLocale("child"))),i.items.push(this.createItemModel(G,"Milestone",this.getLocale("milestone")));break;case"DeleteTask":i=this.createItemModel(G,e,this.getLocale("deleteTask"),this.getIconCSS("e-delete",t));break;case"DeleteDependency":(i=this.createItemModel(G,e,this.getLocale("deleteDependency"))).items=[],i.items.push({});break;case"Convert":(i=this.createItemModel(G,e,this.getLocale("convert"))).items=[],i.items.push({});break;case"TaskMode":(i=this.createItemModel(G,e,this.getLocale("changeScheduleMode"))).items=[],i.items.push({});break;case"SplitTask":i=this.createItemModel(G,e,this.getLocale("splitTask"));break;case"MergeTask":(i=this.createItemModel(G,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(G,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}(),Rt=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(i){e.parent.trigger("beforeExcelExport",i),t.isNullOrUndefined(e.parent.loadingIndicator)||"Shimmer"!==e.parent.loadingIndicator.indicatorType?e.parent.showSpinner():e.parent.showMaskRow()},this.parent.treeGrid.excelQueryCellInfo=function(t){e.parent.trigger("excelQueryCellInfo",t)},this.parent.treeGrid.excelHeaderQueryCellInfo=function(t){e.parent.trigger("excelHeaderQueryCellInfo",t)},this.parent.treeGrid.excelExportComplete=function(i){e.parent.trigger("excelExportComplete",i),t.isNullOrUndefined(e.parent.loadingIndicator)||"Shimmer"!==e.parent.loadingIndicator.indicatorType?e.parent.hideSpinner():e.parent.hideMaskRow()}},e}(),Mt=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}(),Ot=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&&(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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),e.cancel||(this.dropRows(e,!0),e.cancel=!0))},e.prototype.dropRows=function(e,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=this,p=0;p<l;p++){var h=function(e){if(d.parent.isOnEdit=!0,n=a[e],d.draggedRecord=n,"Invalid"!==d.dropPosition){if("ResourceView"===d.parent.viewType&&(d.checkisSharedTask(),d.previousParent=d.draggedRecord.parentItem.uniqueID),d.isSharedTask)return{value:void 0};i&&d.deleteDragRow();var l=d.treeGridData.indexOf(s);if("topSegment"===d.dropPosition&&d.dropAtTop(l),"bottomSegment"===d.dropPosition&&!d.isSharedTask){if(s.hasChildRecords){if(o=d.parent.editModule.getChildCount(s,0),d.parent.taskFields.parentID&&d.ganttData.length>0&&d.ganttData.splice(l+o+1,0,d.draggedRecord.taskData),d.treeGridData.splice(l+o+1,0,d.draggedRecord),d.parent.ids.splice(l+o+1,0,d.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===d.parent.viewType){var p=0===d.draggedRecord.level?"R"+d.draggedRecord.ganttProperties.taskId:"T"+d.draggedRecord.ganttProperties.taskId;d.parent.getTaskIds().splice(l+o+1,0,p)}}else if(d.parent.taskFields.parentID&&d.ganttData.length>0&&d.ganttData.splice(l+1,0,d.draggedRecord.taskData),d.treeGridData.splice(l+1,0,d.draggedRecord),d.parent.ids.splice(l+1,0,d.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===d.parent.viewType){var h=0===d.draggedRecord.level?"R"+d.draggedRecord.ganttProperties.taskId:"T"+d.draggedRecord.ganttProperties.taskId;d.parent.getTaskIds().splice(l+1,0,h)}if(d.parent.setRecordValue("parentItem",d.treeGridData[l].parentItem,n),d.parent.setRecordValue("parentUniqueID",d.treeGridData[l].parentUniqueID,n),d.parent.setRecordValue("level",d.treeGridData[l].level,n),n.hasChildRecords){d.updateChildRecordLevel(n,1),d.updateChildRecord(n,l+o+1)}if(s.parentItem){var c=d.parent.getParentTask(s.parentItem).childRecords,u=c.indexOf(s)+1;c.splice(u,0,n)}}if("middleSegment"===d.dropPosition&&(d.dropMiddle(l),s.childRecords.length>0&&(delete s.ganttProperties.segments,delete s.taskData[d.parent.taskFields.segments])),0!=d.treeGridData.length)for(var g=0;g<d.treeGridData.length;g++)if(d.treeGridData[parseInt(g.toString(),10)].index=g,!t.isNullOrUndefined(d.treeGridData[parseInt(g.toString(),10)].parentItem)){var f=t.getValue("uniqueIDCollection."+d.treeGridData[parseInt(g.toString(),10)].parentUniqueID,d.parent.treeGrid);d.treeGridData[parseInt(g.toString(),10)].parentItem.index=f.index}t.isNullOrUndefined(n.parentItem&&-1!==d.updateParentRecords.indexOf(n.parentItem))||d.updateParentRecords.push(n.parentItem)}if(!d.parent.enableVirtualization){var m=r.flatData,y=void 0,v=void 0,D=d.parent.dataSource,w=d.parent.taskFields.id;if(n.index<s.index){y=n.index;for(var k=0;k<D.length&&"break"!==function(e){var t=d.parent.currentViewData.filter(function(t){return t[w]===D[e][w]})[0];if(t&&t.index>s.index)return v=t.index,"break"}(k);k++);}else{y=s.index;for(var b=0;b<D.length&&"break"!==function(e){var t=d.parent.currentViewData.filter(function(t){return t[w]===D[e][w]})[0];if(t&&t.index>n.index)return v=t.index,"break"}(b);b++);}for(var T=y;T<=v;T++)!function(e){if(!t.isNullOrUndefined(m[e])&&(m[e].index=e,!t.isNullOrUndefined(m[e].parentItem))){var i=m.filter(function(t){return t.uniqueID===m[e].parentUniqueID})[0];m[e].parentItem.index=i.index}}(T)}r.rowDragAndDropModule.refreshDataSource()}(p);if("object"==typeof h)return h.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 c=void 0;c="middleSegment"===this.dropPosition?this.droppedRecord.uniqueID:this.droppedRecord.parentItem?this.droppedRecord.parentItem.uniqueID:this.droppedRecord.uniqueID;var u=this.parent.getTaskByUniqueID(c),g={};g[this.parent.taskFields.resourceInfo]=[],g[this.parent.taskFields.resourceInfo].push(u.ganttProperties.taskId),this.removeExistingResources();var f=this.parent.dataOperation.setResourceInfo(g),m=this.draggedRecord;t.isNullOrUndefined(m.ganttProperties.resourceInfo)&&(m.ganttProperties.resourceInfo=[]),"Unassigned Task"===u.ganttProperties.taskName?(m.ganttProperties.resourceInfo=[],m.ganttProperties.sharedTaskUniqueIds=[m.ganttProperties.rowUniqueID]):m.ganttProperties.resourceInfo.push(f[0]),this.updateCurrentTask(m),"Unassigned Task"===u.ganttProperties.taskName?this.deleteSharedResourceTask():this.updateSharedResourceTask()}if(this.parent.taskFields.dependency&&this.parent.allowParentDependency){var y,v=!0,D=void 0;D=n.parentItem?this.parent.flatData[this.parent.ids.indexOf(n.parentItem.taskId)]:n;var w=void 0;if((y=s.parentItem?this.parent.flatData[this.parent.ids.indexOf(s.parentItem.taskId)]:s).uniqueID===D.uniqueID||D.parentItem&&y.uniqueID===this.parent.flatData[this.parent.ids.indexOf(D.parentItem.taskId)].uniqueID){w=this.parent.currentViewData.filter(function(e){if(e.ganttProperties.predecessor&&e.ganttProperties.predecessor.length>0)for(var t=0;t<e.ganttProperties.predecessor.length;t++)return parseInt(e.ganttProperties.predecessor[t].to)===parseInt(y.ganttProperties.taskId)||parseInt(e.ganttProperties.predecessor[t].from)===parseInt(y.ganttProperties.taskId);return null});for(var k=[],p=0;p<w.length;p++){if(k=[],w[p].ganttProperties.predecessor)for(var b=0;b<w[p].ganttProperties.predecessor.length;b++)parseInt(w[p].ganttProperties.taskId)!==parseInt(w[p].ganttProperties.predecessor[b].from)?k.push(w[p].ganttProperties.predecessor[b].from):k.push(w[p].ganttProperties.predecessor[b].to);for(var T=this,S=0;S<k.length;S++)!function(e){var t=k[e].replace(/\D/g,""),i=T.parent.currentViewData.filter(function(e){return parseInt(e.ganttProperties.taskId)==parseInt(t)});(v=T.parent.connectorLineEditModule.validateParentPredecessor(w[p],i[0]))||(T.parent.dataOperation.resetDependency(w[p]),T.parent.dataOperation.resetDependency(i[0]))}(S)}}}for(S=0;S<this.updateParentRecords.length;S++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[S]);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){if(e[0],0)return;"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var r=[],n=0;n<e.length;n++)r[n]=this.parent.updatedRecords[e[n]];var a={data:r,dropIndex:t,dropPosition:this.dropPosition};this.dropRows(a,!0)}},e}(),xt=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}(),It=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}(),Et=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}(),Nt=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}(),Ft=function(){function e(){}return e}(),Ut=function(){function t(){this.cellSpacing=0,this.borderOverlapStyle=u.PdfBorderOverlapStyle.Overlap,this.allowHorizontalOverflow=!1,this.horizontalOverflowType=e.PdfHorizontalOverflowType.LastPage,this.cellPadding=new Nt}return t}(),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(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 Vt(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 It,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===Et.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(Et.default.right.width/2,Et.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 Bt(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,r>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=t.cells.getCell(s),d=l.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),Bt=function(e){function t(t,i){return e.call(this,t,i)||this}return Vt(t,e),t}(u.PdfLayoutResult),At=function(e){function t(t){return void 0===t?e.call(this)||this:e.call(this,t)||this}return Vt(t,e),t}(u.PdfLayoutFormat),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)}}(),Wt=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 Yt(t),t.rows=new zt(t),t.headers=new _t(t),t.style=new Ut,t.rowHeight=0,t}return Ht(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{for(var t=[],r=0,n=0,a=this.columns.count,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+=(r=this.headers.getHeader(i)).height;for(i=0;i<this.rows.count;i++){var r=this.rows.getRow(i);e+=r.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===Et.default.right.width/2&&e.bounds.y===Et.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}}}return this.setSpan(),this.layouter=new Lt(this),this.layouter.layoutInternal(e)},t.prototype.onBeginCellDraw=function(e){this.raiseBeginCellDraw&&this.beginCellDraw(this,e)},t.prototype.onEndCellDraw=function(e){this.raiseEndCellDraw&&this.endCellDraw(this,e)},t.prototype.setSpan=function(){for(var e=1,t=1,i=0,r=0,n=0,a=this.headers.count,s=0;s<a;s++){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++)for(var p=this.rows.getRow(s),h=p.cells.count,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),jt=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);this.row.treegrid.ganttStyle.font&&(i=this.row.treegrid.ganttStyle.font),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);this.row.treegrid.ganttStyle.font&&(s=this.row.treegrid.ganttStyle.font),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,i>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),this.row.treegrid.ganttStyle.font&&(l=this.row.treegrid.ganttStyle.font);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 Wt){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}(),qt=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 jt;return this.add(t),e}e.row=this.treegridRow,this.cells.push(e)},e.prototype.indexOf=function(e){return this.cells.indexOf(e)},e}(),Gt=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 qt(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}(),zt=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 Gt(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 jt);this.rows.push(e)},e.prototype.getRow=function(e){return this.rows[e]},e}(),_t=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}(),Xt=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}(),Yt=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 Xt(this.treegrid));for(var i=0;i<this.treegrid.rows.count;i++){var r=this.treegrid.rows.getRow(i),n=new jt;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}(),Zt=function(){function e(e){this.parent=e}return e.prototype.processGridExport=function(e,t,i){this.flatData=e,this.gantt=t,this.exportValueFormatter=new Qt(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=T(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=T(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=T(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=T(e.parent.connectorLineWidth>5?5: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 Nt,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=T(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 Et,t.style.borders.all=new u.PdfPen(t.style.borderColor),t.style.padding=new Nt;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.padding&&(t.style.padding=e.padding),e.borders&&(t.style.borders=e.borders)},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}(),Qt=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}(),Kt=function(){return(Kt=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)},Jt=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=T(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);!t.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(p=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var 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=T((this.parent.rowHeight-this.height)/2);m=e.section.indexOf(e);var b=t.isNullOrUndefined(this.unscheduleStarteDate)?this.startDate:this.unscheduleStarteDate,S=t.isNullOrUndefined(this.unscheduleEndDate)?this.endDate:this.unscheduleEndDate;if(r.startDate<=b&&S<=r.endDate)this.isStartPoint||(this.taskStartPoint=Kt({},i),this.isStartPoint=!0),this.isScheduledTask||"duration"===this.unscheduledTaskBy?(o.drawRectangle(y,v,i.x+T(this.left-n)+.5,i.y+k,T(s.width),T(s.height)),this.isScheduledTask&&(o.drawRectangle(D,w,i.x+T(this.left-n)+.5,i.y+k,T(s.progressWidth),T(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+T(this.left-n),i.y+k,T(g),T(this.height),c)))):this.drawUnscheduledTask(o,i,n,k),this.isCompleted=!0,this.startPage=m,this.endPage=m;else if(r.startDate<=b&&r.endDate>=b&&S>=r.endDate){this.isStartPoint||(this.taskStartPoint=Kt({},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+T(this.left-n)+.5,i.y+k,T(P),T(s.height)),s.width=s.width-P,this.isScheduledTask){C=0;C=this.progressWidth<=P?this.progressWidth:P,o.drawRectangle(D,w,i.x+T(this.left-n)+.5,i.y+k,T(C),T(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+T(this.left-n),i.y+k,T(g),T(this.height),c))}}else this.drawUnscheduledTask(o,i,n,k);this.left=0,this.isCompleted=!1,this.startPage=m}else if(S<=r.endDate&&r.startDate<=S&&!this.isCompleted)this.isStartPoint||(this.taskStartPoint=Kt({},i),this.isStartPoint=!0),o.drawRectangle(y,v,i.x+T(s.left+.5),i.y+k,T(s.width),T(s.height)),this.isScheduledTask&&(o.drawRectangle(D,w,i.x+T(s.left+.5),i.y+k,T(s.progressWidth),T(s.height)),t.isNullOrUndefined(this.taskLabel)||(g=this.progressWidth,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+T(this.left),i.y+k,T(g),T(this.height),c))),this.isCompleted=!0,this.endPage=m;else if(b<r.startDate&&S>r.endDate){if(this.isStartPoint||(this.taskStartPoint=Kt({},i),this.isStartPoint=!0),o.drawRectangle(y,v,i.x+T(s.left)+.5,i.y+k,T(r.totalWidth),T(s.height)),this.isScheduledTask){var C=0;C=this.progressWidth<=r.totalWidth?this.progressWidth:r.totalWidth,o.drawRectangle(D,w,i.x+T(s.left)+.5,i.y+k,T(C),T(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+T(this.left),i.y+k,T(g),T(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:T(this.rightTaskLabel.left))-T(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);!t.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(d=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var p=(T(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{d=this.getWidth(this.leftTaskLabel.value,Number.MAX_VALUE,15);a=T(o-(this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33))-d.actualSize.width,this.leftTaskLabel.left=a,this.leftTaskLabel.isLeftCalculated=!0}var l=a-T(n)+i.x;if(r.startPoint<=a&&a<r.endPoint&&!t.isNullOrUndefined(this.leftTaskLabel.value)&&!this.leftTaskLabel.isCompleted){var d=this.getWidth(this.leftTaskLabel.value,r.endPoint-a,15),p=new u.PdfStandardFont(this.fontFamily,9);!t.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(p=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var h=(T(this.parent.rowHeight)-d.actualSize.height)/2,c=new u.PointF(l,i.y+h),g=new u.SizeF(d.actualSize.width,d.actualSize.height),f=new u.RectangleF(c,g),m=new u.PdfStringFormat;if(m.alignment=u.PdfTextAlignment.Right,m.lineAlignment=u.PdfVerticalAlignment.Middle,d.actualSize.width>0){var y=new u.PdfSolidBrush(this.labelColor);s.drawString(d.lines[0].text,p,null,y,f.x,f.y,d.actualSize.width,d.actualSize.height,m),null!==d.remainder?(this.leftTaskLabel.value=d.remainder,this.leftTaskLabel.left=r.endPoint):this.leftTaskLabel.isCompleted=!0}else this.leftTaskLabel.left=r.endPoint}}},e.prototype.getWidth=function(e,i,r){var n=new u.PdfStandardFont(this.fontFamily,9);!t.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(n=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var a=new u.PdfStringLayouter,s=new u.PdfStringFormat;return s.alignment=u.PdfTextAlignment.Left,s.wordWrap=u.PdfWordWrapType.Character,s.lineAlignment=u.PdfVerticalAlignment.Middle,a.layout(e,n,s,new u.SizeF(i,r),!1,new u.SizeF(i,r))},e.prototype.drawUnscheduledTask=function(e,t,i,r){var n=new u.PdfSolidBrush(this.taskColor);e.drawRectangle(n,t.x+T(this.left-i),t.y+r,T(3),T(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=Kt({},t);var s=new u.PdfPen(this.milestoneColor),o=T((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+T(this.left-r),t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2),n.rotateTransform(45),n.drawRectangle(s,l,0,0,T(d),T(d)),n.restore(),this.endPage=this.startPage=a}},e}(),$t=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){l=!1;this.topTier[this.topTierIndex].isFinished||(r>=a.width?(n=a.width,a.isFinished=!0,a.completedWidth=n,l=!0):(n=r,l=!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+=T(n),r-=n,l&&this.topTierIndex++}else r=0}r=Math.floor(i.totalWidth);var s=this.parent.timelineModule.isSingleTier?0:this.topTierHeight;for(this.bottomTierPoint=new u.PointF(t.x,T(t.y+s));r>0;){var o=this.bottomTier[this.bottomTierIndex];if(this.bottomTier.length>this.bottomTierIndex){var l=!0,d=o.width;r<d&&(d=r,l=!1,o.completedWidth=d),this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,d,o.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+T(d),r-=d,o.completedWidth=d,l&&this.bottomTierIndex++}else r=0}},e.prototype.drawPageTimeline=function(e,i,r){this.topTierPoint=t.extend({},{},i,!0);for(a=this.prevTopTierIndex;a<=this.topTierIndex;a++)if(this.topTier.length>a){var n=this.topTier[a];n.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,n.completedWidth,n.value,!0),this.topTierPoint.x+=T(n.completedWidth))}this.bottomTierPoint.x=i.x,this.bottomTierPoint.y=T(i.y+this.topTierHeight);for(var a=this.prevBottomTierIndex;a<=this.bottomTierIndex;a++)if(this.bottomTier.length>a){var s=this.bottomTier[a];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+T(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,T(a),T(n));var y=new u.PdfStandardFont(p.fontFamily,g.fontSize,g.fontStyle);p.font&&(y=p.font);var 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,T(a),T(n),g.format)},e}(),ei=function(){return(ei=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)},ti=function(){function e(e,t){this.parent=e,this.pdfGantt=t}return e.prototype.add=function(){return new e(this.parent)},e.prototype.findindex=function(e,t){var i;return"CurrentViewData"===t.exportType?this.parent.currentViewData.map(function(t,r){t.index==e&&(i=r)}):this.parent.flatData.map(function(t,r){t.index==e&&(i=r)}),i},e.prototype.drawPredecessor=function(e,i){this.pdfGantt=e;var r,n,a=e.result.page.section.getPages(),s=e.taskbarCollection[this.findindex(this.parentIndex,i)],o=e.taskbarCollection[this.findindex(this.childIndex,i)],l=new u.PdfPage,d=new u.PdfPage,p="",h=0,c=0;switch(this.type){case"FS":if(!(!t.isNullOrUndefined(o)&&o.startPage>-1&&!t.isNullOrUndefined(s)&&s.endPage>-1))return;l=a[s.endPage],d=a[o.startPage],r=e.pdfPageDetail[s.endPage-e.chartPageIndex],n=e.pdfPageDetail[o.startPage-e.chartPageIndex],p=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(!(!t.isNullOrUndefined(o)&&o.endPage>-1&&!t.isNullOrUndefined(s)&&s.startPage>-1))return;l=a[s.startPage],d=a[o.endPage],r=e.pdfPageDetail[s.endPage-e.chartPageIndex],n=e.pdfPageDetail[o.startPage-e.chartPageIndex],p=this.parentIndex<this.childIndex?this.parentLeft>this.childLeft+this.childWidth?"SFType1":"SFType2":this.parentLeft>this.childLeft+this.childWidth?"SFType3":"SFType4";break;case"FF":if(!(!t.isNullOrUndefined(o)&&o.endPage>-1&&!t.isNullOrUndefined(s)&&s.endPage>-1))return;l=a[s.endPage],d=a[o.endPage],r=e.pdfPageDetail[s.endPage-e.chartPageIndex],n=e.pdfPageDetail[o.endPage-e.chartPageIndex],p=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(!(!t.isNullOrUndefined(o)&&o.startPage>-1&&!t.isNullOrUndefined(s)&&s.startPage>-1))return;l=a[s.startPage],d=a[o.startPage],r=e.pdfPageDetail[s.startPage-e.chartPageIndex],n=e.pdfPageDetail[o.startPage-e.chartPageIndex],p=this.parentIndex<this.childIndex?this.parentLeft>=this.childLeft?"SSType1":"SSType2":this.parentLeft>=this.childLeft?"SSType3":"SSType4"}var g=Math.round((this.parent.rowHeight-1)/2);g=T(g);var f,m,y,v,D,w;f=m=y=v=D=w=new u.PointF;var k=ei({},s.taskStartPoint),b=ei({},o.taskStartPoint);h=k.y+r.startPoint.y,c=b.y+n.startPoint.y;var S=new u.PointF(T(this.parentLeft+this.parentWidth),h+g),P=new u.PointF(T(this.parentLeft)-1,h+g),C=new u.PointF(T(this.childLeft-20),c+g),R=new u.PointF(T(this.childLeft-6-this.lineWidth)-1,c+g),M=new u.PointF(T(this.childLeft+this.childWidth+6+this.lineWidth)+1,c+g);switch(p){case"FSType1":case"FSType3":f=S,m=new u.PointF(T(this.childLeft-20),h+g),y=C,v=R,this.connectLines(l,d,f,m,y,v,o,g);break;case"FSType2":f=S,m=new u.PointF(f.x+10,h+g),y=new u.PointF(f.x+10,c+2),v=new u.PointF(T(this.childLeft-20),c+2),D=C,w=R,this.connectLines(l,d,f,m,y,v,o,g,D,w);break;case"FSType4":f=S,m=new u.PointF(f.x+10,h+g),y=new u.PointF(f.x+10,h+2),v=new u.PointF(T(this.childLeft-20),h+2),D=C,w=R,this.connectLines(l,d,f,m,y,v,o,g,D,w);break;case"FFType1":case"FFType3":f=new u.PointF(T(this.parentLeft+this.parentWidth)+1,h+g),m=new u.PointF(T(this.childLeft+this.childWidth+20),h+g),y=new u.PointF(m.x,c+g),v=M,this.connectLines(l,d,f,m,y,v,o,g);break;case"FFType2":case"FFType4":f=new u.PointF(T(this.parentLeft+this.parentWidth)+1,h+g),m=new u.PointF(T(this.parentLeft+this.parentWidth+20),h+g),y=new u.PointF(m.x,c+g),v=M,this.connectLines(l,d,f,m,y,v,o,g);break;case"SSType1":case"SSType3":f=P,m=new u.PointF(T(this.childLeft-20),h+g),y=new u.PointF(m.x,c+g),v=R,this.connectLines(l,d,f,m,y,v,o,g);break;case"SSType2":case"SSType4":f=P,m=new u.PointF(T(this.parentLeft-20),h+g),y=new u.PointF(m.x,c+g),v=R,this.connectLines(l,d,f,m,y,v,o,g);break;case"SFType1":case"SFType3":f=P,m=new u.PointF(T(this.childLeft+this.childWidth+20),h+g),y=new u.PointF(m.x,c+g),v=M,this.connectLines(l,d,f,m,y,v,o,g);break;case"SFType2":f=P,m=new u.PointF(T(this.parentLeft-20),h+g),y=new u.PointF(m.x,c+2),v=new u.PointF(T(this.childLeft+this.childWidth+20),c+2),D=new u.PointF(v.x,c+g),w=M,this.connectLines(l,d,f,m,y,v,o,g,D,w);break;case"SFType4":f=P,m=new u.PointF(T(this.parentLeft-20),h+g),y=new u.PointF(m.x,h+2),v=new u.PointF(T(this.childLeft+this.childWidth+20),h+2),D=new u.PointF(v.x,c+g),w=M,this.connectLines(l,d,f,m,y,v,o,g,D,w)}},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=ei({},i),s=ei({},i),o=ei({},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+=T(this.parent.timelineModule.isSingleTier?45:62))):y>i.y&&(s.y=o.y=y-1,i.y=y,this.pdfGantt.enableHeader&&(o.y+=T(this.parent.timelineModule.isSingleTier?45:62),i.y+=T(this.parent.timelineModule.isSingleTier?45: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,T(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;if(s="FS"===this.type||"SS"===this.type?new u.PointF(T(this.childLeft)-1,t.taskStartPoint.y+n.startPoint.y):new u.PointF(T(this.childLeft+this.childWidth)+1,t.taskStartPoint.y+n.startPoint.y),!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-T(l),h.y-T(l)):new u.PointF(h.x+T(l),h.y-T(l));var c=new u.PointF(r.x,r.y+T(2*l)),g=new u.PdfSolidBrush(this.connectorLineColor),f=new u.PdfPen(g,T(this.lineWidth));p.drawLine(f,h,r),p.drawLine(f,r,c),p.drawLine(f,c,h)},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(){return(ri=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)},ni=function(e){function i(t){var i=e.call(this)||this;return i.exportProps={},i.parent=t,i.chartHeader=new $t(i),i.predecessor=new ti(t,i),i.headerDetails=[],i.pdfPageDetail=[],i.taskbarCollection=[],i.predecessorCollection=[],i}return ii(i,e),Object.defineProperty(i.prototype,"taskbar",{get:function(){return t.isNullOrUndefined(this.taskbars)&&(this.taskbars=new Jt(this.parent)),this.taskbars},enumerable:!0,configurable:!0}),i.prototype.drawChart=function(e,t){this.result=e,this.totalPages=this.result.page.section.count,this.perColumnPages=this.totalPages/this.layouter.columnRanges.length,this.calculateRange(),this.drawGantttChart(t),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=T(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=T(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=S(o-s)):(h[1]=s+g,p.totalWidth=S(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.timelineModule.timelineStartDate),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(S(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(S(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(S(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(S(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/T(this.chartHeader.bottomTierCellWidth));p.startDate.setDate(p.startDate.getDate()+k*m);var b=Math.round((p.endPoint-p.startPoint)/T(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+b*m);break;case"Week":p.startDate=new Date(f.getTime());var P=p.startPoint/T(this.chartHeader.bottomTierCellWidth)*7;p.startDate.setDate(p.startDate.getDate()+P*m);var C=7*Math.round((p.endPoint-p.startPoint)/T(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 R=p.startPoint/T(this.chartHeader.bottomTierCellWidth)*31;p.startDate.setDate(p.startDate.getDate()+R*m);var M=31*Math.round((p.endPoint-p.startPoint)/T(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+M*m);break;case"Year":p.startDate=new Date(f.getTime());var O=p.startPoint/T(this.chartHeader.bottomTierCellWidth)*365;p.startDate.setDate(p.startDate.getDate()+O*m);var x=365*Math.round((p.endPoint-p.startPoint)/T(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(e){var t,i=this,r=this.startPoint,n=new u.PointF,a=0,s=0,o=0;this.headerDetails.forEach(function(e,l){var d=i.result.page.section.getPages()[i.startPageIndex];i.chartHeader.drawTimeline(d,i.startPoint,e),r.y=r.y+T(i.parent.timelineModule.isSingleTier?45:60),a=r.x,o=T(i.parent.timelineModule.isSingleTier?45:60),i.headerDetails[i.headerDetails.indexOf(e)].startIndex=i.startPageIndex,i.headerDetails[i.headerDetails.indexOf(e)].pageStartPoint=r;for(var p=0;p<i.taskbarCollection.length;p++){var h=i.taskbarCollection[p],c=i.rows.getRow(p+1).height,g=i.result.page.section.getPages()[i.startPageIndex];h.drawTaskbar(g,r,e,s,c,i.taskbarCollection[p])&&(i.enableHeader?r.y=T(i.parent.timelineModule.isSingleTier?45:60):r.y=0,i.startPageIndex++,(t={}).height=o,t.pageStartX=a,t.startPoint=ri({},n),t.width=T(e.totalWidth),i.pdfPageDetail.push(t),n.y+=t.height,i.enableHeader?o=i.chartHeader.height:(r.y=0,o=0)),r.y+=c,o+=c}i.headerDetails[l].endIndex=i.startPageIndex,s+=e.totalWidth,(t={}).height=o,t.pageStartX=a,t.startPoint=ri({},n),t.width=T(e.totalWidth),i.pdfPageDetail.push(t),n.x+=t.width,n.y=0,i.enableHeader?o=i.chartHeader.height:r.y=0,i.headerDetails.indexOf(e)!==i.headerDetails.length-1&&(i.result.page.section.add(),i.startPageIndex=i.result.page.section.count-1,r=i.startPoint=new u.PointF(0,0))});for(var l=0;l<this.predecessorCollection.length;l++)this.predecessorCollection[l].drawPredecessor(this,e)},i}(Wt),ai=function(){function e(e){this.isPdfExport=!1,this.parent=e,this.helper=new Zt(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 ni(this.parent)},e.prototype.export=function(e,i,r,n){var a=this;this.isBlob=n;var s={requestType:"beforePdfExport",ganttObject:this.parent,cancel:!1};return this.parent.trigger("beforePdfExport",s),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),t.getValue("cancel",s)?new Promise(function(e,t){return e()}):new Promise(function(t,n){a.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",a.isBlob?{promise:a.blobPromise}:{}),t.isNullOrUndefined(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.hideSpinner():a.parent.hideMaskRow(),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 At;e.break=u.PdfLayoutBreakType.FitElement;var a=n.gantt.drawGrid(s,0,0,e);return n.gantt.drawChart(a,i),r||(n.isBlob?n.blobPromise=n.pdfDocument.save():!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 xt(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 xt(i.theme).style;else{var n=new xt(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}(),si=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}();return ot.Inject(vt,wt,Dt,mt,yt,ft,St,kt,Ct,Rt,Ot,Mt,ai,si,Pt),e.Gantt=ot,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=b,e.pixelToPoint=T,e.pointToPixel=S,e.getUid=P,e.load="load",e.rowDataBound="rowDataBound",e.queryCellInfo="queryCellInfo",e.toolbarClick="toolbarClick",e.keyPressed="key-pressed",e.Edit=ft,e.Reorder=mt,e.Resize=yt,e.Filter=vt,e.Sort=Dt,e.Dependency=et,e.Selection=wt,e.Toolbar=kt,e.DayMarkers=St,e.CriticalPath=Pt,e.ContextMenu=Ct,e.ExcelExport=Rt,e.ColumnMenu=Mt,e.RowDD=Ot,e.PdfExport=ai,e.VirtualScroll=si,e.Column=K,e.DayWorkingTime=te,e.AddDialogFieldSettings=ne,e.EditDialogFieldSettings=oe,e.EditSettings=pe,e.EventMarker=ue,e.FilterSettings=me,e.SearchSettings=De,e.Holiday=be,e.LabelSettings=Pe,e.SelectionSettings=Me,e.SplitterSettings=Ie,e.TaskFields=Fe,e.TimelineTierSettings=Le,e.TimelineSettings=Be,e.TooltipSettings=We,e.SortDescriptor=Ge,e.SortSettings=ze,e.ResourceFields=Ye,e.LoadingIndicator=Ke,e.TemporaryDictionary=It,e.PdfBorders=Et,e.PdfPaddings=Nt,e.PdfTreeGridStyleBase=Ft,e.PdfTreeGridStyle=Ut,e.PdfGanttTheme=xt,e.PdfTreeGridLayouter=Lt,e.PdfTreeGridLayoutResult=Bt,e.PdfTreeGridLayoutFormat=At,e.PdfTreeGridCell=jt,e.PdfTreeGridCellCollection=qt,e.PdfTreeGridRow=Gt,e.PdfTreeGridRowCollection=zt,e.PdfTreeGridHeaderCollection=_t,e.PdfTreeGridColumn=Xt,e.PdfTreeGridColumnCollection=Yt,e}({},ej.base,ej.popups,ej.grids,ej.data,ej.treegrid,ej.layouts,ej.navigations,ej.richtexteditor,ej.inputs,ej.buttons,ej.calendars,ej.dropdowns,ej.pdfexport),this.ejs=ej;
|
|
10
|
+
this.ej=this.ej||{},this.ej.gantt=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++){o=void 0;a=o=i?e[s].taskData:t.extend({},e[s].taskData,{},!0)}return a}for(var a=[],s=0;s<e.length;s++){var 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 b(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 T(e){return 76*e/92}function S(e){return 92*e/76}function P(){return C++}var C=0,R=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;if(this.parent.autoCalculateDateScheduling){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())}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;if(this.parent.autoCalculateDateScheduling){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())}return t.isNullOrUndefined(n)||this.setTime(this.parent.defaultEndTime,n),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 i&&i.baselineStartDate&&r&&i.baselineStartDate.getTime()>r.getTime()&&r.setDate(r.getDate()+1),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))r=e[this.parent.taskFields.endDate],t.isNullOrUndefined(r)||this.setTime(this.parent.defaultEndTime,r),this.parent.setRecordValue("endDate",r,i,!0);else{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(this.parent.taskFields.milestone)||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&&this.parent.autoCalculateDateScheduling&&r?this.getWeekendCount(e,i):0,s=this.getNumberOfSeconds(e,i,n),o=r&&this.parent.autoCalculateDateScheduling?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.toLocaleLowerCase()?"hour"===t.toLocaleLowerCase()?3600*e:60*e:this.parent.secondsPerDay*e},e.prototype.getEndDate=function(e,t,i,r,n){for(var a=new Date(e.getTime()),s=new Date(e.getTime()),o=this.getDurationAsSeconds(t,i);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,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(s,a,r.isAutoSchedule,!0))>0&&(a=this.checkEndDate(s,r)),a=new Date(s.getTime());return n&&r.isMilestone&&(s.setDate(s.getDate()-1),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,s),s=this.parent.dateValidationModule.checkStartDate(s,r,!0)),s},e.prototype.getProjectStartDate=function(e,i){if(!t.isNullOrUndefined(this.parent.cloneProjectStartDate)){"string"==typeof this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate));o=this.checkStartDate(this.parent.cloneProjectStartDate);return this.parent.cloneProjectStartDate=o,new Date(o.getTime())}if(t.isNullOrUndefined(this.parent.projectStartDate)){if(t.isNullOrUndefined(i))return null;var r=this.parent.flatData,n=void 0;r.length>0?n=r[0].ganttProperties.startDate:(n=new Date).setHours(0,0,0,0);for(var a=1;a<r.length;a++){var s=r[a].ganttProperties.startDate;t.isNullOrUndefined(s)||-1!==this.compareDates(s,n)||(n=s)}this.parent.cloneProjectStartDate=this.checkStartDate(n,e)}else{var o=this.getDateFromFormat(this.parent.projectStartDate);this.parent.cloneProjectStartDate=this.checkStartDate(o)}return new Date(this.parent.cloneProjectStartDate.getTime())},e.prototype.getValidStartDate=function(e,i){var r=this,n=null,a=i?e.autoStartDate:e.startDate,s=i?e.autoEndDate:e.endDate,o=!e.isAutoSchedule&&e.autoDuration?e.autoDuration:e.duration;return t.isNullOrUndefined(a)?t.isNullOrUndefined(s)?t.isNullOrUndefined(o)||this.parent.flatData.map(function(i){i.ganttProperties.taskId==e.taskId&&(!t.isNullOrUndefined(i.parentItem)&&i.parentItem.taskId?r.parent.flatData.map(function(a){a.ganttProperties.taskId===i.parentItem.taskId?t.isNullOrUndefined(a.ganttProperties.startDate)||(n=a.ganttProperties.startDate):n=r.getProjectStartDate(e)}):n=r.getProjectStartDate(e))}):(n=new Date(s.getTime()),this.setTime(this.parent.defaultStartTime,n)):n=new Date(a.getTime()),n},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,this.parent.autoCalculateDateScheduling||(i=!0),!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.parent.autoCalculateDateScheduling)&&this.isOnHolidayOrWeekEnd(e,null),d=!(!i||!this.parent.autoCalculateDateScheduling)&&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 d?o+=n-r: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){o=s-i;r.setTime(r.getTime()+60*o*1e3)}else if(s>=0){var o=i-s;r.setTime(r.getTime()-60*o*1e3)}}},e.prototype.getSecondsInDecimal=function(e){return 60*e.getHours()*60+60*e.getMinutes()+e.getSeconds()+e.getMilliseconds()/1e3},e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var r=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(r.getTime())?0:(e.getTime()-r.getTime())/6e4+i}catch(e){return 0}},e.prototype.remove=function(e,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}return!t.isNullOrUndefined(this.parent.timezone)&&i?this.convert(r,this.parent.timezone):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){(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))}),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}(),M=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 M(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=this,n=0;n<t.length;n++)!function(n){var a=t[n],s=null!=r.parent.taskFields.child?r.parent.taskFields.child:r.parent.taskFields.child="Children",o=a&&a[r.parent.taskFields.resourceInfo],l=r.parent.resourceFields.id;a[s]&&0!==a[s].length||!o||!o.length?(!a[s]||a[s]&&0===a[s].length)&&i.push(a):o.forEach(function(t){for(var i="object"==typeof t?t[l]:t,r=0;r<e.length;r++)if(e[r][l].toString()===i.toString()){e[r][s]?e[r][s].push(a):e[r][s]=[a];break}}),a[r.parent.taskFields.child]&&a[r.parent.taskFields.child].length&&r.constructResourceViewDataSource(e,a[r.parent.taskFields.child],i)}(n)},i.prototype.prepareDataSource=function(e){this.prepareRecordCollection(e,0),this.parent.initialLoadData=t.extend({},{},this.parent.flatData,!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=this,t=0;t<this.parent.getTaskIds().length;t++)!function(t){var i=[];if(i[0]=e.parent.getTaskIds()[t][0],i[1]=e.parent.getTaskIds()[t].slice(1),"R"!==i[0]){var r=[],n=[];e.parent.flatData.filter(function(e){e.ganttProperties.taskId.toString()===i[1]&&0!==e.level&&(n.push(e.ganttProperties.rowUniqueID),r.push(e))});for(var a=0;a<r.length;a++)r[a].ganttProperties.sharedTaskUniqueIds=n}}(t)},i.prototype.prepareRecordCollection=function(e,i,r){for(var n=this,a=e.length,s=this,o=0;o<a;o++)!function(a){var o=e[a];if(!t.isNullOrUndefined(s.parent.taskFields.segmentId)){var l=s.segmentCollection.filter(function(e){return e.key===o[n.parent.taskFields.id]});l.length>0&&(o[s.parent.taskFields.segments]=l[0].items)}var d=s.createRecord(o,i,r,!0);s.parent.enableValidation&&s.parent.autoCalculateDateScheduling||s.updateTaskLeftWidth(d),d.index=s.recordIndex++,s.parent.ids[d.index]=d.ganttProperties.rowUniqueID,s.parent.flatData.push(d),s.parent.setTaskIds(d);var p=o[s.parent.taskFields.child];if("ResourceView"===s.parent.viewType&&t.isNullOrUndefined(p)&&t.isNullOrUndefined(d.parentItem)&&0===d.level){var h=d.ganttProperties,c=d;s.parent.setRecordValue(h.isAutoSchedule?"startDate":"autoStartDate",null,c.ganttProperties,!0),s.parent.setRecordValue(h.isAutoSchedule?"endDate":"autoEndDate",null,c.ganttProperties,!0);var u=c.ganttProperties;s.parent.setRecordValue("isMilestone",!1,u,!0),u.isAutoSchedule&&s.calculateDuration(c),s.updateWorkWithDuration(c);var g=u.work;s.parent.setRecordValue("work",g,u,!0),s.parent.setRecordValue("taskType","FixedDuration",u,!0),t.isNullOrUndefined(s.parent.taskFields.type)||s.updateMappingData(c,"type"),s.parent.setRecordValue("progress",Math.floor(0),u,!0),s.parent.setRecordValue("totalProgress",0,u,!0),s.parent.setRecordValue("totalDuration",0,u,!0),u.isAutoSchedule||(s.parent.setRecordValue("autoDuration",s.calculateAutoDuration(u),u,!0),s.updateAutoWidthLeft(c)),s.parent.allowParentDependency||s.resetDependency(c),s.updateWidthLeft(c),s.updateTaskData(c)}!t.isNullOrUndefined(p)&&p.length>0&&s.prepareRecordCollection(p,d.level+1,d)}(o)},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])||"ResourceView"===this.parent.viewType&&0==i)&&"Unassigned Task"!==e[s.name]?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()||!t.isNullOrUndefined(y.baselineStartDate)&&!t.isNullOrUndefined(y.startDate)&&y.baselineStartDate.getTime()===y.startDate.getTime()&&!t.isNullOrUndefined(g)&&!t.isNullOrUndefined(y.endDate)&&g.toLocaleDateString()===y.endDate.toLocaleDateString()&&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.parent.allowParentDependency||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_","");"ResourceView"===this.parent.viewType&&"string"==typeof f.ganttProperties.taskId&&(w=y.taskId.toString()),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)){if((c=this.getDateFromFormat(c))&&(t.isNullOrUndefined(u)||""===String(u))&&0===c.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,c),c=this.checkEndDate(c,e.ganttProperties,!1),u=this.getDuration(h,c,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),n.duration){if((o=e.ganttProperties.duration-s-1)<=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}}else if(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),t.isNullOrUndefined(a[a.length-1])||this.parent.setRecordValue("endDate",a[a.length-1].endDate,e.ganttProperties,!0),t.isNullOrUndefined(n.endDate)||t.isNullOrUndefined(a[a.length-1])||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||t.isNullOrUndefined(i[n.segments])&&t.isNullOrUndefined(e.taskData)?null:i[n.segments]||e.taskData[n.segments],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(this.parent.autoCalculateDateScheduling||(t.isNullOrUndefined(e.ganttProperties.startDate)||(e[this.parent.taskFields.startDate]=e.ganttProperties.startDate,e.taskData[this.parent.taskFields.startDate]=e.ganttProperties.startDate),t.isNullOrUndefined(e.ganttProperties.endDate)||(e[this.parent.taskFields.endDate]=e.ganttProperties.endDate,e.taskData[this.parent.taskFields.endDate]=e.ganttProperties.endDate)),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,r):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=!t.isNullOrUndefined(a)||!this.parent.allowUnscheduledTasks):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,i){var r=new Date(e.getTime()),n=new Date(t.getTime()),a="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,s=!1,o=new Date(e.getTime()),l=0;i&&"hour"==i.durationUnit&&(o=new Date(o.getTime()+60*i.duration*60*1e3)),i&&"minute"==i.durationUnit&&(o=new Date(o.getTime()+60*i.duration*60*60*1e3));for(var d=0;d<this.parent.dayWorkingTime.length;d++)l=l+this.parent.dayWorkingTime[d].to-this.parent.dayWorkingTime[d].from;var p=o.getTime()-r.getTime();return"Day"===a?((Math.floor(p/36e5%24)>=l||0===p)&&(s=!0),this.getSecondsInDecimal(r)===this.parent.defaultStartTime&&s&&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)):s=!0,r.getTime()===n.getTime()?this.parent.perDayWidth:s?this.getTimeDifference(r,n)/864e5*this.parent.perDayWidth:this.getTimeDifference(r,n)/(36e5*l)*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):this.getSecondsInDecimal(i)===this.parent.defaultEndTime&&this.parent.allowUnscheduledTasks&&i.setHours(22));var r=this.parent.timelineModule.timelineStartDate;return r?(i.getTime()-r.getTime())/864e5*this.parent.perDayWidth:0},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=0;d<r.length;d++)!function(e){i.filter(function(t){t[n.id]===r[e][n.id]&&l.push(r[e])})}(d);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.setDataSource=function(e){for(var i=[],r=e.length,n=0;n<r;n++){var a=e[n];i.push(a),t.isNullOrUndefined(e[n][this.parent.taskFields.child])||this.setDataSource(e[n][this.parent.taskFields.child])}return i},i.prototype.setStartDate=function(e){var i=this;(t.isNullOrUndefined(this.parent.taskFields.parentID)||t.isNullOrUndefined(this.parent.taskFields.id)?this.parent.dataSource:this.setDataSource(this.parent.dataSource)).map(function(r){e.ganttProperties.taskId===r[i.parent.taskFields.id]&&(t.isNullOrUndefined(i.parent.taskFields.startDate)||(e[i.parent.taskFields.startDate]=r[i.parent.taskFields.startDate]),t.isNullOrUndefined(i.parent.taskFields.endDate)||(e[i.parent.taskFields.endDate]=r[i.parent.taskFields.endDate]))})},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.isLoad||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.isLoad||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.isLoad||this.parent.setRecordValue("taskData."+i.notes,r.notes,e),this.parent.setRecordValue(i.notes,r.notes,e)),i.cssClass&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.cssClass,r.cssClass,e),this.parent.setRecordValue(i.cssClass,r.cssClass,e)),i.indicators&&(this.parent.isLoad||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.isLoad||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.isLoad||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])&&"string"==typeof i&&(i=i.split(","));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.name,s=this.parent.resourceFields.unit,o=this.parent.resourceFields.group,l=[],d=0;d<i.length;d++)!function(e){var d=r.filter(function(t){return"object"==typeof i[e]&&i[e][n]===t[n]||(i[e]===t[n]||i[e]===t[a])}),p=t.extend({},d[0]);l.push(p),t.isNullOrUndefined(s)||t.isNullOrUndefined(i[e][s])||(p[s]=i[e][s]),t.isNullOrUndefined(o)||t.isNullOrUndefined(i[e][o])||(p[o]=i[e][o])}(d);return this.updateResourceUnit(l),l},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=[],n=this.parent.taskFields;if(i){var a=i.length,s=t.extend([],[],e.taskData[this.parent.taskFields.resourceInfo],!0);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e);for(var o=0;o<a;o++){var l=i[o],d=l[this.parent.resourceFields.name],p=l[this.parent.resourceFields.unit];if(100!==p&&(d+="["+p+"%]"),r.push(d),e.taskData){var h=n.resourceInfo;s[o],e.taskData[h].push(s[o])}}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.parent.isLoad&&this.setStartDate(i),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)return void(e.ganttProperties.workTimelineRanges=[]);i=this.setSortedChildTasks(e),this.updateOverlappingIndex(i);for(var n=1;n<i.length;n++){t=i[n];for(var a=new Date(t.ganttProperties.startDate.getTime()),s=new Date(t.ganttProperties.endDate.getTime()),o=[],l=0;l<n;l++){var d=i[l].ganttProperties.startDate,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.parent.autoCalculateDateScheduling||this.updateWidthLeft(e),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(t),t,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(t),t,!0);var i,r=[];e.parentItem&&(r=(i=this.parent.getParentTask(e.parentItem)).childRecords),i&&r.indexOf(e)===r.length-1&&!e.hasChildRecords&&this.parent.enableValidation?((this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType)&&this.updateParentItems(i),this.parent.autoCalculateDateScheduling||this.updateWidthLeft(i)):i&&!this.parent.enableValidation&&this.updateWidthLeft(i)},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?e.ganttProperties.totalDuration:0,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(this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType){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),v[this.parent.taskFields.duration]<1?(p+=t.getValue("totalDuration",h),p=Number(p.toFixed(4))):p+=t.getValue("totalDuration",h)):g++,y+=v.ganttProperties.work}if(!n){var b=void 0,T=(b=this.parent.isOnDelete&&v.isDelete?d-g-1:d-g)>0&&p>0?Number((m/p).toFixed(2)):0,S=r.ganttProperties,P=!(0!==b||!c||!u||c.getTime()!==u.getTime());0!==this.compareDates(s,c)&&(this.parent.setRecordValue(a.isAutoSchedule?"startDate":"autoStartDate",c,r.ganttProperties,!0),(t.isNullOrUndefined(a.autoDuration)?0===a.duration:0===a.autoDuration)&&r.isManual&&P&&r.hasChildRecords&&r.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("startDate",c,r.ganttProperties,!0)),0!==this.compareDates(o,u)&&(this.parent.setRecordValue(a.isAutoSchedule?"endDate":"autoEndDate",u,r.ganttProperties,!0),(t.isNullOrUndefined(a.autoDuration)?0===a.duration:0===a.autoDuration)&&r.isManual&&P&&r.hasChildRecords&&r.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("endDate",u,r.ganttProperties,!0)),this.parent.setRecordValue("isMilestone",P,S,!0),t.isNullOrUndefined(this.parent.taskFields.milestone)||this.updateMappingData(r,"milestone"),S.isAutoSchedule&&this.calculateDuration(r),this.updateWorkWithDuration(r);var C=S.work;C=this.parent.isOnEdit?C:C+y,this.parent.setRecordValue("work",C,S,!0),this.parent.setRecordValue("taskType","FixedDuration",S,!0),t.isNullOrUndefined(this.parent.taskFields.type)||this.updateMappingData(r,"type"),this.parent.setRecordValue("progress",Math.floor(T),S,!0),this.parent.setRecordValue("totalProgress",m,S,!0),this.parent.setRecordValue("totalDuration",p,S,!0),S.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(S),S,!0),this.updateAutoWidthLeft(r)),this.parent.allowParentDependency||this.resetDependency(r),this.updateWidthLeft(r),this.updateTaskData(r)}}}else r.ganttProperties.endDate=r.taskData[this.parent.taskFields.endDate];n&&1===r.childRecords.length&&0===r.ganttProperties.duration&&(this.parent.setRecordValue("isMilestone",!0,r.ganttProperties,!0),this.updateWidthLeft(r),this.updateTaskData(r));var R=this.parent.getParentTask(r.parentItem);R&&(this.parent.autoCalculateDateScheduling||"ResourceView"===this.parent.viewType)&&this.updateParentItems(R),n=!1},i}(R),x="e-timeline-single-header-outer-div",I="e-left-label-container",E="e-right-label-container",N="e-taskbar-main-container",F="e-task-label",U="e-gantt-child-progressbar-inner-div",V="e-baseline-bar",L="e-chart-row",B="e-child-progress-resizer",A="e-gantt-child-taskbar",H="e-gantt-manualparenttaskbar",W="e-label",j="e-gantt-dependency-view-container",q="e-connectorpoint-left",G=".e-content",z="e-rangecontainer",_=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),this.parent.treeGrid.grid.on("showGanttShimmer",this.updateShimmer,this),this.parent.treeGrid.grid.on("removeGanttShimmer",this.removeShimmer,this)},e.prototype.removeEventListeners=function(){t.EventHandler.remove(this.element,"scroll",this.onScroll),this.parent.off("grid-scroll",this.gridScrollHandler),this.parent.treeGrid.grid.off("showGanttShimmer",this.updateShimmer),this.parent.treeGrid.grid.off("removeGanttShimmer",this.removeShimmer)},e.prototype.gridScrollHandler=function(e){this.element.scrollTop=t.getValue("top",e),this.isFromTreeGrid=!0},e.prototype.updateTopPosition=function(){var e,i=this.parent.treeGrid.element.querySelector(".e-content").scrollTop;if(e=this.parent.virtualScrollModule&&this.parent.enableVirtualization?i-this.parent.virtualScrollModule.getTopPosition():i,!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.removeShimmer=function(){var e=this.parent;setTimeout(function(){if(e.hideMaskRow(),"ResourceView"===e.viewType&&!e.allowTaskbarOverlap&&e.showOverAllocation){for(var t=0;t<e.currentViewData.length;t++){var i=e.chartRowsModule.ganttChartTableBody.childNodes[t];"none"!==i.style.display&&e.currentViewData[t].hasChildRecords&&!e.currentViewData[t].expanded&&(e.treeGrid.getRowByIndex(t).style.height=i.style.height)}e.contentHeight=e.enableRtl?e.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:e.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=e.contentHeight+"px"}},0)},e.prototype.updateShimmer=function(){var e=this.parent;setTimeout(function(){e.showMaskRow()},0)},e.prototype.updateSpinner=function(){var e=this.parent;this.parent.showSpinner(),window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(function(){e.hideSpinner()},200)},e.prototype.onScroll=function(){var e={};this.element.scrollTop!==this.previousScroll.top&&(this.isFromTreeGrid?this.isFromTreeGrid=!1:this.parent.notify("chartScroll",{top:this.element.scrollTop}),e.previousScrollTop=this.previousScroll.top,this.previousScroll.top=this.element.scrollTop,e.scrollTop=this.element.scrollTop,e.scrollDirection="Vertical",e.action="VerticalScroll",this.updateTopPosition()),this.element.scrollLeft!==this.previousScroll.left&&(this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,e.previousScrollLeft=this.previousScroll.left,this.previousScroll.left=this.element.scrollLeft,e.scrollLeft=this.element.scrollLeft,e.scrollDirection="Horizontal",e.action="HorizontalScroll"),"Horizontal"===e.scrollDirection||t.isNullOrUndefined(e.scrollDirection)||!0!==this.parent.enableVirtualization||!this.parent.isToolBarClick&&!t.isNullOrUndefined(this.parent.isToolBarClick)||(this.parent.isVirtualScroll=!0,(this.parent.showIndicator||t.isNullOrUndefined(this.parent.showIndicator))&&!this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization&&"Spinner"===this.parent.loadingIndicator.indicatorType&&this.updateSpinner()),this.parent.isToolBarClick=!0,e.requestType="scroll",this.parent.trigger("actionComplete",e)},e.prototype.setHeight=function(e){this.element.style.height=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,t){t&&(e=-1===t&&this.parent.enableRtl?-e:e),this.element.scrollLeft=e,this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,this.previousScroll.left=this.element.scrollLeft},e.prototype.destroy=function(){this.removeEventListeners()},e}(),X=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}(),Y=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:z}),this.rangeViewContainer.setAttribute("role","RangeContainer"),this.virtualRender=new X(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("."+z);i&&(i.innerHTML=""),0===this.parent.treeGrid.grid.filterSettings.columns.length&&this.renderRangeContainer(this.parent.currentViewData)},e.prototype.renderChartElements=function(){if(this.parent.isFromOnPropertyChange)this.rangeViewContainer.innerHTML="",this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff),this.parent.isFromOnPropertyChange=!1;else{this.parent.chartRowsModule.renderChartRows(),this.parent.predecessorModule&&this.parent.taskFields.dependency&&(this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection()),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);for(var e=0;e<this.parent.chartRowsModule.ganttChartTableBody.children.length;e++)this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4]?(this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[2].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4].setAttribute("tabindex","-1")):"ProjectView"===this.parent.viewType?t.isNullOrUndefined(this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[1])||this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"):this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[0]&&this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[0].setAttribute("tabindex","-1");if(this.parent.enableCriticalPath){var i=this.parent.criticalPathModule;this.parent.criticalPathModule.criticalConnectorLine(i.criticalPathCollection,i.detailPredecessorCollection,this.parent.enableCriticalPath,i.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=0,n=this.parent.currentViewData.indexOf(i);r=!this.parent.allowTaskbarOverlap&&this.parent.enableMultiTaskbar?i.expanded?this.parent.getRowByIndex(n).offsetTop+this.parent.rowHeight:this.parent.getRowByIndex(n).offsetTop:this.getTopValue(i);var a=this.rangeViewContainer.querySelector(".rangeContainer"+i.ganttProperties.rowUniqueID);a&&a.remove();var s=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 o=0;o<e.length;o++){var l=void 0;l=this.parent.allowTaskbarOverlap||i.expanded||!this.parent.enableMultiTaskbar?this.getRangeHeight(i):parseInt(this.parent.chartRowsModule.ganttChartTableBody.childNodes[n].style.height)-(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight);var d=t.createElement("div",{className:"e-rg-rangdiv e-leftarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[o].left+e[o].width-5:e[o].left)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px;\n height: "+(l+1)+"px; border-right: 0px"}),p=t.createElement("div",{className:"e-rg-rangdiv e-rightarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[o].left:e[o].left+e[o].width-5)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px; height: "+(l+1)+"px;\n border-left: 0px"});s.appendChild(d),s.appendChild(p),this.rangeViewContainer.appendChild(s)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.rangeViewContainer)}},e.prototype.renderTimelineContainer=function(){this.chartTimelineContainer=t.createElement("div",{className:"e-timeline-header-container"}),this.parent.enableRtl&&(this.chartTimelineContainer.style.borderLeftWidth="1px",this.chartTimelineContainer.style.borderRightWidth="0px"),this.chartTimelineContainer.setAttribute("role","presentation"),this.chartElement.appendChild(this.chartTimelineContainer)},e.prototype.renderBodyContainers=function(){this.chartBodyContainer=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 _(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.treeGrid.element.getElementsByClassName("e-virtualtrack")[0].style.height;var e=t.getValue("wrapper",this.parent.ganttChartModule.virtualRender),i=this.parent.treeGrid.element.getElementsByClassName("e-virtualtable")[0].style.transform;e.style.transform=i}},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),this.parent.editSettings.allowEditing&&this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length>0&&this.parent.treeGrid.endEdit()},e.prototype.ganttChartMouseClick=function(e){this.parent.autoFocusTasks&&this.scrollToTarget(e),this.parent.notify("chartMouseClick",e)},e.prototype.ganttChartMouseUp=function(e){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,this.parent.enableRtl?-1:0)},e.prototype.mouseUp=function(e){if(t.isNullOrUndefined(this.parent.editModule)||t.isNullOrUndefined(this.parent.editModule.taskbarEditModule)||this.parent.editModule.taskbarEditModule.removeFalseLine(!1),this.parent.allowRowDragAndDrop){var i=this.parent.element.querySelector(".e-ganttdrag");i&&i.remove()}this.isGanttElement||this.parent.notify("chartMouseUp",e),this.isGanttElement=!1},e.prototype.documentMouseUp=function(e){if(this.isGanttElement=!0,(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse"))&&!0===t.getValue("isEditCollapse",this.parent.treeGrid)&&t.setValue("isEditCollapse",!1,this.parent.treeGrid),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.parent.showIndicator=!0,t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.focusedElement&&!e.target.classList.contains("e-split-bar")&&(this.focusedElement.tabIndex=0===this.focusedElement.tabIndex?-1:this.focusedElement.tabIndex,t.removeClass([this.focusedElement],"e-active-container"))),!r){var n=e.target,a=e.target.classList.contains(N)||t.closest(e.target,"."+N);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){var n=e.target,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)),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."+N);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(){if(this.parent.connectorLineModule.dependencyViewContainer.innerHTML="",this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection),this.parent.enableCriticalPath&&this.parent.criticalPathModule){var e=this.parent.criticalPathModule;e.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds)}},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){if(!(t.isNullOrUndefined(e.gridRow)&&this.parent.enableVirtualization||t.isNullOrUndefined(e.chartRow))){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||t.isNullOrUndefined(e.chartRow))){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(var 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.enableVirtualization&&this.parent.enableMultiTaskbar?this.parent.flatData[this.getIndexByTaskBar(e)]:this.parent.currentViewData[this.getIndexByTaskBar(e)]},e.prototype.onTabAction=function(e){this.parent.treeGrid.grid.enableHeaderFocus=this.parent.enableHeaderFocus;var 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)||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)return void this.manageFocus(r,"remove",!0);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("data-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),i&&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)}}}},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"))return s=t.closest(e,".e-chart-row").rowIndex,o=i?this.getNextRowElement(s,i,!0):this.parent.treeGrid.grid.getRowByIndex(s),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)}(e.classList.contains("e-right-label-temp-container")||e.classList.contains("e-left-label-temp-container")||e.classList.contains("e-indicator-span"))&&("add"===i?(e.setAttribute("tabIndex","0"),t.addClass([e],"e-active-container"),e.focus()):(t.removeClass([e],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur())),"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(N)?e:t.closest(e,"div."+N),t.isNullOrUndefined(i))i=t.closest(e,"tr."+L),r=[].slice.call(this.parent.chartRowsModule.ganttChartTableBody.childNodes).indexOf(i);else{var n=i.getAttribute("rowUniqueId"),a=this.parent.getRecordByID(n);r=this.parent.enableVirtualization&&this.parent.enableMultiTaskbar?this.parent.flatData.indexOf(a):this.parent.currentViewData.indexOf(a)}return r},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.scrollObject.destroy(),this.scrollObject=null},e}(),Z=function(){return(Z=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)},Q=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.isLoad&&(this.parent.timelineSettings=this.parent.currentZoomingLevel)},e.prototype.validateTimelineProp=function(){this.roundOffDays(),this.processTimelineProperty(),this.timelineWidthCalculation()},e.prototype.refreshTimeline=function(){this.initProperties(),this.processTimelineUnit(),this.parent.dataOperation.calculateProjectDates(),this.parent.isFromOnPropertyChange||this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff)},e.prototype.refreshTimelineByTimeSpan=function(){this.validateTimelineProp(),this.parent.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)):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)):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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),a.cancel||(n=a.timeline,this.changeTimelineSettings(n))},e.prototype.changeTimelineSettings=function(e){var i=this;this.isZoomToFit?this.isSingleTier="None"===this.customTimelineSettings.topTier.unit||"None"===this.customTimelineSettings.bottomTier.unit:this.isZoomIn||(this.isSingleTier="None"===e.topTier.unit||"None"===e.bottomTier.unit);var 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]:Z({},e[n]);else{var a="topTier"===n?"bottomTier":"topTier";"None"!=e.bottomTier.unit&&(i.customTimelineSettings[a]=Z({},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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()}},e.prototype.processZoomToFit=function(){this.isZoomToFit=!0,this.isZooming=!1,this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.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?e.perDayWidth<t.perDayWidth?1:-1:0});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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),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=["timelineViewMode","timelineUnitSize","weekStartDay","weekendBackground"],t={topTier:["unit","format","count","formatter"],bottomTier:["unit","format","count","formatter"]},i=["Year","Month","Week","Day","Hour","Minutes"];this.customTimelineSettings=this.customTimelineSettings?this.customTimelineSettings:this.extendFunction(this.parent.timelineSettings,e,t),-1===i.indexOf(this.customTimelineSettings.topTier.unit)&&-1===i.indexOf(this.customTimelineSettings.bottomTier.unit)?(this.customTimelineSettings.topTier.unit=-1!==i.indexOf(this.customTimelineSettings.timelineViewMode)?this.customTimelineSettings.timelineViewMode:"Week",this.customTimelineSettings.bottomTier.unit=5!==i.indexOf(this.customTimelineSettings.topTier.unit)?i[i.indexOf(this.customTimelineSettings.topTier.unit)+1]:"None"):-1!==i.indexOf(this.customTimelineSettings.topTier.unit)&&-1!==i.indexOf(this.customTimelineSettings.bottomTier.unit)&&i.indexOf(this.customTimelineSettings.topTier.unit)>i.indexOf(this.customTimelineSettings.bottomTier.unit)?this.customTimelineSettings.bottomTier.unit=this.customTimelineSettings.topTier.unit:(this.customTimelineSettings.topTier.unit=-1===i.indexOf(this.customTimelineSettings.topTier.unit)?"None":this.customTimelineSettings.topTier.unit,this.customTimelineSettings.bottomTier.unit=-1===i.indexOf(this.customTimelineSettings.bottomTier.unit)?"None":this.customTimelineSettings.bottomTier.unit),this.topTier=this.customTimelineSettings.topTier.unit,this.bottomTier=this.customTimelineSettings.bottomTier.unit,this.previousIsSingleTier=this.isSingleTier,this.isSingleTier="None"===this.topTier||"None"===this.bottomTier},e.prototype.processTimelineProperty=function(){this.customTimelineSettings.topTier.count="None"===this.topTier?1:this.validateCount(this.customTimelineSettings.topTier.unit,this.customTimelineSettings.topTier.count,"topTier"),this.customTimelineSettings.bottomTier.count="None"===this.customTimelineSettings.bottomTier.unit?1:this.validateCount(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.count,"bottomTier"),this.customTimelineSettings.bottomTier.format=this.validateFormat(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.format),this.customTimelineSettings.topTier.format=this.validateFormat(this.topTier,this.customTimelineSettings.topTier.format),this.customTimelineSettings.weekStartDay=this.customTimelineSettings.weekStartDay>=0&&this.customTimelineSettings.weekStartDay<=6?this.customTimelineSettings.weekStartDay:0,this.checkCurrentZoomingLevel()},e.prototype.calculateZoomingLevelsPerDayWidth=function(){for(var e=this.parent.zoomingLevels,t=0;t<e.length;t++){var i=this.getPerDayWidth(e[t].timelineUnitSize,e[t].bottomTier.count,e[t].bottomTier.unit);e[t].perDayWidth=i}},e.prototype.checkCurrentZoomingLevel=function(){var e="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.count:this.customTimelineSettings.topTier.count,t="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.unit:this.customTimelineSettings.topTier.unit,i="None"!==this.customTimelineSettings.bottomTier.unit?"bottomTier":"topTier",r=this.getCurrentZoomingLevel(t,e,i);return this.parent.toolbarModule&&(r===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):r===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),this.parent.currentZoomingLevel=this.parent.zoomingLevels[r],r},e.prototype.getCurrentZoomingLevel=function(e,t,i){var r,n,a,s,o;this.parent.zoomingLevels.length||(this.parent.zoomingLevels=this.parent.getZoomingLevels());var l=this.parent.zoomingLevels.filter(function(t){return"bottomTier"===i?t.bottomTier.unit===e:t.topTier.unit===e});if(0===l.length){var d=this.getClosestUnit(e,"",!1);l=this.parent.zoomingLevels.filter(function(e){return"bottomTier"===i?e.bottomTier.unit===d:e.topTier.unit===d})}for(var p=l.sort(function(e,t){return"bottomTier"===i?e.bottomTier.count&&t.bottomTier.count?e.bottomTier.count<t.bottomTier.count?1:-1:0:e.topTier.count&&t.topTier.count?e.topTier.count<t.topTier.count?1:-1:0}),h=0;h<p.length;h++){if(o=p[h],h===p.length-1){r=p[h].level;break}if(s=p[h+1],t>=o[""+i].count){n=p[h],r=(a=p.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count})).length>1?this.checkCollectionsWidth(a):a[0].level;break}if(t<o[""+i].count&&t>s[""+i].count){n=p[h+1],r=(a=p.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count})).length>1?this.checkCollectionsWidth(a):a[0].level;break}}return r},e.prototype.getClosestUnit=function(e,t,i){var r=["Year","Month","Week","Day","Hour","Minutes"],n=r.indexOf(e);return 0===n&&(i=!0),e=this.isZoomIn||i?r[n+1]:r[n-1],0===this.parent.zoomingLevels.filter(function(t){return t.bottomTier.unit===e}).length?("Year"===e&&(i=!0),t=e,this.getClosestUnit(e,t,i)):e},e.prototype.checkCollectionsWidth=function(e){for(var t,i,r,n=e,a=this.customTimelineSettings.timelineUnitSize,s=n.sort(function(e,t){return e.timelineUnitSize<t.timelineUnitSize?1:-1}),o=0;o<s.length;o++){if(r=s[o],o===s.length-1){t=s[o].level;break}if(i=s[o+1],a>=r.timelineUnitSize){t=s[o].level;break}if(a<r.timelineUnitSize&&a>i.timelineUnitSize){t=s[o+1].level;break}}return t},e.prototype.updateTimelineHeaderHeight=function(){if(this.parent.timelineModule.isSingleTier?(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: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 i="None"===this.topTier?this.bottomTier:this.topTier,r=new Date(e.toString());return this.parent.isTimelineRoundOff&&("Hour"===i?r.setMinutes(60):"Minutes"===i?r.setSeconds(60):r.setHours(24,0,0,0)),t.isNullOrUndefined(this.parent.projectEndDate)&&this.updateTimelineAfterZooming(r,!1),r},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,y=this.parent.editModule.taskbarEditModule;!t.isNullOrUndefined(c)&&(l<this.timelineStartDate||!t.isNullOrUndefined(y)&&!t.isNullOrUndefined(y.taskBarEditAction)&&"ProgressResizing"!==y.taskBarEditAction&&"RightResizing"!==y.taskBarEditAction)&&(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}(),K=function(){function e(e){this.allowEditing=!0,this.allowReordering=!0,this.allowResizing=!0,this.allowSorting=!0,this.allowFiltering=!0,this.edit={},t.merge(this,e)}return e}(),J=function(){function e(e){var i=this;this.previousScroll={top:0,left:0},this.queryCellInfo=function(e){i.parent.trigger("queryCellInfo",e)},this.headerCellInfo=function(e){i.parent.trigger("headerCellInfo",e)},this.rowDataBound=function(e){i.parent.trigger("rowDataBound",e)},this.columnMenuOpen=function(e){i.parent.notify("columnMenuOpen",e),i.parent.trigger("columnMenuOpen",e),document.querySelector(".e-colmenu").addEventListener("mousemove",function(e){var r=document.querySelector(".e-filter-popup"),n=document.querySelector(".e-filter-item");t.isNullOrUndefined(r)||n.classList.contains("e-focused")||t.remove(i.parent.filterModule.filterMenuElement)})},this.columnMenuClick=function(e){i.parent.trigger("columnMenuClick",e)},this.objectEqualityChecker=function(e,t){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]])!==(t[r[s]]instanceof Date?new Date(t[r[s]]).getTime():t[r[s]])&&-1===a.indexOf(r[s])){i.parent.modifiedRecords.push(t),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["${enableHtmlSanitizer}"]=this.parent.enableHtmlSanitizer,this.parent.treeGrid.enableImmutableMode=this.parent.enableImmutableMode,this.treeGridColumns=[],!this.parent.isLocaleChanged&&this.parent.isLoad&&(this.parent.previousGanttColumns=t.extend([],[],this.parent.columns,!0)),this.validateGanttColumns(),this.parent.isLocaleChanged&&(this.parent.isLocaleChanged=!1),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createContainer,this),this.parent.on("chartScroll",this.updateScrollTop,this),this.parent.on("destroy",this.destroy,this),this.parent.treeGrid.on("renderReactTemplate",this.renderReactTemplate,this)},e.prototype.renderReactTemplate=function(e){this.parent.portals=e,this.parent.renderTemplates()},e.prototype.createContainer=function(){this.treeGridElement=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.enableRtl=this.parent.enableRtl,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.treeGrid.loadingIndicator=this.parent.loadingIndicator,this.parent.treeGrid.enableVirtualMaskRow=this.parent.enableVirtualMaskRow,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;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||this.parent.toolbarModule.element.offsetHeight,this.parent.treeGrid.height=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].offsetHeight-19},e.prototype.getContentDiv=function(){return this.treeGridElement.querySelector(".e-content")},e.prototype.getHeaderDiv=function(){return this.treeGridElement.querySelector(".e-headercontent")},e.prototype.getScrollbarWidth=function(){var e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar";var t=document.createElement("div");e.appendChild(t),this.parent.element.appendChild(e);var i=e.offsetWidth-t.offsetWidth;return e.parentNode.removeChild(e),i},e.prototype.ensureScrollBar=function(){var e=this.getContentDiv(),t=this.getHeaderDiv(),i=this.getScrollbarWidth(),r=/Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);0!==i?e.style.cssText+="width: calc(100% + "+(i+1)+"px);":e.classList.add("e-gantt-scroll-padding"),0===i&&r&&(t.style.cssText+="width: calc(100% + 17px);")},e.prototype.bindEvents=function(){this.parent.treeGrid.dataBound=this.dataBound.bind(this),this.parent.treeGrid.collapsing=this.collapsing.bind(this),this.parent.treeGrid.collapsed=this.collapsed.bind(this),this.parent.treeGrid.expanding=this.expanding.bind(this),this.parent.treeGrid.expanded=this.expanded.bind(this),this.parent.treeGrid.actionBegin=this.actionBegin.bind(this),this.parent.treeGrid.actionComplete=this.treeActionComplete.bind(this),this.parent.treeGrid.created=this.created.bind(this),this.parent.treeGrid.actionFailure=this.actionFailure.bind(this),this.parent.treeGrid.queryCellInfo=this.queryCellInfo.bind(this),this.parent.treeGrid.headerCellInfo=this.headerCellInfo.bind(this),this.parent.treeGrid.rowDataBound=this.rowDataBound.bind(this),this.parent.treeGrid.columnMenuOpen=this.columnMenuOpen.bind(this),this.parent.treeGrid.columnMenuClick=this.columnMenuClick.bind(this),this.parent.treeGrid.beforeDataBound=this.beforeDataBound.bind(this),this.parent.treeGrid.dataStateChange=this.dataStateChange.bind(this)},e.prototype.beforeDataBound=function(e){this.parent.updatedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?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.parent.isVirtualScroll&&((this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization||this.parent.enableVirtualization&&!this.parent.enableVirtualMaskRow&&"Shimmer"===this.parent.loadingIndicator.indicatorType||"Shimmer"===this.parent.loadingIndicator.indicatorType)&&this.parent.hideMaskRow(),this.parent.isVirtualScroll=!1),this.prevCurrentView=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 i=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.collapsedGanttRow(i),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&i.gridRow&&(i.gridRow.style.height=i.chartRow.style.height,this.parent.contentHeight=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.expanded=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod&&!e.data.length){var i=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.expandedGanttRow(i),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&e.row&&(e.row.style.height=this.parent.rowHeight+"px",this.parent.contentHeight=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},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),"virtualscroll"!=e.requestType&&"edit"!=e.type&&"beginEdit"!=e.requestType&&(t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow())},e.prototype.created=function(e){this.updateKeyConfigSettings()},e.prototype.actionFailure=function(e){this.parent.trigger("actionFailure",e)},e.prototype.createExpandCollapseArgs=function(e){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={}}if("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),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation){for(var n=0;n<this.parent.currentViewData.length;n++)this.parent.currentViewData[n].hasChildRecords&&!this.parent.currentViewData[n].expanded&&this.parent.chartRowsModule.updateDragDropRecords(this.parent.currentViewData[n]);this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.updateKeyConfigSettings=function(){delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.delete,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.insert,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlHome,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlEnd,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.shiftTab,delete this.parent.treeGrid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.keyboardModule.keyConfigs.shiftTab},e.prototype.wireEvents=function(){var e=this.parent.treeGrid.element.querySelector(".e-content");e&&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","milestone"],a=this,s=0;s<i;s++)!function(t){var i={};"string"==typeof e.columns[t]?i.field=e.columns[t]:i=e.columns[t];var s=[];if(n.length>0&&(s=n.filter(function(e){return i.field===r[e]})),0===s.length)return i.field===a.parent.resourceFields.group?"continue":(a.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",a.bindTreeGridColumnProperties(i,!0),"continue");var o=n.indexOf(s[0]);n.splice(o,1),a.createTreeGridColumn(i,!0),a.parent.columnMapping[s[0]]=i.field}(s);for(var o=0;o<n.length;o++){l={};t.isNullOrUndefined(r[n[o]])||(l.field=r[n[o]],this.createTreeGridColumn(l,0===i),this.parent.columnMapping[n[o]]=l.field)}if("ProjectView"!==this.parent.viewType){var l={};this.composeUniqueIDColumn(l),this.createTreeGridColumn(l,!0)}},e.prototype.createTreeGridColumn=function(e,i){var r=this.parent.taskFields,a=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];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)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("name"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("name"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type=e.type?e.type:"string";else if(r.startDate===e.field)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("startDate"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("startDate"),e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.width=e.width?e.width:150,e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.endDate===e.field)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("endDate"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("endDate"),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.width=e.width?e.width:150,e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.duration===e.field)e.width=e.width?e.width:150,this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("duration"):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=e.type?e.type:"string";else if(r.progress===e.field)this.composeProgressColumn(e);else if(r.dependency===e.field)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("dependency"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("dependency"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type="string",e.allowFiltering=!1!==e.allowFiltering;else if(r.resourceInfo===e.field)this.composeResourceColumn(e);else if(r.notes===e.field)this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("notes"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("notes"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",this.parent.showInlineNotes||e.template||(e.template='<div class="e-ganttnotes-info"><span class="e-icons e-notes-info"></span></div>');else if(r.baselineStartDate===e.field||r.baselineEndDate===e.field){var s=r.baselineEndDate===e.field?"baselineEndDate":"baselineStartDate";e.width=e.width?e.width:150,this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant(s):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant(s),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"}else r.work===e.field?(this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("work"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("work"),e.width=e.width?e.width:150,e.valueAccessor=e.valueAccessor?e.valueAccessor:this.workValueAccessor.bind(this),e.editType=e.editType?e.editType:"numericedit"):r.type===e.field?(this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("taskType"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskType"),e.width=e.width?e.width:150,e.editType="dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.taskTypeValueAccessor.bind(this)):r.manual===e.field&&"Custom"===this.parent.taskMode&&(this.parent.isLocaleChanged&&a?e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("taskMode"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskMode"),e.width=e.width?e.width:120,e.editType=e.editType?e.editType:"dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.modeValueAccessor.bind(this),e.edit={params:{query:new 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){var t=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];this.parent.isLocaleChanged&&t?e.headerText=t.headerText?t.headerText:this.parent.localeObj.getConstant("resourceName"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("resourceName"),e.width=e.width?e.width:150,e.type="string",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.resourceValueAccessor.bind(this),e.allowFiltering=!1!==e.allowFiltering},e.prototype.getResourceIds=function(e){var 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 i,r="ProjectView"===this.parent.viewType,n=this.parent.dataSource.length;if(e.isPrimaryKey=!!r,this.parent.isLocaleChanged){var a=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];a&&(e.headerText=a.headerText?a.headerText:this.parent.localeObj.getConstant("id"))}else e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("id");e.width=e.width?e.width:100;for(var s=0;s<n;s++)if(!t.isNullOrUndefined(this.parent.dataSource[s][this.parent.taskFields.id])){i=this.parent.dataSource[s][this.parent.taskFields.id];break}"string"==typeof i||t.isNullOrUndefined(i)?("ResourceView"===this.parent.viewType?e.allowEditing=!!e.allowEditing&&e.allowEditing:e.allowEditing=!e.allowEditing||e.allowEditing,e.editType=e.editType?e.editType:"stringedit"):(e.allowEditing=!!e.allowEditing&&e.allowEditing,e.editType=e.editType?e.editType:"numericedit"),e.valueAccessor=r?null:this.idValueAccessor.bind(this)},e.prototype.composeUniqueIDColumn=function(e){e.field="rowUniqueID",e.isPrimaryKey=!0,e.headerText="UniqueID",e.allowEditing=!1,e.visible=!1},e.prototype.composeProgressColumn=function(e){var t=this.parent.previousGanttColumns.filter(function(t){return e.field==t.field})[0];this.parent.isLocaleChanged&&t?e.headerText=t.headerText?t.headerText:this.parent.localeObj.getConstant("progress"):e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("progress"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"numericedit"},e.prototype.bindTreeGridColumnProperties=function(e,t){for(var i={},r={},n=0,a=Object.keys(e);n<a.length;n++){var s=a[n];i[s]=r[s]=e[s]}this.parent.columnByField[r.field]=r,this.parent.ganttColumns.push(new K(r)),t&&this.treeGridColumns.push(i)},e.prototype.durationValueAccessor=function(e,i,r){var n=t.isNullOrUndefined(i)?null: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){var i;i=t.getValue("top",e)>this.parent.flatData.length*this.parent.rowHeight?t.getValue("top",e)-document.getElementsByClassName("e-chart-scroll-container e-content")[0].offsetHeight:t.getValue("top",e),this.treeGridElement.querySelector(".e-content").scrollTop=i,this.previousScroll.top=this.treeGridElement.querySelector(".e-content").scrollTop},e.prototype.treeGridClickHandler=function(e){this.parent.notify("treeGridClick",e)},e.prototype.removeEventListener=function(){this.parent.off("renderPanels",this.createContainer),this.parent.off("chartScroll",this.updateScrollTop),this.parent.off("destroy",this.destroy),this.parent.treeGrid.off("reactTemplateRender",this.renderReactTemplate)},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.parent.treeGrid.element&&this.parent.treeGrid.destroy()},e}(),$=function(){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)}}(),ee=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},te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $(i,e),ee([t.Property(null)],i.prototype,"from",void 0),ee([t.Property(null)],i.prototype,"to",void 0),i}(t.ChildProperty),ie=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)}}(),re=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},ne=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ie(i,e),re([t.Property(null)],i.prototype,"type",void 0),re([t.Property(null)],i.prototype,"headerText",void 0),re([t.Property([])],i.prototype,"fields",void 0),i}(t.ChildProperty),ae=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)}}(),se=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},oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"type",void 0),se([t.Property(null)],i.prototype,"headerText",void 0),se([t.Property([])],i.prototype,"fields",void 0),i}(t.ChildProperty),le=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)}}(),de=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},pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return le(i,e),de([t.Property(!1)],i.prototype,"allowEditing",void 0),de([t.Property(!1)],i.prototype,"allowAdding",void 0),de([t.Property(!1)],i.prototype,"allowDeleting",void 0),de([t.Property("Auto")],i.prototype,"mode",void 0),de([t.Property("Top")],i.prototype,"newRowPosition",void 0),de([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),de([t.Property(!1)],i.prototype,"allowTaskbarEditing",void 0),de([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),he=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)}}(),ce=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},ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),ce([t.Property(null)],i.prototype,"day",void 0),ce([t.Property(null)],i.prototype,"label",void 0),ce([t.Property(null)],i.prototype,"cssClass",void 0),i}(t.ChildProperty),ge=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)}}(),fe=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},me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ge(i,e),fe([t.Collection([],r.Predicate)],i.prototype,"columns",void 0),fe([t.Property("Menu")],i.prototype,"type",void 0),fe([t.Property()],i.prototype,"operators",void 0),fe([t.Property(!1)],i.prototype,"ignoreAccent",void 0),fe([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),ye=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)}}(),ve=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},De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ye(i,e),ve([t.Property([])],i.prototype,"fields",void 0),ve([t.Property(!1)],i.prototype,"ignoreCase",void 0),ve([t.Property("contains")],i.prototype,"operator",void 0),ve([t.Property("")],i.prototype,"key",void 0),ve([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),we=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)}}(),ke=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},be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),ke([t.Property(null)],i.prototype,"from",void 0),ke([t.Property(null)],i.prototype,"to",void 0),ke([t.Property(null)],i.prototype,"label",void 0),ke([t.Property(null)],i.prototype,"cssClass",void 0),i}(t.ChildProperty),Te=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)}}(),Se=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},Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),Se([t.Property(null)],i.prototype,"rightLabel",void 0),Se([t.Property(null)],i.prototype,"leftLabel",void 0),Se([t.Property(null)],i.prototype,"taskLabel",void 0),i}(t.ChildProperty),Ce=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)}}(),Re=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},Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ce(i,e),Re([t.Property("Row")],i.prototype,"mode",void 0),Re([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),Re([t.Property("Single")],i.prototype,"type",void 0),Re([t.Property(!1)],i.prototype,"persistSelection",void 0),Re([t.Property(!1)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Oe=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)}}(),xe=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},Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Oe(i,e),xe([t.Property(null)],i.prototype,"position",void 0),xe([t.Property(-1)],i.prototype,"columnIndex",void 0),xe([t.Property(4)],i.prototype,"separatorSize",void 0),xe([t.Property(null)],i.prototype,"minimum",void 0),xe([t.Property("Default")],i.prototype,"view",void 0),i}(t.ChildProperty),Ee=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)}}(),Ne=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},Fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ee(i,e),Ne([t.Property(null)],i.prototype,"id",void 0),Ne([t.Property(null)],i.prototype,"name",void 0),Ne([t.Property(null)],i.prototype,"parentID",void 0),Ne([t.Property(null)],i.prototype,"startDate",void 0),Ne([t.Property(null)],i.prototype,"endDate",void 0),Ne([t.Property(null)],i.prototype,"dependency",void 0),Ne([t.Property(null)],i.prototype,"progress",void 0),Ne([t.Property(null)],i.prototype,"child",void 0),Ne([t.Property(null)],i.prototype,"milestone",void 0),Ne([t.Property(null)],i.prototype,"duration",void 0),Ne([t.Property(null)],i.prototype,"durationUnit",void 0),Ne([t.Property(null)],i.prototype,"cssClass",void 0),Ne([t.Property(null)],i.prototype,"baselineStartDate",void 0),Ne([t.Property(null)],i.prototype,"baselineEndDate",void 0),Ne([t.Property(null)],i.prototype,"resourceInfo",void 0),Ne([t.Property(null)],i.prototype,"expandState",void 0),Ne([t.Property(null)],i.prototype,"indicators",void 0),Ne([t.Property(null)],i.prototype,"notes",void 0),Ne([t.Property(null)],i.prototype,"work",void 0),Ne([t.Property(null)],i.prototype,"manual",void 0),Ne([t.Property(null)],i.prototype,"type",void 0),Ne([t.Property(null)],i.prototype,"segments",void 0),Ne([t.Property(null)],i.prototype,"segmentId",void 0),i}(t.ChildProperty),Ue=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)}}(),Ve=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},Le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),Ve([t.Property("")],i.prototype,"format",void 0),Ve([t.Property("None")],i.prototype,"unit",void 0),Ve([t.Property(1)],i.prototype,"count",void 0),Ve([t.Property(null)],i.prototype,"formatter",void 0),i}(t.ChildProperty),Be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),Ve([t.Property("Week")],i.prototype,"timelineViewMode",void 0),Ve([t.Complex({},Le)],i.prototype,"topTier",void 0),Ve([t.Complex({},Le)],i.prototype,"bottomTier",void 0),Ve([t.Property(33)],i.prototype,"timelineUnitSize",void 0),Ve([t.Property(0)],i.prototype,"weekStartDay",void 0),Ve([t.Property(null)],i.prototype,"weekendBackground",void 0),Ve([t.Property(!0)],i.prototype,"showTooltip",void 0),Ve([t.Property(!0)],i.prototype,"updateTimescaleView",void 0),i}(t.ChildProperty),Ae=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)}}(),He=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},We=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ae(i,e),He([t.Property(!0)],i.prototype,"showTooltip",void 0),He([t.Property()],i.prototype,"taskbar",void 0),He([t.Property()],i.prototype,"baseline",void 0),He([t.Property()],i.prototype,"connectorLine",void 0),He([t.Property()],i.prototype,"editing",void 0),i}(t.ChildProperty),je=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)}}(),qe=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},Ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return je(i,e),qe([t.Property()],i.prototype,"field",void 0),qe([t.Property()],i.prototype,"direction",void 0),i}(t.ChildProperty),ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return je(i,e),qe([t.Collection([],Ge)],i.prototype,"columns",void 0),qe([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),_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)}}(),Xe=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},Ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _e(i,e),Xe([t.Property(null)],i.prototype,"id",void 0),Xe([t.Property(null)],i.prototype,"name",void 0),Xe([t.Property(null)],i.prototype,"unit",void 0),Xe([t.Property(null)],i.prototype,"group",void 0),i}(t.ChildProperty),Ze=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)}}(),Qe=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},Ke=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ze(i,e),Qe([t.Property("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),Je=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)}}(),$e=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 Je(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"style="line-height:'+this.parent.rowHeight+"px;"+(this.parent.enableRtl?"right:":"left:")+this.getIndicatorleft(e.date)+'px;"><i class="'+e.iconClass+'"></i> </label>';return this.createDivElement(t)},i.prototype.getIndicatorleft=function(e){return e=this.parent.dateValidationModule.getDateFromFormat(e),this.parent.dataOperation.getTaskLeft(e,!1)},i.prototype.getChildTaskbarNode=function(e,i){var r,n=null,a=this.templateData;if(r=this.parent.enableRtl?"right:":"left:",this.childTaskbarTemplateFunction)n=this.childTaskbarTemplateFunction(t.extend({index:e},a),this.parent,"TaskbarTemplate",this.getTemplateID("TaskbarTemplate"),!1,void 0,i[0],this.parent.treeGrid.root);else{var s="",o="",l=void 0,d=void 0;a.ganttProperties.startDate&&a.ganttProperties.endDate&&a.ganttProperties.duration&&(l=this.createDivElement('<div class="e-gantt-child-taskbar-inner-div e-gantt-child-taskbar '+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualtaskbar")+'"style="width:'+a.ganttProperties.width+"px;height:"+this.taskBarHeight+'px;"></div>'),d=this.createDivElement('<div class="'+U+" e-gantt-child-progressbar "+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualprogressbar")+'" style="border-style:'+(a.ganttProperties.progressWidth?"solid;":"none;")+"width:"+a.ganttProperties.progressWidth+"px;height:100%;border-top-right-radius:"+this.getBorderRadius(a.ganttProperties)+"px;border-bottom-right-radius:"+this.getBorderRadius(a.ganttProperties)+'px;"></div>'));var p=t.createElement("div");if(this.taskLabelTemplateFunction&&!t.isNullOrUndefined(d)&&d.length>0){var h=this.taskLabelTemplateFunction(t.extend({index:e},a),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,d[0]);h&&h.length>0&&(t.append(h,p),s=p.innerHTML)}else{var c=this.parent.labelSettings.taskLabel;s="isCustomTemplate"===(s=this.getTaskLabel(c))?this.parent.labelSettings.taskLabel:s,this.parent.enableHtmlSanitizer&&"string"==typeof s&&(s=t.SanitizeHtmlHelper.sanitize(s))}-1===s.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(s=""),o=isNaN(parseInt(s))?'<span class="e-task-label" style="line-height:'+(this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(a.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="e-task-label" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"text-align:"+(this.parent.enableRtl?"right;":"left;"):"")+ +("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+ +("ResourceView"===this.parent.viewType?a.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;"></span>');var u=!t.isNullOrUndefined(a.ganttProperties.segments)&&a.ganttProperties.segments.length>0?this.splitTaskbar(a,s):a.ganttProperties.startDate&&a.ganttProperties.endDate&&a.ganttProperties.duration?o:!a.ganttProperties.startDate||a.ganttProperties.endDate||a.ganttProperties.duration?!a.ganttProperties.endDate||a.ganttProperties.startDate||a.ganttProperties.duration?!a.ganttProperties.duration||a.ganttProperties.startDate||a.ganttProperties.endDate?"":'<div class="'+U+" "+A+" e-gantt-unscheduled-taskbar "+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualtaskbar")+'"style="'+r+a.ganttProperties.left+"px; width:"+a.ganttProperties.width+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+U+" "+A+" e-gantt-unscheduled-taskbar-right "+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualtaskbar")+'"style="'+r+a.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+U+" "+A+" e-gantt-unscheduled-taskbar-left "+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualtaskbar")+'"style="'+r+a.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>';if(a.ganttProperties.startDate&&a.ganttProperties.endDate&&a.ganttProperties.duration&&(t.isNullOrUndefined(a.ganttProperties.segments)||!t.isNullOrUndefined(a.ganttProperties.segments)&&0===a.ganttProperties.segments.length)){if(""!==u&&!t.isNullOrUndefined(d)&&d.length>0){var g=this.createDivElement(u)[0];this.parent.disableHtmlEncode?g.innerText=s:g.innerHTML=s;var f=this.parent.labelSettings.taskLabel;f&&f.elementRef&&g.appendChild(p),d[0].appendChild(g),""!==d[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(f)&&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&&f&&!f.elementRef&&""!==p.innerHTML&&(d[0].querySelectorAll(".e-task-label")[0].textContent=f)}!t.isNullOrUndefined(l)&&l.length>0&&l[0].appendChild([].slice.call(d)[0]),n=l}else n=this.createDivElement(u)}return this.parent.enableRtl&&n[0]&&n[0].querySelector(".e-task-label")&&(n[0].querySelector(".e-task-label").style.marginLeft="15px",n[0].querySelector(".e-task-label").style.marginRight="8px",n[0].querySelector(".e-gantt-child-progressbar")&&(n[0].querySelector(".e-gantt-child-progressbar").style.textAlign="left")),n},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",i+='<div class="e-gantt-child-taskbar-inner-div '+(0===r?"e-segment-first":r===e.ganttProperties.segments.length-1?"e-segment-last":"e-segment-inprogress")+" "+A+' e-segmented-taskbar"style="width:'+n.width+"px;position: absolute;"+(this.parent.enableRtl?"right:":"left:")+n.left+"px;height:"+this.taskBarHeight+"px; overflow:"+a+';" data-segment-index = "'+r+'" aria-label = "'+this.generateSpiltTaskAriaLabel(n,e.ganttProperties)+'"> '+this.getSplitTaskbarLeftResizerNode()+'<div class="'+U+' e-gantt-child-progressbar " style="border-style:'+(n.progressWidth?"solid;":"none;")+"display:"+(n.progressWidth>=0?"block;":"none;")+"width:"+n.progressWidth+"px;height:100%;text-align:"+(this.parent.enableRtl?"left;":"right;")+"border-top-right-radius:"+this.getSplitTaskBorderRadius(n)+"px;border-bottom-right-radius:"+this.getSplitTaskBorderRadius(n)+'px;"><span class="'+F+'" 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="e-taskbar-left-resizer e-icon" style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;"></div>'},i.prototype.getSplitTaskbarRightResizerNode=function(e){var t=this.parent.isAdaptive?-2:-10;return'<div class="e-taskbar-right-resizer e-icon" style="'+(this.parent.enableRtl?"right:":"left:")+(e.width+t)+"px;height:"+this.taskBarHeight+'px;"></div>'},i.prototype.getSplitProgressResizerNode=function(e){var t=this.parent.enableRtl?e.progressWidth+8:e.progressWidth-6;return'<div class="e-child-progress-resizer" style="'+(this.parent.enableRtl?"right:":"left:")+t+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="e-progressbar-handler"><div class="e-progressbar-handler-element"></div><div class="e-progressbar-handler-after"></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.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),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)&&l.length>0&&(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="e-milestone-bottom '+(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="e-baseline-bar " role="term" style="margin-top:'+this.baselineTop+"px;"+(this.parent.enableRtl?"right:":"left:")+e.ganttProperties.baselineLeft+"px;width:"+e.ganttProperties.baselineWidth+"px;height:"+this.baselineHeight+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+'"></div>';return this.createDivElement(t)},i.prototype.getMilestoneBaselineNode=function(){var e=this.templateData,t=this.parent.renderBaseline?5:2,i='<div class="e-baseline-gantt-milestone-container " style="'+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.baselineLeft-this.milesStoneRadius)+"px;margin-top:"+(-Math.floor(this.parent.rowHeight-this.milestoneMarginTop)+t)+'px"><div class="e-baseline-gantt-milestone"><div class="e-baseline-gantt-milestone e-baseline-milestone-top" 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="e-baseline-gantt-milestone e-baseline-milestone-bottom" 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"),this.parent.enableHtmlSanitizer&&"string"==typeof a&&(a="isCustomTemplate"===(a=t.SanitizeHtmlHelper.sanitize(a))?n:a,r=this.getLableText(a,"e-left-label-inner-div")))}return r&&r.length>0&&("null"===r[0].data&&(r[0].data=""),t.append(r,i[0])),this.parent.enableRtl&&(i[0].style.paddingLeft="25px",i[0].style.paddingRight="0px"),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:W});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"),this.parent.enableHtmlSanitizer&&"string"==typeof a&&(a="isCustomTemplate"===(a=t.SanitizeHtmlHelper.sanitize(a))?n:a,r=this.getLableText(a,"e-right-label-inner-div")))}return r&&r.length>0&&("null"===r[0].data&&(r[0].data=""),t.append(r,i[0])),this.parent.enableRtl&&(i[0].style.marginLeft="0px",i[0].style.paddingRight="25px"),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="'+H+'" 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="'+H+" "+(e.ganttProperties.startDate?"e-gantt-unscheduled-taskbar-left":"e-gantt-unscheduled-taskbar-right")+'" 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="'+H+' 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="e-manualparent-main-container"style='+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-e.ganttProperties.autoLeft)+"px;width:"+e.ganttProperties.width+"px;height:"+t+"px;>"+i+(e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration||e.ganttProperties.duration?'<div class="e-gantt-manualparenttaskbar-left" style='+(this.parent.enableRtl?"margin-right:0px;":"")+'"height:'+(t/5+8)+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div><div class="e-gantt-manualparenttaskbar-right" style='+(this.parent.enableRtl?"margin-right:-8px;":"")+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.width-Math.floor((t/5+8)/5))+"px;height:"+(t/5+8)+"px;border-right-width:"+t/5+"px;border-bottom:"+t/5+"px solid transparent;></div></div>":""),n='<div class="e-gantt-manualparent-milestone" style="position:absolute;'+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-e.ganttProperties.autoLeft-this.milestoneHeight/2)+"px;width:"+2*this.milesStoneRadius+'px;"><div class="e-manualparent-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-manualparent-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>';return this.createDivElement(0!==e.ganttProperties.duration?r:n)},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)+' e-gantt-parent-taskbar" 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)+' e-gantt-parent-progressbar" 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,this.parent.enableHtmlSanitizer&&"string"==typeof a&&(a=t.SanitizeHtmlHelper.sanitize(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="e-task-label" style="line-height:'+(n.isManual&&n.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(n.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="e-task-label" style="line-height:'+(n.isManual&&n.hasChildRecords?Math.floor(.6*this.taskBarHeight):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;"></span>';var c=this.createDivElement(s)[0];this.parent.disableHtmlEncode?c.innerText=a:c.innerHTML=a;var 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 this.parent.enableRtl&&r[0]&&r[0].querySelector(".e-task-label")&&(r[0].querySelector(".e-task-label").style.marginLeft="15px",r[0].querySelector(".e-task-label").style.marginRight="8px",r[0].querySelector(".e-gantt-parent-progressbar")&&(r[0].querySelector(".e-gantt-parent-progressbar").style.textAlign="left")),r},i.prototype.getTableTrNode=function(e){var i,r=t.createElement("table"),n="Horizontal"===this.parent.gridLines||"Both"===this.parent.gridLines?"e-chart-row-border":"",a=this.parent.treeGrid.grid.contentModule.getRows()[e];return i=a&&a.isSelected?"e-active":"",r.innerHTML='<tr class="'+this.getRowClassName(this.templateData)+" "+L+" "+i+'"style="display:'+this.getExpandDisplayProp(this.templateData)+";height:"+this.parent.rowHeight+'px;"><td class="e-chart-row-cell '+n+'"style="width:'+this.parent.timelineModule.totalTimelineWidth+'px;"></td></tr>',r.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="term" 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="e-taskbar-main-container '+this.parent.getUnscheduledTaskClass(e.ganttProperties)+" "+(e.ganttProperties.cssClass?e.ganttProperties.cssClass:"")+'" tabindex="-1" role="term" style="'+(!e.ganttProperties.isMilestone||t||e.hasChildRecords&&!e.ganttProperties.isAutoSchedule?"width:"+e.ganttProperties.width+"px;margin-top:"+this.taskBarMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(!e.hasChildRecords||e.ganttProperties.isAutoSchedule?e.ganttProperties.left:e.ganttProperties.autoLeft)+"px;height:"+this.taskBarHeight+"px;cursor:"+(e.ganttProperties.isAutoSchedule?"move;":"auto;"):"width:"+this.milestoneHeight+"px;height:"+this.milestoneHeight+"px;margin-top:"+this.milestoneMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-this.milestoneHeight/2)+"px;")+'"></div>';return this.createDivElement(i)},i.prototype.rightLabelContainer=function(){var e='<div class="'+(this.rightTaskLabelTemplateFunction?"e-right-label-container e-right-label-temp-container":E)+'" tabindex="-1" role="term" style="'+(this.parent.enableRtl?"right:":"left:")+this.getRightLabelLeft(this.templateData)+"px; height:"+(this.parent.rowHeight-2)+'px;"></div>';return this.createDivElement(e)},i.prototype.childTaskbarLeftResizer=function(){var e=-(this.parent.isAdaptive?12:2),t='<div class="e-taskbar-left-resizer e-icon"style="'+(this.parent.enableRtl?"right:":"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="e-taskbar-right-resizer e-icon"style="'+(this.parent.enableRtl?"right:":"left:")+(this.templateData.ganttProperties.width+e)+"px;height:"+this.taskBarHeight+'px;"></div>';return this.createDivElement(t)},i.prototype.childTaskbarProgressResizer=function(){var e=this.parent.enableRtl?this.templateData.ganttProperties.progressWidth+8:this.templateData.ganttProperties.progressWidth-6,t='<div class="e-child-progress-resizer"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="e-progressbar-handler"><div class="e-progressbar-handler-element"></div><div class="e-progressbar-handler-after"></div></div>';return this.createDivElement(t)},i.prototype.getLeftPointNode=function(){var e,t=this.templateData,i=-((this.parent.isAdaptive?14:2)+this.connectorPointWidth),r=-(this.connectorPointWidth+2),n=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2);e=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px";var a='<div class="e-left-connectorpoint-outer-div" style="'+(t.ganttProperties.isMilestone?"margin-top:"+n+"px;left:"+r+"px;":e+";left:"+i+"px;")+'"><div class="'+q+" "+this.parent.getUnscheduledTaskClass(t.ganttProperties)+'" style="width: '+this.connectorPointWidth+"px;"+(this.parent.enableRtl?"margin-right:2px;":"")+"height: "+this.connectorPointWidth+'px;">'+this.touchLeftConnectorpoint+"</div></div>";return this.createDivElement(a)},i.prototype.getRightPointNode=function(){var e,t=this.templateData,i=this.parent.isAdaptive?10:-2,r=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2);e=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px";var n='<div class="e-right-connectorpoint-outer-div" style="'+(t.ganttProperties.isMilestone?"left:"+(this.milestoneHeight-2)+"px;margin-top:"+r+"px;":"left:"+(t.ganttProperties.width+i)+"px;"+e+";")+'"><div class="e-connectorpoint-right '+this.parent.getUnscheduledTaskClass(t.ganttProperties)+'" style="width:'+this.connectorPointWidth+"px;height:"+this.connectorPointWidth+'px;">'+this.touchRightConnectorpoint+"</div></div>";return this.createDivElement(n)},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,e.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)}this.parent.ganttChartModule.updateLastRowBottomWidth()},i.prototype.createTaskbarTemplate=function(){var e,i=[].slice.call(this.ganttChartTableBody.querySelectorAll("tr"));this.ganttChartTableBody.innerHTML="";var r=[],n=this.parent.treeGridModule.prevCurrentView;if(this.refreshedTr=[],this.refreshedData=[],this.parent.enableImmutableMode&&n&&n.length>0&&this.isUpdated){for(var a={},s=[],o=this.parent.treeGrid.getPrimaryKeyFieldNames()[0],l=0;l<n.length;l++)s[l]=i[l],a[n[l][o]]=l;for(var d=0;d<this.parent.currentViewData.length;d++){var p=a[this.parent.currentViewData[d][o]],h=this.parent.modifiedRecords.indexOf(this.parent.currentViewData[d]);if(t.isNullOrUndefined(p)||-1!==h||this.parent.isFromRenderBaseline){g=this.getGanttChartRow(d,this.parent.currentViewData[d]);this.ganttChartTableBody.appendChild(g),this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[d]),this.refreshedData.push(this.parent.currentViewData[d])}else this.ganttChartTableBody.appendChild(s[p]);this.ganttChartTableBody.querySelectorAll("tr")[d].setAttribute("aria-rowindex",d.toString())}}else{var c=void 0;c=t.createElement("tbody",{id:this.parent.element.id+"GanttTaskTableBody"});for(l=0;l<this.parent.currentViewData.length;l++){var u=this.parent.currentViewData[l];"ResourceView"===this.parent.viewType&&((this.parent.editModule&&this.parent.editModule.isResourceTaskDeleted||this.parent.isFromOnPropertyChange)&&(this.parent.initialChartRowElements=this.parent.ganttChartModule.getChartRows(),this.parent.editModule.isResourceTaskDeleted=!1),!u.expanded&&this.parent.enableMultiTaskbar&&r.push(u));var g=this.getGanttChartRow(l,u);c.appendChild(g),this.parent.enableImmutableMode&&(this.refreshedTr.push(c.querySelectorAll("tr")[l]),this.refreshedData.push(this.parent.currentViewData[l])),this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.maintainSelectedRecords(parseInt(g.getAttribute("aria-rowindex"),10))}(e=this.ganttChartTableBody).replaceChildren.apply(e,c.childNodes)}if(this.parent.renderTemplates(),this.triggerQueryTaskbarInfo(),this.parent.modifiedRecords=[],"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.updateOverlapped(),r.length)for(var f=0;f<r.length;f++)r[f].hasChildRecords&&(this.parent.isGanttChartRendered=!0,this.parent.chartRowsModule.refreshRecords([r[f]]));this.parent.renderTemplates()},i.prototype.getGanttChartRow=function(e,i){this.templateData=i;var r=null,n=this.getTableTrNode(e),a=this.getLeftLabelNode(e),s=this.taskbarContainer();s[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),s[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID);var o;if(this.templateData.hasChildRecords||this.parent.allowParentDependency)this.parent.allowParentDependency&&(o=this.getLeftPointNode(),(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)&&s[0].appendChild([].slice.call(o)[0]));else{var l=this.getLeftPointNode();s[0].appendChild([].slice.call(l)[0])}if(this.templateData.hasChildRecords){var d=this.getParentTaskbarNode(e,s);if(!this.templateData.ganttProperties.isAutoSchedule){var p=this.getManualTaskbar();if(!t.isNullOrUndefined(p[0])){if(this.parent.allowParentDependency){p[0].appendChild([].slice.call(o)[0]);var h=this.getRightPointNode();p[0].appendChild([].slice.call(h)[0])}s[0].appendChild([].slice.call(p)[0])}}0!==this.templateData.ganttProperties.autoDuration&&!this.templateData.ganttProperties.isMilestone&&d&&d.length>0?t.append(d,s[0]):0===this.templateData.ganttProperties.duration&&this.templateData.ganttProperties.isMilestone&&this.templateData.ganttProperties.isAutoSchedule&&(c=this.getMilestoneNode(e,s))&&c.length>0&&t.append(c,s[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(t.isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate)||t.isNullOrUndefined(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||t.isNullOrUndefined(this.templateData.ganttProperties.baselineEndDate)||t.isNullOrUndefined(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.toLocaleDateString()!==this.templateData.ganttProperties.endDate.toLocaleDateString()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}else if(this.templateData.ganttProperties.isMilestone){var c=this.getMilestoneNode(e,s);c&&c.length>0&&s[0].appendChild([].slice.call(c)[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(t.isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate)||t.isNullOrUndefined(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||t.isNullOrUndefined(this.templateData.ganttProperties.baselineEndDate)||t.isNullOrUndefined(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.toLocaleDateString()!==this.templateData.ganttProperties.endDate.toLocaleDateString()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}else{var u=f(this.templateData.ganttProperties),g=null,m=null,y=null;if(!t.isNullOrUndefined(u)){(u||this.templateData.ganttProperties.duration)&&u&&(t.isNullOrUndefined(this.templateData.ganttProperties.segments)||this.templateData.ganttProperties.segments.length<=0)&&(g=this.childTaskbarProgressResizer(),y=this.childTaskbarLeftResizer(),m=this.childTaskbarRightResizer());var v=this.getChildTaskbarNode(e,s);if(y&&s[0].appendChild([].slice.call(y)[0]),v&&v.length>0)if(this.templateData.ganttProperties.segments&&this.templateData.ganttProperties.segments.length>0){var D=this.templateData.ganttProperties.segments.length,w=null;w=this.createDivElement('<div class="e-gantt-split-container-line"></div>'),s[0].appendChild([].slice.call(w)[0]);for(var k=0;k<D;k++)s[0].appendChild([].slice.call(v)[0])}else t.append(v,s[0]);g&&s[0].appendChild([].slice.call(g)[0]),m&&s[0].appendChild([].slice.call(m)[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(t.isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate)||t.isNullOrUndefined(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||t.isNullOrUndefined(this.templateData.ganttProperties.baselineEndDate)||t.isNullOrUndefined(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.toLocaleDateString()!==this.templateData.ganttProperties.endDate.toLocaleDateString()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}var b;this.parent.allowParentDependency&&(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)?(b=this.getRightPointNode(),s[0].appendChild([].slice.call(b)[0])):this.parent.allowParentDependency||(b=this.getRightPointNode(),s[0].appendChild([].slice.call(b)[0]));var T=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 S=void 0,P=void 0,C=this.templateData.ganttProperties.indicators,R=0;R<C.length;R++){if((S=this.getIndicatorNode(C[R]))[0].setAttribute("aria-label",C[R].name),C[R].name.indexOf("$")>-1||C[R].name.indexOf("#")>-1)P=this.templateCompiler(C[R].name)(t.extend({index:e},this.templateData),this.parent,"indicatorLabelText");else{var M=t.createElement("Text");M.innerHTML=C[R].name,this.parent.enableHtmlSanitizer&&"string"==typeof C[R].name&&(C[R].name=t.SanitizeHtmlHelper.sanitize(C[R].name),M.innerText=C[R].name),P=M.childNodes}S[0].appendChild([].slice.call(P)[0]),S[0].title=t.isNullOrUndefined(C[R].tooltip)?"":C[R].tooltip,n[0].childNodes[0].childNodes[0].appendChild([].slice.call(S)[0])}T&&T.length>0&&n[0].childNodes[0].childNodes[0].appendChild([].slice.call(T)[0]),t.isNullOrUndefined(r)||n[0].childNodes[0].childNodes[0].appendChild([].slice.call(r)[0]);var O=n[0].childNodes[0];return this.setAriaRowIndex(i,O),O},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,n=this,a=!t.isNullOrUndefined(i.ganttProperties.segments)&&i.ganttProperties.segments.length>0?e:e.querySelector("."+N);i.ganttProperties.segments&&i.ganttProperties.segments.length>0&&(r=e.parentElement.parentElement.parentElement);var s={data:i,rowElement:e,taskbarElement:a,taskbarType:i.hasChildRecords?"ParentTask":i.ganttProperties.isMilestone?"Milestone":"ChildTask"},o=this.getClassName(s);if("Milestone"===s.taskbarType)s.milestoneColor=a.querySelector(o[0])?getComputedStyle(a.querySelector(o[0])).borderBottomColor:null,s.baselineColor=e.querySelector(o[1])?getComputedStyle(e.querySelector(o[1])).borderBottomColor:e.querySelector("."+V)?getComputedStyle(e.querySelector("."+V)).backgroundColor:null;else if(a){var l=a.querySelector(o[0]),d=a.querySelector(o[1]);s.taskbarBgColor=t.isNullOrUndefined(l)?null:a.classList.contains(A)?getComputedStyle(a).backgroundColor:getComputedStyle(a.querySelector(o[0])).backgroundColor,s.taskbarBorderColor=t.isNullOrUndefined(l)?null:a.classList.contains(A)?getComputedStyle(a).backgroundColor:getComputedStyle(a.querySelector(o[0])).borderColor,s.progressBarBgColor=t.isNullOrUndefined(d)?null:a.classList.contains("e-gantt-child-progressbar")?getComputedStyle(a).backgroundColor:getComputedStyle(a.querySelector(o[1])).backgroundColor,s.baselineColor=r?r.querySelector("."+V)?getComputedStyle(r.querySelector("."+V)).backgroundColor:null:e.querySelector("."+V)?getComputedStyle(e.querySelector("."+V)).backgroundColor:null,s.taskLabelColor=a.querySelector("."+F)?getComputedStyle(a.querySelector("."+F)).color:null}r?(s.rightLabelColor=r.querySelector("."+E)&&r.querySelector("."+E).querySelector("."+W)?getComputedStyle(r.querySelector("."+E).querySelector("."+W)).color:null,s.leftLabelColor=r.querySelector("."+I)&&r.querySelector("."+I).querySelector("."+W)?getComputedStyle(r.querySelector("."+I).querySelector("."+W)).color:null):(s.rightLabelColor=e.querySelector("."+E)&&e.querySelector("."+E).querySelector("."+W)?getComputedStyle(e.querySelector("."+E).querySelector("."+W)).color:null,s.leftLabelColor=e.querySelector("."+I)&&e.querySelector("."+I).querySelector("."+W)?getComputedStyle(e.querySelector("."+I).querySelector("."+W)).color:null),this.parent.trigger("queryTaskbarInfo",s,function(e){n.updateQueryTaskbarInfoArgs(e,void 0,void 0)})},i.prototype.updateQueryTaskbarInfoArgs=function(e,t,i){var r,n=e.rowElement,a=e.taskbarElement,s=this.getClassName(e);e.data.ganttProperties.segments&&e.data.ganttProperties.segments.length>0&&(r=n.parentElement.parentElement.parentElement),"Milestone"===e.taskbarType?(a.querySelector(s[0])&&getComputedStyle(a.querySelector(s[0])).borderBottomColor!==e.milestoneColor&&(a.querySelector(s[0]).style.borderBottomColor=e.milestoneColor,a.querySelector(".e-milestone-bottom").style.borderTopColor=e.milestoneColor),n.querySelector(s[1])&&getComputedStyle(n.querySelector(s[1])).borderTopColor!==e.baselineColor&&(n.querySelector(s[1]).style.borderBottomColor=e.baselineColor,n.querySelector(".e-baseline-milestone-bottom").style.borderTopColor=e.baselineColor),n.querySelector("."+V)&&getComputedStyle(n.querySelector("."+V)).borderTopColor!==e.baselineColor&&(n.querySelector("."+V).style.backgroundColor=e.baselineColor)):a&&(a.querySelector(s[0])&&getComputedStyle(a.querySelector(s[0])).backgroundColor!==e.taskbarBgColor&&(a.querySelector(s[0]).style.backgroundColor=e.taskbarBgColor),a.querySelector(s[0])&&getComputedStyle(a.querySelector(s[0])).borderColor!==e.taskbarBorderColor&&(a.querySelector(s[0]).style.borderColor=e.taskbarBorderColor),a.querySelector(s[1])&&getComputedStyle(a.querySelector(s[1])).backgroundColor!==e.progressBarBgColor&&(a.querySelector(s[1]).style.backgroundColor=e.progressBarBgColor),a.classList.contains(A)&&getComputedStyle(a).backgroundColor!==e.taskbarBgColor&&(a.style.backgroundColor=e.taskbarBgColor),a.classList.contains(A)&&getComputedStyle(a).borderColor!==e.taskbarBorderColor&&(a.style.borderColor=e.taskbarBorderColor),a.classList.contains("e-gantt-child-progressbar")&&getComputedStyle(a).backgroundColor!==e.progressBarBgColor&&(a.style.backgroundColor=e.progressBarBgColor),a.querySelector("."+F)&&getComputedStyle(a.querySelector("."+F)).color!==e.taskLabelColor&&(a.querySelector("."+F).style.color=e.taskLabelColor),r?r.querySelector("."+V)&&getComputedStyle(r.querySelector("."+V)).backgroundColor!==e.baselineColor&&(r.querySelector("."+V).style.backgroundColor=e.baselineColor):n.querySelector("."+V)&&getComputedStyle(n.querySelector("."+V)).backgroundColor!==e.baselineColor&&(n.querySelector("."+V).style.backgroundColor=e.baselineColor)),r?(r.querySelector("."+I)&&r.querySelector("."+I).querySelector("."+W)&&getComputedStyle(r.querySelector("."+I).querySelector("."+W)).color!==e.leftLabelColor&&(r.querySelector("."+I).querySelector("."+W).style.color=e.leftLabelColor),r.querySelector("."+E)&&r.querySelector("."+E).querySelector("."+W)&&getComputedStyle(r.querySelector("."+E).querySelector("."+W)).color!==e.rightLabelColor&&(r.querySelector("."+E).querySelector("."+W).style.color=e.rightLabelColor)):(n.querySelector("."+I)&&n.querySelector("."+I).querySelector("."+W)&&getComputedStyle(n.querySelector("."+I).querySelector("."+W)).color!==e.leftLabelColor&&(n.querySelector("."+I).querySelector("."+W).style.color=e.leftLabelColor),n.querySelector("."+E)&&n.querySelector("."+E).querySelector("."+W)&&getComputedStyle(n.querySelector("."+E).querySelector("."+W)).color!==e.rightLabelColor&&(n.querySelector("."+E).querySelector("."+W).style.color=e.rightLabelColor))},i.prototype.getClassName=function(e){var t=[];return t.push("."+("ParentTask"===e.taskbarType?"e-gantt-parent-taskbar":"ChildTask"===e.taskbarType?A:"e-milestone-top")),t.push("."+("ParentTask"===e.taskbarType?"e-gantt-parent-progressbar":"ChildTask"===e.taskbarType?"e-gantt-child-progressbar":"e-baseline-milestone-top")),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.updateOverlapped=function(){for(var e=0;e<this.parent.treeGrid.parentData.length;e++)for(var i=this.parent.treeGrid.parentData[e].childRecords,r=0;r<i.length;r++){i[r+1]&&(i[r].ganttProperties.eOverlapped=void 0);for(var n=r+1;n<i.length;n++)i[n].ganttProperties.eOverlapped=void 0,i[r].ganttProperties.startDate.getTime()<i[n].ganttProperties.endDate.getTime()&&i[r].ganttProperties.endDate.getTime()>i[n].ganttProperties.startDate.getTime()?(i[n].ganttProperties.eOverlapped=!0,i[r].ganttProperties.eOverlapped=!0):(t.isNullOrUndefined(i[n].ganttProperties.eOverlapped)&&(i[n].ganttProperties.eOverlapped=!1),t.isNullOrUndefined(i[r].ganttProperties.eOverlapped)&&(i[r].ganttProperties.eOverlapped=!1))}},i.prototype.updateDragDropRecords=function(e,t){var i=e.childRecords,r=this.parent.currentViewData.indexOf(e),n=this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0].offsetHeight:this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight;t||(t=this.ganttChartTableBody.childNodes[r]),t.style.height=this.parent.treeGrid.getRowByIndex(r).style.height=this.parent.rowHeight+"px",this.parent.contentHeight=n;var a=[],s=0;if(e){for(var o=0;o<i.length;o++)for(var l=o+1;l<i.length;l++)for(var d=t.getElementsByClassName("e-taskbar-main-container"),p=0;p<d.length;p++)i[o].ganttProperties.startDate.getTime()<i[l].ganttProperties.endDate.getTime()&&i[o].ganttProperties.endDate.getTime()>i[l].ganttProperties.startDate.getTime()?d[p].getAttribute("rowuniqueid")===i[l].rowUniqueID&&-1==a.indexOf(i[l].rowUniqueID)&&(a.push(i[l].rowUniqueID),s++,t.children[0].style.verticalAlign="baseline",t.getElementsByClassName("e-taskbar-main-container")[p].style.marginTop=s*this.parent.rowHeight+this.taskBarMarginTop+"px",t.style.height=this.parent.treeGrid.getRowByIndex(r).style.height=parseInt(t.style.height)+this.parent.rowHeight+"px"):d[p].getAttribute("rowuniqueid")===i[l].rowUniqueID&&-1==a.indexOf(i[l].rowUniqueID)&&this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.draggedRecord&&d[p].getAttribute("rowuniqueid")===this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID&&this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID===i[l].rowUniqueID&&(t.getElementsByClassName("e-taskbar-main-container")[p].style.marginTop=this.parent.editModule.taskbarEditModule.draggedRecordMarginTop);this.parent.contentHeight=n,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px"}},i.prototype.refreshRow=function(e,i){var r=this.ganttChartTableBody.childNodes[e],n=this.parent.currentViewData[e];if(-1!==e&&n){var a=n;!this.parent.allowTaskbarOverlap&&"ResourceView"===this.parent.viewType&&a.expanded&&(r.style.height=this.parent.treeGrid.getRowByIndex(e).style.height=this.parent.rowHeight+"px"),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&!a.expanded&&this.parent.enableMultiTaskbar?r.replaceChild(this.getResourceParent(a).childNodes[0],r.childNodes[0]):"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&!a.expanded?r.replaceWith(this.getGanttChartRow(e,a)):r.replaceChild(this.getGanttChartRow(e,a).childNodes[0],r.childNodes[0]),this.parent.renderTemplates(),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&this.parent.showOverAllocation&&this.parent.allowTaskbarOverlap&&(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),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&!a.expanded&&this.parent.enableMultiTaskbar&&!this.parent.allowTaskbarOverlap&&this.updateDragDropRecords(n,r),"ResourceView"===this.parent.viewType&&a.hasChildRecords&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap&&this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);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);var h=this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[e].getAttribute("data-uid"));t.isNullOrUndefined(h)||(h.data=a)}},i.prototype.updateResourceTaskbarElement=function(e,i){var r=e.querySelector(".e-taskbar-main-container");t.addClass([r],"collpse-parent-border");var n=e.querySelector("."+N).getAttribute("rowUniqueId"),a=this.parent.getRecordByID(n),s="";a&&!t.isNullOrUndefined(a.ganttProperties.eOverlapIndex)&&(s=a.ganttProperties.eOverlapIndex.toString());var o=r.cloneNode(!0);o.style.zIndex=s,i[0].childNodes[0].childNodes[0].childNodes[0].appendChild(o)},i.prototype.getResourceParent=function(e){var i=this.parent.ganttChartModule.getChartRows();if(this.parent.initialChartRowElements&&!this.parent.allowTaskbarDragAndDrop&&this.parent.allowTaskbarOverlap)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);var l;if(this.parent.enableVirtualization)for(d=0;d<e.childRecords.length;d++)l=this.getGanttChartRow(e.childRecords[d].index,this.parent.flatData[e.childRecords[d].index]),this.updateResourceTaskbarElement(l,n);else for(var d=0;d<i.length;d++)i[d].classList.contains("gridrowtaskId"+e.ganttProperties.rowUniqueID+"level"+(e.level+1))&&this.updateResourceTaskbarElement(i[d],n);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.generateBaselineAriaLabel=function(e){e=this.templateData;var t="",i=this.parent.localeObj.getConstant("name"),r=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),a=e.ganttProperties.taskName,s=e.ganttProperties.baselineStartDate,o=e.ganttProperties.baselineEndDate;return t+="Baseline ",t+=i+" "+a+" ",t+=r+" "+this.parent.getFormatedDate(s)+" ",t+=n+" "+this.parent.getFormatedDate(o)+" "},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}(R),et=function(){function e(e){this.parentRecord=[],this.parentIds=[],this.parentPredecessors=[],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.parent.allowParentDependency||this.parent.allowParentDependency)&&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=[];var l="ResourceView"===s.parent.viewType?s.parent.getTaskIds():s.parent.ids;-1!==("ResourceView"===s.parent.viewType?l.indexOf("T"+r[0]):l.indexOf(r[0]))?i[0]=r[0]:-1===l.indexOf(r[0])?1===(i=r[0].split(" ")).length&&(-1!=i[0].indexOf(" ")?i=r[0].match(/(\d+|[A-z]+)/g):(i[0]=r[0].slice(0,-2),i[1]=r[0].slice(-2))):i[0]=r[0];var d="ResourceView"===s.parent.viewType?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},g=s.checkIsParent(i[0]);if(s.parent.allowParentDependency){var f=s.parent.connectorLineModule.getRecordByID(u.to),m=s.parent.connectorLineModule.getRecordByID(u.from);s.parent.connectorLineEditModule&&m&&f?s.parent.connectorLineEditModule.validateParentPredecessor(m,f)&&o.push(u):o.push(u),i.splice(0)}else g||o.push(u)}}),o},e.prototype.getPredecessorStringValue=function(e){var i,r,n=e.ganttProperties.predecessor,a=this.parent.durationUnitTexts,s="";if(r=[],n)for(var o=n.length,l=0;l<o;l++){var d=n[l],p="",h="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(d.from!==h.toString()){if(p=d.from+d.type,"string"==typeof e.ganttProperties.taskId?(r[0]=p.slice(0,-2),r[1]=p.slice(-2),i=r[0]+" "+r[1]):i=p,p=i,0!==d.offset){p+=d.offset>0?"+"+d.offset+" ":d.offset+" ";var c=1!==d.offset;"day"===d.offsetUnit?p+=c?t.getValue("days",a):t.getValue("day",a):"hour"===d.offsetUnit?p+=c?t.getValue("hours",a):t.getValue("hour",a):p+=c?t.getValue("minutes",a):t.getValue("minute",a)}s=s.length>0?s+","+p:p}}return s},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.parent.allowParentDependency||this.parent.allowParentDependency)&&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(){if(this.parent.autoCalculateDateScheduling)for(var e=this.parent.flatData,t=this.parent.flatData.length,i=0;i<t;i++)if(e[i].ganttProperties.predecessorsName){this.validatePredecessorDates(e[i]);var r=e[i].ganttProperties.predecessor;if(r&&r.length>1)for(var n=0;n<r.length;n++){var a=this.parent.getRecordByID(r[n].to);a&&this.validatePredecessorDates(a)}e[i].hasChildRecords&&this.parent.editModule&&!this.parent.allowUnscheduledTasks&&this.parent.allowParentDependency&&this.parent.editModule.updateChildItems(e[i])}},e.prototype.updateParentPredecessor=function(){if(this.parent.enablePredecessorValidation)for(var e=this.parentPredecessors.length-1;e>=0;e--){var t=this.parentPredecessors[e];this.validatePredecessorDates(t),t.ganttProperties.startDate&&this.parent.editModule.updateChildItems(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),this.parent.allowParentDependency&&this.parent.isLoad&&-1==this.parentPredecessors.indexOf(e)&&(e.hasChildRecords||n.hasChildRecords)&&this.parentPredecessors.push(e),(n.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)&&this.validateChildGanttRecord(r,n)}}},e.prototype.validateChildGanttRecord=function(e,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),!this.parent.isLoad&&!this.parent.isFromOnPropertyChange&&i.parentItem&&this.parent.isInPredecessorValidation&&this.parent.getParentTask(i.parentItem).ganttProperties.isAutoSchedule&&-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,!0):(r=this.dateValidateModule.getEndDate(e,n,a,i,!1),i.isMilestone||(r=this.dateValidateModule.checkStartDate(r,i))),r},e.prototype.createConnectorLinesCollection=function(e){var t,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){var r=this.parent.editModule.taskbarEditModule,n=void 0;r&&(n=r.taskBarEditRecord);for(var a=e.ganttProperties.predecessor,s=void 0,o=null,l=void 0,d=void 0,p="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),h=a.filter(function(e){return e.to===p?e:null}),c=a.filter(function(e){return e.from===p?e:null}),u=0;u<h.length;u++){l=h[u],s=this.parent.connectorLineModule.getRecordByID(l.from),o=this.parent.connectorLineModule.getRecordByID(l.to),this.parent.isInPredecessorValidation&&o.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1;var g="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;g.toString()!==l.to&&g.toString()!==l.from||i&&"predecessor"!==i||this.validateChildGanttRecord(s,o)}for(u=0;u<c.length;u++)d=c[u],s=this.parent.connectorLineModule.getRecordByID(d.from),o=this.parent.connectorLineModule.getRecordByID(d.to),this.parent.isInPredecessorValidation&&o.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1,"predecessor"!==i&&this.parent.isValidationEnabled&&this.validateChildGanttRecord(s,o),!1!==s.expanded&&o.expanded,o&&this.validatePredecessor(o,void 0,"successor");if(o&&o.ganttProperties.taskId!==this.isValidatedParentTaskID&&n){var f=!1,m=n.ganttProperties.predecessorsName?n.ganttProperties.predecessorsName.split(",").length:n.ganttProperties.predecessorsName,y=n.ganttProperties.predecessor?n.ganttProperties.predecessor.length:n.ganttProperties.predecessor;y&&m!==y?f=!0:o.hasChildRecords&&o.ganttProperties.predecessor.length>0&&n.hasChildRecords&&!n.ganttProperties.predecessor&&(f=!0),"ParentDrag"!==r.taskBarEditAction&&"ChildDrag"!==r.taskBarEditAction?!n.hasChildRecords&&o.hasChildRecords&&(this.parent.editModule.updateChildItems(o),this.isValidatedParentTaskID=o.ganttProperties.taskId):(o.hasChildRecords&&"ChildDrag"==r.taskBarEditAction||f&&"ParentDrag"==r.taskBarEditAction)&&(this.parent.editModule.updateChildItems(o),this.isValidatedParentTaskID=o.ganttProperties.taskId),n.hasChildRecords||this.parent.dataOperation.updateParentItems(o,!0)}else o&&o.hasChildRecords&&!n&&this.parent.editModule.updateChildItems(o)}},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}(),tt=function(){function e(e){this.expandedRecords=[],this.parent=e,this.dependencyViewContainer=t.createElement("div",{className:j}),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);if(n.parentIndexInCurrentView=p.indexOf(e),n.childIndexInCurrentView=p.indexOf(i),!(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);for(a=0;a<this.dependencyViewContainer.children.length;a++)this.dependencyViewContainer.children[a].children[0].setAttribute("tabindex","-1")},e.prototype.getParentPosition=function(e){if(e.parentIndex<e.childIndex){if("FF"===e.type)return e.childLeft+e.childWidth>=e.parentLeft+e.parentWidth?"FFType2":"FFType1";if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth+25){if("FS"===e.type)return"FSType1";if("SF"===e.type)return"SFType1";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType2"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.parentLeft>e.childLeft+e.childWidth+25&&"SF"===e.type)return"SFType2";if(e.parentLeft>e.childLeft){if("SS"===e.type)return"SSType1";if("SF"===e.type)return"SFType1";if("FF"===e.type)return"FFType1"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType2";if("FS"===e.type)return"FSType2";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType1";if("SF"===e.type)return"SFType1"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType2";if("FF"===e.type)return"FFType2";if("SS"===e.type)return"SSType2";if("SF"===e.type)return"SFType1"}}else if(e.parentIndex>e.childIndex)if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth){if("FS"===e.type)return 30>=e.childLeft-(e.milestoneParent?e.parentLeft+e.parentWidth+4:e.parentLeft+e.parentWidth)?"FSType3":"FSType4";if(e.parentLeft<e.childLeft||e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType4"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.childLeft+e.childWidth<=e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType3";if("SF"===e.type)return e.childLeft+e.childWidth+25<e.parentLeft?"SFType3":"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}if("FS"===e.type)return"FSType3"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType3";if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}return null},e.prototype.getHeightValue=function(e){return"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap?e.parentIndex*this.parent.rowHeight>e.childIndex*this.parent.rowHeight?e.parentIndex*this.parent.rowHeight-e.childIndex*this.parent.rowHeight:e.childIndex*this.parent.rowHeight-e.parentIndex*this.parent.rowHeight:e.parentIndex*e.rowHeight>e.childIndex*e.rowHeight?e.parentIndex*e.rowHeight-e.childIndex*e.rowHeight:e.childIndex*e.rowHeight-e.parentIndex*e.rowHeight},e.prototype.getInnerElementWidthSSType2=function(e){return e.parentLeft===e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getInnerElementLeftSSType2=function(e){return e.parentLeft===e.childLeft?e.parentLeft-20:e.parentLeft-10},e.prototype.getInnerChildWidthSSType2=function(e){return e.parentLeft+e.parentWidth<e.childLeft?10:e.parentLeft===e.childLeft?20:e.parentLeft+e.parentWidth>=e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getBorderStyles=function(e,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,u=0,g=0,f=0,m=0,y=0;if("ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap){for(var v=0;v<this.parent.currentViewData.length;v++)"none"!=this.parent.getRowByIndex(v).style.display&&y<e.parentIndex&&(y++,f+=this.parent.getRowByIndex(v).offsetHeight);y=0;for(var D=0;D<this.parent.currentViewData.length;D++)"none"!=this.parent.getRowByIndex(D).style.display&&y<e.childIndex&&(y++,m+=this.parent.getRowByIndex(D).offsetHeight);c=Math.abs(f-m)}if(this.parent.currentViewData[e.parentIndex]&&this.parent.currentViewData[e.childIndex]&&this.parent.allowParentDependency){var w=this.parent.currentViewData[e.parentIndex].hasChildRecords,k=this.parent.currentViewData[e.childIndex].hasChildRecords,b=this.parent.currentViewData[e.parentIndex].ganttProperties.isAutoSchedule,T=this.parent.currentViewData[e.childIndex].ganttProperties.isAutoSchedule,S=!0;(w&&b&&!k||k&&T&&!w||w&&b&&T&&k||!w&&!k)&&(S=!1),S&&(w&&!b&&k&&!T?g=-11:w&&!b&&k&&!T||(e.childIndex>e.parentIndex?!w&&k?u=-11:(u=11,g=-11):w&&!k?u=-11:(u=11,g=-11)),this.parent.currentViewData[e.parentIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(g=-5,u=10):"SS"!==e.type&&"FF"!==e.type||(g=-5):this.parent.currentViewData[e.childIndex].ganttProperties.isMilestone&&(e.parentIndex>e.childIndex?(g=5,u=-10):"SS"!==e.type&&"FF"!==e.type||(g=5)))}if(this.getParentPosition(e)){l='<div id="ConnectorLine'+e.connectorLineId+'" style="background-color:black">';var P='<div class="e-connector-line-container" tabindex="-1" style="',C=this.parent.enableRtl?"right:":"left:",R='<div class="e-line" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),M=void 0,O=void 0;this.parent.enableRtl?(O='<div class="e-connector-line-right-arrow" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),M='<div class="e-connector-line-left-arrow" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";")):(M='<div class="e-connector-line-right-arrow" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),O='<div class="e-connector-line-left-arrow" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"));var x=O+(o?this.parent.enableRtl?"right:0px;":"left:0px;":"")+this.getBorderStyles(this.parent.enableRtl?"left":"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>',I=this.getBorderStyles(this.parent.enableRtl?"right":"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>',E=this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>'+R+"top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-(this.lineStroke-1))+'position:relative;"></div>',N=O+(this.parent.enableRtl?"right:":"left:")+(e.childLeft+e.childWidth-e.parentLeft+10)+"px;"+this.getBorderStyles(this.parent.enableRtl?"left":"right",10),F="top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>';"FSType1"===this.getParentPosition(e)&&(P=P+C+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType1">',P=(P+=R)+C+(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>',P=(P+=R)+C+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:0px;"+this.getBorderStyles("right",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=M)+C+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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)&&(P=P+C+e.parentLeft+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType2">',P=(P+=R)+C+(s?e.parentWidth-1:e.parentWidth)+"px;width:"+(s?11:10)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(e.parentWidth+10-this.lineStroke)+"px;"+this.getBorderStyles("left",this.lineStroke)+"width:0px;"+this.getBorderStyles("top",c+u-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(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>',P=(P+=R)+C+(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>',P=(P+=R)+C+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=M)+C+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+10))+"px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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)&&(P=P+C+(e.childLeft-20)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType3">',P=(P+=M)+C+"10px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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>',P=(P+=R)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(6+(5+this.lineStroke)+Math.round(this.lineStroke/2))+'px;"></div>',P=(P+=R)+"width:"+this.lineStroke+"px;"+this.getBorderStyles("top",c+u-this.getconnectorLineGap(e)-this.lineStroke+1)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',P=(P+=R)+"width:"+(e.parentLeft+e.parentWidth-e.childLeft+30)+"px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',P=(P+=R)+C+(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>',P=(P+=R)+(s?C+(e.parentLeft+e.parentWidth-e.childLeft+(18-this.lineStroke))+"px;width:"+(12+this.lineStroke)+"px;":C+(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)&&(P=P+C+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FSType4">',P=(P+=M)+C+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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>',P=(P+=R)+C+(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>',P=(P+=R)+"top:"+-(13+2*(this.lineStroke-1))+"px;"+C+(e.childLeft-(e.parentLeft+e.parentWidth)-20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke+1)+'position:relative;"></div>',P=(P+=R)+(s?C+"-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)&&(P=P+C+(e.parentLeft-10)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType4">',P=(P+=M)+C+(e.childLeft-e.parentLeft)+"px;"+I,P=(P+=R)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:"+(e.childLeft-e.parentLeft)+"px;"+E,P=(P+=R)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SSType3"===this.getParentPosition(e)&&(P=P+C+(e.childLeft-20)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType3">',P=(P+=M)+C+"10px;"+I,P=(P+=R)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:10px;"+E,P=(P+=R)+"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)&&(P=P+C+n+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType2">',P=(P+=R)+"width:"+(i+1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:"+r+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=M)+C+r+"px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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)&&(P=P+C+(e.childLeft-20)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SSType1">',P=(P+=R)+"width:"+(e.parentLeft-e.childLeft+21)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=M)+C+"10px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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)&&(P=P+C+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType1">',P=(P+=R)+C+(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>',P=(P+=R)+C+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(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>',P=(P+=O)+(o?C+"0px;":"")+this.getBorderStyles(this.parent.enableRtl?"left":"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)&&(P=P+C+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType2">',P=(P+=R)+(s?C+"-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>',P=(P+=R)+C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(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>',P=(P+=O)+C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth))+"px;"+this.getBorderStyles(this.parent.enableRtl?"left":"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)&&(P=P+C+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType3">',P+=x,P=(P+=R)+(o?C+"4px;width:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+16):C+"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>',P=(P+=R)+C+(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+u-this.lineStroke+1)+'position:relative;"></div>',P=(P+=R)+(s?C+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)-1)+"px;width:21":C+(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)&&(P=P+C+(e.parentLeft+e.parentWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="FFType4">',P=(P+=O)+(C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)))+"px;"+this.getBorderStyles(this.parent.enableRtl?"left":"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>',P=(P+=R)+(o?C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+4)+"px;width:"+(16+this.lineStroke):C+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+10)+"px;width:"+(10+this.lineStroke))+"px;"+F,P=(P+=R)+C+(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+u-this.lineStroke+1)+'position:relative;"></div>',P=(P+=R)+(s?C+"-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)&&(P=(P=P+C+(e.parentLeft-10)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType4">')+N+"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>',P=(P+=R)+C+(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;"+F,P=(P+=R)+C+(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+u-this.getconnectorLineGap(e)-(this.lineStroke-1))+'position:relative;"></div>',P=(P+=R)+"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>',P=(P+=R)+"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>',P=(P+=R)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType3"===this.getParentPosition(e)&&(P=P+C+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.childIndex*e.rowHeight:m)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType3">',P+=x,P=(P+=R)+(o?C+"4px;width:"+(16+this.lineStroke):C+"10px;width:"+(10+this.lineStroke))+"px;top:"+-(13+2*(this.lineStroke-1)-1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+"20px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-(this.lineStroke-1))+'position:relative;"></div>',P=(P+=R)+C+"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)&&(P=P+C+(e.parentLeft-10)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(o)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType1">',P=(P+=R)+"width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+"width:"+(e.childLeft+e.childWidth-e.parentLeft+(30+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(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>',P=(P=(P+=R)+(o?C+(e.childLeft+e.childWidth-e.parentLeft+15)+"px;width:"+(15+this.lineStroke):C+(e.childLeft+e.childWidth-e.parentLeft+20)+"px;width:"+(10+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>')+N+"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)&&(P=P+C+(e.childLeft+e.childWidth)+"px;top:"+(d?p.top:(this.parent.allowTaskbarOverlap?e.parentIndex*e.rowHeight:f)+g+this.getTaskbarMidpoint(s)-(this.lineStroke-1)-h)+"px;width:1px;height:"+c+'px;position:absolute" data-connectortype="SFType2">',P=(P+=R)+C+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=R)+C+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",c+u-this.lineStroke)+'position:relative;"></div>',P=(P+=R)+(o?C+"4px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(14-this.lineStroke)):C+"10px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(20-this.lineStroke)))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',P=(P+=O)+C+"0px;"+this.getBorderStyles(this.parent.enableRtl?"right":"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>'),l+=P,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,o=(s=i?e[n[a]]:e[a]).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}(),it=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.enableRtl?(this.parent.splitterElement.appendChild(this.parent.chartPane),this.parent.splitterElement.appendChild(this.parent.treeGridPane)):(this.parent.splitterElement.appendChild(this.parent.treeGridPane),this.parent.splitterElement.appendChild(this.parent.chartPane)),this.splitterObject=new s.Splitter({height:null,width:this.parent.ganttWidth.toString(),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,separatorSize:this.parent.splitterSettings.separatorSize,paneSettings:[{resizable:!0,size:i,min:this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum)},{resizable:!0}],orientation:"Horizontal",resizeStart:function(t){e.parent.contextMenuModule&&e.parent.contextMenuModule.isOpen&&e.parent.contextMenuModule.contextMenu.close();var i=t.pane[0],r=t.pane[1];e.splitterPreviousPositionGrid=i.scrollWidth+1+"px",e.splitterPreviousPositionChart=r.scrollWidth+1+"px";var 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(i){var r=i.pane[0];e.splitterPreviousPositionGrid=r.scrollWidth+1+"px",e.splitterObject.paneSettings[0].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionGrid);var a=new n.Deferred;return e.parent.trigger("splitterResized",i,function(i){!0===i.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)),t.isNullOrUndefined(e.parent.projectEndDate)&&e.parent.timelineModule.updateTimelineAfterZooming(e.parent.timelineModule.timelineEndDate,!0),a.resolve(i)}),a}}),this.parent.element.appendChild(this.parent.splitterElement),this.splitterObject.appendTo(this.parent.splitterElement)},e.prototype.calculateSplitterPosition=function(e){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")?this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(e.columnIndex).toString()+"px"):this.getSpliterPositionInPercentage(130*e.columnIndex+"px"):this.getSpliterPositionInPercentage("250px"):this.getSpliterPositionInPercentage(e.position)},e.prototype.getSpliterPositionInPercentage=function(e){var 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.ganttColumns;e=i.length>e?e:i.length;for(var r=0;r<e;r++)t+=parseInt(i[r].width);return t},e.prototype.updateSplitterPosition=function(){this.splitterObject.separatorSize=this.parent.splitterSettings.separatorSize>=4?this.parent.splitterSettings.separatorSize:4;var e=this.calculateSplitterPosition(this.parent.splitterSettings);this.splitterObject.paneSettings[0].min=this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum),this.splitterObject.dataBind(),this.splitterObject.paneSettings[0].size=e},e.prototype.triggerCustomResizedEvent=function(){var e=this.splitterObject.element.querySelectorAll(".e-pane")[0],t=this.splitterObject.element.querySelectorAll(".e-pane")[1],i={event:null,element:this.splitterObject.element,pane:[e,t],index:[0,1],separator:this.splitterObject.element.querySelector(".e-split-bar"),paneSize:[e.offsetWidth,t.offsetWidth]};this.parent.trigger("splitterResized",i),!0===i.cancel&&(this.splitterObject.paneSettings[0].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionGrid),this.splitterObject.paneSettings[1].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionChart))},e.prototype.destroy=function(){this.splitterObject.destroy(),this.parent.off("destroy",this.destroy)},e}(),rt=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.enableRtl=this.parent.enableRtl,this.toolTipObj.enableHtmlSanitizer=this.parent.enableHtmlSanitizer,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)return void(e.cancel=!0);var r,a=t.closest(e.target,"div."+N);r=t.isNullOrUndefined(a)?g(e.target,"e-chart-row-cell"):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.toolTipObj.content=o.content,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;if(i){var l=(s=i.ganttProperties).taskName;this.parent.enableHtmlSanitizer&&"string"==typeof l&&(l=t.SanitizeHtmlHelper.sanitize(l)),o=t.isNullOrUndefined(l)?"":'<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">'+(this.parent.disableHtmlEncode?l.replace(/</g,"<").replace(/>/g,">"):l)+"</td></tr>"}switch(e){case"milestone":var d=void 0;n.target.className.includes("e-baseline-gantt-milestone")&&!t.isNullOrUndefined(s.baselineStartDate)?d=s.baselineStartDate:t.isNullOrUndefined(s.startDate)||(d=s.startDate);var p=this.parent.getFormatedDate(d,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&"string"==typeof p&&(p=t.SanitizeHtmlHelper.sanitize(p)),a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(t.isNullOrUndefined(d)?"":'<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+p+"</td></tr>")+"</tbody></table>";break;case"taskbar":var h=!(i.hasChildRecords&&!s.isAutoSchedule),c=this.parent.getFormatedDate(h?s.startDate:s.autoStartDate,this.parent.getDateFormat()),u=this.parent.getFormatedDate(h?s.endDate:s.autoEndDate,this.parent.getDateFormat()),g=this.parent.getDurationString(h?s.duration:s.autoDuration,s.durationUnit),f=s.progress;this.parent.enableHtmlSanitizer&&(c="string"==typeof c?t.SanitizeHtmlHelper.sanitize(c):c,u="string"==typeof u?t.SanitizeHtmlHelper.sanitize(u):u,g="string"==typeof g?t.SanitizeHtmlHelper.sanitize(g):g,f="string"==typeof f?t.SanitizeHtmlHelper.sanitize(f):f),a='<table class = "e-gantt-tooltiptable"><tbody>'+o+(s.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(h?"startDate":"subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+c+"</td></tr>":"")+(s.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(h?"endDate":"subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+u+"</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"> '+g+"</td></tr>")+(t.isNullOrUndefined(s.progress)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+"</td><td>:</td><td>"+f+"</td></tr>")+"</tbody></table>";break;case"baseline":var m=this.parent.getFormatedDate(s.baselineStartDate,this.parent.getDateFormat()),y=this.parent.getFormatedDate(s.baselineEndDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(m="string"==typeof m?t.SanitizeHtmlHelper.sanitize(m):m,y="string"==typeof y?t.SanitizeHtmlHelper.sanitize(y):y),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">'+m+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+y+"</td></tr></tbody></table>";break;case"marker":var v=r.tooltipModule.getMarkerTooltipData(n),D=this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(v.day),this.parent.getDateFormat()),w=v.label?v.label:"";this.parent.enableHtmlSanitizer&&(w="string"==typeof w?t.SanitizeHtmlHelper.sanitize(w):w,D="string"==typeof D?t.SanitizeHtmlHelper.sanitize(D):D),a='<table class = "e-gantt-tooltiptable"><tbody><tr><td>'+D+"</td></tr><tr><td>"+(this.parent.disableHtmlEncode?w.replace(/</g,"<").replace(/>/g,">"):w)+"</td></tr></tbody></table>";break;case"connectorLine":var k=r.tooltipModule.predecessorTooltipData.fromName,b=r.tooltipModule.predecessorTooltipData.fromId,T=r.tooltipModule.predecessorTooltipData.toName,S=r.tooltipModule.predecessorTooltipData.toId,P=r.tooltipModule.predecessorTooltipData.linkText,C=r.tooltipModule.predecessorTooltipData.offsetString;this.parent.enableHtmlSanitizer&&(k="string"==typeof k?t.SanitizeHtmlHelper.sanitize(k):k,b="string"==typeof b?t.SanitizeHtmlHelper.sanitize(b):b,T="string"==typeof T?t.SanitizeHtmlHelper.sanitize(T):T,S="string"==typeof S?t.SanitizeHtmlHelper.sanitize(S):S,P="string"==typeof P?t.SanitizeHtmlHelper.sanitize(P):P,C="string"==typeof C?t.SanitizeHtmlHelper.sanitize(C):C),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">'+(this.parent.disableHtmlEncode?k.replace(/</g,"<").replace(/>/g,">"):k)+" ("+(this.parent.disableHtmlEncode&&"string"==typeof b?b.replace(/</g,"<").replace(/>/g,">"):b)+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("to")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?T.replace(/</g,"<").replace(/>/g,">"):T)+" ("+S+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("taskLink")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+P+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("lag")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+C+"</td></tr></tbody></table>";break;case"indicator":if(n.target.title.length){var R=n.target.title;this.parent.enableHtmlSanitizer&&"string"==typeof R&&(R=t.SanitizeHtmlHelper.sanitize(R)),a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+R+"</tr></tbody></table>"}break;case"timeline":var M=n.target.title;this.parent.enableHtmlSanitizer&&"string"==typeof M&&(M=t.SanitizeHtmlHelper.sanitize(M)),a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+M+"</tr></tbody></table>";break;case"manualtaskbar":var O=this.parent.getFormatedDate(s.autoStartDate,this.parent.getDateFormat()),x=this.parent.getFormatedDate(s.autoEndDate,this.parent.getDateFormat()),I=this.parent.getDurationString(s.duration,s.durationUnit),E=this.parent.getFormatedDate(s.startDate,this.parent.getDateFormat()),N=this.parent.getFormatedDate(s.endDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(O="string"==typeof O?t.SanitizeHtmlHelper.sanitize(O):O,x="string"==typeof x?t.SanitizeHtmlHelper.sanitize(x):x,I="string"==typeof I?t.SanitizeHtmlHelper.sanitize(I):I,E="string"==typeof E?t.SanitizeHtmlHelper.sanitize(E):E,N="string"==typeof N?t.SanitizeHtmlHelper.sanitize(N):N);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"> '+O+"</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">'+x+"</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"> '+I+"</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"> '+E+"</td></tr>":"")+F+(s.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+N+"</td></tr>":"")+U+g+"</tbody></table>";break;case"manualmilestone":var V=this.parent.getFormatedDate(s.autoStartDate,this.parent.getDateFormat()),L=this.parent.getFormatedDate(s.autoEndDate,this.parent.getDateFormat()),B=this.parent.getFormatedDate(s.startDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(V="string"==typeof V?t.SanitizeHtmlHelper.sanitize(V):V,L="string"==typeof L?t.SanitizeHtmlHelper.sanitize(L):L,B="string"==typeof B?t.SanitizeHtmlHelper.sanitize(B):B),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">'+B+"</tr>")+(s.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+V+"</td></tr>":"")+(s.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+L+"</td></tr>":"")+"</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 i=e.target.parentElement.id;this.parent.enableHtmlSanitizer&&"string"==typeof i&&(i=t.SanitizeHtmlHelper.sanitize(i));var r=i.match(/ConnectorLineparent(.*)child(.*)/);r.shift();var n,a;"ResourceView"===this.parent.viewType?(n=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[0])],a=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[1])]):(n=this.parent.flatData[this.parent.ids.indexOf(r[0])],a=this.parent.flatData[this.parent.ids.indexOf(r[1])]);var s=n.ganttProperties.predecessor.filter(function(e){return e.to===r[1]});return{fromId:"ResourceView"===this.parent.viewType?n.ganttProperties.taskId:n.ganttProperties.rowUniqueID,toId:"ResourceView"===this.parent.viewType?a.ganttProperties.taskId:a.ganttProperties.rowUniqueID,fromName:n.ganttProperties.taskName,toName:a.ganttProperties.taskName,linkType:s[0].type,linkText:this.parent.getPredecessorTextValue(s[0].type),offset:s[0].offset,offsetUnit:s[0].offsetUnit,offsetString:this.parent.getDurationString(s[0].offset,s[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}(),nt=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);!t.isNullOrUndefined(this.parent.focusModule.getActiveElement())||"expandAll"!==e.action&&"collapseAll"!==e.action||(c=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":(m=i.element.querySelector("#"+i.element.id+"_searchbar"))&&m.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(),(c=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(i.editModule&&i.editModule.cellEditModule&&i.editModule.cellEditModule.isCellEdit)e.stopPropagation();else if(t.isNullOrUndefined(document.getElementById(this.parent.element.id+"_dialog"))){e.preventDefault(),i.addRecord(void 0,this.parent.editSettings.newRowPosition);var c=i.element;c.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":if(e.preventDefault(),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)&&(t.isNullOrUndefined(e.target)?i.editModule.startDeleteAction():"INPUT"!==e.target.tagName&&i.editModule.startDeleteAction());break;case"focusTask":e.preventDefault();var u=void 0;if(i.selectionModule){var g=i.currentViewData;if("Cell"===i.selectionSettings.mode||t.isNullOrUndefined(g[i.selectedRowIndex])){if("Cell"===i.selectionSettings.mode&&i.selectionModule.getSelectedRowCellIndexes().length>0){var f=i.selectionModule.getSelectedRowCellIndexes();u=g[f[f.length-1].rowIndex].ganttProperties.rowUniqueID}}else u=i.currentViewData[i.selectedRowIndex].ganttProperties.rowUniqueID}u&&i.scrollToTask(u.toString());break;case"focusSearch":if(i.element.querySelector("#"+i.element.id+"_searchbar")){var m=i.element.querySelector("#"+i.element.id+"_searchbar");m.setAttribute("tabIndex","-1"),m.focus()}break;case"tab":case"shiftTab":i.element.classList.contains("e-scroll-disabled")||i.ganttChartModule.onTabAction(e);break;case"contextMenu":var y=document.getElementById(this.parent.element.id+"_contextmenu").ej2_instances[0],v=this.parent.getOffsetRect(e.target),D=v.top+v.height/2,w=v.left+v.width/2;this.setActiveElement(e.target),y.open(D,w),e.preventDefault();break;default:var k={requestType:"keyPressed",action:e.action,keyEvent:e};i.trigger("actionComplete",k)}},e.prototype.upDownKeyNavigate=function(e){e.preventDefault();var t=this.parent,i=t.getExpandedRecords(t.currentViewData);if(t.selectionModule){if("Cell"!==t.selectionSettings.mode&&-1!==t.selectedRowIndex){var r=t.currentViewData[t.selectedRowIndex],n=(this.parent.ganttChartModule.focusedRowIndex,i.indexOf(r)),a="downArrow"===e.action?i[n+1]:i[n-1];t.selectionModule.selectRow(t.currentViewData.indexOf(a),!1,!0)}else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var s=t.selectionModule.getSelectedRowCellIndexes(),o=s[s.length-1],l=o.cellIndexes[o.cellIndexes.length-1],r=t.currentViewData[o.rowIndex],n=i.indexOf(r),a="downArrow"===e.action?i[n+1]:i[n-1],d={rowIndex:t.currentViewData.indexOf(a),cellIndex:l};t.selectionModule.selectCell(d)}this.parent.ganttChartModule.focusedRowIndex=this.parent.selectedRowIndex}},e.prototype.expandCollapseKey=function(e){var t=this.parent;if(t.selectionModule&&-1!==t.selectedRowIndex){var i=void 0;if("Cell"!==t.selectionSettings.mode)i=t.selectedRowIndex;else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var r=t.selectionModule.getSelectedRowCellIndexes();i=r[r.length-1].rowIndex}"expandRow"===e.action?t.expandByIndex(i):t.collapseByIndex(i)}},e}(),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 n(i,r){var n=e.call(this,i,r)||this;return n.showIndicator=!0,n.singleTier=0,n.isLocaleChanged=!1,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.isFromRenderBaseline=!1,n.isGanttChartRendered=!1,n.isEdit=!1,t.setValue("mergePersistData",n.mergePersistGanttData,n),n}return at(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 Y(this),this.timelineModule=new Q(this),this.chartRowsModule=new $e(this),this.treeGridModule=new J(this),this.dateValidationModule=new R(this),this.predecessorModule=new et(this),this.connectorLineModule=new tt(this),this.splitterModule=new it(this),this.tooltipModule=new rt(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 nt(this),0===this.zoomingLevels.length&&(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(){return t.isNullOrUndefined(this.dateFormat)?this.globalize.getDatePattern({skeleton:"yMd"}):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),this.isVue&&(this.treeGrid.isVue=!0,this.treeGrid.grid.isVue=!0,this.treeGrid.vueInstance=this.vueInstance,this.treeGrid.grid.vueInstance=this.vueInstance),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),t.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow(),this.dataOperation.checkDataBinding()},n.prototype.hideMaskRow=function(){var e=this.element.querySelectorAll(".e-masked-table").length;if(!t.isNullOrUndefined(this.contentMaskTable)&&(0!=e||this.contentMaskTable)){i=this.contentMaskTable;t.remove(i),this.contentMaskTable=null}if(e=this.element.querySelectorAll(".e-masked-table").length,!t.isNullOrUndefined(this.headerMaskTable)&&(0!=e||this.headerMaskTable)){var i=this.headerMaskTable;t.remove(i),this.headerMaskTable=null}for(;0!=this.element.querySelectorAll(".e-table-background").length;)this.element.querySelectorAll(".e-table-background")[0].remove();for(;0!=this.element.querySelectorAll(".e-temp-timeline").length;)this.element.querySelectorAll(".e-temp-timeline")[0].remove();if(0!=this.element.querySelectorAll(".e-timeline-header-table-container").length)for(var r=0;r<this.singleTier;r++)t.isNullOrUndefined(this.element.querySelectorAll(".e-timeline-header-table-container")[parseInt(r.toString(),10)])||(this.element.querySelectorAll(".e-timeline-header-table-container")[parseInt(r.toString(),10)].style.visibility="visible");t.isNullOrUndefined(this.element.querySelector(".e-timeline-header-container"))||(this.element.querySelector(".e-timeline-header-container").style.position="relative"),t.isNullOrUndefined(this.element.getElementsByClassName("e-chart-rows-container")[0])||(this.element.getElementsByClassName("e-chart-rows-container")[0].style.visibility="visible")},n.prototype.showMaskRow=function(){var e=this.chartPane.childNodes[0].childNodes[0];this.scrollLeftValue=this.chartPane.childNodes[0].childNodes[0].scrollLeft;var t=this.chartPane.childNodes[0].childNodes[1];if(this.treeGrid.element&&this.ganttChartModule.setVirtualHeight(),!this.contentMaskTable){if(t){r=t;if(this.renderBackGround(r),0!=this.element.querySelectorAll(".e-timeline-header-table-container").length){this.singleTier=this.timelineModule.isSingleTier?1:2;for(var i=0;i<this.singleTier;i++)this.element.querySelectorAll(".e-timeline-header-table-container")[parseInt(i.toString(),10)].style.visibility="hidden"}0===this.singleTier&&(this.singleTier=2),this.element.getElementsByClassName("e-chart-rows-container")[0].style.visibility="hidden",this.contentMaskTable=this.contentMaskTable=this.createMaskTable(r)}if(e){this.element.querySelector(".e-timeline-header-container").style.position="static";var r=e;this.renderHeaderBackground(r),this.headerMaskTable=this.headerMaskTable=this.createMaskTable(r)}}},n.prototype.renderHeaderBackground=function(e){var i=e,r=e.getBoundingClientRect().height;if(!!t.closest(i,".e-timeline-header-container")){for(var n=this.createElement("div",{className:"e-table-background"}),a=(this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+r+"px;"}}),0),s=Math.round(e.getBoundingClientRect().width),o=0;o<3;o++)this.enableRtl?n.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(s-=160)+"px; top:0px;"}})):n.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(a+=160)+"px; top:0px;"}}));i.insertBefore(n,i.firstChild)}},n.prototype.renderBackGround=function(e){var i=e,r=e.getBoundingClientRect().height;if(!!t.closest(i,".e-chart-root-container")){for(var n=this.createElement("div",{className:"e-table-background"}),a=(this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+r+"px;"}}),0),s=Math.round(e.getBoundingClientRect().width),o=0;o<3;o++)this.enableRtl?n.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(s-=160)+"px;z-index:1;"}})):n.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(a+=160)+"px;z-index:1;"}}));i.insertBefore(n,i.firstChild)}},n.prototype.createMaskTable=function(e){var i,r=e,n=e.getBoundingClientRect().height,a=!!t.closest(r,".e-timeline-header-container");if(a?((i=this.createEmptyTimeLineTable(n)).style.position="sticky",i.style.left="0px",this.enableRtl&&i.style.removeProperty("left")):((i=this.createEmptyMaskTable(n)).style.position="absolute",i.style.zIndex=1),a){i.style.height=e.getBoundingClientRect().height+"px";var s=this.createElement("div",{className:"e-temp-timeline"});s.style.width="614px",s.style.position="sticky",this.enableRtl?s.style["margin-right"]=Math.abs(this.scrollLeftValue)+"px":s.style["margin-left"]=this.scrollLeftValue+"px",s.appendChild(i),r.insertBefore(s,r.firstChild)}else i.style.height=e.getBoundingClientRect().height+"px",r.insertBefore(i,r.firstChild);return i},n.prototype.createEmptyTimeLineTable=function(e){for(var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),r=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/2+"px;"}}),a=0;a<this.singleTier;a++)r.push(n.cloneNode(!0));this.topBottomHeader=0;for(a=0;a<r.length;a++)i.appendChild(this.applyTimelineMaskRow(r[parseInt(a.toString(),10)])),this.topBottomHeader=this.topBottomHeader+1;return t.appendChild(i),t.style.width="100%",t},n.prototype.applyTimelineMaskRow=function(e){var t=e;t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(r=0;r<t.childNodes.length-1;r++)t.childNodes[parseInt(r.toString(),10)].style.width="166px";for(var i=[].slice.call(t.childNodes),r=0;r<i.length;r++){var n=i[parseInt(r.toString(),10)];switch(this.topBottomHeader){case 0:this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>',n.children[0].style.left="-20px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>';break;case 1:n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),n.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(var a=[].slice.call(n.childNodes),s=0;s<a.length;s++){var o=a[parseInt(s.toString(),10)];0===s?this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>',o.children[0].style.left="-14px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>':1===s?this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>',o.children[0].style.left="-30px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>':this.enableRtl?(o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>',o.children[0].style.left="-60px"):o.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>'}}}return t},n.prototype.createEmptyMaskTable=function(e){var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),r=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/7+"px;"}});this.columnLoop=0;for(var a=0;a<6;a++)r.push(n.cloneNode(!0));for(var s=0;s<r.length;s++)this.columnLoop<4?this.columnLoop=this.columnLoop+1:4===this.columnLoop&&(this.columnLoop=1),i.appendChild(this.applyMaskRow(r[parseInt(s.toString(),10)]));t.appendChild(i),t.style.width="100%";var o=this.createElement("div",{className:"e-temp-container"});return o.style.width="calc(100% - 17px)",o.style.overflow="hidden",o.appendChild(t),o},n.prototype.applyMaskRow=function(e){var t=e;this.columnLoop<4?(t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"})),t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}))):t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}));for(var i=[].slice.call(t.childNodes),r=0;r<i.length;r++){var n=i[parseInt(r.toString(),10)];switch(this.columnLoop){case 1:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>',n.children[0].style.left="-14px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>':n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell02"></span>';break;case 2:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>',n.children[0].style.left="-14px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>':n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell04"></span>';break;case 3:0===r?this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>',n.children[0].style.left="-64px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>':this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>',n.children[0].style.left="-192px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>';break;case 4:this.enableRtl?(n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>',n.children[0].style.left="-388px"):n.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>'}}return t},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(e&&(this.isFromOnPropertyChange=e),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors(),this.isInPredecessorValidation&&this.enableValidation&&this.autoCalculateDateScheduling&&this.predecessorModule.updatedRecordsDateByPredecessor()),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp()),e)if(this.enableValidation&&this.dataOperation.updateGanttData(),this.allowParentDependency&&this.predecessorModule.updateParentPredecessor(),this.dataSource instanceof Object&&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.allowParentDependency&&this.predecessorModule.updateParentPredecessor(),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.removeCriticalPathStyles=function(){var e=this.ganttChartModule.chartElement;t.removeClass(e.querySelectorAll(".e-gantt-child-taskbar-inner-div"),"e-gantt-child-critical-taskbar-inner-div"),t.removeClass(e.querySelectorAll(".e-gantt-child-progressbar-inner-div"),"e-gantt-child-critical-progressbar-inner-div"),t.removeClass(e.querySelectorAll(".e-milestone-top"),"e-critical-milestone-top"),t.removeClass(e.querySelectorAll(".e-milestone-bottom"),"e-critical-milestone-bottom"),t.removeClass(this.element.querySelectorAll(".e-line"),"e-criticalconnector-line"),t.removeClass(this.element.querySelectorAll(".e-connector-line-right-arrow"),"e-criticalconnector-line-right-arrow"),t.removeClass(this.element.querySelectorAll(".e-connector-line-left-arrow"),"e-criticalconnector-line-left-arrow")},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.allowTaskbarOverlap||"ResourceView"!==this.viewType||this.isLoad)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);return!!t.isNullOrUndefined(i)||!1!==i.expanded&&(!i.parentItem||!1!==this.getParentTask(i.parentItem).expanded&&this.getExpandStatus(this.getParentTask(i.parentItem)))},n.prototype.getExpandedRecords=function(e){var i=this;return t.isNullOrUndefined(e)?[]:e.filter(function(e){return!0===i.getExpandStatus(e)})},n.prototype.getZoomingLevels=function(){var e=this.timelineSettings.weekStartDay;return[{topTier:{unit:"Year",format:"yyyy",count:50},bottomTier:{unit:"Year",format:"yyyy",count:10},timelineUnitSize:99,level:0,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:20},bottomTier:{unit:"Year",format:"yyyy",count:5},timelineUnitSize:99,level:1,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:5},bottomTier:{unit:"Year",format:"yyyy",count:1},timelineUnitSize:99,level:2,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:66,level:3,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:99,level:4,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:66,level:5,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:99,level:6,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",format:"MMM yyyy",count:1},timelineUnitSize:99,level:7,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yy",count:1},bottomTier:{unit:"Week",format:"dd",count:1},timelineUnitSize:33,level:8,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:66,level:9,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:99,level:10,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:33,level:11,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:66,level:12,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:99,level:13,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:66,level:14,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:99,level:15,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:66,level:16,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:99,level:17,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:66,level:18,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:99,level:19,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:66,level:20,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:99,level:21,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:30},timelineUnitSize:66,level:22,timelineViewMode:"Hour",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:15},timelineUnitSize:66,level:23,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:1},timelineUnitSize:66,level:24,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0}]},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(),t.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),t.setValue("isGanttCreated",!0,e),this.renderComplete()}}else this.getCurrentRecords(e);this.enableCriticalPath&&this.criticalPathModule&&this.criticalPathModule.showCriticalPath(this.enableCriticalPath),this.notify("recordsUpdated",{});for(var r=0;r<document.getElementsByClassName("e-timeline-header-table-container").length;r++)for(var n=0;n<document.getElementsByClassName("e-timeline-header-table-container")[r].children[0].children[0].children.length;n++)document.getElementsByClassName("e-timeline-header-table-container")[r].children[0].children[0].children[n].children[0].setAttribute("tabindex","-1");if(this.enableCriticalPath&&this.criticalPathModule){var a=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(a.criticalPathCollection,a.detailPredecessorCollection,!0,a.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":this.dataOperation.checkDataBinding(!0);break;case"enableCriticalPath":if(t.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),this.enableCriticalPath&&this.criticalPathModule){this.criticalPathModule.showCriticalPath(this.enableCriticalPath);var l=this.criticalPathModule;this.criticalPathModule.criticalConnectorLine(l.criticalPathCollection,l.detailPredecessorCollection,!0,l.predecessorCollectionTaskIds)}else this.removeCriticalPathStyles();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.isFromRenderBaseline=!0,this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isFromRenderBaseline=!1;break;case"resourceIDMapping":case"resourceNameMapping":case"resources":this.dataOperation.reUpdateResources(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"includeWeekend":case"allowUnscheduledTasks":case"holidays":this.isLoad=!0,"holidays"===o&&(this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.notify("ui-update",{module:"day-markers",properties:e})),this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1;break;case"dayWorkingTime":this.isLoad=!0,this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1;break;case"addDialogFields":case"editDialogFields":this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.processDialogFields();break;case"columns":this.treeGridModule.treeGridColumns=[],this.treeGridModule.validateGanttColumns(),this.treeGrid.columns=this.treeGridModule.treeGridColumns,this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline();break;case"width":case"height":this.reUpdateDimention();break;case"editSettings":this.treeGrid.editSettings.allowAdding=this.editSettings.allowAdding,this.treeGrid.editSettings.allowDeleting=this.editSettings.allowDeleting,this.treeGrid.editSettings.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,this.treeGrid.editSettings.allowEditing=this.editSettings.allowEditing,this.treeGrid.editSettings.allowNextRowEdit=this.editSettings.allowNextRowEdit,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 d=t.getValue("count",this.dataSource);this.treeGrid.dataSource={result:this.flatData,count:d}}else this.treeGrid.hasChildMapping=null;this.dataOperation.checkDataBinding(!0);break;case"enableContextMenu":case"contextMenuItems":this.enableContextMenu||"contextMenuItems"===o?this.notify("reRender-contextMenu",{module:"contextMenu",enable:this.contextMenuItems}):this.treeGrid.contextMenuItems=[],this.treeGrid.dataBind();break;case"currencyCode":case"locale":case"enableRtl":case"readOnly":case"viewType":case"taskFields":case"allowTaskbarDragAndDrop":case"allowTaskbarOverlap":case"allowParentDependency":"locale"===o&&(this.isLocaleChanged=!0),n=!0;break;case"validateManualTasksOnLinking":this.validateManualTasksOnLinking=e.validateManualTasksOnLinking;break;case"showOverAllocation":this.updateOverAllocationCotainer()}}n&&(this.isLoad&&this.contentMaskTable&&(this.contentMaskTable=null),this.refresh())},n.prototype.updateOverAllocationCotainer=function(){if(this.showOverAllocation&&"ResourceView"===this.viewType)this.ganttChartModule.renderOverAllocationContainer();else{var e=this.element.querySelector("."+z);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=["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],n=0;n<e.length;n++)for(var a=this[e[n]],s=0,o=i[e[n]];!t.isNullOrUndefined(o)&&s<o.length;s++)delete a[o[s]];return this.ignoreInArrays(r,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||this.allowTaskbarDragAndDrop)&&e.push({member:"rowDragAndDrop",args:[this]}),this.enableCriticalPath&&e.push({member:"criticalPath",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),this.toolbar&&this.toolbar.length>0&&e.push({member:"toolbar",args:[this]}),(this.editSettings.allowAdding||this.editSettings.allowEditing||this.editSettings.allowDeleting||this.editSettings.allowTaskbarEditing||this.allowRowDragAndDrop)&&e.push({member:"edit",args:[this]}),this.allowSelection&&e.push({member:"selection",args:[this]}),this.tooltipSettings.showTooltip&&e.push({member:"tooltip",args:[this]}),(this.highlightWeekends||this.holidays&&this.holidays.length>0||this.eventMarkers&&this.eventMarkers.length>0)&&e.push({member:"dayMarkers",args:[this]}),this.enableContextMenu&&e.push({member:"contextMenu",args:[this]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this]}),this.allowPdfExport&&e.push({member:"pdfExport",args:[this]}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this]}),e)},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(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(var 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:(this.enableRtl?"right:"+(a+1):"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),t.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow()},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,this.enableRtl?-1:0)),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,r){return this.pdfExportModule?this.pdfExportModule.export(e,t,i,r):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.autoCalculateDateScheduling)?[]: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())&&(this.autoCalculateDateScheduling?e.isDisabled=!0:e.isDisabled=!1)}},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(i=t.isUndefined(i)?null:i,this.isOnEdit||this.isOnDelete){this.makeCloneData(e,r,n);var a=n?r:r.ganttProperties,s=a.rowUniqueID,o=this.getRecordByID(s),l=!1;(t.isNullOrUndefined(i)||!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(r[""+e])&&(i instanceof Date?i.getTime()!==r[""+e].getTime():r[""+e]!==i))&&(l=!0),o&&(-1===this.editedRecords.indexOf(o)&&l||0===this.editedRecords.length)&&(this.editModule.draggedRecord&&this.editModule.draggedRecord.ganttProperties.taskId===a.taskId?this.editedRecords.splice(0,0,o):this.editedRecords.push(o),this.enableImmutableMode&&this.modifiedRecords.push(o))}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])){var l={};this.previousRecords[i.uniqueID]=l}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),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){r=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(r)}else for(var t=0;t<e.length;t++)if("number"==typeof e[t]){var i=e[t],r=this.contructExpandCollapseArgs(null,i);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(r)}},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=void 0;t.isNullOrUndefined(e)||(n=e[this.taskFields.resourceInfo]);var 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;return t.isNullOrUndefined(i)?(n=this.getRecordByID(e.toString()),r=this.getRowByID(e),t.isNullOrUndefined(r)||(a=t.getValue("rowIndex",r))):t.isNullOrUndefined(i)||(r=this.getRowByIndex(i),a=t.getValue("rowIndex",r),n=this.currentViewData[a]),{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)?" e-gantt-unscheduled-task":t.isNullOrUndefined(e.startDate)||t.isNullOrUndefined(e.endDate)||t.isNullOrUndefined(e.duration)?" e-gantt-unscheduled-task":""},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=this.enableRtl?t.right+r-a:t.left+r-a;return{top:Math.round(s),left:Math.round(o),width:t.width,height:t.height}},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),this.updateTreeColumns()},n.prototype.hideColumn=function(e,t){this.treeGrid.hideColumns(e,t),this.updateTreeColumns()},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()},st([t.Property(!0)],n.prototype,"allowKeyboard",void 0),st([t.Property(!1)],n.prototype,"enableImmutableMode",void 0),st([t.Property(!0)],n.prototype,"allowParentDependency",void 0),st([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),st([t.Property(!0)],n.prototype,"disableHtmlEncode",void 0),st([t.Complex({},Ke)],n.prototype,"loadingIndicator",void 0),st([t.Property(!0)],n.prototype,"enableVirtualMaskRow",void 0),st([t.Property(!0)],n.prototype,"UpdateOffsetOnTaskbarEdit",void 0),st([t.Property(!0)],n.prototype,"autoCalculateDateScheduling",void 0),st([t.Property(!0)],n.prototype,"autoFocusTasks",void 0),st([t.Property(!0)],n.prototype,"allowSelection",void 0),st([t.Property(!1)],n.prototype,"allowSorting",void 0),st([t.Property(!0)],n.prototype,"enablePredecessorValidation",void 0),st([t.Property(!1)],n.prototype,"showColumnMenu",void 0),st([t.Property()],n.prototype,"columnMenuItems",void 0),st([t.Property()],n.prototype,"timezone",void 0),st([t.Property(!1)],n.prototype,"collapseAllParentTasks",void 0),st([t.Property(!1)],n.prototype,"highlightWeekends",void 0),st([t.Property(0)],n.prototype,"treeColumnIndex",void 0),st([t.Property([])],n.prototype,"dataSource",void 0),st([t.Property("day")],n.prototype,"durationUnit",void 0),st([t.Property(null)],n.prototype,"query",void 0),st([t.Property(null)],n.prototype,"dateFormat",void 0),st([t.Property("auto")],n.prototype,"height",void 0),st([t.Property(!1)],n.prototype,"renderBaseline",void 0),st([t.Property(!1)],n.prototype,"allowTaskbarDragAndDrop",void 0),st([t.Property(!0)],n.prototype,"allowTaskbarOverlap",void 0),st([t.Property("Horizontal")],n.prototype,"gridLines",void 0),st([t.Complex({},Pe)],n.prototype,"labelSettings",void 0),st([t.Property(null)],n.prototype,"taskbarTemplate",void 0),st([t.Property(null)],n.prototype,"parentTaskbarTemplate",void 0),st([t.Property(null)],n.prototype,"milestoneTemplate",void 0),st([t.Property()],n.prototype,"baselineColor",void 0),st([t.Property("auto")],n.prototype,"width",void 0),st([t.Property(!1)],n.prototype,"enableVirtualization",void 0),st([t.Property()],n.prototype,"toolbar",void 0),st([t.Property(["Monday","Tuesday","Wednesday","Thursday","Friday"])],n.prototype,"workWeek",void 0),st([t.Property(!1)],n.prototype,"includeWeekend",void 0),st([t.Property(!1)],n.prototype,"allowUnscheduledTasks",void 0),st([t.Property(!1)],n.prototype,"showInlineNotes",void 0),st([t.Property(36)],n.prototype,"rowHeight",void 0),st([t.Property(null)],n.prototype,"taskbarHeight",void 0),st([t.Property(null)],n.prototype,"projectStartDate",void 0),st([t.Property(null)],n.prototype,"projectEndDate",void 0),st([t.Property(null)],n.prototype,"resourceIDMapping",void 0),st([t.Property(null)],n.prototype,"resourceNameMapping",void 0),st([t.Property([])],n.prototype,"resources",void 0),st([t.Property([])],n.prototype,"segmentData",void 0),st([t.Property(null)],n.prototype,"connectorLineBackground",void 0),st([t.Property(1)],n.prototype,"connectorLineWidth",void 0),st([t.Property([])],n.prototype,"columns",void 0),st([t.Property([])],n.prototype,"addDialogFields",void 0),st([t.Property([])],n.prototype,"editDialogFields",void 0),st([t.Property(-1)],n.prototype,"selectedRowIndex",void 0),st([t.Property("hour")],n.prototype,"workUnit",void 0),st([t.Property("FixedUnit")],n.prototype,"taskType",void 0),st([t.Property("ProjectView")],n.prototype,"viewType",void 0),st([t.Collection([{from:8,to:12},{from:13,to:17}],te)],n.prototype,"dayWorkingTime",void 0),st([t.Collection([],be)],n.prototype,"holidays",void 0),st([t.Collection([],ue)],n.prototype,"eventMarkers",void 0),st([t.Complex({},Fe)],n.prototype,"taskFields",void 0),st([t.Complex({},Ye)],n.prototype,"resourceFields",void 0),st([t.Complex({},Be)],n.prototype,"timelineSettings",void 0),st([t.Property([])],n.prototype,"zoomingLevels",void 0),st([t.Complex({},ze)],n.prototype,"sortSettings",void 0),st([t.Complex({},pe)],n.prototype,"editSettings",void 0),st([t.Complex({},We)],n.prototype,"tooltipSettings",void 0),st([t.Complex({},Me)],n.prototype,"selectionSettings",void 0),st([t.Property(!1)],n.prototype,"allowFiltering",void 0),st([t.Property(!1)],n.prototype,"allowExcelExport",void 0),st([t.Property(!1)],n.prototype,"allowRowDragAndDrop",void 0),st([t.Property(!1)],n.prototype,"allowReordering",void 0),st([t.Property(!1)],n.prototype,"readOnly",void 0),st([t.Property(!1)],n.prototype,"allowResizing",void 0),st([t.Property(!1)],n.prototype,"enableContextMenu",void 0),st([t.Property(!1)],n.prototype,"enableCriticalPath",void 0),st([t.Property()],n.prototype,"contextMenuItems",void 0),st([t.Property(!1)],n.prototype,"allowPdfExport",void 0),st([t.Property(!1)],n.prototype,"validateManualTasksOnLinking",void 0),st([t.Property(!1)],n.prototype,"enableMultiTaskbar",void 0),st([t.Property(!1)],n.prototype,"showOverAllocation",void 0),st([t.Property("Auto")],n.prototype,"taskMode",void 0),st([t.Complex({},me)],n.prototype,"filterSettings",void 0),st([t.Complex({},De)],n.prototype,"searchSettings",void 0),st([t.Complex({},Ie)],n.prototype,"splitterSettings",void 0),st([t.Event()],n.prototype,"queryTaskbarInfo",void 0),st([t.Event()],n.prototype,"beforeExcelExport",void 0),st([t.Event()],n.prototype,"excelExportComplete",void 0),st([t.Event()],n.prototype,"excelQueryCellInfo",void 0),st([t.Event()],n.prototype,"excelHeaderQueryCellInfo",void 0),st([t.Event()],n.prototype,"rowDrag",void 0),st([t.Event()],n.prototype,"rowDragStart",void 0),st([t.Event()],n.prototype,"rowDragStartHelper",void 0),st([t.Event()],n.prototype,"rowDrop",void 0),st([t.Event()],n.prototype,"collapsing",void 0),st([t.Event()],n.prototype,"collapsed",void 0),st([t.Event()],n.prototype,"expanding",void 0),st([t.Event()],n.prototype,"expanded",void 0),st([t.Event()],n.prototype,"actionBegin",void 0),st([t.Event()],n.prototype,"actionComplete",void 0),st([t.Event()],n.prototype,"actionFailure",void 0),st([t.Event()],n.prototype,"dataStateChange",void 0),st([t.Event()],n.prototype,"taskbarEdited",void 0),st([t.Event()],n.prototype,"endEdit",void 0),st([t.Event()],n.prototype,"cellEdit",void 0),st([t.Event()],n.prototype,"load",void 0),st([t.Event()],n.prototype,"created",void 0),st([t.Event()],n.prototype,"destroyed",void 0),st([t.Event()],n.prototype,"taskbarEditing",void 0),st([t.Event()],n.prototype,"dataBound",void 0),st([t.Event()],n.prototype,"resizeStart",void 0),st([t.Event()],n.prototype,"resizing",void 0),st([t.Event()],n.prototype,"resizeStop",void 0),st([t.Event()],n.prototype,"splitterResizeStart",void 0),st([t.Event()],n.prototype,"splitterResizing",void 0),st([t.Event()],n.prototype,"splitterResized",void 0),st([t.Event()],n.prototype,"columnDragStart",void 0),st([t.Event()],n.prototype,"columnDrag",void 0),st([t.Event()],n.prototype,"columnDrop",void 0),st([t.Event()],n.prototype,"beforeTooltipRender",void 0),st([t.Event()],n.prototype,"rowSelecting",void 0),st([t.Event()],n.prototype,"rowSelected",void 0),st([t.Event()],n.prototype,"rowDeselecting",void 0),st([t.Event()],n.prototype,"rowDeselected",void 0),st([t.Event()],n.prototype,"cellSelecting",void 0),st([t.Event()],n.prototype,"cellSelected",void 0),st([t.Event()],n.prototype,"cellDeselecting",void 0),st([t.Event()],n.prototype,"cellDeselected",void 0),st([t.Event()],n.prototype,"queryCellInfo",void 0),st([t.Event()],n.prototype,"headerCellInfo",void 0),st([t.Event()],n.prototype,"rowDataBound",void 0),st([t.Event()],n.prototype,"columnMenuOpen",void 0),st([t.Event()],n.prototype,"toolbarClick",void 0),st([t.Event()],n.prototype,"columnMenuClick",void 0),st([t.Event()],n.prototype,"contextMenuOpen",void 0),st([t.Event()],n.prototype,"contextMenuClick",void 0),st([t.Event()],n.prototype,"onTaskbarClick",void 0),st([t.Event()],n.prototype,"recordDoubleClick",void 0),st([t.Event()],n.prototype,"onMouseMove",void 0),st([t.Event()],n.prototype,"beforePdfExport",void 0),st([t.Event()],n.prototype,"pdfExportComplete",void 0),st([t.Event()],n.prototype,"pdfQueryCellInfo",void 0),st([t.Event()],n.prototype,"pdfQueryTaskbarInfo",void 0),st([t.Event()],n.prototype,"pdfQueryTimelineCellInfo",void 0),st([t.Event()],n.prototype,"pdfColumnHeaderQueryCellInfo",void 0),n=st([t.NotifyPropertyChanges],n)}(t.Component);!function(e){e[e.NextPage=0]="NextPage",e[e.LastPage=1]="LastPage"}(e.PdfHorizontalOverflowType||(e.PdfHorizontalOverflowType={}));var lt=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)return void(e.cancel=!0);if("Dialog"===this.parent.editSettings.mode)return void(e.cancel=!0);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}(a===s.dependency&&!this.parent.allowParentDependency||a!==s.dependency)&&(e.cancel=!0)},e.prototype.openNotesEditor=function(e){var t=this.parent.taskFields,i=e.rowData,r=e.columnName;if(r===t.notes&&!this.parent.showInlineNotes){e.cancel=!0;var n=this.parent.editModule.dialogModule.updatedEditFields.map(function(e){return e.type}).indexOf("Notes");-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.editModule.cellEditModule.editedColumn)||(this.parent.editModule.cellEditModule.editedColumn=null),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[parseInt(n.toString(),10)],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=0;c<s;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[parseInt(l.toString(),10)])}(c);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}(),dt=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",enableRtl:this.parent.enableRtl,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("."+q)):"ConnectorPointRightDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector(".e-connectorpoint-right")):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.parent.enableRtl?this.toolTipObj.offsetX=0:this.toolTipObj.offsetX=-r:"RightResizing"===this.taskbarEdit.taskBarEditAction||"ParentResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-r:this.toolTipObj.offsetX=0:"ProgressResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-n: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}(),pt=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(){return(ht=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)},ct=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.currentItemTop=0,i.currentItemPrevTop=0,i.topValue=0,i.draggedRecordMarginTop=0,i.parent=t,i.initPublicProp(),i.wireEvents(),i.editTooltip=new dt(i.parent,i),i}return pt(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,N);!i||i.innerHTML!==this.taskBarEditElement.innerHTML||t.classList.contains(q)||t.classList.contains("e-connectorpoint-right")||this.tapPointOnFocus||(this.updateTaskBarEditElement(e),this.canDrag=!0,e.preventDefault())}else this.parent.isAdaptive||this.updateTaskBarEditElement(e)},i.prototype.mouseClickHandler=function(e){if(this.parent.editSettings.allowTaskbarEditing){var t=this.getElementByPosition(e),i=g(t,N);if(this.parent.selectionModule&&this.parent.selectionModule.enableSelectMultiTouch)return void(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("e-connectorpoint-left-hover")||t.classList.contains("e-connectorpoint-right-hover")?(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],["e-active-child-task"]),t.addClass([o],["e-predecessor-touch-mode"])):(t.removeClass([this.taskBarEditElement],["e-active-child-task"]),t.removeClass([o],["e-predecessor-touch-mode"])),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("."+N),o=this.parent.element.querySelector("#ConnectorLineparent"+e+"child"+i);r?(t.addClass([s],["e-active-connected-task"]),o&&t.addClass([o],["e-active-connected-task"])):(t.removeClass([s],["e-active-connected-task"]),o&&t.removeClass([o],["e-active-connected-task"]))}},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("e-gantt-manualparenttaskbar-right")||r.classList.contains("e-manualparent-main-container")||r.classList.contains(H))i=g(r,"e-manualparent-main-container");else if(r.classList.contains("e-manualparent-milestone-top")||r.classList.contains("e-manualparent-milestone-bottom")||r.classList.contains("e-gantt-manualparent-milestone"))i=g(r,"e-gantt-manualparent-milestone");else if(i=g(r,N),!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,"e-gantt-child-taskbar-inner-div"))}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",this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")&&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(".e-taskbar-left-resizer")?(t.addClass([e.querySelector(".e-taskbar-left-resizer")],["e-left-resize-gripper"]),t.addClass([e.querySelector(".e-taskbar-right-resizer")],["e-right-resize-gripper"]),n&&!t.isNullOrUndefined(e.querySelector("."+B))&&t.addClass([e.querySelector("."+B)],["e-progress-resize-gripper"])):this.parent.isAdaptive&&n&&(s=this.parent.ganttChartModule.getRecordByTaskBar(e)).hasChildRecords&&t.addClass([e],["e-active-parent-task"]),t.addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll(".e-connector-line-container"),["e-connector-line-z-index"]),!t.isNullOrUndefined(this.parent.taskFields.dependency)&&(e.querySelector("."+q)||e.parentElement.querySelector("."+q))&&a){l=t.isNullOrUndefined(e.querySelector("."+q))?e.parentElement:e;t.addClass([l.querySelector("."+q)],["e-connectorpoint-left-hover"]),t.addClass([l.querySelector(".e-connectorpoint-right")],["e-connectorpoint-right-hover"])}}else r||t.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll(".e-connector-line-container"),["e-connector-line-z-index"]);if(i&&e!==i){if(i.querySelector(".e-taskbar-left-resizer")&&(t.removeClass([i.querySelector(".e-taskbar-left-resizer")],["e-left-resize-gripper"]),t.removeClass([i.querySelector(".e-taskbar-right-resizer")],["e-right-resize-gripper"]),i.querySelector("."+B)&&t.removeClass([i.querySelector("."+B)],["e-progress-resize-gripper"])),t.isNullOrUndefined(this.parent.taskFields.dependency)||!i.querySelector("."+q)&&!i.parentElement.querySelector("."+q))this.parent.isAdaptive&&(s=this.parent.ganttChartModule.getRecordByTaskBar(i))&&s.hasChildRecords&&t.removeClass([i],["e-active-parent-task"]);else{var l=t.isNullOrUndefined(i.querySelector("."+q))?i.parentElement:i;t.removeClass([l.querySelector("."+q)],["e-connectorpoint-left-hover"]),t.removeClass([l.querySelector(".e-connectorpoint-right")],["e-connectorpoint-right-hover"])}this.editElement=null}}},i.prototype.getTaskBarAction=function(e){var i=this.getElementByPosition(e),r=this.taskBarEditRecord,n="";return i.classList.contains("e-taskbar-left-resizer")?n="LeftResizing":i.classList.contains("e-taskbar-right-resizer")?n="RightResizing":(i.classList.contains(B)||t.closest(i,"."+B))&&this.parent.taskFields.progress?n="ProgressResizing":i.classList.contains(q)?n="ConnectorPointLeftDrag":i.classList.contains("e-connectorpoint-right")?n="ConnectorPointRightDrag":i.classList.contains("e-gantt-manualparenttaskbar-right")?n="ParentResizing":i.classList.contains(H)||i.classList.contains("e-manualparent-main-container")||i.classList.contains("e-gantt-manualparent-milestone")||i.classList.contains("e-manualparent-milestone-top")||i.classList.contains("e-manualparent-milestone-bottom")||i.classList.contains("e-gantt-manualparent-milestone")?n="ManualParentDrag":r&&(n=r.hasChildRecords?"Auto"===this.parent.taskMode?"ParentDrag":"":r.ganttProperties.isMilestone?"MilestoneDrag":"ChildDrag"),n},i.prototype.updateMouseDownProperties=function(e){var i=this.getCoordinate(e);if(i.pageX||i.pageY){var r=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.parent.enableRtl?this.mouseDownX=Math.abs(i.pageX-(r.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseDownX=i.pageX-r.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseDownX,this.mouseDownY=this.dragMoveY=i.pageY-r.top+this.parent.ganttChartModule.scrollObject.previousScroll.top}if("ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop){var n=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(n=this.parent.toolbarModule.element.offsetHeight),this.topValue=this.parent.getOffsetRect(e.target).top-this.parent.getOffsetRect(this.parent.element).top-parseInt(t.closest(e.target,".e-taskbar-main-container").style.marginTop)-this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight-n+document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollTop,this.currentItemPrevTop=this.currentItemTop=this.topValue}"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.fromPredecessorText="ConnectorPointLeftDrag"===this.taskBarEditAction?"start":"finish",this.parent.connectorLineModule.tooltipTable.innerHTML=this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName,this.fromPredecessorText,"",""))},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 i=this;if(this.parent.isAdaptive){if(!this.canDrag)return;this.multipleSelectionEnabled()}var r=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),n=this.getCoordinate(e);if(this.parent.enableRtl?this.mouseMoveX=Math.abs(n.pageX-(r.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=n.pageX-r.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.mouseMoveY=n.pageY-r.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.dragMouseLeave=!1,this.isMouseDragCheck(),this.isMouseDragged&&this.taskBarEditAction){var a={cancel:!1,requestType:"taskbarediting",taskBarEditAction:this.taskBarEditAction,data:this.taskBarEditRecord};-1!==this.segmentIndex&&(a.requestType="mergeSegment"),this.parent.trigger("actionBegin",a,function(r){"ConnectorPointRightDrag"!==a.taskBarEditAction&&"ConnectorPointLeftDrag"!==a.taskBarEditAction&&"LeftResizing"!==a.taskBarEditAction&&"RightResizing"!==a.taskBarEditAction&&"ProgressResizing"!==a.taskBarEditAction&&"ChildDrag"!==a.taskBarEditAction&&"ParentDrag"!==a.taskBarEditAction&&"MilestoneDrag"!==a.taskBarEditAction&&"ManualParentDrag"!==a.taskBarEditAction||(i.parent.showIndicator=!1),!t.isNullOrUndefined(i.parent.loadingIndicator)&&"Shimmer"===i.parent.loadingIndicator.indicatorType&&i.parent.showIndicator?i.parent.showMaskRow():i.parent.showIndicator&&i.parent.showSpinner(),!1===r.cancel&&i.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;if(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()),"ResourceView"==this.parent.viewType&&this.parent.allowTaskbarDragAndDrop){this.dragMoveY>this.mouseMoveY?(this.mouseMoveY=this.dragMoveY-this.mouseMoveY,this.currentItemTop=this.currentItemTop-this.mouseMoveY):(this.mouseMoveY-=this.dragMoveY,this.currentItemTop=this.currentItemTop+this.mouseMoveY);var s=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.dragMoveY=e.pageY-s.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.topValue=this.currentItemTop,this.currentItemPrevTop=0===this.currentItemPrevTop||this.topValue==this.currentItemTop?this.topValue:this.currentItemPrevTop}this.setItemPosition(),this.updateEditedItem(),this.editTooltip.updateTooltip(this.segmentIndex),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))}),this.parent.flatData.map(function(e){t.isNullOrUndefined(r.taskBarEditRecord.parentItem)||e.ganttProperties.taskId!==r.taskBarEditRecord.parentItem.taskId||e.childRecords.map(function(e){(t.isNullOrUndefined(e.ganttProperties.startDate)||t.isNullOrUndefined(e.ganttProperties.endDate)||t.isNullOrUndefined(e.ganttProperties.duration))&&r.parent.dataOperation.updateGanttData()})})}},i.prototype.updateMouseMoveProperties=function(e){var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),i=this.getCoordinate(e);(i.pageX||i.pageY)&&(this.parent.enableRtl?this.mouseMoveX=Math.abs(i.pageX-(t.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=i.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseMoveX,this.mouseMoveY=i.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top);var 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=0;n=this.parent.enableRtl?Math.abs(Math.abs(this.mouseMoveX)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left)+t.left):this.mouseMoveX-this.parent.ganttChartModule.scrollObject.previousScroll.left+t.left;var 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+40>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth&&this.parent.enableRtl&&0==this.parent.ganttChartModule.scrollObject.previousScroll.left?(this.parent.ganttChartModule.scrollObject.previousScroll.left=-1,this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):n-20<t.left?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("left")):a+80>t.top+this.parent.ganttChartModule.chartBodyContainer.offsetHeight?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("bottom")):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();var i=0;this.scrollTimer=window.setInterval(function(){-1==Math.sign(t.timerCount)&&(i=-1,t.timerCount=Math.abs(t.timerCount)),t.timerCount="right"===e?t.timerCount+1>=t.parent.timelineModule.totalTimelineWidth?t.parent.timelineModule.totalTimelineWidth:t.timerCount+1:"bottom"===e?t.timerCount+1:t.timerCount-1<0?0:t.timerCount-1,"bottom"===e||"top"===e?t.parent.ganttChartModule.scrollObject.setScrollTop(t.timerCount):t.parent.ganttChartModule.scrollObject.setScrollLeft(t.timerCount,i),"ConnectorPointLeftDrag"!==t.taskBarEditAction&&"ConnectorPointRightDrag"!==t.taskBarEditAction||t.drawFalseLine()},0)},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 ht({},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 ht({},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(d=1;d<e.segments.length;d++){var o=i[d];o.left=o.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(d=1;d<e.segments.length;d++){var l=i[d];l.left=l.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)if(n=t.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,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(var d=1;d<e.segments.length;d++){var p=i[d];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 ht({},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,e.isMilestone,e);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])){s=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!==s||this.parent.includeWeekend||(s=1),i.offsetDuration=s}if(!t.isNullOrUndefined(e.segments[this.segmentIndex+1])){var a=e.segments[this.segmentIndex+1],s=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,a.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);1!==a.startDate.getDay()||0!==s||this.parent.includeWeekend||(s=1),a.offsetDuration=s}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,t.isNullOrUndefined(e)?e.isMilestone:null,e),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,i,r){var n=new Date(this.parent.timelineModule.timelineStartDate.toString()),a=864e5/this.parent.perDayWidth;n.setTime(n.getTime()+e*a),i&&!t.isNullOrUndefined(r.predecessor)&&r.predecessor.length>0&&(n.setDate(n.getDate()-1),this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,n),n=this.parent.dateValidationModule.checkStartDate(n,r,!0));var s="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier;return"Hour"!==s&&"Minutes"!==s&&(this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&!this.parent.isInDst(n)?n.setTime(n.getTime()+36e5):!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&this.parent.isInDst(n)&&n.setTime(n.getTime()-36e5)),n},i.prototype.setItemPosition=function(){var e=this.taskBarEditRecord.ganttProperties,i=this.parent.enableRtl?"right":"left",r=t.isNullOrUndefined(e.segments)?null:e.segments[this.segmentIndex],n="MilestoneDrag"===this.taskBarEditAction||e.isMilestone?this.parent.chartRowsModule.milestoneHeight:e.width,a=this.parent.isAdaptive?n-2:n-10;t.isNullOrUndefined(r)||(a=this.parent.isAdaptive?r.width-2:r.width-10);var s=this.taskBarEditElement.classList.contains(N)?this.taskBarEditElement:t.closest(this.taskBarEditElement,"tr."+L).querySelector("."+N),o=this.taskBarEditElement.classList.contains("e-segmented-taskbar"),l=t.closest(this.taskBarEditElement,"tr."+L).querySelector("."+I),d=t.closest(this.taskBarEditElement,"tr."+L).querySelector("."+E),p=this.taskBarEditElement.querySelector(".e-gantt-child-progressbar"),h=this.taskBarEditElement.querySelector("."+A),c=this.taskBarEditElement.querySelector("."+B),u=this.taskBarEditElement.querySelector(".e-taskbar-right-resizer"),g=this.taskBarEditElement.querySelector(".e-gantt-parent-taskbar"),f=this.taskBarEditElement.querySelector(".e-gantt-parent-progressbar"),m=this.taskBarEditElement.querySelector(".e-right-connectorpoint-outer-div"),y=this.taskBarEditElement,v=this.taskBarEditElement.querySelector("."+H),D=this.taskBarEditElement.querySelector(".e-gantt-manualparenttaskbar-right"),w=this.taskBarEditElement.querySelector(".e-gantt-manualparenttaskbar-left");if("ConnectorPointRightDrag"!==this.taskBarEditAction&&"ConnectorPointLeftDrag"!==this.taskBarEditAction){if("ParentResizing"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction){if(!o||t.isNullOrUndefined(e.segments)||"RightResizing"!==this.taskBarEditAction&&0===this.segmentIndex||(this.taskBarEditElement.style.width=r.width+"px",this.parent.enableRtl?this.taskBarEditElement.style.right=r.left+"px":this.taskBarEditElement.style.left=r.left+"px"),s.style.width=n+"px",l.style.width=e.left+"px",s.style.setProperty(i,e.left+"px"),"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&("ChildDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction)&&(s.style.setProperty("top",this.topValue+"px"),s.style.zIndex="4"),"LeftResizing"===this.taskBarEditAction&&0===this.segmentIndex)for(var k=this.taskBarEditElement.parentElement.getElementsByClassName("e-segmented-taskbar"),b=0;b<e.segments.length;b++){var T=e.segments[b],S=k[b];S.style.width=T.width+"px",this.parent.enableRtl?S.style.right=T.left+"px":S.style.left=T.left+"px"}t.isNullOrUndefined(d)||d.style.setProperty(i,e.left+n+"px")}if(m&&(this.parent.enableRtl?m.style.left=(this.parent.isAdaptive?n+10:n-2)+"px":m.style.left=(this.parent.isAdaptive?n+10:n+2)+"px"),"MilestoneDrag"===this.taskBarEditAction||e.isMilestone)s.style.setProperty(i,e.left-n/2+"px"),l.style.width=e.left-n/2+"px",t.isNullOrUndefined(d)||d.style.setProperty(i,e.left+n/2+"px");else if("ProgressResizing"===this.taskBarEditAction)if(-1===this.segmentIndex){if(h.style.setProperty(i,e.left+e.progressWidth-10+"px"),!t.isNullOrUndefined(p)){p.style.width=e.progressWidth+"px",p.style.borderBottomRightRadius=this.progressBorderRadius+"px",p.style.borderTopRightRadius=this.progressBorderRadius+"px";var P=this.parent.enableRtl?e.progressWidth+8:e.progressWidth-8;c.style.setProperty(i,P+"px")}}else{this.updateSegmentProgress(this.taskBarEditRecord.ganttProperties),p.style.width=e.segments[this.segmentIndex].progressWidth+"px",p.style.borderBottomRightRadius=this.progressBorderRadius+"px",p.style.borderTopRightRadius=this.progressBorderRadius+"px";var C=this.parent.enableRtl?e.segments[this.segmentIndex].progressWidth+8:e.segments[this.segmentIndex].progressWidth-8;c.style.setProperty(i,C+"px")}else"RightResizing"!==this.taskBarEditAction||t.isNullOrUndefined(h)?"ParentDrag"===this.taskBarEditAction?(t.isNullOrUndefined(g)||(g.style.width=n+"px"),t.isNullOrUndefined(p)||(f.style.width=e.progressWidth+"px")):"ParentResizing"===this.taskBarEditAction?(y.style.width=v.style.width=e.width+"px",D.style.setProperty(i,e.width-w.offsetLeft+"px")):"ManualParentDrag"===this.taskBarEditAction?y.style.setProperty(i,e.left-e.autoLeft+"px"):(t.isNullOrUndefined(h)||o||(h.style.width=n+"px"),t.isNullOrUndefined(p)||(u.style.setProperty(i,a+"px"),p.style.width=e.progressWidth+"px",t.isNullOrUndefined(c)||c.style.setProperty(i,e.progressWidth-10+"px")),o&&(u.style.setProperty(i,a+"px"),p.style.width=r.progressWidth+"px",t.isNullOrUndefined(c)||c.style.setProperty(i,r.progressWidth-10+"px"))):(h.style.width=n+"px",t.isNullOrUndefined(p)||(p.style.width=e.progressWidth+"px",u.style.setProperty(i,a+"px"),t.isNullOrUndefined(c)||c.style.setProperty(i,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||"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop)this.taskBarEditedAction(e),this.isMouseDragged=!1;else if(this.parent.isOnEdit=!1,this.cancelTaskbarEditActionInMouseLeave(),this.parent.enableCriticalPath&&this.parent.criticalPathModule){var 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&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)?(this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord,this.finalPredecessor),this.parent.UpdateOffsetOnTaskbarEdit&&this.parent.connectorLineEditModule.calculateOffset(this.connectorSecondRecord)):(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))},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,a=this.parent.currentViewData.indexOf(r);if(("MilestoneDrag"===i.taskBarEditAction||"ChildDrag"===i.taskBarEditAction)&&"ResourceView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&this.dragMoveY>0){if(this.parent.rowDragAndDropModule){var s=this.parent.currentViewData;s[this.taskBarEditRecord.parentItem.index]&&-1===this.parent.editedRecords.indexOf(s[this.taskBarEditRecord.parentItem.index])&&this.parent.editedRecords.push(s[this.taskBarEditRecord.parentItem.index]);for(var o,l=0,d=0,p=void 0,h=this.parent.treeGrid.getRows().length,c=0;c<h;c++)l<this.dragMoveY&&"none"!==this.parent.getRowByIndex(c).style.display&&(d=c,l+=parseInt(this.parent.getRowByIndex(c).style.height),s[c].parentItem?this.parent.getRecordByID(s[c].parentItem.taskId):s[c]);for(var u=this.parent.getRowByIndex(a).getElementsByClassName("e-taskbar-main-container"),g=this.parent.getRowByIndex(d).getElementsByClassName("e-taskbar-main-container"),f=0;f<g.length;f++)g[f].offsetTop<this.dragMoveY&&u[0].getAttribute("rowuniqueid")!==g[f].getAttribute("rowuniqueid")&&(this.draggedRecordMarginTop=g[f].style.marginTop,o=g[f].getAttribute("rowuniqueid"));if(o&&(p=this.parent.currentViewData.filter(function(e){return e.rowUniqueID===o?e:null})),p){var m=this.parent.currentViewData.indexOf(p[0]),y=p[0].hasChildRecords||!p[0].parentItem&&0==p[0].childRecords.length?"child":"below";this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.reorderRows([a],m,y),this.dragMoveY=0}}"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.parent.ganttChartModule.renderOverAllocationContainer()}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 v=i.data.ganttProperties.segments;if(!t.isNullOrUndefined(v)&&v.length>0&&("LeftResizing"===this.taskBarEditAction&&0!==this.segmentIndex||"ChildDrag"===this.taskBarEditAction&&0!==this.segmentIndex||"RightResizing"===this.taskBarEditAction)){var D=v[this.segmentIndex],w=this.taskBarEditRecord.ganttProperties,k=0===this.segmentIndex?null:v[this.segmentIndex-1],b=this.segmentIndex===v.length-1?null:v[this.segmentIndex+1],T=t.isNullOrUndefined(b)?this.parent.cloneProjectEndDate:new Date(b.startDate.getTime()),S=t.isNullOrUndefined(k)?this.parent.cloneProjectStartDate:new Date(k.endDate.getTime()),P=new Date(D.startDate.getTime()),C=new Date(D.endDate.getTime());if("Day"===this.parent.timelineModule.topTier&&"Hour"===this.parent.timelineModule.bottomTier?(P.setHours(P.getHours()-1),C.setHours(C.getHours()+1)):(T.setHours(0,0,0,0),S.setHours(0,0,0,0),P.setDate(P.getDate()-1),C.setDate(C.getDate()+1),P.setHours(0,0,0,0),C.setHours(0,0,0,0)),P.getTime()<=S.getTime()&&!t.isNullOrUndefined(k)&&!t.isNullOrUndefined(D)){R=[{firstSegmentIndex:k.segmentIndex,secondSegmentIndex:D.segmentIndex}];this.parent.chartRowsModule.mergeTask(w.taskId,R)}else if(C.getTime()>=T.getTime()&&this.segmentIndex!==v.length-1){var R=[{firstSegmentIndex:D.segmentIndex,secondSegmentIndex:b.segmentIndex}];this.parent.chartRowsModule.mergeTask(w.taskId,R)}else if(C.getTime()>=T.getTime()){D.endDate.setDate(this.parent.cloneProjectEndDate.getDate()-1),D.startDate=this.parent.dataOperation.getStartDate(D.endDate,D.duration,w.durationUnit,w);for(c=v.length-2;c>=0;c++){var M=v[c],O=M.endDate;O.setDate(O.getDate()-M.offsetDuration),M.endDate=O,M.startDate=this.parent.dataOperation.getStartDate(M.endDate,M.duration,w.durationUnit,w)}}}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=180*Math.atan2(a-r,n-i)/Math.PI,l="rotate("+(this.parent.enableRtl?-o:o)+"deg)",d=0;t.isNullOrUndefined(document.querySelectorAll(".e-chart-row")[0])||(d=document.querySelectorAll(".e-chart-row")[0].offsetWidth),"ConnectorPointLeftDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?d-(this.elementOffsetLeft+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft-this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),"ConnectorPointRightDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?d-(this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left));var p=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:"position: absolute;transform:"+l+";border-top-width: 1px;border-top-style: dashed;z-index: 5;width:"+(s-3)+"px;top:"+p+"px;"}),this.parent.enableRtl?(this.falseLine.style.left="auto",this.falseLine.style.right=e+"px",this.falseLine.style.transformOrigin="100% 0%"):(this.falseLine.style.right="auto",this.falseLine.style.left=e+"px",this.falseLine.style.transformOrigin="0% 100%"),this.parent.ganttChartModule.chartBodyContainer.appendChild(this.falseLine)},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(".e-connector-line-container"),["e-connector-line-z-index"])))},i.prototype.updateConnectorLineSecondProperties=function(e){var i=this.getElementByPosition(e),r=g(i,N);this.connectorSecondAction=null;var n=0;g(i,q)?(this.connectorSecondAction="ConnectorPointLeftDrag",this.toPredecessorText="Start"):g(i,"e-connectorpoint-right")?(this.connectorSecondAction="ConnectorPointRightDrag",this.toPredecessorText="Finish"):(this.connectorSecondAction=null,this.toPredecessorText=null),this.taskBarEditElement!==r&&this.taskBarEditElement!==this.highlightedSecondElement&&(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&(n=this.parent.virtualScrollModule.getTopPosition()),(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&!this.elementOffsetLeft||!this.parent.enableVirtualization)&&(this.parent.allowParentDependency&&this.taskBarEditElement.children[0].classList.contains("e-manualparent-main-container")?(this.elementOffsetLeft=this.taskBarEditElement.children[0].offsetLeft+this.taskBarEditElement.offsetLeft,this.elementOffsetTop=this.taskBarEditElement.offsetTop-5+this.taskBarEditElement.children[0].offsetTop+n):(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.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)&&(this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),t.removeClass([this.connectorSecondElement.querySelector("."+q)],["e-connectorpoint-allow-block"]),t.removeClass([this.connectorSecondElement.querySelector(".e-connectorpoint-right")],["e-connectorpoint-allow-block"])),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+(this.parent.enableRtl?"F":"S"):"ConnectorPointRightDrag"===this.taskBarEditAction&&(r=d+(this.parent.enableRtl?"S":"F")),this.connectorSecondAction&&("ConnectorPointLeftDrag"===this.connectorSecondAction?(r+=this.parent.enableRtl?"F":"S",n=this.parent.enableRtl?"finish":"start"):"ConnectorPointRightDrag"===this.connectorSecondAction&&(r+=this.parent.enableRtl?"S":"F",n=this.parent.enableRtl?"start":"finish")),t.isNullOrUndefined(s))return void(this.drawPredecessor=!1);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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||"ValidateDependency"==c.requestType?"ValidateDependency"!=c.requestType&&this.parent.showSpinner():this.parent.showMaskRow(),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(q)||o.classList.contains("e-connectorpoint-right"))&&this.showHideActivePredecessors(!0):t.addClass([l],["e-connectorpoint-allow-block"]),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}(R),ut=function(){function e(e){this.updatedEditFields=null,this.updatedAddFields=null,this.addedRecord=null,this.dialogEditValidationFlag=!1,this.ganttResources=[],this.isValidData=!0,this.previousResource=[],this.isResourceUpdate=!1,this.parent=e,this.localeObj=this.parent.localeObj,this.beforeOpenArgs={cancel:!1},this.types=this.getPredecessorType(),this.rowData={},this.editedRecord={},this.inputs={booleanedit: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]):i[a].field===r.type?(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;t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.ganttProperties)||("string"==typeof e.ganttProperties.taskId?this.numericOrString="stringedit":this.numericOrString="numericedit"),t.isNullOrUndefined(e.ganttProperties)&&!t.isNullOrUndefined(e)&&(isNaN(Number(e))||"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?this.numericOrString="stringedit":this.numericOrString="numericedit")),"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});a.classList.add("e-gantt-dialog"),i.element.appendChild(a),r.animationSettings={effect:"None"},r.header=this.localeObj.getConstant(this.isEdit?"editDialogTitle":"addDialogTitle"),r.isModal=!0,r.enableRtl=this.parent.enableRtl,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;t.isNullOrUndefined(a)&&""===a||("General"===(a=(a=a.replace(e.element.id,"")).replace("TabContainer",""))?this.destroyCustomField(n):"Dependency"===a?n.ej2_instances[0].destroy():"Notes"===a?n.ej2_instances[0].destroy():"Resources"===a?n.ej2_instances[0].destroy():-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,l.enableRtl=this.parent.enableRtl,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(d){if(t.isNullOrUndefined(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.showSpinner():a.parent.showMaskRow(),a.renderTabItems(),!d.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 p={action:"OpenDialog",requestType:a.isEdit?"openEditDialog":"openAddDialog",data:a.beforeOpenArgs.rowData,element:a.dialog,cancel:!1};a.parent.trigger("actionComplete",p,function(e){t.isNullOrUndefined(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.hideSpinner():a.parent.hideMaskRow(),e.cancel&&a.resetValues()})}})},e.prototype.tabSelectedEvent=function(e){var i=this.parent,r=e.selectedContent.childNodes[0].id;this.parent.isAdaptive&&this.responsiveTabContent(r,i),r===i.element.id+"ResourcesTabContainer"?this.resourceSelection(r):r===i.element.id+"NotesTabContainer"?(document.getElementById(r).ej2_instances[0].refresh(),document.querySelector("#"+this.parent.element.id+"NotesTabContainer").style.overflow="scroll"):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(t.isNullOrUndefined(this.parent.taskFields.id)||t.isNullOrUndefined(this.parent.columnMapping.id)||t.isNullOrUndefined(this.numericOrString)||s.id===e.field&&(e.editType=this.numericOrString),e.editType){case"booleanedit":var l={label:e.headerText,locale:a,enableRtl:this.parent.enableRtl};i[e.field]=l;break;case"defaultedit":case"stringedit":var d=o;d.enableRtl=this.parent.enableRtl,e.field!==n.columnMapping.duration&&e.field!==n.columnMapping.id&&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;p.enableRtl=this.parent.enableRtl,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.enableRtl=this.parent.enableRtl,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.enableRtl=this.parent.enableRtl,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(e.field===n.columnMapping.type||e.field===n.columnMapping.manual){var u=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];o.dataSource=u,o.fields={value:"Value"};var g=o;g.enableRtl=this.parent.enableRtl,g.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;t.isNullOrUndefined(r.editModule.dialogModule.dialog)||(a=r.editModule.dialogModule.dialog);var s,o=null,l=r.editModule.dialogModule.editedRecord,p=null,h=null,c="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,u=this.parent.viewType;if(t.isNullOrUndefined(e.element)?t.isNullOrUndefined(e.container)?t.isNullOrUndefined(e.event)||t.isNullOrUndefined(e.event.path)||t.isNullOrUndefined(e.event.path)[1]||(o=(s=e.event.path[1]).querySelector("input").getAttribute("id"),s=s.querySelector("#"+o)):(o=(s=e.container).querySelector("input").getAttribute("id"),s=s.querySelector("#"+o)):o=(s=e.element).getAttribute("id"),t.isNullOrUndefined(s))p=e.value,h=i.field;else if(p=s.value,h=o.replace(r.element.id,""),"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType){var g=function(e){return"ResourceView"===u?-1===c.indexOf("T"+e.value)&&-1===c.indexOf("R"+e.value):-1===c.indexOf(e.value)},f={rules:(n={},n[this.parent.taskFields.id]={required:!0,minLength:[g,"ID is already present, please enter new value"]},n)};new d.FormValidator("#"+this.parent.element.id+"GeneralTabContainer",f)}if(0===h.search("Segments"))return h=h.replace("SegmentsTabContainer",""),this.validateSegmentFields(r,h,p,e),!0;this.validateScheduleValuesByCurrentField(h,p,this.editedRecord);var m=l.ganttProperties,y=r.taskFields;return t.isNullOrUndefined(y.startDate)||y.startDate===h||this.updateScheduleFields(a,m,"startDate"),y.endDate===h&&!t.isNullOrUndefined(m.startDate)&&!t.isNullOrUndefined(e.value)&&m.startDate.getTime()>e.value&&this.updateScheduleFields(a,m,"endDate"),t.isNullOrUndefined(y.endDate)||y.endDate===h||this.updateScheduleFields(a,m,"endDate"),t.isNullOrUndefined(y.duration)||y.duration===h||this.updateScheduleFields(a,m,"duration"),t.isNullOrUndefined(y.work)||y.work===h||this.updateScheduleFields(a,m,"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.parent.setRecordValue(s.duration,i,r),this.parent.setRecordValue("taskData."+s.duration,a.duration,r)),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);t.isNullOrUndefined(a.startDate)&&t.isNullOrUndefined(l)&&a.startDate.getTime()>l.getTime()&&(l=a.endDate),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))),e===s.type&&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=this,o=0;o<e.length;o++)!function(r){var n={};switch(e[r]){case"startDate":case"endDate":n={field:e[r],headerText:s.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:s.parent.getDateFormat()},"startDate"===e[r]&&(n.validationRules={required:!0}),a.push(n);break;case"duration":n={field:e[r],headerText:s.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);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]),t.isNullOrUndefined(n.value)||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))}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){return(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"]),{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&&!this.parent.allowParentDependency&&(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,r=!1;if(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)if(-1!==this.parent.customColumns.indexOf(e.field))r=!0;else if(e.field===this.parent.taskFields.id||e.field===this.parent.taskFields.name||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.startDate||e.field===this.parent.taskFields.endDate||e.field===this.parent.taskFields.baselineStartDate||e.field===this.parent.taskFields.baselineEndDate||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type){for(var n=0;n<this.parent.currentViewData.length;n++)if(!t.isNullOrUndefined(this.parent.currentViewData[n].ganttProperties.taskId)){i=this.parent.currentViewData[n].ganttProperties.taskId;break}r="string"!=typeof i}return this.isEdit&&(e.field===this.parent.taskFields.id&&(r=!0),this.editedRecord.hasChildRecords&&(e.field===this.parent.taskFields.endDate&&(!t.isNullOrUndefined(this.editedRecord.isManual)&&!1===this.editedRecord.isManual||"Auto"===this.parent.taskMode)||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type)&&(r=!0)),r},e.prototype.isParentValid=function(e){if(e.length>0)for(var t=0;t<e.length;t++){if(e[t].uniqueID==this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}if(e[t].hasChildRecords&&this.isParentValid(e[t].childRecords),!this.isValidData)break}return this.isValidData},e.prototype.renderPredecessorTab=function(e){var 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,enableRtl:i.parent.enableRtl,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=this,o=0;o<=a.length;o++)!function(r){s.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)}},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=[];if("ResourceView"===this.parent.viewType)for(y=0;y<r.currentViewData.length;y++)for(var h=0;h<r.resources.length;h++)r.currentViewData[y][r.taskFields.id]===r.resources[h][n.id]&&(r.currentViewData[y].hasChildRecords||t.isNullOrUndefined(r.currentViewData[y].parentItem))&&p.push(r.resources[h]);else p=t.extend([],[],r.resources,!0);if(this.parent.dataOperation.updateResourceUnit(p),!t.isNullOrUndefined(o)){var c=void 0,u=o.length,g=void 0,f=p.length;for(c=0;c<u;c++)for(g=0;g<f;g++)o[c][n.id]===p[g][n.id]&&(p[g][n.unit]=o[c][n.unit])}l.dataSource=p;var m=s.ganttProperties.resourceInfo;if(this.isEdit&&!t.isNullOrUndefined(m))for(var y=0;y<m.length;y++)this.ganttResources.push(m[y]);l.rowSelected=function(e){i.updateResourceCollection(e,d)},l.rowDeselected=function(e){i.updateResourceCollection(e,d)};var v=this.createDivElement("e-resource-div",d);a.TreeGrid.Inject(a.Selection,a.Filter,a.Edit,a.VirtualScroll);var D=new a.TreeGrid(l),w=this.parent.columnByField[this.parent.taskFields.resourceInfo];return(!1===w.allowEditing||w.isPrimaryKey||this.parent.readOnly)&&(D.allowSelection=!1,D.allowFiltering=!1,D.editSettings.allowEditing=!1),D.dataBound=function(){if(i.parent.editDialogFields.length>=1&&"Resources"===i.parent.editDialogFields[0].type){var e=i.parent.element.id+"ResourcesTabContainer";i.resourceSelection(e)}},D.appendTo(v),v},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];i.enableHtmlSanitizer=this.parent.enableHtmlSanitizer;var r=this.editedRecord.ganttProperties,n=this.createDivElement("",t.element.id+""+e+"TabContainer");l.RichTextEditor.Inject(l.Toolbar,l.Link,l.HtmlEditor,l.QuickToolbar,l.Count),i.value=r.notes;var a=this.parent.columnByField[this.parent.taskFields.notes];return(!1===a.allowEditing||a.isPrimaryKey||this.parent.readOnly)&&(i.enabled=!1),new l.RichTextEditor(i).appendTo(n),n},e.prototype.renderInputElements=function(e,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=t.isNullOrUndefined(e.enabled)?!this.isCheckIsDisabled(i):e.enabled,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(this.parent.allowParentDependency){var r=i;if(i.parentUniqueID===this.beforeOpenArgs.rowData.uniqueID)this.isValidData=!1;else do{if(r.parentItem&&(r=this.parent.flatData[this.parent.ids.indexOf(r.parentItem.taskId)]).uniqueID===this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}}while(r.parentItem);if(i.hasChildRecords&&this.isValidData&&(this.isValidData=this.isParentValid(i.childRecords)),!this.isValidData){this.isValidData=!0;continue}}else if(i.hasChildRecords)continue;var n="ResourceView"===this.parent.viewType?i.ganttProperties.taskId.toString():i.ganttProperties.rowUniqueID.toString(),a={id:n,text:n+"-"+i.ganttProperties.taskName,value:n};this.preTaskIds.push(a.id),this.preTableCollection.push(a)}},e.prototype.predecessorEditCollection=function(e){var 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++){var a=o[this.parent.taskFields.resourceInfo][r].toString(),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,r=e.ej2_instances[0],n=r.isEdit;r.isEdit&&r.endEdit(),i=n&&r.currentViewData.length!=r.dataSource.length?r.dataSource:r.currentViewData,this.updateSegmentTaskData(i)},e.prototype.updateGeneralTab=function(e,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];if("stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType&&p===this.parent.taskFields.id){var c=h.value.toString();h.value=c}var u=n.columnByField[p];if(!t.isNullOrUndefined(u.edit)&&t.isNullOrUndefined(u.edit.params)){var g=u.edit.read;"string"==typeof g?(g=r.getObject(g,window),s[p]=g(d,h.value)):s[p]=u.edit.read(d,h.value)}else i&&"booleanedit"===u.editType?!0===d.checked?s[p]=!0:s[p]=!1:(s[p]=h.value,this.parent.enableHtmlSanitizer&&"string"==typeof h.value&&(h.value=t.SanitizeHtmlHelper.sanitize(h.value),s[p]=h.value))}}this.isEdit&&(i||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),this.parent.setRecordValue("type",e.ganttProperties.taskType,i.ganttProperties,!0),this.parent.setRecordValue("resourceNames",e.ganttProperties.resourceNames,i.ganttProperties,!0),this.parent.setRecordValue("resourceInfo",e.ganttProperties.resourceInfo,i.ganttProperties,!0),t.isNullOrUndefined(this.parent.taskFields.startDate)||this.parent.dataOperation.updateMappingData(i,this.parent.taskFields.startDate),t.isNullOrUndefined(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(i,this.parent.taskFields.endDate),t.isNullOrUndefined(this.parent.taskFields.duration)||(this.parent.dataOperation.updateMappingData(i,this.parent.taskFields.duration),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,this.rowData,!0),0===this.rowData.ganttProperties.duration?this.parent.setRecordValue("isMilestone",!0,i.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),t.isNullOrUndefined(this.parent.taskFields.type)||this.parent.dataOperation.updateMappingData(this.rowData,"type"),t.isNullOrUndefined(this.parent.taskFields.resourceInfo)||this.parent.dataOperation.updateMappingData(this.rowData,"resourceInfo")},e.prototype.updatePredecessorTab=function(e){var t=e.ej2_instances[0];t.isEdit&&t.endEdit();for(var i=t.dataSource,r=[],n=[],a="",s=[],o=0;o<i.length;o++){var l=i[o];if(-1===s.indexOf(l.id)){var d=l.id+l.type;l.offset&&-1!==l.offset.indexOf("-")?d+=l.offset:d+="+"+l.offset,r.push(d),s.push(l.id)}}this.isEdit?(r.length>0?(n=this.parent.predecessorModule.calculatePredecessor(r.join(","),this.rowData),this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=this.parent.predecessorModule.getPredecessorStringValue(this.rowData)):(n=[],this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=""),this.parent.setRecordValue("predecessorsName",a,this.rowData.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,this.rowData),this.parent.setRecordValue(this.parent.taskFields.dependency,a,this.rowData),this.parent.predecessorModule.updateUnscheduledDependency(this.rowData)):this.addedRecord[this.parent.taskFields.dependency]=r.length>0?r.join(","):""},e.prototype.updateResourceTab=function(e){var 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.editedRecord.ganttProperties,!0),this.parent.dataOperation.updateMappingData(this.editedRecord,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(this.editedRecord,"resource"),this.validateDuration(this.editedRecord),this.updateScheduleProperties(this.editedRecord,this.rowData);else{for(var 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?(!1===t.columnByField[t.taskFields.notes].disableHtmlEncode?this.parent.setRecordValue("notes",i.getHtml(),this.rowData.ganttProperties,!0):this.parent.setRecordValue("notes",i.getText(),this.rowData.ganttProperties,!0),t.dataOperation.updateMappingData(this.rowData,"notes")):this.addedRecord[this.parent.taskFields.notes]=i.getHtml()},e.prototype.updateCustomTab=function(e){this.updateGeneralTab(e,!0)},e}(),gt=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,"e-line"),i=g(e,"e-connector-line-right-arrow"),r=g(e,"e-connector-line-left-arrow");return t||i||r?g(e,"e-connector-line-container"):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],["e-connector-line-hover-z-index"]),e.querySelectorAll(".e-line")[0].classList.contains("e-criticalconnector-line")?(t.addClass(e.querySelectorAll(".e-line"),["e-critical-connector-line-hover"]),t.addClass(e.querySelectorAll(".e-connector-line-right-arrow"),["e-critical-connector-line-right-arrow-hover"]),t.addClass(e.querySelectorAll(".e-connector-line-left-arrow"),["e-critical-connector-line-left-arrow-hover"])):(t.addClass(e.querySelectorAll(".e-line"),["e-connector-line-hover"]),t.addClass(e.querySelectorAll(".e-connector-line-right-arrow"),["e-connector-line-right-arrow-hover"]),t.addClass(e.querySelectorAll(".e-connector-line-left-arrow"),["e-connector-line-left-arrow-hover"]))},e.prototype.removeHighlight=function(){t.isNullOrUndefined(this.connectorLineElement)||(t.removeClass([this.connectorLineElement],["e-connector-line-hover-z-index"]),this.connectorLineElement.querySelectorAll(".e-line")[0].classList.contains("e-critical-connector-line-hover")?(t.removeClass(this.connectorLineElement.querySelectorAll(".e-line"),["e-critical-connector-line-hover"]),t.removeClass(this.connectorLineElement.querySelectorAll(".e-connector-line-right-arrow"),["e-critical-connector-line-right-arrow-hover"]),t.removeClass(this.connectorLineElement.querySelectorAll(".e-connector-line-left-arrow"),["e-critical-connector-line-left-arrow-hover"])):(t.removeClass(this.connectorLineElement.querySelectorAll(".e-line"),["e-connector-line-hover"]),t.removeClass(this.connectorLineElement.querySelectorAll(".e-connector-line-right-arrow"),["e-connector-line-right-arrow-hover"]),t.removeClass(this.connectorLineElement.querySelectorAll(".e-connector-line-left-arrow"),["e-connector-line-left-arrow-hover"])),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),(!this.parent.allowParentDependency&&a&&!0===a.expanded||s&&!0===s.expanded||this.parent.allowParentDependency&&(a||s))&&(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,r=e.split(","),n=[],a=[],s=0;s<r.length;s++){var o=[];i=r[s].split("+"),r[s].indexOf("-")>=0&&(i=r[s].split("-")),t.isNullOrUndefined(i[0])||(-1===("ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids).indexOf(i[0])?-1!==i[0].indexOf(" ")?(1===(a=i[0].split(" ")).length&&(a=i[0].match(/(\d+|[A-z]+)/g)),o.push(a[0])):1===i[0].length||2===i[0].length?o.push(i[0]):o.push(i[0].slice(0,-2)):o.push(i[0])),n.push(o.join(""))}return n},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=this;null!==r;){var d=function(){var e=[];return-1!==o.indexOf(r)?"break":t.isNullOrUndefined(l.parent.connectorLineModule.getRecordByID(r))?{value:!1}:(n=l.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"))}();if("object"==typeof d)return d.value;if("break"===d)break}}return!0},e.prototype.getRootParent=function(e){var t=e;return e.parentItem?((t=this.parent.flatData.filter(function(t){return t.uniqueID===e.parentUniqueID})[0]).parentItem&&(t=this.getRootParent(t)),t):t},e.prototype.validateParentPredecessor=function(e,t){if(t.hasChildRecords&&!e.hasChildRecords){if(e.parentUniqueID===t.uniqueID)return!1;do{if(e.parentItem&&(e=this.parent.flatData[this.parent.ids.indexOf(e.parentItem.taskId)]).uniqueID===t.uniqueID)return!1}while(e.parentItem)}else if(!t.hasChildRecords&&e.hasChildRecords){if(t.parentUniqueID===e.uniqueID)return!1;do{if(t.parentItem&&(t=this.parent.flatData[this.parent.ids.indexOf(t.parentItem.taskId)]).uniqueID===e.uniqueID)return!1}while(t.parentItem)}else if(t.hasChildRecords&&e.hasChildRecords)if(t.parentItem&&e.parentItem){if(e.parentUniqueID===t.uniqueID||e.uniqueID===t.parentUniqueID)return!1}else if(!t.parentItem&&e.parentItem){if(this.parent.connectorLineEditModule.getRootParent(e).uniqueID===t.uniqueID)return!1}else if(t.parentItem&&!e.parentItem&&this.parent.connectorLineEditModule.getRootParent(t).uniqueID===e.uniqueID)return!1;return!0},e.prototype.validatePredecessorRelation=function(e,i){var r,n,a=!0,s="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(!t.isNullOrUndefined(i)&&i.length>0){r=this.idFromPredecessor(i);for(var o=this,l=0;l<r.length;l++){var d=function(i){if(o.parent.allowParentDependency){if(parseInt(r[r.length-1])!==e[o.parent.taskFields.id]){var l=o.parent.ids.indexOf(r[r.length-1]),d=o.parent.currentViewData[l];d&&e&&(a=o.validateParentPredecessor(d,e))}}else if(!o.checkParentRelation(e,r))return{value:!1};var p=[],h=!0;if(r.slice(0).forEach(function(e){-1===p.indexOf(e)?p.push(e):h=!1}),!h)return{value:!1};n=r[i];var c=[];r.slice(0).splice(i,1);for(;null!==n;){var u=function(){var i,r,a=[];if(-1!==c.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&&(a.push(e.from.toString()),i=t)}),s.toString()===r.rowUniqueID.toString()||-1!==a.indexOf(s.toString()))return{value:!1};if(c.push(n),t.isNullOrUndefined(r.predecessor)||!(r.predecessor.length>0))return"break";var l=void 0;return a.length>1?l=o.predecessorValidation(a,e.ganttProperties):1===a.length&&(n=r.predecessor[i].from),!1===l?{value:!1}:void 0}();if("object"==typeof u)return u;if("break"===u)break}}(l);if("object"==typeof d)return d.value}}return a},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=this,n=0;n<t.length;n++){var a=function(e){var i=r.parent.currentViewData.filter(function(i){return i&&i.ganttProperties.rowUniqueID.toString()===t[e].toString()});if(i[0]&&i[0].hasChildRecords)return{value:!1}}(n);if("object"==typeof a)return a.value}return!0},e.prototype.initPredecessorValidationDialog=function(){if(this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation){var e=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,enableRtl:this.parent.enableRtl,visible:!1,width:"50%",showCloseIcon:!0,close:this.validationDialogClose.bind(this),content:"",buttons:[{click:this.validationDialogOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.validationDialogCancelButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});document.getElementById(this.parent.element.id+"_dialogValidationRule").innerHTML="",e.isStringTemplate=!0,e.appendTo("#"+this.parent.element.id+"_dialogValidationRule"),this.parent.validationDialogElement=e},e.prototype.validationDialogOkButton=function(){var e=this.parent.currentEditedArgs;e.validateMode.preserveLinkWithEditing=document.getElementById(this.parent.element.id+"_ValidationAddlineOffset").checked,e.validateMode.removeLink=document.getElementById(this.parent.element.id+"_ValidationRemoveline").checked,e.validateMode.respectLink=document.getElementById(this.parent.element.id+"_ValidationCancel").checked,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogCancelButton=function(){this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogClose=function(e){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.checkChildRecords(t),this.parent.editModule.updateEditedTask(e.editEventArgs)):e.validateMode.preserveLinkWithEditing&&(this.parent.UpdateOffsetOnTaskbarEdit&&this.calculateOffset(t),this.parent.editModule.updateEditedTask(e.editEventArgs))},e.prototype.checkChildRecords=function(e){if(this.validationPredecessor=e.ganttProperties.predecessor,t.isNullOrUndefined(this.validationPredecessor)||this.removePredecessors(e,this.validationPredecessor),e.childRecords.length>0)for(var i=0;i<e.childRecords.length;i++){var r=e.childRecords[i];this.validationPredecessor=r.ganttProperties.predecessor,t.isNullOrUndefined(this.validationPredecessor)||this.removePredecessors(r,this.validationPredecessor),r.childRecords.length>0&&this.checkChildRecords(r)}else if(!t.isNullOrUndefined(e.parentItem)){var n=this.parent.getRecordByID(e.parentItem.taskId);this.validationPredecessor=n.ganttProperties.predecessor,this.removePredecessors(n,this.validationPredecessor)}},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[parseInt(n.toString(),10)],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[b(a,"from",i,"to")].offset=o;var u=t.extend([],s.ganttProperties.predecessor,[],!0);u[b(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){var r=t.extend([],[],e.ganttProperties.predecessor,!0);if(!t.isNullOrUndefined(i)){for(var 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=b(i[a],"from",r,"to");r.splice(l,1);var d=b(i[parseInt(a.toString(),10)],"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,i){var r,n,a=this.parent.predecessorModule.getValidPredecessor(e);this.validationPredecessor=[];var s,o,l=this.parent.predecessorModule.getPredecessorDate(e,a);n=i?i.ganttProperties:e.ganttProperties;for(var d=this.parent.allowUnscheduledTasks&&t.isNullOrUndefined(l)?n.endDate:this.dateValidateModule.getEndDate(l,n.duration,n.durationUnit,n,!1),p=0;p<a.length;p++){r=this.parent.connectorLineModule.getRecordByID(a[p].from);var h=null;"FS"===a[p].type?n.startDate<l?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskBeforePredecessor_FS"):n.startDate>l&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskAfterPredecessor_FS"):"SS"===a[p].type?n.startDate<l?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskBeforePredecessor_SS"):n.startDate>l&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskAfterPredecessor_SS"):"FF"===a[p].type?d<=r.ganttProperties.endDate?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskBeforePredecessor_FF"):d>r.ganttProperties.endDate&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskAfterPredecessor_FF"):"SF"===a[p].type&&(d<r.ganttProperties.startDate?(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskBeforePredecessor_SF"):d>=r.ganttProperties.startDate&&(this.validationPredecessor.push(a[parseInt(p.toString(),10)]),h="taskAfterPredecessor_SF")),!t.isNullOrUndefined(h)&&t.isNullOrUndefined(o)&&(s=r,o=h)}return{parentTask:s,task:e,violationType:o}},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[parseInt(a.toString(),10)].from))===e)e.ganttProperties.predecessor.push(n[parseInt(a.toString(),10)]);else{var s=t.extend([],[],d.ganttProperties.predecessor,!0),o=b(n[parseInt(a.toString(),10)],"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[parseInt(l.toString(),10)].from);(s=t.extend([],[],d.ganttProperties.predecessor,!0)).push(r[parseInt(l.toString(),10)]),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=b(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,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmPredecessorDelete"),buttons:[{click:this.confirmOkDeleteButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.confirmCloseDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});var e=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}(),ft=function(){function e(e){if(this.isFromDeleteMethod=!1,this.targetedRecords=[],this.isNewRecordAdded=!1,this.isValidatedEditedRecord=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.confirmDialog=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,this.isBreakLoop=!1,this.isResourceTaskDeleted=!1,this.deletedTaskDetails=[],this.parent=e,this.validatedChildItems=[],this.parent.editSettings.allowEditing&&"Auto"===this.parent.editSettings.mode&&(this.cellEditModule=new lt(this.parent)),this.parent.taskFields.dependency&&(this.parent.connectorLineEditModule=new gt(this.parent)),(this.parent.editSettings.allowAdding||this.parent.editSettings.allowEditing&&("Dialog"===this.parent.editSettings.mode||"Auto"===this.parent.editSettings.mode))&&(this.dialogModule=new ut(this.parent)),this.parent.editSettings.allowTaskbarEditing&&(this.taskbarEditModule=new ct(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){var t={min:0,decimals:0,enableRtl:this.parent.enableRtl,validateDecimalOnType:!0,format:"n0",showSpinButton:!1};this.updateEditParams(e,t)},e.prototype.updateProgessColumnEditParams=function(e){var t={min:0,enableRtl:this.parent.enableRtl,decimals:0,validateDecimalOnType:!0,max:100,format:"n0"};this.updateEditParams(e,t)},e.prototype.updateEditParams=function(e,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},enableRtl:i.parent.enableRtl,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),enableRtl:i.parent.enableRtl,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 lt(this.parent)),this.parent.editModule.dialogModule&&"Auto"===e.mode?this.parent.treeGrid.recordDoubleClick=void 0:t.isNullOrUndefined(this.parent.editModule.dialogModule)&&(this.dialogModule=new ut(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 ct(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,a.cssClass].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.cssClass)m="cssClass";else if(h===a.segments&&!t.isNullOrUndefined(i.ganttProperties.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),i.ganttProperties.baselineEndDate&&0===i.ganttProperties.baselineEndDate.getHours()&&86400!==this.parent.defaultEndTime&&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(h===a.type)n.setRecordValue("taskType",e[h],i.ganttProperties,!0);else if(-1!==n.customColumns.indexOf(h)){var 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,r,n=this.isCheckPredecessor(e.data);if(t.isNullOrUndefined(e.data.parentItem)||n){if(e.data.childRecords.length>0&&!n&&!(n=this.isCheckPredecessor(e.data))&&this.isTaskbarMoved(e.data))for(var a=0;a<e.data.childRecords.length;a++)this.parent.predecessorModule.getValidPredecessor(e.data.childRecords[a]).length>0&&(r=a,n=!0)}else i=this.parent.getRecordByID(e.data.parentItem.taskId),n=!!(this.isTaskbarMoved(e.data)&&this.parent.predecessorModule.getValidPredecessor(i).length>0&&this.parent.isInPredecessorValidation);this.taskbarMoved=this.isTaskbarMoved(e.data),this.predecessorUpdated=this.isPredecessorUpdated(e.data),this.predecessorUpdated&&(this.parent.isConnectorLineUpdate=!0,this.parent.connectorLineEditModule.addRemovePredecessor(e.data));var s={};if(n)if(s=t.isNullOrUndefined(i)?t.isNullOrUndefined(r)?this.parent.connectorLineEditModule.validateTypes(e.data):this.parent.connectorLineEditModule.validateTypes(e.data.childRecords[r],e.data):this.parent.connectorLineEditModule.validateTypes(i,e.data),this.parent.isConnectorLineUpdate=!0,t.isNullOrUndefined(t.getValue("violationType",s)))this.updateEditedTask(e);else{var o=this.validateTaskEvent(e);!1===o.validateMode.preserveLinkWithEditing&&!1===o.validateMode.removeLink&&!1===o.validateMode.respectLink?this.parent.connectorLineEditModule.openValidationDialog(s):(this.parent.editModule&&this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.isEdit&&this.predecessorUpdated&&(this.isValidatedEditedRecord=!0,this.parent.predecessorModule.validatePredecessor(e.data,[],"")),this.parent.connectorLineEditModule.applyPredecessorOption())}else this.taskbarMoved&&(this.parent.isConnectorLineUpdate=!0),this.updateEditedTask(e)},e.prototype.validateTaskEvent=function(e){var t={};return this.resetValidateArgs(),this.parent.currentEditedArgs=t,t.cancel=!1,t.data=e.data,t.requestType="validateLinkedTask",t.validateMode=this.parent.dialogValidateMode,t.editEventArgs=e,this.parent.actionBeginTask(t),t},e.prototype.resetValidateArgs=function(){this.parent.dialogValidateMode.preserveLinkWithEditing=!0,this.parent.dialogValidateMode.removeLink=!1,this.parent.dialogValidateMode.respectLink=!1},e.prototype.updateEditedTask=function(e){var t=e.data;if(this.parent.autoCalculateDateScheduling&&this.updateParentChildRecord(t),this.parent.isConnectorLineUpdate&&this.parent.autoCalculateDateScheduling){for(var i=0;i<this.validatedChildItems.length;i++){var r=this.validatedChildItems[i];r.ganttProperties.predecessor&&r.ganttProperties.predecessor.length>0&&(this.parent.editedTaskBarItem=r,this.parent.predecessorModule.validatePredecessor(r,[],""))}this.parent.predecessorModule.isValidatedParentTaskID="",t.ganttProperties.predecessor&&(this.parent.isMileStoneEdited=t.ganttProperties.isMilestone,this.taskbarMoved&&(this.parent.editedTaskBarItem=t),this.isValidatedEditedRecord||this.parent.predecessorModule.validatePredecessor(t,[],""),this.isValidatedEditedRecord=!1,this.parent.predecessorModule.isValidatedParentTaskID=""),(this.parent.allowParentDependency&&t.hasChildRecords&&this.parent.previousRecords[t.uniqueID].ganttProperties.startDate&&"DrawConnectorLine"===e.action||"DialogEditing"===e.action)&&this.updateChildItems(t),this.updateParentItemOnEditing()}if(t.parentItem){this.parent.autoCalculateDateScheduling&&this.parent.dataOperation.updateParentItems(t,!0);var n=this.parent.getRecordByID(t.parentItem.taskId);n.ganttProperties.predecessorsName||(this.parent.predecessorModule.validatePredecessor(n,[],""),this.updateParentItemOnEditing())}this.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];t.isNullOrUndefined(r)||t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.ganttProperties)?i=new Date(e.ganttProperties.startDate.getTime()):t.isNullOrUndefined(r.ganttProperties.startDate)||(i=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){!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(d)&&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=!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(a)&&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 if(t.isNullOrUndefined(r)){s=i;var u=this.parent.initialLoadData[p[h].index];this.parent.isLoad?this.calculateDateByRoundOffDuration(u,s):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),this.parent.dataOperation.updateGanttData())}},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,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(a){if(t.isNullOrUndefined(i.parent.loadingIndicator)||"Shimmer"!==i.parent.loadingIndicator.indicatorType?i.parent.showSpinner():i.parent.showMaskRow(),a.cancel)i.reUpdatePreviousRecords(),i.parent.chartRowsModule.refreshRecords([e.data]),i.resetEditProperties(r);else if(a.modifiedTaskData=D(a.modifiedRecords,null,null,i.parent),v(i.parent.dataSource)){var s=i.parent.dataSource,o={changedRecords:a.modifiedTaskData},l=i.parent.query instanceof n.Query?i.parent.query:new n.Query,d=null,p=s.adaptor;if(p instanceof n.WebApiAdaptor&&p instanceof n.ODataAdaptor&&!s.dataSource.batchUrl){d=s.update(i.parent.taskFields.id,o.changedRecords,null,l)}else d=s.saveChanges(o,i.parent.taskFields.id,null,l);d.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){var i,r;i=e.changedRecords?e.changedRecords.length:e.length;for(var n=0;n<i;n++){r=e.changedRecords?e.changedRecords[parseInt(n.toString(),10)]:e[parseInt(n.toString(),10)];for(var a=Object.keys(r).length,s=0,o=Object.keys(r);s<a;s++){var l=o[parseInt(s.toString(),10)];this.parent.editedRecords[parseInt(n.toString(),10)][""+l]=r[""+l],this.parent.editedRecords[parseInt(n.toString(),10)].taskData[""+l]=r[""+l]}null!==this.parent.taskFields.id&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.taskId=r[this.parent.taskFields.id]),null!==this.parent.taskFields.name&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.taskName=r[this.parent.taskFields.name]),null!==this.parent.taskFields.startDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.startDate=r[this.parent.taskFields.startDate]),null!==this.parent.taskFields.endDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.endDate=r[this.parent.taskFields.endDate]),null!==this.parent.taskFields.duration&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.duration=parseInt(r[this.parent.taskFields.duration])),null!==this.parent.taskFields.durationUnit&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.durationUnit=r[this.parent.taskFields.durationUnit]),null!==this.parent.taskFields.progress&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.progress=r[this.parent.taskFields.progress]),null!==this.parent.taskFields.dependency&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.dependency=r[this.parent.taskFields.dependency]),null!==this.parent.taskFields.parentID&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.parentID=r[this.parent.taskFields.parentID]),null!==this.parent.taskFields.baselineEndDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.baselineEndDate=r[this.parent.taskFields.baselineEndDate]),null!==this.parent.taskFields.baselineStartDate&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.baselineStartDate=r[this.parent.taskFields.baselineStartDate]),null!==this.parent.taskFields.resourceInfo&&(this.parent.editedRecords[parseInt(n.toString(),10)].ganttProperties.resources=r[this.parent.taskFields.resourceInfo])}this.saveSuccess(t)},e.prototype.dmFailure=function(e,t){if(this.deletedTaskDetails.length){for(var i=this.deletedTaskDetails,r=0;r<i.length;r++)i[r].isDelete=!1;this.deletedTaskDetails=[]}this.reUpdatePreviousRecords(!0,!0),this.resetEditProperties(),this.parent.trigger("actionFailure",{error:e})},e.prototype.updateSharedTask=function(e){for(var i=e.ganttProperties.sharedTaskUniqueIds,r=0;r<i.length;r++){var n=this.parent.flatData[this.parent.ids.indexOf(i[r].toString())];n&&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),"ResourceView"===this.parent.viewType&&!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation&&(this.parent.contentHeight=this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,this.parent.ganttChartModule.chartBodyContent.style.height=this.parent.contentHeight+"px",this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData),this.parent.taskFields.dependency&&this.parent.ganttChartModule.reRenderConnectorLines()),this.parent.isConnectorLineUpdate&&!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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()}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(c=0;c<n;c++){var s=[];"NaN"===(g=parseInt(t[c][this.parent.resourceFields.id],10).toString())&&(g=t[c][this.parent.resourceFields.id]);for(var o=0;o<e.length;o++){var l=parseInt(e[o][this.parent.resourceFields.id],10).toString();if("NaN"===l&&(l=e[o][this.parent.resourceFields.id]),l===g){s.push(o);break}}if(0===s.length){var d=r[this.parent.getTaskIds().indexOf("R"+g)];d&&this.addNewRecord(i,d)}else{var p=parseInt(s[0].toString(),10);"NaN"===p.toString()&&(p=s[0].toString()),e.splice(p,1)}}for(var h=e?e.length:0,c=0;c<h;c++)for(var u=i.ganttProperties.taskId,g=e[c][this.parent.resourceFields.id],f=r[this.parent.getTaskIds().indexOf("R"+g)],m=0;m<f.childRecords.length;m++)f.childRecords[m].ganttProperties.taskId===u&&this.removeChildRecord(f.childRecords[m]);if(n>0){var y=this.parent.getParentTask(i.parentItem);y&&y.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.removeChildRecord(i)}0===n&&this.checkWithUnassignedTask(i)}},e.prototype.checkWithUnassignedTask=function(e){for(var 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),this.parent.dataSource.push(e.taskData)}else this.addNewRecord(e,i);var l=this.parent.currentViewData.filter(function(t){return t.ganttProperties.taskId===e.ganttProperties.taskId&&t.hasChildRecords===e.hasChildRecords})[0];e.parentItem=l.parentItem,e.parentUniqueID=l.parentUniqueID},e.prototype.addRecordAsBottom=function(e){var t=this.parent.flatData.length;this.parent.currentViewData.splice(t+1,0,e),this.parent.flatData.splice(t+1,0,e),this.parent.ids.splice(t+1,0,e.ganttProperties.rowUniqueID.toString());var i=0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId;this.parent.getTaskIds().splice(t+1,0,i),this.updateTreeGridUniqueID(e,"add")},e.prototype.addNewRecord=function(e,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,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmDelete"),buttons:[{click:this.confirmDeleteOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.closeConfirmDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});e.appendTo("#"+this.parent.element.id+"_deleteConfirmDialog"),this.confirmDialog=e},e.prototype.closeConfirmDialog=function(){this.confirmDialog.hide()},e.prototype.confirmDeleteOkButton=function(){this.deleteSelectedItems(),this.confirmDialog.hide(),this.parent.element.querySelector(".e-treegrid").focus()},e.prototype.startDeleteAction=function(){this.parent.editSettings.allowDeleting&&!this.parent.readOnly&&(this.parent.editSettings.showDeleteConfirmDialog?this.confirmDialog.show():(this.deleteSelectedItems(),this.parent.element.querySelector(".e-treegrid").focus()))},e.prototype.deleteResourceRecords=function(e){for(var t=[],i=this,r=0;r<e.length;r++)!function(r){if(e[r].parentItem){if(1===e[r].ganttProperties.sharedTaskUniqueIds.length){for(var n=e[r],a=n.ganttProperties.sharedTaskUniqueIds,s=0;s<a.length;s++)-1!==i.parent.ids.indexOf(a[s].toString())&&t.push(i.parent.flatData[i.parent.ids.indexOf(a[s].toString())]);-1!==i.parent.ids.indexOf(n.ganttProperties.rowUniqueID)&&t.push(i.parent.flatData[i.parent.ids.indexOf(n.ganttProperties.rowUniqueID)])}}else{var o=i.parent.flatData.filter(function(t){return t.ganttProperties.taskId===e[r].ganttProperties.taskId&&t.hasChildRecords})[0];t.push(o)}}(r);this.deleteRow(t)},e.prototype.deleteSelectedItems=function(){if(this.isFromDeleteMethod)this.targetedRecords.length&&("ResourceView"===this.parent.viewType?this.deleteResourceRecords(this.targetedRecords):this.deleteRow(this.targetedRecords)),this.isFromDeleteMethod=!1;else{var e=[];"Cell"!==this.parent.selectionSettings.mode?e=this.parent.selectionModule.getSelectedRecords():"Cell"===this.parent.selectionSettings.mode&&(e=this.parent.selectionModule.getCellSelectedRecords()),"ResourceView"===this.parent.viewType?this.deleteResourceRecords(e):this.deleteRow(e)}},e.prototype.deleteRecord=function(e){this.isFromDeleteMethod=!0;var 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)){var a=this.parent.getParentTask(n.parentItem);if(n.parentItem){var s=a.childRecords;(1===s.length?s:s.filter(function(e){return!e.isDelete})).length>0&&this.parent.dataOperation.updateParentItems(n.parentItem)}var o=n.ganttProperties.predecessor,l=!0;"ResourceView"===this.parent.viewType&&a&&a.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(l=!1),o&&o.length&&l&&this.removePredecessorOnDelete(n),this.deletedTaskDetails.push(n),n.hasChildRecords&&this.deleteChildRecords(n)}}this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.clearSelection();var d={};d.deletedRecordCollection=this.deletedTaskDetails,d.updatedRecordCollection=this.parent.editedRecords,d.cancel=!1,d.action="delete",this.initiateDeleteAction(d),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)){for(var c=t.extend([],[],h.ganttProperties.predecessor,!0),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,a=!0,s=this.parent.getParentTask(r.parentItem);"ResourceView"===this.parent.viewType&&s&&s.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(a=!1),n&&n.length&&a&&this.removePredecessorOnDelete(r),this.deletedTaskDetails.push(r),r.hasChildRecords&&this.deleteChildRecords(r)}}},e.prototype.removeFromDataSource=function(e){var t;t=this.parent.dataSource instanceof n.DataManager?this.parent.dataSource.dataSource.json:this.parent.dataSource,this.removeData(t,e),this.isBreakLoop=!1},e.prototype.removeData=function(e,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]){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]){var n=e[r][this.parent.taskFields.child];this.removeData(n,i)}},e.prototype.initiateDeleteAction=function(e){var i=this;this.parent.showSpinner();var r={};r.requestType="beforeDelete",r.data=e.deletedRecordCollection,r.modifiedRecords=e.updatedRecordCollection,r.modifiedTaskData=D(e.updatedRecordCollection,null,null,this.parent),this.parent.trigger("actionBegin",r,function(r){if(t.isNullOrUndefined(i.parent.loadingIndicator)||"Shimmer"!==i.parent.loadingIndicator.indicatorType?i.parent.showSpinner():i.parent.showMaskRow(),r.cancel){for(var a=i.deletedTaskDetails,s=0;s<a.length;s++)a[s].isDelete=!1;i.deletedTaskDetails=[],i.reUpdatePreviousRecords(),i.parent.initiateEditAction(!1),i.parent.hideSpinner()}else if(v(i.parent.dataSource)){var o=i.parent.dataSource;i.parent.timezone&&w(r.modifiedTaskData,i.parent);var l={deletedRecords:D(r.data,null,null,i.parent),changedRecords:r.modifiedTaskData},d=o.adaptor,p=i.parent.query instanceof n.Query?i.parent.query:new n.Query;if(d instanceof n.WebApiAdaptor&&d instanceof n.ODataAdaptor&&!o.dataSource.batchUrl){for(var h=null,c=0;c<l.deletedRecords.length;c++)h=o.remove(i.parent.taskFields.id,l.deletedRecords[c],null,p);h.then(function(){o.update(i.parent.taskFields.id,l.changedRecords,null,p).then(function(){return i.deleteSuccess(e)}).catch(function(t){return i.dmFailure(t,e)})}).catch(function(t){return i.dmFailure(t,e)})}else o.saveChanges(l,i.parent.taskFields.id,null,p).then(function(){return i.deleteSuccess(e)}).catch(function(t){return i.dmFailure(t,e)})}else i.deleteSuccess(e)})},e.prototype.deleteSuccess=function(e){var i=this,r=this.parent.flatData,n=this.parent.currentViewData,a=this.parent.getRecordFromFlatdata(e.deletedRecordCollection),s=[];a.length>0&&(this.parent.selectedRowIndex=a[a.length-1].index);for(w=0;w<a.length;w++){var o=a[w],l=n.indexOf(o),d=r.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&&n.splice(l,1),-1!==d&&r.splice(d,1),-1!==c&&h.splice(c,1),!t.isNullOrUndefined(o)){if(s.push(o.ganttProperties.taskId.toString()),-1!==d&&(this.parent.ids.splice(d,1),"ResourceView"===this.parent.viewType&&(this.parent.getTaskIds().splice(d,1),this.isResourceTaskDeleted=!0,o.hasChildRecords||(o.ganttProperties.resourceInfo=null,delete o.ganttProperties.resourceNames,o[this.parent.taskFields.resourceInfo]=null,o.ganttProperties.sharedTaskUniqueIds=[],delete o.taskData[this.parent.taskFields.resourceInfo]))),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")}}s.length>0&&this.removeFromDataSource(s);var m={};if(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(),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,"ResourceView"===this.parent.viewType)for(var y=m.data.filter(function(e){return!e.hasChildRecords}),v=this,w=0;w<y.length;w++)!function(e){var t=v.parent.flatData.filter(function(e){return e.ganttProperties.taskName===i.parent.localeObj.getConstant("unassignedTask")})[0],r=[];t&&(r=t.childRecords.filter(function(t){return t.ganttProperties.taskId===y[e].ganttProperties.taskId}));var n=v.parent.getParentTask(y[e].parentItem);n&&n.ganttProperties.taskName!==v.parent.localeObj.getConstant("unassignedTask")&&0===r.length?v.checkWithUnassignedTask(y[e]):n||r&&0!==r.length||v.checkWithUnassignedTask(y[e]),t=v.parent.flatData.filter(function(e){return e.ganttProperties.taskName===i.parent.localeObj.getConstant("unassignedTask")})[0];var a=v.parent.currentViewData.filter(function(i){return i.ganttProperties.taskId==y[e].ganttProperties.taskId&&!i.hasChildRecords&&i.parentItem&&t.uniqueID===i.parentItem.uniqueID?i:null});a[0]&&v.parent.dataOperation.updateParentItems(a[0])}(w);this.parent.trigger("actionComplete",m),this.deletedTaskDetails=[],this.parent.initiateEditAction(!1),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},e.prototype.getNewTaskId=function(){var e="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,t=e.length+1;if("ResourceView"===this.parent.viewType){if((-1!==e.indexOf("T"+t)||-1!==e.indexOf("R"+t))&&(t+=1,-1!==e.indexOf("T"+t)||-1!==e.indexOf("R"+t)))do{t+=1}while(-1!==e.indexOf("T"+t)||-1!==e.indexOf("R"+t))}else if(-1!=e.indexOf(t.toString())&&(t+=1,-1!=e.indexOf(t.toString())))do{t+=1}while(-1!=e.indexOf(t.toString()));return"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?t=t.toString():t},e.prototype.prepareNewlyAddedData=function(e,i){var r,n,a=this.parent.taskFields,s=this.parent.ids;if(e[a.id]&&(-1!==s.indexOf(e[a.id].toString())?e[a.id]=null:(n="string"==typeof e[a.id]?e[a.id]:parseInt(e[a.id],10),e[a.id]=t.isNullOrUndefined(n)?null:n)),e[a.id]||(r=this.getNewTaskId(),e[a.id]=r),this.parent.allowUnscheduledTasks||e[a.startDate]||(e[a.startDate]=this.parent.projectStartDate),!this.parent.allowUnscheduledTasks&&a.duration&&t.isNullOrUndefined(e[a.duration])&&(e[a.endDate]||(e[a.duration]="5")),a.progress&&(e[a.progress]=e[a.progress]?e[a.progress]>100?100:e[a.progress]:0),!this.parent.allowUnscheduledTasks&&!e[a.endDate]&&a.endDate&&!e[a.duration]){var o=this.parent.dataOperation.getDateFromFormat(this.parent.projectStartDate);o.setDate(o.getDate()+4),e[a.endDate]=this.parent.getFormatedDate(o,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=[],l=0;l<n;l++)if(s[l].to===a.rowUniqueID.toString()){i=this.parent.getRecordByID(s[l].from),r=b(s[l],"from",i.ganttProperties.predecessor,"to");var d=t.extend([],i.ganttProperties.predecessor,[],!0);d.splice(r,1),this.parent.setRecordValue("predecessor",d,i.ganttProperties,!0)}else if(s[l].from===a.rowUniqueID.toString()){var p=(i=this.parent.getRecordByID(s[l].to)).ganttProperties.predecessorsName.toString().split(","),h=s[l].from+s[l].type,c=p.indexOf(h);p.splice(c,1),this.parent.setRecordValue("predecessorsName",p.join(","),i.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.dependency,p.join(","),i),r=b(s[l],"from",i.ganttProperties.predecessor,"to");var u=t.extend([],i.ganttProperties.predecessor,[],!0);u.splice(r,1),this.parent.setRecordValue("predecessor",u,i.ganttProperties,!0),this.parent.predecessorModule.validatePredecessorDates(i)}this.parent.setRecordValue("predecessor",o,e.ganttProperties,!0),this.parent.setRecordValue("predecessorsName","",e.ganttProperties,!0)},e.prototype.predecessorToString=function(e,t){var i=[],r=0,n=e.length;for(r;r<n;r++)if(t.ganttProperties.rowUniqueID.toString()!==e[r].from){var a=e[r].from+e[r].type;e[r].offset=isNaN(e[r].offset)?0:e[r].offset,0!==e[r].offset&&(e[r].offset<0?a+=e[r].offset.toString()+"d":e[r].offset>0&&(a+="+"+e[r].offset.toString()+"d")),i.push(a)}return i.join(",")},e.prototype.backUpAndPushNewlyAddedRecord=function(e,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":n=o.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords?(a=n+(h=this.getChildCount(this.addRowSelectedItem,0))+1,s=l.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,l)+1):(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){var h=this.getChildCount(this.addRowSelectedItem,0);a=n+h+1,this.addRowSelectedItem.expanded||this.parent.enableMultiTaskbar||this.parent.expandByID(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),"ResourceView"===this.parent.viewType&&"number"==typeof a.ganttProperties.taskId){var h=a.ganttProperties.taskId;p.push(h.toString())}if(p.splice(i,0,a.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var c=0===a.level?"R"+a.ganttProperties.taskId:"T"+a.ganttProperties.taskId;this.parent.getTaskIds().splice(i,0,c)}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.taskFields.child||(this.parent.taskFields.child="Children"),this.parent.dataSource instanceof n.DataManager&&t.isNullOrUndefined(s.taskData[this.parent.taskFields.parentID])||!t.isNullOrUndefined(this.parent.dataSource))){var u=this.parent.taskFields.child;s.taskData[u]&&s.taskData[u].length>0?"Above"===o||"Below"===o?s.taskData[u].splice(e,0,a.taskData):s.taskData[u].push(a.taskData):(s.taskData[u]=[],s.taskData[u].push(a.taskData)),this.isNewRecordAdded=!0}},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(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(var 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(n=e[0].index+1;n<this.parent.currentViewData.length&&e[0].level<this.parent.currentViewData[n].level;n++)this.parent.modifiedRecords.push(this.parent.currentViewData[n]);for(var r=this,n=0;n<this.parent.modifiedRecords.length;n++)!function(e){var t=r.parent.modifiedRecords[e],i=r.parent.allowRowDragAndDrop?1:0,n=r.parent.taskFields.id,a=r.parent.currentViewData.findIndex(function(e){return e[n]===t[n]});r.parent.treeGrid.getRows()[a]&&(r.parent.treeGrid.renderModule.cellRender({data:t,cell:r.parent.treeGrid.getRows()[a].cells[r.parent.treeColumnIndex+i],column:r.parent.treeGrid.grid.getColumns()[r.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),r.parent.treeGrid.renderModule.RowModifier({data:t,row:r.parent.treeGrid.getRows()[a],rowHeight:r.parent.rowHeight}))}(n)},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.isNewRecordAdded||this.addDataInRealDataSource(a,e[s].taskData,i),this.isNewRecordAdded=!1):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,s=this.parent.taskFields.id;if(this.parent.editModule&&this.parent.editSettings.allowAdding){this.parent.isDynamicData=!0;var o=[];if(t.isNullOrUndefined(e))this.validateTaskPosition(e,i,r,o);else if(e instanceof Array)for(var l=0;l<e.length;l++)this.validateTaskPosition(e[l],i,r,o);else{if("object"!=typeof e)return;this.validateTaskPosition(e,i,r,o)}var d={};d=this.constructTaskAddedEventArgs(o,this.parent.editedRecords,"beforeAdd"),this.parent.trigger("actionBegin",d,function(e){a.parent.previousRecords={},t.isNullOrUndefined(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.showSpinner():a.parent.showMaskRow();var r=a.parent.taskFields,l="ResourceView"===a.parent.viewType?a.parent.flatData[a.parent.getTaskIds().indexOf("T"+e.data[r.id])]:a.parent.getRecordByID(e.data[r.id]);if(t.isNullOrUndefined(l)||a.validateUpdateValues(e.newTaskData,l,!0),t.isNullOrUndefined(e.data[""+s])||e.data[s]!=e.data.ganttProperties.taskId&&(e.data.ganttProperties.taskId=e.data[s],e.newTaskData[s]=e.data[s]),e.cancel)e=e,a.removeAddedRecord(),a.reUpdatePreviousRecords(),a._resetProperties();else if(v(a.parent.dataSource)){var d=a.parent.dataSource,p={addedRecords:[e.newTaskData],changedRecords:e.modifiedTaskData},h=e.data.ganttProperties.taskId.toString(),c=a.parent.query instanceof n.Query?a.parent.query:new n.Query,u=d.adaptor;if(u instanceof n.WebApiAdaptor&&u instanceof n.ODataAdaptor&&!d.dataSource.batchUrl){d.insert(p.addedRecords,null,c).then(function(i){t.isNullOrUndefined(i[0])?p.addedRecords[0]:i[0],a.updateNewRecord(o,e)}).catch(function(t){a.removeAddedRecord(),a.dmFailure(t,e),a._resetProperties()})}else d.saveChanges(p,a.parent.taskFields.id,null,c).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()==h){a.parent.setRecordValue("taskId",i.addedRecords[0][a.parent.taskFields.id],e.data.ganttProperties,!0),a.parent.setRecordValue("taskData",i.addedRecords[0],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(h);-1!==r&&(a.parent.ids[r]=i.addedRecords[0][a.parent.taskFields.id].toString())}a.updateNewRecord(o,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||t.isNullOrUndefined(i)&&!e.data.parentItem)if(e.data instanceof Array)a.updateRealDataSource(e.data,i);else{var g=[];g.push(e.data),a.updateRealDataSource(g,i)}}else(m(a.parent)?t.getValue("result",a.parent.dataSource):a.parent.dataSource).push(e.data.taskData);0===o.level&&a.parent.treeGrid.parentData.splice(0,0,o),a.updateTreeGridUniqueID(o,"add"),a.refreshNewlyAddedRecord(e,o),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){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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose(),"ResourceView"===this.parent.viewType)if(i.length>1)for(var n=0;n<i.length;n++){e.data[n].ganttProperties.sharedTaskUniqueIds.push(e.data[n].ganttProperties.rowUniqueID),e.data[n].ganttProperties.resourceInfo?((a=t.extend([],[],e.data[n].ganttProperties.resourceInfo,!0)).splice(0,1),this.updateResoures([],a,e.data[n])):(this.removeChildRecord(e.data[n]),this.parent.editModule.checkWithUnassignedTask(e.data[n]));for(s=0;s<this.updateParentRecords.length;s++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[s]);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 a=t.extend([],[],e.data.ganttProperties.resourceInfo,!0);a.splice(0,1),this.updateResoures([],a,e.data)}}else this.removeChildRecord(e.data),this.parent.editModule.checkWithUnassignedTask(e.data);for(var s=0;s<this.updateParentRecords.length;s++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[s]);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,i,r){var n=this;if(e[0],!0){"above"===r&&(this.dropPosition="topSegment"),"below"===r&&(this.dropPosition="bottomSegment"),"child"===r&&(this.dropPosition="middleSegment");for(var a=void 0,s=[],o=0;o<e.length;o++)s[o]=this.parent.updatedRecords[e[o]];var l={data:s,dropIndex:i,dropPosition:this.dropPosition};"middleSegment"===this.dropPosition?a="indenting":"bottomSegment"===this.dropPosition&&(a="outdenting");var d={action:a,data:s[0],cancel:!1};this.parent.trigger("actionBegin",d,function(e){t.isNullOrUndefined(n.parent.loadingIndicator)||"Shimmer"!==n.parent.loadingIndicator.indicatorType?n.parent.showSpinner():n.parent.showMaskRow(),e.cancel||n.reArrangeRows(l,!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,i){if(this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(e.data,i),i?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 r=0;r<e.modifiedRecords.length;r++)w(e.modifiedRecords[r],this.parent);this.parent.trigger("actionComplete",e),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),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;var d=[];Array.isArray(r)?d=r:d[0]=r,this.parent.editModule.updateRealDataSource(d,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);for(var c=void 0,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}(),mt=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}(),yt=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}(),vt=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.wireEvents=function(e){t.EventHandler.add(document.getElementById(e),"click",this.mouseClickHandler,this)},e.prototype.initiateFiltering=function(e){var t=this.parent.getColumnByField(e.field,this.parent.treeGridModule.treeGridColumns);e.allowFiltering=!1!==e.allowFiltering,!e.allowFiltering||"Menu"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||e.filter||(e.filter={ui:this.getCustomFilterUi(e)}),t&&(t.allowFiltering=e.allowFiltering,t.filter=e.allowFiltering?e.filter:{})},e.prototype.getCustomFilterUi=function(e){var t=this.parent.taskFields,i={};return"datepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?"datetimepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?e.field===t.duration&&"stringedit"===e.editType&&(i=this.getDurationFilter()):i=this.getDateTimePickerFilter():i=this.getDatePickerFilter(e.field),i},e.prototype.mouseClickHandler=function(e){t.closest(e.target,".e-excelfilter")&&this.parent.treeGrid.grid.notify("click",e)},e.prototype.unWireEvents=function(){t.EventHandler.remove(this.parent.element,"click",this.mouseClickHandler)},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})).enableRtl=n.parent.enableRtl,i.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})).enableRtl=i.parent.enableRtl,e.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).enableRtl=i.parent.enableRtl,e.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(t.isNullOrUndefined(e.filterModel)||t.isNullOrUndefined(e.filterModel.dialogObj)||t.isNullOrUndefined(e.filterModel.dialogObj.element)||"Excel"===this.parent.filterSettings.type&&this.wireEvents(e.filterModel.dialogObj.element.id),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=void 0;t.isNullOrUndefined(l)||((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){var l=this.filterMenuElement.querySelector(".e-flmenu-input"),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,i){var r,n,a,s,o,l,d,p=this.parent.element.getBoundingClientRect(),h=p.top,c=p.left;if(!t.isNullOrUndefined(this.parent.element.parentNode)&&"BODY"!=this.parent.element.parentNode.tagName){for(n=(r=this.parent.element.parentNode).getBoundingClientRect().top,l=r.style.marginTop;;){if(Math.abs(h)>Math.abs(n)){s=h-n;break}t.isNullOrUndefined(this.parent.element.parentNode)||(l=(r=r.parentNode).parentNode.style.marginTop),n=r.getBoundingClientRect().top}for(a=r.getBoundingClientRect().left,d=r.style.marginLeft;;){if(Math.abs(c)>Math.abs(a)){o=c-a;break}t.isNullOrUndefined(this.parent.element.parentNode)||(d=(r=r.parentNode).style.marginLeft),a=r.getBoundingClientRect().left}}var u=e.getBoundingClientRect(),g=u.right+window.scrollX,f=u.top+window.scrollY;p.right<g+i.offsetWidth?u.left-i.offsetWidth>p.left?g=u.left-i.offsetWidth:g-=g+i.offsetWidth-p.right:t.isNullOrUndefined(s)||t.isNullOrUndefined(o)||(g=Math.abs(u.right-p.left),f=Math.abs(u.top-p.top)),t.isNullOrUndefined(s)||t.isNullOrUndefined(o)?(i.style.top=f+"px",i.style.left=g+"px"):(i.style.top="string"==typeof parseInt(l)?f+s+parseInt(l)+"px":f+s+"px",i.style.left="string"==typeof parseInt(d)?g+o+parseInt(d)+8+"px":g+o+"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(),this.unWireEvents()},e}(),Dt=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}(),wt=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){if(!this.parent.isGanttChartRendered)return void(e.cancel=!0);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.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;"Single"===this.parent.selectionSettings.type||!this.isMultiCtrlRequest&&!this.isMultiShiftRequest?(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&!this.parent.rowDragAndDropModule.draggedRecord)&&this.selectRow(n,a):this.isMultiShiftRequest?this.selectRowsByRange(t.isNullOrUndefined(this.prevRowIndex)?n:this.prevRowIndex,n):(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){"number"==typeof e&&(e=[e]);for(var i=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),r=this,n=0;n<e.length;n++)!function(n){var a=i.filter(function(t){return parseInt(t.getAttribute("aria-rowindex"),0)===e[n]})[0];t.isNullOrUndefined(a)||(r.getSelectedRowIndexes().indexOf(e[n])>-1?r.addClass(a):r.removeClass(a))}(n)},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"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}(),kt=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"},this.parent.enableRtl&&("PrevTimeSpan"===r&&(this.predefinedItems[r].prefixIcon="e-nexttimespan"),"NextTimeSpan"===r&&(this.predefinedItems[r].prefixIcon="e-prevtimespan"))}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,enableRtl:this.parent.enableRtl,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");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"),enableRtl:this.parent.enableRtl,floatLabelType:"Never",showClearButton:!0}).appendTo(this.searchElement)):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;this.parent.isToolBarClick=!1,t.extend(e,{cancel:!1}),e.item.properties.id!==this.parent.element.id+"_pdfexport"&&e.item.properties.id!==this.parent.element.id+"_critical-path"||(t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow()),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.isZoomIn&&(this.parent.timelineModule.isZoomIn=!1),this.parent.timelineModule.processZoomToFit(),this.parent.ganttChartModule.updateScrollLeft(0)},e.prototype.zoomOut=function(){this.parent.timelineModule.processZooming(!1)},e.prototype.refreshToolbarItems=function(e){var 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&&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(v=0;v<p.length;v++)p[v].id!==o+"_update"&&p[v].id!==o+"_cancel"&&-1!==h.indexOf(p[v].id)&&a.push(p[v].id)}else{a.push(o+"_update",o+"_cancel");for(v=0;v<p.length;v++)-1===n.indexOf(p[v].id)&&-1===a.indexOf(p[v].id)&&n.push(p[v].id)}}for(var m=0;m<n.length;m++){for(var y=void 0,v=0;v<p.length;v++)if(p[v].id===n[m]){y=v;break}p.length>0&&this.toolbar.hideItem(y,!1)}for(var D=0;D<a.length;D++){for(var y=void 0,v=0;v<p.length;v++)if(p[v].id===a[D]){y=v;break}p.length>0&&this.toolbar.hideItem(y,!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}(),bt=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.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=this.parent.enableRtl?"right:"+d+"px;":"left:"+d+"px;",h=t.createElement("div",{className:"e-holiday",styles:p+" width:"+l+"px; height:100%;"}),c=s<n?s/2:n/2,u=t.createElement("span",{className:"e-span",styles:"top:"+c+"px;left:"+l/2+"px;"}),g=this.parent.disableHtmlEncode?"textContent":"innerHTML";u[g]=this.parent.holidays[o].label?this.parent.holidays[o].label:"",this.parent.enableHtmlSanitizer&&"string"==typeof u[g]&&(u[g]=t.SanitizeHtmlHelper.sanitize(u[g])),h.appendChild(u),this.parent.holidays[o].cssClass&&h.classList.add(this.parent.holidays[o].cssClass),r.appendChild(h)}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=this.parent.enableRtl?"right:"+s+"px;":"left:"+s+"px;",c=t.createElement("div",{className:"e-weekend",styles:h+" width:"+o+"px;height:100%;"});e.appendChild(c)}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=this.parent.element,r=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(r=this.parent.toolbarModule.element.offsetHeight);for(var n="auto"===this.parent.height?i.offsetHeight-r-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight:this.parent.ganttHeight-r-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight,a=n<e?n/2:e/2,s=this.holidayContainer.querySelectorAll(".e-span"),o=0;o<s.length;o++)s[o].style.top=t.formatUnit(a)},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}(),Tt=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","term"),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++){i=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(this.parent.eventMarkers[s].day,!0),!1);var o=void 0;if(o=this.parent.enableRtl?"right:"+i+"px;":"left:"+i+"px;",r=t.createElement("div",{className:"e-event-markers",styles:o+" height:100%;",id:"stripline"+s}),this.parent.eventMarkers[s].label){n=t.createElement("div",{className:"e-span-label"});var l=this.parent.disableHtmlEncode?"textContent":"innerHTML";n[l]=this.parent.eventMarkers[s].label,this.parent.enableHtmlSanitizer&&"string"==typeof n[l]&&(n[l]=t.SanitizeHtmlHelper.sanitize(n[l])),this.parent.enableRtl?n.style.right="5px":n.style.left="5px",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}(),St=function(){function e(e){this.parent=e,this.nonworkingDayRender=new bt(this.parent),this.eventMarkerRender=new Tt(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}(),Pt=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.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(y=1;y<r.length;y++)r[y].ganttProperties.endDate>=n&&(n=r[y].ganttProperties.endDate,r[y].ganttProperties.taskId),r[y].ganttProperties.isAutoSchedule||r[y].ganttProperties.autoEndDate>=n&&(n=r[y].ganttProperties.autoEndDate,r[y].ganttProperties.taskId);this.maxEndDate=n;for(var m=0;m<i.length;m++)i[m].isCritical=!1,i[m].ganttProperties.isCritical=!1,a=this.parent.dataOperation.getDuration(i[m].ganttProperties.endDate,n,i[m].ganttProperties.durationUnit,i[m].ganttProperties.isAutoSchedule,i[m].ganttProperties.isMilestone),i[m].slack=a+" "+i[m].ganttProperties.durationUnit,i[m].ganttProperties.slack=a+" "+i[m].ganttProperties.durationUnit,i[m].ganttProperties.endDate>=n&&s.push(i[m].ganttProperties.taskId),i[m].ganttProperties.predecessor&&0!==i[m].ganttProperties.predecessor.length&&(o.push(i[m]),l.push(i[m].ganttProperties.taskId));if("ResourceView"===this.parent.viewType)for(var y=0;y<this.parent.taskIds.length;y++)this.resourceCollectionIds[y]=this.parent.taskIds[y].slice(1);for(var v=this,D=0;D<s.length;D++)!function(e){if(-1===l.indexOf(s[e])){if("ProjectView"===v.parent.viewType)d=t.indexOf(s[e].toString());else for(var r=v.parent.currentViewData.filter(function(t){return parseInt(t.ganttProperties.taskId)===s[e]}),n=0;n<r.length;n++)!r[n].hasChildRecords&&r[n].ganttProperties.endDate>=v.maxEndDate&&(d=r[n].index);i[d].ganttProperties.progress<100&&(i[d].isCritical=!0,i[d].ganttProperties.isCritical=!0),i[d].slack="0 "+i[d].ganttProperties.durationUnit,p.push(s[e])}else h.push(s[e])}(D);for(var w=o.length,k=[],b=0;b<w;b++){for(var T=-1,S=-1,P=-1,C=-1,R=b,M=o[b].ganttProperties.predecessor,O=o[b].ganttProperties.predecessor.length,x=o[b].ganttProperties.taskId,I=0;I<O;I++)(isNaN(Number(M[I].from))||"string"==typeof x?(isNaN(Number(M[I].from)),M[I].from):parseInt(M[I].from,10))===x&&(-1===T?M[I].offset?(T=M[I].to+":"+M[I].offset+M[I].offsetUnit,P=M[I].type):(T=M[I].to,P=M[I].type):M[I].offset?(T=T+","+M[I].to+":"+M[I].offset+M[I].offsetUnit,P=P+","+M[I].type):(T=T+","+M[I].to,P=P+","+M[I].type)),(isNaN(Number(M[I].to))||"string"==typeof x?(isNaN(Number(M[I].to)),M[I].to):parseInt(M[I].to,10))===x&&(-1===S?M[I].offset?(S=M[I].from+":"+M[I].offset+M[I].offsetUnit,C=M[I].type):(S=M[I].from,C=M[I].type):M[I].offset?(S=S+","+M[I].from+":"+M[I].offset+M[I].offsetUnit,C=C+","+M[I].type):(S=S+","+M[I].from,C=C+","+M[I].type));-1===S&&(S=null,C=null),-1===T&&(T=null,P=null),c.push({from:S,fromPredecessor:C,taskid:x,to:T,toPredecessor:P,currentIndex:R,slack:null,enddate:null}),u.push(x)}for(var E=c.length,N=0,F=void 0,U=0;U<E;U++)if(!c[U].to){F=c[U].taskid,N="ProjectView"===this.parent.viewType?t.indexOf(F.toString()):this.resourceCollectionIds.indexOf(F.toString());var V=i[N].ganttProperties;a=this.parent.dataOperation.getDuration(V.endDate,n,"minute",V.isAutoSchedule,V.isMilestone),c[U].slack=a,c[U].fs=-1,c[U].enddate=V.endDate,k.push({fromdata:c[U].from,todateID:c[U].taskid,fromDataPredecessor:c[U].fromPredecessor})}for(D=0;D<k.length;D++)g.push(k[D]),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){var L=void 0;this.parent.enableCriticalPath=!1;for(U=0;U<this.criticalPathCollection.length;U++)L=t.indexOf(this.criticalPathCollection[U].toString()),i[L].isCritical=!1;this.criticalPathCollection=[],this.detailPredecessorCollection=[],this.predecessorCollectionTaskIds=[]}},e.prototype.slackCalculation=function(e,i,r,n,a,s){var o=e[0].fromdata.split(","),l=e[0].fromDataPredecessor.split(",");r=(r=r.toString()).split(",");for(var d,p,h,c,u,g,f,m,y=[],v=0;v<o.length;v++){y=o[v].split(":"),d=r.indexOf(y[0].toString()),c=r.indexOf(e[0].todateID.toString()),"ProjectView"===this.parent.viewType?(p=s.indexOf(y[0].toString()),h=s.indexOf(e[0].todateID.toString())):(p=this.resourceCollectionIds.indexOf(y[0].toString()),h=this.resourceCollectionIds.indexOf(e[0].todateID.toString()));var D=a[p].ganttProperties,w=a[h].ganttProperties;y.length>1&&(f=-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"===l[v]&&(u=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[d].slack)?y.length<=1&&(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u):i[d].slack>u&&0!==i[d].slack&&y.length<=1&&(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u),y.length>1&&(i[d].slack=i[c].slack+u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0)),i[d].fs=1,i[d].fsslack=i[d].slack,i[d].enddate=D.startDate,D.endDate>=n&&D.endDate<=n&&(i[d].slack=0)),"SS"===l[v]&&(D.isAutoSchedule?(u=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[d].slack)?y.length<=1&&(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u):i[d].slack>u&&0!==i[d].slack&&y.length<=1&&(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u),y.length>1&&(i[d].slack=i[c].slack+u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0)),i[d].fs=1,i[d].fsslack=i[d].slack,i[d].enddate=D.startDate):D.isAutoSchedule||(u=this.getSlackDuration(D.endDate,n,"minute",a[p]),t.isNullOrUndefined(i[d].slack)?i[d].slack=u:i[d].slack>u&&0!==i[d].slack&&(i[d].slack=u)),D.endDate>=n&&D.endDate<=n&&(i[d].slack=0)),"FF"===l[v]&&(1!==i[c].fs&&1!==i[c].ff&&-1!==i[c].fs||(1!==i[c].fs&&1!==i[c].ff||(g=w.endDate,m=i[c].slack),-1===i[c].fs&&(g=i[c].enddate,m=i[c].slack),u=g>D.endDate?-this.getSlackDuration(D.endDate,g,"minute",a[p]):this.getSlackDuration(g,D.endDate,"minute",a[p]),t.isNullOrUndefined(i[d].slack)?y.length<=1&&(i[d].slack=m-u<0?0:m-u):i[d].slack>u&&0!==i[d].slack&&y.length<=1&&(i[d].slack=m-u<0?0:m-u),y.length>1&&(i[d].slack=i[c].slack-u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0)),i[d].ff=1,i[d].enddate=g,i[d].fsslack=m),D.endDate>=n&&D.endDate<=n&&(i[d].slack=0)),"SF"===l[v]&&(D.isAutoSchedule?t.isNullOrUndefined(i[d].slack)?(y.length<=1?t.isNullOrUndefined(i[c].to)?(u=this.getSlackDuration(D.endDate,n,"minute",a[p]),i[d].slack=u):t.isNullOrUndefined(i[c].to)||(u=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[p]),i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u):y.length>1&&(u=w.endDate>=D.endDate?D.startDate>w.endDate?-this.getSlackDuration(w.endDate,D.startDate,"minute",a[p]):this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(D.endDate,n,"minute",a[p]),i[d].slack=i[c].slack+u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0)),i[d].fs=1,i[d].fsslack=i[d].slack,i[d].enddate=D.startDate):(y.length<=1?(t.isNullOrUndefined(i[c].to)?u=this.getSlackDuration(D.endDate,n,"minute",a[p]):t.isNullOrUndefined(i[c].to)||(u=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[p])),i[d].slack>u&&0!==i[d].slack&&(t.isNullOrUndefined(i[c].to)?i[d].slack=u:t.isNullOrUndefined(i[c].to)||(i[c].slack+u<0?i[d].slack=0:i[d].slack=i[c].slack+u))):y.length>1&&(u=w.endDate>D.endDate?D.startDate>w.endDate?-this.getSlackDuration(w.endDate,D.startDate,"minute",a[p]):this.parent.dataOperation.getDuration(D.startDate,w.endDate,"minute",D.isAutoSchedule,D.isMilestone):this.getSlackDuration(D.endDate,n,"minute",a[p]),i[d].slack>u&&0!==i[d].slack&&(i[d].slack=i[c].slack+u,i[d].slack=i[d].slack-f,i[d].slack<0&&(i[d].slack=0))),i[d].fs=1,i[d].fsslack=i[d].slack,i[d].enddate=D.startDate):D.isAutoSchedule||(u=this.getSlackDuration(D.endDate,n,"minute",a[p]),t.isNullOrUndefined(i[d].slack)?i[d].slack=u:i[d].slack>u&&0!==i[d].slack&&(i[d].slack=u)),D.endDate>=n&&D.endDate<=n&&(i[d].slack=0)),i[d].from&&e.push({fromdata:i[d].from,todateID:i[d].taskid,fromDataPredecessor:i[d].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),("number"==typeof i[a][this.parent.taskFields.id]?parseInt(l[p].from,10):l[p].from)===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){this.parent.ganttChartModule.chartElement;this.parent.removeCriticalPathStyles();for(var a=this,s=0;s<e.length;s++)!function(i){var r;if("ProjectView"===a.parent.viewType)r=a.parent.flatData[a.parent.ids.indexOf(e[i].toString())];else for(var n=a.parent.flatData.filter(function(t){return t.ganttProperties.taskId.toString()===e[i].toString()}),s=0;s<n.length;s++)(n[s].ganttProperties.isCritical||n[s].ganttProperties.endDate>=a.maxEndDate)&&(r=n[s]);var o=a.parent.currentViewData.indexOf(r),l=a.parent.getRowByIndex(o),d=void 0,p=a.parent.taskFields;if(r&&r.parentItem){var h=a.parent.currentViewData.filter(function(e){return r.parentItem.uniqueID===e.uniqueID}),c=a.parent.flatData.indexOf(h[0]),u=a.parent.getRowByIndex(c);if(u)for(var g=u.querySelectorAll(".e-taskbar-main-container"),f=0;f<g.length;f++)g[f].getAttribute("rowuniqueid")===r.rowUniqueID&&t.addClass(g[f].querySelectorAll(".e-gantt-child-taskbar-inner-div"),"e-gantt-child-critical-taskbar-inner-div")}d=a.parent.allowUnscheduledTasks&&!r[p.startDate]&&!r[p.endDate]&&r[p.duration]?"e-gantt-critical-unscheduled-taskbar":"e-gantt-child-critical-progressbar-inner-div",l&&("ProjectView"===a.parent.viewType||"ResourceView"===a.parent.viewType&&!r.hasChildRecords)&&(l.getElementsByClassName("e-milestone-top")[0]&&t.addClass(l.querySelectorAll(".e-milestone-top"),"e-critical-milestone-top"),l.getElementsByClassName("e-milestone-bottom")[0]&&t.addClass(l.querySelectorAll(".e-milestone-bottom"),"e-critical-milestone-bottom"),l.getElementsByClassName("e-gantt-child-taskbar-inner-div").length>0&&t.addClass(l.querySelectorAll(".e-gantt-child-taskbar-inner-div"),"e-gantt-child-critical-taskbar-inner-div"),l.getElementsByClassName("e-gantt-child-progressbar-inner-div").length>0&&t.addClass(l.querySelectorAll(".e-gantt-child-progressbar-inner-div"),d))}(s);if(0!==i.length)for(var o=0,l=void 0,d=[],p=void 0,h=void 0,s=0;s<this.criticalPathCollection.length;s++)if(o=n.indexOf(this.criticalPathCollection[s]),l=i[o],-1!==o&&l.to){d=l.to.split(",");for(var c=0;c<d.length;c++)h=d[c].split("+"),d[c].indexOf("-")>=0&&(h=d[c].split("-")),p=h[0].replace(":",""),"number"==typeof e[c]&&(p=parseInt(h[0],10)),-1!==e.indexOf(p)&&this.parent.element.querySelectorAll("#ConnectorLineparent"+l.taskid+"child"+p).length>0&&(t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+l.taskid+"child"+p)[0].querySelectorAll(".e-line"),"e-criticalconnector-line"),t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+l.taskid+"child"+p)[0].querySelectorAll(".e-connector-line-right-arrow"),"e-criticalconnector-line-right-arrow"),t.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+l.taskid+"child"+p)[0].querySelectorAll(".e-connector-line-left-arrow"),"e-criticalconnector-line-left-arrow"))}},e.prototype.getModuleName=function(){return"criticalPath"},e.prototype.destroy=function(){!this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(this.parent.criticalPathModule=void 0)},e}(),Ct=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,enableRtl:this.parent.enableRtl,target:e,animationSettings:{effect:"None"},select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-gantt"}),this.contextMenu.appendTo(this.element),this.parent.treeGrid.contextMenuItems=this.headerMenuItems},e.prototype.contextMenuItemClick=function(e){this.item=this.getKeyFromId(e.item.id);var 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":isNaN(Number(this.rowData.ganttProperties.rowUniqueID))?this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID):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){t.isNullOrUndefined(i.parent.loadingIndicator)||"Shimmer"!==i.parent.loadingIndicator.indicatorType?i.parent.showSpinner():i.parent.showMaskRow(),i.parent.chartRowsModule.splitTask(i.rowData[r.id],n)})},e.prototype.mergeCall=function(e){var i=this;this.isEdit=!0;var r=this.parent.taskFields,n=this.rowData.ganttProperties.segments,a=[{firstSegmentIndex:"Right"===e?this.segmentIndex:n[this.segmentIndex-1].segmentIndex,secondSegmentIndex:"Left"===e?this.segmentIndex:n[this.segmentIndex+1].segmentIndex}],s={rowData:this.rowData,mergeSegmentIndexes:a,requestType:"mergeSegment",cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",s,function(e){t.isNullOrUndefined(i.parent.loadingIndicator)||"Shimmer"!==i.parent.loadingIndicator.indicatorType?i.parent.showSpinner():i.parent.showMaskRow(),!1===e.cancel&&i.parent.chartRowsModule.mergeTask(i.rowData[r.id],a)})},e.prototype.getClickedDate=function(e){var i;if(this.parent.enableRtl){var r=this.parent.element.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,a=document.documentElement.clientLeft||document.body.clientLeft||0;i=r.left+n-a}else i=this.parent.getOffsetRect(this.parent.element).left;var s,o;this.parent.enableRtl?(s=Math.abs(i+this.parent.ganttChartModule.chartElement.offsetWidth-this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft),o=Math.abs(this.clickedPosition-s)):(s=i+this.parent.ganttChartModule.chartElement.offsetLeft+this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft,o=this.clickedPosition-s);var l=Math.ceil(o/this.parent.perDayWidth),d=this.rowData.ganttProperties.startDate;return t.isNullOrUndefined(this.parent.timelineSettings.bottomTier)||"Hour"!==this.parent.timelineSettings.bottomTier.unit||(l=Math.ceil(o/this.parent.timelineSettings.timelineUnitSize),l-=1),this.parent.dataOperation.getEndDate(d,l,"None"!==this.parent.timelineSettings.bottomTier.unit?this.parent.timelineSettings.bottomTier.unit.toLocaleLowerCase():this.parent.timelineSettings.topTier.unit.toLocaleLowerCase(),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")||r.parentElement.classList.contains("e-treecolumn-container"))&&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[parseInt(o.toString(),10)]);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(G,"ToTask",this.getLocale("toTask"))):s.push(this.createItemModel(G,"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(G,"Manual",this.getLocale("manual"))):s.push(this.createItemModel(G,"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[parseInt(d.toString(),10)].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[parseInt(c.toString(),10)].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[parseInt(r.toString(),10)].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(G,"Right",this.getLocale("right"))):this.segmentIndex===s.length-1?r.push(this.createItemModel(G,"Left",this.getLocale("left"))):(r.push(this.createItemModel(G,"Right",this.getLocale("right"))),r.push(this.createItemModel(G,"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.isNullOrUndefined(i)||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(G,e,this.getLocale("taskInformation"),this.getIconCSS("e-edit",t));break;case"Indent":i=this.createItemModel(G,e,this.getLocale("indent"),this.getIconCSS("e-indent",t));break;case"Outdent":i=this.createItemModel(G,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(G,e,this.getLocale("add"),this.getIconCSS("e-add",t))).items=[],i.items.push(this.createItemModel(G,"Above",this.getLocale("above"),this.getIconCSS("e-add-above",t))),i.items.push(this.createItemModel(G,"Below",this.getLocale("below"),this.getIconCSS("e-add-below",t))),"ResourceView"!==this.parent.viewType&&i.items.push(this.createItemModel(G,"Child",this.getLocale("child"))),i.items.push(this.createItemModel(G,"Milestone",this.getLocale("milestone")));break;case"DeleteTask":i=this.createItemModel(G,e,this.getLocale("deleteTask"),this.getIconCSS("e-delete",t));break;case"DeleteDependency":(i=this.createItemModel(G,e,this.getLocale("deleteDependency"))).items=[],i.items.push({});break;case"Convert":(i=this.createItemModel(G,e,this.getLocale("convert"))).items=[],i.items.push({});break;case"TaskMode":(i=this.createItemModel(G,e,this.getLocale("changeScheduleMode"))).items=[],i.items.push({});break;case"SplitTask":i=this.createItemModel(G,e,this.getLocale("splitTask"));break;case"MergeTask":(i=this.createItemModel(G,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(G,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}(),Rt=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(i){e.parent.trigger("beforeExcelExport",i),t.isNullOrUndefined(e.parent.loadingIndicator)||"Shimmer"!==e.parent.loadingIndicator.indicatorType?e.parent.showSpinner():e.parent.showMaskRow()},this.parent.treeGrid.excelQueryCellInfo=function(t){e.parent.trigger("excelQueryCellInfo",t)},this.parent.treeGrid.excelHeaderQueryCellInfo=function(t){e.parent.trigger("excelHeaderQueryCellInfo",t)},this.parent.treeGrid.excelExportComplete=function(i){e.parent.trigger("excelExportComplete",i),t.isNullOrUndefined(e.parent.loadingIndicator)||"Shimmer"!==e.parent.loadingIndicator.indicatorType?e.parent.hideSpinner():e.parent.hideMaskRow()}},e}(),Mt=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}(),Ot=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&&(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),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),e.cancel||(this.dropRows(e,!0),e.cancel=!0))},e.prototype.dropRows=function(e,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=this,p=0;p<l;p++){var h=function(e){if(d.parent.isOnEdit=!0,n=a[e],d.draggedRecord=n,"Invalid"!==d.dropPosition){if("ResourceView"===d.parent.viewType&&(d.checkisSharedTask(),d.previousParent=d.draggedRecord.parentItem.uniqueID),d.isSharedTask)return{value:void 0};i&&d.deleteDragRow();var l=d.treeGridData.indexOf(s);if("topSegment"===d.dropPosition&&d.dropAtTop(l),"bottomSegment"===d.dropPosition&&!d.isSharedTask){if(s.hasChildRecords){if(o=d.parent.editModule.getChildCount(s,0),d.parent.taskFields.parentID&&d.ganttData.length>0&&d.ganttData.splice(l+o+1,0,d.draggedRecord.taskData),d.treeGridData.splice(l+o+1,0,d.draggedRecord),d.parent.ids.splice(l+o+1,0,d.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===d.parent.viewType){var p=0===d.draggedRecord.level?"R"+d.draggedRecord.ganttProperties.taskId:"T"+d.draggedRecord.ganttProperties.taskId;d.parent.getTaskIds().splice(l+o+1,0,p)}}else if(d.parent.taskFields.parentID&&d.ganttData.length>0&&d.ganttData.splice(l+1,0,d.draggedRecord.taskData),d.treeGridData.splice(l+1,0,d.draggedRecord),d.parent.ids.splice(l+1,0,d.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===d.parent.viewType){var h=0===d.draggedRecord.level?"R"+d.draggedRecord.ganttProperties.taskId:"T"+d.draggedRecord.ganttProperties.taskId;d.parent.getTaskIds().splice(l+1,0,h)}if(d.parent.setRecordValue("parentItem",d.treeGridData[l].parentItem,n),d.parent.setRecordValue("parentUniqueID",d.treeGridData[l].parentUniqueID,n),d.parent.setRecordValue("level",d.treeGridData[l].level,n),n.hasChildRecords){d.updateChildRecordLevel(n,1),d.updateChildRecord(n,l+o+1)}if(s.parentItem){var c=d.parent.getParentTask(s.parentItem).childRecords,u=c.indexOf(s)+1;c.splice(u,0,n)}}if("middleSegment"===d.dropPosition&&(d.dropMiddle(l),s.childRecords.length>0&&(delete s.ganttProperties.segments,delete s.taskData[d.parent.taskFields.segments])),0!=d.treeGridData.length)for(var g=0;g<d.treeGridData.length;g++)if(d.treeGridData[parseInt(g.toString(),10)].index=g,!t.isNullOrUndefined(d.treeGridData[parseInt(g.toString(),10)].parentItem)){var f=t.getValue("uniqueIDCollection."+d.treeGridData[parseInt(g.toString(),10)].parentUniqueID,d.parent.treeGrid);d.treeGridData[parseInt(g.toString(),10)].parentItem.index=f.index}t.isNullOrUndefined(n.parentItem&&-1!==d.updateParentRecords.indexOf(n.parentItem))||d.updateParentRecords.push(n.parentItem)}if(!d.parent.enableVirtualization){var m=r.flatData,y=void 0,v=void 0,D=d.parent.dataSource,w=d.parent.taskFields.id;if(n.index<s.index){y=n.index;for(var k=0;k<D.length&&"break"!==function(e){var t=d.parent.currentViewData.filter(function(t){return t[w]===D[e][w]})[0];if(t&&t.index>s.index)return v=t.index,"break"}(k);k++);}else{y=s.index;for(var b=0;b<D.length&&"break"!==function(e){var t=d.parent.currentViewData.filter(function(t){return t[w]===D[e][w]})[0];if(t&&t.index>n.index)return v=t.index,"break"}(b);b++);}for(var T=y;T<=v;T++)!function(e){if(!t.isNullOrUndefined(m[e])&&(m[e].index=e,!t.isNullOrUndefined(m[e].parentItem))){var i=m.filter(function(t){return t.uniqueID===m[e].parentUniqueID})[0];m[e].parentItem.index=i.index}}(T)}r.rowDragAndDropModule.refreshDataSource()}(p);if("object"==typeof h)return h.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 c=void 0;c="middleSegment"===this.dropPosition?this.droppedRecord.uniqueID:this.droppedRecord.parentItem?this.droppedRecord.parentItem.uniqueID:this.droppedRecord.uniqueID;var u=this.parent.getTaskByUniqueID(c),g={};g[this.parent.taskFields.resourceInfo]=[],g[this.parent.taskFields.resourceInfo].push(u.ganttProperties.taskId),this.removeExistingResources();var f=this.parent.dataOperation.setResourceInfo(g),m=this.draggedRecord;t.isNullOrUndefined(m.ganttProperties.resourceInfo)&&(m.ganttProperties.resourceInfo=[]),"Unassigned Task"===u.ganttProperties.taskName?(m.ganttProperties.resourceInfo=[],m.ganttProperties.sharedTaskUniqueIds=[m.ganttProperties.rowUniqueID]):m.ganttProperties.resourceInfo.push(f[0]),this.updateCurrentTask(m),"Unassigned Task"===u.ganttProperties.taskName?this.deleteSharedResourceTask():this.updateSharedResourceTask()}if(this.parent.taskFields.dependency&&this.parent.allowParentDependency){var y,v=!0,D=void 0;D=n.parentItem?this.parent.flatData[this.parent.ids.indexOf(n.parentItem.taskId)]:n;var w=void 0;if((y=s.parentItem?this.parent.flatData[this.parent.ids.indexOf(s.parentItem.taskId)]:s).uniqueID===D.uniqueID||D.parentItem&&y.uniqueID===this.parent.flatData[this.parent.ids.indexOf(D.parentItem.taskId)].uniqueID){w=this.parent.currentViewData.filter(function(e){if(e.ganttProperties.predecessor&&e.ganttProperties.predecessor.length>0)for(var t=0;t<e.ganttProperties.predecessor.length;t++)return parseInt(e.ganttProperties.predecessor[t].to)===parseInt(y.ganttProperties.taskId)||parseInt(e.ganttProperties.predecessor[t].from)===parseInt(y.ganttProperties.taskId);return null});for(var k=[],p=0;p<w.length;p++){if(k=[],w[p].ganttProperties.predecessor)for(var b=0;b<w[p].ganttProperties.predecessor.length;b++)parseInt(w[p].ganttProperties.taskId)!==parseInt(w[p].ganttProperties.predecessor[b].from)?k.push(w[p].ganttProperties.predecessor[b].from):k.push(w[p].ganttProperties.predecessor[b].to);for(var T=this,S=0;S<k.length;S++)!function(e){var t=k[e].replace(/\D/g,""),i=T.parent.currentViewData.filter(function(e){return parseInt(e.ganttProperties.taskId)==parseInt(t)});(v=T.parent.connectorLineEditModule.validateParentPredecessor(w[p],i[0]))||(T.parent.dataOperation.resetDependency(w[p]),T.parent.dataOperation.resetDependency(i[0]))}(S)}}}for(S=0;S<this.updateParentRecords.length;S++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[S]);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){if(e[0],0)return;"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var r=[],n=0;n<e.length;n++)r[n]=this.parent.updatedRecords[e[n]];var a={data:r,dropIndex:t,dropPosition:this.dropPosition};this.dropRows(a,!0)}},e}(),xt=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}(),It=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}(),Et=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}(),Nt=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}(),Ft=function(){function e(){}return e}(),Ut=function(){function t(){this.cellSpacing=0,this.borderOverlapStyle=u.PdfBorderOverlapStyle.Overlap,this.allowHorizontalOverflow=!1,this.horizontalOverflowType=e.PdfHorizontalOverflowType.LastPage,this.cellPadding=new Nt}return t}(),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(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 Vt(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 It,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===Et.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(Et.default.right.width/2,Et.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 Bt(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,r>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=t.cells.getCell(s),d=l.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),Bt=function(e){function t(t,i){return e.call(this,t,i)||this}return Vt(t,e),t}(u.PdfLayoutResult),At=function(e){function t(t){return void 0===t?e.call(this)||this:e.call(this,t)||this}return Vt(t,e),t}(u.PdfLayoutFormat),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)}}(),Wt=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 Yt(t),t.rows=new zt(t),t.headers=new _t(t),t.style=new Ut,t.rowHeight=0,t}return Ht(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{for(var t=[],r=0,n=0,a=this.columns.count,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+=(r=this.headers.getHeader(i)).height;for(i=0;i<this.rows.count;i++){var r=this.rows.getRow(i);e+=r.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===Et.default.right.width/2&&e.bounds.y===Et.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}}}return this.setSpan(),this.layouter=new Lt(this),this.layouter.layoutInternal(e)},t.prototype.onBeginCellDraw=function(e){this.raiseBeginCellDraw&&this.beginCellDraw(this,e)},t.prototype.onEndCellDraw=function(e){this.raiseEndCellDraw&&this.endCellDraw(this,e)},t.prototype.setSpan=function(){for(var e=1,t=1,i=0,r=0,n=0,a=this.headers.count,s=0;s<a;s++){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++)for(var p=this.rows.getRow(s),h=p.cells.count,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),jt=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);this.row.treegrid.ganttStyle.font&&(i=this.row.treegrid.ganttStyle.font),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);this.row.treegrid.ganttStyle.font&&(s=this.row.treegrid.ganttStyle.font),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,i>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),this.row.treegrid.ganttStyle.font&&(l=this.row.treegrid.ganttStyle.font);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 Wt){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}(),qt=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 jt;return this.add(t),e}e.row=this.treegridRow,this.cells.push(e)},e.prototype.indexOf=function(e){return this.cells.indexOf(e)},e}(),Gt=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 qt(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}(),zt=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 Gt(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 jt);this.rows.push(e)},e.prototype.getRow=function(e){return this.rows[e]},e}(),_t=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}(),Xt=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}(),Yt=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 Xt(this.treegrid));for(var i=0;i<this.treegrid.rows.count;i++){var r=this.treegrid.rows.getRow(i),n=new jt;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}(),Zt=function(){function e(e){this.parent=e}return e.prototype.processGridExport=function(e,t,i){this.flatData=e,this.gantt=t,this.exportValueFormatter=new Qt(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=T(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=T(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=T(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=T(e.parent.connectorLineWidth>5?5: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 Nt,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=T(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 Et,t.style.borders.all=new u.PdfPen(t.style.borderColor),t.style.padding=new Nt;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.padding&&(t.style.padding=e.padding),e.borders&&(t.style.borders=e.borders)},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);this.ganttStyle.font&&(l=this.ganttStyle.font);var 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}(),Qt=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}(),Kt=function(){return(Kt=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)},Jt=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=T(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);!t.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(p=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var 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=T((this.parent.rowHeight-this.height)/2);m=e.section.indexOf(e);var b=t.isNullOrUndefined(this.unscheduleStarteDate)?this.startDate:this.unscheduleStarteDate,S=t.isNullOrUndefined(this.unscheduleEndDate)?this.endDate:this.unscheduleEndDate;if(r.startDate<=b&&S<=r.endDate)this.isStartPoint||(this.taskStartPoint=Kt({},i),this.isStartPoint=!0),this.isScheduledTask||"duration"===this.unscheduledTaskBy?(o.drawRectangle(y,v,i.x+T(this.left-n)+.5,i.y+k,T(s.width),T(s.height)),this.isScheduledTask&&(o.drawRectangle(D,w,i.x+T(this.left-n)+.5,i.y+k,T(s.progressWidth),T(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+T(this.left-n),i.y+k,T(g),T(this.height),c)))):this.drawUnscheduledTask(o,i,n,k),this.isCompleted=!0,this.startPage=m,this.endPage=m;else if(r.startDate<=b&&r.endDate>=b&&S>=r.endDate){this.isStartPoint||(this.taskStartPoint=Kt({},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+T(this.left-n)+.5,i.y+k,T(P),T(s.height)),s.width=s.width-P,this.isScheduledTask){C=0;C=this.progressWidth<=P?this.progressWidth:P,o.drawRectangle(D,w,i.x+T(this.left-n)+.5,i.y+k,T(C),T(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+T(this.left-n),i.y+k,T(g),T(this.height),c))}}else this.drawUnscheduledTask(o,i,n,k);this.left=0,this.isCompleted=!1,this.startPage=m}else if(S<=r.endDate&&r.startDate<=S&&!this.isCompleted)this.isStartPoint||(this.taskStartPoint=Kt({},i),this.isStartPoint=!0),o.drawRectangle(y,v,i.x+T(s.left+.5),i.y+k,T(s.width),T(s.height)),this.isScheduledTask&&(o.drawRectangle(D,w,i.x+T(s.left+.5),i.y+k,T(s.progressWidth),T(s.height)),t.isNullOrUndefined(this.taskLabel)||(g=this.progressWidth,f&&(g=this.width),o.drawString(this.taskLabel.toString(),p,null,h,i.x+T(this.left),i.y+k,T(g),T(this.height),c))),this.isCompleted=!0,this.endPage=m;else if(b<r.startDate&&S>r.endDate){if(this.isStartPoint||(this.taskStartPoint=Kt({},i),this.isStartPoint=!0),o.drawRectangle(y,v,i.x+T(s.left)+.5,i.y+k,T(r.totalWidth),T(s.height)),this.isScheduledTask){var C=0;C=this.progressWidth<=r.totalWidth?this.progressWidth:r.totalWidth,o.drawRectangle(D,w,i.x+T(s.left)+.5,i.y+k,T(C),T(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+T(this.left),i.y+k,T(g),T(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:T(this.rightTaskLabel.left))-T(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);!t.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(d=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var p=(T(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{d=this.getWidth(this.leftTaskLabel.value,Number.MAX_VALUE,15);a=T(o-(this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33))-d.actualSize.width,this.leftTaskLabel.left=a,this.leftTaskLabel.isLeftCalculated=!0}var l=a-T(n)+i.x;if(r.startPoint<=a&&a<r.endPoint&&!t.isNullOrUndefined(this.leftTaskLabel.value)&&!this.leftTaskLabel.isCompleted){var d=this.getWidth(this.leftTaskLabel.value,r.endPoint-a,15),p=new u.PdfStandardFont(this.fontFamily,9);!t.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(p=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var h=(T(this.parent.rowHeight)-d.actualSize.height)/2,c=new u.PointF(l,i.y+h),g=new u.SizeF(d.actualSize.width,d.actualSize.height),f=new u.RectangleF(c,g),m=new u.PdfStringFormat;if(m.alignment=u.PdfTextAlignment.Right,m.lineAlignment=u.PdfVerticalAlignment.Middle,d.actualSize.width>0){var y=new u.PdfSolidBrush(this.labelColor);s.drawString(d.lines[0].text,p,null,y,f.x,f.y,d.actualSize.width,d.actualSize.height,m),null!==d.remainder?(this.leftTaskLabel.value=d.remainder,this.leftTaskLabel.left=r.endPoint):this.leftTaskLabel.isCompleted=!0}else this.leftTaskLabel.left=r.endPoint}}},e.prototype.getWidth=function(e,i,r){var n=new u.PdfStandardFont(this.fontFamily,9);!t.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(n=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font);var a=new u.PdfStringLayouter,s=new u.PdfStringFormat;return s.alignment=u.PdfTextAlignment.Left,s.wordWrap=u.PdfWordWrapType.Character,s.lineAlignment=u.PdfVerticalAlignment.Middle,a.layout(e,n,s,new u.SizeF(i,r),!1,new u.SizeF(i,r))},e.prototype.drawUnscheduledTask=function(e,t,i,r){var n=new u.PdfSolidBrush(this.taskColor);e.drawRectangle(n,t.x+T(this.left-i),t.y+r,T(3),T(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=Kt({},t);var s=new u.PdfPen(this.milestoneColor),o=T((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+T(this.left-r),t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2),n.rotateTransform(45),n.drawRectangle(s,l,0,0,T(d),T(d)),n.restore(),this.endPage=this.startPage=a}},e}(),$t=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){l=!1;this.topTier[this.topTierIndex].isFinished||(r>=a.width?(n=a.width,a.isFinished=!0,a.completedWidth=n,l=!0):(n=r,l=!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+=T(n),r-=n,l&&this.topTierIndex++}else r=0}r=Math.floor(i.totalWidth);var s=this.parent.timelineModule.isSingleTier?0:this.topTierHeight;for(this.bottomTierPoint=new u.PointF(t.x,T(t.y+s));r>0;){var o=this.bottomTier[this.bottomTierIndex];if(this.bottomTier.length>this.bottomTierIndex){var l=!0,d=o.width;r<d&&(d=r,l=!1,o.completedWidth=d),this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,d,o.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+T(d),r-=d,o.completedWidth=d,l&&this.bottomTierIndex++}else r=0}},e.prototype.drawPageTimeline=function(e,i,r){this.topTierPoint=t.extend({},{},i,!0);for(a=this.prevTopTierIndex;a<=this.topTierIndex;a++)if(this.topTier.length>a){var n=this.topTier[a];n.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,n.completedWidth,n.value,!0),this.topTierPoint.x+=T(n.completedWidth))}this.bottomTierPoint.x=i.x,this.bottomTierPoint.y=T(i.y+this.topTierHeight);for(var a=this.prevBottomTierIndex;a<=this.bottomTierIndex;a++)if(this.bottomTier.length>a){var s=this.bottomTier[a];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+T(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,T(a),T(n));var y=new u.PdfStandardFont(p.fontFamily,g.fontSize,g.fontStyle);p.font&&(y=p.font);var 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,T(a),T(n),g.format)},e}(),ei=function(){return(ei=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)},ti=function(){function e(e,t){this.parent=e,this.pdfGantt=t}return e.prototype.add=function(){return new e(this.parent)},e.prototype.findindex=function(e,t){var i;return"CurrentViewData"===t.exportType?this.parent.currentViewData.map(function(t,r){t.index==e&&(i=r)}):this.parent.flatData.map(function(t,r){t.index==e&&(i=r)}),i},e.prototype.drawPredecessor=function(e,i){this.pdfGantt=e;var r,n,a=e.result.page.section.getPages(),s=e.taskbarCollection[this.findindex(this.parentIndex,i)],o=e.taskbarCollection[this.findindex(this.childIndex,i)],l=new u.PdfPage,d=new u.PdfPage,p="",h=0,c=0;switch(this.type){case"FS":if(!(!t.isNullOrUndefined(o)&&o.startPage>-1&&!t.isNullOrUndefined(s)&&s.endPage>-1))return;l=a[s.endPage],d=a[o.startPage],r=e.pdfPageDetail[s.endPage-e.chartPageIndex],n=e.pdfPageDetail[o.startPage-e.chartPageIndex],p=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(!(!t.isNullOrUndefined(o)&&o.endPage>-1&&!t.isNullOrUndefined(s)&&s.startPage>-1))return;l=a[s.startPage],d=a[o.endPage],r=e.pdfPageDetail[s.endPage-e.chartPageIndex],n=e.pdfPageDetail[o.startPage-e.chartPageIndex],p=this.parentIndex<this.childIndex?this.parentLeft>this.childLeft+this.childWidth?"SFType1":"SFType2":this.parentLeft>this.childLeft+this.childWidth?"SFType3":"SFType4";break;case"FF":if(!(!t.isNullOrUndefined(o)&&o.endPage>-1&&!t.isNullOrUndefined(s)&&s.endPage>-1))return;l=a[s.endPage],d=a[o.endPage],r=e.pdfPageDetail[s.endPage-e.chartPageIndex],n=e.pdfPageDetail[o.endPage-e.chartPageIndex],p=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(!(!t.isNullOrUndefined(o)&&o.startPage>-1&&!t.isNullOrUndefined(s)&&s.startPage>-1))return;l=a[s.startPage],d=a[o.startPage],r=e.pdfPageDetail[s.startPage-e.chartPageIndex],n=e.pdfPageDetail[o.startPage-e.chartPageIndex],p=this.parentIndex<this.childIndex?this.parentLeft>=this.childLeft?"SSType1":"SSType2":this.parentLeft>=this.childLeft?"SSType3":"SSType4"}var g=Math.round((this.parent.rowHeight-1)/2);g=T(g);var f,m,y,v,D,w;f=m=y=v=D=w=new u.PointF;var k=ei({},s.taskStartPoint),b=ei({},o.taskStartPoint);h=k.y+r.startPoint.y,c=b.y+n.startPoint.y;var S=new u.PointF(T(this.parentLeft+this.parentWidth),h+g),P=new u.PointF(T(this.parentLeft)-1,h+g),C=new u.PointF(T(this.childLeft-20),c+g),R=new u.PointF(T(this.childLeft-6-this.lineWidth)-1,c+g),M=new u.PointF(T(this.childLeft+this.childWidth+6+this.lineWidth)+1,c+g);switch(p){case"FSType1":case"FSType3":f=S,m=new u.PointF(T(this.childLeft-20),h+g),y=C,v=R,this.connectLines(l,d,f,m,y,v,o,g);break;case"FSType2":f=S,m=new u.PointF(f.x+10,h+g),y=new u.PointF(f.x+10,c+2),v=new u.PointF(T(this.childLeft-20),c+2),D=C,w=R,this.connectLines(l,d,f,m,y,v,o,g,D,w);break;case"FSType4":f=S,m=new u.PointF(f.x+10,h+g),y=new u.PointF(f.x+10,h+2),v=new u.PointF(T(this.childLeft-20),h+2),D=C,w=R,this.connectLines(l,d,f,m,y,v,o,g,D,w);break;case"FFType1":case"FFType3":f=new u.PointF(T(this.parentLeft+this.parentWidth)+1,h+g),m=new u.PointF(T(this.childLeft+this.childWidth+20),h+g),y=new u.PointF(m.x,c+g),v=M,this.connectLines(l,d,f,m,y,v,o,g);break;case"FFType2":case"FFType4":f=new u.PointF(T(this.parentLeft+this.parentWidth)+1,h+g),m=new u.PointF(T(this.parentLeft+this.parentWidth+20),h+g),y=new u.PointF(m.x,c+g),v=M,this.connectLines(l,d,f,m,y,v,o,g);break;case"SSType1":case"SSType3":f=P,m=new u.PointF(T(this.childLeft-20),h+g),y=new u.PointF(m.x,c+g),v=R,this.connectLines(l,d,f,m,y,v,o,g);break;case"SSType2":case"SSType4":f=P,m=new u.PointF(T(this.parentLeft-20),h+g),y=new u.PointF(m.x,c+g),v=R,this.connectLines(l,d,f,m,y,v,o,g);break;case"SFType1":case"SFType3":f=P,m=new u.PointF(T(this.childLeft+this.childWidth+20),h+g),y=new u.PointF(m.x,c+g),v=M,this.connectLines(l,d,f,m,y,v,o,g);break;case"SFType2":f=P,m=new u.PointF(T(this.parentLeft-20),h+g),y=new u.PointF(m.x,c+2),v=new u.PointF(T(this.childLeft+this.childWidth+20),c+2),D=new u.PointF(v.x,c+g),w=M,this.connectLines(l,d,f,m,y,v,o,g,D,w);break;case"SFType4":f=P,m=new u.PointF(T(this.parentLeft-20),h+g),y=new u.PointF(m.x,h+2),v=new u.PointF(T(this.childLeft+this.childWidth+20),h+2),D=new u.PointF(v.x,c+g),w=M,this.connectLines(l,d,f,m,y,v,o,g,D,w)}},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=ei({},i),s=ei({},i),o=ei({},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+=T(this.parent.timelineModule.isSingleTier?45:62))):y>i.y&&(s.y=o.y=y-1,i.y=y,this.pdfGantt.enableHeader&&(o.y+=T(this.parent.timelineModule.isSingleTier?45:62),i.y+=T(this.parent.timelineModule.isSingleTier?45: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,T(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;if(s="FS"===this.type||"SS"===this.type?new u.PointF(T(this.childLeft)-1,t.taskStartPoint.y+n.startPoint.y):new u.PointF(T(this.childLeft+this.childWidth)+1,t.taskStartPoint.y+n.startPoint.y),!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-T(l),h.y-T(l)):new u.PointF(h.x+T(l),h.y-T(l));var c=new u.PointF(r.x,r.y+T(2*l)),g=new u.PdfSolidBrush(this.connectorLineColor),f=new u.PdfPen(g,T(this.lineWidth));p.drawLine(f,h,r),p.drawLine(f,r,c),p.drawLine(f,c,h)},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(){return(ri=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)},ni=function(e){function i(t){var i=e.call(this)||this;return i.exportProps={},i.parent=t,i.chartHeader=new $t(i),i.predecessor=new ti(t,i),i.headerDetails=[],i.pdfPageDetail=[],i.taskbarCollection=[],i.predecessorCollection=[],i}return ii(i,e),Object.defineProperty(i.prototype,"taskbar",{get:function(){return t.isNullOrUndefined(this.taskbars)&&(this.taskbars=new Jt(this.parent)),this.taskbars},enumerable:!0,configurable:!0}),i.prototype.drawChart=function(e,t){this.result=e,this.totalPages=this.result.page.section.count,this.perColumnPages=this.totalPages/this.layouter.columnRanges.length,this.calculateRange(),this.drawGantttChart(t),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=T(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=T(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=S(o-s)):(h[1]=s+g,p.totalWidth=S(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.timelineModule.timelineStartDate),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(S(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(S(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(S(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(S(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/T(this.chartHeader.bottomTierCellWidth));p.startDate.setDate(p.startDate.getDate()+k*m);var b=Math.round((p.endPoint-p.startPoint)/T(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+b*m);break;case"Week":p.startDate=new Date(f.getTime());var P=p.startPoint/T(this.chartHeader.bottomTierCellWidth)*7;p.startDate.setDate(p.startDate.getDate()+P*m);var C=7*Math.round((p.endPoint-p.startPoint)/T(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 R=p.startPoint/T(this.chartHeader.bottomTierCellWidth)*31;p.startDate.setDate(p.startDate.getDate()+R*m);var M=31*Math.round((p.endPoint-p.startPoint)/T(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+M*m);break;case"Year":p.startDate=new Date(f.getTime());var O=p.startPoint/T(this.chartHeader.bottomTierCellWidth)*365;p.startDate.setDate(p.startDate.getDate()+O*m);var x=365*Math.round((p.endPoint-p.startPoint)/T(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(e){var t,i=this,r=this.startPoint,n=new u.PointF,a=0,s=0,o=0;this.headerDetails.forEach(function(e,l){var d=i.result.page.section.getPages()[i.startPageIndex];i.chartHeader.drawTimeline(d,i.startPoint,e),r.y=r.y+T(i.parent.timelineModule.isSingleTier?45:60),a=r.x,o=T(i.parent.timelineModule.isSingleTier?45:60),i.headerDetails[i.headerDetails.indexOf(e)].startIndex=i.startPageIndex,i.headerDetails[i.headerDetails.indexOf(e)].pageStartPoint=r;for(var p=0;p<i.taskbarCollection.length;p++){var h=i.taskbarCollection[p],c=i.rows.getRow(p+1).height,g=i.result.page.section.getPages()[i.startPageIndex];h.drawTaskbar(g,r,e,s,c,i.taskbarCollection[p])&&(i.enableHeader?r.y=T(i.parent.timelineModule.isSingleTier?45:60):r.y=0,i.startPageIndex++,(t={}).height=o,t.pageStartX=a,t.startPoint=ri({},n),t.width=T(e.totalWidth),i.pdfPageDetail.push(t),n.y+=t.height,i.enableHeader?o=i.chartHeader.height:(r.y=0,o=0)),r.y+=c,o+=c}i.headerDetails[l].endIndex=i.startPageIndex,s+=e.totalWidth,(t={}).height=o,t.pageStartX=a,t.startPoint=ri({},n),t.width=T(e.totalWidth),i.pdfPageDetail.push(t),n.x+=t.width,n.y=0,i.enableHeader?o=i.chartHeader.height:r.y=0,i.headerDetails.indexOf(e)!==i.headerDetails.length-1&&(i.result.page.section.add(),i.startPageIndex=i.result.page.section.count-1,r=i.startPoint=new u.PointF(0,0))});for(var l=0;l<this.predecessorCollection.length;l++)this.predecessorCollection[l].drawPredecessor(this,e)},i}(Wt),ai=function(){function e(e){this.isPdfExport=!1,this.parent=e,this.helper=new Zt(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 ni(this.parent)},e.prototype.export=function(e,i,r,n){var a=this;this.isBlob=n;var s={requestType:"beforePdfExport",ganttObject:this.parent,cancel:!1};return this.parent.trigger("beforePdfExport",s),t.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),t.getValue("cancel",s)?new Promise(function(e,t){return e()}):new Promise(function(t,n){a.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",a.isBlob?{promise:a.blobPromise}:{}),t.isNullOrUndefined(a.parent.loadingIndicator)||"Shimmer"!==a.parent.loadingIndicator.indicatorType?a.parent.hideSpinner():a.parent.hideMaskRow(),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 At;e.break=u.PdfLayoutBreakType.FitElement;var a=n.gantt.drawGrid(s,0,0,e);return n.gantt.drawChart(a,i),r||(n.isBlob?n.blobPromise=n.pdfDocument.save():!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 xt(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 xt(i.theme).style;else{var n=new xt(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}(),si=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}();return ot.Inject(vt,wt,Dt,mt,yt,ft,St,kt,Ct,Rt,Ot,Mt,ai,si,Pt),e.Gantt=ot,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=b,e.pixelToPoint=T,e.pointToPixel=S,e.getUid=P,e.load="load",e.rowDataBound="rowDataBound",e.queryCellInfo="queryCellInfo",e.toolbarClick="toolbarClick",e.keyPressed="key-pressed",e.Edit=ft,e.Reorder=mt,e.Resize=yt,e.Filter=vt,e.Sort=Dt,e.Dependency=et,e.Selection=wt,e.Toolbar=kt,e.DayMarkers=St,e.CriticalPath=Pt,e.ContextMenu=Ct,e.ExcelExport=Rt,e.ColumnMenu=Mt,e.RowDD=Ot,e.PdfExport=ai,e.VirtualScroll=si,e.Column=K,e.DayWorkingTime=te,e.AddDialogFieldSettings=ne,e.EditDialogFieldSettings=oe,e.EditSettings=pe,e.EventMarker=ue,e.FilterSettings=me,e.SearchSettings=De,e.Holiday=be,e.LabelSettings=Pe,e.SelectionSettings=Me,e.SplitterSettings=Ie,e.TaskFields=Fe,e.TimelineTierSettings=Le,e.TimelineSettings=Be,e.TooltipSettings=We,e.SortDescriptor=Ge,e.SortSettings=ze,e.ResourceFields=Ye,e.LoadingIndicator=Ke,e.TemporaryDictionary=It,e.PdfBorders=Et,e.PdfPaddings=Nt,e.PdfTreeGridStyleBase=Ft,e.PdfTreeGridStyle=Ut,e.PdfGanttTheme=xt,e.PdfTreeGridLayouter=Lt,e.PdfTreeGridLayoutResult=Bt,e.PdfTreeGridLayoutFormat=At,e.PdfTreeGridCell=jt,e.PdfTreeGridCellCollection=qt,e.PdfTreeGridRow=Gt,e.PdfTreeGridRowCollection=zt,e.PdfTreeGridHeaderCollection=_t,e.PdfTreeGridColumn=Xt,e.PdfTreeGridColumnCollection=Yt,e}({},ej.base,ej.popups,ej.grids,ej.data,ej.treegrid,ej.layouts,ej.navigations,ej.richtexteditor,ej.inputs,ej.buttons,ej.calendars,ej.dropdowns,ej.pdfexport),this.ejs=ej;
|
|
11
11
|
//# sourceMappingURL=ej2-gantt.min.js.map
|