/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(t,define){define("kendo.scheduler.view.min",["kendo.core.min"],t)}(function(){return kendo.ui.scheduler={},function(t){function e(t,e){function n(t,i){var s,r;if(i=i[e])for(s=o[t]=o[t]||[],r=0;r<i.length;r++)s.push(i[r]),n(t+1,i[r])}var o=[];return n(0,t),o}function n(){return x.support.cssBorderSpacing?"":'cellspacing="0"'}function o(e,o){return e.length?"<table "+n()+' class="'+t.trim("k-scheduler-table "+(o||""))+'"><tr>'+e.join("</tr><tr>")+"</tr></table>":""}function i(t,e){return t.length?"<div style='position:relative'>"+o(t,e)+"</div>":""}function s(e,n,i){var s,r=[];if(i>0)for(s=0;s<e;s++)r.push("<th>&nbsp;</th>");return n&&r.push('<th class="k-scheduler-times-all-day">'+n.text+"</th>"),i<1?t():t('<div class="k-scheduler-times">'+o(r)+"</div>")}function r(e,n,s){var r,l,a,u,c,h,f,d,g,p,_=[];for(l=0;l<e.length;l++){for(a=e[l],u=[],c=n/a.length,r=0;r<a.length;r++)h=a[r],u.push('<th colspan="'+(h.colspan||c)+'" class="'+(h.className||"")+'">'+h.text+"</th>");_.push(u.join(""))}if(f=[],s){for(d=e[e.length-1],g=[],p=s.cellContent,r=0;r<d.length;r++)g.push('<td class="'+(d[r].className||"")+'">'+(p?p(r):"&nbsp;")+"</td>");f.push(g.join(""))}return t('<div class="k-scheduler-header k-state-default"><div class="k-scheduler-header-wrap">'+o(_)+i(f,"k-scheduler-header-all-day")+"</div></div>")}function l(e,n){var i,s,r,l,a,u=Array(n).join().split(","),c=[];for(s=0;s<e.length;s++)for(r=e[s],l=n/r.length,i=0;i<r.length;i++)a=r[i].className||"",r[i].allDay&&(a="k-scheduler-times-all-day"),u[l*i]+='<th class="'+a+'" rowspan="'+l+'">'+r[i].text+"</th>";for(i=0;i<n;i++)c.push(u[i]);return n<1?t():t('<div class="k-scheduler-times">'+o(c)+"</div>")}function a(){return t('<div class="k-scheduler-content"><table '+n()+' class="k-scheduler-table"/></div>')}function u(){return y=y?y:x.support.scrollbar()}function c(t,e,n){var o,i,s,r,l;for(o=t.length-1;o>=0;o--)i=h(t[o]),s=i.start,l=i.end,r=s<=e&&l>=e,(r||s>=e&&l<=n||e<=s&&n>=s)&&(s<e&&(e=s),l>n&&(n=l));return f(t,e,n)}function h(t){return{start:t.start,end:t.end}}function f(t,e,n){var o,i,s=[];for(o=0;o<t.length;o++)i=h(t[o]),(i.start<e&&i.end>e||i.start>=e&&i.end<=n)&&s.push(t[o]);return s}function d(t){return p(t)}function g(t){return p(t)}function p(t){var e,n,o,i,s,r,l,a=[];for(e=0;e<t.length;e++){for(n=t[e],o=h(n),i=null,s=0,r=a.length;s<r;s++)if(l=o.start>a[s].end,o.start<a[s].start||l){i=a[s],i.end<o.end&&(i.end=o.end);break}i||(i={start:o.start,end:o.end,events:[]},a.push(i)),i.events.push(n)}return a}function _(e,n,o,i){var s=[];return t.each(n,function(t,n){var r=n.className?"k-slot-cell "+n.className:"k-slot-cell",l={text:n.text,className:r};l[e]=i&&!n.minorTicks?_(e,n.columns,o,i):o,s.push(l)}),s}function v(e,n,o,i,s,r){var l,a,u,c=n[0],h=[];if(c){if(s&&o)t.each(s,function(t,o){o[e]=r&&!o.minorTicks?v(e,n,o.columns,i,o.columns,r):v(e,n,null,i)}),h=s;else for(l=c.dataSource.view(),a=0;a<l.length;a++)u={text:i({text:x.htmlEncode(x.getter(c.dataTextField)(l[a])),color:x.getter(c.dataColorField)(l[a]),field:c.field,title:c.title,name:c.name,value:x.getter(c.dataValueField)(l[a])}),className:"k-slot-cell"},u[e]=v(e,n.slice(1),o,i),h.push(u);return h}return o}function m(e){return function(n){if(t.isArray(n)||n instanceof x.data.ObservableArray){for(var o=0;o<n.length;o++)if(n[o]==e)return!0;return!1}return n==e}}function S(t){t.className=t.className.replace(b,"")+" k-state-selected"}var y,C,b,x=window.kendo,D=x.ui,I=D.Widget,k=x._outerHeight,w=x.keys,H=".kendoSchedulerView",R=Math,T='<div class="k-marquee k-scheduler-marquee"><div class="k-marquee-color"></div><div class="k-marquee-text"><div class="k-label-top"></div><div class="k-label-bottom"></div></div></div>',L=x.Class.extend({init:function(t,e){this._index=t,this._timeSlotCollections=[],this._daySlotCollections=[],this._isRtl=e},addTimeSlotCollection:function(t,e){return this._addCollection(t,e,this._timeSlotCollections)},addDaySlotCollection:function(t,e){return this._addCollection(t,e,this._daySlotCollections)},_addCollection:function(t,e,n){var o=new B(t,e,this._index,n.length);return n.push(o),o},timeSlotCollectionCount:function(){return this._timeSlotCollections.length},daySlotCollectionCount:function(){return this._daySlotCollections.length},daySlotByPosition:function(t,e,n){return this._slotByPosition(t,e,this._daySlotCollections,n)},timeSlotByPosition:function(t,e,n){return this._slotByPosition(t,e,this._timeSlotCollections,n)},_slotByPosition:function(t,e,n,o){var i,s,r,l,a,u,c,h,f;for(i=0;i<n.length;i++)for(s=n[i],r=0;r<s.count();r++)if(l=s.at(r),a=l.offsetWidth,u=l.offsetHeight,h=l.offsetLeft+a,f=l.offsetTop+u,o||(c=s.at(r+1)),c&&(c.offsetLeft!=l.offsetLeft?h=this._isRtl?l.offsetLeft+(l.offsetLeft-c.offsetLeft):c.offsetLeft:f=c.offsetTop),t>=l.offsetLeft&&t<h&&e>=l.offsetTop&&e<f)return l},refresh:function(){var t;for(t=0;t<this._daySlotCollections.length;t++)this._daySlotCollections[t].refresh();for(t=0;t<this._timeSlotCollections.length;t++)this._timeSlotCollections[t].refresh()},timeSlotRanges:function(t,e){var n,o=this._timeSlotCollections,i=this._startSlot(t,o);return!i.inRange&&t>=i.slot.end&&(i=null),n=i,t<e&&(n=this._endSlot(e,o)),n&&!n.inRange&&e<=n.slot.start&&(n=null),null===i&&null===n?[]:(null===i&&(i={inRange:!0,slot:o[n.slot.collectionIndex].first()}),null===n&&(n={inRange:!0,slot:o[i.slot.collectionIndex].last()}),this._continuousRange(E,o,i,n))},daySlotRanges:function(t,e,n){var o,i=this._daySlotCollections,s=this._startSlot(t,i,n);if(!s.inRange&&t>=s.slot.end&&(s=null),o=s,t<e&&(o=this._endSlot(e,i,n)),o&&!o.inRange&&e<=o.slot.start&&(o=null),null===s&&null===o)return[];if(null===s)do t+=x.date.MS_PER_DAY,s=this._startSlot(t,i,n);while(!s.inRange&&t>=s.slot.end);if(null===o)do e-=x.date.MS_PER_DAY,o=this._endSlot(e,i,n);while(!o.inRange&&e<=o.slot.start);return this._continuousRange(G,i,s,o)},_continuousRange:function(t,e,n,o){var i,s,r,l,a,u,c=n.slot,h=o.slot,f=c.collectionIndex,d=h.collectionIndex,g=[];for(i=f;i<=d;i++)s=e[i],r=s.first(),l=s.last(),a=!1,u=!1,i==f&&(u=!n.inRange),i==d&&(a=!o.inRange),r.start<c.start&&(r=c),l.start>h.start&&(l=h),f<d&&(i==f?a=!0:i==d?u=!0:a=u=!0),g.push(new t({start:r,end:l,collection:s,head:a,tail:u}));return g},slotRanges:function(t,e){var n=t._startTime||x.date.toUtcTime(t.start),o=t._endTime||x.date.toUtcTime(t.end);return void 0===e&&(e=t.isMultiDay()),e?this.daySlotRanges(n,o,t.isAllDay):this.timeSlotRanges(n,o)},ranges:function(t,e,n,o){return"number"!=typeof t&&(t=x.date.toUtcTime(t)),"number"!=typeof e&&(e=x.date.toUtcTime(e)),n?this.daySlotRanges(t,e,o):this.timeSlotRanges(t,e)},_startCollection:function(t,e){var n,o;for(n=0;n<e.length;n++)if(o=e[n],o.startInRange(t))return o;return null},_endCollection:function(t,e,n){var o,i;for(o=0;o<e.length;o++)if(i=e[o],i.endInRange(t,n))return i;return null},_getCollections:function(t){return t?this._daySlotCollections:this._timeSlotCollections},continuousSlot:function(t,e){var n=e?-1:1,o=this._getCollections(t.isDaySlot),i=o[t.collectionIndex+n];return i?i[e?"last":"first"]():void 0},firstSlot:function(){var t=this._getCollections(this.daySlotCollectionCount());return t[0].first()},lastSlot:function(){var t=this._getCollections(this.daySlotCollectionCount());return t[t.length-1].last()},upSlot:function(t,e,n){var o=this,i=function(t,n,i){var s=0===i;if(!e&&!t&&s&&o.daySlotCollectionCount())return o._daySlotCollections[0].at(n)};return this.timeSlotCollectionCount()||(e=!0),this._verticalSlot(t,-1,i,n)},downSlot:function(t,e,n){var o=this,i=function(t,n,i){if(!e&&t&&o.timeSlotCollectionCount())return o._timeSlotCollections[i].at(0)};return this.timeSlotCollectionCount()||(e=!0),this._verticalSlot(t,1,i,n)},leftSlot:function(t,e){return this._horizontalSlot(t,-1,e)},rightSlot:function(t,e){return this._horizontalSlot(t,1,e)},_horizontalSlot:function(t,e,n){var o,i=t.index,s=t.isDaySlot,r=t.collectionIndex,l=this._getCollections(s);return s=!n&&s,s?i+=e:r+=e,o=l[r],o?o.at(i):void 0},_verticalSlot:function(t,e,n,o){var i,s=t.index,r=t.isDaySlot,l=t.collectionIndex,a=this._getCollections(r);return(t=n(r,l,s))?t:(r=!o&&r,r?l+=e:s+=e,i=a[l],i?i.at(s):void 0)},_collection:function(t,e){var n=e?this._daySlotCollections:this._timeSlotCollections;return n[t]},_startSlot:function(t,e,n){var o,i=this._startCollection(t,e),s=!0;return i||(i=e[0],s=!1),o=i.slotByStartDate(t,n),o||(o=i.first(),s=!1),{slot:o,inRange:s}},_endSlot:function(t,e,n){var o,i=this._endCollection(t,e,n),s=!0;return i||(i=e[e.length-1],s=!1),o=i.slotByEndDate(t,n),o||(o=i.last(),s=!1),{slot:o,inRange:s}},getSlotCollection:function(t,e){return this[e?"getDaySlotCollection":"getTimeSlotCollection"](t)},getTimeSlotCollection:function(t){return this._timeSlotCollections[t]},getDaySlotCollection:function(t){return this._daySlotCollections[t]}}),z=x.Class.extend({init:function(e){t.extend(this,e)},innerHeight:function(){var t,e=this.collection,n=this.start.index,o=this.end.index,i=0;for(t=n;t<=o;t++)i+=e.at(t).offsetHeight;return i},events:function(){return this.collection.events()},addEvent:function(t){this.events().push(t)},startSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.end:this.start},endSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.start:this.end}}),E=z.extend({innerHeight:function(){var t,e=this.collection,n=this.start.index,o=this.end.index,i=0;for(t=n;t<=o;t++)i+=e.at(t).offsetHeight;return i},outerRect:function(t,e,n){return this._rect("offset",t,e,n)},_rect:function(t,e,n,o){var i,s,r,l,a,u,c,h,f=this.start,d=this.end,g=x.support.isRtl(f.element);return"number"!=typeof e&&(e=x.date.toUtcTime(e)),"number"!=typeof n&&(n=x.date.toUtcTime(n)),o?(i=f.offsetTop,s=d.offsetTop+d[t+"Height"],g?(r=d.offsetLeft,l=f.offsetLeft+f[t+"Width"]):(r=f.offsetLeft,l=d.offsetLeft+d[t+"Width"])):(a=e-f.start,a<0&&(a=0),u=f.end-f.start,i=f.offsetTop+f[t+"Height"]*a/u,c=d.end-n,c<0&&(c=0),h=d.end-d.start,s=d.offsetTop+d[t+"Height"]-d[t+"Height"]*c/h,g?(r=Math.round(d.offsetLeft+d[t+"Width"]*c/h),l=Math.round(f.offsetLeft+f[t+"Width"]-f[t+"Width"]*a/u)):(r=Math.round(f.offsetLeft+f[t+"Width"]*a/u),l=Math.round(d.offsetLeft+d[t+"Width"]-d[t+"Width"]*c/h))),{top:i,bottom:s,left:0===r?r:r+1,right:l}},innerRect:function(t,e,n){return this._rect("client",t,e,n)}}),G=z.extend({innerWidth:function(){var t,e=this.collection,n=this.start.index,o=this.end.index,i=0,s=n!==o?"offsetWidth":"clientWidth";for(t=n;t<=o;t++)i+=e.at(t)[s];return i}}),B=x.Class.extend({init:function(t,e,n,o){this._slots=[],this._events=[],this._start=x.date.toUtcTime(t),this._end=x.date.toUtcTime(e),this._groupIndex=n,this._collectionIndex=o},refresh:function(){for(var t=0;t<this._slots.length;t++)this._slots[t].refresh()},startInRange:function(t){return this._start<=t&&t<this._end},endInRange:function(t,e){var n=e?t<this._end:t<=this._end;return this._start<=t&&n},slotByStartDate:function(t){var e,n,o=t;for("number"!=typeof o&&(o=x.date.toUtcTime(t)),e=0;e<this._slots.length;e++)if(n=this._slots[e],n.startInRange(o))return n;return null},slotByEndDate:function(t,e){var n,o,i=t;if("number"!=typeof i&&(i=x.date.toUtcTime(t)),e)return this.slotByStartDate(t,!1);for(n=0;n<this._slots.length;n++)if(o=this._slots[n],o.endInRange(i))return o;return null},count:function(){return this._slots.length},events:function(){return this._events},addTimeSlot:function(t,e,n,o){var i=new V(t,e,n,this._groupIndex,this._collectionIndex,this._slots.length,o);this._slots.push(i)},addDaySlot:function(t,e,n,o){var i=new A(t,e,n,this._groupIndex,this._collectionIndex,this._slots.length,o);this._slots.push(i)},first:function(){return this._slots[0]},last:function(){return this._slots[this._slots.length-1]},at:function(t){return this._slots[t]}}),W=x.Class.extend({init:function(t,e,n,o,i,s){this.element=t,this.clientWidth=t.clientWidth,this.clientHeight=t.clientHeight,this.offsetWidth=t.offsetWidth,this.offsetHeight=t.offsetHeight,this.offsetTop=t.offsetTop,this.offsetLeft=t.offsetLeft,this.start=e,this.end=n,this.element=t,this.groupIndex=o,this.collectionIndex=i,this.index=s,this.isDaySlot=!1},refresh:function(){var t=this.element;this.clientWidth=t.clientWidth,this.clientHeight=t.clientHeight,this.offsetWidth=t.offsetWidth,this.offsetHeight=t.offsetHeight,this.offsetTop=t.offsetTop,this.offsetLeft=t.offsetLeft},startDate:function(){return x.timezone.toLocalDate(this.start)},endDate:function(){return x.timezone.toLocalDate(this.end)},startInRange:function(t){return this.start<=t&&t<this.end},endInRange:function(t){return this.start<t&&t<=this.end},startOffset:function(){return this.start},endOffset:function(){return this.end}}),V=W.extend({init:function(t,e,n,o,i,s,r){W.fn.init.apply(this,arguments),this.isHorizontal=!!r},offsetX:function(t,e){return t?this.offsetLeft+e:this.offsetLeft+e},startInRange:function(t){return this.start<=t&&t<this.end},endInRange:function(t){return this.start<t&&t<=this.end},startOffset:function(e,n,o){var i,s,r,l,a;if(o)return this.start;if(i=t(this.element).offset(),s=this.end-this.start,this.isHorizontal){if(a=x.support.isRtl(this.element),r=e-i.left,l=Math.floor(s*(r/this.offsetWidth)),a)return this.start+s-l}else r=n-i.top,l=Math.floor(s*(r/this.offsetHeight));return this.start+l},endOffset:function(e,n,o){var i,s,r,l,a;if(o)return this.end;if(i=t(this.element).offset(),s=this.end-this.start,this.isHorizontal){if(a=x.support.isRtl(this.element),r=e-i.left,l=Math.floor(s*(r/this.offsetWidth)),a)return this.start+s-l}else r=n-i.top,l=Math.floor(s*(r/this.offsetHeight));return this.start+l}}),A=W.extend({init:function(t,e,n,o,i,s,r){W.fn.init.apply(this,arguments),this.eventCount=r,this.isDaySlot=!0,this.element.children.length?(this.firstChildHeight=this.element.children[0].offsetHeight+3,this.firstChildTop=this.element.children[0].offsetTop):(this.firstChildHeight=3,this.firstChildTop=0)},startDate:function(){var t=new Date(this.start);return x.timezone.apply(t,"Etc/UTC")},endDate:function(){var t=new Date(this.end);return x.timezone.apply(t,"Etc/UTC")},startInRange:function(t){return this.start<=t&&t<this.end},endInRange:function(t){return this.start<t&&t<=this.end}});x.ui.SchedulerView=I.extend({init:function(e,n){I.fn.init.call(this,e,n),this._normalizeOptions(),this._scrollbar=u(),this._isRtl=x.support.isRtl(e),this._resizeHint=t(),this._moveHint=t(),this._cellId=x.guid(),this._resourcesForGroups(),this._selectedSlots=[]},_normalizeOptions:function(){var t=this.options;t.startTime&&t.startTime.setMilliseconds(0),t.endTime&&t.endTime.setMilliseconds(0),t.workDayStart&&t.workDayStart.setMilliseconds(0),t.workDayEnd&&t.workDayEnd.setMilliseconds(0)},_isMobile:function(){var t=this.options;return t.mobile===!0&&x.support.mobileOS||"phone"===t.mobile||"tablet"===t.mobile},_isMobilePhoneView:function(){var t=this.options;return t.mobile===!0&&x.support.mobileOS&&!x.support.mobileOS.tablet||"phone"===t.mobile},_addResourceView:function(){var t=new L(this.groups.length,this._isRtl);return this.groups.push(t),t},dateForTitle:function(){return x.format(this.options.selectedDateFormat,this.startDate(),this.endDate())},shortDateForTitle:function(){return x.format(this.options.selectedShortDateFormat,this.startDate(),this.endDate())},_changeGroup:function(t,e){var n=e?"prevGroupSlot":"nextGroupSlot",o=this[n](t.start,t.groupIndex,t.isAllDay);return o&&(t.groupIndex+=e?-1:1),this._isGroupedByDate()&&!o&&(t.groupIndex=e?this.groups.length-1:0),o},_changeDate:function(t,e,n){var o,i,s,r=this.groups[t.groupIndex];if(n){if(o=r._getCollections(!1),i=r.daySlotCollectionCount()?e.index-1:e.collectionIndex-1,i>=0)return o[i]._slots[o[i]._slots.length-1]}else if(o=r._getCollections(r.daySlotCollectionCount()),i=r.daySlotCollectionCount()?0:e.collectionIndex+1,s=r.daySlotCollectionCount()?e.collectionIndex+1:0,o[i]&&o[i]._slots[s])return o[i]._slots[s]},_changeGroupContinuously:function(){return null},_changeViewPeriod:function(){return!1},_horizontalSlots:function(t,e,n,o){var i,s,r,l=o?"leftSlot":"rightSlot",a={startSlot:e[0].start,endSlot:e[e.length-1].end},u=this.groups[t.groupIndex],c=this._isVerticallyGrouped();return n||(i=this._normalizeHorizontalSelection(t,e,o),i&&(a.startSlot=a.endSlot=i)),this._isGroupedByDate()&&!n?(s=this._changeGroup(t,o),s?a.startSlot=a.endSlot=s:a=this._getNextHorizontalRange(u,l,a)):(a.startSlot=u[l](a.startSlot),a.endSlot=u[l](a.endSlot),n||c||a.startSlot&&a.endSlot||(a.startSlot=a.endSlot=this._changeGroup(t,o))),a.startSlot&&a.endSlot||this._isGroupedByDate()||(r=this._continuousSlot(t,e,o),r=this._changeGroupContinuously(t,r,n,o),r&&(a.startSlot=a.endSlot=r)),a},_getNextHorizontalRange:function(t,e,n){return this._isVerticallyGrouped()||(n.startSlot=t[e](n.startSlot),n.endSlot=t[e](n.endSlot)),n},_verticalSlots:function(t,e,n,o){var i,s,r=this.groups[t.groupIndex],l={startSlot:e[0].start,endSlot:e[e.length-1].end};return n||(i=this._normalizeVerticalSelection(t,e,o),i&&(l.startSlot=l.endSlot=i)),s=o?"upSlot":"downSlot",l=this._getNextVerticalRange(r,s,l,n),n||!this._isVerticallyGrouped()||l.startSlot&&l.endSlot||(l.startSlot=l.endSlot=this._isGroupedByDate()?this._changeDate(t,i,o):this._changeGroup(t,o)),l},_getNextVerticalRange:function(t,e,n,o){return n.startSlot=t[e](n.startSlot,o),n.endSlot=t[e](n.endSlot,o),n},_normalizeHorizontalSelection:function(){return null},_normalizeVerticalSelection:function(t,e,n){var o;return o=n?e[0].start:e[e.length-1].end},_continuousSlot:function(){return null},constrainSelection:function(t){var e,n=this.groups[0];this.inRange(t)?n.daySlotCollectionCount()?n.timeSlotCollectionCount()||(t.isAllDay=!0):t.isAllDay=!1:(e=n.firstSlot(),t.isAllDay=e.isDaySlot,t.start=e.startDate(),t.end=e.endDate()),this.groups[t.groupIndex]||(t.groupIndex=0)},move:function(t,e,n){var o,i,s,r,l,a,u=!1,c=this.groups[t.groupIndex],h=this._isGroupedByDate()&&this._isVerticallyGrouped();if(c.timeSlotCollectionCount()||(t.isAllDay=!0),o=c.ranges(t.start,t.end,t.isAllDay,!1),e===w.DOWN||e===w.UP){if(u=!0,r=e===w.UP,this._updateDirection(t,o,n,r,!0),l=this._verticalSlots(t,o,n,r),!l.startSlot&&!n&&this._changeViewPeriod(t,r,!h))return u}else if((e===w.LEFT||e===w.RIGHT)&&(u=!0,r=e===w.LEFT,this._updateDirection(t,o,n,r,!1),l=this._horizontalSlots(t,o,n,r),!l.startSlot&&!n&&this._changeViewPeriod(t,r,h)))return u;return u&&(i=l.startSlot,s=l.endSlot,n?(a=t.backward,a&&i?t.start=i.startDate():!a&&s&&(t.end=s.endDate())):i&&s&&(t.isAllDay=i.isDaySlot,t.start=i.startDate(),t.end=s.endDate()),t.events=[]),u},moveToEventInGroup:function(e,n,o,i){for(var s,r,l=e._continuousEvents||[],a=i?-1:1,u=l.length,c=i?u-1:0;c<u&&c>-1;){if(r=l[c],(!i&&r.start.startDate()>=n.startDate()||i&&r.start.startDate()<=n.startDate())&&(o.length&&(r=l[c+a]),r&&t.inArray(r.uid,o)===-1)){s=!!r;break}c+=a}return r},moveToEvent:function(t,e){var n,o,i,s,r,l,a=t.groupIndex,u=this.groups[a],c=u.ranges(t.start,t.end,t.isAllDay,!1)[0].start,h=this.groups.length,f=e?-1:1,d=t.events;if(this._isGroupedByDate())if(o=this._getAllEvents(),i=this._getUniqueEvents(o),s=this._getSortedEvents(i),0===d.length)r=this._getNextEventIndexBySlot(c,s,a),e&&r--,n=s[r];else for(l=this._getStartIdx(d,s);l<s.length&&l>-1&&(d.length>0&&(c=this._getSelectedSlot(c,s,n,l,f,e)),c);){if((!e&&s[l].start.startDate()>=c.startDate()||e&&s[l].start.startDate()<=c.startDate())&&d[0]!=s[l].uid){n=s[l];break}l+=f}else for(;a<h&&a>-1&&(n=this.moveToEventInGroup(u,c,d,e),a+=f,u=this.groups[a],u&&!n);)d=[],c=e?u.lastSlot():u.firstSlot(!0);return n&&(t.events=[n.uid],t.start=n.start.startDate(),t.end=n.end.endDate(),t.isAllDay=n.start.isDaySlot,t.groupIndex=n.start.groupIndex),!!n},current:function(t){return void 0===t?this._current:(this._current=t,void(this.content.has(t)&&this._scrollTo(t,this.content[0])))},select:function(t){this.clearSelection(),this._selectEvents(t)||this._selectSlots(t)},_getNextEventIndexBySlot:function(t,e,n){var o,i,s=0,r=x.date.getDate(t.startDate());for(o=0;o<e.length;o++)if(i=x.date.getDate(e[o].start.startDate()),r>i)s++;else if(r.getTime()===i.getTime()&&n>e[o].start.groupIndex)s++;else{if(!(r.getTime()===i.getTime()&&n>=e[o].start.groupIndex&&t.startDate()>e[o].start.startDate()))break;s++}return s},_getSelectedSlot:function(t,e,n,o,i,s){var r,l;return e[o+i]&&e[o].start.groupIndex!==e[o+i].start.groupIndex&&(r=e[o+i].start.groupIndex,l=this.groups[r],l&&!n||(t=null),t=s?l.lastSlot():l.firstSlot(!0)),t},_getStartIdx:function(e,n){var o=0;return t.each(n,function(){return this.uid!==e[0]&&void o++}),o},_getAllEvents:function(){var t,e=[],n=this.groups;for(t=0;t<n.length;t++)n[t]._continuousEvents&&(e=e.concat(n[t]._continuousEvents));return e},_getUniqueEvents:function(t){var e,n,o,i=[];for(e=0;e<t.length;e++){for(n=!1,o=0;o<i.length;o++)if(t[e].uid===i[o].uid){n=!0;break}n||i.push(t[e])}return i},_getSortedEvents:function(e){return e.sort(function(e,n){var o=e.start.startDate(),i=n.start.startDate(),s=x.date.getDate(o)-x.date.getDate(i);return 0===s&&(s=e.start.groupIndex-n.start.groupIndex),0===s&&(s=o.getTime()-i.getTime()),0===s&&(e.start.isDaySlot&&!n.start.isDaySlot&&(s=-1),!e.start.isDaySlot&&n.start.isDaySlot&&(s=1)),0===s&&(s=t(e.element).index()-t(n.element).index()),s})},_selectSlots:function(t){var e,n,o,i,s,r,l,a=t.isAllDay,u=this.groups[t.groupIndex];for(u.timeSlotCollectionCount()||(a=!0),this._selectedSlots=[],e=u.ranges(t.start,t.end,a,!1),i=0;i<e.length;i++)for(s=e[i],r=s.collection,l=s.start.index;l<=s.end.index;l++)o=r.at(l),n=o.element,n.setAttribute("aria-selected",!0),S(n),this._selectedSlots.push({start:o.startDate(),end:o.endDate(),element:n});t.backward&&(n=e[0].start.element),this.current(n)},_selectEvents:function(e){var n,o,i=!1,s=e.events,r=this.groups[e.groupIndex]._continuousEvents||[],l=r.length;if(!s[0]||!r[0])return i;for(o=t(),e.events=[],n=0;n<l;n++)t.inArray(r[n].uid,s)>-1&&(o=o.add(r[n].element),e.events.push(r[n].uid));return o[0]&&(o.addClass("k-state-selected").attr("aria-selected",!0),this.current(o.last()[0]),this._selectedSlots=[],i=!0),i},inRange:function(t){var e=this.startDate(),n=x.date.addDays(this.endDate(),1),o=t.start,i=t.end;return e<=o&&o<n&&e<i&&i<=n},_resourceValue:function(t,e){return t.valuePrimitive&&(e=x.getter(t.dataValueField)(e)),e},_resourceBySlot:function(t){var e,n,o,i,s,r=this.groupedResources,l={};if(r.length)for(e=t.groupIndex,n=r.length-1;n>=0;n--)o=r[n],i=this._resourceValue(o,o.dataSource.view()[e%o.dataSource.total()]),o.multiple&&(i=[i]),s=x.setter(o.field),s(l,i),e=Math.floor(e/o.dataSource.total());return l},_createResizeHint:function(e,n,o,i){return t(T).css({left:e,top:n,width:o,height:i})},_removeResizeHint:function(){this._resizeHint.remove(),this._resizeHint=t()},_removeMoveHint:function(){this._moveHint.remove(),this._moveHint=t()},_scrollTo:function(t,e){var n=t.offsetTop,o=t.offsetHeight,i=e.scrollTop,s=e.clientHeight,r=n+o,l=0;l=i>n?n:r>i+s?o<=s?r-s:n:i,e.scrollTop=l},_shouldInverseResourceColor:function(t){var e=new C(t.color).isDark(),n=this.element.css("color"),o=new C(n).isDark();return e==o},_eventTmpl:function(e,n){var o,i=this.options,s=t.extend({},x.Template,i.templateSettings),r=s.paramName,l="",a=typeof e,u={storage:{},count:0};return"function"===a?(u.storage["tmpl"+u.count]=e,l+="#=this.tmpl"+u.count+"("+r+")#",u.count++):"string"===a&&(l+=e),o=x.template(x.format(n,l),s),u.count>0&&(o=t.proxy(o,u.storage)),o},eventResources:function(t){var e,n,o,i,s,r,l,a,u,c,h=[],f=this.options;if(!f.resources)return h;for(e=0;e<f.resources.length;e++)if(n=f.resources[e],o=n.field,i=x.getter(o)(t),null!=i)for(n.multiple||(i=[i]),s=n.dataSource.view(),r=0;r<i.length;r++){for(l=null,a=i[r],n.valuePrimitive||(a=x.getter(n.dataValueField)(a)),u=0;u<s.length;u++)if(s[u].get(n.dataValueField)==a){l=s[u];break}null!==l&&(c=x.getter(n.dataColorField)(l),h.push({field:n.field,title:n.title,name:n.name,text:x.getter(n.dataTextField)(l),value:a,color:c}))}return h},createLayout:function(o){var i,s,r,l,a,u=-1;for(o.rows||(o.rows=[]),i=0;i<o.rows.length;i++)if(o.rows[i].allDay){u=i;break}s=o.rows[u],u>=0&&o.rows.splice(u,1),r=this.columnLevels=e(o,"columns"),l=this.rowLevels=e(o,"rows"),this.table=t("<table "+n()+' class="k-scheduler-layout k-scheduler-'+this.name+'view"><tbody></tbody></table>'),a=l[l.length-1].length,this.table.find("tbody:first").append(this._topSection(r,s,a)),this.table.find("tbody:first").append(this._bottomSection(r,l,a)),this.element.append(this.table),this._scroller()},refreshLayout:function(){var e,n,o,i,s,r,l=this,a=l.element.find(">.k-scheduler-toolbar"),u=l.element.innerHeight(),c=this._scrollbar,h=0,f=this._isRtl?"left":"right";for(e=0;e<a.length;e++)u-=k(a.eq(e));l.datesHeader&&(h=k(l.datesHeader)),l.timesHeader&&k(l.timesHeader)>h&&(h=k(l.timesHeader)),l.datesHeader&&l.timesHeader&&(n=l.datesHeader.find("table:first tr"),l.timesHeader.find("tr").height(function(e){t(this).height(n.eq(e).height())})),h&&(u-=h),l.footer&&(u-=k(l.footer)),o=function(t){var e,n;return!!t[0].style.height||(e=t.height(),t.height("auto"),n=t.height(),e!=n?(t.height(""),!0):(t.height(""),!1))},i=l.content[0],s=x.support.kineticScrollNeeded?0:c,o(l.element)&&(l.content.height(u>2*c?u:2*c+1),l.times.height(i.clientHeight),r=l.times.find("table"),r.length&&r.height(l.content.find("table")[0].clientHeight)),i.offsetWidth-i.clientWidth>0?(l.table.addClass("k-scrollbar-v"),l.datesHeader.css("padding-"+f,s-parseInt(l.datesHeader.children().css("border-"+f+"-width"),10))):l.datesHeader.css("padding-"+f,""),i.offsetHeight-i.clientHeight>0||i.clientHeight>l.content.children(".k-scheduler-table").height()?l.table.addClass("k-scrollbar-h"):l.table.removeClass("k-scrollbar-h")},_topSection:function(e,n,o){this.timesHeader=s(e.length,n,o);var i=e[e.length-1].length;return this.datesHeader=r(e,i,n),t("<tr>").append(this.timesHeader.add(this.datesHeader).wrap("<td>").parent())},_bottomSection:function(e,n,o){return this.times=l(n,o),this.content=a(e[e.length-1],n[n.length-1]),t("<tr>").append(this.times.add(this.content).wrap("<td>").parent())},_scroller:function(){var e,n=this;this.content.bind("scroll"+H,function(){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(this.scrollLeft),n.times.scrollTop(this.scrollTop)}),e=x.touchScroller(this.content,{avoidScrolling:function(e){return t(e.event.target).closest(".k-event.k-event-active").length>0}}),e&&e.movable&&(this._touchScroller=e,this.content=e.scrollElement,e.movable.bind("change",function(t){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(-t.sender.x),n.times.scrollTop(-t.sender.y)}))},_resourcesForGroups:function(){var t,e,n,o,i=[],s=this.options.group,r=this.options.resources;if(s=s&&s.resources?s.resources:[],r&&s.length)for(t=0,e=r.length;t<e;t++)for(n=0,o=s.length;n<o;n++)r[t].name===s[n]&&i.push(r[t]);this.groupedResources=i},_createDateLayout:function(t,e,n){return _("rows",t,e,n)},_createColumnsLayout:function(t,e,n,o,i){return v("columns",t,e,n,o,i)},_groupOrientation:function(){var t=this.options.group;return t&&t.resources?t.orientation:"horizontal"},_isGroupedByDate:function(){return this.options.group&&this.options.group.date},_isVerticallyGrouped:function(){return this.groupedResources.length&&"vertical"===this._groupOrientation()},_createRowsLayout:function(t,e,n,o){return v("rows",t,e,n,o)},selectionByElement:function(){return null},clearSelection:function(){this.content.find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},destroy:function(){var t=this;I.fn.destroy.call(this),t.table&&(x.destroy(t.table),t.table.remove()),t.groups=null,t.table=null,t.content=null,t.times=null,t.datesHeader=null,t.timesHeader=null,t.footer=null,t._resizeHint=null,t._moveHint=null},calendarInfo:function(){return x.getCulture().calendars.standard},prevGroupSlot:function(t,e,n){var o,i=this.groups[e],s=i.ranges(t,t,n,!1)[0].start;if(!(e<=0))return this._isGroupedByDate()?s:this._isVerticallyGrouped()?i.timeSlotCollectionCount()?(o=i._collection(n?s.index:s.collectionIndex,!1),o.last()):(o=i._collection(i.daySlotCollectionCount()-1,!0),o.at(s.index)):i.timeSlotCollectionCount()?(o=i._collection(n?0:i.timeSlotCollectionCount()-1,n),n?o.last():o.at(s.index)):(o=i._collection(s.collectionIndex,!0),o.last())},nextGroupSlot:function(t,e,n){var o,i,s=this.groups[e],r=s.ranges(t,t,n,!1)[0].start;if(!(e>=this.groups.length-1))return this._isGroupedByDate()?r:this._isVerticallyGrouped()?s.timeSlotCollectionCount()?(i=s.daySlotCollectionCount(),o=s._collection(i?0:r.collectionIndex,i),n?o.first():o.at(r.collectionIndex)):(o=s._collection(0,!0),o.at(r.index)):s.timeSlotCollectionCount()?(o=s._collection(0,n),n?o.first():o.at(r.index)):(o=s._collection(r.collectionIndex,!0),o.first())},_eventOptionsForMove:function(){return{}},_updateEventForResize:function(){},_updateEventForSelection:function(t){return t}}),C=function(t){var e,n,o,i,s,r=this,l=C.formats;if(1===arguments.length)for(t=r.resolveColor(t),i=0;i<l.length;i++)e=l[i].re,n=l[i].process,o=e.exec(t),o&&(s=n(o),r.r=s[0],r.g=s[1],r.b=s[2]);else r.r=arguments[0],r.g=arguments[1],r.b=arguments[2];r.r=r.normalizeByte(r.r),r.g=r.normalizeByte(r.g),r.b=r.normalizeByte(r.b)},C.prototype={resolveColor:function(t){return t=t||"#000","#"==t.charAt(0)&&(t=t.substr(1,6)),t=t.replace(/ /g,""),t=t.toLowerCase(),t=C.namedColors[t]||t},normalizeByte:function(t){return t<0||isNaN(t)?0:t>255?255:t},percBrightness:function(){var t=this;return R.sqrt(.241*t.r*t.r+.691*t.g*t.g+.068*t.b*t.b)},isDark:function(){var t=this,e=t.percBrightness();return e<180}},C.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(t){return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],C.namedColors={aqua:"00ffff",azure:"f0ffff",beige:"f5f5dc",black:"000000",blue:"0000ff",brown:"a52a2a",coral:"ff7f50",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgray:"a9a9a9",darkgreen:"006400",darkorange:"ff8c00",darkred:"8b0000",dimgray:"696969",fuchsia:"ff00ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lightblue:"add8e6",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumblue:"0000cd",navy:"000080",olive:"808000",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",pink:"ffc0cb",plum:"dda0dd",purple:"800080",red:"ff0000",royalblue:"4169e1",salmon:"fa8072",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",steelblue:"4682b4",tan:"d2b48c",teal:"008080",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},b=/\s*k-state-selected/,t.extend(D.SchedulerView,{createColumns:d,createRows:g,rangeIndex:h,collidingEvents:c,groupEqFilter:m})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()});
//# sourceMappingURL=kendo.scheduler.view.min.js.map
