devexpress-gantt 2.0.28 → 2.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dx-gantt.css +2 -2
- package/dist/dx-gantt.js +3 -3
- package/dist/dx-gantt.min.css +2 -2
- package/dist/dx-gantt.min.js +3 -3
- package/package.json +1 -1
package/dist/dx-gantt.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* DevExpress Gantt (dx-gantt)
|
|
3
|
-
* Version: 2.0.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 2.0.29
|
|
4
|
+
* Build date: Tue Apr 20 2021
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
* Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
|
package/dist/dx-gantt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* DevExpress Gantt (dx-gantt)
|
|
3
|
-
* Version: 2.0.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 2.0.29
|
|
4
|
+
* Build date: Tue Apr 20 2021
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
* Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
|
|
@@ -7210,7 +7210,7 @@ var GanttView = (function () {
|
|
|
7210
7210
|
var end = typeof data.end === "string" ? new Date(data.end) : data.end;
|
|
7211
7211
|
var taskData = {
|
|
7212
7212
|
parentId: parent_1 === null || parent_1 === void 0 ? void 0 : parent_1.internalId,
|
|
7213
|
-
title:
|
|
7213
|
+
title: data.title,
|
|
7214
7214
|
start: start,
|
|
7215
7215
|
end: end,
|
|
7216
7216
|
progress: parseInt(data.progress) || 0,
|
package/dist/dx-gantt.min.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* DevExpress Gantt (dx-gantt.min)
|
|
3
|
-
* Version: 2.0.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 2.0.29
|
|
4
|
+
* Build date: Tue Apr 20 2021
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
* Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
|
package/dist/dx-gantt.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* DevExpress Gantt (dx-gantt.min)
|
|
3
|
-
* Version: 2.0.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 2.0.29
|
|
4
|
+
* Build date: Tue Apr 20 2021
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
* Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
|
|
@@ -36,4 +36,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
36
36
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
37
37
|
PERFORMANCE OF THIS SOFTWARE.
|
|
38
38
|
***************************************************************************** */
|
|
39
|
-
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var h=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function p(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||h(t,e,n)}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function T(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof v?Promise.resolve(n.value.v).then(l,c):u(o[0][2],n)}catch(e){u(o[0][3],e)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function k(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:v(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function I(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var S=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function M(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&h(t,e,n);return S(t,e),t}function E(e){return e&&e.__esModule?e:{default:e}}function D(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function b(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceAssignment=void 0;var r=n(0),i=n(10),o=n(1),s=function(e){function t(){var t=e.call(this)||this;return t.taskId="",t.resourceId="",t}return r.__extends(t,e),t.prototype.assignFromObject=function(t){o.isDefined(t)&&(e.prototype.assignFromObject.call(this,t),this.taskId=String(t.taskId),this.resourceId=String(t.resourceId))},t}(i.DataObject);t.ResourceAssignment=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;var r=function(){function e(e,t,n,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=0),this._hour=0,this._min=0,this._sec=0,this._msec=0,this._fullmsec=0,this.hour=e,this.min=t,this.sec=n,this.msec=r}return Object.defineProperty(e.prototype,"hour",{get:function(){return this._hour},set:function(e){e>=0&&e<24&&(this._hour=e,this.updateFullMilleconds())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this._min},set:function(e){e>=0&&e<60&&(this._min=e,this.updateFullMilleconds())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sec",{get:function(){return this._sec},set:function(e){e>=0&&e<60&&(this._sec=e,this.updateFullMilleconds())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"msec",{get:function(){return this._msec},set:function(e){e>=0&&e<1e3&&(this._msec=e,this.updateFullMilleconds())},enumerable:!1,configurable:!0}),e.prototype.updateFullMilleconds=function(){var e=60*(60*this._hour+this._min)+this._sec;this._fullmsec=1e3*e+this._msec},e.prototype.getTimeInMilleconds=function(){return this._fullmsec},e}();t.Time=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeRange=void 0;var r=n(2),i=function(){function e(e,t){r.DateTimeUtils.caclTimeDifference(e,t)>=0?(this._start=e,this._end=t):(this._start=t,this._end=e)}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},set:function(e){e&&r.DateTimeUtils.caclTimeDifference(e,this._end)>=0&&(this._start=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},set:function(e){e&&r.DateTimeUtils.caclTimeDifference(this._start,e)>=0&&(this._end=e)},enumerable:!1,configurable:!0}),e.prototype.isTimeInRange=function(e){return r.DateTimeUtils.caclTimeDifference(this._start,e)>=0&&r.DateTimeUtils.caclTimeDifference(e,this._end)>=0},e.prototype.hasIntersect=function(e){return this.isTimeInRange(e.start)||this.isTimeInRange(e.end)||e.isTimeInRange(this.start)||e.isTimeInRange(this.end)},e.prototype.concatWith=function(e){return!!this.hasIntersect(e)&&(this.start=r.DateTimeUtils.getMinTime(this.start,e.start),this.end=r.DateTimeUtils.getMaxTime(this.end,e.end),!0)},e}();t.TimeRange=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DayOfWeekMonthlyOccurrence=void 0,function(e){e[e.First=0]="First",e[e.Second=1]="Second",e[e.Third=2]="Third",e[e.Forth=3]="Forth",e[e.Last=4]="Last"}(t.DayOfWeekMonthlyOccurrence||(t.DayOfWeekMonthlyOccurrence={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RecurrenceFactory=void 0;var r=n(1),i=n(41),o=n(73),s=n(74),a=n(76),l=function(){function e(){}return e.createRecurrenceByType=function(e){if(!e)return null;switch(e.toLowerCase()){case"daily":return new i.Daily;case"weekly":return new o.Weekly;case"monthly":return new s.Monthly;case"yearly":return new a.Yearly}return null},e.createRecurrenceFromObject=function(e){if(!e)return null;var t=this.createRecurrenceByType(e.type);return t&&t.assignFromObject(e),t},e.getEnumValue=function(e,t){if(!r.isDefined(e[t]))return null;var n=parseInt(t);return isNaN(n)?e[t]:n},e}();t.RecurrenceFactory=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Daily=void 0;var r=n(0),i=n(16),o=n(2),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.checkDate=function(e){return!0},t.prototype.checkInterval=function(e){return o.DateTimeUtils.getDaysBetween(this.start,e)%this.interval==0},t.prototype.calculatePointByInterval=function(e){var t=this.interval;return this.isRecurrencePoint(e)||(t-=o.DateTimeUtils.getDaysBetween(this.start,e)%this.interval),o.DateTimeUtils.addDays(e,t)},t.prototype.calculateNearestPoint=function(e){return o.DateTimeUtils.addDays(e,1)},t}(i.RecurrenceBase);t.Daily=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElementTextHelperCultureInfo=t.ElementTextHelper=t.DateUtils=void 0;var r=n(14),i=n(3),o=function(){function e(){}var t;return e.getDaysInMonth=function(e,t){return new Date(t,e+1,0).getDate()},e.getOffsetInMonths=function(e,t){return 12*(t.getFullYear()-e.getFullYear())+t.getMonth()-e.getMonth()},e.getOffsetInQuarters=function(e,t){return 4*(t.getFullYear()-e.getFullYear())+Math.floor(t.getMonth()/3)-Math.floor(e.getMonth()/3)},e.getNearestScaleTickDate=function(e,t,n,r){var i=new Date,o=t.start.getTime(),s=t.end.getTime();if(i.setTime(e.getTime()),e.getTime()<o)i.setTime(o);else if(e.getTime()>s)i.setTime(s);else if(this.needCorrectDate(e,o,n,r)){var a=this.getNearestLeftTickTime(e,o,n,r),l=this.getNextTickTime(a,n,r);Math.abs(e.getTime()-a)>Math.abs(e.getTime()-l)?i.setTime(l):i.setTime(a)}return i},e.needCorrectDate=function(e,t,n,i){return i==r.ViewType.Months?e.getTime()!==new Date(e.getFullYear(),e.getMonth(),1).getTime():(e.getTime()-t)%n!=0},e.getNearestLeftTickTime=function(e,t,n,i){return i==r.ViewType.Months?new Date(e.getFullYear(),e.getMonth(),1).getTime():t+Math.floor((e.getTime()-t)/n)*n},e.getNextTickTime=function(e,t,n){if(n==r.ViewType.Months){var i=new Date;return i.setTime(e),i.setMonth(i.getMonth()+1),i.getTime()}return e+t},e.adjustStartDateByViewType=function(e,t,n){switch(void 0===n&&(n=0),t){case r.ViewType.TenMinutes:return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case r.ViewType.SixHours:case r.ViewType.Hours:return new Date(e.getFullYear(),e.getMonth(),e.getDate());case r.ViewType.Days:case r.ViewType.Weeks:return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay()+n);case r.ViewType.Months:case r.ViewType.Quarter:case r.ViewType.Years:return new Date(e.getFullYear(),0,1);default:return new Date}},e.adjustEndDateByViewType=function(e,t,n){switch(void 0===n&&(n=0),t){case r.ViewType.TenMinutes:return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours()+1);case r.ViewType.SixHours:case r.ViewType.Hours:return new Date(e.getFullYear(),e.getMonth(),e.getDate()+1);case r.ViewType.Days:case r.ViewType.Weeks:return new Date(e.getFullYear(),e.getMonth(),e.getDate()+7-e.getDay()+n);case r.ViewType.Months:case r.ViewType.Quarter:case r.ViewType.Years:return new Date(e.getFullYear()+1,0,1);default:return new Date}},e.roundStartDate=function(e,t){switch(t){case r.ViewType.TenMinutes:case r.ViewType.Hours:return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours()-1);case r.ViewType.SixHours:case r.ViewType.Days:return new Date(e.getFullYear(),e.getMonth(),e.getDate()-1);case r.ViewType.Weeks:return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case r.ViewType.Months:return new Date(e.getFullYear(),e.getMonth()-1);case r.ViewType.Quarter:case r.ViewType.Years:return new Date(e.getFullYear()-1,0,1);default:return new Date}},e.getTickTimeSpan=function(t){switch(t){case r.ViewType.TenMinutes:return e.msPerHour/6;case r.ViewType.Hours:return e.msPerHour;case r.ViewType.SixHours:return 6*e.msPerHour;case r.ViewType.Days:return e.msPerDay;case r.ViewType.Weeks:return e.msPerWeek;case r.ViewType.Months:return e.msPerMonth;case r.ViewType.Quarter:return 3*e.msPerMonth;case r.ViewType.Years:return e.msPerYear}},e.parse=function(e){return"function"==typeof e?new Date(e()):new Date(e)},e.getTimezoneOffsetDiff=function(e,t){return t.getTimezoneOffset()-e.getTimezoneOffset()},e.msPerHour=36e5,e.msPerDay=24*e.msPerHour,e.msPerWeek=7*e.msPerDay,e.msPerMonth=30*e.msPerDay,e.msPerYear=365*e.msPerDay,e.ViewTypeToScaleMap=((t={})[r.ViewType.TenMinutes]=r.ViewType.Hours,t[r.ViewType.Hours]=r.ViewType.Days,t[r.ViewType.SixHours]=r.ViewType.Days,t[r.ViewType.Days]=r.ViewType.Weeks,t[r.ViewType.Weeks]=r.ViewType.Months,t[r.ViewType.Months]=r.ViewType.Years,t[r.ViewType.Quarter]=r.ViewType.Years,t[r.ViewType.Years]=r.ViewType.FiveYears,t),e}();t.DateUtils=o;var s=function(){function e(e){this.longestAbbrMonthName=null,this.longestMonthName=null,this.longestAbbrDayName=null;var t=document.createElement("canvas");this.textMeasureContext=t.getContext("2d"),this.cultureInfo=e}return e.prototype.setFont=function(e){var t=i.DomUtils.getCurrentStyle(e),n=t.font?t.font:t.fontStyle+" "+t.fontVariant+" "+t.fontWeight+" "+t.fontSize+" / "+t.lineHeight+" "+t.fontFamily;this.textMeasureContext.font=n},e.prototype.setSettings=function(e,t,n){this.startTime=e,this.viewType=t,this.modelItems=n},e.prototype.getScaleItemStartDate=function(e,t){var n=new Date(this.startTime);switch(t){case r.ViewType.TenMinutes:n.setTime(this.startTime+e*o.msPerHour/6);break;case r.ViewType.Hours:n.setTime(this.startTime+e*o.msPerHour);break;case r.ViewType.SixHours:n.setTime(this.startTime+e*o.msPerHour*6);break;case r.ViewType.Days:n.setTime(this.startTime+e*o.msPerDay);break;case r.ViewType.Weeks:n.setTime(this.startTime+e*o.msPerWeek);break;case r.ViewType.Months:n.setMonth(n.getMonth()+e);break;case r.ViewType.Quarter:n.setMonth(n.getMonth()+3*e);break;case r.ViewType.Years:n.setFullYear(n.getFullYear()+e);break;case r.ViewType.FiveYears:n.setFullYear(n.getFullYear()+5*e)}return n=this.getScaleStartDateCorrectedWithDST(n)},e.prototype.getScaleStartDateCorrectedWithDST=function(e){var t=o.getTimezoneOffsetDiff(new Date(this.startTime),e);return t>0?new Date(e.getTime()+6e4*t):e},e.prototype.getScaleItemText=function(e,t){var n=this.getScaleItemStartDate(e,t),i=this.viewType.valueOf()==t.valueOf();switch(t){case r.ViewType.TenMinutes:return this.getTenMinutesScaleItemText(n);case r.ViewType.Hours:case r.ViewType.SixHours:return this.getHoursScaleItemText(n);case r.ViewType.Days:return this.getDaysScaleItemText(n,i);case r.ViewType.Weeks:return this.getWeeksScaleItemText(n,i);case r.ViewType.Months:return this.getMonthsScaleItemText(n,i);case r.ViewType.Quarter:return this.getQuarterScaleItemText(n,i);case r.ViewType.Years:return this.getYearsScaleItemText(n);case r.ViewType.FiveYears:return this.getFiveYearsScaleItemText(n)}},e.prototype.getTenMinutesScaleItemText=function(e){var t=e.getMinutes()+1;return(10*Math.ceil(t/10)).toString()},e.prototype.getThirtyMinutesScaleItemText=function(e){return e.getMinutes()<30?"30":"60"},e.prototype.getHoursScaleItemText=function(e){var t=e.getHours(),n=this.getHourDisplayText(t),r=t<12?this.getAmText():this.getPmText();return this.getHoursScaleItemTextCore(n,r)},e.prototype.getDaysScaleItemText=function(e,t){return this.getDayTotalText(e,!0,t,t,!t)},e.prototype.getWeeksScaleItemText=function(e,t){var n=new Date(e.getTime()+o.msPerWeek-o.msPerDay);return this.getWeeksScaleItemTextCore(this.getDayTotalText(e,t,!0,t,!t),this.getDayTotalText(n,t,!0,t,!t))},e.prototype.getMonthsScaleItemText=function(e,t){var n=this.getMonthNames(),r=t?"":e.getFullYear().toString();return this.getMonthsScaleItemTextCore(n[e.getMonth()],r)},e.prototype.getQuarterScaleItemText=function(e,t){var n=this.getQuarterNames(),r=t?"":e.getFullYear().toString();return this.getMonthsScaleItemTextCore(n[Math.floor(e.getMonth()/3)],r)},e.prototype.getYearsScaleItemText=function(e){return e.getFullYear().toString()},e.prototype.getFiveYearsScaleItemText=function(e){return e.getFullYear().toString()+" - "+(e.getFullYear()+4).toString()},e.prototype.getHourDisplayText=function(e){return this.hasAmPm()?(0==e?12:e<=12?e:e-12).toString():e<10?"0"+e:e.toString()},e.prototype.getDayTotalText=function(e,t,n,r,i){var o=r?this.getAbbrMonthNames():this.getMonthNames(),s=n?this.getAbbrDayNames():this.getDayNames(),a=t?s[e.getDay()]:"",l=e.getDate(),c=o[e.getMonth()],u=i?e.getFullYear().toString():"";return this.getDayTotalTextCore(a,l.toString(),c,u)},e.prototype.getTaskText=function(e){var t=this.modelItems[e];return t?t.task.title:""},e.prototype.getTaskVisibility=function(e){var t=this.modelItems[e];return!!t&&t.getVisible()},e.prototype.hasAmPm=function(){return this.getAmText().length>0||this.getPmText().length>0},e.prototype.getScaleItemTextTemplate=function(e){switch(e){case r.ViewType.TenMinutes:return"00";case r.ViewType.Hours:case r.ViewType.SixHours:return this.getHoursScaleItemTextCore("00",this.getAmText());case r.ViewType.Days:return this.getDayTextTemplate();case r.ViewType.Weeks:return this.getWeekTextTemplate();case r.ViewType.Months:return this.getMonthsScaleItemTextCore(this.getLongestMonthName(),"");case r.ViewType.Quarter:return"Q4";case r.ViewType.Years:return"0000"}},e.prototype.getDayTextTemplate=function(){return this.getDayTotalTextCore(this.getLongestAbbrDayName(),"00",this.getLongestAbbrMonthName(),"")},e.prototype.getWeekTextTemplate=function(){var e=this.getDayTextTemplate();return this.getWeeksScaleItemTextCore(e,e)},e.prototype.getHoursScaleItemTextCore=function(e,t){return e+":00"+(this.hasAmPm()?" "+t:"")},e.prototype.getDayTotalTextCore=function(e,t,n,r){var i=e.length>0?e+", ":"";return i+=t+" "+n,i+=r.length>0?" "+r:""},e.prototype.getWeeksScaleItemTextCore=function(e,t){return e+" - "+t},e.prototype.getMonthsScaleItemTextCore=function(e,t){var n=e;return t.length>0&&(n+=" "+t),n},e.prototype.getLongestAbbrMonthName=function(){return null==this.longestAbbrMonthName&&(this.longestAbbrMonthName=this.getLongestText(this.getAbbrMonthNames())),this.longestAbbrMonthName},e.prototype.getLongestMonthName=function(){return null==this.longestMonthName&&(this.longestMonthName=this.getLongestText(this.getMonthNames())),this.longestMonthName},e.prototype.getLongestAbbrDayName=function(){return null==this.longestAbbrDayName&&(this.longestAbbrDayName=this.getLongestText(this.getAbbrDayNames())),this.longestAbbrDayName},e.prototype.getLongestText=function(e){var t=this,n="",r=0;return e.forEach((function(e){var i=t.getTextWidth(e);i>r&&(r=i,n=e)})),n},e.prototype.getTextWidth=function(e){return Math.round(this.textMeasureContext.measureText(e).width)},e.prototype.getAmText=function(){return this.cultureInfo.amText},e.prototype.getPmText=function(){return this.cultureInfo.pmText},e.prototype.getQuarterNames=function(){return this.cultureInfo.quarterNames},e.prototype.getMonthNames=function(){return this.cultureInfo.monthNames},e.prototype.getDayNames=function(){return this.cultureInfo.dayNames},e.prototype.getAbbrMonthNames=function(){return this.cultureInfo.abbrMonthNames},e.prototype.getAbbrDayNames=function(){return this.cultureInfo.abbrDayNames},e}();t.ElementTextHelper=s;var a=function(){};t.ElementTextHelperCultureInfo=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GridElementInfo=void 0;var r=n(4),i=n(28),o=n(78),s=function(){function e(t,n,s){this.id=e.id++,this.position=new r.Point(void 0,void 0),this.size=new i.Size(0,0),this.margins=new o.Margins(void 0,void 0,void 0,void 0),this.attr={},this.style={},t&&(this.className=t),n&&this.setPosition(n),s&&this.setSize(s)}return e.prototype.setSize=function(e){this.size.width=e.width,this.size.height=e.height},e.prototype.setPosition=function(e){this.position.x=e.x,this.position.y=e.y},e.prototype.assignToElement=function(e){this.assignPosition(e),this.assignSize(e),this.assignMargins(e),this.className&&(e.className=this.className)},e.prototype.assignPosition=function(e){null!=this.position.x&&(e.style.left=this.position.x+"px"),null!=this.position.y&&(e.style.top=this.position.y+"px")},e.prototype.assignSize=function(e){this.size.width&&(e.style.width=this.size.width+"px"),this.size.height&&(e.style.height=this.size.height+"px")},e.prototype.assignMargins=function(e){this.margins.left&&(e.style.marginLeft=this.margins.left+"px"),this.margins.top&&(e.style.marginTop=this.margins.top+"px"),this.margins.right&&(e.style.marginRight=this.margins.right+"px"),this.margins.bottom&&(e.style.marginBottom=this.margins.bottom+"px")},e.prototype.setAttribute=function(e,t){this.attr[e]=t},e.id=0,e}();t.GridElementInfo=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationSettings=t.StripLine=t.StripLineSettings=t.EditingSettings=t.Settings=void 0;var r=n(14),i=n(1),o=function(){function e(){this.viewType=void 0,this.taskTitlePosition=r.TaskTitlePosition.Inside,this.showResources=!0,this.areHorizontalBordersEnabled=!0,this.areVerticalBordersEnabled=!0,this.areAlternateRowsEnabled=!0,this.allowSelectTask=!0,this.firstDayOfWeek=0,this.editing=new s,this.validation=new c,this.stripLines=new a}return e.parse=function(t){var n=new e;return t&&(i.isDefined(t.viewType)&&(n.viewType=t.viewType),i.isDefined(t.taskTitlePosition)&&(n.taskTitlePosition=t.taskTitlePosition),i.isDefined(t.showResources)&&(n.showResources=t.showResources),i.isDefined(t.areHorizontalBordersEnabled)&&(n.areHorizontalBordersEnabled=t.areHorizontalBordersEnabled),i.isDefined(t.areVerticalBordersEnabled)&&(n.areHorizontalBordersEnabled=t.areHorizontalBordersEnabled),i.isDefined(t.areAlternateRowsEnabled)&&(n.areAlternateRowsEnabled=t.areAlternateRowsEnabled),i.isDefined(t.allowSelectTask)&&(n.allowSelectTask=t.allowSelectTask),i.isDefined(t.firstDayOfWeek)&&(n.firstDayOfWeek=t.firstDayOfWeek),i.isDefined(t.editing)&&(n.editing=s.parse(t.editing)),i.isDefined(t.validation)&&(n.validation=c.parse(t.validation)),i.isDefined(t.stripLines)&&(n.stripLines=a.parse(t.stripLines)),i.isDefined(t.taskTooltipContentTemplate)&&(n.taskTooltipContentTemplate=t.taskTooltipContentTemplate)),n},e.prototype.equal=function(e){var t=!0;return t=(t=(t=(t=(t=(t=(t=(t=(t=t&&this.viewType===e.viewType)&&this.taskTitlePosition===e.taskTitlePosition)&&this.showResources===e.showResources)&&this.areHorizontalBordersEnabled===e.areHorizontalBordersEnabled)&&this.areAlternateRowsEnabled===e.areAlternateRowsEnabled)&&this.allowSelectTask===e.allowSelectTask)&&this.editing.equal(e.editing))&&this.validation.equal(e.validation))&&this.stripLines.equal(e.stripLines)},e}();t.Settings=o;var s=function(){function e(){this.enabled=!1,this.allowDependencyDelete=!0,this.allowDependencyInsert=!0,this.allowTaskDelete=!0,this.allowTaskInsert=!0,this.allowTaskUpdate=!0,this.allowResourceDelete=!0,this.allowResourceInsert=!0,this.allowResourceUpdate=!0,this.allowTaskResourceUpdate=!0}return e.parse=function(t){var n=new e;return t&&(i.isDefined(t.enabled)&&(n.enabled=t.enabled),i.isDefined(t.allowDependencyDelete)&&(n.allowDependencyDelete=t.allowDependencyDelete),i.isDefined(t.allowDependencyInsert)&&(n.allowDependencyInsert=t.allowDependencyInsert),i.isDefined(t.allowTaskDelete)&&(n.allowTaskDelete=t.allowTaskDelete),i.isDefined(t.allowTaskInsert)&&(n.allowTaskInsert=t.allowTaskInsert),i.isDefined(t.allowTaskUpdate)&&(n.allowTaskUpdate=t.allowTaskUpdate),i.isDefined(t.allowResourceDelete)&&(n.allowResourceDelete=t.allowResourceDelete),i.isDefined(t.allowResourceInsert)&&(n.allowResourceInsert=t.allowResourceInsert),i.isDefined(t.allowResourceUpdate)&&(n.allowResourceUpdate=t.allowResourceUpdate),i.isDefined(t.allowTaskResourceUpdate)&&(n.allowTaskResourceUpdate=t.allowTaskResourceUpdate)),n},e.prototype.equal=function(e){var t=!0;return t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t&&this.enabled===e.enabled)&&this.allowDependencyDelete===e.allowDependencyDelete)&&this.allowDependencyInsert===e.allowDependencyInsert)&&this.allowTaskDelete===e.allowTaskDelete)&&this.allowTaskInsert===e.allowTaskInsert)&&this.allowTaskUpdate===e.allowTaskUpdate)&&this.allowResourceDelete===e.allowResourceDelete)&&this.allowResourceInsert===e.allowResourceInsert)&&this.allowResourceUpdate===e.allowResourceUpdate)&&this.allowTaskResourceUpdate===e.allowTaskResourceUpdate},e}();t.EditingSettings=s;var a=function(){function e(){this.showCurrentTime=!1,this.currentTimeUpdateInterval=6e4,this.stripLines=[]}return e.parse=function(t){var n=new e;if(t&&(i.isDefined(t.showCurrentTime)&&(n.showCurrentTime=t.showCurrentTime),i.isDefined(t.currentTimeUpdateInterval)&&(n.currentTimeUpdateInterval=t.currentTimeUpdateInterval),i.isDefined(t.currentTimeTitle)&&(n.currentTimeTitle=t.currentTimeTitle),i.isDefined(t.currentTimeCssClass)&&(n.currentTimeCssClass=t.currentTimeCssClass),i.isDefined(t.stripLines)))for(var r=0;r<t.stripLines.length;r++)n.stripLines.push(l.parse(t.stripLines[r]));return n},e.prototype.equal=function(e){var t=!0;if(t=(t=(t=(t=(t=t&&this.showCurrentTime==e.showCurrentTime)&&this.currentTimeUpdateInterval==e.currentTimeUpdateInterval)&&this.currentTimeTitle==e.currentTimeTitle)&&this.currentTimeCssClass==e.currentTimeCssClass)&&this.stripLines.length===e.stripLines.length)for(var n=0;n<e.stripLines.length;n++)t=t&&this.stripLines[n].equal(e.stripLines[n]);return t},e}();t.StripLineSettings=a;var l=function(){function e(e,t,n,r,i){this.isCurrent=!1,this.start=e,this.end=t,this.title=n,this.cssClass=r,this.isCurrent=i}return e.parse=function(t){var n=new e;return t&&(i.isDefined(t.start)&&(n.start=t.start),i.isDefined(t.end)&&(n.end=t.end),i.isDefined(t.title)&&(n.title=t.title),i.isDefined(t.cssClass)&&(n.cssClass=t.cssClass)),n},e.prototype.clone=function(){return new e(this.start,this.end,this.title,this.cssClass,this.isCurrent)},e.prototype.equal=function(e){var t=!0;return t=(t=(t=(t=t&&this.start==e.start)&&this.end==e.end)&&this.title==e.title)&&this.cssClass==e.cssClass},e}();t.StripLine=l;var c=function(){function e(){this.validateDependencies=!1,this.autoUpdateParentTasks=!1}return e.parse=function(t){var n=new e;return t&&(i.isDefined(t.validateDependencies)&&(n.validateDependencies=t.validateDependencies),i.isDefined(t.autoUpdateParentTasks)&&(n.autoUpdateParentTasks=t.autoUpdateParentTasks)),n},e.prototype.equal=function(e){var t=!0;return t=(t=t&&this.validateDependencies==e.validateDependencies)&&this.autoUpdateParentTasks==e.autoUpdateParentTasks},e}();t.ValidationSettings=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskEditController=void 0;var r=n(14),i=n(9),o=n(3),s=n(5),a=function(){function e(e){this.taskIndex=-1,this.successorIndex=-1,this.editing=!1,this.gantt=e,this.createElements()}return Object.defineProperty(e.prototype,"taskId",{get:function(){return this.gantt.viewModel.items[this.taskIndex].task.internalId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"successorId",{get:function(){return this.gantt.viewModel.items[this.successorIndex].task.internalId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"task",{get:function(){return this.gantt.viewModel.items[this.taskIndex].task},enumerable:!1,configurable:!0}),e.prototype.show=function(t){this.editing||(this.taskIndex=t,this.updateWrapInfo(),this.wrapInfo.assignPosition(this.baseElement),this.wrapInfo.assignSize(this.baseElement),this.gantt.taskArea.appendChild(this.baseElement),this.baseElement.className=e.CLASSNAMES.TASK_EDIT_BOX,this.gantt.settings.editing.enabled&&this.gantt.settings.editing.allowDependencyInsert||(this.baseElement.className=this.baseElement.className+" hide-dependency"),this.task.isMilestone()?this.baseElement.className=this.baseElement.className+" milestone":(this.gantt.settings.editing.enabled&&this.gantt.settings.editing.allowTaskUpdate&&this.canUpdateTask()||(this.baseElement.className=this.baseElement.className+" hide-updating"),this.progressEdit.style.left=this.task.progress/100*this.wrapInfo.size.width-this.progressEdit.offsetWidth/2+"px"),this.taskDateRange=new i.DateRange(this.task.start,this.task.end))},e.prototype.hide=function(){var e=this.baseElement.parentNode;e&&e.removeChild(this.baseElement),this.tooltip.hide()},e.prototype.showTaskInfo=function(e,t){void 0===t&&(t=500),this.tooltip.showInfo(this.task,e,t,this.gantt.settings.taskTooltipContentTemplate)},e.prototype.updateWrapInfo=function(){this.wrapInfo=this.getTaskWrapperElementInfo(this.taskIndex),this.wrapInfo.position.x--},e.prototype.showDependencySuccessor=function(e){if(this.successorIndex!=e&&this.taskIndex!=e){this.successorIndex=e;var t=this.getTaskWrapperElementInfo(e);t.assignPosition(this.dependencySuccessorBaseElement),t.assignSize(this.dependencySuccessorBaseElement),t.assignSize(this.dependencySuccessorFrame),this.gantt.taskArea.appendChild(this.dependencySuccessorBaseElement)}},e.prototype.hideDependencySuccessor=function(){var e=this.dependencySuccessorBaseElement.parentNode;e&&e.removeChild(this.dependencySuccessorBaseElement),this.successorIndex=-1},e.prototype.processProgress=function(e){this.editing=!0;var t=e.x-this.wrapInfo.position.x,n=0;e.x>this.wrapInfo.position.x&&(n=e.x<this.wrapInfo.position.x+this.wrapInfo.size.width?Math.round(t/this.baseElement.clientWidth*100):100),this.progressEdit.style.left=n/100*this.wrapInfo.size.width-this.progressEdit.offsetWidth/2+"px",this.tooltip.showProgress(n,o.DomUtils.getAbsolutePositionX(this.progressEdit)+this.progressEdit.offsetWidth/2)},e.prototype.confirmProgress=function(){this.editing=!1;var e=Math.round((this.progressEdit.offsetLeft+this.progressEdit.offsetWidth/2)/this.wrapInfo.size.width*100);this.gantt.commandManager.changeTaskProgressCommand.execute(this.taskId,e)},e.prototype.processEnd=function(e){this.baseElement.className=this.baseElement.className+" move",this.editing=!0;var t=e.x>this.wrapInfo.position.x?e.x:this.wrapInfo.position.x,n=t-this.wrapInfo.position.x;this.baseElement.style.width=(n<1?0:n)+"px";var r=this.task.start,i=this.gantt.gridLayoutCalculator.getDateByPos(t);i.setSeconds(0),i<r||n<1?this.taskDateRange.end.setTime(r.getTime()):this.taskDateRange.end=this.getNewDate(this.task.end,i),this.tooltip.showTime(r,this.taskDateRange.end,o.DomUtils.getAbsolutePositionX(this.baseElement)+this.baseElement.clientWidth)},e.prototype.confirmEnd=function(){this.baseElement.className=e.CLASSNAMES.TASK_EDIT_BOX,this.editing=!1,this.gantt.commandManager.changeTaskEndCommand.execute(this.taskId,this.taskDateRange.end),this.hide(),this.updateWrapInfo()},e.prototype.processStart=function(e){this.baseElement.className=this.baseElement.className+" move",this.editing=!0;var t=e.x<this.wrapInfo.position.x+this.wrapInfo.size.width?e.x:this.wrapInfo.position.x+this.wrapInfo.size.width,n=this.wrapInfo.size.width-(t-this.wrapInfo.position.x);this.baseElement.style.left=t+"px",this.baseElement.style.width=(n<1?0:n)+"px";var r=this.task.end,i=this.gantt.gridLayoutCalculator.getDateByPos(t);i.setSeconds(0),i>r||n<1?this.taskDateRange.start.setTime(r.getTime()):this.taskDateRange.start=this.getNewDate(this.task.start,i),this.tooltip.showTime(this.taskDateRange.start,r,o.DomUtils.getAbsolutePositionX(this.baseElement))},e.prototype.confirmStart=function(){this.baseElement.className=e.CLASSNAMES.TASK_EDIT_BOX,this.editing=!1,this.gantt.commandManager.changeTaskStartCommand.execute(this.taskId,this.taskDateRange.start),this.hide(),this.updateWrapInfo()},e.prototype.processMove=function(e){if(this.gantt.settings.editing.enabled&&this.gantt.settings.editing.allowTaskUpdate){this.baseElement.className=this.baseElement.className+" move";var t=this.baseElement.offsetLeft+e;this.baseElement.style.left=t+"px";var n=this.gantt.gridLayoutCalculator.getDateByPos(t);this.taskDateRange.start=this.getNewDate(this.task.start,n);var r=this.task.start.getTime()-this.taskDateRange.start.getTime(),i=new Date(this.task.end.getTime()-r);return this.taskDateRange.end=this.getNewDate(this.task.end,i),this.editing=this.gantt.modelManipulator.dispatcher.raiseTaskMoving(this.task,this.taskDateRange.start,this.taskDateRange.end,this.onTaskMovingCallback.bind(this)),this.editing&&this.tooltip.showTime(this.taskDateRange.start,this.taskDateRange.end,o.DomUtils.getAbsolutePositionX(this.baseElement)),this.editing}return!0},e.prototype.onTaskMovingCallback=function(e,t){if(this.taskDateRange.start!==e||this.taskDateRange.end!==t){var n=this.gantt.gridLayoutCalculator,r=n.getPosByDate(e),i=n.getPosByDate(t)-r;this.baseElement.style.left=r+"px",this.baseElement.style.width=(i<1?0:i)+"px",this.taskDateRange.start=e,this.taskDateRange.end=t}},e.prototype.confirmMove=function(){this.gantt.settings.editing.enabled&&this.gantt.settings.editing.allowTaskUpdate&&(this.gantt.settings.editing.allowDependencyInsert||(this.baseElement.className=this.baseElement.className+" hide-dependency"),this.editing&&(this.baseElement.className=e.CLASSNAMES.TASK_EDIT_BOX,this.gantt.commandManager.taskMoveCommand.execute(this.taskId,this.taskDateRange.start,this.taskDateRange.end),this.updateWrapInfo(),this.hide(),this.editing=!1))},e.prototype.getNewDate=function(e,t){if(this.gantt.settings.viewType>r.ViewType.SixHours){var n=t.getFullYear(),i=t.getMonth(),o=t.getDate(),s=this.gantt.settings.viewType==r.ViewType.Days?t.getHours():e.getHours(),a=e.getMinutes(),l=e.getSeconds(),c=e.getMilliseconds();return new Date(n,i,o,s,a,l,c)}return t},e.prototype.startDependency=function(t){this.dependencyLine=document.createElement("DIV"),this.dependencyLine.className=e.CLASSNAMES.TASK_EDIT_DEPENDENCY_LINE,this.gantt.taskArea.appendChild(this.dependencyLine),this.startPosition=t},e.prototype.processDependency=function(e){this.editing=!0,this.drawline(this.startPosition,e)},e.prototype.endDependency=function(e){this.editing=!1,null!=e&&this.gantt.commandManager.createDependencyCommand.execute(this.task.internalId,this.successorId,e);var t=this.dependencyLine.parentNode;t&&t.removeChild(this.dependencyLine),this.dependencyLine=null,this.hideDependencySuccessor(),this.hide()},e.prototype.selectDependency=function(e){this.gantt.settings.editing.allowDependencyDelete&&(this.dependencyId=e)},e.prototype.isDependencySelected=function(e){return this.dependencyId&&this.dependencyId==e},e.prototype.deleteSelectedDependency=function(){this.dependencyId&&this.gantt.commandManager.removeDependencyCommand.execute(this.dependencyId)},e.prototype.getTaskWrapperElementInfo=function(e){var t=this.gantt.gridLayoutCalculator,n=t.getTaskWrapperElementInfo(e);return n.size.width=t.getTaskWidth(e),n.size.height=t.getTaskHeight(e),n},e.prototype.createElements=function(){this.baseElement=document.createElement("DIV"),this.baseFrame=document.createElement("DIV"),this.baseFrame.className=e.CLASSNAMES.TASK_EDIT_FRAME,this.baseElement.appendChild(this.baseFrame),this.progressEdit=document.createElement("DIV"),this.progressEdit.className=e.CLASSNAMES.TASK_EDIT_PROGRESS,this.baseFrame.appendChild(this.progressEdit),this.progressEdit.appendChild(document.createElement("DIV")),this.dependencyFinish=document.createElement("DIV"),this.dependencyFinish.classList.add(e.CLASSNAMES.TASK_EDIT_DEPENDENCY_RIGTH),s.Browser.TouchUI&&this.dependencyFinish.classList.add(e.CLASSNAMES.TASK_EDIT_TOUCH),this.baseFrame.appendChild(this.dependencyFinish),this.dependencyStart=document.createElement("DIV"),this.dependencyStart.classList.add(e.CLASSNAMES.TASK_EDIT_DEPENDENCY_LEFT),s.Browser.TouchUI&&this.dependencyStart.classList.add(e.CLASSNAMES.TASK_EDIT_TOUCH),this.baseFrame.appendChild(this.dependencyStart),this.startEdit=document.createElement("DIV"),this.startEdit.className=e.CLASSNAMES.TASK_EDIT_START,this.baseFrame.appendChild(this.startEdit),this.endEdit=document.createElement("DIV"),this.endEdit.className=e.CLASSNAMES.TASK_EDIT_END,this.baseFrame.appendChild(this.endEdit),this.dependencySuccessorBaseElement=document.createElement("DIV"),this.dependencySuccessorBaseElement.className=e.CLASSNAMES.TASK_EDIT_BOX_SUCCESSOR,this.dependencySuccessorFrame=document.createElement("DIV"),this.dependencySuccessorFrame.className=e.CLASSNAMES.TASK_EDIT_FRAME_SUCCESSOR,this.dependencySuccessorBaseElement.appendChild(this.dependencySuccessorFrame),this.dependencySuccessorStart=document.createElement("DIV"),this.dependencySuccessorStart.classList.add(e.CLASSNAMES.TASK_EDIT_SUCCESSOR_DEPENDENCY_RIGTH),s.Browser.TouchUI&&this.dependencySuccessorStart.classList.add(e.CLASSNAMES.TASK_EDIT_TOUCH),this.dependencySuccessorFrame.appendChild(this.dependencySuccessorStart),this.dependencySuccessorFinish=document.createElement("DIV"),this.dependencySuccessorFinish.classList.add(e.CLASSNAMES.TASK_EDIT_SUCCESSOR_DEPENDENCY_LEFT),s.Browser.TouchUI&&this.dependencySuccessorFinish.classList.add(e.CLASSNAMES.TASK_EDIT_TOUCH),this.dependencySuccessorFrame.appendChild(this.dependencySuccessorFinish),this.tooltip=new l(this.baseElement,this.gantt,this.gantt.elementTextHelper.cultureInfo),this.attachEvents()},e.prototype.attachEvents=function(){this.onMouseLeaveHandler=function(){this.editing||this.hide()}.bind(this),this.baseElement.addEventListener("mouseleave",this.onMouseLeaveHandler)},e.prototype.drawline=function(e,t){if(e.x>t.x){var n=t;t=e,e=n}var r=Math.atan((e.y-t.y)/(t.x-e.x));r=-(r=180*r/Math.PI);var i=Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y));this.dependencyLine.style.left=e.x+"px",this.dependencyLine.style.top=e.y+"px",this.dependencyLine.style.width=i+"px",this.dependencyLine.style.transform="rotate("+r+"deg)"},e.prototype.canUpdateTask=function(){return!this.gantt.viewModel.isTaskToCalculateByChildren(this.task.internalId)},e.prototype.detachEvents=function(){this.baseElement.removeEventListener("mouseleave",this.onMouseLeaveHandler)},e.CLASSNAMES={TASK_EDIT_BOX:"dx-gantt-task-edit-wrapper",TASK_EDIT_FRAME:"dx-gantt-task-edit-frame",TASK_EDIT_PROGRESS:"dx-gantt-task-edit-progress",TASK_EDIT_DEPENDENCY_RIGTH:"dx-gantt-task-edit-dependency-r",TASK_EDIT_DEPENDENCY_LEFT:"dx-gantt-task-edit-dependency-l",TASK_EDIT_START:"dx-gantt-task-edit-start",TASK_EDIT_END:"dx-gantt-task-edit-end",TASK_EDIT_DEPENDENCY_LINE:"dx-gantt-task-edit-dependency-line",TASK_EDIT_BOX_SUCCESSOR:"dx-gantt-task-edit-wrapper-successor",TASK_EDIT_FRAME_SUCCESSOR:"dx-gantt-task-edit-frame-successor",TASK_EDIT_SUCCESSOR_DEPENDENCY_RIGTH:"dx-gantt-task-edit-successor-dependency-r",TASK_EDIT_SUCCESSOR_DEPENDENCY_LEFT:"dx-gantt-task-edit-successor-dependency-l",TASK_EDIT_TOUCH:"dx-gantt-edit-touch"},e}();t.TaskEditController=a;var l=function(){function e(t,n,r){this.parentElement=t,this.baseElement=document.createElement("DIV"),this.baseElement.className=e.CLASSNAMES.TASK_EDIT_PROGRESS_STATUS,t.appendChild(this.baseElement),this.owner=n,this.cultureInfo=r}return e.prototype.setDefaultTooltip=function(t){this.defaultTooltip=document.createElement("DIV"),this.defaultTooltip.className=e.CLASSNAMES.TASK_EDIT_TOOLTIP_DEFAULT;var n=document.createElement("DIV");n.className=e.CLASSNAMES.TASK_EDIT_TASK_TITLE;var r=document.createElement("SPAN");if(n.appendChild(r),this.defaultTooltip.appendChild(n),r.innerText=t.title,this.defaultTooltip.appendChild(this.getTimeContent(t.start,t.end)),!isNaN(t.progress)){var i=document.createElement("DIV");i.className=e.CLASSNAMES.TASK_EDIT_PROGRESS_STATUS_TIME;var o=document.createElement("SPAN"),s=document.createElement("SPAN");i.appendChild(o),i.appendChild(s),this.defaultTooltip.appendChild(i),o.innerText=(this.cultureInfo.progress?this.cultureInfo.progress:"Progress")+": ",s.innerText=t.progress+"%"}this.baseElement.appendChild(this.defaultTooltip)},e.prototype.showInfo=function(e,t,n,r){var i=this;void 0===n&&(n=0);var o=!0;if(this.owner.destroyTemplate(this.baseElement),r?o=r(this.baseElement,e):this.setDefaultTooltip(e),o=o&&!!this.baseElement.innerHTML){var s=function(){i.show(t,!1)};n?this.timerId=setTimeout(s,n):s()}},e.prototype.showProgress=function(t,n){this.owner.destroyTemplate(this.baseElement),this.defaultTooltip=document.createElement("DIV"),this.defaultTooltip.className=e.CLASSNAMES.TASK_EDIT_TOOLTIP_DEFAULT,this.defaultTooltip.innerText=t+"%",this.baseElement.appendChild(this.defaultTooltip),this.show(n)},e.prototype.showTime=function(t,n,r){this.owner.destroyTemplate(this.baseElement),this.defaultTooltip=document.createElement("DIV"),this.defaultTooltip.className=e.CLASSNAMES.TASK_EDIT_TOOLTIP_DEFAULT,this.defaultTooltip.appendChild(this.getTimeContent(t,n)),this.baseElement.appendChild(this.defaultTooltip),this.show(r)},e.prototype.show=function(t,n){var r,i,s,a,l=this;void 0===n&&(n=!0);null===(r=this.defaultTooltip)||void 0===r||r.classList.remove(e.CLASSNAMES.TASK_EDIT_TOOLTIP_ARROW_AFTER),null===(i=this.defaultTooltip)||void 0===i||i.classList.remove(e.CLASSNAMES.TASK_EDIT_TOOLTIP_ARROW_BEFORE),this.baseElement.style.display="block";var c=o.DomUtils.getAbsolutePositionY(this.parentElement),u=t-o.DomUtils.getAbsolutePositionX(this.parentElement)-10,d=c-this.owner.header.clientHeight-o.DomUtils.getDocumentScrollTop()-15,h=this.baseElement.clientHeight>d||this.baseElement.clientHeight>this.parentElement.offsetTop,p=-this.baseElement.clientHeight-5;h?(p=this.parentElement.clientHeight+5,null===(s=this.defaultTooltip)||void 0===s||s.classList.add(e.CLASSNAMES.TASK_EDIT_TOOLTIP_ARROW_AFTER)):null===(a=this.defaultTooltip)||void 0===a||a.classList.add(e.CLASSNAMES.TASK_EDIT_TOOLTIP_ARROW_BEFORE),this.baseElement.style.left=u+"px",this.baseElement.style.top=p+"px",n&&(this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout((function(){l.baseElement.style.display="none"}),1500))},e.prototype.hide=function(){this.baseElement.style.display="none",clearTimeout(this.timerId)},e.prototype.getTimeContent=function(t,n){var r=document.createElement("TABLE");r.className=e.CLASSNAMES.TASK_EDIT_PROGRESS_STATUS_TIME;var i=document.createElement("TBODY");r.appendChild(i);var o=document.createElement("TR"),s=document.createElement("TD"),a=document.createElement("TD"),l=document.createElement("TR"),c=document.createElement("TD"),u=document.createElement("TD");return o.appendChild(s),o.appendChild(a),l.appendChild(c),l.appendChild(u),i.appendChild(o),i.appendChild(l),s.innerText=(this.cultureInfo.start?this.cultureInfo.start:"Start")+": ",a.innerText=this.formatDate(t),c.innerText=(this.cultureInfo.end?this.cultureInfo.end:"End")+": ",u.innerText=this.formatDate(n),r},e.prototype.formatDate=function(e){return this.owner.getDateFormat(e)},e.CLASSNAMES={TASK_EDIT_PROGRESS_STATUS:"dx-gantt-task-edit-tooltip",TASK_EDIT_TOOLTIP_DEFAULT:"dx-gantt-task-edit-tooltip-default",TASK_EDIT_TASK_TITLE:"dx-gantt-task-title",TASK_EDIT_PROGRESS_STATUS_TIME:"dx-gantt-status-time",TASK_EDIT_TOOLTIP_ARROW_BEFORE:"dx-gantt-task-edit-tooltip-before",TASK_EDIT_TOOLTIP_ARROW_AFTER:"dx-gantt-task-edit-tooltip-after"},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryItemState=void 0;var r=function(e,t){this.id=e,this.value=t};t.HistoryItemState=r},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.HandlerBase=void 0;var i=n(8),o=n(45),s=function(){function e(e){this.control=e,this.switchToDefaultState()}return e.prototype.switchState=function(e){this.state&&this.state.finish(),this.state=e,this.state.start()},e.prototype.switchToDefaultState=function(){throw new Error("Not implemented")},e.prototype.getEventSource=function(t){var n=(t.nodeType===Node.ELEMENT_NODE?t:t.parentNode).classList[0];return e.classToSource[n]||i.MouseEventSource.TaskArea},e.classToSource=((r={})[o.TaskEditController.CLASSNAMES.TASK_EDIT_PROGRESS]=i.MouseEventSource.TaskEdit_Progress,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_START]=i.MouseEventSource.TaskEdit_Start,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_END]=i.MouseEventSource.TaskEdit_End,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_FRAME]=i.MouseEventSource.TaskEdit_Frame,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_DEPENDENCY_RIGTH]=i.MouseEventSource.TaskEdit_DependencyStart,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_DEPENDENCY_LEFT]=i.MouseEventSource.TaskEdit_DependencyFinish,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_SUCCESSOR_DEPENDENCY_RIGTH]=i.MouseEventSource.Successor_DependencyStart,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_SUCCESSOR_DEPENDENCY_LEFT]=i.MouseEventSource.Successor_DependencyFinish,r),e}();t.HandlerBase=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandlerDependencyState=t.dependencyMap=void 0;var r=n(0),i=n(4),o=n(3),s=n(6),a=n(29),l=n(8),c=n(11);t.dependencyMap=[],t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyStart]=[],t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyFinish]=[],t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyStart][l.MouseEventSource.Successor_DependencyStart]=c.DependencyType.SS,t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyStart][l.MouseEventSource.Successor_DependencyFinish]=c.DependencyType.SF,t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyFinish][l.MouseEventSource.Successor_DependencyStart]=c.DependencyType.FS,t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyFinish][l.MouseEventSource.Successor_DependencyFinish]=c.DependencyType.FF;var u=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(n,e),n.prototype.onMouseDown=function(e){var t=s.EvtUtils.getEventSource(e);this.source=this.handler.getEventSource(t);var n=this.getRelativePos(new i.Point(o.DomUtils.getAbsolutePositionX(t)+t.clientWidth/2,o.DomUtils.getAbsolutePositionY(t)+t.clientHeight/2));this.handler.control.taskEditController.startDependency(n)},n.prototype.onMouseUp=function(e){if(e instanceof PointerEvent){var n=this.getRelativePos(new i.Point(o.DomUtils.getAbsolutePositionX(this.handler.control.taskEditController.dependencySuccessorStart)+this.handler.control.taskEditController.dependencySuccessorStart.clientWidth/2,o.DomUtils.getAbsolutePositionY(this.handler.control.taskEditController.dependencySuccessorStart)+this.handler.control.taskEditController.dependencySuccessorStart.clientHeight/2)),r=this.getRelativePos(new i.Point(o.DomUtils.getAbsolutePositionX(this.handler.control.taskEditController.dependencySuccessorFinish)+this.handler.control.taskEditController.dependencySuccessorFinish.clientWidth/2,o.DomUtils.getAbsolutePositionY(this.handler.control.taskEditController.dependencySuccessorFinish)+this.handler.control.taskEditController.dependencySuccessorFinish.clientHeight/2)),a=this.getRelativePos(new i.Point(s.EvtUtils.getEventX(e),s.EvtUtils.getEventY(e))),c=(u=this.isTouchNearby(a,n)?l.MouseEventSource.Successor_DependencyStart:this.isTouchNearby(a,r)?l.MouseEventSource.Successor_DependencyFinish:null)===l.MouseEventSource.Successor_DependencyStart||u==l.MouseEventSource.Successor_DependencyFinish?t.dependencyMap[this.source][u]:null;this.handler.control.taskEditController.endDependency(c)}else{var u;c=(u=this.handler.getEventSource(s.EvtUtils.getEventSource(e)))===l.MouseEventSource.Successor_DependencyStart||u==l.MouseEventSource.Successor_DependencyFinish?t.dependencyMap[this.source][u]:null;this.handler.control.taskEditController.endDependency(c)}this.handler.switchToDefaultState()},n.prototype.onMouseMove=function(e){e.preventDefault();var t=this.getRelativePos(new i.Point(s.EvtUtils.getEventX(e),s.EvtUtils.getEventY(e))),n=Math.floor(t.y/this.handler.control.tickSize.height);this.handler.control.taskEditController.processDependency(t),this.handler.control.viewModel.tasks.items[n]&&this.handler.control.taskEditController.showDependencySuccessor(n)},n.prototype.isTouchNearby=function(e,t){return Math.abs(t.x-e.x)<=10&&Math.abs(t.y-e.y)<=10},n}(a.MouseHandlerStateBase);t.MouseHandlerDependencyState=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerStateBase=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){},t.prototype.onDoubleTap=function(e){},t.prototype.onTouchEnd=function(e){},t.prototype.onTouchMove=function(e){},t}(n(19).HandlerStateBase);t.TouchHandlerStateBase=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskEditDialogShowingArguments=t.TaskUpdatingArguments=t.TaskRemovingArguments=t.TaskInsertingArguments=void 0;var r=n(0),i=n(20),o=function(e){function t(t,n){var r=e.call(this,t)||this;return r.values=null!=n?n:{},r}return r.__extends(t,e),Object.defineProperty(t.prototype,"start",{get:function(){return this.values.start},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.values.end},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.values.title},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.values.progress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentId",{get:function(){return this.values.parentId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.values.color},enumerable:!1,configurable:!0}),t}(i.BaseArguments);t.TaskInsertingArguments=o;var s=function(e){function t(t){var n=e.call(this,t.id)||this;return n.values=t,n}return r.__extends(t,e),t}(i.BaseArguments);t.TaskRemovingArguments=s;var a=function(e){function t(t,n,r){var i=e.call(this,t.id)||this;return i.values=t,i.createNewValues(n,r),i}return r.__extends(t,e),t.prototype.createNewValues=function(e,t){var n=this;this.newValues={};for(var r=function(r){var o=e[r];i.newValues[o]=t[r],Object.defineProperty(i,o,{get:function(){return n.newValues[o]}})},i=this,o=0;o<e.length;o++)r(o)},t}(i.BaseArguments);t.TaskUpdatingArguments=a;var l=function(e){function t(t){var n=e.call(this,t.id)||this;return n.values={start:t.start,end:t.end,title:t.title,progress:t.progress},n.hiddenFields=t.hiddenFields,n.readOnlyFields=t.readOnlyFields,n}return r.__extends(t,e),t}(i.BaseArguments);t.TaskEditDialogShowingArguments=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoveTaskHistoryItem=t.CreateTaskHistoryItem=void 0;var r=n(0),i=n(12),o=n(21),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.data=n,r}return r.__extends(t,e),t.prototype.redo=function(){this.taskId=this.modelManipulator.task.create(this.data,this.taskId?this.taskId:null).internalId},t.prototype.undo=function(){this.modelManipulator.task.remove(this.taskId)},t}(i.HistoryItem);t.CreateTaskHistoryItem=s;var a=function(e){function t(t){var n=e.call(this)||this;return n.taskIds=[],n.tasks=[],n.modelManipulator=t,n}return r.__extends(t,e),t.prototype.redo=function(){var t=this;e.prototype.redo.call(this),this.taskIds.forEach((function(e){t.tasks.push(t.modelManipulator.task.remove(e))}))},t.prototype.undo=function(){var t=this;if(this.tasks.length){var n=this.tasks.shift();this.modelManipulator.task.create(n,n.internalId,(function(){t.modelManipulator.task.properties.progress.setValue(n.internalId,n.progress),n.color&&t.modelManipulator.task.properties.color.setValue(n.internalId,n.color),t.tasks.length?t.undo():e.prototype.undo.call(t)}))}},t.prototype.undoItemsQuery=function(){for(;this.tasks.length;){var t=this.tasks.shift();this.modelManipulator.task.create(t,t.internalId,(function(){})),this.modelManipulator.task.properties.progress.setValue(t.internalId,t.progress),t.color&&this.modelManipulator.task.properties.color.setValue(t.internalId,t.color)}e.prototype.undo.call(this)},t.prototype.addTask=function(e){this.taskIds.push(e)},t.prototype.add=function(t){if(t instanceof o.RemoveDependencyHistoryItem){var n=t;this.historyItems.filter((function(e){return e instanceof o.RemoveDependencyHistoryItem&&e.dependencyId==n.dependencyId})).length||this.historyItems.push(n)}else e.prototype.add.call(this,t)},t}(i.CompositionHistoryItem);t.RemoveTaskHistoryItem=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConstraintViolationDialogParameters=t.ConstraintViolationDialogCommand=t.ConstraintViolationOption=void 0;var r,i=n(0),o=n(24),s=n(21);!function(e){e[e.DoNothing=0]="DoNothing",e[e.RemoveDependency=1]="RemoveDependency",e[e.KeepDependency=2]="KeepDependency"}(r=t.ConstraintViolationOption||(t.ConstraintViolationOption={}));var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.applyParameters=function(e,t){return e.option!==r.DoNothing&&(e.option===r.RemoveDependency&&(this.history.beginTransaction(),this.history.addAndRedo(new s.RemoveDependencyHistoryItem(this.modelManipulator,t.validationError.dependencyId)),t.callback(),this.history.endTransaction(),this.control.barManager.updateItemsState([])),e.option===r.KeepDependency&&(t.callback(),this.control.barManager.updateItemsState([])),!0)},t.prototype.createParameters=function(e){var t=this.control.viewModel.dependencies.getItemById(e.validationError.dependencyId),n=this.control.viewModel.tasks.getItemById(t.successorId),r=this.control.viewModel.tasks.getItemById(t.predecessorId);return e.successorTaskTitle=n.title,e.predecessorTaskTitle=r.title,e},t.prototype.getDialogName=function(){return"ConstraintViolation"},t}(o.DialogBase);t.ConstraintViolationDialogCommand=a;var l=function(e){function t(t,n){var r=e.call(this)||this;return r.validationError=t,r.callback=n,r}return i.__extends(t,e),t.prototype.clone=function(){var e=new t(this.validationError,this.callback);return e.option=this.option,e},t}(o.DialogParametersBase);t.ConstraintViolationDialogParameters=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttView=t.default=void 0,n(54);var r=n(55);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.GanttView}}),Object.defineProperty(t,"GanttView",{enumerable:!0,get:function(){return r.GanttView}})},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttView=void 0;var r=n(56),i=n(14),o=n(42),s=n(3),a=n(9),l=n(28),c=n(4),u=n(43),d=n(17),h=n(80),p=n(45),f=n(8),m=n(81),g=n(86),y=n(88),v=n(103),T=n(44),k=n(104),w=n(106),I=n(122),S=n(5),M=n(123),E=n(2),D=n(124),b=n(51),C=n(1),_=n(22),x=function(){function e(e,t,n){var r=this;this.timeScaleAreas=new Array,this.horTaskAreaBorders=[],this.vertTaskAreaBorders=[],this.scaleBorders=[],this.scaleElements=[],this.taskElements=[],this.resourcesElements=[],this.selectionElements=[],this.hlRowElements=[],this.renderedRowIndices=[],this.renderedColIndices=[],this.renderedScaleItemIndices=[],this.dependencyMap=[],this.invalidTaskDependencies=[],this.renderedConnectorLines=[],this.connectorLinesToElementsMap={},this.noWorkingIntervalsToElementsMap={},this.renderedNoWorkingIntervals=[],this.renderedStripLines=[],this.stripLinesMap=[],this.gridLayoutCalculator=new d.GridLayoutCalculator,this.etalonSizeValues=new h.EtalonSizeValues,this.tickSize=new l.Size(0,0),this.scaleCount=2,this.isFocus=!1,this.currentZoom=1,this.maxZoom=3,this.stripLinesUpdaterId=null,this.currentSelectedTaskID="",this.ganttOwner=t,this.settings=T.Settings.parse(n),this.elementTextHelper=new o.ElementTextHelper(n.cultureInfo),this.validationController=new M.ValidationController(this),this.createMainElement(e),this.createHeader(),this.calculateEtalonSizeValues(),this.createTaskAreaContainer(),this.loadOptionsFromGanttOwner(),this.elementTextHelper.setFont(this.mainElement),this.setupHelpers(),this.setSizeForTaskArea(),this.createTimeScaleContainer(),this.createTimeScaleAreas(),this.commandManager=new w.CommandManager(this),this.barManager=new I.BarManager(this,t.bars),this.eventManager=new y.EventManager(this),this.taskEditController=new p.TaskEditController(this),this.history=new g.History,this.taskAreaManager=new f.TaskAreaManager(this),this.fullScreenModeHelper=new D.FullScreenModeHelper(this),this.onWindowResizelHandler=this.onBrowserWindowResize.bind(this),window.addEventListener("resize",this.onWindowResizelHandler),this.updateView(),setTimeout((function(){r.scrollLeftByViewType()}),0),this.initializeStripLinesUpdater()}return e.prototype.reset=function(){this.timeScaleContainer.innerHTML="",this.taskArea.innerHTML="",this.horTaskAreaBorders=[],this.vertTaskAreaBorders=[],this.scaleBorders=[],this.scaleElements=[],this.taskElements=[],this.selectionElements=[],this.hlRowElements=[],this.renderedRowIndices=[],this.renderedColIndices=[],this.renderedConnectorLines=[],this.timeScaleAreas=[],this.renderedScaleItemIndices=[],this.connectorLinesToElementsMap={},this.renderedNoWorkingIntervals=[],this.renderedStripLines=[],this.noWorkingIntervalsToElementsMap={},this.invalidTaskDependencies=[]},e.prototype.setupHelpers=function(){var e=new l.Size(this.taskAreaContainer.getWidth(),this.taskAreaContainer.getHeight()),t=this.taskAreaContainer.getHeight()-this.taskAreaContainer.getElement().clientHeight;this.gridLayoutCalculator.setSettings(e,this.tickSize,this.etalonSizeValues,this.range,this.viewModel,this.settings.viewType,t),this.elementTextHelper.setSettings(this.range.start.getTime(),this.settings.viewType,this.viewModel.items)},e.prototype.getDateRange=function(e,t){var n=new Date(e.getTime()-this.getVisibleAreaTime());n=o.DateUtils.adjustStartDateByViewType(n,this.settings.viewType,this.settings.firstDayOfWeek);var r=new Date(t.getTime()+this.getVisibleAreaTime());return r=o.DateUtils.adjustEndDateByViewType(r,this.settings.viewType,this.settings.firstDayOfWeek),new a.DateRange(n,r)},e.prototype.getVisibleAreaTime=function(){return Math.ceil(this.taskAreaContainer.getWidth()/this.tickSize.width)*o.DateUtils.getTickTimeSpan(this.settings.viewType)},e.prototype.calculateEtalonSizeValues=function(){var e=this.createEtalonElementsContainer(),t=this.createEtalonElements(e);this.calculateEtalonSizeValuesCore(t),this.mainElement.removeChild(e)},e.prototype.calculateEtalonSizeValuesCore=function(e){this.etalonSizeValues.taskHeight=e[0].firstChild.offsetHeight,this.etalonSizeValues.milestoneWidth=e[1].firstChild.offsetWidth,this.etalonSizeValues.taskWrapperTopPadding=s.DomUtils.pxToInt(s.DomUtils.getCurrentStyle(e[0]).paddingTop),this.etalonSizeValues.connectorLineThickness=s.DomUtils.getVerticalBordersWidth(e[2]),this.etalonSizeValues.connectorArrowWidth=s.DomUtils.getHorizontalBordersWidth(e[3]);for(var t=0;t<=i.ViewType.Years;t++)e[4].innerText=this.elementTextHelper.getScaleItemTextTemplate(t),this.etalonSizeValues.scaleItemWidths[t]=e[4].offsetWidth;this.etalonSizeValues.smallTaskWidth=this.getSmallTaskWidth(s.DomUtils.getCurrentStyle(e[0].firstChild.firstChild).paddingLeft),this.etalonSizeValues.outsideTaskTextDefaultWidth=s.DomUtils.pxToFloat(s.DomUtils.getCurrentStyle(e[5]).width),this.etalonSizeValues.scaleItemHeight=this.ganttOwner.getHeaderHeight()/this.scaleCount,this.etalonSizeValues.parentTaskHeight=e[e.length-1].firstChild.offsetHeight},e.prototype.getSmallTaskWidth=function(e){var t=0;if(null!=e&&""!=e){var n=e.indexOf("rem");if(n>-1)try{t=parseFloat(e.substr(0,n))*parseFloat(getComputedStyle(document.documentElement).fontSize)}catch(e){}else t=s.DomUtils.pxToInt(e)}return 2*t},e.prototype.createEtalonElementsContainer=function(){var e=document.createElement("DIV");return e.style.visibility="hidden",e.style.position="absolute",e.style.left="-1000px",this.mainElement.appendChild(e),e},e.prototype.createEtalonElements=function(e){var t=[],n=this.createElement(new u.GridElementInfo("dx-gantt-taskWrapper"),null,e),r=this.createElement(new u.GridElementInfo("dx-gantt-task"),null,n);this.createElement(new u.GridElementInfo("dx-gantt-taskTitle dx-gantt-titleIn"),null,r).innerText="WWW",t.push(n);var i=this.createElement(new u.GridElementInfo("dx-gantt-taskWrapper"),null,e);this.createElement(new u.GridElementInfo("dx-gantt-task dx-gantt-milestone"),null,i),t.push(i);for(var o=["dx-gantt-conn-h","dx-gantt-arrow","dx-gantt-si","dx-gantt-taskTitle dx-gantt-titleOut"],s=0;s<o.length;s++){var a=new u.GridElementInfo(o[s]);t.push(this.createElement(a,null,e))}var l=this.createElement(new u.GridElementInfo("dx-gantt-taskWrapper"),null,e),c=this.createElement(new u.GridElementInfo("dx-gantt-task dx-gantt-parent"),null,l);return this.createElement(new u.GridElementInfo("dx-gantt-taskTitle dx-gantt-titleIn"),null,c).innerText="WWW",t.push(l),t},e.prototype.zoomIn=function(e){void 0===e&&(e=this.taskAreaContainer.getWidth()/2);var t=this.gridLayoutCalculator.getDateByPos(this.taskAreaContainer.scrollLeft+e);this.currentZoom<this.maxZoom?(this.currentZoom++,this.updateTickSizeWidth(),this.resetAndUpdate()):this.settings.viewType>i.ViewType.TenMinutes&&(this.currentZoom=1,this.setViewType(this.settings.viewType-1,!1)),this.scrollToDate(t,e)},e.prototype.zoomOut=function(e){void 0===e&&(e=this.taskAreaContainer.getWidth()/2);var t=this.gridLayoutCalculator.getDateByPos(this.taskAreaContainer.scrollLeft+e);this.currentZoom>1?(this.currentZoom--,this.updateTickSizeWidth(),this.resetAndUpdate()):this.settings.viewType<i.ViewType.Years&&(this.currentZoom=this.maxZoom,this.setViewType(this.settings.viewType+1,!1)),this.scrollToDate(t,e)},e.prototype.scrollToDate=function(e,t){this.taskAreaContainer.scrollLeft=Math.round(this.gridLayoutCalculator.getPosByDate(e))-t},e.prototype.scrollLeftByViewType=function(){var e=o.DateUtils.roundStartDate(this.dataRange.start,this.settings.viewType);this.taskAreaContainer.scrollLeft=Math.round(this.gridLayoutCalculator.getPosByDate(e))+1},e.prototype.onVisualModelChanged=function(){this.resetAndUpdate()},e.prototype.initializeStripLinesUpdater=function(){var e=this;this.settings.stripLines.showCurrentTime&&(this.stripLinesUpdaterId=setInterval((function(){e.recreateStripLines&&e.recreateStripLines()}),Math.max(this.settings.stripLines.currentTimeUpdateInterval,100)))},e.prototype.clearStripLinesUpdater=function(){this.stripLinesUpdaterId&&clearInterval(this.stripLinesUpdaterId),this.stripLinesUpdaterId=null},e.prototype.getGanttViewStartDate=function(e){if(!e)return new Date;var t=e.map((function(e){return"string"==typeof e.start?new Date(e.start):e.start})).filter((function(e){return C.isDefined(e)}));return t.length>0?t.reduce((function(e,t){return t<e?t:e}),t[0]):new Date},e.prototype.getGanttViewEndDate=function(e){if(!e)return new Date;var t=e.map((function(e){return"string"==typeof e.end?new Date(e.end):e.end})).filter((function(e){return C.isDefined(e)}));return t.length>0?t.reduce((function(e,t){return t>e?t:e}),t[0]):new Date},e.prototype.getTaskAreaWidth=function(){return this.gridLayoutCalculator.horizontalTickCount*this.tickSize.width},e.prototype.getTaskAreaHeight=function(){return this.gridLayoutCalculator.getVerticalGridLineHeight()},e.prototype.getVisibleTaskCount=function(){return this.viewModel.itemCount},e.prototype.getTask=function(e){return this.viewModel.items[e].task},e.prototype.createMainElement=function(e){this.mainElement=document.createElement("DIV"),this.mainElement.style.width=e.offsetWidth+"px",this.mainElement.style.height=e.offsetHeight+"px",e.appendChild(this.mainElement)},e.prototype.createHeader=function(){this.header=document.createElement("DIV"),this.header.className="dx-gantt-header",this.mainElement.appendChild(this.header)},e.prototype.createTimeScaleContainer=function(){this.timeScaleContainer=document.createElement("DIV"),this.timeScaleContainer.className="dx-gantt-tsac",this.timeScaleContainer.style.height=this.etalonSizeValues.scaleItemHeight*this.scaleCount+"px",this.header.appendChild(this.timeScaleContainer)},e.prototype.createTimeScaleArea=function(){var e=document.createElement("DIV");return e.className="dx-gantt-tsa",e.style.width=this.getTaskAreaWidth()+"px",e.style.height=this.etalonSizeValues.scaleItemHeight+"px",this.timeScaleContainer.appendChild(e),this.timeScaleAreas.unshift(e),e},e.prototype.createTimeScaleAreas=function(){for(var e=0;e<this.scaleCount;e++){var t=this.createTimeScaleArea();0==e&&this.settings.viewType==i.ViewType.Weeks&&this.createMonthsScale(t)}},e.prototype.createTaskAreaContainer=function(){var e=document.createElement("DIV");e.className="dx-gantt-tac",this.mainElement.appendChild(e),this.createTaskArea(e),this.taskAreaContainer=this.ganttOwner.getExternalTaskAreaContainer(e),null==this.taskAreaContainer&&(this.taskAreaContainer=new v.TaskAreaContainer(e,this)),this.prepareTaskAreaContainer()},e.prototype.prepareTaskAreaContainer=function(){var e=this.taskAreaContainer.getElement();this.settings.areHorizontalBordersEnabled?s.DomUtils.addClassName(e,"dx-gantt-tac-hb"):s.DomUtils.removeClassName(e,"dx-gantt-tac-hb");var t=parseInt(getComputedStyle(e).getPropertyValue("margin-top"))||0;e.style.height="calc(100% - "+(this.etalonSizeValues.scaleItemHeight*this.scaleCount+t)+"px)"},e.prototype.createTaskArea=function(e){this.taskArea=document.createElement("DIV"),this.taskArea.id="dx-gantt-ta",e.appendChild(this.taskArea)},e.prototype.setSizeForTaskArea=function(){this.taskArea.style.width=this.getTaskAreaWidth()+"px",this.taskArea.style.height=this.getTaskAreaHeight()+"px"},e.prototype.updateTickSizeWidth=function(){this.tickSize.width=this.etalonSizeValues.scaleItemWidths[this.settings.viewType]*this.currentZoom},e.prototype.createMonthsScale=function(e){var t=new Date;t.setTime(this.range.start.getTime());for(var n=0,r=0;t.getTime()<this.range.end.getTime();){var s=o.DateUtils.getDaysInMonth(t.getMonth(),t.getFullYear())-t.getDate()+1,a=new Date;a.setTime(t.getTime()+Math.min(s*o.DateUtils.msPerDay,this.range.end.getTime()-t.getTime()));var d=this.gridLayoutCalculator.getWidthByDateRange(t,a),h=new u.GridElementInfo("dx-gantt-si",new c.Point(n,void 0),new l.Size(d,this.etalonSizeValues.scaleItemHeight)),p=this.createElement(h,null,e);p.innerText=this.elementTextHelper.getScaleItemText(r,i.ViewType.Months),p.style.lineHeight=this.etalonSizeValues.scaleItemHeight+"px";var f=new u.GridElementInfo("dx-gantt-vb",new c.Point(n+d,void 0),new l.Size(0,this.etalonSizeValues.scaleItemHeight));this.createElement(f,null,e),n+=d,r++,t=a}},e.prototype.updateView=function(){this.onBeginUpdateView(),this.timeScaleContainer.scrollLeft=this.taskAreaContainerScrollLeft,this.processScroll(!1),this.processScroll(!0),this.ganttOwner.onGanttScroll(this.taskAreaContainerScrollTop),this.onEndUpdateView()},e.prototype.onBeginUpdateView=function(){this[e.taskAreaScrollTopKey]=this.taskAreaContainer.scrollTop,this[e.taskAreaScrollLeftKey]=this.taskAreaContainer.scrollLeft},e.prototype.onEndUpdateView=function(){delete this[e.taskAreaScrollTopKey],delete this[e.taskAreaScrollLeftKey],delete this[e.taskTextHeightKey]},e.prototype.getTaskTextHeight=function(e){e.innerText="WWW";var t=getComputedStyle(e).height;return e.innerText="",t},Object.defineProperty(e.prototype,"taskAreaContainerScrollTop",{get:function(){var t;return null!==(t=this[e.taskAreaScrollTopKey])&&void 0!==t?t:this.taskAreaContainer.scrollTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"taskAreaContainerScrollLeft",{get:function(){var t;return null!==(t=this[e.taskAreaScrollLeftKey])&&void 0!==t?t:this.taskAreaContainer.scrollLeft},enumerable:!1,configurable:!0}),e.prototype.processScroll=function(e){this.taskEditController.tooltip.hide(),this.recreateTaskAreaBordersAndTaskElements(e),e?this.recreateConnectorLineElements():(this.recreateNoWorkingIntervalElements(),this.recreateStripLines(),this.recreateScalesElements())},e.prototype.recreateTaskAreaBordersAndTaskElements=function(e){var t=this,n=e?this.taskAreaContainerScrollTop:this.taskAreaContainerScrollLeft,r=this.gridLayoutCalculator.getRenderedRowColumnIndices(n,e),i=e?this.renderedRowIndices:this.renderedColIndices;this.recreateElements(i,r,(function(n){t.removeTaskAreaBorderAndTaskElement(n,e)}),(function(n){t.createTaskAreaBorderAndTaskElement(n,e)})),e?this.renderedRowIndices=r:this.renderedColIndices=r},e.prototype.recreateNoWorkingIntervalElements=function(){var e=this,t=this.gridLayoutCalculator.getRenderedNoWorkingIntervals(this.taskAreaContainerScrollLeft);this.recreateElements(this.renderedNoWorkingIntervals,t,(function(t){e.removeNoWorkingIntervalElement(t)}),(function(t){e.createNoWorkingIntervalElement(t)})),this.renderedNoWorkingIntervals=t},e.prototype.recreateStripLines=function(){var e=this,t=this.gridLayoutCalculator.getRenderedStripLines(this.settings.stripLines);this.recreateElements(this.renderedStripLines,t,(function(t){e.removeElement(t,null,e.taskArea,e.stripLinesMap)}),(function(t){return e.createElement(t,null,e.taskArea,e.stripLinesMap)})),this.renderedStripLines=t},e.prototype.recreateConnectorLineElements=function(){var e=this,t=this.gridLayoutCalculator.getRenderedConnectorLines(this.taskAreaContainerScrollTop);this.recreateElements(this.renderedConnectorLines,t,(function(t){e.removeConnectorLineElement(t)}),(function(t){e.createConnectorLineElement(t)})),this.renderedConnectorLines=t},e.prototype.recreateScalesElements=function(){this.recreateScaleElements(this.settings.viewType,0),this.settings.viewType!=i.ViewType.Weeks&&this.recreateScaleElements(o.DateUtils.ViewTypeToScaleMap[this.settings.viewType],1)},e.prototype.recreateScaleElements=function(e,t){var n=this,r=this.gridLayoutCalculator.getRenderedScaleItemIndices(e,this.renderedColIndices),i=this.renderedScaleItemIndices[e-this.settings.viewType]||[];this.recreateElements(i,r,(function(e){n.removeScaleElementAndBorder(e,t)}),(function(r){n.createScaleElementAndBorder(r,t,e)})),this.renderedScaleItemIndices[e-this.settings.viewType]=r},e.prototype.recreateElements=function(e,t,n,r){e.filter((function(e){return-1===t.indexOf(e)})).forEach((function(e){n(e)})),t.filter((function(t){return-1===e.indexOf(t)})).forEach((function(e){r(e)}))},e.prototype.recreateTaskElement=function(e){var t=this,n=this.renderedRowIndices.filter((function(t){return t===e})).length>0,r=this.viewModel.items[e],i=r&&r.task;if(i){n&&(this.removeTaskElement(e),this.createTaskElement(e));var o=this.viewModel.dependencies.items.filter((function(e){return e.predecessorId==i.id||e.successorId==i.id}));o.length&&o.forEach((function(e){return t.recreateConnectorLineElement(e.internalId)}))}},e.prototype.recreateConnectorLineElement=function(e,t){var n=this;void 0===t&&(t=!1);var r=[];this.renderedConnectorLines=this.renderedConnectorLines.filter((function(t){return t.attr["dependency-id"]!=e||(r.push(t),!1)}));var i=r.length>0;r.forEach((function(e){n.removeConnectorLineElement(e)})),r=this.gridLayoutCalculator.updateTileToConnectorLinesMap(e),(i||t)&&r.forEach((function(e){n.createConnectorLineElement(e),n.renderedConnectorLines.push(e)}))},e.prototype.allowTaskAreaBorders=function(e){return e?this.settings.areHorizontalBordersEnabled:this.settings.areVerticalBordersEnabled},e.prototype.createTaskAreaBorderAndTaskElement=function(e,t){this.allowTaskAreaBorders(t)&&this.createTaskAreaBorder(e,!t),t&&this.createTaskElement(e)},e.prototype.removeTaskAreaBorderAndTaskElement=function(e,t){this.allowTaskAreaBorders(t)&&this.removeTaskAreaBorder(e,!t),t&&this.removeTaskElement(e)},e.prototype.getTaskAreaBordersDictionary=function(e){return e?this.vertTaskAreaBorders:this.horTaskAreaBorders},e.prototype.createTaskAreaBorder=function(e,t){var n=this.gridLayoutCalculator.getTaskAreaBorderInfo(e,t);this.createElement(n,e,this.taskArea,this.getTaskAreaBordersDictionary(t))},e.prototype.removeTaskAreaBorder=function(e,t){this.removeElement(null,e,this.taskArea,this.getTaskAreaBordersDictionary(t))},e.prototype.createScaleElementAndBorder=function(e,t,n){this.createScaleElement(e,t,n),this.createScaleBorder(e,t,n)},e.prototype.createScaleElement=function(e,t,n){var r=this.gridLayoutCalculator.getScaleElementInfo(e,n),o=this.createScaleElementCore(e,r,t,this.scaleElements);o.innerText=this.elementTextHelper.getScaleItemText(e,n),o.style.lineHeight=this.etalonSizeValues.scaleItemHeight+"px",n===i.ViewType.Quarter&&(o.style.padding="0")},e.prototype.createScaleBorder=function(e,t,n){var r=this.gridLayoutCalculator.getScaleBorderInfo(e,n);this.createScaleElementCore(e,r,t,this.scaleBorders)},e.prototype.createScaleElementCore=function(e,t,n,r){return r[n]||(r[n]=[]),this.createElement(t,e,this.timeScaleAreas[n],r[n])},e.prototype.removeScaleElementAndBorder=function(e,t){this.removeElement(null,e,this.timeScaleAreas[t],this.scaleElements[t]),this.removeElement(null,e,this.timeScaleAreas[t],this.scaleBorders[t])},e.prototype.createTaskElement=function(e){var t=this.viewModel.items[e].task;if(this.isHighlightRowElementAllowed(e)&&this.createHighlightRowElement(e),t.isValid()){this.createTaskWrapperElement(e),this.settings.taskTitlePosition==i.TaskTitlePosition.Outside&&this.createTaskTextElement(e,this.taskElements[e]);var n=this.createTaskVisualElement(e);t.isMilestone()||(this.settings.taskTitlePosition==i.TaskTitlePosition.Inside&&this.createTaskTextElement(e,n),this.createTaskProgressElement(e,n)),this.settings.showResources&&(this.createResourcesWrapperElement(e),this.createResources(e)),this.viewModel.items[e].selected&&this.createTaskSelectionElement(e)}else{var r=this.viewModel.dependencies.items.filter((function(e){return e.predecessorId==t.id||e.successorId==t.id}));this.invalidTaskDependencies=this.invalidTaskDependencies.concat(r)}},e.prototype.isHighlightRowElementAllowed=function(e){return e%2!=0&&this.settings.areAlternateRowsEnabled||this.viewModel.items[e].children.length>0},e.prototype.createResourcesWrapperElement=function(e){var t=this.gridLayoutCalculator.getTaskResourcesWrapperElementInfo(e);this.createElement(t,e,this.taskArea,this.resourcesElements),this.resourcesElements[e].style.display=this.elementTextHelper.getTaskVisibility(e)?"":"none"},e.prototype.createResources=function(e){for(var t=this.viewModel.items[e].resources.items,n=0;n<t.length;n++)this.createResourceElement(e,t[n])},e.prototype.createTaskWrapperElement=function(e){var t=this.gridLayoutCalculator.getTaskWrapperElementInfo(e);this.createElement(t,e,this.taskArea,this.taskElements),this.taskElements[e].style.display=this.elementTextHelper.getTaskVisibility(e)?"":"none"},e.prototype.createTaskVisualElement=function(e){var t=this.gridLayoutCalculator.getTaskElementInfo(e,this.settings.taskTitlePosition!==i.TaskTitlePosition.Inside),n=this.createElement(t,e,this.taskElements[e]);return this.taskAreaManager.attachEventsOnTask(n),n},e.prototype.createTaskProgressElement=function(e,t){var n=this.gridLayoutCalculator.getTaskProgressElementInfo(e);this.createElement(n,e,t)},e.prototype.createTaskTextElement=function(t,n){var r,o,s=this.gridLayoutCalculator.getTaskTextElementInfo(t,this.settings.taskTitlePosition==i.TaskTitlePosition.Inside),a=this.createElement(s,t,n),l=this.elementTextHelper.getTaskText(t);l||(null!==(r=this[o=e.taskTextHeightKey])&&void 0!==r||(this[o]=this.getTaskTextHeight(a)),a.style.height=this[e.taskTextHeightKey]),a.innerText=l},e.prototype.createResourceElement=function(e,t){var n=this.gridLayoutCalculator.getTaskResourceElementInfo();t.color&&(n.style.backgroundColor=t.color),this.createElement(n,e,this.resourcesElements[e]).innerText=t.text},e.prototype.createTaskSelectionElement=function(e){var t=this.gridLayoutCalculator.getSelectionElementInfo(e);this.taskAreaContainer.isExternal&&!this.settings.areHorizontalBordersEnabled&&t.size.height++,this.createElement(t,e,this.taskArea,this.selectionElements)},e.prototype.createHighlightRowElement=function(e){var t=this.gridLayoutCalculator.getHighlightRowInfo(e);this.createElement(t,e,this.taskArea,this.hlRowElements)},e.prototype.removeTaskElement=function(e){var t=this.viewModel.items[e].task;this.invalidTaskDependencies=this.invalidTaskDependencies.filter((function(e){return e.predecessorId!=t.id&&e.successorId!=t.id})),this.taskAreaManager.detachEventsOnTask(this.taskElements[e]),this.removeElement(null,e,this.taskArea,this.taskElements),this.removeElement(null,e,this.taskArea,this.resourcesElements),this.removeElement(null,e,this.taskArea,this.selectionElements),this.isHighlightRowElementAllowed(e)&&this.removeElement(null,e,this.taskArea,this.hlRowElements)},e.prototype.createConnectorLineElement=function(e){var t=e.attr["dependency-id"];if(!this.invalidTaskDependencies.some((function(e){return e.id==t})))return this.taskEditController.isDependencySelected(t)&&(e.className=e.className+" active"),this.createElement(e,null,this.taskArea,this.connectorLinesToElementsMap)},e.prototype.removeConnectorLineElement=function(e){this.removeElement(e,null,this.taskArea,this.connectorLinesToElementsMap)},e.prototype.createNoWorkingIntervalElement=function(e){return this.createElement(e,null,this.taskArea,this.noWorkingIntervalsToElementsMap)},e.prototype.removeNoWorkingIntervalElement=function(e){this.removeElement(e,null,this.taskArea,this.noWorkingIntervalsToElementsMap)},e.prototype.createElement=function(e,t,n,r){var i=document.createElement("DIV");for(var o in e.assignToElement(i),n.appendChild(i),r&&(r instanceof Array&&null!==t?r[t]=i:r[e.id]=i),e.attr)Object.prototype.hasOwnProperty.call(e.attr,o)&&i.setAttribute(o,e.attr[o]);for(var o in e.style)Object.prototype.hasOwnProperty.call(e.style,o)&&(i.style[o]=e.style[o]);return i},e.prototype.removeElement=function(e,t,n,r){var i;r instanceof Array&&null!==t?(i=r[t],delete r[t]):(i=r[e.id],delete r[e.id]),i&&i.parentNode==n&&n.removeChild(i)},e.prototype.calculateAutoViewType=function(e,t){var n=(t.getTime()-e.getTime())/36e5;return n>8760?i.ViewType.Years:n>720?i.ViewType.Months:n>168?i.ViewType.Weeks:n>24?i.ViewType.Days:n>6?i.ViewType.SixHours:n>1?i.ViewType.Hours:i.ViewType.TenMinutes},e.prototype.changeTaskExpanded=function(e,t){var n=this.getTaskByPublicId(e);n&&this.viewModel.changeTaskExpanded(n.internalId,t)},e.prototype.expandTask=function(e){this.viewModel.changeTaskExpanded(e,!0)},e.prototype.collapseTask=function(e){this.viewModel.changeTaskExpanded(e,!1)},e.prototype.showTask=function(e){this.viewModel.changeTaskVisibility(e,!0)},e.prototype.hideTask=function(e){this.viewModel.changeTaskVisibility(e,!1)},e.prototype.getTaskVisibility=function(e){return this.viewModel.getTaskVisibility(e)},e.prototype.unselectCurrentSelectedTask=function(){this.unselectTask(this.currentSelectedTaskID)},e.prototype.getTaskSelected=function(e){return this.viewModel.getTaskSelected(e)},e.prototype.setViewType=function(e,t){void 0===t&&(t=!0),null==e&&(e=this.calculateAutoViewType(this.dataRange.start,this.dataRange.end)),this.settings.viewType!==e&&(this.settings.viewType=e,this.updateTickSizeWidth(),this.resetAndUpdate(),t&&this.scrollLeftByViewType(),this.ganttOwner.UpdateGanttViewType&&this.ganttOwner.UpdateGanttViewType(e))},e.prototype.setTaskTitlePosition=function(e){this.settings.taskTitlePosition!==e&&(this.settings.taskTitlePosition=e,this.resetAndUpdate())},e.prototype.setShowResources=function(e){this.settings.showResources!==e&&(this.settings.showResources=e,this.resetAndUpdate())},e.prototype.setFirstDayOfWeek=function(e){this.settings.firstDayOfWeek!==e&&(this.settings.firstDayOfWeek=e,this.resetAndUpdate())},e.prototype.loadOptionsFromGanttOwner=function(){this.tickSize.height=this.ganttOwner.getRowHeight();var e=this.ganttOwner.getGanttTasksData();this.dataRange=new a.DateRange(this.getGanttViewStartDate(e),this.getGanttViewEndDate(e)),null==this.settings.viewType&&(this.settings.viewType=this.calculateAutoViewType(this.dataRange.start,this.dataRange.end)),this.updateTickSizeWidth(),this.range=this.getDateRange(this.dataRange.start,this.dataRange.end),this.dispatcher=new k.ModelChangesDispatcher;var t=this.ganttOwner.getModelChangesListener();t&&this.dispatcher.onModelChanged.add(t),this.viewModel=new r.ViewVisualModel(this,e,this.ganttOwner.getGanttDependenciesData(),this.ganttOwner.getGanttResourcesData(),this.ganttOwner.getGanttResourceAssignmentsData(),this.range,this.ganttOwner.getGanttWorkTimeRules()),this.modelManipulator=new m.ModelManipulator(this.viewModel,this.dispatcher)},e.prototype.resetAndUpdate=function(){this.reset(),this.range=this.getDateRange(this.dataRange.start,this.dataRange.end),this.viewModel.updateRange(this.range),this.setupHelpers(),this.createTimeScaleAreas(),this.setSizeForTaskArea(),S.Browser.IE&&this.taskEditController.createElements(),this.updateView()},e.prototype.cleanMarkup=function(){this.taskAreaManager.detachEvents(),this.taskEditController.detachEvents(),window.removeEventListener("resize",this.onWindowResizelHandler),this.reset()},e.prototype.updateRowHeights=function(e){if(this.tickSize.height!==e){this.tickSize.height=e;var t=this.taskAreaContainer.scrollLeft;this.resetAndUpdate(),this.taskAreaContainer.scrollLeft=t}},e.prototype.selectTask=function(e){this.selectDependency(null),this.viewModel.changeTaskSelected(e,!0),this.currentSelectedTaskID=e,this.updateBarManager()},e.prototype.unselectTask=function(e){this.viewModel.changeTaskSelected(e,!1),this.updateBarManager()},e.prototype.selectTaskById=function(e){this.unselectCurrentSelectedTask();var t=this.getTaskByPublicId(e);t&&this.selectTask(t.internalId)},e.prototype.selectDependency=function(e){this.taskEditController.selectDependency(e),this.gridLayoutCalculator.createTileToConnectorLinesMap(),this.recreateConnectorLineElements()},e.prototype.getTaskAreaContainer=function(){return this.taskAreaContainer},e.prototype.setWidth=function(e){this.mainElement.style.width=e+"px"},e.prototype.setHeight=function(e){this.mainElement.style.height=e+"px"},e.prototype.setAllowSelection=function(e){this.settings.allowSelectTask=e},e.prototype.setEditingSettings=function(e){this.settings.editing=e,this.updateBarManager()},e.prototype.setValidationSettings=function(e){this.settings.validation=e},e.prototype.setRowLinesVisible=function(e){this.settings.areHorizontalBordersEnabled=e,this.prepareTaskAreaContainer(),this.resetAndUpdate()},e.prototype.setStripLines=function(e){this.settings.stripLines=T.StripLineSettings.parse(e),this.clearStripLinesUpdater(),this.initializeStripLinesUpdater(),this.recreateStripLines()},e.prototype.deleteTask=function(e){var t=this.getTaskByPublicId(e.toString());t&&this.commandManager.removeTaskCommand.execute(t.internalId)},e.prototype.insertTask=function(e){if(e){var t=null!=e.parentId?String(e.parentId):null,n=this.getTaskByPublicId(t),r="string"==typeof e.start?new Date(e.start):e.start,i="string"==typeof e.end?new Date(e.end):e.end,o={parentId:null==n?void 0:n.internalId,title:String(e.title)||"",start:r,end:i,progress:parseInt(e.progress)||0,color:e.color};if(this.commandManager.createTaskCommand.execute(o))return this.getLastInsertedTaskId()}return""},e.prototype.updateTask=function(e,t){var n=this.getTaskByPublicId(e.toString());n&&t&&this.commandManager.updateTaskCommand.execute(n.internalId,t)},e.prototype.getTaskData=function(e){var t=this.getTaskByPublicId(e.toString());if(t)return this.viewModel.getTaskObjectForDataSource(t)},e.prototype.insertDependency=function(e){if(e){var t=String(e.predecessorId),n=String(e.successorId),r=e.type;this.commandManager.createDependencyCommand.execute(t,n,r)}},e.prototype.deleteDependency=function(e){var t=this.viewModel.convertPublicToInternalKey("dependency",e);C.isDefined(t)&&this.commandManager.removeDependencyCommand.execute(t)},e.prototype.getDependencyData=function(e){return this.viewModel.getDependencyObjectForDataSource(e)},e.prototype.insertResource=function(e,t){var n=this;if(e){this.commandManager.createResourceCommand.execute(String(e.text),e.color&&String(e.color),(function(e){if(C.isDefined(t))for(var r=0;r<t.length;r++)n.assignResourceToTask(e,t[r])}))}},e.prototype.deleteResource=function(e){var t=this.viewModel.convertPublicToInternalKey("resource",e);C.isDefined(t)&&this.commandManager.removeResourceCommand.execute(t)},e.prototype.assignResourceToTask=function(e,t){var n=this.viewModel.convertPublicToInternalKey("resource",e),r=this.viewModel.convertPublicToInternalKey("task",t);C.isDefined(n)&&C.isDefined(r)&&this.commandManager.assignResourceCommand.execute(n,r)},e.prototype.unassignResourceFromTask=function(e,t){var n=this.viewModel.findAssignment(e,t);n&&this.commandManager.deassignResourceCommand.execute(n.internalId)},e.prototype.getResourceData=function(e){return this.viewModel.getResourceObjectForDataSource(e)},e.prototype.getResourceAssignmentData=function(e){return this.viewModel.getResourceAssignmentObjectForDataSource(e)},e.prototype.getTaskResources=function(e){var t=this.viewModel,n=t.getItemByPublicId("task",e);return n&&t.getAssignedResources(n).items},e.prototype.getVisibleTaskKeys=function(){return this.viewModel.getVisibleTasks().map((function(e){return e.id}))},e.prototype.getVisibleDependencyKeys=function(){return this.viewModel.getVisibleDependencies().map((function(e){return e.id}))},e.prototype.getVisibleResourceKeys=function(){return this.viewModel.getVisibleResources().map((function(e){return e.id}))},e.prototype.getVisibleResourceAssignmentKeys=function(){return this.viewModel.getVisibleResourceAssignments().map((function(e){return e.id}))},e.prototype.setTaskValue=function(e,t,n){var r=this.commandManager,i=this.getTaskByPublicId(e);if(i){if("title"===t){var o=n||"";return r.changeTaskTitleCommand.execute(i.internalId,o)}if("progress"===t){var s=Math.max(n,0);return s=Math.min(n,100),r.changeTaskProgressCommand.execute(i.internalId,s)}if("start"===t)return r.changeTaskStartCommand.execute(i.internalId,E.DateTimeUtils.getMinDate(n,i.end));if("end"===t)return r.changeTaskEndCommand.execute(i.internalId,E.DateTimeUtils.getMaxDate(n,i.start))}return!1},e.prototype.getLastInsertedTaskId=function(){var e=this.history.historyItems.filter((function(e){return e instanceof b.CreateTaskHistoryItem})),t=e[e.length-1];return t&&t.taskId},e.prototype.getLastInsertedResource=function(){var e=this.history.historyItems.filter((function(e){return e instanceof _.CreateResourceHistoryItem})),t=e[e.length-1];return t&&t.resource},e.prototype.getTaskByPublicId=function(e){return this.viewModel.tasks.getItemByPublicId(e)},e.prototype.getPrevTask=function(e){var t=this.viewModel.findItem(e),n=(t.parent||this.viewModel.root).children.indexOf(t)-1;return n>-1?t.parent.children[n].task:t.parent.task},e.prototype.updateCreatedTaskIdAfterServerUpdate=function(e,t){var n=this.viewModel.findItem(e),r=n&&n.task;r&&(r.id=t)},e.prototype.getTaskIdByInternalId=function(e){var t=this.viewModel.findItem(e),n=t&&t.task;return n?n.id:null},e.prototype.isTaskHasChildren=function(e){var t=this.viewModel.findItem(e);return t&&t.children.length>0},e.prototype.requireFirstLoadParentAutoCalc=function(){var e=this.ganttOwner;return e.getRequireFirstLoadParentAutoCalc&&e.getRequireFirstLoadParentAutoCalc()},e.prototype.updateOwnerInAutoParentMode=function(){this.viewModel.parentAutoCalc&&this.dispatcher.notifyParentDataRecalculated(this.viewModel.getCurrentTaskData())},e.prototype.getOwnerControlMainElement=function(){var e=this.ganttOwner;return e.getMainElement&&e.getMainElement()},e.prototype.adjustOwnerControl=function(){var e=this.ganttOwner;e.adjustControl&&e.adjustControl()},e.prototype.onBrowserWindowResize=function(){this.fullScreenModeHelper.isInFullScreenMode?this.fullScreenModeHelper.adjustControlInFullScreenMode():this.adjustOwnerControl()},e.prototype.applySettings=function(e,t){void 0===t&&(t=!1);var n=T.Settings.parse(e),r=t||this.settings.equal(n);this.settings=n,r||this.resetAndUpdate()},e.prototype.getDataUpdateErrorCallback=function(){var e=this,t=this.history,n=t.getCurrentProcessingItemInfo();return function(){e.dispatcher.lock(),t.rollBackAndRemove(n),e.dispatcher.unlock(),e.updateBarManager()}},e.prototype.setTaskTooltipContentTemplate=function(e){this.settings.taskTooltipContentTemplate=e},e.prototype.updateBarManager=function(){this.barManager.updateItemsState([])},e.prototype.onTaskClick=function(e,t){return!this.ganttOwner.onTaskClick||this.ganttOwner.onTaskClick(e,t)},e.prototype.onTaskDblClick=function(e,t){return!this.ganttOwner.onTaskDblClick||this.ganttOwner.onTaskDblClick(e,t)},e.prototype.getDateFormat=function(e){return this.ganttOwner.getFormattedDateText?this.ganttOwner.getFormattedDateText(e):this.getDefaultDateFormat(e)},e.prototype.getDefaultDateFormat=function(e){return("0"+e.getDate()).slice(-2)+"/"+("0"+(e.getMonth()+1)).slice(-2)+"/"+e.getFullYear()+" "+("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)},e.prototype.destroyTemplate=function(e){this.ganttOwner.destroyTemplate?this.ganttOwner.destroyTemplate(e):e.innerHTML=""},e.cachedPrefix="cached_",e.taskAreaScrollTopKey=e.cachedPrefix+"taskAreaScrollTop",e.taskAreaScrollLeftKey=e.cachedPrefix+"taskAreaScrollLeft",e.taskTextHeightKey=e.cachedPrefix+"taskTextHeight",e}();t.GanttView=x},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewVisualModel=void 0;var r=n(26),i=n(62),o=n(64),s=n(65),a=n(66),l=n(67),c=n(68),u=n(1),d=n(11),h=n(33),p=n(36),f=function(){function e(e,t,n,a,l,u,d){this._fLockCount=0,this.owner=e,this.tasks=new i.TaskCollection,this.tasks.importFromObject(t),this.dependencies=new o.DependencyCollection,this.dependencies.importFromObject(n),this.resources=new r.ResourceCollection,this.resources.importFromObject(a),this.assignments=new s.ResourceAssignmentCollection,this.assignments.importFromObject(l),this._itemList=new Array,this._viewItemList=new Array,this._workTimeCalculator=new c.WorkingTimeCalculator(u,d),this.updateModel()}return e.prototype.updateModel=function(){this._itemList.splice(0,this._itemList.length);for(var e=this.tasks.items,t=0;t<e.length;t++){var n=e[t];n&&this._itemList.push(new a.ViewVisualModelItem(n,this.getAssignedResources(n)))}this.createHierarchy(),this.populateItemsForView(),this.owner&&this.owner.currentSelectedTaskID&&this.changeTaskSelected(this.owner.currentSelectedTaskID,!0)},e.prototype.createHierarchy=function(){var e=this;this.root=new a.ViewVisualModelItem(null,null);for(var t=this._itemList,n=t.reduce((function(e,t){var n,r=null===(n=t.task)||void 0===n?void 0:n.internalId;return u.isDefined(r)&&(e[r]=t),e}),{}),r=this.requireFirstLoadParentAutoCalc,i=0;i<t.length;i++){var o=t[i],s=n[o.task.parentId]||this.root;o.parent=s,s.addChild(o),r&&this.owner.validationController.recalculateParents(o,(function(t){if(u.isDefined(t.id)){var n=e.tasks.getItemById(t.id);u.isDefined(t.start)&&(n.start=t.start),u.isDefined(t.end)&&(n.end=t.end),u.isDefined(t.progress)&&(n.progress=t.progress)}}))}r&&this.owner.dispatcher.notifyParentDataRecalculated(this.getCurrentTaskData())},e.prototype.getCurrentTaskData=function(){var e=this;return this.tasks.items.map((function(t){return e.getTaskObjectForDataSource(t)}))},e.prototype.getTaskObjectForDataSource=function(e){var t=e.parentId&&this.tasks.getItemById(e.parentId);return{id:e.id,start:e.start,end:e.end,duration:e.duration,description:e.description,parentId:t&&t.id,progress:e.progress,color:e.color,taskType:e.taskType,title:e.title,customFields:e.customFields,expanded:e.expanded}},e.prototype.getDependencyObjectForDataSource=function(e){var t=e instanceof d.Dependency?e:this.getItemByPublicId("dependency",e);if(t){var n=this.convertInternalToPublicKey("task",t.predecessorId),r=this.convertInternalToPublicKey("task",t.successorId);return{id:t.id,predecessorId:u.isDefined(n)?n:t.predecessorId,successorId:u.isDefined(r)?r:t.successorId,type:t.type}}return null},e.prototype.getResourceObjectForDataSource=function(e){var t=e instanceof h.Resource?e:this.getItemByPublicId("resource",e);return t?{id:t.id,text:t.text,color:t.color}:null},e.prototype.getResourceAssignmentObjectForDataSource=function(e){var t=e instanceof p.ResourceAssignment?e:this.getItemByPublicId("assignment",e);if(t){var n=this.convertInternalToPublicKey("task",t.taskId),r=this.convertInternalToPublicKey("resource",t.resourceId);return{id:t.id,taskId:u.isDefined(n)?n:t.taskId,resourceId:u.isDefined(r)?r:t.resourceId}}return null},e.prototype.populateItemsForView=function(){this._viewItemList.splice(0,this._viewItemList.length),this.populateVisibleItems(this.root),this.updateVisibleItemDependencies()},e.prototype.populateVisibleItems=function(e){var t=this,n=e===this.root;e&&(e.task||n)&&(n||(this._viewItemList.push(e),e.visibleIndex=this._viewItemList.length-1),(e.getExpanded()||e===this.root)&&e.children.forEach((function(e){return t.populateVisibleItems(e)})))},e.prototype.updateVisibleItemDependencies=function(){for(var e=this._viewItemList,t=0;t<e.length;t++){var n=e[t],r=this.getTasVisibleDependencies(n.task);n.setDependencies(r)}},e.prototype.getAssignedResources=function(e){var t=this,n=new r.ResourceCollection;return this.assignments.items.filter((function(t){return t.taskId==e.internalId})).forEach((function(e){n.add(t.resources.getItemById(e.resourceId))})),n},e.prototype.getTasVisibleDependencies=function(e){for(var t=new Array,n=e.internalId,r=this.dependencies.items.filter((function(e){return e.successorId==n})),i=0;i<r.length;i++){var o=r[i],s=this.findItem(o.predecessorId);s&&s.getVisible()&&t.push(new l.ViewVisualModelDependencyInfo(o.internalId,s,o.type))}return t},e.prototype.changeTaskExpanded=function(e,t){var n=this.tasks.getItemById(String(e));n&&(n.expanded=t,this.changed())},e.prototype.changeTaskVisibility=function(e,t){var n=this.findItem(e);n&&(n.visible=t,this.changed())},e.prototype.changeTaskSelected=function(e,t){var n=this._itemList.filter((function(t){return t.task&&t.task.internalId===e}))[0];if(n){n.selected=t;var r=this.findItem(e),i=r&&r.visibleIndex;i>-1&&this.owner.recreateTaskElement(i)}},e.prototype.beginUpdate=function(){this._fLockCount++},e.prototype.endUpdate=function(){this._fLockCount--,0==this._fLockCount&&this.changed()},e.prototype.changed=function(){0===this._fLockCount&&(this.populateItemsForView(),this.owner&&this.owner.onVisualModelChanged&&this.owner.onVisualModelChanged())},e.prototype.findItem=function(e){return this._viewItemList.filter((function(t){return t.task&&t.task.internalId===e}))[0]},Object.defineProperty(e.prototype,"items",{get:function(){return this._viewItemList},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"itemCount",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),e.prototype.getTaskVisibility=function(e){var t=this.findItem(e);return!!t&&t.getVisible()},e.prototype.getTaskSelected=function(e){var t=this.findItem(e);return!!t&&t.selected},Object.defineProperty(e.prototype,"noWorkingIntervals",{get:function(){return this._workTimeCalculator.noWorkingIntervals},enumerable:!1,configurable:!0}),e.prototype.updateRange=function(e){this._workTimeCalculator.updateRange(e)},e.prototype.taskHasChildrenByIndex=function(e){return this._viewItemList[e].children.length>0},e.prototype.taskHasChildren=function(e){var t=this.findItem(e);return t&&t.children.length>0},Object.defineProperty(e.prototype,"parentAutoCalc",{get:function(){var e=this.owner&&this.owner.settings;return e&&e.validation&&e.validation.autoUpdateParentTasks},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requireFirstLoadParentAutoCalc",{get:function(){return this.parentAutoCalc&&this.owner.requireFirstLoadParentAutoCalc()},enumerable:!1,configurable:!0}),e.prototype.isTaskToCalculateByChildren=function(e){return this.parentAutoCalc&&this.taskHasChildren(e)},e.prototype.hasTasks=function(){return this.tasks.length>0},e.prototype.getDataUpdateErrorCallback=function(){return this.owner.getDataUpdateErrorCallback&&this.owner.getDataUpdateErrorCallback()},e.prototype.convertPublicToInternalKey=function(e,t){var n=this.getItemByPublicId(e,t);return n&&n.internalId},e.prototype.convertInternalToPublicKey=function(e,t){var n=this.getItemByInternalId(e,t);return n&&n.id},e.prototype.getItemByPublicId=function(e,t){var n=t.toString();switch(e){case"task":return this.tasks.getItemByPublicId(n);case"dependency":return this.dependencies.getItemByPublicId(n);case"resource":return this.resources.getItemByPublicId(n);case"assignment":return this.assignments.getItemByPublicId(n)}return null},e.prototype.getItemByInternalId=function(e,t){switch(e){case"task":return this.tasks.getItemById(t);case"dependency":return this.dependencies.getItemById(t);case"resource":return this.resources.getItemById(t);case"assignment":return this.assignments.getItemById(t)}return null},e.prototype.findAssignment=function(e,t){var n=this.convertPublicToInternalKey("resource",e),r=this.convertPublicToInternalKey("task",t);return this.assignments.items.filter((function(e){return e.resourceId===n&&e.taskId===r}))[0]},e.prototype.getVisibleTasks=function(){var e=this;return this.tasks.items.filter((function(t){return t&&e.getTaskVisibility(t.internalId)&&t.isValid()}))},e.prototype.getVisibleDependencies=function(){var e=this.getVisibleTasks().map((function(e){return e.internalId}));return this.dependencies.items.filter((function(t){return t&&e.indexOf(t.successorId)>-1&&e.indexOf(t.predecessorId)>-1}))},e.prototype.getVisibleResourceAssignments=function(){var e=this.getVisibleTasks().map((function(e){return e.internalId}));return this.assignments.items.filter((function(t){return t&&e.indexOf(t.taskId)>-1}))},e.prototype.getVisibleResources=function(){for(var e=[],t=this.getVisibleResourceAssignments(),n=0;n<t.length;n++){var r=this.getItemByInternalId("resource",t[n].resourceId);r&&-1===e.indexOf(r)&&e.push(r)}return e},e}();t.ViewVisualModel=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttJsonUtils=void 0;var r=n(58),i=function(){function e(){}return e.parseJson=function(e){return r.JsonUtils.isValid(e)?JSON.parse(e):null},e}();t.GanttJsonUtils=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.isValid=function(e){return!/[^,:{}[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(e.replace(/"(\\.|[^"\\])*"/g,""))},e}();t.JsonUtils=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(60),i=n(61),o=function(){function e(){}return e.remove=function(e,t){var n=e.indexOf(t,0);n>=0&&e.splice(n,1)},e.removeBy=function(e,t){for(var n=e.length,r=0;r<n;r++)if(t(e[r],r))return e.splice(r,1)[0];return null},e.shallowCopy=function(e){return e.slice()},e.deepCopy=function(t){return e.map(t,(function(e){return e.clone()}))},e.initByValue=function(e,t){for(var n=[];e>0;e--)n.push(t);return n},e.initByCallback=function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},e.forEachOnInterval=function(e,t){for(var n=e.end,r=e.start;r<n;r++)t(r)},e.reverseForEachOnInterval=function(e,t){for(var n=e.start,r=e.end-1;r>=n;r--)t(r)},e.reducedMap=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=[],o=n;o<r;o++){var s=t(e[o],o);null!==s&&i.push(s)}return i},e.filter=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=[],o=n;o<r;o++){var s=e[o];t(s,o)&&i.push(s)}return i},e.map=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=[],o=n;o<r;o++)i.push(t(e[o],o));return i},e.indexBy=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++)if(t(e[i],i))return i;return-1},e.reverseIndexBy=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--)if(t(e[i],i))return i;return-1},e.elementBy=function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=t.length);var o=e.indexBy(t,n,r,i);return o<0?null:t[o]},e.reverseElementBy=function(t,n,r,i){void 0===r&&(r=t.length-1),void 0===i&&(i=0);var o=e.reverseIndexBy(t,n,r,i);return o<0?null:t[o]},e.last=function(e){return e[e.length-1]},e.setLast=function(e,t){return e[e.length-1]=t},e.incLast=function(e){return++e[e.length-1]},e.decLast=function(e){return--e[e.length-1]},e.equals=function(t,n){return t.length===n.length&&e.allOf2(t,n,(function(e,t){return e.equals(t)}))},e.equalsByReference=function(e,t){var n=e.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0},e.unique=function(t,n,r,i){void 0===r&&(r=n),void 0===i&&(i=function(){});var o=t.length;if(0===o)return[];var s=(t=t.sort(n))[0],a=e.reducedMap(t,(function(e){return 0!==r(s,e)?(s=e,e):(i(e),null)}),1,o);return a.unshift(t[0]),a},e.uniqueNumber=function(e){e=e.sort(i.Comparers.number);for(var t=Number.NaN,n=e.length-1;n>=0;n--)t===e[n]?e.splice(n,1):t=e[n];return e},e.forEach=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++)t(e[i],i)},e.forEach2=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=r;o<i;o++)n(e[o],t[o],o)},e.reverseForEach=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--)t(e[i],i)},e.reverseIndexOf=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--)if(e[i]===t)return i;return-1},e.accumulate=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=t,s=r;s<i;s++)o=n(o,e[s],s);return o},e.accumulateNumber=function(e,t,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=n,s=r;s<i;s++)o+=t(e[s],s,o);return o},e.anyOf=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++)if(t(e[i],i))return!0;return!1},e.unsafeAnyOf=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++){var o=t(e[i],i);if(o)return o}return null},e.reverseAnyOf=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--)if(t(e[i],i))return!0;return!1},e.unsafeReverseAnyOf=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--){var o=t(e[i],i);if(o)return o}return null},e.anyOf2=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=r;o<i;o++)if(n(e[o],t[o],o))return!0;return!1},e.allOf=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++)if(!t(e[i],i))return!1;return!0},e.allOf2=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=r;o<i;o++)if(!n(e[o],t[o],o))return!1;return!0},e.allOfOnInterval=function(e,t){for(var n=e.end,r=e.start;r<n;r++)if(!t(r))return!1;return!0},e.addListOnTail=function(e,t){for(var n=0,r=void 0;r=t[n];n++)e.push(r);return e},e.joinLists=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e.accumulate(n,[],(function(n,r){return e.addListOnTail(n,t(r)),n}))},e.push=function(e,t){return e.push(t),e},e.countIf=function(t,n){return e.accumulateNumber(t,(function(e,t){return n(e,t)?1:0}))},e.clear=function(e){e.splice(0)},e.merge=function(e,t,n,r,i,o){if(void 0===i&&(i=0),void 0===o&&(o=e.length),e=e.slice(i,o),o-i<2)return e;for(var s=(e=e.sort(t))[i],a=[s],l=i+1;l<o;l++){var c=e[l];n(s,c)?r(s,c):(s=c,a.push(s))}return a},e.min=function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=t.length);var o=e.minExtended(t,n,r,i);return o?o.minElement:null},e.max=function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=t.length);var o=e.maxExtended(t,n,r,i);return o?o.maxElement:null},e.minMax=function(t,n,i,o){void 0===i&&(i=0),void 0===o&&(o=t.length);var s=e.minMaxExtended(t,n,i,o);return s?new r.MinMax(s.minElement,s.maxElement):null},e.minExtended=function(e,t,n,i){if(void 0===n&&(n=0),void 0===i&&(i=e.length),0===e.length)return null;for(var o=e[n],s=t(o),a=n+1;a<i;a++){var l=e[a],c=t(l);c<s&&(s=c,o=l)}return new r.ExtendedMin(o,s)},e.maxExtended=function(e,t,n,i){if(void 0===n&&(n=0),void 0===i&&(i=e.length),0===e.length)return null;for(var o=e[n],s=t(o),a=n+1;a<i;a++){var l=e[a],c=t(l);c>s&&(s=c,o=l)}return new r.ExtendedMax(o,s)},e.minMaxExtended=function(e,t,n,i){if(void 0===n&&(n=0),void 0===i&&(i=e.length),0===e.length)return null;for(var o=e[n],s=o,a=t(o),l=a,c=n+1;c<i;c++){var u=e[c],d=t(u);d<a?(a=d,o=u):d>l&&(l=d,s=u)}return new r.ExtendedMinMax(o,a,s,l)},e.minByCmp=function(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=e.length),0===e.length)return null;for(var i=e[n],o=n+1;o<r;o++){var s=e[o];t(s,i)<0&&(i=s)}return i},e.maxByCmp=function(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=e.length),0===e.length)return null;for(var i=e[n],o=n+1;o<r;o++){var s=e[o];t(s,i)>0&&(i=s)}return i},e.minMaxByCmp=function(e,t,n,i){if(void 0===n&&(n=0),void 0===i&&(i=e.length),0===e.length)return null;for(var o=e[n],s=o,a=n+1;a<i;a++){var l=e[a],c=t(l,o);c>0?s=l:c<0&&(o=l)}return new r.MinMax(o,s)},e}();t.ListUtils=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(35),i=function(e,t){this.minElement=e,this.maxElement=t};t.MinMax=i;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),Object.defineProperty(t.prototype,"length",{get:function(){return this.maxElement-this.minElement},enumerable:!0,configurable:!0}),t}(i);t.MinMaxNumber=o;var s=function(e,t){this.minElement=e,this.minValue=t};t.ExtendedMin=s;var a=function(e,t){this.maxElement=e,this.maxValue=t};t.ExtendedMax=a;var l=function(e){function t(t,n,r,i){var o=e.call(this,t,r)||this;return o.minValue=n,o.maxValue=i,o}return r.__extends(t,e),t}(i);t.ExtendedMinMax=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.number=function(e,t){return e-t},e.string=function(e,t){return e===t?0:e>t?1:-1},e.stringIgnoreCase=function(e,t){return(e=e.toLowerCase())===(t=t.toLowerCase())?0:e>t?1:-1},e}();t.Comparers=r;var i=function(){function e(){}return e.simpleType=function(e,t){return e===t},e.object=function(e,t){return e&&t&&(e===t||e.equals(t))},e}();t.Equals=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskCollection=void 0;var r=n(0),i=n(63),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.createItem=function(){return new i.Task},t}(n(13).CollectionBase);t.TaskCollection=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Task=t.TaskType=void 0;var r=n(0),i=n(1),o=n(10);!function(e){e[e.Regular=0]="Regular",e[e.Summary=1]="Summary",e[e.Milestone=2]="Milestone"}(t.TaskType||(t.TaskType={}));var s=function(e){function t(){var t=e.call(this)||this;return t.start=null,t.end=null,t.duration=null,t.description="",t.parentId="",t.title="",t.owner=null,t.progress=0,t.taskType=null,t.customFields={},t.expanded=!0,t.color="",t}return r.__extends(t,e),t.prototype.assignFromObject=function(t){i.isDefined(t)&&(e.prototype.assignFromObject.call(this,t),this.owner=t.owner,this.parentId=i.isDefined(t.parentId)?String(t.parentId):"",this.description=t.description,this.title=t.title,this.start="string"==typeof t.start?new Date(t.start):t.start||new Date(0),this.end="string"==typeof t.end?new Date(t.end):t.end||new Date(0),this.duration=t.duration,this.progress=t.progress,this.taskType=t.taskType,i.isDefined(t.expanded)&&(this.expanded=!!t.expanded),i.isDefined(t.color)&&(this.color=t.color),this.assignCustomFields(t.customFields))},t.prototype.assignCustomFields=function(e){if(e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.customFields[t]=e[t])},t.prototype.isMilestone=function(){return this.start.getTime()===this.end.getTime()},t.prototype.getDuration=function(){return this.end.getTime()-this.start.getTime()},t.prototype.isValid=function(){return!!this.start.getTime()&&!!this.end.getTime()},t}(o.DataObject);t.Task=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DependencyCollection=void 0;var r=n(0),i=n(13),o=n(11),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.createItem=function(){return new o.Dependency},t}(i.CollectionBase);t.DependencyCollection=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceAssignmentCollection=void 0;var r=n(0),i=n(13),o=n(36),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.createItem=function(){return new o.ResourceAssignment},t}(i.CollectionBase);t.ResourceAssignmentCollection=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewVisualModelItem=void 0;var r=n(1),i=function(){function e(e,t){this.dependencies=new Array,this.parent=null,this.visible=!0,this.selected=!1,this.visibleIndex=-1,this.task=e,this.resources=t,this.children=new Array}return Object.defineProperty(e.prototype,"resourceText",{get:function(){var e="";return this.resources.items.forEach((function(t){return e+=t.text+" "})),e},enumerable:!1,configurable:!0}),e.prototype.addChild=function(e){r.isDefined(e)&&this.children.indexOf(e)<0&&this.children.push(e)},e.prototype.removeChild=function(e){var t=this.children.indexOf(e);t>-1&&this.children.splice(t,1)},e.prototype.getExpanded=function(){return!!this.task&&this.task.expanded},e.prototype.getVisible=function(){if(!this.visible)return!1;for(var e=this.parent;e;){if(!e.visible)return!1;e=e.parent}return!0},e.prototype.changeVisibility=function(e){this.visible=e},e.prototype.changeSelection=function(e){this.selected=e},e.prototype.setDependencies=function(e){e&&(this.dependencies=e.slice())},e}();t.ViewVisualModelItem=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewVisualModelDependencyInfo=void 0;var r=function(e,t,n){this.id=e,this.predecessor=t,this.type=n};t.ViewVisualModelDependencyInfo=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkingTimeCalculator=void 0;var r=n(69),i=n(77),o=n(2),s=function(){function e(e,t){this._workingRules=new r.WorkingDayRuleCollection,this._workDayList=new Array,this._calculationRange=e,this._workingRules.importFromObject(t)}return e.prototype.calculateWorkDayList=function(){if(this._calculationRange){this.clearList();for(var e=this._workingRules.items,t=0;t<e.length;t++)this.processRule(e[t]);this.sortList()}},e.prototype.processRule=function(e){for(var t=e.recurrence.calculatePoints(this._calculationRange.start,this._calculationRange.end),n=function(n){var s=t[n],a=o.DateTimeUtils.getDayNumber(s),l=r._workDayList.filter((function(e){return e.dayNumber==a}))[0];l?(l.isWorkDay=l.isWorkDay&&e.isWorkDay,l.addWorkingIntervals(e.workTimeRanges)):r._workDayList.push(new i.DayWorkingTimeInfo(a,e.isWorkDay,e.workTimeRanges))},r=this,s=0;s<t.length;s++)n(s)},e.prototype.sortList=function(){this._workDayList.sort((function(e,t){return e.dayNumber-t.dayNumber}))},e.prototype.clearList=function(){this._workDayList.splice(0,this._workDayList.length)},e.prototype.calculateNoWorkTimeIntervals=function(){var e=this,t=new Array;return 0==this._workDayList.length&&this.calculateWorkDayList(),this._workDayList.forEach((function(n){return t=t.concat(e.getNoWorkTimeRangesFromDay(n))})),this.concatJointedRanges(t)},e.prototype.concatJointedRanges=function(e){for(var t=new Array,n=0;n<e.length;n++){var r=e[n];t.length>0&&o.DateTimeUtils.compareDates(t[t.length-1].end,r.start)<2?t[t.length-1].end=r.end:t.push(r)}return t},e.prototype.getNoWorkTimeRangesFromDay=function(e){return e.noWorkingIntervals.map((function(t){return o.DateTimeUtils.convertTimeRangeToDateRange(t,e.dayNumber)}))},Object.defineProperty(e.prototype,"noWorkingIntervals",{get:function(){return this._noWorkingIntervals||(this._noWorkingIntervals=this.calculateNoWorkTimeIntervals()),this._noWorkingIntervals.slice()},enumerable:!1,configurable:!0}),e.prototype.updateRange=function(e){this._calculationRange=e,this.invalidate()},e.prototype.invalidate=function(){this._noWorkingIntervals=null,this.clearList()},e}();t.WorkingTimeCalculator=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkingDayRuleCollection=void 0;var r=n(0),i=n(13),o=n(70),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.createItem=function(){return new o.WorkingTimeRule},t}(i.CollectionBase);t.WorkingDayRuleCollection=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkingTimeRule=void 0;var r=n(0),i=n(10),o=n(1),s=n(2),a=n(40),l=n(41),c=function(e){function t(t,n,r){void 0===t&&(t=null),void 0===n&&(n=!0),void 0===r&&(r=null);var i=e.call(this)||this;return i.isWorkDay=!0,i.workTimeRanges=new Array,i.recurrence=t,i.isWorkDay=n,r&&i.workTimeRanges.concat(r),i}return r.__extends(t,e),t.prototype.assignFromObject=function(t){if(o.isDefined(t)){e.prototype.assignFromObject.call(this,t),this.recurrence=a.RecurrenceFactory.createRecurrenceByType(t.recurrenceType)||new l.Daily,o.isDefined(t.recurrence)&&this.recurrence.assignFromObject(t.recurrence),o.isDefined(t.isWorkDay)&&(this.isWorkDay=!!t.isWorkDay);var n=s.DateTimeUtils.convertToTimeRanges(t.workTimeRanges);n&&(this.workTimeRanges=n)}},t}(i.DataObject);t.WorkingTimeRule=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DayOfWeek=void 0,function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"}(t.DayOfWeek||(t.DayOfWeek={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Month=void 0,function(e){e[e.January=0]="January",e[e.February=1]="February",e[e.March=2]="March",e[e.April=3]="April",e[e.May=4]="May",e[e.June=5]="June",e[e.July=6]="July",e[e.August=7]="August",e[e.September=8]="September",e[e.October=9]="October",e[e.November=10]="November",e[e.December=11]="December"}(t.Month||(t.Month={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Weekly=void 0;var r=n(0),i=n(16),o=n(2),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.checkDate=function(e){return o.DateTimeUtils.checkDayOfWeek(this.dayOfWeekInternal,e)},t.prototype.checkInterval=function(e){return o.DateTimeUtils.getWeeksBetween(this.start,e)%this.interval==0},t.prototype.calculatePointByInterval=function(e){var t=o.DateTimeUtils.getWeeksBetween(this.start,e),n=Math.floor(t/this.interval);(t%this.interval>0||e.getDay()>=this.dayOfWeekInternal)&&n++;var r=n*this.interval;return this.calcNextPointWithWeekCount(this.start,r)},t.prototype.calculateNearestPoint=function(e){var t=this.dayOfWeekInternal-e.getDay();return t>0?o.DateTimeUtils.addDays(new Date(e),t):this.calcNextPointWithWeekCount(e,1)},t.prototype.calcNextPointWithWeekCount=function(e,t){void 0===t&&(t=1);var n=7*t+this.dayOfWeekInternal-e.getDay();return o.DateTimeUtils.addDays(new Date(e),n)},Object.defineProperty(t.prototype,"dayOfWeek",{get:function(){return this.dayOfWeekInternal},set:function(e){this.dayOfWeekInternal=e},enumerable:!1,configurable:!0}),t}(i.RecurrenceBase);t.Weekly=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Monthly=void 0;var r=n(0),i=n(16),o=n(2),s=n(75),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.checkDate=function(e){return this._calculateByDayOfWeek?o.DateTimeUtils.checkDayOfWeekOccurrenceInMonth(e,this.dayOfWeekInternal,this.dayOfWeekOccurrenceInternal):o.DateTimeUtils.checkDayOfMonth(this.dayInternal,e)},t.prototype.checkInterval=function(e){return o.DateTimeUtils.getMonthsDifference(this.start,e)%this.interval==0},t.prototype.calculatePointByInterval=function(e){var t=this.start,n=o.DateTimeUtils.getMonthsDifference(t,e),r=Math.floor(n/this.interval)*this.interval,i=new s.MonthInfo(t.getMonth(),t.getFullYear());i.addMonths(r);var a=this.getSpecDayInMonth(i.year,i.month);return o.DateTimeUtils.compareDates(a,e)>=0&&(i.addMonths(this.interval),a=this.getSpecDayInMonth(i.year,i.month)),a},t.prototype.calculateNearestPoint=function(e){var t=e.getMonth(),n=e.getFullYear(),r=this.getSpecDayInMonth(n,t);if(o.DateTimeUtils.compareDates(r,e)>=0){var i=new s.MonthInfo(t,n);i.addMonths(1),r=this.getSpecDayInMonth(i.year,i.month)}return r},Object.defineProperty(t.prototype,"day",{get:function(){return this.dayInternal},set:function(e){this.dayInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dayOfWeek",{get:function(){return this.dayOfWeekInternal},set:function(e){this.dayOfWeekInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dayOfWeekOccurrence",{get:function(){return this.dayOfWeekOccurrenceInternal},set:function(e){this.dayOfWeekOccurrenceInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"calculateByDayOfWeek",{get:function(){return this._calculateByDayOfWeek},set:function(e){this._calculateByDayOfWeek=e},enumerable:!1,configurable:!0}),t}(i.RecurrenceBase);t.Monthly=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonthInfo=void 0;var r=n(2),i=function(){function e(e,t){this.month=e,this.year=t}return e.prototype.addMonths=function(e){var t=r.DateTimeUtils.getNextMonth(this.month,e),n=Math.floor(e/12);t<this.month&&++n,this.month=t,this.year+=n},e}();t.MonthInfo=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Yearly=void 0;var r=n(0),i=n(16),o=n(2),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.checkDate=function(e){return!!o.DateTimeUtils.checkMonth(this.month,e)&&(this._calculateByDayOfWeek?o.DateTimeUtils.checkDayOfWeekOccurrenceInMonth(e,this.dayOfWeekInternal,this.dayOfWeekOccurrenceInternal):o.DateTimeUtils.checkDayOfMonth(this.dayInternal,e))},t.prototype.checkInterval=function(e){return o.DateTimeUtils.getYearsDifference(this.start,e)%this.interval==0},t.prototype.calculatePointByInterval=function(e){var t=o.DateTimeUtils.getYearsDifference(this.start,e),n=Math.floor(t/this.interval)*this.interval,r=this.start.getFullYear()+n,i=this.getSpecDayInMonth(r,this.monthInternal);return o.DateTimeUtils.compareDates(i,e)>=0&&(r+=this.interval,i=this.getSpecDayInMonth(r,this.monthInternal)),i},t.prototype.calculateNearestPoint=function(e){var t=e.getFullYear(),n=this.getSpecDayInMonth(t,this.monthInternal);return o.DateTimeUtils.compareDates(n,e)>=0&&(n=this.getSpecDayInMonth(++t,this.monthInternal)),n},Object.defineProperty(t.prototype,"month",{get:function(){return this.monthInternal},set:function(e){this.monthInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"day",{get:function(){return this.dayInternal},set:function(e){this.dayInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dayOfWeek",{get:function(){return this.dayOfWeekInternal},set:function(e){this.dayOfWeekInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dayOfWeekOccurrence",{get:function(){return this.dayOfWeekOccurrenceInternal},set:function(e){this.dayOfWeekOccurrenceInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"calculateByDayOfWeek",{get:function(){return this._calculateByDayOfWeek},set:function(e){this._calculateByDayOfWeek=e},enumerable:!1,configurable:!0}),t}(i.RecurrenceBase);t.Yearly=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DayWorkingTimeInfo=void 0;var r=n(38),i=n(2),o=n(37),s=function(){function e(e,t,n){void 0===e&&(e=0),void 0===t&&(t=!0),void 0===n&&(n=null),this._workingIntervals=new Array,this.dayNumber=e,this.isWorkDay=t,this.addWorkingIntervals(n)}return e.prototype.addWorkingIntervals=function(e){e&&(this._workingIntervals=this._workingIntervals.concat(e.filter((function(e){return!!e}))),this.rearrangeWorkingIntervals())},e.prototype.rearrangeWorkingIntervals=function(){for(var e=0;e<this._workingIntervals.length;e++)this.concatWithIntersectedRanges(this._workingIntervals[e]);this.sortIntervals()},e.prototype.concatWithIntersectedRanges=function(e){var t=this;this.getIntersectedIntervals(e).forEach((function(n){e.concatWith(n),t.removeInterval(n)}))},e.prototype.getIntersectedIntervals=function(e){return this._workingIntervals.filter((function(t){return t.hasIntersect(e)&&t!==e}))},e.prototype.sortIntervals=function(){this._workingIntervals.sort((function(e,t){return i.DateTimeUtils.caclTimeDifference(t.start,e.start)}))},e.prototype.removeInterval=function(e){var t=this._workingIntervals.indexOf(e);t>-1&&t<this._workingIntervals.length&&this._workingIntervals.splice(t,1)},e.prototype.clearIntervals=function(){this._workingIntervals.splice(0,this._workingIntervals.length)},Object.defineProperty(e.prototype,"workingIntervals",{get:function(){return this._workingIntervals.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"noWorkingIntervals",{get:function(){var e=new Array;if(this.isWorkDay&&0==this._workingIntervals.length)return e;var t=this._workingIntervals.map((function(e){return e.end}));t.splice(0,0,new o.Time);var n=this._workingIntervals.map((function(e){return e.start}));n.push(i.DateTimeUtils.getLastTimeOfDay());for(var s=0;s<t.length;s++){var a=t[s],l=n[s];i.DateTimeUtils.areTimesEqual(a,l)||e.push(new r.TimeRange(a,l))}return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isWorkDay",{get:function(){return this._isWorkDay},set:function(e){this._isWorkDay=e,e||this.clearIntervals()},enumerable:!1,configurable:!0}),e}();t.DayWorkingTimeInfo=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(35),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.empty=function(){return new t(0,0,0,0)},t.prototype.clone=function(){return new t(this.left,this.right,this.top,this.bottom)},t}(n(79).Offsets);t.Margins=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n,r){this.left=e,this.right=t,this.top=n,this.bottom=r}return e.empty=function(){return new e(0,0,0,0)},Object.defineProperty(e.prototype,"horizontal",{get:function(){return this.left+this.right},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vertical",{get:function(){return this.top+this.bottom},enumerable:!0,configurable:!0}),e.fromNumber=function(t){return new e(t,t,t,t)},e.fromOffsets=function(t){return new e(t.left,t.right,t.top,t.bottom)},e.fromSide=function(t,n){return new e(t,t,n,n)},e.prototype.normalize=function(){return this.left=Math.max(0,this.left),this.right=Math.max(0,this.right),this.top=Math.max(0,this.top),this.bottom=Math.max(0,this.bottom),this},e.prototype.toString=function(){return JSON.stringify(this)},e.prototype.isEmpty=function(){return 0===this.left&&0===this.right&&0===this.top&&0===this.bottom},e.prototype.offset=function(e){return this.left+=e.left,this.right+=e.right,this.top+=e.top,this.bottom+=e.bottom,this},e.prototype.multiply=function(e,t,n,r){switch(arguments.length){case 1:return this.left*=e,this.right*=e,this.top*=e,this.bottom*=e,this;case 2:return this.left*=e,this.right*=e,this.top*=t,this.bottom*=t,this;case 4:return this.left*=e,this.right*=t,this.top*=n,this.bottom*=r,this}return this},e.prototype.clone=function(){return new e(this.left,this.right,this.top,this.bottom)},e.prototype.copyFrom=function(e){this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom},e.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.right===e.right&&this.left===e.left},e.prototype.applyConverter=function(e){return this.left=e(this.left),this.right=e(this.right),this.top=e(this.top),this.bottom=e(this.bottom),this},e}();t.Offsets=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EtalonSizeValues=void 0;var r=function(){this.scaleItemWidths={}};t.EtalonSizeValues=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelManipulator=void 0;var r=n(82),i=n(83),o=n(85),s=function(e,t){this.task=new o.TaskManipulator(e,t),this.dependency=new r.TaskDependencyManipulator(e,t),this.resource=new i.ResourcesManipulator(e,t),this.dispatcher=t};t.ModelManipulator=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskDependencyManipulator=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.insertDependency=function(e,t,n,r){var i=this.viewModel.dependencies.createItem();return i.predecessorId=e,i.successorId=t,i.type=n,r&&(i.internalId=r),i.id=i.internalId,this.viewModel.dependencies.add(i),this.dispatcher.notifyDependencyInserted(this.getObjectForDataSource(i),(function(e){return i.id=e}),this.getErrorCallback()),this.viewModel.updateVisibleItemDependencies(),this.viewModel.owner.recreateConnectorLineElement(i.internalId,!0),i},t.prototype.removeDependency=function(e){var t=this.viewModel.dependencies.getItemById(e);return this.viewModel.dependencies.remove(t),this.dispatcher.notifyDependencyRemoved(t.id,this.getErrorCallback(),this.viewModel.getDependencyObjectForDataSource(t)),this.viewModel.updateVisibleItemDependencies(),this.viewModel.owner.recreateConnectorLineElement(t.internalId),t},t.prototype.getObjectForDataSource=function(e){return{id:e.id,predecessorId:this.viewModel.tasks.getItemById(e.predecessorId).id,successorId:this.viewModel.tasks.getItemById(e.successorId).id,type:e.type}},t}(n(18).BaseManipulator);t.TaskDependencyManipulator=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesManipulator=void 0;var r=n(0),i=n(18),o=n(84),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.properties=new o.ResourcePropertiesManipulator(t,n),r}return r.__extends(t,e),t.prototype.create=function(e,t,n,r){var i=this.viewModel.resources.createItem();return i.text=e,t&&(i.color=t),n&&(i.internalId=n),i.id=i.internalId,this.viewModel.resources.add(i),this.dispatcher.notifyResourceCreated(this.getResourceObjectForDataSource(i),(function(e){i.id=e,r&&r(e)}),this.getErrorCallback()),i},t.prototype.remove=function(e){var t=this.viewModel.resources.getItemById(e);if(!t)throw new Error("Invalid resource id");if(this.viewModel.assignments.items.filter((function(t){return t.resourceId==e})).length)throw new Error("Can't delete assigned resource");return this.viewModel.resources.remove(t),this.dispatcher.notifyResourceRemoved(t.id,this.getErrorCallback(),this.viewModel.getResourceObjectForDataSource(t)),t},t.prototype.assign=function(e,t,n){var r=this.viewModel.assignments.createItem();return r.resourceId=e,r.taskId=t,n&&(r.internalId=n),r.id=r.internalId,this.viewModel.assignments.add(r),this.dispatcher.notifyResourceAssigned(this.getResourceAssignmentObjectForDataSource(r),(function(e){return r.id=e}),this.getErrorCallback()),this.viewModel.updateModel(),this.viewModel.owner.resetAndUpdate(),r},t.prototype.deassig=function(e){var t=this.viewModel.assignments.getItemById(e);return this.viewModel.assignments.remove(t),this.dispatcher.notifyResourceUnassigned(t.id,this.getErrorCallback(),this.viewModel.getResourceAssignmentObjectForDataSource(t)),this.viewModel.updateModel(),this.viewModel.owner.resetAndUpdate(),t},t.prototype.getResourceObjectForDataSource=function(e){return{id:e.id,text:e.text}},t.prototype.getResourceAssignmentObjectForDataSource=function(e){return{id:e.id,taskId:this.viewModel.tasks.getItemById(e.taskId).id,resourceId:this.viewModel.resources.getItemById(e.resourceId).id}},t}(i.BaseManipulator);t.ResourcesManipulator=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcePropertyManipulator=t.ResourcePropertiesManipulator=void 0;var r=n(0),i=n(18),o=n(46),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.color=new l(t,n),r}return r.__extends(t,e),t}(i.BaseManipulator);t.ResourcePropertiesManipulator=s;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.setValue=function(e,t){var n=this,r=this.viewModel.resources.getItemById(e),i=new o.HistoryItemState(e,this.getPropertyValue(r));return this.setPropertyValue(r,t),this.viewModel.assignments.items.filter((function(e){return e.resourceId==r.internalId})).forEach((function(e){var t=n.viewModel.findItem(e.taskId).visibleIndex;n.viewModel.owner.recreateTaskElement(t)})),i},t.prototype.restoreValue=function(e){var t=this;if(e){var n=e.value,r=this.viewModel.resources.getItemById(e.id);this.setPropertyValue(r,n),this.viewModel.assignments.items.filter((function(e){return e.resourceId==r.internalId})).forEach((function(e){var n=t.viewModel.findItem(e.taskId).visibleIndex;t.viewModel.owner.recreateTaskElement(n)}))}},t}(i.BaseManipulator);t.ResourcePropertyManipulator=a;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getPropertyValue=function(e){return e.color},t.prototype.setPropertyValue=function(e,t){e.color=t,this.dispatcher.notifyResourceColorChanged(e.id,t,this.getErrorCallback())},t}(a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskManipulator=void 0;var r=n(0),i=n(18),o=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.properties=new i.TaskPropertiesManipulator(t,n),r}return r.__extends(t,e),t.prototype.create=function(e,t,n){var r=this,i=this.viewModel.tasks.createItem();i.start=e.start,i.end=e.end,i.title=e.title,i.progress=e.progress,e.color&&(i.color=e.color);var o=this.viewModel.tasks.getItemById(e.parentId);return o&&(o.expanded=!0),i.parentId=e.parentId,t&&(i.internalId=t),i.id=i.internalId,this.viewModel.tasks.add(i),this.viewModel.updateModel(),this.dispatcher.notifyTaskCreated(this.getObjectForDataSource(i),(function(e){if(i.id=e,n&&n(),r.viewModel.requireFirstLoadParentAutoCalc){var t=r.viewModel.getCurrentTaskData().map((function(e){return""===e.parentId&&(e.parentId=null),e}));r.dispatcher.notifyParentDataRecalculated(t)}}),this.getErrorCallback()),this.viewModel.owner.resetAndUpdate(),i},t.prototype.remove=function(e){var t=this.viewModel.tasks.getItemById(e);if(!t)throw new Error("Invalid task id");if(this.viewModel.dependencies.items.filter((function(t){return t.predecessorId==e||t.successorId==e})).length)throw new Error("Can't delete task with dependency");if(this.viewModel.assignments.items.filter((function(t){return t.taskId==e})).length)throw new Error("Can't delete task with assigned resource");return this.viewModel.tasks.remove(t),this.dispatcher.notifyTaskRemoved(t.id,this.getErrorCallback(),this.viewModel.getTaskObjectForDataSource(t)),this.viewModel.updateModel(),this.viewModel.owner.resetAndUpdate(),t},t.prototype.getObjectForDataSource=function(e){return this.viewModel.getTaskObjectForDataSource(e)},t}(i.BaseManipulator);t.TaskManipulator=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.History=void 0;var r=n(12),i=n(87),o=function(){function e(){this.historyItems=[],this.currentIndex=-1,this.currentProcessingItemInfo=null,this.transaction=null,this.transactionLevel=-1}return e.prototype.undo=function(){this.canUndo()&&(this.activateItem(this.historyItems[this.currentIndex],!0),this.currentIndex--)},e.prototype.redo=function(){this.canRedo()&&(this.currentIndex++,this.activateItem(this.historyItems[this.currentIndex]))},e.prototype.beginTransaction=function(){this.transactionLevel++,0==this.transactionLevel&&(this.transaction=new r.CompositionHistoryItem)},e.prototype.endTransaction=function(){if(!(--this.transactionLevel>=0)){var e=this.transaction.historyItems.length;e>1?this.addInternal(this.transaction):1==e&&this.addInternal(this.transaction.historyItems.pop()),this.transaction=null}},e.prototype.addAndRedo=function(e){this.add(e),this.activateItem(e)},e.prototype.add=function(e){this.transactionLevel>=0?this.transaction.add(e):this.addInternal(e)},e.prototype.canUndo=function(){return this.currentIndex>=0},e.prototype.canRedo=function(){return this.currentIndex<this.historyItems.length-1},e.prototype.addInternal=function(e){this.currentIndex<this.historyItems.length-1&&this.historyItems.splice(this.currentIndex+1),this.historyItems.push(e),this.currentIndex++,this.deleteOldItems()},e.prototype.deleteOldItems=function(){var t=this.historyItems.length-e.MAX_HISTORY_ITEM_COUNT;t>0&&this.currentIndex>t&&(this.historyItems.splice(0,t),this.currentIndex-=t)},e.prototype.clear=function(){this.currentIndex=-1,this.historyItems=[]},e.prototype.activateItem=function(e,t){void 0===t&&(t=!1),this.currentProcessingItemInfo=new i.HistoryItemInfo(e,t),t?e.undo():e.redo(),this.currentProcessingItemInfo=null},e.prototype.getCurrentProcessingItemInfo=function(){return this.currentProcessingItemInfo},e.prototype.rollBackAndRemove=function(e){var t=e.item;this.checkAndRemoveItem(t)&&(e.isUndo?t.redo():t instanceof r.CompositionHistoryItem?t.undoItemsQuery():t.undo())},e.prototype.checkAndRemoveItem=function(e){var t=this.historyItems.indexOf(e);return t>-1?(this.historyItems.splice(t,1),this.currentIndex--):this.transaction&&(t=this.transaction.historyItems.indexOf(e))>-1&&this.transaction.historyItems.splice(t,1),t>-1},e.MAX_HISTORY_ITEM_COUNT=100,e}();t.History=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryItemInfo=void 0;var r=function(e,t){void 0===t&&(t=!1),this.item=e,this.isUndo=t};t.HistoryItemInfo=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;var r=n(89),i=n(94),o=n(5),s=n(96),a=function(){function e(e){this.control=e,this.mouseHandler=new r.MouseHandler(e),this.touchHandler=new s.TouchHandler(e)}return e.prototype.onMouseDown=function(e){this.mouseHandler.onMouseDown(e)},e.prototype.onMouseMove=function(e){this.mouseHandler.onMouseMove(e)},e.prototype.onMouseUp=function(e){this.mouseHandler.onMouseUp(e)},e.prototype.onMouseDblClick=function(e){this.mouseHandler.onMouseDoubleClick(e)},e.prototype.onMouseWheel=function(e){this.mouseHandler.onMouseWheel(e)},e.prototype.onTouchStart=function(e){this.touchHandler.onTouchStart(e)},e.prototype.onTouchEnd=function(e){this.touchHandler.onTouchEnd(e)},e.prototype.onTouchMove=function(e){this.touchHandler.onTouchMove(e)},e.prototype.onDoubleTap=function(e){this.touchHandler.onDoubleTap(e)},e.prototype.onKeyDown=function(e){if(this.control.isFocus){var t=this.getShortcutCode(e);t==(i.ModifierKey.Ctrl|i.KeyCode.Key_z)&&this.control.history.undo(),t==(i.ModifierKey.Ctrl|i.KeyCode.Key_y)&&this.control.history.redo(),t==i.KeyCode.Delete&&this.control.taskEditController.deleteSelectedDependency()}},e.prototype.getShortcutCode=function(e){var t=i.KeyUtils.getEventKeyCode(e),n=0;return e.altKey&&(n|=i.ModifierKey.Alt),e.ctrlKey&&(n|=i.ModifierKey.Ctrl),e.shiftKey&&(n|=i.ModifierKey.Shift),e.metaKey&&o.Browser.MacOSPlatform&&(n|=i.ModifierKey.Meta),n|t},e}();t.EventManager=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandler=void 0;var r=n(0),i=n(47),o=n(8),s=n(90),a=n(6),l=n(91),c=n(92),u=n(93),d=n(48),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onMouseDoubleClick=function(e){this.state.onMouseDoubleClick(e)},t.prototype.onMouseDown=function(e){switch(this.getEventSource(a.EvtUtils.getEventSource(e))){case o.MouseEventSource.TaskEdit_Frame:this.switchState(new l.MouseHandlerMoveTaskState(this));break;case o.MouseEventSource.TaskEdit_Progress:this.switchState(new c.MouseHandlerProgressTaskState(this));break;case o.MouseEventSource.TaskEdit_Start:case o.MouseEventSource.TaskEdit_End:this.switchState(new u.MouseHandlerTimestampTaskState(this));break;case o.MouseEventSource.TaskEdit_DependencyStart:case o.MouseEventSource.TaskEdit_DependencyFinish:this.switchState(new d.MouseHandlerDependencyState(this))}this.state.onMouseDown(e)},t.prototype.onMouseUp=function(e){this.state.onMouseUp(e)},t.prototype.onMouseMove=function(e){this.state.onMouseMove(e)},t.prototype.onMouseWheel=function(e){this.state.onMouseWheel(e)},t.prototype.switchToDefaultState=function(){this.state=new s.MouseHandlerDefaultState(this)},t}(i.HandlerBase);t.MouseHandler=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttMovingHelper=t.MouseHandlerDefaultState=void 0;var r=n(0),i=n(3),o=n(6),s=n(29),a=n(17),l=n(4),c=n(5),u=function(e){function t(t){var n=e.call(this,t)||this;return n.isInScrolling=!1,n.ganttMovingHelper=new d(n.handler.control),n}return r.__extends(t,e),t.prototype.onMouseDown=function(e){e.preventDefault();var t=o.EvtUtils.getEventSource(e);if(i.DomUtils.hasClassName(t,a.GridLayoutCalculator.CLASSNAMES.CONNECTOR_HORIZONTAL)||i.DomUtils.hasClassName(t,a.GridLayoutCalculator.CLASSNAMES.CONNECTOR_VERTICAL)){var n=t.getAttribute("dependency-id");if(this.handler.control.taskEditController.dependencyId!=n&&(this.handler.control.selectDependency(n),e instanceof PointerEvent)){var r={event:e,type:"dependency",key:n,position:new l.Point(o.EvtUtils.getEventX(e),o.EvtUtils.getEventY(e))};this.handler.control.ganttOwner.showPopupMenu(r)}}else o.EvtUtils.isLeftButtonPressed(e)&&this.ganttMovingHelper.startMoving(e),null!=this.handler.control.taskEditController.dependencyId&&this.handler.control.selectDependency(null)},t.prototype.onMouseUp=function(e){this.ganttMovingHelper.onMouseUp(e)},t.prototype.onMouseMove=function(e){this.ganttMovingHelper.movingInfo&&(this.handler.control.taskEditController.hide(),this.ganttMovingHelper.onMouseMove(e),e.preventDefault())},t.prototype.onMouseWheel=function(e){var t=this;if(e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),!this.isInScrolling)){this.isInScrolling=!0,setTimeout((function(){t.isInScrolling=!1}),50);var n=o.EvtUtils.getWheelDelta(e)>0,r=o.EvtUtils.getEventX(e)-i.DomUtils.getAbsolutePositionX(this.handler.control.taskAreaContainer.getElement());n?this.handler.control.zoomIn(r):this.handler.control.zoomOut(r)}},t}(s.MouseHandlerStateBase);t.MouseHandlerDefaultState=u;var d=function(){function e(e){this.gantt=e,this.movingInfo=null}return e.prototype.startMoving=function(e){this.movingInfo=this.calcMovingInfo(e),this.updateGanttAreaCursor(!0)},e.prototype.cancelMoving=function(){this.movingInfo=null},e.prototype.onMouseMove=function(e){this.move(e)},e.prototype.onMouseUp=function(e){this.cancelMoving(),this.updateGanttAreaCursor(!1)},e.prototype.move=function(e){this.updateScrollPosition(e)},e.prototype.updateScrollPosition=function(e){var t=Math.round(o.EvtUtils.getEventX(e)),n=Math.round(o.EvtUtils.getEventY(e)),r=t-this.movingInfo.eventX,i=n-this.movingInfo.eventY,s=r<0?-1:1,a=i<0?-1:1,l=s<0?this.movingInfo.maxRightDelta:this.movingInfo.maxLeftDelta,c=a<0?this.movingInfo.maxBottomDelta:this.movingInfo.maxTopDelta;Math.abs(r)>l&&(r=l*s),Math.abs(i)>c&&(i=c*a);var u=this.movingInfo.scrollLeft-r,d=this.movingInfo.scrollTop-i,h=this.gantt.taskAreaContainer;h.scrollLeft!==u&&(h.scrollLeft=u),h.scrollTop!==d&&(h.scrollTop=d)},e.prototype.calcMovingInfo=function(e){var t=this.gantt.taskAreaContainer;return{eventX:o.EvtUtils.getEventX(e),eventY:o.EvtUtils.getEventY(e),scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,maxLeftDelta:t.scrollLeft,maxRightDelta:t.scrollWidth-t.scrollLeft-t.getElement().offsetWidth,maxTopDelta:t.scrollTop,maxBottomDelta:t.scrollHeight-t.scrollTop-t.getElement().offsetHeight}},e.prototype.updateGanttAreaCursor=function(e){c.Browser.IE?this.gantt.taskAreaContainer.getElement().style.cursor=e?"move":"default":this.gantt.taskAreaContainer.getElement().style.cursor=e?"grabbing":"default"},e}();t.GanttMovingHelper=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandlerMoveTaskState=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onMouseUpInternal=function(e){this.handler.control.taskEditController.confirmMove()},t.prototype.onMouseMoveInternal=function(e){this.handler.control.taskEditController.processMove(e.x-this.currentPosition.x)||this.handler.switchToDefaultState()},t}(n(30).MouseHandlerDragBaseState);t.MouseHandlerMoveTaskState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandlerProgressTaskState=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onMouseUpInternal=function(e){this.handler.control.taskEditController.confirmProgress()},t.prototype.onMouseMoveInternal=function(e){var t=this.getRelativePos(e);this.handler.control.taskEditController.processProgress(t)},t}(n(30).MouseHandlerDragBaseState);t.MouseHandlerProgressTaskState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandlerTimestampTaskState=void 0;var r=n(0),i=n(8),o=n(6),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onMouseDown=function(t){e.prototype.onMouseDown.call(this,t),this.source=this.handler.getEventSource(o.EvtUtils.getEventSource(t))},t.prototype.onMouseUpInternal=function(e){this.source==i.MouseEventSource.TaskEdit_Start?this.handler.control.taskEditController.confirmStart():this.handler.control.taskEditController.confirmEnd()},t.prototype.onMouseMoveInternal=function(e){var t=this.getRelativePos(e);this.source==i.MouseEventSource.TaskEdit_Start&&this.handler.control.taskEditController.processStart(t),this.source==i.MouseEventSource.TaskEdit_End&&this.handler.control.taskEditController.processEnd(t)},t}(n(30).MouseHandlerDragBaseState);t.MouseHandlerTimestampTaskState=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,o=n(5),s=n(95),a=n(27),l=function(){function e(){}return e.getKeyModifiers=function(e){var t=0;return e.altKey&&(t|=r.Alt),e.ctrlKey&&(t|=r.Ctrl),e.shiftKey&&(t|=r.Shift),t},e.getShortcutCode=function(e,t,n,i,o){var s=e;return s|=t?r.Ctrl:0,s|=n?r.Shift:0,s|=i?r.Alt:0,s|=o?r.Meta:0},e.getShortcutCodeByEvent=function(t){return e.getShortcutCode(e.getEventKeyCode(t),t.ctrlKey,t.shiftKey,t.altKey,!!o.Browser.MacOSPlatform&&t.metaKey)},e.getEventKeyCode=function(e){return o.Browser.NetscapeFamily||o.Browser.Opera?e.which:e.keyCode},e.parseShortcutString=function(t){if(!t)return 0;var n=!1,r=!1,o=!1,l=!1,c=null,u=t.toString().split("+");if(u.length>0)for(var d=0;d<u.length;d++){var h=a.StringUtils.trim(u[d].toUpperCase());switch(h){case"CONTROL":case"CONTROLKEY":case"CTRL":n=!0;break;case"SHIFT":case"SHIFTKEY":r=!0;break;case"ALT":o=!0;break;case"CMD":l=!0;break;case"F1":c=i.F1;break;case"F2":c=i.F2;break;case"F3":c=i.F3;break;case"F4":c=i.F4;break;case"F5":c=i.F5;break;case"F6":c=i.F6;break;case"F7":c=i.F7;break;case"F8":c=i.F8;break;case"F9":c=i.F9;break;case"F10":c=i.F10;break;case"F11":c=i.F11;break;case"F12":c=i.F12;break;case"RETURN":case"ENTER":c=i.Enter;break;case"HOME":c=i.Home;break;case"END":c=i.End;break;case"LEFT":c=i.Left;break;case"RIGHT":c=i.Right;break;case"UP":c=i.Up;break;case"DOWN":c=i.Down;break;case"PAGEUP":c=i.PageUp;break;case"PAGEDOWN":c=i.PageDown;break;case"SPACE":c=i.Space;break;case"TAB":c=i.Tab;break;case"BACKSPACE":case"BACK":c=i.Backspace;break;case"CONTEXT":c=i.ContextMenu;break;case"ESCAPE":case"ESC":c=i.Esc;break;case"DELETE":case"DEL":c=i.Delete;break;case"INSERT":case"INS":c=i.Insert;break;case"PLUS":c="+".charCodeAt(0);break;default:c=h.charCodeAt(0)}}else alert(s.EncodeUtils.decodeViaTextArea("Invalid shortcut"));return e.getShortcutCode(c,n,r,o,l)},e}();t.KeyUtils=l,function(e){e[e.None=0]="None",e[e.Ctrl=65536]="Ctrl",e[e.Shift=262144]="Shift",e[e.Alt=1048576]="Alt",e[e.Meta=16777216]="Meta"}(r=t.ModifierKey||(t.ModifierKey={})),function(e){e[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.Enter=13]="Enter",e[e.Pause=19]="Pause",e[e.CapsLock=20]="CapsLock",e[e.Esc=27]="Esc",e[e.Space=32]="Space",e[e.PageUp=33]="PageUp",e[e.PageDown=34]="PageDown",e[e.End=35]="End",e[e.Home=36]="Home",e[e.Left=37]="Left",e[e.Up=38]="Up",e[e.Right=39]="Right",e[e.Down=40]="Down",e[e.Insert=45]="Insert",e[e.Delete=46]="Delete",e[e.Key_0=48]="Key_0",e[e.Key_1=49]="Key_1",e[e.Key_2=50]="Key_2",e[e.Key_3=51]="Key_3",e[e.Key_4=52]="Key_4",e[e.Key_5=53]="Key_5",e[e.Key_6=54]="Key_6",e[e.Key_7=55]="Key_7",e[e.Key_8=56]="Key_8",e[e.Key_9=57]="Key_9",e[e.Key_a=65]="Key_a",e[e.Key_b=66]="Key_b",e[e.Key_c=67]="Key_c",e[e.Key_d=68]="Key_d",e[e.Key_e=69]="Key_e",e[e.Key_f=70]="Key_f",e[e.Key_g=71]="Key_g",e[e.Key_h=72]="Key_h",e[e.Key_i=73]="Key_i",e[e.Key_j=74]="Key_j",e[e.Key_k=75]="Key_k",e[e.Key_l=76]="Key_l",e[e.Key_m=77]="Key_m",e[e.Key_n=78]="Key_n",e[e.Key_o=79]="Key_o",e[e.Key_p=80]="Key_p",e[e.Key_q=81]="Key_q",e[e.Key_r=82]="Key_r",e[e.Key_s=83]="Key_s",e[e.Key_t=84]="Key_t",e[e.Key_u=85]="Key_u",e[e.Key_v=86]="Key_v",e[e.Key_w=87]="Key_w",e[e.Key_x=88]="Key_x",e[e.Key_y=89]="Key_y",e[e.Key_z=90]="Key_z",e[e.Windows=91]="Windows",e[e.ContextMenu=93]="ContextMenu",e[e.Numpad_0=96]="Numpad_0",e[e.Numpad_1=97]="Numpad_1",e[e.Numpad_2=98]="Numpad_2",e[e.Numpad_3=99]="Numpad_3",e[e.Numpad_4=100]="Numpad_4",e[e.Numpad_5=101]="Numpad_5",e[e.Numpad_6=102]="Numpad_6",e[e.Numpad_7=103]="Numpad_7",e[e.Numpad_8=104]="Numpad_8",e[e.Numpad_9=105]="Numpad_9",e[e.Multiply=106]="Multiply",e[e.Add=107]="Add",e[e.Subtract=109]="Subtract",e[e.Decimal=110]="Decimal",e[e.Divide=111]="Divide",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NumLock=144]="NumLock",e[e.ScrollLock=145]="ScrollLock",e[e.Semicolon=186]="Semicolon",e[e.Equals=187]="Equals",e[e.Comma=188]="Comma",e[e.Dash=189]="Dash",e[e.Period=190]="Period",e[e.ForwardSlash=191]="ForwardSlash",e[e.GraveAccent=192]="GraveAccent",e[e.OpenBracket=219]="OpenBracket",e[e.BackSlash=220]="BackSlash",e[e.CloseBracket=221]="CloseBracket",e[e.SingleQuote=222]="SingleQuote"}(i=t.KeyCode||(t.KeyCode={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.encodeHtml=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},e.decodeHtml=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},e.prepareTextForRequest=function(e){return e.replace(/%/g,"%25").replace(/&/g,"%26amp;").replace(/\+/g,"%2B").replace(/</g,"%26lt;").replace(/>/g,"%26gt;").replace(/"/g,"%26quot;")},e.prepareTextForCallBackRequest=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},e.decodeViaTextArea=function(e){var t=document.createElement("TEXTAREA");return t.innerHTML=e,t.value},e}();t.EncodeUtils=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandler=void 0;var r=n(0),i=n(47),o=n(6),s=n(8),a=n(97),l=n(98),c=n(99),u=n(100),d=n(101),h=n(102),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){switch(e.touches.length>1&&e.preventDefault(),this.getEventSource(o.EvtUtils.getEventSource(e))){case s.MouseEventSource.TaskEdit_Frame:this.switchState(new a.TouchHandlerMoveTaskState(this));break;case s.MouseEventSource.TaskEdit_Progress:this.switchState(new c.TouchHandlerProgressTaskState(this));break;case s.MouseEventSource.TaskEdit_Start:case s.MouseEventSource.TaskEdit_End:this.switchState(new u.TouchHandlerTimestampTaskState(this));break;case s.MouseEventSource.TaskEdit_DependencyStart:case s.MouseEventSource.TaskEdit_DependencyFinish:this.switchState(new d.TouchHandlerDependencyState(this))}this.state.onTouchStart(e)},t.prototype.onDoubleTap=function(e){this.state.onDoubleTap(e)},t.prototype.onTouchEnd=function(e){this.state.onTouchEnd(e)},t.prototype.onTouchMove=function(e){e.touches.length>1&&(this.state instanceof h.TouchHandlerZoomState||this.switchState(new h.TouchHandlerZoomState(this))),this.state.onTouchMove(e)},t.prototype.switchToDefaultState=function(){this.state=new l.TouchHandlerDefaultState(this)},t}(i.HandlerBase);t.TouchHandler=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerMoveTaskState=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchEndInternal=function(e){this.handler.control.taskEditController.confirmMove()},t.prototype.onTouchMoveInternal=function(e){this.handler.control.taskEditController.processMove(e.x-this.currentPosition.x)||this.handler.switchToDefaultState()},t}(n(31).TouchHandlerDragBaseState);t.TouchHandlerMoveTaskState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerDefaultState=void 0;var r=n(0),i=n(4),o=n(3),s=n(6),a=n(15),l=n(17),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){var t=this;if(this.preventSelect=!1,clearTimeout(this.popupTimer),1===e.touches.length){var n=s.EvtUtils.getEventSource(e),r={event:e,position:new i.Point(s.EvtUtils.getEventX(e),s.EvtUtils.getEventY(e))};if(o.DomUtils.hasClassName(n,l.GridLayoutCalculator.CLASSNAMES.CONNECTOR_HORIZONTAL)||o.DomUtils.hasClassName(n,l.GridLayoutCalculator.CLASSNAMES.CONNECTOR_VERTICAL)){this.preventSelect=!0;var a=n.getAttribute("dependency-id");this.handler.control.taskEditController.dependencyId!=a&&this.handler.control.selectDependency(a),r.type="dependency",r.key=a,this.handler.control.ganttOwner.showPopupMenu(r)}else this.popupTimer=setTimeout((function(){var n=t.getTaskIndex(e);t.changeTaskSelection(n);var i=t.handler.control.viewModel.items[n];r.type="task",r.key=i&&i.task.id,t.handler.control.ganttOwner.showPopupMenu(r)}),500)}},t.prototype.onDoubleTap=function(e){},t.prototype.onTouchEnd=function(e){clearTimeout(this.popupTimer),this.preventSelect||this.changeTaskSelection(this.getTaskIndex(e))},t.prototype.onTouchMove=function(e){clearTimeout(this.popupTimer),this.preventSelect=!0},t.prototype.getTaskIndex=function(e){var t=a.TouchUtils.getEventY(e)-o.DomUtils.getAbsolutePositionY(this.handler.control.taskArea);return Math.floor(t/this.handler.control.tickSize.height)},t.prototype.changeTaskSelection=function(e){var t=this.handler.control.viewModel.items[e];t&&this.handler.control.ganttOwner.changeGanttTaskSelection(t.task.id,!0)},t}(n(19).HandlerStateBase);t.TouchHandlerDefaultState=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerProgressTaskState=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchEndInternal=function(e){this.handler.control.taskEditController.confirmProgress()},t.prototype.onTouchMoveInternal=function(e){var t=this.getRelativePos(e);this.handler.control.taskEditController.processProgress(t)},t}(n(31).TouchHandlerDragBaseState);t.TouchHandlerProgressTaskState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerTimestampTaskState=void 0;var r=n(0),i=n(31),o=n(8),s=n(6),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(t){e.prototype.onTouchStart.call(this,t),this.source=this.handler.getEventSource(s.EvtUtils.getEventSource(t))},t.prototype.onTouchEndInternal=function(e){this.source==o.MouseEventSource.TaskEdit_Start?this.handler.control.taskEditController.confirmStart():this.handler.control.taskEditController.confirmEnd()},t.prototype.onTouchMoveInternal=function(e){var t=this.getRelativePos(e);this.source==o.MouseEventSource.TaskEdit_Start&&this.handler.control.taskEditController.processStart(t),this.source==o.MouseEventSource.TaskEdit_End&&this.handler.control.taskEditController.processEnd(t)},t}(i.TouchHandlerDragBaseState);t.TouchHandlerTimestampTaskState=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerDependencyState=void 0;var r=n(0),i=n(49),o=n(8),s=n(3),a=n(6),l=n(4),c=n(48),u=n(15),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){e.preventDefault();var t=a.EvtUtils.getEventSource(e);this.source=this.handler.getEventSource(t);var n=this.getRelativePos(new l.Point(s.DomUtils.getAbsolutePositionX(t)+t.clientWidth/2,s.DomUtils.getAbsolutePositionY(t)+t.clientHeight/2));this.handler.control.taskEditController.startDependency(n)},t.prototype.onTouchEnd=function(e){var t=this.getRelativePos(new l.Point(s.DomUtils.getAbsolutePositionX(this.handler.control.taskEditController.dependencySuccessorStart)+this.handler.control.taskEditController.dependencySuccessorStart.clientWidth/2,s.DomUtils.getAbsolutePositionY(this.handler.control.taskEditController.dependencySuccessorStart)+this.handler.control.taskEditController.dependencySuccessorStart.clientHeight/2)),n=this.getRelativePos(new l.Point(s.DomUtils.getAbsolutePositionX(this.handler.control.taskEditController.dependencySuccessorFinish)+this.handler.control.taskEditController.dependencySuccessorFinish.clientWidth/2,s.DomUtils.getAbsolutePositionY(this.handler.control.taskEditController.dependencySuccessorFinish)+this.handler.control.taskEditController.dependencySuccessorFinish.clientHeight/2)),r=this.getRelativePos(new l.Point(u.TouchUtils.getEventX(e),u.TouchUtils.getEventY(e))),i=this.isTouchNearby(r,t)?o.MouseEventSource.Successor_DependencyStart:this.isTouchNearby(r,n)?o.MouseEventSource.Successor_DependencyFinish:null,a=i===o.MouseEventSource.Successor_DependencyStart||i==o.MouseEventSource.Successor_DependencyFinish?c.dependencyMap[this.source][i]:null;this.handler.control.taskEditController.endDependency(a),this.handler.switchToDefaultState()},t.prototype.onTouchMove=function(e){e.preventDefault();var t=this.getRelativePos(new l.Point(u.TouchUtils.getEventX(e),u.TouchUtils.getEventY(e))),n=Math.floor(t.y/this.handler.control.tickSize.height);this.handler.control.taskEditController.processDependency(t),this.handler.control.viewModel.tasks.items[n]&&this.handler.control.taskEditController.showDependencySuccessor(n)},t.prototype.isTouchNearby=function(e,t){return Math.abs(t.x-e.x)<=10&&Math.abs(t.y-e.y)<=10},t}(i.TouchHandlerStateBase);t.TouchHandlerDependencyState=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerZoomState=void 0;var r=n(0),i=n(19),o=n(4),s=n(3),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){},t.prototype.onDoubleTap=function(e){},t.prototype.onTouchEnd=function(e){this.prevDistance=null,this.handler.switchToDefaultState()},t.prototype.onTouchMove=function(e){if(e.stopPropagation(),e.preventDefault(),e.touches.length>1){var t=this.getTouchDistance(e);if(this.prevDistance){var n=this.prevDistance-t;if(Math.abs(n)>3){var r=this.getMiddleAbsPoint(e).x;n>0?this.handler.control.zoomOut(r):this.handler.control.zoomIn(r),this.prevDistance=t}}else this.prevDistance=t}},t.prototype.getTouchDistance=function(e){var t=new o.Point(e.touches[0].clientX,e.touches[0].clientY),n=new o.Point(e.touches[1].clientX,e.touches[1].clientY);return this.getDistance(t,n)},t.prototype.getDistance=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},t.prototype.getMiddleAbsPoint=function(e){var t=this;return this.getMiddlePointByEvent(e,(function(e){return new o.Point(e.pageX-s.DomUtils.getAbsolutePositionX(t.handler.control.taskAreaContainer.getElement()),e.pageY-s.DomUtils.getAbsolutePositionY(t.handler.control.taskAreaContainer.getElement()))}))},t.prototype.getMiddlePointByEvent=function(e,t){if(e.touches.length>1)return new o.Point((t(e.touches[0]).x+t(e.touches[1]).x)/2,(t(e.touches[0]).y+t(e.touches[1]).y)/2)},t}(i.HandlerStateBase);t.TouchHandlerZoomState=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskAreaContainer=void 0;var r=function(){function e(e,t){this.element=e,this.onScrollHandler=function(){t.updateView()},this.element.addEventListener("scroll",this.onScrollHandler)}return Object.defineProperty(e.prototype,"scrollTop",{get:function(){return this.element.scrollTop},set:function(e){this.element.scrollTop=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollLeft",{get:function(){return this.element.scrollLeft},set:function(e){this.element.scrollLeft=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollWidth",{get:function(){return this.element.scrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollHeight",{get:function(){return this.element.scrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isExternal",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.getWidth=function(){return this.element.offsetWidth},e.prototype.getHeight=function(){return this.element.offsetHeight},e.prototype.getElement=function(){return this.element},e.prototype.detachEvents=function(){this.element.removeEventListener("scroll",this.onScrollHandler)},e}();t.TaskAreaContainer=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelChangesDispatcher=void 0;var r=n(105),i=n(50),o=n(32),s=function(){function e(){this.onModelChanged=new r.EventDispatcher,this.isLocked=!1}return e.prototype.notifyTaskCreating=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskCreating",e)},e.prototype.notifyTaskCreated=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskCreated",e,t,n)},e.prototype.notifyTaskRemoving=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskRemoving",e)},e.prototype.notifyTaskRemoved=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskRemoved",e,t,n)},e.prototype.notifyTaskUpdating=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskUpdating",e)},e.prototype.notifyTaskMoving=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskMoving",e)},e.prototype.notifyTaskEditDialogShowing=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskEditDialogShowing",e)},e.prototype.notifyTaskTitleChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskTitleChanged",e,t,n)},e.prototype.notifyTaskDescriptionChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskDescriptionChanged",e,t,n)},e.prototype.notifyTaskStartChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskStartChanged",e,t,n)},e.prototype.notifyTaskEndChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskEndChanged",e,t,n)},e.prototype.notifyTaskProgressChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskProgressChanged",e,t,n)},e.prototype.notifyTaskColorChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskColorChanged",e,t,n)},e.prototype.notifyDependencyInserting=function(e){this.isLocked||this.onModelChanged.raise("NotifyDependencyInserting",e)},e.prototype.notifyDependencyInserted=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyDependencyInserted",e,t,n)},e.prototype.notifyDependencyRemoving=function(e){this.isLocked||this.onModelChanged.raise("NotifyDependencyRemoving",e)},e.prototype.notifyDependencyRemoved=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyDependencyRemoved",e,t,n)},e.prototype.notifyResourceCreating=function(e){this.isLocked||this.onModelChanged.raise("NotifyResourceCreating",e)},e.prototype.notifyResourceCreated=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceCreated",e,t,n)},e.prototype.notifyResourceRemoving=function(e){this.isLocked||this.onModelChanged.raise("NotifyResourceRemoving",e)},e.prototype.notifyResourceRemoved=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceRemoved",e,t,n)},e.prototype.notifyResourceColorChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceColorChanged",e,t,n)},e.prototype.notifyResourceAssigning=function(e){this.isLocked||this.onModelChanged.raise("NotifyResourceAssigning",e)},e.prototype.notifyResourceAssigned=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceAssigned",e,t,n)},e.prototype.notifyResourceUnassigning=function(e){this.isLocked||this.onModelChanged.raise("NotifyResourceUnassigning",e)},e.prototype.notifyResourceUnassigned=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceUnassigned",e,t,n)},e.prototype.notifyParentDataRecalculated=function(e){this.onModelChanged.raise("NotifyParentDataRecalculated",e)},e.prototype.fireResourceUnassigning=function(e){var t=new o.ResourceUnassigningArguments(e);return this.notifyResourceUnassigning(t),!t.cancel},e.prototype.raiseTaskTitleUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"title",t,n)},e.prototype.raiseTaskDescriptionUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"description",t,n)},e.prototype.raiseTaskProgressUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"progress",t,n)},e.prototype.raiseTaskColorUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"color",t,n)},e.prototype.raiseTaskStartUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"start",t,n)},e.prototype.raiseTaskEndUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"end",t,n)},e.prototype.raiseTaskStartAndEndUpdating=function(e,t,n,r){var o=new i.TaskUpdatingArguments(e,["start","end"],[t,n]);return this.notifyTaskUpdating(o),!o.cancel&&(r(o.start,o.end),!0)},e.prototype.raiseTaskUpdating=function(e,t,n,r){var o=e[t];if(o!==n){var s=new i.TaskUpdatingArguments(e,[t],[n]);if(this.notifyTaskUpdating(s),!s.cancel&&o!==s[t])return r(s[t]),!0}return!1},e.prototype.raiseTaskMultipleUpdating=function(e,t,n){var r=["title","progress","start","end","color"],o=r.map((function(e){return t[e]})),s=new i.TaskUpdatingArguments(e,r,o);return this.notifyTaskUpdating(s),!s.cancel&&(n(s.newValues),!0)},e.prototype.raiseTaskMoving=function(e,t,n,r){var o=new i.TaskUpdatingArguments(e,["start","end"],[t,n]);return this.notifyTaskMoving(o),!o.cancel&&(r(o.start,o.end),!0)},e.prototype.raiseTaskTaskEditDialogShowing=function(e,t){var n=new i.TaskEditDialogShowingArguments(e);return this.notifyTaskEditDialogShowing(n),!n.cancel&&(t(n),!0)},e.prototype.lock=function(){this.isLocked=!0},e.prototype.unlock=function(){this.isLocked=!1},e}();t.ModelChangesDispatcher=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDispatcher=void 0;var r=function(){function e(){this.listeners=[]}return e.prototype.add=function(e){if(!e)throw new Error("Error");this.hasEventListener(e)||this.listeners.push(e)},e.prototype.remove=function(e){for(var t=0,n=void 0;n=this.listeners[t];t++)if(n===e){this.listeners.splice(t,1);break}},e.prototype.raise=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=void 0;i=this.listeners[r];r++){var o=i[e];null==o||o.apply(i,t)}},e.prototype.hasEventListener=function(e){for(var t=0,n=this.listeners.length;t<n;t++)if(this.listeners[t]===e)return!0;return!1},e}();t.EventDispatcher=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommandManager=void 0;var r=n(107),i=n(108),o=n(109),s=n(111),a=n(113),l=n(52),c=n(114),u=n(115),d=n(116),h=n(117),p=n(118),f=n(119),m=n(23),g=n(120),y=function(){function e(e){this.control=e,this.commands={},this.createCommand(u.GanttClientCommand.CreateTask,this.createTaskCommand),this.createCommand(u.GanttClientCommand.CreateSubTask,this.createSubTaskCommand),this.createCommand(u.GanttClientCommand.RemoveTask,this.removeTaskCommand),this.createCommand(u.GanttClientCommand.RemoveDependency,this.removeDependencyCommand),this.createCommand(u.GanttClientCommand.TaskInformation,this.showTaskEditDialog),this.createCommand(u.GanttClientCommand.TaskAddContextItem,new r.TaskAddContextItemCommand(this.control)),this.createCommand(u.GanttClientCommand.Undo,new d.UndoCommand(this.control)),this.createCommand(u.GanttClientCommand.Redo,new d.RedoCommand(this.control)),this.createCommand(u.GanttClientCommand.ZoomIn,new h.ZoomInCommand(this.control)),this.createCommand(u.GanttClientCommand.ZoomOut,new h.ZoomOutCommand(this.control)),this.createCommand(u.GanttClientCommand.FullScreen,new p.ToggleFullScreenCommand(this.control)),this.createCommand(u.GanttClientCommand.CollapseAll,new f.CollapseAllCommand(this.control)),this.createCommand(u.GanttClientCommand.ExpandAll,new f.ExpandAllCommand(this.control))}return Object.defineProperty(e.prototype,"createTaskCommand",{get:function(){return new r.CreateTaskCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createSubTaskCommand",{get:function(){return new r.CreateSubTaskCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"removeTaskCommand",{get:function(){return new r.RemoveTaskCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskTitleCommand",{get:function(){return new i.TaskTitleCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskDescriptionCommand",{get:function(){return new i.TaskDescriptionCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskProgressCommand",{get:function(){return new i.TaskProgressCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskColorCommand",{get:function(){return new i.TaskColorCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskStartCommand",{get:function(){return new i.TaskStartCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"taskMoveCommand",{get:function(){return new i.TaskMoveCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskEndCommand",{get:function(){return new i.TaskEndCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateTaskCommand",{get:function(){return new r.UpdateTaskCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createDependencyCommand",{get:function(){return new o.CreateDependencyCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"removeDependencyCommand",{get:function(){return new o.RemoveDependencyCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createResourceCommand",{get:function(){return new s.CreateResourceCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"removeResourceCommand",{get:function(){return new s.RemoveResourceCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assignResourceCommand",{get:function(){return new s.AssignResourceCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deassignResourceCommand",{get:function(){return new s.DeassignResourceCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeResourceColorCommand",{get:function(){return new g.ResourceColorCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showTaskEditDialog",{get:function(){return new a.TaskEditDialogCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showConstraintViolationDialog",{get:function(){return new l.ConstraintViolationDialogCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showConfirmationDialog",{get:function(){return new m.ConfirmationDialog(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showResourcesDialog",{get:function(){return new c.ResourcesDialogCommand(this.control)},enumerable:!1,configurable:!0}),e.prototype.getCommand=function(e){return this.commands[e]},e.prototype.createCommand=function(e,t){this.commands[e]=t},e}();t.CommandManager=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskAddContextItemCommand=t.UpdateTaskCommand=t.RemoveTaskCommand=t.CreateSubTaskCommand=t.CreateTaskCommand=t.TaskCommandBase=void 0;var r=n(0),i=n(7),o=n(51),s=n(21),a=n(22),l=n(23),c=n(50),u=n(25),d=n(1),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){var e=new i.SimpleCommandState(this.isEnabled());return e.visible=this.control.settings.editing.enabled&&!this.control.taskEditController.dependencyId,e},t}(i.CommandBase);t.TaskCommandBase=h;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t){return e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){var t;if(null!=e||(e={}),!e.parentId){var n=this.control.viewModel.findItem(this.control.currentSelectedTaskID),r=n&&n.task;r&&(e.parentId=r.parentId)}var i=this.control.viewModel.findItem(e.parentId)||this.control.viewModel.items[0],s=i&&i.task;e.start||(e.start=s?new Date(s.start.getTime()):new Date(this.control.range.start.getTime())),e.end||(e.end=s?new Date(s.end.getTime()):new Date(this.control.range.end.getTime())),null!==(t=e.title)&&void 0!==t||(e.title="New task");var a=new c.TaskInsertingArguments(null,e);return this.modelManipulator.dispatcher.notifyTaskCreating(a),a.cancel||this.history.addAndRedo(new o.CreateTaskHistoryItem(this.modelManipulator,a)),!a.cancel},t.prototype.getState=function(){var t=e.prototype.getState.call(this);return t.visible=t.visible&&this.control.settings.editing.allowTaskInsert,t},t}(h);t.CreateTaskCommand=p;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t){return e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){e=e||this.control.currentSelectedTaskID;var t=this.control.viewModel.findItem(e);if(t.selected){var n={start:new Date(t.task.start.getTime()),end:new Date(t.task.end.getTime()),title:"New task",progress:0,parentId:e},r=new c.TaskInsertingArguments(null,n);return this.modelManipulator.dispatcher.notifyTaskCreating(r),r.cancel||this.history.addAndRedo(new o.CreateTaskHistoryItem(this.modelManipulator,r)),!r.cancel}return!1},t.prototype.isEnabled=function(){var t=this.control,n=t.viewModel.findItem(t.currentSelectedTaskID);return e.prototype.isEnabled.call(this)&&!!n&&n.selected},t.prototype.getState=function(){var t=e.prototype.getState.call(this),n=this.control;return t.visible=t.visible&&n.settings.editing.allowTaskInsert,t},t}(h);t.CreateSubTaskCommand=f;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n,r){var i=this;return void 0===n&&(n=!0),n?(this.control.commandManager.showConfirmationDialog.execute(new l.ConfirmationDialogParameters(l.ConfirmationType.TaskDelete,(function(){i.executeInternal(t,r)}))),!1):e.prototype.execute.call(this,t,r)},t.prototype.executeInternal=function(e,n){var r=this;e=e||this.control.currentSelectedTaskID;var i=this.control.viewModel.findItem(e),l=i?i.task:this.control.viewModel.tasks.getItemById(e),u=new c.TaskRemovingArguments(l);if(this.modelManipulator.dispatcher.notifyTaskRemoving(u),u.cancel)return!1;this.control.viewModel.beginUpdate();var d=n||new o.RemoveTaskHistoryItem(this.modelManipulator);d.addTask(e);var h=this.control.viewModel.tasks.items.filter((function(t){return t.parentId==e}));h.forEach((function(e){return new t(r.control).execute(e.internalId,!1,d)}));var p=i&&i.parent,f=this.control.viewModel.dependencies.items.filter((function(t){return t.predecessorId==e||t.successorId==e}));if(f.length){if(!this.control.settings.editing.allowDependencyDelete)return!1;(f=f.filter((function(e){return 0==h.filter((function(t){return t.internalId==e.predecessorId||t.internalId==e.successorId})).length}))).forEach((function(e){return d.add(new s.RemoveDependencyHistoryItem(r.modelManipulator,e.internalId))}))}return this.control.viewModel.assignments.items.filter((function(t){return t.taskId==e})).forEach((function(e){r.modelManipulator.dispatcher.fireResourceUnassigning(e)&&d.add(new a.DeassignResourceHistoryItem(r.modelManipulator,e.internalId))})),n||this.history.addAndRedo(d),this.updateParent(p),this.control.viewModel.endUpdate(),!0},t.prototype.updateParent=function(e){e&&e.children.length>0&&this.control.validationController.updateParentsIfRequired(e.children[0].task.internalId)},t.prototype.isEnabled=function(){var t=this.control,n=t.viewModel.findItem(t.currentSelectedTaskID);return e.prototype.isEnabled.call(this)&&!!n&&n.selected},t.prototype.getState=function(){var t=e.prototype.getState.call(this),n=this.control;return t.visible=t.visible&&n.settings.editing.allowTaskDelete,t},t}(h);t.RemoveTaskCommand=m;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this.control.viewModel.tasks.getItemById(e);if(!n)return!1;var r=this.control.modelManipulator.dispatcher.raiseTaskMultipleUpdating(n,t,(function(e){t.title=e.title,t.progress=e.progress,t.start=e.start,t.end=e.end,t.color=e.color}));if(r){this.history.beginTransaction();var i=!1;d.isDefined(t.title)&&t.title!==n.title&&this.history.addAndRedo(new u.TaskTitleHistoryItem(this.modelManipulator,e,t.title)),d.isDefined(t.progress)&&t.progress!==n.progress&&(this.history.addAndRedo(new u.TaskProgressHistoryItem(this.modelManipulator,e,t.progress)),i=!0),d.isDefined(t.start)&&d.isDefined(t.end)&&t.end.getTime()<t.start.getTime()&&(t.end=t.start),d.isDefined(t.start)&&t.start!==n.start&&(this.history.addAndRedo(new u.TaskStartHistoryItem(this.modelManipulator,e,t.start)),i=!0,this.control.settings.validation.validateDependencies&&this.control.validationController.moveStartDependTasks(e,n.start)),d.isDefined(t.end)&&t.end!==n.end&&(this.history.addAndRedo(new u.TaskEndHistoryItem(this.modelManipulator,e,t.end)),i=!0,this.control.settings.validation.validateDependencies&&this.control.validationController.moveEndDependTasks(e,n.end)),d.isDefined(t.color)&&t.color!==n.color&&this.history.addAndRedo(new u.TaskColorHistoryItem(this.modelManipulator,e,t.color)),i?this.validationController.updateParentsIfRequired(e):this.control.updateOwnerInAutoParentMode(),this.history.endTransaction()}return r},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowTaskUpdate},t}(h);t.UpdateTaskCommand=g;var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){var t=e.prototype.getState.call(this);return t.visible=t.visible&&this.control.settings.editing.allowTaskInsert,t},t.prototype.execute=function(){return!1},t}(h);t.TaskAddContextItemCommand=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskMoveCommand=t.TaskEndCommand=t.TaskStartCommand=t.TaskPropertyCommandValidation=t.TaskColorCommand=t.TaskProgressCommand=t.TaskDescriptionCommand=t.TaskTitleCommand=t.TaskPropertyCommandBase=void 0;var r=n(0),i=n(7),o=n(25),s=n(52),a=n(9),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowTaskUpdate},t.prototype.getTask=function(e){return this.control.viewModel.tasks.getItemById(e)},t}(i.CommandBase);t.TaskPropertyCommandBase=l;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this;return this.modelManipulator.dispatcher.raiseTaskTitleUpdating(this.getTask(e),t,(function(t){n.history.addAndRedo(new o.TaskTitleHistoryItem(n.modelManipulator,e,t))}))},t}(l);t.TaskTitleCommand=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this;return this.modelManipulator.dispatcher.raiseTaskDescriptionUpdating(this.getTask(e),t,(function(t){n.history.addAndRedo(new o.TaskDescriptionHistoryItem(n.modelManipulator,e,t))}))},t}(l);t.TaskDescriptionCommand=u;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this;return this.modelManipulator.dispatcher.raiseTaskProgressUpdating(this.getTask(e),t,(function(t){n.control.history.beginTransaction(),n.history.addAndRedo(new o.TaskProgressHistoryItem(n.modelManipulator,e,t)),n.validationController.updateParentsIfRequired(e),n.control.history.endTransaction()}))},t}(l);t.TaskProgressCommand=d;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this;return this.modelManipulator.dispatcher.raiseTaskColorUpdating(this.getTask(e),t,(function(t){n.history.addAndRedo(new o.TaskColorHistoryItem(n.modelManipulator,e,t))}))},t}(l);t.TaskColorCommand=h;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.executeInternal=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this.control.settings.validation.validateDependencies?this.validate.apply(this,t):[],i=r.filter((function(e){return e.critical}));return!r.length||r.length>1&&0===i.length?this.executeCore.apply(this,t):(1===r.length&&this.control.commandManager.showConstraintViolationDialog.execute(new s.ConstraintViolationDialogParameters(r[0],(function(){e.executeCore.apply(e,t)}))),!1)},t.prototype.executeCore=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!1},t.prototype.validate=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return[]},t}(l);t.TaskPropertyCommandValidation=p;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return this.modelManipulator.dispatcher.raiseTaskStartUpdating(this.getTask(t),n,(function(e){n=e}))&&e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(t,n){return e.prototype.executeInternal.call(this,t,n)},t.prototype.executeCore=function(e,t){var n=this.control.viewModel.tasks.getItemById(e).start;if(n.getTime()==t.getTime())return!1;this.control.history.beginTransaction(),this.history.addAndRedo(new o.TaskStartHistoryItem(this.modelManipulator,e,t)),this.control.settings.validation.validateDependencies&&this.control.validationController.moveStartDependTasks(e,n),this.validationController.updateParentsIfRequired(e),this.control.history.endTransaction();var r=this.control.viewModel.tasks.items.reduce((function(e,t){return t.isValid()?e.isValid()&&e.start.getTime()<t.start.getTime()?e:t:e}));return r.start<this.control.dataRange.start&&(this.control.dataRange.start=r.start,this.control.resetAndUpdate()),!0},t.prototype.validate=function(e,t){return this.control.validationController.checkStartDependencies(e,t)},t}(p);t.TaskStartCommand=f;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return this.modelManipulator.dispatcher.raiseTaskEndUpdating(this.getTask(t),n,(function(e){n=e}))&&e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(t,n){return e.prototype.executeInternal.call(this,t,n)},t.prototype.executeCore=function(e,t){var n=this.control.viewModel.tasks.getItemById(e).end;if(n.getTime()==t.getTime())return!1;this.control.history.beginTransaction(),this.history.addAndRedo(new o.TaskEndHistoryItem(this.modelManipulator,e,t)),this.control.settings.validation.validateDependencies&&this.control.validationController.moveEndDependTasks(e,n),this.validationController.updateParentsIfRequired(e),this.control.history.endTransaction();var r=this.control.viewModel.tasks.items.reduce((function(e,t){return t.isValid()?e.end.getTime()>t.end.getTime()?e:t:e}));return r.end>this.control.dataRange.end&&(this.control.dataRange.end=r.end,this.control.resetAndUpdate()),!0},t.prototype.validate=function(e,t){return this.control.validationController.checkEndDependencies(e,t)},t}(p);t.TaskEndCommand=m;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n,r){return this.modelManipulator.dispatcher.raiseTaskStartAndEndUpdating(this.getTask(t),n,r,(function(e,t){n=e,r=t}))&&e.prototype.execute.call(this,t,n,r)},t.prototype.executeInternal=function(t,n,r){return e.prototype.executeInternal.call(this,t,n,r)},t.prototype.executeCore=function(e,t,n){var r=this.control.viewModel.tasks.getItemById(e),i=new a.DateRange(new Date(r.start.getTime()),new Date(r.end.getTime()));this.control.history.beginTransaction(),this.history.addAndRedo(new o.TaskMoveHistoryItem(this.modelManipulator,e,new a.DateRange(t,n))),this.validationController.correctOnMoving(e,t.getTime()-i.start.getTime()),this.control.settings.validation.validateDependencies&&(this.control.validationController.moveStartDependTasks(e,i.start),this.control.validationController.moveEndDependTasks(e,i.end)),this.control.history.endTransaction();var s=this.control.viewModel.tasks.items.reduce((function(e,t){return t.isValid()?e.end.getTime()>t.end.getTime()?e:t:e}));s.end>this.control.dataRange.end&&(this.control.dataRange.end=s.end,this.control.resetAndUpdate());var l=this.control.viewModel.tasks.items.reduce((function(e,t){return t.isValid()?e.isValid()&&e.start.getTime()<t.start.getTime()?e:t:e}));return l.start<this.control.dataRange.start&&(this.control.dataRange.start=l.start,this.control.resetAndUpdate()),!0},t.prototype.validate=function(e,t,n){var i=this.control.validationController.checkStartDependencies(e,t),o=this.control.validationController.checkEndDependencies(e,n);return r.__spreadArray(r.__spreadArray([],i),o)},t}(p);t.TaskMoveCommand=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoveDependencyCommand=t.CreateDependencyCommand=t.DependencyCommandBase=void 0;var r=n(0),i=n(7),o=n(21),s=n(11),a=n(23),l=n(110),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t}(i.CommandBase);t.DependencyCommandBase=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n,r){return e.prototype.execute.call(this,t,n,r)},t.prototype.executeInternal=function(e,t,n){if(this.control.viewModel.dependencies.items.filter((function(n){return n.predecessorId==e&&n.successorId==t||n.successorId==e&&n.predecessorId==t})).length)return!1;var r=new l.DependencyInsertingArguments(e,t,n);if(this.modelManipulator.dispatcher.notifyDependencyInserting(r),r.cancel)return!1;if(e=r.predecessorId,t=r.successorId,n=r.type,this.control.history.beginTransaction(),this.history.addAndRedo(new o.InsertDependencyHistoryItem(this.modelManipulator,e,t,n)),this.control.settings.validation.validateDependencies){var i=this.control.viewModel.tasks.getItemById(e);n===s.DependencyType.SF||n===s.DependencyType.SS?this.control.validationController.moveStartDependTasks(e,i.start):this.control.validationController.moveEndDependTasks(e,i.end)}return this.control.history.endTransaction(),!0},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowDependencyInsert},t}(c);t.CreateDependencyCommand=u;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){var r=this;return void 0===n&&(n=!0),n?(this.control.commandManager.showConfirmationDialog.execute(new a.ConfirmationDialogParameters(a.ConfirmationType.DependencyDelete,(function(){r.executeInternal(t)}))),!1):e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){if(null!=(e=e||this.control.taskEditController.dependencyId)){var t=this.control.viewModel.dependencies.items.filter((function(t){return t.internalId==e}))[0];if(t){var n=new l.DependencyRemovingArguments(t);if(this.modelManipulator.dispatcher.notifyDependencyRemoving(n),!n.cancel)return this.history.addAndRedo(new o.RemoveDependencyHistoryItem(this.modelManipulator,e)),e===this.control.taskEditController.dependencyId&&this.control.taskEditController.selectDependency(null),this.control.barManager.updateItemsState([]),!0}}return!1},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowDependencyDelete},t.prototype.getState=function(){var t=e.prototype.getState.call(this);return t.visible=t.enabled&&null!=this.control.taskEditController.dependencyId,t},t}(c);t.RemoveDependencyCommand=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DependencyRemovingArguments=t.DependencyInsertingArguments=void 0;var r=n(0),i=n(20),o=function(e){function t(t,n,r){var i=e.call(this,null)||this;return i.values={predecessorId:t,successorId:n,type:r},i}return r.__extends(t,e),Object.defineProperty(t.prototype,"predecessorId",{get:function(){return this.values.predecessorId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"successorId",{get:function(){return this.values.successorId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.values.type},enumerable:!1,configurable:!0}),t}(i.BaseArguments);t.DependencyInsertingArguments=o;var s=function(e){function t(t){var n=e.call(this,t.id)||this;return n.values=t,n}return r.__extends(t,e),t}(i.BaseArguments);t.DependencyRemovingArguments=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeassignResourceCommand=t.AssignResourceCommand=t.RemoveResourceCommand=t.CreateResourceCommand=t.ResourceCommandBase=void 0;var r=n(0),i=n(7),o=n(22),s=n(112),a=n(32),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t}(i.CommandBase);t.ResourceCommandBase=l;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n,r){return void 0===n&&(n=""),e.prototype.execute.call(this,t,n,r)},t.prototype.executeInternal=function(e,t,n){void 0===t&&(t="");var r=new s.ResourceInsertingArguments(e,t);return this.modelManipulator.dispatcher.notifyResourceCreating(r),r.cancel||this.history.addAndRedo(new o.CreateResourceHistoryItem(this.modelManipulator,r.text,r.color,n)),!r.cancel},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowResourceInsert},t}(l);t.CreateResourceCommand=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t){return e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){var t=this,n=this.control.viewModel.resources.items.filter((function(t){return t.internalId==e}))[0];if(n){var r=new s.ResourceRemovingArguments(n);if(this.modelManipulator.dispatcher.notifyResourceRemoving(r),!r.cancel){var i=new o.RemoveResourceHistoryItem(this.modelManipulator,e);return this.control.viewModel.assignments.items.filter((function(t){return t.resourceId==e})).forEach((function(e){t.modelManipulator.dispatcher.fireResourceUnassigning(e)&&i.add(new o.DeassignResourceHistoryItem(t.modelManipulator,e.internalId))})),this.history.addAndRedo(i),!0}}return!1},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowResourceDelete},t}(l);t.RemoveResourceCommand=u;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){if(!this.control.viewModel.assignments.items.filter((function(n){return n.resourceId==e&&n.taskId==t}))[0]){var n=this.control.viewModel,r=new a.ResourceAssigningArguments(n.convertInternalToPublicKey("resource",e),n.convertInternalToPublicKey("task",t));if(this.modelManipulator.dispatcher.notifyResourceAssigning(r),!r.cancel)return this.history.addAndRedo(new o.AssignResourceHistoryItem(this.modelManipulator,n.convertPublicToInternalKey("resource",r.resourceId),n.convertPublicToInternalKey("task",r.taskId))),!0}return!1},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowTaskResourceUpdate},t}(l);t.AssignResourceCommand=d;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t){return e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){var t=this.control.viewModel.assignments.items.filter((function(t){return t.internalId==e}))[0];return!(!t||!this.modelManipulator.dispatcher.fireResourceUnassigning(t))&&(this.history.addAndRedo(new o.DeassignResourceHistoryItem(this.modelManipulator,e)),!0)},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowTaskResourceUpdate},t}(l);t.DeassignResourceCommand=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceRemovingArguments=t.ResourceInsertingArguments=void 0;var r=n(0),i=n(20),o=function(e){function t(t,n){void 0===n&&(n="");var r=e.call(this,null)||this;return r.values={text:t,color:n},r}return r.__extends(t,e),Object.defineProperty(t.prototype,"text",{get:function(){return this.values.text},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.values.color},enumerable:!1,configurable:!0}),t}(i.BaseArguments);t.ResourceInsertingArguments=o;var s=function(e){function t(t){var n=e.call(this,t.id)||this;return n.values=t,n}return r.__extends(t,e),t}(i.BaseArguments);t.ResourceRemovingArguments=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskEditParameters=t.TaskEditDialogCommand=void 0;var r=n(0),i=n(24),o=n(25),s=n(26),a=n(22),l=n(32),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onBeforeDialogShow=function(e){return this.modelManipulator.dispatcher.raiseTaskTaskEditDialogShowing(e,(function(t){var n=t.values;e.start=n.start,e.end=n.end,e.progress=n.progress,e.title=n.title,e.readOnlyFields=t.readOnlyFields,e.hiddenFields=t.hiddenFields}))},t.prototype.applyParameters=function(e,t){this.history.beginTransaction();var n=this.control.modelManipulator.dispatcher.raiseTaskMultipleUpdating(this.control.viewModel.tasks.getItemById(t.id),e,(function(t){e.title=t.title?t.title:"",e.progress=t.progress,e.start="string"==typeof t.start?new Date(t.start):t.start||new Date(0),e.end="string"==typeof t.end?new Date(t.end):t.end||new Date(0)}));n&&(e.title!==t.title&&this.history.addAndRedo(new o.TaskTitleHistoryItem(this.modelManipulator,t.id,e.title)),e.progress!==t.progress&&this.history.addAndRedo(new o.TaskProgressHistoryItem(this.modelManipulator,t.id,e.progress)),e.end.getTime()<e.start.getTime()&&(e.end=e.start),e.start!==t.start&&(this.history.addAndRedo(new o.TaskStartHistoryItem(this.modelManipulator,t.id,e.start)),this.control.settings.validation.validateDependencies&&this.control.validationController.moveStartDependTasks(t.id,t.start)),e.end!==t.end&&(this.history.addAndRedo(new o.TaskEndHistoryItem(this.modelManipulator,t.id,e.end)),this.control.settings.validation.validateDependencies&&this.control.validationController.moveEndDependTasks(t.id,t.end)));for(var r=0;r<e.assigned.length;r++){if(!t.assigned.getItemById(e.assigned.getItem(r).internalId)){var i=e.assigned.getItem(r).internalId,s=t.id,c=new l.ResourceAssigningArguments(i,s);this.modelManipulator.dispatcher.notifyResourceAssigning(c),c.cancel||this.history.addAndRedo(new a.AssignResourceHistoryItem(this.modelManipulator,c.resourceId,c.taskId))}}var u=function(n){var r=t.assigned.getItem(n);if(!e.assigned.getItemById(r.internalId)){var i=d.control.viewModel.assignments.items.filter((function(e){return e.resourceId==r.internalId&&e.taskId==t.id}))[0];d.modelManipulator.dispatcher.fireResourceUnassigning(i)&&d.history.addAndRedo(new a.DeassignResourceHistoryItem(d.modelManipulator,i.internalId))}},d=this;for(r=0;r<t.assigned.length;r++)u(r);var h=e.start!==t.start||e.end!==t.end||e.progress!==t.progress||e.title!==t.title;return n&&h&&this.validationController.updateParentsIfRequired(t.id),this.history.endTransaction(),!1},t.prototype.createParameters=function(e){e=e||this.control.viewModel.tasks.getItemById(this.control.currentSelectedTaskID);var t=new u;return t.id=e.internalId,t.title=e.title,t.progress=e.progress,t.start=e.start,t.end=e.end,t.assigned=this.control.viewModel.getAssignedResources(e),t.resources=new s.ResourceCollection,t.resources.addRange(this.control.viewModel.resources.items),t.showResourcesDialogCommand=this.control.commandManager.showResourcesDialog,t.showTaskEditDialogCommand=this.control.commandManager.showTaskEditDialog,t.enableEdit=this.isTaskEditEnabled(),t.enableRangeEdit=this.isTaskRangeEditEnabled(e),t},t.prototype.isTaskEditEnabled=function(){var e=this.control.settings;return e.editing.enabled&&e.editing.allowTaskUpdate},t.prototype.isTaskRangeEditEnabled=function(e){return!this.control.viewModel.isTaskToCalculateByChildren(e.internalId)},t.prototype.isEnabled=function(){var e=this.control,t=e.viewModel.findItem(e.currentSelectedTaskID);return!!t&&t.selected},t.prototype.getState=function(){var t=e.prototype.getState.call(this);return t.visible=t.visible&&!this.control.taskEditController.dependencyId,t},t.prototype.getDialogName=function(){return"TaskEdit"},t}(i.DialogBase);t.TaskEditDialogCommand=c;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enableEdit=!0,t.enableRangeEdit=!0,t.hiddenFields=[],t.readOnlyFields=[],t}return r.__extends(t,e),t.prototype.clone=function(){var e=new t;return e.id=this.id,e.title=this.title,e.progress=this.progress,e.start=this.start,e.end=this.end,e.assigned=new s.ResourceCollection,e.assigned.addRange(this.assigned.items),e.resources=new s.ResourceCollection,e.resources.addRange(this.resources.items),e.showResourcesDialogCommand=this.showResourcesDialogCommand,e.showTaskEditDialogCommand=this.showTaskEditDialogCommand,e.enableEdit=this.enableEdit,e.enableRangeEdit=this.enableRangeEdit,e.hiddenFields=this.hiddenFields.slice(),e.readOnlyFields=this.readOnlyFields.slice(),e},t}(i.DialogParametersBase);t.TaskEditParameters=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesDialogParameters=t.ResourcesDialogCommand=void 0;var r=n(0),i=n(24),o=n(26),s=n(23),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resourcesForDelete=[],t}return r.__extends(t,e),t.prototype.applyParameters=function(e,t){this.history.beginTransaction();for(var n=0;n<e.resources.length;n++){t.resources.getItemById(e.resources.getItem(n).internalId)||this.control.commandManager.createResourceCommand.execute(e.resources.getItem(n).text)}for(n=0;n<t.resources.length;n++){e.resources.getItemById(t.resources.getItem(n).internalId)||this.resourcesForDelete.push(t.resources.getItem(n))}return this.history.endTransaction(),!1},t.prototype.createParameters=function(e){this.callBack=e;var t=new l;return t.resources=new o.ResourceCollection,t.resources.addRange(this.control.viewModel.resources.items),t},t.prototype.afterClosing=function(){var e=this;if(this.resourcesForDelete.length){var t=this.control.commandManager.showConfirmationDialog,n=new s.ConfirmationDialogParameters(s.ConfirmationType.ResourcesDelete,(function(){e.history.beginTransaction();for(var t=0;t<e.resourcesForDelete.length;t++)e.control.commandManager.removeResourceCommand.execute(e.resourcesForDelete[t].internalId);e.history.endTransaction()}));n.message=this.resourcesForDelete.reduce((function(e,t){return r.__spreadArray(r.__spreadArray([],e),[t.text])}),[]).join(", "),this.callBack&&(t.afterClosing=function(){return e.callBack()}),t.execute(n)}else this.callBack&&this.callBack()},t.prototype.getDialogName=function(){return"Resources"},t}(i.DialogBase);t.ResourcesDialogCommand=a;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.clone=function(){var e=new t;return e.resources=new o.ResourceCollection,e.resources.addRange(this.resources.items),e},t}(i.DialogParametersBase);t.ResourcesDialogParameters=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttClientCommand=void 0,function(e){e[e.CreateTask=0]="CreateTask",e[e.CreateSubTask=1]="CreateSubTask",e[e.RemoveTask=2]="RemoveTask",e[e.RemoveDependency=3]="RemoveDependency",e[e.TaskInformation=4]="TaskInformation",e[e.TaskAddContextItem=5]="TaskAddContextItem",e[e.Undo=6]="Undo",e[e.Redo=7]="Redo",e[e.ZoomIn=8]="ZoomIn",e[e.ZoomOut=9]="ZoomOut",e[e.FullScreen=10]="FullScreen",e[e.CollapseAll=11]="CollapseAll",e[e.ExpandAll=12]="ExpandAll"}(t.GanttClientCommand||(t.GanttClientCommand={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RedoCommand=t.UndoCommand=void 0;var r=n(0),i=n(7),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){var e=new i.SimpleCommandState(this.isEnabled());return e.visible=this.control.settings.editing.enabled,e},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.history.undo(),!0},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.history.canUndo()},t}(i.CommandBase);t.UndoCommand=o;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){var e=new i.SimpleCommandState(this.isEnabled());return e.visible=this.control.settings.editing.enabled,e},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.history.redo(),!0},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.history.canRedo()},t}(i.CommandBase);t.RedoCommand=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZoomOutCommand=t.ZoomInCommand=void 0;var r=n(0),i=n(7),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(!0)},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.zoomIn(),!0},t}(i.CommandBase);t.ZoomInCommand=o;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(!0)},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.zoomOut(),!0},t}(i.CommandBase);t.ZoomOutCommand=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToggleFullScreenCommand=void 0;var r=n(0),i=n(7),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isInFullScreenMode=!1,t.fullScreenTempVars={},t}return r.__extends(t,e),t.prototype.getState=function(){var e=new i.SimpleCommandState(!0);return e.value=this.control.fullScreenModeHelper.isInFullScreenMode,e},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.fullScreenModeHelper.toggle(),!0},t}(i.CommandBase);t.ToggleFullScreenCommand=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpandAllCommand=t.CollapseAllCommand=void 0;var r=n(0),i=n(7),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.ganttOwner.collapseAll(),!0},t.prototype.isEnabled=function(){return!0},t}(i.CommandBase);t.CollapseAllCommand=o;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.ganttOwner.expandAll(),!0},t.prototype.isEnabled=function(){return!0},t}(i.CommandBase);t.ExpandAllCommand=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceColorCommand=t.ResourcePropertyCommandBase=void 0;var r=n(0),i=n(7),o=n(121),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowResourceUpdate},t}(i.CommandBase);t.ResourcePropertyCommandBase=s;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){return this.control.viewModel.resources.getItemById(e).color!=t&&(this.history.addAndRedo(new o.ResourceColorHistoryItem(this.modelManipulator,e,t)),!0)},t}(s);t.ResourceColorCommand=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceColorHistoryItem=t.ResourcePropertiesHistoryItemBase=void 0;var r=n(0),i=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.resourceId=n,i.newValue=r,i}return r.__extends(t,e),t.prototype.redo=function(){this.oldState=this.getPropertiesManipulator().setValue(this.resourceId,this.newValue)},t.prototype.undo=function(){this.getPropertiesManipulator().restoreValue(this.oldState)},t.prototype.getPropertiesManipulator=function(){throw new Error("Not Implemented")},t}(n(12).HistoryItem);t.ResourcePropertiesHistoryItemBase=i;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getPropertiesManipulator=function(){return this.modelManipulator.resource.properties.color},t}(i);t.ResourceColorHistoryItem=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BarManager=void 0;var r=function(){function e(e,t){this.control=e,this.bars=t}return e.prototype.updateContextMenu=function(){for(var e=0,t=void 0;t=this.bars[e];e++)if(t.isContextMenu()){t.updateItemsList();for(var n=t.getCommandKeys(),r=0;r<n.length;r++)this.updateBarItem(t,n[r])}},e.prototype.updateItemsState=function(e){for(var t=!!e.length,n=function(n,i){if(i.isVisible()){for(var o=i.getCommandKeys(),s=function(n){if(t&&!e.filter((function(e){return e==o[n]})).length)return"continue";r.updateBarItem(i,o[n])},a=0;a<o.length;a++)s(a);i.completeUpdate()}},r=this,i=0,o=void 0;o=this.bars[i];i++)n(0,o)},e.prototype.updateBarItem=function(e,t){var n=this.control.commandManager.getCommand(t);if(n){var r=n.getState();e.setItemVisible(t,r.visible),r.visible&&(e.setItemEnabled(t,r.enabled),e.setItemValue(t,r.value))}},e}();t.BarManager=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationController=t.ValidationError=void 0;var r=n(0),i=n(11),o=n(25),s=n(9),a=n(2),l=n(1),c=function(e,t){void 0===t&&(t=!1),this.dependencyId=e,this.critical=t};t.ValidationError=c;var u=function(){function e(e){this.gantt=e}return Object.defineProperty(e.prototype,"viewModel",{get:function(){return this.gantt.viewModel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"history",{get:function(){return this.gantt.history},enumerable:!1,configurable:!0}),e.prototype.checkStartDependencies=function(e,t){var n=this,r=[],o=this.gantt.viewModel.tasks.getItemById(e);return this.viewModel.dependencies.items.filter((function(t){return t.successorId==e})).forEach((function(e){var s=n.gantt.viewModel.tasks.getItemById(e.predecessorId);(e.type==i.DependencyType.FS&&s.end>t||e.type==i.DependencyType.SS&&s.start>t)&&r.push(new c(e.internalId,!0)),(e.type==i.DependencyType.FS&&s.end.valueOf()==o.start.valueOf()&&t>s.end||e.type==i.DependencyType.SS&&s.start.valueOf()==o.start.valueOf()&&t>s.start)&&r.push(new c(e.internalId))})),r},e.prototype.checkEndDependencies=function(e,t){var n=this,r=[],o=this.gantt.viewModel.tasks.getItemById(e);return this.viewModel.dependencies.items.filter((function(t){return t.successorId==e})).forEach((function(e){var s=n.gantt.viewModel.tasks.getItemById(e.predecessorId);(e.type==i.DependencyType.SF&&s.start>t||e.type==i.DependencyType.FF&&s.end>t)&&r.push(new c(e.internalId,!0)),(e.type==i.DependencyType.SF&&s.start.valueOf()==o.end.valueOf()&&t>s.start||e.type==i.DependencyType.FF&&s.end.valueOf()==o.end.valueOf()&&t>s.end)&&r.push(new c(e.internalId))})),r},e.prototype.moveEndDependTasks=function(e,t){var n=this;this.viewModel.dependencies.items.filter((function(t){return t.predecessorId==e})).forEach((function(r){var a=n.gantt.viewModel.tasks.getItemById(e),l=n.gantt.viewModel.tasks.getItemById(r.successorId),c=new s.DateRange(new Date(l.start.getTime()),new Date(l.end.getTime())),u=new s.DateRange(new Date,new Date);if(r.type==i.DependencyType.FS&&(l.start<a.end||l.start.valueOf()===t.valueOf()&&l.start>a.end)){if(u.start.setTime(a.end.getTime()),u.end.setTime(u.start.getTime()+(l.end.getTime()-l.start.getTime())),n.correctMoving(l.internalId,u),n.history.addAndRedo(new o.TaskMoveHistoryItem(n.gantt.modelManipulator,r.successorId,u)),n._parentAutoCalc){var d=u.start.getTime()-c.start.getTime();n.correctOnMoving(l.internalId,d)}n.moveStartDependTasks(r.successorId,c.start),n.moveEndDependTasks(r.successorId,c.end)}if(r.type==i.DependencyType.FF&&(l.end<a.end||l.end.valueOf()===t.valueOf()&&l.end>a.end)){if(u.start.setTime(a.end.getTime()-(l.end.getTime()-l.start.getTime())),u.end.setTime(a.end.getTime()),n.correctMoving(l.internalId,u),n.history.addAndRedo(new o.TaskMoveHistoryItem(n.gantt.modelManipulator,r.successorId,u)),n._parentAutoCalc){d=u.start.getTime()-c.start.getTime();n.correctOnMoving(l.internalId,d)}n.moveStartDependTasks(r.successorId,c.start),n.moveEndDependTasks(r.successorId,c.end)}}))},e.prototype.moveStartDependTasks=function(e,t){var n=this;this.viewModel.dependencies.items.filter((function(t){return t.predecessorId==e})).forEach((function(r){var a=n.gantt.viewModel.tasks.getItemById(e),l=n.gantt.viewModel.tasks.getItemById(r.successorId),c=new s.DateRange(new Date(l.start.getTime()),new Date(l.end.getTime())),u=new s.DateRange(new Date,new Date);if(r.type==i.DependencyType.SF&&(l.end<a.start||l.end.valueOf()===t.valueOf()&&l.end>a.start)){if(u.start.setTime(a.start.getTime()-(l.end.getTime()-l.start.getTime())),u.end.setTime(a.start.getTime()),n.correctMoving(l.internalId,u),n.history.addAndRedo(new o.TaskMoveHistoryItem(n.gantt.modelManipulator,r.successorId,u)),n._parentAutoCalc){var d=u.start.getTime()-c.start.getTime();n.correctOnMoving(l.internalId,d)}n.moveStartDependTasks(r.successorId,c.start),n.moveEndDependTasks(r.successorId,c.end)}if(r.type==i.DependencyType.SS&&(l.start<a.start||l.start.valueOf()===t.valueOf()&&l.start>a.start)){if(u.start.setTime(a.start.getTime()),u.end.setTime(a.start.getTime()+(l.end.getTime()-l.start.getTime())),n.correctMoving(l.internalId,u),n.history.addAndRedo(new o.TaskMoveHistoryItem(n.gantt.modelManipulator,r.successorId,u)),n._parentAutoCalc){d=u.start.getTime()-c.start.getTime();n.correctOnMoving(l.internalId,d)}n.moveStartDependTasks(r.successorId,c.start),n.moveEndDependTasks(r.successorId,c.end)}}))},e.prototype.correctMoving=function(e,t){var n=this,o=t.end.getTime()-t.start.getTime();return r.__spreadArray(r.__spreadArray([],this.checkStartDependencies(e,t.start)),this.checkEndDependencies(e,t.end)).filter((function(e){return e.critical})).forEach((function(e){var r=n.gantt.viewModel.dependencies.getItemById(e.dependencyId),s=n.gantt.viewModel.tasks.getItemById(r.predecessorId);r.type==i.DependencyType.FS&&t.start<s.end&&(t.start.setTime(s.end.getTime()),t.end.setTime(t.start.getTime()+o)),r.type==i.DependencyType.SS&&t.start<s.start&&(t.start.setTime(s.start.getTime()),t.end.setTime(t.start.getTime()+o)),r.type==i.DependencyType.FF&&t.end<s.end&&(t.end.setTime(s.end.getTime()),t.start.setTime(t.end.getTime()-o)),r.type==i.DependencyType.SF&&t.end<s.start&&(t.end.setTime(s.start.getTime()),t.start.setTime(t.end.getTime()-o))})),t},e.prototype.recalculateParents=function(e,t){for(var n=e&&e.parent;n&&n.task;){for(var r=n.children,i=this.gantt.range.end,o=this.gantt.range.start,s=0,l=0,c={id:n.task.internalId},u=0;u<r.length;u++){var d=r[u].task;if(d.isValid()){i=a.DateTimeUtils.getMinDate(i,d.start),o=a.DateTimeUtils.getMaxDate(o,d.end);var h=d.getDuration();s+=d.progress*h,l+=h}}a.DateTimeUtils.areDatesEqual(n.task.start,i)||(c.start=i),a.DateTimeUtils.areDatesEqual(n.task.end,o)||(c.end=o),(s=Math.ceil(s/l))!==n.task.progress&&(c.progress=s),t(c),n=n.parent}},e.prototype.updateParentsRangeByChild=function(e){var t=this;this.recalculateParents(this.viewModel.findItem(e),(function(e){if(l.isDefined(e.id)){var n=t.history,r=t.gantt.modelManipulator;l.isDefined(e.start)&&n.addAndRedo(new o.TaskStartHistoryItem(r,e.id,e.start)),l.isDefined(e.end)&&n.addAndRedo(new o.TaskEndHistoryItem(r,e.id,e.end)),l.isDefined(e.progress)&&n.addAndRedo(new o.TaskProgressHistoryItem(r,e.id,e.progress))}}))},e.prototype.updateChildRangeByParent=function(e,t,n){var r=this.viewModel.findItem(e);if(r&&0!==r.children.length)for(var i=r.children,s=0;s<i.length;s++){var a=i[s].task,l=new Date(a.start.getTime()+t),c=new Date(a.end.getTime()+t);n.push({id:a.internalId,start:a.start,end:a.end}),l<a.end?(this.history.addAndRedo(new o.TaskStartHistoryItem(this.gantt.modelManipulator,a.internalId,l)),this.history.addAndRedo(new o.TaskEndHistoryItem(this.gantt.modelManipulator,a.internalId,c))):(this.history.addAndRedo(new o.TaskEndHistoryItem(this.gantt.modelManipulator,a.internalId,c)),this.history.addAndRedo(new o.TaskStartHistoryItem(this.gantt.modelManipulator,a.internalId,l))),this.updateChildRangeByParent(a.internalId,t,n)}},e.prototype.updateParentsIfRequired=function(e){this._parentAutoCalc&&(this.updateParentsRangeByChild(e),this.gantt.updateOwnerInAutoParentMode())},e.prototype.correctOnMoving=function(e,t){var n=this;if(this._parentAutoCalc&&0!==t){this.updateParentsRangeByChild(e);var r=[];this.updateChildRangeByParent(e,t,r),this.gantt.settings.validation.validateDependencies&&r.forEach((function(e){n.moveStartDependTasks(e.id,e.start),n.moveEndDependTasks(e.id,e.end)})),this.gantt.updateOwnerInAutoParentMode()}},Object.defineProperty(e.prototype,"_parentAutoCalc",{get:function(){return this.viewModel.parentAutoCalc},enumerable:!1,configurable:!0}),e}();t.ValidationController=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FullScreenModeHelper=void 0;var r=n(5),i=n(125),o=n(3),s=function(){function e(e){this._isInFullScreenMode=!1,this.fullScreenTempVars={},this.gantt=e}return Object.defineProperty(e.prototype,"isInFullScreenMode",{get:function(){return this._isInFullScreenMode},enumerable:!1,configurable:!0}),e.prototype.toggle=function(){return this._isInFullScreenMode=!this._isInFullScreenMode,this._isInFullScreenMode?this.setFullScreenMode():this.setNormalMode(),!0},e.prototype.setFullScreenMode=function(){this.prepareFullScreenMode(),this.adjustControlInFullScreenMode()},e.prototype.prepareFullScreenMode=function(){var e=this.getMainElement();i.AttrUtils.changeElementStyleAttribute(e,"border-top-width","0px"),i.AttrUtils.changeElementStyleAttribute(e,"border-left-width","0px"),i.AttrUtils.changeElementStyleAttribute(e,"border-right-width","0px"),i.AttrUtils.changeElementStyleAttribute(e,"border-bottom-width","0px"),this.fullScreenTempVars.scrollTop=o.DomUtils.getDocumentScrollTop(),this.fullScreenTempVars.scrollLeft=o.DomUtils.getDocumentScrollLeft(),i.AttrUtils.changeElementStyleAttribute(e,"background-color","white"),i.AttrUtils.changeElementStyleAttribute(e,"position","fixed"),i.AttrUtils.changeElementStyleAttribute(e,"top","0px"),i.AttrUtils.changeElementStyleAttribute(e,"left","0px"),i.AttrUtils.changeElementStyleAttribute(e,"z-index","1010"),i.AttrUtils.changeElementStyleAttribute(document.documentElement,"position","static"),i.AttrUtils.changeElementStyleAttribute(document.documentElement,"overflow","hidden"),this.fullScreenTempVars.bodyMargin=document.body.style.margin,document.body.style.margin="0",this.fullScreenTempVars.width=e.style.width,this.fullScreenTempVars.height=e.style.height||e.clientHeight,window.self!==window.top&&this.requestFullScreen(document.body)},e.prototype.setNormalMode=function(){this.cancelFullScreen(document);var e=this.getMainElement();i.AttrUtils.restoreElementStyleAttribute(e,"left"),i.AttrUtils.restoreElementStyleAttribute(e,"top"),i.AttrUtils.restoreElementStyleAttribute(e,"background-color"),i.AttrUtils.restoreElementStyleAttribute(document.documentElement,"overflow"),i.AttrUtils.restoreElementStyleAttribute(document.documentElement,"position"),i.AttrUtils.restoreElementStyleAttribute(e,"z-index"),document.body.style.margin=this.fullScreenTempVars.bodyMargin,i.AttrUtils.restoreElementStyleAttribute(e,"position"),i.AttrUtils.restoreElementStyleAttribute(e,"border-top-width"),i.AttrUtils.restoreElementStyleAttribute(e,"border-left-width"),i.AttrUtils.restoreElementStyleAttribute(e,"border-right-width"),i.AttrUtils.restoreElementStyleAttribute(e,"border-bottom-width"),this.setHeight(this.fullScreenTempVars.height),this.setWidth(this.fullScreenTempVars.width),document.documentElement.scrollTop=this.fullScreenTempVars.scrollTop,document.documentElement.scrollLeft=this.fullScreenTempVars.scrollLeft,this.adjustControl()},e.prototype.adjustControlInFullScreenMode=function(){var e=0==document.documentElement.clientWidth?document.body.clientWidth:document.documentElement.clientWidth,t=0==document.documentElement.clientHeight?document.body.clientHeight:document.documentElement.clientHeight;this.setWidth(e),this.setHeight(t),this.adjustControl()},e.prototype.requestFullScreen=function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()},e.prototype.cancelFullScreen=function(e){r.Browser.Firefox&&!this.getFullScreenElement(e)||(e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen?e.msExitFullscreen():e.exitFullscreen&&e.exitFullscreen())},e.prototype.getFullScreenElement=function(e){return e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement},e.prototype.setWidth=function(e){this.getMainElement().style.width=this.isNumber(e)?e+"px":e},e.prototype.setHeight=function(e){this.getMainElement().style.height=this.isNumber(e)?e+"px":e},e.prototype.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},e.prototype.getMainElement=function(){return this.gantt.getOwnerControlMainElement()},e.prototype.adjustControl=function(){this.gantt.adjustOwnerControl()},e}();t.FullScreenModeHelper=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=function(){function e(){}return e.setElementAttribute=function(e,t,n){e.setAttribute&&(r.Browser.IE&&r.Browser.MajorVersion>=11&&"src"===t.toLowerCase()&&e.setAttribute(t,""),e.setAttribute(t,n))},e.setStyleAttribute=function(e,t,n){e.setProperty&&e.setProperty(t,n,"")},e.getElementAttribute=function(e,t){return e.getAttribute(t)},e.getStyleAttribute=function(e,t){if(e.getPropertyValue){if(r.Browser.Firefox)try{return e.getPropertyValue(t)}catch(n){return e[t]}return e.getPropertyValue(t)}return null},e.removeElementAttribute=function(e,t){e.removeAttribute&&e.removeAttribute(t)},e.removeStyleAttribute=function(e,t){e.removeProperty&&e.removeProperty(t)},e.changeElementStyleAttribute=function(t,n,r){e.saveStyleAttributeInElement(t,n),e.setStyleAttribute(t.style,n,r)},e.restoreElementStyleAttribute=function(t,n){var r="saved"+n,i=t.style;if(e.isExistsAttributeInElement(t,r)){var o=e.getElementAttribute(t,r);return o===e.emptyObject||null===o?e.removeStyleAttribute(i,n):e.setStyleAttribute(i,n,o),e.removeElementAttribute(t,r),!0}return!1},e.saveStyleAttributeInElement=function(t,n){var r="saved"+n,i=t.style;if(!e.isExistsAttributeInElement(t,r)){var o=e.getStyleAttribute(i,n);e.setElementAttribute(t,r,e.isAttributeExists(o)?o:e.emptyObject)}},e.isExistsAttributeInElement=function(t,n){var r=e.getElementAttribute(t,n);return e.isAttributeExists(r)},e.isAttributeExists=function(e){return null!==e&&""!==e},e.emptyObject="DxEmptyValue",e}();t.AttrUtils=i}])}));
|
|
39
|
+
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var h=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function p(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||h(t,e,n)}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function T(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof v?Promise.resolve(n.value.v).then(l,c):u(o[0][2],n)}catch(e){u(o[0][3],e)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function k(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:v(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function I(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var S=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function M(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&h(t,e,n);return S(t,e),t}function E(e){return e&&e.__esModule?e:{default:e}}function D(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function b(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceAssignment=void 0;var r=n(0),i=n(10),o=n(1),s=function(e){function t(){var t=e.call(this)||this;return t.taskId="",t.resourceId="",t}return r.__extends(t,e),t.prototype.assignFromObject=function(t){o.isDefined(t)&&(e.prototype.assignFromObject.call(this,t),this.taskId=String(t.taskId),this.resourceId=String(t.resourceId))},t}(i.DataObject);t.ResourceAssignment=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;var r=function(){function e(e,t,n,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=0),this._hour=0,this._min=0,this._sec=0,this._msec=0,this._fullmsec=0,this.hour=e,this.min=t,this.sec=n,this.msec=r}return Object.defineProperty(e.prototype,"hour",{get:function(){return this._hour},set:function(e){e>=0&&e<24&&(this._hour=e,this.updateFullMilleconds())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this._min},set:function(e){e>=0&&e<60&&(this._min=e,this.updateFullMilleconds())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sec",{get:function(){return this._sec},set:function(e){e>=0&&e<60&&(this._sec=e,this.updateFullMilleconds())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"msec",{get:function(){return this._msec},set:function(e){e>=0&&e<1e3&&(this._msec=e,this.updateFullMilleconds())},enumerable:!1,configurable:!0}),e.prototype.updateFullMilleconds=function(){var e=60*(60*this._hour+this._min)+this._sec;this._fullmsec=1e3*e+this._msec},e.prototype.getTimeInMilleconds=function(){return this._fullmsec},e}();t.Time=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeRange=void 0;var r=n(2),i=function(){function e(e,t){r.DateTimeUtils.caclTimeDifference(e,t)>=0?(this._start=e,this._end=t):(this._start=t,this._end=e)}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},set:function(e){e&&r.DateTimeUtils.caclTimeDifference(e,this._end)>=0&&(this._start=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},set:function(e){e&&r.DateTimeUtils.caclTimeDifference(this._start,e)>=0&&(this._end=e)},enumerable:!1,configurable:!0}),e.prototype.isTimeInRange=function(e){return r.DateTimeUtils.caclTimeDifference(this._start,e)>=0&&r.DateTimeUtils.caclTimeDifference(e,this._end)>=0},e.prototype.hasIntersect=function(e){return this.isTimeInRange(e.start)||this.isTimeInRange(e.end)||e.isTimeInRange(this.start)||e.isTimeInRange(this.end)},e.prototype.concatWith=function(e){return!!this.hasIntersect(e)&&(this.start=r.DateTimeUtils.getMinTime(this.start,e.start),this.end=r.DateTimeUtils.getMaxTime(this.end,e.end),!0)},e}();t.TimeRange=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DayOfWeekMonthlyOccurrence=void 0,function(e){e[e.First=0]="First",e[e.Second=1]="Second",e[e.Third=2]="Third",e[e.Forth=3]="Forth",e[e.Last=4]="Last"}(t.DayOfWeekMonthlyOccurrence||(t.DayOfWeekMonthlyOccurrence={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RecurrenceFactory=void 0;var r=n(1),i=n(41),o=n(73),s=n(74),a=n(76),l=function(){function e(){}return e.createRecurrenceByType=function(e){if(!e)return null;switch(e.toLowerCase()){case"daily":return new i.Daily;case"weekly":return new o.Weekly;case"monthly":return new s.Monthly;case"yearly":return new a.Yearly}return null},e.createRecurrenceFromObject=function(e){if(!e)return null;var t=this.createRecurrenceByType(e.type);return t&&t.assignFromObject(e),t},e.getEnumValue=function(e,t){if(!r.isDefined(e[t]))return null;var n=parseInt(t);return isNaN(n)?e[t]:n},e}();t.RecurrenceFactory=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Daily=void 0;var r=n(0),i=n(16),o=n(2),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.checkDate=function(e){return!0},t.prototype.checkInterval=function(e){return o.DateTimeUtils.getDaysBetween(this.start,e)%this.interval==0},t.prototype.calculatePointByInterval=function(e){var t=this.interval;return this.isRecurrencePoint(e)||(t-=o.DateTimeUtils.getDaysBetween(this.start,e)%this.interval),o.DateTimeUtils.addDays(e,t)},t.prototype.calculateNearestPoint=function(e){return o.DateTimeUtils.addDays(e,1)},t}(i.RecurrenceBase);t.Daily=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElementTextHelperCultureInfo=t.ElementTextHelper=t.DateUtils=void 0;var r=n(14),i=n(3),o=function(){function e(){}var t;return e.getDaysInMonth=function(e,t){return new Date(t,e+1,0).getDate()},e.getOffsetInMonths=function(e,t){return 12*(t.getFullYear()-e.getFullYear())+t.getMonth()-e.getMonth()},e.getOffsetInQuarters=function(e,t){return 4*(t.getFullYear()-e.getFullYear())+Math.floor(t.getMonth()/3)-Math.floor(e.getMonth()/3)},e.getNearestScaleTickDate=function(e,t,n,r){var i=new Date,o=t.start.getTime(),s=t.end.getTime();if(i.setTime(e.getTime()),e.getTime()<o)i.setTime(o);else if(e.getTime()>s)i.setTime(s);else if(this.needCorrectDate(e,o,n,r)){var a=this.getNearestLeftTickTime(e,o,n,r),l=this.getNextTickTime(a,n,r);Math.abs(e.getTime()-a)>Math.abs(e.getTime()-l)?i.setTime(l):i.setTime(a)}return i},e.needCorrectDate=function(e,t,n,i){return i==r.ViewType.Months?e.getTime()!==new Date(e.getFullYear(),e.getMonth(),1).getTime():(e.getTime()-t)%n!=0},e.getNearestLeftTickTime=function(e,t,n,i){return i==r.ViewType.Months?new Date(e.getFullYear(),e.getMonth(),1).getTime():t+Math.floor((e.getTime()-t)/n)*n},e.getNextTickTime=function(e,t,n){if(n==r.ViewType.Months){var i=new Date;return i.setTime(e),i.setMonth(i.getMonth()+1),i.getTime()}return e+t},e.adjustStartDateByViewType=function(e,t,n){switch(void 0===n&&(n=0),t){case r.ViewType.TenMinutes:return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case r.ViewType.SixHours:case r.ViewType.Hours:return new Date(e.getFullYear(),e.getMonth(),e.getDate());case r.ViewType.Days:case r.ViewType.Weeks:return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay()+n);case r.ViewType.Months:case r.ViewType.Quarter:case r.ViewType.Years:return new Date(e.getFullYear(),0,1);default:return new Date}},e.adjustEndDateByViewType=function(e,t,n){switch(void 0===n&&(n=0),t){case r.ViewType.TenMinutes:return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours()+1);case r.ViewType.SixHours:case r.ViewType.Hours:return new Date(e.getFullYear(),e.getMonth(),e.getDate()+1);case r.ViewType.Days:case r.ViewType.Weeks:return new Date(e.getFullYear(),e.getMonth(),e.getDate()+7-e.getDay()+n);case r.ViewType.Months:case r.ViewType.Quarter:case r.ViewType.Years:return new Date(e.getFullYear()+1,0,1);default:return new Date}},e.roundStartDate=function(e,t){switch(t){case r.ViewType.TenMinutes:case r.ViewType.Hours:return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours()-1);case r.ViewType.SixHours:case r.ViewType.Days:return new Date(e.getFullYear(),e.getMonth(),e.getDate()-1);case r.ViewType.Weeks:return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case r.ViewType.Months:return new Date(e.getFullYear(),e.getMonth()-1);case r.ViewType.Quarter:case r.ViewType.Years:return new Date(e.getFullYear()-1,0,1);default:return new Date}},e.getTickTimeSpan=function(t){switch(t){case r.ViewType.TenMinutes:return e.msPerHour/6;case r.ViewType.Hours:return e.msPerHour;case r.ViewType.SixHours:return 6*e.msPerHour;case r.ViewType.Days:return e.msPerDay;case r.ViewType.Weeks:return e.msPerWeek;case r.ViewType.Months:return e.msPerMonth;case r.ViewType.Quarter:return 3*e.msPerMonth;case r.ViewType.Years:return e.msPerYear}},e.parse=function(e){return"function"==typeof e?new Date(e()):new Date(e)},e.getTimezoneOffsetDiff=function(e,t){return t.getTimezoneOffset()-e.getTimezoneOffset()},e.msPerHour=36e5,e.msPerDay=24*e.msPerHour,e.msPerWeek=7*e.msPerDay,e.msPerMonth=30*e.msPerDay,e.msPerYear=365*e.msPerDay,e.ViewTypeToScaleMap=((t={})[r.ViewType.TenMinutes]=r.ViewType.Hours,t[r.ViewType.Hours]=r.ViewType.Days,t[r.ViewType.SixHours]=r.ViewType.Days,t[r.ViewType.Days]=r.ViewType.Weeks,t[r.ViewType.Weeks]=r.ViewType.Months,t[r.ViewType.Months]=r.ViewType.Years,t[r.ViewType.Quarter]=r.ViewType.Years,t[r.ViewType.Years]=r.ViewType.FiveYears,t),e}();t.DateUtils=o;var s=function(){function e(e){this.longestAbbrMonthName=null,this.longestMonthName=null,this.longestAbbrDayName=null;var t=document.createElement("canvas");this.textMeasureContext=t.getContext("2d"),this.cultureInfo=e}return e.prototype.setFont=function(e){var t=i.DomUtils.getCurrentStyle(e),n=t.font?t.font:t.fontStyle+" "+t.fontVariant+" "+t.fontWeight+" "+t.fontSize+" / "+t.lineHeight+" "+t.fontFamily;this.textMeasureContext.font=n},e.prototype.setSettings=function(e,t,n){this.startTime=e,this.viewType=t,this.modelItems=n},e.prototype.getScaleItemStartDate=function(e,t){var n=new Date(this.startTime);switch(t){case r.ViewType.TenMinutes:n.setTime(this.startTime+e*o.msPerHour/6);break;case r.ViewType.Hours:n.setTime(this.startTime+e*o.msPerHour);break;case r.ViewType.SixHours:n.setTime(this.startTime+e*o.msPerHour*6);break;case r.ViewType.Days:n.setTime(this.startTime+e*o.msPerDay);break;case r.ViewType.Weeks:n.setTime(this.startTime+e*o.msPerWeek);break;case r.ViewType.Months:n.setMonth(n.getMonth()+e);break;case r.ViewType.Quarter:n.setMonth(n.getMonth()+3*e);break;case r.ViewType.Years:n.setFullYear(n.getFullYear()+e);break;case r.ViewType.FiveYears:n.setFullYear(n.getFullYear()+5*e)}return n=this.getScaleStartDateCorrectedWithDST(n)},e.prototype.getScaleStartDateCorrectedWithDST=function(e){var t=o.getTimezoneOffsetDiff(new Date(this.startTime),e);return t>0?new Date(e.getTime()+6e4*t):e},e.prototype.getScaleItemText=function(e,t){var n=this.getScaleItemStartDate(e,t),i=this.viewType.valueOf()==t.valueOf();switch(t){case r.ViewType.TenMinutes:return this.getTenMinutesScaleItemText(n);case r.ViewType.Hours:case r.ViewType.SixHours:return this.getHoursScaleItemText(n);case r.ViewType.Days:return this.getDaysScaleItemText(n,i);case r.ViewType.Weeks:return this.getWeeksScaleItemText(n,i);case r.ViewType.Months:return this.getMonthsScaleItemText(n,i);case r.ViewType.Quarter:return this.getQuarterScaleItemText(n,i);case r.ViewType.Years:return this.getYearsScaleItemText(n);case r.ViewType.FiveYears:return this.getFiveYearsScaleItemText(n)}},e.prototype.getTenMinutesScaleItemText=function(e){var t=e.getMinutes()+1;return(10*Math.ceil(t/10)).toString()},e.prototype.getThirtyMinutesScaleItemText=function(e){return e.getMinutes()<30?"30":"60"},e.prototype.getHoursScaleItemText=function(e){var t=e.getHours(),n=this.getHourDisplayText(t),r=t<12?this.getAmText():this.getPmText();return this.getHoursScaleItemTextCore(n,r)},e.prototype.getDaysScaleItemText=function(e,t){return this.getDayTotalText(e,!0,t,t,!t)},e.prototype.getWeeksScaleItemText=function(e,t){var n=new Date(e.getTime()+o.msPerWeek-o.msPerDay);return this.getWeeksScaleItemTextCore(this.getDayTotalText(e,t,!0,t,!t),this.getDayTotalText(n,t,!0,t,!t))},e.prototype.getMonthsScaleItemText=function(e,t){var n=this.getMonthNames(),r=t?"":e.getFullYear().toString();return this.getMonthsScaleItemTextCore(n[e.getMonth()],r)},e.prototype.getQuarterScaleItemText=function(e,t){var n=this.getQuarterNames(),r=t?"":e.getFullYear().toString();return this.getMonthsScaleItemTextCore(n[Math.floor(e.getMonth()/3)],r)},e.prototype.getYearsScaleItemText=function(e){return e.getFullYear().toString()},e.prototype.getFiveYearsScaleItemText=function(e){return e.getFullYear().toString()+" - "+(e.getFullYear()+4).toString()},e.prototype.getHourDisplayText=function(e){return this.hasAmPm()?(0==e?12:e<=12?e:e-12).toString():e<10?"0"+e:e.toString()},e.prototype.getDayTotalText=function(e,t,n,r,i){var o=r?this.getAbbrMonthNames():this.getMonthNames(),s=n?this.getAbbrDayNames():this.getDayNames(),a=t?s[e.getDay()]:"",l=e.getDate(),c=o[e.getMonth()],u=i?e.getFullYear().toString():"";return this.getDayTotalTextCore(a,l.toString(),c,u)},e.prototype.getTaskText=function(e){var t=this.modelItems[e];return t?t.task.title:""},e.prototype.getTaskVisibility=function(e){var t=this.modelItems[e];return!!t&&t.getVisible()},e.prototype.hasAmPm=function(){return this.getAmText().length>0||this.getPmText().length>0},e.prototype.getScaleItemTextTemplate=function(e){switch(e){case r.ViewType.TenMinutes:return"00";case r.ViewType.Hours:case r.ViewType.SixHours:return this.getHoursScaleItemTextCore("00",this.getAmText());case r.ViewType.Days:return this.getDayTextTemplate();case r.ViewType.Weeks:return this.getWeekTextTemplate();case r.ViewType.Months:return this.getMonthsScaleItemTextCore(this.getLongestMonthName(),"");case r.ViewType.Quarter:return"Q4";case r.ViewType.Years:return"0000"}},e.prototype.getDayTextTemplate=function(){return this.getDayTotalTextCore(this.getLongestAbbrDayName(),"00",this.getLongestAbbrMonthName(),"")},e.prototype.getWeekTextTemplate=function(){var e=this.getDayTextTemplate();return this.getWeeksScaleItemTextCore(e,e)},e.prototype.getHoursScaleItemTextCore=function(e,t){return e+":00"+(this.hasAmPm()?" "+t:"")},e.prototype.getDayTotalTextCore=function(e,t,n,r){var i=e.length>0?e+", ":"";return i+=t+" "+n,i+=r.length>0?" "+r:""},e.prototype.getWeeksScaleItemTextCore=function(e,t){return e+" - "+t},e.prototype.getMonthsScaleItemTextCore=function(e,t){var n=e;return t.length>0&&(n+=" "+t),n},e.prototype.getLongestAbbrMonthName=function(){return null==this.longestAbbrMonthName&&(this.longestAbbrMonthName=this.getLongestText(this.getAbbrMonthNames())),this.longestAbbrMonthName},e.prototype.getLongestMonthName=function(){return null==this.longestMonthName&&(this.longestMonthName=this.getLongestText(this.getMonthNames())),this.longestMonthName},e.prototype.getLongestAbbrDayName=function(){return null==this.longestAbbrDayName&&(this.longestAbbrDayName=this.getLongestText(this.getAbbrDayNames())),this.longestAbbrDayName},e.prototype.getLongestText=function(e){var t=this,n="",r=0;return e.forEach((function(e){var i=t.getTextWidth(e);i>r&&(r=i,n=e)})),n},e.prototype.getTextWidth=function(e){return Math.round(this.textMeasureContext.measureText(e).width)},e.prototype.getAmText=function(){return this.cultureInfo.amText},e.prototype.getPmText=function(){return this.cultureInfo.pmText},e.prototype.getQuarterNames=function(){return this.cultureInfo.quarterNames},e.prototype.getMonthNames=function(){return this.cultureInfo.monthNames},e.prototype.getDayNames=function(){return this.cultureInfo.dayNames},e.prototype.getAbbrMonthNames=function(){return this.cultureInfo.abbrMonthNames},e.prototype.getAbbrDayNames=function(){return this.cultureInfo.abbrDayNames},e}();t.ElementTextHelper=s;var a=function(){};t.ElementTextHelperCultureInfo=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GridElementInfo=void 0;var r=n(4),i=n(28),o=n(78),s=function(){function e(t,n,s){this.id=e.id++,this.position=new r.Point(void 0,void 0),this.size=new i.Size(0,0),this.margins=new o.Margins(void 0,void 0,void 0,void 0),this.attr={},this.style={},t&&(this.className=t),n&&this.setPosition(n),s&&this.setSize(s)}return e.prototype.setSize=function(e){this.size.width=e.width,this.size.height=e.height},e.prototype.setPosition=function(e){this.position.x=e.x,this.position.y=e.y},e.prototype.assignToElement=function(e){this.assignPosition(e),this.assignSize(e),this.assignMargins(e),this.className&&(e.className=this.className)},e.prototype.assignPosition=function(e){null!=this.position.x&&(e.style.left=this.position.x+"px"),null!=this.position.y&&(e.style.top=this.position.y+"px")},e.prototype.assignSize=function(e){this.size.width&&(e.style.width=this.size.width+"px"),this.size.height&&(e.style.height=this.size.height+"px")},e.prototype.assignMargins=function(e){this.margins.left&&(e.style.marginLeft=this.margins.left+"px"),this.margins.top&&(e.style.marginTop=this.margins.top+"px"),this.margins.right&&(e.style.marginRight=this.margins.right+"px"),this.margins.bottom&&(e.style.marginBottom=this.margins.bottom+"px")},e.prototype.setAttribute=function(e,t){this.attr[e]=t},e.id=0,e}();t.GridElementInfo=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationSettings=t.StripLine=t.StripLineSettings=t.EditingSettings=t.Settings=void 0;var r=n(14),i=n(1),o=function(){function e(){this.viewType=void 0,this.taskTitlePosition=r.TaskTitlePosition.Inside,this.showResources=!0,this.areHorizontalBordersEnabled=!0,this.areVerticalBordersEnabled=!0,this.areAlternateRowsEnabled=!0,this.allowSelectTask=!0,this.firstDayOfWeek=0,this.editing=new s,this.validation=new c,this.stripLines=new a}return e.parse=function(t){var n=new e;return t&&(i.isDefined(t.viewType)&&(n.viewType=t.viewType),i.isDefined(t.taskTitlePosition)&&(n.taskTitlePosition=t.taskTitlePosition),i.isDefined(t.showResources)&&(n.showResources=t.showResources),i.isDefined(t.areHorizontalBordersEnabled)&&(n.areHorizontalBordersEnabled=t.areHorizontalBordersEnabled),i.isDefined(t.areVerticalBordersEnabled)&&(n.areHorizontalBordersEnabled=t.areHorizontalBordersEnabled),i.isDefined(t.areAlternateRowsEnabled)&&(n.areAlternateRowsEnabled=t.areAlternateRowsEnabled),i.isDefined(t.allowSelectTask)&&(n.allowSelectTask=t.allowSelectTask),i.isDefined(t.firstDayOfWeek)&&(n.firstDayOfWeek=t.firstDayOfWeek),i.isDefined(t.editing)&&(n.editing=s.parse(t.editing)),i.isDefined(t.validation)&&(n.validation=c.parse(t.validation)),i.isDefined(t.stripLines)&&(n.stripLines=a.parse(t.stripLines)),i.isDefined(t.taskTooltipContentTemplate)&&(n.taskTooltipContentTemplate=t.taskTooltipContentTemplate)),n},e.prototype.equal=function(e){var t=!0;return t=(t=(t=(t=(t=(t=(t=(t=(t=t&&this.viewType===e.viewType)&&this.taskTitlePosition===e.taskTitlePosition)&&this.showResources===e.showResources)&&this.areHorizontalBordersEnabled===e.areHorizontalBordersEnabled)&&this.areAlternateRowsEnabled===e.areAlternateRowsEnabled)&&this.allowSelectTask===e.allowSelectTask)&&this.editing.equal(e.editing))&&this.validation.equal(e.validation))&&this.stripLines.equal(e.stripLines)},e}();t.Settings=o;var s=function(){function e(){this.enabled=!1,this.allowDependencyDelete=!0,this.allowDependencyInsert=!0,this.allowTaskDelete=!0,this.allowTaskInsert=!0,this.allowTaskUpdate=!0,this.allowResourceDelete=!0,this.allowResourceInsert=!0,this.allowResourceUpdate=!0,this.allowTaskResourceUpdate=!0}return e.parse=function(t){var n=new e;return t&&(i.isDefined(t.enabled)&&(n.enabled=t.enabled),i.isDefined(t.allowDependencyDelete)&&(n.allowDependencyDelete=t.allowDependencyDelete),i.isDefined(t.allowDependencyInsert)&&(n.allowDependencyInsert=t.allowDependencyInsert),i.isDefined(t.allowTaskDelete)&&(n.allowTaskDelete=t.allowTaskDelete),i.isDefined(t.allowTaskInsert)&&(n.allowTaskInsert=t.allowTaskInsert),i.isDefined(t.allowTaskUpdate)&&(n.allowTaskUpdate=t.allowTaskUpdate),i.isDefined(t.allowResourceDelete)&&(n.allowResourceDelete=t.allowResourceDelete),i.isDefined(t.allowResourceInsert)&&(n.allowResourceInsert=t.allowResourceInsert),i.isDefined(t.allowResourceUpdate)&&(n.allowResourceUpdate=t.allowResourceUpdate),i.isDefined(t.allowTaskResourceUpdate)&&(n.allowTaskResourceUpdate=t.allowTaskResourceUpdate)),n},e.prototype.equal=function(e){var t=!0;return t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t&&this.enabled===e.enabled)&&this.allowDependencyDelete===e.allowDependencyDelete)&&this.allowDependencyInsert===e.allowDependencyInsert)&&this.allowTaskDelete===e.allowTaskDelete)&&this.allowTaskInsert===e.allowTaskInsert)&&this.allowTaskUpdate===e.allowTaskUpdate)&&this.allowResourceDelete===e.allowResourceDelete)&&this.allowResourceInsert===e.allowResourceInsert)&&this.allowResourceUpdate===e.allowResourceUpdate)&&this.allowTaskResourceUpdate===e.allowTaskResourceUpdate},e}();t.EditingSettings=s;var a=function(){function e(){this.showCurrentTime=!1,this.currentTimeUpdateInterval=6e4,this.stripLines=[]}return e.parse=function(t){var n=new e;if(t&&(i.isDefined(t.showCurrentTime)&&(n.showCurrentTime=t.showCurrentTime),i.isDefined(t.currentTimeUpdateInterval)&&(n.currentTimeUpdateInterval=t.currentTimeUpdateInterval),i.isDefined(t.currentTimeTitle)&&(n.currentTimeTitle=t.currentTimeTitle),i.isDefined(t.currentTimeCssClass)&&(n.currentTimeCssClass=t.currentTimeCssClass),i.isDefined(t.stripLines)))for(var r=0;r<t.stripLines.length;r++)n.stripLines.push(l.parse(t.stripLines[r]));return n},e.prototype.equal=function(e){var t=!0;if(t=(t=(t=(t=(t=t&&this.showCurrentTime==e.showCurrentTime)&&this.currentTimeUpdateInterval==e.currentTimeUpdateInterval)&&this.currentTimeTitle==e.currentTimeTitle)&&this.currentTimeCssClass==e.currentTimeCssClass)&&this.stripLines.length===e.stripLines.length)for(var n=0;n<e.stripLines.length;n++)t=t&&this.stripLines[n].equal(e.stripLines[n]);return t},e}();t.StripLineSettings=a;var l=function(){function e(e,t,n,r,i){this.isCurrent=!1,this.start=e,this.end=t,this.title=n,this.cssClass=r,this.isCurrent=i}return e.parse=function(t){var n=new e;return t&&(i.isDefined(t.start)&&(n.start=t.start),i.isDefined(t.end)&&(n.end=t.end),i.isDefined(t.title)&&(n.title=t.title),i.isDefined(t.cssClass)&&(n.cssClass=t.cssClass)),n},e.prototype.clone=function(){return new e(this.start,this.end,this.title,this.cssClass,this.isCurrent)},e.prototype.equal=function(e){var t=!0;return t=(t=(t=(t=t&&this.start==e.start)&&this.end==e.end)&&this.title==e.title)&&this.cssClass==e.cssClass},e}();t.StripLine=l;var c=function(){function e(){this.validateDependencies=!1,this.autoUpdateParentTasks=!1}return e.parse=function(t){var n=new e;return t&&(i.isDefined(t.validateDependencies)&&(n.validateDependencies=t.validateDependencies),i.isDefined(t.autoUpdateParentTasks)&&(n.autoUpdateParentTasks=t.autoUpdateParentTasks)),n},e.prototype.equal=function(e){var t=!0;return t=(t=t&&this.validateDependencies==e.validateDependencies)&&this.autoUpdateParentTasks==e.autoUpdateParentTasks},e}();t.ValidationSettings=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskEditController=void 0;var r=n(14),i=n(9),o=n(3),s=n(5),a=function(){function e(e){this.taskIndex=-1,this.successorIndex=-1,this.editing=!1,this.gantt=e,this.createElements()}return Object.defineProperty(e.prototype,"taskId",{get:function(){return this.gantt.viewModel.items[this.taskIndex].task.internalId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"successorId",{get:function(){return this.gantt.viewModel.items[this.successorIndex].task.internalId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"task",{get:function(){return this.gantt.viewModel.items[this.taskIndex].task},enumerable:!1,configurable:!0}),e.prototype.show=function(t){this.editing||(this.taskIndex=t,this.updateWrapInfo(),this.wrapInfo.assignPosition(this.baseElement),this.wrapInfo.assignSize(this.baseElement),this.gantt.taskArea.appendChild(this.baseElement),this.baseElement.className=e.CLASSNAMES.TASK_EDIT_BOX,this.gantt.settings.editing.enabled&&this.gantt.settings.editing.allowDependencyInsert||(this.baseElement.className=this.baseElement.className+" hide-dependency"),this.task.isMilestone()?this.baseElement.className=this.baseElement.className+" milestone":(this.gantt.settings.editing.enabled&&this.gantt.settings.editing.allowTaskUpdate&&this.canUpdateTask()||(this.baseElement.className=this.baseElement.className+" hide-updating"),this.progressEdit.style.left=this.task.progress/100*this.wrapInfo.size.width-this.progressEdit.offsetWidth/2+"px"),this.taskDateRange=new i.DateRange(this.task.start,this.task.end))},e.prototype.hide=function(){var e=this.baseElement.parentNode;e&&e.removeChild(this.baseElement),this.tooltip.hide()},e.prototype.showTaskInfo=function(e,t){void 0===t&&(t=500),this.tooltip.showInfo(this.task,e,t,this.gantt.settings.taskTooltipContentTemplate)},e.prototype.updateWrapInfo=function(){this.wrapInfo=this.getTaskWrapperElementInfo(this.taskIndex),this.wrapInfo.position.x--},e.prototype.showDependencySuccessor=function(e){if(this.successorIndex!=e&&this.taskIndex!=e){this.successorIndex=e;var t=this.getTaskWrapperElementInfo(e);t.assignPosition(this.dependencySuccessorBaseElement),t.assignSize(this.dependencySuccessorBaseElement),t.assignSize(this.dependencySuccessorFrame),this.gantt.taskArea.appendChild(this.dependencySuccessorBaseElement)}},e.prototype.hideDependencySuccessor=function(){var e=this.dependencySuccessorBaseElement.parentNode;e&&e.removeChild(this.dependencySuccessorBaseElement),this.successorIndex=-1},e.prototype.processProgress=function(e){this.editing=!0;var t=e.x-this.wrapInfo.position.x,n=0;e.x>this.wrapInfo.position.x&&(n=e.x<this.wrapInfo.position.x+this.wrapInfo.size.width?Math.round(t/this.baseElement.clientWidth*100):100),this.progressEdit.style.left=n/100*this.wrapInfo.size.width-this.progressEdit.offsetWidth/2+"px",this.tooltip.showProgress(n,o.DomUtils.getAbsolutePositionX(this.progressEdit)+this.progressEdit.offsetWidth/2)},e.prototype.confirmProgress=function(){this.editing=!1;var e=Math.round((this.progressEdit.offsetLeft+this.progressEdit.offsetWidth/2)/this.wrapInfo.size.width*100);this.gantt.commandManager.changeTaskProgressCommand.execute(this.taskId,e)},e.prototype.processEnd=function(e){this.baseElement.className=this.baseElement.className+" move",this.editing=!0;var t=e.x>this.wrapInfo.position.x?e.x:this.wrapInfo.position.x,n=t-this.wrapInfo.position.x;this.baseElement.style.width=(n<1?0:n)+"px";var r=this.task.start,i=this.gantt.gridLayoutCalculator.getDateByPos(t);i.setSeconds(0),i<r||n<1?this.taskDateRange.end.setTime(r.getTime()):this.taskDateRange.end=this.getNewDate(this.task.end,i),this.tooltip.showTime(r,this.taskDateRange.end,o.DomUtils.getAbsolutePositionX(this.baseElement)+this.baseElement.clientWidth)},e.prototype.confirmEnd=function(){this.baseElement.className=e.CLASSNAMES.TASK_EDIT_BOX,this.editing=!1,this.gantt.commandManager.changeTaskEndCommand.execute(this.taskId,this.taskDateRange.end),this.hide(),this.updateWrapInfo()},e.prototype.processStart=function(e){this.baseElement.className=this.baseElement.className+" move",this.editing=!0;var t=e.x<this.wrapInfo.position.x+this.wrapInfo.size.width?e.x:this.wrapInfo.position.x+this.wrapInfo.size.width,n=this.wrapInfo.size.width-(t-this.wrapInfo.position.x);this.baseElement.style.left=t+"px",this.baseElement.style.width=(n<1?0:n)+"px";var r=this.task.end,i=this.gantt.gridLayoutCalculator.getDateByPos(t);i.setSeconds(0),i>r||n<1?this.taskDateRange.start.setTime(r.getTime()):this.taskDateRange.start=this.getNewDate(this.task.start,i),this.tooltip.showTime(this.taskDateRange.start,r,o.DomUtils.getAbsolutePositionX(this.baseElement))},e.prototype.confirmStart=function(){this.baseElement.className=e.CLASSNAMES.TASK_EDIT_BOX,this.editing=!1,this.gantt.commandManager.changeTaskStartCommand.execute(this.taskId,this.taskDateRange.start),this.hide(),this.updateWrapInfo()},e.prototype.processMove=function(e){if(this.gantt.settings.editing.enabled&&this.gantt.settings.editing.allowTaskUpdate){this.baseElement.className=this.baseElement.className+" move";var t=this.baseElement.offsetLeft+e;this.baseElement.style.left=t+"px";var n=this.gantt.gridLayoutCalculator.getDateByPos(t);this.taskDateRange.start=this.getNewDate(this.task.start,n);var r=this.task.start.getTime()-this.taskDateRange.start.getTime(),i=new Date(this.task.end.getTime()-r);return this.taskDateRange.end=this.getNewDate(this.task.end,i),this.editing=this.gantt.modelManipulator.dispatcher.raiseTaskMoving(this.task,this.taskDateRange.start,this.taskDateRange.end,this.onTaskMovingCallback.bind(this)),this.editing&&this.tooltip.showTime(this.taskDateRange.start,this.taskDateRange.end,o.DomUtils.getAbsolutePositionX(this.baseElement)),this.editing}return!0},e.prototype.onTaskMovingCallback=function(e,t){if(this.taskDateRange.start!==e||this.taskDateRange.end!==t){var n=this.gantt.gridLayoutCalculator,r=n.getPosByDate(e),i=n.getPosByDate(t)-r;this.baseElement.style.left=r+"px",this.baseElement.style.width=(i<1?0:i)+"px",this.taskDateRange.start=e,this.taskDateRange.end=t}},e.prototype.confirmMove=function(){this.gantt.settings.editing.enabled&&this.gantt.settings.editing.allowTaskUpdate&&(this.gantt.settings.editing.allowDependencyInsert||(this.baseElement.className=this.baseElement.className+" hide-dependency"),this.editing&&(this.baseElement.className=e.CLASSNAMES.TASK_EDIT_BOX,this.gantt.commandManager.taskMoveCommand.execute(this.taskId,this.taskDateRange.start,this.taskDateRange.end),this.updateWrapInfo(),this.hide(),this.editing=!1))},e.prototype.getNewDate=function(e,t){if(this.gantt.settings.viewType>r.ViewType.SixHours){var n=t.getFullYear(),i=t.getMonth(),o=t.getDate(),s=this.gantt.settings.viewType==r.ViewType.Days?t.getHours():e.getHours(),a=e.getMinutes(),l=e.getSeconds(),c=e.getMilliseconds();return new Date(n,i,o,s,a,l,c)}return t},e.prototype.startDependency=function(t){this.dependencyLine=document.createElement("DIV"),this.dependencyLine.className=e.CLASSNAMES.TASK_EDIT_DEPENDENCY_LINE,this.gantt.taskArea.appendChild(this.dependencyLine),this.startPosition=t},e.prototype.processDependency=function(e){this.editing=!0,this.drawline(this.startPosition,e)},e.prototype.endDependency=function(e){this.editing=!1,null!=e&&this.gantt.commandManager.createDependencyCommand.execute(this.task.internalId,this.successorId,e);var t=this.dependencyLine.parentNode;t&&t.removeChild(this.dependencyLine),this.dependencyLine=null,this.hideDependencySuccessor(),this.hide()},e.prototype.selectDependency=function(e){this.gantt.settings.editing.allowDependencyDelete&&(this.dependencyId=e)},e.prototype.isDependencySelected=function(e){return this.dependencyId&&this.dependencyId==e},e.prototype.deleteSelectedDependency=function(){this.dependencyId&&this.gantt.commandManager.removeDependencyCommand.execute(this.dependencyId)},e.prototype.getTaskWrapperElementInfo=function(e){var t=this.gantt.gridLayoutCalculator,n=t.getTaskWrapperElementInfo(e);return n.size.width=t.getTaskWidth(e),n.size.height=t.getTaskHeight(e),n},e.prototype.createElements=function(){this.baseElement=document.createElement("DIV"),this.baseFrame=document.createElement("DIV"),this.baseFrame.className=e.CLASSNAMES.TASK_EDIT_FRAME,this.baseElement.appendChild(this.baseFrame),this.progressEdit=document.createElement("DIV"),this.progressEdit.className=e.CLASSNAMES.TASK_EDIT_PROGRESS,this.baseFrame.appendChild(this.progressEdit),this.progressEdit.appendChild(document.createElement("DIV")),this.dependencyFinish=document.createElement("DIV"),this.dependencyFinish.classList.add(e.CLASSNAMES.TASK_EDIT_DEPENDENCY_RIGTH),s.Browser.TouchUI&&this.dependencyFinish.classList.add(e.CLASSNAMES.TASK_EDIT_TOUCH),this.baseFrame.appendChild(this.dependencyFinish),this.dependencyStart=document.createElement("DIV"),this.dependencyStart.classList.add(e.CLASSNAMES.TASK_EDIT_DEPENDENCY_LEFT),s.Browser.TouchUI&&this.dependencyStart.classList.add(e.CLASSNAMES.TASK_EDIT_TOUCH),this.baseFrame.appendChild(this.dependencyStart),this.startEdit=document.createElement("DIV"),this.startEdit.className=e.CLASSNAMES.TASK_EDIT_START,this.baseFrame.appendChild(this.startEdit),this.endEdit=document.createElement("DIV"),this.endEdit.className=e.CLASSNAMES.TASK_EDIT_END,this.baseFrame.appendChild(this.endEdit),this.dependencySuccessorBaseElement=document.createElement("DIV"),this.dependencySuccessorBaseElement.className=e.CLASSNAMES.TASK_EDIT_BOX_SUCCESSOR,this.dependencySuccessorFrame=document.createElement("DIV"),this.dependencySuccessorFrame.className=e.CLASSNAMES.TASK_EDIT_FRAME_SUCCESSOR,this.dependencySuccessorBaseElement.appendChild(this.dependencySuccessorFrame),this.dependencySuccessorStart=document.createElement("DIV"),this.dependencySuccessorStart.classList.add(e.CLASSNAMES.TASK_EDIT_SUCCESSOR_DEPENDENCY_RIGTH),s.Browser.TouchUI&&this.dependencySuccessorStart.classList.add(e.CLASSNAMES.TASK_EDIT_TOUCH),this.dependencySuccessorFrame.appendChild(this.dependencySuccessorStart),this.dependencySuccessorFinish=document.createElement("DIV"),this.dependencySuccessorFinish.classList.add(e.CLASSNAMES.TASK_EDIT_SUCCESSOR_DEPENDENCY_LEFT),s.Browser.TouchUI&&this.dependencySuccessorFinish.classList.add(e.CLASSNAMES.TASK_EDIT_TOUCH),this.dependencySuccessorFrame.appendChild(this.dependencySuccessorFinish),this.tooltip=new l(this.baseElement,this.gantt,this.gantt.elementTextHelper.cultureInfo),this.attachEvents()},e.prototype.attachEvents=function(){this.onMouseLeaveHandler=function(){this.editing||this.hide()}.bind(this),this.baseElement.addEventListener("mouseleave",this.onMouseLeaveHandler)},e.prototype.drawline=function(e,t){if(e.x>t.x){var n=t;t=e,e=n}var r=Math.atan((e.y-t.y)/(t.x-e.x));r=-(r=180*r/Math.PI);var i=Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y));this.dependencyLine.style.left=e.x+"px",this.dependencyLine.style.top=e.y+"px",this.dependencyLine.style.width=i+"px",this.dependencyLine.style.transform="rotate("+r+"deg)"},e.prototype.canUpdateTask=function(){return!this.gantt.viewModel.isTaskToCalculateByChildren(this.task.internalId)},e.prototype.detachEvents=function(){this.baseElement.removeEventListener("mouseleave",this.onMouseLeaveHandler)},e.CLASSNAMES={TASK_EDIT_BOX:"dx-gantt-task-edit-wrapper",TASK_EDIT_FRAME:"dx-gantt-task-edit-frame",TASK_EDIT_PROGRESS:"dx-gantt-task-edit-progress",TASK_EDIT_DEPENDENCY_RIGTH:"dx-gantt-task-edit-dependency-r",TASK_EDIT_DEPENDENCY_LEFT:"dx-gantt-task-edit-dependency-l",TASK_EDIT_START:"dx-gantt-task-edit-start",TASK_EDIT_END:"dx-gantt-task-edit-end",TASK_EDIT_DEPENDENCY_LINE:"dx-gantt-task-edit-dependency-line",TASK_EDIT_BOX_SUCCESSOR:"dx-gantt-task-edit-wrapper-successor",TASK_EDIT_FRAME_SUCCESSOR:"dx-gantt-task-edit-frame-successor",TASK_EDIT_SUCCESSOR_DEPENDENCY_RIGTH:"dx-gantt-task-edit-successor-dependency-r",TASK_EDIT_SUCCESSOR_DEPENDENCY_LEFT:"dx-gantt-task-edit-successor-dependency-l",TASK_EDIT_TOUCH:"dx-gantt-edit-touch"},e}();t.TaskEditController=a;var l=function(){function e(t,n,r){this.parentElement=t,this.baseElement=document.createElement("DIV"),this.baseElement.className=e.CLASSNAMES.TASK_EDIT_PROGRESS_STATUS,t.appendChild(this.baseElement),this.owner=n,this.cultureInfo=r}return e.prototype.setDefaultTooltip=function(t){this.defaultTooltip=document.createElement("DIV"),this.defaultTooltip.className=e.CLASSNAMES.TASK_EDIT_TOOLTIP_DEFAULT;var n=document.createElement("DIV");n.className=e.CLASSNAMES.TASK_EDIT_TASK_TITLE;var r=document.createElement("SPAN");if(n.appendChild(r),this.defaultTooltip.appendChild(n),r.innerText=t.title,this.defaultTooltip.appendChild(this.getTimeContent(t.start,t.end)),!isNaN(t.progress)){var i=document.createElement("DIV");i.className=e.CLASSNAMES.TASK_EDIT_PROGRESS_STATUS_TIME;var o=document.createElement("SPAN"),s=document.createElement("SPAN");i.appendChild(o),i.appendChild(s),this.defaultTooltip.appendChild(i),o.innerText=(this.cultureInfo.progress?this.cultureInfo.progress:"Progress")+": ",s.innerText=t.progress+"%"}this.baseElement.appendChild(this.defaultTooltip)},e.prototype.showInfo=function(e,t,n,r){var i=this;void 0===n&&(n=0);var o=!0;if(this.owner.destroyTemplate(this.baseElement),r?o=r(this.baseElement,e):this.setDefaultTooltip(e),o=o&&!!this.baseElement.innerHTML){var s=function(){i.show(t,!1)};n?this.timerId=setTimeout(s,n):s()}},e.prototype.showProgress=function(t,n){this.owner.destroyTemplate(this.baseElement),this.defaultTooltip=document.createElement("DIV"),this.defaultTooltip.className=e.CLASSNAMES.TASK_EDIT_TOOLTIP_DEFAULT,this.defaultTooltip.innerText=t+"%",this.baseElement.appendChild(this.defaultTooltip),this.show(n)},e.prototype.showTime=function(t,n,r){this.owner.destroyTemplate(this.baseElement),this.defaultTooltip=document.createElement("DIV"),this.defaultTooltip.className=e.CLASSNAMES.TASK_EDIT_TOOLTIP_DEFAULT,this.defaultTooltip.appendChild(this.getTimeContent(t,n)),this.baseElement.appendChild(this.defaultTooltip),this.show(r)},e.prototype.show=function(t,n){var r,i,s,a,l=this;void 0===n&&(n=!0);null===(r=this.defaultTooltip)||void 0===r||r.classList.remove(e.CLASSNAMES.TASK_EDIT_TOOLTIP_ARROW_AFTER),null===(i=this.defaultTooltip)||void 0===i||i.classList.remove(e.CLASSNAMES.TASK_EDIT_TOOLTIP_ARROW_BEFORE),this.baseElement.style.display="block";var c=o.DomUtils.getAbsolutePositionY(this.parentElement),u=t-o.DomUtils.getAbsolutePositionX(this.parentElement)-10,d=c-this.owner.header.clientHeight-o.DomUtils.getDocumentScrollTop()-15,h=this.baseElement.clientHeight>d||this.baseElement.clientHeight>this.parentElement.offsetTop,p=-this.baseElement.clientHeight-5;h?(p=this.parentElement.clientHeight+5,null===(s=this.defaultTooltip)||void 0===s||s.classList.add(e.CLASSNAMES.TASK_EDIT_TOOLTIP_ARROW_AFTER)):null===(a=this.defaultTooltip)||void 0===a||a.classList.add(e.CLASSNAMES.TASK_EDIT_TOOLTIP_ARROW_BEFORE),this.baseElement.style.left=u+"px",this.baseElement.style.top=p+"px",n&&(this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout((function(){l.baseElement.style.display="none"}),1500))},e.prototype.hide=function(){this.baseElement.style.display="none",clearTimeout(this.timerId)},e.prototype.getTimeContent=function(t,n){var r=document.createElement("TABLE");r.className=e.CLASSNAMES.TASK_EDIT_PROGRESS_STATUS_TIME;var i=document.createElement("TBODY");r.appendChild(i);var o=document.createElement("TR"),s=document.createElement("TD"),a=document.createElement("TD"),l=document.createElement("TR"),c=document.createElement("TD"),u=document.createElement("TD");return o.appendChild(s),o.appendChild(a),l.appendChild(c),l.appendChild(u),i.appendChild(o),i.appendChild(l),s.innerText=(this.cultureInfo.start?this.cultureInfo.start:"Start")+": ",a.innerText=this.formatDate(t),c.innerText=(this.cultureInfo.end?this.cultureInfo.end:"End")+": ",u.innerText=this.formatDate(n),r},e.prototype.formatDate=function(e){return this.owner.getDateFormat(e)},e.CLASSNAMES={TASK_EDIT_PROGRESS_STATUS:"dx-gantt-task-edit-tooltip",TASK_EDIT_TOOLTIP_DEFAULT:"dx-gantt-task-edit-tooltip-default",TASK_EDIT_TASK_TITLE:"dx-gantt-task-title",TASK_EDIT_PROGRESS_STATUS_TIME:"dx-gantt-status-time",TASK_EDIT_TOOLTIP_ARROW_BEFORE:"dx-gantt-task-edit-tooltip-before",TASK_EDIT_TOOLTIP_ARROW_AFTER:"dx-gantt-task-edit-tooltip-after"},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryItemState=void 0;var r=function(e,t){this.id=e,this.value=t};t.HistoryItemState=r},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.HandlerBase=void 0;var i=n(8),o=n(45),s=function(){function e(e){this.control=e,this.switchToDefaultState()}return e.prototype.switchState=function(e){this.state&&this.state.finish(),this.state=e,this.state.start()},e.prototype.switchToDefaultState=function(){throw new Error("Not implemented")},e.prototype.getEventSource=function(t){var n=(t.nodeType===Node.ELEMENT_NODE?t:t.parentNode).classList[0];return e.classToSource[n]||i.MouseEventSource.TaskArea},e.classToSource=((r={})[o.TaskEditController.CLASSNAMES.TASK_EDIT_PROGRESS]=i.MouseEventSource.TaskEdit_Progress,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_START]=i.MouseEventSource.TaskEdit_Start,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_END]=i.MouseEventSource.TaskEdit_End,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_FRAME]=i.MouseEventSource.TaskEdit_Frame,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_DEPENDENCY_RIGTH]=i.MouseEventSource.TaskEdit_DependencyStart,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_DEPENDENCY_LEFT]=i.MouseEventSource.TaskEdit_DependencyFinish,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_SUCCESSOR_DEPENDENCY_RIGTH]=i.MouseEventSource.Successor_DependencyStart,r[o.TaskEditController.CLASSNAMES.TASK_EDIT_SUCCESSOR_DEPENDENCY_LEFT]=i.MouseEventSource.Successor_DependencyFinish,r),e}();t.HandlerBase=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandlerDependencyState=t.dependencyMap=void 0;var r=n(0),i=n(4),o=n(3),s=n(6),a=n(29),l=n(8),c=n(11);t.dependencyMap=[],t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyStart]=[],t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyFinish]=[],t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyStart][l.MouseEventSource.Successor_DependencyStart]=c.DependencyType.SS,t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyStart][l.MouseEventSource.Successor_DependencyFinish]=c.DependencyType.SF,t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyFinish][l.MouseEventSource.Successor_DependencyStart]=c.DependencyType.FS,t.dependencyMap[l.MouseEventSource.TaskEdit_DependencyFinish][l.MouseEventSource.Successor_DependencyFinish]=c.DependencyType.FF;var u=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(n,e),n.prototype.onMouseDown=function(e){var t=s.EvtUtils.getEventSource(e);this.source=this.handler.getEventSource(t);var n=this.getRelativePos(new i.Point(o.DomUtils.getAbsolutePositionX(t)+t.clientWidth/2,o.DomUtils.getAbsolutePositionY(t)+t.clientHeight/2));this.handler.control.taskEditController.startDependency(n)},n.prototype.onMouseUp=function(e){if(e instanceof PointerEvent){var n=this.getRelativePos(new i.Point(o.DomUtils.getAbsolutePositionX(this.handler.control.taskEditController.dependencySuccessorStart)+this.handler.control.taskEditController.dependencySuccessorStart.clientWidth/2,o.DomUtils.getAbsolutePositionY(this.handler.control.taskEditController.dependencySuccessorStart)+this.handler.control.taskEditController.dependencySuccessorStart.clientHeight/2)),r=this.getRelativePos(new i.Point(o.DomUtils.getAbsolutePositionX(this.handler.control.taskEditController.dependencySuccessorFinish)+this.handler.control.taskEditController.dependencySuccessorFinish.clientWidth/2,o.DomUtils.getAbsolutePositionY(this.handler.control.taskEditController.dependencySuccessorFinish)+this.handler.control.taskEditController.dependencySuccessorFinish.clientHeight/2)),a=this.getRelativePos(new i.Point(s.EvtUtils.getEventX(e),s.EvtUtils.getEventY(e))),c=(u=this.isTouchNearby(a,n)?l.MouseEventSource.Successor_DependencyStart:this.isTouchNearby(a,r)?l.MouseEventSource.Successor_DependencyFinish:null)===l.MouseEventSource.Successor_DependencyStart||u==l.MouseEventSource.Successor_DependencyFinish?t.dependencyMap[this.source][u]:null;this.handler.control.taskEditController.endDependency(c)}else{var u;c=(u=this.handler.getEventSource(s.EvtUtils.getEventSource(e)))===l.MouseEventSource.Successor_DependencyStart||u==l.MouseEventSource.Successor_DependencyFinish?t.dependencyMap[this.source][u]:null;this.handler.control.taskEditController.endDependency(c)}this.handler.switchToDefaultState()},n.prototype.onMouseMove=function(e){e.preventDefault();var t=this.getRelativePos(new i.Point(s.EvtUtils.getEventX(e),s.EvtUtils.getEventY(e))),n=Math.floor(t.y/this.handler.control.tickSize.height);this.handler.control.taskEditController.processDependency(t),this.handler.control.viewModel.tasks.items[n]&&this.handler.control.taskEditController.showDependencySuccessor(n)},n.prototype.isTouchNearby=function(e,t){return Math.abs(t.x-e.x)<=10&&Math.abs(t.y-e.y)<=10},n}(a.MouseHandlerStateBase);t.MouseHandlerDependencyState=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerStateBase=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){},t.prototype.onDoubleTap=function(e){},t.prototype.onTouchEnd=function(e){},t.prototype.onTouchMove=function(e){},t}(n(19).HandlerStateBase);t.TouchHandlerStateBase=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskEditDialogShowingArguments=t.TaskUpdatingArguments=t.TaskRemovingArguments=t.TaskInsertingArguments=void 0;var r=n(0),i=n(20),o=function(e){function t(t,n){var r=e.call(this,t)||this;return r.values=null!=n?n:{},r}return r.__extends(t,e),Object.defineProperty(t.prototype,"start",{get:function(){return this.values.start},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.values.end},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.values.title},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.values.progress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentId",{get:function(){return this.values.parentId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.values.color},enumerable:!1,configurable:!0}),t}(i.BaseArguments);t.TaskInsertingArguments=o;var s=function(e){function t(t){var n=e.call(this,t.id)||this;return n.values=t,n}return r.__extends(t,e),t}(i.BaseArguments);t.TaskRemovingArguments=s;var a=function(e){function t(t,n,r){var i=e.call(this,t.id)||this;return i.values=t,i.createNewValues(n,r),i}return r.__extends(t,e),t.prototype.createNewValues=function(e,t){var n=this;this.newValues={};for(var r=function(r){var o=e[r];i.newValues[o]=t[r],Object.defineProperty(i,o,{get:function(){return n.newValues[o]}})},i=this,o=0;o<e.length;o++)r(o)},t}(i.BaseArguments);t.TaskUpdatingArguments=a;var l=function(e){function t(t){var n=e.call(this,t.id)||this;return n.values={start:t.start,end:t.end,title:t.title,progress:t.progress},n.hiddenFields=t.hiddenFields,n.readOnlyFields=t.readOnlyFields,n}return r.__extends(t,e),t}(i.BaseArguments);t.TaskEditDialogShowingArguments=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoveTaskHistoryItem=t.CreateTaskHistoryItem=void 0;var r=n(0),i=n(12),o=n(21),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.data=n,r}return r.__extends(t,e),t.prototype.redo=function(){this.taskId=this.modelManipulator.task.create(this.data,this.taskId?this.taskId:null).internalId},t.prototype.undo=function(){this.modelManipulator.task.remove(this.taskId)},t}(i.HistoryItem);t.CreateTaskHistoryItem=s;var a=function(e){function t(t){var n=e.call(this)||this;return n.taskIds=[],n.tasks=[],n.modelManipulator=t,n}return r.__extends(t,e),t.prototype.redo=function(){var t=this;e.prototype.redo.call(this),this.taskIds.forEach((function(e){t.tasks.push(t.modelManipulator.task.remove(e))}))},t.prototype.undo=function(){var t=this;if(this.tasks.length){var n=this.tasks.shift();this.modelManipulator.task.create(n,n.internalId,(function(){t.modelManipulator.task.properties.progress.setValue(n.internalId,n.progress),n.color&&t.modelManipulator.task.properties.color.setValue(n.internalId,n.color),t.tasks.length?t.undo():e.prototype.undo.call(t)}))}},t.prototype.undoItemsQuery=function(){for(;this.tasks.length;){var t=this.tasks.shift();this.modelManipulator.task.create(t,t.internalId,(function(){})),this.modelManipulator.task.properties.progress.setValue(t.internalId,t.progress),t.color&&this.modelManipulator.task.properties.color.setValue(t.internalId,t.color)}e.prototype.undo.call(this)},t.prototype.addTask=function(e){this.taskIds.push(e)},t.prototype.add=function(t){if(t instanceof o.RemoveDependencyHistoryItem){var n=t;this.historyItems.filter((function(e){return e instanceof o.RemoveDependencyHistoryItem&&e.dependencyId==n.dependencyId})).length||this.historyItems.push(n)}else e.prototype.add.call(this,t)},t}(i.CompositionHistoryItem);t.RemoveTaskHistoryItem=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConstraintViolationDialogParameters=t.ConstraintViolationDialogCommand=t.ConstraintViolationOption=void 0;var r,i=n(0),o=n(24),s=n(21);!function(e){e[e.DoNothing=0]="DoNothing",e[e.RemoveDependency=1]="RemoveDependency",e[e.KeepDependency=2]="KeepDependency"}(r=t.ConstraintViolationOption||(t.ConstraintViolationOption={}));var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.applyParameters=function(e,t){return e.option!==r.DoNothing&&(e.option===r.RemoveDependency&&(this.history.beginTransaction(),this.history.addAndRedo(new s.RemoveDependencyHistoryItem(this.modelManipulator,t.validationError.dependencyId)),t.callback(),this.history.endTransaction(),this.control.barManager.updateItemsState([])),e.option===r.KeepDependency&&(t.callback(),this.control.barManager.updateItemsState([])),!0)},t.prototype.createParameters=function(e){var t=this.control.viewModel.dependencies.getItemById(e.validationError.dependencyId),n=this.control.viewModel.tasks.getItemById(t.successorId),r=this.control.viewModel.tasks.getItemById(t.predecessorId);return e.successorTaskTitle=n.title,e.predecessorTaskTitle=r.title,e},t.prototype.getDialogName=function(){return"ConstraintViolation"},t}(o.DialogBase);t.ConstraintViolationDialogCommand=a;var l=function(e){function t(t,n){var r=e.call(this)||this;return r.validationError=t,r.callback=n,r}return i.__extends(t,e),t.prototype.clone=function(){var e=new t(this.validationError,this.callback);return e.option=this.option,e},t}(o.DialogParametersBase);t.ConstraintViolationDialogParameters=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttView=t.default=void 0,n(54);var r=n(55);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.GanttView}}),Object.defineProperty(t,"GanttView",{enumerable:!0,get:function(){return r.GanttView}})},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttView=void 0;var r=n(56),i=n(14),o=n(42),s=n(3),a=n(9),l=n(28),c=n(4),u=n(43),d=n(17),h=n(80),p=n(45),f=n(8),m=n(81),g=n(86),y=n(88),v=n(103),T=n(44),k=n(104),w=n(106),I=n(122),S=n(5),M=n(123),E=n(2),D=n(124),b=n(51),C=n(1),_=n(22),x=function(){function e(e,t,n){var r=this;this.timeScaleAreas=new Array,this.horTaskAreaBorders=[],this.vertTaskAreaBorders=[],this.scaleBorders=[],this.scaleElements=[],this.taskElements=[],this.resourcesElements=[],this.selectionElements=[],this.hlRowElements=[],this.renderedRowIndices=[],this.renderedColIndices=[],this.renderedScaleItemIndices=[],this.dependencyMap=[],this.invalidTaskDependencies=[],this.renderedConnectorLines=[],this.connectorLinesToElementsMap={},this.noWorkingIntervalsToElementsMap={},this.renderedNoWorkingIntervals=[],this.renderedStripLines=[],this.stripLinesMap=[],this.gridLayoutCalculator=new d.GridLayoutCalculator,this.etalonSizeValues=new h.EtalonSizeValues,this.tickSize=new l.Size(0,0),this.scaleCount=2,this.isFocus=!1,this.currentZoom=1,this.maxZoom=3,this.stripLinesUpdaterId=null,this.currentSelectedTaskID="",this.ganttOwner=t,this.settings=T.Settings.parse(n),this.elementTextHelper=new o.ElementTextHelper(n.cultureInfo),this.validationController=new M.ValidationController(this),this.createMainElement(e),this.createHeader(),this.calculateEtalonSizeValues(),this.createTaskAreaContainer(),this.loadOptionsFromGanttOwner(),this.elementTextHelper.setFont(this.mainElement),this.setupHelpers(),this.setSizeForTaskArea(),this.createTimeScaleContainer(),this.createTimeScaleAreas(),this.commandManager=new w.CommandManager(this),this.barManager=new I.BarManager(this,t.bars),this.eventManager=new y.EventManager(this),this.taskEditController=new p.TaskEditController(this),this.history=new g.History,this.taskAreaManager=new f.TaskAreaManager(this),this.fullScreenModeHelper=new D.FullScreenModeHelper(this),this.onWindowResizelHandler=this.onBrowserWindowResize.bind(this),window.addEventListener("resize",this.onWindowResizelHandler),this.updateView(),setTimeout((function(){r.scrollLeftByViewType()}),0),this.initializeStripLinesUpdater()}return e.prototype.reset=function(){this.timeScaleContainer.innerHTML="",this.taskArea.innerHTML="",this.horTaskAreaBorders=[],this.vertTaskAreaBorders=[],this.scaleBorders=[],this.scaleElements=[],this.taskElements=[],this.selectionElements=[],this.hlRowElements=[],this.renderedRowIndices=[],this.renderedColIndices=[],this.renderedConnectorLines=[],this.timeScaleAreas=[],this.renderedScaleItemIndices=[],this.connectorLinesToElementsMap={},this.renderedNoWorkingIntervals=[],this.renderedStripLines=[],this.noWorkingIntervalsToElementsMap={},this.invalidTaskDependencies=[]},e.prototype.setupHelpers=function(){var e=new l.Size(this.taskAreaContainer.getWidth(),this.taskAreaContainer.getHeight()),t=this.taskAreaContainer.getHeight()-this.taskAreaContainer.getElement().clientHeight;this.gridLayoutCalculator.setSettings(e,this.tickSize,this.etalonSizeValues,this.range,this.viewModel,this.settings.viewType,t),this.elementTextHelper.setSettings(this.range.start.getTime(),this.settings.viewType,this.viewModel.items)},e.prototype.getDateRange=function(e,t){var n=new Date(e.getTime()-this.getVisibleAreaTime());n=o.DateUtils.adjustStartDateByViewType(n,this.settings.viewType,this.settings.firstDayOfWeek);var r=new Date(t.getTime()+this.getVisibleAreaTime());return r=o.DateUtils.adjustEndDateByViewType(r,this.settings.viewType,this.settings.firstDayOfWeek),new a.DateRange(n,r)},e.prototype.getVisibleAreaTime=function(){return Math.ceil(this.taskAreaContainer.getWidth()/this.tickSize.width)*o.DateUtils.getTickTimeSpan(this.settings.viewType)},e.prototype.calculateEtalonSizeValues=function(){var e=this.createEtalonElementsContainer(),t=this.createEtalonElements(e);this.calculateEtalonSizeValuesCore(t),this.mainElement.removeChild(e)},e.prototype.calculateEtalonSizeValuesCore=function(e){this.etalonSizeValues.taskHeight=e[0].firstChild.offsetHeight,this.etalonSizeValues.milestoneWidth=e[1].firstChild.offsetWidth,this.etalonSizeValues.taskWrapperTopPadding=s.DomUtils.pxToInt(s.DomUtils.getCurrentStyle(e[0]).paddingTop),this.etalonSizeValues.connectorLineThickness=s.DomUtils.getVerticalBordersWidth(e[2]),this.etalonSizeValues.connectorArrowWidth=s.DomUtils.getHorizontalBordersWidth(e[3]);for(var t=0;t<=i.ViewType.Years;t++)e[4].innerText=this.elementTextHelper.getScaleItemTextTemplate(t),this.etalonSizeValues.scaleItemWidths[t]=e[4].offsetWidth;this.etalonSizeValues.smallTaskWidth=this.getSmallTaskWidth(s.DomUtils.getCurrentStyle(e[0].firstChild.firstChild).paddingLeft),this.etalonSizeValues.outsideTaskTextDefaultWidth=s.DomUtils.pxToFloat(s.DomUtils.getCurrentStyle(e[5]).width),this.etalonSizeValues.scaleItemHeight=this.ganttOwner.getHeaderHeight()/this.scaleCount,this.etalonSizeValues.parentTaskHeight=e[e.length-1].firstChild.offsetHeight},e.prototype.getSmallTaskWidth=function(e){var t=0;if(null!=e&&""!=e){var n=e.indexOf("rem");if(n>-1)try{t=parseFloat(e.substr(0,n))*parseFloat(getComputedStyle(document.documentElement).fontSize)}catch(e){}else t=s.DomUtils.pxToInt(e)}return 2*t},e.prototype.createEtalonElementsContainer=function(){var e=document.createElement("DIV");return e.style.visibility="hidden",e.style.position="absolute",e.style.left="-1000px",this.mainElement.appendChild(e),e},e.prototype.createEtalonElements=function(e){var t=[],n=this.createElement(new u.GridElementInfo("dx-gantt-taskWrapper"),null,e),r=this.createElement(new u.GridElementInfo("dx-gantt-task"),null,n);this.createElement(new u.GridElementInfo("dx-gantt-taskTitle dx-gantt-titleIn"),null,r).innerText="WWW",t.push(n);var i=this.createElement(new u.GridElementInfo("dx-gantt-taskWrapper"),null,e);this.createElement(new u.GridElementInfo("dx-gantt-task dx-gantt-milestone"),null,i),t.push(i);for(var o=["dx-gantt-conn-h","dx-gantt-arrow","dx-gantt-si","dx-gantt-taskTitle dx-gantt-titleOut"],s=0;s<o.length;s++){var a=new u.GridElementInfo(o[s]);t.push(this.createElement(a,null,e))}var l=this.createElement(new u.GridElementInfo("dx-gantt-taskWrapper"),null,e),c=this.createElement(new u.GridElementInfo("dx-gantt-task dx-gantt-parent"),null,l);return this.createElement(new u.GridElementInfo("dx-gantt-taskTitle dx-gantt-titleIn"),null,c).innerText="WWW",t.push(l),t},e.prototype.zoomIn=function(e){void 0===e&&(e=this.taskAreaContainer.getWidth()/2);var t=this.gridLayoutCalculator.getDateByPos(this.taskAreaContainer.scrollLeft+e);this.currentZoom<this.maxZoom?(this.currentZoom++,this.updateTickSizeWidth(),this.resetAndUpdate()):this.settings.viewType>i.ViewType.TenMinutes&&(this.currentZoom=1,this.setViewType(this.settings.viewType-1,!1)),this.scrollToDate(t,e)},e.prototype.zoomOut=function(e){void 0===e&&(e=this.taskAreaContainer.getWidth()/2);var t=this.gridLayoutCalculator.getDateByPos(this.taskAreaContainer.scrollLeft+e);this.currentZoom>1?(this.currentZoom--,this.updateTickSizeWidth(),this.resetAndUpdate()):this.settings.viewType<i.ViewType.Years&&(this.currentZoom=this.maxZoom,this.setViewType(this.settings.viewType+1,!1)),this.scrollToDate(t,e)},e.prototype.scrollToDate=function(e,t){this.taskAreaContainer.scrollLeft=Math.round(this.gridLayoutCalculator.getPosByDate(e))-t},e.prototype.scrollLeftByViewType=function(){var e=o.DateUtils.roundStartDate(this.dataRange.start,this.settings.viewType);this.taskAreaContainer.scrollLeft=Math.round(this.gridLayoutCalculator.getPosByDate(e))+1},e.prototype.onVisualModelChanged=function(){this.resetAndUpdate()},e.prototype.initializeStripLinesUpdater=function(){var e=this;this.settings.stripLines.showCurrentTime&&(this.stripLinesUpdaterId=setInterval((function(){e.recreateStripLines&&e.recreateStripLines()}),Math.max(this.settings.stripLines.currentTimeUpdateInterval,100)))},e.prototype.clearStripLinesUpdater=function(){this.stripLinesUpdaterId&&clearInterval(this.stripLinesUpdaterId),this.stripLinesUpdaterId=null},e.prototype.getGanttViewStartDate=function(e){if(!e)return new Date;var t=e.map((function(e){return"string"==typeof e.start?new Date(e.start):e.start})).filter((function(e){return C.isDefined(e)}));return t.length>0?t.reduce((function(e,t){return t<e?t:e}),t[0]):new Date},e.prototype.getGanttViewEndDate=function(e){if(!e)return new Date;var t=e.map((function(e){return"string"==typeof e.end?new Date(e.end):e.end})).filter((function(e){return C.isDefined(e)}));return t.length>0?t.reduce((function(e,t){return t>e?t:e}),t[0]):new Date},e.prototype.getTaskAreaWidth=function(){return this.gridLayoutCalculator.horizontalTickCount*this.tickSize.width},e.prototype.getTaskAreaHeight=function(){return this.gridLayoutCalculator.getVerticalGridLineHeight()},e.prototype.getVisibleTaskCount=function(){return this.viewModel.itemCount},e.prototype.getTask=function(e){return this.viewModel.items[e].task},e.prototype.createMainElement=function(e){this.mainElement=document.createElement("DIV"),this.mainElement.style.width=e.offsetWidth+"px",this.mainElement.style.height=e.offsetHeight+"px",e.appendChild(this.mainElement)},e.prototype.createHeader=function(){this.header=document.createElement("DIV"),this.header.className="dx-gantt-header",this.mainElement.appendChild(this.header)},e.prototype.createTimeScaleContainer=function(){this.timeScaleContainer=document.createElement("DIV"),this.timeScaleContainer.className="dx-gantt-tsac",this.timeScaleContainer.style.height=this.etalonSizeValues.scaleItemHeight*this.scaleCount+"px",this.header.appendChild(this.timeScaleContainer)},e.prototype.createTimeScaleArea=function(){var e=document.createElement("DIV");return e.className="dx-gantt-tsa",e.style.width=this.getTaskAreaWidth()+"px",e.style.height=this.etalonSizeValues.scaleItemHeight+"px",this.timeScaleContainer.appendChild(e),this.timeScaleAreas.unshift(e),e},e.prototype.createTimeScaleAreas=function(){for(var e=0;e<this.scaleCount;e++){var t=this.createTimeScaleArea();0==e&&this.settings.viewType==i.ViewType.Weeks&&this.createMonthsScale(t)}},e.prototype.createTaskAreaContainer=function(){var e=document.createElement("DIV");e.className="dx-gantt-tac",this.mainElement.appendChild(e),this.createTaskArea(e),this.taskAreaContainer=this.ganttOwner.getExternalTaskAreaContainer(e),null==this.taskAreaContainer&&(this.taskAreaContainer=new v.TaskAreaContainer(e,this)),this.prepareTaskAreaContainer()},e.prototype.prepareTaskAreaContainer=function(){var e=this.taskAreaContainer.getElement();this.settings.areHorizontalBordersEnabled?s.DomUtils.addClassName(e,"dx-gantt-tac-hb"):s.DomUtils.removeClassName(e,"dx-gantt-tac-hb");var t=parseInt(getComputedStyle(e).getPropertyValue("margin-top"))||0;e.style.height="calc(100% - "+(this.etalonSizeValues.scaleItemHeight*this.scaleCount+t)+"px)"},e.prototype.createTaskArea=function(e){this.taskArea=document.createElement("DIV"),this.taskArea.id="dx-gantt-ta",e.appendChild(this.taskArea)},e.prototype.setSizeForTaskArea=function(){this.taskArea.style.width=this.getTaskAreaWidth()+"px",this.taskArea.style.height=this.getTaskAreaHeight()+"px"},e.prototype.updateTickSizeWidth=function(){this.tickSize.width=this.etalonSizeValues.scaleItemWidths[this.settings.viewType]*this.currentZoom},e.prototype.createMonthsScale=function(e){var t=new Date;t.setTime(this.range.start.getTime());for(var n=0,r=0;t.getTime()<this.range.end.getTime();){var s=o.DateUtils.getDaysInMonth(t.getMonth(),t.getFullYear())-t.getDate()+1,a=new Date;a.setTime(t.getTime()+Math.min(s*o.DateUtils.msPerDay,this.range.end.getTime()-t.getTime()));var d=this.gridLayoutCalculator.getWidthByDateRange(t,a),h=new u.GridElementInfo("dx-gantt-si",new c.Point(n,void 0),new l.Size(d,this.etalonSizeValues.scaleItemHeight)),p=this.createElement(h,null,e);p.innerText=this.elementTextHelper.getScaleItemText(r,i.ViewType.Months),p.style.lineHeight=this.etalonSizeValues.scaleItemHeight+"px";var f=new u.GridElementInfo("dx-gantt-vb",new c.Point(n+d,void 0),new l.Size(0,this.etalonSizeValues.scaleItemHeight));this.createElement(f,null,e),n+=d,r++,t=a}},e.prototype.updateView=function(){this.onBeginUpdateView(),this.timeScaleContainer.scrollLeft=this.taskAreaContainerScrollLeft,this.processScroll(!1),this.processScroll(!0),this.ganttOwner.onGanttScroll(this.taskAreaContainerScrollTop),this.onEndUpdateView()},e.prototype.onBeginUpdateView=function(){this[e.taskAreaScrollTopKey]=this.taskAreaContainer.scrollTop,this[e.taskAreaScrollLeftKey]=this.taskAreaContainer.scrollLeft},e.prototype.onEndUpdateView=function(){delete this[e.taskAreaScrollTopKey],delete this[e.taskAreaScrollLeftKey],delete this[e.taskTextHeightKey]},e.prototype.getTaskTextHeight=function(e){e.innerText="WWW";var t=getComputedStyle(e).height;return e.innerText="",t},Object.defineProperty(e.prototype,"taskAreaContainerScrollTop",{get:function(){var t;return null!==(t=this[e.taskAreaScrollTopKey])&&void 0!==t?t:this.taskAreaContainer.scrollTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"taskAreaContainerScrollLeft",{get:function(){var t;return null!==(t=this[e.taskAreaScrollLeftKey])&&void 0!==t?t:this.taskAreaContainer.scrollLeft},enumerable:!1,configurable:!0}),e.prototype.processScroll=function(e){this.taskEditController.tooltip.hide(),this.recreateTaskAreaBordersAndTaskElements(e),e?this.recreateConnectorLineElements():(this.recreateNoWorkingIntervalElements(),this.recreateStripLines(),this.recreateScalesElements())},e.prototype.recreateTaskAreaBordersAndTaskElements=function(e){var t=this,n=e?this.taskAreaContainerScrollTop:this.taskAreaContainerScrollLeft,r=this.gridLayoutCalculator.getRenderedRowColumnIndices(n,e),i=e?this.renderedRowIndices:this.renderedColIndices;this.recreateElements(i,r,(function(n){t.removeTaskAreaBorderAndTaskElement(n,e)}),(function(n){t.createTaskAreaBorderAndTaskElement(n,e)})),e?this.renderedRowIndices=r:this.renderedColIndices=r},e.prototype.recreateNoWorkingIntervalElements=function(){var e=this,t=this.gridLayoutCalculator.getRenderedNoWorkingIntervals(this.taskAreaContainerScrollLeft);this.recreateElements(this.renderedNoWorkingIntervals,t,(function(t){e.removeNoWorkingIntervalElement(t)}),(function(t){e.createNoWorkingIntervalElement(t)})),this.renderedNoWorkingIntervals=t},e.prototype.recreateStripLines=function(){var e=this,t=this.gridLayoutCalculator.getRenderedStripLines(this.settings.stripLines);this.recreateElements(this.renderedStripLines,t,(function(t){e.removeElement(t,null,e.taskArea,e.stripLinesMap)}),(function(t){return e.createElement(t,null,e.taskArea,e.stripLinesMap)})),this.renderedStripLines=t},e.prototype.recreateConnectorLineElements=function(){var e=this,t=this.gridLayoutCalculator.getRenderedConnectorLines(this.taskAreaContainerScrollTop);this.recreateElements(this.renderedConnectorLines,t,(function(t){e.removeConnectorLineElement(t)}),(function(t){e.createConnectorLineElement(t)})),this.renderedConnectorLines=t},e.prototype.recreateScalesElements=function(){this.recreateScaleElements(this.settings.viewType,0),this.settings.viewType!=i.ViewType.Weeks&&this.recreateScaleElements(o.DateUtils.ViewTypeToScaleMap[this.settings.viewType],1)},e.prototype.recreateScaleElements=function(e,t){var n=this,r=this.gridLayoutCalculator.getRenderedScaleItemIndices(e,this.renderedColIndices),i=this.renderedScaleItemIndices[e-this.settings.viewType]||[];this.recreateElements(i,r,(function(e){n.removeScaleElementAndBorder(e,t)}),(function(r){n.createScaleElementAndBorder(r,t,e)})),this.renderedScaleItemIndices[e-this.settings.viewType]=r},e.prototype.recreateElements=function(e,t,n,r){e.filter((function(e){return-1===t.indexOf(e)})).forEach((function(e){n(e)})),t.filter((function(t){return-1===e.indexOf(t)})).forEach((function(e){r(e)}))},e.prototype.recreateTaskElement=function(e){var t=this,n=this.renderedRowIndices.filter((function(t){return t===e})).length>0,r=this.viewModel.items[e],i=r&&r.task;if(i){n&&(this.removeTaskElement(e),this.createTaskElement(e));var o=this.viewModel.dependencies.items.filter((function(e){return e.predecessorId==i.id||e.successorId==i.id}));o.length&&o.forEach((function(e){return t.recreateConnectorLineElement(e.internalId)}))}},e.prototype.recreateConnectorLineElement=function(e,t){var n=this;void 0===t&&(t=!1);var r=[];this.renderedConnectorLines=this.renderedConnectorLines.filter((function(t){return t.attr["dependency-id"]!=e||(r.push(t),!1)}));var i=r.length>0;r.forEach((function(e){n.removeConnectorLineElement(e)})),r=this.gridLayoutCalculator.updateTileToConnectorLinesMap(e),(i||t)&&r.forEach((function(e){n.createConnectorLineElement(e),n.renderedConnectorLines.push(e)}))},e.prototype.allowTaskAreaBorders=function(e){return e?this.settings.areHorizontalBordersEnabled:this.settings.areVerticalBordersEnabled},e.prototype.createTaskAreaBorderAndTaskElement=function(e,t){this.allowTaskAreaBorders(t)&&this.createTaskAreaBorder(e,!t),t&&this.createTaskElement(e)},e.prototype.removeTaskAreaBorderAndTaskElement=function(e,t){this.allowTaskAreaBorders(t)&&this.removeTaskAreaBorder(e,!t),t&&this.removeTaskElement(e)},e.prototype.getTaskAreaBordersDictionary=function(e){return e?this.vertTaskAreaBorders:this.horTaskAreaBorders},e.prototype.createTaskAreaBorder=function(e,t){var n=this.gridLayoutCalculator.getTaskAreaBorderInfo(e,t);this.createElement(n,e,this.taskArea,this.getTaskAreaBordersDictionary(t))},e.prototype.removeTaskAreaBorder=function(e,t){this.removeElement(null,e,this.taskArea,this.getTaskAreaBordersDictionary(t))},e.prototype.createScaleElementAndBorder=function(e,t,n){this.createScaleElement(e,t,n),this.createScaleBorder(e,t,n)},e.prototype.createScaleElement=function(e,t,n){var r=this.gridLayoutCalculator.getScaleElementInfo(e,n),o=this.createScaleElementCore(e,r,t,this.scaleElements);o.innerText=this.elementTextHelper.getScaleItemText(e,n),o.style.lineHeight=this.etalonSizeValues.scaleItemHeight+"px",n===i.ViewType.Quarter&&(o.style.padding="0")},e.prototype.createScaleBorder=function(e,t,n){var r=this.gridLayoutCalculator.getScaleBorderInfo(e,n);this.createScaleElementCore(e,r,t,this.scaleBorders)},e.prototype.createScaleElementCore=function(e,t,n,r){return r[n]||(r[n]=[]),this.createElement(t,e,this.timeScaleAreas[n],r[n])},e.prototype.removeScaleElementAndBorder=function(e,t){this.removeElement(null,e,this.timeScaleAreas[t],this.scaleElements[t]),this.removeElement(null,e,this.timeScaleAreas[t],this.scaleBorders[t])},e.prototype.createTaskElement=function(e){var t=this.viewModel.items[e].task;if(this.isHighlightRowElementAllowed(e)&&this.createHighlightRowElement(e),t.isValid()){this.createTaskWrapperElement(e),this.settings.taskTitlePosition==i.TaskTitlePosition.Outside&&this.createTaskTextElement(e,this.taskElements[e]);var n=this.createTaskVisualElement(e);t.isMilestone()||(this.settings.taskTitlePosition==i.TaskTitlePosition.Inside&&this.createTaskTextElement(e,n),this.createTaskProgressElement(e,n)),this.settings.showResources&&(this.createResourcesWrapperElement(e),this.createResources(e)),this.viewModel.items[e].selected&&this.createTaskSelectionElement(e)}else{var r=this.viewModel.dependencies.items.filter((function(e){return e.predecessorId==t.id||e.successorId==t.id}));this.invalidTaskDependencies=this.invalidTaskDependencies.concat(r)}},e.prototype.isHighlightRowElementAllowed=function(e){return e%2!=0&&this.settings.areAlternateRowsEnabled||this.viewModel.items[e].children.length>0},e.prototype.createResourcesWrapperElement=function(e){var t=this.gridLayoutCalculator.getTaskResourcesWrapperElementInfo(e);this.createElement(t,e,this.taskArea,this.resourcesElements),this.resourcesElements[e].style.display=this.elementTextHelper.getTaskVisibility(e)?"":"none"},e.prototype.createResources=function(e){for(var t=this.viewModel.items[e].resources.items,n=0;n<t.length;n++)this.createResourceElement(e,t[n])},e.prototype.createTaskWrapperElement=function(e){var t=this.gridLayoutCalculator.getTaskWrapperElementInfo(e);this.createElement(t,e,this.taskArea,this.taskElements),this.taskElements[e].style.display=this.elementTextHelper.getTaskVisibility(e)?"":"none"},e.prototype.createTaskVisualElement=function(e){var t=this.gridLayoutCalculator.getTaskElementInfo(e,this.settings.taskTitlePosition!==i.TaskTitlePosition.Inside),n=this.createElement(t,e,this.taskElements[e]);return this.taskAreaManager.attachEventsOnTask(n),n},e.prototype.createTaskProgressElement=function(e,t){var n=this.gridLayoutCalculator.getTaskProgressElementInfo(e);this.createElement(n,e,t)},e.prototype.createTaskTextElement=function(t,n){var r,o,s=this.gridLayoutCalculator.getTaskTextElementInfo(t,this.settings.taskTitlePosition==i.TaskTitlePosition.Inside),a=this.createElement(s,t,n),l=this.elementTextHelper.getTaskText(t);l||(null!==(r=this[o=e.taskTextHeightKey])&&void 0!==r||(this[o]=this.getTaskTextHeight(a)),a.style.height=this[e.taskTextHeightKey]),a.innerText=l},e.prototype.createResourceElement=function(e,t){var n=this.gridLayoutCalculator.getTaskResourceElementInfo();t.color&&(n.style.backgroundColor=t.color),this.createElement(n,e,this.resourcesElements[e]).innerText=t.text},e.prototype.createTaskSelectionElement=function(e){var t=this.gridLayoutCalculator.getSelectionElementInfo(e);this.taskAreaContainer.isExternal&&!this.settings.areHorizontalBordersEnabled&&t.size.height++,this.createElement(t,e,this.taskArea,this.selectionElements)},e.prototype.createHighlightRowElement=function(e){var t=this.gridLayoutCalculator.getHighlightRowInfo(e);this.createElement(t,e,this.taskArea,this.hlRowElements)},e.prototype.removeTaskElement=function(e){var t=this.viewModel.items[e].task;this.invalidTaskDependencies=this.invalidTaskDependencies.filter((function(e){return e.predecessorId!=t.id&&e.successorId!=t.id})),this.taskAreaManager.detachEventsOnTask(this.taskElements[e]),this.removeElement(null,e,this.taskArea,this.taskElements),this.removeElement(null,e,this.taskArea,this.resourcesElements),this.removeElement(null,e,this.taskArea,this.selectionElements),this.isHighlightRowElementAllowed(e)&&this.removeElement(null,e,this.taskArea,this.hlRowElements)},e.prototype.createConnectorLineElement=function(e){var t=e.attr["dependency-id"];if(!this.invalidTaskDependencies.some((function(e){return e.id==t})))return this.taskEditController.isDependencySelected(t)&&(e.className=e.className+" active"),this.createElement(e,null,this.taskArea,this.connectorLinesToElementsMap)},e.prototype.removeConnectorLineElement=function(e){this.removeElement(e,null,this.taskArea,this.connectorLinesToElementsMap)},e.prototype.createNoWorkingIntervalElement=function(e){return this.createElement(e,null,this.taskArea,this.noWorkingIntervalsToElementsMap)},e.prototype.removeNoWorkingIntervalElement=function(e){this.removeElement(e,null,this.taskArea,this.noWorkingIntervalsToElementsMap)},e.prototype.createElement=function(e,t,n,r){var i=document.createElement("DIV");for(var o in e.assignToElement(i),n.appendChild(i),r&&(r instanceof Array&&null!==t?r[t]=i:r[e.id]=i),e.attr)Object.prototype.hasOwnProperty.call(e.attr,o)&&i.setAttribute(o,e.attr[o]);for(var o in e.style)Object.prototype.hasOwnProperty.call(e.style,o)&&(i.style[o]=e.style[o]);return i},e.prototype.removeElement=function(e,t,n,r){var i;r instanceof Array&&null!==t?(i=r[t],delete r[t]):(i=r[e.id],delete r[e.id]),i&&i.parentNode==n&&n.removeChild(i)},e.prototype.calculateAutoViewType=function(e,t){var n=(t.getTime()-e.getTime())/36e5;return n>8760?i.ViewType.Years:n>720?i.ViewType.Months:n>168?i.ViewType.Weeks:n>24?i.ViewType.Days:n>6?i.ViewType.SixHours:n>1?i.ViewType.Hours:i.ViewType.TenMinutes},e.prototype.changeTaskExpanded=function(e,t){var n=this.getTaskByPublicId(e);n&&this.viewModel.changeTaskExpanded(n.internalId,t)},e.prototype.expandTask=function(e){this.viewModel.changeTaskExpanded(e,!0)},e.prototype.collapseTask=function(e){this.viewModel.changeTaskExpanded(e,!1)},e.prototype.showTask=function(e){this.viewModel.changeTaskVisibility(e,!0)},e.prototype.hideTask=function(e){this.viewModel.changeTaskVisibility(e,!1)},e.prototype.getTaskVisibility=function(e){return this.viewModel.getTaskVisibility(e)},e.prototype.unselectCurrentSelectedTask=function(){this.unselectTask(this.currentSelectedTaskID)},e.prototype.getTaskSelected=function(e){return this.viewModel.getTaskSelected(e)},e.prototype.setViewType=function(e,t){void 0===t&&(t=!0),null==e&&(e=this.calculateAutoViewType(this.dataRange.start,this.dataRange.end)),this.settings.viewType!==e&&(this.settings.viewType=e,this.updateTickSizeWidth(),this.resetAndUpdate(),t&&this.scrollLeftByViewType(),this.ganttOwner.UpdateGanttViewType&&this.ganttOwner.UpdateGanttViewType(e))},e.prototype.setTaskTitlePosition=function(e){this.settings.taskTitlePosition!==e&&(this.settings.taskTitlePosition=e,this.resetAndUpdate())},e.prototype.setShowResources=function(e){this.settings.showResources!==e&&(this.settings.showResources=e,this.resetAndUpdate())},e.prototype.setFirstDayOfWeek=function(e){this.settings.firstDayOfWeek!==e&&(this.settings.firstDayOfWeek=e,this.resetAndUpdate())},e.prototype.loadOptionsFromGanttOwner=function(){this.tickSize.height=this.ganttOwner.getRowHeight();var e=this.ganttOwner.getGanttTasksData();this.dataRange=new a.DateRange(this.getGanttViewStartDate(e),this.getGanttViewEndDate(e)),null==this.settings.viewType&&(this.settings.viewType=this.calculateAutoViewType(this.dataRange.start,this.dataRange.end)),this.updateTickSizeWidth(),this.range=this.getDateRange(this.dataRange.start,this.dataRange.end),this.dispatcher=new k.ModelChangesDispatcher;var t=this.ganttOwner.getModelChangesListener();t&&this.dispatcher.onModelChanged.add(t),this.viewModel=new r.ViewVisualModel(this,e,this.ganttOwner.getGanttDependenciesData(),this.ganttOwner.getGanttResourcesData(),this.ganttOwner.getGanttResourceAssignmentsData(),this.range,this.ganttOwner.getGanttWorkTimeRules()),this.modelManipulator=new m.ModelManipulator(this.viewModel,this.dispatcher)},e.prototype.resetAndUpdate=function(){this.reset(),this.range=this.getDateRange(this.dataRange.start,this.dataRange.end),this.viewModel.updateRange(this.range),this.setupHelpers(),this.createTimeScaleAreas(),this.setSizeForTaskArea(),S.Browser.IE&&this.taskEditController.createElements(),this.updateView()},e.prototype.cleanMarkup=function(){this.taskAreaManager.detachEvents(),this.taskEditController.detachEvents(),window.removeEventListener("resize",this.onWindowResizelHandler),this.reset()},e.prototype.updateRowHeights=function(e){if(this.tickSize.height!==e){this.tickSize.height=e;var t=this.taskAreaContainer.scrollLeft;this.resetAndUpdate(),this.taskAreaContainer.scrollLeft=t}},e.prototype.selectTask=function(e){this.selectDependency(null),this.viewModel.changeTaskSelected(e,!0),this.currentSelectedTaskID=e,this.updateBarManager()},e.prototype.unselectTask=function(e){this.viewModel.changeTaskSelected(e,!1),this.updateBarManager()},e.prototype.selectTaskById=function(e){this.unselectCurrentSelectedTask();var t=this.getTaskByPublicId(e);t&&this.selectTask(t.internalId)},e.prototype.selectDependency=function(e){this.taskEditController.selectDependency(e),this.gridLayoutCalculator.createTileToConnectorLinesMap(),this.recreateConnectorLineElements()},e.prototype.getTaskAreaContainer=function(){return this.taskAreaContainer},e.prototype.setWidth=function(e){this.mainElement.style.width=e+"px"},e.prototype.setHeight=function(e){this.mainElement.style.height=e+"px"},e.prototype.setAllowSelection=function(e){this.settings.allowSelectTask=e},e.prototype.setEditingSettings=function(e){this.settings.editing=e,this.updateBarManager()},e.prototype.setValidationSettings=function(e){this.settings.validation=e},e.prototype.setRowLinesVisible=function(e){this.settings.areHorizontalBordersEnabled=e,this.prepareTaskAreaContainer(),this.resetAndUpdate()},e.prototype.setStripLines=function(e){this.settings.stripLines=T.StripLineSettings.parse(e),this.clearStripLinesUpdater(),this.initializeStripLinesUpdater(),this.recreateStripLines()},e.prototype.deleteTask=function(e){var t=this.getTaskByPublicId(e.toString());t&&this.commandManager.removeTaskCommand.execute(t.internalId)},e.prototype.insertTask=function(e){if(e){var t=null!=e.parentId?String(e.parentId):null,n=this.getTaskByPublicId(t),r="string"==typeof e.start?new Date(e.start):e.start,i="string"==typeof e.end?new Date(e.end):e.end,o={parentId:null==n?void 0:n.internalId,title:e.title,start:r,end:i,progress:parseInt(e.progress)||0,color:e.color};if(this.commandManager.createTaskCommand.execute(o))return this.getLastInsertedTaskId()}return""},e.prototype.updateTask=function(e,t){var n=this.getTaskByPublicId(e.toString());n&&t&&this.commandManager.updateTaskCommand.execute(n.internalId,t)},e.prototype.getTaskData=function(e){var t=this.getTaskByPublicId(e.toString());if(t)return this.viewModel.getTaskObjectForDataSource(t)},e.prototype.insertDependency=function(e){if(e){var t=String(e.predecessorId),n=String(e.successorId),r=e.type;this.commandManager.createDependencyCommand.execute(t,n,r)}},e.prototype.deleteDependency=function(e){var t=this.viewModel.convertPublicToInternalKey("dependency",e);C.isDefined(t)&&this.commandManager.removeDependencyCommand.execute(t)},e.prototype.getDependencyData=function(e){return this.viewModel.getDependencyObjectForDataSource(e)},e.prototype.insertResource=function(e,t){var n=this;if(e){this.commandManager.createResourceCommand.execute(String(e.text),e.color&&String(e.color),(function(e){if(C.isDefined(t))for(var r=0;r<t.length;r++)n.assignResourceToTask(e,t[r])}))}},e.prototype.deleteResource=function(e){var t=this.viewModel.convertPublicToInternalKey("resource",e);C.isDefined(t)&&this.commandManager.removeResourceCommand.execute(t)},e.prototype.assignResourceToTask=function(e,t){var n=this.viewModel.convertPublicToInternalKey("resource",e),r=this.viewModel.convertPublicToInternalKey("task",t);C.isDefined(n)&&C.isDefined(r)&&this.commandManager.assignResourceCommand.execute(n,r)},e.prototype.unassignResourceFromTask=function(e,t){var n=this.viewModel.findAssignment(e,t);n&&this.commandManager.deassignResourceCommand.execute(n.internalId)},e.prototype.getResourceData=function(e){return this.viewModel.getResourceObjectForDataSource(e)},e.prototype.getResourceAssignmentData=function(e){return this.viewModel.getResourceAssignmentObjectForDataSource(e)},e.prototype.getTaskResources=function(e){var t=this.viewModel,n=t.getItemByPublicId("task",e);return n&&t.getAssignedResources(n).items},e.prototype.getVisibleTaskKeys=function(){return this.viewModel.getVisibleTasks().map((function(e){return e.id}))},e.prototype.getVisibleDependencyKeys=function(){return this.viewModel.getVisibleDependencies().map((function(e){return e.id}))},e.prototype.getVisibleResourceKeys=function(){return this.viewModel.getVisibleResources().map((function(e){return e.id}))},e.prototype.getVisibleResourceAssignmentKeys=function(){return this.viewModel.getVisibleResourceAssignments().map((function(e){return e.id}))},e.prototype.setTaskValue=function(e,t,n){var r=this.commandManager,i=this.getTaskByPublicId(e);if(i){if("title"===t){var o=n||"";return r.changeTaskTitleCommand.execute(i.internalId,o)}if("progress"===t){var s=Math.max(n,0);return s=Math.min(n,100),r.changeTaskProgressCommand.execute(i.internalId,s)}if("start"===t)return r.changeTaskStartCommand.execute(i.internalId,E.DateTimeUtils.getMinDate(n,i.end));if("end"===t)return r.changeTaskEndCommand.execute(i.internalId,E.DateTimeUtils.getMaxDate(n,i.start))}return!1},e.prototype.getLastInsertedTaskId=function(){var e=this.history.historyItems.filter((function(e){return e instanceof b.CreateTaskHistoryItem})),t=e[e.length-1];return t&&t.taskId},e.prototype.getLastInsertedResource=function(){var e=this.history.historyItems.filter((function(e){return e instanceof _.CreateResourceHistoryItem})),t=e[e.length-1];return t&&t.resource},e.prototype.getTaskByPublicId=function(e){return this.viewModel.tasks.getItemByPublicId(e)},e.prototype.getPrevTask=function(e){var t=this.viewModel.findItem(e),n=(t.parent||this.viewModel.root).children.indexOf(t)-1;return n>-1?t.parent.children[n].task:t.parent.task},e.prototype.updateCreatedTaskIdAfterServerUpdate=function(e,t){var n=this.viewModel.findItem(e),r=n&&n.task;r&&(r.id=t)},e.prototype.getTaskIdByInternalId=function(e){var t=this.viewModel.findItem(e),n=t&&t.task;return n?n.id:null},e.prototype.isTaskHasChildren=function(e){var t=this.viewModel.findItem(e);return t&&t.children.length>0},e.prototype.requireFirstLoadParentAutoCalc=function(){var e=this.ganttOwner;return e.getRequireFirstLoadParentAutoCalc&&e.getRequireFirstLoadParentAutoCalc()},e.prototype.updateOwnerInAutoParentMode=function(){this.viewModel.parentAutoCalc&&this.dispatcher.notifyParentDataRecalculated(this.viewModel.getCurrentTaskData())},e.prototype.getOwnerControlMainElement=function(){var e=this.ganttOwner;return e.getMainElement&&e.getMainElement()},e.prototype.adjustOwnerControl=function(){var e=this.ganttOwner;e.adjustControl&&e.adjustControl()},e.prototype.onBrowserWindowResize=function(){this.fullScreenModeHelper.isInFullScreenMode?this.fullScreenModeHelper.adjustControlInFullScreenMode():this.adjustOwnerControl()},e.prototype.applySettings=function(e,t){void 0===t&&(t=!1);var n=T.Settings.parse(e),r=t||this.settings.equal(n);this.settings=n,r||this.resetAndUpdate()},e.prototype.getDataUpdateErrorCallback=function(){var e=this,t=this.history,n=t.getCurrentProcessingItemInfo();return function(){e.dispatcher.lock(),t.rollBackAndRemove(n),e.dispatcher.unlock(),e.updateBarManager()}},e.prototype.setTaskTooltipContentTemplate=function(e){this.settings.taskTooltipContentTemplate=e},e.prototype.updateBarManager=function(){this.barManager.updateItemsState([])},e.prototype.onTaskClick=function(e,t){return!this.ganttOwner.onTaskClick||this.ganttOwner.onTaskClick(e,t)},e.prototype.onTaskDblClick=function(e,t){return!this.ganttOwner.onTaskDblClick||this.ganttOwner.onTaskDblClick(e,t)},e.prototype.getDateFormat=function(e){return this.ganttOwner.getFormattedDateText?this.ganttOwner.getFormattedDateText(e):this.getDefaultDateFormat(e)},e.prototype.getDefaultDateFormat=function(e){return("0"+e.getDate()).slice(-2)+"/"+("0"+(e.getMonth()+1)).slice(-2)+"/"+e.getFullYear()+" "+("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)},e.prototype.destroyTemplate=function(e){this.ganttOwner.destroyTemplate?this.ganttOwner.destroyTemplate(e):e.innerHTML=""},e.cachedPrefix="cached_",e.taskAreaScrollTopKey=e.cachedPrefix+"taskAreaScrollTop",e.taskAreaScrollLeftKey=e.cachedPrefix+"taskAreaScrollLeft",e.taskTextHeightKey=e.cachedPrefix+"taskTextHeight",e}();t.GanttView=x},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewVisualModel=void 0;var r=n(26),i=n(62),o=n(64),s=n(65),a=n(66),l=n(67),c=n(68),u=n(1),d=n(11),h=n(33),p=n(36),f=function(){function e(e,t,n,a,l,u,d){this._fLockCount=0,this.owner=e,this.tasks=new i.TaskCollection,this.tasks.importFromObject(t),this.dependencies=new o.DependencyCollection,this.dependencies.importFromObject(n),this.resources=new r.ResourceCollection,this.resources.importFromObject(a),this.assignments=new s.ResourceAssignmentCollection,this.assignments.importFromObject(l),this._itemList=new Array,this._viewItemList=new Array,this._workTimeCalculator=new c.WorkingTimeCalculator(u,d),this.updateModel()}return e.prototype.updateModel=function(){this._itemList.splice(0,this._itemList.length);for(var e=this.tasks.items,t=0;t<e.length;t++){var n=e[t];n&&this._itemList.push(new a.ViewVisualModelItem(n,this.getAssignedResources(n)))}this.createHierarchy(),this.populateItemsForView(),this.owner&&this.owner.currentSelectedTaskID&&this.changeTaskSelected(this.owner.currentSelectedTaskID,!0)},e.prototype.createHierarchy=function(){var e=this;this.root=new a.ViewVisualModelItem(null,null);for(var t=this._itemList,n=t.reduce((function(e,t){var n,r=null===(n=t.task)||void 0===n?void 0:n.internalId;return u.isDefined(r)&&(e[r]=t),e}),{}),r=this.requireFirstLoadParentAutoCalc,i=0;i<t.length;i++){var o=t[i],s=n[o.task.parentId]||this.root;o.parent=s,s.addChild(o),r&&this.owner.validationController.recalculateParents(o,(function(t){if(u.isDefined(t.id)){var n=e.tasks.getItemById(t.id);u.isDefined(t.start)&&(n.start=t.start),u.isDefined(t.end)&&(n.end=t.end),u.isDefined(t.progress)&&(n.progress=t.progress)}}))}r&&this.owner.dispatcher.notifyParentDataRecalculated(this.getCurrentTaskData())},e.prototype.getCurrentTaskData=function(){var e=this;return this.tasks.items.map((function(t){return e.getTaskObjectForDataSource(t)}))},e.prototype.getTaskObjectForDataSource=function(e){var t=e.parentId&&this.tasks.getItemById(e.parentId);return{id:e.id,start:e.start,end:e.end,duration:e.duration,description:e.description,parentId:t&&t.id,progress:e.progress,color:e.color,taskType:e.taskType,title:e.title,customFields:e.customFields,expanded:e.expanded}},e.prototype.getDependencyObjectForDataSource=function(e){var t=e instanceof d.Dependency?e:this.getItemByPublicId("dependency",e);if(t){var n=this.convertInternalToPublicKey("task",t.predecessorId),r=this.convertInternalToPublicKey("task",t.successorId);return{id:t.id,predecessorId:u.isDefined(n)?n:t.predecessorId,successorId:u.isDefined(r)?r:t.successorId,type:t.type}}return null},e.prototype.getResourceObjectForDataSource=function(e){var t=e instanceof h.Resource?e:this.getItemByPublicId("resource",e);return t?{id:t.id,text:t.text,color:t.color}:null},e.prototype.getResourceAssignmentObjectForDataSource=function(e){var t=e instanceof p.ResourceAssignment?e:this.getItemByPublicId("assignment",e);if(t){var n=this.convertInternalToPublicKey("task",t.taskId),r=this.convertInternalToPublicKey("resource",t.resourceId);return{id:t.id,taskId:u.isDefined(n)?n:t.taskId,resourceId:u.isDefined(r)?r:t.resourceId}}return null},e.prototype.populateItemsForView=function(){this._viewItemList.splice(0,this._viewItemList.length),this.populateVisibleItems(this.root),this.updateVisibleItemDependencies()},e.prototype.populateVisibleItems=function(e){var t=this,n=e===this.root;e&&(e.task||n)&&(n||(this._viewItemList.push(e),e.visibleIndex=this._viewItemList.length-1),(e.getExpanded()||e===this.root)&&e.children.forEach((function(e){return t.populateVisibleItems(e)})))},e.prototype.updateVisibleItemDependencies=function(){for(var e=this._viewItemList,t=0;t<e.length;t++){var n=e[t],r=this.getTasVisibleDependencies(n.task);n.setDependencies(r)}},e.prototype.getAssignedResources=function(e){var t=this,n=new r.ResourceCollection;return this.assignments.items.filter((function(t){return t.taskId==e.internalId})).forEach((function(e){n.add(t.resources.getItemById(e.resourceId))})),n},e.prototype.getTasVisibleDependencies=function(e){for(var t=new Array,n=e.internalId,r=this.dependencies.items.filter((function(e){return e.successorId==n})),i=0;i<r.length;i++){var o=r[i],s=this.findItem(o.predecessorId);s&&s.getVisible()&&t.push(new l.ViewVisualModelDependencyInfo(o.internalId,s,o.type))}return t},e.prototype.changeTaskExpanded=function(e,t){var n=this.tasks.getItemById(String(e));n&&(n.expanded=t,this.changed())},e.prototype.changeTaskVisibility=function(e,t){var n=this.findItem(e);n&&(n.visible=t,this.changed())},e.prototype.changeTaskSelected=function(e,t){var n=this._itemList.filter((function(t){return t.task&&t.task.internalId===e}))[0];if(n){n.selected=t;var r=this.findItem(e),i=r&&r.visibleIndex;i>-1&&this.owner.recreateTaskElement(i)}},e.prototype.beginUpdate=function(){this._fLockCount++},e.prototype.endUpdate=function(){this._fLockCount--,0==this._fLockCount&&this.changed()},e.prototype.changed=function(){0===this._fLockCount&&(this.populateItemsForView(),this.owner&&this.owner.onVisualModelChanged&&this.owner.onVisualModelChanged())},e.prototype.findItem=function(e){return this._viewItemList.filter((function(t){return t.task&&t.task.internalId===e}))[0]},Object.defineProperty(e.prototype,"items",{get:function(){return this._viewItemList},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"itemCount",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),e.prototype.getTaskVisibility=function(e){var t=this.findItem(e);return!!t&&t.getVisible()},e.prototype.getTaskSelected=function(e){var t=this.findItem(e);return!!t&&t.selected},Object.defineProperty(e.prototype,"noWorkingIntervals",{get:function(){return this._workTimeCalculator.noWorkingIntervals},enumerable:!1,configurable:!0}),e.prototype.updateRange=function(e){this._workTimeCalculator.updateRange(e)},e.prototype.taskHasChildrenByIndex=function(e){return this._viewItemList[e].children.length>0},e.prototype.taskHasChildren=function(e){var t=this.findItem(e);return t&&t.children.length>0},Object.defineProperty(e.prototype,"parentAutoCalc",{get:function(){var e=this.owner&&this.owner.settings;return e&&e.validation&&e.validation.autoUpdateParentTasks},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requireFirstLoadParentAutoCalc",{get:function(){return this.parentAutoCalc&&this.owner.requireFirstLoadParentAutoCalc()},enumerable:!1,configurable:!0}),e.prototype.isTaskToCalculateByChildren=function(e){return this.parentAutoCalc&&this.taskHasChildren(e)},e.prototype.hasTasks=function(){return this.tasks.length>0},e.prototype.getDataUpdateErrorCallback=function(){return this.owner.getDataUpdateErrorCallback&&this.owner.getDataUpdateErrorCallback()},e.prototype.convertPublicToInternalKey=function(e,t){var n=this.getItemByPublicId(e,t);return n&&n.internalId},e.prototype.convertInternalToPublicKey=function(e,t){var n=this.getItemByInternalId(e,t);return n&&n.id},e.prototype.getItemByPublicId=function(e,t){var n=t.toString();switch(e){case"task":return this.tasks.getItemByPublicId(n);case"dependency":return this.dependencies.getItemByPublicId(n);case"resource":return this.resources.getItemByPublicId(n);case"assignment":return this.assignments.getItemByPublicId(n)}return null},e.prototype.getItemByInternalId=function(e,t){switch(e){case"task":return this.tasks.getItemById(t);case"dependency":return this.dependencies.getItemById(t);case"resource":return this.resources.getItemById(t);case"assignment":return this.assignments.getItemById(t)}return null},e.prototype.findAssignment=function(e,t){var n=this.convertPublicToInternalKey("resource",e),r=this.convertPublicToInternalKey("task",t);return this.assignments.items.filter((function(e){return e.resourceId===n&&e.taskId===r}))[0]},e.prototype.getVisibleTasks=function(){var e=this;return this.tasks.items.filter((function(t){return t&&e.getTaskVisibility(t.internalId)&&t.isValid()}))},e.prototype.getVisibleDependencies=function(){var e=this.getVisibleTasks().map((function(e){return e.internalId}));return this.dependencies.items.filter((function(t){return t&&e.indexOf(t.successorId)>-1&&e.indexOf(t.predecessorId)>-1}))},e.prototype.getVisibleResourceAssignments=function(){var e=this.getVisibleTasks().map((function(e){return e.internalId}));return this.assignments.items.filter((function(t){return t&&e.indexOf(t.taskId)>-1}))},e.prototype.getVisibleResources=function(){for(var e=[],t=this.getVisibleResourceAssignments(),n=0;n<t.length;n++){var r=this.getItemByInternalId("resource",t[n].resourceId);r&&-1===e.indexOf(r)&&e.push(r)}return e},e}();t.ViewVisualModel=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttJsonUtils=void 0;var r=n(58),i=function(){function e(){}return e.parseJson=function(e){return r.JsonUtils.isValid(e)?JSON.parse(e):null},e}();t.GanttJsonUtils=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.isValid=function(e){return!/[^,:{}[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(e.replace(/"(\\.|[^"\\])*"/g,""))},e}();t.JsonUtils=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(60),i=n(61),o=function(){function e(){}return e.remove=function(e,t){var n=e.indexOf(t,0);n>=0&&e.splice(n,1)},e.removeBy=function(e,t){for(var n=e.length,r=0;r<n;r++)if(t(e[r],r))return e.splice(r,1)[0];return null},e.shallowCopy=function(e){return e.slice()},e.deepCopy=function(t){return e.map(t,(function(e){return e.clone()}))},e.initByValue=function(e,t){for(var n=[];e>0;e--)n.push(t);return n},e.initByCallback=function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},e.forEachOnInterval=function(e,t){for(var n=e.end,r=e.start;r<n;r++)t(r)},e.reverseForEachOnInterval=function(e,t){for(var n=e.start,r=e.end-1;r>=n;r--)t(r)},e.reducedMap=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=[],o=n;o<r;o++){var s=t(e[o],o);null!==s&&i.push(s)}return i},e.filter=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=[],o=n;o<r;o++){var s=e[o];t(s,o)&&i.push(s)}return i},e.map=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=[],o=n;o<r;o++)i.push(t(e[o],o));return i},e.indexBy=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++)if(t(e[i],i))return i;return-1},e.reverseIndexBy=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--)if(t(e[i],i))return i;return-1},e.elementBy=function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=t.length);var o=e.indexBy(t,n,r,i);return o<0?null:t[o]},e.reverseElementBy=function(t,n,r,i){void 0===r&&(r=t.length-1),void 0===i&&(i=0);var o=e.reverseIndexBy(t,n,r,i);return o<0?null:t[o]},e.last=function(e){return e[e.length-1]},e.setLast=function(e,t){return e[e.length-1]=t},e.incLast=function(e){return++e[e.length-1]},e.decLast=function(e){return--e[e.length-1]},e.equals=function(t,n){return t.length===n.length&&e.allOf2(t,n,(function(e,t){return e.equals(t)}))},e.equalsByReference=function(e,t){var n=e.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0},e.unique=function(t,n,r,i){void 0===r&&(r=n),void 0===i&&(i=function(){});var o=t.length;if(0===o)return[];var s=(t=t.sort(n))[0],a=e.reducedMap(t,(function(e){return 0!==r(s,e)?(s=e,e):(i(e),null)}),1,o);return a.unshift(t[0]),a},e.uniqueNumber=function(e){e=e.sort(i.Comparers.number);for(var t=Number.NaN,n=e.length-1;n>=0;n--)t===e[n]?e.splice(n,1):t=e[n];return e},e.forEach=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++)t(e[i],i)},e.forEach2=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=r;o<i;o++)n(e[o],t[o],o)},e.reverseForEach=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--)t(e[i],i)},e.reverseIndexOf=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--)if(e[i]===t)return i;return-1},e.accumulate=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=t,s=r;s<i;s++)o=n(o,e[s],s);return o},e.accumulateNumber=function(e,t,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=n,s=r;s<i;s++)o+=t(e[s],s,o);return o},e.anyOf=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++)if(t(e[i],i))return!0;return!1},e.unsafeAnyOf=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++){var o=t(e[i],i);if(o)return o}return null},e.reverseAnyOf=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--)if(t(e[i],i))return!0;return!1},e.unsafeReverseAnyOf=function(e,t,n,r){void 0===n&&(n=e.length-1),void 0===r&&(r=0);for(var i=n;i>=r;i--){var o=t(e[i],i);if(o)return o}return null},e.anyOf2=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=r;o<i;o++)if(n(e[o],t[o],o))return!0;return!1},e.allOf=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);for(var i=n;i<r;i++)if(!t(e[i],i))return!1;return!0},e.allOf2=function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=e.length);for(var o=r;o<i;o++)if(!n(e[o],t[o],o))return!1;return!0},e.allOfOnInterval=function(e,t){for(var n=e.end,r=e.start;r<n;r++)if(!t(r))return!1;return!0},e.addListOnTail=function(e,t){for(var n=0,r=void 0;r=t[n];n++)e.push(r);return e},e.joinLists=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e.accumulate(n,[],(function(n,r){return e.addListOnTail(n,t(r)),n}))},e.push=function(e,t){return e.push(t),e},e.countIf=function(t,n){return e.accumulateNumber(t,(function(e,t){return n(e,t)?1:0}))},e.clear=function(e){e.splice(0)},e.merge=function(e,t,n,r,i,o){if(void 0===i&&(i=0),void 0===o&&(o=e.length),e=e.slice(i,o),o-i<2)return e;for(var s=(e=e.sort(t))[i],a=[s],l=i+1;l<o;l++){var c=e[l];n(s,c)?r(s,c):(s=c,a.push(s))}return a},e.min=function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=t.length);var o=e.minExtended(t,n,r,i);return o?o.minElement:null},e.max=function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=t.length);var o=e.maxExtended(t,n,r,i);return o?o.maxElement:null},e.minMax=function(t,n,i,o){void 0===i&&(i=0),void 0===o&&(o=t.length);var s=e.minMaxExtended(t,n,i,o);return s?new r.MinMax(s.minElement,s.maxElement):null},e.minExtended=function(e,t,n,i){if(void 0===n&&(n=0),void 0===i&&(i=e.length),0===e.length)return null;for(var o=e[n],s=t(o),a=n+1;a<i;a++){var l=e[a],c=t(l);c<s&&(s=c,o=l)}return new r.ExtendedMin(o,s)},e.maxExtended=function(e,t,n,i){if(void 0===n&&(n=0),void 0===i&&(i=e.length),0===e.length)return null;for(var o=e[n],s=t(o),a=n+1;a<i;a++){var l=e[a],c=t(l);c>s&&(s=c,o=l)}return new r.ExtendedMax(o,s)},e.minMaxExtended=function(e,t,n,i){if(void 0===n&&(n=0),void 0===i&&(i=e.length),0===e.length)return null;for(var o=e[n],s=o,a=t(o),l=a,c=n+1;c<i;c++){var u=e[c],d=t(u);d<a?(a=d,o=u):d>l&&(l=d,s=u)}return new r.ExtendedMinMax(o,a,s,l)},e.minByCmp=function(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=e.length),0===e.length)return null;for(var i=e[n],o=n+1;o<r;o++){var s=e[o];t(s,i)<0&&(i=s)}return i},e.maxByCmp=function(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=e.length),0===e.length)return null;for(var i=e[n],o=n+1;o<r;o++){var s=e[o];t(s,i)>0&&(i=s)}return i},e.minMaxByCmp=function(e,t,n,i){if(void 0===n&&(n=0),void 0===i&&(i=e.length),0===e.length)return null;for(var o=e[n],s=o,a=n+1;a<i;a++){var l=e[a],c=t(l,o);c>0?s=l:c<0&&(o=l)}return new r.MinMax(o,s)},e}();t.ListUtils=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(35),i=function(e,t){this.minElement=e,this.maxElement=t};t.MinMax=i;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),Object.defineProperty(t.prototype,"length",{get:function(){return this.maxElement-this.minElement},enumerable:!0,configurable:!0}),t}(i);t.MinMaxNumber=o;var s=function(e,t){this.minElement=e,this.minValue=t};t.ExtendedMin=s;var a=function(e,t){this.maxElement=e,this.maxValue=t};t.ExtendedMax=a;var l=function(e){function t(t,n,r,i){var o=e.call(this,t,r)||this;return o.minValue=n,o.maxValue=i,o}return r.__extends(t,e),t}(i);t.ExtendedMinMax=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.number=function(e,t){return e-t},e.string=function(e,t){return e===t?0:e>t?1:-1},e.stringIgnoreCase=function(e,t){return(e=e.toLowerCase())===(t=t.toLowerCase())?0:e>t?1:-1},e}();t.Comparers=r;var i=function(){function e(){}return e.simpleType=function(e,t){return e===t},e.object=function(e,t){return e&&t&&(e===t||e.equals(t))},e}();t.Equals=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskCollection=void 0;var r=n(0),i=n(63),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.createItem=function(){return new i.Task},t}(n(13).CollectionBase);t.TaskCollection=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Task=t.TaskType=void 0;var r=n(0),i=n(1),o=n(10);!function(e){e[e.Regular=0]="Regular",e[e.Summary=1]="Summary",e[e.Milestone=2]="Milestone"}(t.TaskType||(t.TaskType={}));var s=function(e){function t(){var t=e.call(this)||this;return t.start=null,t.end=null,t.duration=null,t.description="",t.parentId="",t.title="",t.owner=null,t.progress=0,t.taskType=null,t.customFields={},t.expanded=!0,t.color="",t}return r.__extends(t,e),t.prototype.assignFromObject=function(t){i.isDefined(t)&&(e.prototype.assignFromObject.call(this,t),this.owner=t.owner,this.parentId=i.isDefined(t.parentId)?String(t.parentId):"",this.description=t.description,this.title=t.title,this.start="string"==typeof t.start?new Date(t.start):t.start||new Date(0),this.end="string"==typeof t.end?new Date(t.end):t.end||new Date(0),this.duration=t.duration,this.progress=t.progress,this.taskType=t.taskType,i.isDefined(t.expanded)&&(this.expanded=!!t.expanded),i.isDefined(t.color)&&(this.color=t.color),this.assignCustomFields(t.customFields))},t.prototype.assignCustomFields=function(e){if(e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.customFields[t]=e[t])},t.prototype.isMilestone=function(){return this.start.getTime()===this.end.getTime()},t.prototype.getDuration=function(){return this.end.getTime()-this.start.getTime()},t.prototype.isValid=function(){return!!this.start.getTime()&&!!this.end.getTime()},t}(o.DataObject);t.Task=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DependencyCollection=void 0;var r=n(0),i=n(13),o=n(11),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.createItem=function(){return new o.Dependency},t}(i.CollectionBase);t.DependencyCollection=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceAssignmentCollection=void 0;var r=n(0),i=n(13),o=n(36),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.createItem=function(){return new o.ResourceAssignment},t}(i.CollectionBase);t.ResourceAssignmentCollection=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewVisualModelItem=void 0;var r=n(1),i=function(){function e(e,t){this.dependencies=new Array,this.parent=null,this.visible=!0,this.selected=!1,this.visibleIndex=-1,this.task=e,this.resources=t,this.children=new Array}return Object.defineProperty(e.prototype,"resourceText",{get:function(){var e="";return this.resources.items.forEach((function(t){return e+=t.text+" "})),e},enumerable:!1,configurable:!0}),e.prototype.addChild=function(e){r.isDefined(e)&&this.children.indexOf(e)<0&&this.children.push(e)},e.prototype.removeChild=function(e){var t=this.children.indexOf(e);t>-1&&this.children.splice(t,1)},e.prototype.getExpanded=function(){return!!this.task&&this.task.expanded},e.prototype.getVisible=function(){if(!this.visible)return!1;for(var e=this.parent;e;){if(!e.visible)return!1;e=e.parent}return!0},e.prototype.changeVisibility=function(e){this.visible=e},e.prototype.changeSelection=function(e){this.selected=e},e.prototype.setDependencies=function(e){e&&(this.dependencies=e.slice())},e}();t.ViewVisualModelItem=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewVisualModelDependencyInfo=void 0;var r=function(e,t,n){this.id=e,this.predecessor=t,this.type=n};t.ViewVisualModelDependencyInfo=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkingTimeCalculator=void 0;var r=n(69),i=n(77),o=n(2),s=function(){function e(e,t){this._workingRules=new r.WorkingDayRuleCollection,this._workDayList=new Array,this._calculationRange=e,this._workingRules.importFromObject(t)}return e.prototype.calculateWorkDayList=function(){if(this._calculationRange){this.clearList();for(var e=this._workingRules.items,t=0;t<e.length;t++)this.processRule(e[t]);this.sortList()}},e.prototype.processRule=function(e){for(var t=e.recurrence.calculatePoints(this._calculationRange.start,this._calculationRange.end),n=function(n){var s=t[n],a=o.DateTimeUtils.getDayNumber(s),l=r._workDayList.filter((function(e){return e.dayNumber==a}))[0];l?(l.isWorkDay=l.isWorkDay&&e.isWorkDay,l.addWorkingIntervals(e.workTimeRanges)):r._workDayList.push(new i.DayWorkingTimeInfo(a,e.isWorkDay,e.workTimeRanges))},r=this,s=0;s<t.length;s++)n(s)},e.prototype.sortList=function(){this._workDayList.sort((function(e,t){return e.dayNumber-t.dayNumber}))},e.prototype.clearList=function(){this._workDayList.splice(0,this._workDayList.length)},e.prototype.calculateNoWorkTimeIntervals=function(){var e=this,t=new Array;return 0==this._workDayList.length&&this.calculateWorkDayList(),this._workDayList.forEach((function(n){return t=t.concat(e.getNoWorkTimeRangesFromDay(n))})),this.concatJointedRanges(t)},e.prototype.concatJointedRanges=function(e){for(var t=new Array,n=0;n<e.length;n++){var r=e[n];t.length>0&&o.DateTimeUtils.compareDates(t[t.length-1].end,r.start)<2?t[t.length-1].end=r.end:t.push(r)}return t},e.prototype.getNoWorkTimeRangesFromDay=function(e){return e.noWorkingIntervals.map((function(t){return o.DateTimeUtils.convertTimeRangeToDateRange(t,e.dayNumber)}))},Object.defineProperty(e.prototype,"noWorkingIntervals",{get:function(){return this._noWorkingIntervals||(this._noWorkingIntervals=this.calculateNoWorkTimeIntervals()),this._noWorkingIntervals.slice()},enumerable:!1,configurable:!0}),e.prototype.updateRange=function(e){this._calculationRange=e,this.invalidate()},e.prototype.invalidate=function(){this._noWorkingIntervals=null,this.clearList()},e}();t.WorkingTimeCalculator=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkingDayRuleCollection=void 0;var r=n(0),i=n(13),o=n(70),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.createItem=function(){return new o.WorkingTimeRule},t}(i.CollectionBase);t.WorkingDayRuleCollection=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkingTimeRule=void 0;var r=n(0),i=n(10),o=n(1),s=n(2),a=n(40),l=n(41),c=function(e){function t(t,n,r){void 0===t&&(t=null),void 0===n&&(n=!0),void 0===r&&(r=null);var i=e.call(this)||this;return i.isWorkDay=!0,i.workTimeRanges=new Array,i.recurrence=t,i.isWorkDay=n,r&&i.workTimeRanges.concat(r),i}return r.__extends(t,e),t.prototype.assignFromObject=function(t){if(o.isDefined(t)){e.prototype.assignFromObject.call(this,t),this.recurrence=a.RecurrenceFactory.createRecurrenceByType(t.recurrenceType)||new l.Daily,o.isDefined(t.recurrence)&&this.recurrence.assignFromObject(t.recurrence),o.isDefined(t.isWorkDay)&&(this.isWorkDay=!!t.isWorkDay);var n=s.DateTimeUtils.convertToTimeRanges(t.workTimeRanges);n&&(this.workTimeRanges=n)}},t}(i.DataObject);t.WorkingTimeRule=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DayOfWeek=void 0,function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"}(t.DayOfWeek||(t.DayOfWeek={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Month=void 0,function(e){e[e.January=0]="January",e[e.February=1]="February",e[e.March=2]="March",e[e.April=3]="April",e[e.May=4]="May",e[e.June=5]="June",e[e.July=6]="July",e[e.August=7]="August",e[e.September=8]="September",e[e.October=9]="October",e[e.November=10]="November",e[e.December=11]="December"}(t.Month||(t.Month={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Weekly=void 0;var r=n(0),i=n(16),o=n(2),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.checkDate=function(e){return o.DateTimeUtils.checkDayOfWeek(this.dayOfWeekInternal,e)},t.prototype.checkInterval=function(e){return o.DateTimeUtils.getWeeksBetween(this.start,e)%this.interval==0},t.prototype.calculatePointByInterval=function(e){var t=o.DateTimeUtils.getWeeksBetween(this.start,e),n=Math.floor(t/this.interval);(t%this.interval>0||e.getDay()>=this.dayOfWeekInternal)&&n++;var r=n*this.interval;return this.calcNextPointWithWeekCount(this.start,r)},t.prototype.calculateNearestPoint=function(e){var t=this.dayOfWeekInternal-e.getDay();return t>0?o.DateTimeUtils.addDays(new Date(e),t):this.calcNextPointWithWeekCount(e,1)},t.prototype.calcNextPointWithWeekCount=function(e,t){void 0===t&&(t=1);var n=7*t+this.dayOfWeekInternal-e.getDay();return o.DateTimeUtils.addDays(new Date(e),n)},Object.defineProperty(t.prototype,"dayOfWeek",{get:function(){return this.dayOfWeekInternal},set:function(e){this.dayOfWeekInternal=e},enumerable:!1,configurable:!0}),t}(i.RecurrenceBase);t.Weekly=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Monthly=void 0;var r=n(0),i=n(16),o=n(2),s=n(75),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.checkDate=function(e){return this._calculateByDayOfWeek?o.DateTimeUtils.checkDayOfWeekOccurrenceInMonth(e,this.dayOfWeekInternal,this.dayOfWeekOccurrenceInternal):o.DateTimeUtils.checkDayOfMonth(this.dayInternal,e)},t.prototype.checkInterval=function(e){return o.DateTimeUtils.getMonthsDifference(this.start,e)%this.interval==0},t.prototype.calculatePointByInterval=function(e){var t=this.start,n=o.DateTimeUtils.getMonthsDifference(t,e),r=Math.floor(n/this.interval)*this.interval,i=new s.MonthInfo(t.getMonth(),t.getFullYear());i.addMonths(r);var a=this.getSpecDayInMonth(i.year,i.month);return o.DateTimeUtils.compareDates(a,e)>=0&&(i.addMonths(this.interval),a=this.getSpecDayInMonth(i.year,i.month)),a},t.prototype.calculateNearestPoint=function(e){var t=e.getMonth(),n=e.getFullYear(),r=this.getSpecDayInMonth(n,t);if(o.DateTimeUtils.compareDates(r,e)>=0){var i=new s.MonthInfo(t,n);i.addMonths(1),r=this.getSpecDayInMonth(i.year,i.month)}return r},Object.defineProperty(t.prototype,"day",{get:function(){return this.dayInternal},set:function(e){this.dayInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dayOfWeek",{get:function(){return this.dayOfWeekInternal},set:function(e){this.dayOfWeekInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dayOfWeekOccurrence",{get:function(){return this.dayOfWeekOccurrenceInternal},set:function(e){this.dayOfWeekOccurrenceInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"calculateByDayOfWeek",{get:function(){return this._calculateByDayOfWeek},set:function(e){this._calculateByDayOfWeek=e},enumerable:!1,configurable:!0}),t}(i.RecurrenceBase);t.Monthly=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonthInfo=void 0;var r=n(2),i=function(){function e(e,t){this.month=e,this.year=t}return e.prototype.addMonths=function(e){var t=r.DateTimeUtils.getNextMonth(this.month,e),n=Math.floor(e/12);t<this.month&&++n,this.month=t,this.year+=n},e}();t.MonthInfo=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Yearly=void 0;var r=n(0),i=n(16),o=n(2),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.checkDate=function(e){return!!o.DateTimeUtils.checkMonth(this.month,e)&&(this._calculateByDayOfWeek?o.DateTimeUtils.checkDayOfWeekOccurrenceInMonth(e,this.dayOfWeekInternal,this.dayOfWeekOccurrenceInternal):o.DateTimeUtils.checkDayOfMonth(this.dayInternal,e))},t.prototype.checkInterval=function(e){return o.DateTimeUtils.getYearsDifference(this.start,e)%this.interval==0},t.prototype.calculatePointByInterval=function(e){var t=o.DateTimeUtils.getYearsDifference(this.start,e),n=Math.floor(t/this.interval)*this.interval,r=this.start.getFullYear()+n,i=this.getSpecDayInMonth(r,this.monthInternal);return o.DateTimeUtils.compareDates(i,e)>=0&&(r+=this.interval,i=this.getSpecDayInMonth(r,this.monthInternal)),i},t.prototype.calculateNearestPoint=function(e){var t=e.getFullYear(),n=this.getSpecDayInMonth(t,this.monthInternal);return o.DateTimeUtils.compareDates(n,e)>=0&&(n=this.getSpecDayInMonth(++t,this.monthInternal)),n},Object.defineProperty(t.prototype,"month",{get:function(){return this.monthInternal},set:function(e){this.monthInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"day",{get:function(){return this.dayInternal},set:function(e){this.dayInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dayOfWeek",{get:function(){return this.dayOfWeekInternal},set:function(e){this.dayOfWeekInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dayOfWeekOccurrence",{get:function(){return this.dayOfWeekOccurrenceInternal},set:function(e){this.dayOfWeekOccurrenceInternal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"calculateByDayOfWeek",{get:function(){return this._calculateByDayOfWeek},set:function(e){this._calculateByDayOfWeek=e},enumerable:!1,configurable:!0}),t}(i.RecurrenceBase);t.Yearly=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DayWorkingTimeInfo=void 0;var r=n(38),i=n(2),o=n(37),s=function(){function e(e,t,n){void 0===e&&(e=0),void 0===t&&(t=!0),void 0===n&&(n=null),this._workingIntervals=new Array,this.dayNumber=e,this.isWorkDay=t,this.addWorkingIntervals(n)}return e.prototype.addWorkingIntervals=function(e){e&&(this._workingIntervals=this._workingIntervals.concat(e.filter((function(e){return!!e}))),this.rearrangeWorkingIntervals())},e.prototype.rearrangeWorkingIntervals=function(){for(var e=0;e<this._workingIntervals.length;e++)this.concatWithIntersectedRanges(this._workingIntervals[e]);this.sortIntervals()},e.prototype.concatWithIntersectedRanges=function(e){var t=this;this.getIntersectedIntervals(e).forEach((function(n){e.concatWith(n),t.removeInterval(n)}))},e.prototype.getIntersectedIntervals=function(e){return this._workingIntervals.filter((function(t){return t.hasIntersect(e)&&t!==e}))},e.prototype.sortIntervals=function(){this._workingIntervals.sort((function(e,t){return i.DateTimeUtils.caclTimeDifference(t.start,e.start)}))},e.prototype.removeInterval=function(e){var t=this._workingIntervals.indexOf(e);t>-1&&t<this._workingIntervals.length&&this._workingIntervals.splice(t,1)},e.prototype.clearIntervals=function(){this._workingIntervals.splice(0,this._workingIntervals.length)},Object.defineProperty(e.prototype,"workingIntervals",{get:function(){return this._workingIntervals.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"noWorkingIntervals",{get:function(){var e=new Array;if(this.isWorkDay&&0==this._workingIntervals.length)return e;var t=this._workingIntervals.map((function(e){return e.end}));t.splice(0,0,new o.Time);var n=this._workingIntervals.map((function(e){return e.start}));n.push(i.DateTimeUtils.getLastTimeOfDay());for(var s=0;s<t.length;s++){var a=t[s],l=n[s];i.DateTimeUtils.areTimesEqual(a,l)||e.push(new r.TimeRange(a,l))}return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isWorkDay",{get:function(){return this._isWorkDay},set:function(e){this._isWorkDay=e,e||this.clearIntervals()},enumerable:!1,configurable:!0}),e}();t.DayWorkingTimeInfo=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(35),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.empty=function(){return new t(0,0,0,0)},t.prototype.clone=function(){return new t(this.left,this.right,this.top,this.bottom)},t}(n(79).Offsets);t.Margins=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n,r){this.left=e,this.right=t,this.top=n,this.bottom=r}return e.empty=function(){return new e(0,0,0,0)},Object.defineProperty(e.prototype,"horizontal",{get:function(){return this.left+this.right},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vertical",{get:function(){return this.top+this.bottom},enumerable:!0,configurable:!0}),e.fromNumber=function(t){return new e(t,t,t,t)},e.fromOffsets=function(t){return new e(t.left,t.right,t.top,t.bottom)},e.fromSide=function(t,n){return new e(t,t,n,n)},e.prototype.normalize=function(){return this.left=Math.max(0,this.left),this.right=Math.max(0,this.right),this.top=Math.max(0,this.top),this.bottom=Math.max(0,this.bottom),this},e.prototype.toString=function(){return JSON.stringify(this)},e.prototype.isEmpty=function(){return 0===this.left&&0===this.right&&0===this.top&&0===this.bottom},e.prototype.offset=function(e){return this.left+=e.left,this.right+=e.right,this.top+=e.top,this.bottom+=e.bottom,this},e.prototype.multiply=function(e,t,n,r){switch(arguments.length){case 1:return this.left*=e,this.right*=e,this.top*=e,this.bottom*=e,this;case 2:return this.left*=e,this.right*=e,this.top*=t,this.bottom*=t,this;case 4:return this.left*=e,this.right*=t,this.top*=n,this.bottom*=r,this}return this},e.prototype.clone=function(){return new e(this.left,this.right,this.top,this.bottom)},e.prototype.copyFrom=function(e){this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom},e.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.right===e.right&&this.left===e.left},e.prototype.applyConverter=function(e){return this.left=e(this.left),this.right=e(this.right),this.top=e(this.top),this.bottom=e(this.bottom),this},e}();t.Offsets=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EtalonSizeValues=void 0;var r=function(){this.scaleItemWidths={}};t.EtalonSizeValues=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelManipulator=void 0;var r=n(82),i=n(83),o=n(85),s=function(e,t){this.task=new o.TaskManipulator(e,t),this.dependency=new r.TaskDependencyManipulator(e,t),this.resource=new i.ResourcesManipulator(e,t),this.dispatcher=t};t.ModelManipulator=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskDependencyManipulator=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.insertDependency=function(e,t,n,r){var i=this.viewModel.dependencies.createItem();return i.predecessorId=e,i.successorId=t,i.type=n,r&&(i.internalId=r),i.id=i.internalId,this.viewModel.dependencies.add(i),this.dispatcher.notifyDependencyInserted(this.getObjectForDataSource(i),(function(e){return i.id=e}),this.getErrorCallback()),this.viewModel.updateVisibleItemDependencies(),this.viewModel.owner.recreateConnectorLineElement(i.internalId,!0),i},t.prototype.removeDependency=function(e){var t=this.viewModel.dependencies.getItemById(e);return this.viewModel.dependencies.remove(t),this.dispatcher.notifyDependencyRemoved(t.id,this.getErrorCallback(),this.viewModel.getDependencyObjectForDataSource(t)),this.viewModel.updateVisibleItemDependencies(),this.viewModel.owner.recreateConnectorLineElement(t.internalId),t},t.prototype.getObjectForDataSource=function(e){return{id:e.id,predecessorId:this.viewModel.tasks.getItemById(e.predecessorId).id,successorId:this.viewModel.tasks.getItemById(e.successorId).id,type:e.type}},t}(n(18).BaseManipulator);t.TaskDependencyManipulator=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesManipulator=void 0;var r=n(0),i=n(18),o=n(84),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.properties=new o.ResourcePropertiesManipulator(t,n),r}return r.__extends(t,e),t.prototype.create=function(e,t,n,r){var i=this.viewModel.resources.createItem();return i.text=e,t&&(i.color=t),n&&(i.internalId=n),i.id=i.internalId,this.viewModel.resources.add(i),this.dispatcher.notifyResourceCreated(this.getResourceObjectForDataSource(i),(function(e){i.id=e,r&&r(e)}),this.getErrorCallback()),i},t.prototype.remove=function(e){var t=this.viewModel.resources.getItemById(e);if(!t)throw new Error("Invalid resource id");if(this.viewModel.assignments.items.filter((function(t){return t.resourceId==e})).length)throw new Error("Can't delete assigned resource");return this.viewModel.resources.remove(t),this.dispatcher.notifyResourceRemoved(t.id,this.getErrorCallback(),this.viewModel.getResourceObjectForDataSource(t)),t},t.prototype.assign=function(e,t,n){var r=this.viewModel.assignments.createItem();return r.resourceId=e,r.taskId=t,n&&(r.internalId=n),r.id=r.internalId,this.viewModel.assignments.add(r),this.dispatcher.notifyResourceAssigned(this.getResourceAssignmentObjectForDataSource(r),(function(e){return r.id=e}),this.getErrorCallback()),this.viewModel.updateModel(),this.viewModel.owner.resetAndUpdate(),r},t.prototype.deassig=function(e){var t=this.viewModel.assignments.getItemById(e);return this.viewModel.assignments.remove(t),this.dispatcher.notifyResourceUnassigned(t.id,this.getErrorCallback(),this.viewModel.getResourceAssignmentObjectForDataSource(t)),this.viewModel.updateModel(),this.viewModel.owner.resetAndUpdate(),t},t.prototype.getResourceObjectForDataSource=function(e){return{id:e.id,text:e.text}},t.prototype.getResourceAssignmentObjectForDataSource=function(e){return{id:e.id,taskId:this.viewModel.tasks.getItemById(e.taskId).id,resourceId:this.viewModel.resources.getItemById(e.resourceId).id}},t}(i.BaseManipulator);t.ResourcesManipulator=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcePropertyManipulator=t.ResourcePropertiesManipulator=void 0;var r=n(0),i=n(18),o=n(46),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.color=new l(t,n),r}return r.__extends(t,e),t}(i.BaseManipulator);t.ResourcePropertiesManipulator=s;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.setValue=function(e,t){var n=this,r=this.viewModel.resources.getItemById(e),i=new o.HistoryItemState(e,this.getPropertyValue(r));return this.setPropertyValue(r,t),this.viewModel.assignments.items.filter((function(e){return e.resourceId==r.internalId})).forEach((function(e){var t=n.viewModel.findItem(e.taskId).visibleIndex;n.viewModel.owner.recreateTaskElement(t)})),i},t.prototype.restoreValue=function(e){var t=this;if(e){var n=e.value,r=this.viewModel.resources.getItemById(e.id);this.setPropertyValue(r,n),this.viewModel.assignments.items.filter((function(e){return e.resourceId==r.internalId})).forEach((function(e){var n=t.viewModel.findItem(e.taskId).visibleIndex;t.viewModel.owner.recreateTaskElement(n)}))}},t}(i.BaseManipulator);t.ResourcePropertyManipulator=a;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getPropertyValue=function(e){return e.color},t.prototype.setPropertyValue=function(e,t){e.color=t,this.dispatcher.notifyResourceColorChanged(e.id,t,this.getErrorCallback())},t}(a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskManipulator=void 0;var r=n(0),i=n(18),o=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.properties=new i.TaskPropertiesManipulator(t,n),r}return r.__extends(t,e),t.prototype.create=function(e,t,n){var r=this,i=this.viewModel.tasks.createItem();i.start=e.start,i.end=e.end,i.title=e.title,i.progress=e.progress,e.color&&(i.color=e.color);var o=this.viewModel.tasks.getItemById(e.parentId);return o&&(o.expanded=!0),i.parentId=e.parentId,t&&(i.internalId=t),i.id=i.internalId,this.viewModel.tasks.add(i),this.viewModel.updateModel(),this.dispatcher.notifyTaskCreated(this.getObjectForDataSource(i),(function(e){if(i.id=e,n&&n(),r.viewModel.requireFirstLoadParentAutoCalc){var t=r.viewModel.getCurrentTaskData().map((function(e){return""===e.parentId&&(e.parentId=null),e}));r.dispatcher.notifyParentDataRecalculated(t)}}),this.getErrorCallback()),this.viewModel.owner.resetAndUpdate(),i},t.prototype.remove=function(e){var t=this.viewModel.tasks.getItemById(e);if(!t)throw new Error("Invalid task id");if(this.viewModel.dependencies.items.filter((function(t){return t.predecessorId==e||t.successorId==e})).length)throw new Error("Can't delete task with dependency");if(this.viewModel.assignments.items.filter((function(t){return t.taskId==e})).length)throw new Error("Can't delete task with assigned resource");return this.viewModel.tasks.remove(t),this.dispatcher.notifyTaskRemoved(t.id,this.getErrorCallback(),this.viewModel.getTaskObjectForDataSource(t)),this.viewModel.updateModel(),this.viewModel.owner.resetAndUpdate(),t},t.prototype.getObjectForDataSource=function(e){return this.viewModel.getTaskObjectForDataSource(e)},t}(i.BaseManipulator);t.TaskManipulator=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.History=void 0;var r=n(12),i=n(87),o=function(){function e(){this.historyItems=[],this.currentIndex=-1,this.currentProcessingItemInfo=null,this.transaction=null,this.transactionLevel=-1}return e.prototype.undo=function(){this.canUndo()&&(this.activateItem(this.historyItems[this.currentIndex],!0),this.currentIndex--)},e.prototype.redo=function(){this.canRedo()&&(this.currentIndex++,this.activateItem(this.historyItems[this.currentIndex]))},e.prototype.beginTransaction=function(){this.transactionLevel++,0==this.transactionLevel&&(this.transaction=new r.CompositionHistoryItem)},e.prototype.endTransaction=function(){if(!(--this.transactionLevel>=0)){var e=this.transaction.historyItems.length;e>1?this.addInternal(this.transaction):1==e&&this.addInternal(this.transaction.historyItems.pop()),this.transaction=null}},e.prototype.addAndRedo=function(e){this.add(e),this.activateItem(e)},e.prototype.add=function(e){this.transactionLevel>=0?this.transaction.add(e):this.addInternal(e)},e.prototype.canUndo=function(){return this.currentIndex>=0},e.prototype.canRedo=function(){return this.currentIndex<this.historyItems.length-1},e.prototype.addInternal=function(e){this.currentIndex<this.historyItems.length-1&&this.historyItems.splice(this.currentIndex+1),this.historyItems.push(e),this.currentIndex++,this.deleteOldItems()},e.prototype.deleteOldItems=function(){var t=this.historyItems.length-e.MAX_HISTORY_ITEM_COUNT;t>0&&this.currentIndex>t&&(this.historyItems.splice(0,t),this.currentIndex-=t)},e.prototype.clear=function(){this.currentIndex=-1,this.historyItems=[]},e.prototype.activateItem=function(e,t){void 0===t&&(t=!1),this.currentProcessingItemInfo=new i.HistoryItemInfo(e,t),t?e.undo():e.redo(),this.currentProcessingItemInfo=null},e.prototype.getCurrentProcessingItemInfo=function(){return this.currentProcessingItemInfo},e.prototype.rollBackAndRemove=function(e){var t=e.item;this.checkAndRemoveItem(t)&&(e.isUndo?t.redo():t instanceof r.CompositionHistoryItem?t.undoItemsQuery():t.undo())},e.prototype.checkAndRemoveItem=function(e){var t=this.historyItems.indexOf(e);return t>-1?(this.historyItems.splice(t,1),this.currentIndex--):this.transaction&&(t=this.transaction.historyItems.indexOf(e))>-1&&this.transaction.historyItems.splice(t,1),t>-1},e.MAX_HISTORY_ITEM_COUNT=100,e}();t.History=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryItemInfo=void 0;var r=function(e,t){void 0===t&&(t=!1),this.item=e,this.isUndo=t};t.HistoryItemInfo=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;var r=n(89),i=n(94),o=n(5),s=n(96),a=function(){function e(e){this.control=e,this.mouseHandler=new r.MouseHandler(e),this.touchHandler=new s.TouchHandler(e)}return e.prototype.onMouseDown=function(e){this.mouseHandler.onMouseDown(e)},e.prototype.onMouseMove=function(e){this.mouseHandler.onMouseMove(e)},e.prototype.onMouseUp=function(e){this.mouseHandler.onMouseUp(e)},e.prototype.onMouseDblClick=function(e){this.mouseHandler.onMouseDoubleClick(e)},e.prototype.onMouseWheel=function(e){this.mouseHandler.onMouseWheel(e)},e.prototype.onTouchStart=function(e){this.touchHandler.onTouchStart(e)},e.prototype.onTouchEnd=function(e){this.touchHandler.onTouchEnd(e)},e.prototype.onTouchMove=function(e){this.touchHandler.onTouchMove(e)},e.prototype.onDoubleTap=function(e){this.touchHandler.onDoubleTap(e)},e.prototype.onKeyDown=function(e){if(this.control.isFocus){var t=this.getShortcutCode(e);t==(i.ModifierKey.Ctrl|i.KeyCode.Key_z)&&this.control.history.undo(),t==(i.ModifierKey.Ctrl|i.KeyCode.Key_y)&&this.control.history.redo(),t==i.KeyCode.Delete&&this.control.taskEditController.deleteSelectedDependency()}},e.prototype.getShortcutCode=function(e){var t=i.KeyUtils.getEventKeyCode(e),n=0;return e.altKey&&(n|=i.ModifierKey.Alt),e.ctrlKey&&(n|=i.ModifierKey.Ctrl),e.shiftKey&&(n|=i.ModifierKey.Shift),e.metaKey&&o.Browser.MacOSPlatform&&(n|=i.ModifierKey.Meta),n|t},e}();t.EventManager=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandler=void 0;var r=n(0),i=n(47),o=n(8),s=n(90),a=n(6),l=n(91),c=n(92),u=n(93),d=n(48),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onMouseDoubleClick=function(e){this.state.onMouseDoubleClick(e)},t.prototype.onMouseDown=function(e){switch(this.getEventSource(a.EvtUtils.getEventSource(e))){case o.MouseEventSource.TaskEdit_Frame:this.switchState(new l.MouseHandlerMoveTaskState(this));break;case o.MouseEventSource.TaskEdit_Progress:this.switchState(new c.MouseHandlerProgressTaskState(this));break;case o.MouseEventSource.TaskEdit_Start:case o.MouseEventSource.TaskEdit_End:this.switchState(new u.MouseHandlerTimestampTaskState(this));break;case o.MouseEventSource.TaskEdit_DependencyStart:case o.MouseEventSource.TaskEdit_DependencyFinish:this.switchState(new d.MouseHandlerDependencyState(this))}this.state.onMouseDown(e)},t.prototype.onMouseUp=function(e){this.state.onMouseUp(e)},t.prototype.onMouseMove=function(e){this.state.onMouseMove(e)},t.prototype.onMouseWheel=function(e){this.state.onMouseWheel(e)},t.prototype.switchToDefaultState=function(){this.state=new s.MouseHandlerDefaultState(this)},t}(i.HandlerBase);t.MouseHandler=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttMovingHelper=t.MouseHandlerDefaultState=void 0;var r=n(0),i=n(3),o=n(6),s=n(29),a=n(17),l=n(4),c=n(5),u=function(e){function t(t){var n=e.call(this,t)||this;return n.isInScrolling=!1,n.ganttMovingHelper=new d(n.handler.control),n}return r.__extends(t,e),t.prototype.onMouseDown=function(e){e.preventDefault();var t=o.EvtUtils.getEventSource(e);if(i.DomUtils.hasClassName(t,a.GridLayoutCalculator.CLASSNAMES.CONNECTOR_HORIZONTAL)||i.DomUtils.hasClassName(t,a.GridLayoutCalculator.CLASSNAMES.CONNECTOR_VERTICAL)){var n=t.getAttribute("dependency-id");if(this.handler.control.taskEditController.dependencyId!=n&&(this.handler.control.selectDependency(n),e instanceof PointerEvent)){var r={event:e,type:"dependency",key:n,position:new l.Point(o.EvtUtils.getEventX(e),o.EvtUtils.getEventY(e))};this.handler.control.ganttOwner.showPopupMenu(r)}}else o.EvtUtils.isLeftButtonPressed(e)&&this.ganttMovingHelper.startMoving(e),null!=this.handler.control.taskEditController.dependencyId&&this.handler.control.selectDependency(null)},t.prototype.onMouseUp=function(e){this.ganttMovingHelper.onMouseUp(e)},t.prototype.onMouseMove=function(e){this.ganttMovingHelper.movingInfo&&(this.handler.control.taskEditController.hide(),this.ganttMovingHelper.onMouseMove(e),e.preventDefault())},t.prototype.onMouseWheel=function(e){var t=this;if(e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),!this.isInScrolling)){this.isInScrolling=!0,setTimeout((function(){t.isInScrolling=!1}),50);var n=o.EvtUtils.getWheelDelta(e)>0,r=o.EvtUtils.getEventX(e)-i.DomUtils.getAbsolutePositionX(this.handler.control.taskAreaContainer.getElement());n?this.handler.control.zoomIn(r):this.handler.control.zoomOut(r)}},t}(s.MouseHandlerStateBase);t.MouseHandlerDefaultState=u;var d=function(){function e(e){this.gantt=e,this.movingInfo=null}return e.prototype.startMoving=function(e){this.movingInfo=this.calcMovingInfo(e),this.updateGanttAreaCursor(!0)},e.prototype.cancelMoving=function(){this.movingInfo=null},e.prototype.onMouseMove=function(e){this.move(e)},e.prototype.onMouseUp=function(e){this.cancelMoving(),this.updateGanttAreaCursor(!1)},e.prototype.move=function(e){this.updateScrollPosition(e)},e.prototype.updateScrollPosition=function(e){var t=Math.round(o.EvtUtils.getEventX(e)),n=Math.round(o.EvtUtils.getEventY(e)),r=t-this.movingInfo.eventX,i=n-this.movingInfo.eventY,s=r<0?-1:1,a=i<0?-1:1,l=s<0?this.movingInfo.maxRightDelta:this.movingInfo.maxLeftDelta,c=a<0?this.movingInfo.maxBottomDelta:this.movingInfo.maxTopDelta;Math.abs(r)>l&&(r=l*s),Math.abs(i)>c&&(i=c*a);var u=this.movingInfo.scrollLeft-r,d=this.movingInfo.scrollTop-i,h=this.gantt.taskAreaContainer;h.scrollLeft!==u&&(h.scrollLeft=u),h.scrollTop!==d&&(h.scrollTop=d)},e.prototype.calcMovingInfo=function(e){var t=this.gantt.taskAreaContainer;return{eventX:o.EvtUtils.getEventX(e),eventY:o.EvtUtils.getEventY(e),scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,maxLeftDelta:t.scrollLeft,maxRightDelta:t.scrollWidth-t.scrollLeft-t.getElement().offsetWidth,maxTopDelta:t.scrollTop,maxBottomDelta:t.scrollHeight-t.scrollTop-t.getElement().offsetHeight}},e.prototype.updateGanttAreaCursor=function(e){c.Browser.IE?this.gantt.taskAreaContainer.getElement().style.cursor=e?"move":"default":this.gantt.taskAreaContainer.getElement().style.cursor=e?"grabbing":"default"},e}();t.GanttMovingHelper=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandlerMoveTaskState=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onMouseUpInternal=function(e){this.handler.control.taskEditController.confirmMove()},t.prototype.onMouseMoveInternal=function(e){this.handler.control.taskEditController.processMove(e.x-this.currentPosition.x)||this.handler.switchToDefaultState()},t}(n(30).MouseHandlerDragBaseState);t.MouseHandlerMoveTaskState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandlerProgressTaskState=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onMouseUpInternal=function(e){this.handler.control.taskEditController.confirmProgress()},t.prototype.onMouseMoveInternal=function(e){var t=this.getRelativePos(e);this.handler.control.taskEditController.processProgress(t)},t}(n(30).MouseHandlerDragBaseState);t.MouseHandlerProgressTaskState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MouseHandlerTimestampTaskState=void 0;var r=n(0),i=n(8),o=n(6),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onMouseDown=function(t){e.prototype.onMouseDown.call(this,t),this.source=this.handler.getEventSource(o.EvtUtils.getEventSource(t))},t.prototype.onMouseUpInternal=function(e){this.source==i.MouseEventSource.TaskEdit_Start?this.handler.control.taskEditController.confirmStart():this.handler.control.taskEditController.confirmEnd()},t.prototype.onMouseMoveInternal=function(e){var t=this.getRelativePos(e);this.source==i.MouseEventSource.TaskEdit_Start&&this.handler.control.taskEditController.processStart(t),this.source==i.MouseEventSource.TaskEdit_End&&this.handler.control.taskEditController.processEnd(t)},t}(n(30).MouseHandlerDragBaseState);t.MouseHandlerTimestampTaskState=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,o=n(5),s=n(95),a=n(27),l=function(){function e(){}return e.getKeyModifiers=function(e){var t=0;return e.altKey&&(t|=r.Alt),e.ctrlKey&&(t|=r.Ctrl),e.shiftKey&&(t|=r.Shift),t},e.getShortcutCode=function(e,t,n,i,o){var s=e;return s|=t?r.Ctrl:0,s|=n?r.Shift:0,s|=i?r.Alt:0,s|=o?r.Meta:0},e.getShortcutCodeByEvent=function(t){return e.getShortcutCode(e.getEventKeyCode(t),t.ctrlKey,t.shiftKey,t.altKey,!!o.Browser.MacOSPlatform&&t.metaKey)},e.getEventKeyCode=function(e){return o.Browser.NetscapeFamily||o.Browser.Opera?e.which:e.keyCode},e.parseShortcutString=function(t){if(!t)return 0;var n=!1,r=!1,o=!1,l=!1,c=null,u=t.toString().split("+");if(u.length>0)for(var d=0;d<u.length;d++){var h=a.StringUtils.trim(u[d].toUpperCase());switch(h){case"CONTROL":case"CONTROLKEY":case"CTRL":n=!0;break;case"SHIFT":case"SHIFTKEY":r=!0;break;case"ALT":o=!0;break;case"CMD":l=!0;break;case"F1":c=i.F1;break;case"F2":c=i.F2;break;case"F3":c=i.F3;break;case"F4":c=i.F4;break;case"F5":c=i.F5;break;case"F6":c=i.F6;break;case"F7":c=i.F7;break;case"F8":c=i.F8;break;case"F9":c=i.F9;break;case"F10":c=i.F10;break;case"F11":c=i.F11;break;case"F12":c=i.F12;break;case"RETURN":case"ENTER":c=i.Enter;break;case"HOME":c=i.Home;break;case"END":c=i.End;break;case"LEFT":c=i.Left;break;case"RIGHT":c=i.Right;break;case"UP":c=i.Up;break;case"DOWN":c=i.Down;break;case"PAGEUP":c=i.PageUp;break;case"PAGEDOWN":c=i.PageDown;break;case"SPACE":c=i.Space;break;case"TAB":c=i.Tab;break;case"BACKSPACE":case"BACK":c=i.Backspace;break;case"CONTEXT":c=i.ContextMenu;break;case"ESCAPE":case"ESC":c=i.Esc;break;case"DELETE":case"DEL":c=i.Delete;break;case"INSERT":case"INS":c=i.Insert;break;case"PLUS":c="+".charCodeAt(0);break;default:c=h.charCodeAt(0)}}else alert(s.EncodeUtils.decodeViaTextArea("Invalid shortcut"));return e.getShortcutCode(c,n,r,o,l)},e}();t.KeyUtils=l,function(e){e[e.None=0]="None",e[e.Ctrl=65536]="Ctrl",e[e.Shift=262144]="Shift",e[e.Alt=1048576]="Alt",e[e.Meta=16777216]="Meta"}(r=t.ModifierKey||(t.ModifierKey={})),function(e){e[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.Enter=13]="Enter",e[e.Pause=19]="Pause",e[e.CapsLock=20]="CapsLock",e[e.Esc=27]="Esc",e[e.Space=32]="Space",e[e.PageUp=33]="PageUp",e[e.PageDown=34]="PageDown",e[e.End=35]="End",e[e.Home=36]="Home",e[e.Left=37]="Left",e[e.Up=38]="Up",e[e.Right=39]="Right",e[e.Down=40]="Down",e[e.Insert=45]="Insert",e[e.Delete=46]="Delete",e[e.Key_0=48]="Key_0",e[e.Key_1=49]="Key_1",e[e.Key_2=50]="Key_2",e[e.Key_3=51]="Key_3",e[e.Key_4=52]="Key_4",e[e.Key_5=53]="Key_5",e[e.Key_6=54]="Key_6",e[e.Key_7=55]="Key_7",e[e.Key_8=56]="Key_8",e[e.Key_9=57]="Key_9",e[e.Key_a=65]="Key_a",e[e.Key_b=66]="Key_b",e[e.Key_c=67]="Key_c",e[e.Key_d=68]="Key_d",e[e.Key_e=69]="Key_e",e[e.Key_f=70]="Key_f",e[e.Key_g=71]="Key_g",e[e.Key_h=72]="Key_h",e[e.Key_i=73]="Key_i",e[e.Key_j=74]="Key_j",e[e.Key_k=75]="Key_k",e[e.Key_l=76]="Key_l",e[e.Key_m=77]="Key_m",e[e.Key_n=78]="Key_n",e[e.Key_o=79]="Key_o",e[e.Key_p=80]="Key_p",e[e.Key_q=81]="Key_q",e[e.Key_r=82]="Key_r",e[e.Key_s=83]="Key_s",e[e.Key_t=84]="Key_t",e[e.Key_u=85]="Key_u",e[e.Key_v=86]="Key_v",e[e.Key_w=87]="Key_w",e[e.Key_x=88]="Key_x",e[e.Key_y=89]="Key_y",e[e.Key_z=90]="Key_z",e[e.Windows=91]="Windows",e[e.ContextMenu=93]="ContextMenu",e[e.Numpad_0=96]="Numpad_0",e[e.Numpad_1=97]="Numpad_1",e[e.Numpad_2=98]="Numpad_2",e[e.Numpad_3=99]="Numpad_3",e[e.Numpad_4=100]="Numpad_4",e[e.Numpad_5=101]="Numpad_5",e[e.Numpad_6=102]="Numpad_6",e[e.Numpad_7=103]="Numpad_7",e[e.Numpad_8=104]="Numpad_8",e[e.Numpad_9=105]="Numpad_9",e[e.Multiply=106]="Multiply",e[e.Add=107]="Add",e[e.Subtract=109]="Subtract",e[e.Decimal=110]="Decimal",e[e.Divide=111]="Divide",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NumLock=144]="NumLock",e[e.ScrollLock=145]="ScrollLock",e[e.Semicolon=186]="Semicolon",e[e.Equals=187]="Equals",e[e.Comma=188]="Comma",e[e.Dash=189]="Dash",e[e.Period=190]="Period",e[e.ForwardSlash=191]="ForwardSlash",e[e.GraveAccent=192]="GraveAccent",e[e.OpenBracket=219]="OpenBracket",e[e.BackSlash=220]="BackSlash",e[e.CloseBracket=221]="CloseBracket",e[e.SingleQuote=222]="SingleQuote"}(i=t.KeyCode||(t.KeyCode={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.encodeHtml=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},e.decodeHtml=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},e.prepareTextForRequest=function(e){return e.replace(/%/g,"%25").replace(/&/g,"%26amp;").replace(/\+/g,"%2B").replace(/</g,"%26lt;").replace(/>/g,"%26gt;").replace(/"/g,"%26quot;")},e.prepareTextForCallBackRequest=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},e.decodeViaTextArea=function(e){var t=document.createElement("TEXTAREA");return t.innerHTML=e,t.value},e}();t.EncodeUtils=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandler=void 0;var r=n(0),i=n(47),o=n(6),s=n(8),a=n(97),l=n(98),c=n(99),u=n(100),d=n(101),h=n(102),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){switch(e.touches.length>1&&e.preventDefault(),this.getEventSource(o.EvtUtils.getEventSource(e))){case s.MouseEventSource.TaskEdit_Frame:this.switchState(new a.TouchHandlerMoveTaskState(this));break;case s.MouseEventSource.TaskEdit_Progress:this.switchState(new c.TouchHandlerProgressTaskState(this));break;case s.MouseEventSource.TaskEdit_Start:case s.MouseEventSource.TaskEdit_End:this.switchState(new u.TouchHandlerTimestampTaskState(this));break;case s.MouseEventSource.TaskEdit_DependencyStart:case s.MouseEventSource.TaskEdit_DependencyFinish:this.switchState(new d.TouchHandlerDependencyState(this))}this.state.onTouchStart(e)},t.prototype.onDoubleTap=function(e){this.state.onDoubleTap(e)},t.prototype.onTouchEnd=function(e){this.state.onTouchEnd(e)},t.prototype.onTouchMove=function(e){e.touches.length>1&&(this.state instanceof h.TouchHandlerZoomState||this.switchState(new h.TouchHandlerZoomState(this))),this.state.onTouchMove(e)},t.prototype.switchToDefaultState=function(){this.state=new l.TouchHandlerDefaultState(this)},t}(i.HandlerBase);t.TouchHandler=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerMoveTaskState=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchEndInternal=function(e){this.handler.control.taskEditController.confirmMove()},t.prototype.onTouchMoveInternal=function(e){this.handler.control.taskEditController.processMove(e.x-this.currentPosition.x)||this.handler.switchToDefaultState()},t}(n(31).TouchHandlerDragBaseState);t.TouchHandlerMoveTaskState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerDefaultState=void 0;var r=n(0),i=n(4),o=n(3),s=n(6),a=n(15),l=n(17),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){var t=this;if(this.preventSelect=!1,clearTimeout(this.popupTimer),1===e.touches.length){var n=s.EvtUtils.getEventSource(e),r={event:e,position:new i.Point(s.EvtUtils.getEventX(e),s.EvtUtils.getEventY(e))};if(o.DomUtils.hasClassName(n,l.GridLayoutCalculator.CLASSNAMES.CONNECTOR_HORIZONTAL)||o.DomUtils.hasClassName(n,l.GridLayoutCalculator.CLASSNAMES.CONNECTOR_VERTICAL)){this.preventSelect=!0;var a=n.getAttribute("dependency-id");this.handler.control.taskEditController.dependencyId!=a&&this.handler.control.selectDependency(a),r.type="dependency",r.key=a,this.handler.control.ganttOwner.showPopupMenu(r)}else this.popupTimer=setTimeout((function(){var n=t.getTaskIndex(e);t.changeTaskSelection(n);var i=t.handler.control.viewModel.items[n];r.type="task",r.key=i&&i.task.id,t.handler.control.ganttOwner.showPopupMenu(r)}),500)}},t.prototype.onDoubleTap=function(e){},t.prototype.onTouchEnd=function(e){clearTimeout(this.popupTimer),this.preventSelect||this.changeTaskSelection(this.getTaskIndex(e))},t.prototype.onTouchMove=function(e){clearTimeout(this.popupTimer),this.preventSelect=!0},t.prototype.getTaskIndex=function(e){var t=a.TouchUtils.getEventY(e)-o.DomUtils.getAbsolutePositionY(this.handler.control.taskArea);return Math.floor(t/this.handler.control.tickSize.height)},t.prototype.changeTaskSelection=function(e){var t=this.handler.control.viewModel.items[e];t&&this.handler.control.ganttOwner.changeGanttTaskSelection(t.task.id,!0)},t}(n(19).HandlerStateBase);t.TouchHandlerDefaultState=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerProgressTaskState=void 0;var r=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchEndInternal=function(e){this.handler.control.taskEditController.confirmProgress()},t.prototype.onTouchMoveInternal=function(e){var t=this.getRelativePos(e);this.handler.control.taskEditController.processProgress(t)},t}(n(31).TouchHandlerDragBaseState);t.TouchHandlerProgressTaskState=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerTimestampTaskState=void 0;var r=n(0),i=n(31),o=n(8),s=n(6),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(t){e.prototype.onTouchStart.call(this,t),this.source=this.handler.getEventSource(s.EvtUtils.getEventSource(t))},t.prototype.onTouchEndInternal=function(e){this.source==o.MouseEventSource.TaskEdit_Start?this.handler.control.taskEditController.confirmStart():this.handler.control.taskEditController.confirmEnd()},t.prototype.onTouchMoveInternal=function(e){var t=this.getRelativePos(e);this.source==o.MouseEventSource.TaskEdit_Start&&this.handler.control.taskEditController.processStart(t),this.source==o.MouseEventSource.TaskEdit_End&&this.handler.control.taskEditController.processEnd(t)},t}(i.TouchHandlerDragBaseState);t.TouchHandlerTimestampTaskState=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerDependencyState=void 0;var r=n(0),i=n(49),o=n(8),s=n(3),a=n(6),l=n(4),c=n(48),u=n(15),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){e.preventDefault();var t=a.EvtUtils.getEventSource(e);this.source=this.handler.getEventSource(t);var n=this.getRelativePos(new l.Point(s.DomUtils.getAbsolutePositionX(t)+t.clientWidth/2,s.DomUtils.getAbsolutePositionY(t)+t.clientHeight/2));this.handler.control.taskEditController.startDependency(n)},t.prototype.onTouchEnd=function(e){var t=this.getRelativePos(new l.Point(s.DomUtils.getAbsolutePositionX(this.handler.control.taskEditController.dependencySuccessorStart)+this.handler.control.taskEditController.dependencySuccessorStart.clientWidth/2,s.DomUtils.getAbsolutePositionY(this.handler.control.taskEditController.dependencySuccessorStart)+this.handler.control.taskEditController.dependencySuccessorStart.clientHeight/2)),n=this.getRelativePos(new l.Point(s.DomUtils.getAbsolutePositionX(this.handler.control.taskEditController.dependencySuccessorFinish)+this.handler.control.taskEditController.dependencySuccessorFinish.clientWidth/2,s.DomUtils.getAbsolutePositionY(this.handler.control.taskEditController.dependencySuccessorFinish)+this.handler.control.taskEditController.dependencySuccessorFinish.clientHeight/2)),r=this.getRelativePos(new l.Point(u.TouchUtils.getEventX(e),u.TouchUtils.getEventY(e))),i=this.isTouchNearby(r,t)?o.MouseEventSource.Successor_DependencyStart:this.isTouchNearby(r,n)?o.MouseEventSource.Successor_DependencyFinish:null,a=i===o.MouseEventSource.Successor_DependencyStart||i==o.MouseEventSource.Successor_DependencyFinish?c.dependencyMap[this.source][i]:null;this.handler.control.taskEditController.endDependency(a),this.handler.switchToDefaultState()},t.prototype.onTouchMove=function(e){e.preventDefault();var t=this.getRelativePos(new l.Point(u.TouchUtils.getEventX(e),u.TouchUtils.getEventY(e))),n=Math.floor(t.y/this.handler.control.tickSize.height);this.handler.control.taskEditController.processDependency(t),this.handler.control.viewModel.tasks.items[n]&&this.handler.control.taskEditController.showDependencySuccessor(n)},t.prototype.isTouchNearby=function(e,t){return Math.abs(t.x-e.x)<=10&&Math.abs(t.y-e.y)<=10},t}(i.TouchHandlerStateBase);t.TouchHandlerDependencyState=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TouchHandlerZoomState=void 0;var r=n(0),i=n(19),o=n(4),s=n(3),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onTouchStart=function(e){},t.prototype.onDoubleTap=function(e){},t.prototype.onTouchEnd=function(e){this.prevDistance=null,this.handler.switchToDefaultState()},t.prototype.onTouchMove=function(e){if(e.stopPropagation(),e.preventDefault(),e.touches.length>1){var t=this.getTouchDistance(e);if(this.prevDistance){var n=this.prevDistance-t;if(Math.abs(n)>3){var r=this.getMiddleAbsPoint(e).x;n>0?this.handler.control.zoomOut(r):this.handler.control.zoomIn(r),this.prevDistance=t}}else this.prevDistance=t}},t.prototype.getTouchDistance=function(e){var t=new o.Point(e.touches[0].clientX,e.touches[0].clientY),n=new o.Point(e.touches[1].clientX,e.touches[1].clientY);return this.getDistance(t,n)},t.prototype.getDistance=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},t.prototype.getMiddleAbsPoint=function(e){var t=this;return this.getMiddlePointByEvent(e,(function(e){return new o.Point(e.pageX-s.DomUtils.getAbsolutePositionX(t.handler.control.taskAreaContainer.getElement()),e.pageY-s.DomUtils.getAbsolutePositionY(t.handler.control.taskAreaContainer.getElement()))}))},t.prototype.getMiddlePointByEvent=function(e,t){if(e.touches.length>1)return new o.Point((t(e.touches[0]).x+t(e.touches[1]).x)/2,(t(e.touches[0]).y+t(e.touches[1]).y)/2)},t}(i.HandlerStateBase);t.TouchHandlerZoomState=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskAreaContainer=void 0;var r=function(){function e(e,t){this.element=e,this.onScrollHandler=function(){t.updateView()},this.element.addEventListener("scroll",this.onScrollHandler)}return Object.defineProperty(e.prototype,"scrollTop",{get:function(){return this.element.scrollTop},set:function(e){this.element.scrollTop=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollLeft",{get:function(){return this.element.scrollLeft},set:function(e){this.element.scrollLeft=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollWidth",{get:function(){return this.element.scrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollHeight",{get:function(){return this.element.scrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isExternal",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.getWidth=function(){return this.element.offsetWidth},e.prototype.getHeight=function(){return this.element.offsetHeight},e.prototype.getElement=function(){return this.element},e.prototype.detachEvents=function(){this.element.removeEventListener("scroll",this.onScrollHandler)},e}();t.TaskAreaContainer=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelChangesDispatcher=void 0;var r=n(105),i=n(50),o=n(32),s=function(){function e(){this.onModelChanged=new r.EventDispatcher,this.isLocked=!1}return e.prototype.notifyTaskCreating=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskCreating",e)},e.prototype.notifyTaskCreated=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskCreated",e,t,n)},e.prototype.notifyTaskRemoving=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskRemoving",e)},e.prototype.notifyTaskRemoved=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskRemoved",e,t,n)},e.prototype.notifyTaskUpdating=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskUpdating",e)},e.prototype.notifyTaskMoving=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskMoving",e)},e.prototype.notifyTaskEditDialogShowing=function(e){this.isLocked||this.onModelChanged.raise("NotifyTaskEditDialogShowing",e)},e.prototype.notifyTaskTitleChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskTitleChanged",e,t,n)},e.prototype.notifyTaskDescriptionChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskDescriptionChanged",e,t,n)},e.prototype.notifyTaskStartChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskStartChanged",e,t,n)},e.prototype.notifyTaskEndChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskEndChanged",e,t,n)},e.prototype.notifyTaskProgressChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskProgressChanged",e,t,n)},e.prototype.notifyTaskColorChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyTaskColorChanged",e,t,n)},e.prototype.notifyDependencyInserting=function(e){this.isLocked||this.onModelChanged.raise("NotifyDependencyInserting",e)},e.prototype.notifyDependencyInserted=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyDependencyInserted",e,t,n)},e.prototype.notifyDependencyRemoving=function(e){this.isLocked||this.onModelChanged.raise("NotifyDependencyRemoving",e)},e.prototype.notifyDependencyRemoved=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyDependencyRemoved",e,t,n)},e.prototype.notifyResourceCreating=function(e){this.isLocked||this.onModelChanged.raise("NotifyResourceCreating",e)},e.prototype.notifyResourceCreated=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceCreated",e,t,n)},e.prototype.notifyResourceRemoving=function(e){this.isLocked||this.onModelChanged.raise("NotifyResourceRemoving",e)},e.prototype.notifyResourceRemoved=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceRemoved",e,t,n)},e.prototype.notifyResourceColorChanged=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceColorChanged",e,t,n)},e.prototype.notifyResourceAssigning=function(e){this.isLocked||this.onModelChanged.raise("NotifyResourceAssigning",e)},e.prototype.notifyResourceAssigned=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceAssigned",e,t,n)},e.prototype.notifyResourceUnassigning=function(e){this.isLocked||this.onModelChanged.raise("NotifyResourceUnassigning",e)},e.prototype.notifyResourceUnassigned=function(e,t,n){this.isLocked||this.onModelChanged.raise("NotifyResourceUnassigned",e,t,n)},e.prototype.notifyParentDataRecalculated=function(e){this.onModelChanged.raise("NotifyParentDataRecalculated",e)},e.prototype.fireResourceUnassigning=function(e){var t=new o.ResourceUnassigningArguments(e);return this.notifyResourceUnassigning(t),!t.cancel},e.prototype.raiseTaskTitleUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"title",t,n)},e.prototype.raiseTaskDescriptionUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"description",t,n)},e.prototype.raiseTaskProgressUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"progress",t,n)},e.prototype.raiseTaskColorUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"color",t,n)},e.prototype.raiseTaskStartUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"start",t,n)},e.prototype.raiseTaskEndUpdating=function(e,t,n){return this.raiseTaskUpdating(e,"end",t,n)},e.prototype.raiseTaskStartAndEndUpdating=function(e,t,n,r){var o=new i.TaskUpdatingArguments(e,["start","end"],[t,n]);return this.notifyTaskUpdating(o),!o.cancel&&(r(o.start,o.end),!0)},e.prototype.raiseTaskUpdating=function(e,t,n,r){var o=e[t];if(o!==n){var s=new i.TaskUpdatingArguments(e,[t],[n]);if(this.notifyTaskUpdating(s),!s.cancel&&o!==s[t])return r(s[t]),!0}return!1},e.prototype.raiseTaskMultipleUpdating=function(e,t,n){var r=["title","progress","start","end","color"],o=r.map((function(e){return t[e]})),s=new i.TaskUpdatingArguments(e,r,o);return this.notifyTaskUpdating(s),!s.cancel&&(n(s.newValues),!0)},e.prototype.raiseTaskMoving=function(e,t,n,r){var o=new i.TaskUpdatingArguments(e,["start","end"],[t,n]);return this.notifyTaskMoving(o),!o.cancel&&(r(o.start,o.end),!0)},e.prototype.raiseTaskTaskEditDialogShowing=function(e,t){var n=new i.TaskEditDialogShowingArguments(e);return this.notifyTaskEditDialogShowing(n),!n.cancel&&(t(n),!0)},e.prototype.lock=function(){this.isLocked=!0},e.prototype.unlock=function(){this.isLocked=!1},e}();t.ModelChangesDispatcher=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDispatcher=void 0;var r=function(){function e(){this.listeners=[]}return e.prototype.add=function(e){if(!e)throw new Error("Error");this.hasEventListener(e)||this.listeners.push(e)},e.prototype.remove=function(e){for(var t=0,n=void 0;n=this.listeners[t];t++)if(n===e){this.listeners.splice(t,1);break}},e.prototype.raise=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=void 0;i=this.listeners[r];r++){var o=i[e];null==o||o.apply(i,t)}},e.prototype.hasEventListener=function(e){for(var t=0,n=this.listeners.length;t<n;t++)if(this.listeners[t]===e)return!0;return!1},e}();t.EventDispatcher=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommandManager=void 0;var r=n(107),i=n(108),o=n(109),s=n(111),a=n(113),l=n(52),c=n(114),u=n(115),d=n(116),h=n(117),p=n(118),f=n(119),m=n(23),g=n(120),y=function(){function e(e){this.control=e,this.commands={},this.createCommand(u.GanttClientCommand.CreateTask,this.createTaskCommand),this.createCommand(u.GanttClientCommand.CreateSubTask,this.createSubTaskCommand),this.createCommand(u.GanttClientCommand.RemoveTask,this.removeTaskCommand),this.createCommand(u.GanttClientCommand.RemoveDependency,this.removeDependencyCommand),this.createCommand(u.GanttClientCommand.TaskInformation,this.showTaskEditDialog),this.createCommand(u.GanttClientCommand.TaskAddContextItem,new r.TaskAddContextItemCommand(this.control)),this.createCommand(u.GanttClientCommand.Undo,new d.UndoCommand(this.control)),this.createCommand(u.GanttClientCommand.Redo,new d.RedoCommand(this.control)),this.createCommand(u.GanttClientCommand.ZoomIn,new h.ZoomInCommand(this.control)),this.createCommand(u.GanttClientCommand.ZoomOut,new h.ZoomOutCommand(this.control)),this.createCommand(u.GanttClientCommand.FullScreen,new p.ToggleFullScreenCommand(this.control)),this.createCommand(u.GanttClientCommand.CollapseAll,new f.CollapseAllCommand(this.control)),this.createCommand(u.GanttClientCommand.ExpandAll,new f.ExpandAllCommand(this.control))}return Object.defineProperty(e.prototype,"createTaskCommand",{get:function(){return new r.CreateTaskCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createSubTaskCommand",{get:function(){return new r.CreateSubTaskCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"removeTaskCommand",{get:function(){return new r.RemoveTaskCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskTitleCommand",{get:function(){return new i.TaskTitleCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskDescriptionCommand",{get:function(){return new i.TaskDescriptionCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskProgressCommand",{get:function(){return new i.TaskProgressCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskColorCommand",{get:function(){return new i.TaskColorCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskStartCommand",{get:function(){return new i.TaskStartCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"taskMoveCommand",{get:function(){return new i.TaskMoveCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeTaskEndCommand",{get:function(){return new i.TaskEndCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateTaskCommand",{get:function(){return new r.UpdateTaskCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createDependencyCommand",{get:function(){return new o.CreateDependencyCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"removeDependencyCommand",{get:function(){return new o.RemoveDependencyCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createResourceCommand",{get:function(){return new s.CreateResourceCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"removeResourceCommand",{get:function(){return new s.RemoveResourceCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assignResourceCommand",{get:function(){return new s.AssignResourceCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deassignResourceCommand",{get:function(){return new s.DeassignResourceCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeResourceColorCommand",{get:function(){return new g.ResourceColorCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showTaskEditDialog",{get:function(){return new a.TaskEditDialogCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showConstraintViolationDialog",{get:function(){return new l.ConstraintViolationDialogCommand(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showConfirmationDialog",{get:function(){return new m.ConfirmationDialog(this.control)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showResourcesDialog",{get:function(){return new c.ResourcesDialogCommand(this.control)},enumerable:!1,configurable:!0}),e.prototype.getCommand=function(e){return this.commands[e]},e.prototype.createCommand=function(e,t){this.commands[e]=t},e}();t.CommandManager=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskAddContextItemCommand=t.UpdateTaskCommand=t.RemoveTaskCommand=t.CreateSubTaskCommand=t.CreateTaskCommand=t.TaskCommandBase=void 0;var r=n(0),i=n(7),o=n(51),s=n(21),a=n(22),l=n(23),c=n(50),u=n(25),d=n(1),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){var e=new i.SimpleCommandState(this.isEnabled());return e.visible=this.control.settings.editing.enabled&&!this.control.taskEditController.dependencyId,e},t}(i.CommandBase);t.TaskCommandBase=h;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t){return e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){var t;if(null!=e||(e={}),!e.parentId){var n=this.control.viewModel.findItem(this.control.currentSelectedTaskID),r=n&&n.task;r&&(e.parentId=r.parentId)}var i=this.control.viewModel.findItem(e.parentId)||this.control.viewModel.items[0],s=i&&i.task;e.start||(e.start=s?new Date(s.start.getTime()):new Date(this.control.range.start.getTime())),e.end||(e.end=s?new Date(s.end.getTime()):new Date(this.control.range.end.getTime())),null!==(t=e.title)&&void 0!==t||(e.title="New task");var a=new c.TaskInsertingArguments(null,e);return this.modelManipulator.dispatcher.notifyTaskCreating(a),a.cancel||this.history.addAndRedo(new o.CreateTaskHistoryItem(this.modelManipulator,a)),!a.cancel},t.prototype.getState=function(){var t=e.prototype.getState.call(this);return t.visible=t.visible&&this.control.settings.editing.allowTaskInsert,t},t}(h);t.CreateTaskCommand=p;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t){return e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){e=e||this.control.currentSelectedTaskID;var t=this.control.viewModel.findItem(e);if(t.selected){var n={start:new Date(t.task.start.getTime()),end:new Date(t.task.end.getTime()),title:"New task",progress:0,parentId:e},r=new c.TaskInsertingArguments(null,n);return this.modelManipulator.dispatcher.notifyTaskCreating(r),r.cancel||this.history.addAndRedo(new o.CreateTaskHistoryItem(this.modelManipulator,r)),!r.cancel}return!1},t.prototype.isEnabled=function(){var t=this.control,n=t.viewModel.findItem(t.currentSelectedTaskID);return e.prototype.isEnabled.call(this)&&!!n&&n.selected},t.prototype.getState=function(){var t=e.prototype.getState.call(this),n=this.control;return t.visible=t.visible&&n.settings.editing.allowTaskInsert,t},t}(h);t.CreateSubTaskCommand=f;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n,r){var i=this;return void 0===n&&(n=!0),n?(this.control.commandManager.showConfirmationDialog.execute(new l.ConfirmationDialogParameters(l.ConfirmationType.TaskDelete,(function(){i.executeInternal(t,r)}))),!1):e.prototype.execute.call(this,t,r)},t.prototype.executeInternal=function(e,n){var r=this;e=e||this.control.currentSelectedTaskID;var i=this.control.viewModel.findItem(e),l=i?i.task:this.control.viewModel.tasks.getItemById(e),u=new c.TaskRemovingArguments(l);if(this.modelManipulator.dispatcher.notifyTaskRemoving(u),u.cancel)return!1;this.control.viewModel.beginUpdate();var d=n||new o.RemoveTaskHistoryItem(this.modelManipulator);d.addTask(e);var h=this.control.viewModel.tasks.items.filter((function(t){return t.parentId==e}));h.forEach((function(e){return new t(r.control).execute(e.internalId,!1,d)}));var p=i&&i.parent,f=this.control.viewModel.dependencies.items.filter((function(t){return t.predecessorId==e||t.successorId==e}));if(f.length){if(!this.control.settings.editing.allowDependencyDelete)return!1;(f=f.filter((function(e){return 0==h.filter((function(t){return t.internalId==e.predecessorId||t.internalId==e.successorId})).length}))).forEach((function(e){return d.add(new s.RemoveDependencyHistoryItem(r.modelManipulator,e.internalId))}))}return this.control.viewModel.assignments.items.filter((function(t){return t.taskId==e})).forEach((function(e){r.modelManipulator.dispatcher.fireResourceUnassigning(e)&&d.add(new a.DeassignResourceHistoryItem(r.modelManipulator,e.internalId))})),n||this.history.addAndRedo(d),this.updateParent(p),this.control.viewModel.endUpdate(),!0},t.prototype.updateParent=function(e){e&&e.children.length>0&&this.control.validationController.updateParentsIfRequired(e.children[0].task.internalId)},t.prototype.isEnabled=function(){var t=this.control,n=t.viewModel.findItem(t.currentSelectedTaskID);return e.prototype.isEnabled.call(this)&&!!n&&n.selected},t.prototype.getState=function(){var t=e.prototype.getState.call(this),n=this.control;return t.visible=t.visible&&n.settings.editing.allowTaskDelete,t},t}(h);t.RemoveTaskCommand=m;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this.control.viewModel.tasks.getItemById(e);if(!n)return!1;var r=this.control.modelManipulator.dispatcher.raiseTaskMultipleUpdating(n,t,(function(e){t.title=e.title,t.progress=e.progress,t.start=e.start,t.end=e.end,t.color=e.color}));if(r){this.history.beginTransaction();var i=!1;d.isDefined(t.title)&&t.title!==n.title&&this.history.addAndRedo(new u.TaskTitleHistoryItem(this.modelManipulator,e,t.title)),d.isDefined(t.progress)&&t.progress!==n.progress&&(this.history.addAndRedo(new u.TaskProgressHistoryItem(this.modelManipulator,e,t.progress)),i=!0),d.isDefined(t.start)&&d.isDefined(t.end)&&t.end.getTime()<t.start.getTime()&&(t.end=t.start),d.isDefined(t.start)&&t.start!==n.start&&(this.history.addAndRedo(new u.TaskStartHistoryItem(this.modelManipulator,e,t.start)),i=!0,this.control.settings.validation.validateDependencies&&this.control.validationController.moveStartDependTasks(e,n.start)),d.isDefined(t.end)&&t.end!==n.end&&(this.history.addAndRedo(new u.TaskEndHistoryItem(this.modelManipulator,e,t.end)),i=!0,this.control.settings.validation.validateDependencies&&this.control.validationController.moveEndDependTasks(e,n.end)),d.isDefined(t.color)&&t.color!==n.color&&this.history.addAndRedo(new u.TaskColorHistoryItem(this.modelManipulator,e,t.color)),i?this.validationController.updateParentsIfRequired(e):this.control.updateOwnerInAutoParentMode(),this.history.endTransaction()}return r},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowTaskUpdate},t}(h);t.UpdateTaskCommand=g;var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){var t=e.prototype.getState.call(this);return t.visible=t.visible&&this.control.settings.editing.allowTaskInsert,t},t.prototype.execute=function(){return!1},t}(h);t.TaskAddContextItemCommand=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskMoveCommand=t.TaskEndCommand=t.TaskStartCommand=t.TaskPropertyCommandValidation=t.TaskColorCommand=t.TaskProgressCommand=t.TaskDescriptionCommand=t.TaskTitleCommand=t.TaskPropertyCommandBase=void 0;var r=n(0),i=n(7),o=n(25),s=n(52),a=n(9),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowTaskUpdate},t.prototype.getTask=function(e){return this.control.viewModel.tasks.getItemById(e)},t}(i.CommandBase);t.TaskPropertyCommandBase=l;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this;return this.modelManipulator.dispatcher.raiseTaskTitleUpdating(this.getTask(e),t,(function(t){n.history.addAndRedo(new o.TaskTitleHistoryItem(n.modelManipulator,e,t))}))},t}(l);t.TaskTitleCommand=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this;return this.modelManipulator.dispatcher.raiseTaskDescriptionUpdating(this.getTask(e),t,(function(t){n.history.addAndRedo(new o.TaskDescriptionHistoryItem(n.modelManipulator,e,t))}))},t}(l);t.TaskDescriptionCommand=u;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this;return this.modelManipulator.dispatcher.raiseTaskProgressUpdating(this.getTask(e),t,(function(t){n.control.history.beginTransaction(),n.history.addAndRedo(new o.TaskProgressHistoryItem(n.modelManipulator,e,t)),n.validationController.updateParentsIfRequired(e),n.control.history.endTransaction()}))},t}(l);t.TaskProgressCommand=d;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){var n=this;return this.modelManipulator.dispatcher.raiseTaskColorUpdating(this.getTask(e),t,(function(t){n.history.addAndRedo(new o.TaskColorHistoryItem(n.modelManipulator,e,t))}))},t}(l);t.TaskColorCommand=h;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.executeInternal=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this.control.settings.validation.validateDependencies?this.validate.apply(this,t):[],i=r.filter((function(e){return e.critical}));return!r.length||r.length>1&&0===i.length?this.executeCore.apply(this,t):(1===r.length&&this.control.commandManager.showConstraintViolationDialog.execute(new s.ConstraintViolationDialogParameters(r[0],(function(){e.executeCore.apply(e,t)}))),!1)},t.prototype.executeCore=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!1},t.prototype.validate=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return[]},t}(l);t.TaskPropertyCommandValidation=p;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return this.modelManipulator.dispatcher.raiseTaskStartUpdating(this.getTask(t),n,(function(e){n=e}))&&e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(t,n){return e.prototype.executeInternal.call(this,t,n)},t.prototype.executeCore=function(e,t){var n=this.control.viewModel.tasks.getItemById(e).start;if(n.getTime()==t.getTime())return!1;this.control.history.beginTransaction(),this.history.addAndRedo(new o.TaskStartHistoryItem(this.modelManipulator,e,t)),this.control.settings.validation.validateDependencies&&this.control.validationController.moveStartDependTasks(e,n),this.validationController.updateParentsIfRequired(e),this.control.history.endTransaction();var r=this.control.viewModel.tasks.items.reduce((function(e,t){return t.isValid()?e.isValid()&&e.start.getTime()<t.start.getTime()?e:t:e}));return r.start<this.control.dataRange.start&&(this.control.dataRange.start=r.start,this.control.resetAndUpdate()),!0},t.prototype.validate=function(e,t){return this.control.validationController.checkStartDependencies(e,t)},t}(p);t.TaskStartCommand=f;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return this.modelManipulator.dispatcher.raiseTaskEndUpdating(this.getTask(t),n,(function(e){n=e}))&&e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(t,n){return e.prototype.executeInternal.call(this,t,n)},t.prototype.executeCore=function(e,t){var n=this.control.viewModel.tasks.getItemById(e).end;if(n.getTime()==t.getTime())return!1;this.control.history.beginTransaction(),this.history.addAndRedo(new o.TaskEndHistoryItem(this.modelManipulator,e,t)),this.control.settings.validation.validateDependencies&&this.control.validationController.moveEndDependTasks(e,n),this.validationController.updateParentsIfRequired(e),this.control.history.endTransaction();var r=this.control.viewModel.tasks.items.reduce((function(e,t){return t.isValid()?e.end.getTime()>t.end.getTime()?e:t:e}));return r.end>this.control.dataRange.end&&(this.control.dataRange.end=r.end,this.control.resetAndUpdate()),!0},t.prototype.validate=function(e,t){return this.control.validationController.checkEndDependencies(e,t)},t}(p);t.TaskEndCommand=m;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n,r){return this.modelManipulator.dispatcher.raiseTaskStartAndEndUpdating(this.getTask(t),n,r,(function(e,t){n=e,r=t}))&&e.prototype.execute.call(this,t,n,r)},t.prototype.executeInternal=function(t,n,r){return e.prototype.executeInternal.call(this,t,n,r)},t.prototype.executeCore=function(e,t,n){var r=this.control.viewModel.tasks.getItemById(e),i=new a.DateRange(new Date(r.start.getTime()),new Date(r.end.getTime()));this.control.history.beginTransaction(),this.history.addAndRedo(new o.TaskMoveHistoryItem(this.modelManipulator,e,new a.DateRange(t,n))),this.validationController.correctOnMoving(e,t.getTime()-i.start.getTime()),this.control.settings.validation.validateDependencies&&(this.control.validationController.moveStartDependTasks(e,i.start),this.control.validationController.moveEndDependTasks(e,i.end)),this.control.history.endTransaction();var s=this.control.viewModel.tasks.items.reduce((function(e,t){return t.isValid()?e.end.getTime()>t.end.getTime()?e:t:e}));s.end>this.control.dataRange.end&&(this.control.dataRange.end=s.end,this.control.resetAndUpdate());var l=this.control.viewModel.tasks.items.reduce((function(e,t){return t.isValid()?e.isValid()&&e.start.getTime()<t.start.getTime()?e:t:e}));return l.start<this.control.dataRange.start&&(this.control.dataRange.start=l.start,this.control.resetAndUpdate()),!0},t.prototype.validate=function(e,t,n){var i=this.control.validationController.checkStartDependencies(e,t),o=this.control.validationController.checkEndDependencies(e,n);return r.__spreadArray(r.__spreadArray([],i),o)},t}(p);t.TaskMoveCommand=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoveDependencyCommand=t.CreateDependencyCommand=t.DependencyCommandBase=void 0;var r=n(0),i=n(7),o=n(21),s=n(11),a=n(23),l=n(110),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t}(i.CommandBase);t.DependencyCommandBase=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n,r){return e.prototype.execute.call(this,t,n,r)},t.prototype.executeInternal=function(e,t,n){if(this.control.viewModel.dependencies.items.filter((function(n){return n.predecessorId==e&&n.successorId==t||n.successorId==e&&n.predecessorId==t})).length)return!1;var r=new l.DependencyInsertingArguments(e,t,n);if(this.modelManipulator.dispatcher.notifyDependencyInserting(r),r.cancel)return!1;if(e=r.predecessorId,t=r.successorId,n=r.type,this.control.history.beginTransaction(),this.history.addAndRedo(new o.InsertDependencyHistoryItem(this.modelManipulator,e,t,n)),this.control.settings.validation.validateDependencies){var i=this.control.viewModel.tasks.getItemById(e);n===s.DependencyType.SF||n===s.DependencyType.SS?this.control.validationController.moveStartDependTasks(e,i.start):this.control.validationController.moveEndDependTasks(e,i.end)}return this.control.history.endTransaction(),!0},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowDependencyInsert},t}(c);t.CreateDependencyCommand=u;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){var r=this;return void 0===n&&(n=!0),n?(this.control.commandManager.showConfirmationDialog.execute(new a.ConfirmationDialogParameters(a.ConfirmationType.DependencyDelete,(function(){r.executeInternal(t)}))),!1):e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){if(null!=(e=e||this.control.taskEditController.dependencyId)){var t=this.control.viewModel.dependencies.items.filter((function(t){return t.internalId==e}))[0];if(t){var n=new l.DependencyRemovingArguments(t);if(this.modelManipulator.dispatcher.notifyDependencyRemoving(n),!n.cancel)return this.history.addAndRedo(new o.RemoveDependencyHistoryItem(this.modelManipulator,e)),e===this.control.taskEditController.dependencyId&&this.control.taskEditController.selectDependency(null),this.control.barManager.updateItemsState([]),!0}}return!1},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowDependencyDelete},t.prototype.getState=function(){var t=e.prototype.getState.call(this);return t.visible=t.enabled&&null!=this.control.taskEditController.dependencyId,t},t}(c);t.RemoveDependencyCommand=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DependencyRemovingArguments=t.DependencyInsertingArguments=void 0;var r=n(0),i=n(20),o=function(e){function t(t,n,r){var i=e.call(this,null)||this;return i.values={predecessorId:t,successorId:n,type:r},i}return r.__extends(t,e),Object.defineProperty(t.prototype,"predecessorId",{get:function(){return this.values.predecessorId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"successorId",{get:function(){return this.values.successorId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.values.type},enumerable:!1,configurable:!0}),t}(i.BaseArguments);t.DependencyInsertingArguments=o;var s=function(e){function t(t){var n=e.call(this,t.id)||this;return n.values=t,n}return r.__extends(t,e),t}(i.BaseArguments);t.DependencyRemovingArguments=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeassignResourceCommand=t.AssignResourceCommand=t.RemoveResourceCommand=t.CreateResourceCommand=t.ResourceCommandBase=void 0;var r=n(0),i=n(7),o=n(22),s=n(112),a=n(32),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t}(i.CommandBase);t.ResourceCommandBase=l;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n,r){return void 0===n&&(n=""),e.prototype.execute.call(this,t,n,r)},t.prototype.executeInternal=function(e,t,n){void 0===t&&(t="");var r=new s.ResourceInsertingArguments(e,t);return this.modelManipulator.dispatcher.notifyResourceCreating(r),r.cancel||this.history.addAndRedo(new o.CreateResourceHistoryItem(this.modelManipulator,r.text,r.color,n)),!r.cancel},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowResourceInsert},t}(l);t.CreateResourceCommand=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t){return e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){var t=this,n=this.control.viewModel.resources.items.filter((function(t){return t.internalId==e}))[0];if(n){var r=new s.ResourceRemovingArguments(n);if(this.modelManipulator.dispatcher.notifyResourceRemoving(r),!r.cancel){var i=new o.RemoveResourceHistoryItem(this.modelManipulator,e);return this.control.viewModel.assignments.items.filter((function(t){return t.resourceId==e})).forEach((function(e){t.modelManipulator.dispatcher.fireResourceUnassigning(e)&&i.add(new o.DeassignResourceHistoryItem(t.modelManipulator,e.internalId))})),this.history.addAndRedo(i),!0}}return!1},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowResourceDelete},t}(l);t.RemoveResourceCommand=u;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){if(!this.control.viewModel.assignments.items.filter((function(n){return n.resourceId==e&&n.taskId==t}))[0]){var n=this.control.viewModel,r=new a.ResourceAssigningArguments(n.convertInternalToPublicKey("resource",e),n.convertInternalToPublicKey("task",t));if(this.modelManipulator.dispatcher.notifyResourceAssigning(r),!r.cancel)return this.history.addAndRedo(new o.AssignResourceHistoryItem(this.modelManipulator,n.convertPublicToInternalKey("resource",r.resourceId),n.convertPublicToInternalKey("task",r.taskId))),!0}return!1},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowTaskResourceUpdate},t}(l);t.AssignResourceCommand=d;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t){return e.prototype.execute.call(this,t)},t.prototype.executeInternal=function(e){var t=this.control.viewModel.assignments.items.filter((function(t){return t.internalId==e}))[0];return!(!t||!this.modelManipulator.dispatcher.fireResourceUnassigning(t))&&(this.history.addAndRedo(new o.DeassignResourceHistoryItem(this.modelManipulator,e)),!0)},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowTaskResourceUpdate},t}(l);t.DeassignResourceCommand=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceRemovingArguments=t.ResourceInsertingArguments=void 0;var r=n(0),i=n(20),o=function(e){function t(t,n){void 0===n&&(n="");var r=e.call(this,null)||this;return r.values={text:t,color:n},r}return r.__extends(t,e),Object.defineProperty(t.prototype,"text",{get:function(){return this.values.text},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.values.color},enumerable:!1,configurable:!0}),t}(i.BaseArguments);t.ResourceInsertingArguments=o;var s=function(e){function t(t){var n=e.call(this,t.id)||this;return n.values=t,n}return r.__extends(t,e),t}(i.BaseArguments);t.ResourceRemovingArguments=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskEditParameters=t.TaskEditDialogCommand=void 0;var r=n(0),i=n(24),o=n(25),s=n(26),a=n(22),l=n(32),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.onBeforeDialogShow=function(e){return this.modelManipulator.dispatcher.raiseTaskTaskEditDialogShowing(e,(function(t){var n=t.values;e.start=n.start,e.end=n.end,e.progress=n.progress,e.title=n.title,e.readOnlyFields=t.readOnlyFields,e.hiddenFields=t.hiddenFields}))},t.prototype.applyParameters=function(e,t){this.history.beginTransaction();var n=this.control.modelManipulator.dispatcher.raiseTaskMultipleUpdating(this.control.viewModel.tasks.getItemById(t.id),e,(function(t){e.title=t.title?t.title:"",e.progress=t.progress,e.start="string"==typeof t.start?new Date(t.start):t.start||new Date(0),e.end="string"==typeof t.end?new Date(t.end):t.end||new Date(0)}));n&&(e.title!==t.title&&this.history.addAndRedo(new o.TaskTitleHistoryItem(this.modelManipulator,t.id,e.title)),e.progress!==t.progress&&this.history.addAndRedo(new o.TaskProgressHistoryItem(this.modelManipulator,t.id,e.progress)),e.end.getTime()<e.start.getTime()&&(e.end=e.start),e.start!==t.start&&(this.history.addAndRedo(new o.TaskStartHistoryItem(this.modelManipulator,t.id,e.start)),this.control.settings.validation.validateDependencies&&this.control.validationController.moveStartDependTasks(t.id,t.start)),e.end!==t.end&&(this.history.addAndRedo(new o.TaskEndHistoryItem(this.modelManipulator,t.id,e.end)),this.control.settings.validation.validateDependencies&&this.control.validationController.moveEndDependTasks(t.id,t.end)));for(var r=0;r<e.assigned.length;r++){if(!t.assigned.getItemById(e.assigned.getItem(r).internalId)){var i=e.assigned.getItem(r).internalId,s=t.id,c=new l.ResourceAssigningArguments(i,s);this.modelManipulator.dispatcher.notifyResourceAssigning(c),c.cancel||this.history.addAndRedo(new a.AssignResourceHistoryItem(this.modelManipulator,c.resourceId,c.taskId))}}var u=function(n){var r=t.assigned.getItem(n);if(!e.assigned.getItemById(r.internalId)){var i=d.control.viewModel.assignments.items.filter((function(e){return e.resourceId==r.internalId&&e.taskId==t.id}))[0];d.modelManipulator.dispatcher.fireResourceUnassigning(i)&&d.history.addAndRedo(new a.DeassignResourceHistoryItem(d.modelManipulator,i.internalId))}},d=this;for(r=0;r<t.assigned.length;r++)u(r);var h=e.start!==t.start||e.end!==t.end||e.progress!==t.progress||e.title!==t.title;return n&&h&&this.validationController.updateParentsIfRequired(t.id),this.history.endTransaction(),!1},t.prototype.createParameters=function(e){e=e||this.control.viewModel.tasks.getItemById(this.control.currentSelectedTaskID);var t=new u;return t.id=e.internalId,t.title=e.title,t.progress=e.progress,t.start=e.start,t.end=e.end,t.assigned=this.control.viewModel.getAssignedResources(e),t.resources=new s.ResourceCollection,t.resources.addRange(this.control.viewModel.resources.items),t.showResourcesDialogCommand=this.control.commandManager.showResourcesDialog,t.showTaskEditDialogCommand=this.control.commandManager.showTaskEditDialog,t.enableEdit=this.isTaskEditEnabled(),t.enableRangeEdit=this.isTaskRangeEditEnabled(e),t},t.prototype.isTaskEditEnabled=function(){var e=this.control.settings;return e.editing.enabled&&e.editing.allowTaskUpdate},t.prototype.isTaskRangeEditEnabled=function(e){return!this.control.viewModel.isTaskToCalculateByChildren(e.internalId)},t.prototype.isEnabled=function(){var e=this.control,t=e.viewModel.findItem(e.currentSelectedTaskID);return!!t&&t.selected},t.prototype.getState=function(){var t=e.prototype.getState.call(this);return t.visible=t.visible&&!this.control.taskEditController.dependencyId,t},t.prototype.getDialogName=function(){return"TaskEdit"},t}(i.DialogBase);t.TaskEditDialogCommand=c;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enableEdit=!0,t.enableRangeEdit=!0,t.hiddenFields=[],t.readOnlyFields=[],t}return r.__extends(t,e),t.prototype.clone=function(){var e=new t;return e.id=this.id,e.title=this.title,e.progress=this.progress,e.start=this.start,e.end=this.end,e.assigned=new s.ResourceCollection,e.assigned.addRange(this.assigned.items),e.resources=new s.ResourceCollection,e.resources.addRange(this.resources.items),e.showResourcesDialogCommand=this.showResourcesDialogCommand,e.showTaskEditDialogCommand=this.showTaskEditDialogCommand,e.enableEdit=this.enableEdit,e.enableRangeEdit=this.enableRangeEdit,e.hiddenFields=this.hiddenFields.slice(),e.readOnlyFields=this.readOnlyFields.slice(),e},t}(i.DialogParametersBase);t.TaskEditParameters=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesDialogParameters=t.ResourcesDialogCommand=void 0;var r=n(0),i=n(24),o=n(26),s=n(23),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resourcesForDelete=[],t}return r.__extends(t,e),t.prototype.applyParameters=function(e,t){this.history.beginTransaction();for(var n=0;n<e.resources.length;n++){t.resources.getItemById(e.resources.getItem(n).internalId)||this.control.commandManager.createResourceCommand.execute(e.resources.getItem(n).text)}for(n=0;n<t.resources.length;n++){e.resources.getItemById(t.resources.getItem(n).internalId)||this.resourcesForDelete.push(t.resources.getItem(n))}return this.history.endTransaction(),!1},t.prototype.createParameters=function(e){this.callBack=e;var t=new l;return t.resources=new o.ResourceCollection,t.resources.addRange(this.control.viewModel.resources.items),t},t.prototype.afterClosing=function(){var e=this;if(this.resourcesForDelete.length){var t=this.control.commandManager.showConfirmationDialog,n=new s.ConfirmationDialogParameters(s.ConfirmationType.ResourcesDelete,(function(){e.history.beginTransaction();for(var t=0;t<e.resourcesForDelete.length;t++)e.control.commandManager.removeResourceCommand.execute(e.resourcesForDelete[t].internalId);e.history.endTransaction()}));n.message=this.resourcesForDelete.reduce((function(e,t){return r.__spreadArray(r.__spreadArray([],e),[t.text])}),[]).join(", "),this.callBack&&(t.afterClosing=function(){return e.callBack()}),t.execute(n)}else this.callBack&&this.callBack()},t.prototype.getDialogName=function(){return"Resources"},t}(i.DialogBase);t.ResourcesDialogCommand=a;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.clone=function(){var e=new t;return e.resources=new o.ResourceCollection,e.resources.addRange(this.resources.items),e},t}(i.DialogParametersBase);t.ResourcesDialogParameters=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GanttClientCommand=void 0,function(e){e[e.CreateTask=0]="CreateTask",e[e.CreateSubTask=1]="CreateSubTask",e[e.RemoveTask=2]="RemoveTask",e[e.RemoveDependency=3]="RemoveDependency",e[e.TaskInformation=4]="TaskInformation",e[e.TaskAddContextItem=5]="TaskAddContextItem",e[e.Undo=6]="Undo",e[e.Redo=7]="Redo",e[e.ZoomIn=8]="ZoomIn",e[e.ZoomOut=9]="ZoomOut",e[e.FullScreen=10]="FullScreen",e[e.CollapseAll=11]="CollapseAll",e[e.ExpandAll=12]="ExpandAll"}(t.GanttClientCommand||(t.GanttClientCommand={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RedoCommand=t.UndoCommand=void 0;var r=n(0),i=n(7),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){var e=new i.SimpleCommandState(this.isEnabled());return e.visible=this.control.settings.editing.enabled,e},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.history.undo(),!0},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.history.canUndo()},t}(i.CommandBase);t.UndoCommand=o;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){var e=new i.SimpleCommandState(this.isEnabled());return e.visible=this.control.settings.editing.enabled,e},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.history.redo(),!0},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.history.canRedo()},t}(i.CommandBase);t.RedoCommand=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZoomOutCommand=t.ZoomInCommand=void 0;var r=n(0),i=n(7),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(!0)},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.zoomIn(),!0},t}(i.CommandBase);t.ZoomInCommand=o;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(!0)},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.zoomOut(),!0},t}(i.CommandBase);t.ZoomOutCommand=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToggleFullScreenCommand=void 0;var r=n(0),i=n(7),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isInFullScreenMode=!1,t.fullScreenTempVars={},t}return r.__extends(t,e),t.prototype.getState=function(){var e=new i.SimpleCommandState(!0);return e.value=this.control.fullScreenModeHelper.isInFullScreenMode,e},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.fullScreenModeHelper.toggle(),!0},t}(i.CommandBase);t.ToggleFullScreenCommand=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpandAllCommand=t.CollapseAllCommand=void 0;var r=n(0),i=n(7),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.ganttOwner.collapseAll(),!0},t.prototype.isEnabled=function(){return!0},t}(i.CommandBase);t.CollapseAllCommand=o;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t.prototype.execute=function(){return e.prototype.execute.call(this)},t.prototype.executeInternal=function(){return this.control.ganttOwner.expandAll(),!0},t.prototype.isEnabled=function(){return!0},t}(i.CommandBase);t.ExpandAllCommand=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceColorCommand=t.ResourcePropertyCommandBase=void 0;var r=n(0),i=n(7),o=n(121),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getState=function(){return new i.SimpleCommandState(this.isEnabled())},t.prototype.isEnabled=function(){return e.prototype.isEnabled.call(this)&&this.control.settings.editing.allowResourceUpdate},t}(i.CommandBase);t.ResourcePropertyCommandBase=s;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.execute=function(t,n){return e.prototype.execute.call(this,t,n)},t.prototype.executeInternal=function(e,t){return this.control.viewModel.resources.getItemById(e).color!=t&&(this.history.addAndRedo(new o.ResourceColorHistoryItem(this.modelManipulator,e,t)),!0)},t}(s);t.ResourceColorCommand=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceColorHistoryItem=t.ResourcePropertiesHistoryItemBase=void 0;var r=n(0),i=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.resourceId=n,i.newValue=r,i}return r.__extends(t,e),t.prototype.redo=function(){this.oldState=this.getPropertiesManipulator().setValue(this.resourceId,this.newValue)},t.prototype.undo=function(){this.getPropertiesManipulator().restoreValue(this.oldState)},t.prototype.getPropertiesManipulator=function(){throw new Error("Not Implemented")},t}(n(12).HistoryItem);t.ResourcePropertiesHistoryItemBase=i;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.getPropertiesManipulator=function(){return this.modelManipulator.resource.properties.color},t}(i);t.ResourceColorHistoryItem=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BarManager=void 0;var r=function(){function e(e,t){this.control=e,this.bars=t}return e.prototype.updateContextMenu=function(){for(var e=0,t=void 0;t=this.bars[e];e++)if(t.isContextMenu()){t.updateItemsList();for(var n=t.getCommandKeys(),r=0;r<n.length;r++)this.updateBarItem(t,n[r])}},e.prototype.updateItemsState=function(e){for(var t=!!e.length,n=function(n,i){if(i.isVisible()){for(var o=i.getCommandKeys(),s=function(n){if(t&&!e.filter((function(e){return e==o[n]})).length)return"continue";r.updateBarItem(i,o[n])},a=0;a<o.length;a++)s(a);i.completeUpdate()}},r=this,i=0,o=void 0;o=this.bars[i];i++)n(0,o)},e.prototype.updateBarItem=function(e,t){var n=this.control.commandManager.getCommand(t);if(n){var r=n.getState();e.setItemVisible(t,r.visible),r.visible&&(e.setItemEnabled(t,r.enabled),e.setItemValue(t,r.value))}},e}();t.BarManager=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationController=t.ValidationError=void 0;var r=n(0),i=n(11),o=n(25),s=n(9),a=n(2),l=n(1),c=function(e,t){void 0===t&&(t=!1),this.dependencyId=e,this.critical=t};t.ValidationError=c;var u=function(){function e(e){this.gantt=e}return Object.defineProperty(e.prototype,"viewModel",{get:function(){return this.gantt.viewModel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"history",{get:function(){return this.gantt.history},enumerable:!1,configurable:!0}),e.prototype.checkStartDependencies=function(e,t){var n=this,r=[],o=this.gantt.viewModel.tasks.getItemById(e);return this.viewModel.dependencies.items.filter((function(t){return t.successorId==e})).forEach((function(e){var s=n.gantt.viewModel.tasks.getItemById(e.predecessorId);(e.type==i.DependencyType.FS&&s.end>t||e.type==i.DependencyType.SS&&s.start>t)&&r.push(new c(e.internalId,!0)),(e.type==i.DependencyType.FS&&s.end.valueOf()==o.start.valueOf()&&t>s.end||e.type==i.DependencyType.SS&&s.start.valueOf()==o.start.valueOf()&&t>s.start)&&r.push(new c(e.internalId))})),r},e.prototype.checkEndDependencies=function(e,t){var n=this,r=[],o=this.gantt.viewModel.tasks.getItemById(e);return this.viewModel.dependencies.items.filter((function(t){return t.successorId==e})).forEach((function(e){var s=n.gantt.viewModel.tasks.getItemById(e.predecessorId);(e.type==i.DependencyType.SF&&s.start>t||e.type==i.DependencyType.FF&&s.end>t)&&r.push(new c(e.internalId,!0)),(e.type==i.DependencyType.SF&&s.start.valueOf()==o.end.valueOf()&&t>s.start||e.type==i.DependencyType.FF&&s.end.valueOf()==o.end.valueOf()&&t>s.end)&&r.push(new c(e.internalId))})),r},e.prototype.moveEndDependTasks=function(e,t){var n=this;this.viewModel.dependencies.items.filter((function(t){return t.predecessorId==e})).forEach((function(r){var a=n.gantt.viewModel.tasks.getItemById(e),l=n.gantt.viewModel.tasks.getItemById(r.successorId),c=new s.DateRange(new Date(l.start.getTime()),new Date(l.end.getTime())),u=new s.DateRange(new Date,new Date);if(r.type==i.DependencyType.FS&&(l.start<a.end||l.start.valueOf()===t.valueOf()&&l.start>a.end)){if(u.start.setTime(a.end.getTime()),u.end.setTime(u.start.getTime()+(l.end.getTime()-l.start.getTime())),n.correctMoving(l.internalId,u),n.history.addAndRedo(new o.TaskMoveHistoryItem(n.gantt.modelManipulator,r.successorId,u)),n._parentAutoCalc){var d=u.start.getTime()-c.start.getTime();n.correctOnMoving(l.internalId,d)}n.moveStartDependTasks(r.successorId,c.start),n.moveEndDependTasks(r.successorId,c.end)}if(r.type==i.DependencyType.FF&&(l.end<a.end||l.end.valueOf()===t.valueOf()&&l.end>a.end)){if(u.start.setTime(a.end.getTime()-(l.end.getTime()-l.start.getTime())),u.end.setTime(a.end.getTime()),n.correctMoving(l.internalId,u),n.history.addAndRedo(new o.TaskMoveHistoryItem(n.gantt.modelManipulator,r.successorId,u)),n._parentAutoCalc){d=u.start.getTime()-c.start.getTime();n.correctOnMoving(l.internalId,d)}n.moveStartDependTasks(r.successorId,c.start),n.moveEndDependTasks(r.successorId,c.end)}}))},e.prototype.moveStartDependTasks=function(e,t){var n=this;this.viewModel.dependencies.items.filter((function(t){return t.predecessorId==e})).forEach((function(r){var a=n.gantt.viewModel.tasks.getItemById(e),l=n.gantt.viewModel.tasks.getItemById(r.successorId),c=new s.DateRange(new Date(l.start.getTime()),new Date(l.end.getTime())),u=new s.DateRange(new Date,new Date);if(r.type==i.DependencyType.SF&&(l.end<a.start||l.end.valueOf()===t.valueOf()&&l.end>a.start)){if(u.start.setTime(a.start.getTime()-(l.end.getTime()-l.start.getTime())),u.end.setTime(a.start.getTime()),n.correctMoving(l.internalId,u),n.history.addAndRedo(new o.TaskMoveHistoryItem(n.gantt.modelManipulator,r.successorId,u)),n._parentAutoCalc){var d=u.start.getTime()-c.start.getTime();n.correctOnMoving(l.internalId,d)}n.moveStartDependTasks(r.successorId,c.start),n.moveEndDependTasks(r.successorId,c.end)}if(r.type==i.DependencyType.SS&&(l.start<a.start||l.start.valueOf()===t.valueOf()&&l.start>a.start)){if(u.start.setTime(a.start.getTime()),u.end.setTime(a.start.getTime()+(l.end.getTime()-l.start.getTime())),n.correctMoving(l.internalId,u),n.history.addAndRedo(new o.TaskMoveHistoryItem(n.gantt.modelManipulator,r.successorId,u)),n._parentAutoCalc){d=u.start.getTime()-c.start.getTime();n.correctOnMoving(l.internalId,d)}n.moveStartDependTasks(r.successorId,c.start),n.moveEndDependTasks(r.successorId,c.end)}}))},e.prototype.correctMoving=function(e,t){var n=this,o=t.end.getTime()-t.start.getTime();return r.__spreadArray(r.__spreadArray([],this.checkStartDependencies(e,t.start)),this.checkEndDependencies(e,t.end)).filter((function(e){return e.critical})).forEach((function(e){var r=n.gantt.viewModel.dependencies.getItemById(e.dependencyId),s=n.gantt.viewModel.tasks.getItemById(r.predecessorId);r.type==i.DependencyType.FS&&t.start<s.end&&(t.start.setTime(s.end.getTime()),t.end.setTime(t.start.getTime()+o)),r.type==i.DependencyType.SS&&t.start<s.start&&(t.start.setTime(s.start.getTime()),t.end.setTime(t.start.getTime()+o)),r.type==i.DependencyType.FF&&t.end<s.end&&(t.end.setTime(s.end.getTime()),t.start.setTime(t.end.getTime()-o)),r.type==i.DependencyType.SF&&t.end<s.start&&(t.end.setTime(s.start.getTime()),t.start.setTime(t.end.getTime()-o))})),t},e.prototype.recalculateParents=function(e,t){for(var n=e&&e.parent;n&&n.task;){for(var r=n.children,i=this.gantt.range.end,o=this.gantt.range.start,s=0,l=0,c={id:n.task.internalId},u=0;u<r.length;u++){var d=r[u].task;if(d.isValid()){i=a.DateTimeUtils.getMinDate(i,d.start),o=a.DateTimeUtils.getMaxDate(o,d.end);var h=d.getDuration();s+=d.progress*h,l+=h}}a.DateTimeUtils.areDatesEqual(n.task.start,i)||(c.start=i),a.DateTimeUtils.areDatesEqual(n.task.end,o)||(c.end=o),(s=Math.ceil(s/l))!==n.task.progress&&(c.progress=s),t(c),n=n.parent}},e.prototype.updateParentsRangeByChild=function(e){var t=this;this.recalculateParents(this.viewModel.findItem(e),(function(e){if(l.isDefined(e.id)){var n=t.history,r=t.gantt.modelManipulator;l.isDefined(e.start)&&n.addAndRedo(new o.TaskStartHistoryItem(r,e.id,e.start)),l.isDefined(e.end)&&n.addAndRedo(new o.TaskEndHistoryItem(r,e.id,e.end)),l.isDefined(e.progress)&&n.addAndRedo(new o.TaskProgressHistoryItem(r,e.id,e.progress))}}))},e.prototype.updateChildRangeByParent=function(e,t,n){var r=this.viewModel.findItem(e);if(r&&0!==r.children.length)for(var i=r.children,s=0;s<i.length;s++){var a=i[s].task,l=new Date(a.start.getTime()+t),c=new Date(a.end.getTime()+t);n.push({id:a.internalId,start:a.start,end:a.end}),l<a.end?(this.history.addAndRedo(new o.TaskStartHistoryItem(this.gantt.modelManipulator,a.internalId,l)),this.history.addAndRedo(new o.TaskEndHistoryItem(this.gantt.modelManipulator,a.internalId,c))):(this.history.addAndRedo(new o.TaskEndHistoryItem(this.gantt.modelManipulator,a.internalId,c)),this.history.addAndRedo(new o.TaskStartHistoryItem(this.gantt.modelManipulator,a.internalId,l))),this.updateChildRangeByParent(a.internalId,t,n)}},e.prototype.updateParentsIfRequired=function(e){this._parentAutoCalc&&(this.updateParentsRangeByChild(e),this.gantt.updateOwnerInAutoParentMode())},e.prototype.correctOnMoving=function(e,t){var n=this;if(this._parentAutoCalc&&0!==t){this.updateParentsRangeByChild(e);var r=[];this.updateChildRangeByParent(e,t,r),this.gantt.settings.validation.validateDependencies&&r.forEach((function(e){n.moveStartDependTasks(e.id,e.start),n.moveEndDependTasks(e.id,e.end)})),this.gantt.updateOwnerInAutoParentMode()}},Object.defineProperty(e.prototype,"_parentAutoCalc",{get:function(){return this.viewModel.parentAutoCalc},enumerable:!1,configurable:!0}),e}();t.ValidationController=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FullScreenModeHelper=void 0;var r=n(5),i=n(125),o=n(3),s=function(){function e(e){this._isInFullScreenMode=!1,this.fullScreenTempVars={},this.gantt=e}return Object.defineProperty(e.prototype,"isInFullScreenMode",{get:function(){return this._isInFullScreenMode},enumerable:!1,configurable:!0}),e.prototype.toggle=function(){return this._isInFullScreenMode=!this._isInFullScreenMode,this._isInFullScreenMode?this.setFullScreenMode():this.setNormalMode(),!0},e.prototype.setFullScreenMode=function(){this.prepareFullScreenMode(),this.adjustControlInFullScreenMode()},e.prototype.prepareFullScreenMode=function(){var e=this.getMainElement();i.AttrUtils.changeElementStyleAttribute(e,"border-top-width","0px"),i.AttrUtils.changeElementStyleAttribute(e,"border-left-width","0px"),i.AttrUtils.changeElementStyleAttribute(e,"border-right-width","0px"),i.AttrUtils.changeElementStyleAttribute(e,"border-bottom-width","0px"),this.fullScreenTempVars.scrollTop=o.DomUtils.getDocumentScrollTop(),this.fullScreenTempVars.scrollLeft=o.DomUtils.getDocumentScrollLeft(),i.AttrUtils.changeElementStyleAttribute(e,"background-color","white"),i.AttrUtils.changeElementStyleAttribute(e,"position","fixed"),i.AttrUtils.changeElementStyleAttribute(e,"top","0px"),i.AttrUtils.changeElementStyleAttribute(e,"left","0px"),i.AttrUtils.changeElementStyleAttribute(e,"z-index","1010"),i.AttrUtils.changeElementStyleAttribute(document.documentElement,"position","static"),i.AttrUtils.changeElementStyleAttribute(document.documentElement,"overflow","hidden"),this.fullScreenTempVars.bodyMargin=document.body.style.margin,document.body.style.margin="0",this.fullScreenTempVars.width=e.style.width,this.fullScreenTempVars.height=e.style.height||e.clientHeight,window.self!==window.top&&this.requestFullScreen(document.body)},e.prototype.setNormalMode=function(){this.cancelFullScreen(document);var e=this.getMainElement();i.AttrUtils.restoreElementStyleAttribute(e,"left"),i.AttrUtils.restoreElementStyleAttribute(e,"top"),i.AttrUtils.restoreElementStyleAttribute(e,"background-color"),i.AttrUtils.restoreElementStyleAttribute(document.documentElement,"overflow"),i.AttrUtils.restoreElementStyleAttribute(document.documentElement,"position"),i.AttrUtils.restoreElementStyleAttribute(e,"z-index"),document.body.style.margin=this.fullScreenTempVars.bodyMargin,i.AttrUtils.restoreElementStyleAttribute(e,"position"),i.AttrUtils.restoreElementStyleAttribute(e,"border-top-width"),i.AttrUtils.restoreElementStyleAttribute(e,"border-left-width"),i.AttrUtils.restoreElementStyleAttribute(e,"border-right-width"),i.AttrUtils.restoreElementStyleAttribute(e,"border-bottom-width"),this.setHeight(this.fullScreenTempVars.height),this.setWidth(this.fullScreenTempVars.width),document.documentElement.scrollTop=this.fullScreenTempVars.scrollTop,document.documentElement.scrollLeft=this.fullScreenTempVars.scrollLeft,this.adjustControl()},e.prototype.adjustControlInFullScreenMode=function(){var e=0==document.documentElement.clientWidth?document.body.clientWidth:document.documentElement.clientWidth,t=0==document.documentElement.clientHeight?document.body.clientHeight:document.documentElement.clientHeight;this.setWidth(e),this.setHeight(t),this.adjustControl()},e.prototype.requestFullScreen=function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()},e.prototype.cancelFullScreen=function(e){r.Browser.Firefox&&!this.getFullScreenElement(e)||(e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen?e.msExitFullscreen():e.exitFullscreen&&e.exitFullscreen())},e.prototype.getFullScreenElement=function(e){return e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement},e.prototype.setWidth=function(e){this.getMainElement().style.width=this.isNumber(e)?e+"px":e},e.prototype.setHeight=function(e){this.getMainElement().style.height=this.isNumber(e)?e+"px":e},e.prototype.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},e.prototype.getMainElement=function(){return this.gantt.getOwnerControlMainElement()},e.prototype.adjustControl=function(){this.gantt.adjustOwnerControl()},e}();t.FullScreenModeHelper=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=function(){function e(){}return e.setElementAttribute=function(e,t,n){e.setAttribute&&(r.Browser.IE&&r.Browser.MajorVersion>=11&&"src"===t.toLowerCase()&&e.setAttribute(t,""),e.setAttribute(t,n))},e.setStyleAttribute=function(e,t,n){e.setProperty&&e.setProperty(t,n,"")},e.getElementAttribute=function(e,t){return e.getAttribute(t)},e.getStyleAttribute=function(e,t){if(e.getPropertyValue){if(r.Browser.Firefox)try{return e.getPropertyValue(t)}catch(n){return e[t]}return e.getPropertyValue(t)}return null},e.removeElementAttribute=function(e,t){e.removeAttribute&&e.removeAttribute(t)},e.removeStyleAttribute=function(e,t){e.removeProperty&&e.removeProperty(t)},e.changeElementStyleAttribute=function(t,n,r){e.saveStyleAttributeInElement(t,n),e.setStyleAttribute(t.style,n,r)},e.restoreElementStyleAttribute=function(t,n){var r="saved"+n,i=t.style;if(e.isExistsAttributeInElement(t,r)){var o=e.getElementAttribute(t,r);return o===e.emptyObject||null===o?e.removeStyleAttribute(i,n):e.setStyleAttribute(i,n,o),e.removeElementAttribute(t,r),!0}return!1},e.saveStyleAttributeInElement=function(t,n){var r="saved"+n,i=t.style;if(!e.isExistsAttributeInElement(t,r)){var o=e.getStyleAttribute(i,n);e.setElementAttribute(t,r,e.isAttributeExists(o)?o:e.emptyObject)}},e.isExistsAttributeInElement=function(t,n){var r=e.getElementAttribute(t,n);return e.isAttributeExists(r)},e.isAttributeExists=function(e){return null!==e&&""!==e},e.emptyObject="DxEmptyValue",e}();t.AttrUtils=i}])}));
|