{"version":3,"sources":["kendo.scheduler.view.js"],"names":["f","define","kendo","ui","scheduler","$","levels","values","key","collect","depth","level","idx","result","length","push","cellspacing","support","cssBorderSpacing","table","tableRows","className","trim","join","allDayTable","timesHeader","columnLevelCount","allDaySlot","rowCount","text","datesHeader","columnLevels","columnCount","columnIndex","columnLevelIndex","th","colspan","column","allDayTableRows","lastLevel","td","cellContent","dateTableRows","times","rowLevels","isMobile","rowIndex","rowLevelIndex","rowspan","rows","Array","split","rowHeaderRows","allDay","indexOf","content","scrollbar","scrollbarWidth","collidingEvents","elements","start","end","index","startIndex","overlaps","endIndex","rangeIndex","eventsForSlot","eventElement","slotStart","slotEnd","event","events","createColumns","eventElements","_createColumns","createRows","eventRange","j","columnLength","endOverlaps","columns","createDateLayoutConfiguration","name","dates","inner","configuration","each","item","obj","minorTicks","createLayoutConfiguration","resources","template","data","dataIndex","resource","dataSource","view","htmlEncode","getter","dataTextField","color","dataColorField","field","title","value","dataValueField","slice","groupEqFilter","isArray","ObservableArray","addSelectedState","cell","replace","selectedStateRegExp","Color","window","getDate","date","Widget","outerHeight","_outerHeight","keys","NS","INVERSE_COLOR_CLASS","MIN_HORIZONTAL_SCROLL_SIZE","math","Math","HINT","ResourceView","Class","extend","init","isRtl","this","_index","_timeSlotCollections","_daySlotCollections","_isRtl","addTimeSlotCollection","startDate","endDate","_addCollection","addDaySlotCollection","collections","collection","SlotCollection","timeSlotCollectionCount","daySlotCollectionCount","daySlotByPosition","x","y","byDate","_slotByPosition","timeSlotByPosition","collectionIndex","slotIndex","slot","width","height","nextSlot","horizontalEnd","verticalEnd","count","at","offsetWidth","offsetHeight","offsetLeft","offsetTop","refresh","timeSlotRanges","startTime","endTime","_startSlot","inRange","_endSlot","first","last","_continuousRange","TimeSlotRange","daySlotRanges","isAllDay","MS_PER_DAY","DaySlotRange","range","head","tail","startSlot","endSlot","ranges","slotRanges","isDay","_startTime","toUtcTime","_endTime","undefined","isMultiDay","_startCollection","startInRange","_endCollection","endInRange","_getCollections","continuousSlot","reverse","pad","isDaySlot","firstSlot","lastSlot","upSlot","keepCollection","groupByDateVertically","that","moveToDaySlot","isFirstCell","_verticalSlot","downSlot","moveToTimeSlot","leftSlot","_horizontalSlot","rightSlot","step","swapCollection","_collection","multiday","time","slotByStartDate","slotByEndDate","getSlotCollection","getTimeSlotCollection","getDaySlotCollection","SlotRange","options","innerHeight","addEvent","outerRect","snap","_rect","property","top","bottom","left","right","startOffset","startSlotDuration","endOffset","endSlotDuration","element","round","innerRect","innerWidth","groupIndex","_slots","_events","_start","_end","_groupIndex","_collectionIndex","allday","addTimeSlot","isHorizontal","TimeSlot","addDaySlot","eventCount","DaySlot","Slot","clientWidth","clientHeight","timezone","toLocalDate","fn","apply","arguments","offsetX","rtl","offset","duration","difference","floor","children","firstChild","firstChildHeight","firstChildTop","Date","SchedulerView","call","_normalizeOptions","_scrollbar","_resizeHint","_moveHint","_cellId","guid","_resourcesForGroups","_selectedSlots","visibleEndDate","setMilliseconds","workDayStart","workDayEnd","_isMobile","mobile","mobileOS","_addResourceView","resourceView","groups","dateForTitle","format","selectedDateFormat","shortDateForTitle","selectedShortDateFormat","mobileDateForTitle","selectedMobileDateFormat","_changeGroup","selection","previous","method","_isGroupedByDate","_changeDate","group","_changeGroupContinuously","_changeViewPeriod","_isInRange","newStart","newEnd","min","max","_horizontalSlots","multiple","tempSlot","horizontalRange","isVertical","_isVerticallyGrouped","_normalizeHorizontalSelection","_getNextHorizontalRange","_continuousSlot","_verticalSlots","verticalRange","_normalizeVerticalSelection","_getNextVerticalRange","_footer","html","messages","today","footer","appendTo","on","e","action","currentDate","timezoneOffset","preventDefault","convert","getTimezoneOffset","trigger","constrainSelection","move","shift","slots","backward","handled","verticalByDate","DOWN","UP","_updateDirection","LEFT","RIGHT","moveToEventInGroup","selectedEvents","prev","found","lastSelected","i","_continuousEvents","uid","inArray","moveToEvent","allEvents","uniqueAllEvents","sortedEvents","eventIndex","_getAllEvents","_getUniqueEvents","_getSortedEvents","_getNextEventIndexBySlot","_getStartIdx","_getSelectedSlot","current","candidate","_current","has","_scrollTo","select","clearSelection","_selectEvents","_selectSlots","eventStartDate","tempIndex","slotStartDate","getTime","selectedEventIndex","concat","exists","sort","second","firstStartDate","secondStartDate","setAttribute","groupEvent","groupEvents","add","addClass","attr","addDays","_resourceValue","valuePrimitive","_resourceBySlot","resourceIndex","setter","groupedResources","total","_createResizeHint","css","_removeResizeHint","remove","_removeMoveHint","filter","container","elementOffset","elementOffsetDir","containerScroll","scrollTop","containerOffsetDir","bottomDistance","_inverseEventColor","eventColor","eventColorIsDark","isDark","eventBackground","eventBackgroundIsDark","_eventTmpl","wrapper","tmpl","settings","Template","templateSettings","paramName","type","state","storage","proxy","eventResources","eventResource","resourceColor","get","createLayout","layout","allDayIndex","splice","_isVirtualized","_trimRowLevels","find","append","_topSection","_bottomSection","_updateDomRowLevels","_groupOrientation","_outerWidth","_scroller","virtual","levelMarker","stopAtLevel","stop","lastGroup","cachedRowLevels","_hasContentToRender","hasParent","createNextLayout","trimmedRowLevels","rowSpan","clone","_height","parseInt","_virtualContent","render","_cachedEvents","_tryRenderContent","bufferHeight","groupCells","_rowLevelIndices","map","toArray","refreshLayout","datesHeaderRows","isSchedulerHeightSet","contentDiv","timesTable","toolbar","headerHeight","paddingDirection","eq","el","initialHeight","newHeight","style","kineticScrollNeeded","removeClass","dateGroup","thElm","closest","wrap","parent","touchScroller","bind","scrollLeft","avoidScrolling","target","movable","_touchScroller","scrollElement","sender","groupIdx","groupLength","_createDateLayout","_createColumnsLayout","orientation","_createRowsLayout","selectionByElement","removeAttr","destroy","calendarInfo","getCulture","calendars","standard","prevGroupSlot","nextGroupSlot","_eventOptionsForMove","_updateEventForResize","_updateEventForSelection","re","processor","parts","channels","formats","resolveColor","process","exec","r","g","b","normalizeByte","prototype","charAt","substr","toLowerCase","namedColors","isNaN","percBrightness","sqrt","brightnessValue","aqua","azure","beige","black","blue","brown","coral","cyan","darkblue","darkcyan","darkgray","darkgreen","darkorange","darkred","dimgray","fuchsia","gold","goldenrod","gray","green","greenyellow","indigo","ivory","khaki","lightblue","lightgrey","lightgreen","lightpink","lightyellow","lime","limegreen","linen","magenta","maroon","mediumblue","navy","olive","orange","orangered","orchid","pink","plum","purple","red","royalblue","salmon","silver","skyblue","slateblue","slategray","snow","steelblue","tan","teal","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,wBAAyB,cAAeD,IACjD,WA6kEE,MApkEAE,OAAMC,GAAGC,aACR,SAAUC,GAEP,QAASC,GAAOC,EAAQC,GAEpB,QAASC,GAAQC,EAAOH,GAAxB,GAGYI,GACKC,CAFb,IADAL,EAASA,EAAOC,GAGZ,IADIG,EAAQE,EAAOH,GAASG,EAAOH,OAC1BE,EAAM,EAAGA,EAAML,EAAOO,OAAQF,IACnCD,EAAMI,KAAKR,EAAOK,IAClBH,EAAQC,EAAQ,EAAGH,EAAOK,IAPtC,GAAIC,KAYJ,OADAJ,GAAQ,EAAGF,GACJM,EAEX,QAASG,KACL,MAAId,GAAMe,QAAQC,iBACP,GAEJ,kBAEX,QAASC,GAAMC,EAAWC,GACtB,MAAKD,GAAUN,OAGR,6BAA+BE,IAAgB,WAAad,EAAMoB,KAAK,sBAAwBD,GAAa,KAAO,SAAgBD,EAAUG,KAAK,aAAe,gBAF7J,GAIf,QAASC,GAAYJ,EAAWC,GAC5B,MAAKD,GAAUN,OAGR,kCAAsCK,EAAMC,EAAWC,GAAa,SAFhE,GAIf,QAASI,GAAYC,EAAkBC,EAAYC,GAAnD,GAGiBhB,GAFTQ,IACJ,IAAIQ,EAAW,EACX,IAAShB,EAAM,EAAGA,EAAMc,EAAkBd,IACtCQ,EAAUL,KAAK,mBAMvB,OAHIY,IACAP,EAAUL,KAAK,yCAA2CY,EAAWE,KAAO,SAE5ED,EAAW,EACJvB,IAEJA,EAAE,kCAAo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,MAAO,SACPC,UAAW,SACXC,UAAW,SACXC,WAAY,SACZC,UAAW,SACXC,YAAa,SACbC,KAAM,SACNC,UAAW,SACXC,MAAO,SACPC,QAAS,SACTC,OAAQ,SACRC,WAAY,SACZC,KAAM,SACNC,MAAO,SACPC,OAAQ,SACRC,UAAW,SACXC,OAAQ,SACRC,KAAM,SACNC,KAAM,SACNC,OAAQ,SACRC,IAAK,SACLC,UAAW,SACXC,OAAQ,SACRC,OAAQ,SACRC,QAAS,SACTC,UAAW,SACXC,UAAW,SACXC,KAAM,SACNC,UAAW,SACXC,IAAK,SACLC,KAAM,SACNC,OAAQ,SACRC,UAAW,SACXC,OAAQ,SACRC,MAAO,SACPC,MAAO,SACPC,WAAY,SACZC,OAAQ,SACRC,YAAa,UA+Fbxf,EAAsB,sBAI1B9G,EAAE+H,OAAOjI,EAAGyR,eACRnN,cAAeA,EACfG,WAAYA,EACZV,WAAYA,EACZR,gBAAiBA,EACjBmD,cAAeA,KAErBQ,OAAOnH,MAAM0mB,QACRvf,OAAOnH,OACE,kBAAVD,SAAwBA,OAAO4mB,IAAM5mB,OAAS,SAAU6mB,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.scheduler.view.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('kendo.scheduler.view', ['kendo.core'], f);\n}(function () {\n var __meta__ = {\n id: 'scheduler.view',\n name: 'Scheduler View',\n category: 'web',\n description: 'The Scheduler Common View',\n depends: ['core'],\n hidden: true\n };\n kendo.ui.scheduler = {};\n (function ($) {\n var kendo = window.kendo, ui = kendo.ui, getDate = kendo.date.getDate, Widget = ui.Widget, outerHeight = kendo._outerHeight, keys = kendo.keys, NS = '.kendoSchedulerView', INVERSE_COLOR_CLASS = 'k-event-inverse', MIN_HORIZONTAL_SCROLL_SIZE = 1024, math = Math;\n function levels(values, key) {\n var result = [];\n function collect(depth, values) {\n values = values[key];\n if (values) {\n var level = result[depth] = result[depth] || [];\n for (var idx = 0; idx < values.length; idx++) {\n level.push(values[idx]);\n collect(depth + 1, values[idx]);\n }\n }\n }\n collect(0, values);\n return result;\n }\n function cellspacing() {\n if (kendo.support.cssBorderSpacing) {\n return '';\n }\n return 'cellspacing=\"0\"';\n }\n function table(tableRows, className) {\n if (!tableRows.length) {\n return '';\n }\n return '' + '' + tableRows.join('') + '' + '
';\n }\n function allDayTable(tableRows, className) {\n if (!tableRows.length) {\n return '';\n }\n return '
' + table(tableRows, className) + '
';\n }\n function timesHeader(columnLevelCount, allDaySlot, rowCount) {\n var tableRows = [];\n if (rowCount > 0) {\n for (var idx = 0; idx < columnLevelCount; idx++) {\n tableRows.push('​');\n }\n }\n if (allDaySlot) {\n tableRows.push('' + allDaySlot.text + '');\n }\n if (rowCount < 1) {\n return $();\n }\n return $('
' + table(tableRows) + '
');\n }\n function datesHeader(columnLevels, columnCount, allDaySlot) {\n var dateTableRows = [];\n var columnIndex;\n for (var columnLevelIndex = 0; columnLevelIndex < columnLevels.length; columnLevelIndex++) {\n var level = columnLevels[columnLevelIndex];\n var th = [];\n var colspan = columnCount / level.length;\n for (columnIndex = 0; columnIndex < level.length; columnIndex++) {\n var column = level[columnIndex];\n th.push('' + column.text + '');\n }\n dateTableRows.push(th.join(''));\n }\n var allDayTableRows = [];\n if (allDaySlot) {\n var lastLevel = columnLevels[columnLevels.length - 1];\n var td = [];\n var cellContent = allDaySlot.cellContent;\n for (columnIndex = 0; columnIndex < lastLevel.length; columnIndex++) {\n td.push('' + (cellContent ? cellContent(columnIndex) : ' ') + '');\n }\n allDayTableRows.push(td.join(''));\n }\n return $('
' + '
' + table(dateTableRows) + allDayTable(allDayTableRows, 'k-scheduler-header-all-day') + '
' + '
');\n }\n function times(rowLevels, rowCount, isMobile) {\n var rows = new Array(rowCount).join().split(',');\n var rowHeaderRows = [];\n var rowIndex;\n for (var rowLevelIndex = 0; rowLevelIndex < rowLevels.length; rowLevelIndex++) {\n var level = rowLevels[rowLevelIndex];\n var rowspan = rowCount / level.length;\n var className;\n var text;\n for (rowIndex = 0; rowIndex < level.length; rowIndex++) {\n className = level[rowIndex].className || '';\n text = level[rowIndex].text;\n if (level[rowIndex].allDay) {\n className = 'k-scheduler-times-all-day';\n }\n if (isMobile && className.indexOf('k-scheduler-group-cell') !== -1) {\n text = '' + text + '';\n }\n rows[rowspan * rowIndex] += '' + text + '';\n }\n }\n for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n rowHeaderRows.push(rows[rowIndex]);\n }\n if (rowCount < 1) {\n return $();\n }\n return $('
' + table(rowHeaderRows) + '
');\n }\n function content() {\n return $('
' + '
' + '
');\n }\n var HINT = '
' + '
' + '
' + '
' + '
' + '
' + '
';\n var ResourceView = kendo.Class.extend({\n init: function (index, isRtl) {\n this._index = index;\n this._timeSlotCollections = [];\n this._daySlotCollections = [];\n this._isRtl = isRtl;\n },\n addTimeSlotCollection: function (startDate, endDate) {\n return this._addCollection(startDate, endDate, this._timeSlotCollections);\n },\n addDaySlotCollection: function (startDate, endDate) {\n return this._addCollection(startDate, endDate, this._daySlotCollections);\n },\n _addCollection: function (startDate, endDate, collections) {\n var collection = new SlotCollection(startDate, endDate, this._index, collections.length);\n collections.push(collection);\n return collection;\n },\n timeSlotCollectionCount: function () {\n return this._timeSlotCollections.length;\n },\n daySlotCollectionCount: function () {\n return this._daySlotCollections.length;\n },\n daySlotByPosition: function (x, y, byDate) {\n return this._slotByPosition(x, y, this._daySlotCollections, byDate);\n },\n timeSlotByPosition: function (x, y, byDate) {\n return this._slotByPosition(x, y, this._timeSlotCollections, byDate);\n },\n _slotByPosition: function (x, y, collections, byDate) {\n for (var collectionIndex = 0; collectionIndex < collections.length; collectionIndex++) {\n var collection = collections[collectionIndex];\n for (var slotIndex = 0; slotIndex < collection.count(); slotIndex++) {\n var slot = collection.at(slotIndex);\n var width = slot.offsetWidth;\n var height = slot.offsetHeight;\n var nextSlot;\n var horizontalEnd = slot.offsetLeft + width;\n var verticalEnd = slot.offsetTop + height;\n if (!byDate) {\n nextSlot = collection.at(slotIndex + 1);\n }\n if (nextSlot) {\n if (nextSlot.offsetLeft != slot.offsetLeft) {\n if (this._isRtl) {\n horizontalEnd = slot.offsetLeft + (slot.offsetLeft - nextSlot.offsetLeft);\n } else {\n horizontalEnd = nextSlot.offsetLeft;\n }\n } else {\n verticalEnd = nextSlot.offsetTop;\n }\n }\n if (x >= slot.offsetLeft && x < horizontalEnd && y >= slot.offsetTop && y < verticalEnd) {\n return slot;\n }\n }\n }\n },\n refresh: function () {\n var collectionIndex;\n for (collectionIndex = 0; collectionIndex < this._daySlotCollections.length; collectionIndex++) {\n this._daySlotCollections[collectionIndex].refresh();\n }\n for (collectionIndex = 0; collectionIndex < this._timeSlotCollections.length; collectionIndex++) {\n this._timeSlotCollections[collectionIndex].refresh();\n }\n },\n timeSlotRanges: function (startTime, endTime) {\n var collections = this._timeSlotCollections;\n var start = this._startSlot(startTime, collections);\n if (!start.inRange && startTime >= start.slot.end) {\n start = null;\n }\n var end = start;\n if (startTime < endTime) {\n end = this._endSlot(endTime, collections);\n }\n if (end && !end.inRange && endTime <= end.slot.start) {\n end = null;\n }\n if (start === null && end === null) {\n return [];\n }\n if (start === null) {\n if (end.slot.end <= startTime) {\n return [];\n }\n start = {\n inRange: true,\n slot: collections[end.slot.collectionIndex].first()\n };\n }\n if (end === null) {\n if (start.slot.start >= endTime) {\n return [];\n }\n end = {\n inRange: true,\n slot: collections[start.slot.collectionIndex].last()\n };\n }\n return this._continuousRange(TimeSlotRange, collections, start, end);\n },\n daySlotRanges: function (startTime, endTime, isAllDay) {\n var collections = this._daySlotCollections;\n var start = this._startSlot(startTime, collections, isAllDay);\n if (!start.inRange && startTime >= start.slot.end) {\n start = null;\n }\n var end = start;\n if (startTime < endTime) {\n end = this._endSlot(endTime, collections, isAllDay);\n }\n if (end && !end.inRange && endTime <= end.slot.start) {\n end = null;\n }\n if (start === null && end === null) {\n return [];\n }\n if (start === null) {\n if (end.slot.end <= startTime) {\n return [];\n }\n do {\n startTime += kendo.date.MS_PER_DAY;\n start = this._startSlot(startTime, collections, isAllDay);\n } while (!start.inRange && startTime >= start.slot.end);\n }\n if (end === null) {\n if (start.slot.start >= endTime) {\n return [];\n }\n do {\n endTime -= kendo.date.MS_PER_DAY;\n end = this._endSlot(endTime, collections, isAllDay);\n } while (!end.inRange && endTime <= end.slot.start);\n }\n return this._continuousRange(DaySlotRange, collections, start, end);\n },\n _continuousRange: function (range, collections, start, end) {\n var startSlot = start.slot;\n var endSlot = end.slot;\n var startIndex = startSlot.collectionIndex;\n var endIndex = endSlot.collectionIndex;\n var ranges = [];\n for (var collectionIndex = startIndex; collectionIndex <= endIndex; collectionIndex++) {\n var collection = collections[collectionIndex];\n var first = collection.first();\n var last = collection.last();\n var head = false;\n var tail = false;\n if (collectionIndex == startIndex) {\n tail = !start.inRange;\n }\n if (collectionIndex == endIndex) {\n head = !end.inRange;\n }\n if (first.start < startSlot.start) {\n first = startSlot;\n }\n if (last.start > endSlot.start) {\n last = endSlot;\n }\n if (startIndex < endIndex) {\n if (collectionIndex == startIndex) {\n head = true;\n } else if (collectionIndex == endIndex) {\n tail = true;\n } else {\n head = tail = true;\n }\n }\n ranges.push(new range({\n start: first,\n end: last,\n collection: collection,\n head: head,\n tail: tail\n }));\n }\n return ranges;\n },\n slotRanges: function (event, isDay) {\n var startTime = event._startTime || kendo.date.toUtcTime(event.start);\n var endTime = event._endTime || kendo.date.toUtcTime(event.end);\n if (isDay === undefined) {\n isDay = event.isMultiDay();\n }\n if (isDay) {\n return this.daySlotRanges(startTime, endTime, event.isAllDay);\n }\n return this.timeSlotRanges(startTime, endTime);\n },\n ranges: function (startTime, endTime, isDay, isAllDay) {\n if (typeof startTime != 'number') {\n startTime = kendo.date.toUtcTime(startTime);\n }\n if (typeof endTime != 'number') {\n endTime = kendo.date.toUtcTime(endTime);\n }\n if (isDay) {\n return this.daySlotRanges(startTime, endTime, isAllDay);\n }\n return this.timeSlotRanges(startTime, endTime);\n },\n _startCollection: function (date, collections) {\n for (var collectionIndex = 0; collectionIndex < collections.length; collectionIndex++) {\n var collection = collections[collectionIndex];\n if (collection.startInRange(date)) {\n return collection;\n }\n }\n return null;\n },\n _endCollection: function (date, collections, isAllDay) {\n for (var collectionIndex = 0; collectionIndex < collections.length; collectionIndex++) {\n var collection = collections[collectionIndex];\n if (collection.endInRange(date, isAllDay)) {\n return collection;\n }\n }\n return null;\n },\n _getCollections: function (isDay) {\n return isDay ? this._daySlotCollections : this._timeSlotCollections;\n },\n continuousSlot: function (slot, reverse) {\n var pad = reverse ? -1 : 1;\n var collections = this._getCollections(slot.isDaySlot);\n var collection = collections[slot.collectionIndex + pad];\n return collection ? collection[reverse ? 'last' : 'first']() : undefined;\n },\n firstSlot: function () {\n var collections = this._getCollections(this.daySlotCollectionCount());\n return collections[0].first();\n },\n lastSlot: function () {\n var collections = this._getCollections(this.daySlotCollectionCount());\n return collections[collections.length - 1].last();\n },\n upSlot: function (slot, keepCollection, groupByDateVertically) {\n var that = this;\n var moveToDaySlot = function (isDaySlot, collectionIndex, index) {\n var isFirstCell = index === 0;\n if (!keepCollection && !isDaySlot && isFirstCell && that.daySlotCollectionCount()) {\n return that._daySlotCollections[0].at(collectionIndex);\n }\n };\n if (!this.timeSlotCollectionCount()) {\n keepCollection = true;\n }\n return this._verticalSlot(slot, -1, moveToDaySlot, groupByDateVertically);\n },\n downSlot: function (slot, keepCollection, groupByDateVertically) {\n var that = this;\n var moveToTimeSlot = function (isDaySlot, collectionIndex, index) {\n if (!keepCollection && isDaySlot && that.timeSlotCollectionCount()) {\n return that._timeSlotCollections[index].at(0);\n }\n };\n if (!this.timeSlotCollectionCount()) {\n keepCollection = true;\n }\n return this._verticalSlot(slot, 1, moveToTimeSlot, groupByDateVertically);\n },\n leftSlot: function (slot, groupByDateVertically) {\n return this._horizontalSlot(slot, -1, groupByDateVertically);\n },\n rightSlot: function (slot, groupByDateVertically) {\n return this._horizontalSlot(slot, 1, groupByDateVertically);\n },\n _horizontalSlot: function (slot, step, groupByDateVertically) {\n var index = slot.index;\n var isDaySlot = slot.isDaySlot;\n var collectionIndex = slot.collectionIndex;\n var collections = this._getCollections(isDaySlot);\n isDaySlot = groupByDateVertically ? false : isDaySlot;\n if (isDaySlot) {\n index += step;\n } else {\n collectionIndex += step;\n }\n var collection = collections[collectionIndex];\n return collection ? collection.at(index) : undefined;\n },\n _verticalSlot: function (slot, step, swapCollection, groupByDateVertically) {\n var index = slot.index;\n var isDaySlot = slot.isDaySlot;\n var collectionIndex = slot.collectionIndex;\n var collections = this._getCollections(isDaySlot);\n slot = swapCollection(isDaySlot, collectionIndex, index);\n if (slot) {\n return slot;\n }\n isDaySlot = groupByDateVertically ? false : isDaySlot;\n if (isDaySlot) {\n collectionIndex += step;\n } else {\n index += step;\n }\n var collection = collections[collectionIndex];\n return collection ? collection.at(index) : undefined;\n },\n _collection: function (index, multiday) {\n var collections = multiday ? this._daySlotCollections : this._timeSlotCollections;\n return collections[index];\n },\n _startSlot: function (time, collections, isAllDay) {\n var collection = this._startCollection(time, collections);\n var inRange = true;\n if (!collection) {\n collection = collections[0];\n inRange = false;\n }\n var slot = collection.slotByStartDate(time, isAllDay);\n if (!slot) {\n slot = collection.first();\n inRange = false;\n }\n return {\n slot: slot,\n inRange: inRange\n };\n },\n _endSlot: function (time, collections, isAllDay) {\n var collection = this._endCollection(time, collections, isAllDay);\n var inRange = true;\n if (!collection) {\n collection = collections[collections.length - 1];\n inRange = false;\n }\n var slot = collection.slotByEndDate(time, isAllDay);\n if (!slot) {\n slot = collection.last();\n inRange = false;\n }\n return {\n slot: slot,\n inRange: inRange\n };\n },\n getSlotCollection: function (index, isDay) {\n return this[isDay ? 'getDaySlotCollection' : 'getTimeSlotCollection'](index);\n },\n getTimeSlotCollection: function (index) {\n return this._timeSlotCollections[index];\n },\n getDaySlotCollection: function (index) {\n return this._daySlotCollections[index];\n }\n });\n var SlotRange = kendo.Class.extend({\n init: function (options) {\n $.extend(this, options);\n },\n innerHeight: function () {\n var collection = this.collection;\n var startIndex = this.start.index;\n var endIndex = this.end.index;\n var result = 0;\n for (var slotIndex = startIndex; slotIndex <= endIndex; slotIndex++) {\n result += collection.at(slotIndex).offsetHeight;\n }\n return result;\n },\n events: function () {\n return this.collection.events();\n },\n addEvent: function (event) {\n this.events().push(event);\n },\n startSlot: function () {\n if (this.start.offsetLeft > this.end.offsetLeft) {\n return this.end;\n }\n return this.start;\n },\n endSlot: function () {\n if (this.start.offsetLeft > this.end.offsetLeft) {\n return this.start;\n }\n return this.end;\n }\n });\n var TimeSlotRange = SlotRange.extend({\n innerHeight: function () {\n var collection = this.collection;\n var startIndex = this.start.index;\n var endIndex = this.end.index;\n var result = 0;\n for (var slotIndex = startIndex; slotIndex <= endIndex; slotIndex++) {\n result += collection.at(slotIndex).offsetHeight;\n }\n return result;\n },\n outerRect: function (start, end, snap) {\n return this._rect('offset', start, end, snap);\n },\n _rect: function (property, start, end, snap) {\n var top;\n var bottom;\n var left;\n var right;\n var startSlot = this.start;\n var endSlot = this.end;\n var isRtl = kendo.support.isRtl(startSlot.element);\n if (typeof start != 'number') {\n start = kendo.date.toUtcTime(start);\n }\n if (typeof end != 'number') {\n end = kendo.date.toUtcTime(end);\n }\n if (snap) {\n top = startSlot.offsetTop;\n bottom = endSlot.offsetTop + endSlot[property + 'Height'];\n if (isRtl) {\n left = endSlot.offsetLeft;\n right = startSlot.offsetLeft + startSlot[property + 'Width'];\n } else {\n left = startSlot.offsetLeft;\n right = endSlot.offsetLeft + endSlot[property + 'Width'];\n }\n } else {\n var startOffset = start - startSlot.start;\n if (startOffset < 0) {\n startOffset = 0;\n }\n var startSlotDuration = startSlot.end - startSlot.start;\n top = startSlot.offsetTop + startSlot[property + 'Height'] * startOffset / startSlotDuration;\n var endOffset = endSlot.end - end;\n if (endOffset < 0) {\n endOffset = 0;\n }\n var endSlotDuration = endSlot.end - endSlot.start;\n bottom = endSlot.offsetTop + endSlot[property + 'Height'] - endSlot[property + 'Height'] * endOffset / endSlotDuration;\n if (isRtl) {\n left = Math.round(endSlot.offsetLeft + endSlot[property + 'Width'] * endOffset / endSlotDuration);\n right = Math.round(startSlot.offsetLeft + startSlot[property + 'Width'] - startSlot[property + 'Width'] * startOffset / startSlotDuration);\n } else {\n left = Math.round(startSlot.offsetLeft + startSlot[property + 'Width'] * startOffset / startSlotDuration);\n right = Math.round(endSlot.offsetLeft + endSlot[property + 'Width'] - endSlot[property + 'Width'] * endOffset / endSlotDuration);\n }\n }\n return {\n top: top,\n bottom: bottom,\n left: left === 0 ? left : left + 1,\n right: right\n };\n },\n innerRect: function (start, end, snap) {\n return this._rect('client', start, end, snap);\n }\n });\n var DaySlotRange = SlotRange.extend({\n innerWidth: function () {\n var collection = this.collection;\n var startIndex = this.start.index;\n var endIndex = this.end.index;\n var result = 0;\n var width = startIndex !== endIndex ? 'offsetWidth' : 'clientWidth';\n for (var slotIndex = startIndex; slotIndex <= endIndex; slotIndex++) {\n result += collection.at(slotIndex)[width];\n }\n return result;\n }\n });\n var SlotCollection = kendo.Class.extend({\n init: function (startDate, endDate, groupIndex, collectionIndex) {\n this._slots = [];\n this._events = [];\n this._start = kendo.date.toUtcTime(startDate);\n this._end = kendo.date.toUtcTime(endDate);\n this._groupIndex = groupIndex;\n this._collectionIndex = collectionIndex;\n },\n refresh: function () {\n for (var slotIndex = 0; slotIndex < this._slots.length; slotIndex++) {\n this._slots[slotIndex].refresh();\n }\n },\n startInRange: function (date) {\n return this._start <= date && date < this._end;\n },\n endInRange: function (date, isAllDay) {\n var end = isAllDay ? date < this._end : date <= this._end;\n return this._start <= date && end;\n },\n slotByStartDate: function (date) {\n var time = date;\n if (typeof time != 'number') {\n time = kendo.date.toUtcTime(date);\n }\n for (var slotIndex = 0; slotIndex < this._slots.length; slotIndex++) {\n var slot = this._slots[slotIndex];\n if (slot.startInRange(time)) {\n return slot;\n }\n }\n return null;\n },\n slotByEndDate: function (date, allday) {\n var time = date;\n if (typeof time != 'number') {\n time = kendo.date.toUtcTime(date);\n }\n if (allday) {\n return this.slotByStartDate(date, false);\n }\n for (var slotIndex = 0; slotIndex < this._slots.length; slotIndex++) {\n var slot = this._slots[slotIndex];\n if (slot.endInRange(time)) {\n return slot;\n }\n }\n return null;\n },\n count: function () {\n return this._slots.length;\n },\n events: function () {\n return this._events;\n },\n addTimeSlot: function (element, start, end, isHorizontal) {\n var slot = new TimeSlot(element, start, end, this._groupIndex, this._collectionIndex, this._slots.length, isHorizontal);\n this._slots.push(slot);\n },\n addDaySlot: function (element, start, end, eventCount) {\n var slot = new DaySlot(element, start, end, this._groupIndex, this._collectionIndex, this._slots.length, eventCount);\n this._slots.push(slot);\n },\n first: function () {\n return this._slots[0];\n },\n last: function () {\n return this._slots[this._slots.length - 1];\n },\n at: function (index) {\n return this._slots[index];\n }\n });\n var Slot = kendo.Class.extend({\n init: function (element, start, end, groupIndex, collectionIndex, index) {\n this.element = element;\n this.clientWidth = element.clientWidth;\n this.clientHeight = element.clientHeight;\n this.offsetWidth = element.offsetWidth;\n this.offsetHeight = element.offsetHeight;\n this.offsetTop = element.offsetTop;\n this.offsetLeft = element.offsetLeft;\n this.start = start;\n this.end = end;\n this.element = element;\n this.groupIndex = groupIndex;\n this.collectionIndex = collectionIndex;\n this.index = index;\n this.isDaySlot = false;\n },\n refresh: function () {\n var element = this.element;\n this.clientWidth = element.clientWidth;\n this.clientHeight = element.clientHeight;\n this.offsetWidth = element.offsetWidth;\n this.offsetHeight = element.offsetHeight;\n this.offsetTop = element.offsetTop;\n this.offsetLeft = element.offsetLeft;\n },\n startDate: function () {\n return kendo.timezone.toLocalDate(this.start);\n },\n endDate: function () {\n return kendo.timezone.toLocalDate(this.end);\n },\n startInRange: function (date) {\n return this.start <= date && date < this.end;\n },\n endInRange: function (date) {\n return this.start < date && date <= this.end;\n },\n startOffset: function () {\n return this.start;\n },\n endOffset: function () {\n return this.end;\n }\n });\n var TimeSlot = Slot.extend({\n init: function (element, start, end, groupIndex, collectionIndex, index, isHorizontal) {\n Slot.fn.init.apply(this, arguments);\n this.isHorizontal = isHorizontal ? true : false;\n },\n offsetX: function (rtl, offset) {\n if (rtl) {\n return this.offsetLeft + offset;\n } else {\n return this.offsetLeft + offset;\n }\n },\n startInRange: function (date) {\n return this.start <= date && date < this.end;\n },\n endInRange: function (date) {\n return this.start < date && date <= this.end;\n },\n startOffset: function (x, y, snap) {\n if (snap) {\n return this.start;\n }\n var offset = $(this.element).offset();\n var duration = this.end - this.start;\n var difference;\n var time;\n if (this.isHorizontal) {\n var isRtl = kendo.support.isRtl(this.element);\n difference = x - offset.left;\n time = Math.floor(duration * (difference / this.offsetWidth));\n if (isRtl) {\n return this.start + duration - time;\n }\n } else {\n difference = y - offset.top;\n time = Math.floor(duration * (difference / this.offsetHeight));\n }\n return this.start + time;\n },\n endOffset: function (x, y, snap) {\n if (snap) {\n return this.end;\n }\n var offset = $(this.element).offset();\n var duration = this.end - this.start;\n var difference;\n var time;\n if (this.isHorizontal) {\n var isRtl = kendo.support.isRtl(this.element);\n difference = x - offset.left;\n time = Math.floor(duration * (difference / this.offsetWidth));\n if (isRtl) {\n return this.start + duration - time;\n }\n } else {\n difference = y - offset.top;\n time = Math.floor(duration * (difference / this.offsetHeight));\n }\n return this.start + time;\n }\n });\n var DaySlot = Slot.extend({\n init: function (element, start, end, groupIndex, collectionIndex, index, eventCount) {\n Slot.fn.init.apply(this, arguments);\n this.eventCount = eventCount;\n this.isDaySlot = true;\n if (this.element.children.length) {\n var firstChild = this.element.children[0];\n this.firstChildHeight = firstChild.offsetHeight;\n this.firstChildTop = firstChild.offsetTop;\n } else {\n this.firstChildHeight = 3;\n this.firstChildTop = 0;\n }\n },\n startDate: function () {\n var date = new Date(this.start);\n return kendo.timezone.apply(date, 'Etc/UTC');\n },\n endDate: function () {\n var date = new Date(this.end);\n return kendo.timezone.apply(date, 'Etc/UTC');\n },\n startInRange: function (date) {\n return this.start <= date && date < this.end;\n },\n endInRange: function (date) {\n return this.start < date && date <= this.end;\n }\n });\n var scrollbarWidth;\n function scrollbar() {\n scrollbarWidth = scrollbarWidth ? scrollbarWidth : kendo.support.scrollbar();\n return scrollbarWidth;\n }\n kendo.ui.SchedulerView = Widget.extend({\n init: function (element, options) {\n Widget.fn.init.call(this, element, options);\n this._normalizeOptions();\n this._scrollbar = scrollbar();\n this._isRtl = kendo.support.isRtl(element);\n this._resizeHint = $();\n this._moveHint = $();\n this._cellId = kendo.guid();\n this._resourcesForGroups();\n this._selectedSlots = [];\n },\n visibleEndDate: function () {\n return this.endDate();\n },\n _normalizeOptions: function () {\n var options = this.options;\n if (options.startTime) {\n options.startTime.setMilliseconds(0);\n }\n if (options.endTime) {\n options.endTime.setMilliseconds(0);\n }\n if (options.workDayStart) {\n options.workDayStart.setMilliseconds(0);\n }\n if (options.workDayEnd) {\n options.workDayEnd.setMilliseconds(0);\n }\n },\n _isMobile: function () {\n var options = this.options;\n return options.mobile === true && kendo.support.mobileOS || options.mobile === 'phone' || options.mobile === 'tablet';\n },\n _addResourceView: function () {\n var resourceView = new ResourceView(this.groups.length, this._isRtl);\n this.groups.push(resourceView);\n return resourceView;\n },\n dateForTitle: function () {\n return kendo.format(this.options.selectedDateFormat, this.startDate(), this.endDate());\n },\n shortDateForTitle: function () {\n return kendo.format(this.options.selectedShortDateFormat, this.startDate(), this.endDate());\n },\n mobileDateForTitle: function () {\n return kendo.format(this.options.selectedMobileDateFormat || this.options.selectedShortDateFormat, this.startDate(), this.endDate());\n },\n _changeGroup: function (selection, previous) {\n var method = previous ? 'prevGroupSlot' : 'nextGroupSlot';\n var slot = this[method](selection.start, selection.groupIndex, selection.isAllDay);\n if (slot) {\n selection.groupIndex += previous ? -1 : 1;\n }\n if (this._isGroupedByDate() && !slot) {\n selection.groupIndex = previous ? this.groups.length - 1 : 0;\n }\n return slot;\n },\n _changeDate: function (selection, slot, previous) {\n var group = this.groups[selection.groupIndex];\n var collections, index;\n if (previous) {\n collections = group._getCollections(false);\n index = group.daySlotCollectionCount() ? slot.index - 1 : slot.collectionIndex - 1;\n if (index >= 0) {\n return collections[index]._slots[collections[index]._slots.length - 1];\n }\n } else {\n collections = group._getCollections(group.daySlotCollectionCount());\n index = group.daySlotCollectionCount() ? 0 : slot.collectionIndex + 1;\n var slotIndex = group.daySlotCollectionCount() ? slot.collectionIndex + 1 : 0;\n if (collections[index] && collections[index]._slots[slotIndex]) {\n return collections[index]._slots[slotIndex];\n }\n }\n },\n _changeGroupContinuously: function () {\n return null;\n },\n _changeViewPeriod: function () {\n return false;\n },\n _isInRange: function (newStart, newEnd) {\n if (!newStart || !newEnd || !this.options.min || !this.options.max) {\n return false;\n }\n return getDate(newStart) <= getDate(this.options.min) || getDate(newEnd) >= getDate(this.options.max);\n },\n _horizontalSlots: function (selection, ranges, multiple, reverse) {\n var method = reverse ? 'leftSlot' : 'rightSlot';\n var horizontalRange = {\n startSlot: ranges[0].start,\n endSlot: ranges[ranges.length - 1].end\n };\n var group = this.groups[selection.groupIndex];\n var isVertical = this._isVerticallyGrouped();\n if (!multiple) {\n var slot = this._normalizeHorizontalSelection(selection, ranges, reverse);\n if (slot) {\n horizontalRange.startSlot = horizontalRange.endSlot = slot;\n }\n }\n if (this._isGroupedByDate() && !multiple) {\n var tempSlot = this._changeGroup(selection, reverse);\n if (!tempSlot) {\n horizontalRange = this._getNextHorizontalRange(group, method, horizontalRange);\n } else {\n horizontalRange.startSlot = horizontalRange.endSlot = tempSlot;\n }\n } else {\n horizontalRange.startSlot = group[method](horizontalRange.startSlot);\n horizontalRange.endSlot = group[method](horizontalRange.endSlot);\n if (!multiple && !isVertical && (!horizontalRange.startSlot || !horizontalRange.endSlot)) {\n horizontalRange.startSlot = horizontalRange.endSlot = this._changeGroup(selection, reverse);\n }\n }\n var continuousSlot;\n if ((!horizontalRange.startSlot || !horizontalRange.endSlot) && !this._isGroupedByDate()) {\n continuousSlot = this._continuousSlot(selection, ranges, reverse);\n continuousSlot = this._changeGroupContinuously(selection, continuousSlot, multiple, reverse);\n if (continuousSlot) {\n horizontalRange.startSlot = horizontalRange.endSlot = continuousSlot;\n }\n }\n return horizontalRange;\n },\n _getNextHorizontalRange: function (group, method, horizontalRange) {\n if (!this._isVerticallyGrouped()) {\n horizontalRange.startSlot = group[method](horizontalRange.startSlot);\n horizontalRange.endSlot = group[method](horizontalRange.endSlot);\n }\n return horizontalRange;\n },\n _verticalSlots: function (selection, ranges, multiple, reverse) {\n var group = this.groups[selection.groupIndex];\n var slot;\n var verticalRange = {\n startSlot: ranges[0].start,\n endSlot: ranges[ranges.length - 1].end\n };\n if (!multiple) {\n slot = this._normalizeVerticalSelection(selection, ranges, reverse);\n if (slot) {\n verticalRange.startSlot = verticalRange.endSlot = slot;\n }\n }\n var method = reverse ? 'upSlot' : 'downSlot';\n verticalRange = this._getNextVerticalRange(group, method, verticalRange, multiple);\n if (!multiple && this._isVerticallyGrouped() && (!verticalRange.startSlot || !verticalRange.endSlot)) {\n if (this._isGroupedByDate()) {\n verticalRange.startSlot = verticalRange.endSlot = this._changeDate(selection, slot, reverse);\n } else {\n verticalRange.startSlot = verticalRange.endSlot = this._changeGroup(selection, reverse);\n }\n }\n return verticalRange;\n },\n _getNextVerticalRange: function (group, method, verticalRange, multiple) {\n verticalRange.startSlot = group[method](verticalRange.startSlot, multiple);\n verticalRange.endSlot = group[method](verticalRange.endSlot, multiple);\n return verticalRange;\n },\n _normalizeHorizontalSelection: function () {\n return null;\n },\n _normalizeVerticalSelection: function (selection, ranges, reverse) {\n var slot;\n if (reverse) {\n slot = ranges[0].start;\n } else {\n slot = ranges[ranges.length - 1].end;\n }\n return slot;\n },\n _continuousSlot: function () {\n return null;\n },\n _footer: function () {\n var that = this;\n var options = that.options;\n if (that._isMobile()) {\n var html = '';\n that.footer = $(html).appendTo(that.element);\n }\n if (that.footer) {\n that.footer.on('click' + NS, '.k-scheduler-today', function (e) {\n e.preventDefault();\n var timezone = that.options.timezone;\n var action = 'today';\n var currentDate = new Date();\n var date;\n if (timezone) {\n var timezoneOffset = kendo.timezone.offset(currentDate, timezone);\n date = kendo.timezone.convert(currentDate, currentDate.getTimezoneOffset(), timezoneOffset);\n } else {\n date = currentDate;\n }\n that.trigger('navigate', {\n view: that.name || options.name,\n action: action,\n date: date\n });\n });\n }\n },\n constrainSelection: function (selection) {\n var group = this.groups[0];\n var slot;\n if (!this.inRange(selection)) {\n slot = group.firstSlot();\n selection.isAllDay = slot.isDaySlot;\n selection.start = slot.startDate();\n selection.end = slot.endDate();\n } else {\n if (!group.daySlotCollectionCount()) {\n selection.isAllDay = false;\n } else if (!group.timeSlotCollectionCount()) {\n selection.isAllDay = true;\n }\n }\n if (!this.groups[selection.groupIndex]) {\n selection.groupIndex = 0;\n }\n },\n move: function (selection, key, shift) {\n var handled = false;\n var group = this.groups[selection.groupIndex];\n var verticalByDate = this._isGroupedByDate() && this._isVerticallyGrouped();\n if (!group.timeSlotCollectionCount()) {\n selection.isAllDay = true;\n }\n var ranges = group.ranges(selection.start, selection.end, selection.isAllDay, false);\n var startSlot, endSlot, reverse, slots;\n if (key === keys.DOWN || key === keys.UP) {\n handled = true;\n reverse = key === keys.UP;\n this._updateDirection(selection, ranges, shift, reverse, true);\n slots = this._verticalSlots(selection, ranges, shift, reverse);\n if (!slots.startSlot && !shift && this._changeViewPeriod(selection, reverse, !verticalByDate)) {\n return handled;\n }\n } else if (key === keys.LEFT || key === keys.RIGHT) {\n handled = true;\n reverse = key === keys.LEFT;\n this._updateDirection(selection, ranges, shift, reverse, false);\n slots = this._horizontalSlots(selection, ranges, shift, reverse);\n if (!slots.startSlot && !shift && this._changeViewPeriod(selection, reverse, verticalByDate)) {\n return handled;\n }\n }\n if (handled) {\n startSlot = slots.startSlot;\n endSlot = slots.endSlot;\n if (shift) {\n var backward = selection.backward;\n if (backward && startSlot) {\n selection.start = startSlot.startDate();\n } else if (!backward && endSlot) {\n selection.end = endSlot.endDate();\n }\n } else if (startSlot && endSlot) {\n selection.isAllDay = startSlot.isDaySlot;\n selection.start = startSlot.startDate();\n selection.end = endSlot.endDate();\n }\n selection.events = [];\n }\n return handled;\n },\n moveToEventInGroup: function (group, slot, selectedEvents, prev) {\n var events = group._continuousEvents || [];\n var found, event;\n var pad = prev ? -1 : 1;\n var length = events.length;\n var idx = prev ? length - 1 : 0;\n if (selectedEvents.length) {\n var lastSelected = selectedEvents[selectedEvents.length - 1];\n for (var i = 0; i < events.length; i++) {\n if (events[i].uid === lastSelected) {\n idx = i + pad;\n }\n }\n }\n while (idx < length && idx > -1) {\n event = events[idx];\n if (!prev && event.start.startDate() >= slot.startDate() || prev && event.start.startDate() <= slot.startDate()) {\n if (event && $.inArray(event.uid, selectedEvents) === -1) {\n found = !!event;\n break;\n }\n }\n idx += pad;\n }\n return event;\n },\n moveToEvent: function (selection, prev) {\n var groupIndex = selection.groupIndex;\n var group = this.groups[groupIndex];\n var slot = group.ranges(selection.start, selection.end, selection.isAllDay, false)[0].start;\n var length = this.groups.length;\n var pad = prev ? -1 : 1;\n var events = selection.events;\n var event;\n if (this._isGroupedByDate()) {\n var allEvents = this._getAllEvents();\n var uniqueAllEvents = this._getUniqueEvents(allEvents);\n var sortedEvents = this._getSortedEvents(uniqueAllEvents);\n if (events.length === 0) {\n var eventIndex = this._getNextEventIndexBySlot(slot, sortedEvents, groupIndex);\n if (prev) {\n eventIndex--;\n }\n event = sortedEvents[eventIndex];\n } else {\n var idx = this._getStartIdx(events, sortedEvents);\n while (idx < sortedEvents.length && idx > -1) {\n if (events.length > 0) {\n slot = this._getSelectedSlot(slot, sortedEvents, event, idx, pad, prev);\n }\n if (!slot) {\n break;\n }\n if (!prev && sortedEvents[idx].start.startDate() >= slot.startDate() || prev && sortedEvents[idx].start.startDate() <= slot.startDate()) {\n if (events[0] != sortedEvents[idx].uid) {\n event = sortedEvents[idx];\n break;\n }\n }\n idx += pad;\n }\n }\n } else {\n while (groupIndex < length && groupIndex > -1) {\n event = this.moveToEventInGroup(group, slot, events, prev);\n groupIndex += pad;\n group = this.groups[groupIndex];\n if (!group || event) {\n break;\n }\n events = [];\n if (prev) {\n slot = group.lastSlot();\n } else {\n slot = group.firstSlot(true);\n }\n }\n }\n if (event) {\n selection.events = [event.uid];\n selection.start = event.start.startDate();\n selection.end = event.end.endDate();\n selection.isAllDay = event.start.isDaySlot;\n selection.groupIndex = event.start.groupIndex;\n }\n return !!event;\n },\n current: function (candidate) {\n if (candidate !== undefined) {\n this._current = candidate;\n if (this.content.has(candidate)) {\n this._scrollTo(candidate, this.content[0]);\n }\n } else {\n return this._current;\n }\n },\n select: function (selection) {\n this.clearSelection();\n if (!this._selectEvents(selection)) {\n this._selectSlots(selection);\n }\n },\n _getNextEventIndexBySlot: function (slot, sortedEvents, groupIndex) {\n var tempIndex = 0;\n var slotStartDate = kendo.date.getDate(slot.startDate());\n for (var i = 0; i < sortedEvents.length; i++) {\n var eventStartDate = kendo.date.getDate(sortedEvents[i].start.startDate());\n if (slotStartDate > eventStartDate) {\n tempIndex++;\n continue;\n }\n if (slotStartDate.getTime() === eventStartDate.getTime() && groupIndex > sortedEvents[i].start.groupIndex) {\n tempIndex++;\n continue;\n }\n if (slotStartDate.getTime() === eventStartDate.getTime() && groupIndex >= sortedEvents[i].start.groupIndex && slot.startDate() > sortedEvents[i].start.startDate()) {\n tempIndex++;\n continue;\n }\n break;\n }\n return tempIndex;\n },\n _getSelectedSlot: function (slot, sortedEvents, event, idx, pad, prev) {\n if (sortedEvents[idx + pad] && sortedEvents[idx].start.groupIndex !== sortedEvents[idx + pad].start.groupIndex) {\n var groupIndex = sortedEvents[idx + pad].start.groupIndex;\n var group = this.groups[groupIndex];\n if (!group || event) {\n slot = null;\n }\n if (prev) {\n slot = group.lastSlot();\n } else {\n slot = group.firstSlot(true);\n }\n }\n return slot;\n },\n _getStartIdx: function (events, sortedEvents) {\n var selectedEventIndex = 0;\n $.each(sortedEvents, function () {\n if (this.uid === events[0]) {\n return false;\n }\n selectedEventIndex++;\n });\n return selectedEventIndex;\n },\n _getAllEvents: function () {\n var allEvents = [];\n var groups = this.groups;\n for (var idx = 0; idx < groups.length; idx++) {\n if (groups[idx]._continuousEvents) {\n allEvents = allEvents.concat(groups[idx]._continuousEvents);\n }\n }\n return allEvents;\n },\n _getUniqueEvents: function (allEvents) {\n var uniqueAllEvents = [];\n for (var i = 0; i < allEvents.length; i++) {\n var exists = false;\n for (var j = 0; j < uniqueAllEvents.length; j++) {\n if (allEvents[i].uid === uniqueAllEvents[j].uid) {\n exists = true;\n break;\n }\n }\n if (!exists) {\n uniqueAllEvents.push(allEvents[i]);\n }\n }\n return uniqueAllEvents;\n },\n _getSortedEvents: function (uniqueAllEvents) {\n return uniqueAllEvents.sort(function (first, second) {\n var firstStartDate = first.start.startDate();\n var secondStartDate = second.start.startDate();\n var result = kendo.date.getDate(firstStartDate) - kendo.date.getDate(secondStartDate);\n if (result === 0) {\n result = first.start.groupIndex - second.start.groupIndex;\n }\n if (result === 0) {\n result = firstStartDate.getTime() - secondStartDate.getTime();\n }\n if (result === 0) {\n if (first.start.isDaySlot && !second.start.isDaySlot) {\n result = -1;\n }\n if (!first.start.isDaySlot && second.start.isDaySlot) {\n result = 1;\n }\n }\n if (result === 0) {\n result = $(first.element).index() - $(second.element).index();\n }\n return result;\n });\n },\n _selectSlots: function (selection) {\n var isAllDay = selection.isAllDay;\n var group = this.groups[selection.groupIndex];\n if (!group.timeSlotCollectionCount()) {\n isAllDay = true;\n }\n this._selectedSlots = [];\n var ranges = group.ranges(selection.start, selection.end, isAllDay, false);\n var element;\n var slot;\n for (var rangeIndex = 0; rangeIndex < ranges.length; rangeIndex++) {\n var range = ranges[rangeIndex];\n var collection = range.collection;\n for (var slotIndex = range.start.index; slotIndex <= range.end.index; slotIndex++) {\n slot = collection.at(slotIndex);\n element = slot.element;\n element.setAttribute('aria-selected', true);\n addSelectedState(element);\n this._selectedSlots.push({\n start: slot.startDate(),\n end: slot.endDate(),\n element: element\n });\n }\n }\n if (selection.backward) {\n element = ranges[0].start.element;\n }\n this.current(element);\n },\n _selectEvents: function (selection) {\n var found = false;\n var events = selection.events;\n var groupEvents = this._getAllEvents();\n var idx, groupEvent, length = groupEvents.length;\n if (!events[0] || !groupEvents[0]) {\n return found;\n }\n var result = $();\n selection.events = [];\n for (idx = 0; idx < length; idx++) {\n if ($.inArray(groupEvents[idx].uid, events) > -1) {\n groupEvent = groupEvents[idx];\n result = result.add(groupEvent.element);\n if (selection.events.indexOf(groupEvent.uid) === -1) {\n selection.events.push(groupEvent.uid);\n }\n }\n }\n if (result[0]) {\n result.addClass('k-state-selected').attr('aria-selected', true);\n this.current(result.last()[0]);\n this._selectedSlots = [];\n found = true;\n }\n return found;\n },\n inRange: function (options) {\n var startDate = this.startDate();\n var endDate = kendo.date.addDays(this.endDate(), 1);\n var start = options.start;\n var end = options.end;\n return startDate <= start && start < endDate && startDate < end && end <= endDate;\n },\n _resourceValue: function (resource, item) {\n if (resource.valuePrimitive) {\n item = kendo.getter(resource.dataValueField)(item);\n }\n return item;\n },\n _resourceBySlot: function (slot) {\n var resources = this.groupedResources;\n var result = {};\n if (resources.length) {\n var resourceIndex = slot.groupIndex;\n for (var idx = resources.length - 1; idx >= 0; idx--) {\n var resource = resources[idx];\n var value = this._resourceValue(resource, resource.dataSource.view()[resourceIndex % resource.dataSource.total()]);\n if (resource.multiple) {\n value = [value];\n }\n var setter = kendo.setter(resource.field);\n setter(result, value);\n resourceIndex = Math.floor(resourceIndex / resource.dataSource.total());\n }\n }\n return result;\n },\n _createResizeHint: function (left, top, width, height) {\n return $(HINT).css({\n left: left,\n top: top,\n width: width,\n height: height\n });\n },\n _removeResizeHint: function () {\n this._resizeHint.remove();\n this._resizeHint = $();\n },\n _removeMoveHint: function (uid) {\n if (uid) {\n this._moveHint.filter('[data-uid=\\'' + uid + '\\']').remove();\n this._moveHint = this._moveHint.filter('[data-uid!=\\'' + uid + '\\']');\n } else {\n this._moveHint.remove();\n this._moveHint = $();\n }\n },\n _scrollTo: function (element, container) {\n var elementOffset = element.offsetTop, elementOffsetDir = element.offsetHeight, containerScroll = container.scrollTop, containerOffsetDir = container.clientHeight, bottomDistance = elementOffset + elementOffsetDir, result = 0;\n if (containerScroll > elementOffset) {\n result = elementOffset;\n } else if (bottomDistance > containerScroll + containerOffsetDir) {\n if (elementOffsetDir <= containerOffsetDir) {\n result = bottomDistance - containerOffsetDir;\n } else {\n result = elementOffset;\n }\n } else {\n result = containerScroll;\n }\n container.scrollTop = result;\n },\n _inverseEventColor: function (element) {\n var eventColor = element.css('color');\n var eventColorIsDark = new Color(eventColor).isDark();\n var eventBackground = element.css('background-color');\n var eventBackgroundIsDark = new Color(eventBackground).isDark();\n if (eventColorIsDark == eventBackgroundIsDark) {\n element.addClass(INVERSE_COLOR_CLASS);\n }\n },\n _eventTmpl: function (template, wrapper) {\n var options = this.options, settings = $.extend({}, kendo.Template, options.templateSettings), paramName = settings.paramName, html = '', type = typeof template, state = {\n storage: {},\n count: 0\n };\n if (type === 'function') {\n state.storage['tmpl' + state.count] = template;\n html += '#=this.tmpl' + state.count + '(' + paramName + ')#';\n state.count++;\n } else if (type === 'string') {\n html += template;\n }\n var tmpl = kendo.template(kendo.format(wrapper, html), settings);\n if (state.count > 0) {\n tmpl = $.proxy(tmpl, state.storage);\n }\n return tmpl;\n },\n eventResources: function (event) {\n var resources = [], options = this.options;\n if (!options.resources) {\n return resources;\n }\n for (var idx = 0; idx < options.resources.length; idx++) {\n var resource = options.resources[idx];\n var field = resource.field;\n var eventResources = kendo.getter(field)(event);\n if (eventResources == null) {\n continue;\n }\n if (!resource.multiple) {\n eventResources = [eventResources];\n }\n var data = resource.dataSource.view();\n for (var resourceIndex = 0; resourceIndex < eventResources.length; resourceIndex++) {\n var eventResource = null;\n var value = eventResources[resourceIndex];\n if (!resource.valuePrimitive) {\n value = kendo.getter(resource.dataValueField)(value);\n }\n for (var dataIndex = 0; dataIndex < data.length; dataIndex++) {\n if (data[dataIndex].get(resource.dataValueField) == value) {\n eventResource = data[dataIndex];\n break;\n }\n }\n if (eventResource !== null) {\n var resourceColor = kendo.getter(resource.dataColorField)(eventResource);\n resources.push({\n field: resource.field,\n title: resource.title,\n name: resource.name,\n text: kendo.getter(resource.dataTextField)(eventResource),\n value: value,\n color: resourceColor\n });\n }\n }\n }\n return resources;\n },\n createLayout: function (layout) {\n var allDayIndex = -1;\n if (!layout.rows) {\n layout.rows = [];\n }\n for (var idx = 0; idx < layout.rows.length; idx++) {\n if (layout.rows[idx].allDay) {\n allDayIndex = idx;\n break;\n }\n }\n var allDaySlot = layout.rows[allDayIndex];\n if (allDayIndex >= 0) {\n layout.rows.splice(allDayIndex, 1);\n }\n var columnLevels = this.columnLevels = levels(layout, 'columns');\n var rowLevels = this.rowLevels = levels(layout, 'rows');\n if (this._isVirtualized()) {\n this._trimRowLevels(rowLevels);\n }\n this.table = $('
');\n var rowCount = rowLevels[rowLevels.length - 1].length;\n this.table.find('tbody:first').append(this._topSection(columnLevels, allDaySlot, rowCount));\n this.table.find('tbody:first').append(this._bottomSection(columnLevels, rowLevels, rowCount));\n this.element.append(this.table);\n if (this._isVirtualized()) {\n this._updateDomRowLevels();\n }\n if (this._isMobile() && columnLevels.length > 1 && this._groupOrientation() === 'horizontal' && kendo._outerWidth($(window)) < MIN_HORIZONTAL_SCROLL_SIZE) {\n this.table.find('.k-scheduler-content .k-scheduler-table').width(columnLevels[columnLevels.length - 2].length * 100 + '%');\n this.table.find('.k-scheduler-header .k-scheduler-table').width(columnLevels[columnLevels.length - 2].length * 100 + '%');\n }\n this._scroller();\n },\n _isVirtualized: function () {\n return this.options.virtual && this.rowLevels.length > 1 && this._isVerticallyGrouped();\n },\n _trimRowLevels: function (rowLevels) {\n var lastGroup = rowLevels[rowLevels.length - 2];\n var cachedRowLevels = this.cachedRowLevels || [];\n var levelMarker;\n this._hasContentToRender = true;\n var stopAtLevel = function (levels, index) {\n var hasParent = levels[index - 1].length > 0;\n if (hasParent) {\n return levels[index].length % levels[index - 1][0].rows.length !== 0;\n } else {\n return true;\n }\n };\n for (var rowLevelIndex = rowLevels.length - 2; rowLevelIndex >= 0; rowLevelIndex--) {\n var stop = false;\n if (rowLevelIndex > 0 && stopAtLevel(rowLevels, rowLevelIndex)) {\n stop = true;\n levelMarker = rowLevelIndex;\n }\n cachedRowLevels[rowLevelIndex] = rowLevels[rowLevelIndex].splice(1);\n if (stop) {\n break;\n }\n }\n cachedRowLevels[rowLevels.length - 1] = rowLevels[rowLevels.length - 1].splice(lastGroup[0].rows.length);\n this.cachedRowLevels = cachedRowLevels;\n if (!cachedRowLevels[cachedRowLevels.length - 1].length) {\n this._hasContentToRender = false;\n }\n return {\n levelMarker: levelMarker || 0,\n rowLevels: rowLevels\n };\n },\n createNextLayout: function () {\n var clone = [];\n var trimmedRowLevels;\n var rowLevels;\n var levelMarker;\n var rowCount;\n for (var rowLevelIndex = 0; rowLevelIndex < this.cachedRowLevels.length; rowLevelIndex++) {\n clone[rowLevelIndex] = this.cachedRowLevels[rowLevelIndex];\n }\n trimmedRowLevels = this._trimRowLevels(clone);\n rowLevels = trimmedRowLevels.rowLevels.splice(trimmedRowLevels.levelMarker);\n levelMarker = trimmedRowLevels.levelMarker;\n rowCount = rowLevels[rowLevels.length - 1].length;\n delete this._height;\n for (var i = levelMarker; i < this.rowLevels.length; i++) {\n this.rowLevels[i] = this.rowLevels[i].concat(rowLevels[i - levelMarker]);\n }\n this.table.find('.k-scheduler-times:last tbody').append(times(rowLevels, rowCount, this._isMobile()).find('tr'));\n this._updateDomRowLevels();\n if (levelMarker > 0) {\n for (i = 0; i < levelMarker; i++) {\n var cell = this.table.find('[data-row-level=' + i + ']:last');\n var rowSpan = parseInt(cell.attr('rowspan'), 10) + rowCount;\n cell.attr('rowspan', rowSpan);\n }\n }\n this._virtualContent(rowLevels, this.columnLevels);\n this.render(this._cachedEvents);\n },\n _tryRenderContent: function () {\n var that = this;\n var bufferHeight = that.table.innerHeight();\n var height = that.content.find('table').innerHeight();\n var scrollTop = that.content.scrollTop();\n while (that._hasContentToRender && height - bufferHeight < scrollTop) {\n that.createNextLayout();\n height = that.content.find('table').innerHeight();\n }\n },\n _updateDomRowLevels: function () {\n var that = this;\n var groupCells = that.times.find('.k-scheduler-group-cell:not([data-row-level])');\n if (!this._rowLevelIndices) {\n this._rowLevelIndices = groupCells.map(function (index, item) {\n $(item).attr('data-row-level', index);\n return index;\n }).toArray().reverse();\n return;\n }\n groupCells = groupCells.toArray().reverse();\n for (var i = 0; i <= groupCells.length; i++) {\n $(groupCells[i]).attr('data-row-level', this._rowLevelIndices[i]);\n }\n },\n refreshLayout: function () {\n var that = this, toolbar = that.element.find('> .k-scheduler-toolbar'), height = that.element.innerHeight(), scrollbar = this._scrollbar, headerHeight = 0, paddingDirection = this._isRtl ? 'left' : 'right';\n for (var idx = 0; idx < toolbar.length; idx++) {\n height -= outerHeight(toolbar.eq(idx));\n }\n if (that.datesHeader) {\n headerHeight = outerHeight(that.datesHeader);\n }\n if (that.timesHeader && outerHeight(that.timesHeader) > headerHeight) {\n headerHeight = outerHeight(that.timesHeader);\n }\n if (that.datesHeader && that.timesHeader) {\n var datesHeaderRows = that.datesHeader.find('table:first tr');\n that.timesHeader.find('tr').height(function (index) {\n $(this).height(datesHeaderRows.eq(index).height());\n });\n }\n if (headerHeight) {\n height -= headerHeight;\n }\n if (that.footer) {\n height -= outerHeight(that.footer);\n }\n var isSchedulerHeightSet = function (el) {\n var initialHeight, newHeight;\n if (el[0].style.height) {\n return true;\n } else {\n initialHeight = el.height();\n }\n el.height('auto');\n newHeight = el.height();\n if (initialHeight != newHeight) {\n el.height('');\n return true;\n }\n el.height('');\n return false;\n };\n var contentDiv = that.content[0], scrollbarWidth = !kendo.support.kineticScrollNeeded ? scrollbar : 0;\n if (isSchedulerHeightSet(that.element)) {\n if (height > scrollbar * 2) {\n that.content.height(height);\n } else {\n that.content.height(scrollbar * 2 + 1);\n }\n that.times.height(contentDiv.clientHeight);\n var timesTable = that.times.find('table');\n if (timesTable.length) {\n timesTable.height(that.content.find('table')[0].clientHeight);\n }\n }\n if (contentDiv.offsetWidth - contentDiv.clientWidth > 0) {\n that.table.addClass('k-scrollbar-v');\n that.datesHeader.css('padding-' + paddingDirection, scrollbarWidth - parseInt(that.datesHeader.children().css('border-' + paddingDirection + '-width'), 10));\n } else {\n that.datesHeader.css('padding-' + paddingDirection, '');\n }\n if (contentDiv.offsetHeight - contentDiv.clientHeight > 0 || contentDiv.clientHeight > that.content.children('.k-scheduler-table').height()) {\n that.table.addClass('k-scrollbar-h');\n } else {\n that.table.removeClass('k-scrollbar-h');\n }\n },\n _topSection: function (columnLevels, allDaySlot, rowCount) {\n var thElm = $('');\n var columnCount = columnLevels[columnLevels.length - 1].length;\n this.timesHeader = timesHeader(columnLevels.length, allDaySlot, rowCount);\n this.datesHeader = datesHeader(columnLevels, columnCount, allDaySlot);\n var dateGroup = this.datesHeader.find('.k-nav-day');\n if (dateGroup.length) {\n dateGroup.closest('tr').addClass('k-scheduler-date-group');\n }\n if (this._isMobile()) {\n thElm.addClass('k-mobile-header');\n thElm.addClass('k-mobile-' + this._groupOrientation() + '-header');\n }\n return $(thElm).append(this.timesHeader.add(this.datesHeader).wrap('').parent());\n },\n _bottomSection: function (columnLevels, rowLevels, rowCount) {\n this.times = times(rowLevels, rowCount, this._isMobile());\n this.content = content(columnLevels[columnLevels.length - 1], rowLevels[rowLevels.length - 1]);\n return $('').append(this.times.add(this.content).wrap('').parent());\n },\n _scroller: function () {\n var that = this;\n this.content.bind('scroll' + NS, function () {\n that.datesHeader.find('>.k-scheduler-header-wrap').scrollLeft(this.scrollLeft);\n that.times.scrollTop(this.scrollTop);\n if (that._isVirtualized()) {\n that._tryRenderContent();\n }\n });\n var touchScroller = kendo.touchScroller(this.content, {\n avoidScrolling: function (e) {\n return $(e.event.target).closest('.k-event.k-event-active').length > 0;\n }\n });\n if (touchScroller && touchScroller.movable) {\n this._touchScroller = touchScroller;\n this.content = touchScroller.scrollElement;\n touchScroller.movable.bind('change', function (e) {\n that.datesHeader.find('>.k-scheduler-header-wrap').scrollLeft(-e.sender.x);\n that.times.scrollTop(-e.sender.y);\n if (that._isVirtualized()) {\n that._tryRenderContent();\n }\n });\n }\n },\n _resourcesForGroups: function () {\n var result = [];\n var groups = this.options.group;\n var resources = this.options.resources;\n groups = groups && groups.resources ? groups.resources : [];\n if (resources && groups.length) {\n for (var idx = 0, length = resources.length; idx < length; idx++) {\n for (var groupIdx = 0, groupLength = groups.length; groupIdx < groupLength; groupIdx++) {\n if (resources[idx].name === groups[groupIdx]) {\n result.push(resources[idx]);\n }\n }\n }\n }\n this.groupedResources = result;\n },\n _createDateLayout: function (dates, inner, times) {\n return createDateLayoutConfiguration('rows', dates, inner, times);\n },\n _createColumnsLayout: function (resources, inner, template, dates, times) {\n return createLayoutConfiguration('columns', resources, inner, template, dates, times);\n },\n _groupOrientation: function () {\n var groups = this.options.group;\n return groups && groups.resources ? groups.orientation : 'horizontal';\n },\n _isGroupedByDate: function () {\n return this.options.group && this.options.group.date;\n },\n _isVerticallyGrouped: function () {\n return this.groupedResources.length && this._groupOrientation() === 'vertical';\n },\n _createRowsLayout: function (resources, inner, template, dates) {\n return createLayoutConfiguration('rows', resources, inner, template, dates);\n },\n selectionByElement: function () {\n return null;\n },\n clearSelection: function () {\n this.content.find('.k-state-selected').removeAttr('id').attr('aria-selected', false).removeClass('k-state-selected');\n },\n destroy: function () {\n var that = this;\n Widget.fn.destroy.call(this);\n if (that.table) {\n kendo.destroy(that.table);\n that.table.remove();\n }\n if (that.footer) {\n kendo.destroy(that.footer);\n that.footer.remove();\n }\n that.groups = null;\n that.table = null;\n that.content = null;\n that.times = null;\n that.datesHeader = null;\n that.timesHeader = null;\n that.footer = null;\n that._resizeHint = null;\n that._moveHint = null;\n },\n calendarInfo: function () {\n return kendo.getCulture().calendars.standard;\n },\n prevGroupSlot: function (date, groupIndex, isDay) {\n var collection;\n var group = this.groups[groupIndex];\n var slot = group.ranges(date, date, isDay, false)[0].start;\n if (groupIndex <= 0) {\n return;\n }\n if (this._isGroupedByDate()) {\n return slot;\n }\n if (this._isVerticallyGrouped()) {\n if (!group.timeSlotCollectionCount()) {\n collection = group._collection(group.daySlotCollectionCount() - 1, true);\n return collection.at(slot.index);\n } else {\n collection = group._collection(isDay ? slot.index : slot.collectionIndex, false);\n return collection.last();\n }\n } else {\n if (!group.timeSlotCollectionCount()) {\n collection = group._collection(slot.collectionIndex, true);\n return collection.last();\n } else {\n collection = group._collection(isDay ? 0 : group.timeSlotCollectionCount() - 1, isDay);\n return isDay ? collection.last() : collection.at(slot.index);\n }\n }\n },\n nextGroupSlot: function (date, groupIndex, isDay) {\n var collection;\n var group = this.groups[groupIndex];\n var slot = group.ranges(date, date, isDay, false)[0].start;\n var daySlotCollectionCount;\n if (groupIndex >= this.groups.length - 1) {\n return;\n }\n if (this._isGroupedByDate()) {\n return slot;\n }\n if (this._isVerticallyGrouped()) {\n if (!group.timeSlotCollectionCount()) {\n collection = group._collection(0, true);\n return collection.at(slot.index);\n } else {\n daySlotCollectionCount = group.daySlotCollectionCount();\n collection = group._collection(daySlotCollectionCount ? 0 : slot.collectionIndex, daySlotCollectionCount);\n return isDay ? collection.first() : collection.at(slot.collectionIndex);\n }\n } else {\n if (!group.timeSlotCollectionCount()) {\n collection = group._collection(slot.collectionIndex, true);\n return collection.first();\n } else {\n collection = group._collection(0, isDay);\n return isDay ? collection.first() : collection.at(slot.index);\n }\n }\n },\n _eventOptionsForMove: function () {\n return {};\n },\n _updateEventForResize: function () {\n return;\n },\n _updateEventForSelection: function (event) {\n return event;\n }\n });\n function collidingEvents(elements, start, end) {\n var idx, index, startIndex, overlaps, endIndex;\n for (idx = elements.length - 1; idx >= 0; idx--) {\n index = rangeIndex(elements[idx]);\n startIndex = index.start;\n endIndex = index.end;\n overlaps = startIndex <= start && endIndex >= start;\n if (overlaps || startIndex >= start && endIndex <= end || start <= startIndex && end >= startIndex) {\n if (startIndex < start) {\n start = startIndex;\n }\n if (endIndex > end) {\n end = endIndex;\n }\n }\n }\n return eventsForSlot(elements, start, end);\n }\n function rangeIndex(eventElement) {\n return {\n start: eventElement.start,\n end: eventElement.end\n };\n }\n function eventsForSlot(elements, slotStart, slotEnd) {\n var events = [];\n for (var idx = 0; idx < elements.length; idx++) {\n var event = rangeIndex(elements[idx]);\n if (event.start < slotStart && event.end > slotStart || event.start >= slotStart && event.end <= slotEnd) {\n events.push(elements[idx]);\n }\n }\n return events;\n }\n function createColumns(eventElements) {\n return _createColumns(eventElements);\n }\n function createRows(eventElements) {\n return _createColumns(eventElements);\n }\n var Color = function (value) {\n var color = this, formats = Color.formats, re, processor, parts, i, channels;\n if (arguments.length === 1) {\n value = color.resolveColor(value);\n for (i = 0; i < formats.length; i++) {\n re = formats[i].re;\n processor = formats[i].process;\n parts = re.exec(value);\n if (parts) {\n channels = processor(parts);\n color.r = channels[0];\n color.g = channels[1];\n color.b = channels[2];\n }\n }\n } else {\n color.r = arguments[0];\n color.g = arguments[1];\n color.b = arguments[2];\n }\n color.r = color.normalizeByte(color.r);\n color.g = color.normalizeByte(color.g);\n color.b = color.normalizeByte(color.b);\n };\n Color.prototype = {\n resolveColor: function (value) {\n value = value || '#000';\n if (value.charAt(0) == '#') {\n value = value.substr(1, 6);\n }\n value = value.replace(/ /g, '');\n value = value.toLowerCase();\n value = Color.namedColors[value] || value;\n return value;\n },\n normalizeByte: function (value) {\n return value < 0 || isNaN(value) ? 0 : value > 255 ? 255 : value;\n },\n percBrightness: function () {\n var color = this;\n return math.sqrt(0.241 * color.r * color.r + 0.691 * color.g * color.g + 0.068 * color.b * color.b);\n },\n isDark: function () {\n var color = this;\n var brightnessValue = color.percBrightness();\n return brightnessValue < 180;\n }\n };\n Color.formats = [\n {\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\n process: function (parts) {\n return [\n parseInt(parts[1], 10),\n parseInt(parts[2], 10),\n parseInt(parts[3], 10)\n ];\n }\n },\n {\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\n process: function (parts) {\n return [\n parseInt(parts[1], 16),\n parseInt(parts[2], 16),\n parseInt(parts[3], 16)\n ];\n }\n },\n {\n re: /^(\\w{1})(\\w{1})(\\w{1})$/,\n process: function (parts) {\n return [\n parseInt(parts[1] + parts[1], 16),\n parseInt(parts[2] + parts[2], 16),\n parseInt(parts[3] + parts[3], 16)\n ];\n }\n }\n ];\n Color.namedColors = {\n aqua: '00ffff',\n azure: 'f0ffff',\n beige: 'f5f5dc',\n black: '000000',\n blue: '0000ff',\n brown: 'a52a2a',\n coral: 'ff7f50',\n cyan: '00ffff',\n darkblue: '00008b',\n darkcyan: '008b8b',\n darkgray: 'a9a9a9',\n darkgreen: '006400',\n darkorange: 'ff8c00',\n darkred: '8b0000',\n dimgray: '696969',\n fuchsia: 'ff00ff',\n gold: 'ffd700',\n goldenrod: 'daa520',\n gray: '808080',\n green: '008000',\n greenyellow: 'adff2f',\n indigo: '4b0082',\n ivory: 'fffff0',\n khaki: 'f0e68c',\n lightblue: 'add8e6',\n lightgrey: 'd3d3d3',\n lightgreen: '90ee90',\n lightpink: 'ffb6c1',\n lightyellow: 'ffffe0',\n lime: '00ff00',\n limegreen: '32cd32',\n linen: 'faf0e6',\n magenta: 'ff00ff',\n maroon: '800000',\n mediumblue: '0000cd',\n navy: '000080',\n olive: '808000',\n orange: 'ffa500',\n orangered: 'ff4500',\n orchid: 'da70d6',\n pink: 'ffc0cb',\n plum: 'dda0dd',\n purple: '800080',\n red: 'ff0000',\n royalblue: '4169e1',\n salmon: 'fa8072',\n silver: 'c0c0c0',\n skyblue: '87ceeb',\n slateblue: '6a5acd',\n slategray: '708090',\n snow: 'fffafa',\n steelblue: '4682b4',\n tan: 'd2b48c',\n teal: '008080',\n tomato: 'ff6347',\n turquoise: '40e0d0',\n violet: 'ee82ee',\n wheat: 'f5deb3',\n white: 'ffffff',\n whitesmoke: 'f5f5f5',\n yellow: 'ffff00',\n yellowgreen: '9acd32'\n };\n function _createColumns(eventElements) {\n var columns = [];\n for (var idx = 0; idx < eventElements.length; idx++) {\n var event = eventElements[idx];\n var eventRange = rangeIndex(event);\n var column = null;\n for (var j = 0, columnLength = columns.length; j < columnLength; j++) {\n var endOverlaps = eventRange.start > columns[j].end;\n if (eventRange.start < columns[j].start || endOverlaps) {\n column = columns[j];\n if (column.end < eventRange.end) {\n column.end = eventRange.end;\n }\n break;\n }\n }\n if (!column) {\n column = {\n start: eventRange.start,\n end: eventRange.end,\n events: []\n };\n columns.push(column);\n }\n column.events.push(event);\n }\n return columns;\n }\n function createDateLayoutConfiguration(name, dates, inner, times) {\n var configuration = [];\n $.each(dates, function (index, item) {\n var className = item.className ? 'k-slot-cell ' + item.className : 'k-slot-cell';\n var obj = {\n text: item.text,\n className: className\n };\n if (times && !item.minorTicks) {\n obj[name] = createDateLayoutConfiguration(name, item.columns, inner, times);\n } else {\n obj[name] = inner;\n }\n configuration.push(obj);\n });\n return configuration;\n }\n function createLayoutConfiguration(name, resources, inner, template, dates, times) {\n var resource = resources[0];\n var configuration = [];\n if (resource) {\n if (dates && inner) {\n $.each(dates, function (index, item) {\n if (times && !item.minorTicks) {\n item[name] = createLayoutConfiguration(name, resources, item.columns, template, item.columns, times);\n } else {\n item[name] = createLayoutConfiguration(name, resources, null, template);\n }\n });\n configuration = dates;\n } else {\n var data = resource.dataSource.view();\n for (var dataIndex = 0; dataIndex < data.length; dataIndex++) {\n var obj = {\n text: template({\n text: kendo.htmlEncode(kendo.getter(resource.dataTextField)(data[dataIndex])),\n color: kendo.getter(resource.dataColorField)(data[dataIndex]),\n field: resource.field,\n title: resource.title,\n name: resource.name,\n value: kendo.getter(resource.dataValueField)(data[dataIndex])\n }),\n className: 'k-slot-cell k-scheduler-group-cell'\n };\n obj[name] = createLayoutConfiguration(name, resources.slice(1), inner, template);\n configuration.push(obj);\n }\n }\n return configuration;\n }\n return inner;\n }\n function groupEqFilter(value) {\n return function (item) {\n if ($.isArray(item) || item instanceof kendo.data.ObservableArray) {\n for (var idx = 0; idx < item.length; idx++) {\n if (item[idx] == value) {\n return true;\n }\n }\n return false;\n }\n return item == value;\n };\n }\n var selectedStateRegExp = /\\s*k-state-selected/;\n function addSelectedState(cell) {\n cell.className = cell.className.replace(selectedStateRegExp, '') + ' k-state-selected';\n }\n $.extend(ui.SchedulerView, {\n createColumns: createColumns,\n createRows: createRows,\n rangeIndex: rangeIndex,\n collidingEvents: collidingEvents,\n groupEqFilter: groupEqFilter\n });\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}