jetsum_dhtmlx_gantt
Version:
An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.
1 lines • 666 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("dhtmlxgantt",[],e):"object"==typeof exports?exports.dhtmlxgantt=e():t.dhtmlxgantt=e()}(window,function(){return i={},r.m=n=[function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i,a=n(2),o={}.constructor.toString();t.exports={copy:function t(e){var n,i;if(e&&"object"==r(e))switch(!0){case a.isDate(e):i=new Date(e);break;case a.isArray(e):for(i=new Array(e.length),n=0;n<e.length;n++)i[n]=t(e[n]);break;default:for(n in i=e.constructor.toString()!==o?Object.create(e):{},e)Object.prototype.hasOwnProperty.apply(e,[n])&&(i[n]=t(e[n]))}return i||e},defined:function(t){return void 0!==t},mixin:function(t,e,n){for(var i in e)void 0!==t[i]&&!n||(t[i]=e[i]);return t},uid:function(){return i=i||(new Date).valueOf(),++i},bind:function(t,e){return t.bind?t.bind(e):function(){return t.apply(e,arguments)}},event:function(t,e,n,i){t.addEventListener?t.addEventListener(e,n,void 0!==i&&i):t.attachEvent&&t.attachEvent("on"+e,n)},eventRemove:function(t,e,n,i){t.removeEventListener?t.removeEventListener(e,n,void 0!==i&&i):t.detachEvent&&t.detachEvent("on"+e,n)}}},function(t,e){function r(t){var e=0,n=0,i=0,r=0;if(t.getBoundingClientRect)var a=t.getBoundingClientRect(),o=document.body,s=document.documentElement||document.body.parentNode||document.body,l=window.pageYOffset||s.scrollTop||o.scrollTop,c=window.pageXOffset||s.scrollLeft||o.scrollLeft,u=s.clientTop||o.clientTop||0,o=s.clientLeft||o.clientLeft||0,e=a.top+l-u,n=a.left+c-o,i=document.body.offsetWidth-a.right,r=document.body.offsetHeight-a.bottom;else{for(;t;)e+=parseInt(t.offsetTop,10),n+=parseInt(t.offsetLeft,10),t=t.offsetParent;i=document.body.offsetWidth-t.offsetWidth-n,r=document.body.offsetHeight-t.offsetHeight-e}return{y:Math.round(e),x:Math.round(n),width:t.offsetWidth,height:t.offsetHeight,right:Math.round(i),bottom:Math.round(r)}}function s(t){if(!t)return"";t=t.className||"";return t.baseVal&&(t=t.baseVal),t.indexOf||(t=""),c(t)}var n;function l(t){var e;return t.tagName?e=t:(e=(t=t||window.event).target||t.srcElement).shadowRoot&&t.composedPath&&(e=t.composedPath()[0]),e}function c(t){return(String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")}).apply(t)}function i(){return document.head.createShadowRoot||document.head.attachShadow}function a(t){if(!t)return document.body;if(!i())return document.body;for(;t.parentNode&&(t=t.parentNode);)if(t instanceof ShadowRoot)return t.host;return document.body}t.exports={getNodePosition:r,getFocusableNodes:function(t){for(var e,n,i,t=t.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),r=Array.prototype.slice.call(t,0),a=0;a<r.length;a++)r[a].$position=a;for(r.sort(function(t,e){return 0===t.tabIndex&&0!==e.tabIndex?1:0!==t.tabIndex&&0===e.tabIndex?-1:t.tabIndex===e.tabIndex?t.$position-e.$position:t.tabIndex<e.tabIndex?-1:1}),a=0;a<r.length;a++){var o=r[a];i=o,(!isNaN(i.getAttribute("tabindex"))&&0<=+i.getAttribute("tabindex")||(!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[(n=o).nodeName.toLowerCase()]||!n.hasAttribute("disabled"))||(!{a:!0,area:!0}[(e=o).nodeName.loLowerCase()]||e.getAttribute("href")))&&(i=o,o=e=n=void 0,o=e=!1,window.getComputedStyle?(e=(n=window.getComputedStyle(i,null)).display,o=n.visibility):i.currentStyle&&(e=i.currentStyle.display,o=i.currentStyle.visibility),"none"!=e&&"hidden"!=o)||(r.splice(a,1),a--)}return r},getScrollSize:function(){var t=document.createElement("div");t.style.cssText="visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e},getClassName:s,addClassName:function(t,e){e&&-1===t.className.indexOf(e)&&(t.className+=" "+e)},removeClassName:function(t,e){e=e.split(" ");for(var n=0;n<e.length;n++){var i=new RegExp("\\s?\\b"+e[n]+"\\b(?![-_.])","");t.className=t.className.replace(i,"")}},insertNode:function(t,e){(n=n||document.createElement("div")).innerHTML=e;e=n.firstChild;return t.appendChild(e),e},removeNode:function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},getChildNodes:function(t,e){for(var n=t.childNodes,i=n.length,r=[],a=0;a<i;a++){var o=n[a];o.className&&-1!==o.className.indexOf(e)&&r.push(o)}return r},toNode:function(t){return"string"==typeof t?document.getElementById(t)||document.querySelector(t)||document.body:t||document.body},locateClassName:function(t,e,n){var i=l(t),r="";for(void 0===n&&(n=!0);i;){if(r=s(i)){var a=r.indexOf(e);if(0<=a){if(!n)return i;var o=0===a||!c(r.charAt(a-1)),a=a+e.length>=r.length||!c(r.charAt(a+e.length));if(o&&a)return i}}i=i.parentNode}return null},locateAttribute:function(t,e){if(e){for(var n=l(t);n;){if(n.getAttribute&&n.getAttribute(e))return n;n=n.parentNode}return null}},getTargetNode:l,getRelativeEventPosition:function(t,e){var n=document.documentElement,i=r(e);return{x:t.clientX+n.scrollLeft-n.clientLeft-i.x+e.scrollLeft,y:t.clientY+n.scrollTop-n.clientTop-i.y+e.scrollTop}},isChildOf:function(t,e){if(!t||!e)return!1;for(;t&&t!=e;)t=t.parentNode;return t===e},hasClass:function(t,e){return"classList"in t?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)},closest:function(t,e){if(t.closest)return t.closest(e);if(t.matches||t.msMatchesSelector||t.webkitMatchesSelector){var n=t;if(!document.documentElement.contains(n))return null;do{if((n.matches||n.msMatchesSelector||n.webkitMatchesSelector).call(n,e))return n}while(null!==(n=n.parentElement||n.parentNode)&&1===n.nodeType);return null}return console.error("Your browser is not supported"),null},getRootNode:a,hasShadowParent:function(t){return!!a(t)},isShadowDomSupported:i,getActiveElement:function(){var t=document.activeElement;return t.shadowRoot&&(t=t.shadowRoot.activeElement),t===document.body&&document.getSelection&&(t=document.getSelection().focusNode||document.body),t}}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i={second:1,minute:60,hour:3600,day:86400,week:604800,month:2592e3,quarter:7776e3,year:31536e3};function r(t){return!(!t||"object"!==n(t)||!(t.getFullYear&&t.getMonth&&t.getDate))}function a(t,e){var n=[];if(t.filter)return t.filter(e);for(var i=0;i<t.length;i++)e(t[i],i)&&(n[n.length]=t[i]);return n}function o(t){return 0===t}t.exports={getSecondsInUnit:function(t){return i[t]||i.hour},forEach:function(t,e){if(t.forEach)t.forEach(e);else for(var n=t.slice(),i=0;i<n.length;i++)e(n[i],i)},arrayMap:function(t,e){if(t.map)return t.map(e);for(var n=t.slice(),i=[],r=0;r<n.length;r++)i.push(e(n[r],r));return i},arrayIncludes:function(t,e){if(t.includes)return t.includes(e);for(var n=0;n<t.length;n++)if(t[n]===e)return!0;return!1},arrayFind:function(t,e){if(t.find)return t.find(e);for(var n=0;n<t.length;n++)if(e(t[n],n))return t[n]},arrayFilter:a,arrayDifference:function(t,n){return a(t,function(t,e){return!n(t,e)})},arraySome:function(t,e){if(0===t.length)return!1;for(var n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},hashToArray:function(t){var e,n=[];for(e in t)t.hasOwnProperty(e)&&n.push(t[e]);return n},sortArrayOfHash:function(t,n,i){t.sort(function(t,e){return t[n]===e[n]?0:i?t[n]<e[n]:e[n]<t[n]})},throttle:function(t,e){var n=!1;return function(){n||(t.apply(null,arguments),n=!0,setTimeout(function(){n=!1},e))}},isArray:function(t){return Array.isArray?Array.isArray(t):t&&void 0!==t.length&&t.pop&&t.push},isDate:r,isValidDate:function(t){return r(t)&&!isNaN(t.getTime())},isStringObject:function(t){return t&&"object"===n(t)&&"function String() { [native code] }"===Function.prototype.toString.call(t.constructor)},isNumberObject:function(t){return t&&"object"===n(t)&&"function Number() { [native code] }"===Function.prototype.toString.call(t.constructor)},isBooleanObject:function(t){return t&&"object"===n(t)&&"function Boolean() { [native code] }"===Function.prototype.toString.call(t.constructor)},delay:function(e,n){function i(){i.$cancelTimeout(),i.$pending=!0;var t=Array.prototype.slice.call(arguments);r=setTimeout(function(){e.apply(this,t),i.$pending=!1},n)}var r;return i.$pending=!1,i.$cancelTimeout=function(){clearTimeout(r),i.$pending=!1},i.$execute=function(){var t=Array.prototype.slice.call(arguments);e.apply(this,t),i.$cancelTimeout()},i},objectKeys:function(t){if(Object.keys)return Object.keys(t);var e,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},isEventable:function(t){return t.attachEvent&&t.detachEvent},replaceValidZeroId:function(t,e){return 0===t&&0!==e&&(t="0"),t},checkZeroId:o,findBinary:function(t,e){for(var n,i,r,a=0,o=t.length-1;a<=o;)if(i=+t[n=Math.floor((a+o)/2)],r=+t[n-1],i<e)a=n+1;else{if(!(e<i)){for(;+t[n]==+t[n+1];)n++;return n}if(!isNaN(r)&&r<e)return n-1;o=n-1}return t.length-1}}},function(t,e){t.exports=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}},function(t,e){function n(){this._silent_mode=!1,this.listeners={}}n.prototype={_silentStart:function(){this._silent_mode=!0},_silentEnd:function(){this._silent_mode=!1}};function i(i){function r(){var t,e=!0;for(t in a)var n=a[t].apply(i,arguments),e=e&&n;return e}var a={},o=0;return r.addEvent=function(t,e){return"function"==typeof t&&(e&&e.id?n=e.id:(n=o,o++),e&&e.once&&(i=t,t=function(){i(),r.removeEvent(n)}),a[n]=t,n);var n,i},r.removeEvent=function(t){delete a[t]},r.clear=function(){a={}},r}t.exports=function(t){var a=new n;t.attachEvent=function(t,e,n){t="ev_"+t.toLowerCase(),a.listeners[t]||(a.listeners[t]=i(this)),n&&n.thisObject&&(e=e.bind(n.thisObject));e=t+":"+a.listeners[t].addEvent(e,n);return n&&n.id&&(e=n.id),e},t.attachAll=function(t){this.attachEvent("listen_all",t)},t.callEvent=function(t,e){if(a._silent_mode)return!0;var n="ev_"+t.toLowerCase(),i=a.listeners;return i.ev_listen_all&&i.ev_listen_all.apply(this,[t].concat(e)),!i[n]||i[n].apply(this,e)},t.checkEvent=function(t){return!!a.listeners["ev_"+t.toLowerCase()]},t.detachEvent=function(t){if(t){for(var e in r=a.listeners)r[e].removeEvent(t);var n,i=t.split(":"),r=a.listeners;2===i.length&&(n=i[0],i=i[1],r[n]&&r[n].removeEvent(i))}},t.detachAllEvents=function(){for(var t in a.listeners)a.listeners[t].clear()}}},function(t,e){function n(){console.log("Method is not implemented.")}function i(){}i.prototype.render=n,i.prototype.set_value=n,i.prototype.get_value=n,i.prototype.focus=n,t.exports=function(t){return i}},function(t,e){t.exports=function(t,e,n,i,r){var a=e.getItemIndexByTopPosition(r.y)||0,r=e.getItemIndexByTopPosition(r.y_end)||i.count();return{start:Math.max(0,a-1),end:Math.min(i.count(),r+1)}}},function(t,e){var n="undefined"!=typeof window,n={isIE:n&&(0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Trident")),isIE6:n&&!XMLHttpRequest&&0<=navigator.userAgent.indexOf("MSIE"),isIE7:n&&0<=navigator.userAgent.indexOf("MSIE 7.0")&&navigator.userAgent.indexOf("Trident")<0,isIE8:n&&0<=navigator.userAgent.indexOf("MSIE 8.0")&&0<=navigator.userAgent.indexOf("Trident"),isOpera:n&&0<=navigator.userAgent.indexOf("Opera"),isChrome:n&&0<=navigator.userAgent.indexOf("Chrome"),isKHTML:n&&(0<=navigator.userAgent.indexOf("Safari")||0<=navigator.userAgent.indexOf("Konqueror")),isFF:n&&0<=navigator.userAgent.indexOf("Firefox"),isIPad:n&&0<=navigator.userAgent.search(/iPad/gi),isEdge:n&&-1!=navigator.userAgent.indexOf("Edge"),isNode:!n||"undefined"==typeof navigator};t.exports=n},function(t,e){t.exports=function(t){function e(){}return e.prototype={show:function(t,e,n,i){},hide:function(){},set_value:function(t,e,n,i){this.get_input(i).value=t},get_value:function(t,e,n){return this.get_input(n).value||""},is_changed:function(t,e,n,i){i=this.get_value(e,n,i);return i&&t&&i.valueOf&&t.valueOf?i.valueOf()!=t.valueOf():i!=t},is_valid:function(t,e,n,i){return!0},save:function(t,e,n){},get_input:function(t){return t.querySelector("input")},focus:function(t){t=this.get_input(t);t&&(t.focus&&t.focus(),t.select&&t.select())}},e}},function(t,e,n){var r=n(0),a=n(4),o=n(1),n=function(){"use strict";function t(t,e,n,i){t&&(this.$container=o.toNode(t),this.$parent=t),this.$config=r.mixin(e,{headerHeight:33}),this.$gantt=i,this.$domEvents=i._createDomEventScope(),this.$id=e.id||"c"+r.uid(),this.$name="cell",this.$factory=n,a(this)}return t.prototype.destructor=function(){this.$parent=this.$container=this.$view=null,this.$gantt.$services.getService("mouseEvents").detach("click","gantt_header_arrow",this._headerClickHandler),this.$domEvents.detachAll(),this.callEvent("onDestroy",[]),this.detachAllEvents()},t.prototype.cell=function(t){return null},t.prototype.scrollTo=function(t,e){var n=this.$view;this.$config.html&&(n=this.$view.firstChild),+t==t&&(n.scrollLeft=t),+e==e&&(n.scrollTop=e)},t.prototype.clear=function(){this.getNode().innerHTML="",this.getNode().className="gantt_layout_content",this.getNode().style.padding="0"},t.prototype.resize=function(t){if(this.$parent)return this.$parent.resize(t);!1===t&&(this.$preResize=!0);var e=this.$container,n=e.offsetWidth,i=e.offsetHeight,t=this.getSize();e===document.body&&(n=document.body.offsetWidth,i=document.body.offsetHeight),n<t.minWidth&&(n=t.minWidth),n>t.maxWidth&&(n=t.maxWidth),i<t.minHeight&&(i=t.minHeight),i>t.maxHeight&&(i=t.maxHeight),this.setSize(n,i),this.$preResize,this.$preResize=!1},t.prototype.hide=function(){this._hide(!0),this.resize()},t.prototype.show=function(t){this._hide(!1),t&&this.$parent&&this.$parent.show(),this.resize()},t.prototype._hide=function(t){var e;!0===t&&this.$view.parentNode?this.$view.parentNode.removeChild(this.$view):!1!==t||this.$view.parentNode||(e=this.$parent.cellIndex(this.$id),this.$parent.moveView(this,e)),this.$config.hidden=t},t.prototype.$toHTML=function(t,e){void 0===t&&(t=""),e=[e||"",this.$config.css||""].join(" ");var n=this.$config,i="";return n.raw?t="string"==typeof n.raw?n.raw:"":(t=t||"<div class='gantt_layout_content' "+(e?" class='"+e+"' ":"")+" >"+(n.html||"")+"</div>",n.header&&(i="<div class='gantt_layout_header'>"+(n.canCollapse?"<div class='gantt_layout_header_arrow'></div>":"")+"<div class='gantt_layout_header_content'>"+n.header+"</div></div>")),"<div class='gantt_layout_cell "+e+"' data-cell-id='"+this.$id+"'>"+i+t+"</div>"},t.prototype.$fill=function(t,e){this.$view=t,this.$parent=e,this.init()},t.prototype.getNode=function(){return this.$view.querySelector("gantt_layout_cell")||this.$view},t.prototype.init=function(){var e=this;this._headerClickHandler=function(t){o.locateAttribute(t,"data-cell-id")==e.$id&&e.toggle()},this.$gantt.$services.getService("mouseEvents").delegate("click","gantt_header_arrow",this._headerClickHandler),this.callEvent("onReady",[])},t.prototype.toggle=function(){this.$config.collapsed=!this.$config.collapsed,this.resize()},t.prototype.getSize=function(){var t,e={height:this.$config.height||0,width:this.$config.width||0,gravity:this.$config.gravity||1,minHeight:this.$config.minHeight||0,minWidth:this.$config.minWidth||0,maxHeight:this.$config.maxHeight||1e11,maxWidth:this.$config.maxWidth||1e11};return this.$config.collapsed&&(e[(t="x"===this.$config.mode)?"width":"height"]=e[t?"maxWidth":"maxHeight"]=this.$config.headerHeight),e},t.prototype.getContentSize=function(){var t=this.$lastSize.contentX;t!==+t&&(t=this.$lastSize.width);var e=this.$lastSize.contentY;return e!==+e&&(e=this.$lastSize.height),{width:t,height:e}},t.prototype._getBorderSizes=function(){var t={top:0,right:0,bottom:0,left:0,horizontal:0,vertical:0};return this._currentBorders&&(this._currentBorders[this._borders.left]&&(t.left=1,t.horizontal++),this._currentBorders[this._borders.right]&&(t.right=1,t.horizontal++),this._currentBorders[this._borders.top]&&(t.top=1,t.vertical++),this._currentBorders[this._borders.bottom]&&(t.bottom=1,t.vertical++)),t},t.prototype.setSize=function(t,e){this.$view.style.width=t+"px",this.$view.style.height=e+"px";var n=this._getBorderSizes(),i=e-n.vertical,n=t-n.horizontal;this.$lastSize={x:t,y:e,contentX:n,contentY:i},this.$config.header?this._sizeHeader():this._sizeContent()},t.prototype._borders={left:"gantt_layout_cell_border_left",right:"gantt_layout_cell_border_right",top:"gantt_layout_cell_border_top",bottom:"gantt_layout_cell_border_bottom"},t.prototype._setBorders=function(t,e){var n=(e=e||this).$view;for(r in this._borders)o.removeClassName(n,this._borders[r]);"string"==typeof t&&(t=[t]);for(var i={},r=0;r<t.length;r++)o.addClassName(n,t[r]),i[t[r]]=!0;e._currentBorders=i},t.prototype._sizeContent=function(){var t=this.$view.childNodes[0];t&&"gantt_layout_content"==t.className&&(t.style.height=this.$lastSize.contentY+"px")},t.prototype._sizeHeader=function(){var t=this.$lastSize;t.contentY-=this.$config.headerHeight;var e,n=this.$view.childNodes[0],i=this.$view.childNodes[1],r="x"===this.$config.mode;this.$config.collapsed?(i.style.display="none",r?(n.className="gantt_layout_header collapsed_x",n.style.width=t.y+"px",e=Math.floor(t.y/2-t.x/2),n.style.transform="rotate(90deg) translate("+e+"px, "+e+"px)",i.style.display="none"):n.className="gantt_layout_header collapsed_y"):(n.className=r?"gantt_layout_header":"gantt_layout_header vertical",n.style.width="auto",n.style.transform="",i.style.display="",i.style.height=t.contentY+"px"),n.style.height=this.$config.headerHeight+"px"},t}();t.exports=n},function(t,e,n){var i=n(7);t.exports=function(t){return i.isNode||!t.$root}},function(t,e){t.exports=function(t,e,n,i){return!!((i=e?e.config:i)&&i.placeholder_task&&n.exists(t))&&n.getItem(t).type===i.types.placeholder}},function(e,t,n){(function(t){t="undefined"!=typeof window?window:t;e.exports=t}).call(this,n(14))},function(t,e){t.exports=function(t){return t.config.smart_rendering&&t._smart_render}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(i=window)}t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=(r.Create=function(t){var e=new r;if(t)for(var n in e)void 0!==t[n]&&(e[n]=t[n]);return e},r);function r(){this.link=null,this.task=null,this.start_date=null,this.end_date=null,this.latestStart=null,this.earliestStart=null,this.earliestEnd=null,this.latestEnd=null,this.latestSchedulingStart=null,this.earliestSchedulingStart=null,this.latestSchedulingEnd=null,this.earliestSchedulingEnd=null,this.kind="asap",this.conflict=!1}e.TaskPlan=i},function(t,e,n){var a=n(2),n={getHtmlSelect:function(t,e,n){var i="",r=this;return t=t||[],a.forEach(t,function(t){var e=[{key:"value",value:t.key}];n==t.key&&(e[e.length]={key:"selected",value:"selected"}),t.attributes&&(e=e.concat(t.attributes)),i+=r.getHtmlOption({innerHTML:t.label},e)}),o("select",{innerHTML:i},e)},getHtmlOption:function(t,e){return o("option",t,e)},getHtmlButton:function(t,e){return o("button",t,e)},getHtmlDiv:function(t,e){return o("div",t,e)},getHtmlLabel:function(t,e){return o("label",t,e)},getHtmlInput:function(t){return"<input"+i(t||[])+">"}};function o(t,e,n){return e=e||[],"<"+t+i(n||[])+">"+(e.innerHTML||"")+"</"+t+">"}function i(t){var e="";return a.forEach(t,function(t){e+=" "+t.key+"='"+t.value+"'"}),e}t.exports=n},function(t,e,i){var r=i(3),a=i(16);t.exports=function(e){var t=i(5)(e);function n(){return t.apply(this,arguments)||this}return r(n,t),n.prototype.render=function(t){var e="<div class='gantt_cal_ltext' style='height:"+(t.height||"23")+"px;'>";return(e+=a.getHtmlSelect(t.options,[{key:"style",value:"width:100%;"}]))+"</div>"},n.prototype.set_value=function(t,e,n,i){t=t.firstChild;!t._dhx_onchange&&i.onchange&&(t.onchange=i.onchange,t._dhx_onchange=!0),void 0===e&&(e=(t.options[0]||{}).value),t.value=e||""},n.prototype.get_value=function(t){return t.firstChild.value},n.prototype.focus=function(t){t=t.firstChild;e._focus(t,!0)},n}},function(t,e,n){var i=n(0);t.exports={createDropTargetObject:function(t){var e={targetParent:null,targetIndex:0,targetId:null,child:!1,nextSibling:!1,prevSibling:!1};return t&&i.mixin(e,t,!0),e},nextSiblingTarget:function(t,e,n){var i=this.createDropTargetObject();return i.targetId=e,i.nextSibling=!0,i.targetParent=n.getParent(i.targetId),i.targetIndex=n.getBranchIndex(i.targetId),(n.getParent(t)!=i.targetParent||i.targetIndex<n.getBranchIndex(t))&&(i.targetIndex+=1),i},prevSiblingTarget:function(t,e,n){var i=this.createDropTargetObject();return i.targetId=e,i.prevSibling=!0,i.targetParent=n.getParent(i.targetId),i.targetIndex=n.getBranchIndex(i.targetId),n.getParent(t)==i.targetParent&&i.targetIndex>n.getBranchIndex(t)&&--i.targetIndex,i},firstChildTarget:function(t,e,n){var i=this.createDropTargetObject();return i.targetId=e,i.targetParent=i.targetId,i.targetIndex=0,i.child=!0,i},lastChildTarget:function(t,e,n){var i=n.getChildren(e),n=this.createDropTargetObject();return n.targetId=i[i.length-1],n.targetParent=e,n.targetIndex=i.length,n.nextSibling=!0,n}}},function(t,e,n){var a=n(13);t.exports=function(t,e,n,i){var r=e.width[t];if(r<=0)return!1;if(!i.config.smart_rendering||a(i))return!0;i=e.left[t]-r,r=e.left[t]+r;return i<=n.x_end&&r>=n.x}},function(t,e){t.exports=function(t,e){var n=0,i=t.left.length-1;if(e)for(var r=0;r<t.left.length;r++){var a=t.left[r];if(a<e.x&&(n=r),a>e.x_end){i=r;break}}return{start:n,end:i}}},function(t,e){t.exports=function(t,e,n){return{top:e.getItemTop(t.id),height:e.getItemHeight(t.id),left:0,right:1/0}}},function(t,e){t.exports=function(p){function a(t,o,e){if(!p._isAllowedUnscheduledTask(t)&&p._isTaskInTimelineLimits(t)){var n=o.getItemPosition(t),i=e,r=o.$getTemplates(),a=p.getTaskType(t.type),s=o.getBarHeight(t.id,a==i.types.milestone),l=0;a==i.types.milestone&&(l=(s-n.height)/2);var c=Math.floor((o.getItemHeight(t.id)-s)/2);a==i.types.milestone&&(n.left-=Math.round(s/2),n.width=s);var u=document.createElement("div"),d=Math.round(n.width);o.$config.item_attribute&&(u.setAttribute(o.$config.item_attribute,t.id),u.setAttribute(o.$config.bind+"_id",t.id)),i.show_progress&&a!=i.types.milestone&&function(t,e,n,i,r){var a=+t.progress||0;n=Math.max(n-2,0);var o=document.createElement("div"),a=Math.round(n*a),a=Math.min(n,a);t.progressColor&&(o.style.backgroundColor=t.progressColor,o.style.opacity=1),o.style.width=a+"px",o.className="gantt_task_progress",o.innerHTML=r.progress_text(t.start_date,t.end_date,t),i.rtl&&(o.style.position="absolute",o.style.right="0px"),(r=document.createElement("div")).className="gantt_task_progress_wrapper",r.appendChild(o),e.appendChild(r),p.config.drag_progress&&!p.isReadonly(t)&&(r=document.createElement("div"),t=a,i.rtl&&(t=n-a),r.style.left=t+"px",r.className="gantt_task_progress_drag",o.appendChild(r),e.appendChild(r))}(t,u,d,i,r);e=(f=t,_=d,g=r,e=document.createElement("div"),p.getTaskType(f.type)!=p.config.types.milestone?e.innerHTML=g.task_text(f.start_date,f.end_date,f):p.getTaskType(f.type)==p.config.types.milestone&&_&&(e.style.height=e.style.width=_+"px"),e.className="gantt_task_content",e);t.textColor&&(e.style.color=t.textColor),u.appendChild(e);e=function(t,e){var n=o.$getConfig(),i=["gantt_task_line"];t&&i.push(t);var r=p.getState(),a=p.getTask(e);return p.getTaskType(a.type)==n.types.milestone?i.push("gantt_milestone"):p.getTaskType(a.type)==n.types.project&&i.push("gantt_project"),i.push("gantt_bar_"+p.getTaskType(a.type)),p.isSummaryTask(a)&&i.push("gantt_dependent_task"),p.isSplitTask(a)&&(n.open_split_tasks&&!a.$open||!n.open_split_tasks)&&i.push("gantt_split_parent"),n.select_task&&p.isSelectedTask(e)&&i.push("gantt_selected"),e==r.drag_id&&(i.push("gantt_drag_"+r.drag_mode),r.touch_drag&&i.push("gantt_touch_"+r.drag_mode)),r.link_source_id==e&&i.push("gantt_link_source"),r.link_target_id==e&&i.push("gantt_link_target"),n.highlight_critical_path&&p.isCriticalTask&&p.isCriticalTask(a)&&i.push("gantt_critical_task"),r.link_landing_area&&r.link_target_id&&r.link_source_id&&r.link_target_id!=r.link_source_id&&(r.link_target_id==e||r.link_source_id==e)&&(t=r.link_source_id,n=r.link_from_start,a=r.link_to_start,r="",r=p.isLinkAllowed(t,e,n,a)?a?"link_start_allow":"link_finish_allow":a?"link_start_deny":"link_finish_deny",i.push(r)),i.join(" ")}(r.task_class(t.start_date,t.end_date,t),t.id);(t.color||t.progressColor||t.textColor)&&(e+=" gantt_task_inline_color"),n.width<20&&(e+=" gantt_thin_task"),u.className=e;e=["left:"+n.left+"px","top:"+(c+n.top)+"px","height:"+(a==i.types.milestone?n.height:s)+"px","line-height:"+Math.max(s<30?s-2:s,0)+"px","width:"+d+"px"];t.color&&e.push("background-color:"+t.color),t.textColor&&e.push("color:"+t.textColor),u.style.cssText=e.join(";");c=(c=t,n=r,d=l,e="gantt_left "+m(!i.rtl,c),d=d?{type:"marginRight",value:d}:null,v(c,n.leftside_text,e,d));c&&u.appendChild(c),n=t,e=r,d=l,r="gantt_right "+m(!!i.rtl,n),d=d?{type:"marginLeft",value:d}:null,(c=v(n,e.rightside_text,r,d))&&u.appendChild(c),p._waiAria.setTaskBarAttr(t,u);var h=p.getState();return p.isReadonly(t)||(i.drag_resize&&!p.isSummaryTask(t)&&a!=i.types.milestone&&y(u,"gantt_task_drag",t,function(t){var e=document.createElement("div");return e.className=t,e},i),i.drag_links&&i.show_links&&y(u,"gantt_link_control",t,function(t){var e=document.createElement("div");e.className=t,e.style.cssText=["height:"+s+"px","line-height:"+s+"px"].join(";");var n=document.createElement("div"),t=!(n.className="gantt_link_point");return h.link_source_id&&i.touch&&(t=!0),n.style.display=t?"block":"",e.appendChild(n),e},i,l)),u}var f,_,g}function v(t,e,n,i){if(!e)return null;e=e(t.start_date,t.end_date,t);if(!e)return null;t=document.createElement("div");return t.className="gantt_side_content "+n,t.innerHTML=e,i&&(t.style[i.type]=Math.abs(i.value)+"px"),t}function m(t,e){var n,i=t?{$source:[p.config.links.start_to_start],$target:[p.config.links.start_to_start,p.config.links.finish_to_start]}:{$source:[p.config.links.finish_to_start,p.config.links.finish_to_finish],$target:[p.config.links.finish_to_finish]};for(n in i)for(var r=e[n],a=0;a<r.length;a++)for(var o=p.getLink(r[a]),s=0;s<i[n].length;s++)if(o.type==i[n][s])return"gantt_link_crossing";return""}function y(t,e,n,i,r,a){var o,s=p.getState();+n.start_date>=+s.min_date&&((o=i([e,r.rtl?"task_right":"task_left","task_start_date"].join(" "))).setAttribute("data-bind-property","start_date"),a&&(o.style.marginLeft=a+"px"),t.appendChild(o)),+n.end_date<=+s.max_date&&((o=i([e,r.rtl?"task_left":"task_right","task_end_date"].join(" "))).setAttribute("data-bind-property","end_date"),a&&(o.style.marginRight=a+"px"),t.appendChild(o))}return function(t,e,n){var i=(n=e.$getConfig()).type_renderers[p.getTaskType(t.type)],r=a;return i?i.call(p,t,function(t){return r.call(p,t,e,n)},e):r.call(p,t,e,n)}}},function(t,e){t.exports=function(t,e,n,i,r){if(!t.start_date||!t.end_date)return null;var a=n.getItemTop(t.id),o=n.getItemHeight(t.id);if(a>e.y_end||a+o<e.y)return!1;o=n.posFromDate(t.start_date),n=n.posFromDate(t.end_date),t=Math.min(o,n)-200,n=Math.max(o,n)+200;return!(t>e.x_end||n<e.x)}},function(t,e,n){var a=n(2);function o(t){var e,n,i;t._delayRender&&t._delayRender.$cancelTimeout(),t.$gantt&&(e=t.$gantt.$data.tasksStore,t[i="_attached_"+(n=t.$config.rowStore).$config.name]&&(e.detachEvent(t[i]),t[i]=null),n.$attachedResourceViewHandler&&(n.detachEvent(n.$attachedResourceViewHandler),n.$attachedResourceViewHandler=null,e.detachEvent(n.$attachedTaskStoreHandler),n.$attachedTaskStoreHandler=null))}t.exports=function(t){var e=t.prototype.init,n=t.prototype.destructor;return{init:function(){e.apply(this,arguments),this._linkToTaskStore()},destructor:function(){o(this),n.apply(this,arguments)},_linkToTaskStore:function(){var t,e,n,i,r;this.$config.rowStore&&this.$gantt.$data.tasksStore&&(t=this.$gantt.$data.tasksStore,e=this.$config.rowStore,o(this),n=this,i=a.delay(function(){n.$gantt.getState().lightbox?i():n.$config.rowStore.refresh()},300),this._delayRender=i,r="_attached_"+e.$config.name,n[r]||(n[r]=t.attachEvent("onStoreUpdated",function(){return i.$pending||i(),!0})),this.$gantt.attachEvent("onDestroy",function(){return o(n),!0}),e.$attachedResourceViewHandler||(e.$attachedResourceViewHandler=e.attachEvent("onBeforeFilter",function(){return!n.$gantt.getState().lightbox&&(i.$pending&&i.$cancelTimeout(),n._updateNestedTasks(),!0)}),e.$attachedTaskStoreHandler=t.attachEvent("onAfterDelete",function(){e._mark_recompute=!0})))},_updateNestedTasks:function(){var o=this.$gantt,s=o.getDatastore(o.config.resource_store);s.$config.fetchTasks&&s.silent(function(){var t,r=[],a={},e={};for(t in s.eachItem(function(n){var i;"task"!=n.$role?(i={},o.getResourceAssignments(n.id).forEach(function(t){var e;i[t.task_id]||(i[t.task_id]=!0,e=o.getTask(t.task_id),(t=Object.create(e)).id=e.id+"_"+n.id,t.$task_id=e.id,t.$resource_id=n.id,t[s.$parentProperty]=n.id,t.$role="task",r.push(t),a[t.id]=!0)})):e[n.id]=!0}),e)a[t]||s.removeItem(t);r.length&&s.parse(r)})}}}},function(t,e){t.exports=function(t,e,n){return{top:e.getItemTop(t.id),height:e.getItemHeight(t.id),left:0,right:1/0}}},function(t,e){t.exports=function(r){var a=[];return{delegate:function(t,e,n,i){a.push([t,e,n,i]),r.$services.getService("mouseEvents").delegate(t,e,n,i)},destructor:function(){for(var t=r.$services.getService("mouseEvents"),e=0;e<a.length;e++){var n=a[e];t.detach(n[0],n[1],n[2],n[3])}a=[]}}}},function(t,e,s){function n(t,e,n,i){this.$config=a.mixin({},e||{}),this.$gantt=i,this.$parent=t,o(this),this.$state={},a.mixin(this,c(this))}var r=s(1),a=s(0),o=s(4),l=s(197),c=s(38),u=s(195),d=s(194).default;n.prototype={init:function(t){var e=this.$gantt,n=e._waiAria.gridAttrString(),i=e._waiAria.gridDataAttrString(),r=this.$getConfig(),a=r.reorder_grid_columns||!1;void 0!==this.$config.reorder_grid_columns&&(a=this.$config.reorder_grid_columns),t.innerHTML="<div class='gantt_grid' style='height:inherit;width:inherit;' "+n+"></div>",this.$grid=t.childNodes[0],this.$grid.innerHTML="<div class='gantt_grid_scale' "+e._waiAria.gridScaleRowAttrString()+"></div><div class='gantt_grid_data' "+i+"></div>",this.$grid_scale=this.$grid.childNodes[0],this.$grid_data=this.$grid.childNodes[1];r=r[this.$config.bind+"_attribute"];!r&&this.$config.bind&&(r="data-"+this.$config.bind+"-id"),this.$config.item_attribute=r||null,this.$config.layers||(o=this._createLayerConfig(),this.$config.layers=o);var o=l(e,this);o.init(),this._renderHeaderResizers=o.doOnRender,this._mouseDelegates=s(26)(e),u(e,this).init(),this._addLayers(this.$gantt),this._initEvents(),a&&(this._columnDND=new d(e,this),this._columnDND.init()),this.callEvent("onReady",[])},_validateColumnWidth:function(t,e){var n,i=t[e];i&&"*"!=i&&(n=this.$gantt,i=+i,isNaN(i)?n.assert(!1,"Wrong "+e+" value of column "+t.name):t[e]=i)},setSize:function(t,e){this.$config.width=this.$state.width=t,this.$config.height=this.$state.height=e;for(var n,i=this.getGridColumns(),r=0,e=(s=this.$getConfig()).grid_elastic_columns,a=0,o=i.length;a<o;a++)this._validateColumnWidth(i[a],"min_width"),this._validateColumnWidth(i[a],"max_width"),this._validateColumnWidth(i[a],"width"),r+=+i[a].width;!isNaN(r)&&this.$config.scrollable||(r=l=this._setColumnsWidth(t+1)),this.$config.scrollable&&e&&!isNaN(r)&&(n=0,i.forEach(function(t){n+=t.min_width||s.min_grid_column_width}),e=Math.max(n,t),r=this._setColumnsWidth(e),l=t),this.$config.scrollable?(this.$grid_scale.style.width=r+"px",this.$grid_data.style.width=r+"px"):(this.$grid_scale.style.width="inherit",this.$grid_data.style.width="inherit"),--this.$config.width;var s=this.$getConfig();l!==t&&(void 0!==l?(s.grid_width=l,this.$config.width=l-1):isNaN(r)||(this._setColumnsWidth(r),s.grid_width=r,this.$config.width=r-1));var l=Math.max(this.$state.height-s.scale_height,0);this.$grid_data.style.height=l+"px",this.refresh()},getSize:function(){var t=this.$getConfig(),e=this.$config.rowStore?this.getTotalHeight():0,n=this._getGridWidth();return{x:this.$state.width,y:this.$state.height,contentX:this.isVisible()?n:0,contentY:this.isVisible()?t.scale_height+e:0,scrollHeight:this.isVisible()?e:0,scrollWidth:this.isVisible()?n:0}},_bindStore:function(){var t,e;this.$config.bind&&(t=this.$gantt.getDatastore(this.$config.bind),(this.$config.rowStore=t)&&!t._gridCacheAttached&&(e=this,t._gridCacheAttached=t.attachEvent("onBeforeFilter",function(){e._resetTopPositionHeight()})))},_unbindStore:function(){var t;!this.$config.bind||(t=this.$gantt.getDatastore(this.$config.bind))&&t._gridCacheAttached&&(t.detachEvent(t._gridCacheAttached),t._gridCacheAttached=!1)},refresh:function(){this._bindStore(),this._resetTopPositionHeight(),this._resetHeight(),this._initSmartRenderingPlaceholder(),this._calculateGridWidth(),this._renderGridHeader()},getViewPort:function(){var t=this.$config.scrollLeft||0,e=this.$config.scrollTop||0,n=this.$config.height||0,i=this.$config.width||0;return{y:e,y_end:e+n,x:t,x_end:t+i,height:n,width:i}},scrollTo:function(t,e){var n;this.isVisible()&&(n=!1,this.$config.scrollTop=this.$config.scrollTop||0,this.$config.scrollLeft=this.$config.scrollLeft||0,+t==t&&(this.$config.scrollLeft=this.$state.scrollLeft=this.$grid.scrollLeft=t,n=!0),+e==e&&(this.$config.scrollTop=this.$state.scrollTop=this.$grid_data.scrollTop=e,n=!0),n&&this.callEvent("onScroll",[this.$config.scrollLeft,this.$config.scrollTop]))},getColumnIndex:function(t,e){for(var n=this.$getConfig().columns,i=0,r=0;r<n.length;r++)if(e&&n[r].hide&&i++,n[r].name==t)return r-i;return null},getColumn:function(t){t=this.getColumnIndex(t);return null===t?null:this.$getConfig().columns[t]},getGridColumns:function(){return this.$getConfig().columns.slice()},isVisible:function(){return this.$parent&&this.$parent.$config?!this.$parent.$config.hidden:this.$grid.offsetWidth},_createLayerConfig:function(){var t=this.$gantt,e=this;return[{renderer:t.$ui.layers.gridLine(),container:this.$grid_data,filter:[function(){return e.isVisible()}]},{renderer:t.$ui.layers.gridTaskRowResizer(),container:this.$grid_data,append:!0,filter:[function(){return t.config.resize_rows}]}]},_addLayers:function(t){if(this.$config.bind){this._taskLayers=[];for(var e=this,n=this.$gantt.$services.getService("layers"),i=(i=n.getDataRender(this.$config.bind))||n.createDataRender({name:this.$config.bind,defaultContainer:function(){return e.$grid_data}}),r=this.$config.layers,a=0;r&&a<r.length;a++){var o=r[a];o.view=this;o=i.addLayer(o);this._taskLayers.push(o)}this._bindStore(),this._initSmartRenderingPlaceholder()}},_refreshPlaceholderOnStoreUpdate:function(t){var e,n=this.$getConfig(),i=this.$config.rowStore;i&&null===t&&this.isVisible()&&n.smart_rendering&&(!this.$config.scrollY||(n=this.$gantt.$ui.getView(this.$config.scrollY))&&(e=n.getScrollState().scrollSize),(e=e||(i?this.getTotalHeight():0))&&(this.$rowsPlaceholder&&this.$rowsPlaceholder.parentNode&&this.$rowsPlaceholder.parentNode.removeChild(this.$rowsPlaceholder),(i=this.$rowsPlaceholder=document.createElement("div")).style.visibility="hidden",i.style.height=e+"px",i.style.width="1px",this.$grid_data.appendChild(i)))},_initSmartRenderingPlaceholder:function(){var t=this.$config.rowStore;t&&(this._initSmartRenderingPlaceholder=function(){},this._staticBgHandler=t.attachEvent("onStoreUpdated",a.bind(this._refreshPlaceholderOnStoreUpdate,this)))},_initEvents:function(){var t=this.$gantt;this._mouseDelegates.delegate("click","gantt_close",t.bind(function(t,e,n){var i=this.$config.rowStore;if(!i)return!0;t=r.locateAttribute(t,this.$config.item_attribute);return t&&i.close(t.getAttribute(this.$config.item_attribute)),!1},this),this.$grid),this._mouseDelegates.delegate("click","gantt_open",t.bind(function(t,e,n){var i=this.$config.rowStore;if(!i)return!0;t=r.locateAttribute(t,this.$config.item_attribute);return t&&i.open(t.getAttribute(this.$config.item_attribute)),!1},this),this.$grid)},_clearLayers:function(t){var e=this.$gantt.$services.getService("layers").getDataRender(this.$config.bind);if(this._taskLayers)for(var n=0;n<this._taskLayers.length;n++)e.removeLayer(this._taskLayers[n]);this._taskLayers=[]},_getColumnWidth:function(t,e,n){e=t.min_width||e.min_grid_column_width,e=Math.max(n,e||10);return t.max_width&&(e=Math.min(e,t.max_width)),e},_checkGridColumnMinWidthLimits:function(t,e){for(var n=0,i=t.length;n<i;n++){var r=+t[n].width;!t[n].min_width&&r<e.min_grid_column_width&&(t[n].min_width=r)}},_getGridWidthLimits:function(){for(var t=this.$getConfig(),e=this.getGridColumns(),n=0,i=0,r=0;r<e.length;r++)n+=e[r].min_width||t.min_grid_column_width,void 0!==i&&(i=e[r].max_width?i+e[r].max_width:void 0);return this._checkGridColumnMinWidthLimits(e,t),[n,i]},_setColumnsWidth:function(t,e){var n=this.$getConfig(),i=this.getGridColumns(),r=0,t=t;e=window.isNaN(e)?-1:e;for(var a=0,o=i.length;a<o;a++)r+=+i[a].width;if(window.isNaN(r))for(this._calculateGridWidth(),a=r=0,o=i.length;a<o;a++)r+=+i[a].width;var s=t-r,l=0;for(a=0;a<e+1;a++)l+=i[a].width;for(r-=l,a=e+1;a<i.length;a++){var c=i[a],u=Math.round(s*(c.width/r));s<0?c.min_width&&c.width+u<c.min_width?u=c.min_width-c.width:!c.min_width&&n.min_grid_column_width&&c.width+u<n.min_grid_column_width&&(u=n.min_grid_column_width-c.width):c.max_width&&c.width+u>c.max_width&&(u=c.max_width-c.width),r-=c.width,c.width+=u,s-=u}for(var d=0<s?1:-1;0<s&&1==d||s<0&&-1==d;){for(var h,f=s,a=e+1;a<i.length;a++)if((h=i[a].width+d)==this._getColumnWidth(i[a],n,h)&&(s-=d,i[a].width=h),!s)break;if(f==s)break}return s&&-1<e&&(h=i[e].width+s)==this._getColumnWidth(i[e],n,h)&&(i[e].width=h),this._getColsTotalWidth()},_getColsTotalWidth:function(){for(var t=this.getGridColumns(),e=0,n=0;n<t.length;n++){var i=parseFloat(t[n].width);if(window.isNaN(i))return!1;e+=i}return e},_calculateGridWidth:function(){for(var t=this.$getConfig(),e=this.getGridColumns(),n=0,i=[],r=[],a=0;a<e.length;a++){var o=parseFloat(e[a].width);window.isNaN(o)&&(o=t.min_grid_column_width||10,i.push(a)),n+=r[a]=o}var s=this._getGridWidth()+1;if(t.autofit||i.length){var l=s-n;if(t.autofit&&!t.grid_elastic_columns)for(a=0;a<r.length;a++){var c=Math.round(l/(r.length-a));r[a]+=c,(u=this._getColumnWidth(e[a],t,r[a]))!=r[a]&&(c=u-r[a],r[a]=u),l-=c}else if(i.length)for(a=0;a<i.length;a++){c=Math.round(l/(i.length-a));var u,d=i[a];r[d]+=c,(u=this._getColumnWidth(e[d],t,r[d]))!=r[d]&&(c=u-r[d],r[d]=u),l-=c}for(a=0;a<r.length;a++)e[a].width=r[a]}else{s=s!=n;this.$config.width=n-1,t.grid_width=n,s&&this.$parent._setContentSize(this.$config.width,null)}},_renderGridHeader:function(){var t=this.$gantt,e=this.$getConfig(),n=this.$gantt.locale,i=this.$gantt.templates,r=this.getGridColumns();e.rtl&&(r=r.reverse());for(var a=[],o=0,s=n.labels,n=e.scale_height-1,l=0;l<r.length;l++){var c=l==r.length-1,u=r[l];u.name||(u.name=t.uid()+"");var d=+u.width,h=this._getGridWidth();c&&o+d<h&&(u.width=d=h-o),o+=d;var f=t._sort&&u.name==t._sort.name?"<div class='gantt_sort gantt_"+t._sort.direction+"'></div>":"",h=["gantt_grid_head_cell","gantt_grid_head_"+u.name,c?"gantt_last_cell":"",i.grid_header_class(u.name,u)].join(" "),d="width:"+(d-(c?1:0))+"px;",c=(c=u.label||s["column_"+u.name]||s[u.name])||"",f="<div class='"+h+"' style='"+d+"' "+t._waiAria.gridScaleCellAttrString(u,c)+" data-column-id='"+u.name+"' column_id='"+u.name+"' data-column-name='"+u.name+"' data-column-index='"+l+"'>"+c+f+"</div>";a.push(f)}this.$grid_scale.style.height=e.scale_height+"px",this.$grid_scale.style.lineHeight=n+"px",this.$grid_scale.innerHTML=a.join(""),this._renderHeaderResizers&&this._renderHeaderResizers()},_getGridWidth:function(){return this.$config.width},destructor:function(){this._clearLayers(this.$gantt),this._mouseDelegates&&(this._mouseDelegates.destructor(),this._mouseDelegates=null),this._unbindStore(),this.$grid=null,this.$grid_scale=null,this.$grid_data=null,this.$gantt=null,this.$config.rowStore&&(this.$config.rowStore.detachEvent(this._staticBgHandler),this.$config.rowStore=null),this.callEvent("onDestroy",[]),this.detachAllEvents()}},t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.ConstraintTypes||(e.ConstraintTypes={})).ASAP="asap",e.ALAP="alap",e.SNET="snet",e.SNLT="snlt",e.FNET="fnet",e.FNLT="fnlt",e.MSO="mso",e.MFO="mfo"},function(t,e){t.exports=function(_){return{getVirtualRoot:function(){return _.mixin(_.getSubtaskDates(),{id:_.config.root_id,type:_.config.types.project,$source:[],$target:[],$virtual:!0})},getLinkedTasks:function(t,e){var n=[t],t=!1;_._isLinksCacheEnabled()||(_._startLinksCache(),t=!0);for(var i=[],r={},a={},o=0;o<n.length;o++)this._getLinkedTasks(n[o],r,e,a);for(o in a)i.push(a[o]);return t&&_._endLinksCache(),i},_collectRelations:function(t,e,n,i){var r,a=_._getSuccessors(t,e),o=[];n&&(o=_._getPredecessors(t,e));for(var s=[],l=0;l<a.length;l++)i[r=a[l].hashSum]||(i[r]=!0,s.push(a[l]));for(l=0;l<o.length;l++)i[r=o[l].hashSum]||(i[r]=!0,s.push(o[l]));return s},_getLinkedTasks:function(t,e,n,i){for(var r=void 0===t?_.config.root_id:t,a={},o=[{from:r,includePredecessors:n,isChild:!(e={})}];o.length;){var s=o.pop(),l=s.isChild;if(!e[r=s.from]){s=_.isTaskExists(r)?_.getTask(r):this.getVirtualRoot(),e[r]=!0;for(var c=this._collectRelations(s,l,n,a),u=0;u<c.length;u++){var d=c[u],h=(i[d.hashSum]=d).sourceParent==d.targetParent;e[d.target]||o.push({from:d.target,includePredecessors:!0,isChild:h})}if(_.hasChild(s.id))for(var f=_.getChildren(s.id),u=0;u<f.length;u++)e[f[u]]||o.push({from:f[u],includePredecessors:!0,isChild:!0})}}return i}}}},,function(t,e,n){},function(t,e,n){var y=n(2);t.exports=function(m){var a={};return m.$data.tasksStore.attachEvent("onStoreUpdated",function(){a={}}),function(t,e,n,i){var r=t.id+"_"+e+"_"+n.unit+"_"+n.step;return a[r]||(a[r]=function(t,e,n,i){var r,a=!1;m.config.process_resource_assignments&&e===m.config.resource_property?(r="task"==t.$role?m.getResourceAssignments(t.$resource_id,t.$task_id):m.getResourceAssignments(t.id),a=!0):r="task"==t.$role?[]:m.getTaskBy(e,t.id);for(var o,s,l,c,u=function(t,e,n){for(var i=e.unit,r=e.step,a={},o={},s=0;s<t.length;s++){var l=t[s],c=l;n&&(c=m.getTask(l.task_id));var u=l.start_date||c.start_date,d=l.end_date||c.end_date;n&&(l.start_date&&(u=new Date(Math.max(l.start_date.valueOf(),c.start_date.valueOf()))),l.end_date&&(d=new Date(Math.min(l.end_date.valueOf(),c.end_date.valueOf()))));var h=y.findBinary(e.trace_x,u.valueOf()),f=new Date(e.trace_x[h]||m.date[i+"_start"](new Date(u))),_=m.config.work_time?m.getTaskCalendar(c):m;for(o[_.id]={};f<d;){var g=o[_.id],p=f,v=p.valueOf(),f=m.date.add(f,r,i);!1!==g[v]&&(_.isWorkTime({date:p,task:c,unit:i})?(a[v]||(a[v]={tasks:[],assignments:[]}),a[v].tasks.push(c),n&&a[v].assignments.push(l)):g[v]=!1)}}return a}(r,n,a),d=n.unit,h=n.step,f=[],_=i.$getConfig(),g=0;g<n.trace_x.length;g++)o=new Date(n.trace_x[g]),s=m.date.add(o,h,d),l=(c=u[o.valueOf()]||{}).assignments||[],(c=c.tasks||[]).length||_.resource_render_empty_cells?f.push({start_date:o,end_date:s,tasks:c,assignments:l}):f.push(null);return f}(t,e,n,i))}}},function(t,e,n){var a,i=n(0),r=n(34),o=n(24),o=(n(3)(s,a=r),i.mixin(s.prototype,{init:function(){void 0===this.$config.bind&&(this.$config.bind=this.$getConfig().resource_store),a.prototype.init.apply(this,arguments)},_createLayerConfig:function(){function t(){return e.isVisible()}var e=this;return{tasks:[{renderer:this.$gantt.$ui.layers.resourceRow(),container:this.$task_bars,filter:[t]},{renderer:this.$gantt.$ui.layers.taskBg(),container:this.$task_bg,filter:[t]}],links:[]}}},!0),i.mixin(s.prototype,o(s),!0),s);function s(t,e,n,i){var r=a.apply(this,arguments)||this;return r.$config.bindLinks=null,r}t.exports=o},function(t,e,n){var r=n(41),a=n(4),o=n(0),y=n(2),s=n(38),i=n(118),n=function(t,e,n,i){this.$config=o.mixin({},e||{}),this.$scaleHelper=new r(i),this.$gantt=i,this._posFromDateCache={},this._timelineDragScroll=null,o.mixin(this,s(this)),a(this)};n.prototype={init:function(t){t.innerHTML+="<div class='gantt_task' style='width:inherit;height:inherit;'></div>",this.$task=t.childNodes[0],this.$task.innerHTML="<div class='gantt_task_scale'></div><div class='gantt_data_area'></div>",this.$task_scale=this.$task.childNodes[0],this.$task_data=this.$task.childNodes[1],this.$task_data.innerHTML="<div class='gantt_task_bg'></div><div class='gantt_links_area'></div><div class='gantt_bars_area'></div>",this.$task_bg=this.$task_data.childNodes[0],this.$task_links=this.$task_data.childNodes[1],this.$task_bars=this.$task_data.childNodes[2],this._tasks={col_width:0,width:[],full_width:0,trace_x:[],rendered:{}};var e=this.$getConfig(),t=e[this.$config.bind+"_attribute"],e=e[this.$config.bindLinks+"_attribute"];!t&&this.$config.bind&&(t="data-"+this.$config.bind+"-id"),!e&&this.$config.bindLinks&&(e="data-"+this.$config.bindLinks+"-id"),this.$config.item_attribute=t||null,this.$config.link_attribute=e||null;e=this._createLayerConfig();this.$config.layers||(this.$config.layers=e.tasks),this.$config.linkLayers||(this.$config.linkLayers=e.links),this._attachLayers(this.$gantt),this.callEvent("onReady",[]),this.$gantt.ext.dragTimeline&&(this._timelineDragScroll=this.$gantt.ext.dragTimeline.create(),this._timelineDragScroll.attach(this))},setSize:function(t,e){var n=this.$getConfig();+t===t&&(this.$config.width=t),+e===e&&(this.$config.height=e,e=Math.max(this.$config.height-n.scale_height),this.$task_data.style.height=e+"px"),this.refresh(),this.$task_bg.style.backgroundImage="",n.smart_rendering&&this.$config.rowStore?this.$task_bg.style.height=this.getTotalHeight()+"px":this.$task_bg.style.height="";for(var i=this._tasks,r=this.$task_data.childNodes,a=0,o=r.length;a<o;a++){var s=r[a];s.hasAttribute("data-layer")&&s.style&&(s.style.width=i.full_width+"px")}},isVisible:function(){return this.$parent&&this.$parent.$config?!this.$parent.$config.hidden:this.$task.offsetWidth},getSize:function(){var t=this.$getConfig(),e=this.$config.rowStore?this.getTotalHeight():0,n=this.isVisible()?this._tasks.full_width:0;return{x:this.isVisible()?this.$config.width:0,y:this.isVisible()?this.$config.height:0,contentX:this.isVisible()?n:0,contentY:this.isVisible()?t.scale_height+e:0,scrollHeight:this.isVisible()?e:0,scrollWidth:this.isVisible()?n:0}},scrollTo:function(t,e){var n;this.isVisible()&&(n=!1,this.$config.scrollTop=this.$config.scrollTop||0,this.$config.scrollLeft=this.$config.scrollLeft||0,+e===e&&(this.$config.scrollTop=e,this.$task_data.scrollTop=this.$config.scrollTop,n=!0),+t===t&&(this.$task.scrollLeft=t,this.$config.scrollLeft=this.$task.scrollLeft,this._refreshScales(),n=!0),n&&this.callEvent("onScroll",[this.$config.scrollLeft,this.$config.scrollTop]))},_refreshScales:function(){var t,e;this.isVisible()&&this.$getConfig().smart_scales&&(t=this.getViewPort(),e=this._scales,this.$task_scale.innerHTML=this._getScaleChunkHtml(e,t.x,t.x_end))},getViewPort:function(){var t=this.$config.scrollLeft||0,e=this.$config.scrollTop||0,n=this.$config.height||0,i=this.$config.width||0;return{y:e,y_end:e+n,x:t,x_end:t+i,height:n,width:i}},_createLayerConfig:function(){function t(){return e.isVisible()}var e=this;return{tasks:[{expose:!0,renderer:this.$gantt.$ui.layers.taskBar(),container:this.$task_bars,filter:[t,function(t,e){return!e.hide_bar}]},{renderer:this.$gantt.$ui.layers.taskSplitBar(),filter:[t],container:this.$task_bars,append:!0},{renderer:this.$gantt.$ui.layers.taskRollupBar(),filter:[t],container:this.$task_bars,append:!0},{renderer:this.$gantt.$ui.layers.taskBg(),container:this.$task_bg,filter:[t]}],links:[{expose:!0,renderer:this.$gantt.$ui.layers.link(),container:this.$task_links,filter:[t]}]}},_attachLayers:function(t){this._taskLayers=[],this._linkLayers=[];var e=this,n=this.$gantt.$services.getService("layers");if(this.$config.bind){this._bindStore();var i=n.getDataRender(this.$config.bind);(i=i||n.createDataRender({name:this.$config.bind,defaultContainer:function(){return e.$task_data}})).container=function(){return e.$task_data};for(var r=this.$config.layers,a=0;r&&a<r.length;a++){"string"==typeof(s=r[a])&&(s=this.$gantt.$ui.layers[s]()),("function"==typeof s||s&&s.render&&s.update)&&(s={renderer:s}),s.view=this;var o=i.addLayer(s);this._taskLayers.push(o),s.expose&&(this._taskRenderer=i.getLayer(o))}this._initStaticBackgroundRender()}if(this.$config.bindLinks){e.$config.linkStore=e.$gantt.getDatastore(e.$config.bindLinks);for(var s,l=(l=n.getDataRender(this.$config.bindLinks))||n.createDataRender({name:this.$config.bindLinks,defaultContainer:function(){return e.$task_data}}),c=this.$config.linkLayers,a=0;c&&a<c.length;a++){"string"==typeof s&&(s=this.$gantt.$ui.layers[s]()),(s=c[a]).view=this;var u=l.addLayer(s);this._taskLayers.push(u),c[a].expose&&(this._linkRenderer=l.getLayer(u))}}},_initStaticBackgroundRender:function(){var a=this,o=i.create(),t=a.$config.rowStore;t&&(this._staticBgHandler=t.attachEvent("onStoreUpdated",function(t,e,n){var i,r;null===t&&a.isVisible()&&((i=a.$getConfig()).static_background?(r=a.$gantt.getDatastore(a.$config.bind),(t=a.$task_bg_static)||((t=document.createElement("div")).className="gantt_task_bg",a.$task_bg_static=t,a.$task_bg.nextSibling?a.$task_data.insertBefore(t,a.$task_bg.nextSibling):a.$task_data.appendChild(t)),r&&o.render(t,i,a.getScale(),a.getTotalHeight(),a.getItemHeight(e?e.id:null))):i.static_background&&a.$task_bg_static&&a.$task_bg_static.parentNode&&a.$task_bg_static.parentNode.removeChild(a.$task_bg_static))}),this.attachEvent("onDestroy",function(){