text: module.exports=function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}({0:function(e,t,n){e.exports=n(1278)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},1069:function(e,t){e.exports=require("./kendo.data")},1278:function(e,t,n){var r,a,i;!function(d,define){a=[n(1069),n(1279)],r=d,i="function"==typeof r?r.apply(t,a):r,!(void 0!==i&&(e.exports=i))}(function(){return function(e,t){var n,r,a=Array.isArray,i=e.extend,d=e.map,s=kendo.data,l=s.Query,o=s.DataSource,u=s.TreeListDataSource,c=s.TreeListModel,p="parentId",f=function(e,t){return function(n){var r,i;if(n=a(n)?{data:n}:n,r=n||{},i=r.data,r.data=i,!(r instanceof e)&&r instanceof o)throw Error("Incorrect DataSource type. Only "+t+" instances are supported");return r instanceof e?r:new e(r)}},h=function(e){if(e.filter("[name=end], [name=start], [name=plannedEnd], [name=plannedStart]").length){for(var t,n,r=e.attr("name"),a=kendo.widgetInstance(e,kendo.ui),i={},d=e;d!==window&&!t;)d=d.parent(),t=d.data("kendoEditable");return!(n=t?t.options.model:null)||(r.indexOf("planned")>=0?(i.plannedStart=n.plannedStart,i.plannedEnd=n.plannedEnd):(i.start=n.start,i.end=n.end),i[r]=a?a.value():kendo.parseDate(e.val()),r.indexOf("planned")>=0?i.plannedStart<=i.plannedEnd:i.start<=i.end)}return!0},m=kendo.data.Model.define({id:"id",fields:{id:{type:"number",editable:!1},predecessorId:{type:"number"},successorId:{type:"number"},type:{type:"number"}}}),v=o.extend({init:function(e){o.fn.init.call(this,i(!0,{},{schema:{modelBase:m,model:m}},e))},dependencies:function(e){var t=this.predecessors(e),n=this.successors(e);return t.push.apply(t,n),t},predecessors:function(e){return this._dependencies("successorId",e)},successors:function(e){return this._dependencies("predecessorId",e)},_dependencies:function(e,t){var n=this.view(),r={field:e,operator:"eq",value:t};return n=new l(n).filter(r).toArray()}});v.create=f(v,"GanttDependencyDataSource"),n=c.define({fields:{id:{type:"number",editable:!1},parentId:{type:"number",defaultValue:null,validation:{required:!0},nullable:!0},orderId:{type:"number",validation:{required:!0}},title:{type:"string",defaultValue:"New task"},start:{type:"date",validation:{required:!0}},end:{type:"date",validation:{required:!0,dateCompare:h,message:"End date should be after or equal to the start date"}},percentComplete:{type:"number",validation:{required:!0,min:0,max:1,step:.01}},summary:{type:"boolean"},expanded:{type:"boolean",defaultValue:!0},plannedStart:{type:"date",defaultValue:null,nullable:!0},plannedEnd:{type:"date",defaultValue:null,nullable:!0,validation:{dateCompare:h,message:"Planned end date should be after or equal to the planned start date"}}},duration:function(){var e=this.end,t=this.start;return e-t},plannedDuration:function(){var e=this.plannedEnd,t=this.plannedStart;return e&&t?e-t:0},isMilestone:function(){return 0===this.duration()},_offset:function(e){var t,n,r=["start","end"];for(n=0;n<r.length;n++)t=new Date(this.get(r[n]).getTime()+e),this.set(r[n],t)},_offsetPlanned:function(e){var t,n,r=["plannedStart","plannedEnd"];for(n=0;n<r.length;n++)t=new Date(this.get(r[n]).getTime()+e),this.set(r[n],t)}}),n.define=function(e,r){var a,i;return r===t&&(r=e,e=n),a=r.parentId||p,r.parentIdField=a,i=c.define(e,r),a&&(i.parentIdField=a),i},r=u.extend({init:function(e){u.fn.init.call(this,i(!0,{},{schema:{modelBase:n,model:n},sort:{field:"orderId",dir:"asc"}},e))},add:function(e){if(e)return e=this._toGanttTask(e),this.insert(this.taskSiblings(e).length,e)},insert:function(e,t){if(t)return t=this._toGanttTask(t),t.set("orderId",e),t=o.fn.insert.call(this,e,t),this._reorderSiblings(t,this.taskSiblings(t).length-1),this._resolveSummaryFields(this.taskParent(t)),t},remove:function(e){var t=e.get("parentId"),n=this.taskAllChildren(e);return this._removeItems(n),e=u.fn.remove.call(this,e),this._childRemoved(t,e.get("orderId")),e},taskAllChildren:function(e){var t=[],n=this,r=function(e){var a=n.taskChildren(e);t.push.apply(t,a),d(a,r)};return e?r(e):t=this.view(),t},taskChildren:function(e,n){var r,a,i={field:"parentId",operator:"eq",value:null},d=this._sort&&this._sort.length?this._sort:{field:"orderId",dir:"asc"};if(a=n?this.view():this.data(),e){if(r=e.get("id"),r===t||null===r||""===r)return[];i.value=r}return a=new l(a).filter(i).sort(d).toArray()},taskLevel:function(e){for(var t=0,n=this.taskParent(e);null!==n;)t+=1,n=this.taskParent(n);return t},taskParent:function(e){return e&&null!==e.get("parentId")?this.get(e.parentId):null},taskSiblings:function(e){if(!e)return null;var t=this.taskParent(e);return this.taskChildren(t)},taskTree:function(e){var t,n,r,a,i=[],d=this.taskChildren(e,!0);for(n=0,r=d.length;n<r;n++)t=d[n],i.push(t),t.get("expanded")&&(a=this.taskTree(t),i.push.apply(i,a));return i},update:function(e,n){var r,a,i=this,d=function(e,t){var n,r,a=i.taskAllChildren(e);for(n=0,r=a.length;n<r;n++)a[n]._offset(t)},s=function(e,t){var n,r,a=i.taskAllChildren(e);for(n=0,r=a.length;n<r;n++)a[n]._offsetPlanned(t)},l=function(e){var t=e.field,n=e.sender;switch(t){case"start":i._resolveSummaryStart(i.taskParent(n)),d(n,n.get(t).getTime()-r.getTime());break;case"end":i._resolveSummaryEnd(i.taskParent(n));break;case"plannedStart":i._resolveSummaryPlannedStart(i.taskParent(n)),n.get(t)&&r&&s(n,n.get(t).getTime()-r.getTime());break;case"plannedEnd":i._resolveSummaryPlannedEnd(i.taskParent(n));break;case"percentComplete":i._resolveSummaryPercentComplete(i.taskParent(n));break;case"orderId":i._reorderSiblings(n,r)}};n.parentId!==t&&(r=e.get("parentId"),r!==n.parentId&&(e.set("parentId",n.parentId),i._childRemoved(r,e.get("orderId")),e.set("orderId",i.taskSiblings(e).length-1),i._resolveSummaryFields(i.taskParent(e))),delete n.parentId),e.bind("change",l),e.bind("equalSet",l);for(a in n)r=e.get(a),"plannedStart"===a||"plannedEnd"===a?r===t&&null===n[a]||e.set(a,n[a]):"start"===a||"end"===a?e.set(a,n[a]):e.get(a)!==n[a]&&e.set(a,n[a]);e.unbind("change",l),e.unbind("equalSet",l)},_childRemoved:function(e,t){var n,r,a=null===e?null:this.get(e),i=this.taskChildren(a);for(n=t,r=i.length;n<r;n++)i[n].set("orderId",n);this._resolveSummaryFields(a)},_resolveSummaryFields:function(e){e&&(this._updateSummary(e),this.taskChildren(e).length&&(this._resolveSummaryStart(e),this._resolveSummaryEnd(e),this._resolveSummaryPlannedStart(e),this._resolveSummaryPlannedEnd(e),this._resolveSummaryPercentComplete(e)))},_resolveSummaryStart:function(e){var t=this,n=function(e){var n,r,a,i=t.taskChildren(e),d=i[0].start.getTime();for(r=1,a=i.length;r<a;r++)n=i[r].start.getTime(),n<d&&(d=n);return new Date(d)};this._updateSummaryRecursive(e,"start",n)},_resolveSummaryEnd:function(e){var t=this,n=function(e){var n,r,a,i=t.taskChildren(e),d=i[0].end.getTime();for(r=1,a=i.length;r<a;r++)n=i[r].end.getTime(),n>d&&(d=n);return new Date(d)};this._updateSummaryRecursive(e,"end",n)},_resolveSummaryPlannedStart:function(e){var t=this,n=function(e){var n,r,a,i=t.taskChildren(e),d=null;for(r=0,a=i.length;r<a;r++)i[r].plannedStart&&(n=i[r].plannedStart.getTime(),(!d||n<d)&&(d=n));return d?new Date(d):null};this._updateSummaryRecursive(e,"plannedStart",n)},_resolveSummaryPlannedEnd:function(e){var t=this,n=function(e){var n,r,a,i=t.taskChildren(e),d=null;for(r=0,a=i.length;r<a;r++)i[r].plannedEnd&&(n=i[r].plannedEnd.getTime(),(!d||n>d)&&(d=n));return d?new Date(d):null};this._updateSummaryRecursive(e,"plannedEnd",n)},_resolveSummaryPercentComplete:function(e){var t=this,n=function(e){var n=t.taskChildren(e),r=new l(n).aggregate([{field:"percentComplete",aggregate:"average"}]);return r.percentComplete.average};this._updateSummaryRecursive(e,"percentComplete",n)},_reorderSiblings:function(e,t){var n,r=e.get("orderId"),a=r>t,i=a?t:r,d=a?r:t,s=a?i:i+1,l=this.taskSiblings(e);if(l.length)for(d=Math.min(d,l.length-1),n=i;n<=d;n++)l[n]!==e&&(l[n].set("orderId",s),s+=1)},_toGanttTask:function(e){if(!(e instanceof n)){var t=e;e=o.fn._createNewModel.call(this),e.accept(t)}return e},_updateSummary:function(e){if(null!==e){var t=this.taskChildren(e).length;e.set("summary",t>0)}},_updateSummaryRecursive:function(e,t,n){var r,a;e&&(r=n(e),e.set(t,r),a=this.taskParent(e),a&&this._updateSummaryRecursive(a,t,n))}}),r.create=f(r,"GanttDataSource"),i(!0,kendo.data,{GanttDataSource:r,GanttTask:n,GanttDependencyDataSource:v,GanttDependency:m})}(window.kendo.jQuery),window.kendo},n(3))},1279:function(e,t){e.exports=require("./kendo.treelist")}});