text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-treegrid"),require("@syncfusion/ej2-layouts"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-richtexteditor"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-grids","@syncfusion/ej2-data","@syncfusion/ej2-treegrid","@syncfusion/ej2-layouts","@syncfusion/ej2-navigations","@syncfusion/ej2-richtexteditor","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-calendars","@syncfusion/ej2-dropdowns","@syncfusion/ej2-pdf-export"],t):t(e.ej={},e.ej2Base,e.ej2Popups,e.ej2Grids,e.ej2Data,e.ej2Treegrid,e.ej2Layouts,e.ej2Navigations,e.ej2Richtexteditor,e.ej2Inputs,e.ej2Buttons,e.ej2Calendars,e.ej2Dropdowns,e.ej2PdfExport)}(this,function(e,t,i,r,n,a,o,s,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){for(var t={},i=0,r=Object.keys(e);i<r.length;i++){var n=r[i];t[e[n]]=n}return t}function y(e){if(e instanceof n.DataManager){var t=e.adaptor;return t instanceof n.ODataAdaptor||t instanceof n.WebApiAdaptor||t instanceof n.WebMethodAdaptor||t instanceof n.CacheAdaptor||t instanceof n.UrlAdaptor}return!1}function v(e,i){for(var r=[],n=0;n<e.length;n++){var a=void 0;a=a=i?e[n].taskData:t.extend({},e[n].taskData,{},!0),r.push(a)}return r}function w(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 D(e,i,r,n){for(var a=-1,o=0;o<r.length;o++)if(t.getValue(i,r[o])===t.getValue(i,e)&&t.isNullOrUndefined(n)||!t.isNullOrUndefined(n)&&t.getValue(i,r[o])===t.getValue(i,e)&&t.getValue(n,r[o])===t.getValue(n,e)){a=o;break}return a}function k(e){return 76*e/92}function T(e){return 92*e/76}function S(){return b++}var b=0,P=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){if(t.isNullOrUndefined(e))return null;var n=new Date(e.getTime()),a=this.getSecondsInDecimal(n);if(r=t.isNullOrUndefined(r)?!t.isNullOrUndefined(i)&&i.isMilestone:r,a<this.parent.defaultStartTime)this.setTime(this.parent.defaultStartTime,n);else if(a!==this.parent.defaultEndTime||i&&r){if(a>this.parent.defaultEndTime)n.setDate(n.getDate()+1),this.setTime(this.parent.defaultStartTime,n);else if(a>this.parent.defaultStartTime&&a<this.parent.defaultEndTime)for(var o=0;o<this.parent.workingTimeRanges.length;o++){var s=this.parent.workingTimeRanges[o];if(a>=s.to&&this.parent.workingTimeRanges[o+1]&&a<this.parent.workingTimeRanges[o+1].from){a!==s.to||i&&r?a!==s.to&&this.setTime(this.parent.workingTimeRanges[o+1].from,n):this.setTime(this.parent.workingTimeRanges[o+1].from,n);break}}}else n.setDate(n.getDate()+1),this.setTime(this.parent.defaultStartTime,n);var l;do{l=new Date(n.getTime());var d=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(i)){if(!this.parent.includeWeekend){var p=new Date(n.getTime());n=this.getNextWorkingDay(n),p.getTime()!==n.getTime()&&this.setTime(this.parent.defaultStartTime,n)}for(var h=0;h<d;h++){var c=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[h])),u=new Date(c.getTime());c.setHours(0,0,0,0),u.setHours(23,59,59,59),n.getTime()>=c.getTime()&&n.getTime()<u.getTime()&&(n.setDate(n.getDate()+1),this.setTime(this.parent.defaultStartTime,n))}}}while(l.getTime()!==n.getTime());return new Date(n.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 o=0;o<this.parent.workingTimeRanges.length;o++){if(a>this.parent.workingTimeRanges[o].to&&this.parent.workingTimeRanges[o+1]&&a<=this.parent.workingTimeRanges[o+1].from){this.setTime(this.parent.workingTimeRanges[o].to,n);break}}var s;do{s=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(s.getTime()!==n.getTime());return new Date(n.getTime())},e.prototype.checkBaselineStartDate=function(e){if(t.isNullOrUndefined(e))return null;var i=new Date(e.getTime()),r=this.getSecondsInDecimal(i);if(r<this.parent.defaultStartTime)this.setTime(this.parent.defaultStartTime,i);else if(r>=this.parent.defaultEndTime)i.setDate(i.getDate()+1),this.setTime(this.parent.defaultStartTime,i);else if(r>this.parent.defaultStartTime&&r<this.parent.defaultEndTime)for(var n=0;n<this.parent.workingTimeRanges.length;n++){if(r>=this.parent.workingTimeRanges[n].to&&this.parent.workingTimeRanges[n+1]&&r<this.parent.workingTimeRanges[n+1].from){this.setTime(this.parent.workingTimeRanges[n+1].from,i);break}}return i},e.prototype.checkBaselineEndDate=function(e){if(t.isNullOrUndefined(e))return null;var i=new Date(e.getTime()),r=this.getSecondsInDecimal(i);if(r>this.parent.defaultEndTime)this.setTime(this.parent.defaultEndTime,i);else if(r<=this.parent.defaultStartTime)i.setDate(i.getDate()-1),this.setTime(this.parent.defaultEndTime,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].to,i);break}}return i},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;t.isNullOrUndefined(i.startDate)||(!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)||(r=this.getEndDate(i.startDate,i.duration,i.durationUnit,i,!1)),this.parent.setRecordValue("endDate",r,i,!0)),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(e,"endDate")},e.prototype.calculateDuration=function(e){var i=e.ganttProperties,r=this.getDuration(i.startDate,i.endDate,i.durationUnit,i.isAutoSchedule,i.isMilestone);this.parent.setRecordValue("duration",r,i,!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 o=a.querySelector("#"+this.parent.element.id+"Duration").ej2_instances[0];t.isNullOrUndefined(o)||o.value===r.toString()||(o.value=r.toString(),o.dataBind())}}this.parent.taskFields.duration&&(this.parent.dataOperation.updateMappingData(e,"duration"),this.parent.taskFields.durationUnit&&this.parent.dataOperation.updateMappingData(e,"durationUnit"))}},e.prototype.getNonworkingTime=function(e,i,r,n){n=!!t.isNullOrUndefined(n)||n;this.getTimeDifference(e,i,n);var a=!this.parent.includeWeekend&&r?this.getWeekendCount(e,i):0,o=this.getNumberOfSeconds(e,i,n),s=r?this.getHolidaysCount(e,i):0,l=(o-86400*a-86400*s)/86400,d=this.getNonWorkingSecondsOnDate(e,i,r);return l*(86400-this.parent.secondsPerDay)+86400*a+86400*s+d},e.prototype.getDuration=function(e,i,r,n,a,o){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))return null;o=!!t.isNullOrUndefined(o)||o;var s=0,l=this.getTimeDifference(e,i,o)/1e3-this.getNonworkingTime(e,i,n,o);return s=a&&this.parent.getFormatedDate(e)===this.parent.getFormatedDate(i)?0:r&&"day"!==r?"minute"===r?l/60:l/3600:l/this.parent.secondsPerDay,parseFloat(s.toString())},e.prototype.getDurationAsSeconds=function(e,t){return t&&"day"!==t?"hour"===t?3600*e:60*e:this.parent.secondsPerDay*e},e.prototype.getEndDate=function(e,t,i,r,n){for(var a=new Date(e.getTime()),o=new Date(e.getTime()),s=this.getDurationAsSeconds(t,i);s>0;)o.setSeconds(o.getSeconds()+s),(s-=s-this.getNonworkingTime(a,o,r.isAutoSchedule,!0))>0&&(o=this.checkStartDate(o,r,n)),a=new Date(o.getTime());return o},e.prototype.getStartDate=function(e,t,i,r){for(var n=new Date(e.getTime()),a=new Date(e.getTime()),o=this.getDurationAsSeconds(t,i);o>0;)a.setSeconds(a.getSeconds()-o),(o-=o-this.getNonworkingTime(a,n,r.isAutoSchedule,!0))>0&&(n=this.checkEndDate(a,r)),n=new Date(a.getTime());return a},e.prototype.getProjectStartDate=function(e,i){if(!t.isNullOrUndefined(this.parent.cloneProjectStartDate)){var r=this.checkStartDate(this.parent.cloneProjectStartDate);return this.parent.cloneProjectStartDate=r,new Date(r.getTime())}if(t.isNullOrUndefined(this.parent.projectStartDate)){if(t.isNullOrUndefined(i))return null;var n=this.parent.flatData,a=void 0;n.length>0?a=n[0].ganttProperties.startDate:(a=new Date).setHours(0,0,0,0);for(var o=1;o<n.length;o++){var s=n[o].ganttProperties.startDate;t.isNullOrUndefined(s)||-1!==this.compareDates(s,a)||(a=s)}this.parent.cloneProjectStartDate=this.checkStartDate(a,e)}else{r=this.getDateFromFormat(this.parent.projectStartDate);this.parent.cloneProjectStartDate=this.checkStartDate(r)}return new Date(this.parent.cloneProjectStartDate.getTime())},e.prototype.getValidStartDate=function(e,i){var r=null,n=i?e.autoStartDate:e.startDate,a=i?e.autoEndDate:e.endDate,o=!e.isAutoSchedule&&e.autoDuration?e.autoDuration:e.duration;return t.isNullOrUndefined(n)?t.isNullOrUndefined(a)?t.isNullOrUndefined(o)||(r=this.getProjectStartDate(e)):(r=new Date(a.getTime()),this.setTime(this.parent.defaultStartTime,r)):r=new Date(n.getTime()),r},e.prototype.getValidEndDate=function(e,i){var r=null,n=i?e.autoStartDate:e.startDate,a=i?e.autoEndDate:e.endDate,o=i?e.autoDuration:e.duration;if(t.isNullOrUndefined(a))if(t.isNullOrUndefined(n)){if(!t.isNullOrUndefined(o)){var s=this.getValidStartDate(e);s&&(r=this.getEndDate(s,o,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 o=this.parent.workingTimeRanges;this.parent.nonWorkingTimeRanges=[];for(var s=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-o[l-1].to),o[l-1].to<g&&s.push({from:o[l-1].to,to:g,isWorking:!1,interval:g-o[l-1].to})):(a.push(0),s.push({from:0,to:g,isWorking:!1,interval:g})),o.push({from:g,to:f}),s.push({from:g,to:f,isWorking:!0,interval:f-g})}}return this.parent.defaultEndTime/3600!=24&&s.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 o=a[1]?a[1].toString().trim().toLowerCase():null;-1!==t.getValue("minute",this.parent.durationUnitEditText).indexOf(o)?r="minute":-1!==t.getValue("hour",this.parent.durationUnitEditText).indexOf(o)?r="hour":-1!==t.getValue("day",this.parent.durationUnitEditText).indexOf(o)&&(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 o=0;o<r.length;o++){var s=this.getDateFromFormat(new Date(r[o]));n.getTime()<=s.getTime()&&a.getTime()>s.getTime()&&(this.parent.includeWeekend||-1!==this.parent.nonWorkingDayIndex.indexOf(s.getDay())?this.parent.includeWeekend&&(i+=1):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 o=n||a;o.setHours(0,0,0,0),-1===i.indexOf(o.getTime())&&i.push(o.getTime())}else for(;n<=a;)n.setHours(0,0,0,0),-1===i.indexOf(n.getTime())&&i.push(n.getTime()),n.setDate(n.getDate()+1)}return i},e.prototype.isOnHolidayOrWeekEnd=function(e,i){if(!(i=t.isNullOrUndefined(i)?this.parent.includeWeekend:i)&&-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay()))return!0;for(var r=this.parent.totalHolidayDates,n=0;n<r.length;n++){var a=this.getDateFromFormat(new Date(r[n])),o=new Date(a.getTime());if(a.setHours(0,0,0,0),o.setHours(23,59,59,59),e.getTime()>=a.getTime()&&e.getTime()<o.getTime())return!0}return!1},e.prototype.getNonWorkingSecondsOnDate=function(e,t,i){for(var r=this.getSecondsInDecimal(e),n=this.getSecondsInDecimal(t),a=-1,o=-1,s=0,l=!!i&&this.isOnHolidayOrWeekEnd(e,null),d=!!i&&this.isOnHolidayOrWeekEnd(t,null),p=0;p<this.parent.nonWorkingTimeRanges.length;p++){var h=this.parent.nonWorkingTimeRanges[p];r>=h.from&&r<=h.to&&(a=p),n>=h.from&&n<=h.to&&(o=p)}if(e.getDate()!==t.getDate()||e.getMonth()!==t.getMonth()||e.getFullYear()!==t.getFullYear()){if(l)s+=86400-r;else for(p=a;p<this.parent.nonWorkingTimeRanges.length;p++)this.parent.nonWorkingTimeRanges[p].isWorking||(s+=p===a?this.parent.nonWorkingTimeRanges[p].to-r:this.parent.nonWorkingTimeRanges[p].interval);if(d)s+=n;else for(p=0;p<=o;p++)this.parent.nonWorkingTimeRanges[p].isWorking||(s+=p===o?n-this.parent.nonWorkingTimeRanges[p].from:this.parent.nonWorkingTimeRanges[p].interval)}else if(a!==o)if(d)s+=n-r;else for(p=a;p<=o;p++)this.parent.nonWorkingTimeRanges[p].isWorking||(s+=p===a?this.parent.nonWorkingTimeRanges[p].to-r:p===o?n-this.parent.nonWorkingTimeRanges[p].from:this.parent.nonWorkingTimeRanges[p].interval);else if(d)s+=n-r;else{this.parent.nonWorkingTimeRanges[a].isWorking||(s=n-r)}return s},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 o=new Date((new Date).getFullYear(),0,1).getTimezoneOffset();if(o!==n?(r=e,i=n):o!==a&&(r=t,i=a),o<0){var s=o-i;r.setTime(r.getTime()+60*s*1e3)}else if(o>0){s=i-o;r.setTime(r.getTime()-60*s*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,i){var r=new Date(e.toLocaleString("en-US",{timeZone:i}));return isNaN(r.getTime())?0:(e.getTime()-r.getTime())/6e4+t},e.prototype.convert=function(e,t){var i=e.getTimezoneOffset(),r=this.offset(e,i,t),n=(e=new Date(e.getTime()+6e4*(i-r))).getTimezoneOffset();return new Date(e.getTime()+6e4*(n-i))},e.prototype.getDateFromFormat=function(e,i){var r;if(t.isNullOrUndefined(e))return null;if(e instanceof Date)r=new Date(e.getTime());else{var n=this.parent.globalize.parseDate(e,{format:this.parent.getDateFormat(),type:"dateTime"});r=t.isNullOrUndefined(n)&&!isNaN(new Date(e).getTime())?new Date(e):n}if(!t.isNullOrUndefined(this.parent.timezone)&&i){return this.convert(r,this.parent.timezone)}return r},e.prototype.compareDates=function(e,i){return t.isNullOrUndefined(e)||t.isNullOrUndefined(i)?!t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)?1:t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)?-1:null:e.getTime()>i.getTime()?1:e.getTime()<i.getTime()?-1:0},e.prototype.getDurationString=function(e,i){var r="";if(!t.isNullOrUndefined(e)&&(r+=parseFloat(e.toFixed(2))+" ",!t.isNullOrUndefined(i))){var n=1!==e;"day"===i?r+=n?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===i?r+=n?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===i&&(r+=n?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return r},e.prototype.getWorkString=function(e,i){var r="";if(!t.isNullOrUndefined(e)&&(r+=parseFloat(e).toFixed(2)+" ",!t.isNullOrUndefined(i))){var n=1!==e;"day"===i?r+=n?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===i?r+=n?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===i&&(r+=n?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))}return r},e.prototype.calculateProjectDates=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=this.parent.timelineModule.isZooming&&this.parent.cloneProjectStartDate?this.getDateFromFormat(this.parent.cloneProjectStartDate):this.getDateFromFormat(r),o=this.parent.timelineModule.isZooming&&this.parent.cloneProjectEndDate?this.getDateFromFormat(this.parent.cloneProjectEndDate):this.getDateFromFormat(n),s=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()}),s=new Date(e[0].getTime()),l=e.length>1?new Date(e[e.length-1].getTime()):null)};if((!a||!o)&&d.length>0||e||this.parent.timelineModule.isZoomToFit){if((p.length>0&&this.parent.timelineModule.isZoomToFit&&this.parent.treeGrid.filterModule&&this.parent.treeGrid.filterModule.filteredResult.length>0?p:d).forEach(function(e,t){h=[];var r=e.ganttProperties,n=i.getValidStartDate(r),a=i.getValidEndDate(r);c(s),c(l),c(n),c(a),i.parent.renderBaseline&&!i.parent.timelineModule.isZoomToFit&&(c(r.baselineStartDate),c(r.baselineEndDate)),r.indicators&&r.indicators.length>0&&!i.parent.timelineModule.isZoomToFit&&r.indicators.forEach(function(e,t){c(i.getDateFromFormat(e.date))}),u(h)}),h=[],c(s),c(l),this.parent.eventMarkers.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.eventMarkers.forEach(function(e,t){c(i.getDateFromFormat(e.day))})}if(this.parent.totalHolidayDates.length>0&&!this.parent.timelineModule.isZoomToFit){this.parent.totalHolidayDates.forEach(function(e,t){c(new Date(e))})}u(h),s&&l||(s=t.isNullOrUndefined(s)?this.getDateFromFormat(new Date):s,(l=this.getDateFromFormat(new Date(s.getTime()))).setDate(l.getDate()+20))}else a&&o||0!==d.length||(s=this.getDateFromFormat(new Date),l=this.getDateFromFormat(new Date(s.getTime())));e?(t.setValue("minStartDate",s,e),t.setValue("maxEndDate",l,e)):(this.parent.cloneProjectStartDate=s||new Date(a.getTime()),this.parent.cloneProjectEndDate=l||new Date(o.getTime()))},e}(),C=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)}}(),R=function(e){function i(t){var i=e.call(this,t)||this;return i.recordIndex=0,i.taskIds=[],i.hierarchyData=[],i.addEventListener(),i}return C(i,e),i.prototype.addEventListener=function(){this.parent.on("beforeDataManipulate",this.checkDataBinding.bind(this))},i.prototype.checkDataBinding=function(e){e&&(this.parent.flatData=[],this.parent.currentViewData=[],this.dataArray=[],this.taskIds=[],this.parent.ids=[],this.recordIndex=0,this.hierarchyData=[],this.parent.predecessorsCollection=[],this.parent.treeGrid.parentData=[]),t.isNullOrUndefined(this.parent.dataSource)?(this.parent.dataSource=[],this.parent.renderGantt(e)):this.parent.dataSource instanceof n.DataManager?this.initDataSource(e):this.parent.dataSource.length>0?(this.dataArray=this.parent.dataSource,this.cloneDataSource(),this.parent.renderGantt(e)):this.parent.renderGantt(e)},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.cloneDataSource(),t.parent.renderGantt(e)}).catch(function(i){t.parent.renderGantt(e),t.parent.trigger("actionFailure",{error:i})})},i.prototype.constructDataSource=function(e){for(var i=new n.DataManager(e).executeLocal((new n.Query).group(this.parent.taskFields.parentID)),r=[],a=0;a<i.length;a++){var o=i[a];if(!t.isNullOrUndefined(o.key)){var s=this.taskIds.indexOf(o.key.toString());if(s>-1&&!t.isNullOrUndefined(o.key)){e[s][this.parent.taskFields.child]=o.items;continue}}r.push.apply(r,o.items)}this.hierarchyData=this.dataReorder(e,r)},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 n=[],a=0;a<this.dataArray.length;a++){var o=this.dataArray[a];n.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(n),r=this.hierarchyData}if("ProjectView"!==this.parent.viewType){var s=t.extend([],[],this.parent.resources,!0),l=[];if(this.constructResourceViewDataSource(s,r,l),l.length>0){var d={};d[this.parent.resourceFields.id]=0,d[this.parent.resourceFields.name]=this.parent.localeObj.getConstant("unassignedTask"),d[this.parent.taskFields.child]=l,s.push(d)}r=s}this.prepareDataSource(r)},i.prototype.constructResourceViewDataSource=function(e,t,i){for(var r=function(r){var a=t[r],o=n.parent.taskFields.child,s=a&&a[n.parent.taskFields.resourceInfo],l=n.parent.resourceFields.id;!a[o]&&s&&s.length?s.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][o]?e[r][o].push(a):e[r][o]=[a];break}}):a[o]||i.push(a),a[n.parent.taskFields.child]&&a[n.parent.taskFields.child].length&&n.constructResourceViewDataSource(e,a[n.parent.taskFields.child],i)},n=this,a=0;a<t.length;a++)r(a)},i.prototype.prepareDataSource=function(e){this.prepareRecordCollection(e,0),"ResourceView"===this.parent.viewType&&this.calculateSharedTaskUniqueIds(),this.parent.taskFields.dependency&&this.parent.predecessorModule&&this.parent.predecessorModule.ensurePredecessorCollection()},i.prototype.calculateSharedTaskUniqueIds=function(){for(var e=function(e){var i=t.parent.getTaskIds()[e].match(/(\d+|[A-z]+)/g);if("R"!==i[0]){var r=[],n=[];t.parent.flatData.filter(function(e){e.ganttProperties.taskId.toString()===i[1]&&0!==e.level&&(n.push(e.ganttProperties.rowUniqueID),r.push(e))});for(var a=0;a<r.length;a++)r[a].ganttProperties.sharedTaskUniqueIds=n}},t=this,i=0;i<this.parent.getTaskIds().length;i++)e(i)},i.prototype.prepareRecordCollection=function(e,i,r){for(var n=e.length,a=0;a<n;a++){var o=e[a],s=this.createRecord(o,i,r,!0);s.index=this.recordIndex++,this.parent.ids[s.index]=s.ganttProperties.rowUniqueID,this.parent.flatData.push(s),this.parent.setTaskIds(s);var l=o[this.parent.taskFields.child];if("ResourceView"===this.parent.viewType&&t.isNullOrUndefined(l)&&t.isNullOrUndefined(s.parentItem)&&0===s.level){var d=s.ganttProperties,p=s;this.parent.setRecordValue(d.isAutoSchedule?"startDate":"autoStartDate",null,p.ganttProperties,!0),this.parent.setRecordValue(d.isAutoSchedule?"endDate":"autoEndDate",null,p.ganttProperties,!0);var h=p.ganttProperties;this.parent.setRecordValue("isMilestone",!1,h,!0),h.isAutoSchedule&&this.calculateDuration(p),this.updateWorkWithDuration(p);var c=h.work;this.parent.setRecordValue("work",c,h,!0),this.parent.setRecordValue("taskType","FixedDuration",h,!0),t.isNullOrUndefined(this.parent.taskFields.type)||this.updateMappingData(p,"type"),this.parent.setRecordValue("progress",Math.floor(0),h,!0),this.parent.setRecordValue("totalProgress",0,h,!0),this.parent.setRecordValue("totalDuration",0,h,!0),h.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(h),h,!0),this.updateAutoWidthLeft(p)),this.resetDependency(p),this.updateWidthLeft(p),this.updateTaskData(p)}!t.isNullOrUndefined(l)&&l.length>0&&this.prepareRecordCollection(l,s.level+1,s)}},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 o=this.parent.taskFields,s=this.parent.resourceFields,l=(e[o.child],e[o.progress]),d=null,p=null;l=l&&parseFloat(l.toString())?parseFloat(l.toString()):0;var h=e[o.dependency],c=this.getDateFromFormat(e[o.baselineStartDate],!0),u=this.getDateFromFormat(e[o.baselineEndDate],!0),g={},f={},m="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[o.manual];this.parent.setRecordValue("ganttProperties",f,g),t.isNullOrUndefined(e[o.id])?t.isNullOrUndefined(e[s.id])||(d=e[s.id],p=e[s.name],this.addTaskData(g,e,!1)):(d=e[o.id],p=e[o.name],this.addTaskData(g,e,a)),this.parent.setRecordValue("taskId",d,f,!0),this.parent.setRecordValue("taskName",p,f,!0),o.parentID&&this.parent.setRecordValue("parentId",e[o.parentID],f,!0),this.addCustomFieldValue(e,g),this.parent.setRecordValue("isAutoSchedule",m,f,!0),this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),f,!0),this.parent.setRecordValue("isMilestone",!1,f,!0),this.updateResourceName(g),this.calculateScheduledValues(g,e,a),this.parent.setRecordValue("baselineStartDate",this.checkBaselineStartDate(c),f,!0),u&&0===u.getHours()&&86400!==this.parent.defaultEndTime&&this.setTime(this.parent.defaultEndTime,u),this.parent.setRecordValue("baselineEndDate",this.checkBaselineEndDate(u),f,!0),this.parent.setRecordValue("progress",l,f,!0),this.parent.setRecordValue("totalProgress",l,f,!0),this.parent.setRecordValue("predecessorsName",h,f,!0),this.parent.setRecordValue("indicators",e[o.indicators],f,!0),this.parent.setRecordValue("notes",e[o.notes],f,!0),this.parent.setRecordValue("cssClass",e[o.cssClass],f,!0),this.parent.setRecordValue("parentItem",this.getCloneParent(n),g);var y=g.parentItem?g.parentItem.uniqueID:null;if(this.parent.setRecordValue("parentUniqueID",y,g),"ResourceView"!==this.parent.viewType||t.isNullOrUndefined(o.parentID)||t.isNullOrUndefined(g.parentItem)||this.parent.setRecordValue("parentId",g.parentItem.taskId,f,!0),this.parent.setRecordValue("level",i,g),this.parent.setRecordValue("uniqueID",r.getUid(this.parent.element.id+"_data_"),g),this.parent.setRecordValue("uniqueID",g.uniqueID,f,!0),this.parent.setRecordValue("childRecords",[],g),this.parent.setRecordValue("baselineEndDate",this.checkBaselineEndDate(u),f,!0),!t.isNullOrUndefined(e[o.child])&&e[o.child].length>0?(this.parent.setRecordValue("hasChildRecords",!0,g),this.parent.setRecordValue("isMilestone",!1,f,!0),this.resetDependency(g)):this.parent.setRecordValue("hasChildRecords",!1,g),g.hasChildRecords&&(this.parent.setRecordValue("autoStartDate",g.ganttProperties.startDate,f),this.parent.setRecordValue("autoEndDate",g.ganttProperties.endDate,f),this.parent.setRecordValue("autoDuration",g.ganttProperties.duration,f)),this.parent.setRecordValue("expanded",!g.hasChildRecords||!this.parent.collapseAllParentTasks,g),this.updateExpandStateMappingValue(g,e),a||(this.parent.setRecordValue("width",this.calculateWidth(g),f,!0),this.parent.setRecordValue("left",this.calculateLeft(f),f,!0),this.parent.setRecordValue("progressWidth",this.getProgressWidth(f.width,l),f,!0),f.baselineEndDate&&f.baselineStartDate&&(this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(f),f,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(f),f,!0))),t.isNullOrUndefined(o.work)&&this.updateWorkWithDuration(g),t.isNullOrUndefined(o.manual)||this.parent.dataOperation.updateMappingData(g,"manual"),this.updateTaskData(g),h&&this.parent.predecessorsCollection.push(g),t.isNullOrUndefined(n)||n.childRecords.push(g),"ProjectView"===this.parent.viewType)this.parent.setRecordValue("rowUniqueID",f.taskId.toString(),f,!0);else{var v=g.uniqueID.replace(this.parent.element.id+"_data_","");this.parent.setRecordValue("rowUniqueID",v,g),this.parent.setRecordValue("rowUniqueID",v,f,!0),this.parent.setRecordValue("sharedTaskUniqueIds",[],f,!0)}return g},i.prototype.updateWorkWithDuration=function(e){var i=e.ganttProperties.resourceInfo,r=0;if(!t.isNullOrUndefined(i)){var n=i.length,a=void 0,o=void 0,s=this.parent.secondsPerDay/3600,l=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit);for(a=0;a<n;a++)r+=((o=i[a][this.parent.resourceFields.unit])>0?s*o/100:s)*l;"minute"===e.ganttProperties.workUnit&&(r*=60),"day"===e.ganttProperties.workUnit&&(r/=s),r%1!=0&&(r=parseFloat(r.toFixed(2)))}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,t,i){var r=this.parent.taskFields,a=this.parent.dataSource;if(i)if(r.parentID||a instanceof n.DataManager&&a.dataSource.json&&a.dataSource.offline)if(r.parentID){var o=t[r.id],s=this.taskIds.indexOf(o.toString()),l=s>-1?this.dataArray[s]:{};this.parent.setRecordValue("taskData",l,e)}else this.parent.setRecordValue("taskData",t,e);else this.parent.setRecordValue("taskData",t,e);else this.parent.setRecordValue("taskData",t,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.calculateScheduledValues=function(e,i,r){var n=this.parent.taskFields,a=e.ganttProperties,o=i[n.duration];o=t.isNullOrUndefined(o)||""===o?null:o;var s=this.getDateFromFormat(i[n.startDate],!0),l=this.getDateFromFormat(i[n.endDate],!0),d=!!n.milestone&&!!i[n.milestone],p=i[n.durationUnit]?i[n.durationUnit]:"";this.parent.setRecordValue("durationUnit",this.validateDurationUnitMapping(p),a,!0);var h=t.isNullOrUndefined(i[n.work])?0:parseFloat(i[n.work]);this.parent.setRecordValue("workUnit",this.validateWorkUnitMapping(this.parent.workUnit),a,!0);var c=i[n.type]?i[n.type]:"",u=this.validateTaskTypeMapping(c);if(this.parent.setRecordValue("taskType",u,a,!0),l||s||!t.isNullOrUndefined(o)&&""!==o)s?this.calculateDateFromStartDate(s,l,o,e):l?this.calculateDateFromEndDate(l,o,e):t.isNullOrUndefined(o)||""===o||(this.updateDurationValue(o,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(0===a.duration&&(this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("endDate",a.startDate,a,!0)),!t.isNullOrUndefined(d)&&d&&(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(h)||t.isNullOrUndefined(h))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",h,a,!0),u){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,o=this.parent.secondsPerDay/3600,s=0,l=void 0,d=void 0,p=void 0;for(d=0;d<n;d++)a+=(l=r[d][this.parent.resourceFields.unit])>0?o*l/100:o;p=this.getWorkInHour(i.work,i.workUnit),n>0&&(s+=p/a),"minute"===i.durationUnit&&(s=s*o*60),"hour"===i.durationUnit&&(s*=o),s%1!=0&&(s=parseFloat(s.toFixed(2))),t.isNullOrUndefined(i.duration)||this.parent.setRecordValue("duration",s,i,!0)}},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 o=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit),s=this.getWorkInHour(i.work,i.workUnit),l=o>0?s/(o*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){var a=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,a,o),a,!0),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),a,!0),1===this.compareDates(a.startDate,a.endDate)?(this.parent.setRecordValue("endDate",a.startDate,a,!0),this.parent.setRecordValue("isMilestone",!0,a,!0),this.parent.setRecordValue("duration",0,a,!0)):this.calculateDuration(n)):(this.updateDurationValue(r,a),this.calculateEndDate(n)):this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("endDate",null,a,!0),this.parent.setRecordValue("duration",null,a,!0)):(this.parent.setRecordValue("duration",1,a,!0),this.calculateEndDate(n))},i.prototype.getProgressWidth=function(e,t){return e*t/100},i.prototype.calculateWidth=function(e,i){var r=e.ganttProperties,n=i?r.autoStartDate:r.startDate,a=i?r.autoEndDate:r.endDate;return t.isNullOrUndefined(n)&&t.isNullOrUndefined(a)&&(n=this.getValidStartDate(r,i),a=this.getValidEndDate(r,i)),t.isNullOrUndefined(n)||t.isNullOrUndefined(a)?3:!r.isMilestone||e.hasChildRecords&&!r.isAutoSchedule?this.getTaskWidth(n,a):0},i.prototype.getTaskbarHeight=function(){var e=this.parent.rowHeight,t=this.parent.taskbarHeight;return t<e?t:e},i.prototype.calculateLeft=function(e,i){var r=null,n=-300,a=i?e.autoStartDate:e.startDate,o=i?e.autoEndDate:e.endDate,s=(i?e.autoDuration:e.duration,e.isMilestone);return a?r=new Date(a.getTime()):o?(r=new Date(o.getTime()),s=!0):r=this.getValidStartDate(e),t.isNullOrUndefined(r)||(n=this.getTaskLeft(r,s)),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?this.getTaskWidth(t,i):0},i.prototype.getTaskWidth=function(e,t){var i=new Date(e.getTime()),r=new Date(t.getTime());return"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(this.getSecondsInDecimal(i)===this.parent.defaultStartTime&&i.setHours(0,0,0,0),this.getSecondsInDecimal(r)===this.parent.defaultEndTime&&r.setHours(24),this.getSecondsInDecimal(r)===this.parent.defaultStartTime&&r.setHours(0,0,0,0)),this.getTimeDifference(i,r)/864e5*this.parent.perDayWidth},i.prototype.getTaskLeft=function(e,t){var i=new Date(e.getTime());"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(this.getSecondsInDecimal(i)===this.parent.defaultStartTime?i.setHours(0,0,0,0):t&&this.getSecondsInDecimal(i)===this.parent.defaultEndTime&&i.setHours(24));var r=this.parent.timelineModule.timelineStartDate;return r?(i.getTime()-r.getTime())/864e5*this.parent.perDayWidth:0},i.prototype.updateMappingData=function(e,i){var r=this.parent.columnMapping,n=e.ganttProperties;if(!t.isNullOrUndefined(r[i])||"taskType"===i)if("predecessorName"===i);else if("resourceInfo"===i){for(var a=n.resourceInfo,o=this.parent.resourceFields,s=[],l=[],d=0;d<a.length;d++){s.push(a[d][o.id]);var p=a[d][o.name],h=a[d][o.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)):(this.parent.setRecordValue("taskData."+r[i],n[i],e),this.parent.setRecordValue(r[i],n[i],e))},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 o=!1,s=0;s<r.length;s++)if("number"==typeof r[s]||"string"==typeof r[s]){if(parseInt(r[s],10)===parseInt(i[a][n.id],10)){r[s]=i[a],o=!0;break}}else if(r[s][n.id]===i[a][n.id]&&"number"!=typeof r[s]){r[s]=t.extend({},r[s],i[a],!0),o=!0;break}o||r.push(i[a])}for(var l=[],d=function(e){i.filter(function(t){t[n.id]===r[e][n.id]&&l.push(r[e])})},p=0;p<r.length;p++)d(p);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,l,e)}else this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e)},i.prototype.setRecordDate=function(e,i,r){var n="string"==typeof i?new Date(i):i;t.isNullOrUndefined(i)||(i=new Date(n.getTime())),this.parent.setRecordValue(r,i,e),t.isNullOrUndefined(i)||(i=new Date(n.getTime())),this.parent.setRecordValue("taskData."+r,i,e)},i.prototype.getDurationInDay=function(e,t){return"day"===t?e:"hour"===t?e/(this.parent.secondsPerDay/3600):e/(this.parent.secondsPerDay/60)},i.prototype.setRecordDuration=function(e,i){var r=e.ganttProperties.duration,n=e.ganttProperties.durationUnit;if(t.isNullOrUndefined(r))this.parent.setRecordValue(i,r,e),this.parent.setRecordValue("taskData."+i,r,e);else{this.parent.setRecordValue(i,e.ganttProperties.duration,e);var a=t.getValue(i,e.taskData);isNaN(a)&&t.isNullOrUndefined(this.parent.taskFields.durationUnit)&&!t.isNullOrUndefined(a)?this.parent.setRecordValue("taskData."+i,this.getDurationString(r,n),e):"string"==typeof a?this.parent.setRecordValue("taskData."+i,r.toString(),e):this.parent.setRecordValue("taskData."+i,r,e)}this.parent.taskFields.durationUnit&&(e.taskData[this.parent.taskFields.durationUnit]=e.ganttProperties.durationUnit)},i.prototype.getWorkInHour=function(e,t){return"day"===t?e*(this.parent.secondsPerDay/3600):"minute"===t?e/60:e},i.prototype.updateTaskData=function(e){var i=this.parent.taskFields,r=e.ganttProperties;if(!t.isNullOrUndefined(e.taskData)){var n=e.taskData;i.id&&(this.parent.setRecordValue("taskData."+i.id,r.taskId,e),this.parent.setRecordValue(i.id,r.taskId,e)),i.name&&(this.parent.setRecordValue("taskData."+i.name,r.taskName,e),this.parent.setRecordValue(i.name,r.taskName,e)),i.startDate&&this.setRecordDate(e,r.startDate,i.startDate),i.endDate&&this.setRecordDate(e,r.endDate,i.endDate),i.duration&&this.setRecordDuration(e,i.duration),i.durationUnit&&(n[i.durationUnit]=r.durationUnit),i.progress&&(this.parent.setRecordValue("taskData."+i.progress,r.progress,e),this.parent.setRecordValue(i.progress,r.progress,e)),i.baselineStartDate&&this.setRecordDate(e,r.baselineStartDate,i.baselineStartDate),i.baselineEndDate&&this.setRecordDate(e,r.baselineEndDate,i.baselineEndDate),i.notes&&(this.parent.setRecordValue("taskData."+i.notes,r.notes,e),this.parent.setRecordValue(i.notes,r.notes,e)),i.cssClass&&(this.parent.setRecordValue("taskData."+i.cssClass,r.cssClass,e),this.parent.setRecordValue(i.cssClass,r.cssClass,e)),i.indicators&&(this.parent.setRecordValue("taskData."+i.indicators,r.indicators,e),this.parent.setRecordValue(i.indicators,r.indicators,e)),i.parentID&&(this.parent.setRecordValue("taskData."+i.parentID,r.parentId,e),this.parent.setRecordValue(i.parentID,r.parentId,e)),i.work&&(this.parent.setRecordValue("taskData."+i.work,this.getWorkString(r.work,r.workUnit),e),this.parent.setRecordValue(i.work,r.work,e)),i.type&&(this.parent.setRecordValue("taskData."+i.type,r.taskType,e),this.parent.setRecordValue(i.type,r.taskType,e))}},i.prototype.setResourceInfo=function(e){var i;if(t.isNullOrUndefined(e[this.parent.taskFields.resourceInfo]))return i;i=e[this.parent.taskFields.resourceInfo];var r;r=!t.isNullOrUndefined(this.parent.editModule)&&this.parent.editModule.dialogModule.isAddNewResource?this.parent.editModule.dialogModule.ganttResources:this.parent.resources;for(var n=this.parent.resourceFields.id,a=this.parent.resourceFields.unit,o=this.parent.resourceFields.group,s=[],l=function(e){var l=r.filter(function(t){return"object"==typeof i[e]&&i[e][n]===t[n]||i[e]===t[n]}),d=t.extend({},l[0]);s.push(d),t.isNullOrUndefined(a)||t.isNullOrUndefined(i[e][a])||(d[a]=i[e][a]),t.isNullOrUndefined(o)||t.isNullOrUndefined(i[e][o])||(d[o]=i[e][o])},d=0;d<i.length;d++)l(d);return this.updateResourceUnit(s),s},i.prototype.updateResourceUnit=function(e){var i=this.parent.resourceFields.unit;if(!t.isNullOrUndefined(i)){var r=e.length,n=void 0;for(n=0;n<r;n++)t.isNullOrUndefined(e[n][i])&&(e[n][i]=100)}},i.prototype.updateResourceName=function(e){var i=e.ganttProperties.resourceInfo,r=[];if(i){var n=t.extend([],[],e.taskData[this.parent.taskFields.resourceInfo],!0);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e);for(var a=0;a<i.length;a++){var o=i[a],s=o[this.parent.resourceFields.name],l=o[this.parent.resourceFields.unit];if(100!==l&&(s+="["+l+"%]"),r.push(s),e.taskData){var d=this.parent.taskFields.resourceInfo;n[a],e.taskData[d].push(n[a])}}this.parent.setRecordValue("resourceNames",r.join(","),e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.resourceInfo,r.join(","),e,!0),this.updateTaskDataResource(e)}},i.prototype.dataReorder=function(e,t){for(var i=[];e.length>0&&t.length>0;){var r=t.indexOf(e[0]);-1===r?e.shift():(i.push(e.shift()),t.splice(r,1))}return i},i.prototype.validateDurationUnitMapping=function(e){var t=e;return t="minute"===t||"minutes"===t||"m"===t||"min"===t?"minute":"hour"===t||"hours"===t||"h"===t||"hr"===t?"hour":"day"===t||"days"===t||"d"===t?"day":this.parent.durationUnit.toLocaleLowerCase()},i.prototype.validateTaskTypeMapping=function(e){var t=e;return t="FixedDuration"===t?"FixedDuration":"FixedUnit"===t?"FixedUnit":"FixedWork"===t?"FixedWork":this.parent.taskType},i.prototype.validateWorkUnitMapping=function(e){var t=e;return t="minute"===t?"minute":"hour"===t?"hour":"day"===t?"day":this.parent.workUnit.toLocaleLowerCase()},i.prototype.updateDurationValue=function(e,i){var r=this.getDurationValue(e);isNaN(t.getValue("duration",r))||this.parent.setRecordValue("duration",t.getValue("duration",r),i,!0),t.isNullOrUndefined(t.getValue("durationUnit",r))||this.parent.setRecordValue("durationUnit",t.getValue("durationUnit",r),i,!0)},i.prototype.reUpdateGanttData=function(){if(this.parent.flatData.length>0){var e=void 0,i=void 0;this.parent.secondsPerDay=this.getSecondsPerDay();for(var r=0;r<this.parent.flatData.length;r++)e=this.parent.flatData[r].taskData,i=this.parent.flatData[r],t.isNullOrUndefined(this.parent.taskFields.duration)||this.setRecordDuration(i,this.parent.taskFields.duration),this.calculateScheduledValues(i,e,!1);this.updateGanttData()}},i.prototype._isInStartDateRange=function(e,t,i){var r=!1;return e.getTime()>=t.getTime()&&e.getTime()<i.getTime()&&(r=!0),r},i.prototype._isInEndDateRange=function(e,t,i){var r=!1;return e.getTime()>t.getTime()&&e.getTime()<=i.getTime()&&(r=!0),r},i.prototype.updateOverlappingValues=function(e){var t,i=e.childRecords,r=[];if(i.length<=1)e.ganttProperties.workTimelineRanges=[];else{i=this.setSortedChildTasks(e),this.updateOverlappingIndex(i);for(var n=1;n<i.length;n++){t=i[n];for(var a=new Date(t.ganttProperties.startDate.getTime()),o=new Date(t.ganttProperties.endDate.getTime()),s=[],l=0;l<n;l++){var d=i[l].ganttProperties.startDate,p=i[l].ganttProperties.endDate,h={};(this._isInStartDateRange(a,d,p)||this._isInEndDateRange(o,d,p))&&(d.getTime()>a.getTime()&&d.getTime()<o.getTime()&&p.getTime()>a.getTime()&&p.getTime()>o.getTime()||a.getTime()===d.getTime()&&o.getTime()<=p.getTime()?(h.from=d,h.to=o):a.getTime()===d.getTime()&&o.getTime()>p.getTime()?(h.from=d,h.to=p):a.getTime()>d.getTime()&&o.getTime()>=p.getTime()?(h.from=a,h.to=p):a.getTime()>d.getTime()&&o.getTime()<p.getTime()&&(h.from=a,h.to=o),s.push(h))}r.push.apply(r,this.mergeRangeCollections(s))}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){var i,r,a,o,s,l=[],d={},p={};i=new n.DataManager(e).executeLocal((new n.Query).sortBy(this.parent.taskFields.startDate,"Ascending"));for(var h=0;h<i.length;h++)0!==l.length||0!==h?(r=(d=l[l.length-1]).from,a=d.to,o=(p=i[h]).from,s=p.to,r.getTime()===o.getTime()&&a.getTime()>=s.getTime()||r.getTime()<o.getTime()&&a.getTime()>=s.getTime()||(r.getTime()<=o.getTime()&&a.getTime()>=o.getTime()&&a.getTime()<s.getTime()||a.getTime()<o.getTime()&&this.checkStartDate(a).getTime()===o.getTime()?d.to=s:a.getTime()<o.getTime()&&this.checkStartDate(a).getTime()!==o.getTime()&&l.push(i[h]))):l.push(i[h]);return t&&(l=this.splitRangeCollection(l)),l},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",o=(new Date(e[n]),new Date(e[n])),s=new Date(e[a]),l=[],d={};if(o.getTime()<s.getTime())do{for(var p=new Date(o.getTime()),h=new Date(o.getTime()),c=0,u=this.parent.dataOperation.getSecondsInDecimal(o),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()<s.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]=s,d.isSplit=!0,l.push(d)),o=this.checkStartDate(h)}while(o.getTime()<s.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",o=new Date(e[n]),s=new Date(e[n]),l=new Date(e[a]),d=!1,p=[],h={};if(s.setDate(s.getDate()+1),s.getTime()<l.getTime()){do{if(this.parent.dataOperation.isOnHolidayOrWeekEnd(s,null)){var c=new Date(s.getTime());c.setDate(s.getDate()-1),this.setTime(this.parent.defaultEndTime,c),(h={})[n]=o,h.isSplit=!0,h[a]=c,e.task&&(h.task=t.extend([],e.task,!0)),o.getTime()!==c.getTime()&&p.push(h),o=this.checkStartDate(c),s=new Date(o.getTime()),d=!0}else s.setDate(s.getDate()+1)}while(s.getTime()<l.getTime());d?o.getTime()!==l.getTime()&&(h={},e.task&&(h.task=t.extend([],e.task,!0)),h[n]=o,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],n=r.ganttProperties;r.hasChildRecords||this.updateWidthLeft(r),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(n),n,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(n),n,!0);var a=[],o=void 0;r.parentItem&&(a=(o=this.parent.getParentTask(r.parentItem)).childRecords),o&&a.indexOf(r)===a.length-1&&!r.hasChildRecords&&this.updateParentItems(o)}},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 t=e.ganttProperties;this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e),t,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(t),t,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.isAutoSchedule||!e.hasChildRecords?t.width:t.autoWidth,t.progress),t,!0)},i.prototype.updateAutoWidthLeft=function(e){var t=e.ganttProperties;this.parent.setRecordValue("autoWidth",this.calculateWidth(e,!0),t,!0),this.parent.setRecordValue("autoLeft",this.calculateLeft(t,!0),t,!0)},i.prototype.getParentProgress=function(e){var i=0,r={};switch(e.ganttProperties.durationUnit){case"hour":i=e.ganttProperties.duration/(this.parent.secondsPerDay/3600);break;case"minute":i=e.ganttProperties.duration/(this.parent.secondsPerDay/60);break;default:i=e.ganttProperties.duration}return e.hasChildRecords?(t.setValue("totalProgress",e.ganttProperties.totalProgress,r),t.setValue("totalDuration",e.ganttProperties.totalDuration,r)):(t.setValue("totalProgress",e.ganttProperties.progress*i,r),t.setValue("totalDuration",i,r)),r},i.prototype.resetDependency=function(e){var i=this.parent.taskFields.dependency;if(!t.isNullOrUndefined(i)){var r=e.ganttProperties;this.parent.setRecordValue("predecessor",[],r,!0),this.parent.setRecordValue("predecessorsName",null,r,!0),this.parent.setRecordValue("taskData."+i,null,e),this.parent.setRecordValue(i,null,e)}},i.prototype.updateParentItems=function(e,i){var r=i?e:this.parent.getParentTask(e),n=!1,a=r.ganttProperties;if(r.childRecords.length>0){for(var o=a.isAutoSchedule?a.startDate:a.autoStartDate,s=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,w=0;w<d;w++)if(v=l[w],this.parent.isOnDelete&&v.isDelete){if(1===d&&"ProjectView"===this.parent.viewType){if(t.isBlazor()){var D=r.ganttProperties.rowUniqueID,k=this.parent.getRecordByID(D);k&&-1===this.parent.editedRecords.indexOf(k)&&this.parent.editedRecords.push(k)}n=!0}}else{var T=this.getValidStartDate(v.ganttProperties),S=this.getValidEndDate(v.ganttProperties);t.isNullOrUndefined(c)&&(c=this.getDateFromFormat(T)),t.isNullOrUndefined(u)&&(u=this.getDateFromFormat(S)),t.isNullOrUndefined(S)||1!==this.compareDates(S,u)||(u=this.getDateFromFormat(S)),t.isNullOrUndefined(T)||-1!==this.compareDates(T,c)||(c=this.getDateFromFormat(T)),!v.ganttProperties.isMilestone&&f(v.ganttProperties)?(h=this.getParentProgress(v),m+=t.getValue("totalProgress",h),p+=t.getValue("totalDuration",h)):g++,y+=v.ganttProperties.work}if(!n){0!==this.compareDates(o,c)&&this.parent.setRecordValue(a.isAutoSchedule?"startDate":"autoStartDate",c,r.ganttProperties,!0),0!==this.compareDates(s,u)&&this.parent.setRecordValue(a.isAutoSchedule?"endDate":"autoEndDate",u,r.ganttProperties,!0);var b=void 0,P=(b=this.parent.isOnDelete&&v.isDelete?d-g-1:d-g)>0&&p>0?m/p:0,C=r.ganttProperties,R=!(0!==b||!c||!u||c.getTime()!==u.getTime());this.parent.setRecordValue("isMilestone",R,C,!0),C.isAutoSchedule&&this.calculateDuration(r),this.updateWorkWithDuration(r);var M=C.work;M+=y,this.parent.setRecordValue("work",M,C,!0),this.parent.setRecordValue("taskType","FixedDuration",C,!0),t.isNullOrUndefined(this.parent.taskFields.type)||this.updateMappingData(r,"type"),this.parent.setRecordValue("progress",Math.floor(P),C,!0),this.parent.setRecordValue("totalProgress",m,C,!0),this.parent.setRecordValue("totalDuration",p,C,!0),C.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(C),C,!0),this.updateAutoWidthLeft(r)),this.resetDependency(r),this.updateWidthLeft(r),this.updateTaskData(r)}}n&&1===r.childRecords.length&&0===r.ganttProperties.duration&&(this.parent.setRecordValue("isMilestone",!0,r.ganttProperties,!0),this.updateWidthLeft(r),this.updateTaskData(r));var x=this.parent.getParentTask(r.parentItem);x&&this.updateParentItems(x),n=!1},i}(P),M="e-timeline-single-header-outer-div",x="e-left-label-container",O="e-right-label-container",I="e-taskbar-main-container",E="e-task-label",F="e-gantt-child-progressbar-inner-div",L="e-milestone-top",V="e-milestone-bottom",U="e-baseline-bar",N="e-baseline-gantt-milestone",B="e-baseline-milestone-top",A="e-baseline-milestone-bottom",W="e-chart-row-cell",H="e-chart-row",j="e-taskbar-left-resizer",G="e-taskbar-right-resizer",q="e-child-progress-resizer",z="e-gantt-child-taskbar",_="e-gantt-child-progressbar",Y="e-manualparent-main-container",X="e-gantt-manualparenttaskbar",Z="e-gantt-manualparent-milestone",K="e-manualparent-milestone-top",Q="e-manualparent-milestone-bottom",J="e-gantt-child-manualtaskbar",$="e-gantt-manualparenttaskbar-right",ee="e-gantt-parent-taskbar",te="e-gantt-parent-progressbar",ie="e-gantt-unscheduled-task",re="e-left-resize-gripper",ne="e-right-resize-gripper",ae="e-progress-resize-gripper",oe="e-label",se="e-gantt-unscheduled-taskbar-left",le="e-gantt-unscheduled-taskbar-right",de="e-gantt-dependency-view-container",pe="e-connector-line-container",he="e-line",ce="e-connector-line-right-arrow",ue="e-connector-line-left-arrow",ge="e-connector-line-z-index",fe="e-connector-line-hover",me="e-connector-line-hover-z-index",ye="e-connector-line-right-arrow-hover",ve="e-connector-line-left-arrow-hover",we="e-connectorpoint-left",De="e-connectorpoint-right",ke="e-connectorpoint-left-hover",Te="e-connectorpoint-right-hover",Se="e-right-connectorpoint-outer-div",be="e-connectorpoint-allow-block",Pe="e-gantt-tooltip",Ce=".e-content",Re="e-active-parent-task",Me="e-active-child-task",xe="e-active-connected-task",Oe="e-predecessor-touch-mode",Ie="e-rangecontainer",Ee=function(){function e(e){this.previousScroll={top:0,left:0},this.parent=e,this.element=this.parent.ganttChartModule.scrollElement,this.addEventListeners()}return e.prototype.addEventListeners=function(){this.parent.on("grid-scroll",this.gridScrollHandler,this),t.EventHandler.add(this.element,"scroll",this.onScroll,this)},e.prototype.removeEventListeners=function(){t.EventHandler.remove(this.element,"scroll",this.onScroll),this.parent.off("grid-scroll",this.gridScrollHandler)},e.prototype.gridScrollHandler=function(e){this.element.scrollTop=t.getValue("top",e),this.isFromTreeGrid=!0},e.prototype.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.element.scrollLeft!==this.previousScroll.left&&(this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,e.previousScrollLeft=this.previousScroll.left,this.previousScroll.left=this.element.scrollLeft,e.scrollLeft=this.element.scrollLeft,e.scrollDirection="Horizontal",e.action="HorizontalScroll"),e.requestType="scroll",this.parent.trigger("actionComplete",e)},e.prototype.setHeight=function(e){this.element.style.height=t.formatUnit(e)},e.prototype.setWidth=function(e){this.element.style.width=t.formatUnit(e)},e.prototype.setScrollTop=function(e){this.element.scrollTop=e},e.prototype.setScrollLeft=function(e){this.element.scrollLeft=e,this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,this.previousScroll.left=this.element.scrollLeft},e.prototype.destroy=function(){this.removeEventListeners()},e}(),Fe=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:Ie}),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("."+Ie);i&&(i.innerHTML=""),0===this.parent.treeGrid.grid.filterSettings.columns.length&&this.renderRangeContainer(this.parent.flatData)},e.prototype.renderChartElements=function(){this.parent.chartRowsModule.renderChartRows(),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection),"ResourceView"===this.parent.viewType&&this.parent.showOverAllocation&&this.renderOverAllocationContainer(),this.updateWidthAndHeight(),this.parent.notify("selectRowByIndex",{})},e.prototype.renderRangeContainer=function(e){var t,i,r,n=e.length;if(0===this.parent.treeGrid.grid.filterSettings.columns.length)for(t=0;t<n;t++)(r=(i=e[t]).ganttProperties.workTimelineRanges)&&this.renderRange(r,i)},e.prototype.getTopValue=function(e){var t=this.parent.getExpandedRecords(this.parent.currentViewData).indexOf(e);return e.expanded?(t+1)*this.parent.rowHeight:t*this.parent.rowHeight},e.prototype.getRangeHeight=function(e){return!e.expanded&&e.hasChildRecords?this.parent.rowHeight-Math.floor(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight):e.childRecords.length*this.parent.rowHeight-Math.floor(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)},e.prototype.renderRange=function(e,i){var r=this.getTopValue(i),n=this.rangeViewContainer.querySelector(".rangeContainer"+i.ganttProperties.rowUniqueID);n&&n.remove();var a=t.createElement("div",{className:"rangeContainer"+i.ganttProperties.rowUniqueID,styles:"top:"+r+"px; position: absolute;"});if(0!==i.level||i.expanded||!t.isNullOrUndefined(i.parentItem)||this.parent.enableMultiTaskbar){for(var o=0;o<e.length;o++){var s=this.getRangeHeight(i),l=t.createElement("div",{className:"e-rg-rangdiv e-leftarc",styles:"left:"+e[o].left+"px;\n                top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px;\n                height: "+(s+1)+"px; border-right: 0px"}),d=t.createElement("div",{className:"e-rg-rangdiv e-rightarc",styles:"left:"+(e[o].left+e[o].width-5)+"px;\n                top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px; height: "+(s+1)+"px;\n                border-left: 0px"});a.appendChild(l),a.appendChild(d),this.rangeViewContainer.appendChild(a)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.rangeViewContainer)}},e.prototype.renderTimelineContainer=function(){this.chartTimelineContainer=t.createElement("div",{className:"e-timeline-header-container"}),this.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.scrollElement.appendChild(this.chartBodyContent),this.scrollObject=new Ee(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=t.isBlazor()?39:36,i=0===this.parent.contentHeight?e:this.parent.contentHeight;this.chartBodyContent.style.height=t.formatUnit(i),this.chartBodyContent.style.width=t.formatUnit(this.parent.timelineModule.totalTimelineWidth),this.parent.notify("updateHeight",{}),this.parent.updateGridLineContainerHeight(),this.updateLastRowBottomWidth()},e.prototype.updateLastRowBottomWidth=function(){if(this.parent.currentViewData.length>0&&"auto"!==this.parent.height){var e=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;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"),this.chartBodyContent.style.height=t.formatUnit(this.parent.contentHeight+1))}},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.notify("chartMouseDown",e),this.parent.element.tabIndex=0)},e.prototype.ganttChartMouseClick=function(e){this.parent.autoFocusTasks&&this.scrollToTarget(e),this.parent.notify("chartMouseClick",e)},e.prototype.ganttChartMouseUp=function(e){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-50>0?e-50: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)},e.prototype.mouseUp=function(e){this.isGanttElement||this.parent.notify("chartMouseUp",e),this.isGanttElement=!1},e.prototype.documentMouseUp=function(e){if(this.isGanttElement=!0,this.parent.allowRowDragAndDrop){var i=this.parent.element.querySelector(".e-ganttdrag");i&&i.remove()}if(!this.parent.isDestroyed&&3!==e.which){var r=!1;if(this.parent.editSettings.allowTaskbarEditing&&t.getValue("editModule.taskbarEditModule.isMouseDragged",this.parent)&&t.getValue("editModule.taskbarEditModule.taskBarEditAction",this.parent)&&(r=!0),this.parent.notify("chartMouseUp",e),this.parent.showActiveElement&&this.focusedElement&&!e.target.classList.contains("e-split-bar")&&(this.focusedElement.tabIndex=0===this.focusedElement.tabIndex?-1:this.focusedElement.tabIndex,t.removeClass([this.focusedElement],"e-active-container")),!r){var n=e.target,a=e.target.classList.contains(I)||t.closest(e.target,"."+I);t.closest(n,".e-gantt-parent-taskbar")?this.chartExpandCollapseRequest(e):!a&&this.parent.autoFocusTasks&&this.scrollToTarget(e)}if(this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.removeFalseLine(!0),!t.isNullOrUndefined(this.parent.onTaskbarClick)&&!r){n=e.target;var o=t.closest(n,".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");o&&this.onTaskbarClick(e,n,o)}}},e.prototype.onTaskbarClick=function(e,i,r){var n=t.closest(i,"tr"),a=t.getValue("rowIndex",n),o={data:this.getRecordByTarget(e),taskbarElement:r,rowIndex:a,target:i};this.parent.trigger("onTaskbarClick",o)},e.prototype.ganttChartLeave=function(e){this.parent.notify("chartMouseLeave",e)},e.prototype.ganttChartMove=function(e){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,o=t.closest(i,".e-rowcell,.e-chart-row-cell"),s=t.closest(i,".e-rowcell,.e-headercell");if(o&&(a=this.parent.ganttChartModule.getRecordByTarget(e),r.data=a),s){var l=t.getValue("cellIndex",s);r.column=this.parent.treeGrid.columns[l]}if(t.closest(i,".e-indicator-span")){var d=0,p=a.ganttProperties.indicators;if(p.length>1)for(d=0;d<p.length&&p[d].name!==n.innerText.trim();d++);r.indicator=p[d]}if(t.closest(i,".e-connector-line-container")){(h={}).target=n,r.predecessor=this.parent.tooltipModule.getPredecessorTooltipData(h)}if(t.closest(i,".e-event-markers")){var h;(h={}).target=n,r.eventMarkers=this.parent.tooltipModule.getMarkerTooltipData(h)}i.classList.contains("e-header-cell-label")&&(r.date=new Date(i.dataset.content))}this.parent.trigger("onMouseMove",r)}},e.prototype.doubleClickHandler=function(e){this.parent.notify("chartDblClick",e);var i=e.target,r=t.closest(i,"tr"),n=t.getValue("rowIndex",r),a={row:r,rowData:this.parent.ganttChartModule.getRecordByTarget(e),rowIndex:n,target:i};this.recordDoubleClick(a)},e.prototype.recordDoubleClick=function(e){this.parent.trigger("recordDoubleClick",e)},e.prototype.getRecordByTarget=function(e){var i,r=t.closest(e.target,"div."+I);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 document.getElementById(this.parent.element.id+"GanttTaskTableBody").querySelectorAll(".e-chart-row")},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"),o=t.getValue("rowIndex",a),s={data:n,gridRow:this.parent.treeGrid.getRows()[o],chartRow:a,cancel:!1};this.isExpandCollapseFromChart=!0,r.classList.contains("e-row-expand")?this.collapseGanttRow(s):r.classList.contains("e-row-collapse")&&this.expandGanttRow(s)}},e.prototype.reRenderConnectorLines=function(){this.parent.connectorLineModule.dependencyViewContainer.innerHTML="",this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection)},e.prototype.collapseGanttRow=function(e,i){var r=this;i?this.collapsedGanttRow(e):this.parent.trigger("collapsing",e,function(e){r.isExpandCollapseFromChart&&!t.getValue("cancel",e)&&(t.isBlazor()&&(t.setValue("chartRow",t.getElement(t.getValue("chartRow",e)),e),t.setValue("gridRow",t.getElement(t.getValue("gridRow",e)),e)),r.collapsedGanttRow(e)),r.isExpandCollapseFromChart=!1})},e.prototype.collapsedGanttRow=function(e){var i=t.getValue("data",e);this.isExpandCollapseFromChart?(this.expandCollapseChartRows("collapse",t.getValue("chartRow",e),i,null),this.parent.treeGrid.collapseRow(t.getValue("gridRow",e),i),this.isExpandCollapseFromChart=!1):this.expandCollapseChartRows("collapse",t.getValue("chartRow",e),i,null),"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(i),this.parent.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){t.isBlazor()&&(t.setValue("chartRow",t.getElement(t.getValue("chartRow",e)),e),t.setValue("gridRow",t.getElement(t.getValue("gridRow",e)),e)),r.isExpandCollapseFromChart&&!t.getValue("cancel",e)&&r.expandedGanttRow(e),r.isExpandCollapseFromChart=!1})},e.prototype.expandedGanttRow=function(e){var i=t.getValue("data",e);this.isExpandCollapseFromChart?(this.expandCollapseChartRows("expand",t.getValue("chartRow",e),i,null),this.parent.treeGrid.expandRow(t.getValue("gridRow",e),i),this.isExpandCollapseFromChart=!1):this.expandCollapseChartRows("expand",t.getValue("chartRow",e),i,null),"ResourceView"===this.parent.viewType&&this.renderMultiTaskbar(i),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 o=i.querySelectorAll(".e-row-collapse"),s=0;s<o.length;s++)t.addClass([o[s]],"e-row-expand"),t.removeClass([o[s]],"e-row-collapse")}else if("collapse"===e){a="none",n||(r.expanded=!1);for(o=i.querySelectorAll(".e-row-expand"),s=0;s<o.length;s++)t.addClass([o[s]],"e-row-collapse"),t.removeClass([o[s]],"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;this.parent.element.querySelector(".e-treegrid").focus()},e.prototype.expandAtLevel=function(e){this.parent.treeGrid.expandAtLevel(e)},e.prototype.collapseAtLevel=function(e){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,o=e?"pointerleave":"mouseleave";this.parent.editSettings.allowTaskbarEditing&&(t.EventHandler.add(this.parent.chartPane,i,this.ganttChartMouseDown,this),t.EventHandler.add(this.parent.chartPane,o,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(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,o=e?"pointerleave":"mouseleave";this.parent.editSettings.allowTaskbarEditing&&(t.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,i,this.ganttChartMouseDown),t.EventHandler.remove(this.parent.chartPane,o,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(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);if("noNextRow"!==a){if("string"!=typeof a&&((r.classList.contains("e-rowcell")||r.closest(".e-chart-row-cell")||r.classList.contains("e-headercell"))&&e.preventDefault(),(r.classList.contains("e-rowcell")&&a&&a.classList.contains("e-rowcell")||r.classList.contains("e-headercell"))&&this.parent.treeGrid.grid.notify("key-pressed",e),!i&&a)){if(r.classList.contains("e-rowcell")?this.manageFocus(r,"remove",!1):this.manageFocus(r,"remove",!0),a.classList.contains("e-rowcell")){if(!r.classList.contains("e-rowcell")){this.parent.treeGrid.grid.notify("key-pressed",e);var o=t.getValue("focusModule",this.parent.treeGrid.grid);o.currentInfo.element=a,o.currentInfo.elementToFocus=a,o.content.matrix.current=[a.parentElement.rowIndex,a.cellIndex]}this.manageFocus(a,"add",!1)}else this.manageFocus(a,"add",!0);this.parent.focusModule.setActiveElement(a)}}else this.manageFocus(r,"remove",!0)}},e.prototype.getNextElement=function(e,i){for(var r=i?e.nextElementSibling:e.previousElementSibling;r&&r.parentElement.classList.contains("e-row");){if(!r.matches(".e-hide")&&!r.matches(".e-rowdragdrop"))return r;r=i?r.nextElementSibling:r.previousElementSibling}if(this.validateNextElement(r))return r;var n=-1,a=null;if(e.classList.contains("e-rowcell"))if(n=e.parentElement.rowIndex,i){if(a=this.parent.getRowByIndex(n),this.validateNextElement(a,"e-left-label-container"))return a.getElementsByClassName("e-left-label-container")[0];if(this.validateNextElement(a,"e-taskbar-main-container"))return a.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(a,"e-right-label-container"))return a.getElementsByClassName("e-right-label-container")[0]}else{if(a=this.getNextRowElement(n,i,!1),this.validateNextElement(a,"e-right-label-container"))return a.getElementsByClassName("e-right-label-container")[0];if(this.validateNextElement(a,"e-taskbar-main-container"))return a.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(a,"e-left-label-container"))return a.getElementsByClassName("e-left-label-container")[0]}else if(e.parentElement.classList.contains("e-chart-row-cell")){var o=void 0;if(n=t.closest(e,".e-chart-row").rowIndex,!(a=i?this.getNextRowElement(n,i,!0):this.parent.treeGrid.grid.getRowByIndex(n)))return"noNextRow";for(o=i?a.children[0]:a.children[a.children.length-1];o;){if(!o.matches(".e-hide")&&!o.matches(".e-rowdragdrop"))return o;o=i?o.nextElementSibling:o.previousElementSibling}}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),o=t?r[a+1]:r[a-1],s=this.parent.currentViewData.indexOf(o);return o?i?this.parent.treeGrid.grid.getRowByIndex(s):this.parent.getRowByIndex(s):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.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")){var a=t.closest(e,".e-chart-row").rowIndex,o=this.parent.currentViewData[a],s=o.hasChildRecords?o.ganttProperties.isAutoSchedule?"e-gantt-parent-taskbar":"e-manualparent-main-container":o.ganttProperties.isMilestone?"e-gantt-milestone":"e-gantt-child-taskbar";n=e.getElementsByClassName(s)[0]}"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(I)?e:t.closest(e,"div."+I),t.isNullOrUndefined(i))i=t.closest(e,"tr."+H),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}(),Le=function(){return(Le=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)},Ve=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)},e.prototype.validateTimelineProp=function(){this.roundOffDays(),this.processTimelineProperty(),this.timelineWidthCalculation()},e.prototype.refreshTimeline=function(){this.initProperties(),this.processTimelineUnit(),this.parent.dataOperation.calculateProjectDates(),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,r=this.checkCurrentZoomingLevel();this.isZoomIn=e,this.isZooming=!0,i=e?r+1:r-1,this.parent.toolbarModule&&(e?i===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):i===this.parent.zoomingLevels[0].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!0));var n=this.parent.zoomingLevels[i],a={requestType:e?"beforeZoomIn":"beforeZoomOut",timeline:n,cancel:!1};this.parent.trigger("actionBegin",a),a.cancel||(n=a.timeline,this.changeTimelineSettings(n))},e.prototype.changeTimelineSettings=function(e){var i=this,r=this.isSingleTier?"None"===this.customTimelineSettings.topTier.unit?"topTier":"bottomTier":null;if(Object.keys(this.customTimelineSettings).forEach(function(n){if(n!==r)i.customTimelineSettings[n]="object"!=typeof e[n]||t.isNullOrUndefined(e[n])?e[n]:Le({},e[n]);else{var a="topTier"===n?"bottomTier":"topTier";i.customTimelineSettings[a]=Le({},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),this.isZooming||this.isZoomToFit){var n={requestType:this.isZoomIn?"AfterZoomIn":this.isZoomToFit?"AfterZoomToProject":"AfterZoomOut"};this.parent.trigger("actionComplete",n)}},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();var e,t,i,r=(this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime())/864e5,n=this.parent.ganttChartModule.chartElement.offsetWidth,a=n/r,o=this.parent.zoomingLevels.slice().sort(function(e,t){return e.perDayWidth<t.perDayWidth?1:-1});if(0!==a){for(var s=0;s<o.length;s++){if(t=o[s],s===o.length-1){e=o[s];break}if(i=o[s+1],a>=t.perDayWidth){e=o[s];break}if(a<t.perDayWidth&&a>i.perDayWidth){e=o[s+1];break}}var l=Le({},e);this.roundOffDateToZoom(this.parent.cloneProjectStartDate,!0,a,l.bottomTier.unit),this.roundOffDateToZoom(this.parent.cloneProjectEndDate,!1,a,l.bottomTier.unit);var d=this.calculateNumberOfTimelineCells(l);l.timelineUnitSize=Math.abs(n-25)/d,this.changeTimelineSettings(l);var p={requestType:"beforeZoomToProject",timeline:l};this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin",this.parent.controlId+"_zoomout"],!0),this.parent.trigger("actionBegin",p)}},e.prototype.roundOffDateToZoom=function(e,t,i,r){var n=("Month"===r||"Year"===r?60:20)/i*864e5;t?e.setTime(e.getTime()-n):e.setTime(e.getTime()+n),"Hour"===r?e.setMinutes(t?-120:120):"Minutes"===r?e.setSeconds(t?-120:120):e.setHours(t?-48:48,0,0,0)},e.prototype.calculateNumberOfTimelineCells=function(e){var t=Math.abs((this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime())/864e5),i=e.bottomTier.count,r=e.bottomTier.unit;return"Day"===r?t/i:"Week"===r?t/i/7:"Month"===r?t/i/28:"Year"===r?t/i/336:"Hour"===r?t*(24/i):t*(1440/i)},e.prototype.processTimelineUnit=function(){var e=["Year","Month","Week","Day","Hour","Minutes"];this.customTimelineSettings=this.customTimelineSettings?this.customTimelineSettings:this.extendFunction(this.parent.timelineSettings,["timelineViewMode","timelineUnitSize","weekStartDay","weekendBackground"],{topTier:["unit","format","count","formatter"],bottomTier:["unit","format","count","formatter"]}),-1===e.indexOf(this.customTimelineSettings.topTier.unit)&&-1===e.indexOf(this.customTimelineSettings.bottomTier.unit)?(this.customTimelineSettings.topTier.unit=-1!==e.indexOf(this.customTimelineSettings.timelineViewMode)?this.customTimelineSettings.timelineViewMode:"Week",this.customTimelineSettings.bottomTier.unit=5!==e.indexOf(this.customTimelineSettings.topTier.unit)?e[e.indexOf(this.customTimelineSettings.topTier.unit)+1]:"None"):-1!==e.indexOf(this.customTimelineSettings.topTier.unit)&&-1!==e.indexOf(this.customTimelineSettings.bottomTier.unit)&&e.indexOf(this.customTimelineSettings.topTier.unit)>e.indexOf(this.customTimelineSettings.bottomTier.unit)?this.customTimelineSettings.bottomTier.unit=this.customTimelineSettings.topTier.unit:(this.customTimelineSettings.topTier.unit=-1===e.indexOf(this.customTimelineSettings.topTier.unit)?"None":this.customTimelineSettings.topTier.unit,this.customTimelineSettings.bottomTier.unit=-1===e.indexOf(this.customTimelineSettings.bottomTier.unit)?"None":this.customTimelineSettings.bottomTier.unit),this.topTier=this.customTimelineSettings.topTier.unit,this.bottomTier=this.customTimelineSettings.bottomTier.unit,this.previousIsSingleTier=this.isSingleTier,this.isSingleTier="None"===this.topTier||"None"===this.bottomTier},e.prototype.processTimelineProperty=function(){this.customTimelineSettings.topTier.count="None"===this.topTier?1:this.validateCount(this.customTimelineSettings.topTier.unit,this.customTimelineSettings.topTier.count,"topTier"),this.customTimelineSettings.bottomTier.count="None"===this.customTimelineSettings.bottomTier.unit?1:this.validateCount(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.count,"bottomTier"),this.customTimelineSettings.bottomTier.format=this.validateFormat(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.format),this.customTimelineSettings.topTier.format=this.validateFormat(this.topTier,this.customTimelineSettings.topTier.format),this.customTimelineSettings.weekStartDay=this.customTimelineSettings.weekStartDay>=0&&this.customTimelineSettings.weekStartDay<=6?this.customTimelineSettings.weekStartDay:0,this.checkCurrentZoomingLevel()},e.prototype.calculateZoomingLevelsPerDayWidth=function(){for(var e=this.parent.zoomingLevels,t=0;t<e.length;t++){var i=this.getPerDayWidth(e[t].timelineUnitSize,e[t].bottomTier.count,e[t].bottomTier.unit);e[t].perDayWidth=i}},e.prototype.checkCurrentZoomingLevel=function(){var e="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.count:this.customTimelineSettings.topTier.count,t="None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier.unit:this.customTimelineSettings.topTier.unit,i=this.getCurrentZoomingLevel(t,e);return this.parent.toolbarModule&&(i===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):i===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),this.parent.currentZoomingLevel=this.parent.zoomingLevels[i],i},e.prototype.getCurrentZoomingLevel=function(e,t){var i,r,n,a,o;this.parent.zoomingLevels.length||(this.parent.zoomingLevels=this.parent.getZoomingLevels());var s=this.parent.zoomingLevels.filter(function(t){return t.bottomTier.unit===e});if(0===s.length){var l=this.getClosestUnit(e,"",!1);s=this.parent.zoomingLevels.filter(function(e){return e.bottomTier.unit===l})}for(var d=s.sort(function(e,t){return e.bottomTier.count<t.bottomTier.count?1:-1}),p=0;p<d.length;p++){if(o=d[p],p===d.length-1){i=d[p].level;break}if(a=d[p+1],t>=o.bottomTier.count){r=d[p],i=(n=d.filter(function(e){return e.bottomTier.count===r.bottomTier.count})).length>1?this.checkCollectionsWidth(n):n[0].level;break}if(t<o.bottomTier.count&&t>a.bottomTier.count){r=d[p+1],i=(n=d.filter(function(e){return e.bottomTier.count===r.bottomTier.count})).length>1?this.checkCollectionsWidth(n):n[0].level;break}}return i},e.prototype.getClosestUnit=function(e,t,i){var r=["Year","Month","Week","Day","Hour","Minutes"],n=r.indexOf(e);0===n&&(i=!0),e=this.isZoomIn||i?r[n+1]:r[n-1];return 0===this.parent.zoomingLevels.filter(function(t){return t.bottomTier.unit===e}).length?("Year"===e&&(i=!0),t=e,this.getClosestUnit(e,t,i)):e},e.prototype.checkCollectionsWidth=function(e){for(var t,i,r,n=e,a=this.customTimelineSettings.timelineUnitSize,o=n.sort(function(e,t){return e.timelineUnitSize<t.timelineUnitSize?1:-1}),s=0;s<o.length;s++){if(r=o[s],s===o.length-1){t=o[s].level;break}if(i=o[s+1],a>=r.timelineUnitSize){t=o[s].level;break}if(a<r.timelineUnitSize&&a>i.timelineUnitSize){t=o[s+1].level;break}}return t},e.prototype.updateTimelineHeaderHeight=function(){if(this.parent.timelineModule.isSingleTier?(t.addClass([this.parent.ganttChartModule.chartTimelineContainer],M),this.parent.treeGrid.element&&(t.addClass(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),M),t.addClass(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),M))):(t.removeClass([this.parent.ganttChartModule.chartTimelineContainer],M),this.parent.treeGrid.element&&(t.removeClass(this.parent.treeGrid.element.querySelectorAll(".e-headercell"),M),t.removeClass(this.parent.treeGrid.element.querySelectorAll(".e-columnheader"),M))),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,o=this.isSingleTier?1:2,s="None"===this.topTier?"bottomTier":"topTier";this.updateTimelineHeaderHeight(),this.topTierCollection=[],this.bottomTierCollection=[];for(var l=0;l<o;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(s)}),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),s="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,o=Math.abs(this.timelineRoundOffEndDate.getTime()-this.timelineStartDate.getTime());switch(e){case"Year":a=a<=(n=Math.round(o/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(o/864e5/28))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Week":a=a<=(n=Math.round(o/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(o/864e5))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Hour":a=a<=(n=Math.round(o/36e5))?a:n>0?n:1,"None"!==this.topTier&&"bottomTier"===r&&(a=this.validateBottomTierCount(e,a));break;case"Minutes":a=a<=(n=Math.round(o/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());switch(e){case"":i=this.parent.globalize.formatDate(r,{format:"E"}),i="zh"===this.parent.locale?i.slice(1):i.slice(0,1);break;default:i=this.parent.globalize.formatDate(r,{format:e})}return 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=this.parent,n="",a="",o="topTier"===e?r.timelineModule.customTimelineSettings.topTier.unit:r.timelineModule.customTimelineSettings.bottomTier.unit,s="topTier"===e?r.timelineModule.customTimelineSettings.topTier.count:r.timelineModule.customTimelineSettings.bottomTier.count,l=new Date(this.parent.timelineModule.timelineStartDate.toString()),d=new Date(this.timelineRoundOffEndDate.toString()),p=[];do{var h={};h.startDate=new Date(l.getTime()),a=this.getHeaterTemplateString(new Date(l.toString()),o,e,!1,s,h),p.push(new Date(l.toString())),t=this.getIncrement(l,s,o),i=l.getTime()+t,l.setTime(i),l>=d&&(a=this.getHeaterTemplateString(p[p.length-1],o,e,!0,s,h)),n+=a,a="";var c="topTier"===e?this.topTierCollection:this.bottomTierCollection;h.endDate=new Date(l.getTime()),c.push(h)}while(!(l>=d));return n},e.prototype.getTimelineRoundOffEndDate=function(e){var t="None"===this.topTier?this.bottomTier:this.topTier,i=new Date(e.toString());return this.parent.isTimelineRoundOff&&("Hour"===t?i.setMinutes(60):"Minutes"===t?i.setSeconds(60):i.setHours(24,0,0,0)),i},e.prototype.getIncrement=function(e,t,i){var r,n=new Date(e.getTime()),a=new Date(e.getTime());switch(i){case"Year":n=e,r=(a=new Date(e.getFullYear()+(t-1),11,31)).getTime()-n.getTime()+864e5;break;case"Month":n=e,r=(a=new Date(e.getFullYear(),e.getMonth()+t,1)).getTime()-n.getTime();break;case"Week":var o=this.parent.timelineModule.customTimelineSettings.weekStartDay,s=e.getDay()<o?o-e.getDay():6-e.getDay()+o;t=s>0?t-1:0,a.setHours(24,0,0,0),s=e.getDay()<o&&s>0?s-1:s,a.setDate(a.getDate()+(s+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);break;case"Minutes":a.setSeconds(60),r=a.getTime()-n.getTime()+6e4*(t-1)}return r},e.prototype.isWeekendHeaderCell=function(e,t,i){return"Day"===e&&1===this.customTimelineSettings[t].count&&-1!==this.parent.nonWorkingDayIndex.indexOf(i.getDay())},e.prototype.getHeaterTemplateString=function(e,i,r,n,a,o){var s,l,d,p="",h="",c="topTier"===r?this.parent.timelineModule.customTimelineSettings.topTier.format:this.parent.timelineModule.customTimelineSettings.bottomTier.format,u="topTier"===r?this.parent.timelineModule.customTimelineSettings.topTier.formatter:this.parent.timelineModule.customTimelineSettings.bottomTier.formatter,g=t.isNullOrUndefined(u)?this.parent.globalize.formatDate(e,{format:this.parent.getDateFormat()}):this.customFormat(e,c,r,i,u);l=s=this.getIncrement(e,a,i)/864e5*this.parent.perDayWidth,s=n?this.calculateWidthBetweenTwoDate(i,e,this.timelineRoundOffEndDate):s,d=this.isWeekendHeaderCell(i,r,e);var f="topTier"===r?" e-gantt-top-cell-text":"",m=t.isNullOrUndefined(u)?this.formatDateHeader(c,e):this.customFormat(e,c,r,i,u);return h+=this.parent.timelineModule.isSingleTier?'<th class="e-timeline-single-header-cell ':'<th class="e-timeline-top-header-cell',h+=d?" e-weekend-header-cell":"",h+='" tabindex="-1" aria-label= "'+this.parent.localeObj.getConstant("timelineCell")+" "+g,h+='" style="width:'+s+"px;",h+=d&&this.customTimelineSettings.weekendBackground?"background-color:"+this.customTimelineSettings.weekendBackground+";":"",h+='"><div class="e-header-cell-label'+f+'" style="width:'+(s-1)+"px;"+(this.parent.timelineSettings.showTooltip?'"title="'+g:""),h+='">'+m+"</div>",p+=h,p+="</th>",h="",!this.isSingleTier&&"topTier"!==r||n?(this.isSingleTier||"topTier"===r)&&n&&(this.totalTimelineWidth=this.totalTimelineWidth-l+s):this.totalTimelineWidth=this.totalTimelineWidth+s,o.value=m,o.isWeekend=d,o.width=l,p},e.prototype.calculateWidthBetweenTwoDate=function(e,t,i){return(i.getTime()-t.getTime())/864e5*this.parent.perDayWidth},e.prototype.timelineWidthCalculation=function(){var e=this.customTimelineSettings.timelineUnitSize,t=this.customTimelineSettings.bottomTier.count,i=this.customTimelineSettings.topTier.count;switch(this.bottomTierCellWidth=e,this.bottomTier){case"None":this.parent.perDayWidth=this.getPerDayWidth(e,i,this.topTier);break;default: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){var r,a=e.filter(function(e){return!t.isNullOrUndefined(e.ganttProperties.startDate)}),o=e.filter(function(e){return!t.isNullOrUndefined(e.ganttProperties.endDate)}),s=a.length>0?new Date(n.DataUtil.aggregates.min(a,"ganttProperties.startDate")):null,l=o.length>0?new Date(n.DataUtil.aggregates.max(o,"ganttProperties.endDate")):null,d=new Date(this.parent.dataOperation.checkStartDate(this.timelineStartDate).getTime()),p=new Date(this.parent.dataOperation.checkEndDate(this.timelineEndDate).getTime()),h=t.isNullOrUndefined(s)?null:this.parent.dataOperation.getTaskLeft(s,!1),c=t.isNullOrUndefined(l)?null:this.parent.dataOperation.getTaskLeft(l,!1),u=this.parent.dataOperation.getTaskLeft(d,!1),g=this.parent.dataOperation.getTaskLeft(p,!1);!t.isNullOrUndefined(h)&&(h<=this.bottomTierCellWidth||h<=u)?(r="prevTimeSpan",s=s>this.timelineStartDate?this.timelineStartDate:s):s=this.timelineStartDate,!t.isNullOrUndefined(c)&&(c>=this.totalTimelineWidth-this.bottomTierCellWidth||c>=g)?(r="prevTimeSpan"===r?"both":"nextTimeSpan",l=l<this.timelineEndDate?this.timelineEndDate:l):l=this.timelineEndDate,r&&this.performTimeSpanAction(r,i,s,l)},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 o=new Date(this.parent.cloneProjectStartDate.getTime()),s=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);l.cancel?(this.parent.cloneProjectStartDate=o,this.parent.cloneProjectEndDate=s):(this.parent.updateProjectDates(l.projectStartDate,l.ProjectEndDate,l.isTimelineRoundOff,i),"prevTimeSpan"===e&&"publicMethod"===i?this.parent.ganttChartModule.updateScrollLeft(0):"nextTimeSpan"===e&&"publicMethod"===i&&this.parent.ganttChartModule.updateScrollLeft(this.parent.timelineModule.totalTimelineWidth),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}(),Ue=function(){return function(e){this.allowEditing=!0,this.allowReordering=!0,this.allowResizing=!0,this.allowSorting=!0,this.allowFiltering=!0,this.edit={},t.merge(this,e)}}(),Ne=function(){function e(e){var t=this;this.previousScroll={top:0,left:0},this.queryCellInfo=function(e){t.parent.trigger("queryCellInfo",e)},this.headerCellInfo=function(e){t.parent.trigger("headerCellInfo",e)},this.rowDataBound=function(e){t.parent.trigger("rowDataBound",e)},this.columnMenuOpen=function(e){t.parent.notify("columnMenuOpen",e),t.parent.trigger("columnMenuOpen",e)},this.columnMenuClick=function(e){t.parent.trigger("columnMenuClick",e)},this.parent=e,this.parent.treeGrid=new a.TreeGrid,this.parent.treeGrid.allowSelection=!1,this.parent.treeGrid.allowKeyboard=this.parent.allowKeyboard,this.treeGridColumns=[],this.validateGanttColumns(),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createContainer,this),this.parent.on("chartScroll",this.updateScrollTop,this),this.parent.on("destroy",this.destroy,this),this.parent.treeGrid.on("renderReactTemplate",this.renderReactTemplate,this)},e.prototype.renderReactTemplate=function(e){this.parent.portals=e,this.parent.renderTemplates()},e.prototype.createContainer=function(){this.treeGridElement=t.createElement("div",{id:"treeGrid"+this.parent.element.id,className:"e-gantt-tree-grid"});var e=t.createElement("div",{className:"e-gantt-temp-header"});this.parent.treeGridPane.appendChild(this.treeGridElement),this.treeGridElement.appendChild(e),this.parent.treeGridPane.classList.add("e-temp-content")},e.prototype.renderTreeGrid=function(){this.composeProperties(),this.bindEvents(),this.parent.treeGrid.appendTo(this.treeGridElement),this.wireEvents()},e.prototype.composeProperties=function(){this.parent.treeGrid.showColumnMenu=this.parent.showColumnMenu,this.parent.treeGrid.columnMenuItems=this.parent.columnMenuItems,this.parent.treeGrid.childMapping=this.parent.taskFields.child,this.parent.treeGrid.treeColumnIndex=this.parent.treeColumnIndex,this.parent.treeGrid.columns=this.treeGridColumns,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,t.isBlazor()?0===this.parent.searchSettings.fields.length&&""===this.parent.searchSettings.key||(this.parent.treeGrid.searchSettings=this.parent.searchSettings):this.parent.treeGrid.searchSettings=this.parent.searchSettings;this.parent.treeGrid.isJsComponent=!0;var e=0;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||(e=this.parent.toolbarModule.element.offsetHeight),this.parent.treeGrid.height=this.parent.ganttHeight-e-46},e.prototype.getContentDiv=function(){return this.treeGridElement.querySelector(".e-content")},e.prototype.getHeaderDiv=function(){return this.treeGridElement.querySelector(".e-headercontent")},e.prototype.getScrollbarWidth=function(){var e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar";var t=document.createElement("div");e.appendChild(t),this.parent.element.appendChild(e);var i=e.offsetWidth-t.offsetWidth;return e.parentNode.removeChild(e),i},e.prototype.ensureScrollBar=function(){var e=this.getContentDiv(),t=this.getHeaderDiv(),i=this.getScrollbarWidth(),r=/Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);0!==i?e.style.cssText+="width: calc(100% + "+i+"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)},e.prototype.dataBound=function(e){this.ensureScrollBar(),this.parent.treeDataBound(e)},e.prototype.collapsing=function(e){var i=this,r=new n.Deferred;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){var a=this.createExpandCollapseArgs(e);if(t.isBlazor())return this.parent.trigger("collapsing",a,function(e){r.resolve(e),t.setValue("chartRow",t.getElement(t.getValue("chartRow",e)),e),t.setValue("gridRow",t.getElement(t.getValue("gridRow",e)),e),t.getValue("cancel",e)||i.parent.ganttChartModule.collapseGanttRow(e,!0)}),r;this.parent.ganttChartModule.collapseGanttRow(a),t.setValue("cancel",t.getValue("cancel",a),e)}},e.prototype.expanding=function(e){var i=this,r=new n.Deferred;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){var a=this.createExpandCollapseArgs(e);if(t.isBlazor())return this.parent.trigger("expanding",a,function(e){r.resolve(e),t.setValue("chartRow",t.getElement(t.getValue("chartRow",e)),e),t.setValue("gridRow",t.getElement(t.getValue("gridRow",e)),e),t.getValue("cancel",e)||i.parent.ganttChartModule.expandGanttRow(e,!0)}),r;this.parent.ganttChartModule.expandGanttRow(a),t.setValue("cancel",t.getValue("cancel",a),e)}},e.prototype.collapsed=function(e){if(this.updateExpandStatus(e),!this.parent.ganttChartModule.isExpandCollapseFromChart){var t=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.collapsedGanttRow(t)}},e.prototype.expanded=function(e){if(this.updateExpandStatus(e),!this.parent.ganttChartModule.isExpandCollapseFromChart){var t=this.createExpandCollapseArgs(e);this.parent.ganttChartModule.expandedGanttRow(t)}},e.prototype.updateExpandStatus=function(e){if(t.getValue("data",e)&&t.isBlazor()){this.parent.getTaskByUniqueID(t.getValue("data",e).uniqueID).expanded=t.getValue("data",e).expanded}},e.prototype.actionBegin=function(e){this.parent.notify("actionBegin",e),this.parent.trigger("actionBegin",e)},e.prototype.created=function(e){this.updateKeyConfigSettings()},e.prototype.actionFailure=function(e){this.parent.trigger("actionFailure",e)},e.prototype.createExpandCollapseArgs=function(e){var i=t.getValue("data",e);return{data:i,gridRow:t.getValue("row",e),chartRow:t.isBlazor()?this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(this.parent.getTaskByUniqueID(i.uniqueID))]:this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(i)],cancel:!1}},e.prototype.treeActionComplete=function(e){var i=t.extend({},e,!0);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],this.parent.getTaskByUniqueID(r.uniqueID).taskData[this.parent.taskFields.resourceInfo]=r.taskData[this.parent.taskFields.resourceInfo]),this.parent.editModule.cellEditModule.initiateCellEdit(e,this.currentEditRow),this.currentEditRow={}}"filterafteropen"===t.getValue("requestType",e)&&this.parent.notify("actionComplete",e),"searching"===t.getValue("requestType",e)&&this.parent.notify("actionComplete",e),t.isNullOrUndefined(t.getValue("batchChanges",e))||t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),t.isBlazor()&&this.parent.updateDataArgs(i),this.parent.isCancelled&&(t.setValue("requestType","cancel",i),t.setValue("action","CellEditing",i),this.parent.isCancelled=!1),this.parent.trigger("actionComplete",i)},e.prototype.updateKeyConfigSettings=function(){delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.delete,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.insert,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlHome,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlEnd,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.shiftTab,delete this.parent.treeGrid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.keyboardModule.keyConfigs.shiftTab},e.prototype.wireEvents=function(){var e=this.parent.treeGrid.element.querySelector(".e-content");e&&t.EventHandler.add(e,"scroll",this.scrollHandler,this),this.parent.isAdaptive&&t.EventHandler.add(this.parent.treeGridPane,"click",this.treeGridClickHandler,this)},e.prototype.unWireEvents=function(){var e=this.parent.treeGrid.element&&this.parent.treeGrid.element.querySelector(".e-content");e&&t.EventHandler.remove(e,"scroll",this.scrollHandler),this.parent.isAdaptive&&t.EventHandler.remove(this.parent.treeGridPane,"click",this.treeGridClickHandler)},e.prototype.scrollHandler=function(e){var t=this.parent.treeGrid.element.querySelector(".e-content");t.scrollTop!==this.previousScroll.top&&this.parent.notify("grid-scroll",{top:t.scrollTop}),this.previousScroll.top=t.scrollTop,this.parent.contextMenuModule&&this.parent.contextMenuModule.isOpen&&this.parent.contextMenuModule.contextMenu.close()},e.prototype.validateGanttColumns=function(){var e=this.parent,i=e.columns.length,r=this.parent.taskFields;this.parent.columnMapping={},this.parent.columnByField={},this.parent.customColumns=[];for(var n=["id","name","startDate","endDate","duration","dependency","progress","baselineStartDate","baselineEndDate","resourceInfo","notes","work","manual","type"],a=function(t){var i={};"string"==typeof e.columns[t]?i.field=e.columns[t]:i=e.columns[t];var a=[];if(n.length>0&&(a=n.filter(function(e){return i.field===r[e]})),0===a.length)return i.field===o.parent.resourceFields.group?"continue":(o.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",o.bindTreeGridColumnProperties(i,!0),"continue");var s=n.indexOf(a[0]);n.splice(s,1),o.createTreeGridColumn(i,!0),o.parent.columnMapping[a[0]]=i.field},o=this,s=0;s<i;s++)a(s);for(var l=0;l<n.length;l++){var d={};t.isNullOrUndefined(r[n[l]])||(d.field=r[n[l]],this.createTreeGridColumn(d,0===i),this.parent.columnMapping[n[l]]=d.field)}if("ProjectView"!==this.parent.viewType){d={};this.composeUniqueIDColumn(d),this.createTreeGridColumn(d,!0)}},e.prototype.createTreeGridColumn=function(e,i){var r=this.parent.taskFields;if(e.disableHtmlEncode=e.disableHtmlEncode?e.disableHtmlEncode:this.parent.disableHtmlEncode,r.id!==e.field&&(e.clipMode=e.clipMode?e.clipMode:"EllipsisWithTooltip"),r.id===e.field)this.composeIDColumn(e);else if(r.name===e.field)e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("name"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type=e.type?e.type:"string";else if(r.startDate===e.field)e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("startDate"),e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.width=e.width?e.width:150,e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.endDate===e.field)e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("endDate"),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit",e.width=e.width?e.width:150,e.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}};else if(r.duration===e.field)e.width=e.width?e.width:150,e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("duration"),e.valueAccessor=e.valueAccessor?e.valueAccessor:t.isNullOrUndefined(e.edit)?this.durationValueAccessor.bind(this):null,e.editType=e.editType?e.editType:"stringedit",e.type="string";else if(r.progress===e.field)this.composeProgressColumn(e);else if(r.dependency===e.field)e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("dependency"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",e.type="string",e.allowFiltering=!1!==e.allowFiltering;else if(r.resourceInfo===e.field)this.composeResourceColumn(e);else if(r.notes===e.field)e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("notes"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"stringedit",t.isBlazor()&&!e.template&&this.parent.setProperties({showInlineNotes:!0},!0),this.parent.showInlineNotes?e.disableHtmlEncode=!1:e.template||(e.template='<div class="e-ganttnotes-info"><span class="e-icons e-notes-info"></span></div>');else if(r.baselineStartDate===e.field||r.baselineEndDate===e.field){var a=r.baselineEndDate===e.field?"baselineEndDate":"baselineStartDate";e.width=e.width?e.width:150,e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant(a),e.format=e.format?e.format:{type:"date",format:this.parent.getDateFormat()},e.editType=e.editType?e.editType:-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"}else r.work===e.field?(e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("work"),e.width=e.width?e.width:150,e.valueAccessor=e.valueAccessor?e.valueAccessor:this.workValueAccessor.bind(this),e.editType=e.editType?e.editType:"numericedit"):r.type===e.field?(e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskType"),e.width=e.width?e.width:150,e.editType="dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.taskTypeValueAccessor.bind(this)):r.manual===e.field&&"Custom"===this.parent.taskMode&&(e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("taskMode"),e.width=e.width?e.width:120,e.editType=e.editType?e.editType:"dropdownedit",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.modeValueAccessor.bind(this),e.edit={params:{query:new n.Query,dataSource:[{id:1,text:this.parent.localeObj.getConstant("manual"),value:!0},{id:2,text:this.parent.localeObj.getConstant("auto"),value:!1}],fields:{text:"text",value:"value"}}});this.bindTreeGridColumnProperties(e,i)},e.prototype.composeResourceColumn=function(e){e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("resourceName"),e.width=e.width?e.width:150,e.type="string",e.valueAccessor=e.valueAccessor?e.valueAccessor:this.resourceValueAccessor.bind(this),e.allowFiltering=!1!==e.allowFiltering},e.prototype.getResourceIds=function(e){var i=t.getValue(this.parent.taskFields.resourceInfo,e.taskData),r=[];if(t.isNullOrUndefined(i))return i;for(var n=0;n<i.length;n++)r.push("object"==typeof i[n]?i[n][this.parent.resourceFields.id]:i[n]);return r},e.prototype.composeIDColumn=function(e){e.isPrimaryKey=!!t.isNullOrUndefined(e.isPrimaryKey)||e.isPrimaryKey,e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("id"),e.width=e.width?e.width:100,e.allowEditing=!!e.allowEditing&&e.allowEditing,e.editType=e.editType?e.editType:"numericedit","ProjectView"!==this.parent.viewType&&(e.valueAccessor=this.idValueAccessor.bind(this),e.isPrimaryKey=!1)},e.prototype.composeUniqueIDColumn=function(e){e.field="rowUniqueID",e.isPrimaryKey=!0,e.headerText="UniqueID",e.allowEditing=!1,e.visible=!1},e.prototype.composeProgressColumn=function(e){e.headerText=e.headerText?e.headerText:this.parent.localeObj.getConstant("progress"),e.width=e.width?e.width:150,e.editType=e.editType?e.editType:"numericedit"},e.prototype.bindTreeGridColumnProperties=function(e,t){for(var i={},r={},n=0,a=Object.keys(e);n<a.length;n++){var o=a[n];i[o]=r[o]=e[o]}this.parent.columnByField[r.field]=r,this.parent.ganttColumns.push(new Ue(r)),t&&this.treeGridColumns.push(i)},e.prototype.durationValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":this.parent.dataOperation.getDurationString(n.duration,n.durationUnit)},e.prototype.resourceValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":n.resourceNames},e.prototype.workValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":this.parent.dataOperation.getWorkString(n.work,n.workUnit)},e.prototype.taskTypeValueAccessor=function(e,i,r){var n=i.ganttProperties;return t.isNullOrUndefined(n)?"":n.taskType},e.prototype.modeValueAccessor=function(e,t,i){return t[e]?"Manual":"Auto"},e.prototype.idValueAccessor=function(e,t,i){return 0===t.level?"R-"+t.ganttProperties.taskId:"T-"+t.ganttProperties.taskId},e.prototype.updateScrollTop=function(e){this.treeGridElement.querySelector(".e-content").scrollTop=t.getValue("top",e),this.previousScroll.top=this.treeGridElement.querySelector(".e-content").scrollTop},e.prototype.treeGridClickHandler=function(e){this.parent.notify("treeGridClick",e)},e.prototype.removeEventListener=function(){this.parent.off("renderPanels",this.createContainer),this.parent.off("chartScroll",this.updateScrollTop),this.parent.off("destroy",this.destroy),this.parent.treeGrid.off("reactTemplateRender",this.renderReactTemplate)},e.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.parent.treeGrid.element&&this.parent.treeGrid.destroy()},e}(),Be=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)}}(),Ae=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},We=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Be(i,e),Ae([t.Property(null)],i.prototype,"from",void 0),Ae([t.Property(null)],i.prototype,"to",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)}}(),je=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},Ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return He(i,e),je([t.Property(null)],i.prototype,"type",void 0),je([t.Property(null)],i.prototype,"headerText",void 0),je([t.Property([])],i.prototype,"fields",void 0),i}(t.ChildProperty),qe=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)}}(),ze=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},_e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qe(i,e),ze([t.Property(null)],i.prototype,"type",void 0),ze([t.Property(null)],i.prototype,"headerText",void 0),ze([t.Property([])],i.prototype,"fields",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)}}(),Xe=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},Ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ye(i,e),Xe([t.Property(!1)],i.prototype,"allowEditing",void 0),Xe([t.Property(!1)],i.prototype,"allowAdding",void 0),Xe([t.Property(!1)],i.prototype,"allowDeleting",void 0),Xe([t.Property("Auto")],i.prototype,"mode",void 0),Xe([t.Property("Top")],i.prototype,"newRowPosition",void 0),Xe([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),Xe([t.Property(!1)],i.prototype,"allowTaskbarEditing",void 0),i}(t.ChildProperty),Ke=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,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},Je=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ke(i,e),Qe([t.Property(null)],i.prototype,"day",void 0),Qe([t.Property(null)],i.prototype,"label",void 0),Qe([t.Property(null)],i.prototype,"cssClass",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)}}(),et=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},tt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $e(i,e),et([t.Collection([],r.Predicate)],i.prototype,"columns",void 0),et([t.Property("Menu")],i.prototype,"type",void 0),et([t.Property()],i.prototype,"operators",void 0),et([t.Property(!1)],i.prototype,"ignoreAccent",void 0),et([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),it=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rt=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},nt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return it(i,e),rt([t.Property([])],i.prototype,"fields",void 0),rt([t.Property(!1)],i.prototype,"ignoreCase",void 0),rt([t.Property("contains")],i.prototype,"operator",void 0),rt([t.Property("")],i.prototype,"key",void 0),rt([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),at=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ot=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},st=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),ot([t.Property(null)],i.prototype,"from",void 0),ot([t.Property(null)],i.prototype,"to",void 0),ot([t.Property(null)],i.prototype,"label",void 0),ot([t.Property(null)],i.prototype,"cssClass",void 0),i}(t.ChildProperty),lt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dt=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return lt(i,e),dt([t.Property(null)],i.prototype,"rightLabel",void 0),dt([t.Property(null)],i.prototype,"leftLabel",void 0),dt([t.Property(null)],i.prototype,"taskLabel",void 0),i}(t.ChildProperty),ht=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ct=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ht(i,e),ct([t.Property("Row")],i.prototype,"mode",void 0),ct([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),ct([t.Property("Single")],i.prototype,"type",void 0),ct([t.Property(!1)],i.prototype,"persistSelection",void 0),ct([t.Property(!1)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),gt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ft=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},mt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return gt(i,e),ft([t.Property(null)],i.prototype,"position",void 0),ft([t.Property(-1)],i.prototype,"columnIndex",void 0),ft([t.Property(4)],i.prototype,"separatorSize",void 0),ft([t.Property(null)],i.prototype,"minimum",void 0),ft([t.Property("Default")],i.prototype,"view",void 0),i}(t.ChildProperty),yt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vt=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},wt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return yt(i,e),vt([t.Property(null)],i.prototype,"id",void 0),vt([t.Property(null)],i.prototype,"name",void 0),vt([t.Property(null)],i.prototype,"parentID",void 0),vt([t.Property(null)],i.prototype,"startDate",void 0),vt([t.Property(null)],i.prototype,"endDate",void 0),vt([t.Property(null)],i.prototype,"dependency",void 0),vt([t.Property(null)],i.prototype,"progress",void 0),vt([t.Property(null)],i.prototype,"child",void 0),vt([t.Property(null)],i.prototype,"milestone",void 0),vt([t.Property(null)],i.prototype,"duration",void 0),vt([t.Property(null)],i.prototype,"durationUnit",void 0),vt([t.Property(null)],i.prototype,"cssClass",void 0),vt([t.Property(null)],i.prototype,"baselineStartDate",void 0),vt([t.Property(null)],i.prototype,"baselineEndDate",void 0),vt([t.Property(null)],i.prototype,"resourceInfo",void 0),vt([t.Property(null)],i.prototype,"expandState",void 0),vt([t.Property(null)],i.prototype,"indicators",void 0),vt([t.Property(null)],i.prototype,"notes",void 0),vt([t.Property(null)],i.prototype,"work",void 0),vt([t.Property(null)],i.prototype,"manual",void 0),vt([t.Property(null)],i.prototype,"type",void 0),i}(t.ChildProperty),Dt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kt=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},Tt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),kt([t.Property("")],i.prototype,"format",void 0),kt([t.Property("None")],i.prototype,"unit",void 0),kt([t.Property(1)],i.prototype,"count",void 0),kt([t.Property(null)],i.prototype,"formatter",void 0),i}(t.ChildProperty),St=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),kt([t.Property("Week")],i.prototype,"timelineViewMode",void 0),kt([t.Complex({},Tt)],i.prototype,"topTier",void 0),kt([t.Complex({},Tt)],i.prototype,"bottomTier",void 0),kt([t.Property(33)],i.prototype,"timelineUnitSize",void 0),kt([t.Property(0)],i.prototype,"weekStartDay",void 0),kt([t.Property(null)],i.prototype,"weekendBackground",void 0),kt([t.Property(!0)],i.prototype,"showTooltip",void 0),kt([t.Property(!0)],i.prototype,"updateTimescaleView",void 0),i}(t.ChildProperty),bt=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)}}(),Pt=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},Ct=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bt(i,e),Pt([t.Property(!0)],i.prototype,"showTooltip",void 0),Pt([t.Property()],i.prototype,"taskbar",void 0),Pt([t.Property()],i.prototype,"baseline",void 0),Pt([t.Property()],i.prototype,"connectorLine",void 0),Pt([t.Property()],i.prototype,"editing",void 0),i}(t.ChildProperty),Rt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mt=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},xt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Rt(i,e),Mt([t.Property()],i.prototype,"field",void 0),Mt([t.Property()],i.prototype,"direction",void 0),i}(t.ChildProperty),Ot=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Rt(i,e),Mt([t.Collection([],xt)],i.prototype,"columns",void 0),Mt([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),It=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Et=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},Ft=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return It(i,e),Et([t.Property(null)],i.prototype,"id",void 0),Et([t.Property(null)],i.prototype,"name",void 0),Et([t.Property(null)],i.prototype,"unit",void 0),Et([t.Property(null)],i.prototype,"group",void 0),i}(t.ChildProperty),Lt=function(){function e(e){this.taskBarHeight=0,this.milestoneHeight=0,this.milesStoneRadius=0,this.baselineTop=0,this.baselineHeight=3,this.touchLeftConnectorpoint="",this.touchRightConnectorpoint="",this.parent=e,this.initPublicProp(),this.addEventListener()}return e.prototype.initPublicProp=function(){this.ganttChartTableBody=null},e.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createChartTable,this),this.parent.on("dataReady",this.initiateTemplates,this),this.parent.on("destroy",this.destroy,this)},e.prototype.refreshChartByTimeline=function(){this.taskTable.style.width=t.formatUnit(this.parent.timelineModule.totalTimelineWidth),this.refreshGanttRows()},e.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)},e.prototype.initiateTemplates=function(){this.taskTable.style.width=t.formatUnit(this.parent.timelineModule.totalTimelineWidth),this.initChartHelperPrivateVariable(),this.initializeChartTemplate()},e.prototype.renderChartRows=function(){this.createTaskbarTemplate(),this.parent.isGanttChartRendered=!0},e.prototype.getIndicatorNode=function(e){var t='<label class="e-label e-indicator-span"  style="line-height:'+this.parent.rowHeight+"px;left:"+this.getIndicatorleft(e.date)+'px;"><i class="'+e.iconClass+'"></i> </label>';return this.createDivElement(t)},e.prototype.getIndicatorleft=function(e){e=this.parent.dateValidationModule.getDateFromFormat(e);return this.parent.dataOperation.getTaskLeft(e,!1)},e.prototype.getChildTaskbarNode=function(e,i){var r=null,n=this.templateData;if(this.childTaskbarTemplateFunction)r=this.childTaskbarTemplateFunction(t.extend({index:e},n),this.parent,"TaskbarTemplate",this.getTemplateID("TaskbarTemplate"),!1,void 0,i[0]);else{var a="";if(this.taskLabelTemplateFunction){var o=this.taskLabelTemplateFunction(t.extend({index:e},n),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1),s=t.createElement("div");s.appendChild(o[0]),a=s.innerHTML}else a="isCustomTemplate"===(a=this.getTaskLabel(this.parent.labelSettings.taskLabel))?this.parent.labelSettings.taskLabel:a;var l=n.ganttProperties.startDate&&n.ganttProperties.endDate&&n.ganttProperties.duration?'<div class="e-gantt-child-taskbar-inner-div '+z+" "+(n.ganttProperties.isAutoSchedule?"":J)+'"style="width:'+n.ganttProperties.width+"px;height:"+this.taskBarHeight+'px;"><div class="'+F+" "+_+" "+(n.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualprogressbar")+'" style="border-style:'+(n.ganttProperties.progressWidth?"solid;":"none;")+"width:"+n.ganttProperties.progressWidth+"px;height:100%;border-top-right-radius:"+this.getBorderRadius(n.ganttProperties)+"px;border-bottom-right-radius:"+this.getBorderRadius(n.ganttProperties)+'px;"><span class="'+E+'" style="line-height:'+(this.taskBarHeight-1)+"px; text-align:"+("ResourceView"===this.parent.viewType?"left;":"")+"display:"+("ResourceView"===this.parent.viewType?"inline-flex;":"")+"width:"+("ResourceView"===this.parent.viewType?n.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;">'+a+"</span></div></div>":!n.ganttProperties.startDate||n.ganttProperties.endDate||n.ganttProperties.duration?!n.ganttProperties.endDate||n.ganttProperties.startDate||n.ganttProperties.duration?!n.ganttProperties.duration||n.ganttProperties.startDate||n.ganttProperties.endDate?"":'<div class="'+F+" "+z+" e-gantt-unscheduled-taskbar "+(n.ganttProperties.isAutoSchedule?"":J)+'"style="left:'+n.ganttProperties.left+"px; width:"+n.ganttProperties.width+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+F+" "+z+" "+le+" "+(n.ganttProperties.isAutoSchedule?"":J)+'"style="left:'+n.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+F+" "+z+" "+se+" "+(n.ganttProperties.isAutoSchedule?"":J)+'"style="left:'+n.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>';r=this.createDivElement(l)}return r},e.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]);else{var a='<div class="e-gantt-milestone" style="position:absolute;"><div class="'+L+" "+(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="'+V+" "+(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},e.prototype.getTaskBaselineNode=function(){var e=this.templateData,t='<div class="'+U+' " style="margin-top:'+this.baselineTop+"px;left:"+e.ganttProperties.baselineLeft+"px;width:"+e.ganttProperties.baselineWidth+"px;height:"+this.baselineHeight+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+'"></div>';return this.createDivElement(t)},e.prototype.getMilestoneBaselineNode=function(){var e='<div class="e-baseline-gantt-milestone-container " style="left:'+(this.templateData.ganttProperties.baselineLeft-this.milesStoneRadius)+"px;margin-top:"+(2-Math.floor(this.parent.rowHeight-this.milestoneMarginTop))+'px"><div class="'+N+'"><div class="'+N+" "+B+'"  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="'+N+" "+A+'"  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(e)},e.prototype.getLeftLabelNode=function(e){var i=this.leftLabelContainer();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);else{var n=this.parent.labelSettings.leftLabel,a=this.getTaskLabel(n);a&&(a="isCustomTemplate"===a?n:a,r=this.getLableText(a,"e-left-label-inner-div"))}return r&&r.length>0&&i[0].appendChild([].slice.call(r)[0]),i},e.prototype.getLableText=function(e,i){var r=t.createElement("div",{className:i,styles:"height:"+this.taskBarHeight+"px;margin-top:"+this.taskBarMarginTop+"px;"}),n=t.createElement("span",{className:oe});n[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=e,r.appendChild(n);var a=t.createElement("div");return a.appendChild(r),a.childNodes},e.prototype.getRightLabelNode=function(e){var i=this.rightLabelContainer();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);else{var n=this.parent.labelSettings.rightLabel,a=this.getTaskLabel(n);a&&(a="isCustomTemplate"===a?n:a,r=this.getLableText(a,"e-right-label-inner-div"))}return r&&r.length>0&&i[0].appendChild([].slice.call(r)[0]),i},e.prototype.getManualTaskbar=function(){var e=this.templateData,t=this.taskBarHeight/2-1,i=e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration?'<div class="'+X+'" 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="'+X+" "+(e.ganttProperties.startDate?se:le)+'" 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="'+X+' 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="'+Y+'"style=left:'+(e.ganttProperties.left-e.ganttProperties.autoLeft)+"px;width:"+e.ganttProperties.width+"px;height:"+t+"px;>"+i+(e.ganttProperties.startDate&&e.ganttProperties.endDate&&e.ganttProperties.duration||e.ganttProperties.duration?'<div class="e-gantt-manualparenttaskbar-left" style="height:'+t+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div><div class="e-gantt-manualparenttaskbar-right" style=left:'+(e.ganttProperties.width-t/5)+"px;height:"+t+"px;border-right-width:"+t/5+"px;border-bottom:"+t/5+"px solid transparent;></div></div>":""),n='<div class="'+Z+'" style="position:absolute;left:'+(e.ganttProperties.left-e.ganttProperties.autoLeft-this.milestoneHeight/2)+"px;width:"+2*this.milesStoneRadius+'px;"><div class="'+K+'" style="border-right-width:'+this.milesStoneRadius+"px;border-left-width:"+this.milesStoneRadius+"px;border-bottom-width:"+this.milesStoneRadius+'px;"></div><div class="'+Q+'" style="top:'+this.milesStoneRadius+"px;border-right-width:"+this.milesStoneRadius+"px; border-left-width:"+this.milesStoneRadius+"px; border-top-width:"+this.milesStoneRadius+'px;"></div></div>';return this.createDivElement(0===e.ganttProperties.width?n:r)},e.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]);else{var a="";if(this.taskLabelTemplateFunction){var o=this.taskLabelTemplateFunction(t.extend({index:e},n),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1),s=t.createElement("div");s.appendChild(o[0]),a=s.innerHTML}else a="isCustomTemplate"===(a=this.getTaskLabel(this.parent.labelSettings.taskLabel))?this.parent.labelSettings.taskLabel:a;var l=this.taskBarHeight/5,d='<div class="e-gantt-parent-taskbar-inner-div '+this.getExpandClass(n)+" "+ee+'" style="width:'+(n.ganttProperties.isAutoSchedule?n.ganttProperties.width:n.ganttProperties.autoWidth)+"px;height:"+(n.ganttProperties.isAutoSchedule?this.taskBarHeight:3*l)+"px;margin-top:"+(n.ganttProperties.isAutoSchedule?"":2*l)+'px;"><div class="e-gantt-parent-progressbar-inner-div '+this.getExpandClass(n)+" "+te+'" 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%;"><span class="'+E+'" style="line-height:'+(this.taskBarHeight-1)+"px; display:"+("ResourceView"===this.parent.viewType?"inline-flex;":"")+"width:"+("ResourceView"===this.parent.viewType?n.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;">'+a+"</span></div></div>",p='<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>';r=this.createDivElement(n.ganttProperties.isMilestone?n.ganttProperties.isAutoSchedule?p:"":d)}return r},e.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)+" "+H+'"style="display:'+this.getExpandDisplayProp(this.templateData)+";height:"+this.parent.rowHeight+'px;"><td class="'+W+" "+i+'" style="width:'+this.parent.timelineModule.totalTimelineWidth+'px;"></td></tr>',e.childNodes},e.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))},e.prototype.createDivElement=function(e){var i=t.createElement("div");return i.innerHTML=e,i.childNodes},e.prototype.isTemplate=function(e){var t=!1;return"string"!=typeof e?t=!0:(0===e.indexOf("#")||e.indexOf("<")>-1||e.indexOf("$")>-1)&&(t=!0),t},e.prototype.getTemplateID=function(e){return this.parent.element.id+e},e.prototype.updateTaskbarBlazorTemplate=function(e,i){var r=!0,n=!0,a=!0;i&&(i.ganttProperties.isMilestone?n=a=!1:i.hasChildRecords?r=a=!1:i.hasChildRecords||(n=r=!1)),this.parentTaskbarTemplateFunction&&n&&(e?t.updateBlazorTemplate(this.getTemplateID("ParentTaskbarTemplate"),"ParentTaskbarTemplate",this.parent,!1):t.resetBlazorTemplate(this.getTemplateID("ParentTaskbarTemplate"),"ParentTaskbarTemplate")),this.childTaskbarTemplateFunction&&a&&(e?t.updateBlazorTemplate(this.getTemplateID("TaskbarTemplate"),"TaskbarTemplate",this.parent,!1):t.resetBlazorTemplate(this.getTemplateID("TaskbarTemplate"),"TaskbarTemplate")),this.milestoneTemplateFunction&&r&&(e?t.updateBlazorTemplate(this.getTemplateID("MilestoneTemplate"),"MilestoneTemplate",this.parent,!1):t.resetBlazorTemplate(this.getTemplateID("MilestoneTemplate"),"MilestoneTemplate")),this.leftTaskLabelTemplateFunction&&(e?t.updateBlazorTemplate(this.getTemplateID("LeftLabelTemplate"),"LeftLabelTemplate",this.parent.labelSettings,!1):t.resetBlazorTemplate(this.getTemplateID("LeftLabelTemplate"),"LeftLabelTemplate")),this.rightTaskLabelTemplateFunction&&(e?t.updateBlazorTemplate(this.getTemplateID("RightLabelTemplate"),"RightLabelTemplate",this.parent.labelSettings,!1):t.resetBlazorTemplate(this.getTemplateID("RightLabelTemplate"),"RightLabelTemplate")),this.taskLabelTemplateFunction&&(n||a)&&(e?t.updateBlazorTemplate(this.getTemplateID("TaskLabelTemplate"),"TaskLabelTemplate",this.parent.labelSettings,!1):t.resetBlazorTemplate(this.getTemplateID("TaskLabelTemplate"),"TaskLabelTemplate"))},e.prototype.leftLabelContainer=function(){var e='<div class="'+(this.leftTaskLabelTemplateFunction?"e-left-label-container e-left-label-temp-container":x)+' " tabindex="-1" style="height:'+(this.parent.rowHeight-1)+"px;width:"+this.taskNameWidth(this.templateData)+'"></div>';return this.createDivElement(e)},e.prototype.taskbarContainer=function(){var e=this.templateData,t=!(!this.parent.editModule||!this.parent.editSettings.allowTaskbarEditing||"ParentResizing"!==this.parent.editModule.taskbarEditModule.taskBarEditAction),i='<div class="'+I+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+" "+(e.ganttProperties.cssClass?e.ganttProperties.cssClass:"")+'"  tabindex="-1" style="'+(e.ganttProperties.isMilestone&&!t?"width:"+this.milestoneHeight+"px;height:"+this.milestoneHeight+"px;margin-top:"+this.milestoneMarginTop+"px;left:"+(e.ganttProperties.left-this.milestoneHeight/2)+"px;":"width:"+e.ganttProperties.width+"px;margin-top:"+this.taskBarMarginTop+"px;left:"+(!e.hasChildRecords||e.ganttProperties.isAutoSchedule?e.ganttProperties.left:e.ganttProperties.autoLeft)+"px;height:"+this.taskBarHeight+"px;cursor:"+(e.ganttProperties.isAutoSchedule?"move;":"auto;"))+'"></div>';return this.createDivElement(i)},e.prototype.rightLabelContainer=function(){var e='<div class="'+(this.rightTaskLabelTemplateFunction?"e-right-label-container e-right-label-temp-container":O)+'"  tabindex="-1" style="left:'+this.getRightLabelLeft(this.templateData)+"px;height:"+(this.parent.rowHeight-1)+'px;"></div>';return this.createDivElement(e)},e.prototype.childTaskbarLeftResizer=function(){var e=-(this.parent.isAdaptive?12:2),t='<div class="'+j+' e-icon" style="left:'+e+"px;height:"+this.taskBarHeight+'px;"></div>';return this.createDivElement(t)},e.prototype.childTaskbarRightResizer=function(){var e=this.parent.isAdaptive?-2:-10,t='<div class="'+G+' e-icon" style="left:'+(this.templateData.ganttProperties.width+e)+"px;height:"+this.taskBarHeight+'px;"></div>';return this.createDivElement(t)},e.prototype.childTaskbarProgressResizer=function(){var e='<div class="'+q+'" style="left:'+(this.templateData.ganttProperties.progressWidth-6)+"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(e)},e.prototype.getLeftPointNode=function(){var e=this.templateData,t=-((this.parent.isAdaptive?14:2)+this.connectorPointWidth),i=-(this.connectorPointWidth+2),r=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),n='<div class="e-left-connectorpoint-outer-div" style="'+(e.ganttProperties.isMilestone?"margin-top:"+r+"px;left:"+i+"px;":"margin-top:"+this.connectorPointMargin+"px;left:"+t+"px;")+'"><div class="'+we+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width: '+this.connectorPointWidth+"px;height: "+this.connectorPointWidth+'px;">'+this.touchLeftConnectorpoint+"</div></div>";return this.createDivElement(n)},e.prototype.getRightPointNode=function(){var e=this.templateData,t=this.parent.isAdaptive?10:-2,i=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),r='<div class="'+Se+'" style="'+(e.ganttProperties.isMilestone?"left:"+(this.milestoneHeight-2)+"px;margin-top:"+i+"px;":"left:"+(e.ganttProperties.width+t)+"px;margin-top:"+this.connectorPointMargin+"px;")+'"><div class="'+De+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width:'+this.connectorPointWidth+"px;height:"+this.connectorPointWidth+'px;">'+this.touchRightConnectorpoint+"</div></div>";return this.createDivElement(r)},e.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},e.prototype.getExpandDisplayProp=function(e){return e=this.templateData,this.parent.getExpandStatus(e)?"table-row":"none"},e.prototype.getRowClassName=function(e){var t="gridrowtaskId",i=(e=this.templateData).parentItem;return i&&(t+=i.taskId.toString()),t+="level",t+=e.level.toString()},e.prototype.getBorderRadius=function(e){var t=(e=this.templateData).ganttProperties.width-e.ganttProperties.progressWidth;return t<=4?4-t:0},e.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"},e.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},e.prototype.getExpandClass=function(e){return(e=this.templateData).expanded?"e-row-expand":!e.expanded&&e.hasChildRecords?"e-row-collapse":""},e.prototype.getFieldValue=function(e){return t.isNullOrUndefined(e)?"":e},e.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],o=e.ganttProperties.resourceInfo[n][this.parent.resourceFields.unit];100!==o&&(a+="["+o+"%]"),t.isNullOrUndefined(i)?i=a:i+=" , "+a}return i}return""}return""},e.prototype.initChartHelperPrivateVariable=function(){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(.62*this.parent.rowHeight):this.parent.taskbarHeight,this.parent.renderBaseline){var e=void 0;e=this.taskBarHeight+this.baselineHeight<=this.parent.rowHeight?this.taskBarHeight:this.taskBarHeight-(this.baselineHeight+1),this.taskBarHeight=e}this.milestoneHeight=Math.floor(.82*this.taskBarHeight),this.taskBarMarginTop=Math.floor((this.parent.rowHeight-this.taskBarHeight)/2),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))-1),this.connectorPointWidth=this.parent.isAdaptive?Math.round(this.taskBarHeight/2):8,this.connectorPointMargin=Math.floor(this.taskBarHeight/2-this.connectorPointWidth/2)},e.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)}},e.prototype.createTaskbarTemplate=function(){this.updateTaskbarBlazorTemplate(!1),this.ganttChartTableBody.innerHTML="";for(var e=[],t=0;t<this.parent.currentViewData.length;t++){var i=this.parent.currentViewData[t];"ResourceView"===this.parent.viewType&&!i.expanded&&this.parent.enableMultiTaskbar&&e.push(i),this.ganttChartTableBody.appendChild(this.getGanttChartRow(t,i))}if(this.triggerQueryTaskbarInfo(),e.length)for(var r=0;r<e.length;r++)e[r].hasChildRecords&&(this.parent.isGanttChartRendered=!0,this.parent.chartRowsModule.refreshRecords([e[r]]));this.parent.renderTemplates(),this.updateTaskbarBlazorTemplate(!0)},e.prototype.getGanttChartRow=function(e,i){this.templateData=i;var r=null,n=this.getTableTrNode(),a=this.getLeftLabelNode(e),o=this.taskbarContainer();if(o[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),o[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID),!this.templateData.hasChildRecords){var s=this.getLeftPointNode();o[0].appendChild([].slice.call(s)[0])}if(this.templateData.hasChildRecords){var l=this.getParentTaskbarNode(e,o);if(!this.templateData.ganttProperties.isAutoSchedule){var d=this.getManualTaskbar();o[0].appendChild([].slice.call(d)[0])}l&&l.length>0&&o[0].appendChild([].slice.call(l)[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.getTaskBaselineNode())}else if(this.templateData.ganttProperties.isMilestone){var p=this.getMilestoneNode(e,o);p&&p.length>0&&o[0].appendChild([].slice.call(p)[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.getMilestoneBaselineNode())}else{var h=f(this.templateData.ganttProperties),c=null,u=null,g=null;if(!t.isNullOrUndefined(h)){(h||this.templateData.ganttProperties.duration)&&h&&(c=this.childTaskbarProgressResizer(),g=this.childTaskbarLeftResizer(),u=this.childTaskbarRightResizer());var m=this.getChildTaskbarNode(e,o);g&&o[0].appendChild([].slice.call(g)[0]),m&&m.length>0&&o[0].appendChild([].slice.call(m)[0]),c&&o[0].appendChild([].slice.call(c)[0]),u&&o[0].appendChild([].slice.call(u)[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(r=this.getTaskBaselineNode())}if(!this.templateData.hasChildRecords){var y=this.getRightPointNode();o[0].appendChild([].slice.call(y)[0])}var v=this.getRightLabelNode(e);if(n[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[0]),n[0].childNodes[0].childNodes[0].appendChild([].slice.call(o)[0]),this.templateData.ganttProperties.indicators&&this.templateData.ganttProperties.indicators.length>0)for(var w=void 0,D=void 0,k=this.templateData.ganttProperties.indicators,T=0;T<k.length;T++){if(w=this.getIndicatorNode(k[T]),k[T].name.indexOf("$")>-1||k[T].name.indexOf("#")>-1)D=this.templateCompiler(k[T].name)(t.extend({index:e},this.templateData),this.parent,"indicatorLabelText");else{var S=t.createElement("Text");S.innerHTML=k[T].name,D=S.childNodes}w[0].appendChild([].slice.call(D)[0]),w[0].title=t.isNullOrUndefined(k[T].tooltip)?"":k[T].tooltip,n[0].childNodes[0].childNodes[0].appendChild([].slice.call(w)[0])}return v&&v.length>0&&n[0].childNodes[0].childNodes[0].appendChild([].slice.call(v)[0]),t.isNullOrUndefined(r)||n[0].childNodes[0].childNodes[0].appendChild([].slice.call(r)[0]),n[0].childNodes[0]},e.prototype.triggerQueryTaskbarInfo=function(){if(this.parent.queryTaskbarInfo)for(var e,t,i=this.ganttChartTableBody.querySelectorAll("tr").length,r=0;r<i;r++)(e=this.ganttChartTableBody.querySelectorAll("tr")[r]).querySelector("."+I),t=this.parent.currentViewData[r],this.triggerQueryTaskbarInfoByIndex(e,t)},e.prototype.triggerQueryTaskbarInfoByIndex=function(e,i){var r,n=this;r=e.querySelector("."+I);var a,o,s={data:i,rowElement:e,taskbarElement:e.querySelector("."+I),taskbarType:i.hasChildRecords?"ParentTask":i.ganttProperties.isMilestone?"Milestone":"ChildTask"},l=this.getClassName(s);"Milestone"===s.taskbarType?(s.milestoneColor=r.querySelector(l[0])?getComputedStyle(r.querySelector(l[0])).borderBottomColor:null,s.baselineColor=e.querySelector(l[1])?getComputedStyle(e.querySelector(l[1])).borderBottomColor:null):(s.taskbarBgColor=r.querySelector(l[0])?getComputedStyle(r.querySelector(l[0])).backgroundColor:null,s.taskbarBorderColor=r.querySelector(l[0])?getComputedStyle(r.querySelector(l[0])).borderColor:null,s.progressBarBgColor=r.querySelector(l[1])?getComputedStyle(r.querySelector(l[1])).backgroundColor:null,s.baselineColor=e.querySelector("."+U)?getComputedStyle(e.querySelector("."+U)).backgroundColor:null,s.taskLabelColor=r.querySelector("."+E)?getComputedStyle(r.querySelector("."+E)).color:null),s.rightLabelColor=e.querySelector("."+O)&&e.querySelector("."+O).querySelector("."+oe)?getComputedStyle(e.querySelector("."+O).querySelector("."+oe)).color:null,s.leftLabelColor=e.querySelector("."+x)&&e.querySelector("."+x).querySelector("."+oe)?getComputedStyle(e.querySelector("."+x).querySelector("."+oe)).color:null,t.isBlazor()&&(a=s.rowElement,o=s.taskbarElement),this.parent.trigger("queryTaskbarInfo",s,function(e){n.updateQueryTaskbarInfoArgs(e,a,o)})},e.prototype.updateQueryTaskbarInfoArgs=function(e,i,r){var n=t.isBlazor()&&i?i:e.rowElement,a=t.isBlazor()&&r?r:e.taskbarElement,o=this.getClassName(e);"Milestone"===e.taskbarType?(a.querySelector(o[0])&&getComputedStyle(a.querySelector(o[0])).borderBottomColor!==e.milestoneColor&&(a.querySelector(o[0]).style.borderBottomColor=e.milestoneColor,a.querySelector("."+V).style.borderTopColor=e.milestoneColor),n.querySelector(o[1])&&getComputedStyle(n.querySelector(o[1])).borderTopColor!==e.baselineColor&&(n.querySelector(o[1]).style.borderBottomColor=e.baselineColor,n.querySelector("."+A).style.borderTopColor=e.baselineColor)):(a.querySelector(o[0])&&getComputedStyle(a.querySelector(o[0])).backgroundColor!==e.taskbarBgColor&&(a.querySelector(o[0]).style.backgroundColor=e.taskbarBgColor),a.querySelector(o[0])&&getComputedStyle(a.querySelector(o[0])).borderColor!==e.taskbarBorderColor&&(a.querySelector(o[0]).style.borderColor=e.taskbarBorderColor),a.querySelector(o[1])&&getComputedStyle(a.querySelector(o[1])).backgroundColor!==e.progressBarBgColor&&(a.querySelector(o[1]).style.backgroundColor=e.progressBarBgColor),a.querySelector("."+E)&&getComputedStyle(a.querySelector("."+E)).color!==e.taskLabelColor&&(a.querySelector("."+E).style.color=e.taskLabelColor),n.querySelector("."+U)&&getComputedStyle(n.querySelector("."+U)).backgroundColor!==e.baselineColor&&(n.querySelector("."+U).style.backgroundColor=e.baselineColor)),n.querySelector("."+x)&&n.querySelector("."+x).querySelector("."+oe)&&getComputedStyle(n.querySelector("."+x).querySelector("."+oe)).color!==e.leftLabelColor&&(n.querySelector("."+x).querySelector("."+oe).style.color=e.leftLabelColor),n.querySelector("."+O)&&n.querySelector("."+O).querySelector("."+oe)&&getComputedStyle(n.querySelector("."+O).querySelector("."+oe)).color!==e.rightLabelColor&&(n.querySelector("."+O).querySelector("."+oe).style.color=e.rightLabelColor)},e.prototype.getClassName=function(e){var t=[];return t.push("."+("ParentTask"===e.taskbarType?ee:"ChildTask"===e.taskbarType?z:L)),t.push("."+("ParentTask"===e.taskbarType?te:"ChildTask"===e.taskbarType?_:B)),t},e.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},e.prototype.refreshRow=function(e,t){var i=this.ganttChartTableBody.childNodes[e],r=this.parent.currentViewData[e];if(-1!==e&&r){var n=r;"ResourceView"===this.parent.viewType&&n.hasChildRecords&&!n.expanded&&this.parent.enableMultiTaskbar?i.replaceChild(this.getResourceParent(n).childNodes[0],i.childNodes[0]):i.replaceChild(this.getGanttChartRow(e,n).childNodes[0],i.childNodes[0]),"ResourceView"===this.parent.viewType&&n.hasChildRecords&&this.parent.showOverAllocation&&(t?this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData):(this.parent.dataOperation.updateOverlappingValues(n),this.parent.ganttChartModule.renderRangeContainer([n]))),this.triggerQueryTaskbarInfoByIndex(i,n);var a="ProjectView"===this.parent.viewType?n.ganttProperties.taskId:n.ganttProperties.rowUniqueID;this.parent.treeGrid.grid.setRowData(a,n);this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[e].getAttribute("data-uid")).data=n}},e.prototype.getResourceParent=function(e){var i=this.parent.ganttChartModule.getChartRows();this.templateData=e;var r=this.getTableTrNode(),n=this.leftLabelContainer(),a=t.createElement("div",{className:"e-collapse-parent"});r[0].childNodes[0].childNodes[0].appendChild(a);var o=this.parent.dataOperation.setSortedChildTasks(e);this.parent.dataOperation.updateOverlappingIndex(o);for(var s=0;s<i.length;s++)if(i[s].classList.contains("gridrowtaskId"+e.ganttProperties.rowUniqueID+"level"+(e.level+1))){var l=i[s].querySelector(".e-taskbar-main-container");t.addClass([l],"collpse-parent-border");var d=i[s].querySelector("."+I).getAttribute("rowUniqueId"),p=this.parent.getRecordByID(d).ganttProperties.eOverlapIndex.toString(),h=l.cloneNode(!0);h.style.zIndex=p,r[0].childNodes[0].childNodes[0].childNodes[0].appendChild(h)}return r[0].childNodes[0].childNodes[0].appendChild([].slice.call(n)[0]),r[0].childNodes[0]},e.prototype.refreshRecords=function(e,t){if(this.parent.isGanttChartRendered){if(this.updateTaskbarBlazorTemplate(!1),"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(),this.parent.renderTemplates(),this.updateTaskbarBlazorTemplate(!0)}},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("renderPanels",this.createChartTable),this.parent.off("dataReady",this.initiateTemplates),this.parent.off("destroy",this.destroy))},e.prototype.destroy=function(){this.removeEventListener()},e.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"),o=e.ganttProperties.taskName,s=e.ganttProperties.startDate,l=e.ganttProperties.endDate,d=e.ganttProperties.duration;return e.ganttProperties.isMilestone?t=i+" "+o+" "+r+" "+this.parent.getFormatedDate(s):(o&&(t+=i+" "+o+" "),s&&(t+=r+" "+this.parent.getFormatedDate(s)+" "),l&&(t+=n+" "+this.parent.getFormatedDate(l)+" "),d&&(t+=a+" "+this.parent.getDurationString(d,e.ganttProperties.durationUnit))),t},e.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},e}(),Vt=function(){function e(e){this.parent=e,this.dateValidateModule=this.parent.dateValidationModule}return e.prototype.ensurePredecessorCollection=function(){for(var e=this.parent.predecessorsCollection,t=e.length-1;t>=0;t--){var i=e[t],r=i.ganttProperties;i.hasChildRecords||this.ensurePredecessorCollectionHelper(i,r)}},e.prototype.ensurePredecessorCollectionHelper=function(e,i){var r=i.predecessorsName;if(!r||"string"!=typeof r&&"number"!=typeof r){if(r&&"object"==typeof r&&r.length){for(var n=[],a=0;a<r.length;a++){var o=r[a],s={};s.from=t.getValue("from",o),s.to=t.getValue("to",o)?t.getValue("to",o):i.rowUniqueID,s.type=t.getValue("type",o)?t.getValue("type",o):"FS";var l=t.getValue("offset",o);if(t.isNullOrUndefined(l))s.offset=0,s.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();else if("string"==typeof l){var d=this.getOffsetDurationUnit(t.getValue("offset",o));s.offset=d.duration,s.offsetUnit=d.durationUnit}else s.offset=parseFloat(l.toString()),s.offsetUnit=this.parent.durationUnit.toLocaleLowerCase();this.checkIsParent(s.from.toString())||n.push(s)}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 o=this.parent.getRecordByID(a.toString()),s=t.isNullOrUndefined(o)?null:t.extend({},{},o.taskData,!0);!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s[i.startDate])&&t.isNullOrUndefined(s[i.duration])&&t.isNullOrUndefined(s[i.endDate])&&(s[i.duration]=1,s[i.startDate]=this.parent.projectStartDate,this.parent.updateRecordByID(s))}}},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,o=this,s=[];return e.toString().split(",").forEach(function(e){r=e.split("+"),n="+",e.indexOf("-")>=0&&(r=e.split("-"),n="-"),i=r[0].match(/(\d+|[A-z]+)/g);var l="ResourceView"===o.parent.viewType?o.parent.getTaskIds():o.parent.ids,d="ResourceView"===o.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=o.getOffsetDurationUnit(h),u={from:i[0],type:a,isDrawn:!1,to:"ResourceView"===o.parent.viewType?t.ganttProperties.taskId.toString():t.ganttProperties.rowUniqueID.toString(),offsetUnit:c.durationUnit,offset:c.duration};o.checkIsParent(i[0])||s.push(u)}}),s},e.prototype.getPredecessorStringValue=function(e){var i=e.ganttProperties.predecessor,r=this.parent.durationUnitTexts,n="";if(i)for(var a=i.length,o=0;o<a;o++){var s=i[o],l="",d="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(s.from!==d.toString()){if(l=s.from+s.type,0!==s.offset){l+=s.offset>0?"+"+s.offset+" ":s.offset+" ";var p=1!==s.offset;"day"===s.offsetUnit?l+=p?t.getValue("days",r):t.getValue("day",r):"hour"===s.offsetUnit?l+=p?t.getValue("hours",r):t.getValue("hour",r):l+=p?t.getValue("minutes",r):t.getValue("minute",r)}n=n.length>0?n+","+l:l}}return n},e.prototype.getOffsetDurationUnit=function(e){var i=0,r=this.parent.durationUnit.toLocaleLowerCase(),n=this.parent.durationUnitEditText;if("string"==typeof e){for(var a=e.match(/[^0-9]+|[0-9]+/g),o=0;o<a.length;o++)a[o]=a[o].trim();"-"===a[0]&&a[1]?(a[1]=a[0]+a[1],a.shift()):"+"===a[0]&&a.shift(),"."!==a[1]||isNaN(parseInt(a[2],10))||(a[0]+=a[1]+a[2],a.splice(1,2)),a&&a.length<=2&&(i=parseFloat(a[0]),r=a[1]?a[1].toLowerCase().trim():"",r=-1!==t.getValue("minute",n).indexOf(r)?"minute":-1!==t.getValue("hour",n).indexOf(r)?"hour":-1!==t.getValue("day",n).indexOf(r)?"day":this.parent.durationUnit.toLocaleLowerCase())}else i=e,r=this.parent.durationUnit.toLocaleLowerCase();return isNaN(i)&&(i=0,r=this.parent.durationUnit.toLocaleLowerCase()),{duration:i,durationUnit:r}},e.prototype.updatePredecessors=function(){for(var e,t=this.parent.predecessorsCollection,i=t.length,r=0;r<i;r++)(e=t[r]).hasChildRecords||this.updatePredecessorHelper(e,t)},e.prototype.updatePredecessorHelper=function(e,i){var r,n,a;i=t.isNullOrUndefined(i)?[]:i,a=(r=e.ganttProperties.predecessor).length;for(var o=0;o<a;o++){var s=r[o];n=this.parent.connectorLineModule.getRecordByID(s.from);var l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(s.from!==l.toString()&&n){var d=void 0;n.ganttProperties.predecessor?((d=t.extend([],n.ganttProperties.predecessor,[],!0)).push(s),this.parent.setRecordValue("predecessor",d,n.ganttProperties,!0)):((d=[]).push(s),this.parent.setRecordValue("predecessor",d,n.ganttProperties,!0),i.push(n))}}},e.prototype.updatedRecordsDateByPredecessor=function(){for(var e=this.parent.flatData,t=0;t<e.length;t++)e[t].ganttProperties.predecessor&&this.validatePredecessorDates(e[t])},e.prototype.validatePredecessorDates=function(e){if(e.ganttProperties.predecessor){var t=e.ganttProperties.predecessor,i=void 0,r=void 0,n=null,a="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),o=t.filter(function(e){return e.to===a?e:null});for(i=0;i<o.length;i++){var s=void 0;s=o[i],r=this.parent.connectorLineModule.getRecordByID(s.from),((n=this.parent.connectorLineModule.getRecordByID(s.to)).ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)&&this.validateChildGanttRecord(r,n)}}},e.prototype.validateChildGanttRecord=function(e,i){if(this.parent.editedTaskBarItem!==i&&!t.isNullOrUndefined(f(e.ganttProperties))&&!t.isNullOrUndefined(f(i.ganttProperties))&&this.parent.isInPredecessorValidation&&(i.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)){var r=i.ganttProperties,n="ResourceView"===this.parent.viewType?r.taskId.toString():r.rowUniqueID.toString(),a=r.predecessor.filter(function(e){return e.to===n?e:null}),o=this.getPredecessorDate(i,a);this.parent.setRecordValue("startDate",o,r,!0),this.parent.dataOperation.updateMappingData(i,"startDate"),this.dateValidateModule.calculateEndDate(i),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(r),r,!0),this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(i),r,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(r.width,r.progress),r,!0),i.parentItem&&this.parent.getParentTask(i.parentItem).ganttProperties.isAutoSchedule&&this.parent.isInPredecessorValidation&&this.parent.dataOperation.updateParentItems(i.parentItem)}},e.prototype.getPredecessorDate=function(e,t){var i,r,n,a,o=this,s=t.filter(function(t){var i="ResourceView"===o.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;return t.to===i.toString()?t:null});if(s)for(var l=s.length,d=0;d<l;d++){var p=s[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?i=r:1===this.dateValidateModule.compareDates(r,i)&&(i=r)}return i},e.prototype.getValidatedStartDate=function(e,t,i){var r,n,a=i.type,o=i.offset;switch(a){case"FS":r=this.dateValidateModule.getValidEndDate(t),e.isMilestone&&0===o||(r=this.dateValidateModule.checkStartDate(r,e)),0!==o&&(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!==o&&(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!==o&&(r=this.updateDateByOffset(r,i,e)),n=e.isMilestone?r:this.dateValidateModule.checkStartDate(r,e)}return n},e.prototype.updateDateByOffset=function(e,t,i){var r,n=t.offset,a=t.offsetUnit;return n<0?r=this.dateValidateModule.getStartDate(this.dateValidateModule.checkEndDate(e,i),-1*n,a,i):(r=this.dateValidateModule.getEndDate(e,n,a,i,!1),i.isMilestone||(r=this.dateValidateModule.checkStartDate(r,i))),r},e.prototype.createConnectorLinesCollection=function(e){var t,i,r=e||this.parent.currentViewData,n=r.length;for(this.parent.connectorLineModule.expandedRecords=this.parent.getExpandedRecords(this.parent.currentViewData),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.currentViewData&&-1!==this.parent.currentViewData.indexOf(n)&&-1!==this.parent.currentViewData.indexOf(a)&&this.updateConnectorLineObject(n,a,r)}},e.prototype.updateConnectorLineObject=function(e,t,i){var r;if(r=this.parent.connectorLineModule.createConnectorLineObject(e,t,i)){if(this.parent.connectorLineIds.length>0&&-1===this.parent.connectorLineIds.indexOf(r.connectorLineId))this.parent.updatedConnectorLineCollection.push(r),this.parent.connectorLineIds.push(r.connectorLineId);else if(0===this.parent.connectorLineIds.length)this.parent.updatedConnectorLineCollection.push(r),this.parent.connectorLineIds.push(r.connectorLineId);else if(-1!==this.parent.connectorLineIds.indexOf(r.connectorLineId)){var n=this.parent.connectorLineIds.indexOf(r.connectorLineId);this.parent.updatedConnectorLineCollection[n]=r}i.isDrawn=!0}return r},e.prototype.validatePredecessor=function(e,t,i){if(this.parent.isInPredecessorValidation&&e.ganttProperties.predecessor){for(var r=e.ganttProperties.predecessor,n=void 0,a=null,o=void 0,s=void 0,l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId.toString():e.ganttProperties.rowUniqueID.toString(),d=r.filter(function(e){return e.to===l?e:null}),p=r.filter(function(e){return e.from===l?e:null}),h=0;h<d.length;h++){o=d[h],n=this.parent.connectorLineModule.getRecordByID(o.from),a=this.parent.connectorLineModule.getRecordByID(o.to),this.parent.isInPredecessorValidation&&a.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1;var c="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;c.toString()!==o.to&&c.toString()!==o.from||i&&"predecessor"!==i||this.validateChildGanttRecord(n,a)}for(h=0;h<p.length;h++)s=p[h],n=this.parent.connectorLineModule.getRecordByID(s.from),a=this.parent.connectorLineModule.getRecordByID(s.to),this.parent.isInPredecessorValidation&&a.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1,"predecessor"!==i&&this.parent.isValidationEnabled&&this.validateChildGanttRecord(n,a),!1!==n.expanded&&a.expanded,a&&this.validatePredecessor(a,void 0,"successor")}},e.prototype.getValidPredecessor=function(e){var i=this,r=[];if(!t.isNullOrUndefined(e)){var n=e.ganttProperties.predecessor;n&&n.length>0&&(r=n.filter(function(t){var r="ResourceView"===i.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;return t.from!==r.toString()}))}return r},e}(),Ut=function(){function e(e){this.expandedRecords=[],this.parent=e,this.dependencyViewContainer=t.createElement("div",{className:de}),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.currentViewData:this.expandedRecords,o=a.indexOf(e),s=a.indexOf(i),l=e.ganttProperties,d=i.ganttProperties;if(-1===o||-1===s)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=o,n.childIndex=s,n.rowHeight=this.parent.rowHeight,n.type=r.type;var p="ResourceView"===this.parent.viewType?l.taskId:l.rowUniqueID,h="ResourceView"===this.parent.viewType?d.taskId:d.rowUniqueID;return n.connectorLineId="parent"+p+"child"+h,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 o=n[a].childNodes,s=0;s<o.length;s++){var l=this.parent.connectorLineModule.generateAriaLabel(i[a]);o[s].setAttribute("aria-label",l)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.dependencyViewContainer)},e.prototype.getParentPosition=function(e){if(e.parentIndex<e.childIndex){if("FF"===e.type)return e.childLeft+e.childWidth>=e.parentLeft+e.parentWidth?"FFType2":"FFType1";if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth+25){if("FS"===e.type)return"FSType1";if("SF"===e.type)return"SFType1";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType2"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.parentLeft>e.childLeft+e.childWidth+25&&"SF"===e.type)return"SFType2";if(e.parentLeft>e.childLeft){if("SS"===e.type)return"SSType1";if("SF"===e.type)return"SFType1";if("FF"===e.type)return"FFType1"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType2";if("FS"===e.type)return"FSType2";if("SS"===e.type)return"SSType2";if("FF"===e.type)return"FFType1";if("SF"===e.type)return"SFType1"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType2";if("FF"===e.type)return"FFType2";if("SS"===e.type)return"SSType2";if("SF"===e.type)return"SFType1"}}else if(e.parentIndex>e.childIndex)if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth){if("FS"===e.type)return 30>=e.childLeft-(e.milestoneParent?e.parentLeft+e.parentWidth+4:e.parentLeft+e.parentWidth)?"FSType3":"FSType4";if(e.parentLeft<e.childLeft||e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth&&"FF"===e.type)return"FFType4"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.childLeft+e.childWidth<=e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType3";if("SF"===e.type)return e.childLeft+e.childWidth+25<e.parentLeft?"SFType3":"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}if("FS"===e.type)return"FSType3"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType3";if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}return null},e.prototype.getHeightValue=function(e){return e.parentIndex*e.rowHeight>e.childIndex*e.rowHeight?e.parentIndex*e.rowHeight-e.childIndex*e.rowHeight:e.childIndex*e.rowHeight-e.parentIndex*e.rowHeight},e.prototype.getInnerElementWidthSSType2=function(e){return e.parentLeft===e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getInnerElementLeftSSType2=function(e){return e.parentLeft===e.childLeft?e.parentLeft-20:e.parentLeft-10},e.prototype.getInnerChildWidthSSType2=function(e){return e.parentLeft+e.parentWidth<e.childLeft?10:e.parentLeft===e.childLeft?20:e.parentLeft+e.parentWidth>=e.childLeft?10:e.childLeft-e.parentLeft},e.prototype.getBorderStyles=function(e,i){return"border-"+e+"-width:"+i+"px;"+("border-"+e+"-style:solid;")+(t.isNullOrUndefined(this.lineColor)?"":"border-"+e+"-color:"+this.lineColor+";")},e.prototype.getConnectorLineTemplate=function(e){var i=this.getInnerChildWidthSSType2(e),r=this.getInnerElementWidthSSType2(e),n=this.getInnerElementLeftSSType2(e),a=this.getHeightValue(e),o=!!e.milestoneParent,s=!!e.milestoneChild,l="";if(this.getParentPosition(e)){l='<div id="ConnectorLine'+e.connectorLineId+'" style="background-color:black">';var d='<div class="'+pe+'" tabindex="-1" style="',p='<div class="e-line" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),h='<div class="'+ce+'" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),c='<div class="'+ue+'" style="'+(t.isNullOrUndefined(this.lineColor)?"":"outline-color:"+this.lineColor+";"),u=c+(s?"left:0px;":"")+this.getBorderStyles("right",10)+"top:"+(-5-this.lineStroke+(this.lineStroke-1))+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',g=this.getBorderStyles("left",10)+"top:"+-6+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',f=this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>'+p+"top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-(this.lineStroke-1))+'position:relative;"></div>',m=c+"left:"+(e.childLeft+e.childWidth-e.parentLeft+10)+"px;"+this.getBorderStyles("right",10),y="top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>';"FSType1"===this.getParentPosition(e)&&(d=d+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="FSType1">',d=(d+=p)+"left:"+(o?-1:0)+"px;width:"+(o?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>',d=(d+=p)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:0px;"+this.getBorderStyles("right",this.lineStroke)+this.getBorderStyles("top",a-this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10)-10)+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=h)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles("left",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FSType2"===this.getParentPosition(e)&&(d=d+"left:"+e.parentLeft+"px;top:"+(e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="FSType2">',d=(d+=p)+"left:"+(o?e.parentWidth-1:e.parentWidth)+"px;width:"+(o?11:10)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(e.parentWidth+10-this.lineStroke)+"px;"+this.getBorderStyles("left",this.lineStroke)+"width:0px;"+this.getBorderStyles("top",a-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:"+(e.parentLeft+e.parentWidth-e.childLeft+30)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:0px;"+this.getBorderStyles("top",this.getconnectorLineGap(e)-this.lineStroke)+this.getBorderStyles("left",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+20))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=h)+"left:"+(e.parentWidth-(e.parentLeft+e.parentWidth-e.childLeft+10))+"px;"+this.getBorderStyles("left",10)+"border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+"px;top:"+(-6-this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FSType3"===this.getParentPosition(e)&&(d=d+"left:"+(e.childLeft-20)+"px;top:"+(e.childIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="FSType3">',d=(d+=h)+"left:10px;"+this.getBorderStyles("left",10)+"border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+"px;top:"+-6+'px;width:0;height:0;position:relative;"></div>',d=(d+=p)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(6+(5+this.lineStroke)+Math.round(this.lineStroke/2))+'px;"></div>',d=(d+=p)+"width:"+this.lineStroke+"px;"+this.getBorderStyles("top",a-this.getconnectorLineGap(e)-this.lineStroke+1)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',d=(d+=p)+"width:"+(e.parentLeft+e.parentWidth-e.childLeft+30)+"px;"+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',d=(d+=p)+"left:"+(e.parentLeft+e.parentWidth-e.childLeft+(30-this.lineStroke))+"px;width:0px;height:"+(this.getconnectorLineGap(e)-this.lineStroke)+"px;"+this.getBorderStyles("left",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div>',d=(d+=p)+(o?"left:"+(e.parentLeft+e.parentWidth-e.childLeft+(18-this.lineStroke))+"px;width:"+(12+this.lineStroke)+"px;":"left:"+(e.parentLeft+e.parentWidth-e.childLeft+20)+"px;width:10px;")+this.getBorderStyles("top",this.lineStroke)+"position:relative;top:"+-(13+2*(this.lineStroke-1))+'px;"></div></div>'),"FSType4"===this.getParentPosition(e)&&(d=d+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(e.childIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="FSType4">',d=(d+=h)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth+10))+"px;"+this.getBorderStyles("left",10)+"top:"+-6+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',d=(d+=p)+"left:"+(e.childLeft-(e.parentLeft+e.parentWidth)-20)+"px;top:"+-(6+(5+this.lineStroke)+Math.round(this.lineStroke/2))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"top:"+-(13+2*(this.lineStroke-1))+"px;left:"+(e.childLeft-(e.parentLeft+e.parentWidth)-20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.lineStroke+1)+'position:relative;"></div>',d=(d+=p)+(o?"left:-1px;":"")+"top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(o?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)&&(d=d+"left:"+(e.parentLeft-10)+"px;top:"+(e.childIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="SSType4">',d=(d+=h)+"left:"+(e.childLeft-e.parentLeft)+"px;"+g,d=(d+=p)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:"+(e.childLeft-e.parentLeft)+"px;"+f,d=(d+=p)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SSType3"===this.getParentPosition(e)&&(d=d+"left:"+(e.childLeft-20)+"px;top:"+(e.childIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="SSType3">',d=(d+=h)+"left:10px;"+g,d=(d+=p)+"top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;width:10px;"+f,d=(d+=p)+"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)&&(d=d+"left:"+n+"px;top:"+(e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="SSType2">',d=(d+=p)+"width:"+(i+1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"width:"+r+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=h)+"left:"+r+"px;"+this.getBorderStyles("left",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"SSType1"===this.getParentPosition(e)&&(d=d+"left:"+(e.childLeft-20)+"px;top:"+(e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="SSType1">',d=(d+=p)+"width:"+(e.parentLeft-e.childLeft+21)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"width:10px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=h)+"left:10px;"+this.getBorderStyles("left",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FFType1"===this.getParentPosition(e)&&(d=d+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="FFType1">',d=(d+=p)+"left:"+(o?e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)-1:e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth))+"px;width:"+(o?21+this.lineStroke:20+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(s?4:10)+"px;width:"+(s?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>',d=(d+=c)+(s?"left:0px;":"")+this.getBorderStyles("right",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FFType2"===this.getParentPosition(e)&&(d=d+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="FFType2">',d=(d+=p)+(o?"left:-1px;":"")+"width:"+(o?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>',d=(d+=p)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+20)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(s?e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+4:e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+10)+"px;width:"+(s?16+this.lineStroke:10+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=c)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth))+"px;"+this.getBorderStyles("right",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),"FFType3"===this.getParentPosition(e)&&(d=d+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(e.childIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="FFType3">',d+=u,d=(d+=p)+(s?"left:4px;width:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+16):"left:10px;width:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+10))+"px;top:"+-(6+(5+this.lineStroke)+this.lineStroke/2)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)+20)+"px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.lineStroke+1)+'position:relative;"></div>',d=(d+=p)+(o?"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth)-1)+"px;width:21":"left:"+(e.parentLeft+e.parentWidth-(e.childLeft+e.childWidth))+"px;width:20")+"px;top:"+-(13+2*(this.lineStroke-1))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"FFType4"===this.getParentPosition(e)&&(d=d+"left:"+(e.parentLeft+e.parentWidth)+"px;top:"+(e.childIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="FFType4">',d=(d+=c)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth))+"px;"+this.getBorderStyles("right",10)+"top:"+(-5-this.lineStroke+(this.lineStroke-1))+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div>',d=(d+=p)+(s?"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+4)+"px;width:"+(16+this.lineStroke):"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+10)+"px;width:"+(10+this.lineStroke))+"px;"+y,d=(d+=p)+"left:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+20)+"px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.lineStroke+1)+'position:relative;"></div>',d=(d+=p)+(o?"left:-1px;width:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(21+this.lineStroke)):"width:"+(e.childLeft+e.childWidth-(e.parentLeft+e.parentWidth)+(20+this.lineStroke)))+"px;top:"+-(13+2*(this.lineStroke-1))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType4"===this.getParentPosition(e)&&(d=(d=d+"left:"+(e.parentLeft-10)+"px;top:"+(e.childIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="SFType4">')+m+"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>',d=(d+=p)+"left:"+(s?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;"+y,d=(d+=p)+"left:"+(e.childLeft+e.childWidth-e.parentLeft+30)+"px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.getconnectorLineGap(e)-(this.lineStroke-1))+'position:relative;"></div>',d=(d+=p)+"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>',d=(d+=p)+"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>',d=(d+=p)+"top:"+-(13+2*(this.lineStroke-1))+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType3"===this.getParentPosition(e)&&(d=d+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(e.childIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="SFType3">',d+=u,d=(d+=p)+(s?"left:4px;width:"+(16+this.lineStroke):"left:10px;width:"+(10+this.lineStroke))+"px;top:"+-(13+2*(this.lineStroke-1)-1)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:20px;top:"+-(13+2*(this.lineStroke-1))+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-(this.lineStroke-1))+'position:relative;"></div>',d=(d+=p)+"left:20px;top:"+-(13+2*(this.lineStroke-1))+"px;width:"+(e.parentLeft-(e.childLeft+e.childWidth+20)+this.lineStroke)+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div></div>'),"SFType1"===this.getParentPosition(e)&&(d=d+"left:"+(e.parentLeft-10)+"px;top:"+(e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(s)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="SFType1">',d=(d+=p)+"width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"width:"+(e.childLeft+e.childWidth-e.parentLeft+(30+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(e.childLeft+e.childWidth-e.parentLeft+30)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",this.getconnectorLineGap(e)-this.lineStroke)+'position:relative;"></div>',d=(d=(d+=p)+(s?"left:"+(e.childLeft+e.childWidth-e.parentLeft+15)+"px;width:"+(15+this.lineStroke):"left:"+(e.childLeft+e.childWidth-e.parentLeft+20)+"px;width:"+(10+this.lineStroke))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>')+m+"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)&&(d=d+"left:"+(e.childLeft+e.childWidth)+"px;top:"+(e.parentIndex*e.rowHeight+this.getTaskbarMidpoint(o)-(this.lineStroke-1))+"px;width:1px;height:"+a+'px;position:absolute" data-connectortype="SFType2">',d=(d+=p)+"left:"+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:11px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=p)+"left:"+(e.parentLeft-(e.childLeft+e.childWidth)-10)+"px;width:0px;"+this.getBorderStyles("left",this.lineStroke)+this.getBorderStyles("top",a-this.lineStroke)+'position:relative;"></div>',d=(d+=p)+(s?"left:4px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(14-this.lineStroke)):"left:10px;width:"+(e.parentLeft-(e.childLeft+e.childWidth)-(20-this.lineStroke)))+"px;"+this.getBorderStyles("top",this.lineStroke)+'position:relative;"></div>',d=(d+=c)+"left:0px;"+this.getBorderStyles("right",10)+"top:"+(-6-this.lineStroke)+"px;border-bottom-width:"+(5+this.lineStroke)+"px;border-top-width:"+(5+this.lineStroke)+'px;width:0;height:0;position:relative;"></div></div>'),l+=d,l+="</div>"}return l},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.parent.getExpandedRecords(this.parent.currentViewData),r=i[e.parentIndex].ganttProperties.taskName,n=i[e.childIndex].ganttProperties.taskName,a=this.parent.localeObj.getConstant("start"),o=this.parent.localeObj.getConstant("finish");return"FS"===t?r+" "+o+" to "+n+" "+a:"FF"===t?r+" "+o+" to "+n+" "+o:"SS"===t?r+" "+a+" to "+n+" "+a:r+" "+a+" to "+n+" "+o},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}(),Nt=function(){function e(e){this.parent=e,this.parent.on("destroy",this.destroy,this)}return e.prototype.renderSplitter=function(){var e=this;t.isNullOrUndefined(this.parent.toolbarModule)||t.isNullOrUndefined(this.parent.toolbarModule.element)||this.parent.toolbarModule.element.offsetHeight;var i=this.calculateSplitterPosition(this.parent.splitterSettings);this.parent.splitterElement=t.createElement("div",{className:"e-gantt-splitter"}),this.parent.treeGridPane=t.createElement("div",{className:"e-gantt-tree-grid-pane"}),this.parent.chartPane=t.createElement("div",{className:"e-gantt-chart-pane"}),this.parent.splitterElement.appendChild(this.parent.treeGridPane),this.parent.splitterElement.appendChild(this.parent.chartPane),this.splitterObject=new o.Splitter({height:null,width:this.parent.ganttWidth.toString(),separatorSize:this.parent.splitterSettings.separatorSize,paneSettings:[{resizable:!0,size:i,min:this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum)},{resizable:!0}],orientation:"Horizontal",resizeStart:function(i){var r=t.isBlazor()?i.element.querySelectorAll(".e-pane")[0]:i.pane[0],a=t.isBlazor()?i.element.querySelectorAll(".e-pane")[1]:i.pane[1];e.splitterPreviousPositionGrid=r.scrollWidth+1+"px",e.splitterPreviousPositionChart=a.scrollWidth+1+"px";var o=new n.Deferred;return e.parent.trigger("splitterResizeStart",i,function(e){o.resolve(e)}),o},resizing:function(t){e.parent.trigger("splitterResizing",t)},resizeStop:function(t){var i=new n.Deferred;return e.parent.trigger("splitterResized",t,function(t){!0===t.cancel&&(e.splitterObject.paneSettings[0].size=null,e.splitterObject.paneSettings[0].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionGrid),e.splitterObject.paneSettings[1].size=null,e.splitterObject.paneSettings[1].size=e.getSpliterPositionInPercentage(e.splitterPreviousPositionChart)),i.resolve(t)}),i}}),this.parent.element.appendChild(this.parent.splitterElement),this.splitterObject.appendTo(this.parent.splitterElement)},e.prototype.calculateSplitterPosition=function(e,i){return"Grid"===e.view?"100%":"Chart"===e.view?"0%":t.isNullOrUndefined(e.position)||""===e.position?!t.isNullOrUndefined(e.columnIndex)&&e.columnIndex>=0?i?this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(e.columnIndex).toString()+"px"):this.getSpliterPositionInPercentage(150*e.columnIndex+"px"):this.getSpliterPositionInPercentage("250px"):this.getSpliterPositionInPercentage(e.position)},e.prototype.getSpliterPositionInPercentage=function(e){var i=t.isNullOrUndefined(e)||""===e?null:e;if(!t.isNullOrUndefined(i))if(-1!==e.indexOf("px")){var r=parseInt(e,10);i=r/this.parent.ganttWidth*100<=100?r/this.parent.ganttWidth*100+"%":"25%"}else i=-1===e.indexOf("%")?e+"%":e;return i},e.prototype.getTotalColumnWidthByIndex=function(e){var t=0,i=this.parent.treeGrid.element.querySelectorAll(".e-headercell");e=i.length>e?e:i.length;for(var r=0;r<e;r++)t+=i[r].offsetWidth;return t},e.prototype.updateSplitterPosition=function(){this.splitterObject.separatorSize=this.parent.splitterSettings.separatorSize>=4?this.parent.splitterSettings.separatorSize:4;var e=this.calculateSplitterPosition(this.parent.splitterSettings,!0);this.splitterObject.paneSettings[0].min=this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum),this.splitterObject.dataBind(),this.splitterObject.paneSettings[0].size=e},e.prototype.triggerCustomResizedEvent=function(){var e=this.splitterObject.element.querySelectorAll(".e-pane")[0],t=this.splitterObject.element.querySelectorAll(".e-pane")[1],i={event:null,element:this.splitterObject.element,pane:[e,t],index:[0,1],separator:this.splitterObject.element.querySelector(".e-split-bar"),paneSize:[e.offsetWidth,t.offsetWidth]};this.parent.trigger("splitterResized",i),!0===i.cancel&&(this.splitterObject.paneSettings[0].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionGrid),this.splitterObject.paneSettings[1].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionChart))},e.prototype.destroy=function(){this.splitterObject.destroy(),this.parent.off("destroy",this.destroy)},e}(),Bt=function(){function e(e){this.parent=e,this.createTooltip(),this.parent.on("destroy",this.destroy,this)}return e.prototype.createTooltip=function(){this.toolTipObj=new i.Tooltip,this.toolTipObj.target=".e-header-cell-label, .e-gantt-child-taskbar,.e-gantt-parent-taskbar, .e-gantt-milestone, .e-gantt-unscheduled-taskbar.e-event-markers, .e-baseline-bar, .e-event-markers,.e-connector-line-container, .e-indicator-span, .e-notes-info, .e-gantt-manualparent-milestone,.e-taskbar-left-resizer, .e-taskbar-right-resizer, .e-baseline-gantt-milestone, .e-gantt-manualparenttaskbar",this.toolTipObj.position="BottomCenter",this.toolTipObj.openDelay=700,this.toolTipObj.enableHtmlSanitizer=!1,this.toolTipObj.cssClass=Pe,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;i.isOnEdit&&(e.cancel=!0);var r,a=t.closest(e.target,"div."+I);r=t.isNullOrUndefined(a)?g(e.target,W):e.target;var o,s={data:{},args:e,cancel:!1,content:""};if(e.target.classList.contains("e-header-cell-label"))i.timelineSettings.showTooltip?s.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("timeline",o,i,e):e.cancel=!0;else if(i.tooltipSettings.showTooltip)if(r&&(s.data=i.ganttChartModule.getRecordByTaskBar(r),o=s.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")){var l=void 0;i.tooltipSettings.taskbar&&(l=i.tooltipModule.templateCompiler(i.tooltipSettings.taskbar,i,o,"TooltipTaskbarTemplate")),s.content=this.toolTipObj.content=l?l[0]:i.tooltipModule.getTooltipContent(o.ganttProperties.isMilestone?"milestone":"taskbar",o,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,o,"TooltipBaselineTemplate")),s.content=this.toolTipObj.content=d?d[0]:i.tooltipModule.getTooltipContent(o.ganttProperties.isMilestone?"milestone":"baseline",o,i,e)}else if(e.target.classList.contains("e-event-markers"))s.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("marker",o,i,e);else if(e.target.classList.contains("e-connector-line-container")){var p=void 0;i.tooltipModule.predecessorTooltipData=i.tooltipModule.getPredecessorTooltipData(e),s.data=this.predecessorTooltipData,i.tooltipSettings.connectorLine&&(p=i.tooltipModule.templateCompiler(i.tooltipSettings.connectorLine,i,i.tooltipModule.predecessorTooltipData,"TooltipConnectorLineTemplate")),s.content=this.toolTipObj.content=p?p[0]:i.tooltipModule.getTooltipContent("connectorLine",o,i,e)}else if(e.target.classList.contains("e-indicator-span"))s.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("indicator",o,i,e),t.isNullOrUndefined(s.content)&&(e.cancel=!0);else if(e.target.classList.contains("e-notes-info")){var h=this.parent.ganttChartModule.getRecordByTarget(e.event);s.content=this.toolTipObj.content=h.ganttProperties.notes,t.isNullOrUndefined(s.content)&&(e.cancel=!0)}else e.target.classList.contains("e-gantt-manualparenttaskbar")?(s.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("manualtaskbar",o,i,e),t.isNullOrUndefined(s.content)&&(e.cancel=!0)):e.target.classList.contains("e-gantt-manualparent-milestone")&&(s.content=this.toolTipObj.content=i.tooltipModule.getTooltipContent("manualmilestone",o,i,e),t.isNullOrUndefined(s.content)&&(e.cancel=!0));else e.cancel=!0;if(!1===e.cancel){var c=new n.Deferred;return i.trigger("beforeTooltipRender",s,function(t){c.resolve(t),t.cancel&&(e.cancel=!0)}),this.parent.isAdaptive||"mouseover"!==e.event.type||(this.currentTarget=e.target,t.EventHandler.add(this.currentTarget,"mousemove",this.mouseMoveHandler.bind(this))),this.parent.renderTemplates(),c}},e.prototype.tooltipCloseHandler=function(e){this.tooltipMouseEvent=null,this.parent.isAdaptive||t.EventHandler.remove(this.currentTarget,"mousemove",this.mouseMoveHandler),this.currentTarget=null},e.prototype.mouseMoveHandler=function(e){this.tooltipMouseEvent=e},e.prototype.updateTooltipPosition=function(e){if(!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,o=i.x,s=i.y,l=!1;a<o+e.element.offsetWidth+20?o=o-e.element.offsetWidth-10:o+=10,n<s+e.element.offsetHeight+20?s=s-e.element.offsetHeight-10:(l=!0,s+=10),window.innerHeight<e.element.offsetHeight+s&&(s=s-e.element.offsetHeight-(l?20:10)),e.element.style.left=o+"px",e.element.style.top=s+"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,o,s;switch(i&&(o=i.ganttProperties,s=t.isNullOrUndefined(o.taskName)?"":'<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">'+o.taskName+"</td></tr>"),e){case"milestone":a='<table class = "e-gantt-tooltiptable"><tbody>'+s+(t.isNullOrUndefined(o.startDate)?"":'<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(o.startDate,this.parent.getDateFormat())+"</td></tr>")+"</tbody></table>";break;case"taskbar":var l=!(i.hasChildRecords&&!o.isAutoSchedule);a='<table class = "e-gantt-tooltiptable"><tbody>'+s+(o.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(l?"startDate":"subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(l?o.startDate:o.autoStartDate,this.parent.getDateFormat())+"</td></tr>":"")+(o.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(l?"endDate":"subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(l?o.endDate:o.autoEndDate,this.parent.getDateFormat())+"</td></tr>":"")+(t.isNullOrUndefined(o.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getDurationString(l?o.duration:o.autoDuration,o.durationUnit)+"</td></tr>")+(t.isNullOrUndefined(o.progress)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+"</td><td>:</td><td>"+o.progress+"</td></tr>")+"</tbody></table>";break;case"baseline":a='<table class = "e-gantt-tooltiptable"><tbody>'+s+'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(o.baselineStartDate,this.parent.getDateFormat())+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(o.baselineEndDate,this.parent.getDateFormat())+"</td></tr></tbody></table>";break;case"marker":var d=r.tooltipModule.getMarkerTooltipData(n),p=d.label?d.label:"";a='<table class = "e-gantt-tooltiptable"><tbody><tr><td>'+this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(d.day),this.parent.getDateFormat())+"</td></tr><tr><td>"+p+"</td></tr></tbody></table>";break;case"connectorLine":a='<table class = "e-gantt-tooltiptable"><tbody><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("from")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.tooltipModule.predecessorTooltipData.fromName+" ("+r.tooltipModule.predecessorTooltipData.fromId+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("to")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.tooltipModule.predecessorTooltipData.toName+" ("+r.tooltipModule.predecessorTooltipData.toId+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("taskLink")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+r.tooltipModule.predecessorTooltipData.linkText+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("lag")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+r.tooltipModule.predecessorTooltipData.offsetString+"</td></tr></tbody></table>";break;case"indicator":n.target.title.length&&(a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+n.target.title+"</tr></tbody></table>");break;case"timeline":a='<table class = "e-gantt-tooltiptable"><tbody><tr>'+n.target.title+"</tr></tbody></table>";break;case"manualtaskbar":var h=o.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(o.autoStartDate,this.parent.getDateFormat())+"</td></tr>":"",c=o.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(o.autoEndDate,this.parent.getDateFormat())+"</td></tr>":"",u=t.isNullOrUndefined(o.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getDurationString(o.duration,o.durationUnit)+"</td></tr>";a='<table class = "e-gantt-tooltiptable"><tbody>'+s+(o.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(o.startDate,this.parent.getDateFormat())+"</td></tr>":"")+h+(o.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(o.endDate,this.parent.getDateFormat())+"</td></tr>":"")+c+u+"</tbody></table>";break;case"manualmilestone":var g=o.autoStartDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+this.parent.getFormatedDate(o.autoStartDate,this.parent.getDateFormat())+"</td></tr>":"",f=o.autoEndDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(o.autoEndDate,this.parent.getDateFormat())+"</td></tr>":"";a='<table class = "e-gantt-tooltiptable"><tbody>'+s+('<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getFormatedDate(o.startDate,this.parent.getDateFormat())+"</tr>")+g+f+"</tbody></table>"}return a},e.prototype.getMarkerTooltipData=function(e){var t=e.target.id.match(/\d+/g);return this.parent.eventMarkers[Number(t)]},e.prototype.getPredecessorTooltipData=function(e){var t,i,r=e.target.parentElement.id.match(/\d+/g);"ResourceView"===this.parent.viewType?(t=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[0])],i=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[1])]):(t=this.parent.flatData[this.parent.ids.indexOf(r[0])],i=this.parent.flatData[this.parent.ids.indexOf(r[1])]);var n=t.ganttProperties.predecessor.filter(function(e){return e.to===r[1]});return{fromId:"ResourceView"===this.parent.viewType?t.ganttProperties.taskId:t.ganttProperties.rowUniqueID,toId:"ResourceView"===this.parent.viewType?i.ganttProperties.taskId:i.ganttProperties.rowUniqueID,fromName:t.ganttProperties.taskName,toName:i.ganttProperties.taskName,linkType:n[0].type,linkText:this.parent.getPredecessorTextValue(n[0].type),offset:n[0].offset,offsetUnit:n[0].offsetUnit,offsetString:this.parent.getDurationString(n[0].offset,n[0].offsetUnit)}},e.prototype.templateCompiler=function(e,i,r,n){var a=i.chartRowsModule.templateCompiler(e),o=i.chartRowsModule.getTemplateID(n);return a(t.extend({index:0},r),i,n,o,!0)},e.prototype.destroy=function(){this.toolTipObj.destroy()},e}(),At=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),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.currentViewData.indexOf(a))return;i.selectionModule.selectRow(i.currentViewData.indexOf(a),!1,!0)}break;case"downArrow":case"upArrow":var o=i.element.querySelector("#"+i.element.id+"_searchbar");o&&o.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 l=e.target.ej2_instances[0],d=e.target.value,p=i.currentViewData[i.selectedRowIndex].ganttProperties;s.field===i.columnMapping.duration&&d!==(t.isNullOrUndefined(s.edit)||t.isNullOrUndefined(s.edit.read)?t.isNullOrUndefined(s.valueAccessor)?i.dataOperation.getDurationString(p.duration,p.durationUnit):s.valueAccessor(i.columnMapping.duration,i.editedRecords,s):s.edit.read()).toString()&&(l.value=d,l.dataBind())}if(i.editModule.dialogModule.dialogObj&&t.getValue("dialogOpen",i.editModule.dialogModule.dialogObj))return;i.editModule.cellEditModule.isCellEdit=!1,i.treeGrid.grid.saveCell();i.element.querySelector(".e-treegrid").focus()}if(!t.isNullOrUndefined(this.parent.onTaskbarClick)&&!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(n.closest(".e-chart-row"))){var h=e.target,c=n.querySelector(".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone");c&&this.parent.ganttChartModule.onTaskbarClick(e,h,c)}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":e.preventDefault();i.element.querySelector(".e-gantt-chart").focus(),i.addRecord();break;case"addRowDialog":if(e.preventDefault(),i.editModule&&i.editModule.dialogModule&&i.editSettings.allowAdding){if(i.editModule.dialogModule.dialogObj&&t.getValue("dialogOpen",i.editModule.dialogModule.dialogObj))return;i.editModule.dialogModule.openAddDialog()}break;case"editRowDialog":e.preventDefault();if(i.element.querySelector(".e-treegrid").focus(),i.editModule&&i.editModule.dialogModule&&i.editSettings.allowEditing){if(i.editModule.dialogModule.dialogObj&&t.getValue("dialogOpen",i.editModule.dialogModule.dialogObj))return;i.editModule.dialogModule.openToolbarEditDialog()}break;case"delete":i.selectionModule&&i.editModule&&(!i.editSettings.allowTaskbarEditing||i.editSettings.allowTaskbarEditing&&!i.editModule.taskbarEditModule.touchEdit)&&("Cell"!==i.selectionSettings.mode&&i.selectionModule.selectedRowIndexes.length||"Cell"===i.selectionSettings.mode&&i.selectionModule.getSelectedRowCellIndexes().length)&&i.editModule.startDeleteAction();break;case"focusTask":e.preventDefault();var 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),w=v.top+v.height/2,D=v.left+v.width/2;this.setActiveElement(e.target),y.open(w,D),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,a=n>-1?n:i.indexOf(r),o="downArrow"===e.action?i[a+1]:i[a-1];t.selectionModule.selectRow(t.currentViewData.indexOf(o),!1,!0)}else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var s=t.selectionModule.getSelectedRowCellIndexes(),l=s[s.length-1],d=l.cellIndexes[l.cellIndexes.length-1],p=(r=t.currentViewData[l.rowIndex],a=i.indexOf(r),o="downArrow"===e.action?i[a+1]:i[a-1],{rowIndex:t.currentViewData.indexOf(o),cellIndex:d});t.selectionModule.selectCell(p)}this.parent.ganttChartModule.focusedRowIndex=this.parent.selectedRowIndex}},e.prototype.expandCollapseKey=function(e){var t=this.parent;if(t.selectionModule&&-1!==t.selectedRowIndex){var i=void 0;if("Cell"!==t.selectionSettings.mode)i=t.selectedRowIndex;else if("Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length>0){var r=t.selectionModule.getSelectedRowCellIndexes();i=r[r.length-1].rowIndex}"expandRow"===e.action?t.expandByIndex(i):t.collapseByIndex(i)}},e}(),Wt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ht=function(e,t,i,r){var n,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},jt=function(e){function n(t,i){var r=e.call(this,t,i)||this;return r.isCancelled=!1,r.previousRecords={},r.editedRecords=[],r.isOnEdit=!1,r.isOnDelete=!1,r.isConnectorLineUpdate=!1,r.staticSelectedRowIndex=-1,r.needsID=!0,r.showActiveElement=!0,r.enableHeaderFocus=!0,r.isTreeGridRendered=!1,r.isGanttChartRendered=!1,r}return Wt(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.ids=[],this.ganttColumns=[],this.localeObj=new t.L10n(this.getModuleName(),this.getDefaultLocale(),this.locale),this.dataOperation=new R(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=null,this.cloneProjectEndDate=null,this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.ganttChartModule=new Fe(this),this.timelineModule=new Ve(this),this.chartRowsModule=new Lt(this),this.treeGridModule=new Ne(this),this.dateValidationModule=new P(this),this.predecessorModule=new Vt(this),this.connectorLineModule=new Ut(this),this.splitterModule=new Nt(this),this.tooltipModule=new Bt(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 At(this),this.zoomingLevels=this.getZoomingLevels(),this.resourceFieldsMapping(),t.isNullOrUndefined(this.resourceFields.unit)&&(this.resourceFields.unit="unit"),t.isNullOrUndefined(this.taskFields.work)||(this.taskType="FixedWork"),this.taskIds=[]},n.prototype.getDateFormat=function(){if(t.isNullOrUndefined(this.dateFormat)){return t.isBlazor()?this.globalize.getDatePattern({skeleton:"d"}):this.globalize.getDatePattern({skeleton:"yMd"})}return this.dateFormat},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.grid.isReact=!0),i.createSpinner({target:this.element},this.createElement),this.trigger("load",{}),this.element.classList.add("e-gantt"),this.isAdaptive?this.element.classList.add("e-device"):this.element.classList.remove("e-device"),this.calculateDimensions(),t.isNullOrUndefined(this.toolbarModule)||this.renderToolbar(),this.splitterModule.renderSplitter(),this.notify("renderPanels",null),this.showSpinner(),this.dataOperation.checkDataBinding()},n.prototype.showSpinner=function(){i.showSpinner(this.element)},n.prototype.hideSpinner=function(){i.hideSpinner(this.element)},n.prototype.renderGantt=function(e){this.timelineModule.processTimelineUnit(),this.timelineModule.calculateZoomingLevelsPerDayWidth(),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.updatePredecessors(),this.isInPredecessorValidation&&this.predecessorModule.updatedRecordsDateByPredecessor()),this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp(),e?(this.updateProjectDates(this.cloneProjectStartDate,this.cloneProjectEndDate,this.isTimelineRoundOff),this.dataOperation.updateGanttData(),this.treeGrid.dataSource=this.flatData):(this.dataOperation.updateGanttData(),this.treeGridPane.classList.remove("e-temp-content"),t.remove(this.treeGridPane.querySelector(".e-gantt-temp-header")),this.notify("dataReady",{}),this.enableContextMenu&&this.notify("initiate-contextMenu",{}),this.renderTreeGrid(),this.wireEvents(),this.notify("initPredessorDialog",{})),this.splitterModule.updateSplitterPosition(),"Vertical"!==this.gridLines&&"Both"!==this.gridLines||this.renderChartVerticalLines()},n.prototype.wireEvents=function(){this.allowKeyboard&&(this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfig,eventName:"keydown"}))},n.prototype.keyActionHandler=function(e){this.focusModule.onKeyPress(e)},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(){if(t.isBlazor()&&0!==this.flatData.length){var e=this.treeGrid.getCurrentViewRecords().slice();this.currentViewData=[];for(var i=0;i<e.length;i++)this.currentViewData.push(this.getTaskByUniqueID(e[i].uniqueID));this.treeGrid.grid.currentViewData=this.currentViewData}else 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(){var e=this.getExpandedRecords(this.currentViewData);this.contentHeight=e.length*this.rowHeight},n.prototype.getExpandStatus=function(e){var i=this.getParentTask(e.parentItem);if(t.isNullOrUndefined(i))return!0;if(!1===i.expanded)return!1;if(i.parentItem){return!1!==this.getParentTask(i.parentItem).expanded&&this.getExpandStatus(this.getParentTask(i.parentItem))}return!0},n.prototype.getExpandedRecords=function(e){var t=this;return e.filter(function(e){return!0===t.getExpandStatus(e)})},n.prototype.getZoomingLevels=function(){return[{topTier:{unit:"Year",format:"yyyy",count:50},bottomTier:{unit:"Year",format:"yyyy",count:10},timelineUnitSize:99,level:0,timelineViewMode:"Year",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:20},bottomTier:{unit:"Year",format:"yyyy",count:5},timelineUnitSize:99,level:1,timelineViewMode:"Year",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:5},bottomTier:{unit:"Year",format:"yyyy",count:1},timelineUnitSize:99,level:2,timelineViewMode:"Year",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:66,level:3,timelineViewMode:"Year",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:99,level:4,timelineViewMode:"Year",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:66,level:5,timelineViewMode:"Year",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:99,level:6,timelineViewMode:"Year",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",format:"MMM yyyy",count:1},timelineUnitSize:99,level:7,timelineViewMode:"Year",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yy",count:1},bottomTier:{unit:"Week",format:"dd",count:1},timelineUnitSize:33,level:8,timelineViewMode:"Month",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:66,level:9,timelineViewMode:"Month",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:99,level:10,timelineViewMode:"Month",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:33,level:11,timelineViewMode:"Week",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:66,level:12,timelineViewMode:"Week",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:99,level:13,timelineViewMode:"Week",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:66,level:14,timelineViewMode:"Day",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:99,level:15,timelineViewMode:"Day",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:66,level:16,timelineViewMode:"Day",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:99,level:17,timelineViewMode:"Day",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:66,level:18,timelineViewMode:"Day",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:99,level:19,timelineViewMode:"Day",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:66,level:20,timelineViewMode:"Day",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:99,level:21,timelineViewMode:"Day",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:30},timelineUnitSize:66,level:22,timelineViewMode:"Hour",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:15},timelineUnitSize:66,level:23,timelineViewMode:"Hour",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:1},timelineUnitSize:66,level:24,timelineViewMode:"Hour",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0}]},n.prototype.displayQuarterValue=function(e){var t=e.getMonth();return t>=0&&t<=2?"Q1":t>=3&&t<=5?"Q2":t>=6&&t<=8?"Q3":"Q4"},n.prototype.displayHalfValue=function(e){var t=e.getMonth();return t>=0&&t<=6?"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.treeDataBound=function(e){if(this.updateCurrentViewData(),this.updateContentHeight(),!this.isTreeGridRendered){this.isTreeGridRendered=!0,this.isLoad=!1;var i=0;t.isNullOrUndefined(this.toolbarModule)||t.isNullOrUndefined(this.toolbarModule.element)||(i=this.toolbarModule.element.offsetHeight),this.timelineModule.isSingleTier?(t.addClass(this.treeGrid.element.querySelectorAll(".e-headercell"),M),t.addClass(this.treeGrid.element.querySelectorAll(".e-columnheader"),M)):(t.removeClass(this.treeGrid.element.querySelectorAll(".e-headercell"),M),t.removeClass(this.treeGrid.element.querySelectorAll(".e-columnheader"),M)),this.treeGrid.height=this.ganttHeight-i-this.treeGrid.grid.getHeaderContent().offsetHeight,this.notify("tree-grid-created",{}),this.createGanttPopUpElement(),this.hideSpinner(),t.setValue("isGanttCreated",!0,e),this.renderComplete()}this.predecessorModule&&this.taskFields.dependency&&(this.connectorLineIds=[],this.updatedConnectorLineCollection=[],this.predecessorModule.createConnectorLinesCollection()),this.notify("recordsUpdated",{}),this.trigger("dataBound",e)},n.prototype.onPropertyChanged=function(e,i){for(var n=!1,a=0,o=Object.keys(e);a<o.length;a++){var s=o[a];switch(s){case"allowSelection":this.treeGrid.allowSelection=this.allowSelection,this.treeGrid.dataBind();break;case"allowRowDragAndDrop":this.treeGrid.allowRowDragAndDrop=this.allowRowDragAndDrop,this.treeGrid.dataBind();break;case"allowFiltering":this.treeGrid.allowFiltering=this.allowFiltering,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"showColumnMenu":this.treeGrid.showColumnMenu=this.showColumnMenu,this.treeGrid.dataBind();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"filterSettings":this.treeGrid.filterSettings=r.getActualProperties(this.filterSettings),this.treeGrid.dataBind();break;case"allowResizing":this.treeGrid.allowResizing=this.allowResizing,this.treeGrid.dataBind();break;case"allowReordering":this.treeGrid.allowReordering=this.allowReordering,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":this.treeGrid.grid.searchSettings=r.getActualProperties(this.searchSettings),this.treeGrid.grid.dataBind(),this.toolbarModule&&this.toolbarModule.updateSearchTextBox();break;case"labelSettings":case"renderBaseline":case"baselineColor":this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"resourceIDMapping":case"resourceNameMapping":case"resources":this.dataOperation.reUpdateResources(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"includeWeekend":case"dayWorkingTime":case"allowUnscheduledTasks":case"holidays":"holidays"===s&&(this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.notify("ui-update",{module:"day-markers",properties:e})),this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"addDialogFields":case"editDialogFields":this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.processDialogFields();break;case"columns":this.treeGridModule.treeGridColumns=[],this.treeGridModule.validateGanttColumns(),this.treeGrid.columns=this.treeGridModule.treeGridColumns,this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline();break;case"width":case"height":this.reUpdateDimention();break;case"editSettings":this.treeGrid.editSettings.allowAdding=this.editSettings.allowAdding,this.treeGrid.editSettings.allowDeleting=this.editSettings.allowDeleting,this.treeGrid.editSettings.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,this.treeGrid.editSettings.allowEditing=this.editSettings.allowEditing,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":this.closeGanttActions(),this.dataOperation.checkDataBinding(!0);break;case"enableContextMenu":case"contextMenuItems":this.enableContextMenu||"contextMenuItems"===s?this.notify("reRender-contextMenu",{module:"contextMenu",enable:this.contextMenuItems}):this.treeGrid.contextMenuItems=[],this.treeGrid.dataBind();break;case"currencyCode":case"locale":case"enableRtl":n=!0;break;case"validateManualTasksOnLinking":this.validateManualTasksOnLinking=e.validateManualTasksOnLinking;break;case"readOnly":this.readOnly=this.readOnly,this.refresh();break;case"showOverAllocation":this.updateOverAllocationCotainer();break;case"viewType":"ProjectView"!==e.viewType&&"ResourceView"!==e.viewType||this.refresh()}}n&&this.refresh()},n.prototype.updateOverAllocationCotainer=function(){if(this.showOverAllocation&&"ResourceView"===this.viewType)this.ganttChartModule.renderOverAllocationContainer();else{var e=this.element.querySelector("."+Ie);e&&(e.innerHTML="")}},n.prototype.getPersistData=function(){return this.addOnPersist(["allowSelection"])},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(),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()},n.prototype.getTaskbarHeight=function(){return this.chartRowsModule.taskBarHeight},n.prototype.requiredModules=function(){var e=[];return this.isDestroyed?e:(this.allowSorting&&e.push({member:"sort",args:[this]}),(this.allowFiltering||this.toolbar&&-1!==this.toolbar.indexOf("Search"))&&e.push({member:"filter",args:[this]}),this.allowReordering&&e.push({member:"reorder",args:[this]}),this.allowExcelExport&&e.push({member:"excelExport",args:[this]}),this.allowRowDragAndDrop&&e.push({member:"rowDragAndDrop",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),this.toolbar&&e.push({member:"toolbar",args:[this]}),(this.editSettings.allowAdding||this.editSettings.allowEditing||this.editSettings.allowDeleting||this.editSettings.allowTaskbarEditing||this.allowRowDragAndDrop)&&e.push({member:"edit",args:[this]}),this.allowSelection&&e.push({member:"selection",args:[this]}),this.tooltipSettings.showTooltip&&e.push({member:"tooltip",args:[this]}),(this.highlightWeekends||this.holidays&&this.holidays.length>0||this.eventMarkers&&this.eventMarkers.length>0)&&e.push({member:"dayMarkers",args:[this]}),this.enableContextMenu&&e.push({member:"contextMenu",args:[this]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this]}),this.allowPdfExport&&e.push({member:"pdfExport",args:[this]}),e)},n.prototype.sortColumn=function(e,t,i){this.sortModule&&this.allowSorting&&this.sortModule.sortColumn(e,t,i)},n.prototype.clearSorting=function(){this.sortModule.clearSorting()},n.prototype.renderChartGridLines=function(){var e="e-chart-row-border",i=this.chartVerticalLineContainer,r=document.getElementById(this.element.id+"GanttTaskTableBody").querySelectorAll("td");if("Vertical"===this.gridLines){if(t.isNullOrUndefined(i)?this.renderChartVerticalLines():"none"===i.style.display&&(i.style.display="block"),r[0].classList.contains(e))for(var n=0;n<r.length;n++)t.removeClass([r[n]],e)}else if("Horizontal"===this.gridLines){if(t.isNullOrUndefined(i)||(i.style.display="none"),!r[0].classList.contains(e))for(n=0;n<r.length;n++)t.addClass([r[n]],e)}else if("Both"===this.gridLines){if(t.isNullOrUndefined(i)?this.renderChartVerticalLines():"none"===i.style.display&&(i.style.display="block"),!r[0].classList.contains(e))for(n=0;n<r.length;n++)t.addClass([r[n]],e)}else if("None"===this.gridLines&&(t.isNullOrUndefined(i)||"none"===i.style.display||(i.style.display="none"),r[0].classList.contains(e)))for(n=0;n<r.length;n++)t.removeClass([r[n]],e)},n.prototype.updateGridLineContainerHeight=function(){this.chartVerticalLineContainer&&(this.chartVerticalLineContainer.style.height=t.formatUnit(this.contentHeight))},n.prototype.reUpdateDimention=function(){var e=0;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(),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.element.getElementsByClassName("e-chart-rows-container")[0].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,o=t.createElement("div"),s=0;s<n;s++){a=0===s?-1:a+parseFloat(i),i=r[s].style.width;var l=t.createElement("div",{className:"e-line-container-cell",styles:"left:"+a+"px"});o.appendChild(l)}this.chartVerticalLineContainer.innerHTML=o.innerHTML},n.prototype.getDefaultLocale=function(){var e={emptyRecord:"No records to display",id:"ID",name:"Name",startDate:"Start Date",endDate:"End Date",duration:"Duration",progress:"Progress",dependency:"Dependency",notes:"Notes",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",taskBeforePredecessor_FS:'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',taskAfterPredecessor_FS:'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',taskBeforePredecessor_SS:'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',taskAfterPredecessor_SS:'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',taskBeforePredecessor_FF:'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',taskAfterPredecessor_FF:'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',taskBeforePredecessor_SF:'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',taskAfterPredecessor_SF:'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"};if(t.isBlazor()){t.extend(e,{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"},{},!0)}return e},n.prototype.removeSortColumn=function(e){this.sortModule.removeSortColumn(e)},n.prototype.actionBeginTask=function(e){this.trigger("actionBegin",e)},n.prototype.scrollToDate=function(e){var t=this.dateValidationModule.getDateFromFormat(e),i=this.dataOperation.getTaskLeft(t,!1);this.ganttChartModule.updateScrollLeft(i)},n.prototype.scrollToTask=function(e){if(-1!==this.ids.indexOf(e)){var t=this.flatData[this.ids.indexOf(e)].ganttProperties.left;this.ganttChartModule.updateScrollLeft(t)}},n.prototype.updateChartScrollOffset=function(e,i){t.isNullOrUndefined(e)||(e=this.ganttChartModule.scrollElement.scrollWidth<=e?this.ganttChartModule.scrollElement.scrollWidth:e,this.ganttChartModule.scrollObject.setScrollLeft(e)),t.isNullOrUndefined(i)||(i=this.ganttChartModule.scrollElement.scrollHeight<=i?this.ganttChartModule.scrollElement.scrollHeight:i,this.ganttChartModule.scrollObject.setScrollTop(i))},n.prototype.getParentTask=function(e){if(t.isNullOrUndefined(e))return null;var i=this.flatData.filter(function(t){return e.uniqueID===t.uniqueID});return i.length>0?i[0]:null},n.prototype.filterByColumn=function(e,t,i,r,n,a){this.treeGrid.filterByColumn(e,t,i,r,n,a)},n.prototype.excelExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.excelExport(e,t,i,r):null},n.prototype.csvExport=function(e,t,i,r){return this.excelExportModule?this.treeGrid.csvExport(e,t,i,r):null},n.prototype.pdfExport=function(e,t,i){return this.pdfExportModule?this.pdfExportModule.export(e,t,i):null},n.prototype.clearFiltering=function(e){this.treeGrid.grid.clearFiltering(e)},n.prototype.removeFilteredColsByField=function(e){this.treeGrid.removeFilteredColsByField(e,!1)},n.prototype.renderWorkingDayCell=function(e){var t="Auto"!==this.taskMode||!!this.includeWeekend?[]:this.nonWorkingDayIndex,i=this.totalHolidayDates;if(t.length>0&&-1!==t.indexOf(e.date.getDay()))e.isDisabled=!0;else if(i.length>0){var r=new Date(e.date.getTime());r.setHours(0,0,0),-1!==i.indexOf(r.getTime())&&(e.isDisabled=!0)}},n.prototype.previousTimeSpan=function(e){this.timelineModule.performTimeSpanAction("prevTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},n.prototype.nextTimeSpan=function(e){this.timelineModule.performTimeSpanAction("nextTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},n.prototype.updateProjectDates=function(e,i,r,n){t.isBlazor()&&(e=this.dataOperation.getDateFromFormat(e),i=this.dataOperation.getDateFromFormat(i)),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.reorderColumns=function(e,t){this.treeGrid.reorderColumns(e,t)},n.prototype.initiateEditAction=function(e){this.isOnEdit=e,this.previousRecords={},this.editedRecords=[]},n.prototype.setRecordValue=function(e,i,r,n){if(this.isOnEdit||this.isOnDelete){this.makeCloneData(e,r,n);var a=n?r.rowUniqueID:r.ganttProperties.rowUniqueID,o=this.getRecordByID(a);o&&-1===this.editedRecords.indexOf(o)&&this.editedRecords.push(o)}i=t.isUndefined(i)?null:i,t.setValue(e,i,r)},n.prototype.makeCloneData=function(e,i,r){var n,a,o,s=t.getValue(e,i);if(r&&(e="ganttProperties."+e),t.isNullOrUndefined(this.previousRecords[i.uniqueID])){this.previousRecords[i.uniqueID]={}}n=this.previousRecords[i.uniqueID],a=t.getValue(e,n),t.isUndefined(a)&&(o=s instanceof Date?new Date(s.getTime()):t.isObjectArray(s)?t.extend([],s,[],!0):t.isObject(s)?t.extend({},{},s,!0):s,t.isUndefined(o)?t.setValue(e,null,n):t.setValue(e,o,n))},n.prototype.closeGanttActions=function(){this.editModule&&(this.editModule.cellEditModule&&this.editModule.cellEditModule.isCellEdit?(this.treeGrid.closeEdit(),this.editModule.cellEditModule.isCellEdit=!1,t.isNullOrUndefined(this.toolbarModule)||this.toolbarModule.refreshToolbarItems()):this.editModule.dialogModule&&this.editModule.dialogModule.dialogObj&&this.editModule.dialogModule.dialogObj.visible&&(this.editModule.dialogModule.dialogObj.hide(),this.editModule.dialogModule.dialogClose()))},n.prototype.getTaskByUniqueID=function(e){var t=this.flatData.filter(function(t){return t.uniqueID===e});return t.length>0?t[0]:null},n.prototype.getRecordByID=function(e){return t.isNullOrUndefined(e)?null:this.flatData[this.ids.indexOf(e.toString())]},n.prototype.setSplitterPosition=function(e,t){var i={};i[t]=e;var r=this.splitterModule.calculateSplitterPosition(i,!0),n=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[0],a=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[1];this.splitterModule.splitterPreviousPositionGrid=n.scrollWidth+1+"px",this.splitterModule.splitterPreviousPositionChart=a.scrollWidth+1+"px",this.splitterModule.splitterObject.paneSettings[0].size=r,this.splitterModule.triggerCustomResizedEvent()},n.prototype.expandByIndex=function(e){if("number"==typeof e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)}else for(var i=0;i<e.length;i++)if("number"==typeof e[i]){var r=e[i];t=this.contructExpandCollapseArgs(null,r);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)}},n.prototype.expandByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)},n.prototype.collapseByIndex=function(e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},n.prototype.collapseByID=function(e){var t=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(t)},n.prototype.addRecord=function(e,i,r){if(this.editModule&&this.editSettings.allowAdding)if("ResourceView"===this.viewType){this.editModule.addRowPosition=i,this.editModule.addRowIndex=r;var n=e[this.taskFields.resourceInfo],a=void 0,o=void 0;if(!t.isNullOrUndefined(n)&&n.length){for(var s=0;s<n.length&&(a="object"==typeof n[s]?n[s][this.resourceFields.id]:n[0],!(o=this.flatData[this.getTaskIds().indexOf("R"+a)]));s++);if(o&&o.childRecords.length||0===o.level){var l=o.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.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.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=void 0,n=this.taskFields;r=this.currentViewData.length>0?t.isNullOrUndefined(this.currentViewData[e])?null:this.currentViewData[e]:null,t.isNullOrUndefined(r)||(i[n.id]=r[n.id],this.editModule.updateRecordByID(i))}},n.prototype.addPredecessor=function(e,i){var r=this.getRecordByID(e.toString());this.editModule&&!t.isNullOrUndefined(r)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.addPredecessor(r,i)},n.prototype.removePredecessor=function(e){var i=this.getRecordByID(e.toString());this.editModule&&!t.isNullOrUndefined(i)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.removePredecessor(i)},n.prototype.updatePredecessor=function(e,i){var r=this.getRecordByID(e.toString());this.editModule&&!t.isNullOrUndefined(r)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.updatePredecessor(r,i)},n.prototype.openAddDialog=function(){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowAdding&&this.editModule.dialogModule.openAddDialog()},n.prototype.openEditDialog=function(e){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowEditing&&this.editModule.dialogModule.openEditDialog(e)},n.prototype.contructExpandCollapseArgs=function(e,i){var r,n,a;t.isNullOrUndefined(i)?(n=this.getRecordByID(e.toString()),r=this.getRowByID(e),a=t.getValue("rowIndex",r)):t.isNullOrUndefined(i)||(r=this.getRowByIndex(i),a=t.getValue("rowIndex",r),n=this.currentViewData[a]);return{data:n,gridRow:this.treeGrid.getRows()[a],chartRow:r,cancel:!1}},n.prototype.getRowByIndex=function(e){try{var i=this.element.querySelectorAll(".e-chart-row");return t.isNullOrUndefined(e)?null:i[e]}catch(e){return null}},n.prototype.getRowByID=function(e){var t=this.getRecordByID(e.toString()),i=this.currentViewData.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)?" "+ie:t.isNullOrUndefined(e.startDate)||t.isNullOrUndefined(e.endDate)||t.isNullOrUndefined(e.duration)?" "+ie:""},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,o=t.top+i-n,s=t.left+r-a;return{top:Math.round(o),left:Math.round(s),width:t.width,height:t.height}},n.prototype.expandAll=function(){this.ganttChartModule.expandCollapseAll("expand")},n.prototype.updateDataSource=function(e,i){if(!t.isNullOrUndefined(i))for(var r=0,n=Object.keys(i);r<n.length;r++){var a=n[r];switch(a){case"projectStartDate":this.setProperties({projectStartDate:i[a]},!0);break;case"projectEndDate":this.setProperties({projectEndDate:i[a]},!0)}}this.dataSource=e},n.prototype.collapseAll=function(){this.ganttChartModule.expandCollapseAll("collapse")},n.prototype.getGridColumns=function(){return this.treeGrid.getColumns()},n.prototype.getColumnByField=function(e,t){var i=t.filter(function(t){return t.field===e});return i.length>0?i[0]:null},n.prototype.getGanttColumns=function(){return this.ganttColumns},n.prototype.showColumn=function(e,t){this.treeGrid.showColumns(e,t)},n.prototype.hideColumn=function(e,t){this.treeGrid.hideColumns(e,t)},n.prototype.setScrollTop=function(e){this.ganttChartModule.scrollObject.setScrollTop(e)},n.prototype.cancelEdit=function(){this.isCancelled=!0,this.closeGanttActions()},n.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},n.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},n.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},n.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},n.prototype.deleteRecord=function(e){this.editModule&&this.editModule.deleteRecord(e)},n.prototype.enableItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},n.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},n.prototype.updateDataArgs=function(e){if(!Array.isArray(e.data)){var i=[];i.push(e.data),t.setValue("data",i,e)}return e},n.prototype.convertToMilestone=function(e){var i=this.getRecordByID(e);if(!t.isNullOrUndefined(i)){var r=t.extend({},{},i.taskData,!0),n=this.taskFields;if(t.isNullOrUndefined(n.duration)?(r[n.startDate]=new Date(i.taskData[n.startDate]),r[n.endDate]=new Date(i.taskData[n.startDate])):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(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 t=this.taskFields,i=this.getRecordByID(e[t.id]),r=i.ganttProperties;this.isOnEdit=!0,this.setRecordValue("isAutoSchedule",!r.isAutoSchedule,r,!0),this.setRecordValue("taskData."+t.manual,!r.isAutoSchedule,i),this.setRecordValue(t.manual,!r.isAutoSchedule,i),this.editModule.updateTaskScheduleModes(i);var n={data:i};this.editModule.initiateUpdateAction(n)},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()},Ht([t.Property(!0)],n.prototype,"allowKeyboard",void 0),Ht([t.Property(!0)],n.prototype,"disableHtmlEncode",void 0),Ht([t.Property(!0)],n.prototype,"autoFocusTasks",void 0),Ht([t.Property(!0)],n.prototype,"allowSelection",void 0),Ht([t.Property(!1)],n.prototype,"allowSorting",void 0),Ht([t.Property(!0)],n.prototype,"enablePredecessorValidation",void 0),Ht([t.Property(!1)],n.prototype,"showColumnMenu",void 0),Ht([t.Property()],n.prototype,"columnMenuItems",void 0),Ht([t.Property()],n.prototype,"timezone",void 0),Ht([t.Property(!1)],n.prototype,"collapseAllParentTasks",void 0),Ht([t.Property(!1)],n.prototype,"highlightWeekends",void 0),Ht([t.Property(0)],n.prototype,"treeColumnIndex",void 0),Ht([t.Property([])],n.prototype,"dataSource",void 0),Ht([t.Property("day")],n.prototype,"durationUnit",void 0),Ht([t.Property(null)],n.prototype,"query",void 0),Ht([t.Property(null)],n.prototype,"dateFormat",void 0),Ht([t.Property("auto")],n.prototype,"height",void 0),Ht([t.Property(!1)],n.prototype,"renderBaseline",void 0),Ht([t.Property("Horizontal")],n.prototype,"gridLines",void 0),Ht([t.Complex({},pt)],n.prototype,"labelSettings",void 0),Ht([t.Property(null)],n.prototype,"taskbarTemplate",void 0),Ht([t.Property(null)],n.prototype,"parentTaskbarTemplate",void 0),Ht([t.Property(null)],n.prototype,"milestoneTemplate",void 0),Ht([t.Property()],n.prototype,"baselineColor",void 0),Ht([t.Property("auto")],n.prototype,"width",void 0),Ht([t.Property()],n.prototype,"toolbar",void 0),Ht([t.Property(["Monday","Tuesday","Wednesday","Thursday","Friday"])],n.prototype,"workWeek",void 0),Ht([t.Property(!1)],n.prototype,"includeWeekend",void 0),Ht([t.Property(!1)],n.prototype,"allowUnscheduledTasks",void 0),Ht([t.Property(!1)],n.prototype,"showInlineNotes",void 0),Ht([t.Property(36)],n.prototype,"rowHeight",void 0),Ht([t.Property(null)],n.prototype,"taskbarHeight",void 0),Ht([t.Property(null)],n.prototype,"projectStartDate",void 0),Ht([t.Property(null)],n.prototype,"projectEndDate",void 0),Ht([t.Property(null)],n.prototype,"resourceIDMapping",void 0),Ht([t.Property(null)],n.prototype,"resourceNameMapping",void 0),Ht([t.Property([])],n.prototype,"resources",void 0),Ht([t.Property(null)],n.prototype,"connectorLineBackground",void 0),Ht([t.Property(1)],n.prototype,"connectorLineWidth",void 0),Ht([t.Property([])],n.prototype,"columns",void 0),Ht([t.Property([])],n.prototype,"addDialogFields",void 0),Ht([t.Property([])],n.prototype,"editDialogFields",void 0),Ht([t.Property(-1)],n.prototype,"selectedRowIndex",void 0),Ht([t.Property("hour")],n.prototype,"workUnit",void 0),Ht([t.Property("FixedUnit")],n.prototype,"taskType",void 0),Ht([t.Property("ProjectView")],n.prototype,"viewType",void 0),Ht([t.Collection([{from:8,to:12},{from:13,to:17}],We)],n.prototype,"dayWorkingTime",void 0),Ht([t.Collection([],st)],n.prototype,"holidays",void 0),Ht([t.Collection([],Je)],n.prototype,"eventMarkers",void 0),Ht([t.Complex({},wt)],n.prototype,"taskFields",void 0),Ht([t.Complex({},Ft)],n.prototype,"resourceFields",void 0),Ht([t.Complex({},St)],n.prototype,"timelineSettings",void 0),Ht([t.Complex({},Ot)],n.prototype,"sortSettings",void 0),Ht([t.Complex({},Ze)],n.prototype,"editSettings",void 0),Ht([t.Complex({},Ct)],n.prototype,"tooltipSettings",void 0),Ht([t.Complex({},ut)],n.prototype,"selectionSettings",void 0),Ht([t.Property(!1)],n.prototype,"allowFiltering",void 0),Ht([t.Property(!1)],n.prototype,"allowExcelExport",void 0),Ht([t.Property(!1)],n.prototype,"allowRowDragAndDrop",void 0),Ht([t.Property(!1)],n.prototype,"allowReordering",void 0),Ht([t.Property(!1)],n.prototype,"readOnly",void 0),Ht([t.Property(!1)],n.prototype,"allowResizing",void 0),Ht([t.Property(!1)],n.prototype,"enableContextMenu",void 0),Ht([t.Property()],n.prototype,"contextMenuItems",void 0),Ht([t.Property(!1)],n.prototype,"allowPdfExport",void 0),Ht([t.Property(!1)],n.prototype,"validateManualTasksOnLinking",void 0),Ht([t.Property(!1)],n.prototype,"enableMultiTaskbar",void 0),Ht([t.Property(!1)],n.prototype,"showOverAllocation",void 0),Ht([t.Property("Auto")],n.prototype,"taskMode",void 0),Ht([t.Complex({},tt)],n.prototype,"filterSettings",void 0),Ht([t.Complex({},nt)],n.prototype,"searchSettings",void 0),Ht([t.Complex({},mt)],n.prototype,"splitterSettings",void 0),Ht([t.Event()],n.prototype,"queryTaskbarInfo",void 0),Ht([t.Event()],n.prototype,"beforeExcelExport",void 0),Ht([t.Event()],n.prototype,"excelExportComplete",void 0),Ht([t.Event()],n.prototype,"excelQueryCellInfo",void 0),Ht([t.Event()],n.prototype,"excelHeaderQueryCellInfo",void 0),Ht([t.Event()],n.prototype,"rowDrag",void 0),Ht([t.Event()],n.prototype,"rowDragStart",void 0),Ht([t.Event()],n.prototype,"rowDragStartHelper",void 0),Ht([t.Event()],n.prototype,"rowDrop",void 0),Ht([t.Event()],n.prototype,"collapsing",void 0),Ht([t.Event()],n.prototype,"collapsed",void 0),Ht([t.Event()],n.prototype,"expanding",void 0),Ht([t.Event()],n.prototype,"expanded",void 0),Ht([t.Event()],n.prototype,"actionBegin",void 0),Ht([t.Event()],n.prototype,"actionComplete",void 0),Ht([t.Event()],n.prototype,"actionFailure",void 0),Ht([t.Event()],n.prototype,"taskbarEdited",void 0),Ht([t.Event()],n.prototype,"endEdit",void 0),Ht([t.Event()],n.prototype,"cellEdit",void 0),Ht([t.Event()],n.prototype,"load",void 0),Ht([t.Event()],n.prototype,"created",void 0),Ht([t.Event()],n.prototype,"destroyed",void 0),Ht([t.Event()],n.prototype,"taskbarEditing",void 0),Ht([t.Event()],n.prototype,"dataBound",void 0),Ht([t.Event()],n.prototype,"resizeStart",void 0),Ht([t.Event()],n.prototype,"resizing",void 0),Ht([t.Event()],n.prototype,"resizeStop",void 0),Ht([t.Event()],n.prototype,"splitterResizeStart",void 0),Ht([t.Event()],n.prototype,"splitterResizing",void 0),Ht([t.Event()],n.prototype,"splitterResized",void 0),Ht([t.Event()],n.prototype,"columnDragStart",void 0),Ht([t.Event()],n.prototype,"columnDrag",void 0),Ht([t.Event()],n.prototype,"columnDrop",void 0),Ht([t.Event()],n.prototype,"beforeTooltipRender",void 0),Ht([t.Event()],n.prototype,"rowSelecting",void 0),Ht([t.Event()],n.prototype,"rowSelected",void 0),Ht([t.Event()],n.prototype,"rowDeselecting",void 0),Ht([t.Event()],n.prototype,"rowDeselected",void 0),Ht([t.Event()],n.prototype,"cellSelecting",void 0),Ht([t.Event()],n.prototype,"cellSelected",void 0),Ht([t.Event()],n.prototype,"cellDeselecting",void 0),Ht([t.Event()],n.prototype,"cellDeselected",void 0),Ht([t.Event()],n.prototype,"queryCellInfo",void 0),Ht([t.Event()],n.prototype,"headerCellInfo",void 0),Ht([t.Event()],n.prototype,"rowDataBound",void 0),Ht([t.Event()],n.prototype,"columnMenuOpen",void 0),Ht([t.Event()],n.prototype,"toolbarClick",void 0),Ht([t.Event()],n.prototype,"columnMenuClick",void 0),Ht([t.Event()],n.prototype,"contextMenuOpen",void 0),Ht([t.Event()],n.prototype,"contextMenuClick",void 0),Ht([t.Event()],n.prototype,"onTaskbarClick",void 0),Ht([t.Event()],n.prototype,"recordDoubleClick",void 0),Ht([t.Event()],n.prototype,"onMouseMove",void 0),Ht([t.Event()],n.prototype,"beforePdfExport",void 0),Ht([t.Event()],n.prototype,"pdfExportComplete",void 0),Ht([t.Event()],n.prototype,"pdfQueryCellInfo",void 0),Ht([t.Event()],n.prototype,"pdfQueryTaskbarInfo",void 0),Ht([t.Event()],n.prototype,"pdfQueryTimelineCellInfo",void 0),Ht([t.Event()],n.prototype,"pdfColumnHeaderQueryCellInfo",void 0),n=Ht([t.NotifyPropertyChanges],n)}(t.Component);!function(e){e[e.NextPage=0]="NextPage",e[e.LastPage=1]="LastPage"}(e.PdfHorizontalOverflowType||(e.PdfHorizontalOverflowType={}));var Gt=function(){function e(e){this.isCellEdit=!1,this.parent=e,this.bindTreeGridProperties()}return e.prototype.bindTreeGridProperties=function(){this.parent.treeGrid.editSettings.allowEditing=this.parent.editSettings.allowEditing,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 o=this.parent.taskFields;if(this.parent.readOnly)e.cancel=!0;else if("Dialog"!==this.parent.editSettings.mode){if(!r.hasChildRecords||a!==o.endDate&&a!==o.duration&&a!==o.dependency&&a!==o.progress&&a!==o.work&&"taskType"!==a){var s=new n.Deferred;return this.parent.trigger("cellEdit",e,function(e){t.isBlazor()&&(e.cell=t.getElement(e.cell),e.row=t.getElement(e.row)),0===r.level&&"ResourceView"===i.parent.viewType&&(e.cancel=!0),s.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()))}),s}e.cancel=!0}else e.cancel=!0},e.prototype.openNotesEditor=function(e){var t=this.parent.taskFields,i=e.rowData,r=e.columnName;if(r===t.notes&&!this.parent.showInlineNotes){e.cancel=!0;var n=this.parent.editModule.dialogModule.updatedEditFields.map(function(e){return e.type}).indexOf("Notes");if(-1!==n){this.parent.editModule.dialogModule.openEditDialog(i.ganttProperties.rowUniqueID);document.getElementById(this.parent.element.id+"_Tab").ej2_instances[0].selectedItem=n}}r===t.notes&&!0===this.parent.showInlineNotes&&(this.isCellEdit=!0)},e.prototype.isValueChange=function(e,i){var r=t.getValue("data",e),n=r[i],a=t.getValue("previousData",e);if(t.isNullOrUndefined(n)&&!t.isNullOrUndefined(a)||!t.isNullOrUndefined(n)&&t.isNullOrUndefined(a))return!0;if(!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(a)){if(n instanceof Date)return n.getTime()!==r.taskData[i].getTime();if(i===this.parent.taskFields.resourceInfo)return n!==a;if(n!==r.taskData[i])return!0}return!1},e.prototype.initiateCellEdit=function(e,i){var r=t.getValue("column",e),n=t.getValue("data",e),a={};a.action="CellEditing",a.data=this.parent.getTaskByUniqueID(n.uniqueID);var o=t.getValue("previousData",e),s=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]:o;t.isNullOrUndefined(n)?this.parent.editModule.endEditAction(e):(n[r.field]=o,a.data[r.field]=o,this.parent.initiateEditAction(!0),this.parent.setRecordValue(r.field,s,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,o):r.field===this.parent.taskFields.notes?this.notedEdited(a):r.field===this.parent.taskFields.work?this.workEdited(a):"taskType"!==r.field||t.isNullOrUndefined(this.parent.taskFields.work)?r.field===this.parent.taskFields.manual?this.taskmodeEdited(a):(this.parent.setRecordValue("taskData."+r.field,a.data[r.field],a.data),this.parent.editModule.initiateSaveAction(a)):this.typeEdited(a,i)),this.isCellEdit=!1,t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.prototype.taskNameEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.name,e.data[this.parent.taskFields.name],e.data),this.parent.setRecordValue("taskName",e.data[this.parent.taskFields.name],e.data.ganttProperties,!0),this.updateEditedRecord(e)},e.prototype.notedEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.notes,e.data[this.parent.taskFields.name],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),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.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),-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)),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),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)),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 t=e.data;if(this.parent.setRecordValue("progress",t[this.parent.taskFields.progress]>100?100:t[this.parent.taskFields.progress],t.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.progress,t[this.parent.taskFields.progress]>100?100:t[this.parent.taskFields.progress],e.data),!e.data.hasChildRecords){var i=t.ganttProperties.isAutoSchedule?t.ganttProperties.width:t.ganttProperties.autoWidth;this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(i,t.ganttProperties.progress),t.ganttProperties,!0)}this.updateEditedRecord(e)},e.prototype.baselineEdited=function(e){var t=e.data.ganttProperties,i=e.data[this.parent.taskFields.baselineStartDate],r=e.data[this.parent.taskFields.baselineEndDate];r&&0===r.getHours()&&86400!==this.parent.defaultEndTime&&this.parent.dateValidationModule.setTime(this.parent.defaultEndTime,r),this.parent.setRecordValue("baselineStartDate",this.parent.dateValidationModule.checkBaselineStartDate(i),t,!0),this.parent.setRecordValue("baselineEndDate",this.parent.dateValidationModule.checkBaselineEndDate(r),t,!0),t.baselineStartDate&&t.baselineEndDate&&(this.parent.setRecordValue("baselineLeft",this.parent.dataOperation.calculateBaselineLeft(t),t,!0),this.parent.setRecordValue("baselineWidth",this.parent.dataOperation.calculateBaselineWidth(t),t,!0)),this.updateEditedRecord(e)},e.prototype.resourceEdited=function(e,i,r){var n=this.parent.resourceFields,a=i[this.parent.taskFields.resourceInfo];if(a){for(var o=this.parent.dataOperation.setResourceInfo(i).length,s=r.ganttProperties.resourceInfo,l=void 0,d=[],p=this.parent.resources,h=void 0,c=function(e){if(s){var i=s.length;for(h=0;h<i;h++){if(s[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]}),o=t.extend({},r[0]);o[n.unit]=100,d.push(o)}else d.push(s[l])},u=0;u<o;u++)c(u);e.data.ganttProperties.resourceInfo=d,this.parent.dataOperation.updateMappingData(e.data,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(e.data,"resource"),"ResourceView"===this.parent.viewType&&(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=s),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}(),qt=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,content:this.getTooltipText(),position:"TopRight",mouseTrail:t,cssClass:Pe,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.prototype.showHideTaskbarEditTooltip=function(e){e&&this.parent.tooltipSettings.showTooltip?(this.createTooltip("Custom",!1),this.parent.tooltipModule.toolTipObj.close(),this.updateTooltip(),"ConnectorPointLeftDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+we)):"ConnectorPointRightDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+De)):this.toolTipObj.open(this.taskbarEdit.taskBarEditElement)):t.isNullOrUndefined(this.toolTipObj)||(this.toolTipObj.destroy(),this.toolTipObj=null)},e.prototype.updateTooltip=function(){t.isNullOrUndefined(this.toolTipObj)||("ConnectorPointLeftDrag"===this.taskbarEdit.taskBarEditAction||"ConnectorPointRightDrag"===this.taskbarEdit.taskBarEditAction?(this.toolTipObj.content=this.getTooltipText(),this.toolTipObj.offsetY=-3):(this.toolTipObj.content=this.getTooltipText(),this.toolTipObj.refresh(this.taskbarEdit.taskBarEditElement),"LeftResizing"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-this.taskbarEdit.taskBarEditRecord.ganttProperties.width:"RightResizing"===this.taskbarEdit.taskBarEditAction||"ParentResizing"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=0:"ProgressResizing"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-(this.taskbarEdit.taskBarEditRecord.ganttProperties.width-this.taskbarEdit.taskBarEditRecord.ganttProperties.progressWidth):"MilestoneDrag"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-this.parent.chartRowsModule.milestoneHeight/2:this.taskbarEdit.taskBarEditRecord.ganttProperties.width>5&&(this.toolTipObj.offsetX=-(this.taskbarEdit.taskBarEditRecord.ganttProperties.width+this.taskbarEdit.taskBarEditRecord.ganttProperties.left-this.taskbarEdit.tooltipPositionX))))},e.prototype.getTooltipText=function(){var e="",i=this.parent.globalize,r=this.taskbarEdit.taskBarEditRecord.ganttProperties;if(this.parent.tooltipSettings.editing){e=this.parent.tooltipModule.templateCompiler(this.parent.tooltipSettings.editing,this.parent,r,"TooltipEditingTemplate")[0]}else switch(this.taskbarEdit.taskBarEditAction){case"ProgressResizing":e=this.parent.localeObj.getConstant("progress")+" : "+r.progress;break;case"LeftResizing":e=this.parent.localeObj.getConstant("startDate")+" : ",e+=i.formatDate(r.startDate,{format:this.parent.getDateFormat()}),e+="<br/>"+this.parent.localeObj.getConstant("duration")+" : "+this.parent.getDurationString(r.duration,r.durationUnit);break;case"RightResizing":case"ParentResizing":e=this.parent.localeObj.getConstant("endDate")+" : ",e+=i.formatDate(r.endDate,{format:this.parent.getDateFormat()}),e+="<br/>"+this.parent.localeObj.getConstant("duration")+" : "+this.parent.getDurationString(r.duration,r.durationUnit);break;case"ChildDrag":case"ParentDrag":case"MilestoneDrag":case"ManualParentDrag":t.isNullOrUndefined(this.taskbarEdit.taskBarEditRecord.ganttProperties.startDate)||(e=this.parent.localeObj.getConstant("startDate")+" : ",e+=i.formatDate(r.startDate,{format:this.parent.getDateFormat()})),t.isNullOrUndefined(this.taskbarEdit.taskBarEditRecord.ganttProperties.endDate)||(e+=""===e?"":"<br/>",e+=this.parent.localeObj.getConstant("endDate")+" : "+i.formatDate(r.endDate,{format:this.parent.getDateFormat()}));break;case"ConnectorPointLeftDrag":case"ConnectorPointRightDrag":e=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 e},e}(),zt=function(){function e(e){this.isMouseDragged=!1,this.dependencyCancel=!1,this.editElement=null,this.parent=e,this.initPublicProp(),this.wireEvents(),this.editTooltip=new qt(this.parent,this)}return e.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)},e.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"],this.tapPointOnFocus=!1,this.touchEdit=!1},e.prototype.mouseDownHandler=function(e){if(this.parent.editSettings.allowTaskbarEditing)if(this.canDrag=!1,this.parent.isAdaptive&&this.taskBarEditElement){var t=this.getElementByPosition(e),i=g(t,I);!i||i.innerHTML!==this.taskBarEditElement.innerHTML||t.classList.contains(we)||t.classList.contains(De)||this.tapPointOnFocus||(this.updateTaskBarEditElement(e),this.canDrag=!0,e.preventDefault())}else this.parent.isAdaptive||this.updateTaskBarEditElement(e)},e.prototype.mouseClickHandler=function(e){var t=this.getElementByPosition(e),i=g(t,I);this.parent.selectionModule&&this.parent.selectionModule.enableSelectMultiTouch?this.tapPointOnFocus&&this.updateTaskBarEditElement(e):this.tapPointOnFocus&&i&&i.innerHTML!==this.taskBarEditElement.innerHTML?(this.connectorSecondRecord=this.parent.ganttChartModule.getRecordByTaskBar(i),this.connectorSecondAction="ConnectorPointLeftDrag",this.connectorSecondElement=i,this.fromPredecessorText="Finish",this.validateConnectorPoint()&&this.taskBarEditingAction(e,!0),this.showHideActivePredecessors(!1),this.initPublicProp()):t.classList.contains(ke)||t.classList.contains(Te)?(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))},e.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 o=r[a];n.toString()===o.from?this.applyActiveColor(o.from,o.to,e):n.toString()===o.to&&this.applyActiveColor(o.from,o.to,e)}var s=this.parent.ganttChartModule.chartBodyContainer;e?(t.addClass([this.taskBarEditElement],[Me]),t.addClass([s],[Oe])):(t.removeClass([this.taskBarEditElement],[Me]),t.removeClass([s],[Oe])),this.touchEdit=e,t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},e.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 o=a.querySelector("."+I),s=this.parent.element.querySelector("#ConnectorLineparent"+e+"child"+i);r?(t.addClass([o],[xe]),s&&t.addClass([s],[xe])):(t.removeClass([o],[xe]),s&&t.removeClass([s],[xe]))}},e.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 o=t.predecessor[a];if(o.from===r.toString()&&o.to===n.toString()){this.parent.connectorLineEditModule.childRecord=this.connectorSecondRecord,this.parent.connectorLineEditModule.predecessorIndex=a,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}if(o.from===n.toString()&&o.to===r.toString()){this.parent.connectorLineEditModule.childRecord=this.taskBarEditRecord,this.parent.connectorLineEditModule.predecessorIndex=a,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}}return i},e.prototype.mouseLeaveHandler=function(e){this.dragMouseLeave=!0},e.prototype.updateTaskBarEditElement=function(e){var i,r=this.getElementByPosition(e);if(i=r.classList.contains($)||r.classList.contains(Y)||r.classList.contains(X)?g(r,Y):r.classList.contains(K)||r.classList.contains(Q)||r.classList.contains(Z)?g(r,Z):g(r,I),this.parent.editSettings.allowTaskbarEditing&&i){if(this.showHideTaskBarEditingElements(i,this.taskBarEditElement),this.editElement=i,this.taskBarEditElement=i,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 n=this.parent.getTaskByUniqueID(this.taskBarEditRecord.parentItem.uniqueID);t.isNullOrUndefined(n)||n.expanded||(this.prevZIndex=this.taskBarEditElement.style.zIndex,this.taskBarEditElement.style.zIndex="1000",t.addClass([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"))}}}else this.parent.isAdaptive?(this.taskBarEditElement&&this.showHideTaskBarEditingElements(i,this.taskBarEditElement),this.initPublicProp()):this.showHideTaskBarEditingElements(i,this.taskBarEditElement)},e.prototype.showHideTaskBarEditingElements=function(e,i,r){i=i||this.editElement;var n=!0;if(!this.parent.readOnly){if("ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar&&e){var a=this.parent.ganttChartModule.getRecordByTaskBar(e),o=this.parent.getParentTask(a.parentItem);t.isNullOrUndefined(o)||o.expanded||(n=!1)}if(e){if(e.querySelector("."+j))t.addClass([e.querySelector("."+j)],[re]),t.addClass([e.querySelector("."+G)],[ne]),n&&t.addClass([e.querySelector("."+q)],[ae]);else if(this.parent.isAdaptive&&n){(a=this.parent.ganttChartModule.getRecordByTaskBar(e)).hasChildRecords&&t.addClass([e],[Re])}n&&t.addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+pe),[ge]),!t.isNullOrUndefined(this.parent.taskFields.dependency)&&e.querySelector("."+we)&&n&&(t.addClass([e.querySelector("."+we)],[ke]),t.addClass([e.querySelector("."+De)],[Te]))}else r||t.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+pe),[ge]);if(i&&e!==i){if(i.querySelector("."+j)&&(t.removeClass([i.querySelector("."+j)],[re]),t.removeClass([i.querySelector("."+G)],[ne]),i.querySelector("."+q)&&t.removeClass([i.querySelector("."+q)],[ae])),!t.isNullOrUndefined(this.parent.taskFields.dependency)&&i.querySelector("."+we))t.removeClass([i.querySelector("."+we)],[ke]),t.removeClass([i.querySelector("."+De)],[Te]);else if(this.parent.isAdaptive){(a=this.parent.ganttChartModule.getRecordByTaskBar(i))&&a.hasChildRecords&&t.removeClass([i],[Re])}this.editElement=null}}},e.prototype.getTaskBarAction=function(e){var i=this.getElementByPosition(e),r=this.taskBarEditRecord,n="";return i.classList.contains(j)?n="LeftResizing":i.classList.contains(G)?n="RightResizing":i.classList.contains(q)||t.closest(i,"."+q)?n="ProgressResizing":i.classList.contains(we)?n="ConnectorPointLeftDrag":i.classList.contains(De)?n="ConnectorPointRightDrag":i.classList.contains($)?n="ParentResizing":i.classList.contains(X)||i.classList.contains(Y)||i.classList.contains(Z)||i.classList.contains(K)||i.classList.contains(Q)||i.classList.contains(Z)?n="ManualParentDrag":r&&(n=r.hasChildRecords?"Auto"===this.parent.taskMode?"ParentDrag":"":r.ganttProperties.isMilestone?"MilestoneDrag":"ChildDrag"),n},e.prototype.updateMouseDownProperties=function(e){var t=this.getCoordinate(e);if(t.pageX||t.pageY){var i=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);this.mouseDownX=t.pageX-i.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseDownX,this.mouseDownY=t.pageY-i.top+this.parent.ganttChartModule.scrollObject.previousScroll.top}"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.fromPredecessorText="ConnectorPointLeftDrag"===this.taskBarEditAction?"start":"finish",this.parent.connectorLineModule.tooltipTable.innerHTML=this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName,this.fromPredecessorText,"",""))},e.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.taskBarEditElement.setAttribute("aria-grabbed","true")}},e.prototype.mouseMoveAction=function(e){if(this.parent.isAdaptive){if(!this.canDrag)return;this.multipleSelectionEnabled()}var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),i=this.getCoordinate(e);this.mouseMoveX=i.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.mouseMoveY=i.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.dragMouseLeave=!1,this.isMouseDragCheck(),this.isMouseDragged&&this.taskBarEditAction?this.taskBarEditingAction(e,!1):this.parent.isAdaptive||this.taskBarEditAction||this.updateTaskBarEditElement(e)},e.prototype.taskBarEditingAction=function(e,i){var r=this,n={},a=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement);if(null!==this.taskBarEditRecord){if(n.editingFields=this.taskBarEditRecord.ganttProperties,n.data=this.taskBarEditRecord,"ResourceView"===this.parent.viewType&&0===n.data.level)return;n.recordIndex=a,n.taskBarEditAction=this.taskBarEditAction,n.roundOffDuration=this.roundOffDuration,n.cancel=!1,n.previousData=this.previousItem,this.roundOffDuration=n.roundOffDuration,this.updateMouseMoveProperties(e),"ProgressResizing"===this.taskBarEditAction?this.performProgressResize(e):"LeftResizing"===this.taskBarEditAction?this.enableLeftResizing(e):"RightResizing"===this.taskBarEditAction||"ParentResizing"===this.taskBarEditAction?this.enableRightResizing(e):"ParentDrag"===this.taskBarEditAction||"ChildDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction||"ManualParentDrag"===this.taskBarEditAction?this.enableDragging(e):"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.updateConnectorLineSecondProperties(e),this.triggerDependencyEvent(e),this.parent.isAdaptive||this.drawFalseLine()),this.setItemPosition(),this.updateEditedItem(),this.editTooltip.updateTooltip(),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))})}},e.prototype.updateMouseMoveProperties=function(e){var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),i=this.getCoordinate(e);(i.pageX||i.pageY)&&(this.mouseMoveX=i.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseMoveX,this.mouseMoveY=i.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top);var r="ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction;if(this.taskBarEditRecord.ganttProperties.width>3&&("ProgressResizing"!==this.taskBarEditAction||0!==this.taskBarEditRecord.ganttProperties.progress&&100!==this.taskBarEditRecord.ganttProperties.progress)||r){var n=this.mouseMoveX-this.parent.ganttChartModule.scrollObject.previousScroll.left+t.left,a=this.mouseMoveY-this.parent.ganttChartModule.scrollObject.previousScroll.top+t.top;n+20>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):n-20<t.left?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("left")):r&&a+20>t.top+this.parent.ganttChartModule.chartBodyContainer.offsetHeight?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("bottom")):r&&a-20<t.top?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("top")):this.stopScrollTimer()}else this.stopScrollTimer()},e.prototype.startScrollTimer=function(e){var t=this;this.stopScrollTimer(),this.scrollTimer=window.setInterval(function(){t.timerCount="right"===e||"bottom"===e?t.timerCount+1>=t.parent.timelineModule.totalTimelineWidth?t.parent.timelineModule.totalTimelineWidth:t.timerCount+1:t.timerCount-1<0?0:t.timerCount-1,"bottom"===e||"top"===e?t.parent.ganttChartModule.scrollObject.setScrollTop(t.timerCount):t.parent.ganttChartModule.scrollObject.setScrollLeft(t.timerCount),"ConnectorPointLeftDrag"!==t.taskBarEditAction&&"ConnectorPointRightDrag"!==t.taskBarEditAction||t.drawFalseLine()},0)},e.prototype.stopScrollTimer=function(){window.clearInterval(this.scrollTimer),this.scrollTimer=null},e.prototype.enableDragging=function(e){var t=this.taskBarEditRecord.ganttProperties,i=0;this.mouseDownX>this.mouseMoveX?(i=this.mouseDownX-this.mouseMoveX)>0&&this.parent.setRecordValue("left",this.previousItem.left-i,t,!0):(i=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+i,t,!0));var r=t.left<0?0:t.left+t.width>=this.parent.timelineModule.totalTimelineWidth?this.parent.timelineModule.totalTimelineWidth-t.width:t.left;this.parent.setRecordValue("left",r,t,!0)},e.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},e.prototype.enableLeftResizing=function(e){var t=this.taskBarEditRecord.ganttProperties,i=0;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)},e.prototype.updateEditPosition=function(e,t){this.updateIsMilestone(t),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.width,t.progress),t,!0)},e.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))},e.prototype.enableRightResizing=function(e){var t=this.taskBarEditRecord.ganttProperties,i=0;this.mouseDownX>this.mouseMoveX?this.mouseMoveX>t.left&&this.mouseDownX-this.mouseMoveX>3?(i=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("width",this.previousItem.width-i,t,!0)):this.mouseMoveX<t.left&&this.parent.setRecordValue("width",3,t,!0):this.mouseMoveX>t.left&&(i=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("width",this.previousItem.width+i,t,!0)),this.updateEditPosition(e,t)},e.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":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");break;case"RightResizing":case"ParentResizing":e=this.getRoundOffEndLeft(a,this.roundOffDuration);var o=this.getDateByLeft(e);t.isNullOrUndefined(a.startDate)&&(n=this.parent.dateValidationModule.getValidStartDate(a),this.parent.setRecordValue("startDate",n,a,!0));var s=t.isNullOrUndefined(a.startDate)?n:a.startDate;r=a.isMilestone?s:this.parent.dateValidationModule.checkEndDate(o,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");break;case"ParentDrag":case"ChildDrag":case"MilestoneDrag":case"ManualParentDrag":e=this.getRoundOffStartLeft(a,this.roundOffDuration),i=this.getDateByLeft(e),!t.isNullOrUndefined(a.endDate)&&t.isNullOrUndefined(a.startDate)?(r=this.parent.dateValidationModule.checkStartDate(i,a,null),r=this.parent.dateValidationModule.checkEndDate(r,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",r,a,!0)):(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(i,a,null),a,!0),t.isNullOrUndefined(a.duration)||this.parent.dateValidationModule.calculateEndDate(this.taskBarEditRecord))}},e.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,n=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Day")/864e5),a=this.parent.perDayWidth-this.parent.perDayWidth/n,o=a/this.parent.perDayWidth;if(void 0===t&&(t=!1),t){if(t)if("Hour"===i){var s=this.parent.perDayWidth/24;n=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Hour")/36e5),0!==(a=this.parent.perDayWidth/24-this.parent.perDayWidth/24/n)&&(r=r-a+s)}else if("Minutes"===i){var l=this.parent.perDayWidth/1440;n=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(r),1,"Minutes")/6e4),0!==(a=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/n)&&(r=r-a+l)}else 0!==a&&(r=r-a+this.parent.perDayWidth)}else"Hour"!==i&&"Minutes"!==i&&(0===o?r=r:o>.5?r=r-a+this.parent.perDayWidth:o<.5&&(r=r-a+this.parent.perDayWidth/2));return r},e.prototype.getRoundOffStartLeft=function(e,t){var i=e.left,r="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,n=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(i),1,"Day")/864e5),a=this.parent.perDayWidth-this.parent.perDayWidth/n,o=a/this.parent.perDayWidth;return void 0===t&&(t=!1),t?t&&("Hour"===r?(n=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(i),1,"Hour")/36e5),i-=a=this.parent.perDayWidth/24-this.parent.perDayWidth/24/n):"Minutes"===r?(n=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(i),1,"Minutes")/6e4),i-=a=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/n):i-=a):"Hour"!==r&&"Minutes"!==r&&(o<=.5?i-=a:o>.5&&(i=i-a+this.parent.perDayWidth/2)),i},e.prototype.getDateByLeft=function(e){var t=new Date(this.parent.timelineModule.timelineStartDate.toString()),i=864e5/this.parent.perDayWidth;t.setTime(t.getTime()+e*i);var r="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier;return"Hour"!==r&&"Minutes"!==r&&(this.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&!this.isInDst(t)?t.setTime(t.getTime()+36e5):!this.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&this.isInDst(t)&&t.setTime(t.getTime()-36e5)),t},e.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())},e.prototype.isInDst=function(e){return e.getTimezoneOffset()<this.getDefaultTZOffset()},e.prototype.setItemPosition=function(){var e=this.taskBarEditRecord.ganttProperties,i="MilestoneDrag"===this.taskBarEditAction||e.isMilestone?this.parent.chartRowsModule.milestoneHeight:e.width,r=this.parent.isAdaptive?i-2:i-10,n=this.taskBarEditElement.classList.contains(I)?this.taskBarEditElement:t.closest(this.taskBarEditElement,"tr."+H).querySelector("."+I),a=t.closest(this.taskBarEditElement,"tr."+H).querySelector("."+x),o=t.closest(this.taskBarEditElement,"tr."+H).querySelector("."+O),s=this.taskBarEditElement.querySelector("."+_),l=this.taskBarEditElement.querySelector("."+z),d=this.taskBarEditElement.querySelector("."+q),p=this.taskBarEditElement.querySelector("."+G),h=this.taskBarEditElement.querySelector("."+ee),c=this.taskBarEditElement.querySelector("."+te),u=this.taskBarEditElement.querySelector("."+Se),g=this.taskBarEditElement,f=this.taskBarEditElement.querySelector("."+X),m=this.taskBarEditElement.querySelector("."+$),y=this.taskBarEditElement.querySelector(".e-gantt-manualparenttaskbar-left");"ConnectorPointRightDrag"!==this.taskBarEditAction&&"ConnectorPointLeftDrag"!==this.taskBarEditAction&&("ParentResizing"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction&&(n.style.width=i+"px",n.style.left=e.left+"px",a.style.width=e.left+"px",t.isNullOrUndefined(o)||(o.style.left=e.left+i+"px")),u&&(u.style.left=(this.parent.isAdaptive?i+10:i+2)+"px"),"MilestoneDrag"===this.taskBarEditAction||e.isMilestone?(n.style.left=e.left-i/2+"px",a.style.width=e.left-i/2+"px",t.isNullOrUndefined(o)||(o.style.left=e.left+i/2+"px")):"ProgressResizing"===this.taskBarEditAction?(l.style.left=e.left+e.progressWidth-10+"px",t.isNullOrUndefined(s)||(s.style.width=e.progressWidth+"px",s.style.borderBottomRightRadius=this.progressBorderRadius+"px",s.style.borderTopRightRadius=this.progressBorderRadius+"px",d.style.left=e.progressWidth-8+"px")):"RightResizing"===this.taskBarEditAction?(l.style.width=i+"px",t.isNullOrUndefined(s)||(s.style.width=e.progressWidth+"px",p.style.left=r+"px",d.style.left=e.progressWidth-10+"px")):"ParentDrag"===this.taskBarEditAction?(t.isNullOrUndefined(h)||(h.style.width=i+"px"),t.isNullOrUndefined(s)||(c.style.width=e.progressWidth+"px")):"ParentResizing"===this.taskBarEditAction?(g.style.width=f.style.width=e.width+"px",m.style.left=e.width-y.offsetLeft+"px"):"ManualParentDrag"===this.taskBarEditAction?g.style.left=e.left-e.autoLeft+"px":(t.isNullOrUndefined(l)||(l.style.width=i+"px"),t.isNullOrUndefined(s)||(p.style.left=r+"px",s.style.width=e.progressWidth+"px",d.style.left=e.progressWidth-10+"px")))},e.prototype.mouseUpHandler=function(e){var i=this.isMouseDragged;this.editTooltip.showHideTaskbarEditTooltip(!1),this.taskBarEditAction&&this.isMouseDragged&&(!this.dragMouseLeave&&this.taskBarEditedAction?(this.taskBarEditedAction(e),this.isMouseDragged=!1):this.cancelTaskbarEditActionInMouseLeave()),"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()},e.prototype.taskBarEditedAction=function(e){var t,i,r={},n=this.mouseDownX,a=this.mouseDownY,o=this.taskBarEditRecord,s=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement),l=this.getCoordinate(e);t=this.mouseMoveX,this.mouseMoveY,i=l.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?(n!==t||Math.abs(a-i)>=(this.parent.rowHeight-this.parent.taskbarHeight)/2)&&null!==o&&(r.editingFields=o.ganttProperties,r.data=o,r.recordIndex=s,r.previousData=this.previousItem,r.taskBarEditAction=this.taskBarEditAction,r.action="TaskbarEditing",r.roundOffDuration=this.roundOffDuration,this.taskbarEditedArgs=r,this.taskbarEdited(r)):this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord,this.finalPredecessor)},e.prototype.cancelTaskbarEditActionInMouseLeave=function(){this.parent.editModule.reUpdatePreviousRecords(!0)},e.prototype.taskbarEdited=function(e){var i=t.extend({},e),r=i.data,n=r.ganttProperties;"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)):this.parent.dataOperation.updateWidthLeft(i.data),this.parent.dataOperation.updateTaskData(r),this.parent.editModule.initiateUpdateAction(i)},e.prototype.getProgressPercent=function(e,t){return Math.ceil(t/e*100)},e.prototype.drawFalseLine=function(){var e,i,r=this.mouseDownX,n=this.mouseDownY,a=this.mouseMoveX,o=this.mouseMoveY,s=Math.sqrt((r-a)*(r-a)+(n-o)*(n-o)),l="rotate("+180*Math.atan2(o-n,a-r)/Math.PI+"deg)";"ConnectorPointLeftDrag"===this.taskBarEditAction&&(e=this.taskBarEditElement.offsetLeft-this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),"ConnectorPointRightDrag"===this.taskBarEditAction&&(e=this.taskBarEditElement.offsetLeft+this.taskBarEditElement.offsetWidth+this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),i=this.taskBarEditElement.offsetTop+this.taskBarEditElement.offsetHeight/2+this.parent.ganttChartModule.chartBodyContainer.offsetTop-this.parent.ganttChartModule.scrollObject.previousScroll.top,this.removeFalseLine(!1),this.falseLine=t.createElement("div",{className:"e-gantt-false-line",id:"ganttfalseline"+this.parent.element.id,styles:"transform-origin: 0% 100%;right: auto;position: absolute;transform:"+l+";border-top-width: 1px;border-top-style: dashed;z-index: 5;width:"+(s-3)+"px;left:"+e+"px;top:"+i+"px;"}),this.parent.ganttChartModule.chartBodyContainer.appendChild(this.falseLine)},e.prototype.removeFalseLine=function(e){this.falseLine&&(t.remove(this.falseLine),this.falseLine=null,e&&t.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+pe),[ge]))},e.prototype.updateConnectorLineSecondProperties=function(e){var i=this.getElementByPosition(e),r=g(i,I);this.connectorSecondAction=null,g(i,we)?(this.connectorSecondAction="ConnectorPointLeftDrag",this.toPredecessorText="Start"):g(i,De)?(this.connectorSecondAction="ConnectorPointRightDrag",this.toPredecessorText="Finish"):(this.connectorSecondAction=null,this.toPredecessorText=null),this.taskBarEditElement!==r&&this.taskBarEditElement!==this.highlightedSecondElement&&this.showHideTaskBarEditingElements(r,this.highlightedSecondElement,!0),t.isNullOrUndefined(this.connectorSecondAction)&&!t.isNullOrUndefined(this.connectorSecondElement)&&(this.editTooltip.showHideTaskbarEditTooltip(!1),t.removeClass([this.connectorSecondElement.querySelector("."+we)],[be]),t.removeClass([this.connectorSecondElement.querySelector("."+De)],[be])),this.connectorSecondElement=this.connectorSecondAction?r:null,this.highlightedSecondElement=r,this.connectorSecondRecord=t.isNullOrUndefined(this.connectorSecondElement)?null:this.parent.ganttChartModule.getRecordByTaskBar(this.connectorSecondElement)},e.prototype.triggerDependencyEvent=function(e,i){var r,n,a=this.taskBarEditRecord.ganttProperties,o=this.connectorSecondRecord?this.connectorSecondRecord.ganttProperties:null,s=this.getElementByPosition(e),l=s,d="ResourceView"===this.parent.viewType?a.taskId:a.rowUniqueID;if("ConnectorPointLeftDrag"===this.taskBarEditAction?r=d+"S":"ConnectorPointRightDrag"===this.taskBarEditAction&&(r=d+"F"),this.connectorSecondAction&&("ConnectorPointLeftDrag"===this.connectorSecondAction?(r+="S",n="Start"):"ConnectorPointRightDrag"===this.connectorSecondAction&&(r+="F",n="Finish")),t.isNullOrUndefined(o))this.drawPredecessor=!1;else{o.predecessorsName?this.finalPredecessor=o.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=o,c.newPredecessorString=this.finalPredecessor,c.predecessor=h&&h[0],c.isValidLink=p,c.requestType="ValidateDependency",this.parent.trigger("actionBegin",c),c.isValidLink=!(!p&&c.isValidLink)&&c.isValidLink,c.isValidLink){if(this.editTooltip.toolTipObj||this.parent.isAdaptive||this.editTooltip.showHideTaskbarEditTooltip(!0),this.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=o.taskName,u[2].innerText=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?(s.classList.contains(we)||s.classList.contains(De))&&this.showHideActivePredecessors(!0):t.addClass([l],[be]),this.drawPredecessor=!1}},e.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},e.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},e.prototype.multipleSelectionEnabled=function(){this.parent.selectionModule&&"Cell"!==this.parent.selectionSettings.mode&&"Multiple"===this.parent.selectionSettings.type&&this.parent.selectionModule.hidePopUp()},e.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))},e.prototype.destroy=function(){this.unWireEvents(),this.stopScrollTimer(),this.parent.editModule.taskbarEditModule=void 0},e}(),_t=function(){function e(e){this.updatedEditFields=null,this.updatedAddFields=null,this.addedRecord=null,this.dialogEditValidationFlag=!1,this.ganttResources=[],this.previousResource=[],this.isResourceUpdate=!1,this.parent=e,this.localeObj=this.parent.localeObj,this.beforeOpenArgs={cancel:!1},this.types=this.getPredecessorType(),this.rowData={},this.editedRecord={},this.inputs={booleanedit:p.CheckBox,dropdownedit:c.DropDownList,datepickeredit:h.DatePicker,datetimepickeredit:h.DateTimePicker,maskededit:d.MaskedTextBox,numericedit:d.NumericTextBox,stringedit:d.TextBox},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.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 o=r.getActualProperties(e[a]);"General"!==o.type||!t.isNullOrUndefined(o.fields)&&0!==o.fields.length||(o.fields=this.getGeneralColumnFields()),"Dependency"===o.type&&t.isNullOrUndefined(this.parent.taskFields.dependency)||"Resources"===o.type&&t.isNullOrUndefined(this.parent.taskFields.resourceInfo)||"Notes"===o.type&&t.isNullOrUndefined(this.parent.taskFields.notes)||("Custom"!==o.type||!t.isNullOrUndefined(o.fields)&&0!==o.fields.length||(n+=1,o.fields=this.getCustomColumnFields()),n>1||i.push(o))}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.columnMapping;return 0!==Object.keys(r).length&&(i.type="General",this.getGeneralColumnFields(),e.push(i)),t.isNullOrUndefined(t.getValue("dependency",r))||(i={},!1!==this.parent.columnByField[r.dependency.valueOf()].visible&&(i.type="Dependency"),e.push(i)),t.isNullOrUndefined(t.getValue("resourceInfo",r))||(i={},!1!==this.parent.columnByField[r.resourceInfo.valueOf()].visible&&(i.type="Resources"),e.push(i)),t.isNullOrUndefined(t.getValue("notes",r))||(i={},!1!==this.parent.columnByField[r.notes.valueOf()].visible&&(i.type="Notes"),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 o=i[a].field;o===r.id?(e[o]=n,e.ganttProperties.rowUniqueID=e[o]):i[a].field===r.startDate?(t.isNullOrUndefined(e[r.endDate])?e[o]=this.getMinimumStartDate():e[o]=new Date(e[r.endDate]),e.ganttProperties.startDate=new Date(e[o])):i[a].field===r.endDate?(t.isNullOrUndefined(e[r.startDate])?e[o]=this.getMinimumStartDate():e[o]=new Date(e[r.startDate]),e.ganttProperties.endDate=new Date(e[o])):i[a].field===r.duration?(e[o]=1,e.ganttProperties.duration=e[o],e.ganttProperties.durationUnit=this.parent.durationUnit.toLocaleLowerCase()):i[a].field===r.name?(e[o]="New Task "+n,e.ganttProperties.taskName=e[o]):i[a].field===r.progress?(e[o]=0,e.ganttProperties.progress=e[o]):i[a].field===r.work?(e[o]=0,e.ganttProperties.work=e[o]):"taskType"===i[a].field?(e[o]=this.parent.taskType,e.ganttProperties.taskType=e[o]):e[this.parent.ganttColumns[a].field]=""}return 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.currentViewData[e.selectionModule.getSelectedRowCellIndexes()[0].rowIndex].ganttProperties.rowUniqueID:null:e.currentViewData[e.selectionModule.selectedRowIndexes[0]].ganttProperties.rowUniqueID:null;t.isNullOrUndefined(i)||this.openEditDialog(i)}},e.prototype.openEditDialog=function(e){var i=this.parent;"object"!=typeof e||t.isNullOrUndefined(e)?t.isNullOrUndefined(e)?i.selectedRowIndex>-1&&(this.rowData=i.currentViewData[i.selectedRowIndex],this.rowIndex=i.selectedRowIndex):(this.rowIndex=i.ids.indexOf(e.toString()),this.rowIndex>-1&&(this.rowData=i.flatData[this.rowIndex])):(this.rowIndex=this.parent.currentViewData.indexOf(e),this.rowIndex>-1&&(this.rowData=e)),this.isEdit=!0,"ResourceView"===this.parent.viewType&&0===this.rowData.level||0!==Object.keys(this.rowData).length&&(this.editedRecord=t.extend({},{},this.rowData,!0),this.createDialog())},e.prototype.createDialog=function(){var e=this,i=this.parent,r={};this.beforeOpenArgs.dialogModel=r,this.beforeOpenArgs.rowData=this.editedRecord,this.beforeOpenArgs.rowIndex=this.rowIndex;var n=this.parent.isAdaptive?"":"600px",a=this.parent.createElement("div",{id:i.element.id+"_dialog",styles:"max-width:"+n});i.element.appendChild(a),r.animationSettings={effect:"None"},r.header=this.localeObj.getConstant(this.isEdit?"editDialogTitle":"addDialogTitle"),r.isModal=!0,r.cssClass="e-gantt-dialog",r.allowDragging=!this.parent.isAdaptive,r.showCloseIcon=!0;var o=this.parent.isAdaptive?{X:"top",Y:"left"}:{X:"center",Y:"center"};r.position=o,r.height=this.parent.isAdaptive?"100%":"auto",r.target=this.parent.element,r.close=this.dialogClose.bind(this),r.closeOnEscape=!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.dialog&&!this.dialogObj.isDestroyed&&(this.destroyDialogInnerElements(),this.dialogObj.destroy(),t.remove(this.dialog))},e.prototype.destroyDialogInnerElements=function(){for(var e=this.parent,i=this.beforeOpenArgs.tabModel.items,r=0;r<i.length;r++){var n=i[r].content,a=n.id;if(!t.isNullOrUndefined(a)||""!==a)if(a=a.replace(e.element.id,""),"General"===(a=a.replace("TabContainer","")))this.destroyCustomField(n);else if("Dependency"===a){n.ej2_instances[0].destroy()}else if("Notes"===a){n.ej2_instances[0].destroy()}else if("Resources"===a){n.ej2_instances[0].destroy()}else-1!==a.indexOf("Custom")&&this.destroyCustomField(n)}},e.prototype.destroyCustomField=function(e){for(var i=e.childNodes,n=this.parent,a=0;a<i.length;a++){var o=i[a],s=o.querySelector('input[id^="'+n.element.id+'"]');if(s){var l=s.id.replace(n.element.id,""),d=o.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,o=this.parent,l={},d=[],p=this.getEditFields(),h=o.taskFields,c=p.length;l.items=d,l.locale=this.parent.locale,this.beforeOpenArgs.tabModel=l;var u=0;if(c>0)for(var g=0;g<c;g++){var f=p[g],m={};if("General"===f.type){if(0===Object.keys(o.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("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";var y={rowData:this.beforeOpenArgs.rowData,name:this.beforeOpenArgs.name,requestType:this.beforeOpenArgs.requestType,cancel:this.beforeOpenArgs.cancel};this.parent.trigger("actionBegin",t.isBlazor()?y:this.beforeOpenArgs,function(d){if(a.renderTabItems(),!d.cancel){l.selected=a.tabSelectedEvent.bind(a),l.height=a.parent.isAdaptive?"100%":"auto",l.overflowMode="Scrollable",a.tabObj=new s.Tab(l),a.tabObj.isStringTemplate=!0,n=a.parent.createElement("div",{id:o.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};t.isBlazor()&&a.parent.updateDataArgs(p),a.parent.trigger("actionComplete",p,function(e){e.cancel&&a.resetValues()})}})},e.prototype.tabSelectedEvent=function(e){var i=this.parent,r=e.selectedContent.childNodes[0].id;if(this.parent.isAdaptive&&this.responsiveTabContent(r,i),r===i.element.id+"ResourcesTabContainer"){var n=i.element.querySelector("#"+r).ej2_instances[0],a=this.ganttResources,o=n.getCurrentViewRecords();a&&a.length>0&&o.forEach(function(e,r){for(var o=0;o<a.length;o++)e.taskData[i.resourceFields.id]!==a[o][i.resourceFields.id]||t.isNullOrUndefined(n.selectionModule)||-1!==n.getSelectedRowIndexes().indexOf(r)||n.selectRow(r)})}else r===i.element.id+"NotesTabContainer"&&i.element.querySelector("#"+r).ej2_instances[0].refresh()},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,o=this.parent.taskFields,s={placeholder:e.headerText,floatLabelType:"Auto"};switch(e.editType){case"booleanedit":var l={label:e.headerText,locale:a};i[e.field]=l;break;case"stringedit":var d=s;e.field!==n.columnMapping.duration&&e.field!==n.columnMapping.startDate&&e.field!==n.columnMapping.endDate||(d.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=s;break;case"numericedit":var p=s;o.progress===e.field&&(p.min=0,p.max=100),o.work===e.field&&(p.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=p;break;case"datepickeredit":var h=s;h.format=this.parent.getDateFormat(),h.strictMode=!0,h.firstDayOfWeek=n.timelineModule.customTimelineSettings.weekStartDay,e.field!==n.columnMapping.startDate&&e.field!==n.columnMapping.endDate||(h.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),h.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=h;break;case"datetimepickeredit":var c=s;c.format=this.parent.getDateFormat(),c.strictMode=!0,c.firstDayOfWeek=n.timelineModule.customTimelineSettings.weekStartDay,e.field!==n.columnMapping.startDate&&e.field!==n.columnMapping.endDate||(c.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),c.change=function(t){r.validateScheduleFields(t,e,n)}),i[e.field]=c;break;case"dropdownedit":if("taskType"===e.field||e.field===n.columnMapping.manual){s.dataSource=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}],s.fields={value:"Value"};s.change=function(t){e.field===o.manual&&(r.editedRecord.ganttProperties.isAutoSchedule=!t.value),r.validateScheduleFields(t,e,n)}}i[e.field]=s;break;case"maskededit":i[e.field]=s}return t.isNullOrUndefined(e.edit)||t.isNullOrUndefined(e.edit.params)||t.extend(i[e.field],e.edit.params),i},e.prototype.validateScheduleFields=function(e,i,r){var n,a=r.editModule.dialogModule.dialog,o=null,s=r.editModule.dialogModule.editedRecord;t.isNullOrUndefined(e.element)?t.isNullOrUndefined(e.container)?t.isNullOrUndefined(e.event.path[1])||(o=(n=e.event.path[1]).querySelector("input").getAttribute("id"),n=n.querySelector("#"+o)):(o=(n=e.container).querySelector("input").getAttribute("id"),n=n.querySelector("#"+o)):o=(n=e.element).getAttribute("id");var l=n.value,d=o.replace(r.element.id,"");this.validateScheduleValuesByCurrentField(d,l,this.editedRecord);var p=s.ganttProperties,h=r.taskFields;return t.isNullOrUndefined(h.startDate)||this.updateScheduleFields(a,p,"startDate"),t.isNullOrUndefined(h.endDate)||this.updateScheduleFields(a,p,"endDate"),t.isNullOrUndefined(h.duration)||this.updateScheduleFields(a,p,"duration"),t.isNullOrUndefined(h.work)||this.updateScheduleFields(a,p,"work"),this.dialogEditValidationFlag=!1,!0},e.prototype.updateScheduleFields=function(e,i,r){var n,a=this.parent,o=a.element.id,s=t.getValue(r,a.columnMapping),l=a.columnByField[s],d=this.parent.taskFields;if("stringedit"===l.editType){var p=e.querySelector("#"+o+s).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(s,a.editModule.dialogModule.editedRecord,l):l.edit.read(),p.value!==n.toString()&&d.duration===s?(p.value=n,p.dataBind()):d.startDate!==s&&d.endDate!==s||(p.value=d.startDate===s?i.startDate.toString():i.endDate.toString(),p.dataBind())}else if("datepickeredit"===l.editType||"datetimepickeredit"===l.editType){var h=(l.editType,e.querySelector("#"+o+s).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("#"+o+s).ej2_instances[0];n=i[r],t.isNullOrUndefined(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.calculateStartDate(e),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):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,o=n.taskFields;if(o.duration===e&&(t.isNullOrUndefined(i)||""===i?n.allowUnscheduledTasks&&this.parent.setRecordValue("duration",null,a,!0):n.dataOperation.updateDurationValue(i,a),this.validateDuration(r),this.parent.editModule.updateResourceRelatedFields(r,"duration")),o.startDate===e){if(""!==i){var s=this.parent.dateValidationModule.getDateFromFormat(i);s=this.parent.dateValidationModule.checkStartDate(s,a),this.parent.setRecordValue("startDate",s,a,!0)}else n.allowUnscheduledTasks&&!r.hasChildRecords&&this.parent.setRecordValue("startDate",null,a,!0);this.validateStartDate(r)}if(o.endDate===e){if(""!==i){var l=this.parent.dateValidationModule.getDateFromFormat(i);0===l.getHours()&&86400!==n.defaultEndTime&&this.parent.dateValidationModule.setTime(n.defaultEndTime,l),l=this.parent.dateValidationModule.checkEndDate(l,a),(t.isNullOrUndefined(a.startDate)||l.getTime()>a.startDate.getTime())&&this.parent.setRecordValue("endDate",l,a,!0)}else n.allowUnscheduledTasks&&this.parent.setRecordValue("endDate",null,a,!0);this.validateEndDate(r)}return o.work===e&&(t.isNullOrUndefined(i)||""===i||(this.parent.setRecordValue("work",i,a,!0),this.parent.editModule.updateResourceRelatedFields(r,"work"),this.validateDuration(r))),"taskType"===e&&this.parent.setRecordValue("taskType",i,a,!0),o.manual===e&&this.parent.editModule.updateTaskScheduleModes(r),!0},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:"0 days",validationRules:{required:!0},width:"100px"},r.push(a)):"uniqueid"===e[n].toLowerCase()&&(a={field:"uniqueId",isPrimaryKey:!0,visible:!1,defaultValue:S().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:5,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 o={};e[a]===i.id?(o={field:i.id,headerText:this.localeObj.getConstant("id"),isPrimaryKey:!0,width:"100px",allowEditing:!1},n.push(o)):e[a]===i.name?(o={field:i.name,headerText:this.localeObj.getConstant("name"),allowEditing:!1},n.push(o)):e[a]===i.unit?(o={field:i.unit,headerText:this.localeObj.getConstant("unit"),editType:"numericedit",edit:{params:{min:0}}},n.push(o)):e[a]!==i.group||t.isNullOrUndefined(i.group)||(o={field:i.group,headerText:this.localeObj.getConstant("group"),allowEditing:!1},n.push(o))}return r.columns=n,r.height=this.parent.isAdaptive?"100%":"196px",r},e.prototype.getNotesModel=function(e){(t.isNullOrUndefined(e)||0===e.length)&&(e=["Bold","Italic","Underline","StrikeThrough","FontName","FontSize","FontColor","BackgroundColor","LowerCase","UpperCase","|","Alignments","OrderedList","UnorderedList","Outdent","Indent","|","CreateTable","CreateLink","|","ClearFormat","Print","|","Undo","Redo"]);return{placeholder:this.localeObj.getConstant("writeNotes"),toolbarSettings:{items:e},height:this.parent.isAdaptive?"100%":"auto",locale:this.parent.locale}},e.prototype.createDivElement=function(e,i){return t.createElement("div",{className:e,id:i})},e.prototype.createInputElement=function(e,i,r,n){return t.createElement(n||"input",{className:e,attrs:{type:"text",id:i,name:r,title:r}})},e.prototype.renderTabItems=function(){for(var e=this.beforeOpenArgs.tabModel.items,t=0,i=0;i<e.length;i++){var r=e[i];r.content instanceof HTMLElement||("General"===r.content?r.content=this.renderGeneralTab(r.content):"Dependency"===r.content?(this.editedRecord.hasChildRecords&&(r.disabled=!0),r.content=this.renderPredecessorTab(r.content)):"Resources"===r.content?r.content=this.renderResourceTab(r.content):r.content==="Custom"+t?(r.content=this.renderCustomTab(r.content),t++):"Notes"===r.content&&(r.content=this.renderNotesTab(r.content)))}},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 o=a[n];if(!1!==this.parent.columnByField[o].visible){var s=this.parent.columnByField[o],l=i[o];r.appendChild(this.renderInputElements(l,s))}}return r},e.prototype.isCheckIsDisabled=function(e){var t=!1;return(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)&&(-1!==this.parent.customColumns.indexOf(e.field)?t=!0:e.field===this.parent.taskFields.id?t=!0:e.field===this.parent.taskFields.name?t=!0:e.field===this.parent.taskFields.duration?t=!0:e.field===this.parent.taskFields.progress?t=!0:e.field===this.parent.taskFields.startDate?t=!0:e.field===this.parent.taskFields.endDate?t=!0:e.field===this.parent.taskFields.baselineStartDate?t=!0:e.field===this.parent.taskFields.baselineEndDate?t=!0:e.field===this.parent.taskFields.work?t=!0:"taskType"===e.field&&(t=!0)),this.isEdit&&(e.field===this.parent.taskFields.id&&(t=!0),this.editedRecord.hasChildRecords&&(e.field===this.parent.taskFields.endDate?t=!0:e.field===this.parent.taskFields.duration?t=!0:e.field===this.parent.taskFields.progress?t=!0:e.field===this.parent.taskFields.work?t=!0:"taskType"===e.field&&(t=!0))),t},e.prototype.renderPredecessorTab=function(e){var i=this,a=this.parent,o=this.beforeOpenArgs[e],s=this.parent.columnByField[this.parent.taskFields.dependency];(!1===s.allowEditing||s.isPrimaryKey||this.parent.readOnly)&&(o.editSettings.allowEditing=!1,o.editSettings.allowAdding=!1,o.editSettings.allowDeleting=!1);var l=this.beforeOpenArgs.rowData,d=[];this.taskNameCollection(),this.isEdit&&(d=this.predecessorEditCollection(l),this.updatePredecessorDropDownData(l)),o.dataSource=d,o.actionBegin=this.gridActionBegin.bind(this);o.columns[1].edit={write:function(e){"add"===t.getValue("requestType",e)&&t.setValue("rowData.uniqueId",S(),e);new c.ComboBox({dataSource:new n.DataManager(i.idCollection),popupHeight:"180px",allowCustom:!1,fields:{value:"text"},value:e.rowData.name,change:function(e){var r=t.closest(e.element,"tr").querySelector("#"+i.parent.element.id+"DependencyTabContainerid");r&&(t.isNullOrUndefined(e.itemData)||t.isNullOrUndefined(e.item)?r.value="":r.value=e.itemData.id)},autofill:!0}).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value}},r.Grid.Inject(r.Edit,r.Page,r.Toolbar,r.ForeignKey);var p=new r.Grid(o),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,o=function(r){s.idCollection.forEach(function(o,s){if(o.id===t.getValue("id",a[r])){var l=t.getValue("rowData",e);if(n&&t.getValue("id",l)===o.id)return;i.idCollection.splice(i.idCollection.indexOf(o),1)}})},s=this,l=0;l<=a.length;l++)o(l)}},e.prototype.updateResourceCollection=function(e,i){if(!t.isNullOrUndefined(e.data)&&Object.keys(e.data).length){var r=this.parent.element.querySelector("#"+i).ej2_instances[0];if(!t.isNullOrUndefined(r)&&r.getSelectedRecords().length>0){var n=r.getSelectedRecords(),a=void 0,o=[];for(a=0;a<n.length;a++)o.push(n[a].taskData);this.ganttResources=t.extend([],o)}else this.ganttResources=[]}else this.ganttResources=[]},e.prototype.renderResourceTab=function(e){var i=this,r=this.parent,n=r.resourceFields,o=this.beforeOpenArgs.rowData,s=o.ganttProperties.resourceInfo,l=this.beforeOpenArgs[e],d=r.element.id+""+e+"TabContainer",p=t.extend([],[],r.resources,!0);if(this.parent.dataOperation.updateResourceUnit(p),!t.isNullOrUndefined(s)){var h=void 0,c=s.length,u=void 0,g=p.length;for(h=0;h<c;h++)for(u=0;u<g;u++)s[h][n.id]===p[u][n.id]&&(p[u][n.unit]=s[h][n.unit])}l.dataSource=p;var f=o.ganttProperties.resourceInfo;if(this.isEdit&&!t.isNullOrUndefined(f))for(var m=0;m<f.length;m++)this.ganttResources.push(f[m]);l.rowSelected=function(e){i.updateResourceCollection(e,d)},l.rowDeselected=function(e){i.updateResourceCollection(e,d)};var y=this.createDivElement("e-resource-div",d);a.TreeGrid.Inject(a.Selection,a.Filter,a.Edit);var v=new a.TreeGrid(l),w=this.parent.columnByField[this.parent.taskFields.resourceInfo];return(!1===w.allowEditing||w.isPrimaryKey||this.parent.readOnly)&&(v.allowSelection=!1,v.allowFiltering=!1,v.editSettings.allowEditing=!1),v.appendTo(y),y},e.prototype.renderCustomTab=function(e){return this.renderGeneralTab(e)},e.prototype.renderNotesTab=function(e){var t=this.parent,i=this.beforeOpenArgs[e],r=this.editedRecord.ganttProperties,n=this.createDivElement("",t.element.id+""+e+"TabContainer");l.RichTextEditor.Inject(l.Toolbar,l.Link,l.HtmlEditor,l.QuickToolbar,l.Count),i.value=r.notes;var a=this.parent.columnByField[this.parent.taskFields.notes];(!1===a.allowEditing||a.isPrimaryKey||this.parent.readOnly)&&(i.enabled=!1);return new l.RichTextEditor(i).appendTo(n),n},e.prototype.renderInputElements=function(e,i){var n,a=this,o=this.parent.element.id,s=this.editedRecord,l=this.createDivElement("e-edit-form-column"),d={column:i,data:s};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",o+""+i.field),n.setAttribute("name",i.field),n.setAttribute("title",i.field),l.appendChild(n)}else n=this.createInputElement("",o+""+i.field,i.field),l.appendChild(n);if(e.enabled=!this.isCheckIsDisabled(i),i.field===this.parent.taskFields.duration)if(t.isNullOrUndefined(i.valueAccessor)){if(t.isNullOrUndefined(i.edit)){var h=s.ganttProperties;e.value=this.parent.dataOperation.getDurationString(h.duration,h.durationUnit)}}else e.value=i.valueAccessor(i.field,s,i);else"booleanedit"===i.editType?!0===s[i.field]?e.checked=!0:e.checked=!1:e.value=s[i.field];if(!t.isNullOrUndefined(i.edit)&&t.isNullOrUndefined(i.edit.params)){var c=i.edit.write,u=void 0;u="string"==typeof c?(c=r.getObject(c,window))({column:i,rowData:s,element:n}):i.edit.write({column:i,rowData:s,element:n}),i.field===this.parent.taskFields.duration&&(u.change=function(e){a.validateScheduleFields(e,i,a.parent)})}else{(u=new this.inputs[i.editType](e)).appendTo(n)}return l},e.prototype.taskNameCollection=function(){var e=this.parent.flatData;this.preTaskIds=[],this.preTableCollection=[];for(var t=0;t<e.length;t++){var i=e[t];if(!i.hasChildRecords){var r="ResourceView"===this.parent.viewType?i.ganttProperties.taskId.toString():i.ganttProperties.rowUniqueID.toString(),n={id:r,text:r+"-"+i.ganttProperties.taskName,value:r};this.preTaskIds.push(n.id),this.preTableCollection.push(n)}}},e.prototype.predecessorEditCollection=function(e){var i=[],r=e.ganttProperties;if(this.isEdit&&!t.isNullOrUndefined(this.parent.taskFields.dependency)&&!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(r.predecessor))for(var n=r.predecessor,a=this.preTableCollection,o=0;o<n.length;o++){var s=n[o].from.toString(),l={};if(("ResourceView"===this.parent.viewType?r.taskId:r.rowUniqueID).toString()!==s){l.id=s;for(var d=0;d<a.length;d++)if(a[d].value===s){l.name=a[d].text;break}l.type=n[o].type;var p=n[o].offset,h=n[o].offsetUnit;l.offset=this.parent.dataOperation.getDurationString(p,h),l.uniqueId=S(),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,o="ResourceView"===this.parent.viewType?n.taskId.toString():n.rowUniqueID.toString();a.forEach(function(e){if(e.from.toString()===o){var n=e.to,a=-1;(a=t.indexOf(n))>-1&&(t.splice(a,1),i.splice(a,1));var s=r.parent.connectorLineModule.getRecordByID(n);r.validSuccessorTasks(s,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))}if(this.isEdit){this.parent.dataOperation.updateWidthLeft(this.rowData);var o={data:this.rowData,action:"DialogEditing"};this.parent.editModule.initiateUpdateAction(o)}else if("ResourceView"===this.parent.viewType){var s=t.extend({},this.addedRecord,!0);if(s[this.parent.taskFields.resourceInfo].length)for(r=0;r<s[this.parent.taskFields.resourceInfo].length;r++){a=s[this.parent.taskFields.resourceInfo][r].toString();var l=this.parent.getTaskIds().indexOf("R"+a.toString());if(-1!==l){this.parent.editModule.addRecord(this.addedRecord,"Child",l);break}}else this.parent.editModule.addRecord(this.addedRecord,"Bottom")}else this.parent.editModule.addRecord(this.addedRecord,this.parent.editSettings.newRowPosition);return!0},e.prototype.updateGeneralTab=function(e,i){var n=this.parent,a=e.childNodes,o={};this.isEdit||(o=this.addedRecord);for(var s=0;s<a.length;s++){var l=a[s],d=l.querySelector('input[id^="'+n.element.id+'"]');if(d){var p=d.id.replace(n.element.id,""),h=l.querySelector("#"+n.element.id+p).ej2_instances[0],c=n.columnByField[p];if(!t.isNullOrUndefined(c.edit)&&t.isNullOrUndefined(c.edit.params)){var u=c.edit.read;"string"==typeof u?(u=r.getObject(u,window),o[p]=u(d,h.value)):o[p]=c.edit.read(d,h.value)}else i&&"booleanedit"===c.editType?!0===d.checked?o[p]=!0:o[p]=!1:o[p]=h.value}}this.isEdit&&(this.updateScheduleProperties(this.editedRecord,this.rowData),n.editModule.validateUpdateValues(o,this.rowData,!0))},e.prototype.updateScheduleProperties=function(e,i){this.parent.setRecordValue("startDate",e.ganttProperties.startDate,i.ganttProperties,!0),this.parent.setRecordValue("endDate",e.ganttProperties.endDate,i.ganttProperties,!0),this.parent.setRecordValue("duration",e.ganttProperties.duration,i.ganttProperties,!0),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,i.ganttProperties,!0),this.parent.setRecordValue("work",e.ganttProperties.work,i.ganttProperties,!0),t.isNullOrUndefined(this.parent.taskFields.startDate)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.startDate),t.isNullOrUndefined(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.endDate),t.isNullOrUndefined(this.parent.taskFields.duration)||(this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.duration),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,this.rowData,!0),0===this.rowData.ganttProperties.duration?this.parent.setRecordValue("isMilestone",!0,this.rowData.ganttProperties,!0):this.parent.setRecordValue("isMilestone",!1,this.rowData.ganttProperties,!0)),t.isNullOrUndefined(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.work),t.isNullOrUndefined(this.parent.taskFields.manual)||this.parent.dataOperation.updateMappingData(this.rowData,this.parent.taskFields.manual)},e.prototype.updatePredecessorTab=function(e){var t=e.ej2_instances[0];t.isEdit&&t.endEdit();for(var i=t.dataSource,r=[],n=[],a="",o=[],s=0;s<i.length;s++){var l=i[s],d=l.name.split("-")[0];if(l.id!==d&&(l.id=d),-1===o.indexOf(l.id)){var p=l.id+l.type;l.offset&&-1!==l.offset.indexOf("-")?p+=l.offset:p+="+"+l.offset,r.push(p),o.push(l.id)}}this.isEdit?(r.length>0?(n=this.parent.predecessorModule.calculatePredecessor(r.join(","),this.rowData),this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=this.parent.predecessorModule.getPredecessorStringValue(this.rowData)):(n=[],this.parent.setRecordValue("predecessor",n,this.rowData.ganttProperties,!0),a=""),this.parent.setRecordValue("predecessorsName",a,this.rowData.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,this.rowData),this.parent.setRecordValue(this.parent.taskFields.dependency,a,this.rowData),this.parent.predecessorModule.updateUnscheduledDependency(this.rowData)):this.addedRecord[this.parent.taskFields.dependency]=r.length>0?r.join(","):""},e.prototype.updateResourceTab=function(e){var i=e.ej2_instances[0];i&&i.grid.endEdit();var r=this.ganttResources;"ResourceView"!==this.parent.viewType||t.isNullOrUndefined(this.rowData.ganttProperties)||(JSON.stringify(this.ganttResources)!==JSON.stringify(this.rowData.ganttProperties.resourceInfo)?(this.isResourceUpdate=!0,this.previousResource=t.isNullOrUndefined(this.rowData.ganttProperties.resourceInfo)?[]:this.rowData.ganttProperties.resourceInfo.slice()):this.isResourceUpdate=!1);var n=[];if(this.isEdit)this.parent.setRecordValue("resourceInfo",r,this.rowData.ganttProperties,!0),this.parent.dataOperation.updateMappingData(this.rowData,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(this.rowData,"resource"),this.validateDuration(this.rowData);else{for(var a=0;a<r.length;a++)n.push(r[a][this.parent.resourceFields.id]),this.isAddNewResource=!0;this.addedRecord[this.parent.taskFields.resourceInfo]=n}},e.prototype.updateNotesTab=function(e){var t=this.parent,i=e.ej2_instances[0];this.isEdit?(this.parent.setRecordValue("notes",i.getHtml(),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}(),Yt=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,he),i=g(e,ce),r=g(e,ue);return t||i||r?g(e,pe):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],[me]),t.addClass(e.querySelectorAll("."+he),[fe]),t.addClass(e.querySelectorAll("."+ce),[ye]),t.addClass(e.querySelectorAll("."+ue),[ve])},e.prototype.removeHighlight=function(){t.isNullOrUndefined(this.connectorLineElement)||(t.removeClass([this.connectorLineElement],[me]),t.removeClass(this.connectorLineElement.querySelectorAll("."+he),[fe]),t.removeClass(this.connectorLineElement.querySelectorAll("."+ce),[ye]),t.removeClass(this.connectorLineElement.querySelectorAll("."+ue),[ve]),this.connectorLineElement=null)},e.prototype.getEditedConnectorLineString=function(e){for(var i,r,n,a,o,s,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.removeConnectorLineById("parent"+n.from+"child"+n.to),a=this.parent.connectorLineModule.getRecordByID(n.from),o=this.parent.connectorLineModule.getRecordByID(n.to),(a&&!0===a.expanded||o&&!0===o.expanded)&&(s=this.parent.predecessorModule.updateConnectorLineObject(a,o,n),!t.isNullOrUndefined(s))){var u=l.indexOf(s.connectorLineId),g=this.parent.connectorLineModule.getConnectorLineTemplate(s);-1!==u?d[u]=g:(l.push(s.connectorLineId),d.push(g))}}p=d.join("")}return p},e.prototype.refreshEditedRecordConnectorLine=function(e){this.removePreviousConnectorLines(this.parent.previousRecords),this.parent.connectorLineModule.expandedRecords=this.parent.getExpandedRecords(this.parent.currentViewData);var t;t=this.getEditedConnectorLineString(e),this.parent.connectorLineModule.dependencyViewContainer.innerHTML=this.parent.connectorLineModule.dependencyViewContainer.innerHTML+t},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 o=void 0,s=void 0;if(i){o=e[n[a]]}else o=e[a];if((s=o.ganttProperties&&o.ganttProperties.predecessor)&&s.length>0)for(var l=0;l<s.length;l++){var d="parent"+s[l].from+"child"+s[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.prototype.idFromPredecessor=function(e){for(var i=e.split(","),r=[],n=0;n<i.length;n++){for(var a=[],o=0;o<i[n].length&&(!t.isNullOrUndefined(i[n].charAt(o))&&"NaN"!==parseInt(i[n].charAt(o),10).toString());o++)a.push(i[n].charAt(o));r.push(a.join(""))}return r},e.prototype.predecessorValidation=function(e,i){for(var r,n,a=i.rowUniqueID,o=0;o<e.length;o++){r=e[o];var s=[];e.slice(0).splice(o,1);for(var l=function(){var e=[];return-1!==s.indexOf(r)?"break":t.isNullOrUndefined(d.parent.connectorLineModule.getRecordByID(r))?{value:!1}:(n=d.parent.connectorLineModule.getRecordByID(r).ganttProperties,!t.isNullOrUndefined(n.predecessor)&&n.predecessor.length>0&&n.predecessor.forEach(function(t){n.rowUniqueID.toString()!==t.from&&e.push(t.from.toString())}),a.toString()===n.rowUniqueID.toString()||-1!==e.indexOf(a.toString())?{value:!1}:(s.push(r),!t.isNullOrUndefined(n.predecessor)&&n.predecessor.length>0?void(r=n.predecessor[0].from):"break"))},d=this;null!==r;){var p=l();if("object"==typeof p)return p.value;if("break"===p)break}}return!0},e.prototype.validatePredecessorRelation=function(e,i){var r,n,a="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(!t.isNullOrUndefined(i)&&i.length>0){r=this.idFromPredecessor(i);for(var o=function(i){if(!s.checkParentRelation(e,r))return{value:!1};var o=[],l=!0;if(r.slice(0).forEach(function(e){-1===o.indexOf(e)?o.push(e):l=!1}),!l)return{value:!1};n=r[i];var d=[];r.slice(0).splice(i,1);for(var p=function(){var i,r,o=[];if(-1!==d.indexOf(n))return"break";if(t.isNullOrUndefined(s.parent.connectorLineModule.getRecordByID(n.toString())))return{value:!1};if(r=s.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&&(o.push(e.from.toString()),i=t)}),a.toString()===r.rowUniqueID.toString()||-1!==o.indexOf(a.toString()))return{value:!1};if(d.push(n),t.isNullOrUndefined(r.predecessor)||!(r.predecessor.length>0))return"break";var l=void 0;return o.length>1?l=s.predecessorValidation(o,e.ganttProperties):1===o.length&&(n=r.predecessor[i].from),!1===l?{value:!1}:void 0};null!==n;){var h=p();if("object"==typeof h)return h;if("break"===h)break}},s=this,l=0;l<r.length;l++){var d=o(l);if("object"==typeof d)return d.value}}return!0},e.prototype.addPredecessor=function(e,i){var r=t.isNullOrUndefined(e.ganttProperties.predecessorsName)||""===e.ganttProperties.predecessorsName?i:e.ganttProperties.predecessorsName+","+i;this.updatePredecessorHelper(e,r)},e.prototype.removePredecessor=function(e){this.updatePredecessorHelper(e,null)},e.prototype.updatePredecessor=function(e,t,i){return this.updatePredecessorHelper(e,t,i)},e.prototype.updatePredecessorHelper=function(e,i,r){if(t.isUndefined(i)||this.validatePredecessorRelation(e,i)){this.parent.isOnEdit=!0;var n=[];t.isNullOrUndefined(i)||""===i||(n=this.parent.predecessorModule.calculatePredecessor(i,e)),this.parent.setRecordValue("predecessor",n,e.ganttProperties,!0);var a=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",a,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,e),this.parent.setRecordValue(this.parent.taskFields.dependency,a,e);var o={};return o.action=r&&r.action&&"CellEditing"===r.action?r.action:"DrawConnectorLine",o.data=e,this.parent.editModule.initiateUpdateAction(o),!0}return!1},e.prototype.checkParentRelation=function(e,t){var i=e;if(i&&i.parentItem&&-1!==t.indexOf(i.parentItem.taskId.toString()))return!1;for(var r=function(e){var i=n.parent.currentViewData.filter(function(i){return i&&i.ganttProperties.rowUniqueID.toString()===t[e].toString()});if(i[0]&&i[0].hasChildRecords)return{value:!1}},n=this,a=0;a<t.length;a++){var o=r(a);if("object"==typeof o)return o.value}return!0},e.prototype.initPredecessorValidationDialog=function(){if(this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation){var e=t.createElement("div",{id:this.parent.element.id+"_dialogValidationRule"});this.parent.element.appendChild(e),this.renderValidationDialog()}},e.prototype.renderValidationDialog=function(){var e=new i.Dialog({header:"Validate Editing",isModal:!0,visible:!1,width:"50%",showCloseIcon:!0,close:this.validationDialogClose.bind(this),content:"",buttons:[{click:this.validationDialogOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.validationDialogCancelButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});document.getElementById(this.parent.element.id+"_dialogValidationRule").innerHTML="",e.isStringTemplate=!0,e.appendTo("#"+this.parent.element.id+"_dialogValidationRule"),this.parent.validationDialogElement=e},e.prototype.validationDialogOkButton=function(){var e=this.parent.currentEditedArgs;e.validateMode.preserveLinkWithEditing=document.getElementById(this.parent.element.id+"_ValidationAddlineOffset").checked,e.validateMode.removeLink=document.getElementById(this.parent.element.id+"_ValidationRemoveline").checked,e.validateMode.respectLink=document.getElementById(this.parent.element.id+"_ValidationCancel").checked,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogCancelButton=function(){this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},e.prototype.validationDialogClose=function(e){t.getValue("isInteraction",e)&&(this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption())},e.prototype.applyPredecessorOption=function(){var e=this.parent.currentEditedArgs,t=e.data;e.validateMode.respectLink?(this.parent.editModule.reUpdatePreviousRecords(),this.parent.chartRowsModule.refreshRecords([e.data])):e.validateMode.removeLink?(this.removePredecessors(t,this.validationPredecessor),this.parent.editModule.updateEditedTask(e.editEventArgs)):e.validateMode.preserveLinkWithEditing&&(this.calculateOffset(t),this.parent.editModule.updateEditedTask(e.editEventArgs))},e.prototype.calculateOffset=function(e){for(var i=t.extend([],e.ganttProperties.predecessor,[],!0),r=this.parent.predecessorModule.getValidPredecessor(e),n=0;n<r.length;n++){var a=r[n],o=this.parent.connectorLineModule.getRecordByID(a.from),s=void 0;if(f(o.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(o.ganttProperties.endDate.getTime()),d=new Date(e.ganttProperties.startDate.getTime());break;case"SS":l=new Date(o.ganttProperties.startDate.getTime()),d=new Date(e.ganttProperties.startDate.getTime());break;case"SF":l=new Date(o.ganttProperties.startDate.getTime()),d=new Date(e.ganttProperties.endDate.getTime());break;case"FF":l=new Date(o.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),s=h?-1*p:p):s=0}else s=0;i[D(a,"from",i,"to")].offset=s;var u=t.extend([],o.ganttProperties.predecessor,[],!0);u[D(a,"from",u,"to")].offset=s,this.parent.setRecordValue("predecessor",u,o.ganttProperties,!0)}this.parent.setRecordValue("predecessor",i,e.ganttProperties,!0);var g=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,g,e),this.parent.setRecordValue(this.parent.taskFields.dependency,g,e),this.parent.setRecordValue("predecessorsName",g,e.ganttProperties,!0)},e.prototype.removePredecessors=function(e,i){for(var r=t.extend([],[],e.ganttProperties.predecessor,!0),n=i.length,a=0;a<n;a++){var o=this.parent.connectorLineModule.getRecordByID(i[a].from),s=t.extend([],[],o.ganttProperties.predecessor,!0),l=D(i[a],"from",r,"to");r.splice(l,1);var d=D(i[a],"from",s,"to");s.splice(d,1),this.parent.setRecordValue("predecessor",s,o.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,n=this.parent.element.id,a=t.createElement("div",{className:"e-ValidationContent"}),o=t.getValue("task",e),s=t.getValue("parentTask",e),l=t.getValue("violationType",e),d=o.ganttProperties.taskName,p=this.parent.getFormatedDate(o.ganttProperties.startDate,"MM/dd/yyyy"),h=[d,s.ganttProperties.taskName];"taskBeforePredecessor_FS"===l?r=this.parent.localeObj.getConstant("taskBeforePredecessor_FS"):"taskAfterPredecessor_FS"===l?r=this.parent.localeObj.getConstant("taskAfterPredecessor_FS"):"taskBeforePredecessor_SS"===l?r=this.parent.localeObj.getConstant("taskBeforePredecessor_SS"):"taskAfterPredecessor_SS"===l?r=this.parent.localeObj.getConstant("taskAfterPredecessor_SS"):"taskBeforePredecessor_FF"===l?r=this.parent.localeObj.getConstant("taskBeforePredecessor_FF"):"taskAfterPredecessor_FF"===l?r=this.parent.localeObj.getConstant("taskAfterPredecessor_FF"):"taskBeforePredecessor_SF"===l?r=this.parent.localeObj.getConstant("taskBeforePredecessor_SF"):"taskAfterPredecessor_SF"===l&&(r=this.parent.localeObj.getConstant("taskAfterPredecessor_SF")),i='<div id="'+n+'_ValidationText">'+(r=w(r,h))+"<div>";var c='<table><tr><td><input type="radio" id="'+n+'_ValidationCancel" name="ValidationRule" checked/><label for="'+n+'_ValidationCancel" id= "'+n+'_cancelLink">Cancel, keep the existing link</label></td></tr><tr><td><input type="radio" id="'+n+'_ValidationRemoveline" name="ValidationRule"/><label for="'+n+'_ValidationRemoveline" id="'+n+'_removeLink">Remove the link and move <b>'+d+"</b> to start on <b>"+p+'</b>.</label></td></tr><tr><td><input type="radio" id="'+n+'_ValidationAddlineOffset" name="ValidationRule"/><label for="'+n+'_ValidationAddlineOffset" id="'+n+'_preserveLink">Move the <b>'+d+"</b> to start on <b>"+p+"</b> and keep the link.</label></td></tr></table>";return a.innerHTML=i+c,a},e.prototype.validateTypes=function(e){var i,r=this.parent.predecessorModule.getValidPredecessor(e);this.validationPredecessor=[];for(var n,a,o=this.parent.predecessorModule.getPredecessorDate(e,r),s=e.ganttProperties,l=this.parent.allowUnscheduledTasks&&t.isNullOrUndefined(o)?s.endDate:this.dateValidateModule.getEndDate(o,s.duration,s.durationUnit,s,!1),d=0;d<r.length;d++){i=this.parent.connectorLineModule.getRecordByID(r[d].from);var p=null;"FS"===r[d].type?s.startDate<o?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_FS"):s.startDate>o&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_FS"):"SS"===r[d].type?s.startDate<o?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_SS"):s.startDate>o&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_SS"):"FF"===r[d].type?l<=i.ganttProperties.endDate?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_FF"):l>i.ganttProperties.endDate&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_FF"):"SF"===r[d].type&&(l<i.ganttProperties.startDate?(this.validationPredecessor.push(r[d]),p="taskBeforePredecessor_SF"):l>i.ganttProperties.startDate&&(this.validationPredecessor.push(r[d]),p="taskAfterPredecessor_SF")),!t.isNullOrUndefined(p)&&t.isNullOrUndefined(a)&&(n=i,a=p)}return{parentTask:n,task:e,violationType:a}},e.prototype.addRemovePredecessor=function(e){var i=this.parent.previousRecords[e.uniqueID],r=e.ganttProperties.predecessor.slice();if(i&&i.ganttProperties&&i.ganttProperties.hasOwnProperty("predecessor")){var n=i.ganttProperties.predecessor;if(!t.isNullOrUndefined(n))for(var a=0;a<n.length;a++){if((d=this.parent.connectorLineModule.getRecordByID(n[a].from))===e)e.ganttProperties.predecessor.push(n[a]);else{var o=t.extend([],[],d.ganttProperties.predecessor,!0),s=D(n[a],"from",o,"to");-1!==s&&(o.splice(s,1),this.parent.setRecordValue("predecessor",o,d.ganttProperties,!0))}}if(!t.isNullOrUndefined(r))for(var l=0;l<r.length;l++){var d=this.parent.connectorLineModule.getRecordByID(r[l].from);(o=t.extend([],[],d.ganttProperties.predecessor,!0)).push(r[l]),this.parent.setRecordValue("predecessor",o,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=D(r[0],"from",n,"to");n.splice(a,1);var o=this.parent.predecessorModule.getPredecessorStringValue(e);i.push(r[0]),this.parent.connectorLineEditModule.updatePredecessor(e,o)},e.prototype.renderPredecessorDeleteConfirmDialog=function(){this.confirmPredecessorDialog=new i.Dialog({width:"320px",isModal:!0,content:this.parent.localeObj.getConstant("confirmPredecessorDelete"),buttons:[{click:this.confirmOkDeleteButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.confirmCloseDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});var e=t.createElement("div",{id:this.parent.element.id+"_deletePredecessorConfirmDialog"});this.parent.element.appendChild(e),this.confirmPredecessorDialog.isStringTemplate=!0,this.confirmPredecessorDialog.appendTo(e)},e.prototype.confirmCloseDialog=function(){this.confirmPredecessorDialog.destroy()},e.prototype.confirmOkDeleteButton=function(){this.removePredecessorByIndex(this.childRecord,this.predecessorIndex),this.confirmPredecessorDialog.destroy()},e}(),Xt=function(){return(Xt=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)},Zt=function(){function e(e){if(this.isFromDeleteMethod=!1,this.targetedRecords=[],this.updateParentRecords=[],this.isaddtoBottom=!1,this.confirmDialog=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,this.isBreakLoop=!1,this.deletedTaskDetails=[],this.parent=e,this.validatedChildItems=[],this.parent.editSettings.allowEditing&&"Auto"===this.parent.editSettings.mode&&(this.cellEditModule=new Gt(this.parent)),this.parent.taskFields.dependency&&(this.parent.connectorLineEditModule=new Yt(this.parent)),(this.parent.editSettings.allowAdding||this.parent.editSettings.allowEditing&&("Dialog"===this.parent.editSettings.mode||"Auto"===this.parent.editSettings.mode))&&(this.dialogModule=new _t(this.parent)),this.parent.editSettings.allowTaskbarEditing&&(this.taskbarEditModule=new zt(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.updateDefaultColumnEditors()}return e.prototype.getModuleName=function(){return"edit"},e.prototype.updateDefaultColumnEditors=function(){for(var e=[this.parent.taskFields.id,this.parent.taskFields.progress,this.parent.taskFields.resourceInfo,"taskType"],i=0;i<e.length;i++)if(!t.isNullOrUndefined(e[i])&&e[i].length>0){var r=this.parent.getColumnByField(e[i],this.parent.treeGridModule.treeGridColumns);r&&(r.field===this.parent.taskFields.id?this.updateIDColumnEditParams(r):r.field===this.parent.taskFields.progress?this.updateProgessColumnEditParams(r):r.field===this.parent.taskFields.resourceInfo?this.updateResourceColumnEditor(r):"taskType"===r.field&&this.updateTaskTypeColumnEditor(r))}},e.prototype.updateIDColumnEditParams=function(e){this.updateEditParams(e,{min:0,decimals:0,validateDecimalOnType:!0,format:"n0",showSpinButton:!1})},e.prototype.updateProgessColumnEditParams=function(e){this.updateEditParams(e,{min:0,decimals:0,validateDecimalOnType:!0,max:100,format:"n0"})},e.prototype.updateEditParams=function(e,i){t.isNullOrUndefined(e.edit)?(e.edit={},e.edit.params={}):t.isNullOrUndefined(e.edit.params)&&(e.edit.params={}),t.extend(i,e.edit.params),e.edit.params=i;this.parent.getColumnByField(e.field,this.parent.ganttColumns).edit=e.edit},e.prototype.updateResourceColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&t.isNullOrUndefined(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getResourceEditor();var i=this.parent.getColumnByField(e.field,this.parent.ganttColumns);i.editType="dropdownedit",i.edit=e.edit}},e.prototype.getResourceEditor=function(){var e,i=this,r=this.parent.resourceFields,a={};return c.MultiSelect.Inject(c.CheckBoxSelection),a.write=function(t){i.parent.treeGridModule.currentEditRow={},(e=new c.MultiSelect({dataSource:new n.DataManager(i.parent.resources),fields:{text:r.name,value:r.id},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"350px",delimiterChar:",",value:i.parent.treeGridModule.getResourceIds(t.rowData)})).appendTo(t.element)},a.read=function(e){var n=e.ej2_instances[0].value,a=[];t.isNullOrUndefined(n)&&(n=[]);for(var o=0;o<n.length;o++)for(var s=0;s<i.parent.resources.length;s++)if(i.parent.resources[s][r.id]===n[o]){a.push(i.parent.resources[s][r.name]);break}return i.parent.treeGridModule.currentEditRow[i.parent.taskFields.resourceInfo]=n,a.join(",")},a.destroy=function(){e&&e.destroy()},a},e.prototype.updateTaskTypeColumnEditor=function(e){if(this.parent.editSettings.allowEditing&&t.isNullOrUndefined(e.edit)&&"Auto"===this.parent.editSettings.mode){e.editType="dropdownedit",e.edit=this.getTaskTypeEditor();var i=this.parent.getColumnByField(e.field,this.parent.ganttColumns);i.editType="dropdownedit",i.edit=e.edit}},e.prototype.getTaskTypeEditor=function(){var e,i=this,r={},a=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];return r.write=function(r){i.parent.treeGridModule.currentEditRow={},(e=new c.DropDownList({dataSource:new n.DataManager(a),fields:{value:"Value"},popupHeight:"350px",value:t.getValue("taskType",r.rowData.ganttProperties)})).appendTo(r.element)},r.read=function(e){var t=e.ej2_instances[0].value;return i.parent.treeGridModule.currentEditRow.taskType=t,t},r.destroy=function(){e&&e.destroy()},r},e.prototype.reUpdateEditModules=function(){var e=this.parent.editSettings;if(e.allowEditing?(this.parent.editModule.cellEditModule&&"Dialog"===e.mode?(this.cellEditModule.destroy(),this.parent.treeGrid.recordDoubleClick=this.recordDoubleClick.bind(this)):t.isNullOrUndefined(this.parent.editModule.cellEditModule)&&"Auto"===e.mode&&(this.cellEditModule=new Gt(this.parent)),this.parent.editModule.dialogModule&&"Auto"===e.mode?this.parent.treeGrid.recordDoubleClick=void 0:t.isNullOrUndefined(this.parent.editModule.dialogModule)&&(this.dialogModule=new _t(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 zt(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.isBlazor()){-1===(n=Object.keys(e)).indexOf(i.startDate)||t.isNullOrUndefined(t.getValue(this.parent.taskFields.startDate,e))||t.setValue(this.parent.taskFields.startDate,this.parent.dataOperation.getDateFromFormat(t.getValue(this.parent.taskFields.startDate,e)),e),-1===n.indexOf(i.endDate)||t.isNullOrUndefined(t.getValue(this.parent.taskFields.endDate,e))||t.setValue(this.parent.taskFields.endDate,this.parent.dataOperation.getDateFromFormat(t.getValue(this.parent.taskFields.endDate,e)),e),-1===n.indexOf(i.baselineStartDate)||t.isNullOrUndefined(t.getValue(this.parent.taskFields.baselineStartDate,e))||t.setValue(this.parent.taskFields.baselineStartDate,this.parent.dataOperation.getDateFromFormat(t.getValue(this.parent.taskFields.baselineStartDate,e)),e),-1===n.indexOf(i.baselineEndDate)||t.isNullOrUndefined(t.getValue(this.parent.taskFields.baselineEndDate,e))||t.setValue(this.parent.taskFields.baselineEndDate,this.parent.dataOperation.getDateFromFormat(t.getValue(this.parent.taskFields.baselineEndDate,e)),e)}if(!t.isNullOrUndefined(this.parent.editModule)&&r){this.parent.isOnEdit=!0,this.validateUpdateValues(e,r,!0);var n;if(-1===(n=Object.keys(e)).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,o=m(n.columnMapping),s=[],l=!1,d=0,p=Object.keys(e);d<p.length;d++){var h=p[d];if(!(t.isNullOrUndefined(h)||t.isNullOrUndefined(e[h])&&!n.allowUnscheduledTasks))if(-1!==[a.startDate,a.endDate,a.duration].indexOf(h))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,o[h]);else{var c="string"==typeof e[h]?new Date(e[h]):e[h];n.setRecordValue(o[h],c,i.ganttProperties,!0),n.dataOperation.updateMappingData(i,o[h])}else s.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].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 y=o[h];h===a.id?y="taskId":h===a.name&&(y="taskName"),t.isNullOrUndefined(y)||n.setRecordValue(y,f,i.ganttProperties,!0),(h===a.baselineStartDate||h===a.baselineEndDate)&&i.ganttProperties.baselineStartDate&&i.ganttProperties.baselineEndDate&&(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),n.setRecordValue(h,f,i)}else if(a.indicators===h){f=e[h];n.setRecordValue("indicators",f,i.ganttProperties,!0),n.setRecordValue("taskData."+h,f,i),n.setRecordValue(h,f,i)}else if(a.work===h)n.setRecordValue("work",e[h],i.ganttProperties,!0),this.parent.dataOperation.updateMappingData(i,"work"),this.parent.dataOperation.updateMappingData(i,"duration"),this.parent.dataOperation.updateMappingData(i,"endDate");else if("taskType"===h)n.setRecordValue("taskType",e[h],i.ganttProperties,!0);else if(-1!==n.customColumns.indexOf(h)){g=n.columnByField[h],f=e[h];t.isNullOrUndefined(g.edit)&&("datepickeredit"!==g.editType&&"datetimepickeredit"!==g.editType||(f=n.dataOperation.getDateFromFormat(f))),n.setRecordValue("taskData."+h,f,i),n.setRecordValue(h,f,i)}else a.manual===h&&(n.setRecordValue("isAutoSchedule",!e[h],i.ganttProperties,!0),this.parent.setRecordValue(h,e[h],i),this.updateTaskScheduleModes(i))}l&&this.validateScheduleValues(s,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":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,o=this.parent,s=o.taskFields,l=i.ganttProperties,d=o.allowUnscheduledTasks;-1!==t.indexOf(s.startDate)&&(r=e[s.startDate]),-1!==t.indexOf(s.endDate)&&(n=e[s.endDate]),-1!==t.indexOf(s.duration)&&(a=e[s.duration]),r&&n||d&&-1!==t.indexOf(s.startDate)&&-1!==t.indexOf(s.endDate)?(o.setRecordValue("startDate",o.dataOperation.getDateFromFormat(r),l,!0),o.setRecordValue("endDate",o.dataOperation.getDateFromFormat(n),l,!0),o.dataOperation.calculateDuration(i)):n&&a||d&&-1!==t.indexOf(s.endDate)&&-1!==t.indexOf(s.duration)?(o.setRecordValue("endDate",o.dataOperation.getDateFromFormat(n),l,!0),o.dataOperation.updateDurationValue(a,l)):(r&&a||d&&-1!==t.indexOf(s.startDate)&&-1!==t.indexOf(s.duration))&&(o.setRecordValue("startDate",o.dataOperation.getDateFromFormat(r),l,!0),o.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),o=t.getValue("ganttProperties.endDate",n),s=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(o)&&!t.isNullOrUndefined(r.endDate)||t.isNullOrUndefined(r.startDate)&&!t.isNullOrUndefined(a)||t.isNullOrUndefined(r.endDate)&&!t.isNullOrUndefined(o)||a&&a.getTime()!==r.startDate.getTime()||o&&o.getTime()!==r.endDate.getTime()||!t.isNullOrUndefined(s)&&s!==r.duration||!t.isNullOrUndefined(s)&&s===r.duration&&l!==r.durationUnit)&&(i=!0)}return i},e.prototype.isPredecessorUpdated=function(e){var t=!1,i=this.parent.previousRecords[e.uniqueID];return i&&i.ganttProperties&&i.ganttProperties.hasOwnProperty("predecessor")&&(e.ganttProperties.predecessorsName!==i.ganttProperties.predecessorsName?t=!0:this.parent.setRecordValue("predecessor",i.ganttProperties.predecessor,e.ganttProperties,!0)),t},e.prototype.isCheckPredecessor=function(e){var t=!1;return this.parent.previousRecords[e.uniqueID]&&this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation&&this.parent.predecessorModule.getValidPredecessor(e).length>0&&this.isTaskbarMoved(e)&&(t=!0),t},e.prototype.updateGanttProperties=function(e,t){var i=["taskId","uniqueID","rowUniqueID","parentId"];Object.keys(e.ganttProperties).forEach(function(r){-1===i.indexOf(r)&&(t.ganttProperties[r]=e.ganttProperties[r])})},e.prototype.initiateUpdateAction=function(e){var i=this.isCheckPredecessor(e.data);this.taskbarMoved=this.isTaskbarMoved(e.data),this.predecessorUpdated=this.isPredecessorUpdated(e.data),this.predecessorUpdated&&(this.parent.isConnectorLineUpdate=!0,this.parent.connectorLineEditModule.addRemovePredecessor(e.data));var r={};if(i)if(r=this.parent.connectorLineEditModule.validateTypes(e.data),this.parent.isConnectorLineUpdate=!0,t.isNullOrUndefined(t.getValue("violationType",r)))this.updateEditedTask(e);else{var n=this.validateTaskEvent(e);!1===n.validateMode.preserveLinkWithEditing&&!1===n.validateMode.removeLink&&!1===n.validateMode.respectLink?this.parent.connectorLineEditModule.openValidationDialog(r):this.parent.connectorLineEditModule.applyPredecessorOption()}else this.taskbarMoved&&(this.parent.isConnectorLineUpdate=!0),this.updateEditedTask(e)},e.prototype.validateTaskEvent=function(e){var i={},r={};return this.resetValidateArgs(),this.parent.currentEditedArgs=i,i.cancel=!1,i.data=e.data,i.requestType="validateLinkedTask",i.validateMode=this.parent.dialogValidateMode,i.editEventArgs=e,t.isBlazor()&&(r=Xt({},i),this.parent.updateDataArgs(i),this.parent.currentEditedArgs=r),this.parent.actionBeginTask(i),t.isBlazor()?r:i},e.prototype.resetValidateArgs=function(){this.parent.dialogValidateMode.preserveLinkWithEditing=!0,this.parent.dialogValidateMode.removeLink=!1,this.parent.dialogValidateMode.respectLink=!1},e.prototype.updateEditedTask=function(e){var t=e.data;if(this.updateParentChildRecord(t),this.parent.isConnectorLineUpdate){for(var i=0;i<this.validatedChildItems.length;i++){var r=this.validatedChildItems[i];r.ganttProperties.predecessor&&r.ganttProperties.predecessor.length>0&&(this.parent.editedTaskBarItem=r,this.parent.predecessorModule.validatePredecessor(r,[],""))}t.ganttProperties.predecessor&&(this.parent.isMileStoneEdited=t.ganttProperties.isMilestone,this.taskbarMoved&&(this.parent.editedTaskBarItem=t),this.parent.predecessorModule.validatePredecessor(t,[],""))}(t.parentItem||"Auto"!==this.parent.taskMode)&&this.parent.dataOperation.updateParentItems(t,!0),this.initiateSaveAction(e)},e.prototype.updateParentChildRecord=function(e){var t=e;t.hasChildRecords&&this.taskbarMoved&&"Auto"===this.parent.taskMode&&this.updateChildItems(t)},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 o=this.parent.dateValidationModule.checkStartDate(a,n,null);this.parent.setRecordValue("endDate",this.parent.dateValidationModule.checkEndDate(o,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,o=0,s=0,l=0,d={};if(n){for(var p=0;p<a;p++)n[p].ganttProperties.isMilestone&&!n[p].hasChildRecords||!f(n[p].ganttProperties)?s+=1:(d=this.parent.dataOperation.getParentProgress(n[p]),o+=t.getValue("totalProgress",d),l+=t.getValue("totalDuration",d));i=a-s>0?Math.round(o/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",o,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],o=i[a],s=this.parent.getTaskByUniqueID(a);this.copyTaskData(s.taskData,o.taskData),delete o.taskData,this.copyTaskData(s.ganttProperties,o.ganttProperties),delete o.ganttProperties,this.copyTaskData(s,o);var l=this.parent.currentViewData.indexOf(s);if(e&&this.parent.chartRowsModule.refreshRow(l),t){var d="ProjectView"===this.parent.viewType?s.ganttProperties.taskId:s.ganttProperties.rowUniqueID;this.parent.treeGrid.grid.setRowData(d,s);this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[l].getAttribute("data-uid")).data=s}}},e.prototype.copyTaskData=function(e,i){t.isNullOrUndefined(i)||t.extend(e,i)},e.prototype.updateScheduleDatesOnEditing=function(e){},e.prototype.updateChildItems=function(e){var i,r=this.parent.previousRecords[e.uniqueID];i=t.isNullOrUndefined(r)||t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.ganttProperties)?new Date(e.ganttProperties.startDate.getTime()):new Date(r.ganttProperties.startDate.getTime());var n,a,o,s,l,d=e.ganttProperties.startDate,p=[];if(this.getUpdatableChildRecords(e,p),0!==p.length){i.getTime()>d.getTime()?(n=this.parent.dateValidationModule.checkStartDate(d),a=this.parent.dateValidationModule.checkEndDate(i,e.ganttProperties),s=!1):(n=this.parent.dateValidationModule.checkStartDate(i),a=this.parent.dateValidationModule.checkEndDate(d,e.ganttProperties),s=!0),l=n.getTime()>=a.getTime()?0:this.parent.dateValidationModule.getDuration(n,a,"minute",!0,!1);for(var h=0;h<p.length;h++)if(p[h].ganttProperties.isAutoSchedule)if(l>0){var c=f(p[h].ganttProperties)?p[h].ganttProperties.startDate:p[h].ganttProperties.startDate?p[h].ganttProperties.startDate:p[h].ganttProperties.endDate?p[h].ganttProperties.endDate:new Date(i.toString());o=s?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],o),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(p[h])&&this.validatedChildItems.push(p[h])}else t.isNullOrUndefined(r)&&(o=i,this.calculateDateByRoundOffDuration(p[h],o),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(p[h])&&this.validatedChildItems.push(p[h]));p.length&&this.parent.dataOperation.updateParentItems(e,!0)}},e.prototype.getUpdatableChildRecords=function(e,t){for(var i=e.childRecords,r=0;r<i.length;r++)i[r].ganttProperties.isAutoSchedule&&(t.push(i[r]),i[r].hasChildRecords&&this.getUpdatableChildRecords(i[r],t))},e.prototype.initiateSaveAction=function(e){var i=this;this.parent.showSpinner();var r={};r.requestType="beforeSave",r.data=e.data,r.modifiedRecords=this.parent.editedRecords,r.modifiedTaskData=v(this.parent.editedRecords,!0),e.action&&"DrawConnectorLine"===e.action&&(r.action="DrawConnectorLine"),t.isBlazor()&&(r=this.parent.updateDataArgs(r)).modifiedTaskData,this.parent.trigger("actionBegin",r,function(t){if(t.cancel)i.reUpdatePreviousRecords(),i.parent.chartRowsModule.refreshRecords([e.data]),i.resetEditProperties();else if(t.modifiedTaskData=v(t.modifiedRecords),y(i.parent.dataSource)){var r=i.parent.dataSource,a={changedRecords:t.modifiedTaskData},o=i.parent.query instanceof n.Query?i.parent.query:new n.Query;r.saveChanges(a,i.parent.taskFields.id,null,o).then(function(t){return i.dmSuccess(t,e)}).catch(function(t){return i.dmFailure(t,e)})}else i.saveSuccess(e)})},e.prototype.dmSuccess=function(e,t){this.saveSuccess(t)},e.prototype.dmFailure=function(e,t){if(this.deletedTaskDetails.length){for(var i=this.deletedTaskDetails,r=0;r<i.length;r++)i[r].isDelete=!1;this.deletedTaskDetails=[]}this.reUpdatePreviousRecords(!0,!0),this.resetEditProperties(),this.parent.trigger("actionFailure",{error:e})},e.prototype.updateSharedTask=function(e){for(var i=e.ganttProperties.sharedTaskUniqueIds,r=0;r<i.length;r++){var n=this.parent.flatData[this.parent.ids.indexOf(i[r].toString())];n.uniqueID!==e.uniqueID&&(this.updateGanttProperties(e,n),this.parent.setRecordValue("taskData",e.taskData,n,!0),this.parent.dataOperation.updateTaskData(n),this.parent.dataOperation.updateResourceName(n),t.isNullOrUndefined(n.parentItem)||this.parent.dataOperation.updateParentItems(n.parentItem))}},e.prototype.saveSuccess=function(e){var i={};if(this.parent.timelineSettings.updateTimescaleView){var r=this.parent.editedRecords;this.parent.timelineModule.updateTimeLineOnEditing(r,e.action)}if("ResourceView"===this.parent.viewType){"TaskbarEditing"===e.action?this.updateSharedTask(e.data):"DialogEditing"!==e.action&&"CellEditing"!==e.action&&"methodUpdate"!==e.action||(this.parent.editModule.dialogModule.isResourceUpdate?(this.updateResoures(this.parent.editModule.dialogModule.previousResource,e.data.ganttProperties.resourceInfo,e.data),this.updateSharedTask(e.data),this.isTreeGridRefresh=!0):this.updateSharedTask(e.data));for(var n=0;n<this.updateParentRecords.length;n++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[n]);this.updateParentRecords=[],this.parent.editModule.dialogModule.isResourceUpdate=!1,this.parent.editModule.dialogModule.previousResource=[]}this.isTreeGridRefresh||(this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords),this.parent.isConnectorLineUpdate&&!t.isNullOrUndefined(this.parent.connectorLineEditModule)&&(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.editedRecords),this.updateScheduleDatesOnEditing(e))),!this.parent.editSettings.allowTaskbarEditing||this.parent.editSettings.allowTaskbarEditing&&!this.taskbarEditModule.dependencyCancel?(i.requestType="save",i.data=e.data,i.modifiedRecords=this.parent.editedRecords,i.modifiedTaskData=v(this.parent.editedRecords),t.isNullOrUndefined(e.action)||t.setValue("action",e.action,i),"TaskbarEditing"===e.action&&(i.taskBarEditAction=e.taskBarEditAction),this.endEditAction(e),t.isBlazor()&&this.parent.updateDataArgs(i),this.parent.trigger("actionComplete",i)):(this.taskbarEditModule.dependencyCancel=!1,this.resetEditProperties(),t.isBlazor()&&this.parent.updateDataArgs(i)),"ResourceView"===this.parent.viewType&&this.isTreeGridRefresh&&(this.parent.treeGrid.refresh(),this.isTreeGridRefresh=!1)},e.prototype.updateResoures=function(e,t,i){var r=this.parent.flatData,n=t?t.length:0,a=e?e.length:0;if(0!==n||0!==a){for(var o=0;o<n;o++){for(var s=[],l=parseInt(t[o][this.parent.resourceFields.id],10),d=0;d<e.length;d++)if(parseInt(e[d][this.parent.resourceFields.id],10)===l){s.push(d);break}if(0===s.length){var p=r[this.parent.getTaskIds().indexOf("R"+l)];p&&this.addNewRecord(i,p)}else e.splice(parseInt(s[0].toString(),10),1)}var h=e?e.length:0;for(o=0;o<h;o++)for(var c=i.ganttProperties.taskId,u=(l=e[o][this.parent.resourceFields.id],r[this.parent.getTaskIds().indexOf("R"+l)]),g=0;g<u.childRecords.length;g++)u.childRecords[g].ganttProperties.taskId===c&&this.removeChildRecord(u.childRecords[g]);if(n>0){var f=this.parent.getParentTask(i.parentItem);f&&f.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.removeChildRecord(i)}0===n&&this.checkWithUnassignedTask(i)}},e.prototype.checkWithUnassignedTask=function(e){for(var i=null,r=0;r<this.parent.flatData.length;r++)this.parent.flatData[r].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&(i=this.parent.flatData[r]);if(t.isNullOrUndefined(i)){var n={};n[this.parent.taskFields.id]=0,n[this.parent.taskFields.name]=this.parent.localeObj.getConstant("unassignedTask");var a=void 0,o=this.parent.isOnEdit;this.parent.isOnEdit=!1,a=this.parent.dataOperation.createRecord(n,0),this.parent.isOnEdit=o,this.addRecordAsBottom(a);var s=this.parent.flatData[this.parent.flatData.length-1];this.addNewRecord(e,s)}else this.addNewRecord(e,i)},e.prototype.addRecordAsBottom=function(e){var t=this.parent.flatData.length;this.parent.taskFields.parentID&&this.parent.dataSource.length>0&&this.parent.dataSource.splice(t+1,0,e.taskData),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 o=n.parentItem?n.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",o,n),e.ganttProperties.sharedTaskUniqueIds.push(a),n.ganttProperties.sharedTaskUniqueIds=e.ganttProperties.sharedTaskUniqueIds,this.addRecordAsChild(i,n)},e.prototype.removeChildRecord=function(e){var t,i=this.parent,r=[];r=this.parent.dataSource instanceof n.DataManager&&this.parent.dataSource.dataSource.json.length>0?this.parent.dataSource.dataSource.json:this.parent.currentViewData,t=this.parent.dataSource;var a=e,o=this.parent.getParentTask(a.parentItem);if(a){if(a.parentItem){var s=o?o.childRecords:[],l=0;s&&s.length>0&&(1===s.length&&(this.parent.isOnDelete=!0,s[0].isDelete=!0,this.parent.dataOperation.updateParentItems(o),this.parent.isOnDelete=!1,s[0].isDelete=!1),l=s.indexOf(a),o.childRecords.splice(l,1),this.updateParentRecords.push(o))}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"),a&&!this.parent.taskFields.parentID){var p=[];p.push(a.ganttProperties.rowUniqueID.toString()),this.parent.editModule.removeFromDataSource(p)}if(i.taskFields.parentID){for(var h=void 0,c=this.parent.currentViewData,u=0;u<c.length;u++)c[u].ganttProperties.rowUniqueID===a.ganttProperties.rowUniqueID&&(h=u);-1!==h&&(t.length>0&&t.splice(h,1),r.splice(h,1),this.parent.flatData.splice(h,1),this.parent.ids.splice(h,1),this.parent.getTaskIds().splice(h,1))}var g=r.indexOf(a);if(!i.taskFields.parentID){var f=this.parent.editModule.getChildCount(a,0);r.splice(g,f+1),this.parent.flatData.splice(g,f+1),this.parent.ids.splice(g,f+1),this.parent.getTaskIds().splice(g,f+1)}a.parentItem&&o&&o.childRecords&&!o.childRecords.length&&(o.expanded=!1,o.hasChildRecords=!1)}},e.prototype.addRecordAsChild=function(e,i){var r,n=this.parent,a=this.parent.flatData.indexOf(e),o=this.parent.editModule.getChildCount(e,0);if(!t.isNullOrUndefined(this.addRowIndex)&&this.addRowPosition&&e.childRecords&&"Child"!==this.addRowPosition){var s=e.childRecords[this.addRowIndex],l="Above"===this.addRowPosition||"Below"===this.addRowPosition?this.addRowPosition:"Child";r=s?this.addRowIndex+a+1:o+a+1,r="Above"===l?r:r+1}else r=t.isNullOrUndefined(o)||0===o?a+1:o+a+1;n.taskFields.parentID&&this.parent.dataSource.length>0&&this.parent.dataSource.splice(r,0,i.taskData),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||(e.hasChildRecords=!0,e.expanded=!0,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(){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)||(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose()),this.parent.hideSpinner(),this.parent.initiateEditAction(!1)},e.prototype.endEditAction=function(e){this.resetEditProperties(),"TaskbarEditing"===e.action?this.parent.trigger("taskbarEdited",e):"CellEditing"===e.action?this.parent.trigger("endEdit",e):"DialogEditing"===e.action&&(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose())},e.prototype.saveFailed=function(e){this.reUpdatePreviousRecords(),this.parent.hideSpinner()},e.prototype.renderDeleteConfirmDialog=function(){var e=new i.Dialog({width:"320px",isModal:!0,visible:!1,content:this.parent.localeObj.getConstant("confirmDelete"),buttons:[{click:this.confirmDeleteOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.closeConfirmDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});e.appendTo("#"+this.parent.element.id+"_deleteConfirmDialog"),this.confirmDialog=e},e.prototype.closeConfirmDialog=function(){this.confirmDialog.hide()},e.prototype.confirmDeleteOkButton=function(){this.deleteSelectedItems(),this.confirmDialog.hide();this.parent.element.querySelector(".e-treegrid").focus()},e.prototype.startDeleteAction=function(){this.parent.editSettings.allowDeleting&&(this.parent.editSettings.showDeleteConfirmDialog?this.confirmDialog.show():this.deleteSelectedItems())},e.prototype.deleteResourceRecords=function(e){for(var t=[],i=0;i<e.length;i++)if(e[i].parentItem)for(var r=e[i].ganttProperties.sharedTaskUniqueIds,n=0;n<r.length;n++)t.push(this.parent.flatData[this.parent.ids.indexOf(r[n].toString())]);this.deleteRow(t)},e.prototype.deleteSelectedItems=function(){if(this.isFromDeleteMethod)this.targetedRecords.length&&("ResourceView"===this.parent.viewType?this.deleteResourceRecords(this.targetedRecords):this.deleteRow(this.targetedRecords)),this.isFromDeleteMethod=!1;else{var e=[];"Cell"!==this.parent.selectionSettings.mode?e=this.parent.selectionModule.getSelectedRecords():"Cell"===this.parent.selectionSettings.mode&&(e=this.parent.selectionModule.getCellSelectedRecords()),"ResourceView"===this.parent.viewType?this.deleteResourceRecords(e):this.deleteRow(e)}},e.prototype.deleteRecord=function(e){this.isFromDeleteMethod=!0;var i=typeof e;switch(this.targetedRecords=[],i){case"number":case"string":var r=e.toString();"ResourceView"===this.parent.viewType?t.isNullOrUndefined(r)||-1===this.parent.getTaskIds().indexOf("T"+r)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r)]):t.isNullOrUndefined(r)||-1===this.parent.ids.indexOf(r)||this.targetedRecords.push(this.parent.getRecordByID(r));break;case"object":Array.isArray(e)?this.updateTargetedRecords(e):this.targetedRecords.push(e.valueOf())}this.startDeleteAction()},e.prototype.updateTargetedRecords=function(e){if(e.length){if("object"===typeof e[0])this.targetedRecords=e;else for(var i=0;i<e.length;i++){var r=e[i].toString();"ResourceView"===this.parent.viewType?t.isNullOrUndefined(r)||-1===this.parent.getTaskIds().indexOf("T"+r)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r)]):t.isNullOrUndefined(r)||-1===this.parent.ids.indexOf(r)||this.targetedRecords.push(this.parent.getRecordByID(r))}}},e.prototype.deleteRow=function(e){this.parent.flatData;var i=e&&e.length?e:this.parent.selectionModule.getSelectedRecords();if(i.length){this.parent.isOnDelete=!0,i.forEach(function(e){e.isDelete=!0}),"ResourceView"!==this.parent.viewType||e.length||(i=[]);for(var r=0;r<i.length;r++){var n=i[r];if(-1===this.deletedTaskDetails.indexOf(n)){if(n.parentItem){var a=this.parent.getParentTask(n.parentItem).childRecords;(1===a.length?a:a.filter(function(e){return!e.isDelete})).length>0&&this.parent.dataOperation.updateParentItems(n.parentItem)}var o=n.ganttProperties.predecessor;o&&o.length&&this.removePredecessorOnDelete(n),this.deletedTaskDetails.push(n),n.hasChildRecords&&this.deleteChildRecords(n)}}this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.clearSelection();var s={};s.deletedRecordCollection=this.deletedTaskDetails,s.updatedRecordCollection=this.parent.editedRecords,s.cancel=!1,s.action="delete",this.initiateDeleteAction(s),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 o=this.parent.connectorLineModule.getRecordByID(n.to.toString());if(!t.isNullOrUndefined(o)){for(var s=t.extend([],[],o.ganttProperties.predecessor,!0),l=void 0,d=0;d<s.length;d++){var p="ResourceView"===this.parent.viewType?o.ganttProperties.taskId:o.ganttProperties.rowUniqueID;if(s[d].to.toString()===p.toString()&&s[d].from.toString()===a.toString()){l=d;break}}s.splice(l,1),this.updatePredecessorValues(o,s)}}else if(n.to.toString()===a.toString()){var h=this.parent.connectorLineModule.getRecordByID(n.from.toString());if(!t.isNullOrUndefined(h)){var c=t.extend([],[],h.ganttProperties.predecessor,!0);for(l=void 0,d=0;d<c.length;d++){var u="ResourceView"===this.parent.viewType?h.ganttProperties.taskId:h.ganttProperties.rowUniqueID;if(c[d].from.toString()===u.toString()&&c[d].to.toString()===a.toString()){l=d;break}}c.splice(l,1),this.updatePredecessorValues(h,c)}}}},e.prototype.updatePredecessorValues=function(e,t){this.parent.setRecordValue("predecessor",t,e.ganttProperties,!0);var i=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",i,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,i,e),this.parent.setRecordValue(this.parent.taskFields.dependency,i,e)},e.prototype.updateTaskId=function(e,i){if(!this.parent.readOnly){var r="number"==typeof e?e.toString():e,n="number"==typeof i?i.toString():i,a=this.parent.ids;if(!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(n)){var o=a.indexOf(r),s=a.indexOf(n);if(-1===o||s>-1)return;var l=this.parent.flatData[o];if(l.ganttProperties.taskId=l.ganttProperties.rowUniqueID=n,l.taskData[this.parent.taskFields.id]=n,l[this.parent.taskFields.id]=n,a[o]=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.updatePredecessorOnUpdateId(l,r,n),this.parent.treeGrid.refresh()}}},e.prototype.updatePredecessorOnUpdateId=function(e,t,i){if(this.parent.currentViewData.indexOf(e)>-1)for(var r=e.ganttProperties.predecessor,n=0;n<r.length;n++){var a=r[n];a.to===t?a.to=i:a.from===t&&(a.from=i)}this.updatePredecessorValues(e,e.ganttProperties.predecessor)},e.prototype.deleteChildRecords=function(e){for(var t=e.childRecords,i=0;i<t.length;i++){var r=t[i];if(-1===this.deletedTaskDetails.indexOf(r)){var n=r.ganttProperties.predecessor;n&&n.length&&this.removePredecessorOnDelete(r),this.deletedTaskDetails.push(r),r.hasChildRecords&&this.deleteChildRecords(r)}}},e.prototype.removeFromDataSource=function(e){var t;this.parent.taskFields;t=this.parent.dataSource instanceof n.DataManager?this.parent.dataSource.dataSource.json:this.parent.dataSource,this.removeData(t,e),this.isBreakLoop=!1},e.prototype.removeData=function(e,i){for(var r=0;r<e.length&&!this.isBreakLoop;r++)if(-1!==i.indexOf(t.getValue(this.parent.taskFields.id,e[r]).toString())){if(e[r][this.parent.taskFields.child]){var n=e[r][this.parent.taskFields.child];this.removeData(n,i)}if(i.splice(i.indexOf(t.getValue(this.parent.taskFields.id,e[r]).toString()),1),e.splice(r,1),0===i.length){this.isBreakLoop=!0;break}}else if(e[r][this.parent.taskFields.child]){n=e[r][this.parent.taskFields.child];this.removeData(n,i)}},e.prototype.initiateDeleteAction=function(e){var i=this;this.parent.showSpinner();var r={};r.requestType="beforeDelete",r.data=e.deletedRecordCollection,r.modifiedRecords=e.updatedRecordCollection,r.modifiedTaskData=v(e.updatedRecordCollection);var n={};t.isBlazor()&&(r=this.parent.updateDataArgs(r),n.modifiedTaskData=r.modifiedTaskData,n.data=r.data),this.parent.trigger("actionBegin",r,function(r){if(r.cancel){for(var a=i.deletedTaskDetails,o=0;o<a.length;o++)a[o].isDelete=!1;i.deletedTaskDetails=[],i.reUpdatePreviousRecords(),i.parent.initiateEditAction(!1),i.parent.hideSpinner()}else if(y(i.parent.dataSource)){var s=i.parent.dataSource,l={deletedRecords:t.isBlazor()?v(n.data):v(r.data),changedRecords:t.isBlazor()?n.modifiedTaskData:r.modifiedTaskData};if(t.isBlazor()){l.addedRecords=[]}s.saveChanges(l,i.parent.taskFields.id).then(function(t){return i.deleteSuccess(e)}).catch(function(t){return i.dmFailure(t,e)})}else i.deleteSuccess(e)})},e.prototype.deleteSuccess=function(e){for(var i=this.parent.flatData,r=this.parent.currentViewData,n=this.parent.getRecordFromFlatdata(e.deletedRecordCollection),a=[],o=0;o<n.length;o++){var s=n[o],l=r.indexOf(s),d=i.indexOf(s),p=this.parent.treeGrid.parentData.indexOf(s),h=void 0;if(-1!==l&&r.splice(l,1),-1!==d&&i.splice(d,1),!t.isNullOrUndefined(s)){if(a.push(s.ganttProperties.rowUniqueID.toString()),-1!==d&&(this.parent.ids.splice(d,1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(d,1)),0===s.level&&-1!==p&&this.parent.treeGrid.parentData.splice(p,1),s.parentItem){var c=this.parent.getParentTask(s.parentItem);if(c){var u=c.childRecords;-1!==(h=u.indexOf(s))&&u.splice(h,1),u.length||(c.hasChildRecords=!1)}}this.updateTreeGridUniqueID(s,"delete")}}a.length>0&&this.removeFromDataSource(a);var g={};this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.taskFields.dependency&&this.parent.predecessorModule.updatedRecordsDateByPredecessor(),this.parent.treeGrid.refresh(),g.requestType="delete",g.data=e.deletedRecordCollection,g.modifiedRecords=e.updatedRecordCollection,g.modifiedTaskData=v(e.updatedRecordCollection),t.setValue("action",e.action,g),t.isBlazor()&&this.parent.updateDataArgs(g),this.parent.trigger("actionComplete",g),this.deletedTaskDetails=[],this.parent.initiateEditAction(!1),this.parent.hideSpinner()},e.prototype.getNewTaskId=function(){var e=n.DataUtil.aggregates.max(this.parent.flatData,this.parent.taskFields.id);return t.isNullOrUndefined(e)?1:parseInt(e.toString(),10)+1},e.prototype.prepareNewlyAddedData=function(e,i){var r,n=this.parent.taskFields,a=this.parent.ids;if(e[n.id]&&(-1!==a.indexOf(e[n.id].toString())?e[n.id]=null:e[n.id]=t.isNullOrUndefined(e[n.id])?null:parseInt(e[n.id],10)),e[n.id]||(r=this.getNewTaskId(),e[n.id]=r),n.name&&!e[n.name]&&(e[n.name]="New Task "+e[n.id]),this.parent.allowUnscheduledTasks||e[n.startDate]||(e[n.startDate]=this.parent.projectStartDate),!this.parent.allowUnscheduledTasks&&n.duration&&t.isNullOrUndefined(e[n.duration])&&(e[n.endDate]||(e[n.duration]="5")),n.progress&&(e[n.progress]=e[n.progress]?e[n.progress]>100?100:e[n.progress]:0),!this.parent.allowUnscheduledTasks&&!e[n.endDate]&&n.endDate&&!e[n.duration]){var o=this.parent.dataOperation.getDateFromFormat(this.parent.projectStartDate);o.setDate(o.getDate()+4),e[n.endDate]=this.parent.getFormatedDate(o,this.parent.getDateFormat())}},e.prototype.updateNewlyAddedDataBeforeAjax=function(e,i,r,n){var a;if(a=this.parent.dataOperation.createRecord(e,i),a.index=parseInt(a.ganttProperties.rowUniqueID.toString(),10)-1,!t.isNullOrUndefined(n)){this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(n),a);var o=a.parentItem?a.parentItem.index:null;this.parent.setRecordValue("parentIndex",o,a);var s=a.parentItem?a.parentItem.uniqueID:null;this.parent.setRecordValue("parentUniqueID",s,a),t.isNullOrUndefined(this.parent.taskFields.id)||t.isNullOrUndefined(this.parent.taskFields.parentID)||!a.parentItem||(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),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,o=a.predecessor,s=0;s<n;s++)if(o[s].to===a.rowUniqueID.toString()){i=this.parent.getRecordByID(o[s].from),r=D(o[s],"from",i.ganttProperties.predecessor,"to");var l=void 0;(l=t.extend([],i.ganttProperties.predecessor,[],!0)).splice(r,1),this.parent.setRecordValue("predecessor",l,i.ganttProperties,!0)}else if(o[s].from===a.rowUniqueID.toString()){i=this.parent.getRecordByID(o[s].to);this.predecessorToString(i.ganttProperties.predecessor,e);var d=i.ganttProperties.predecessorsName.toString().split(","),p=o[s].from+o[s].type,h=d.indexOf(p);d.splice(h,1),this.parent.setRecordValue("predecessorsName",d.join(","),i.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.dependency,d.join(","),i),r=D(o[s],"from",i.ganttProperties.predecessor,"to");var c=void 0;(c=t.extend([],i.ganttProperties.predecessor,[],!0)).splice(r,1),this.parent.setRecordValue("predecessor",c,i.ganttProperties,!0),this.parent.predecessorModule.validatePredecessorDates(i)}this.parent.setRecordValue("predecessor",[],e.ganttProperties,!0),this.parent.setRecordValue("predecessorsName","",e.ganttProperties,!0)},e.prototype.predecessorToString=function(e,t){for(var i=[],r=0,n=e.length;r<n;r++)if(t.ganttProperties.rowUniqueID.toString()!==e[r].from){var a=e[r].from+e[r].type;e[r].offset=isNaN(e[r].offset)?0:e[r].offset,0!==e[r].offset&&(e[r].offset<0?a+=e[r].offset.toString()+"d":e[r].offset>0&&(a+="+"+e[r].offset.toString()+"d")),i.push(a)}return i.join(",")},e.prototype.backUpAndPushNewlyAddedRecord=function(e,t,i){var r,n,a,o=this.parent.flatData,s=this.parent.currentViewData,l=this.parent.ids;switch(t){case"Top":o.splice(0,0,e),s.splice(0,0,e),l.splice(0,0,e.ganttProperties.rowUniqueID.toString());break;case"Bottom":if(o.push(e),s.push(e),l.push(e.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var d=0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId;this.parent.getTaskIds().push(d)}break;case"Above":n=o.indexOf(this.addRowSelectedItem),a=s.indexOf(this.addRowSelectedItem),this.recordCollectionUpdate(void 0,n,a,e,i);break;case"Below":if(r=o.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){n=r+this.getChildCount(this.addRowSelectedItem,0)+1,a=s.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,s)+1}else n=r+1,a=s.indexOf(this.addRowSelectedItem)+1;this.recordCollectionUpdate(NaN,n,a,e,i);break;case"Child":if(r=o.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords){n=r+this.getChildCount(this.addRowSelectedItem,0)+1,this.addRowSelectedItem.expanded||this.parent.enableMultiTaskbar||this.parent.expandByID(Number(this.addRowSelectedItem.ganttProperties.rowUniqueID)),a=s.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,s)+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),n=r+1,a=s.indexOf(this.addRowSelectedItem)+1,this.addRowSelectedItem.ganttProperties.predecessor&&this.updatePredecessorOnIndentOutdent(this.addRowSelectedItem);this.recordCollectionUpdate(NaN,n,a,e,i)}this.newlyAddedRecordBackup=e},e.prototype.recordCollectionUpdate=function(e,i,r,a,o){var s=this.parent.flatData,l=this.parent.currentViewData,d=this.parent.ids;if(s.splice(i,0,a),l.splice(r,0,a),d.splice(i,0,a.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var p=0===a.level?"R"+a.ganttProperties.taskId:"T"+a.ganttProperties.taskId;this.parent.getTaskIds().splice(i,0,p)}if(!t.isNullOrUndefined(o)&&(e=o.childRecords.indexOf(this.addRowSelectedItem),o.childRecords.splice(e,0,a),this.parent.dataSource instanceof n.DataManager&&t.isNullOrUndefined(o.taskData[this.parent.taskFields.parentID]))){var h=this.parent.taskFields.child;o.taskData[h]&&o.taskData[h].length>0?o.taskData[h].push(a.taskData):(o.taskData[h]=[],o.taskData[h].push(a.taskData))}},e.prototype.constructTaskAddedEventArgs=function(e,t,i){var r={};return r.action=r.requestType=i,r.data=e,r.newTaskData=v([e])[0],r.recordIndex=e.index,r.modifiedRecords=t,r.modifiedTaskData=v(t),r},e.prototype.addSuccess=function(e){this.parent.treeGrid.refresh()},e.prototype.updateRealDataSource=function(e,i){var r=this.parent.taskFields,n=this.parent.dataSource;"Top"===i?n.splice(0,0,e.taskData):"Bottom"===i?n.push(e):t.isNullOrUndefined(r.id)||t.isNullOrUndefined(r.parentID)?this.addDataInRealDataSource(n,e.taskData,i):n.push(e.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 o=e[n][a];this.addDataInRealDataSource(o,i,r)}}},e.prototype.addRecord=function(e,i,r){var a=this;if(this.parent.editModule&&this.parent.editSettings.allowAdding){var o=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(o)?null:this.parent.currentViewData[o],i=t.isNullOrUndefined(i)?this.parent.editSettings.newRowPosition:i,e=t.isNullOrUndefined(e)?this.parent.editModule.dialogModule.composeAddRecord():e,((t.isNullOrUndefined(o)||o<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,l=0,d={},p=void 0;switch(i){case"Top":case"Bottom":l=0;break;case"Above":case"Below":l=this.addRowSelectedItem.level,p=this.parent.getParentTask(this.addRowSelectedItem.parentItem);break;case"Child":l=this.addRowSelectedItem.level+1,p=this.addRowSelectedItem}this.prepareNewlyAddedData(e,i),s=this.updateNewlyAddedDataBeforeAjax(e,l,i,p),d=this.constructTaskAddedEventArgs(s,this.parent.editedRecords,"beforeAdd"),this.parent.showSpinner();var h={};if(t.isBlazor()){if(!Array.isArray(d.data)){var c=[];c.push(d.data),t.setValue("data",c,d)}h=Xt({},d)}this.parent.trigger("actionBegin",d,function(e){if(e.cancel)e=t.isBlazor()?h:e,a.removeAddedRecord(),a.reUpdatePreviousRecords(),a.dialogModule.dialog&&!a.dialogModule.dialogObj.isDestroyed&&a.dialogModule.dialogObj.hide(),a.dialogModule.dialogClose(),a._resetProperties();else if(t.isBlazor()&&(h.data=h.data[0],e=h,a._resetProperties()),y(a.parent.dataSource)){var r=a.parent.dataSource,o={addedRecords:[e.newTaskData],changedRecords:e.modifiedTaskData},l=e.data.ganttProperties.taskId.toString(),d=a.parent.query instanceof n.Query?a.parent.query:new n.Query;r.saveChanges(o,a.parent.taskFields.id,null,d).then(function(i){if(a.parent.taskFields.id&&!t.isNullOrUndefined(i.addedRecords[0][a.parent.taskFields.id])&&i.addedRecords[0][a.parent.taskFields.id].toString()!==l){a.parent.setRecordValue("taskId",i.addedRecords[0][a.parent.taskFields.id],e.data.ganttProperties,!0),a.parent.setRecordValue("taskData."+a.parent.taskFields.id,i.addedRecords[0][a.parent.taskFields.id],e.data),a.parent.setRecordValue(a.parent.taskFields.id,i.addedRecords[0][a.parent.taskFields.id],e.data),a.parent.setRecordValue("rowUniqueID",i.addedRecords[0][a.parent.taskFields.id].toString(),e.data.ganttProperties,!0);var r=a.parent.ids.indexOf(l);-1!==r&&(a.parent.ids[r]=i.addedRecords[0][a.parent.taskFields.id].toString())}0===s.level&&a.parent.treeGrid.parentData.splice(0,0,s),a.updateTreeGridUniqueID(s,"add"),a.refreshNewlyAddedRecord(e,s),a._resetProperties()}).catch(function(t){a.removeAddedRecord(),a.dmFailure(t,e),a._resetProperties()})}else a.updateRealDataSource(e.data,i),0===s.level&&a.parent.treeGrid.parentData.splice(0,0,s),a.updateTreeGridUniqueID(s,"add"),a.refreshNewlyAddedRecord(e,s),a._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.push(e.data),r.push.apply(r,e.modifiedRecords)):r=[e.data],this.parent.timelineModule.updateTimeLineOnEditing(r,e.action)}if(this.addSuccess(e),e=this.constructTaskAddedEventArgs(i,e.modifiedRecords,"add"),t.isBlazor()&&this.parent.updateDataArgs(e),this.parent.trigger("actionComplete",e),this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose(),"ResourceView"===this.parent.viewType){if(e.data.ganttProperties.sharedTaskUniqueIds.push(e.data.ganttProperties.rowUniqueID),e.data.ganttProperties.resourceInfo.length){if(e.data.ganttProperties.resourceInfo.length>1){var n=t.extend([],[],e.data.ganttProperties.resourceInfo,!0);n.splice(0,1),this.updateResoures([],n,e.data)}}else this.removeChildRecord(e.data),this.parent.editModule.checkWithUnassignedTask(e.data);for(var a=0;a<this.updateParentRecords.length;a++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[a]);this.updateParentRecords=[]}},e.prototype.removeAddedRecord=function(){var e=this.parent.flatData,i=this.parent.currentViewData,r=this.parent.ids,n=e.indexOf(this.newlyAddedRecordBackup),a=i.indexOf(this.newlyAddedRecordBackup),o=r.indexOf(this.newlyAddedRecordBackup.ganttProperties.rowUniqueID.toString());if(t.deleteObject(this.parent.previousRecords,e[n].uniqueID),this.newlyAddedRecordBackup.parentItem){var s=this.parent.getParentTask(this.newlyAddedRecordBackup.parentItem),l=s.childRecords.indexOf(this.newlyAddedRecordBackup);s.childRecords.splice(l,1)}e.splice(n,1),i.splice(a,1),r.splice(o,1)},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.currentViewData[this.parent.selectionModule.getSelectedRowIndexes()[0]-1];if(this.parent.editSettings.allowEditing&&0!==t&&-1!==t&&i&&"ResourceView"!==this.parent.viewType&&this.parent.currentViewData[t].level-r.level!=1){if(r.level>this.parent.selectionModule.getSelectedRecords()[0].level)for(var n=this.parent.getTaskByUniqueID(r.parentItem.uniqueID),a=0;a<this.parent.currentViewData.length;a++)this.parent.currentViewData[a].taskData===n.taskData&&(e=a);else e=this.parent.selectionModule.getSelectedRowIndexes()[0]-1;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.currentViewData[t].level){for(var r=this.parent.getTaskByUniqueID(this.parent.selectionModule.getSelectedRecords()[0].parentItem.uniqueID),n=0;n<this.parent.currentViewData.length;n++)this.parent.currentViewData[n].taskData===r.taskData&&(e=n);this.indentOutdentRow([t],e,"below")}},e.prototype.indentOutdentRow=function(e,t,i){var r=this;e[0],"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var n=void 0,a=[],o=0;o<e.length;o++)a[o]=this.parent.currentViewData[e[o]];var s={data:a,dropIndex:t,dropPosition:this.dropPosition};"middleSegment"===this.dropPosition?n="indenting":"bottomSegment"===this.dropPosition&&(n="outdenting");var l={action:n,data:a[0],cancel:!1};this.parent.trigger("actionBegin",l,function(e){e.cancel||r.reArrangeRows(s,!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,a=void 0;this.droppedRecord=r.currentViewData[e.dropIndex];var o=[];a=this.droppedRecord,e.data[0]?o=e.data:o.push(e.data);for(var s=0,l=o.length,d=0;d<l;d++){if(this.parent.isOnEdit=!0,n=o[d],this.draggedRecord=n,"Invalid"!==this.dropPosition){i&&this.deleteDragRow();var p=this.treeGridData.indexOf(a);if("bottomSegment"===this.dropPosition){if(a.hasChildRecords?(s=this.parent.editModule.getChildCount(a,0),this.parent.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(p+s+1,0,this.draggedRecord.taskData),this.treeGridData.splice(p+s+1,0,this.draggedRecord)):(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)),n.parentItem=this.treeGridData[p].parentItem,n.parentUniqueID=this.treeGridData[p].parentUniqueID,n.level=this.treeGridData[p].level,n.hasChildRecords){this.updateChildRecordLevel(n,1),this.updateChildRecord(n,p+s+1)}if(a.parentItem){var h=this.parent.getParentTask(a.parentItem).childRecords,c=h.indexOf(a)+1;h.splice(c,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 u=this.parent.treeGrid.parentData,g=u.indexOf(this.droppedRecord);"bottomSegment"===this.dropPosition&&u.splice(g+1,0,n)}this.refreshDataSource()}"middleSegment"===this.dropPosition&&(a.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(a),a.ganttProperties.predecessor=null,a.ganttProperties.predecessorsName=null,a[this.parent.taskFields.dependency]=null,a.taskData[this.parent.taskFields.dependency]=null),a.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,a.ganttProperties,!0),t.isNullOrUndefined(a.taskData[this.parent.taskFields.milestone])||!0===a.taskData[this.parent.taskFields.milestone]&&(a.taskData[this.parent.taskFields.milestone]=!1)));for(var f=0;f<this.updateParentRecords.length;f++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[f]);this.updateParentRecords=[],this.parent.isOnEdit=!1}this.parent.treeGrid.refresh(),"middleSegment"===this.dropPosition?e.requestType="indented":"bottomSegment"===this.dropPosition&&(e.requestType="outdented"),e.modifiedRecords=this.parent.editedRecords,this.parent.trigger("actionComplete",e),this.parent.editedRecords=[]},e.prototype.refreshDataSource=function(){var e,i,r=this.draggedRecord,a=this.droppedRecord,o=this.parent;if((e=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):o.dataSource).length>0&&!t.isNullOrUndefined(a)&&!a.parentItem){for(var s=0;s<Object.keys(e).length;s++)e[s][this.parent.taskFields.child]===a.taskData[this.parent.taskFields.child]&&(i=s);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(i,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(i+1,0,r.taskData))}else if(!this.parent.taskFields.parentID&&!t.isNullOrUndefined(a)&&a.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var l="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=a,this.parent.editModule.updateRealDataSource(r,l),delete this.parent.editModule.addRowSelectedItem}this.parent.taskFields.parentID&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID],r.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID]):(r[this.parent.taskFields.parentID]=a[this.parent.taskFields.id],r.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.id]):(r[this.parent.taskFields.parentID]=null,r.taskData[this.parent.taskFields.parentID]=null))},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof n.DataManager?this.ganttData=t.getValue("dataOperation.dataArray",this.parent):this.ganttData=this.parent.dataSource,this.treeGridData=this.parent.treeGrid.dataSource;var e;e=this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID),this.removeRecords(e)},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;"middleSegment"===this.dropPosition&&(i.taskFields.parentID&&this.ganttData.length>0&&this.ganttData.splice(n,0,this.draggedRecord.taskData),this.treeGridData.splice(n,0,this.draggedRecord),this.recordLevel(),this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,n,this.droppedRecord.expanded),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;e.parentItem&&(a=this.parent.getParentTask(e.parentItem)),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 o=0;o<a;o++)r=e.childRecords[o],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,o=this.parent.getParentTask(a.parentItem);if(a){if(a.parentItem){var s=o?o.childRecords:[],l=0;s&&s.length>0&&(l=s.indexOf(a),o.childRecords.splice(l,1),this.parent.taskFields.parentID||o.taskData[this.parent.taskFields.child].splice(l,1),this.updateParentRecords.push(o))}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);-1!==d&&(i.length>0&&i.splice(d,1),this.treeGridData.splice(d,1),-1!==this.parent.treeGrid.parentData.indexOf(a)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(a),1))}var c=this.treeGridData.indexOf(a);if(!r.taskFields.parentID){var u=this.getChildCount(a,0);this.treeGridData.splice(c,u+1);var g=this.ganttData.indexOf(a.taskData);-1!==g&&(this.ganttData.splice(g,1),this.parent.treeGrid.parentData.splice(g,1))}a.parentItem&&o&&o.childRecords&&!o.childRecords.length&&(o.expanded=!1,o.hasChildRecords=!1)}},e.prototype.removeChildItem=function(e){this.parent;for(var i,r,a=0;a<e.childRecords.length;a++){i=e.childRecords[a];var o=void 0;o=this.parent.dataSource instanceof n.DataManager?t.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource;for(var s=0;s<o.length;s++)o[s][this.parent.taskFields.id]===i.taskData[this.parent.taskFields.id]&&(r=s);-1!==r&&(o.length>0&&o.splice(r,1),this.treeGridData.splice(r,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 o={uniqueID:a.uniqueID,expanded:a.expanded,level:a.level,index:a.index,taskId:a.ganttProperties.rowUniqueID};if(i.parentItem=o,i.parentUniqueID=r.uniqueID,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.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e}(),Kt=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}(),Qt=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}(),Jt=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.Filter),this.parent.treeGrid.allowFiltering=this.parent.allowFiltering,this.updateCustomFilters(),this.parent.treeGrid.filterSettings=r.getActualProperties(this.parent.filterSettings),this.addEventListener()}return e.prototype.getModuleName=function(){return"filter"},e.prototype.updateCustomFilters=function(){for(var e=this.parent.taskFields,t=0;t<this.parent.ganttColumns.length;t++){var i=this.parent.ganttColumns[t];("datepickeredit"!==i.editType&&"datetimepickeredit"!==i.editType||i.field!==e.startDate&&i.field!==e.endDate&&i.field!==e.baselineStartDate&&i.field!==e.baselineEndDate)&&(i.field!==e.duration||"stringedit"!==i.editType)||this.initiateFiltering(this.parent.ganttColumns[t])}},e.prototype.updateModel=function(){this.parent.filterSettings=this.parent.treeGrid.filterSettings},e.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("actionBegin",this.actionBegin,this),this.parent.on("actionComplete",this.actionComplete,this),this.parent.on("columnMenuOpen",this.columnMenuOpen,this)},e.prototype.initiateFiltering=function(e){var t=this.parent.getColumnByField(e.field,this.parent.treeGridModule.treeGridColumns);e.allowFiltering=!1!==e.allowFiltering,e.allowFiltering&&"Menu"===this.parent.filterSettings.type&&!e.filter&&(e.filter={ui:this.getCustomFilterUi(e)}),t&&(t.allowFiltering=e.allowFiltering,t.filter=e.filter)},e.prototype.getCustomFilterUi=function(e){var t=this.parent.taskFields,i={};return"datepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?"datetimepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?e.field===t.duration&&"stringedit"===e.editType&&(i=this.getDurationFilter()):i=this.getDateTimePickerFilter():i=this.getDatePickerFilter(e.field),i},e.prototype.getDatePickerFilter=function(e){var i,r=this,n=this.parent,a=e===n.taskFields.startDate||e===n.taskFields.baselineStartDate?n.defaultStartTime:n.defaultEndTime;return{create:function(e){var n=t.createElement("input",{className:"flm-input"});e.target.appendChild(n),(i=new h.DatePicker({placeholder:r.parent.localeObj.getConstant("enterValue")})).appendTo(n)},write:function(e){i.value=e.filteredValue},read:function(e){i.value&&i.value.setSeconds(a),e.fltrObj.filterByColumn(e.column.field,e.operator,i.value)}}},e.prototype.getDateTimePickerFilter=function(){var e,i=this;return{create:function(r){var n=t.createElement("input",{className:"flm-input"});r.target.appendChild(n),(e=new h.DateTimePicker({placeholder:i.parent.localeObj.getConstant("enterValue")})).appendTo(n)},write:function(t){e.value=t.filteredValue},read:function(t){t.fltrObj.filterByColumn(t.column.field,t.operator,e.value)}}},e.prototype.getDurationFilter=function(){var e,i=this,r=this.parent,n="";return{create:function(r){var n=t.createElement("input",{className:"e-input"});n.setAttribute("placeholder",i.parent.localeObj.getConstant("enterValue")),r.target.appendChild(n),(e=new d.TextBox).appendTo(n)},write:function(t){e.value=t.filteredValue?n:""},read:function(a){var o=i.parent.dataOperation.getDurationValue(e.value),s=t.getValue("duration",o),l=t.getValue("durationUnit",o);if(s>=0){var d=void 0;"minute"===l?d=60*s/r.secondsPerDay:"hour"===l?d=60*s*60/r.secondsPerDay:(d=s,l="day"),a.fltrObj.filterByColumn(a.column.field,a.operator,d),n=i.parent.dataOperation.getDurationString(s,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){this.filterMenuElement&&document.body.contains(this.filterMenuElement)&&(this.filterMenuElement.contains(e)||(t.remove(this.filterMenuElement),this.parent.treeGrid.grid.notify("filter-menu-close",{isOpen:!1}),this.filterMenuElement=null))},e.prototype.actionComplete=function(e){if(e.requestType===r.filterAfterOpen){this.filterMenuElement=t.getValue("filterModel.dlgObj.element",e),this.updateFilterMenuPosition(this.filterMenuElement,e);var i=this.parent.taskFields.id,n=this.parent.taskFields.dependency,a=this.parent.taskFields.resourceInfo,o=this.parent.treeGrid.grid.filterModule,s=t.getValue("values",o);if(e.columnName===n&&t.isNullOrUndefined(t.getValue(n,s))||e.columnName===a&&t.isNullOrUndefined(t.getValue(a,s))){var l=this.filterMenuElement.querySelector(".e-dropdownlist");(d=t.getValue("ej2_instances[0]",l)).index=2,d.dataBind()}else if(e.columnName===i&&t.isNullOrUndefined(t.getValue(i,s))){l=this.filterMenuElement.querySelector(".e-numerictextbox");var d=t.getValue("ej2_instances[0]",l);!t.isNullOrUndefined(d)&&t.isNullOrUndefined(this.parent.columnByField[e.columnName].format)&&(d.format="n")}}},e.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),r=e.getBoundingClientRect(),n=r.right+window.scrollX,a=r.top+window.scrollY;i.right<n+t.offsetWidth&&(r.left-t.offsetWidth>i.left?n=r.left-t.offsetWidth:n-=n+t.offsetWidth-i.right),t.style.top=a+"px",t.style.left=n+"px"},e.prototype.updateFilterMenuPosition=function(e,i){t.addClass([e],"e-gantt"),document.body.appendChild(e);var n;this.parent.showColumnMenu?(n=document.querySelector("#treeGrid"+this.parent.controlId+"_gridcontrol_colmenu_Filter"),e.style.zIndex=n.parentElement.style.zIndex,this.setPosition(n,t.getValue("filterModel.dlgObj.element",i))):(n=this.parent.treeGrid.grid.getColumnHeaderByField(i.columnName).querySelector(".e-filtermenudiv"),r.getFilterMenuPostion(n,t.getValue("filterModel.dlgObj",i),this.parent.treeGrid.grid)),e.querySelector(".e-valid-input").focus()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("actionBegin",this.actionBegin),this.parent.off("actionComplete",this.actionComplete),this.parent.off("columnMenuOpen",this.columnMenuOpen))},e.prototype.destroy=function(){this.removeEventListener()},e}(),$t=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}(),ei=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.selectRow(-1!==this.parent.staticSelectedRowIndex?this.parent.staticSelectedRowIndex:this.parent.selectedRowIndex),this.parent.staticSelectedRowIndex=-1)},e.prototype.bindEvents=function(){this.parent.treeGrid.rowSelecting=this.rowSelecting.bind(this),this.parent.treeGrid.rowSelected=this.rowSelected.bind(this),this.parent.treeGrid.rowDeselecting=this.rowDeselecting.bind(this),this.parent.treeGrid.rowDeselected=this.rowDeselected.bind(this),this.parent.treeGrid.cellSelecting=this.cellSelecting.bind(this),this.parent.treeGrid.cellSelected=this.cellSelected.bind(this),this.parent.treeGrid.cellDeselecting=this.cellDeselecting.bind(this),this.parent.treeGrid.cellDeselected=this.cellDeselected.bind(this)},e.prototype.rowSelecting=function(e){this.parent.isGanttChartRendered?(e.isCtrlPressed=this.isMultiCtrlRequest,e.isShiftPressed=this.isMultiShiftRequest,e.target=this.actualTarget,t.isNullOrUndefined(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.parent.trigger("rowSelecting",e)):e.cancel=!0},e.prototype.rowSelected=function(e){var i="Multiple"!==this.parent.selectionSettings.type||t.isNullOrUndefined(e.rowIndexes)?[e.rowIndex]:e.rowIndexes;this.addClass(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,t.isBlazor()&&"Multiple"===this.parent.selectionSettings.type&&(this.multipleIndexes=t.extend([],e.rowIndex,[],!0)),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.removeClass(i),this.selectedRowIndexes=t.extend([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:-1},!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=this.parent.getRowByIndex(e);-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 t.isBlazor()?this.parent.getRecordFromFlatdata(this.parent.treeGrid.getSelectedRecords()):this.parent.treeGrid.getSelectedRecords()},e.prototype.getCellSelectedRecords=function(){for(var e=this.parent.selectionModule.getSelectedRowCellIndexes(),i=[],r=0;r<e.length;r++)i.push(this.parent.currentViewData[e[r].rowIndex]);return t.isBlazor()?this.parent.getRecordFromFlatdata(i):i},e.prototype.getSelectedRows=function(){return this.parent.treeGrid.getSelectedRows()},e.prototype.clearSelection=function(){this.removeClass(this.selectedRowIndexes),this.parent.treeGrid.clearSelection(),this.parent.selectedRowIndex=-1,this.selectedRowIndexes=[],t.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.isInteracted=!1},e.prototype.highlightSelectedRows=function(e,i){var r=t.closest(e.target,"tbody").children,n=t.closest(e.target,"tr.e-chart-row"),a=[].slice.call(r).indexOf(n);this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch,this.isMultiShiftRequest=e.shiftKey,this.actualTarget=e.target,this.isInteracted=!0,this.isSelectionFromChart=i;var o=this.parent.selectionSettings.enableToggle;i&&("Single"===this.parent.selectionSettings.type||!this.isMultiCtrlRequest&&!this.isMultiShiftRequest?this.selectRow(a,o):this.isMultiShiftRequest?this.selectRowsByRange(t.isNullOrUndefined(this.prevRowIndex)?a:this.prevRowIndex,a):(t.setValue("isMultiCtrlRequest",!0,this.parent.treeGrid.grid.selectionModule),this.parent.treeGrid.grid.selectionModule.addRowsToSelection([a])))},e.prototype.getselectedrowsIndex=function(e,t){for(var i=[],r=e<t?{i:e,max:t}:{i:t,max:e},n=r.i,a=r.max;n<=a;n++)i.push(n);e>t&&i.reverse(),this.selectedRowIndexes=i},e.prototype.selectRowsByRange=function(e,t){this.isSelectionFromChart=!0,this.getselectedrowsIndex(e,t),this.selectRows(this.selectedRowIndexes)},e.prototype.addClass=function(e){for(var i=document.getElementById(this.parent.element.id+"GanttTaskTableBody").children,r=0;r<e.length;r++)t.isNullOrUndefined(i[e[r]])||(t.addClass([i[e[r]]],"e-active"),i[e[r]].setAttribute("aria-selected","true"))},e.prototype.removeClass=function(e){if(!this.parent.selectionSettings.persistSelection)for(var i=document.getElementById(this.parent.element.id+"GanttTaskTableBody").children,r=t.isNullOrUndefined(e.length)?[e]:e,n=0;n<r.length;n++)t.removeClass([i[r[n]]],"e-active"),i[r[n]].removeAttribute("aria-selected")},e.prototype.showPopup=function(e){this.isSelectionFromChart?(r.setCssInGridPopUp(this.parent.element.querySelector(".e-ganttpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(this.enableSelectMultiTouch&&(this.getSelectedRecords().length>1||this.getSelectedRowCellIndexes().length>1)?" e-spanclicked":"")),document.getElementsByClassName("e-gridpopup")[0].style.display="none",this.openPopup=!0):0===this.selectedRowIndexes.length&&this.hidePopUp()},e.prototype.hidePopUp=function(){this.openPopup?(document.getElementsByClassName("e-ganttpopup")[0].style.display="none",this.openPopup=!1):document.getElementsByClassName("e-gridpopup")[0].style.display="none"},e.prototype.popUpClickHandler=function(e){var i=e.target,r=this.parent.treeGrid.grid,n=t.closest(i,".e-ganttpopup")?t.closest(i,".e-ganttpopup"):t.closest(i,".e-gridpopup");if(n){var a=n.querySelector(".e-rowselect");t.closest(i,".e-ganttpopup")&&!a.classList.contains("e-spanclicked")?(this.enableSelectMultiTouch=!0,a.classList.add("e-spanclicked")):t.closest(i,".e-gridpopup")&&a.classList.contains("e-spanclicked")?(this.openPopup=!0,this.enableSelectMultiTouch=!0):(this.hidePopUp(),this.enableSelectMultiTouch=!1,t.closest(i,".e-ganttpopup")&&a.classList.remove("e-spanclicked"))}else if("Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive){t.closest(i,".e-rowcell")&&0===this.selectedRowIndexes.length&&this.hidePopUp()}r&&t.setValue("enableSelectMultiTouch",this.enableSelectMultiTouch,r.selectionModule)},e.prototype.mouseUpHandler=function(e){var i=!1,n=null;if(e.target.closest(".e-rowcell")?n=e.target:e.target.closest(".e-chart-row")&&(n=e.target.closest(".e-left-label-container")||e.target.closest(".e-taskbar-main-container")||e.target.closest(".e-right-label-container")),this.parent.focusModule&&this.parent.focusModule.setActiveElement(n),this.parent.editModule&&this.parent.editSettings.allowTaskbarEditing&&this.parent.editModule.taskbarEditModule){var a=this.parent.editModule.taskbarEditModule;(a.isMouseDragged||a.tapPointOnFocus)&&(i=!0)}if(!i&&this.parent.element.contains(e.target)){var o=r.parentsUntil(e.target,"e-chart-row"),s=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(o);this.popUpClickHandler(e),"Cell"!==this.parent.selectionSettings.mode&&s?(t.closest(e.target,"tr.e-chart-row")?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.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}(),ti=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"],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"];e<i.length;e++){var r=i[e],n=r.toLowerCase(),a=r[0].toLowerCase()+r.slice(1);this.predefinedItems[r]={id:this.parent.element.id+"_"+n,prefixIcon:"e-"+n,text:this.parent.isAdaptive?"":this.parent.localeObj.getConstant(a),tooltipText:this.parent.localeObj.getConstant(a)+("add"===a||"edit"===a||"delete"===a?this.parent.localeObj.getConstant("task"):"expandAll"===a||"collapseAll"===a?this.parent.localeObj.getConstant("tasks"):""),align:this.parent.isAdaptive?"Right":"Left"}}var o=this.parent.localeObj.getConstant("search");this.parent.isAdaptive?this.predefinedItems.Search={id:this.id+"_searchbutton",prefixIcon:"e-search-icon",tooltipText:o,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= "'+o+'"/>                <span id="'+this.id+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"                 tabindex="-1" title="'+o+'" aria-label= "search"></span>                 </div>',tooltipText:o,align:"Right",cssClass:"e-search-wrapper"},this.createToolbar()}},e.prototype.createToolbar=function(){var e=this.getItems();this.toolbar=new s.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),height:this.parent.isAdaptive?48:"auto"}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.element);var i=this.element.querySelector("#"+this.parent.element.id+"_cancel"),r=this.element.querySelector("#"+this.parent.element.id+"_update");if(i&&t.addClass([i],"e-grid"),r&&t.addClass([r],"e-grid"),this.parent.isAdaptive){this.element.insertBefore(this.getSearchBarElement(),this.element.childNodes[0]),this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar");new d.TextBox({placeholder:this.parent.localeObj.getConstant("search"),floatLabelType:"Never",showClearButton:!0}).appendTo(this.searchElement)}else this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar");this.parent.filterModule&&(this.wireEvent(),this.parent.searchSettings&&this.updateSearchTextBox()),this.parent.readOnly&&this.enableItems([this.parent.element.id+"_add",this.parent.element.id+"_update",this.parent.element.id+"_delete",this.parent.element.id+"_cancel",this.parent.element.id+"_indent",this.parent.element.id+"_outdent"],!1)},e.prototype.getSearchBarElement=function(){var e=this,i=t.createElement("div",{className:"e-adaptive-searchbar",styles:"display: none"}),r=t.createElement("input",{attrs:{type:"text"},id:this.parent.element.id+"_searchbar"}),n=t.createElement("span",{className:"e-backarrowspan e-icons"});return n.onclick=function(){i.style.display="none",e.element.childNodes[1].style.display="block"},i.appendChild(n),i.appendChild(r),i},e.prototype.wireEvent=function(){this.searchElement&&(t.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.searchElement,"focus",this.focusHandler,this),t.EventHandler.add(this.searchElement,"blur",this.blurHandler,this))},e.prototype.propertyChanged=function(e){t.getValue("module",e)===this.getModuleName()&&this.parent.toolbar&&(this.element&&this.element.parentNode&&t.remove(this.element),this.renderToolbar(),this.refreshToolbarItems())},e.prototype.unWireEvent=function(){this.searchElement&&(t.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),t.EventHandler.remove(this.searchElement,"focus",this.focusHandler),t.EventHandler.remove(this.searchElement,"blur",this.blurHandler),this.searchElement=null),this.parent.off("ui-toolbarupdate",this.propertyChanged)},e.prototype.keyUpHandler=function(e){13===e.keyCode&&this.parent.searchSettings.key!==this.searchElement.value&&(this.parent.searchSettings.key=this.searchElement.value,this.parent.dataBind())},e.prototype.focusHandler=function(e){e.target.parentElement.classList.add("e-input-focus")},e.prototype.blurHandler=function(e){e.target.parentElement.classList.remove("e-input-focus")},e.prototype.updateSearchTextBox=function(){this.searchElement&&this.searchElement.value!==this.parent.searchSettings.key&&(this.searchElement.value=this.parent.searchSettings.key)},e.prototype.getItems=function(){var e=[],t=this.parent.toolbar,i=-1;if(t.forEach(function(e,t){("string"==typeof e&&"Search"===e||"object"==typeof e&&"Search"===e.text)&&(i=t)}),i>-1){var r=t.splice(i,1);t.push(r[0])}for(var n=0,a=t;n<a.length;n++){var o=a[n];switch(typeof o){case"string":e.push(this.getItemObject(o));break;default:e.push(this.getItem(o))}}return e},e.prototype.getItem=function(e){var i=this.predefinedItems[e.text];return i?t.extend(i,i,e):e},e.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.id+"_"+e}},e.prototype.toolbarClickHandler=function(e){var i=this,r=this.parent,n=this.id;t.extend(e,{cancel:!1}),r.trigger("toolbarClick",e,function(e){if(!e.cancel)switch(!0===i.parent.isAdaptive&&(e.item.id!==n+"_edit"&&e.item.id!==n+"_add"&&e.item.id!==n+"_delete"&&e.item.id!==n+"_searchbutton"&&e.item.id!==n+"_expandall"&&e.item.id!==n+"_collapseall"||i.parent.selectionModule&&"Multiple"===i.parent.selectionSettings.type&&(i.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),!t.isNullOrUndefined(e.item)&&e.item.id){case n+"_edit":r.editModule&&r.editSettings.allowEditing&&r.editModule.dialogModule.openToolbarEditDialog();break;case n+"_indent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.indent();break;case n+"_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 o=i.element.querySelector(".e-adaptive-searchbar");o.parentElement.childNodes[1].style.display="none",o.style.display="block";break;case n+"_expandall":i.parent.ganttChartModule.expandCollapseAll("expand");break;case n+"_collapseall":i.parent.ganttChartModule.expandCollapseAll("collapse");break;case n+"_prevtimespan":i.parent.previousTimeSpan();break;case n+"_nexttimespan":i.parent.nextTimeSpan();break;case n+"_zoomin":i.zoomIn();break;case n+"_zoomout":i.zoomOut();break;case n+"_zoomtofit":i.zoomToFit()}})},e.prototype.zoomIn=function(){this.parent.timelineModule.processZooming(!0)},e.prototype.zoomToFit=function(){this.parent.timelineModule.processZoomToFit(),this.parent.ganttChartModule.updateScrollLeft(0)},e.prototype.zoomOut=function(){this.parent.timelineModule.processZooming(!1)},e.prototype.refreshToolbarItems=function(e){var i,r=this.parent,n=[],a=[],o=r.editSettings,s=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=[s+"_add",s+"_edit",s+"_delete",s+"_update",s+"_cancel",s+"_indent",s+"_outdent"],c="ResourceView"===this.parent.viewType&&0!==t.getValue("data.level",e)||"ProjectView"===this.parent.viewType;if(t.isNullOrUndefined(this.parent.editModule))a.push(s+"_delete"),a.push(s+"_add"),a.push(s+"_edit"),a.push(s+"_update"),a.push(s+"_cancel");else{var u=!!r.editModule.taskbarEditModule&&r.editModule.taskbarEditModule.touchEdit,g=r.currentViewData&&r.currentViewData.length;o.allowAdding&&!u?n.push(s+"_add"):a.push(s+"_add"),o.allowEditing&&c&&g&&d&&!u?n.push(s+"_edit"):a.push(s+"_edit"),o.allowEditing&&0!==l&&-1!==l&&g&&d&&"ResourceView"!==this.parent.viewType?0===r.currentViewData[l].level&&g&&!u?(n.push(s+"_indent"),a.push(s+"_outdent")):(i=r.currentViewData[l-1],r.currentViewData[l].level-i.level==1&&-1!==l?(a.push(s+"_indent"),n.push(s+"_outdent")):-1!==l&&(n.push(s+"_indent"),n.push(s+"_outdent"))):(a.push(s+"_indent"),a.push(s+"_outdent"));var f=!!r.selectionModule&&(r.selectionModule.selectedRowIndexes.length>0||r.selectionModule.getSelectedRowCellIndexes().length>0);if(o.allowDeleting&&c&&g&&f&&!u?n.push(s+"_delete"):a.push(s+"_delete"),"Auto"===r.editSettings.mode&&!t.isNullOrUndefined(r.editModule.cellEditModule)&&r.editModule.cellEditModule.isCellEdit){(n=[]).push(s+"_update",s+"_cancel"),a=[];for(var m=0;m<p.length;m++)p[m].id!==s+"_update"&&p[m].id!==s+"_cancel"&&-1!==h.indexOf(p[m].id)&&a.push(p[m].id)}else{a.push(s+"_update",s+"_cancel");for(m=0;m<p.length;m++)-1===n.indexOf(p[m].id)&&-1===a.indexOf(p[m].id)&&n.push(p[m].id)}}for(var y=0;y<n.length;y++){var v=void 0;for(m=0;m<p.length;m++)if(p[m].id===n[y]){v=m;break}p.length>0&&this.toolbar.hideItem(v,!1)}for(var w=0;w<a.length;w++){for(v=void 0,m=0;m<p.length;m++)if(p[m].id===a[w]){v=m;break}p.length>0&&this.toolbar.hideItem(v,!0)}},e.prototype.enableItems=function(e,t){for(var i=0,r=e;i<r.length;i++){var n=r[i],a=this.element.querySelector("#"+n);a&&this.toolbar.enableItems(a.parentElement,t)}},e.prototype.destroy=function(){this.parent.isDestroyed||(this.toolbar.destroy(),this.parent.filterModule&&this.unWireEvent(),t.remove(this.element))},e}(),ii=function(){function e(e){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&&(t.remove(this.holidayContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&t.remove(this.nonworkingContainer))},e.prototype.getHolidaysElement=function(){for(var e,i,r=t.createElement("div"),n=this.parent.contentHeight,a=this.parent.ganttChartModule.scrollElement,o=parseInt(a.style.height,10),s=0;s<this.parent.holidays.length;s++){this.parent.holidays[s].from&&this.parent.holidays[s].to?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[s].from),(i=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[s].to)).setDate(i.getDate()+1),e.setHours(0,0,0,0),i.setHours(0,0,0,0)):this.parent.holidays[s].from?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[s].from)).setHours(0,0,0,0):this.parent.holidays[s].to&&(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[s].to)).setHours(0,0,0,0);var l=this.parent.holidays[s].from&&this.parent.holidays[s].to?this.parent.dataOperation.getTaskWidth(e,i):this.parent.perDayWidth,d=this.parent.dataOperation.getTaskLeft(e,!1),p=t.createElement("div",{className:"e-holiday",styles:"left:"+d+"px; width:"+l+"px; height:100%;"}),h=o<n?o/2:n/2,c=t.createElement("span",{className:"e-span",styles:"top:"+h+"px;left:"+l/2+"px;"});c[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=this.parent.holidays[s].label?this.parent.holidays[s].label:"",p.appendChild(c),this.parent.holidays[s].cssClass&&p.classList.add(this.parent.holidays[s].cssClass),r.appendChild(p)}return r},e.prototype.renderWeekends=function(){this.parent.highlightWeekends?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.weekendContainer)||(this.weekendContainer=t.createElement("div",{className:"e-weekend-container"}),this.nonworkingContainer.appendChild(this.weekendContainer)),this.weekendContainer.innerHTML=this.getWeekendElements().innerHTML):this.weekendContainer&&(t.remove(this.weekendContainer),this.nonworkingContainer&&0===this.nonworkingContainer.childNodes.length&&t.remove(this.nonworkingContainer))},e.prototype.getWeekendElements=function(){var e=t.createElement("div"),i=new Date(this.parent.timelineModule.timelineStartDate.getTime()),r=new Date(this.parent.timelineModule.timelineEndDate.getTime()),n=this.parent.nonWorkingDayIndex,a=!0;do{if(-1!==n.indexOf(i.getDay())){var o=this.parent.dataOperation.getTaskLeft(i,!1),s=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),s=this.parent.dataOperation.getTaskWidth(l,d),a=!1}var p=t.createElement("div",{className:"e-weekend",styles:"left:"+o+"px;width:"+s+"px;height:100%;"});e.appendChild(p)}i.setDate(i.getDate()+1),i.setHours(0,0,0,0)}while(i<r);return e},e.prototype.updateHolidayLabelHeight=function(){for(var e=this.parent.contentHeight,i=this.parent.ganttChartModule.scrollElement,r=parseInt(i.style.height,10),n=r<e?r/2:e/2,a=this.holidayContainer.querySelectorAll(".e-span"),o=0;o<a.length;o++)a[o].style.top=t.formatUnit(n)},e.prototype.updateContainerHeight=function(){this.holidayContainer&&(this.holidayContainer.style.height=t.formatUnit(this.parent.contentHeight),this.updateHolidayLabelHeight()),this.weekendContainer&&(this.weekendContainer.style.height=t.formatUnit(this.parent.contentHeight))},e.prototype.removeContainers=function(){this.holidayContainer&&t.remove(this.holidayContainer),this.weekendContainer&&t.remove(this.weekendContainer),this.nonworkingContainer&&t.remove(this.nonworkingContainer)},e}(),ri=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.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,o=0;o<this.parent.eventMarkers.length;o++){if(i=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(this.parent.eventMarkers[o].day,!0),!1),r=t.createElement("div",{className:"e-event-markers",styles:"left:"+i+"px;  height:100%;",id:"stripline"+o}),this.parent.eventMarkers[o].label){(n=t.createElement("div",{className:"e-span-label"}))[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=this.parent.eventMarkers[o].label,r.appendChild(n),a=t.createElement("div",{className:"e-gantt-right-arrow"}),r.appendChild(a)}this.parent.eventMarkers[o].cssClass&&r.classList.add(this.parent.eventMarkers[o].cssClass),r.setAttribute("tabindex","-1"),t.isNullOrUndefined(this.parent.eventMarkers[o].day)||r.setAttribute("aria-label",this.parent.localeObj.getConstant("eventMarkers")+" "+("string"==typeof this.parent.eventMarkers[o].day?this.parent.eventMarkers[o].day:this.parent.getFormatedDate(this.parent.eventMarkers[o].day))+" "+this.parent.eventMarkers[o].label),e.appendChild(r)}},e.prototype.updateContainerHeight=function(){this.eventMarkersContainer&&(this.eventMarkersContainer.style.height=t.formatUnit(this.parent.contentHeight))},e}(),ni=function(){function e(e){this.parent=e,this.nonworkingDayRender=new ii(this.parent),this.eventMarkerRender=new ri(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}(),ai=function(){function e(e){var i=this;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 s.ContextMenu({items:this.getMenuItems(),locale:this.parent.locale,target:e,animationSettings:{effect:"None"},select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-gantt"}),this.contextMenu.appendTo(this.element),this.parent.treeGrid.contextMenuItems=this.headerMenuItems},e.prototype.contextMenuItemClick=function(e){this.item=this.getKeyFromId(e.item.id);var i=t.getValue("parentObj",e.item),r=-1;switch(i&&!t.isNullOrUndefined(i.id)&&"DeleteDependency"===this.getKeyFromId(i.id)&&(r=i.items.indexOf(e.item)),this.parent.isAdaptive&&("TaskInformation"!==this.item&&"Above"!==this.item&&"Below"!==this.item&&"Child"!==this.item&&"DeleteTask"!==this.item||this.parent.selectionModule&&"Multiple"===this.parent.selectionSettings.type&&(this.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none")),this.item){case"TaskInformation":this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID));break;case"Above":case"Below":case"Child":var n=this.item,a=t.extend({},{},this.rowData.taskData,!0),o=this.parent.taskFields;if(t.isNullOrUndefined(o.dependency)||(a[o.dependency]=null),!t.isNullOrUndefined(o.child)&&a[o.child]&&delete a[o.child],!t.isNullOrUndefined(o.parentID)&&a[o.parentID]&&(a[o.parentID]=null),this.rowData){var s=this.parent.currentViewData.indexOf(this.rowData);this.parent.addRecord(a,n,s)}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(a=t.extend({},{},this.rowData.taskData,!0),o=this.parent.taskFields,t.isNullOrUndefined(o.duration)){a[o.startDate]=new Date(this.rowData.taskData[o.startDate]);var l=new Date(this.rowData.taskData[o.startDate]);l.setDate(l.getDate()+1),a[o.endDate]=l}else{var d=this.rowData.ganttProperties;a[o.duration]="1 "+d.durationUnit}t.isNullOrUndefined(a[o.milestone])||!0===a[o.milestone]&&(a[o.milestone]=!1),this.parent.updateRecordByID(a);break;case"Cancel":this.parent.cancelEdit();break;case"Save":this.parent.editModule.cellEditModule.isCellEdit=!1,this.parent.treeGrid.grid.saveCell();break;case"Dependency"+r:this.parent.connectorLineEditModule.removePredecessorByIndex(this.rowData,r);break;case"Auto":case"Manual":this.parent.changeTaskMode(this.rowData);break;case"Indent":this.parent.indent();break;case"Outdent":this.parent.outdent()}e.type="Content",e.rowData=this.rowData,this.parent.trigger("contextMenuClick",e)},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();e.gridRow=t.closest(r,".e-row"),e.chartRow=t.closest(r,".e-chart-row");var a=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"],!1),(t.isNullOrUndefined(e.gridRow)&&t.isNullOrUndefined(e.chartRow)||0===this.contentMenuItems.length)&&(t.isNullOrUndefined(e.parentItem)||t.isNullOrUndefined(a)?e.cancel=!0:e.cancel=!1),!e.cancel){var o=-1;e.gridRow?o=parseInt(e.gridRow.getAttribute("aria-rowindex"),0):e.chartRow&&(o=parseInt(t.getValue("rowIndex",e.chartRow),0)),this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.selectRow(o),e.parentItem||(this.rowData=this.parent.currentViewData[o]);for(var s=0,l=e.items;s<l.length;s++){var d=l[s];d.separator||this.updateItemStatus(d,r)}if(e.rowData=this.rowData,e.type="Content",e.disableItems=this.disableItems,e.hideItems=this.hideItems,0===e.rowData.level&&"ResourceView"===this.parent.viewType)return void(e.cancel=!0);var p=new n.Deferred;return this.parent.trigger("contextMenuOpen",e,function(e){p.resolve(e),t.isBlazor()&&(e.element=t.isNullOrUndefined(e.element)?e.element:t.getElement(e.element),e.gridRow=t.isNullOrUndefined(e.gridRow)?e.gridRow:t.getElement(e.gridRow),e.chartRow=t.isNullOrUndefined(e.chartRow)?e.chartRow:t.getElement(e.chartRow)),i.hideItems=e.hideItems,i.disableItems=e.disableItems,e.parentItem||e.hideItems.length!==e.items.length||(i.revertItemStatus(),e.cancel=!0),i.hideItems.length>0&&i.contextMenu.hideItems(i.hideItems),i.disableItems.length>0&&i.contextMenu.enableItems(i.disableItems,!1)}),p}},e.prototype.updateItemStatus=function(e,i){var r=this.getKeyFromId(e.id);if(t.closest(i,".e-gridform"))"Save"!==r&&"Cancel"!==r&&this.hideItems.push(e.text);else switch(r){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":if(this.rowData.hasChildRecords)this.hideItems.push(e.text);else if(this.parent.editSettings.allowEditing&&this.parent.editModule){var n=[];this.rowData.ganttProperties.isMilestone?n.push(this.createItemModel(Ce,"ToTask",this.getLocale("toTask"))):n.push(this.createItemModel(Ce,"ToMilestone",this.getLocale("toMilestone"))),e.items=n}else this.updateItemVisibility(e.text);break;case"DeleteDependency":var a=this.getPredecessorsItems();this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowDeleting&&0!==a.length&&this.parent.editModule?a.length>0&&(e.items=a):this.updateItemVisibility(e.text);break;case"DeleteTask":this.parent.editSettings.allowDeleting&&this.parent.editModule||this.updateItemVisibility(e.text);break;case"TaskMode":var o=[];"Custom"!==this.parent.taskMode?this.updateItemVisibility(e.text):(this.rowData.ganttProperties.isAutoSchedule?o.push(this.createItemModel(Ce,"Manual",this.getLocale("manual"))):o.push(this.createItemModel(Ce,"Auto",this.getLocale("auto"))),e.items=o);break;case"Indent":var s=this.parent.selectedRowIndex,l=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),d=this.parent.currentViewData[this.parent.selectionModule.getSelectedRowIndexes()[0]-1];this.parent.editSettings.allowEditing&&0!==s&&-1!==s&&l&&"ResourceView"!==this.parent.viewType&&this.parent.currentViewData[s].level-d.level!=1||this.hideItems.push(e.text);break;case"Outdent":var p=this.parent.selectionModule.getSelectedRowIndexes()[0],h=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length);this.parent.editSettings.allowEditing&&-1!==p&&0!==p&&h&&"ResourceView"!==this.parent.viewType&&0!==this.parent.currentViewData[p].level||this.hideItems.push(e.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)")[0];t.addClass([i],"e-focused")},e.prototype.getMenuItems=function(){for(var e=0,i=t.isNullOrUndefined(this.parent.contextMenuItems)?this.getDefaultItems():this.parent.contextMenuItems;e<i.length;e++){var r=i[e];"string"==typeof r&&-1!==this.getDefaultItems().indexOf(r)?this.buildDefaultItems(r):"string"!=typeof r&&(-1!==this.getDefaultItems().indexOf(r.text)?this.buildDefaultItems(r.text,r.iconCss):".e-gridheader"===r.target?this.headerMenuItems.push(r):this.contentMenuItems.push(r))}return this.contentMenuItems},e.prototype.createItemModel=function(e,t,i,r){return{text:i,id:this.generateID(t),target:e,iconCss:r?"e-icons "+r:null}},e.prototype.getLocale=function(e){return this.parent.localeObj.getConstant(e)},e.prototype.buildDefaultItems=function(e,t){var i;switch(e){case"AutoFitAll":case"AutoFit":case"SortAscending":case"SortDescending":this.headerMenuItems.push(e);break;case"TaskInformation":i=this.createItemModel(Ce,e,this.getLocale("taskInformation"),this.getIconCSS("e-edit",t));break;case"Indent":i=this.createItemModel(Ce,e,this.getLocale("indent"),this.getIconCSS("e-indent",t));break;case"Outdent":i=this.createItemModel(Ce,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(Ce,e,this.getLocale("add"),this.getIconCSS("e-add",t))).items=[],i.items.push(this.createItemModel(Ce,"Above",this.getLocale("above"),this.getIconCSS("e-add-above",t))),i.items.push(this.createItemModel(Ce,"Below",this.getLocale("below"),this.getIconCSS("e-add-below",t))),"ResourceView"!==this.parent.viewType&&i.items.push(this.createItemModel(Ce,"Child",this.getLocale("child"))),i.items.push(this.createItemModel(Ce,"Milestone",this.getLocale("milestone")));break;case"DeleteTask":i=this.createItemModel(Ce,e,this.getLocale("deleteTask"),this.getIconCSS("e-delete",t));break;case"DeleteDependency":(i=this.createItemModel(Ce,e,this.getLocale("deleteDependency"))).items=[],i.items.push({});break;case"Convert":(i=this.createItemModel(Ce,e,this.getLocale("convert"))).items=[],i.items.push({});break;case"TaskMode":(i=this.createItemModel(Ce,e,this.getLocale("changeScheduleMode"))).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],o=this.parent.getRecordByID(a.from).ganttProperties,s=o.rowUniqueID+" - "+o.taskName,l="Dependency"+i++;e=this.createItemModel(Ce,l,s),t.push(e)}return t},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","TaskInformation","DeleteTask","Save","Cancel","SortAscending","SortDescending","Add","DeleteDependency","Convert","TaskMode","Indent","Outdent"]},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 s.ContextMenu&&this.revertItemStatus()},e.prototype.revertItemStatus=function(){t.isBlazor()&&t.isNullOrUndefined(this.disableItems)&&(this.disableItems=[]),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}(),oi=function(){function e(e){this.parent=e,a.TreeGrid.Inject(a.ExcelExport),this.parent.treeGrid.allowExcelExport=this.parent.allowExcelExport,this.bindEvents()}return e.prototype.getModuleName=function(){return"excelExport"},e.prototype.destroy=function(){},e.prototype.bindEvents=function(){var e=this;this.parent.treeGrid.beforeExcelExport=function(t){e.parent.trigger("beforeExcelExport",t)},this.parent.treeGrid.excelQueryCellInfo=function(t){e.parent.trigger("excelQueryCellInfo",t)},this.parent.treeGrid.excelHeaderQueryCellInfo=function(t){e.parent.trigger("excelHeaderQueryCellInfo",t)},this.parent.treeGrid.excelExportComplete=function(t){e.parent.trigger("excelExportComplete",t)}},e}(),si=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}(),li=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,o=this.parent.element.getClientRects()[0].left,s=t.getValue("event",e.originalEvent).clientX-o,l=t.getValue("event",e.originalEvent).clientY-a;n.style.left=s+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.filterSettings.columns.length>0||this.parent.sortSettings.columns.length>0)&&(e.cancel=!0),"ResourceView"===this.parent.viewType&&0===t.getValue("level",e.data[0])&&(e.cancel=!0)},e.prototype.rowDrop=function(e){var i=document.querySelector(".e-ganttdrag");i&&i.remove();var r=t.closest(e.target,".e-row"),n=r?parseInt(r.getAttribute("aria-rowindex"),10):e.dropIndex;e.dropIndex=n,e.dropRecord=this.parent.currentViewData[e.dropIndex],this.parent.trigger("rowDrop",e),"ResourceView"===this.parent.viewType&&("middleSegment"===e.dropPosition&&(1===e.dropRecord.level?e.cancel=!0:e.dropRecord.uniqueID===t.getValue("parentItem",e.data[0]).uniqueID&&(e.cancel=!0)),"middleSegment"!==e.dropPosition&&(0===e.dropRecord.level?e.cancel=!0:t.getValue("parentItem",e.data[0]).uniqueID===e.dropRecord.parentItem.uniqueID&&(e.cancel=!0))),e.cancel||(e.cancel=!0,e.requestType="beforeDrop",this.parent.trigger("actionBegin",e),this.dropRows(e,!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,a=void 0;this.droppedRecord=r.currentViewData[e.dropIndex];var o=[];a=this.droppedRecord,e.data[0]?o=e.data:o.push(e.data);for(var s=0,l=o.length,d=0;d<l;d++){if(this.parent.isOnEdit=!0,n=o[d],this.draggedRecord=n,"Invalid"!==this.dropPosition){if("ResourceView"===this.parent.viewType&&(this.checkisSharedTask(),this.previousParent=this.draggedRecord.parentItem.uniqueID),this.isSharedTask)return;i&&this.deleteDragRow();var p=this.ganttData.indexOf(a);if("topSegment"===this.dropPosition&&this.dropAtTop(p),"bottomSegment"===this.dropPosition&&!this.isSharedTask){if(a.hasChildRecords){if(s=this.parent.editModule.getChildCount(a,0),this.parent.taskFields.parentID&&this.parent.dataSource.length>0&&this.parent.dataSource.splice(p+s+1,0,this.draggedRecord.taskData),this.ganttData.splice(p+s+1,0,this.draggedRecord),this.parent.flatData.splice(p+s+1,0,this.draggedRecord),this.parent.ids.splice(p+s+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var h=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId;this.parent.getTaskIds().splice(p+s+1,0,h)}}else if(this.parent.taskFields.parentID&&this.parent.dataSource.length>0&&this.parent.dataSource.splice(p+1,0,this.draggedRecord.taskData),this.ganttData.splice(p+1,0,this.draggedRecord),this.parent.flatData.splice(p+1,0,this.draggedRecord),this.parent.ids.splice(p+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType){var c=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId;this.parent.getTaskIds().splice(p+1,0,c)}if(n.parentItem=this.ganttData[p].parentItem,n.parentUniqueID=this.ganttData[p].parentUniqueID,n.level=this.ganttData[p].level,n.hasChildRecords){this.updateChildRecordLevel(n,1),this.updateChildRecord(n,p+s+1)}if(a.parentItem){var u=this.parent.getParentTask(a.parentItem).childRecords,g=u.indexOf(a)+1;u.splice(g,0,n)}}"middleSegment"===this.dropPosition&&this.dropMiddle(p),t.isNullOrUndefined(n.parentItem&&-1!==this.updateParentRecords.indexOf(n.parentItem))||this.updateParentRecords.push(n.parentItem)}r.rowDragAndDropModule.refreshDataSource()}if("middleSegment"===this.dropPosition&&(a.ganttProperties.predecessor&&(this.parent.editModule.removePredecessorOnDelete(a),a.ganttProperties.predecessor=null,a.ganttProperties.predecessorsName=null,a[this.parent.taskFields.dependency]=null,a.taskData[this.parent.taskFields.dependency]=null),a.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,a.ganttProperties,!0),t.isNullOrUndefined(a.taskData[this.parent.taskFields.milestone])||!0===a.taskData[this.parent.taskFields.milestone]&&(a.taskData[this.parent.taskFields.milestone]=!1))),"ResourceView"===this.parent.viewType&&!this.isSharedTask){var f=void 0;f="middleSegment"===this.dropPosition?this.droppedRecord.uniqueID:this.droppedRecord.parentItem.uniqueID;var m=this.parent.getTaskByUniqueID(f),y={};y[this.parent.taskFields.resourceInfo]=[],y[this.parent.taskFields.resourceInfo].push(m.ganttProperties.taskId),this.removeExistingResources();var v=this.parent.dataOperation.setResourceInfo(y),w=this.draggedRecord;t.isNullOrUndefined(w.ganttProperties.resourceInfo)&&(w.ganttProperties.resourceInfo=[]),"Unassigned Task"===m.ganttProperties.taskName?(w.ganttProperties.resourceInfo=[],w.ganttProperties.sharedTaskUniqueIds=[w.ganttProperties.rowUniqueID]):w.ganttProperties.resourceInfo.push(v[0]),this.updateCurrentTask(w),"Unassigned Task"===m.ganttProperties.taskName?this.deleteSharedResourceTask():this.updateSharedResourceTask()}for(var D=0;D<this.updateParentRecords.length;D++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[D]);this.updateParentRecords=[],this.parent.isOnEdit=!1}this.parent.treeGrid.refresh(),e.requestType="rowDropped",e.modifiedRecords=this.parent.editedRecords,this.parent.trigger("actionComplete",e),this.parent.editedRecords=[]}},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.currentViewData[e]),this.parent.dataOperation.updateTaskData(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._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.currentViewData[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 o=(n=r[a]).ganttProperties.resourceInfo,s=0;s<o.length;s++)if(o[s][this.parent.resourceFields.id]===i.ganttProperties.taskId){o.splice(s,1),this.parent.setRecordValue("resourceInfo",o,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,o=this.parent;if((e=this.parent.dataSource instanceof n.DataManager&&this.parent.dataSource.dataSource.json.length>0?o.dataSource.dataSource.json:o.dataSource).length>0&&!t.isNullOrUndefined(a)&&!a.parentItem){for(var s=0;s<Object.keys(e).length;s++)e[s][this.parent.taskFields.child]===a.taskData[this.parent.taskFields.child]&&(i=s);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||e.splice(i,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.taskFields.parentID||e.splice(i+1,0,r.taskData))}else if(!this.parent.taskFields.parentID&&!t.isNullOrUndefined(a)&&a.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var l="topSegment"===this.dropPosition?"Above":"Below";this.parent.editModule.addRowSelectedItem=a,this.parent.editModule.updateRealDataSource(r,l),delete this.parent.editModule.addRowSelectedItem}this.parent.taskFields.parentID&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID],r.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID],r.ganttProperties.parentId=a[this.parent.taskFields.parentID]):(r[this.parent.taskFields.parentID]=a[this.parent.taskFields.id],r.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.id],r.ganttProperties.parentId=a[this.parent.taskFields.id]):(r[this.parent.taskFields.parentID]=null,r.taskData[this.parent.taskFields.parentID]=null,r.ganttProperties.parentId=null))},e.prototype.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.parent.dataSource.length>0&&this.parent.dataSource.splice(n,0,this.draggedRecord.taskData),this.ganttData.splice(n,0,this.draggedRecord),this.parent.flatData.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 o={uniqueID:a.uniqueID,expanded:a.expanded,level:a.level,index:a.index,taskId:a.ganttProperties.rowUniqueID};if(i.parentItem=o,i.parentUniqueID=r.uniqueID,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.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof n.DataManager&&this.parent.dataSource.dataSource.json.length>0?this.ganttData=this.parent.dataSource.dataSource.json:this.ganttData=this.parent.currentViewData;var e;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.parent.dataSource.length>0&&this.parent.dataSource.splice(e,0,this.draggedRecord.taskData),this.draggedRecord.parentItem=this.ganttData[e].parentItem,this.draggedRecord.parentUniqueID=this.ganttData[e].parentUniqueID,this.draggedRecord.level=this.ganttData[e].level,this.ganttData.splice(e,0,this.draggedRecord),this.parent.flatData.splice(e,0,this.draggedRecord),this.parent.ids.splice(e,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),"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;e.parentItem&&(a=this.parent.getParentTask(e.parentItem)),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 o=0;o<a;o++)r=e.childRecords[o],t++,n.currentViewData.splice(t,0,r),n.flatData.splice(t,0,r),this.parent.ids.splice(t,0,r.ganttProperties.rowUniqueID.toString()),n.taskFields.parentID&&n.dataSource.length>0&&n.dataSource.splice(t,0,r.taskData),r.hasChildRecords&&(t=this.updateChildRecord(r,t));return t},e.prototype.removeRecords=function(e){var t,i=this.parent;t=this.parent.dataSource;var r=e,n=this.parent.getParentTask(r.parentItem);if(r){if(r.parentItem){var a=n?n.childRecords:[],o=0;a&&a.length>0&&("ResourceView"===this.parent.viewType&&1===a.length&&(this.parent.isOnDelete=!0,a[0].isDelete=!0,this.parent.dataOperation.updateParentItems(n),this.parent.isOnDelete=!1,a[0].isDelete=!1),o=a.indexOf(r),n.childRecords.splice(o,1),this.updateParentRecords.push(n))}if(r&&!this.parent.taskFields.parentID){var s=[];s.push(r.ganttProperties.rowUniqueID.toString()),this.parent.editModule.removeFromDataSource(s)}if(i.taskFields.parentID){r.hasChildRecords&&r.childRecords.length>0&&this.removeChildItem(r);for(var l=void 0,d=t.length>0&&"ResourceView"!==this.parent.viewType?t:this.parent.currentViewData,p=0;p<d.length;p++)"ResourceView"===this.parent.viewType?d[p].ganttProperties.rowUniqueID===r.ganttProperties.rowUniqueID&&(l=p):d[p][this.parent.taskFields.id]===r.taskData[this.parent.taskFields.id]&&(l=p);-1!==l&&(t.length>0&&t.splice(l,1),this.ganttData.splice(l,1),this.parent.flatData.splice(l,1),this.parent.ids.splice(l,1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(l,1))}var h=this.ganttData.indexOf(r);if(!i.taskFields.parentID){var c=this.parent.editModule.getChildCount(r,0);this.ganttData.splice(h,c+1),this.parent.flatData.splice(h,c+1),this.parent.ids.splice(h,c+1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(h,c+1)}r.parentItem&&n&&n.childRecords&&!n.childRecords.length&&(n.expanded=!1,n.hasChildRecords=!1)}},e.prototype.removeChildItem=function(e){for(var t,i,r=this.parent,n=0;n<e.childRecords.length;n++){t=e.childRecords[n];var a=void 0;a=this.parent.dataSource.length>0?this.parent.dataSource:this.parent.currentViewData;for(var o=0;o<a.length;o++)a[o][this.parent.taskFields.id]===t.taskData[this.parent.taskFields.id]&&(i=o);-1!==i&&(r.dataSource.length>0&&r.dataSource.splice(i,1),this.ganttData.splice(i,1),this.parent.flatData.splice(i,1),this.parent.ids.splice(i,1),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(i,1)),t.hasChildRecords&&this.removeChildItem(t)}},e.prototype.reorderRows=function(e,t,i){if(!this.parent.readOnly){e[0],"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var r=[],n=0;n<e.length;n++)r[n]=this.parent.currentViewData[e[n]];var a={data:r,dropIndex:t,dropPosition:this.dropPosition};this.dropRows(a,!0)}},e}(),di=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.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.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.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.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}(),pi=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}(),hi=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}(),ci=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}(),ui=function(){return function(){this.cellSpacing=0,this.borderOverlapStyle=u.PdfBorderOverlapStyle.Overlap,this.allowHorizontalOverflow=!1,this.horizontalOverflowType=e.PdfHorizontalOverflowType.LastPage,this.cellPadding=new ci}}(),gi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fi=function(i){function r(e){var t=i.call(this,e)||this;return t.columnRanges=[],t.repeatRowIndex=-1,t.currentBounds=new u.RectangleF(0,0,0,0),t}return gi(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,o=e;o<=n&&!((a+=this.treegrid.columns.getColumn(o).width)>r);o++)t=o;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 pi,a=t.page,o=0;o<this.columnRanges.length;o++){var s=this.columnRanges[o];this.cellStartIndex=s[0],this.cellEndIndex=s[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,s);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(),g=this.currentBounds.y,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===hi.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.drawRow(c),null===this.currentPage||n.containsKey(this.currentPage)||n.add(this.currentPage,s))}this.columnRanges.indexOf(s)<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(hi.default.right.width/2,hi.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++){(s=r[n]).section=null,i.push(s),t.pages.remove(s)}for(n=0;n<e.size();n++)for(var a=e.size()/this.columnRanges.length,o=n;o<e.size();o+=a){var s=i[o];-1===t.pages.indexOf(s)&&t.pages.add(s)}},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 mi(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,a=e.rowBreakHeight>0?e.rowBreakHeight:e.height;return a>this.currentPageBounds.height?this.treegrid.allowRowBreakAcrossPages?(n.isFinish=!0,this.drawRowWithBreak(n,e,a)):(n.isFinish=!1,this.drawRow(e,n,a)):this.currentBounds.y+a>this.currentPageBounds.height||this.currentBounds.y+a>this.currentBounds.height?this.repeatRowIndex>-1&&this.repeatRowIndex===e.rowIndex?this.treegrid.allowRowBreakAcrossPages?(n.isFinish=!0,this.drawRowWithBreak(n,e,a)):(n.isFinish=!1,this.drawRow(e,n,a)):n.isFinish=!1:(n.isFinish=!0,this.drawRow(e,n,a)),n}var o=new u.PointF(this.currentBounds.x,this.currentBounds.y);i.bounds=new u.RectangleF(o,new u.SizeF(0,0));var s=0;r=this.reCalculateHeight(e,r);for(var l=this.cellStartIndex;l<=this.cellEndIndex;l++){var d=e.cells.getCell(l),p=this.treegrid.columns.getColumn(l);p.isTreeColumn&&(s=10*e.level);var h=l>this.cellEndIndex+1&&d.columnSpan>1;if(!h)for(var c=1;c<d.columnSpan;c++)e.cells.getCell(l+c).isCellMergeContinue=!0;var g=new u.SizeF(p.width,r);!this.checkIfDefaultFormat(p.format)&&this.checkIfDefaultFormat(d.style.format)&&(d.style.format=p.format);d.draw(this.currentGraphics,new u.RectangleF(o,g),h,s);e.treegrid.style.allowHorizontalOverflow&&(d.columnSpan>this.cellEndIndex||l+d.columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),o.x+=p.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(o.x,o.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 o=this.cellStartIndex;o<=this.cellEndIndex;o++){var s=this.treegrid.columns.getColumn(o);s.isTreeColumn&&(n=10*t.level);var l,d=(l=t.cells.getCell(o)).columnSpan+o>this.cellEndIndex+1&&l.columnSpan>1;if(!d)for(var p=1;p<l.columnSpan;p++)t.cells.getCell(o+p).isCellMergeContinue=!0;var h=this.treegridHeight>0?this.treegridHeight:this.currentBounds.height,c=new u.SizeF(s.width,h);!this.checkIfDefaultFormat(s.format)&&this.checkIfDefaultFormat(l.style.format)&&(l.style.format=s.format);l.draw(this.currentGraphics,new u.RectangleF(r,c),d,n);e.isFinish=e.isFinish?l.finishedDrawingCell:e.isFinish,r.x+=s.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),mi=function(e){function t(t,i){return e.call(this,t,i)||this}return gi(t,e),t}(u.PdfLayoutResult),yi=function(e){function t(t){return void 0===t?e.call(this)||this:e.call(this,t)||this}return gi(t,e),t}(u.PdfLayoutFormat),vi=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)}}(),wi=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 Ci(t),t.rows=new Si(t),t.headers=new bi(t),t.style=new ui,t.rowHeight=0,t}return vi(t,e),Object.defineProperty(t.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return 0===this.treeGridSize.width&&0===this.treeGridSize.height&&(this.treeGridSize=this.calculateTreeGridSize()),this.treeGridSize},set:function(e){this.treeGridSize=e},enumerable:!0,configurable:!0}),t.prototype.draw=function(e,t,i,r){if(t instanceof u.PointF&&void 0===t.width&&void 0===i)return this.drawHelper(e,t.x,t.y);if("number"==typeof t&&"number"==typeof i&&void 0===r)return this.drawHelper(e,t,i,null);if(t instanceof u.RectangleF&&void 0!==t.width&&void 0===i)return this.drawHelper(e,t,null);if(t instanceof u.PointF&&void 0===t.width&&i instanceof u.PdfLayoutFormat)return this.drawHelper(e,t.x,t.y,i);if("number"==typeof t&&"number"==typeof i&&(r instanceof u.PdfLayoutFormat||null==r)){var n=e.graphics.clientSize.width-t,a=new u.RectangleF(t,i,n,0);return this.drawHelper(e,a,r)}return t instanceof u.RectangleF&&void 0!==t.width&&"boolean"==typeof i?this.drawHelper(e,t,null):this.drawHelper(e,t,i)},t.prototype.measureColumnsWidth=function(e){if(void 0!==e)for(var t=this.columns.getDefaultWidths(e.width-e.x),i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i]);else{t=[];var r=0,n=0,a=this.columns.count;for(i=0;i<a;i++){for(var o=this.rows.count,s=0;s<o;s++){var l=this.rows.getRow(s).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(s).level))}this.columns.getColumn(i).isTreeColumn?t.push(r+10*n):t.push(r),r=0}for(i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i])}},t.prototype.calculateTreeGridSize=function(){for(var e=0,t=this.columns.width,i=0;i<this.headers.count;i++){e+=this.headers.getHeader(i).height}for(i=0;i<this.rows.count;i++){e+=this.rows.getRow(i).height}return new u.SizeF(t,e)},t.prototype.drawGrid=function(e,t,i,r){this.initialWidth=e.graphics.clientSize.width;var n=new u.RectangleF(0,0,e.getClientSize().height,0);return this.draw(e,n,r)},t.prototype.layout=function(e){if(0!==this.rows.count){var t=this.rows.getRow(0).cells.getCell(0).style;if(1!==t.borders.left.width){var i=t.borders.left.width/2,r=t.borders.top.width/2;if(e.bounds.x===hi.default.right.width/2&&e.bounds.y===hi.default.right.width/2){var n=new u.RectangleF(new u.PointF(i,r),new u.SizeF(this.size.width,this.size.height));e.bounds=n}}}this.setSpan(),this.layouter=new fi(this);return this.layouter.layoutInternal(e)},t.prototype.onBeginCellDraw=function(e){this.raiseBeginCellDraw&&this.beginCellDraw(this,e)},t.prototype.onEndCellDraw=function(e){this.raiseEndCellDraw&&this.endCellDraw(this,e)},t.prototype.setSpan=function(){for(var e=1,t=1,i=0,r=0,n=0,a=this.headers.count,o=0;o<a;o++){n=0;for(var s=(p=this.headers.getHeader(o)).cells.count,l=0;l<s;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 "+o.toString());if(d.rowSpan+o>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+o.toString());if(d.columnSpan>1&&d.rowSpan>1){for(e=d.columnSpan,t=d.rowSpan,i=l,r=o,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=o;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(o=0;o<a;o++){var p,h=(p=this.rows.getRow(o)).cells.count;for(l=0;l<h;l++){if(!(d=p.cells.getCell(l)).isCellMergeContinue&&!d.isRowMergeContinue&&(d.columnSpan>1||d.rowSpan>1)){if(d.columnSpan+l>p.cells.count)throw new Error("Invalid span specified at row {0} column {1} "+l.toString());if(d.rowSpan+o>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=o,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=o;t>1;)r++,this.rows.getRow(r).cells.getCell(l).isRowMergeContinue=!0,t--}}}},t}(u.PdfLayoutElement),Di=function(){function e(e){this.cellWidth=0,this.cellHeight=0,this.finishedDrawingCell=!0,t.isNullOrUndefined(e)?(this.rowSpan=1,this.columnSpan=1):this.row=e,this.style={}}return Object.defineProperty(e.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(e){this.cellHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return 0===this.cellWidth&&(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(e){this.cellWidth=e},enumerable:!0,configurable:!0}),e.prototype.measureWidth=function(){var e=0,t=new u.PdfStringLayouter;if("string"==typeof this.value){var i=new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);e+=t.layout(this.value,i,this.style.format,new u.SizeF(Number.MAX_VALUE,Number.MAX_VALUE),!1,new u.SizeF(0,0)).actualSize.width,e+=2*(this.style.borders.left.width+this.style.borders.right.width)}return void 0!==this.row.treegrid.style.cellPadding.left&&this.row.treegrid.style.cellPadding.hasLeftPad&&(e+=this.row.treegrid.style.cellPadding.left),void 0!==this.row.treegrid.style.cellPadding.right&&this.row.treegrid.style.cellPadding.hasRightPad&&(e+=this.row.treegrid.style.cellPadding.right),e+=this.row.treegrid.style.cellSpacing},e.prototype.measureHeight=function(){var e=this.row.treegrid.rowHeight,i=0,r=this.calculateWidth();r-=this.row.treegrid.style.cellPadding.right+this.row.treegrid.style.cellPadding.left,r-=this.style.borders.left.width+this.style.borders.right.width;var n=new u.PdfStringLayouter;if("string"==typeof this.value||"string"==typeof this.remainingString){var a=this.value;this.finishedDrawingCell||(a=t.isNullOrUndefined(this.remainingString)||""===this.remainingString?this.value:this.remainingString);var o=new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);i+=n.layout(a,o,this.style.format,new u.SizeF(r,0),!1,new u.SizeF(0,0)).actualSize.height,i+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}return i+=this.row.treegrid.style.cellPadding.top+this.row.treegrid.style.cellPadding.bottom,(i+=this.row.treegrid.style.cellSpacing)>e?i:e},e.prototype.calculateWidth=function(){for(var e=this.row.cells.indexOf(this),t=this.columnSpan,i=0,r=0;r<t;r++)i+=this.row.treegrid.columns.getColumn(e+r).width;return this.row.treegrid.columns.getColumn(e).isTreeColumn&&(i-=10*this.row.level),i},e.prototype.draw=function(e,t,i,r){var n=null;if(i){for(var a=this.row.cells.indexOf(this),o=a+1;o<=a+this.columnSpan;o++)this.row.cells.getCell(o).isCellMergeContinue=!1,this.row.cells.getCell(o).isRowMergeContinue=!1;this.columnSpan=1}if((this.isCellMergeContinue||this.isRowMergeContinue)&&this.isCellMergeContinue&&this.row.treegrid.style.allowHorizontalOverflow)return this.row.rowOverflowIndex>0&&this.row.cells.indexOf(this)!==this.row.rowOverflowIndex+1||0===this.row.rowOverflowIndex&&this.isCellMergeContinue,n;this.drawCellBackground(e,t);var s=new u.PdfSolidBrush(this.style.fontColor),l=null;l=this.row.isParentRow?new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,u.PdfFontStyle.Bold):new u.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle);var d=t;if(this.isHeaderCell||(d.x=d.x,d.width=d.width),d.height>=e.clientSize.height&&(this.row.treegrid.allowRowBreakAcrossPages?(d.height-=d.y,t.height-=t.y):(d.height=e.clientSize.height,t.height=e.clientSize.height)),d=this.adjustContentLayoutArea(d),"string"==typeof this.value||"string"==typeof this.remainingString){var p=null;this.finishedDrawingCell?(p=""===this.remainingString?this.remainingString:this.value,e.drawString(p,l,null,s,d.x+r,d.y,d.width-r-10,d.height-10,this.style.format)):e.drawString(this.remainingString,l,null,s,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 wi){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}(),ki=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 Di;return this.add(t),e}e.row=this.treegridRow,this.cells.push(e)},e.prototype.indexOf=function(e){return this.cells.indexOf(e)},e}(),Ti=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 ki(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}(),Si=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 Ti(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 Di);this.rows.push(e)},e.prototype.getRow=function(e){return this.rows[e]},e}(),bi=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}(),Pi=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}(),Ci=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 Pi(this.treegrid));for(var i=0;i<this.treegrid.rows.count;i++){var r=this.treegrid.rows.getRow(i),n=new Di;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}(),Ri=function(){function e(e){this.parent=e}return e.prototype.processGridExport=function(e,t,i){this.flatData=e,this.gantt=t,this.exportValueFormatter=new Mi(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=k(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=k(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.row.height=k(a),this.copyStyles(this.ganttStyle.columnHeader,n,!1),e.headerTextAlign&&(n.style.format.alignment=u.PdfTextAlignment[e.headerTextAlign]);var o={cell:n,style:n.style,value:n.value,column:e};this.parent.pdfColumnHeaderQueryCellInfo&&this.parent.trigger("pdfColumnHeaderQueryCellInfo",o),n.value=o.value},e.prototype.isColumnVisible=function(e){var i=e.visible||this.exportProps.includeHiddenColumn,r=!!t.isNullOrUndefined(e.template);return i&&r},e.prototype.processGanttContent=function(){var e=this;0===this.flatData.length?this.renderEmptyGantt():this.flatData.forEach(function(t){e.row=e.gantt.rows.addRow(),t.hasChildRecords?(e.gantt.rows.getRow(e.rowIndex).isParentRow=!0,e.processRecordRow(t)):e.processRecordRow(t),e.rowIndex++})},e.prototype.processTimeline=function(){var e=this.parent.timelineModule;this.gantt.chartHeader.topTierHeight=this.gantt.chartHeader.bottomTierHeight=this.parent.timelineModule.isSingleTier?45:30,this.gantt.chartHeader.topTierCellWidth=e.topTierCellWidth,this.gantt.chartHeader.bottomTierCellWidth=e.bottomTierCellWidth,this.gantt.chartHeader.topTier=t.extend([],[],e.topTierCollection,!0),this.gantt.chartHeader.bottomTier=t.extend([],[],e.bottomTierCollection,!0),this.gantt.chartHeader.width=e.totalTimelineWidth,this.gantt.chartHeader.height=this.gantt.rows.getRow(0).height,this.gantt.timelineStartDate=new Date(e.timelineStartDate.getTime())},e.prototype.processPredecessor=function(){var e=this;(t.isNullOrUndefined(this.exportProps.showPredecessorLines)||this.exportProps.showPredecessorLines)&&(this.parent.pdfExportModule.isPdfExport=!0,this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.updatedConnectorLineCollection.forEach(function(t){var i=e.gantt.predecessor.add();i.parentLeft=t.parentLeft,i.childLeft=t.childLeft,i.parentWidth=t.parentWidth,i.childWidth=t.childWidth,i.parentIndex=t.parentIndex,i.childIndex=t.childIndex,i.rowHeight=t.rowHeight,i.type=t.type,i.milestoneParent=t.milestoneParent,i.milestoneChild=t.milestoneChild,i.lineWidth=e.parent.connectorLineWidth>5?k(5):k(e.parent.connectorLineWidth),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,o=e.ganttProperties;if("datepickeredit"===i.editType||"datetimepickeredit"===i.editType?n.value=this.parent.getFormatedDate(e[i.field],this.parent.getDateFormat()):i.field===a.duration?n.value=this.parent.getDurationString(o.duration,o.durationUnit):i.field===a.resourceInfo?n.value=o.resourceNames:i.field===a.work?n.value=this.parent.getWorkString(o.work,o.workUnit):n.value=t.isNullOrUndefined(e[i.field])?"":e[i.field].toString(),n.isHeaderCell=!1,n.style.padding=new ci,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,null!=this.parent.pdfQueryCellInfo){var s={data:e,value:n.value,column:i,style:n.style,cell:n};s.value=this.exportValueFormatter.formatCellValue(s),this.parent.pdfQueryCellInfo&&this.parent.trigger("pdfQueryCellInfo",s),n.value=s.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.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.width=n.width,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());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)):(r.taskColor=new u.PdfColor(e.ganttStyle.taskbar.taskColor),r.taskBorderColor=new u.PdfColor(e.ganttStyle.taskbar.taskBorderColor),r.progressColor=new u.PdfColor(e.ganttStyle.taskbar.progressColor)),r.gridLineColor=new u.PdfColor(e.ganttStyle.chartGridLineColor),e.gantt.taskbarCollection.push(r);var o={};o.progressFontColor=r.progressFontColor,o.taskColor=r.taskColor,o.taskBorderColor=r.taskBorderColor,o.progressColor=r.progressColor,o.milestoneColor=r.milestoneColor;var s={taskbar:o,data:i};e.parent.pdfQueryTaskbarInfo&&(e.parent.trigger("pdfQueryTaskbarInfo",s),r.progressFontColor=s.taskbar.progressFontColor,r.taskColor=s.taskbar.taskColor,r.taskBorderColor=s.taskbar.taskBorderColor,r.progressColor=s.taskbar.progressColor,r.milestoneColor=s.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=k(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 hi,t.style.borders.all=new u.PdfPen(t.style.borderColor),t.style.padding=new ci;var r=0;r=t.isHeaderCell?this.parent.timelineModule.isSingleTier?22.5:30:this.parent.rowHeight/2,t.style.padding.top=r-e.fontSize,t.style.padding.bottom=r-e.fontSize,t.style.padding.left=10,t.style.padding.right=10},e.prototype.initializePdf=function(e){this.pdfDoc=e;var i=[],r=this.pdfDoc.pageSettings.width-82;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.pdfDoc.sections.add();if(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),o=new u.PdfPageTemplateElement(n),s=new u.PdfSolidBrush(this.ganttStyle.footer.backgroundColor);o.graphics.drawRectangle(a,s,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(o.graphics,new u.PointF(0,0)),e.template.bottom=o}},e}(),Mi=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",skeleton:e.column.format}:"time"===e.column.type?{type:"time",skeleton:e.column.format}:{type:"dateTime",skeleton:e.column.format},this.returnFormattedValue(e,i)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var n=void 0;return n="date"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,n)},e}(),xi=function(){return(xi=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},Oi=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,o){var s=e.graphics,l=!1,d=e.getClientSize(),p=(new u.PdfPen(o.gridLineColor,.5),i.y+a);p>d.height&&(s=(e=this.GetNextPage(e)).graphics,i.y=0,this.parent.pdfExportModule.gantt.enableHeader&&(this.parent.pdfExportModule.gantt.chartHeader.drawPageTimeline(e,i,r),i.y=k(this.parent.timelineModule.isSingleTier?45:60)),p=i.y+a,l=!0),this.drawLeftLabel(e,i,r,n);var h=new u.PdfStandardFont(this.fontFamily,9,u.PdfFontStyle.Regular),c=new u.PdfSolidBrush(this.progressFontColor),g=new u.PdfStringFormat;g.lineAlignment=u.PdfVerticalAlignment.Middle,g.alignment=u.PdfTextAlignment.Right;var f=-1;if(o.isMilestone)this.drawMilestone(e,i,r,n);else{var m=new u.PdfPen(o.taskBorderColor),y=new u.PdfSolidBrush(o.taskColor),v=new u.PdfPen(o.progressColor),w=new u.PdfSolidBrush(o.progressColor),D=k((this.parent.rowHeight-this.height)/2);f=e.section.indexOf(e);var T=t.isNullOrUndefined(this.unscheduleStarteDate)?this.startDate:this.unscheduleStarteDate,S=t.isNullOrUndefined(this.unscheduleEndDate)?this.endDate:this.unscheduleEndDate;if(r.startDate<=T&&S<=r.endDate)this.isStartPoint||(this.taskStartPoint=xi({},i),this.isStartPoint=!0),this.isScheduledTask||"duration"===this.unscheduledTaskBy?(s.drawRectangle(m,y,i.x+k(this.left-n)+.5,i.y+D,k(o.width),k(o.height)),this.progress>0&&this.progressWidth>0&&this.isScheduledTask&&(s.drawRectangle(v,w,i.x+k(this.left-n)+.5,i.y+D,k(o.progressWidth),k(o.height)),t.isNullOrUndefined(this.parent.taskFields.progress)||t.isNullOrUndefined(this.parent.labelSettings.taskLabel)||s.drawString(this.progress.toString(),h,null,c,i.x+k(this.left-n),i.y+D,k(this.progressWidth),k(this.height),g))):this.drawUnscheduledTask(s,i,n,D),this.isCompleted=!0,this.startPage=f,this.endPage=f;else if(r.startDate<=T&&r.endDate>=T&&!(S<r.endDate)){this.isStartPoint||(this.taskStartPoint=xi({},i),this.isStartPoint=!0);var b=0;if(this.width=this.width-(r.totalWidth-(this.left-n)),b=r.totalWidth-(this.left-n),this.isScheduledTask||"duration"===this.unscheduledTaskBy){if(s.drawRectangle(m,y,i.x+k(this.left-n)+.5,i.y+D,k(b),k(o.height)),this.progress>0&&this.progressWidth>0&&this.isScheduledTask){var P=0;P=this.progressWidth<=b?this.progressWidth:b,s.drawRectangle(v,w,i.x+k(this.left-n)+.5,i.y+D,k(P),k(o.height)),this.progressWidth-=P,0===this.progressWidth&&0!==this.progress&&this.parent.labelSettings.taskLabel&&s.drawString(this.progress.toString(),h,null,c,i.x+k(this.left-n),i.y+D,k(P),k(this.height),g)}}else this.drawUnscheduledTask(s,i,n,D);this.left=0,this.isCompleted=!1,this.startPage=f}else if(S<=r.endDate&&r.startDate<=S&&!this.isCompleted)this.isStartPoint||(this.taskStartPoint=xi({},i),this.isStartPoint=!0),s.drawRectangle(m,y,i.x+k(o.left+.5),i.y+D,k(o.width),k(o.height)),this.isScheduledTask&&(s.drawRectangle(v,w,i.x+k(o.left+.5),i.y+D,k(o.progressWidth),k(o.height)),0===this.progressWidth&&0!==this.progress&&s.drawString(this.progress.toString(),h,null,c,i.x+k(this.left),i.y+D,k(this.progressWidth),k(this.height),g)),this.isCompleted=!0,this.endPage=f;else if(T<r.startDate&&S>r.endDate){if(this.isStartPoint||(this.taskStartPoint=xi({},i),this.isStartPoint=!0),s.drawRectangle(m,y,i.x+k(o.left)+.5,i.y+D,k(r.totalWidth),k(o.height)),this.progress>0&&this.progressWidth>0&&this.isScheduledTask){P=0;P=this.progressWidth<=r.totalWidth?this.progressWidth:r.totalWidth,s.drawRectangle(v,w,i.x+k(o.left)+.5,i.y+D,k(P),k(o.height)),this.progressWidth-=P,0===this.progressWidth&&0!==this.progress&&s.drawString(this.progress.toString(),h,null,c,i.x+k(this.left),i.y+D,k(P),k(this.height),g)}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,o=e.graphics,s=(a=this.rightTaskLabel.isLeftCalculated?this.rightTaskLabel.left:k(this.rightTaskLabel.left))-k(n)+i.x;if(r.startPoint<=a&&a<r.endPoint&&!t.isNullOrUndefined(this.rightTaskLabel.value)&&!this.rightTaskLabel.isCompleted){var l=this.getWidth(this.rightTaskLabel.value,r.endPoint-a,15),d=new u.PdfStandardFont(this.fontFamily,9),p=(k(this.parent.rowHeight)-l.actualSize.height)/2,h=new u.PointF(s,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);o.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,o=e.graphics;if(!t.isNullOrUndefined(this.leftTaskLabel.value)){var s=0;if(s=this.left,this.leftTaskLabel.isLeftCalculated)a=this.leftTaskLabel.left;else{var l=this.getWidth(this.leftTaskLabel.value,Number.MAX_VALUE,15);a=k(s-(this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33))-l.actualSize.width,this.leftTaskLabel.left=a,this.leftTaskLabel.isLeftCalculated=!0}var d=a-k(n)+i.x;if(r.startPoint<=a&&a<r.endPoint&&!t.isNullOrUndefined(this.leftTaskLabel.value)&&!this.leftTaskLabel.isCompleted){l=this.getWidth(this.leftTaskLabel.value,r.endPoint-a,15);var p=new u.PdfStandardFont(this.fontFamily,9),h=(k(this.parent.rowHeight)-l.actualSize.height)/2,c=new u.PointF(d,i.y+h),g=new u.SizeF(l.actualSize.width,l.actualSize.height),f=new u.RectangleF(c,g),m=new u.PdfStringFormat;if(m.alignment=u.PdfTextAlignment.Right,m.lineAlignment=u.PdfVerticalAlignment.Middle,l.actualSize.width>0){var y=new u.PdfSolidBrush(this.labelColor);o.drawString(l.lines[0].text,p,null,y,f.x,f.y,l.actualSize.width,l.actualSize.height,m),null!==l.remainder?(this.leftTaskLabel.value=l.remainder,this.leftTaskLabel.left=r.endPoint):this.leftTaskLabel.isCompleted=!0}else this.leftTaskLabel.left=r.endPoint}}},e.prototype.getWidth=function(e,t,i){var r=new u.PdfStandardFont(this.fontFamily,9),n=new u.PdfStringLayouter,a=new u.PdfStringFormat;a.alignment=u.PdfTextAlignment.Left,a.wordWrap=u.PdfWordWrapType.Character,a.lineAlignment=u.PdfVerticalAlignment.Middle;return n.layout(e,r,a,new u.SizeF(t,i),!1,new u.SizeF(t,i))},e.prototype.drawUnscheduledTask=function(e,t,i,r){var n=new u.PdfSolidBrush(this.taskColor);e.drawRectangle(n,t.x+k(this.left-i),t.y+r,k(3),k(this.height))},e.prototype.drawMilestone=function(e,t,i,r){if(i.startDate<=this.startDate&&this.startDate<=i.endDate){var n=e.graphics,a=e.section.indexOf(e);this.taskStartPoint=xi({},t);var o=new u.PdfPen(this.milestoneColor),s=k((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+k(this.left-r),t.y+s-.7*this.parent.chartRowsModule.taskBarHeight/2),n.rotateTransform(45),n.drawRectangle(o,l,0,0,k(d),k(d)),n.restore(),this.endPage=this.startPage=a}},e}(),Ii=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;e.graphics;for(this.topTierPoint.x=t.x,this.topTierPoint.y=t.y,this.prevTopTierIndex=this.topTierIndex,this.prevBottomTierIndex=this.bottomTierIndex;r>0;){var a=this.topTier[this.topTierIndex];if(this.topTier.length>this.topTierIndex){var o=!1;this.topTier[this.topTierIndex].isFinished||(r>=a.width?(n=a.width,a.isFinished=!0,a.completedWidth=n,o=!0):(n=r,o=!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+=k(n),r-=n,o&&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,k(t.y+s));r>0;){var l=this.bottomTier[this.bottomTierIndex];if(this.bottomTier.length>this.bottomTierIndex){o=!0;var d=l.width;r<d&&(d=r,o=!1,l.completedWidth=d),this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,d,l.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+k(d),r-=d,l.completedWidth=d,o&&this.bottomTierIndex++}else r=0}},e.prototype.drawPageTimeline=function(e,i,r){e.graphics;this.topTierPoint=t.extend({},{},i,!0);for(var n=this.prevTopTierIndex;n<=this.topTierIndex;n++)if(this.topTier.length>n){var a=this.topTier[n];a.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,a.completedWidth,a.value,!0),this.topTierPoint.x+=k(a.completedWidth))}this.bottomTierPoint.x=i.x,this.bottomTierPoint.y=k(i.y+this.topTierHeight);for(n=this.prevBottomTierIndex;n<=this.bottomTierIndex;n++)if(this.bottomTier.length>n){var o=this.bottomTier[n];o.completedWidth>0&&(this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,o.width,o.value,!1),this.bottomTierPoint.x=this.bottomTierPoint.x+k(o.width))}},e.prototype.triggerQueryTimelinecell=function(e,i,r,n,a,o,s){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)?s?(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:o};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,k(a),k(n));var y=new u.PdfStandardFont(p.fontFamily,g.fontSize,g.fontStyle),v=new u.PdfSolidBrush(c.timelineCell.fontColor),w=p.timeline.padding?c.timelineCell.padding.left:0,D=p.timeline.padding?c.timelineCell.padding.top:0;l.drawString(c.value,y,null,v,i+w,r+D,k(a),k(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)},Fi=function(){function e(e,t){this.parent=e,this.pdfGantt=t}return e.prototype.add=function(){return new e(this.parent)},e.prototype.drawPredecessor=function(e){this.pdfGantt=e;var t,i,r=e.result.page.section.getPages(),n=e.taskbarCollection[this.parentIndex],a=e.taskbarCollection[this.childIndex],o=new u.PdfPage,s=new u.PdfPage,l="",d=0,p=0;switch(this.type){case"FS":if(!(a.startPage>-1&&n.endPage>-1))return;o=r[n.endPage],s=r[a.startPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[a.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType1":"FSType2":this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType3":"FSType4";break;case"SF":if(!(a.endPage>-1&&n.startPage>-1))return;o=r[n.startPage],s=r[a.endPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[a.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>this.childLeft+this.childWidth?"SFType1":"SFType2":this.parentLeft>this.childLeft+this.childWidth?"SFType3":"SFType4";break;case"FF":if(!(a.endPage>-1&&n.endPage>-1))return;o=r[n.endPage],s=r[a.endPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[a.endPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType1":"FFType2":this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType3":"FFType4";break;case"SS":if(!(a.startPage>-1&&n.startPage>-1))return;o=r[n.startPage],s=r[a.startPage],t=e.pdfPageDetail[n.startPage-e.chartPageIndex],i=e.pdfPageDetail[a.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>=this.childLeft?"SSType1":"SSType2":this.parentLeft>=this.childLeft?"SSType3":"SSType4"}var h=Math.round((this.parent.rowHeight-1)/2);h=k(h);var c,g,f,m,y,v;c=g=f=m=y=v=new u.PointF;var w=Ei({},n.taskStartPoint),D=Ei({},a.taskStartPoint);d=w.y+t.startPoint.y,p=D.y+i.startPoint.y;var T=new u.PointF(k(this.parentLeft+this.parentWidth),d+h),S=new u.PointF(k(this.parentLeft)-1,d+h),b=new u.PointF(k(this.childLeft-20),p+h),P=new u.PointF(k(this.childLeft-6-this.lineWidth)-1,p+h),C=new u.PointF(k(this.childLeft+this.childWidth+6+this.lineWidth)+1,p+h);switch(l){case"FSType1":case"FSType3":c=T,g=new u.PointF(k(this.childLeft-20),d+h),f=b,m=P,this.connectLines(o,s,c,g,f,m,a,h);break;case"FSType2":c=T,g=new u.PointF(c.x+10,d+h),f=new u.PointF(c.x+10,p+2),m=new u.PointF(k(this.childLeft-20),p+2),y=b,v=P,this.connectLines(o,s,c,g,f,m,a,h,y,v);break;case"FSType4":c=T,g=new u.PointF(c.x+10,d+h),f=new u.PointF(c.x+10,d+2),m=new u.PointF(k(this.childLeft-20),d+2),y=b,v=P,this.connectLines(o,s,c,g,f,m,a,h,y,v);break;case"FFType1":case"FFType3":c=new u.PointF(k(this.parentLeft+this.parentWidth)+1,d+h),g=new u.PointF(k(this.childLeft+this.childWidth+20),d+h),f=new u.PointF(g.x,p+h),m=C,this.connectLines(o,s,c,g,f,m,a,h);break;case"FFType2":case"FFType4":c=new u.PointF(k(this.parentLeft+this.parentWidth)+1,d+h),g=new u.PointF(k(this.parentLeft+this.parentWidth+20),d+h),f=new u.PointF(g.x,p+h),m=C,this.connectLines(o,s,c,g,f,m,a,h);break;case"SSType1":case"SSType3":c=S,g=new u.PointF(k(this.childLeft-20),d+h),f=new u.PointF(g.x,p+h),m=P,this.connectLines(o,s,c,g,f,m,a,h);break;case"SSType2":case"SSType4":c=S,g=new u.PointF(k(this.parentLeft-20),d+h),f=new u.PointF(g.x,p+h),m=P,this.connectLines(o,s,c,g,f,m,a,h);break;case"SFType1":case"SFType3":c=S,g=new u.PointF(k(this.childLeft+this.childWidth+20),d+h),f=new u.PointF(g.x,p+h),m=C,this.connectLines(o,s,c,g,f,m,a,h);break;case"SFType2":c=S,g=new u.PointF(k(this.parentLeft-20),d+h),f=new u.PointF(g.x,p+2),m=new u.PointF(k(this.childLeft+this.childWidth+20),p+2),y=new u.PointF(m.x,p+h),v=C,this.connectLines(o,s,c,g,f,m,a,h,y,v);break;case"SFType4":c=S,g=new u.PointF(k(this.parentLeft-20),d+h),f=new u.PointF(g.x,d+2),m=new u.PointF(k(this.childLeft+this.childWidth+20),d+2),y=new u.PointF(m.x,p+h),v=C,this.connectLines(o,s,c,g,f,m,a,h,y,v)}},e.prototype.connectLines=function(e,i,r,n,a,o,s,l,d,p){this.drawLine(e,r,n),this.drawLine(e,n,a),this.drawLine(e,a,o),t.isNullOrUndefined(d)||t.isNullOrUndefined(p)||(this.drawLine(e,o,d),this.drawLine(e,d,p)),this.drawArrow(i,s,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),o=Ei({},i),s=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){if(h&&!p)(c=this.findPageIndex(t))>-1&&(l=this.pdfGantt.pdfPageDetail[c],o=t,a=i,this.drawLine(r[c+this.pdfGantt.chartPageIndex],o,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?(s.x=i.x=g-1,o.x=g-1):f<i.x?(s.x=i.x=f,o.x=f,s.x+=1):m<i.y?(s.y=i.y=m,o.y=m,s.y+=1,this.pdfGantt.enableHeader&&(o.y+=this.parent.timelineModule.isSingleTier?k(45):k(62))):y>i.y&&(o.y=s.y=y-1,i.y=y,this.pdfGantt.enableHeader&&(s.y+=this.parent.timelineModule.isSingleTier?k(45):k(62),i.y+=this.parent.timelineModule.isSingleTier?k(45):k(62))),-1!==(c=this.findPageIndex(s))&&this.drawLine(r[c+this.pdfGantt.chartPageIndex],o,a)}}else(c=this.findPageIndex(t))>-1&&(l=this.pdfGantt.pdfPageDetail[c],o=t,a=i,this.drawLine(r[c+this.pdfGantt.chartPageIndex],o,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),w=new u.PdfPen(v,k(this.lineWidth));n.drawLine(w,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)),o=new u.PointF,s=e.section.getPages(),l=6+this.lineWidth;o="FS"===this.type||"SS"===this.type?new u.PointF(k(this.childLeft)-1,t.taskStartPoint.y+n.startPoint.y):new u.PointF(k(this.childLeft+this.childWidth)+1,t.taskStartPoint.y+n.startPoint.y);if(!this.contains(a,o.x,o.y)){var d=this.findPageIndex(o);d>-1&&(n=this.pdfGantt.pdfPageDetail[d],e=s[d+this.pdfGantt.chartPageIndex])}var p=e.graphics;o.x=o.x-n.startPoint.x+n.pageStartX,o.y=o.y-n.startPoint.y;var h=new u.PointF(o.x,o.y+i);r="FS"===this.type||"SS"===this.type?new u.PointF(h.x-k(l),h.y-k(l)):new u.PointF(h.x+k(l),h.y-k(l));var c=new u.PointF(r.x,r.y+k(2*l)),g=new u.PdfSolidBrush(this.connectorLineColor),f=new u.PdfPen(g,k(this.lineWidth));p.drawLine(f,h,r),p.drawLine(f,r,c),p.drawLine(f,c,h)},e}(),Li=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vi=function(){return(Vi=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)},Ui=function(e){function i(t){var i=e.call(this)||this;return i.exportProps={},i.parent=t,i.chartHeader=new Ii(i),i.predecessor=new Fi(t,i),i.headerDetails=[],i.pdfPageDetail=[],i.taskbarCollection=[],i.predecessorCollection=[],i}return Li(i,e),Object.defineProperty(i.prototype,"taskbar",{get:function(){return t.isNullOrUndefined(this.taskbars)&&(this.taskbars=new Oi(this.parent)),this.taskbars},enumerable:!0,configurable:!0}),i.prototype.drawChart=function(e){this.result=e,this.totalPages=this.result.page.section.count,this.perColumnPages=this.totalPages/this.layouter.columnRanges.length,this.calculateRange(),this.drawGantttChart(),this.drawPageBorder()},i.prototype.calculateRange=function(){for(var e=this.layouter.columnRanges[this.layouter.columnRanges.length-1],i=0,r=!0,n=0,a=0,o=0,s=k(this.chartHeader.width),l=this.parent.timelineModule,d=e[0];d<=e[1];d++)i+=this.layouter.treegrid.columns.getColumn(d).width;if((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);else{this.result.page.section.add();this.chartPageIndex=this.startPageIndex=this.totalPages,r=!0,this.startPoint=new u.PointF(o,0)}for(;Math.round(o)<Math.round(s);){r?n=this.result.page.getClientSize().width:(n=a,r=!0);var p={},h=[],c=k(this.chartHeader.bottomTierCellWidth),g=0;0!==this.chartHeader.bottomTierCellWidth&&(g=Math.floor(n/c)*c),h[0]=o,s-o<=g?(h[1]=s,p.totalWidth=T(s-o)):(h[1]=o+g,p.totalWidth=T(g)),p.startPoint=h[0],p.endPoint=h[1],0===this.parent.cloneProjectStartDate.getHours()&&0===this.parent.cloneProjectStartDate.getMinutes()&&0===this.parent.cloneProjectStartDate.getSeconds()&&this.parent.cloneProjectStartDate.setHours(8);var f=this.parent.dataOperation.getDateFromFormat(this.parent.cloneProjectStartDate),m=t.isNullOrUndefined(l.customTimelineSettings.bottomTier.count)?l.customTimelineSettings.topTier.count:l.customTimelineSettings.bottomTier.count;switch("None"===l.customTimelineSettings.bottomTier.unit?l.customTimelineSettings.topTier.unit:l.customTimelineSettings.bottomTier.unit){case"Minutes":p.startDate=new Date(f.getTime());var y=Math.floor(T(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(T(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 w=Math.floor(T(p.startPoint)/this.chartHeader.bottomTierCellWidth);p.startDate.setHours(p.startDate.getHours()+w*m),p.startDate.setMinutes(p.startDate.getMinutes()+1),p.endDate=new Date(p.startDate.getTime());var D=Math.floor(T(p.endPoint-p.startPoint)/this.chartHeader.bottomTierCellWidth);p.endDate.setHours(p.endDate.getHours()+D*m);break;case"Day":p.startDate=new Date(f.getTime());var S=Math.round(p.startPoint/k(this.chartHeader.bottomTierCellWidth));p.startDate.setDate(p.startDate.getDate()+S*m);var b=Math.round((p.endPoint-p.startPoint)/k(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/k(this.chartHeader.bottomTierCellWidth)*7;p.startDate.setDate(p.startDate.getDate()+P*m);var C=7*Math.round((p.endPoint-p.startPoint)/k(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/k(this.chartHeader.bottomTierCellWidth)*31;p.startDate.setDate(p.startDate.getDate()+R*m);var M=31*Math.round((p.endPoint-p.startPoint)/k(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 x=p.startPoint/k(this.chartHeader.bottomTierCellWidth)*365;p.startDate.setDate(p.startDate.getDate()+x*m);var O=365*Math.round((p.endPoint-p.startPoint)/k(this.chartHeader.bottomTierCellWidth))-1;p.endDate=new Date(p.startDate.getTime()),p.endDate.setDate(p.startDate.getDate()+O*m)}this.headerDetails.push(p),o+=g}},i.prototype.drawPageBorder=function(){for(var e=this.result.page.section.getPages(),t=0;t<e.length;t++){var i=e[t],r=i.graphics,n=i.getClientSize(),a=new u.PdfPen(new u.PdfColor(206,206,206));r.drawRectangle(a,0,0,n.width,n.height)}},i.prototype.drawGantttChart=function(){var e,t=this,i=this.startPoint,r=new u.PointF,n=0,a=0,o=0;this.headerDetails.forEach(function(s,l){var d=t.result.page.section.getPages()[t.startPageIndex];t.chartHeader.drawTimeline(d,t.startPoint,s),i.y=i.y+k(t.parent.timelineModule.isSingleTier?45:60),n=i.x,o=k(t.parent.timelineModule.isSingleTier?45:60),t.headerDetails[t.headerDetails.indexOf(s)].startIndex=t.startPageIndex,t.headerDetails[t.headerDetails.indexOf(s)].pageStartPoint=i;for(var p=0;p<t.taskbarCollection.length;p++){var h=t.taskbarCollection[p],c=t.rows.getRow(p+1).height,g=t.result.page.section.getPages()[t.startPageIndex];h.drawTaskbar(g,i,s,a,c,t.taskbarCollection[p])&&(t.enableHeader?i.y=k(t.parent.timelineModule.isSingleTier?45:60):i.y=0,t.startPageIndex++,(e={}).height=o,e.pageStartX=n,e.startPoint=Vi({},r),e.width=k(s.totalWidth),t.pdfPageDetail.push(e),r.y+=e.height,t.enableHeader?o=t.chartHeader.height:(i.y=0,o=0)),i.y+=c,o+=c}if(t.headerDetails[l].endIndex=t.startPageIndex,a+=s.totalWidth,e={},e.height=o,e.pageStartX=n,e.startPoint=Vi({},r),e.width=k(s.totalWidth),t.pdfPageDetail.push(e),r.x+=e.width,r.y=0,t.enableHeader?o=t.chartHeader.height:i.y=0,t.headerDetails.indexOf(s)!==t.headerDetails.length-1){t.result.page.section.add();t.startPageIndex=t.result.page.section.count-1,i=t.startPoint=new u.PointF(0,0)}});for(var s=0;s<this.predecessorCollection.length;s++){this.predecessorCollection[s].drawPredecessor(this)}},i}(wi),Ni=function(){function e(e){this.isPdfExport=!1,this.parent=e,this.helper=new Ri(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 Ui(this.parent)},e.prototype.export=function(e,i,r){var n=this,a={requestType:"beforePdfExport",ganttObject:this.parent,cancel:!1};return this.parent.trigger("beforePdfExport",a),t.getValue("cancel",a)?new Promise(function(e,t){return e()}):new Promise(function(t,a){n.exportWithData(r,t,e,i)})},e.prototype.exportWithData=function(e,i,r,n){var a=this,o=[];t.isNullOrUndefined(r)&&(r={}),o="CurrentViewData"===r.exportType?this.parent.currentViewData:this.parent.flatData,this.initGantt(),t.isNullOrUndefined(e)?this.pdfDocument=new u.PdfDocument:this.pdfDocument=e,this.processExport(o,r,n).then(function(){a.parent.trigger("pdfExportComplete",{}),i(a.pdfDocument)})},e.prototype.processExport=function(e,i,r){var n=this,a=this.pdfDocument.sections.add();this.processSectionExportProperties(a,i);var o=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 yi;e.break=u.PdfLayoutBreakType.FitElement;var a=n.gantt.drawGrid(o,0,0,e);return n.gantt.drawChart(a),r||(!t.isNullOrUndefined(i)&&i.fileName?n.pdfDocument.save(i.fileName):n.pdfDocument.save("Export.pdf"),n.pdfDocument.destroy()),n.pdfDocument})},e.prototype.processSectionExportProperties=function(e,i){if(t.isNullOrUndefined(i))this.gantt.ganttStyle=new di(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 di(i.theme).style;else{var n=new di(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}();e.Gantt=jt,e.parentsUntil=g,e.isScheduledTask=f,e.getSwapKey=m,e.isRemoteData=y,e.getTaskData=v,e.formatString=w,e.getIndex=D,e.pixelToPoint=k,e.pointToPixel=T,e.getUid=S,e.load="load",e.rowDataBound="rowDataBound",e.queryCellInfo="queryCellInfo",e.toolbarClick="toolbarClick",e.keyPressed="key-pressed",e.Edit=Zt,e.Reorder=Kt,e.Resize=Qt,e.Filter=Jt,e.Sort=$t,e.Dependency=Vt,e.Selection=ei,e.Toolbar=ti,e.DayMarkers=ni,e.ContextMenu=ai,e.ExcelExport=oi,e.ColumnMenu=si,e.RowDD=li,e.PdfExport=Ni,e.Column=Ue,e.DayWorkingTime=We,e.AddDialogFieldSettings=Ge,e.EditDialogFieldSettings=_e,e.EditSettings=Ze,e.EventMarker=Je,e.FilterSettings=tt,e.SearchSettings=nt,e.Holiday=st,e.LabelSettings=pt,e.SelectionSettings=ut,e.SplitterSettings=mt,e.TaskFields=wt,e.TimelineTierSettings=Tt,e.TimelineSettings=St,e.TooltipSettings=Ct,e.SortDescriptor=xt,e.SortSettings=Ot,e.ResourceFields=Ft,Object.defineProperty(e,"__esModule",{value:!0})});
  //# sourceMappingURL=ej2-gantt.umd.min.js.map
  