/*
 * Isomorphic SmartClient
 * Version v13.1p_2026-05-28 (2026-05-28)
 * Copyright(c) 1998 and beyond Isomorphic Software, Inc. All rights reserved.
 * "SmartClient" is a trademark of Isomorphic Software, Inc.
 *
 * licensing@smartclient.com
 *
 * http://smartclient.com/license
 */

if(window.isc&&window.isc.module_Core&&!window.isc.module_Calendar){isc.module_Calendar=1;isc._moduleStart=isc._Calendar_start=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc._moduleEnd&&(!isc.Log||(isc.Log&&isc.Log.logIsDebugEnabled('loadTime')))){isc._pTM={message:'Calendar load/parse time: '+(isc._moduleStart-isc._moduleEnd)+'ms',category:'loadTime'};if(isc.Log&&isc.Log.logDebug)isc.Log.logDebug(isc._pTM.message,'loadTime');else if(isc._preLog)isc._preLog[isc._preLog.length]=isc._pTM;else isc._preLog=[isc._pTM]}isc.definingFramework=true;if(window.isc&&isc.version!="v13.1p_2026-05-28/LGPL Development Only"&&!isc.DevUtil){isc.logWarn("SmartClient module version mismatch detected: This application is loading the core module from SmartClient version '"+isc.version+"' and additional modules from 'v13.1p_2026-05-28/LGPL Development Only'. Mixing resources from different SmartClient packages is not supported and may lead to unpredictable behavior. If you are deploying resources from a single package you may need to clear your browser cache, or restart your browser."+(isc.Browser.isSGWT?" SmartGWT developers may also need to clear the gwt-unitCache and run a GWT Compile.":""))}
isc.ClassFactory.defineClass("CalendarView","ListGrid");isc.A=isc.CalendarView.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.isCalendarView=true;isc.A.showHeaderSpanContextMenu=false;isc.A.autoDraw=false;isc.A.verticalEvents=true;isc.A.allowMultiDayEvents=false;isc.A.showDateChooserTimeItem=false;isc.A.hiliteRowOnFocus=false;isc.A.hoverDelay=0;isc.A.showHover=true;isc.A.canHover=true;isc.A.hoverByCell=null;isc.A.hoverAutoFitWidth=null;isc.A.hoverAutoFitMaxWidth=null;isc.A.allowMultiDayEvents=true;isc.A.canFreezeFields=false;isc.A.alternateFieldStyles=false;isc.A.alternateRecordStyles=false;isc.A.dateEditingStyle="time";isc.A.canSaveSearches=false;isc.A.longEventsLayoutDefaults={_constructor:"Canvas",overflow:"hidden",height:10,canvasList:null,canvasPool:null,eventList:null,isLongEventsLayout:true,canHover:true,showHover:true,getHoverHTML:function(){return this.calendar.getLongEventLayoutHoverHTML(this,this.calendarView)},getStartDate:function(){if(this.currentRecord)return this.currentRecord.startDate;return this.calendarView.startDate},getEndDate:function(){if(this.currentRecord)return this.currentRecord.endDate;return this.calendarView.endDate},ghostEvent:{},setGhostCanvas:function(_1){if(!this.ghostCanvas){this.ghostCanvas=this.createAutoChild("canvas",{height:this.canvasHeight,calendarView:this.creator,calendar:this.creator.creator,isGhost:true,opacity:this.calendar.longEventDragOpacity,eventProxy:this});this.addChild(this.ghostCanvas)}
var _2=this.calendar;this.ghostCanvas.setHeight(_2.dragGhostHeight);this.ghostCanvas.$3003=true;if(_1){this.ghostEvent[_2.startDateField]=_1.event[_2.startDateField];this.ghostEvent[_2.endDateField]=_1.event[_2.endDateField];this.ghostCanvas.setStyleName(_1.styleName);this.ghostEvent.name=_1.event.name}else if(this.calendarView.ghostEvent){var _3=this.calendarView.ghostEvent;this.ghostEvent[_2.startDateField]=_3[_2.startDateField];this.ghostEvent[_2.endDateField]=_3[_2.endDateField];this.ghostEvent.name=_2.newLongEventName}},updateGhostCanvas:function(_1,_2){var _3=this.calendar;_1=_1||this.ghostEvent[_3.startDateField];_2=_2||this.ghostEvent[_3.endDateField];this.ghostEvent[_3.startDateField]=_1;this.ghostEvent[_3.endDateField]=_2;this.ghostCanvas.setEvent(this.ghostEvent);if(this.ghostCanvas.$3003&&this.ghostCanvas.headerLabel){this.ghostCanvas.headerLabel.setContents("")}
if(_1>this.endDate||_2<this.startDate){this.ghostCanvas.hide()}else{var _4=this.getDateLeft(this.ghostEvent[_3.startDateField]);var _5=this.getEventWidth(this.ghostEvent),_6=this.getMaxEventRight();if(_4+_5>_6){_5=_6-_4}
this.ghostCanvas.resizeTo(_5);var _7=this.canvasList&&this.canvasList.length>0;var _8=_3.dragGhostSpace;var _9=_8+(_7?_8:0);if(this.getHeight()<_9)this.setHeight(_9);var _10=0;if(_3.dragGhostSpaceVAlign=="bottom"){_10=this.getHeight()-_8}
var _11=_10+this.$301e(_3);this.ghostCanvas.moveTo(_4,_11);if(!this.ghostCanvas.isVisible())this.ghostCanvas.show();this.ghostCanvas.updateEndStyles()}
if(this.ghostCanvas.isVisible())this.ghostCanvas.bringToFront()},$301e:function(_1){var _2=_1.dragGhostSpace,_3=_1.dragGhostHeight,_4=_1.dragGhostVAlign;if(_4=="bottom")return _2-_3;if(_4=="center"){return Math.floor((_2-_3)/2)}
return 0},showGhostCanvas:function(_1){this.setGhostCanvas(_1);this.updateGhostCanvas();this.ghostCanvas.setEvent(this.ghostEvent);if(this.ghostCanvas.$3003&&this.ghostCanvas.headerLabel){this.ghostCanvas.headerLabel.setContents("")}
var _2=this.calendar;var _3=this.ghostEvent[_2.startDateField]<this.endDate&&this.ghostEvent[_2.endDateField]>this.startDate;if(_3){if(!this.ghostCanvas.isVisible())this.ghostCanvas.show();this.ghostCanvas.bringToFront()}},hideGhostCanvas:function(){this.ghostCanvas&&this.ghostCanvas.hide();if(!this.canvasList||this.canvasList.length==0){this.setHeight(this.calendar.dragGhostSpace)}},handleMouseDown:function(){var _1=this.calendarView,_2=_1.body,_3=_2.getEventRow(),_4=_2.getEventColumn();var _5=this.getMouseDates(),_6=_5[0],_7=_5[1];if(this.calendar.canDragCreateEvents&&!this.calendar.shouldDisableDate(_6,_1,this.getField(_4).lane)){_1.$288v=true;_1.startGhostDragCreate(_6,_7)}
return false},handleMouseUp:function(){return false},handleMouseMove:function(){var _1=isc.EH.lastEvent
if(this.calendarView.containsPoint(_1.x,_1.y)){if(this.calendarView.inGhostDragCreate||this.calendarView.inGhostDragMove){var _2=this.getMouseDates();if(_2&&_2[0]&&_2[1])
this.calendarView.updateGhostCanvas(_2[0],_2[1])}}},cancelGhostDrag:function(){delete this.dragAnchorDate;this.hideGhostCanvas()},canvasDefaults:{_constructor:"EventCanvas",overflow:"hidden",border:"none",borderRadius:"4px",hoverAutoFitWidth:true,hoverAutoFitMaxWidth:300,headerLabelProperties:{overflow:"hidden"},showBody:false,getHeaderHTML:function(){var _1=this.calendar.getLongEventHTML(this.event,this.creator,this.calendarView);return _1},getHoverHTML:function(){var _1=this.calendar.getLongEventHoverHTML(this.event,this.creator,this.calendarView);return _1},click:function(){return this.creator.eventClick(this)},handleMouseMove:function(){var _1=this.calendarView;if(_1.inGhostDragCreate||_1.inGhostDragMove)
{this.creator.handleMouseMove();return isc.EH.STOP_BUBBLING}
return this.Super("handleMouseMove",arguments)},mouseUp:function(){if(this.creator.$3023){delete this.creator.$3023;return false}
var _1=this.calendarView;if(_1.isMonthView()){if(_1.inGhostDragCreate){var _2=_1.calendar,_3=_1.ghostEvent[_2.startDateField],_4=_1.ghostEvent[_2.endDateField],_5=isc.DateUtil.compareLogicalDates(_3,_4)==0;if(_5){_1.cancelGhostDrag()}else{_1.finishGhostDragCreate()}
return false}
if(_1.inGhostDragMove){_1.finishGhostDragMove();_1.ignoreGhostEvents();return false}}
return isc.EH.STOP_BUBBLING},isLongEvent:true,canDrag:true,canDragReposition:true,dragAppearance:"none",verticalResize:false,canDragResize:false,canRemove:true,dragRepositionStart:function(){if(!this.calendar.canDragEvents)return false;this.mouseDownDates=this.creator.getMouseDates();this.calendarView.startGhostDragMove(this);return!this.calendarView.isMonthView()},dragRepositionMove:function(){var _1=this.creator.getMouseDates();if(!_1||!_1[0]||!_1[1])return;var _2=this.calendarView;this.calendarView.updateGhostCanvas(_1[0],_1[1],"canvasDragRepositionMove");return false},dragRepositionStop:function(){var _1=this.calendarView;_1.hideGhostCanvas();var _2=this.creator.getMouseDates();if(_2&&_2[0]!=this.mouseDownDates[0]){var _3=_1.ghostEvent;this.calendar.updateCalendarEvent(_1.ghostCanvas.event,_3)}
this.creator.$3023=true;return false},draw:function(){var _1=this.Super("draw",arguments);this.updateEndStyles()},getHeaderHeight:function(){return this.calendar&&this.calendar.longEventHeight},setStyleName:function(){var _1=this.Super("setStyleName",arguments);this.updateEndStyles();return _1},updateEndStyles:function(){if(!this.isDrawn()||!this.event)return;var _1=this.calendar,_2=this.calendarView,_3=this.event,_4=this.creator,_5=_3[_1.startDateField].getTime()<_2.startDate.getTime(),_6=_3[_1.endDateField].getTime()>_2.endDate.getTime();var _7=this.getPartHandle(),_8=this.getShowHeader()?this.getPartHandle("header"):null;if(!_8){this.logWarn("No header-element in updateEndStyles()");return}
this.clearEndStyles();if(_4.$289!=null){}
_5=_3[_1.startDateField].getTime()<_4.getStartDate();_6=_3[_1.endDateField].getTime()>_4.getEndDate();var _9=null;if(_5&&_6)_9=this.baseStyle+"BothEnds";else if(_5)_9=this.baseStyle+"LeftEnd";else if(_6)_9=this.baseStyle+"RightEnd";if(_9){_7.classList.add(_9);if(_8)_8.classList.add(_9)}
this.$278b=_9;var _10=this.getStyleHandle();if(_10){_10["border"]="none";_10["outline"]="none";_10=this.headerLabel.getStyleHandle();if(_10){_10["padding-top"]="0px";_10["padding-bottom"]="0px";_10["border"]="none";_10["outline"]="none"}}
isc.logInfo("New End style for event '"+this.event[_1.nameField]+"': "+(this.$278b||"None"),"calendar")},clearEndStyles:function(){if(!this.isDrawn())return;var _1=this.getPartHandle(),_2=this.getShowHeader()?this.getPartHandle("header"):null;if(!_1){this.logWarn("No header-element in clearEndStyles()");return}
var _3=[this.baseStyle+"BothEnds",this.baseStyle+"LeftEnd",this.baseStyle+"RightEnd"];for(var i=0;i<_3.length;i++){_1.classList.remove(_3[i]);_2.classList.remove(_3[i])}
delete this.$278b}},canvasHeight:20,canvasSpacing:1,initWidget:function(){this.canvasList=[];this.canvasPool=[];this.eventList=[];this.height=this.calendar.dragGhostSpace;return this.Super("initWidget",arguments)},draw:function(){var _1=this.Super("draw",arguments);if(this.$278n){delete this.$278n;this.reset();this.refreshEvents()}
return _1},getChildCanvas:function(_1){var _2;if(this.canvasPool.length>0){if(_1){var _3=this.calendar;for(var i=0;i<this.canvasPool.length;i++)
{if(_3.eventsAreSame(this.canvasPool[i].event,_1))
{_2=this.canvasPool[i];this.canvasPool.removeAt(i);break}}}
if(!_2){_2=this.canvasPool.shift()}
_2.clearEndStyles()}else{_2=this.createAutoChild("canvas",{height:this.canvasHeight,calendarView:this.creator,calendar:this.creator.creator})}
this.canvasList.add(_2);return _2},click:function(){var _1=this.calendarView;if(_1.inGhostDragCreate||_1.inGhostDragMove||_1.$303e)
{return false}
var _2=this.getMouseDates();if(!_2)return;var _3=_2[0].duplicate(),_4=_2[1].duplicate();_3.setHours(new Date().getHours());_4.setHours(_3.getHours()+1);var _5=this.calendar;var _6=_5.createEventObject(null,_3,_4);_6[_5.allDayField]=true;_5.showEventDialog(_6,true);return false},eventClick:function(_1){if(this.$3023){delete this.$3023;return false}
var _2=isc.addProperties({},_1.event);this.creator.calendar.showEventEditor(_2);return false},reset:function(_1,_2,_3){var _4=this.currentRecord;_1=_1||(_4&&_4.startDate)||this.calendarView.startDate;_2=_2||(_4&&_4.endDate)||this.calendarView.endDate;this.logInfo(this.getID()+" -- reset("+_1.toShortDatetime()+", "+_2.toShortDatetime()+")","longEvents");this.updateFields(_3,_1)},refreshEvents:function(){if(!this.isDrawn())return;this.logInfo(this.getID()+" -- refreshEvents()","longEvents");this.hideEvents();var _1=this.calendar,_2=this.calendarView,_3=this.calendarView.getLongEventData(),_4=[],_5=this.getStartDate().getTime(),_6=this.getEndDate().getTime();for(var i=0;i<_3.length;i++){var _8=_3[i];if(_5>=_8[_1.endDateField].getTime())continue;if(_6<=_8[_1.startDateField].getTime())continue;_4.add(_8)}
this.eventList=_4;this.redrawEvents()},hideEvents:function(){if(!this.canvasList)return;var _1=this.canvasList.length;var _2=this.canvasList.reverse();while(_2.length>0){var _3=_2.shift();_3.hide();_3.clear();this.canvasPool.add(_3);this.removeChild(_3)}
this.canvasList.length=0;this.logInfo(this.getID()+" -- hideEvent: "+_1+" events hidden in layout","longEvents")},updateFields:function(_1,_2){var _3=this.calendarView,_4=_3.getFirstDateColumn();if(!_1)_1=_3.fields.duplicate();if(!_2){_2=_1[_4].date&&_1[_4].date.duplicate()}
_2=isc.DateUtil.createLogicalDate(_2);this.fieldWidths=_3.getFieldWidths();var _5=_3.body;if(_5&&_5.isDrawn()){var _6=_3.frozenBody?_3.frozenBody.getWidth():0;this.setWidth(_6+_5.getViewportWidth())}
this.fields=[];var _7=this.calendarView.isMonthView();for(var i=0;i<_1.length;i++){var _9=isc.addProperties({},_1[i]);_9.width=this.fieldWidths[i]-1;if(_7)
_9.left=i==0?0:this.fieldWidths.slice(0,i).sum();else
_9.left=i==0?0:this.fieldWidths.slice(1,i).sum();if(i>=_4){_9.date=_2.duplicate();_9.startDate=isc.DateUtil.adjustDate(_9.date,"-0D");_9.endDate=isc.DateUtil.adjustDate(_9.date,"+0D");_2=isc.DateUtil.adjustDate(_2,"+1d")}
this.fields.add(_9)}
this.startDate=this.fields[0].startDate;this.endDate=this.fields[this.fields.length-1].endDate;this.logInfo(this.getID()+" -- updateFields: "+isc.echoFull(this.fields.getProperty("startDate")),"longEvents")},sortEvents:function(){this.eventList.setSort([{property:"eventLength",direction:"descending"}])},redrawEvents:function(){this.logInfo(this.getID()+" -- redrawEvents()","longEvents");this.sortEvents();if(!this.fields)this.updateFields();var _1=this.calendar,_2=0;var _3=this.getMaxEventRight();for(var i=0;i<this.eventList.length;i++){var _5=this.eventList[i],_6=this.getChildCanvas(_5);if(_6){var _7=this.getDateLeft(_5[_1.startDateField]),_8=this.getEventWidth(_5);if(_7+_8>_3)_8=_3-_7;_6.resizeTo(_8,this.canvasHeight);_6.setLeft(_7);_6.setEvent(_5);this.addChild(_6,null,false);_2++}}
var _9=this.layoutCanvases();if(_2>0)this.setHeight(_9);else this.setHeight(this.calendar.dragGhostSpace);if(this.ghostCanvas&&this.ghostCanvas.isVisible()){var _10=_2>0;var _11=_1.dragGhostSpace;var _12=_11+(_10?_11:0);if(this.getHeight()<_12)this.setHeight(_12)}},layoutCanvases:function(){var _1=this.canvasList;var _2=this.canvasHeight;var _3=this.calendar;var _4=0;if(_3.dragGhostSpaceVAlign=="top"){_4=_3.dragGhostSpace}
var _5=[];var _6=0;var _7=0;for(var i=0;i<_1.length;i++){var _9=_1[i];var _10=0;var _11=false;var _12=0;while(true){_11=false;for(var j=0;j<_5.length;j++){var _14=_5[j];if(!(_9.left+_9.width<=_14.left||_9.left>=_14.left+_14.width))
{if(_10<_14.top+_2&&_10+_2>_14.top)
{_11=true;break}}}
if(!_11)break;_10+=_2;_12++}
_9.setTop(_10+_4+(_12*this.canvasSpacing));_9.draw();_9.show();_6=Math.max(_6,_10);_5.push({top:_10,left:_9.left,width:_9.width})}
this.logInfo(this.getID()+" -- layoutCanvases()","longEvents");var _15=_6+(_12*this.canvasSpacing);return _15+this.canvasHeight+_3.dragGhostSpace},getMaxEventRight:function(){if(this.fieldWidths)return this.fieldWidths.sum()-1;return this.creator.getFieldWidths().sum()},getMouseColumn:function(){var x=this.getOffsetX(),_2=null;var _3=0;var _4=this.fieldWidths||[];for(var i=0;i<_4.length;i++){_3+=_4[i];if(x<_3){_2=i;break}}
return _2},getDateColumn:function(_1){var _2=-1;for(var i=0;i<this.fields.length;i++){var _4=this.fields[i];if(_4.frozen||!_4.endDate)continue;if(_4.endDate.getTime()>=_1.getTime()){_2=i;break}}
return _2},getDateLeft:function(_1){var _2=this.getDateColumn(_1);if(_2==-1){_2=this.creator.frozenBody?this.creator.frozenBody.fields.length:1}
var _3=this.creator.frozenBody?this.creator.frozenBody.getWidth():0;return this.fields[_2].left+_3},getDateRight:function(_1){var _2=this.getDateColumn(_1);if(_2==-1)return this.creator.getScrollWidth();var _3=this.creator.frozenBody?this.creator.frozenBody.getWidth():0;var _4=this.fields[_2].left+this.fields[_2].width+_3;return _4},getEventWidth:function(_1){var _2=this.calendar,_3=_1[_2.endDateField],_4=this.getDateLeft(_1[_2.startDateField]);_3=isc.DateUtil.adjustDate(_3,"-1ms");var _5=this.getDateRight(_3),_6=_5-_4;if(_6<0||_6>this.getScrollWidth()){_6=this.calendarView.getScrollWidth()}
return _6},getMouseDates:function(){var _1=this.getMouseColumn();if(_1==null)return;var _2=this.fields[_1].startDate,_3=this.fields[_1].endDate;return[_2,_3]}};isc.A.canTabToHeader=false;isc.A.includeRangeCriteria=null;isc.A.fetchMode="view";isc.A.rangeCriteriaMode="view";isc.A.$81i=/^\d{4}.\d\d?.\d\d?$/;isc.A.$81j=/^\d\d?.\d\d.\d{4}?$/;isc.A.rangeUnit="D";isc.A.showLaneFields=null;isc.A.useEventCanvasPool=true;isc.A.eventCanvasPoolingMode="data";isc.A.headerRowPrintHeight=30;isc.A.eventDragCanvasStyleName="eventDragCanvas";isc.A.eventDragCanvasDefaults={_constructor:"Canvas",width:1,height:1,snapToGrid:false,autoDraw:false,moveWithMouse:false,dragAppearance:"target",visibility:"hidden",hideUsingDisplayNone:true,keepInParentRect:true,hoverMoveWithMouse:true,showHover:true,hoverDelay:0,hoverProps:{overflow:"visible",hoverMoveWithMouse:this.hoverMoveWithMouse},getHoverHTML:function(){var _1=this.eventCanvas,_2=_1.event,_3=_1.$1245;if(!_3)return;var _4=_3.$131e,_5=_3.$131f,_6=this.view.calendar.createEventObject(_2,_4,_5,_3.$130b,_3.$1298);return this.view.calendar.$140a(this.view,_6)},setView:function(_1){this.view=_1},getEventPadding:function(){var _1=this.eventCanvas.calendar;return _1.useDragPadding?_1.getLanePadding(this.view):0},show:function(){if(this.$193z)return;return this.Super("show",arguments)},fillOverlapSlots:true,positionToEventCanvas:function(_1){if(this.$1930||!this.eventCanvas){this.hide();return isc.EH.STOP_BUBBLING}
var _2=this.eventCanvas,_3=_2.calendar,_4=this.view,_5=_4.getEventLeft(_2.event)+this.getEventPadding(),_6=_2.getTop(),_7=(_4.$732?_4.$732(_2.event):_2.getVisibleWidth()),_8=_2.getVisibleHeight(),_9=_2.$1245;if(this.fillOverlapSlots){if(_4.isTimelineView()){var _10=_2.$1245.$8l;_6=_4.body.getRowTop(_10);if(_2.isIndicatorCanvas){_8=_2.getVisibleHeight();_9.$142h=true}else if(!_9.$1297){_8=_4.getLaneHeight(_10)}else{_6+=_9.$1298.top;_8=_9.$1298.height}}else{var _11=_2.$1245.$644;_5=_4.body.getColumnLeft(_11);if(_9.$1299){if(!_9.$1297){_7=_4.getLaneWidth(_11)}else{_5+=_9.$1298.left;_7=_9.$1298.width}}else{_7=_4.body.getColumnWidth(_11)}}}
if(this.$1244){if(_4.isTimelineView()){_6=_4.body.getRowTop(_2.$1245.$8l)}else{_5=_4.body.getColumnLeft(_2.$1245.$644)}}
if(_5<0)_5=0;this.moveTo(_5,_6);this.resizeTo(_7,_8);if(_1){if(!this.isDrawn())this.draw();this.show();this.bringToFront()}
if(_4.shouldShowDragHovers())this.handleHover()},moveToEvent:function(){},dragRepositionStart:function(){if(!this.eventCanvas)return isc.EH.STOP_BUBBLING;var _1=this.eventCanvas,_2=_1.event,_3=_1.calendar,_4=this.view,_5=_4.body;if(!_3.canDragEvent(_2,_4))return false;this.$1246=true;var _6=_5.getEventRow(),_7=_5.getRowTop(_6),_8=_5.getRowHeight(_4.getRecord(_6),_6),_9=_4.getEventLeft(_2)+1,_10=_5.getEventColumn(_9),_11=_5.getColumnLeft(_10),_12=_5.getColumnWidth(_10),_13=_5.getOffsetX()-_1.getLeft(),_14=_5.getOffsetY()-_1.getTop();var _15=_4.isTimelineView();var _16=_1.$1245={};_16.$126l=!_15;_16.$8l=_6;_16.$644=_10;_16.$1249=_8;_16.$1248=_12;_16.$117y=_15?_4.$732(_2):_16.$1248;_16.$126o=_15?_16.$1249:_1.getVisibleHeight();_16.$936=_6;_16.$937=_10;_16.$116y=_13;_16.$1247=_4.getRowTop(_4.getEventRow(_14));_16.$126p=Math.round(_16.$126o/_16.$1249);_16.$126q=_4.data.getLength()-_16.$126p;_16.$126r=_4.getRowTop(_16.$126q);_16.$126s=_15?_5.getScrollWidth()-_16.$117y:_5.getColumnLeft(_5.fields.length-1);_16.$126t=_15?_5.getEventColumn(_16.$126s):_5.fields.length-1;_16.$131e=_3.getEventStartDate(_2);_16.$131f=_3.getEventEndDate(_2);_16.$142s=_16.$131e.duplicate();_16.$142t=_16.$131f.duplicate();_16.$1670=_4.getDateFromPoint()||_16.$131e.duplicate();_16.$131h=_16.$1670.duplicate();_16.$1299=_4.usesLanes()&&!_1.isIndicatorCanvas&&!_1.isZoneCanvas;if(_16.$1299){var _17=_4.getLane(_2[_3.laneNameField]),_18=!_17||!_17.sublanes?null:_17.sublanes.find(_3.laneNameField,_2[_3.sublaneNameField]);_16.$130a=_17;_16.$130b=_17;_16.$1297=_3.useSublanes&&_17&&_17.sublanes&&_17.sublanes.length>0;_16.$130c=_18;_16.$1298=_18;_16.$130d=!_3.canEditEventLane(_2,_4);_16.$130e=!_3.canEditEventSublane(_2,_4)}
this.positionToEventCanvas(true);return isc.EH.STOP_BUBBLING},dragRepositionMove:function(){if(!this.eventCanvas)return isc.EH.STOP_BUBBLING;var _1=this.eventCanvas,_2=_1.$1245,_3=_1.event,_4=_1.calendar,_5=this.view,_6=_4.getSnapGapPixels(_5),_7=_5.isTimelineView(),_8=_5.body,_9=this.getEventPadding(),_10=_2.$142h!=null?_2.$142h:-1,_11=-1,_12=-1,_13=-1;if(_8.getEventRow()<0)return;if(_8.getEventColumn()<0)return;var _14=_5.getDateFromPoint();if(!_14)return;var _15=_5.getLaneFromPoint();if(_2.$1299&&!_15)return;if(_2.$131h&&_2.$131h.getTime()==_14.getTime()&&_2.$130b&&_2.$130b==_15)return;if(_2.$1299){var _16=_15,_17=_2.$1297?_5.getSublaneFromPoint():null;if(!_16||_5.isGroupNode(_16)){_16=_2.$130b;_17=_2.$1298}else{if(_2.$130d){_16=_2.$130a;if(_2.$1297&&(_2.$130e||!_16.sublanes.contains(_17)))
{_17=_2.$130c}}else{if(_2.$1297){if(_2.$130e){var _18=_16.sublanes?_16.sublanes.find(_4.laneNameField,_2.$130c.name):null;if(_18){_17=_18}else{_16=_2.$130b;_17=_2.$1298}}else{if(_16!=_2.$130b){if(!_16.sublanes){_16=_2.$130b;_17=_2.$1298}}}}}}
if(_7){var _19=_5.getRecordIndex(_16);_10=_5.getRowTop(_19);if(_17)_10+=_17.top;_13=(_17?_17.height:_16.height);_2.$936=_19}else{var _19=_5.getLaneIndex(_16.name);_11=_5.body.getColumnLeft(_19);_12=_5.getLaneWidth(_16.name);if(_17){_11+=_17.left;_12=_17.width}
_2.$937=_19}}
var _20=_8.getEventRow(),_21=Math.min(_2.$126q,(_20<0?0:_20)),_22=_8.getRowTop(_21),_23=_8.getOffsetY(),_24=Math.floor((Math.floor((_23-_22)/_6))*_6),_25=_8.getEventRow(_23-_2.$1247),_26=_7?_22:Math.min(_2.$126r,_8.getRowTop(_25)),_27=this.getVisibleHeight(),_28=_27;var _29=_14.getTime()-_2.$131h.getTime(),_30=_29<0?-1:_29==0?0:1,_31=Math.floor(Math.abs(_29)/_5.getTimePerSnapGap("ms"));var _32=_4.addSnapGapsToDate(_2.$131e,_5,_31*_30);var _33=_4.addSnapGapsToDate(_2.$131f,_5,_31*_30);var _34=_32.duplicate();var _35=_33.duplicate();if(_7){if(_32.getTime()<_5.startDate.getTime()){_34=_5.startDate.duplicate()}
if(_33.getTime()>_5.endDate.getTime()){_35=_5.endDate.duplicate()}}
var _36=Math.min(_2.$126t,_8.getEventColumn()),_37=_8.getColumnLeft(_36),_38=(_8.getOffsetX()-_2.$116y),_39=Math.max(0,_38-((_38-_37)%_6)+1),_40=_5.getDateFromPoint(_39,_26,null,true),_41=Math.min(_2.$126s,(_7?_4.getDateLeftOffset(_40,_5):_37)),_42=_41+(_7?(_2.$117y):_1.getVisibleWidth());if(!_7){if(_21!=_2.$936){if(_21<0){_21=0;_26=0}else{var _43=_22+_2.$126o;var _44=_8.getEventRow(_22+_2.$126o-_2.$1249);if(_44<0){_21=_2.$936;_26=_8.getRowTop(_21)}else{_2.$936=_21}}}}
var _45=_5.isTimelineView()?(_10>=0&&_13>=0):(_2.$1299?(_11>=0&&_12>=0):false)
if(!_45){_2.$936=_21}
if(_36!=_2.$937){if(_5.isDayView()||_5.isWeekView()){if(_5.usesLanes()&&!_4.canEditEventLane(_3,_5)){_36=_2.$937;_41=_2.$117z}else{if(_36==-1)_2.$937=0;else if(_36==-2)_2.$937=_2.$937;else _2.$937=_36;_41=_8.getColumnLeft(_2.$937)}}else{_2.$937=Math.max(1,_36)}}
var _46=Math.max(0,(_10>=0?_10:_26)),_43=Math.min(_5.body.getScrollHeight(),_46+_2.$126o);if(_46<0){_46=0;_43=_2.$126o}else if(_43>=_5.body.getScrollHeight()){_43=_5.body.getScrollHeight();_46=_43-_2.$126o}
if(!_5.isTimelineView()){_32=_5.getDateFromPoint(_41+1,_46+1);_33=_5.getDateFromPoint(_42-1,_43);_34=_32.duplicate();_35=_33.duplicate()}
if(_5.isDayView()||_5.isWeekView()){if(_32.getDate()!=_33.getDate()){}}
var _47=_33.duplicate();_47.setTime(_33.getTime()-1);var _48=true;var _49=_4.createEventObject(_3,_32,_47,_16&&_16.name,_17&&_17.name);_48=_4.eventRepositionMove(_3,_49,_5);if(_45){if(_7){_46=_10;_2.$125b=_13;_41=_5.getDateLeftOffset(_34);_42=_5.getDateRightOffset(_35);_2.$117y=_42-_41;this.resizeTo(_2.$117y,_13)}else{_41=_11;_2.$131b=_12;this.resizeTo(_12,null)}
_2.$1298=_17;_2.$130b=_16}else{if(_46+_28>_5.body.getScrollHeight()-1){_28=_5.body.getScrollHeight()-1-_46}
_2.$125b=_28;this.resizeTo(null,_28)}
_2.$125a=_46;_2.$117z=_41;_2.$131e=_32.duplicate();_2.$131f=_33.duplicate();_2.$131h=_14.duplicate();if(_48){_2.$142s=_32.duplicate();_2.$142t=_33.duplicate();this.setDragCursor("default")}else{this.setDragCursor("not-allowed")}
this.moveTo(_2.$117z,_2.$125a);if(_5.shouldShowDragHovers())isc.Hover.show(this.getHoverHTML(),this.hoverProps);return isc.EH.STOP_BUBBLING},dragRepositionStop:function(){if(!this.eventCanvas)return isc.EH.STOP_BUBBLING;var _1=this.eventCanvas,_2=_1.$1245,_3=_1.calendar,_4=this.view,_5=_4.body,_6=_1.event;if(_4.shouldShowDragHovers())isc.Hover.hide();this.hide();var _7=(this.cursor=="not-allowed"&&_3.eventUseLastValidDropDates!=true);this.setDragCursor("default");if(_7)return;var _8=_1.isIndicatorCanvas;var _9=_2.$1299&&_3.canEditEventLane(_6,_4),_10=_2.$1299&&_3.canEditEventSublane(_6,_4),_11,_12;if(!_8){if(_4.isTimelineView()){if(_9||_10){if(_9)_11=_2.$130b.name;if(_10&&_3.useSublanes&&_2.$1298){_12=_2.$1298.name}}}else if(_4.usesLanes()){if(_9||_10){if(_9)_11=_2.$130b.name;if(_10&&_3.useSublanes&&_2.$1298){_12=_2.$1298.name}}else return false}
var _13=new Date(_2.$142t.getTime());var _14=[_2.$142s.duplicate(),_13];var _15=_14[0].getTime()-_3.getEventStartDate(_6).getTime(),_16=Math.floor(_15/(1000*60)),_17={};if(_4.isTimelineView()){if(_6[_3.leadingDateField]&&_6[_3.trailingDateField]){_14.add(_6[_3.leadingDateField].duplicate());_14[2].setMinutes(_14[2].getMinutes()+_16);_14.add(_6[_3.trailingDateField].duplicate());_14[3].setMinutes(_14[3].getMinutes()+_16);_17[_3.leadingDateField]=_14[2];_17[_3.trailingDateField]=_14[3]}}
if(_11==null)_11=_6[_3.laneNameField];if(_3.adjustEventTimes){var _18=_3.adjustEventTimes(_6,_1,_14[0],_14[1],_11);if(_18){_14[0]=_18[0].duplicate();_14[1]=_18[1].duplicate()}}
if(_3.allowEventOverlap==false){var _19=_3.checkForOverlap(_4,_1,_6,_14[0],_14[1],_11);if(_19==true){if(_3.timelineEventOverlap){_3.timelineEventOverlap(false,_6,_1,_14[0],_14[1],_11)}
return false}else if(isc.isAn.Array(_19)){_14[0]=_19[0].duplicate();_14[1]=_19[1].duplicate();if(_3.timelineEventOverlap){_3.timelineEventOverlap(true,_6,_1,_14[0],_14[1],_11)}}}
if(_3.isZeroLengthEvent(_6))_14[1]=null;if(_14[0]!=_2.$142s)_2.$142s=_14[0];if(_14[1]!=_2.$142t)_2.$142t=_14[1]}else{_2.$142t=_2.$142s}
var _20=isc.addProperties({},_6,_17);var _21=_3.createEventObject(_20,_2.$142s,_2.$142t,_2.$130b&&_2.$130b.name,_2.$1298&&_2.$1298.name);if(_3.getEventStartDate(_20).getTime()==_3.getEventStartDate(_21).getTime()){if(!_4.usesLanes()||_20[_3.laneNameField]==_21[_3.laneNameField]){return}}
var _22=_3.eventRepositionStop(_6,_21,_17,_4);this.$1246=false;if(_22!=false){if(!_8){if(_4.isTimelineView()){if(_3.timelineEventMoved(_6,_2.$142s,_2.$142t,_11)==false)return false}else{if(_3.eventMoved(_2.$142s,_6,_11)==false)return false}
_3.updateCalendarEvent(_6,_21,_17,"mouse")}else{var _23=_3.indicators.find(_3.nameField,_6[_3.nameField]);_23[_3.startDateField]=_2.$142s;_4.drawIndicators();_4.drawZones()}}
delete _1.$1245;return isc.EH.STOP_BUBBLING},handleDragResizeStart:function(){var _1=this.eventCanvas,_2=_1.event,_3=_1.calendar,_4=this.view,_5=_4.body;if(!_3.canResizeEvent(_1.event,_4))return false;this.$1244=true;var _6=_5.getEventRow(),_7=_5.getRowTop(_6),_8=_5.getRowHeight(_4.getRecord(_6),_6),_9=_5.getEventColumn(),_10=_5.getColumnLeft(_9),_11=_5.getColumnWidth(_9),_12=_5.getOffsetX()-_1.getLeft(),_13=_5.getOffsetY()-_1.getTop(),_14=_1.getVisibleWidth(),_15=_4.usesLanes(),_16=_4.isTimelineView(),_17=_16&&(_12<_14/2),_18=_15?_4.getLaneFromPoint():null,_19=_18&&_3.useSublanes?_3.getSublaneFromPoint():null;var _20;if(_16){_20={$8l:_6,$644:_9,$1299:_4.usesLanes(),$1297:_3.useSublanes,$117z:_4.getDateLeftOffset(_3.getEventStartDate(_2)),$1171:_1.getLeft()+_14,$125a:_7+(_19?_19.top:0),$125b:_19?_19.height:_18.height,$131b:_1.getVisibleWidth(),$1172:_17,$131q:!_17,$131e:_3.getEventStartDate(_1.event),$131f:_3.getEventEndDate(_1.event),$130b:_18,$1298:_19}}else{_20={$8l:_6,$644:_9,$1299:_4.usesLanes(),$1297:_3.useSublanes,$117z:_10+(_15&&_19?_19.left:0),$1171:_1.getLeft()+_14,$125a:_1.getTop(),$125b:_1.getVisibleHeight(),$131b:(_19?_19.width:(_18&&_4.getLaneWidth?_4.getLaneWidth(_2[_3.laneNameField]):_11)),$131g:true,$131e:_3.getEventStartDate(_1.event),$131f:_3.getEventEndDate(_1.event),$130b:_18,$1298:_19}}
if(_20.$125a==-1){_20.$125a=0;_20.$125b-=_5.getScrollTop()}
_1.$1245=_20;this.positionToEventCanvas(true);_20.$1827=false;return isc.EH.STOP_BUBBLING},dragResizeMove:function(){var _1=this.eventCanvas,_2=_1.$1245,_3=_1.event,_4=_1.calendar,_5=this.view,_6=_2.$125a,_7=_2.$117z,_8=_2.$125b,_9=_2.$131b,_10=_2.$131e,_11=_2.$131f,_12=isc.DateUtil;var _13=_5.getSnapData(null,null,null,true,null,_2.$131g);var _14;if(_2.$131g){_14=_5.getDateFromPoint();_11=_4.addSnapGapsToDate(_14,_5,1);var _15=isc.DateUtil.getLogicalDateOnly(_10);var _16=isc.DateUtil.getLogicalDateOnly(_11);if(_15.getDate()!=_16.getDate()){_11=isc.DateUtil.getEndOf(_15,"D",false)}
var _17=_5.getDateTopOffset(_11);_8=_17-_6}else if(_2.$1172){_14=_13&&_13.startDate.duplicate();if(!_14)_14=_5.startDate.duplicate();_10=_14;var _18=_7+_9;if(_3[_4.durationField]!=null){var _19=_11.getTime()-_10.getTime(),_20=_3[_4.durationUnitField],_21=_12.getTimeUnitMilliseconds(_20);if(_19%_21!=0){var _22=Math.round(_12.convertPeriodUnit(_19,"ms",_20)),_10=_12.dateAdd(_11,_20,_22*-1,null,null,null,this.firstDayOfWeek)}}
var _23=_5.getSnapData(null,null,_10);var _7=_23.startLeftOffset;_9=(_18-_7)}else{_14=_13&&_13.endDate.duplicate();if(!_14)_14=_5.endDate.duplicate();_11=_14.duplicate();var _24=_4.getVisibleEndDate(_5);if(_11.getTime()>_24.getTime()){_11.setTime(_24.getTime())}
if(_3[_4.durationField]!=null){var _19=_11.getTime()-_10.getTime(),_20=_3[_4.durationUnitField],_21=_12.getTimeUnitMilliseconds(_20);if(_19%_21!=0){var _22=Math.round(_12.convertPeriodUnit(_19,"ms",_20)),_11=_12.dateAdd(_10,_20,_22,null,null,null,this.firstDayOfWeek)}}
var _23=_5.getSnapData(null,null,_10);var _25=_5.getSnapData(null,null,_11);var _7=_23?_23.startLeftOffset:0,_18=_25.endLeftOffset;_9=_18-_7}
if(_11.getTime()<=_10.getTime()||_9<=0||_8<=0){return isc.EH.STOP_BUBBLING}
var _26=_4.createEventObject(_3,_10,_11);var _27=_4.eventResizeMove(_3,_26,_5,_2);_2.$131e=_10;_2.$131f=_11;_2.$125a=_6;_2.$117z=_7;_2.$131b=_9;_2.$125b=_8;this.setRect(_2.$117z,_2.$125a,_2.$131b,_2.$125b);if(_27!=false){_2.$1827=false;_2.$142s=_10.duplicate();_2.$142t=_11.duplicate();this.setDragCursor("default")}else{_2.$1827=true;this.setDragCursor("not-allowed")}
if(_5.shouldShowDragHovers())isc.Hover.show(this.getHoverHTML(),this.hoverProps);return isc.EH.STOP_BUBBLING},setDragCursor:function(_1){var _2=this.getCurrentCursor();if(_2==_1)return;this.setCursor(_1);this.eventCanvas.setCursor(_1);this.view.setCursor(_1);if(this.view.body)this.view.body.setCursor(_1);if(this.view.frozenBody)this.view.frozenBody.setCursor(_1);if(isc.EH.lastEvent&&isc.EH.lastEvent.target&&isc.EH.lastEvent.target.setCursor){isc.EH.lastEvent.target.setCursor(_1)}},dragResizeStop:function(){var _1=this.eventCanvas,_2=_1.$1245,_3=_1.calendar,_4=this.view,_5=_1.event,_6=_2.$142s,_7=_2.$142t;if(_2.$1827&&!_3.eventUseLastValidDropDates){_6=null;_7=null}
this.setDragCursor("default");if(_4.shouldShowDragHovers())isc.Hover.hide();this.hide();if((_2.$1172&&!_6)||(_2.$131q&&!_7)){this.$1244=false;return isc.EH.STOP_BUBBLING}
var _8=_3.createEventObject(_5,_6,_7);if(_5[_3.durationField]!=null){var _9=_7.getTime()-_6.getTime();var _10=Math.round(isc.DateUtil.convertPeriodUnit(_9,"ms",_5[_3.durationUnitField]));_8[_3.durationField]=_10;_7=_2.$142t=_3.getEventEndDate(_8);_8[_3.endDateField]=_7}
if(_3.getEventStartDate(_5).getTime()==_3.getEventStartDate(_8).getTime()&&_3.getEventEndDate(_5).getTime()==_3.getEventEndDate(_8).getTime())
{return}
if(_4.isTimelineView()){if(_2.$1172&&_5[_3.leadingDateField]){var _11=_5[_3.leadingDateField].duplicate();var _12=isc.DateUtil.getPeriodLength(_5[_3.startDateField],_8[_3.startDateField],"mn");_11.setMinutes(_11.getMinutes()+_12);_8[_3.leadingDateField]=_11}
if(!_2.$1172&&_5[_3.trailingDateField]){var _13=_5[_3.trailingDateField].duplicate();var _12=isc.DateUtil.getPeriodLength(_5[_3.endDateField],_8[_3.endDateField],"mn");_13.setMinutes(_13.getMinutes()+_12);_8[_3.trailingDateField]=_13}}
var _14=_3.eventResizeStop(_5,_8,null,_4);if(_14!=false){if(_4.isTimelineView()){if(_3.timelineEventResized(_5,_6,_7)==false)return false}else{if(_3.eventResized(_7,_5)==false)return false}
_3.updateCalendarEvent(_5,_8,null,"mouse")}
this.$1244=false;return isc.EH.STOP_BUBBLING}};isc.A.$171d="center";isc.B.push(isc.A.mouseUp=function isc_CalendarView_mouseUp(){if(this.$53r){var _1=this.getEventColumn(this.getOffsetX()),_2=this.getEventRow(this.getOffsetY()),_3=this.getRecord(_2);this.cellMouseUp(_3,_2,_1)}
return isc.EH.STOP_BUBBLING});isc.evalBoundary;isc.B.push(isc.A.mouseDown=function isc_CalendarView_mouseDown(){},isc.A.init=function isc_CalendarView_init(){this.calendar=this.creator;this.resetEventCaches(true);this.resetCanvasCaches(true);this.resetLaneCaches(true);if(this.hoverAutoFitWidth==null){this.hoverAutoFitWidth=this.calendar.hoverAutoFitWidth}
if(this.hoverAutoFitMaxWidth==null){this.hoverAutoFitMaxWidth=this.calendar.hoverAutoFitMaxWidth}
return this.Super("init",arguments)},isc.A.resetEventCaches=function isc_CalendarView_resetEventCaches(_1){this.$232i=_1?{}:null;this.$232j=_1?{}:null;this.$232k=_1?{}:null},isc.A.resetCanvasCaches=function isc_CalendarView_resetCanvasCaches(_1){this.$232l=_1?{}:null;this.$232m=_1?{}:null;this.$232n=_1?{}:null;this.$232o=_1?{}:null},isc.A.resetLaneCaches=function isc_CalendarView_resetLaneCaches(_1){this.laneMap=_1?{}:null;this.laneIndexCache=_1?{}:null;this.laneHeightCache=_1?{}:null},isc.A.shouldRefreshEventsOnDraw=function isc_CalendarView_shouldRefreshEventsOnDraw(){var _1=this.calendar,_2=!_1.getDataSource(),_3=!_2&&_1.autoFetchData,_4=_1.$2830,_5=_1.$283a,_6=false;var _7=this;while(_7){if(_7.$vc=="show"){_6=true;break}
_7=_7.parentElement}
return _2||_4||(_3&&(_5||_6))},isc.A.showGhostCanvas=function isc_CalendarView_showGhostCanvas(_1,_2,_3){if(!this.shouldAllowLongEvents())return;this.ghostCanvas=_1;this.ghostEvent=isc.addProperties({},_1&&_1.event);if(_2)this.ghostEvent[this.calendar.startDateField]=_2;if(_3)this.ghostEvent[this.calendar.endDateField]=_3;this.ghostMouseDates=[_2,_3];this.ghostLastMouseDates=[_2,_3];if(this.longEventsLayouts){this.longEventsLayouts.callMethod("showGhostCanvas",_1)}else if(this.longEventsLayout){this.longEventsLayout.showGhostCanvas(_1)}},isc.A.updateGhostCanvas=function isc_CalendarView_updateGhostCanvas(_1,_2,_3){if(!this.shouldAllowLongEvents())return;var _4=this.calendar;var _5=isc.DateUtil.createLogicalDate(_1);var _6=isc.DateUtil.createLogicalDate(this.ghostLastMouseDates[0]);var _7=Math.round(isc.DateUtil.getPeriodLength(_5,_6,"d"));if(_7==0)return;var _8=_1,_9=_2;if(this.inGhostDragCreate){if(_5<this.ghostEventAnchorDate){_8=_1;_9=isc.DateUtil.getEndOf(this.ghostEventAnchorDate,"D",false)}else if(_5>this.ghostEventAnchorDate){_8=isc.DateUtil.getStartOf(this.ghostEventAnchorDate,"D",false);_9=_2}}else{var _10=isc.DateUtil.getPeriodLength(this.ghostEventAnchorDate,_5,"d");var _11=(_10>=0?"+":"")+_10+"d";_8=isc.DateUtil.adjustDate(this.$300x,_11);_9=isc.DateUtil.adjustDate(this.$300y,_11)}
this.ghostEvent[_4.startDateField]=_8;this.ghostEvent[_4.endDateField]=_9;this.ghostLastMouseDates=[_1,_2];if(this.longEventsLayouts){this.longEventsLayouts.callMethod("updateGhostCanvas",_8,_9,"updateGhostCanvas")}else if(this.longEventsLayout){this.longEventsLayout.updateGhostCanvas(_8,_9,"updateGhostCanvas")}},isc.A.hideGhostCanvas=function isc_CalendarView_hideGhostCanvas(){if(!this.shouldAllowLongEvents())return;if(this.longEventsLayouts){this.longEventsLayouts.callMethod("hideGhostCanvas")}else if(this.longEventsLayout){this.longEventsLayout.hideGhostCanvas()}
if(this.inGhostDragMove)delete this.inGhostDragMove;if(this.inGhostDragCreate)delete this.inGhostDragCreate},isc.A.startGhostDragCreate=function isc_CalendarView_startGhostDragCreate(_1,_2){if(!this.shouldAllowLongEvents())return;var _3=this.calendar;this.$3031();this.ghostEventAnchorDate=isc.DateUtil.getLogicalDateOnly(_1);this.ghostEvent={name:_3.newLongEventName};this.ghostEvent[_3.startDateField]=_1;this.ghostEvent[_3.endDateField]=_2||_1;this.inGhostDragCreate=true;this.showGhostCanvas(null,_1,_2);this.observeGhostEvents()},isc.A.startGhostDragMove=function isc_CalendarView_startGhostDragMove(_1){if(!this.shouldAllowLongEvents())return;var _2=this.calendar;this.$3031();this.ghostEvent={name:_2.newLongEventName};var _3=_1&&_1.event;var _4=this.ghostEvent[_2.startDateField]=_3[_2.startDateField].duplicate();var _5=this.ghostEvent[_2.endDateField]=_3[_2.endDateField].duplicate();this.ghostEventAnchorDate=isc.DateUtil.getLogicalDateOnly(_1.mouseDownDates[0]);this.ghostEventStartAnchorDelta=Math.ceil(isc.DateUtil.getPeriodLength(this.ghostEventAnchorDate,_4,"d"));this.$300z=_3;this.$300x=_4;this.$300y=_5;this.inGhostDragMove=true;this.showGhostCanvas(_1,_4,_5);this.observeGhostEvents()},isc.A.$3031=function isc_CalendarView__resetGhostState(){this.ignoreGhostEvents();delete this.inGhostDragCreate;delete this.inGhostDragMove;delete this.$300z;delete this.$300x;delete this.$300y;delete this.ghostEventStartAnchorDelta;delete this.$303e},isc.A.observeGhostEvents=function isc_CalendarView_observeGhostEvents(){var _1=this;this.$2797=isc.Page.setEvent("keyPress",function(){_1.ghostDragKeyPress()});this.$2798=isc.Page.setEvent("mouseUp",function(){_1.ghostDragMouseUp()})},isc.A.ignoreGhostEvents=function isc_CalendarView_ignoreGhostEvents(){if(this.$2797!=null){isc.Page.clearEvent("keyPress",this.$2797);delete this.$2797}
if(this.$2798!=null){isc.Page.clearEvent("mouseUp",this.$2798);delete this.$2798}},isc.A.ghostDragKeyPress=function isc_CalendarView_ghostDragKeyPress(){var _1=isc.EH.getKey();if(_1=="Escape"&&(this.inGhostDragCreate||this.inGhostDragMove)){this.logWarn("in ghostDragKeyPress - key is 'Escape' - calling cancelGhostDrag()")
this.cancelGhostDrag()}},isc.A.ghostDragMouseUp=function isc_CalendarView_ghostDragMouseUp(){if(this.isMonthView()){if(this.inGhostDragCreate){if(!this.$288v){var _1=this.calendar,_2=this.ghostEvent[_1.startDateField],_3=this.ghostEvent[_1.endDateField],_4=isc.DateUtil.compareLogicalDates(_2,_3)==0;if(_4){delete this.inGhostDragCreate;this.ignoreGhostEvents();return}}
this.finishGhostDragCreate();this.ignoreGhostEvents();return}
if(this.inGhostDragMove){this.finishGhostDragMove();this.ignoreGhostEvents()}
return}
if(this.inGhostDragCreate)this.finishGhostDragCreate();if(this.inGhostDragMove)this.finishGhostDragMove();this.ignoreGhostEvents()},isc.A.finishGhostDragCreate=function isc_CalendarView_finishGhostDragCreate(){delete this.inGhostDragCreate;this.$303e=true;var _1=this.calendar;var _2=this.ghostEvent[_1.startDateField],_3=this.ghostEvent[_1.endDateField];this.ignoreGhostEvents();var _4=_1.createEventObject(null,_2,_3,null,null,_1.newLongEventName);if(this.$288v){delete this.$288v;_4[_1.allDayField]=true}else if(isc.DateUtil.compareLogicalDates(_2,_3)!=0)
{_4[_1.allDayField]=true}
_1.showEventDialog(_4,true)},isc.A.finishGhostDragMove=function isc_CalendarView_finishGhostDragMove(){delete this.inGhostDragMove;this.hideGhostCanvas();var _1=this.$300z||this.ghostCanvas.event;delete this.$300z;delete this.$300x;delete this.$300y;this.calendar.updateCalendarEvent(_1,this.ghostEvent)},isc.A.cancelGhostDrag=function isc_CalendarView_cancelGhostDrag(){delete this.inGhostDragCreate;delete this.inGhostDragMove;delete this.$300z;delete this.$300x;delete this.$300y;delete this.$288v;this.ignoreGhostEvents();this.hideGhostCanvas()},isc.A.initWidget=function isc_CalendarView_initWidget(){this.$27q={};this.$1743=[];this.$1725=[];var _1=this.calendar;if(this.shouldAllowLongEvents()&&(this.viewName=="day"||this.viewName=="week")){this.longEventsLayout=this.createAutoChild("longEventsLayout",{calendarView:this,calendar:this.calendar,styleName:this.calendar.longEventLayoutStyleName,canvasHeight:_1.longEventHeight,canvasSpacing:_1.longEventSpace});this.gridComponents=["header",this.longEventsLayout,"body"]}
this.firstDayOfWeek=_1.firstDayOfWeek;var _2=this.showHover;if(_2==null)_2=_1.showViewHovers;this.setShowHover(_2);this.Super("initWidget",arguments);if(this.installLocalHandlers)this.installLocalHandlers()
this.setChosenDate(this.chosenDate)},isc.A.setEventData=function isc_CalendarView_setEventData(_1){this.$1743=_1},isc.A.getEventData=function isc_CalendarView_getEventData(){if(!this.$1743)this.$1743=[];return this.$1743},isc.A.addEventData=function isc_CalendarView_addEventData(_1){var _2=this.getEventData();if(!_2.contains(_1)){_2.add(_1);return true}
return false},isc.A.removeEventData=function isc_CalendarView_removeEventData(_1){this.getEventData().remove(_1)},isc.A.setLongEventData=function isc_CalendarView_setLongEventData(_1){this.$2777=_1},isc.A.getLongEventData=function isc_CalendarView_getLongEventData(){if(!this.$2777)this.$2777=[];return this.$2777},isc.A.viewMouseMove=function isc_CalendarView_viewMouseMove(_1,_2,_3,_4,_5){},isc.A.viewDragMove=function isc_CalendarView_viewDragMove(_1){this.logInfo("In viewDragMove");this.viewMouseMove()},isc.A.getMouseData=function isc_CalendarView_getMouseData(){return this.$1744},isc.A.shouldShowColumnLayouts=function isc_CalendarView_shouldShowColumnLayouts(){if(this.isMonthView())return false;if(this.isTimelineView())return false;return!!this.calendar.showColumnLayouts},isc.A.getVisibleStartDate=function isc_CalendarView_getVisibleStartDate(){return this.startDate},isc.A.getVisibleEndDate=function isc_CalendarView_getVisibleEndDate(){return this.endDate},isc.A.setChosenDate=function isc_CalendarView_setChosenDate(_1){var _2=this.calendar;var _3=_1.logicalDate?_1.duplicate():isc.DateUtil.getLogicalDateOnly(_1);var _4=_3.getWeek();this.logicalDate=_3.duplicate();this.chosenDate=_3;this.chosenWeek=_4;this.firstDayOfWeek=this.calendar.firstDayOfWeek;var _5=this.firstDayOfWeek;if(this.rangeUnit){this.periodStartDate=isc.DateUtil.getStartOf(this.chosenDate,this.rangeUnit,false,_5);this.startDate=this.periodStartDate.duplicate();this.periodEndDate=isc.DateUtil.getEndOf(this.chosenDate,this.rangeUnit,false,_5);this.endDate=this.periodEndDate.duplicate();if(this.isWeekView()){this.labelStartDate=this.startDate.duplicate();this.labelEndDate=this.endDate.duplicate();if(_2.showWeekends==false){if(isc.DateUtil.isWeekend(this.startDate)){this.labelStartDate=isc.DateUtil.getNextWeekday(this.startDate,_2.getWeekendDays())}
if(isc.DateUtil.isWeekend(this.endDate)){this.labelEndDate=isc.DateUtil.getPreviousWeekday(this.endDate,_2.getWeekendDays())}}}else if(this.isMonthView()){this.startDate=isc.DateUtil.getStartOf(this.chosenDate,"M",false,_5);this.startDate=isc.DateUtil.getStartOf(this.startDate,"W",false,_5)
if(_2.fixedMonths){this.endDate=isc.DateUtil.getEndOf(isc.DateUtil.dateAdd(this.startDate,"D",41),"D",false,_5)}else{this.endDate=isc.DateUtil.getEndOf(isc.DateUtil.adjustDate(this.endDate,"-1MS"),"W",false,_5)}}
this.logicalDate=isc.DateUtil.createLogicalDate(this.startDate)}
this.$132n=false;if(this.isSelectedView()){if(this.verticalEvents&&_2.showWorkday&&_2.scrollToWorkday){this.$2440=true}
if(this.isMonthView()&&this.year!=null&&this.year==_2.year&&this.month==_2.month)
{this.markForRedraw("chosenDate changed");return}
this.updateRange();this.$1739()}else{if(this.verticalEvents&&_2.showWorkday&&_2.scrollToWorkday){this.$2440=true}
this.$220m=true;this.$123s=true}},isc.A.getPeriodStartDate=function isc_CalendarView_getPeriodStartDate(){return this.periodStartDate},isc.A.getPeriodEndDate=function isc_CalendarView_getPeriodEndDate(){return this.periodEndDate},isc.A.updateRange=function isc_CalendarView_updateRange(_1){delete this.$220m;if(this.isWeekView()||this.isDayView()){this.updateFieldDates();this.updateRowDates();this.updateLongEventDates();if(this.$2440){delete this.$2440;this.delayCall("scrollToWorkdayStart")}
this.markForRedraw()}else if(this.isMonthView()){this.updateFieldDates();this.updateRowDates();this.markForRedraw()}},isc.A.shouldAllowLongEvents=function isc_CalendarView_shouldAllowLongEvents(){if(this.allowLongEvents!=null)return this.allowLongEvents;return this.calendar.allowLongEvents},isc.A.getFieldTitle=function isc_CalendarView_getFieldTitle(_1){var _2=this.calendar,_3=this.Super("getFieldTitle",arguments),_4=this.getUnderlyingField(_1);if(_4){var _5=_4.date,_6=_5?_5.getDay():_4.$654;if(_6!=null){if(_2.getDateHeaderTitle){_3=_2.getDateHeaderTitle(_5,_6,_3,this)||_3}}}
return _3},isc.A.getMinimumSnapGapTime=function isc_CalendarView_getMinimumSnapGapTime(_1){var _2=this.$27q,_3=_2.minimumSnapGapMillis;if(!_3){var _4=[1,5,10,15,20,30,60,120,180,240,360,480,720,1440];var _5=isc.DateUtil.convertPeriodUnit(_2.millisPerPixel,"ms","mn");for(var i=0;i<_4.length;i++){if(_5<=_4[i]){_5=_4[i];break}}
_3=isc.DateUtil.convertPeriodUnit(_5,"mn","ms")}
if(!_1)_1="mn";return Math.floor(isc.DateUtil.convertPeriodUnit(_3,"ms",_1))},isc.A.getTimePerCell=function isc_CalendarView_getTimePerCell(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerCell;if(!_4){_4=isc.DateUtil.convertPeriodUnit(_2.minutesPerRow,"mn","ms")}
if(!_1)_1="mn";return Math.floor(isc.DateUtil.convertPeriodUnit(_4,"ms",_1))},isc.A.getTimePerSnapGap=function isc_CalendarView_getTimePerSnapGap(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerSnapGap;if(!_4){if(_3.calendarEventSnapGap==null){_4=this.getTimePerCell("ms")}else if(_3.calendarEventSnapGap==0){_4=this.getMinimumSnapGapTime("ms")}else{_4=isc.DateUtil.convertPeriodUnit(_3.calendarEventSnapGap,"mn","ms")}
_3.millisPerSnapGap=_4}
if(!_1)_1="mn";return isc.DateUtil.convertPeriodUnit(_4,"ms",_1)},isc.A.getTimePerPixel=function isc_CalendarView_getTimePerPixel(_1){var _2=this.calendar,_3=this.$27q;var _4=Math.floor(this.getTimePerCell("ms")/this.cellHeight);if(!_1)_1="mn";return isc.DateUtil.convertPeriodUnit(_4,"ms",_1)},isc.A.getSnapGapPixels=function isc_CalendarView_getSnapGapPixels(_1,_2){var _3=this.getTimePerCell()/this.getTimePerSnapGap();return Math.round(this.cellHeight/_3)},isc.A.getDateLabelText=function isc_CalendarView_getDateLabelText(_1,_2){return null},isc.A.setShowHover=function isc_CalendarView_setShowHover(_1){if(this.showViewHovers==false)return;this.showHover=_1;this.canHover=_1},isc.A.shouldShowEventHovers=function isc_CalendarView_shouldShowEventHovers(){if(this.showHover==false||this.calendar.showViewHovers==false)return false;if(this.showEventHovers!=null)return this.showEventHovers;return this.calendar.showEventHovers},isc.A.shouldShowHeaderHovers=function isc_CalendarView_shouldShowHeaderHovers(){if(this.showHover==false||this.calendar.showViewHovers==false)return false;if(this.showHeaderHovers!=null)return this.showHeaderHovers;return this.calendar.showHeaderHovers},isc.A.shouldShowLaneFieldHovers=function isc_CalendarView_shouldShowLaneFieldHovers(){if(this.showHover==false)return false;if(this.showLaneFieldHovers!=null)return this.showLaneFieldHovers;return this.calendar.showLaneFieldHovers},isc.A.shouldShowCellHovers=function isc_CalendarView_shouldShowCellHovers(){if(this.showHover==false)return false;if(this.showCellHovers!=null)return this.showCellHovers;return this.calendar.showCellHovers},isc.A.shouldShowDragHovers=function isc_CalendarView_shouldShowDragHovers(){if(this.showHover==false)return false;if(this.showDragHovers!=null)return this.showDragHovers;return this.calendar.showDragHovers},isc.A.shouldShowZoneHovers=function isc_CalendarView_shouldShowZoneHovers(){if(this.shouldShowCellHovers())return false;if(this.showZoneHovers!=null)return this.showZoneHovers;return this.calendar.showZoneHovers},isc.A.isSelectedView=function isc_CalendarView_isSelectedView(){return this.creator.getCurrentViewName()==this.viewName},isc.A.isTimelineView=function isc_CalendarView_isTimelineView(){return this.viewName=="timeline"},isc.A.isDayView=function isc_CalendarView_isDayView(){return this.viewName=="day"},isc.A.isWeekView=function isc_CalendarView_isWeekView(){return this.viewName=="week"},isc.A.isMonthView=function isc_CalendarView_isMonthView(){return this.viewName=="month"},isc.A.isVerticalView=function isc_CalendarView_isVerticalView(){return this.viewName=="day"||this.viewName=="week"},isc.A.updateLaneRollover=function isc_CalendarView_updateLaneRollover(_1){if(!this.isTimelineView())return;this.clearLastHilite();if(_1==null)return;this.body.lastOverRow=_1;this.body.updateRollOver(_1)},isc.A.rebuild=function isc_CalendarView_rebuild(_1){if(_1==null)_1=true;if(this.$152e)this.$152e(_1);else if(this.rebuildFields){this.rebuildFields();this.setChosenDate(this.chosenDate)}else{if(this.isMonthView())this.refreshFields();this.refreshEvents("rebuild")}},isc.A.initCacheValues=function isc_CalendarView_initCacheValues(){var _1=this.calendar;this.$27q={firstDayOfWeek:this.firstDayOfWeek,rangeStartDate:_1.getPeriodStartDate(this),rangeEndDate:_1.getPeriodEndDate(this),calendarEventSnapGap:_1.eventSnapGap};this.$27q.rangeStartMillis=this.$27q.rangeStartDate.getTime();this.$27q.rangeEndMillis=this.$27q.rangeEndDate.getTime();this.updateSnapProperties();return this.$27q});isc.evalBoundary;isc.B.push(isc.A.updateSnapProperties=function isc_CalendarView_updateSnapProperties(){delete this.$27q.millisPerCell;delete this.$27q.millisPerSnapGap;delete this.$27q.millisPerPixel;delete this.$27q.snapGapPixels;this.$27q.millisPerCell=this.getTimePerCell("ms");this.$27q.millisPerPixel=this.getTimePerPixel("ms");this.$27q.minimumSnapGapMillis=this.getMinimumSnapGapTime("ms");this.$27q.millisPerSnapGap=this.getTimePerSnapGap("ms")},isc.A.getLaneIndex=function isc_CalendarView_getLaneIndex(_1){return null},isc.A.getLane=function isc_CalendarView_getLane(_1){return null},isc.A.getLaneFromPoint=function isc_CalendarView_getLaneFromPoint(_1,_2){return null},isc.A.getSublane=function isc_CalendarView_getSublane(_1,_2){if(!this.hasSublanes())return null;var _3=this.getLane(_1),_4=_3&&_3.sublanes?isc.isAn.Object(_2)?_2:_3.sublanes.find(this.calendar.laneNameField,_2):null;return _4},isc.A.getSublaneFromPoint=function isc_CalendarView_getSublaneFromPoint(_1,_2){return null},isc.A.setLaneTitle=function isc_CalendarView_setLaneTitle(_1,_2){var l=this.getLane(_1);if(!l)return false;l.title=_2;this.updateLanes(this.lanes);return true},isc.A.updateLanes=function isc_CalendarView_updateLanes(_1){this.setLanes(_1,true);this.body.redraw()},isc.A.getLaneMap=function isc_CalendarView_getLaneMap(){return this.laneMap},isc.A.usesLanes=function isc_CalendarView_usesLanes(){return this.isTimelineView()||(this.isDayView()&&this.calendar.showDayLanes)},isc.A.hasLanes=function isc_CalendarView_hasLanes(){return this.usesLanes()&&this.lanes&&this.lanes.length>0},isc.A.hasSublanes=function isc_CalendarView_hasSublanes(){return this.calendar.useSublanes&&this.usesLanes()},isc.A.useLanePadding=function isc_CalendarView_useLanePadding(){if(this.isTimelineView())return true;if(this.usesLanes()){return this.calendar.eventOverlap?false:true}
return false},isc.A.canScrollToEvent=function isc_CalendarView_canScrollToEvent(_1){var _2=this.startDate.getTime(),_3=this.endDate.getTime(),_4=this.calendar.getEventStartDate(_1),_5=this.calendar.getEventEndDate(_1);if((_4.getTime()>=_2&&_4.getTime()<=_3)||(_5.getTime()>=_2&&_5.getTime()<=_3))
{return true}
return false},isc.A.scrollToEvent=function isc_CalendarView_scrollToEvent(_1){var _2=this.calendar,_3={start:this.startDate.getTime(),end:this.endDate.getTime()},_4=_2.getEventStartDate(_1),_5=_2.getEventEndDate(_1);if(this.canScrollToEvent(_1)){var x=null,y=null;var _8=this.getCurrentEventCanvas(_1);if(_8){x=_8.getLeft();y=_8.getTop()}else{x=this.getDateLeftOffset(_4);if(this.isTimelineView()){y=this.getRowTop(this.getLaneIndex(_1[_2.laneNameField]))}else{y=this.getDateTopOffset(_4,_1[_2.laneNameField])}}
this.body.scrollTo(x,y)}},isc.A.getCellCSSText=function isc_CalendarView_getCellCSSText(_1,_2,_3){var _4=this.calendar.$116j(this,_1,_2,_3);return _4},isc.A.getEventCanvasStyle=function isc_CalendarView_getEventCanvasStyle(_1){if(this.usesLanes()){var _2=this.calendar,_3=_2.laneNameField,_4=_2.sublaneNameField,_5=_2.eventStyleNameField,_6=this.getLane(_1[_3]),_7=_6&&_2.useSublanes?this.getSublane(_6[_3],_1[_4]):null;return(_7&&_7.eventStyleName)||(_6&&_6.eventStyleName)||this.eventStyleName}
return this.eventStyleName},isc.A.getDateFromPoint=function isc_CalendarView_getDateFromPoint(){return this.getCellDate()},isc.A.cellHoverHTML=function isc_CalendarView_cellHoverHTML(_1,_2,_3){var _4=this.calendar.$140d(this,_1,_2,_3);return _4},isc.A.headerHoverHTML=function isc_CalendarView_headerHoverHTML(_1){var _2=this.getField(_1);return this.calendar.$140e(this,this.fieldHeaderLevel,_2,_2.date,_2.endDate)},isc.A.getPrintHTML=function isc_CalendarView_getPrintHTML(_1,_2){if(this.isMonthView())return this.Super("getPrintHTML",arguments);if(_2){this.delayCall("asyncGetPrintHTML",[_1,_2]);return null}else{return this.asyncGetPrintHTML(_1,_2)}},isc.A.asyncGetPrintHTML=function isc_CalendarView_asyncGetPrintHTML(_1,_2){this.$158l=true;var _3=this.calendar.lanes;if(_3){this.$2796=[];for(var i=0;i<_3.length;i++){var _5=_3[i];this.$2796.add(isc.addProperties({},_5));for(var j=0;j<this.calendar.laneFields.length;j++){var _7=this.calendar.laneFields[j];var _8={};_8.minWidth=_7.minWidth;_8.width=_7.width
var _9=_5[_7.name];var _10=this.getLaneFieldStyleName(_7,_5);var _11=_3[i].height;var _12=isc.Canvas.measureContent(_9,_10,true,true,_8);if(_12>_5.height)_5.height=_12}}
this.calendar.setLanes(_3)}
this.refreshVisibleEvents(true,"asyncGetPrintHTML");_1=isc.addProperties({},_1);this.body.printChildrenAbsolutelyPositioned=true;var _13=this.calendar,_14=this.isTimelineView(),_15=this.isWeekView(),_16=this.isDayView(),_17=this.isMonthView();if(_17)return;var _18=this.getVisibleFields(this.completeFields),_19=this.getData(),_20=isc.StringBuffer.create(),_21=0,_22=[];if(isc.isA.Tree(_19))_19=_19.$27m;for(var i=0;i<_18.length;i++){var _7=_18[i];var _23=this.getFieldHeaderButton(_7.masterIndex);var _24=_23?_23.width||_23.getVisibleWidth():null;if(_24==null)_24=this.getFieldWidth(_7);_24=_14?Math.ceil(_24):Math.floor(_24);_22.add(_24)}
_21=_22.sum();var _25="<TR",_26="</TR>",_27=">",_28=" HEIGHT=",_29=" VALIGN=";var _30=this.creator.dateLabel?this.creator.dateLabel.getVisibleHeight():0;_20.append("<div style='position:relative;top:"+_30+"px;'>");_20.append("<TABLE cellpadding='0' cellspacing='0' WIDTH='",_21,"' style='border: 1px solid grey;'>");_20.append("<THEAD>");if(this.showHeader){var _31=this.getPrintHeaders(0,this.fields.length,_22);this.$238k=isc.Canvas.measureContent(_31,"printHeader",true,true,{wrap:false});_20.append(_31)}
_20.append("</THEAD>");_30+=this.getHeaderHeight();_20.append("<TBODY>");for(var i=0;i<_19.length;i++){var _32=Math.floor(this.getRowHeight(_19[i],i));if(i<_19.length-1){_32=this.getRowTop(i+1)-this.getRowTop(i)}
_20.append(_25,_28,_32,_27);for(var j=0;j<_18.length;j++){var _33=this.getCellValue(_19[i],i,j);_20.append("<TD class='",this.getCellStyle(_19[i],i,j),"' ","style='width:",_22[j]-1,"px; ","box-sizing: border-box; ","max-width:",_22[j]-1+"px;","border-width: 0px 1px 1px 0px; ","height: ",_32,"px;","border-bottom: 1px solid #ABABAB; border-right: 1px solid #ABABAB; ","border-top: none; border-left: none;",this.getCellCSSText(_19[i],i,j),"'>");_20.append(this.getCellValue(_19[i],i,j)||"&nbsp;");_20.append("</TD>")}
_20.append(_26)}
_20.append("</TBODY>");_20.append("</TABLE>");var _34=this.body.children;for(var i=0,_35=_34.length;i<_35;i++){var _36=_34[i],_37=_36.isEventCanvas||_36.isZoneCanvas||_36.isIndicatorCanvas;if(!_37){if(this.shouldShowColumnLayouts()&&isc.isA.Layout(_36)){_20.append(_36.getHandle().outerHTML)}
continue}
if(!_36.isDrawn()||!_36.isVisible())continue;if(_36.isZoneCanvas)_1.i=0;else if(_36.isIndicatorCanvas)_1.i=_35;else _1.i=i;var _38=_36.getPrintHTML(_1);_20.append(_38)}
_20.append("</div>");var _24=_20.release(false);if(_2){this.fireCallback(_2,"HTML",[_24])}
delete this.$158l;if(this.$2796){this.calendar.setLanes(this.$2796);delete this.$2796}
return _24},isc.A.getPrintHeaders=function isc_CalendarView_getPrintHeaders(_1,_2,_3){var _4=(this.isRTL()?isc.Canvas.LEFT:isc.Canvas.RIGHT),_5=this.headerBaseStyle,_6;var _7=this.headerRowPrintHeight;if(this.headerSpans){var _8=[],_9=1;for(var i=_1;i<_2;i++){var _11=this.getField(i);_8[i]=[_11];var _12=this.spanMap[_11.name];while(_12!=null){_8[i].add(_12);_12=_12.parentSpan}
_9=Math.max(_8[i].length,_9)}
_6=[];for(var i=_9-1;i>=0;i--){_6[_6.length]="<TR HEIGHT="+_7+">";var _13=null,_14=null;for(var _15=_1;_15<_2;_15++){var _16=1,_17=1;var _18=(i==0);var _19=_8[_15][i];if(_19=="spanned"){continue}
var _20,_21=_15,_22=[];_17=0;while(_21<_2){var _23=null,_24=false;for(var _25=0;(i-_25)>=0;_25++){_23=_8[_21][i-_25];if(_23!=null){if(_19==null){_19=_23;_20=_25;if(i-_25==0){_18=true}}
if(_19==_23){_22[_17]=_25;_20=Math.min(_25,_20)}else{_24=true}
break}}
if(_24){break}
_21++;_17++}
if(_20!=null){_16=_20+1}
for(var _26=0;_26<_22.length;_26++)
{var _27=_8[_26+_15],_25=_22[_26];for(var _28=0;_28<=_25;_28++){if(_26==0&&_28==0){_27[i-_28]=_19}else if(_28<=_20){_27[i-_28]="spanned"}else{_27[i-_28]=null}}}
if(_19==null){this.logWarn("Error in getPrintHeaders() - unable to generate print header HTML from this component's specified headerSpans")}
var _29="center",_30;if(_18){_29=_19.align||_4;_30=this.getHeaderButtonTitle(_19.masterIndex)}else{_30=_19.title}
var _31=_6.length;_6[_6.length]="<TD class='";_6[_6.length]=_5;_6[_6.length]="' align='";_6[_6.length]="center";_6[_6.length]="' rowSpan='";_6[_6.length]=_16;_6[_6.length]="' colSpan='";_6[_6.length]=_17;_6[_6.length]="' ";var _32=_3[(_18?_19.masterIndex:_15)];_6[_6.length]="style='margin: 0px; padding: 0px; width:"+_32+"px; height:"+_7+"px; border-width: 0px 1px 1px 0px;' ";_6[_6.length]=">";_6[_6.length]=_30;_6[_6.length]="</TD>"}
_6[_6.length]="</TR>"}}else{_6=["<TR HEIGHT="+_7+">"];var _33=["<TD CLASS='",_5,"' HEIGHT="+_7+" ALIGN="].join(""),_34=this.frozenBody?this.frozenBody.fields.length:0;if(this.frozenBody){for(var _35=0;_35<_34;_35++){var _11=this.frozenBody.fields[_35];if(!_11)continue;var _29=_11.align||_4;var _36=_3[_35];var _37=this.getHeaderButtonTitle(_11.masterIndex);_6.addList([_33,_29," style='margin: 0px; padding: 0px; width:"+_36+"px; height:"+_7+"px; border-width: 0px 1px 1px 0px;'>",_37,"</TD>"])}}
for(var _35=0;_35<(_2-_34);_35++){var _11=this.body.fields[_35];if(!_11)continue;var _29=_11.align||_4;var _36=_3[_35+_34];_6.addList([_33,_29," style='width:"+_36+"px;'>",this.getHeaderButtonTitle(_11.masterIndex),"</TD>"])}
_6[_6.length]="</TR>"}
return _6.join(isc.emptyString)},isc.A.scrolled=function isc_CalendarView_scrolled(){if(this.shouldShowColumnLayouts())return;if(this.renderEventsOnDemand&&this.refreshVisibleEvents){delete this.$27q.viewportStartMillis;delete this.$27q.viewportEndMillis;this.delayedRefreshVisibleEvents(null,"scrolled")}},isc.A.resized=function isc_CalendarView_resized(_1,_2,_3){if(this.calendar.showWorkday&&!this.isMonthView()){this.cacheWorkdayRowHeight();this.markForRedraw()}
var _4;if(this.renderEventsOnDemand){if(!this.$81r&&this.isDrawn()){if(this.shouldShowColumnLayouts()){this.updateColumnLayouts()}else{this.refreshVisibleEvents(null,"resized - "+_3)}}}else if(this.shouldShowColumnLayouts()){this.updateColumnLayouts()}
if(this.calendar.allowLongEvents)this.refreshLongEvents();return _4},isc.A.forceDataSort=function isc_CalendarView_forceDataSort(_1,_2){var _3=this.calendar,_4=[];if(this.usesLanes()){_4.add({property:_3.laneNameField,direction:"ascending"})}
if(_3.overlapSortSpecifiers){_4.addList(_3.overlapSortSpecifiers)}else{_4.add({property:_3.startDateField,direction:"ascending"})}
if(_2||!_1){if(!_1)_1=this.getEventData()}
_1.setSort(_4)},isc.A.findEventsInRange=function isc_CalendarView_findEventsInRange(_1,_2,_3,_4){var _5=this.calendar,_6={},_7=_3!=null&&this.usesLanes();_6[_5.startDateField]=_1;_6[_5.endDateField]=_2;if(_7)_6[_5.laneNameField]=_3;var _8=this.findOverlappingEvents(_6,_6,[_6],_7,_4,true);return _8},isc.A.findOverlappingEvents=function isc_CalendarView_findOverlappingEvents(_1,_2,_3,_4,_5,_6){var _7=this.calendar,_8=_5!=null;var _9=_8?_5:this.getEventData();if(!_8)this.forceDataSort(_9,_6);var _10=[],_11=_9.getLength(),_12=_7.getEventStartDate(_2),_13=_7.getEventEndDate(_2);var _14={};var _15=_4?_1[_7.laneNameField]:null,_16=0;if(_15)_16=_9.findIndex(_7.laneNameField,_15);if(_16<0)return _10;var _17=this.isTimelineView();for(var i=_16;i<_11;i++){var _19=_9.get(i);if(!_19){isc.logWarn('findOverlappingEvents: potentially invalid index: '+i);break}
if(_4&&_19[_7.laneNameField]!=_15)break;var _20=false;if(_3&&_3.length>0){for(var j=0;j<_3.length;j++){if(_7.eventsAreSame(_19,_3[j])){_20=true;break}}
if(_20)continue}
if(_17){if(_19[_7.leadingDateField]&&_19[_7.trailingDateField]){_14[_7.leadingDateField]=_2[_7.leadingDateField];_14[_7.trailingDateField]=_2[_7.trailingDateField];if(_14[_7.trailingDateField]&&this.endDate){if(_14[_7.trailingDateField].getTime()>this.endDate.getTime()){_14[_7.trailingDateField].setTime(this.endDate.getTime()-1)}}}else{_14[_7.startDateField]=_12;_14[_7.endDateField]=_13;if(_14[_7.endDateField].getTime()>this.endDate.getTime()){_14[_7.endDateField].setTime(this.endDate.getTime()-1)}}}else{var _22=isc.DateUtil.getStartOf(_13,"d",false).getTime(),_23=isc.DateUtil.getEndOf(_12,"d",false).getTime(),_24=_7.getEventStartDate(_19),_25=_24.getTime(),_26=_7.getEventEndDate(_19),_27=_26.getTime();if(_25>_23||_27<_22)continue;if(_25<_22&&_27>_23){if(this.isWeekView())continue;_25=_22}
_14[_7.startDateField]=_12;if(_14[_7.startDateField].getTime()<_22){_14[_7.startDateField].setTime(_22)}
_14[_7.endDateField]=_13;if(_14[_7.endDateField].getTime()>_23){_14[_7.endDateField].setTime(_23)}}
_14[_7.laneNameField]=_19[_7.laneNameField];if(this.eventsOverlap(_14,_19,_4)){_10.add(_19)}}
return _10},isc.A.eventsOverlap=function isc_CalendarView_eventsOverlap(_1,_2,_3){var a=_1,_5=a["_"+this.viewName]||{},b=_2,_7=b["_"+this.viewName]||{},_8=this.calendar,_9=_8.startDateField,_10=_8.endDateField;if(_3&&a[_8.laneNameField]!=b[_8.laneNameField])return false;if(this.isTimelineView()){if(a[_8.leadingDateField]&&b[_8.leadingDateField])_9=_8.leadingDateField;if(a[_8.trailingDateField]&&b[_8.trailingDateField])_10=_8.trailingDateField}
var _11=a[_9],_12=a[_10]||_8.getEventEndDate(a);if(!_11||!_12)return false;var _13=_11.duplicate(),_14=_12.duplicate(),_15=b[_9],_16=b[_10]||_8.getEventEndDate(b),_17=_15.duplicate(),_18=_16.duplicate();if(this.isTimelineView()){if(_15.getTime()>this.endDate.getTime())return false;if(_16.getTime()<this.startDate.getTime())return false;if(_17.getTime()<_14.getTime()&&_18.getTime()>_13.getTime())return true;if(_17.getTime()!=_14.getTime()&&_18.getTime()!=_13.getTime()){var _19=Math.round(_8.getSnapGapPixels(this));_13=_5.snapStartLeftOffset||this.getDateLeftOffset(_11);_14=Math.max((_5.snapEndLeftOffset||this.getDateRightOffset(_12)),_13);if(_14-_13<_19)_14=_13+_19;_17=_7.snapStartLeftOffset||this.getDateLeftOffset(_15);_18=Math.max((_7.snapEndLeftOffset||this.getDateRightOffset(_16)),_17);if(_18-_17<_19)_18=_17+_19}}
if(_8.equalDatesOverlap&&_8.allowEventOverlap){if((_13<_17&&_14>=_18&&_13<=_18)||(_13<=_18&&_14>_18)||(_13<=_17&&_14>=_18)||(_13>=_17&&_14<=_18)){return true}else{return false}}else{if(_17<_14&&_18>_13)return true;return false}},isc.A.updateEventRange=function isc_CalendarView_updateEventRange(_1,_2){if(!isc.isAn.Object(_2))_2=this.overlapRanges.ranges[_2];var _3=_2.events;_3.remove(_1);this.updateOverlapRanges(_3)},isc.A.updateOverlapRanges=function isc_CalendarView_updateOverlapRanges(_1){var _2=this.calendar,_3=_1||this.getEventData(),_4=this.overlapRanges||[],_5=_3.getLength(),_6=this.isTimelineView(),_7=this.usesLanes(),_8=!_6,_9=[],_10=this.startDate,_11=this.endDate;var _12=(isc.isA.ResultSet(_3)?_3.allRows:_3);_12.setProperty("tagged",false);_12.setProperty("overlapProps",null);_12.setProperty("slotNum",null);_12.setSort([{property:_2.laneNameField,direction:"ascending"},{property:_2.startDateField,direction:"ascending"},{property:_2.endDateField,direction:"descending"}]);for(var i=0;i<_5;i++){var _14=_12.get(i);var _15={events:[_14]};_15[_2.startDateField]=_2.getEventStartDate(_14);if(_15[_2.startDateField]<_10)_15[_2.startDateField]=_10;_15[_2.endDateField]=_2.getEventEndDate(_14);if(_15[_2.endDateField]>_11)_15[_2.endDateField]=isc.DateUtil.adjustDate(_11,"-1ms");_15[_2.laneNameField]=_15.lane=_7?_14[_2.laneNameField]:null;var _16=true;for(var j=0;j<_4.length;j++){if(_15[_2.laneNameField]!=_4[j][_2.laneNameField])continue;else{if(_15[_2.endDateField].getDate()<_4[j][_2.startDateField].getDate()||_15[_2.startDateField].getDate()>_4[j][_2.endDateField].getDate()){continue}}
if(this.eventsOverlap(_15,_4[j],_7)){this.mergeOverlapRanges(_15,_4[j]);_16=false}
if(!_16)break}
if(_16){_4.add(_15);if(!_9.contains(_15))_9.add(_15)}}
for(i=0;i<_4.length;i++){var _18=_4[i];_18.id="range_"+i+"_"+this.viewName;if(_18.lane)_18.id+="_lane_"+_18.lane;_18.events.setProperty("overlapRangeId",_18.id);var _19=this.getFieldFromDate(_18[_2.startDateField],_18[_2.laneNameField]);if(_19){_18.fieldName=_19.name;_18.colNum=_19.masterIndex;if(_19.endDate&&_19.endDate<=_18.endDate){_18.endDate=_19.endDate.duplicate()}}}
this.overlapRanges=_4;return _9},isc.A.getTouchedOverlapRanges=function isc_CalendarView_getTouchedOverlapRanges(_1,_2,_3){if(!this.overlapRanges)this.overlapRanges=[];var _4=true,_5=this.calendar,_6=this.overlapRanges,r={},_8=[];r[_5.startDateField]=_1;r[_5.endDateField]=_2;r[_5.laneNameField]=_3;for(var k=0;k<_6.length;k++){var _10=_6[k];if(_3!=null&&_10[_5.laneNameField]!=_3)continue;var _11=this.eventsOverlap(r,_10,true);if(_11){_8.add(_10)}}
return _8},isc.A.mergeOverlapRanges=function isc_CalendarView_mergeOverlapRanges(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=this.calendar,b=_2,_5,_6;for(var i=0;i<_1.length;i++){var a=_1[i];if(a[_3.leadingDateField]&&b[_3.leadingDateField]){_5=_3.leadingDateField;_6=_3.trailingDateField}else{_5=_3.startDateField;_6=_3.endDateField}
if(a[_5]<b[_5])b[_5]=a[_5];if(a[_6]>b[_6])b[_6]=a[_6];if(a.totalSlots>b.totalSlots)b.totalSlots=a.totalSlots;b.events.addList(a.events);b.events=b.events.getUniqueItems()}},isc.A.getEventLaneIndex=function isc_CalendarView_getEventLaneIndex(_1){return this.getLaneIndex(_1[this.calendar.laneNameField])},isc.A.getEventLane=function isc_CalendarView_getEventLane(_1){return this.getLane(_1[this.calendar.laneNameField])},isc.A.hasOverlapRanges=function isc_CalendarView_hasOverlapRanges(){return this.overlapRanges!=null&&this.overlapRanges.length>0},isc.A.getLaneOverlapRanges=function isc_CalendarView_getLaneOverlapRanges(_1){if(!this.hasOverlapRanges())return;var _2=this.calendar,_3=[];this.overlapRanges.map(function(_4){if(_4[_2.laneNameField]==_1)_3.add(_4)});return _3},isc.A.getDayOverlapRanges=function isc_CalendarView_getDayOverlapRanges(_1){if(!this.hasOverlapRanges())return;var _2=this.getFieldNameFromDate(_1);if(_2)return this.getColOverlapRanges(_2)},isc.A.getColOverlapRanges=function isc_CalendarView_getColOverlapRanges(_1){if(!this.hasOverlapRanges())return;var _2=[];if(isc.isAn.String(_1)){_2=this.overlapRanges.findAll("fieldName",_1)}else{_2=this.overlapRanges.findAll("colNum",_1)}
return _2},isc.A.removeOverlapRanges=function isc_CalendarView_removeOverlapRanges(_1){if(!this.hasOverlapRanges()||!_1)return;_1.map(function(_2){_2.events.setProperty("overlapRangeId",null)});this.overlapRanges.removeList(_1)},isc.A.getEventOverlapRange=function isc_CalendarView_getEventOverlapRange(_1){if(!this.hasOverlapRanges())return;return this.overlapRanges.find("id",_1.overlapRangeId)},isc.A.getDateOverlapRange=function isc_CalendarView_getDateOverlapRange(_1,_2){if(!this.hasOverlapRanges())return;var _3=this.calendar,_4=_1.getTime();var _5=this.overlapRanges.map(function(_6){if(_4>=_6[_3.startDateField].getTime()&&_4<=_6[_3.endDateField].getTime()&&(!_2||_2==_6[_3.laneNameField]))
{return _6}});if(_5)_5.removeEmpty();return _5&&_5.length&&_5[0]?_5[0]:null},isc.A.retagLaneEvents=function isc_CalendarView_retagLaneEvents(_1){if(!this.usesLanes())return;var _2=this.getLaneIndex(_1);if(this.isTimelineView()){this.retagRowEvents(_2,true)}else{this.retagColumnEvents(_2,true)}},isc.A.retagDayEvents=function isc_CalendarView_retagDayEvents(_1){if(this.isTimelineView())return;var _2=this.getFieldFromDate(_1);if(_2)this.retagColumnEvents(_2,false)},isc.A.retagColumnEvents=function isc_CalendarView_retagColumnEvents(_1,_2){if(this.isTimelineView())return;var _3;if(isc.isA.Number(_1)){_3=this.body.getField(_1)}else{_3=_1;_1=this.body.getFieldNum(_3)}
this.removeOverlapRanges(this.getColOverlapRanges(_3.name));var _4=_3.startDate;if(!_4)return;var _5=_4,_6=this.getCellEndDate(this.data.length-1,_1);var _7=this.findEventsInRange(_5,_6,(_2?_3.name:null));this.renderEvents(_7,_2)},isc.A.retagRowEvents=function isc_CalendarView_retagRowEvents(_1){if(!this.isTimelineView())return;var _2=this.calendar,_3;if(isc.isA.Number(_1)){_3=this.getRecord(_1)}else{_3=_1;_1=this.isGrouped?this.getGroupedRecordIndex():this.getRecordIndex(_3)}
var _4=_3.name;this.removeOverlapRanges(this.getLaneOverlapRanges(_4));var _5=this.startDate,_6=this.endDate;var _7=this.findEventsInRange(_5,_6,_4);this.renderEvents(_7,true)},isc.A.retagOverlapRange=function isc_CalendarView_retagOverlapRange(_1,_2,_3){var _4=this.calendar,_5=this.getTouchedOverlapRanges(_1,_2,_3),_6=_5?_5[0]:null,_7=_1.duplicate(),_8=_2.duplicate();if(_6){_5.removeAt(0);this.mergeOverlapRanges(_5,_6);_7=_6[_4.startDateField];_8=_6[_4.endDateField];this.removeOverlapRanges(_5);this.removeOverlapRanges([_6]);var _9=this.findEventsInRange(_7,_8,_3,_6.events);this.renderEvents(_9,(_3!=null))}else{var _9=this.findEventsInRange(_7,_8,_3,this.getEventData());this.renderEvents(_9,(_3!=null))}},isc.A.sortForRender=function isc_CalendarView_sortForRender(_1){var _2=this.calendar,_3=[];if(this.usesLanes()){_3.add({property:_2.laneNameField,direction:"ascending"})}
if(_2.overlapSortSpecifiers){_3.addList(_2.overlapSortSpecifiers)}else{if(!_2.showColumnLayouts){_3.add({property:"slotNum",direction:"ascending"})}
_3.add({property:_2.startDateField,direction:"ascending"})}
_1.setSort(_3)},isc.A.renderEvents=function isc_CalendarView_renderEvents(_1,_2){if(!_1||_1.length==0)return;this.tagDataForOverlap(_1,_2);this.sortForRender(_1);var _3=this.calendar,_4=this.isTimelineView(),_5=_2?(_4?this.body.getVisibleRows():this.body.getVisibleColumns()):[],_6=this;for(var i=0;i<_1.length;i++){var _8=_1.get(i),_9=_8.overlapProps,_10=_2?_6.getLaneIndex(_8[_3.laneNameField]):null;if(!_2||(_10>=_5[0]&&_10<=_5[1])){var _11=this.getCurrentEventCanvas(_8);if(_11){if(_11.setEvent)_11.setEvent(_8);else _11.event=_8;_6.sizeEventCanvas(_11,false,"renderEvents")}else{_11=this.addEvent(_8)}}}},isc.A.sizeEventCanvas=function isc_CalendarView_sizeEventCanvas(_1,_2,_3){if(!_1||!_1.event||Array.isLoading(_1.event))return;if(this.shouldShowColumnLayouts()){this.logInfo("sizeEventCanvas() called from "+_3+" while showColumnLayouts is true...");return}
var _4=this.calendar;if(_4==null)return;var _5=_1.event,_6=this.isTimelineView(),_7=this.isWeekView(),_8=this.usesLanes(),_9=_4.getEventStartDate(_5),_10=_4.getEventEndDate(_5);var _11=_1.hasFocus;var _12,_13,_14,_15,_16=_8?this.getLaneIndex(_5[_4.laneNameField]):null,_17=_8?this.getLane(_5[_4.laneNameField]):null,_18=_4.getLanePadding(this);;if(_6){this.logInfo("Sizing Timeline-event '"+_5.name+"'","calendar");if(!_17)return;_15=this.getLaneHeight(_17);_14=Math.round(this.$732(_5));var _19=Math.round(_4.getSnapGapPixels(this));if(_4.isDurationEvent(_5)&&_4.getEventDuration(_5)==0){_19=_4.zeroLengthEventSize+(_18*2)}
_14=Math.max(_14,_19);_13=this.getDateLeftOffset(_9);_12=this.getRowTop(_16);if(_18>0){_12+=_18;_13+=_18;_14-=(_18*2);_15-=(_18*2);if(_19>(_18*2))_19-=(_18*2)}
if(_4.eventsOverlapGridLines){_13-=1;_14+=1;if(_12>0){_12-=1;_15+=1}}
if(this.eventDragGap>0){_14=Math.max(this.eventDragGap,_14-this.eventDragGap)}
_14=Math.max(_14,_19)}else{if(_1.$172y){delete _1.$172y.$184b;delete _1.$172y.$963}
var _20=isc.DateUtil.createLogicalDate(_9.getFullYear(),_9.getMonth(),_9.getDate());var _21;if(this.isDayView()){if(this.usesLanes())_21=_16;else _21=0}else{_21=this.getColFromDate(_20,_17)}
var _22=this.getCellDate(0,_21);_13=this.body.getColumnLeft(_21);_14=this.body.getColumnWidth(_21);var _23=this.body.getRowHeight(this.getRecord(1),1),_24=false,_25=this.getTimePerCell(),_26=_4.getRowsPerHour(this),_27=null;if(_22&&_9.getTime()<_22.getTime()){_20=_22.duplicate();_24=true}
var _28=isc.DateUtil.getLogicalDateOnly(_10);var _29=isc.DateUtil.compareLogicalDates(_20,_28)==0;if(!_29){_28=isc.DateUtil.getEndOf(_20,"d",false);_24=true;_27=24}
var _30=isc.DateUtil.getLogicalTimeOnly(_9);var _31=isc.DateUtil.getLogicalTimeOnly(_10);if(_27==null){if(_31.getHours()<_30.getHours())_27=24;else _27=_31.getHours()==0&&_31.getMinutes()==0&&_29?24:_31.getHours()}
_12=this.getRowTop(_30.getHours()*_26);var _32=this.getRowTop(_27*_26);_15=_32-_12;_15-=1;if(_4.showDayLanes){if(_18>0){_12+=_18;_13+=_18;_14-=(_18*2);_15-=(_18*2)}}
var _33=_30.getMinutes();if(_33>0){var _34=_4.getMinutePixels(_33,_23,this);_15-=_34;_12+=_34}
if(_31.getMinutes()>0&&!_24){_15+=_4.getMinutePixels(_31.getMinutes(),_23,this)}
if(_4.eventsOverlapGridLines){_13-=1;_14+=1;if(_12>0){_12-=1;_15+=1}}
var _35=this.body.getScrollHeight();if(_12+_15>_35){_15=_35-_12}}
this.logDebug("New size for event '"+_5.name+"': ["+[_12,_13,_14,_15].join(", ")+"]","calendar");var _36=true;if(_4.useSublanes&&_17&&_17.sublanes){this.sizeEventCanvasToSublane(_1,_17,_13,_12,_14,_15)}else{_36=this.adjustDimensionsForOverlap(_1,_13,_12,_14,_15)}
if(!_1.isDrawn()){_1.draw()}else _1.redraw();_1.show();if(_6&&_5!=null){if(_5[_4.leadingDateField]&&_5[_4.trailingDateField]){if(_1.leadingIcon)_1.updateLeadingTrailingDates();else _1.delayCall("updateLeadingTrailingDates")}}
if(_11&&!_1.hasFocus){_1.focus("restore calendar event focus after redraw")}
delete _1.needsResize},isc.A.adjustDimensionsForOverlap=function isc_CalendarView_adjustDimensionsForOverlap(_1,_2,_3,_4,_5){var _6=this.calendar,_7=_1.event.overlapProps;if(!_7){return}
var _8=this.isTimelineView(),_9=this.useLanePadding(),_10=_9?_6.getLanePadding(this):0,_11=_9?Math.floor(_10/2):0,_12=_9&&_7?(_7.totalSlots-1)*_10:0;if(_7.slotNum==null){_7.slotNum=1}
if(_7&&_7.totalSlots>0){var _13;if(_8){_13=Math.floor((_5-_12)/_7.totalSlots);if(_6.fixedEventHeight)_13=_6.fixedEventHeight;_5=_13;if(_6.fixedEventHeight==null){if(_7.slotCount){_5*=_7.slotCount;_5+=(_7.slotCount-1)*_10}
if(_7.totalSlots!=1){if(_7.slotNum==_7.totalSlots)_5-=_11}}
_3=_3+Math.floor((_13*(_7.slotNum-1)));if(_7.slotNum>1)_3+=(_10*(_7.slotNum-1));if(_6.eventOverlap&&_7.$64m!=false){if(_7.slotNum>1){_3-=Math.floor(_13*(_6.eventOverlapPercent/100));_5+=Math.floor(_13*(_6.eventOverlapPercent/100))}}}else{_13=Math.floor((_4-_12)/_7.totalSlots);_4=_13;if(_7.slotCount){_4*=_7.slotCount;_4+=(_7.slotCount-1)*_10}
if(_7.totalSlots!=1){if(_7.slotNum==_7.totalSlots)_4-=_11}
_2=_2+Math.floor((_13*(_7.slotNum-1)));if(!_6.eventOverlap&&_7.slotNum>1)_2+=(_10*(_7.slotNum-1));if(_6.eventOverlap&&_7.$64m!=false){if(_7.slotNum>1){_2-=Math.floor(_13*(_6.eventOverlapPercent/100));_4+=Math.floor(_13*(_6.eventOverlapPercent/100))}}
var _14=!_7?true:(_7.slotNum==_7.totalSlots||(_7.slotNum+_7.slotCount)-1==_7.totalSlots);if(_14){_4-=_6.eventDragGap||1}}}else{if(_8){if(_6.fixedEventHeight)_5=_6.fixedEventHeight}else{_4-=_6.eventDragGap||1}}
if(_6.eventsOverlapGridLines){if(_8){if(_7&&_7.totalSlots>1)_5+=1}else{_5+=1;if(_7&&_7.slotNum>0&&!_6.eventOverlap){_4+=1}}}
var _15=_1.getRect();if(_15[0]==_2&&_15[1]==_3&&_15[2]==_4&&_15[3]==_5){this.logDebug("Not resizing event '"+_1.event.name+"'.");return false}
_1.renderEvent(_3,_2,_4,_5);return true});isc.evalBoundary;isc.B.push(isc.A.sizeEventCanvasToSublane=function isc_CalendarView_sizeEventCanvasToSublane(_1,_2,_3,_4,_5,_6){var _7=this.calendar,_8=_1.event,_9=_2.sublanes,_10=_9.findIndex("name",_8[this.calendar.sublaneNameField]),_11=this.isTimelineView(),_12=_9.length,_13=_7.getLanePadding(this),_14=0;if(_10<0)return;for(var i=0;i<=_10;i++){if(i==_10){if(_11){_4+=_14;_6=_9[i].height-_13}else{_3+=_14;_5=_9[i].width-_13;if(_3+_5+1<this.body.getScrollWidth())_5+=1;if(_4+_6+1<this.body.getScrollHeight())_6+=1}
break}
if(_11)_14+=_9[i].height;else _14+=_9[i].width}
if(_10>0&&_13>0){if(_11)_6-=Math.floor(_13/_9.length);else _5-=Math.floor(_13/_9.length)}
_1.renderEvent(_4,_3,_5,_6)},isc.A.getOverlapSlot=function isc_CalendarView_getOverlapSlot(_1,_2){var _3={slotNum:_1,events:[],snapGaps:[]};for(var i=0;i<_2;i++)_3.snapGaps[i]=0;return _3},isc.A.getSnapData=function isc_CalendarView_getSnapData(_1,_2,_3,_4,_5,_6){var _7=this.calendar,_8=this.getTimePerSnapGap("mn"),_9=this.getSnapGapPixels(0),_10={};if(_3==null){_3=this.getDateFromPoint(_1,_2)}
if(_3!=null){var d=(isc.isA.Date(_3)?_3.duplicate():new Date(_3));if(_4){if(d.getTime()<this.startDate.getTime()){d=this.startDate.duplicate()}else if(d.getTime()>this.endDate.getTime()){d=this.endDate.duplicate()}}
if(!_6&&d.getTime()<this.endDate.getTime())d.setTime(d.getTime()+1);_10.startTopOffset=this.getDateTopOffset(d,_5);var _12=isc.DateUtil.dateAdd(d,"mn",_8);if(d.getDate()==_12.getDate()){_10.endTopOffset=this.getDateTopOffset(_12,_5)}else{_10.endTopOffset=this.body.getScrollHeight()}
if(_6){var t=isc.DateUtil.getLogicalTimeOnly(d);var _14=t.getHours()*60+t.getMinutes()+t.getSeconds()/60+t.getMilliseconds()/60000;_10.index=Math.floor(_14/_8)}else{_10.index=Math.floor(_10.startTopOffset/_9)}
_10[_7.startDateField]=this.getDateFromPoint(null,_10.startTopOffset);_10[_7.endDateField]=this.getDateFromPoint(null,_10.endTopOffset)}
return _10},isc.A.tagDataForOverlap=function isc_CalendarView_tagDataForOverlap(_1,_2){_1=_1||this.getEventData();if(_1.getLength()==0)return;var _3=this.calendar,_4=[],_5=0,_6=0,_7=0,_8=this.isTimelineView();if(_3.eventAutoArrange==false)return;this.forceDataSort(_1);var _9=_1.get(0),_10=_9[_3.laneNameField];var _11=[];_1.setProperty("overlapProps",null);_1.setProperty("slotNum",null);var _12=this.usesLanes();var _13=this.updateOverlapRanges(_1);var _14=[];if(_12){_14.add({property:_3.laneNameField,direction:"ascending"})}
if(_3.overlapSortSpecifiers){_14.addList(_3.overlapSortSpecifiers)}else{_14.add({property:"eventLength",direction:"descending"});_14.add({property:_3.startDateField,direction:"ascending"});_14.add({property:_3.endDateField,direction:"ascending"})}
var _15=false;if(_15){this.logWarn("tagDataForOverlap: about to loop over "+_13.length+" overlap ranges")}
var _16=this.getLastSnapIndex();for(var j=0;j<_13.length;j++){var _18=_13[j];if(_15){this.logWarn("range: "+isc.echoFull(_18)+"")}
var _19=(_18.fieldName?this.getFieldByName(_18.fieldName):null);var _20=this.getSnapData(null,null,_18[_3.startDateField],true,_18[_3.laneNameField]),_21=_20?_20.index:0,_22=this.getSnapData(null,null,_18[_3.endDateField],true,_18[_3.laneNameField],true),_23=_22?_22.index:this.$1725.length-1,_24=(_23-_21)+1,_25=[],_26=1;_25[0]=this.getOverlapSlot(0,_24);var _27=_18.events;for(var _28=0;_28<_27.length;_28++){var _29=_27[_28];_29.overlapProps={};var _30=_29.overlapProps;if(_15){this.logWarn("Processing event "+_29.name)}
var _31=_3.getEventStartDate(_29),_32=_3.getEventEndDate(_29);var _33=isc.DateUtil.getLogicalDateOnly(_31);var _34=isc.DateUtil.getLogicalTimeOnly(_31);_31=isc.DateUtil.combineLogicalDateAndTime(_33,_34);var _35=isc.DateUtil.getLogicalDateOnly(_32);var _36=isc.DateUtil.getLogicalTimeOnly(_32);_32=isc.DateUtil.combineLogicalDateAndTime(_35,_36);_32=isc.DateUtil.adjustDate(_32,"-1ms");if(_19&&_19.endDate&&_32>_19.endDate){_32=_19.endDate.duplicate()}
if(_15){this.logWarn("    startDate: "+_31+"\n      endDate: "+_32)}
_30.eventStartSnap=this.getSnapData(null,null,_31.getTime()+1,true,_29[_3.laneNameField]);_30.eventEndSnap=this.getSnapData(null,null,_32.getTime()-1,true,_29[_3.laneNameField],true);var _37=(_30.eventStartSnap?_30.eventStartSnap.index:_30.nextValidSnap.index)-_21;var _38=(_30.eventEndSnap?_30.eventEndSnap.index:_30.lastValidSnap.index)-_21;_38++;_38=Math.min(_38,_16);var _39=false;var _40=null;for(var _41=0;_41<_26;_41++){var _42=_25[_41].snapGaps.slice(_37,_38);var _43=_42.sum()>0;if(_15){this.logWarn("    checking slots: "+_37+" to "+_38);this.logWarn("    used is: "+_43);this.logWarn("    gaps are: "+isc.echoFull(_42))}
if(!_43){_39=true;_25[_41].snapGaps.fill(1,_37,_38);_25[_41].events.add(_29);_29.overlapProps.slotNum=_41;if(_15){this.logWarn("event "+_29.name+" now occupying slot "+_41)}
break}}
if(!_39){_25[_26]=this.getOverlapSlot(_26,_24);_25[_26].snapGaps.fill(1,_37,_38);_25[_26].events.add(_29);_29.overlapProps.slotNum=_26
if(_15){this.logWarn("event "+_29.name+" added to new slot index "+_26)}
_26++}}
for(var i=0;i<_25.length;i++){var _40=_25[i];for(var _45=0;_45<_40.events.length;_45++){var _29=_40.events[_45];var _30=_29.overlapProps;_30.totalSlots=_26;var _37=(_30.eventStartSnap?_30.eventStartSnap.index:_21)-_21;var _38=(_30.eventEndSnap?_30.eventEndSnap.index:_21)-_21;_38++;var _39=false;for(var _46=i+1;_46<_25.length;_46++){var _42=_25[_46].snapGaps.slice(_37,_38);var _43=_42.sum()>0;if(_43){_30.slotCount=_46-_30.slotNum;_39=true;break}}
if(!_39){_30.slotCount=_26-_30.slotNum}
_30.slotNum++;_29.slotNum=_30.slotNum}}
_18.slotList=_25;if(_15){this.logWarn("***** slotList *****\n"+isc.echoFull(_25))}}},isc.A.getLastSnapIndex=function isc_CalendarView_getLastSnapIndex(){var _1=this.getSnapData(null,null,isc.DateUtil.adjustDate(this.endDate,"-1ms"),true);if(_1)return _1.index},isc.A.getVisibleDateRange=function isc_CalendarView_getVisibleDateRange(_1){var _2=this.calendar;if(_1){return[_2.getVisibleStartDate(this),_2.getVisibleEndDate(this)]}
if(!this.renderEventsOnDemand){return[this.startDate.duplicate(),this.endDate.duplicate()]}
if(this.isTimelineView()){}
var _3=this.body.getScrollLeft(),_4=_3+this.body.getVisibleWidth(),_5=this.body.getEventColumn(_3+1),_6=this.body.getEventColumn(_4),_7=this.body.getScrollTop(),_8=_7+this.body.getVisibleHeight(),_9=this.body.getEventRow(_7+1),_10=this.body.getEventRow(_8);if(_10<0||isNaN(_10))_10=this.data.getLength()-1;if(_6<0||isNaN(_6)){if(this.isTimelineView()){_6=this.$116z}else{_6=this.body.fields.length-1}}
_6=Math.min(_6,this.body.fields.length-1);_10=Math.min(_10,this.data.length-1);var _11=this.getCellDate(_9,_5)||this.startDate,_12=(this.getCellEndDate?this.getCellEndDate(_10,_6):this.getCellDate(_10,_6))||this.endDate;this.$27q.viewportStartMillis=_11.getTime();this.$27q.viewportEndMillis=_12.getTime();return[_11,_12]},isc.A.getVisibleRowRange=function isc_CalendarView_getVisibleRowRange(){if(!this.renderEventsOnDemand){return[0,this.data.getLength()]}
return this.getVisibleRows()},isc.A.getVisibleColumnRange=function isc_CalendarView_getVisibleColumnRange(){if(!this.renderEventsOnDemand){return[0,this.fields.getLength()]}
return this.body.getVisibleColumns()},isc.A.delayedRefreshVisibleEvents=function isc_CalendarView_delayedRefreshVisibleEvents(_1,_2){if(this.refreshVisibleEventsTimer)isc.Timer.clear(this.refreshVisibleEventsTimer);var _3=this;this.refreshVisibleEventsTimer=isc.Timer.setTimeout(function(){isc.Timer.clear(_3.refreshVisibleEventsTimer);delete _3.refreshVisibleEventsTimer;_3.refreshVisibleEvents(_1,_2)},100)},isc.A.refreshLongEvents=function isc_CalendarView_refreshLongEvents(){if(this.longEventsLayout){this.longEventsLayout.reset();this.longEventsLayout.refreshEvents()}},isc.A.refreshVisibleEvents=function isc_CalendarView_refreshVisibleEvents(_1,_2){if(!this.isDrawn()||!this.body||!this.body.isDrawn())return;if(this.$236y||this.$222w){return}
var _3=this.getVisibleEvents(_1);this.sortForRender(_3);var _4=_3.getLength();var _5=this.useEventCanvasPool?isc.addProperties({},this.$232j):{},_6={};this.logDebug('refreshing visible events','calendar');var _7=_3.makeIndex("$232p");var _8=(_2=="scrolled");for(var _9 in _7){var _10=_7[_9],_11=this.$232j[_9]!=null;if(_11){delete _5[_9];if(!_8&&(this.isGrouped||this.useEventCanvasPool)){var _12=this.getCurrentEventCanvas(_10);this.sizeEventCanvas(_12,null,"refreshVisibleEvents")}
continue}
_6[_10.$232p]=_10}
if(this.isGrouped||(this.useEventCanvasPool&&this.eventCanvasPoolingMode=="viewport"))
{for(var _9 in _5){var _12=this.$232l[_5[_9]];if(_12)this.clearEventCanvas(_12)}}
_5=null;if(isc.getKeys(_6).length>0){for(var _9 in _6){var _10=_6[_9];this.addEvent(_10,false,true)}}
_6=null;if(this.shouldShowColumnLayouts())this.updateColumnLayouts();if(!this.$158l){this.drawZones();this.drawIndicators()}
if(this.calendar.canSelectEvents)this.setEventCanvasTabPositions();this.$222e()},isc.A.$222e=function isc_CalendarView__eventsRendered(){var _1=this.calendar;if(this.$222f){this.scrollToEvent(this.$222f);this.$222f=null}
if(_1.eventsRendered&&isc.isA.Function(_1.eventsRendered)){_1.eventsRendered()}},isc.A.setEventCanvasTabPositions=function isc_CalendarView_setEventCanvasTabPositions(){if(!this.calendar.canSelectEvents)return;var _1=this.getEventData();this.forceDataSort(_1);for(var j=0;j<_1.length;j++){var _3=this.getCurrentEventCanvas(_1[j]);if(_3&&_3.isEventCanvas&&_3.event){var _4=0;if(this.usesLanes()){_4=this.getLaneIndex(_3.event[this.calendar.laneNameField])*1000}
_4+=j;_3.setRelativeTabPosition(_4)}}},isc.A.getVisibleEvents=function isc_CalendarView_getVisibleEvents(_1){var _2=this.calendar;if(!this.renderEventsOnDemand)return this.getEventData();var _3=this.isTimelineView(),_4=this.getVisibleDateRange(_1),_5=this.usesLanes(),_6=_5?(_3?this.getVisibleRowRange():this.getVisibleColumnRange()):null;var _7=this.getEventData(),_8=_4[0].getTime(),_9=_4[1].getTime(),_10=_7.getLength(),_11=[],_12=this.isWeekView(),_13=this.isGrouped?this.data.getOpenList():null;for(var i=0;i<_10;i++){var _15=_7.get(i);if(!_15){isc.logWarn('getVisibleEvents: potentially invalid index: '+i);break}
if(isc.isA.String(_15))return[];if(_2.shouldShowEvent(_15,this)==false)continue;if(_5&&_2.shouldShowLane(this.getLane(_15[_2.laneNameField]),this)==false)continue;var _16=_2.getEventLeadingDate(_15)||_2.getEventStartDate(_15);if(!_16){if(_15.loadingMarker){this.logWarn(this.viewName+".getVisibleEvents() encountered a place-holder for a loading record, rather than a valid record. Can't continue:  "+isc.echoFull(this.getStackTrace()));break}
this.logWarn(this.viewName+".getVisibleEvents() - event has no start-date: "+isc.echoFull(_15));continue}
var _17=_2.getEventTrailingDate(_15)||_2.getEventEndDate(_15),_18=_17.getTime();if(_18<=_8)continue;if(_16.getTime()>=_9)continue;if(_12){var _19=isc.DateUtil.getLogicalDateOnly(_16),_20=isc.DateUtil.getLogicalDateOnly(_17);if(_19.getDate()!=_20.getDate()){_17=isc.DateUtil.getEndOf(_16,"d",false)}}
var _21={};if(_5){if(this.isGrouped){var _22=_13.findIndex("name",_15[_2.laneNameField]);if(_22<0)continue}else{if(_1!=true){var _23=this.getEventLaneIndex(_15);if(_23==null||_23<_6[0]||_23>_6[1])
continue}}
_21[_2.laneNameField]=_15[_2.laneNameField]}
if(_3){if(_15[_2.leadingDateField]&&_15[_2.trailingDateField]){_21[_2.leadingDateField]=_4[0];_21[_2.trailingDateField]=_4[1]}else{_21[_2.startDateField]=_4[0];_21[_2.endDateField]=_4[1]}}else{_21[_2.startDateField]=_4[0];_21[_2.endDateField]=_4[1]}
if(this.eventsOverlap(_21,_15,_5)){_11.add(_15)}}
return _11},isc.A.clearEventCanvas=function isc_CalendarView_clearEventCanvas(_1,_2){if(_1){if(!isc.isAn.Array(_1))_1=[_1];var _3=_1.length;while(--_3>=0){var _4=_1[_3];if(_4.hide)_4.hide();if(_4.clear)_4.clear();delete this.$232n[_4.ID];if(_4.event){delete this.$232j[_4.event.$232p]}
if(this.useEventCanvasPool&&!_2){this.poolEventCanvas(_4)}else{_4.event=null;_4.destroy();_4=null}}}},isc.A.clearEvents=function isc_CalendarView_clearEvents(_1,_2){if(!_1)_1=0;if(_2==null)_2=!this.useEventCanvasPool;for(var _3 in this.$232n){this.clearEventCanvas(this.$232l[_3],_2)}
this.clearLongEvents()},isc.A.clearLongEvents=function isc_CalendarView_clearLongEvents(){if(this.longEventsLayout)this.longEventsLayout.reset()},isc.A.areSame=function isc_CalendarView_areSame(_1,_2){if(!_1||!_2)return false;var _3=this.calendar;if(_3.dataSource){var _4=_3.getEventPKs(),_5=true;for(var i=0,_7=_4.length;i<_7;i++){if(_1[_4[i]]!=_2[_4[i]]){_5=false;break}}
return _5}else{return(_1===_2)}},isc.A.getEventCanvasConstructor=function isc_CalendarView_getEventCanvasConstructor(_1){return this.eventCanvasConstructor},isc.A.getCurrentEventCanvas=function isc_CalendarView_getCurrentEventCanvas(_1){var _2=this.$232j[_1.$232p];return _2!=null?this.$232l[_2]:null},isc.A.poolEventCanvas=function isc_CalendarView_poolEventCanvas(_1){if(this.body){var _2;delete this.$232n[_1.ID];if(_1.event){_2=_1.event.$232p;delete this.$232j[_2];this.logInfo("pooling canvas "+_1.ID+" for event + "+_2,"calendar");_1.event=null}
_1.availableForUse=true;this.$232m[_1.ID]=_1;return true}else return false},isc.A.getPooledEventCanvas=function isc_CalendarView_getPooledEventCanvas(_1){if(!this.body)return;var _2=null;var _3=null;var _4=this.$232k[_1.$232p];if(_4&&this.$232m[_4]){_2=_4;_3=this.$232l[_2];this.logInfo("re-using canvas "+_2+" for event + "+_1.$232p,"calendar")}else{var _5=isc.getKeys(this.$232m);if(_5.length>0){_3=this.$232m[_5[0]];_2=_3.ID;this.logInfo("un-pooling canvas "+_2+" for event + "+_1.$232p,"calendar")}}
if(!_3)return;this.$232j[_1.$232p]=_2;this.$232k[_1.$232p]=_2;this.$232n[_2]=_1.$232p;this.$232o[_2]=_1.$232p;delete this.$232m[_2];_3.availableForUse=false;return _3},isc.A.addEvent=function isc_CalendarView_addEvent(_1,_2,_3){if(!_1.$232p)this.calendar.getEventKey(_1,this);if(this.clearSelection)this.clearSelection();this.addEventData(_1);var _4=this.calendar,_5=false;var _6=this.getCurrentEventCanvas(_1)
if(!_6)_6=this.getPooledEventCanvas(_1);if(!_6)_6=_4.$129r(_1,this);if(_6.isDrawn())_6.clear();if(!this.shouldShowColumnLayouts()){_6.dragTarget=this.eventDragCanvas}
_6.setEvent(_1);if(!this.shouldShowColumnLayouts()&&_6.parentElement!=this.body){this.body.addChild(_6,null,false)}
_6.needsResize=true;this.$232n[_6.ID]=_1.$232p;this.$232o[_6.ID]=_1.$232p;this.$232j[_1.$232p]=_6.ID;this.$232k[_1.$232p]=_6.ID;_6.$53i=this.isWeekView();if(this.isDayView()&&this.usesLanes()){var _7=_1[_4.laneNameField];if(!this.getLane(_7))_5=true}
if(!this.shouldShowColumnLayouts()){if(!_5&&this.body&&this.body.isDrawn()){if(_2){if(this.verticalEvents){this.retagDayEvents(_4.getEventStartDate(_1))}else{this.retagOverlapRange(_4.getEventStartDate(_1),_4.getEventEndDate(_1),_1[_4.laneNameField])}}else{this.sizeEventCanvas(_6,null,"addEvent");_6.bringToFront()}}}else{this.addEventCanvasToColumnLayout(_6,_3)}},isc.A.getColumnLayout=function isc_CalendarView_getColumnLayout(_1){var _2=this.getColFromDate(_1);return this.columnLayouts[_2]},isc.A.addEventCanvasToColumnLayout=function isc_CalendarView_addEventCanvasToColumnLayout(_1,_2){var _3=this.getColFromDate(this.calendar.getEventStartDate(_1.event));var _4=this.columnLayouts[_3];if(_4){_4.addMember(_1);_1.clear();_1.setHeight(1);_1.setOverflow("visible");if(!_1.isDrawn())_1.draw();else _1.redraw();_1.show();if(!_2)_4.resort();return true}
return false},isc.A.removeEvent=function isc_CalendarView_removeEvent(_1){var _2=this.getCurrentEventCanvas(_1);if(_2){this.clearEventCanvas(_2,!this.useEventCanvasPool);this.removeEventData(_1);return true}
if(this.shouldAllowLongEvents()){var _3=this.getLongEventData();var _4=_3.find("$232p",_1["$232p"]);if(_4){_3.remove(_4);this.refreshLongEvents();return true}}
return false},isc.A.clearZones=function isc_CalendarView_clearZones(){var _1=(this.$131c||[]);_1.callMethod("clear");_1.callMethod("deparent");_1.callMethod("destroy");_1=null;this.$131c=[]},isc.A.drawZones=function isc_CalendarView_drawZones(){if(!this.isTimelineView())return;if(this.$131c)this.clearZones();if(!this.calendar.showZones)return;var _1=this.calendar,_2=_1.zones||[],_3=this.$131c=[];if(this.isGrouped){this.logInfo("Zones are not currently supported in grouped Calendar views.");return}
if(!_2||_2.length<=0)return;var _4=[],_5=this.getVisibleDateRange(),_6=_5[0].getTime(),_7=_5[1].getTime();for(var i=0;i<_2.length;i++){var _9=_2[i];if(_9[_1.startDateField].getTime()<_7&&_9[_1.endDateField].getTime()>_6)
{_4.add(_9)}
_9.styleName=_1.getZoneCanvasStyle(_9,this)}
for(var i=0;i<_4.length;i++){var _9=_4[i],_10=_1.getZoneCanvas(_9,this),_11=this.getDateLeftOffset(_9[_1.startDateField]),_12=this.getDateLeftOffset(_9[_1.endDateField]),_13=_9.lane?this.getLaneHeight(_9.lane):this.data.getProperty("height").sum(),_14=_9.lane?this.getRowTop(this.getLaneIndex(_9.lane)):0;this.body.addChild(_10,null,false)
_10.renderEvent(_14,_11,_12-_11,_13,true);_3.add(_10)}},isc.A.clearIndicators=function isc_CalendarView_clearIndicators(){var _1=(this.$131d||[]);_1.callMethod("clear");_1.callMethod("deparent");_1.callMethod("destroy");_1=null;this.$131d=[]},isc.A.drawIndicators=function isc_CalendarView_drawIndicators(){if(this.$131d)this.clearIndicators();if(!this.calendar.showIndicators)return;var _1=this.calendar,_2=_1.indicators||[],_3=this.$131d=[];if(this.isGrouped){this.logInfo("Indicators are not currently supported in grouped Calendar views.");return}
if(!_2||_2.length<=0)return;var _4=[],_5=this.getVisibleDateRange(),_6=_5[0].getTime(),_7=_5[1].getTime();for(var i=0;i<_2.length;i++){var _9=_2[i];delete _9[_1.endDateField];_9.duration=0;_9.durationUnit="minute";var _10=_1.getEventStartDate(_9).getTime();if(_10>=_6&&_10<_7){_4.add(_9)}};for(var i=0;i<_4.length;i++){var _9=_4[i],_11=_1.getIndicatorCanvas(_9,this),_12=this.getDateLeftOffset(_9[_1.startDateField]),_13=this.data.getProperty("height").sum();this.body.addChild(_11,null,false)
_11.renderEvent(0,_12,_1.zeroLengthEventSize,_13,!_1.showIndicatorsInFront);_3.add(_11)}},isc.A.$1739=function isc_CalendarView__refreshEvents(){if(!this.isDrawn()){this.$128r=true;return}
if(this.calendar.shouldIncludeRangeCriteria(this)){this.$116v();return}
this.refreshEvents("$1739")},isc.A.delayedRefreshEvents=function isc_CalendarView_delayedRefreshEvents(_1){if(this.refreshEventsTimer)isc.Timer.clear(this.refreshEventsTimer);var _2=this;this.refreshEventsTimer=isc.Timer.setTimeout(function(){isc.Timer.clear(_2.refreshEventsTimer);delete _2.refreshEventsTimer;_2.refreshEvents(_1)},100)},isc.A.refreshEvents=function isc_CalendarView_refreshEvents(_1){if(this.$132n)return;var _2=this.calendar;if(!this.body||!this.body.isDrawn())return;if(!_2.hasData()){if(!_2.$1737){this.$116v()}
return}
this.$129s=true;this.$132n=true;this.clearZones();this.clearIndicators();this.clearEvents(0,!this.useEventCanvasPool);this.setEventData([]);this.$232j={};if(!this.isTimelineView()){this.initCacheValues()}
var _3=_2.getVisibleStartDate(this)||this.startDate,_4=_3.getTime(),_5=_2.getVisibleEndDate(this)||this.endDate,_6=_5.getTime();this.overlapRanges=[];var _7=_2.data.getLength();var _8=_2.data.getRange(0,_7);var _9;if(this.usesLanes())_9=_2.lanes?_2.lanes.makeIndex("name"):null;var _10=[];var _11=[];this.$232i={}
this.$2778={};while(--_7>=0){var _12=_8.get(_7);if(!_12)continue;if(!isc.isA.String(_12)){if(_2.shouldShowEvent(_12,this)==false)continue;if(_9&&_12[_2.laneNameField]&&!_9[_12[_2.laneNameField]]){continue}
var _13=_2.getEventStartDate(_12);if(!_13){if(_12.loadingMarker){this.logWarn(this.viewName+".refreshEvents() encountered a place-holder for a loading record, rather than a valid record. Can't continue:  "+isc.echoFull(this.getStackTrace()));break}
this.logWarn(this.viewName+".refreshEvents() - event has no start-date: "+isc.echoFull(_12));continue}
var _14=_2.getEventDates(_12),_15=_14[_2.leadingDateField],_16=_14[_2.startDateField],_17=_14[_2.endDateField],_18=_14[_2.trailingDateField];if(_16.getHours()==0&&_17.getHours()==0){_17.setTime(_17.getTime()-1)}
var _19=isc.DateUtil.compareLogicalDates(_16,_17)==0;if((_16&&_16.getTime()>=_4&&_16.getTime()<_6)||(_17&&_17.getTime()>_4&&_17.getTime()<=_6)||((!_19||!this.verticalEvents)&&_16.getTime()<=_4&&_17.getTime()>=_6))
{var _20=this.getSnapData(null,null,_16),_21=this.getSnapData(null,null,_17);if(_20&&_20.startHidden&&_21&&_21.endHidden){if(_20.lastValidSnap==_21.lastValidSnap&&_20.nextValidSnap==_21.nextValidSnap)
{continue}}
_12.eventLength=(_17.getTime()-_16.getTime());if(_12[_2.durationField]!=null){_12.isDuration=true;_12.isZeroDuration=_12[_2.durationField]==0}
if(!_12.$232p){_12.$232p=_2.getEventKey(_12)}
this.$232i[_12.$232p]=_12;var _19=isc.DateUtil.compareLogicalDates(_16,_17)==0;if(!this.isTimelineView()&&!_19||_12[_2.allDayField]){this.$2778[_12.$232p]=_12;_11.add(_12)}else{_10.add(_12)}}else{}}};if(this.usesLanes()&&_2.lanes){var _22=[];var _23=_10.getProperty(_2.laneNameField).getUniqueItems();for(var i=0;i<_2.lanes.length;i++){if(_2.hideUnusedLanes){if(_23.contains(_2.lanes[i].name)){_22.add(_2.lanes[i])}}else _22.add(_2.lanes[i])}
var _25=_22.length!=this.lanes.length;for(var i=0;i<this.lanes.length;i++){if(!_22[i]||_22[i].name!=this.lanes[i].name){_25=true;break}}
if(_25)this.updateLanes(_22,true)}
this.setEventData(_10);this.setLongEventData(_11);this.tagDataForOverlap();if(this.isTimelineView()&&_2.fixedEventHeight){this.redraw()}
this.refreshVisibleEvents(null,"refreshEvents");this.refreshLongEvents();if(this.$123r){this.body.scrollTo(null,this.$123r);delete this.$123r}
delete this.$123s;delete this.$132n},isc.A.$116v=function isc_CalendarView__refreshData(_1){delete this.$2905;if(this.$2779)return;this.$2779=true;var _2=this.calendar;var _3=_2.getDataSource();if(_3){if(isc.ResultSet&&isc.isA.ResultSet(_2.data)){if(_2.hasData()&&_2.shouldIncludeRangeCriteria(this)&&!this.isMonthView()){var _4=_2.getRangeCriteria(this);if(_4&&!isc.isAn.emptyObject(_4)){var _5=_2.$2755;if(_5){var _6=_5.criteria[0].value,_7=_5.criteria[1].value,_8=_4.criteria[0].value,_9=_4.criteria[1].value;if(isc.DateUtil.dateInRange(_9,_7,_6)&&isc.DateUtil.dateInRange(_8,_7,_6))
{isc.logInfo("New range-crit fully-contained - not fetching:\n\n"+isc.echoFull(_4),"calendar");delete this.$2779;this.refreshEvents();return}}
isc.logInfo("New rangeCrit:\n\n"+isc.echoFull(_4),"calendar")}}}
if(!_2.hasData()||(isc.isAn.Array(_2.data))){if(_1&&(_2.$2830||_2.getCurrentViewName()!=this.viewName)){delete _2.$2830;var _10=_2.$2831;var _11=_2.$2832;delete _2.$2831;delete _2.$2832;_2.fetchData(_2.initialCriteria,_10,_11)}else if((!_1&&!_2.$1737)||(_2.autoFetchData&&_2.$2830)){delete _2.$2830;var _10=_2.$2831||_2.$289c;var _11=_2.$2832||_2.$289d;delete _2.$2831;delete _2.$2832;delete _2.$289c;delete _2.$289d;_2.fetchData(_2.initialCriteria,_10,_11)}else{this.refreshEvents()}}else{var _10=_2.$2831;var _11=_2.$2832;delete _2.$2831;delete _2.$2832;_2.filterData(_2.initialCriteria,_10,_11)}}else{_2.dataChanged()}
delete this.$2779});isc.evalBoundary;isc.B.push(isc.A.getFrozenLength=function isc_CalendarView_getFrozenLength(){if(this.frozenBody&&this.frozenBody.fields)return this.frozenBody.fields.length;return 0},isc.A.getCellAlign=function isc_CalendarView_getCellAlign(_1,_2,_3){if(this.isMonthView())return;var _4=this.calendar,_5=this.fields[_3],_6=_1?_1.cellAlign:null,_7=null;if(_5){if(_5.frozen){return _5.cellAlign||_6||this.labelColumnAlign}
var _8=this.getFrozenLength();if(_4.getDateCellAlign){var _9=this.getCellDate(_2,_3-_8);if(_9)_7=_4.getDateCellAlign(_9,_2,_3-_8,this)}
_5=this.body.fields[_3-_8];if(_7||_5.cellAlign||_6){return _7||_5.cellAlign||_6}}
return this.Super("getCellAlign",arguments)},isc.A.getCellVAlign=function isc_CalendarView_getCellVAlign(_1,_2,_3){if(this.isMonthView()){if(_1&&!_1.isHeaderRow)return"top";return}
var _4=this.calendar,_5=this.fields[_3],_6=_1?_1.cellVAlign:null,_7=null;if(_5){if(_5.frozen){return _5.cellVAlign||_6||this.labelColumnVAlign||this.$171d}
var _8=this.getFrozenLength();if(_4.getDateCellVAlign){var _9=this.getCellDate(_2,_3-_8);if(_9)_7=_4.getDateCellVAlign(_9,_2,_3-_8,this)}
_5=this.body.fields[_3-_8];if(_7||_6||_5.cellVAlign){return _7||_6||_5.cellVAlign}}
return _6||this.$171d},isc.A.getCellValue=function isc_CalendarView_getCellValue(_1,_2,_3){if(!this.calendar.getDateHTML)return this.Super("getCellValue",arguments);if(this.isMonthView())return this.Super("getCellValue",arguments);var _4=this.calendar,_5=this.getFrozenLength();if(_3-_5>=0){var _6=this.getCellDate(_2,_3-_5);if(_6){var _7=_4.getDateHTML(_6,_2,_3-_5,this);if(_7)return _7}}
return this.Super("getCellValue",arguments)},isc.A.destroyEvents=function isc_CalendarView_destroyEvents(){if(!this.body||!this.body.children)return;if(this.clearZones)this.clearZones();if(this.clearIndicators)this.clearIndicators();var _1=this.body.children.length;while(--_1>=0){var _2=this.body.children[_1];if(_2&&!_2.destroyed){_2.clear();_2.deparent();_2.destroy()}
_2=null}
this.resetEventCaches()},isc.A.destroy=function isc_CalendarView_destroy(){if(this.isObserving(this,"$45m")){this.ignore(this,"$45m")}
if(this.removeLocalHandlers)this.removeLocalHandlers();this.destroyEvents(true);if(this.clearZones)this.clearZones();if(this.clearIndicators)this.clearIndicators();this.calendar=null;this.overlapRanges=null;this.$1725=null;this.$27q=null;this.lanes=null;this.resetLaneCaches();this.resetEventCaches();this.resetCanvasCaches();if(this.cellSelection){if(this.cellSelection.destroy)this.cellSelection.destroy();this.cellSelection=null}
if(this.data){if(this.data.destroy)this.data.destroy();this.data=null}
this.Super("destroy",arguments)},isc.A.draw=function isc_CalendarView_draw(){var _1=this.isMonthView();if(this.calendar.showWorkday&&!_1)this.cacheWorkdayRowHeight();var _2=this.Super("draw",arguments);if(this.calendar.showWorkday&&!_1)this.cacheWorkdayRowHeight();if(this.$198x){this["scrollTo"+this.$198x]();delete this.$198x}},isc.A.scrollToStart=function isc_CalendarView_scrollToStart(){if(!this.isDrawn()){this.$198x="Start";return}
if(this.verticalEvents){this.body.scrollToTop()}else{this.body.scrollToLeft()}},isc.A.scrollToEnd=function isc_CalendarView_scrollToEnd(){if(!this.isDrawn()){this.$198x="End";return}
if(this.verticalEvents){this.body.scrollToBottom()}else{this.body.scrollToRight()}},isc.A.getNewEventDefaults=function isc_CalendarView_getNewEventDefaults(_1){var _2=_1||{};var _3=this.calendar;var _4=_2[_3.startDateField];if(!_4){_4=this.getDateFromPoint()||isc.DateUtil.createDatetime();if(_4.getHours()>22)_4.setHours(22);_2[_3.startDateField]=_4}
if(!_2[_3.endDateField]){var _5=_4.duplicate();_5.setHours(_4.getHours()+1);_2[_3.endDateField]=_5}
return _2},isc.A.getEditDialogPosition=function isc_CalendarView_getEditDialogPosition(_1){var _2=this.calendar,_3=_2.getEventStartDate(_1),_4=this.getColFromDate(_3,_1[_2.laneNameField]),_5,_6;if(_2.allowLongEvents&&_2.isLongEvent(_1)){_6=[this.body.getColumnLeft(_4),0]}else{if(_2.showColumnLayouts)_5=this.body.getEventRow();else _5=this.body.getEventRow(this.getDateTopOffset(_3));_6=this.body.getCellPageRect(_5,_4)}
return{left:Math.max(_6[0],this.body.getPageLeft()),top:Math.max(_6[1],this.body.getPageTop())}},isc.A.cellDisabled=function isc_CalendarView_cellDisabled(_1,_2){var _3=this.getFieldBody(_2);if(!_3||_3==this.frozenBody)return false;var _4=this.getLocalFieldNum(_2),_5=this.getCellDate(_1,_4);return this.calendar.shouldDisableDate(_5,this,this.getField(_2).lane)},isc.A.getFirstDateColumn=function isc_CalendarView_getFirstDateColumn(){return this.frozenBody?this.frozenBody.fields.length:0});isc.B._maxIndex=isc.C+159;isc.CalendarView.changeDefaults("bodyDefaults",{drawChildWithParent:function(_1){if(_1.isEventCanvas)return false;return this.Super("drawChildWithParent",arguments)}});isc.CalendarView.changeDefaults("frozenBodyDefaults",{canFocus:false});isc.ClassFactory.defineClass("DaySchedule","CalendarView");isc.DaySchedule.changeDefaults("bodyProperties",{snapToCells:false,suppressVSnapOffset:true,suppressHSnapOffset:true,childrenSnapToGrid:false,scrollTo:function(_1,_2){var _3=this.creator;if(_3.calendar.showWorkday&&_3.calendar.limitToWorkday){if(_2<_3.$245f)_2=_3.$245f;else if(_2>_3.$245g)_2=_3.$245g}
return this.Super("scrollTo",arguments)}});isc.A=isc.DaySchedule.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoDraw=false;isc.A.canSort=false;isc.A.canResizeFields=false;isc.A.canReorderFields=false;isc.A.showHeader=false;isc.A.showHeaderContextMenu=false;isc.A.showAllRecords=true;isc.A.fixedRecordHeights=true;isc.A.labelColumnWidth=60;isc.A.labelColumnAlign="right";isc.A.labelColumnPosition="left";isc.A.labelColumnBaseStyle="labelColumn";isc.A.showRollOver=true;isc.A.useCellRollOvers=true;isc.A.canAutoFitFields=false;isc.A.canSelectCells=true;isc.A.navigateOnTab=false;isc.A.dateLabelFormat="dddd, MMM dd, YYYY";isc.A.dateLabelCompactFormat="ddd, MMM dd, YYYY";isc.B.push(isc.A.getDateLabelText=function isc_DaySchedule_getDateLabelText(_1,_2){if(this.isWeekView()){return isc.DateUtil.getFormattedDateRangeString(_1,_2)}
return isc.DateUtil.format(_1,isc.Browser.isMobile?this.dateLabelCompactFormat:this.dateLabelFormat)},isc.A.initWidget=function isc_DaySchedule_initWidget(){var _1=this.calendar;if(this.isDayView()&&this.usesLanes()&&_1.alternateLaneStyles){this.alternateFieldStyles=true;this.alternateFieldFrequency=_1.alternateFieldFrequency}
if(_1.labelColumnWidth&&_1.labelColumnWidth!=this.labelColumnWidth){this.labelColumnWidth=_1.labelColumnWidth}
this.renderEventsOnDemand=_1.renderEventsOnDemand;this.eventDragGap=_1.eventDragGap;var _2=this.calendar.firstDayOfWeek;if(this.rangeUnit){this.periodStartDate=this.startDate=isc.DateUtil.getStartOf(this.chosenDate,this.rangeUnit,false,_2);this.periodEndDate=this.endDate=isc.DateUtil.getEndOf(this.chosenDate,this.rangeUnit,false,_2)}
if(!this.logicalDate){this.logicalDate=isc.DateUtil.getLogicalDateOnly(this.chosenDate)}
if(this.usesLanes()){this.lanes=_1.lanes?_1.lanes.duplicate():[];this.laneMap=this.lanes.makeIndex("name")}
this.rebuildFields();this.Super("initWidget",arguments);if(isc.isAn.Array(_1.data)){this.$128r=true}
this.addAutoChild("eventDragCanvas",{styleName:this.eventDragCanvasStyleName})},isc.A.reorderFields=function isc_DaySchedule_reorderFields(_1,_2,_3){this.Super("reorderFields",arguments);this.refreshEvents("reorderFields")},isc.A.$220n=function isc_DaySchedule__getLabelFieldProperties(){return{autoFitWidth:this.calendar.autoFitLabelColumn,minWidth:this.labelColumnWidth,width:this.labelColumnWidth,name:"label",isLabelField:true,title:" ",cellAlign:"right",calendar:this.calendar,frozen:this.labelColumnPosition=="left",formatCellValue:function(_4,_5,_6,_7,_8){var _1=_8.calendar;var _2=_5.logicalTime;var _3=(_2.getHours()*60)+_2.getMinutes();if(_3%_1.rowTitleFrequency==0){return isc.Time.toShortTime(_2,_8.creator.timeFormatter,true)}else{return""}}}},isc.A.rebuildFields=function isc_DaySchedule_rebuildFields(){this.initCacheValues();var _1=this.calendar,_2=[],_3=this.labelColumnPosition=="left";this.showLabelColumn=_1.showLabelColumn;if(this.showLabelColumn&&_3){_2.add(this.$220n())}
var _4=[];if(this.usesLanes()){_4=this.lanes||[];if(_4.length==0){isc.logWarn("Calendar.showDayLanes has been turned off because no lanes have been provided.");this.calendar.showDayLanes=false}}
if(_4.length>0){var d=this.startDate.duplicate(),_6=isc.DaySchedule.$126v(this),_7=isc.DateUtil.createLogicalDate(d.getFullYear(),d.getMonth(),d.getDate()),_8={align:"center",canReorder:_1.canReorderLanes,date:_7,startDate:isc.DateUtil.getStartOf(isc.DateUtil.createDatetime(_7),"D",false),endDate:isc.DateUtil.getEndOf(isc.DateUtil.createDatetime(_7),"D",false)};for(var i=0;i<_4.length;i++){var _10=_4[i],_11=_10.name,p=isc.addProperties({},_8,{name:_11});p[_1.laneNameField]=_11;if(_10.sublanes){var _13=this.getLaneWidth(_10),_14=_10.sublanes.length,_15=Math.floor(_13/_14),_16=0;for(var j=0;j<_14;j++){var _18=_10.sublanes[j];_18[_1.laneNameField]=_18.name;_18.left=_16;if(_18.width==null)_18.width=_15;_16+=_18.width}
_10.width=_10.sublanes.getProperty("width").sum()}
p.isLaneField=true;_2.add(isc.addProperties(p,_10))}
_6.setProperty(_11,"");this.setShowHeader(true);if(_1.canReorderLanes)this.canReorderFields=_1.canReorderLanes;if(_1.minLaneWidth!=null)this.minFieldWidth=_1.minLaneWidth;this.data=_6}else{var _7=isc.DateUtil.getLogicalDateOnly(this.startDate);var _19=_1.getWeekendDays();var _20=isc.DateUtil.getShortDayNames();var _21=this.isWeekView()?7:1;if(this.shouldShowColumnLayouts()&&!this.columnLayouts){this.createColumnLayouts(_21)}
for(var i=0;i<_21;i++){var _22=_7.toShortDate(this.dateFormatter,false);if(_22.match(this.$81i)!=null)_22=_22.substring(5);else if(_22.match(this.$81j))_22=_22.substring(0,_22.length-5);var _23="day"+(i+1);var _24={name:_23,width:"*",autoFitWidth:false,align:"right",showIf:"return !list.isWeekView() || list.calendar.showWeekends || !field.isWeekend;",isWeekend:_19.contains(_7.getDay()),title:_20[_7.getDay()]+" "+_22,date:isc.DateUtil.getLogicalDateOnly(_7),startDate:isc.DateUtil.getStartOf(isc.DateUtil.createDatetime(_7),"D",false),endDate:isc.DateUtil.getEndOf(isc.DateUtil.createDatetime(_7),"D",false),$654:_7.getDay(),$658:_7.getDate(),$659:_7.getMonth(),$66a:_7.getFullYear()};if(this.shouldShowColumnLayouts()){_24.eventLayoutID=this.columnLayouts[i].ID}
_2.add(_24);_7.setDate(_7.getDate()+1)}
this.setShowHeader(this.isWeekView());this.data=isc.DaySchedule.$126v(this)}
if(this.showLabelColumn&&!_3){_2.add(this.$220n())}
if(this.isDrawn())this.setFields(_2);else this.fields=_2},isc.A.fieldStateChanged=function isc_DaySchedule_fieldStateChanged(){if(!this.shouldShowColumnLayouts())return;this.updateColumnLayouts()},isc.A.createColumnLayouts=function isc_DaySchedule_createColumnLayouts(_1){if(!this.shouldShowColumnLayouts())return;this.columnLayouts=[];for(var i=0;i<_1;i++){this.columnLayouts.add(this.calendar.createColumnLayout(this))}
this.columnLayoutMap=this.columnLayouts.makeIndex("ID")},isc.A.destroyColumnLayouts=function isc_DaySchedule_destroyColumnLayouts(){if(!this.shouldShowColumnLayouts())return;if(this.columnLayoutMap)delete this.columnLayoutMap;if(this.columnLayouts){for(var i=0;i<this.columnLayouts.length;i++){this.columnLayouts[i].markForDestroy();this.columnLayouts[i]=null}
this.columnLayouts=null}},isc.A.updateColumnLayouts=function isc_DaySchedule_updateColumnLayouts(){if(!this.shouldShowColumnLayouts())return;if(!this.body||!this.body.isDrawn()){this.$221k=true;return}
if(this.fields){var _1=this.getFieldWidths();for(var i=this.fields.length-1;i>=0;i--){var f=this.fields[i];if(f.eventLayoutID){var _4=this.columnLayoutMap[f.eventLayoutID];_4.fieldName=f.name;if(!this.body.contains(_4)){this.body.addChild(_4)}
var _5=this.getColumnLeft(f.masterIndex);if(_4.getLeft()!=_5)
_4.setLeft(_5);if(_4.getWidth()!=_1[i])
_4.setWidth(_1[i]);var _6=this.body.getScrollHeight();if(_4.getHeight()!=_6)
_4.setHeight(_6);if(_4.isDrawn())_4.redraw();else _4.draw();_4.resort();_4.show();_4.bringToFront()}}}},isc.A.setFields=function isc_DaySchedule_setFields(){var _1=this.Super("setFields",arguments);if(this.shouldShowColumnLayouts())this.updateColumnLayouts();return _1},isc.A.updateLongEventDates=function isc_DaySchedule_updateLongEventDates(){if(!this.isDrawn()||!this.longEventsLayout)return;this.longEventsLayout.reset();this.longEventsLayout.refreshEvents()},isc.A.updateFieldDates=function isc_DaySchedule_updateFieldDates(){var _1=isc.DateUtil.getShortDayNames();var _2=this.calendar.getWeekendDays();var _3=this.isWeekView()?7:1;var _4=this.logicalDate.duplicate()
for(var i=0;i<_3;i++){var _6=_4.toShortDate(this.dateFormatter,false);if(_6.match(this.$81i)!=null)_6=_6.substring(5);else if(_6.match(this.$81j))_6=_6.substring(0,_6.length-5);var _7="day"+(i+1);var _8={title:_1[_4.getDay()]+" "+_6,date:_4.duplicate(),startDate:isc.DateUtil.adjustDate(_4,"-0D"),endDate:isc.DateUtil.adjustDate(_4,"+0D"),$654:_4.getDay(),$658:_4.getDate(),$659:_4.getMonth(),$66a:_4.getFullYear()};this.setFieldProperties(_7,_8);_4.setDate(_4.getDate()+1)}
if(this.shouldShowColumnLayouts())this.updateColumnLayouts();if(this.header)this.header.markForRedraw()},isc.A.updateRowDates=function isc_DaySchedule_updateRowDates(){var _1=this.getTimePerCell(),_2=(60/_1)*24,_3=this.startDate,_4=isc.DateUtil.getLogicalDateOnly(_3);isc.DaySchedule.$129g(this);_4=isc.DateUtil.createDatetime(_4.getFullYear(),_4.getMonth(),_4.getDate(),0,0,0,0);var _5=this.logicalDate.duplicate(),_6=isc.DateUtil.createLogicalTime(0,0,0);for(var i=0;i<_2;i++){var _8=isc.DateUtil.combineLogicalDateAndTime(_5,_6);var _9=this.data[i];_9.time=_8.duplicate();_9.logicalDate=_5.duplicate();_9.logicalTime=_6.duplicate();_6.setMinutes(_6.getMinutes()+_1)}},isc.A.getDateFromPoint=function isc_DaySchedule_getDateFromPoint(_1,_2,_3,_4){var _5=this.calendar;if(_1==null&&_2==null){_2=this.body.getOffsetY();_1=this.body.getOffsetX()}
if(_2>this.body.getScrollHeight())
return null;var _6=this.body.getEventRow(_2);if(_6==-1)_6=0;else if(_6==-2)_6=this.getTotalRows()-1;var _7=this.cellHeight,_8=this.body.getRowTop(_6),_9=this.body.getEventColumn(_1),_10=(_9<0);if(_9==-1)_9=0;else if(_9==-2)_9=this.body.fields.length-1;var _11=this.getCellDate(_6,_9);if(!_11)return null;var _12=this.getTimePerCell(),_13=_5.getRowsPerHour(this),_14=_2-_8,_15=_5.getSnapGapPixels(this),_16=_14-(_14%_15),_17=Math.round(_12/(_7/_15)),_18=_16/_15,_19=_17*_18;_11.setMinutes(_11.getMinutes()+_19);return _11},isc.A.getCellDate=function isc_DaySchedule_getCellDate(_1,_2){if(!this.body||!this.body.fields||!this.$129f||!this.body.fields[_2]){return null}
if(_1<0)_1=this.data.getLength()-1;var _3=this.isDayView()?"day1":this.body.fields[_2].name;if(!_3.startsWith("day"))return;var _4=this.$129f[_1];if(!_4||!_4[_3])return null;var _5=isc.DateUtil.combineLogicalDateAndTime(_4[_3+"$220o"],_4.logicalTime);return _5},isc.A.getCellEndDate=function isc_DaySchedule_getCellEndDate(_1,_2){if(!this.body||!this.body.fields||!this.$129f||!this.body.fields[_2]){return null}
if(_1<0)_1=this.data.getLength()-1;var _3=this.isDayView()?"day1":this.body.fields[_2].name;if(!_3.startsWith("day"))return;var _4=this.$129f[_1];if(!_4||!_4[_3])return null;var _5=isc.DateUtil.combineLogicalDateAndTime(_4[_3+"$220o"],_4.logicalEndTime);return _5},isc.A.getEventLeft=function isc_DaySchedule_getEventLeft(_1){var _2=this.getColFromDate(this.calendar.getEventStartDate(_1),_1[this.calendar.laneNameField]);if(_2==null)return null;return this.body.getColumnLeft(_2)},isc.A.getEventRight=function isc_DaySchedule_getEventRight(_1){var _2=this.getColFromDate(this.calendar.getEventEndDate(_1),_1[this.calendar.laneNameField]);return this.body.getColumnLeft(_2)+this.body.getColumnWidth(_2)},isc.A.getDateLeftOffset=function isc_DaySchedule_getDateLeftOffset(_1,_2){var _3=this.getColFromDate(_1,_2);if(_3!=null)return this.body.getColumnLeft(_3);return 0},isc.A.getDateTopOffset=function isc_DaySchedule_getDateTopOffset(_1,_2){var _3=this.calendar;var _4=isc.DateUtil.getLogicalTimeOnly(_1);var _5=_4.getHours()
var _6=Math.round(_4.getMinutes()/this.getTimePerSnapGap("mn"));var _7=this.getRowTop(_4.getHours()*_3.getRowsPerHour());_7+=(_6*this.getSnapGapPixels());return _7},isc.A.setLanes=function isc_DaySchedule_setLanes(_1,_2){var _3=this.creator;_3.checkLaneNames(_1);this.lanes=_1;this.laneMap=this.lanes.makeIndex("name");this.rebuildFields();if(!_2)this.refreshEvents("setLanes")},isc.A.getLane=function isc_DaySchedule_getLane(_1){return this.getLaneMap()[_1]},isc.A.getLaneIndex=function isc_DaySchedule_getLaneIndex(_1){if(!this.usesLanes())return;var _2=this.body.fields,_3=-1;if(isc.isAn.Object(_1))_3=_2.indexOf(_1)
else if(isc.isA.String(_1)){_3=_2.findIndex("name",_1);if(_3<0)_3=_2.findIndex(this.calendar.laneNameField,_1)}
return _3},isc.A.getLaneWidth=function isc_DaySchedule_getLaneWidth(_1){var _2=null;if(isc.isA.String(_1))_1=this.getLane(_1);if(_1){if(_1.width)_2=_1.width;else{var _3=this.calendar.laneNameField,_4=this.body.fields.findIndex(_3,_1[_3]);_2=_4>=0?this.body.getColumnWidth(_4):null}}
return _2},isc.A.getLaneFromPoint=function isc_DaySchedule_getLaneFromPoint(_1,_2){if(!this.usesLanes())return null;if(_1==null)_1=this.body.getOffsetX();var _3=this.body.getEventColumn(_1),_4=this.body.fields[_3];return!this.isGroupNode(_4)?_4:null},isc.A.getSublaneFromPoint=function isc_DaySchedule_getSublaneFromPoint(_1,_2){if(!this.hasSublanes())return null;if(_1==null)_1=this.body.getOffsetX();var _3=this.body.getEventColumn(_1),_4=this.body.fields[_3],_5=_4?_4.sublanes:null;if(!_5)return null;var _6=this.body.getColumnLeft(_3),_7=_1-_6,_8=this.getLaneWidth(_4),_9=_5.length,_10=0;for(var i=0;i<_9;i++){if(_10+_5[i].width>_7){return _5[i]}
_10+=_5[i].width}
return null},isc.A.draw=function isc_DaySchedule_draw(_1,_2,_3,_4){var _5=this.calendar;this.invokeSuper(isc.DaySchedule,"draw",_1,_2,_3,_4);this.logDebug('draw','calendar');this.body.addChild(this.eventDragCanvas,null,false);this.eventDragCanvas.setView(this);if(this.$221k){delete this.$221k;this.updateColumnLayouts()}
if(this.$128r){delete this.$128r;this.delayCall("$116v",[true],100);this.$2905=true}
if(this.calendar.scrollToWorkday)this.delayCall("scrollToWorkdayStart");if(this.$191w){delete this.$191w;this.calendar.currentViewChanged(this.viewName)}},isc.A.scrollToWorkdayStart=function isc_DaySchedule_scrollToWorkdayStart(){this.calendar.scrollToTime(this.getWorkdayRange(false).start)},isc.A.getWorkdayRange=function isc_DaySchedule_getWorkdayRange(_1){var _2=this.fields,_3={start:isc.Time.parseInput("23:59"),end:isc.Time.parseInput("00:01")},_4=this.calendar,_5=_4.chosenDate,_6;if(this.isWeekView()&&_1!=false){for(var i=0;i<_2.length;i++){_5=_2[i].date;if(isc.isA.Date(_5)){_6=isc.Time.parseInput(_4.getWorkdayStart(_5));if(isc.DateUtil.compareDates(_3.start,_6)<0){_3.start=_6}
_6=isc.Time.parseInput(_4.getWorkdayEnd(_5));if(isc.DateUtil.compareDates(_3.end,_6)>0){_3.end=_6}}}}else if(_4.showDayLanes&&_1!=false){for(var i=0;i<_2.length;i++){var _8=_2[i],_9=_8[_4.laneNameField];if(isc.isA.Date(_5)){_6=isc.Time.parseInput(_4.getWorkdayStart(_5,_9));if(isc.DateUtil.compareDates(_3.start,_6)<0){_3.start=_6}
_6=isc.Time.parseInput(_4.getWorkdayEnd(_5,_9));if(isc.DateUtil.compareDates(_3.end,_6)>0){_3.end=_6}}}}else{_3.start=isc.Time.parseInput(_4.getWorkdayStart(_4.chosenDate));_3.end=isc.Time.parseInput(_4.getWorkdayEnd(_4.chosenDate))}
return _3},isc.A.getRowHeight=function isc_DaySchedule_getRowHeight(_1,_2){return this.cellHeight},isc.A.cacheWorkdayRowHeight=function isc_DaySchedule_cacheWorkdayRowHeight(){var _1=this.getViewportHeight()-(this.showHeader?this.headerHeight:0);if(this.calendar.showWorkday){var _2=this.calendar,_3=_2.getWorkdayRange(),_4=_3.end.getHours()-_3.start.getHours(),_5=_4*_2.getRowsPerHour(this),_6=Math.floor(_1/_5);if(this.calendar.sizeToWorkday){this.cellHeight=Math.max(this.calendar.minRowHeight,_6);if(this.body)this.body.cellHeight=Math.max(this.calendar.minRowHeight,_6)}
this.$245h=Math.max(this.calendar.minRowHeight,_6);this.$245i=_3.start.getHours()*_2.getRowsPerHour(this);this.$245j=_3.end.getHours()*_2.getRowsPerHour(this);this.$245f=this.cellHeight*this.$245i;this.$245g=this.$245f;this.$245k=this.cellHeight*_5;if(this.$245k>_1){this.$245g+=(this.$245k-_1)}
this.$2448=_1}
return this.cellHeight},isc.A.getDayFromCol=function isc_DaySchedule_getDayFromCol(_1){if(_1<0)return null;var _2=this.body.fields.get(_1).$654;return _2},isc.A.getDateFromCol=function isc_DaySchedule_getDateFromCol(_1){if(_1<0)return null;var _2=this.getCellDate(0,_1);return _2},isc.A.getColFromDate=function isc_DaySchedule_getColFromDate(_1,_2){var _3=isc.DateUtil.getLogicalDateOnly(_1);if(isc.DateUtil.compareLogicalDates(_3,this.startDate)>0)return 0;for(var i=0;i<this.body.fields.length;i++){var _5=this.body.fields.get(i);if(!_5.date)continue;if(isc.DateUtil.compareLogicalDates(_3,_5.date)==0){if(this.usesLanes()&&_2){if(_5.lane==_2)return i}else return i}}
if(isc.DateUtil.compareLogicalDates(_3,this.endDate)<0)return this.body.fields.length-1;return null},isc.A.getFieldNameFromDate=function isc_DaySchedule_getFieldNameFromDate(_1,_2){var _3=this.getFieldFromDate(_1,_2);if(_3)return _3.name;return""},isc.A.getFieldFromDate=function isc_DaySchedule_getFieldFromDate(_1,_2){var _3=isc.DateUtil.getLogicalDateOnly(_1);for(var i=0;i<this.body.fields.length;i++){var _5=this.body.fields.get(i);if(!_5.date)continue;if(isc.DateUtil.compareLogicalDates(_3,_5.date)==0){if(this.usesLanes()&&_2){if(_5.lane==_2)return _5}else return _5}}
return null},isc.A.isLabelCol=function isc_DaySchedule_isLabelCol(_1){var _2=this.frozenFields?this.frozenFields.length:0;if(_1<_2)return true;var _3=this.getCellDate(1,_1-_2);return _3==null},isc.A.cellDisabled=function isc_DaySchedule_cellDisabled(_1,_2){var _3=this.getFieldBody(_2);if(!_3||_3==this.frozenBody)return false;var _4=this.getLocalFieldNum(_2),_5=this.getCellDate(_1,_4);if(this.$142y){var _6=this.$142y;for(var i=0;i<_6.length;i++){if(_6[i].rowNum==_1&&_6[i].colNum==_4){return true}}}
return this.calendar.shouldDisableDate(_5,this,this.getField(_2).lane)},isc.A.refreshStyle=function isc_DaySchedule_refreshStyle(){if(!this.body)return;if(this.isWeekView()||this.calendar.showDayLanes){this.markForRedraw();return}
for(var i=0;i<this.data.length;i++){this.body.refreshCellStyle(i,1)}},isc.A.headerClick=function isc_DaySchedule_headerClick(_1,_2){var _3=this.calendar;if(this.isLabelCol(_1))return true;if(_3.showDayLanes&&!this.isWeekView())return true;var _4=this.getField(_1);_3.selectTab("day");_3.setChosenDate(_4.date);return true},isc.A.cellMouseDown=function isc_DaySchedule_cellMouseDown(_1,_2,_3){if(!this.calendar.canDragCreateEvents)return true;if(this.isLabelCol(_3)||this.cellDisabled(_2,_3))return true;if(this.floatingScrollbars){if(this.body.getOffsetX()>this.body.getScrollWidth()-this.scrollbarSize){return}}
var _4=this.calendar;var _5=this.getCellDate(this.body.getEventRow(),this.body.getEventColumn());if(_4.backgroundMouseDown&&_4.backgroundMouseDown(_5)==false)return;if(!_4.canCreateEvents)return true;if(!this.$53r||!this.$53q){this.clearSelection();this.$53q={};this.$53q.colNum=_3;this.$53q.startRowNum=_2;this.$53q.endRowNum=_2}
this.$53r=true;this.refreshCellStyle(_2,_3)},isc.A.cellOver=function isc_DaySchedule_cellOver(_1,_2,_3){if(this.calendar.canDragCreateEvents==false)return;if(this.$53r&&this.$53q){var _4;var _5=this.getCellDate(_2,this.$53q.colNum);if(_5&&this.calendar.shouldDisableDate(_5,this,this.getField(this.$53q.colNum).lane)){this.setCursor("not-allowed");return}else{this.setCursor("default")}
if(this.$53q.startRowNum<this.$53q.endRowNum){if(_2>this.$53q.endRowNum){_4=_2}else{_4=this.$53q.endRowNum}
this.$53q.endRowNum=_2}else{if(_2<this.$53q.endRowNum){_4=_2}else{_4=this.$53q.endRowNum}
this.$53q.endRowNum=_2}
var _6=6,_7=this.$53q.colNum,_8=this.getTotalRows();for(var i=_4-_6;i<_4+_6;i++){if(i>=0&&i<_8)this.refreshCellStyle(i,_7)}}else{if(this.inGhostDragCreate||this.inGhostDragMove){var _10=this.longEventsLayout.getMouseDates();if(_10&&_10[0]&&_10[1])
this.updateGhostCanvas(_10[0],_10[1],"cellOver")}}},isc.A.cellMouseUp=function isc_DaySchedule_cellMouseUp(_1,_2,_3){if(!this.calendar.canDragCreateEvents)return;if(!this.$53q)return true;this.setCursor("default");this.$53r=false;var _4,_5,_6;if(this.$53q.startRowNum>this.$53q.endRowNum){_4=this.$53q.endRowNum;_5=this.$53q.startRowNum}else{_5=this.$53q.endRowNum;_4=this.$53q.startRowNum}
_6=_5-_4+1;var _7=this.calendar,_8=_7.getCellDate(_4,this.$53q.colNum,this),_9=_7.getCellDate(_4+_6,this.$53q.colNum,this);if(!_9){_9=isc.DateUtil.getEndOf(_8,"D",false,this.firstDayOfWeek)}
if(_6==1&&_7.backgroundClick){if(_7.backgroundClick(_8,_9)==false){this.clearSelection();return}}
if(_7.backgroundMouseUp){if(_7.backgroundMouseUp(_8,_9)==false){this.clearSelection();return}}
var _10,_11;if(_7.showDayLanes&&_7.dayViewSelected()){_10=this.getLane(this.getField(this.$53q.colNum).lane);_11=_10?this.getSublaneFromPoint():null}
var _12=_7.createEventObject(null,_8,_9,_10&&_10.name,_11&&_11.name);_7.showEventDialog(_12,true);return isc.EH.STOP_BUBBLING},isc.A.cellClick=function isc_DaySchedule_cellClick(_1,_2,_3){if(!this.calendar.canCreateEvents)return;if(this.calendar.canDragCreateEvents)return;var _4=this.calendar,_5=_4.getCellDate(_2,_3,this),_6=_4.getCellDate(_2+1,_3,this);if(!_5)return;if(this.calendar.shouldDisableDate(_5,this,this.getField(_3).lane))return;if(!_6){_6=isc.DateUtil.getEndOf(_5,"D",false,this.firstDayOfWeek)}
if(_4.backgroundClick){if(_4.backgroundClick(_5,_6)==false){this.clearSelection();return}}
if(_4.backgroundMouseUp){if(_4.backgroundMouseUp(_5,_6)==false){this.clearSelection();return}}
var _7,_8;if(_4.showDayLanes&&_4.dayViewSelected()){_7=this.getLaneFromPoint();_8=_7?this.getSublaneFromPoint():null}
var _9=_4.createEventObject(null,_5,_6,_7&&_7.name,_8&&_8.name);_4.showEventDialog(_9,true);return isc.EH.STOP_BUBBLING},isc.A.clearSelection=function isc_DaySchedule_clearSelection(){if(this.$53q){var _1,_2,_3=this.$53q.colNum;if(this.$53q.startRowNum<this.$53q.endRowNum){_1=this.$53q.startRowNum;_2=this.$53q.endRowNum}else{_1=this.$53q.endRowNum;_2=this.$53q.startRowNum}
this.$53q=null;for(var i=_1;i<_2+1;i++){this.refreshCellStyle(i,_3)}}},isc.A.destroyEvents=function isc_DaySchedule_destroyEvents(){if(!this.body||!this.body.children)return;var _1=this.body.children.length;while(--_1>=0){var _2=this.body.children[_1];if(_2&&!_2.destroyed){_2.clear();_2.deparent();_2.destroy()}
_2=null}
this.$232j=null;this.$232n=null;this.$128h=null},isc.A.getBaseStyle=function isc_DaySchedule_getBaseStyle(_1,_2,_3){var _4=this.calendar,_5=_4.getCellDate(_2,_3,this),_6=this.getField(_3),_7=(_6&&_6.styleName)||(_5&&_4.getDateStyle?_4.getDateStyle(_5,_2,_3,this):null),_8=this.isWeekView();if(_7){return _7}
if(this.isLabelCol(_3))return this.labelColumnBaseStyle;if(!_4.showWorkday||!_4.styleWorkday)return this.baseStyle;var _9=this.getFieldBody(_3),_10=_3;if(_9==this.body)_10=this.getLocalFieldNum(_3);var _11=_8?this.getDayFromCol(_10):_4.chosenDate.getDay();var _12=_8?this.getDateFromCol(_10):_4.chosenDate.duplicate(),_13=_12.duplicate(),_14=_5?_5.duplicate():null,_15=this.usesLanes()?this.body.getField(_10)[_4.laneNameField]:null;if(_14){var _16=isc.Time.parseInput(_4.getWorkdayStart(_14,_15)),_17=isc.Time.parseInput(_4.getWorkdayEnd(_14,_15));_12.setHours(_16.getHours(),_16.getMinutes(),0,0);_13.setHours(_17.getHours(),_17.getMinutes(),0,0);var _18=_4.dateIsWorkday(_14,_15);_14=_14.getTime();if(_18&&_12.getTime()<=_14&&_14<_13.getTime()){return _4.workdayBaseStyle}else{return this.baseStyle}}else{return this.baseStyle}},isc.A.getCellStyle=function isc_DaySchedule_getCellStyle(_1,_2,_3){var _4=this.calendar,_5=this.getField(_3),_6=this.isSelected(_1),_7=this.isDisabled(),_8=_5.date?isc.DateUtil.combineLogicalDateAndTime(_5.date,_1.logicalTime):null,_9=_8?_4.shouldDisableDate(_8,this,this.hasLanes()?this.getField(_3).lane:null):false;var _10=this.getBaseStyle(_1,_2,_3);if(_7||(_9&&!_6)){_10+="Disabled"}
if(this.isLabelCol(_3)){return _10}
if(this.$53q&&this.$53q.colNum==_3){var _11=this.$53q.startRowNum,_12=this.$53q.endRowNum;if(_2>=_11&&_2<=_12||_2>=_12&&_2<=_11){if(_10==_4.workdayBaseStyle)_10+="Selected";else _10=_4.selectedCellStyle;return _10}}
if(this.alternateRecordStyles&&_2%2!=0){if(_10!=_4.workdayBaseStyle)_10+="Dark"}else if(this.alternateFieldStyles&&_3%2!=0){if(_4.dayViewSelected()&&_4.showDayLanes){if(_10!=_4.workdayBaseStyle)_10+="Dark"}}
return _10},isc.A.getWorkdayRowRange=function isc_DaySchedule_getWorkdayRowRange(){var _1=this.$245f/this.cellHeight,_2=_1+(this.$245k/this.cellHeight);return{start:_1,end:_2}});isc.B._maxIndex=isc.C+49;isc.ClassFactory.defineClass("WeekSchedule","DaySchedule");isc.A=isc.WeekSchedule.getPrototype();isc.A.rangeUnit="W";isc.ClassFactory.defineClass("MonthSchedule","CalendarView");isc.ClassFactory.defineClass("MonthScheduleBody","GridBody");isc.A=isc.MonthScheduleBody.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.adjustOverflow=function isc_MonthScheduleBody_adjustOverflow(_1){var _2=this.Super("adjustOverflow",arguments);var _3=this.grid;if(_3&&_3.longEventsLayouts){var _4=this.getViewportWidth();for(var i=0;i<_3.longEventsLayouts.length;i++){var _6=_3.longEventsLayouts[i];if(_6&&_6.isDrawn()){_6.setWidth(_4)}}}
return _2});isc.B._maxIndex=isc.C+1;isc.MonthSchedule.changeDefaults("headerButtonProperties",{showRollOver:false,showDown:false,cursor:"default"});isc.MonthSchedule.changeDefaults("bodyProperties",{redrawOnResize:true,fixedRowHeights:false});isc.A=isc.MonthSchedule.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.rangeUnit="M";isc.A.autoDraw=false;isc.A.leaveScrollbarGap=false;isc.A.showAllRecords=true;isc.A.showHeader=true;isc.A.showHeaderContextMenu=false;isc.A.canSort=false;isc.A.canResizeFields=false;isc.A.canReorderFields=false;isc.A.canAutoFitFields=false;isc.A.canHover=true;isc.A.showHover=true;isc.A.showRollOver=true;isc.A.useCellRollOvers=true;isc.A.hoverByCell=true;isc.A.showViewHovers=false;isc.A.navigateOnTab=false;isc.A.dayHeaderHeight=20;isc.A.alternateRecordStyles=false;isc.A.$160h="date";isc.A.cellHeight=1;isc.A.enforceVClipping=true;isc.B.push(isc.A.getDateLabelText=function isc_MonthSchedule_getDateLabelText(_1,_2){return this.chosenDate.getShortMonthName()+" "+this.chosenDate.getFullYear()},isc.A.initWidget=function isc_MonthSchedule_initWidget(){var _1=this.calendar;this.fields=[{name:"day1",align:"center",cellAlign:"left"},{name:"day2",align:"center",cellAlign:"left"},{name:"day3",align:"center",cellAlign:"left"},{name:"day4",align:"center",cellAlign:"left"},{name:"day5",align:"center",cellAlign:"left"},{name:"day6",align:"center",cellAlign:"left"},{name:"day7",align:"center",cellAlign:"left"}];if(!this.shouldAllowLongEvents())this.showRecordComponents=false;else{this.longEventsLayouts=[]}
this.firstDayOfWeek=_1.firstDayOfWeek;var _2=isc.DateUtil.getShortDayNames();var _3=_1.getWeekendDays();for(var i=0;i<7;i++){var _5=(i+this.firstDayOfWeek)%7;this.fields[i].title=_2[_5];this.fields[i].$654=_5;this.fields[i].$66b=i+1;if(_3.contains(_5)){this.fields[i].showIf="return list.creator.showWeekends!=false;"}}
this.minimumDayHeight=_1.minimumDayHeight;this.dayHeaderHeight=_1.monthDayHeaderHeight;if(_1.monthDayBodyHeight!=null)this.monthDayBodyHeight=_1.monthDayBodyHeight;if(this.rangeUnit){this.periodStartDate=this.startDate=isc.DateUtil.getStartOf(this.chosenDate,this.rangeUnit,false,this.firstDayOfWeek);this.periodEndDate=this.endDate=isc.DateUtil.getEndOf(this.chosenDate,this.rangeUnit,false,this.firstDayOfWeek)}
this.Super("initWidget",arguments);this.$128r=true},isc.A.canSelectCell=function isc_MonthSchedule_canSelectCell(_1,_2){return!this.calendar.shouldDisableDate(this.calendar.getCellDate(_1,_2,this),this,this.getField(_2).lane)},isc.A.getCalendar=function isc_MonthSchedule_getCalendar(){return this.calendar},isc.A.getTimePerCell=function isc_MonthSchedule_getTimePerCell(_1){return isc.DateUtil.convertPeriodUnit(1,"d","mn")},isc.A.getTimePerSnapGap=function isc_MonthSchedule_getTimePerSnapGap(_1){return isc.DateUtil.convertPeriodUnit(1,"d","mn")},isc.A.updateFieldDates=function isc_MonthSchedule_updateFieldDates(){return},isc.A.updateRowDates=function isc_MonthSchedule_updateRowDates(){var _1=this.logicalDate.duplicate(),_2=isc.DateUtil.createLogicalTime(0,0,0),_3=_1.duplicate();var _4=isc.DateUtil.getShortDayNames();var _5=this.calendar.getWeekendDays();for(var i=0;i<this.data.length-2;i+=2){var _7=this.getHeaderRowObject(_3);isc.addProperties(this.data[i],_7);_7=this.getEventRowObject(_3);isc.addProperties(this.data[i+1],_7);this.incrementDate(_3,7)}},isc.A.refreshLongEvents=function isc_MonthSchedule_refreshLongEvents(){if(!this.longEventsLayouts||!this.shouldAllowLongEvents())return;this.updateLongEventDates();for(var i=0;i<this.longEventsLayouts.length;i++){var _2=this.longEventsLayouts[i];if(_2){_2.reset();_2.refreshEvents()}}},isc.A.updateLongEventDates=function isc_MonthSchedule_updateLongEventDates(){return},isc.A.resized=function isc_MonthSchedule_resized(){if(!this.$204a||!this.body||!this.body.isDrawn())return;this.cacheRowHeights();this.markForRedraw();if(this.calendar.allowLongEvents&&!this.inGhostDragCreate&&!this.inGhostDragMove)
{this.refreshLongEvents()}},isc.A.cacheRowHeights=function isc_MonthSchedule_cacheRowHeights(_1){_1=_1||this.$204a;if(!_1)return;var _2=this.calendar,_3=_2.showDayHeaders,_4=_3?this.dayHeaderHeight:0,_5=_3?_1.length/2:_1.length,_6=this.body.getVisibleHeight(),_7=0;if(_3&&this.body&&!this.body.$297k){_7=this.$3036()}
var _8=_3?(_4+_7)*_5:0,_9=Math.floor(_6/_1.length);if(_3){_9=Math.floor((_6-_8)/_5);var _10=this.monthDayBodyHeight!=null?this.monthDayBodyHeight:this.minimumDayHeight-_4;if(_9<_10)_9=_10;_8+=(_9*_5)}else{_8=_9*_1.length}
var _11=_6-_8;for(var i=0;i<_1.length;i++){if(_1[i].isHeaderRow)_1[i].rowHeight=_4;else{_1[i].rowHeight=_9;if(_11>0&&i==_1.length-1){_1[i].rowHeight+=_11}}}},isc.A.getHeaderRowObject=function isc_MonthSchedule_getHeaderRowObject(_1){var _2={};var _3=_1.duplicate();_2.startDate=isc.DateUtil.adjustDate(_3.duplicate(),"-0D");for(var i=0;i<7;i++){_2["day"+(i+1)]=_3.getDate();_2["date"+(i+1)]=_3.duplicate();this.incrementDate(_3,1)}
this.incrementDate(_3,-1);_2.endDate=isc.DateUtil.adjustDate(_3.duplicate(),"+0D");_2.isHeaderRow=true;return _2},isc.A.getCellDate=function isc_MonthSchedule_getCellDate(_1,_2){if(_1==null&&_2==null){_1=this.getEventRow();_2=this.getEventColumn()}
if(_1<0||_2<0)return null;var _3=this.body.fields.get(_2).$66b,_4=this.getRecord(_1),_5=[this.$160h,_3].join(""),_6=_4[_5];return _6},isc.A.getCellStartDate=function isc_MonthSchedule_getCellStartDate(_1,_2){var _3=this.getCellDate(_1,_2);if(!_3)return null;return isc.DateUtil.getStartOf(_3,"D",false)},isc.A.getCellEndDate=function isc_MonthSchedule_getCellEndDate(_1,_2){var _3=this.getCellDate(_1,_2);if(!_3)return null;return isc.DateUtil.getEndOf(_3,"D",false)},isc.A.incrementDate=function isc_MonthSchedule_incrementDate(_1,_2){var _3=_1.getDate();_1.setDate(_3+_2);if(_1.getDate()==(_3+_2)-1){_1.setHours(_1.getHours()+1);_1.setDate(_3+_2)}
return _1},isc.A.getEventRowObject=function isc_MonthSchedule_getEventRowObject(_1,_2){_2=_2||[];var _3={};var _4=_1.duplicate();_3.startDate=isc.DateUtil.adjustDate(_4.duplicate(),"-0D");for(var i=0;i<7;i++){var _6=[];while(this.$53t<_2.length){var _7=_2[this.$53t];if(_7[this.calendar.startDateField].getMonth()!=_4.getMonth()||_7[this.calendar.startDateField].getDate()!=_4.getDate()){break}else{_6.add(_7);this.$53t+=1}}
_3["day"+(i+1)]=_4.getDate();_3["date"+(i+1)]=_4.duplicate();_3["event"+(i+1)]=_6;this.incrementDate(_4,1)}
this.incrementDate(_4,-1);_3.endDate=isc.DateUtil.adjustDate(_4.duplicate(),"+0D");return _3},isc.A.getEvents=function isc_MonthSchedule_getEvents(_1,_2){var _3=this.getFieldBody(_2);if(!_3||_3==this.frozenBody)return false;var _4=this.getLocalFieldNum(_2);var _5=this.getDayFromCol(_4);var _6=this.fields.get(_4).$66b;var _7=this.data[_1]["event"+_6];return _7},isc.A.getEventCell=function isc_MonthSchedule_getEventCell(_1){var _2=this.data;for(var _3=0;_3<this.fields.length;_3++){var _4=this.fields[_3].$66b,_5="event"+_4;for(var _6=0;_6<_2.length;_6++){var _7=_2.get(_6)[_5];if(_7!=null&&_7.contains(_1)){return[_6,_3]}}}},isc.A.getDayFromCol=function isc_MonthSchedule_getDayFromCol(_1){var _2=this.body.fields.get(_1).$654;return _2},isc.A.getDateCells=function isc_MonthSchedule_getDateCells(_1){for(var i=0;i<this.data.length;i++){var _3=this.data[i];for(var _4 in _3){if(_4.startsWith("date")&&isc.DateUtil.compareLogicalDates(_1,_3[_4])==0)
{var _5=[];if(this.calendar.showDayHeaders)
_5.add([i+1,new Number(_4.substring(4,5))-1]);_5.add([i,new Number(_4.substring(4,5))-1])
return _5}}}
return null},isc.A.getDayArray=function isc_MonthSchedule_getDayArray(){var _1=[],_2,_3,_4=this.calendar,_5=isc.DateUtil.createLogicalDate(_4.year,_4.month,1);while(_5.getDay()!=this.firstDayOfWeek){this.incrementDate(_5,-1)}
if(!_4.showWeekends&&!_4.fixedMonths){var _6=_4.getWeekendDays();var _7=_5.duplicate();var _8=true;for(var i=0;i<=7-_6.length;i++){if(_7.getMonth()==_4.month){_8=false;break}
this.incrementDate(_7,1)}
if(_8)this.incrementDate(_5,7)}
_2=this.$1743;_2.sortByProperty("name",true,function(_10,_11,_12){return _10[_12.startDateField].getTime()},_4);this.$53t=0;for(var i=0;i<6;i++){if(_4.showDayHeaders)_1.add(this.getHeaderRowObject(_5));_1.add(this.getEventRowObject(_5,_2));this.incrementDate(_5,7);if(!_4.fixedMonths&&_5.getMonth()!=_4.month)break}
if(this.body)this.cacheRowHeights(_1);this.$204a=_1;return _1},isc.A.showDataRows=function isc_MonthSchedule_showDataRows(){var _1=this.getDayArray();if(this.data&&this.data.length==_1.length){for(var i=0;i<_1.length;i++){isc.addProperties(this.data[i],_1[i])}
this.$204a=this.data;this.markForRedraw()}else{this.setData(_1)}},isc.A.refreshEvents=function isc_MonthSchedule_refreshEvents(){var _1=this.calendar;if(!_1.hasData()){if(this.shouldRefreshEventsOnDraw()){this.$116v();return}}
var _2=_1.$53g(this.startDate,this.endDate,this);this.$1743=[];this.$2777=[];for(var i=0;i<_2.length;i++){if(this.shouldAllowLongEvents()&&_1.isLongEvent(_2[i])){this.$2777.add(_2[i])}else{this.$1743.add(_2[i])}}
this.logDebug('refreshEvents: month','calendar');this.year=_1.year;this.month=_1.month;this.showDataRows();this.refreshLongEvents();if(_1.eventsRendered&&isc.isA.Function(_1.eventsRendered))
_1.eventsRendered()},isc.A.rowIsHeader=function isc_MonthSchedule_rowIsHeader(_1){var _2=this.calendar;if(!_2.showDayHeaders||(_2.showDayHeaders&&_1%2==1))return false;else return true},isc.A.formatCellValue=function isc_MonthSchedule_formatCellValue(_1,_2,_3,_4){if(!_2)return;var _5=this.calendar,_6=this.fields.get(_4).$66b,_7=_2["event"+_6],_8=_2["date"+_6],_9=_8.getMonth()!=_5.month;if(this.rowIsHeader(_3)){if(!_5.showOtherDays&&_9){return""}else{var _10=_5.getDayHeaderHTML(_8,_7,_5,_3,_4);var _11=this.dayHeaderHeight;if(this.body&&this.body.$297k){_11-=this.$303y()}else if(this.body){_11-=this.$3036()}
return"<div style='line-height:"+_11+"px'>"+_10+"</div>"}}else{if(!_5.showOtherDays&&_9){return""}else{return _5.getDayBodyHTML(_8,_7,_5,_3,_4)}}},isc.A.$303y=function isc_MonthSchedule__getHeaderCellVBorder(){if(this.$303z!=null)return this.$303z;this.$303z=isc.Element.$ym(this.calendar.dayHeaderBaseStyle);return this.$303z},isc.A.$3036=function isc_MonthSchedule__getHeaderCellVBorderPad(){if(this.$3037!=null)return this.$3037;var _1=this.calendar.dayHeaderBaseStyle,_2=isc.Element.$ym(_1),_3=isc.Element.$tq(_1),_4=this.body?this.body.cellPadding:0,_5=_3.nullTop?_4:_3.top,_6=_3.nullBottom?_4:_3.bottom;this.$3037=_2+_5+_6;return this.$3037},isc.A.getRowHeight=function isc_MonthSchedule_getRowHeight(_1,_2){if(_1&&_1.rowHeight!=null)return _1.rowHeight;return this.cellHeight},isc.A.getCellAlign=function isc_MonthSchedule_getCellAlign(_1,_2,_3){if(this.rowIsHeader(_2))return"right";else return"left"},isc.A.getCellVAlign=function isc_MonthSchedule_getCellVAlign(_1,_2,_3){if(!this.rowIsHeader(_2))return"top";else return"center"},isc.A.cellHoverHTML=function isc_MonthSchedule_cellHoverHTML(_1,_2,_3){var _4=this.fields.get(_3).$66b;var _5=_1["date"+_4];var _6=_1["event"+_4];if(!this.rowIsHeader(_2)&&_6!=null){var _7=this.calendar;return _7.getMonthViewHoverHTML(_5,_6)}},isc.A.getBaseStyle=function isc_MonthSchedule_getBaseStyle(_1,_2,_3){var _4=this.calendar,_5=this.fields.get(_3).$66b;var _6;var _7=_1["date"+_5],_8=_7&&_7.getMonth()!=_4.month;if(this.rowIsHeader(_2)){if(_8){if(!_4.showOtherDays)return _4.otherDayBlankStyle;else _6=_4.otherDayHeaderBaseStyle}else _6=_4.dayHeaderBaseStyle}else{if(_8){if(!_4.showOtherDays)return _4.otherDayBlankStyle;else _6=_4.otherDayBodyBaseStyle}else _6=_4.dayBodyBaseStyle}
return _6},isc.A.getCellStyle=function isc_MonthSchedule_getCellStyle(_1,_2,_3){var _4=this.calendar,_5=this.getField(_3),_6=this.isDisabled(),_7=this.data[_2]["date"+_5.$66b],_8=_7?_4.shouldDisableDate(_7,this,this.getField(_3).lane):false,_9=isc.DateUtil.compareLogicalDates(_7,this.chosenDate)==0;var _10=this.getBaseStyle(_1,_2,_3);if(_4.selectChosenDate&&_9)_10+="Selected";if(_6||_8){_10+="Disabled"}
return _10},isc.A.cellMouseDown=function isc_MonthSchedule_cellMouseDown(_1,_2,_3){var _4=this.calendar;delete this.$303e;var _5=this.getField(_3),_6=_1["date"+_5.$66b],_7=_6&&_6.getMonth()!=_4.month;if(_6&&!_7){_4.setChosenDate(isc.DateUtil.createLogicalDate(_6.getFullYear(),_6.getMonth(),_6.getDate()))}
if(this.rowIsHeader(_2))return false;if(!_4.canCreateEvents||!_4.canDragCreateEvents)return true;if(this.cellDisabled(_2,_3))return true;if(this.floatingScrollbars){if(this.body.getOffsetX()>this.body.getScrollWidth()-
this.scrollbarSize)
{return}}
var _8=this.getCellDate(_2,_3),_9=this.getCellEndDate(_2,_3);this.startGhostDragCreate(_8,_9);return false},isc.A.cellOver=function isc_MonthSchedule_cellOver(_1,_2,_3){if(this.inGhostDragCreate||this.inGhostDragMove){var _4=this.getCellStartDate(_2,_3),_5=this.getCellEndDate(_2,_3);this.updateGhostCanvas(_4,_5,"cellOver")}},isc.A.cellMouseUp=function isc_MonthSchedule_cellMouseUp(_1,_2,_3){var _4=this.calendar;if(this.inGhostDragCreate){var _5=this.ghostEvent[_4.startDateField],_6=this.ghostEvent[_4.endDateField],_7=isc.DateUtil.compareLogicalDates(_5,_6)==0;if(_7){delete this.inGhostDragCreate;this.ignoreGhostEvents()}else{this.finishGhostDragCreate();this.$303e=true;return isc.EH.STOP_BUBBLING}}
if(this.inGhostDragMove){this.finishGhostDragMove();this.ignoreGhostEvents();this.$303e=true;return isc.EH.STOP_BUBBLING}},isc.A.cellClick=function isc_MonthSchedule_cellClick(_1,_2,_3){if(this.inGhostDragCreate)return false;if(this.$303e){delete this.$303e;return false}
var _4=this.calendar,_5,_6,_7=this.fields.get(_3).$66b,_8=_1["date"+_7],_9=_1["event"+_7],_10=_4.month!=_8.getMonth(),_11=false;this.$53r=false;if(!_4.showOtherDays&&_10)return;var _12=isc.DateUtil.createLogicalDate(_8.getFullYear(),_8.getMonth(),_8.getDate())
if(this.rowIsHeader(_2)){_11=_4.dayHeaderClick(_12,_9,_4,_2,_3);if(_11){_4.setChosenDate(_12);_4.selectTab("day")}
return false}else{if(!this.cellDisabled(_2,_3)){_11=_4.dayBodyClick(_12,_9,_4,_2,_3);if(_11&&_4.canCreateEvents){var _13=_4.getCellDate(_2,_3,this);_13=isc.DateUtil.createDatetime(_13,null,null,12,0,0);var _14=isc.DateUtil.createDatetime(_13,null,null,13,0,0);if(_10){if(_4.otherDayClickNavigation)_4.setChosenDate(_12);if(!_4.canCreateOtherDayEvents)return}else{_4.setChosenDate(_12)}
var _15=_4.createEventObject(null,_13,_14,null,null,_4.newLongEventName);_4.delayCall("showEventDialog",[_15,true])}}}},isc.A.draw=function isc_MonthSchedule_draw(){this.Super("draw",arguments);this.cacheRowHeights();var _1=this.calendar;if(this.$128r){delete this.$128r;this.delayCall("$116v",[true],100);this.$2905=true}
if(this.$191w){delete this.$191w;_1.currentViewChanged(this.viewName)}
this.markForRedraw()},isc.A.getDateCell=function isc_MonthSchedule_getDateCell(_1){var _2=this.calendar,_3=_2.showDayHeaders?2:1;for(var i=0;i<this.data.length;i+=_3){for(var j=1;j<=7;j++){var _6=this.data[i]["date"+j];if(isc.DateUtil.compareLogicalDates(_1,_6)==0){var _7=this.getField("day"+j);return[i,_7?_7.masterIndex:0]}}}},isc.A.getEditDialogPosition=function isc_MonthSchedule_getEditDialogPosition(_1){var _2=this.calendar.getEventStartDate(_1),_3=_2?this.getDateCell(_2):[this.getEventRow(),this.getEventColumn()];var _4=this.body.getCellPageRect(_3[0],_3[1]);return{left:Math.max(_4[0],this.body.getPageLeft()),top:Math.max(_4[1],this.body.getPageTop())}});isc.B._maxIndex=isc.C+42;isc.ClassFactory.defineClass("TimelineView","CalendarView");isc.TimelineView.changeDefaults("bodyProperties",{snapToCells:false,suppressVSnapOffset:true,suppressHSnapOffset:true,childrenSnapToGrid:false});isc.A=isc.TimelineView.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canSort=false;isc.A.canResizeFields=false;isc.A.canAutoFitFields=false;isc.A.canReorderFields=false;isc.A.showHeaderContextMenu=false;isc.A.showAllRecords=true;isc.A.alternateRecordStyles=false;isc.A.showRollOver=false;isc.A.useCellRollOvers=false;isc.A.canSelectCells=false;isc.A.selectionType="multiple";isc.A.laneNameField="lane";isc.A.columnWidth=60;isc.A.laneHeight=60;isc.A.labelColumnWidth=75;isc.A.labelColumnBaseStyle="labelColumn";isc.A.labelColumnAlign="left";isc.A.eventPageSize=30;isc.A.trailIconSize=16;isc.A.leadIconSize=16;isc.A.scrollToToday=false;isc.A.lineImage="[SKINIMG]Stretchbar/hsplit_over_stretch.gif";isc.A.trailingEndPointImage="[SKINIMG]Calendar/trailingDateGripper.png";isc.A.leadingEndPointImage="[SKINIMG]Calendar/leadingDateGripper.png";isc.A.headerSpanHeight=28;isc.A.headerProperties={inherentWidth:false};isc.A.dateEditingStyle=null;isc.A.showDateChooserTimeItem=null;isc.A.verticalEvents=false;isc.A.allowMultiDayEvents=true;isc.A.animateFolders=false;isc.A.includeRangeCriteria=true;isc.A.unitSnapGapsPerCell={minute:1,hour:15,day:60,week:1440,month:1440,year:1440*30};isc.A.groupNodeStyle=null;isc.A.groupNodeBaseStyle="groupNode";isc.A.dragSelectCanvasDefaults={_constructor:"Canvas",styleName:"calendarCellSelected",opacity:60,width:1,height:1,disabled:true,visibility:"hidden",autoDraw:false,resizeNow:function(_1){var _2=this.creator,_3=_2.calendar,p=isc.addProperties({},this.props,_1);var _5=p.lane?_2.getLane(p.lane):null;var _6=p.lane&&p.sublane?_2.getSublane(p.sublane):null;if(p.top==null){p.top=_2.getRowTop(_2.getLaneIndex(p.lane));if(_6)p.top+=_6.top}
if(p.height==null){p.height=_6?_6.height:_2.getLaneHeight(p.lane)}
var _7=p.startSnap.startLeftOffset,_8=p.endSnap.endLeftOffset,_9=Math.abs(_8-_7);this.props=p;this.moveTo(_7,p.top);this.resizeTo(_9,p.height);if(!this.isDrawn())this.draw();if(!this.isVisible()){this.show()}
if(_2.shouldShowDragHovers())isc.Hover.show(this.getHoverHTML())},hoverMoveWithMouse:true,showHover:true,hoverDelay:0,hoverProps:{overflow:"visible",hoverMoveWithMouse:this.hoverMoveWithMouse},getHoverHTML:function(){var _1=this.creator,_2=this.props,_3=_2.startSnap[_1.calendar.startDateField],_4=_2.endSnap[_1.calendar.endDateField];var _5=_1.calendar.createEventObject({},_3,_4,_2.lane,_2.sublane);return _1.calendar.$140a(_1,_5)}};isc.A.laneSlotCounts={};isc.A.laneIndexCache={};isc.A.groupRowHeight=30;isc.A.rangeCriteriaMode="view";isc.A.maximumTimelineColumns=400;isc.A.laneHeightCache={};isc.B.push(isc.A.getTimePerCell=function isc_TimelineView_getTimePerCell(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerCell;if(!_4){_4=isc.DateUtil.convertPeriodUnit(1*_3.unitsPerColumn,_3.granularity,"ms")}
if(!_1)_1="mn";return Math.floor(isc.DateUtil.convertPeriodUnit(_4,"ms",_1))},isc.A.getTimePerSnapGap=function isc_TimelineView_getTimePerSnapGap(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerSnapGap;if(!_4){if(_3.calendarEventSnapGap==null){_4=this.getTimePerCell("ms")}else if(_3.calendarEventSnapGap==0){if(_3.unitsPerColumn>1){_4=isc.DateUtil.convertPeriodUnit(1,_3.innerHeaderUnit||_3.granularity,"ms")}else{_4=isc.DateUtil.convertPeriodUnit(this.unitSnapGapsPerCell[_3.granularity],"mn","ms");_4=Math.max(_4,_3.minimumSnapGapMillis)}}else{_4=isc.DateUtil.convertPeriodUnit(_3.calendarEventSnapGap,"mn","ms");var _5=_3.minimumSnapGapMillis;if(_4<_5){this.logWarn("Invalid eventSnapGap - "+((_4/1000)/60)+" minutes - altered to the lowest sensible time that can be represented by the column-widths in the current view: "+((_5/1000)/60)+" minutes.");_4=_5}}
_3.calendarEventSnapGap=isc.DateUtil.convertPeriodUnit(_4,"ms","mn")}
if(!_1)_1="mn";return isc.DateUtil.convertPeriodUnit(_4,"ms",_1)},isc.A.getHeaderButtonWidth=function isc_TimelineView_getHeaderButtonWidth(_1){var _2=this.columnWidth;var _3=this.calendar;if(_3.headerLevels){_2=this.$251k}
return _2},isc.A.getTimePerPixel=function isc_TimelineView_getTimePerPixel(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerPixel;if(!_4){_4=this.getTimePerCell("ms")/this.getHeaderButtonWidth()}
if(!_1)_1="mn";return isc.DateUtil.convertPeriodUnit(_4,"ms",_1)},isc.A.getSnapGapPixels=function isc_TimelineView_getSnapGapPixels(_1,_2){var _3=this.getTimePerCell()/this.getTimePerSnapGap();return this.getHeaderButtonWidth()/_3},isc.A.getVisibleStartDate=function isc_TimelineView_getVisibleStartDate(){var _1=this.getFirstVisibleSnap();if(_1)return _1.startDate;return this.startDate},isc.A.getVisibleEndDate=function isc_TimelineView_getVisibleEndDate(){var _1=this.getLastVisibleSnap();if(_1)return _1.endDate;return this.endDate},isc.A.getFirstVisibleSnap=function isc_TimelineView_getFirstVisibleSnap(){if(this.$1725){return this.$1725[this.$1725.firstVisibleIndex]}
return null},isc.A.getLastVisibleSnap=function isc_TimelineView_getLastVisibleSnap(){if(this.$1725){return this.$1725[this.$1725.lastVisibleIndex]}
return null},isc.A.setChosenDate=function isc_TimelineView_setChosenDate(_1){this.chosenDate=_1.duplicate();this.logicalDate=isc.DateUtil.createLogicalDate(this.chosenDate);this.remapCalendarSettings();var _2=isc.DateUtil.getTimeUnitKey(this.timelineGranularity);this.startDate=isc.DateUtil.getStartOf(this.chosenDate,_2,false,this.firstDayOfWeek);this.endDate=isc.DateUtil.dateAdd(this.startDate,_2,(this.calendar.timelineColumnSpan*this.timelineUnitsPerColumn)-1,1,null,null,this.firstDayOfWeek)
this.endDate=isc.DateUtil.getEndOf(this.endDate,_2,null,this.firstDayOfWeek);this.setTimelineRange(this.startDate,this.endDate)},isc.A.getDateLabelText=function isc_TimelineView_getDateLabelText(_1,_2){if(!_1||!_2){this.logInfo("missing dates in getDateLabelText()");return""}
var _3=new Date(_1.getTime()+1),_4=new Date(_2.getTime()-1);var _5=_3.getFullYear(),_6=_3.getMonth(),_7=_3.getDate(),_8=_4.getFullYear(),_9=_4.getMonth(),_10=_4.getDate(),s="";if(_5==_8){if(_6==_9){if(_7==_10){s=_3.getShortMonthName()+" "+_7+", "+_5}else{s=_3.getShortMonthName()+" "+_7+" - "+_10+", "+_8}}else{s=_3.getShortMonthName()+" "+_7+" - "+_4.getShortMonthName()+" "+_10+", "+_8}}else{s=_3.getShortMonthName()+" "+_7+", "+_5+" - "+_4.getShortMonthName()+" "+_10+", "+_8}
return s},isc.A.initWidget=function isc_TimelineView_initWidget(){this.fields=[];this.$963=this.headerHeight;this.remapCalendarSettings();var c=this.calendar;var _2=isc.DateUtil.getTimeUnitKey(this.timelineGranularity);if(c.startDate){c.startDate=isc.DateUtil.getStartOf(c.startDate,_2,false,this.firstDayOfWeek);this.startDate=c.startDate.duplicate()}
if(c.endDate){c.endDate=isc.DateUtil.getEndOf(c.endDate,_2,false,this.firstDayOfWeek);this.endDate=c.endDate.duplicate()}
if(!this.startDate){this.startDate=c.startDate=isc.DateUtil.getAbsoluteDate("-0"+_2,c.chosenDate)}
if(!this.endDate){this.endDate=c.endDate=isc.DateUtil.getAbsoluteDate("+"+c.defaultTimelineColumnSpan+_2,this.startDate)}else if(isc.DateUtil.compareDates(this.startDate,this.endDate)==-1){var s=this.startDate;this.startDate=c.startDate=this.endDate.duplicate();this.endDate=c.endDate=s;this.logWarn("Timeline startDate is later than endDate - switching the values.")}
this.Super("initWidget",arguments);this.$128r=true;this.addAutoChild("eventDragCanvas",{styleName:this.eventDragCanvasStyleName});if(c.canGroupLanes==true)this.$222w=true},isc.A.remapCalendarSettings=function isc_TimelineView_remapCalendarSettings(){var c=this.calendar;this.firstDayOfWeek=c.firstDayOfWeek;if(c.renderEventsOnDemand!=null)this.renderEventsOnDemand=c.renderEventsOnDemand;if(c.laneNameField)this.laneNameField=c.laneNameField;if(c.labelColumnWidth!=null)this.labelColumnWidth=c.labelColumnWidth;if(c.alternateLaneStyles!=null)this.alternateRecordStyles=c.alternateLaneStyles;if(c.showLaneRollOver!=null){this.showRollOver=c.showLaneRollOver;this.useCellRollOvers=false}
if(c.canReorderLanes!=null)this.canReorderRecords=c.canReorderLanes;if(c.eventDragGap!=null)this.eventDragGap=c.eventDragGap;this.cellHeight=this.laneHeight;if(c.headerLevels){this.headerLevels=isc.shallowClone(c.headerLevels)}
var _2=this.headerLevels&&this.headerLevels.length>0?this.headerLevels[this.headerLevels.length-1]:null;if(_2){this.timelineGranularity=_2.unit;c.timelineGranularity=_2.unit}else{this.timelineGranularity=c.timelineGranularity}
this.timelineUnitsPerColumn=c.timelineUnitsPerColumn},isc.A.installLocalHandlers=function isc_TimelineView_installLocalHandlers(){if(this.calendar.showLaneRollOver){this.viewMouseMoveEventId=isc.Page.setEvent("mouseMove",this.getID()+".viewMouseMove()");this.viewDragMoveEventId=isc.Page.setEvent("dragMove",this.getID()+".viewDragMove()");this.viewDragRepositionMoveEventId=isc.Page.setEvent("dragRepositionMove",this.getID()+".viewDragMove()");this.$1745=true}},isc.A.removeLocalHandlers=function isc_TimelineView_removeLocalHandlers(){if(this.$1745){isc.Page.clearEvent("mouseMove",this.viewMouseMoveEventId);isc.Page.clearEvent("dragMove",this.viewDragMoveEventId);isc.Page.clearEvent("dragRepositionMove",this.viewDragRepositionMoveEventId);delete this.$1745}},isc.A.initCacheValues=function isc_TimelineView_initCacheValues(){var _1=this.calendar;this.$27q={alternateLaneStyles:this.alternateRecordStyles,firstDayOfWeek:this.firstDayOfWeek,granularity:this.timelineGranularity,unitsPerColumn:this.timelineUnitsPerColumn||1,rangeStartDate:this.startDate,rangeEndDate:this.endDate,calendarEventSnapGap:_1.eventSnapGap};this.$27q.rangeStartMillis=this.$27q.rangeStartDate.getTime();this.$27q.rangeEndMillis=this.$27q.rangeEndDate.getTime();this.updateSnapProperties();return this.$27q},isc.A.updateSnapProperties=function isc_TimelineView_updateSnapProperties(){if(this.fieldHeaderLevel)this.$27q.innerHeaderUnit=this.fieldHeaderLevel.unit;this.Super("updateSnapProperties",arguments)},isc.A.getDragSelectCanvas=function isc_TimelineView_getDragSelectCanvas(_1){if(!this.body)return null;if(!this.dragSelectCanvas){this.dragSelectCanvas=this.createAutoChild("dragSelectCanvas",{eventProxy:this.body});this.body.addChild(this.dragSelectCanvas)}
return this.dragSelectCanvas},isc.A.cellMouseDown=function isc_TimelineView_cellMouseDown(_1,_2,_3){if(isc.EH.dragTarget||isc.EH.lastTarget!=this.body)return;if((_1&&_1.$52e)||this.isLabelCol(_3)){return true}
var _4=this.calendar;if(_4.canDragCreateEvents==false&&this.canDragScroll){this.$50p=true;this.$171u=this.body.getScrollLeft();this.$171v=this.$171w=this.getOffsetX();this.$53r=true;return false}
var _5=this.getMouseData()||{x:this.body.getOffsetX(),y:this.body.getOffsetY()},_6=this.getSnapData(_5.x,_5.y),_7=_6&&_6[_4.startDateField];if(_4.shouldDisableDate(_7,this,this.getField(_3).lane)){return false}
if(_4.backgroundMouseDown&&_4.backgroundMouseDown(_7)==false)return;if(!_4.canCreateEvents||_4.canDragCreateEvents==false)return true;this.clearSelection();var _8=this.getDragSelectCanvas(),_9=_6[_4.endDateField],_10=this.getLaneFromPoint(),_11=this.getSublaneFromPoint();var p={top:null,height:null};p.lane=_10&&_10.name;p.sublane=_11&&_11.name;p.draggingLeftEdge=false;p.startSnap=_6;p.endSnap=_6;_8.resizeNow(p);this.$53r=true;return false},isc.A.cellOver=function isc_TimelineView_cellOver(_1,_2,_3){_3-=1;this.$152f=_2;if(this.$50p){var _4=this.body.getScrollLeft(),_5=this.getOffsetX(),_6=this.$171w-_5;this.$171w=_5;var _7=Math.max(0,this.$171u+_6);this.body.scrollBy(_6)}else if(this.$53r){var _8=this.getDragSelectCanvas(),_9=_8.props,_10=this.getMouseData()||{x:this.body.getOffsetX(),y:this.body.getOffsetY()},_11=this.getSnapData(_10.x,_10.y);if(_11){if(_11.index<_9.startSnap.index){if(_9.draggingLeftEdge)_9.startSnap=_11;else{_9.endSnap=_9.startSnap;_9.startSnap=_11;_9.draggingLeftEdge=true}}else if(_11.index>_9.endSnap.index){if(!_9.draggingLeftEdge)_9.endSnap=_11;else{_9.startSnap=_9.endSnap;_9.endSnap=_11;_9.draggingLeftEdge=false}}else{if(_9.draggingLeftEdge)_9.startSnap=_11;else _9.endSnap=_11}
_8.resizeNow(_9)}}
return this.Super("cellOver",arguments)},isc.A.cellMouseUp=function isc_TimelineView_cellMouseUp(_1,_2,_3){var _4=this.calendar;if(!this.$53r){var _5=this.getField(_3);if(_5.isLaneField&&_1.name){var _6=_4.laneFieldClick(_4.getLane(_1.name),this);return _6}
return}
this.$53r=false;if(this.shouldShowDragHovers())isc.Hover.hide();if(this.$50p){this.$171v=null;this.$171u=null;this.$50p=false;return isc.EH.STOP_BUBBLING}
var _7=this.getDragSelectCanvas(),_8=_7.props,_9=_8.startSnap[_4.startDateField],_10=_8.endSnap[_4.endDateField];if(_4.backgroundClick){if(_4.backgroundClick(_9,_10)==false){this.clearSelection();return}}
if(_4.backgroundMouseUp){if(_4.backgroundMouseUp(_9,_10)==false){this.clearSelection();return}}
if(_4.shouldDisableDate(isc.DateUtil.dateAdd(_10,"ms",-1),this,this.getField(_3).lane)){this.clearSelection();return false}
var _11=_4.createEventObject(null,_9,_10,_8.lane,_8.sublane);_4.showEventDialog(_11,true);return isc.EH.STOP_BUBBLING},isc.A.clearSelection=function isc_TimelineView_clearSelection(){var _1=this.getDragSelectCanvas();if(_1)_1.hide()},isc.A.getCellDate=function isc_TimelineView_getCellDate(_1,_2){if(!this.body)return null;var _3=this.body.getField(_2);if(!_3||!_3.date)return null;return _3.date},isc.A.getCellEndDate=function isc_TimelineView_getCellEndDate(_1,_2){if(!this.body)return null;var _3=this.body.getField(_2);if(!_3||!_3.endDate)return null;return _3.endDate},isc.A.recordDrop=function isc_TimelineView_recordDrop(_1,_2,_3,_4){this.Super("recordDrop",arguments);var _5=this.calendar;if(_5.canReorderLanes&&_4==this){var _6=[];for(var i=0;i<_5.lanes.length;i++){_6[i]=_5.lanes.find("name",this.data[i].name)}
_5.lanes=_6}
this.refreshEvents();this.markForRedraw()},isc.A.updateOverlapRanges=function isc_TimelineView_updateOverlapRanges(_1){var _2=this.calendar,_3=_1||this.getEventData(),_4=_3.getLength(),_5=this.overlapRanges||[],_6=[],_7=this.startDate,_8=this.endDate;var _9=(isc.isA.ResultSet(_3)?_3.allRows:_3);_9.setProperty("tagged",false);_9.setProperty("overlapProps",null);_9.setProperty("slotNum",null);_9.setSort([{property:_2.laneNameField,direction:"ascending"},{property:_2.startDateField,direction:"ascending"},{property:_2.endDateField,direction:"descending"}]);for(var i=0;i<_4;i++){var _11=_9.get(i);var _12={events:[_11]};_12[_2.leadingDateField]=_11[_2.leadingDateField];_12[_2.startDateField]=_2.getEventStartDate(_11);if(_12[_2.leadingDateField]>_8)_12[_2.leadingDateField]=_8;if(_12[_2.startDateField]<_7)_12[_2.startDateField]=_7;_12[_2.trailingDateField]=_11[_2.trailingDateField];_12[_2.endDateField]=_2.getEventEndDate(_11);if(_12[_2.trailingDateField]>_8)_12[_2.trailingDateField]=_8;if(_12[_2.endDateField]>_8)_12[_2.endDateField]=_8;_12[_2.laneNameField]=_12.lane=_11[_2.laneNameField];var _13=true;for(var j=0;j<_5.length;j++){if(_12[_2.laneNameField]!=_5[j][_2.laneNameField])continue;if(this.eventsOverlap(_12,_5[j],true)){this.mergeOverlapRanges(_12,_5[j]);_13=false}
if(!_13)break}
if(_13){_5.add(_12);if(!_6.contains(_12))_6.add(_12)}}
for(i=0;i<_5.length;i++){var _15=_5[i];_15.id="range_"+i+"_lane_"+_15.lane;_15.events.setProperty("overlapRangeId",_15.id)}
this.overlapRanges=_5;return _6},isc.A.getOverlapSlot=function isc_TimelineView_getOverlapSlot(_1,_2){var _3={slotNum:_1,events:[],snapGaps:[]};for(var i=0;i<_2;i++)_3.snapGaps[i]=0;return _3},isc.A.tagDataForOverlap=function isc_TimelineView_tagDataForOverlap(_1,_2){_1=_1||this.getEventData();if(_1.getLength()==0)return;var _3=false;var _4=this.calendar;if(_4.eventAutoArrange==false)return;this.forceDataSort(_1);var _5=this.usesLanes();var _6=this.updateOverlapRanges(_1);var _7=[];if(_5){_7.add({property:_4.laneNameField,direction:"ascending"})}
if(_4.overlapSortSpecifiers){_7.addList(_4.overlapSortSpecifiers)}else{_7.add({property:"eventLength",direction:"descending"});_7.add({property:_4.startDateField,direction:"ascending"});_7.add({property:_4.endDateField,direction:"ascending"})}
if(_3){this.logWarn("tagDataForOverlap: about to loop over "+_6.length+" overlap ranges")}
for(var j=0;j<_6.length;j++){var _9=_6[j];if(_3){this.logWarn("range: "+isc.echoFull(_9)+"")}
var _10=_9[_4.leadingDateField]||_9[_4.startDateField]
var _11=_9[_4.trailingDateField]||_9[_4.endDateField]
var _12=this.getSnapData(null,null,_10),_13=_12?_12.index:0,_14=this.getSnapData(null,null,_11),_15=_14?_14.index:this.$1725.length-1,_16=(_15-_13)+1,_17=[],_18=1;_17[0]=this.getOverlapSlot(0,_16);var _19=_9.events;_19.setSort(_7);for(var _20=0;_20<_19.length;_20++){var _21=_19[_20];_21.overlapProps={};var _22=_21.overlapProps;var _23=_21[_4.leadingDateField]||_4.getEventStartDate(_21),_24=_21[_4.trailingDateField]||_4.getEventEndDate(_21);_22.eventStartSnap=this.getSnapData(null,null,_23.getTime()+1,true);_22.eventEndSnap=this.getSnapData(null,null,_24.getTime()-1,true);var _25=(_22.eventStartSnap?_22.eventStartSnap.index:_22.nextValidSnap.index)-_13;var _26=(_22.eventEndSnap?_22.eventEndSnap.index:_22.lastValidSnap.index)-_13;var _27=false;var _28=null;for(var _29=0;_29<_18;_29++){var _30=_17[_29].snapGaps.slice(_25,_26+1);var _31=_30.sum()>0;if(!_31){_27=true;_17[_29].snapGaps.fill(1,_25,_26+1);_17[_29].events.add(_21);_21.overlapProps.slotNum=_29
if(_3){this.logWarn("event "+_21.name+" occupying slot "+_29)}
break}}
if(!_27){_17[_18]=this.getOverlapSlot(_18,_16);_17[_18].snapGaps.fill(1,_25,_26+1);_17[_18].events.add(_21);_21.overlapProps.slotNum=_18
if(_3){this.logWarn("event "+_21.name+" added to new slot index "+_18)}
_18++}}
for(var i=0;i<_17.length;i++){var _28=_17[i];for(var _33=0;_33<_28.events.length;_33++){var _21=_28.events[_33];var _22=_21.overlapProps;_22.totalSlots=_18;var _25=(_22.eventStartSnap?_22.eventStartSnap.index:_13)-_13;var _26=(_22.eventEndSnap?_22.eventEndSnap.index:_13)-_13;var _27=false;for(var _34=i+1;_34<_17.length;_34++){var _30=_17[_34].snapGaps.slice(_25,_26+1);var _31=_30.sum()>0;if(_31){_22.slotCount=_34-_22.slotNum;_27=true;break}}
if(!_27){_22.slotCount=_18-_22.slotNum}
_22.slotNum++;_21.slotNum=_22.slotNum}}
_9.slotList=_17;if(_3){this.logWarn("***** slotList *****\n"+isc.echoFull(_17))}}
var _35={};for(var i=0;i<_6.length;i++){var _9=_6[i];if(!_35[_9.lane])_35[_9.lane]=0;if(_9.slotList.length>_35[_9.lane]){_35[_9.lane]=_9.slotList.length}}
this.laneSlotCounts=_35;if(_4.fixedEventHeight){for(var _36 in _35){var _37=this.data.find("name",_36);if(_37){_37.height=_35[_36]*_4.fixedEventHeight;_37.height+=(_35[_36]+1)*_4.laneEventPadding;_37.height=Math.max(_37.height,_4.minLaneHeight)}}}},isc.A.getSnapData=function isc_TimelineView_getSnapData(_1,_2,_3,_4){var _5=this.$1725,_6=_5.length,_7=(_3!=null),_8=null;if(_7){if(isc.isA.Number(_3))_8=_3;else if(_3.getTime)_8=_3.getTime()}else{if(_1==null)_1=this.body.getOffsetX()}
if(_8!=null){if(_8<_5[_5.firstVisibleIndex].startMillis){if(_4)return _5[_5.firstVisibleIndex];return null}
if(_8>_5[_5.lastVisibleIndex].endMillis){if(_4)return _5[_5.lastVisibleIndex];return null}}
for(var i=0;i<_6;i++){var _10=_5[i];if(_7){if(_10.startMillis<=_8&&_10.endMillis>=_8){return _10}}else{if(_10.startHidden&&_10.endHidden)continue;if(_1>=_10.startLeftOffset&&_1<=_10.endLeftOffset)return _10}}
return null},isc.A.buildSnapGapList=function isc_TimelineView_buildSnapGapList(_1){if(!this.$27q)return;if(!this.body)return;var _2=this.creator,_3=this.frozenBody?this.body.fields:this.getFields(),_4=_2.getSnapGapPixels(this),_5=this.getTimePerPixel("ms"),_6=this.getTimePerSnapGap("ms"),_7=this.getTimePerSnapGap("mn"),_8=this.$27q.rangeStartDate,_9=this.$27q.rangeStartMillis,_10=this.$27q.rangeEndMillis,_11=this.$27q.rangeEndDate,_12=this.$27q.rangeStartDate.duplicate(),_13=_9,i=0,_15=[],_16=false,_17=null,_18=0,_19=null,_20=null,_21;var _22=null;if(isc.DateUtil.compareTimeUnits("day",this.timelineGranularity)==1){_22=this.timelineGranularity}
while(_13<_10){if(_22){_6=isc.DateUtil.getUnitDurationForDate(_13,_22)}
var _23=_13+_6;if(_23==_21){this.logWarn("snapGaps "+i+" and "+(i+1)+" have identical times")}else if(_23>=_10){_23=_10;_16=true}
if(_7==1440){_12.setDate(_12.getDate()+1);_23=_12.getTime()}else{_12.setTime(_23-1)}
_21=_23;if(!_22){_21--}
var _24={index:i++,startMillis:_13,endMillis:_21,startDate:new Date(_13),endDate:new Date(_21)};_24.startField=this.getFieldContainingDate(_13+1,true);if(_24.startField){_24.startCol=_3.indexOf(_24.startField);_24.startField.startLeftOffset=this.body.getColumnLeft(_24.startCol);_24.startField.endLeftOffset=_24.startField.startLeftOffset+this.$251k}else{_24.startHidden=true}
if(_24.startField){if(_24.startCol==_17){_18++}else{_17=_24.startCol;_18=0}
_24.fieldSnapIndex=_18;var _25=_2.getMinutePixels(Math.floor((_13-_24.startField.date.getTime())/1000/60),null,this);_24.startLeftOffset=_24.startField.startLeftOffset+_25}
_24.endField=this.getFieldContainingDate(_21,true);if(!_24.endField){_24.endField=this.getFieldContainingDate(_21,false)}
if(_24.endField){_24.endCol=_3.indexOf(_24.endField);_24.endField.startLeftOffset=this.body.getColumnLeft(_24.endCol);_24.endField.endLeftOffset=_24.endField.startLeftOffset+this.$251k}else{_24.endHidden=true}
if(_24.endField){var _26=_2.getMinutePixels(Math.floor((_24.endField.endDate.getTime()-_21)/1000/60),null,this);_24.endLeftOffset=_24.endField.endLeftOffset-_26}
_24[_2.startDateField]=new Date(_13);_24[_2.endDateField]=new Date(_21);_15.add(_24);if(!_24.startHidden){if(_19==null)_19=_24.index;if(_20==null||_24.index>_20)_20=_24.index}
if(_16)break;_13=_21+1}
var _27;var _28;var _29;for(var i=0;i<_15.length;i++){var _24=_15[i];if(_24.startHidden){if(_28==null)_28=i}else{if(_28!=null){for(var j=_28;j<i;j++){_15[j].nextValidSnap=_24}
_28=null}}
if(_24.endHidden){_24.lastValidSnap=_15[_29]}else{_29=i}
_27=_24}
if(_27.endField)_27.endField.endLeftOffset=this.header.getWidth()-1;if(_27.startField&&_27.endField){if(_27.startField.masterIndex==_27.endField.masterIndex)
_27.startField.endLeftOffset=_27.endField.endLeftOffset}
if(_19!=null)_15.firstVisibleIndex=_19;if(_20!=null)_15.lastVisibleIndex=_20;this.$1725=_15},isc.A.$1731=function isc_TimelineView__rebuildFields(){this.$171x=true;var _1=this.calcFields();if(this.isDrawn()){this.body.removeChild(this.eventDragCanvas);this.setFields(_1);this.body.addChild(this.eventDragCanvas,null,false)}else this.fields=_1;this.buildSnapGapList("$1731");if(this.isDrawn()&&this.scrollToToday!==false){var _2=isc.DateUtil.getLogicalDateOnly(new Date());_2.setDate(_2.getDate()-this.scrollToToday);var _3=this.getColFromDate(_2,true);if(_3!=null){this.bodies[1]&&this.bodies[1].scrollTo(this.bodies[1].getColumnLeft(_3),0)}}},isc.A.$152e=function isc_TimelineView__rebuild(_1){this.clearEvents();var _2=this.calendar;this.setShowHover(_2.showViewHovers);this.$1731();if(!this.$2160){var _3=this.lanes||_2.lanes||[];this.setLanes(_3.duplicate(),true)}
this.$730();var _4=_2.getDataSource();if(!_2.$283a){return}
if(_1!=false||!_4){if(_1!=false)this.$116v()}else if(!_2.hasData()||(_4&&isc.isAn.Array(_2.data))){if(_2.autoFetchData||_2.$253z!=null)
this.refreshEvents("$152e");else this.redraw()}},isc.A.refreshEvents=function isc_TimelineView_refreshEvents(){this.buildSnapGapList("refreshEvents");return this.Super("refreshEvents",arguments)},isc.A.setLanes=function isc_TimelineView_setLanes(_1,_2){this.resetLaneCaches(true);var _3=this.calendar,_4=_3.laneNameField;_3.checkLaneNames(_1);this.lanes=[];for(var i=0;i<_1.length;i++){if(this.calendar.shouldShowLane(_1[i]))this.lanes.add(_1[i])}
var _6=this.lanes.length;for(var i=0;i<_6;i++){var _7=this.lanes[i];if(_7.sublanes){var _8=this.getLaneHeight(_7),_9=_7.sublanes.length,_10=Math.floor(_8/_9),_11=0;for(var j=0;j<_9;j++){var _13=_7.sublanes[j];_13[_4]=_13.name;_13.top=_11;if(_13.height==null)_13.height=_10;_11+=_13.height}
_7.height=_7.sublanes.getProperty("height").sum()}else{_7.height=this.getLaneHeight(_7)}}
this.setData(this.lanes);this.redraw();this.laneMap=(this.originalData||this.data).makeIndex("name");if(!_2)this.refreshEvents("setLanes");return},isc.A.getLaneIndex=function isc_TimelineView_getLaneIndex(_1){var _2=null;if(_2==null){var _3;if(isc.isAn.Object(_1))_3=_1;else if(this.data){_3=this.laneMap[_1]||this.data.find(this.calendar.laneNameField,_1)}else _2=-1;if(_2==null)_2=this.getRecordIndex(_3);this.laneIndexCache[_1]=_2}
return _2},isc.A.getLane=function isc_TimelineView_getLane(_1){return this.getLaneMap()[_1]},isc.A.getLaneFromPoint=function isc_TimelineView_getLaneFromPoint(_1,_2){if(_2==null)_2=this.body.getOffsetY();var _3=this.getEventRow(_2),_4=this.getRecord(_3);return!this.isGroupNode(_4)?_4:null},isc.A.getSublaneFromPoint=function isc_TimelineView_getSublaneFromPoint(_1,_2){if(_2==null)_2=this.body.getOffsetY();var _3=this.getEventRow(_2),_4=this.getRecord(_3),_5=_4?_4.sublanes:null;if(!_5)return null;var _6=this.getRowTop(_3),_7=_2-_6,_8=this.getLaneHeight(_4),_9=_5.length,_10=0;for(var i=0;i<_9;i++){if(_10+_5[i].height>=_7){return _5[i]}
_10+=_5[i].height}
return null},isc.A.$730=function isc_TimelineView__scrubDateRange(){var _1=this.calendar.timelineGranularity;if(_1=="month"){this.startDate.setDate(1)}else if(_1=="week"){this.startDate=isc.DateUtil.getStartOf(this.startDate,"w",true,this.calendar.firstDayOfWeek)}else if(_1=="day"){this.startDate.setHours(0);this.startDate.setMinutes(0);this.startDate.setSeconds(0);this.startDate.setMilliseconds(0)}else if(_1=="hour"){this.startDate.setMinutes(0);this.startDate.setSeconds(0);this.startDate.setMilliseconds(0)}else if(_1=="minute"){this.startDate.setSeconds(0);this.startDate.setMilliseconds(0)}},isc.A.scrollTimelineTo=function isc_TimelineView_scrollTimelineTo(_1){this.bodies[1]&&this.bodies[1].scrollTo(_1)},isc.A.setLaneHeight=function isc_TimelineView_setLaneHeight(_1){this.laneHeight=_1;this.setCellHeight(_1);this.refreshEvents("setLaneHeight")},isc.A.getRowHeight=function isc_TimelineView_getRowHeight(_1,_2){var _3=null;if(_1){if(this.isGroupNode(_1))_3=this.groupRowHeight;else _3=_1.height}
return Math.round(_3||this.Super("getRowHeight",arguments))},isc.A.setInnerColumnWidth=function isc_TimelineView_setInnerColumnWidth(_1){this.columnWidth=_1;this.$152e(true)},isc.A.setTimelineRange=function isc_TimelineView_setTimelineRange(_1,_2){var _3=this.calendar;this.timelineGranularity=_3.timelineGranularity;this.timelineUnitsPerColumn=_3.timelineUnitsPerColumn;this.timelineColumnSpan=_3.timelineColumnSpan;var _4=this.timelineColumnSpan||this.$178u||_3.defaultTimelineColumnSpan,_5=false,_6=this.timelineGranularity.toLowerCase(),_7=isc.DateUtil.getTimeUnitKey(_6);;_1=_1||this.startDate;_1=isc.DateUtil.getStartOf(_1,_7,false,this.firstDayOfWeek);if(!_2){if(_1.getTime()==this.startDate.getTime()&&this.endDate)_2=this.endDate;else _2=isc.DateUtil.getAbsoluteDate("+"+(_4*this.timelineUnitsPerColumn)+_7,_1)}
var _8=this.rangeCriteriaMode||_3.rangeCriteriaMode;if(_8&&_8!="none")_5=true;if(_1.logicalDate){_1=isc.DateUtil.getStartOf(_1,_7,false,this.firstDayOfWeek)}
if(_2.logicalDate){_2=isc.DateUtil.getEndOf(_2,_7,false,this.firstDayOfWeek)}
if(isc.DateUtil.compareLogicalDates(_1,_2)==0){if(_3.showWeekends==false&&_3.dateIsWeekend(_1)){_3.showWeekends=true;this.logWarn("showWeekends was automatically switched on because the dates provided for the timeline spanned less than one day and the day is a weekend.")}}
this.startDate=this.periodStartDate=_1.duplicate();this.endDate=this.periodEndDate=_2.duplicate();_3.startDate=_1.duplicate();_3.endDate=_2.duplicate();_3.setDateLabel();if(_3.$1737)_5=false;if(!this.isDrawn()){this.$251l=true}else{var _9=(this.autoFetchData||_3.$253z!=null);this.$152e(!_3.dataSource||_9)}});isc.evalBoundary;isc.B.push(isc.A.addUnits=function isc_TimelineView_addUnits(_1,_2,_3){_3=_3||this.calendar.timelineGranularity;if(_3=="century"){_1.setFullYear(_1.getFullYear()+(_2*100))}else if(_3=="decade"){_1.setFullYear(_1.getFullYear()+(_2*10))}else if(_3=="year"){_1.setFullYear(_1.getFullYear()+_2)}else if(_3=="quarter"){_1.setMonth(_1.getMonth()+(_2*3))}else if(_3=="month"){_1.setMonth(_1.getMonth()+_2)}else if(_3=="week"){_1.setDate(_1.getDate()+(_2*7))}else if(_3=="day"){_1.setDate(_1.getDate()+_2)}else if(_3=="hour"){_1.setHours(_1.getHours()+_2)}else if(_3=="minute"){_1.setMinutes(_1.getMinutes()+_2)}else if(_3=="second"){_1.setSeconds(_1.getSeconds()+_2)}else if(_3=="millisecond"){_1.setMilliseconds(_1.getMilliseconds()+_2)}
return _1},isc.A.getColFromDate=function isc_TimelineView_getColFromDate(_1,_2){var _3=this.frozenBody?this.body.fields:this.getFields(),_4=(_1&&_1.getTime)?_1.getTime():_1;if(_1){for(var i=0;i<_3.length;i++){var _6=_3[i],_7=_6&&_6.date?_6.date.getTime():null,_8=_6&&_6.endDate?_6.endDate.getTime():null;if(!_7||!_8)continue;if(_2){if(_4>=_7&&_4<_8){return i}}else{if(_7>=_4){return i}}}}
return null},isc.A.getFieldContainingDate=function isc_TimelineView_getFieldContainingDate(_1,_2){var _3=this.frozenBody?this.body.fields:this.getFields(),_4=(_1&&_1.getTime)?_1.getTime():_1;if(_4){if(_4<this.startDate.getTime())return _3[0];if(_4>=this.endDate.getTime()){return _2?null:_3[_3.length-1]}
for(var i=0;i<_3.length;i++){var _6=_3[i],_7=_6&&_6.date?_6.date.getTime():null,_8=_6&&_6.endDate?_6.endDate.getTime():null;if(_4>=_7&&_4<=_8){return _6}}}
return null},isc.A.calcFields=function isc_TimelineView_calcFields(){var _1=[],_2=this.calendar;if(this.showLaneFields!=false){var _3=this.shouldShowLaneFieldHovers();if(_2.laneFields){var _4=_2.laneFields;for(var i=0;i<_4.length;i++){var _6=isc.addProperties({},{hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,frozen:true,isLaneField:true,baseStyle:this.getLaneFieldStyleName(_4[i],{}),minWidth:this.labelColumnWidth,width:this.labelColumnWidth,canHover:_3,showHover:_3},_4[i]);_1.add(_6)}}else{var _7=isc.addProperties({autoFitWidth:true,width:this.labelColumnWidth,minWidth:this.labelColumnWidth,baseStyle:this.labelColumnBaseStyle,name:"title",title:" ",showTitle:false,frozen:true,isLaneField:true,hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,canHover:_3,showHover:_3});_1.add(_7)}}
if(!_2.headerLevels&&!this.headerLevels){_2.headerLevels=[{unit:_2.timelineGranularity}]}
if(_2.headerLevels){this.headerLevels=isc.shallowClone(_2.headerLevels)}
if(this.headerLevels){this.fieldHeaderLevel=this.headerLevels[this.headerLevels.length-1];if(this.fieldHeaderLevel.headerWidth!=null){}
this.headerLevels.remove(this.fieldHeaderLevel);_2.timelineGranularity=this.fieldHeaderLevel.unit;this.$27q.innerHeaderLevel=this.fieldHeaderLevel;this.$27q.granularity=_2.timelineGranularity}
this.adjustTimelineForHeaders();var _8=this.startDate.duplicate(),_9=this.endDate.duplicate(),_10=_2.timelineUnitsPerColumn,_11=0,_12=this.fieldHeaderLevel,_13=_12&&_12.titles?_12.titles:[];var _14=_9.getTime(),_15=this.columnWidth,_16=0,_17=_16+_15-1,_18=this.getTimePerCell("d"),_19=_18>1,_20;this.$178u=0;var _21=this.shouldShowCellHovers();var _22=_15;while(_8.getTime()<=_14){var _23=_8.duplicate(),_24=_19||_2.shouldShowDate(_8,this);_23=isc.DateUtil.getStartOf(_23,_2.timelineGranularity,false,this.firstDayOfWeek);if(_23.getTime()>=_14)break;this.$178u++;_20=isc.DateUtil.getEndOf(this.addUnits(_8.duplicate(),_10),_2.timelineGranularity,false,this.firstDayOfWeek);var _25=null;if(_20.getTime()>_14){_20.setTime(_14)}
if(_24){var _26=this.getInnerFieldTitle(_12,_11,_23);_25=isc.addProperties({},{name:"f"+_11,headerLevel:_12,title:_26,width:_12.headerWidth||_22,cellAlign:_12.cellAlign,cellVAlign:_12.cellVAlign,date:_23.duplicate(),logicalDate:isc.DateUtil.getLogicalDateOnly(_23),logicalTime:isc.DateUtil.getLogicalTimeOnly(_23),canGroup:false,canSort:false,canFreeze:false,canFocus:false,startLeftOffset:_16,endLeftOffset:_17,hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,canHover:_21,showHover:_21},this.getFieldProperties(_23));if(_2.shouldDisableDate(_23,this,_25.name)){_25.dateDisabled=true}}
_8=_20.duplicate();if(_24){_25.endDate=_8.duplicate();_25.endDate.setTime(_25.endDate.getTime()-1);_25.logicalEndDate=isc.DateUtil.getLogicalDateOnly(_8);_25.logicalEndTime=isc.DateUtil.getLogicalTimeOnly(_8),_1.add(_25);_11++;_16+=_15;_17+=_15}
if(_1.length>=this.maximumTimelineColumns){this.endDate=_8.duplicate();this.logWarn("Date-range too large - limiting to "+this.maximumTimelineColumns+" columns.");break}}
var _27={hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,canHover:true,getHoverHTML:function(){var _28=this.grid;if(!_28.shouldShowHeaderHovers())return;return _28.calendar.$140e(_28,_28.fieldHeaderLevel,this,this.date,this.endDate)}};for(var i=0,_29=_1.length;i<_29;i++){var _30=_1[i];isc.addProperties(_30,_27);_30.headerLevel=this.fieldHeaderLevel}
if(_12&&_12.headerWidth!=null){if(_12.headerWidth=="*"){if(this.isDrawn()&&this.isVisible()){this.$251k=this.body.getColumnWidth(0)}else{this.$251k=Math.floor(this.body.getWidth()/this.$178u)}}else if(isc.isA.Number(_12.headerWidth)){this.$251k=_12.headerWidth}}else{this.$251k=this.columnWidth}
this.buildHeaderSpans(_1,this.headerLevels,this.startDate,this.endDate);this.initCacheValues();this.$116z=_11-1;return _1},isc.A.redraw=function isc_TimelineView_redraw(){this.Super("redraw",arguments);if(!this.animateFolders&&this.$236z){delete this.$236z;this.laneHeightCache={};this.laneIndexCache={};this.delayedRefreshVisibleEvents()}},isc.A.toggleFolder=function isc_TimelineView_toggleFolder(_1){this.Super("toggleFolder",arguments);this.$236z=true;this.markForRedraw()},isc.A.rowAnimationComplete=function isc_TimelineView_rowAnimationComplete(_1,_2){this.Super("rowAnimationComplete",arguments);if(!this.$64v){delete this.body.$8s;this.refreshVisibleEvents()}},isc.A.adjustTimelineForHeaders=function isc_TimelineView_adjustTimelineForHeaders(){var _1=this.calendar,_2=this.fieldHeaderLevel?this.fieldHeaderLevel.unit:_1.timelineGranularity,_3=this.startDate,_4=new Date(this.endDate.getTime()-1);var _5=isc.DateUtil.getTimeUnitKey(_2);this.startDate=isc.DateUtil.getStartOf(_3,_5,false,this.firstDayOfWeek);this.endDate=isc.DateUtil.getEndOf(_4,_5,false,this.firstDayOfWeek)},isc.A.buildHeaderSpans=function isc_TimelineView_buildHeaderSpans(_1,_2,_3,_4){var _5=_3.duplicate(),c=this.calendar,_7=[],_8=[];if(_2&&_2.length>0){_8=this.getHeaderSpans(_3,_4,_2,0,_1);this.headerHeight=this.$963+(_2.length*this.headerSpanHeight)}
if(_8&&_8.length>0){this.setHeaderSpans(_8,true)}},isc.A.getHeaderSpans=function isc_TimelineView_getHeaderSpans(_1,_2,_3,_4,_5){var _6=_1.duplicate(),c=this.calendar,_8=_3[_4],_9=_8.unit,_10=isc.DateUtil.getTimeUnitKey(_9),_11=_4>0?_3[_4-1].unit:_9,_12=c.timelineUnitsPerColumn,_13=_8.titles||[],_14=[],_15=0;if(_4>0){if(isc.DateUtil.compareTimeUnits(_9,_11)==-1){isc.logWarn("The order of the specified HeaderLevels is incorrect - '"+_9+"' is of a larger granularity than '"+_11+"'")}}
var _16=isc.DateUtil;var _17=true;while(_6<=_2){_6=_16.dateAdd(_6,"mn",1,1);if(_17){_17=false;var _18=isc.DateUtil.getEndOf(_6,_10,false,c.firstDayOfWeek)}else{var _18=this.addUnits(_6.duplicate(),_12,_9)}
var _19={unit:_9,hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,canHover:true,canFocus:false,headerLevel:_8,getHoverHTML:function(){var _20=this.creator;if(!_20.shouldShowHeaderHovers())return;return _20.calendar.$140e(_20,this.headerLevel,this,this.startDate,this.endDate)}};_19.startDate=_6.duplicate();_19.endDate=_18.duplicate();this.setSpanDates(_19,_6.duplicate());_18=_19.endDate;var _21=this.getHeaderLevelTitle(_8,_15,_6,_18);_19.title=_21;_19.fields=[];for(var i=0;i<_5.length;i++){var _23=_5[i];if(_23.isLaneField||_23.date<_19.startDate)continue;if(_23.date>=_19.endDate)break;_23.headerLevel=_3[_4];_19.fields.add(_23.name)}
if(_4<_3.length-1){_19.spans=this.getHeaderSpans(_19.startDate,_19.endDate,_3,_4+1,_5);if(_19.spans&&_19.spans.length>0)_19.fields=null;if(_8.titles&&_8.titles.length!=_19.spans.length){isc.logWarn("The titles array provided for the "+_8.unit+" levelHeader has a length mismatch: expected "+_19.spans.length+" but "+_8.titles.length+" are present.  Some titles  may be auto-generated according to TimeUnit.")}}
_14.add(isc.clone(_19));_6=_18.duplicate();_15++}
return _14},isc.A.getHeaderLevelTitle=function isc_TimelineView_getHeaderLevelTitle(_1,_2,_3,_4){var _5=_1.unit,_6=_1.titles?_1.titles[_2]:null;if(!_6){if(_5=="century"||_5=="decade"){_6=_3.getFullYear()+" - "+_3.getFullYear()}else if(_5=="year"){_6=_3.getFullYear()}else if(_5=="quarter"){_6=_3.getShortMonthName()+" - "+_4.getShortMonthName()}else if(_5=="month"){_6=_3.getShortMonthName()}else if(_5=="week"){var _7=isc.DateUtil.getStartOf(_3,"W",false,this.calendar.firstDayOfWeek);_7.setDate(_7.getDate()+(_7.firstWeekIncludesDay-this.calendar.firstDayOfWeek));_6=this.calendar.weekPrefix+" "+_7.getWeek(this.calendar.firstDayOfWeek)}else if(_5=="day"){_6=_3.getShortDayName()}else{if(_5=="hour")_6=_3.getHours();if(_5=="minute")_6=_3.getMinutes();if(_5=="second")_6=_3.getSeconds();if(_5=="millisecond")_6=_3.getMilliseconds();if(_5=="hour")_6=_3.getHours()}
_6=""+_6;if(isc.isA.Function(_1.titleFormatter)){_6=_1.titleFormatter(_1,_3,_4,_6,this.calendar)}}
return _6},isc.A.setSpanDates=function isc_TimelineView_setSpanDates(_1,_2){var _3=isc.DateUtil.getTimeUnitKey(_1.unit);var _4=this.calendar;_1.startDate=isc.DateUtil.getStartOf(_2,_3,false,this.firstDayOfWeek);_1.endDate=isc.DateUtil.getEndOf(_1.startDate,_3,false,this.firstDayOfWeek)},isc.A.getFieldProperties=function isc_TimelineView_getFieldProperties(_1){return null},isc.A.getInnerFieldTitle=function isc_TimelineView_getInnerFieldTitle(_1,_2,_3,_4){var _5=_1.unit,_6=_1.titles?_1.titles[_2]:null;if(!_6){if(_5=="year"){_6=_3.getFullYear()}else if(_5=="month"){_6=_3.getShortMonthName()}else if(_5=="week"){var _7=isc.DateUtil.getStartOf(_3,"W",null,this.calendar.firstDayOfWeek);_7.setDate(_7.getDate()+(_7.firstWeekIncludesDay-this.calendar.firstDayOfWeek));_6=this.calendar.weekPrefix+" "+_7.getWeek(this.calendar.firstDayOfWeek)}else if(_5=="day"){var _8=isc.DateUtil.getInputFormat();if(isc.isA.String(_8)){_8=_8.replace("Y","");_8=_8.replace("D","d");_8=_8[0]+isc.DateUtil.getDefaultDateSeparator()+_8[1];_6=isc.DateUtil.format(_3,_8)}else{_6=(_3.getMonth()+1)+"/"+_3.getDate()}}else{var _9=isc.DateUtil.getLogicalTimeOnly(_3);_6=isc.Time.toShortTime(_9,this.calendar.timeFormatter)}
if(isc.isA.Function(_1.titleFormatter)){_6=_1.titleFormatter(_1,_3,_4,_6,this.calendar)}}
return _6},isc.A.refreshEventsForBodyResize=function isc_TimelineView_refreshEventsForBodyResize(){if(this.$251k!=this.body.$26a[0]&&this.isDrawn()&&this.isVisible()){this.$251k=this.body.$26a[0];this.clearEvents();this.initCacheValues();this.buildSnapGapList();this.delayedRefreshVisibleEvents()}},isc.A.draw=function isc_TimelineView_draw(_1,_2,_3,_4){this.invokeSuper(isc.TimelineView,"draw",_1,_2,_3,_4);if(!this.isObserving(this,"$45m")){this.observe(this,"$45m","observer.refreshEventsForBodyResize();")}
var _5=this.calendar;this.logDebug('draw','calendar');this.body.addChild(this.eventDragCanvas,null,false);this.eventDragCanvas.setView(this);if(this.$251l){delete this.$251l;this.$152e()}
if(this.$128r){delete this.$128r;this.delayCall("$116v",[true],100);this.$2905=true}
if(this.$222w){this.canGroupBy=true;this.groupByField=_5.laneGroupByField;if(_5.laneGroupStartOpen!=null)this.groupStartOpen=_5.laneGroupStartOpen;this.$236y=true;this.delayCall("groupBy",[this.groupByField],0)}
if(this.$191w){delete this.$191w;this.calendar.currentViewChanged(this.viewName)}},isc.A.groupByComplete=function isc_TimelineView_groupByComplete(){delete this.$222w;delete this.$236y;this.delayedRefreshVisibleEvents();return},isc.A.formatDateForDisplay=function isc_TimelineView_formatDateForDisplay(_1){return _1.getShortMonthName()+" "+_1.getDate()+", "+_1.getFullYear()},isc.A.getLabelColCount=function isc_TimelineView_getLabelColCount(){var _1=this.calendar,_2=1;if(_1.laneFields){_2=0;for(var i=0;i<_1.laneFields.length;i++){if(_1.laneFields[i].hidden!=true)_2++}}
return _2},isc.A.isLabelCol=function isc_TimelineView_isLabelCol(_1){var _2=this.getField(_1);return _2&&_2.frozen},isc.A.showField=function isc_TimelineView_showField(){this.Super("showField",arguments);this.refreshEvents("showField")},isc.A.hideField=function isc_TimelineView_hideField(){this.Super("hideField",arguments);this.refreshEvents("hideField")},isc.A.getLaneStyleName=function isc_TimelineView_getLaneStyleName(_1){if(_1&&_1.styleName)return _1.styleName},isc.A.getLaneFieldStyleName=function isc_TimelineView_getLaneFieldStyleName(_1,_2){if(_1&&_1.styleName)return _1.styleName;if(_2&&_2.fieldStyleName)return _2.fieldStyleName;return this.labelColumnBaseStyle},isc.A.getBaseStyle=function isc_TimelineView_getBaseStyle(_1,_2,_3){var _4=this.calendar;if(_1.$52e)return this.groupNodeBaseStyle;if(_1.fieldStyleName&&this.frozenFields){if(this.fieldIsFrozen(_3))return _1.fieldStyleName}
return this.Super("getBaseStyle",arguments)},isc.A.getCellStyle=function isc_TimelineView_getCellStyle(_1,_2,_3){var _4=this.calendar,_5=this.getField(_3),_6=this.getFieldBody(_3)||this.getBody(),_7=_2==_6.lastOverRow,_8=this.isSelected(_1),_9=this.isDisabled(),_10=(_5&&_5.date&&_4.shouldDisableDate(_5.date,this,_5.lane));var _11=this.getBaseStyle(_1,_2,_3);if(_9||(_10&&!_8)){_11+="Disabled"}
if(_8)_11+="Selected";if(_4.showLaneRollOver&&_7)_11+="Over";if(this.alternateRecordStyles&&_2%2!=0){_11+="Dark"}
return _11},isc.A.slideRange=function isc_TimelineView_slideRange(_1){var c=this.calendar,_3=this.timelineGranularity.toLowerCase(),_4=isc.DateUtil.getTimeUnitKey(_3),_5=this.timelineUnitsPerColumn||1,_6=this.startDate.duplicate(),_7=this.endDate.duplicate(),_8=_1?1:-1,_9=c.columnsPerPage||(this.getFields().length-this.getLabelColCount());_6=isc.DateUtil.dateAdd(_6,_4,_9*_5,_8,false,null,this.firstDayOfWeek);_6=isc.DateUtil.getStartOf(_6,_4,false,this.firstDayOfWeek);this.$2160=true;this.calendar.setChosenDate(_6);this.$116v();delete this.$2160},isc.A.nextOrPrev=function isc_TimelineView_nextOrPrev(_1){this.slideRange(_1)},isc.A.compareDates=function isc_TimelineView_compareDates(_1,_2,_3){if(_1.getFullYear()<_2.getFullYear()){return 1}else if(_1.getFullYear()>_2.getFullYear()){return-1}
if(_1.getMonth()<_2.getMonth()){return 1}else if(_1.getMonth()>_2.getMonth()){return-1}
if(_1.getDate()<_2.getDate()){return 1}else if(_1.getDate()>_2.getDate()){return-1}
return 0},isc.A.getDateFromPoint=function isc_TimelineView_getDateFromPoint(_1,_2,_3,_4){var _5=this.calendar;if(_1==null&&_2==null){_1=this.body.getOffsetX()}
var _6=this.getSnapData(_1,null,null,true);if(_6){if(_6.nextValidSnap){return _6.nextValidSnap[_5.startDateField].duplicate()}else if(_6.lastValidSnap){return _6.lastValidSnap[_5.endDateField].duplicate()}
return _6[_5.endDateField].duplicate()}
if(_1<0||_2<0)return null;var _7=this.body.getEventColumn(_1);if(_7==-2)_7=this.body.fields.length-1;if(_7==-1)return null;if(_4==null)_4=true;var _8=Math.max(_5.getSnapGapPixels(this),1);if(_4){var r=_1%_8;if(r)_1-=r}
var _10=this.body.fields[_7].date,_11=this.body.getColumnLeft(_7),_12=_1-_11,_13=Math.floor(_12/_8);if(_13)_10=_5.addSnapGapsToDate(_10.duplicate(),this,_13);return _10},isc.A.$732=function isc_TimelineView__getEventBreadth(_1,_2){var _3=_1&&_1["_"+this.viewName];if(_3){if(_2&&_3.exactBreadth)return _3.exactBreadth;if(!_2&&_3.snapBreadth)return _3.snapBreadth}
var _4=this.calendar,_5=_4.getEventStartDate(_1),_6=_4.getEventEndDate(_1),_7=_4.getVisibleStartDate(this),_8=isc.DateUtil.adjustDate(_4.getVisibleEndDate(this),"-1ms");;if(_5.getTime()<_7.getTime())_5=_7;if(_6.getTime()>_8.getTime())_6=_8;var _9=this.getDateLeftOffset(_5,null,_2),_10=this.getDateRightOffset(_6,_2),_11=_10-_9;if(_3){if(_2)_3.exactBreadth=_11;else _3.snapBreadth=_11}
return _11},isc.A.getDateRightOffset=function isc_TimelineView_getDateRightOffset(_1,_2){if(!_1)return 0;var _3=_1.getTime(),_4=this.getSnapData(null,null,_1,true);var _5=0;if(_4){if(_3==_4.startMillis&&_4.index>0){_5=_4.startLeftOffset}else if(_4.lastValidSnap){_5=_4.lastValidSnap.endLeftOffset}else _5=_4.endLeftOffset}
return _5},isc.A.getDateLeftOffset=function isc_TimelineView_getDateLeftOffset(_1,_2,_3){if(!_1)return 0;var _4=this.getSnapData(null,null,_1,true);if(_4){if(_4.nextValidSnap){return _4.nextValidSnap.startLeftOffset}else if(_4.lastValidSnap){return _4.lastValidSnap.endLeftOffset}
return _4.startLeftOffset}
var _5=this.calendar.getVisibleStartDate(this).getTime();var _6=this.calendar.getVisibleEndDate(this).getTime();var _7=isc.isA.Number(_1)?_1:_1.getTime();if(_7<=_5)_7=_5+1;if(_7>=_6)_7=_6;var _8=this.calendar,_9=_8.getSnapGapPixels(this),_10=_8.getSnapGapMinutes(this);var _11=this.body.fields,_12=_11.getLength(),_13=Math.floor(_7/60000),_14=this.body.getColumnWidth(0),_15=this.getTimePerCell("mn");for(var i=0;i<_12;i++){var _17=_11[i];var _18=_17.date.getTime(),_19=_17.endDate.getTime(),_20=Math.floor(_17.date.getTime()/60000),_21=Math.floor(_17.endDate.getTime()/60000);if(_13==_21){return this.body.getColumnLeft(i)+_14}else if(_13<_21){if(_13==_20){return this.body.getColumnLeft(i)}else if(_13>_20){var _22=(_14*i),_23=_13-_20,_24=Math.floor(_23/_10),_25=_23%_10;if(_2){if(_25>0||_23<_10)_24++}
var _26=_22+Math.round((_24*_9));if(_3)_26+=Math.round(_8.getMinutePixels(_25,null,this));return _26}else{return(_14*i)}}}
return-1},isc.A.getEventLeft=function isc_TimelineView_getEventLeft(_1){return this.getDateLeftOffset(this.calendar.getEventStartDate(_1))},isc.A.getEventRight=function isc_TimelineView_getEventRight(_1){return this.getDateRightOffset(this.calendar.getEventEndDate(_1))},isc.A.getLaneHeight=function isc_TimelineView_getLaneHeight(_1){var _2=isc.isA.String(_1)?_1:(isc.isAn.Object(_1)?_1.name:null);var _3=(_1&&_1.height)||this.cellHeight;if(!_2){if(isc.isA.Number(_1))_1=this.getRecord(_1);if(_1){_2=_1.name;if(_1.height!=null)_3=_1.height;_1=null}}
var _4=this.laneHeightCache[_2];if(_4==null){this.laneHeightCache[_2]=_3}
return this.laneHeightCache[_2]},isc.A.getSublaneHeight=function isc_TimelineView_getSublaneHeight(_1,_2){if(!isc.isAn.Object(_1)){if(!_2||!_2.sublanes)return null;if(isc.isA.Number(_1))_1=_2.sublanes[_1];else if(isc.isA.String(_1)){_1=_2.sublanes.find(this.calendar.laneNameField,_1)}}
return _1?_1.height:null},isc.A.getEditDialogPosition=function isc_TimelineView_getEditDialogPosition(_1){var _2=this.calendar,_3=this.getColFromDate(_2.getEventStartDate(_1),_1[_2.laneNameField]),_4=this.getEventLaneIndex(_1),_5=this.body.getCellPageRect(_4,_3);return{left:Math.max(_5[0],this.body.getPageLeft()),top:Math.max(_5[1],this.body.getPageTop())}});isc.B._maxIndex=isc.C+82;isc.A=isc.DaySchedule;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.$126v=function isc_c_DaySchedule__getEventScaffolding(_1){var _2=_1.getTimePerCell(),_3=(60/_2)*24,_4=[],_5={label:"",day1:"",day2:"",day3:"",day4:"",day5:"",day6:"",day7:""};isc.DaySchedule.$129g(_1);var _6=_1.logicalDate.duplicate(),_7=isc.DateUtil.createLogicalTime(0,0,0);for(var i=0;i<_3;i++){var _9=isc.DateUtil.combineLogicalDateAndTime(_6,_7);var _10=_4.add(isc.addProperties({},_5));_10.time=_9.duplicate();_10.logicalTime=_7.duplicate();_10.logicalDate=_6.duplicate();_7.setMinutes(_7.getMinutes()+_2)}
return _4},isc.A.$129g=function isc_c_DaySchedule__getCellDates(_1){var _2=_1.startDate||new Date();var _3=_1.getTimePerCell(),_4=(60/_3)*24,_5=_1.isDayView()?1:7,_6=[];var _7=_1.logicalDate.duplicate();var _8=isc.DateUtil.createDatetime(_7.getFullYear(),_7.getMonth(),_7.getDate(),0,0,0,0);_1.$142y=null;for(var j=0;j<_5;j++){var _10=_8.duplicate();for(var i=0;i<_4;i++){if(j==_5-1&&i==_4)break;if(!_6[i])_6[i]={};_6[i]["day"+(j+1)]=_10.duplicate();_6[i].logicalTime=isc.DateUtil.getLogicalTimeOnly(_10);var _12=_3*(i+1);var _13=isc.DateUtil.dateAdd(_8,"mn",_12,1);var _14=isc.DateUtil.getLogicalTimeOnly(_13,true);_14.setTime(_14.getTime()+(_12*60000));_6[i]["day"+(j+1)+"_end"]=isc.DateUtil.dateAdd(_13,"ms",-1);_6[i].logicalEndTime=isc.DateUtil.getLogicalTimeOnly(_6[i]["day"+(j+1)+"_end"]);var _15=_10.getDate(),_16=_13.getDate(),_17=_14.getHours(),_18=_14.getMinutes(),_19=isc.Date.getLogicalTimeOnly(_13,true),_20=_19.getHours(),_21=_19.getMinutes();_1.calendar.ignoreDST=true;if(_1.calendar.ignoreDST){_10=_13.duplicate()}else{if(_17!=_20||_18!=_21){if(!_1.$142y)_1.$142y=[];_1.$142y.add({rowNum:i+1,colNum:j})}else{_10=_13.duplicate()}}
_6[i]["day"+(j+1)+"$220o"]=_7.duplicate()}
_8=isc.DateUtil.dateAdd(_8,"d",1);_7=isc.DateUtil.dateAdd(_7,"d",1)}
_1.$129f=_6;return _6});isc.B._maxIndex=isc.C+2;isc.ClassFactory.defineClass("Calendar","Canvas","DataBoundComponent");isc.A=isc.Calendar.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.defaultWidth="100%";isc.A.defaultHeight="100%";isc.A.overflow="hidden";isc.A.year=new Date().getFullYear();isc.A.month=new Date().getMonth();isc.A.hoverMoveWithMouse=true;isc.A.hoverAutoFitWidth=true;isc.A.hoverAutoFitMaxWidth=300;isc.A.baseStyle="calendar";isc.A.dayHeaderBaseStyle="calMonthDayHeader";isc.A.dayBodyBaseStyle="calMonthDayBody";isc.A.otherDayHeaderBaseStyle="calMonthOtherDayHeader";isc.A.otherDayBodyBaseStyle="calMonthOtherDayBody";isc.A.otherDayBlankStyle="calMonthOtherDayBlank";isc.A.minimumDayHeight=80;isc.A.monthDayHeaderHeight=20;isc.A.showDayView=true;isc.A.showWeekView=true;isc.A.showMonthView=true;isc.A.selectedCellStyle="calendarCellSelected";isc.A.eventStyleName="eventWindow";isc.A.calMonthEventLinkStyle="calMonthEventLink";isc.A.workdayBaseStyle="calendarWorkday";isc.A.workdayStart="9:00am";isc.A.workdayEnd="5:00pm";isc.A.showWorkday=false;isc.A.styleWorkday=true;isc.A.workdays=[1,2,3,4,5];isc.A.scrollToWorkday=false;isc.A.sizeToWorkday=false;isc.A.limitToWorkday=false;isc.A.minutesPerRow=30;isc.A.rowTitleFrequency=60;isc.A.nameField="name";isc.A.descriptionField="description";isc.A.startDateField="startDate";isc.A.endDateField="endDate";isc.A.durationField="duration";isc.A.durationUnitField="durationUnit";isc.A.laneNameField="lane";isc.A.allDayField="allDay";isc.A.sublaneNameField="sublane";isc.A.leadingDateField="leadingDate";isc.A.trailingDateField="trailingDate";isc.A.labelColumnWidth=60;isc.A.autoFitLabelColumn=false;isc.A.showLabelColumn=true;isc.A.eventWindowStyleField="eventWindowStyle";isc.A.eventStyleNameField="styleName";isc.A.canEditField="canEdit";isc.A.canEditLaneField="canEditLane";isc.A.canEditSublaneField="canEditSublane";isc.A.canRemoveField="canRemove";isc.A.canDragEventField="canDrag";isc.A.canResizeEventField="canResize";isc.A.durationUnitOptions=["minute","hour","day","week"];isc.A.laneEventPadding=0;isc.A.eventDragGap=10;isc.A.weekEventBorderOverlap=false;isc.A.showQuickEventDialog=true;isc.A.eventEditorDateFieldTitle="Date";isc.A.canCreateEvents=true;isc.A.canEditEvents=true;isc.A.canRemoveEvents=true;isc.A.canDragEvents=null;isc.A.canResizeEvents=true;isc.A.showDateChooser=false;isc.A.disableWeekends=true;isc.A.showWeekends=true;isc.A.showDayHeaders=true;isc.A.showOtherDays=true;isc.A.fixedMonths=false;isc.A.otherDayClickNavigation=true;isc.A.canCreateOtherDayEvents=false;isc.A.selectChosenDate=true;isc.A.eventAutoArrange=true;isc.A.eventOverlap=true;isc.A.eventOverlapPercent=10;isc.A.minimalUI=null;isc.A.canDragCreateEvents=null;isc.A.alternateLaneFrequency=1;isc.A.dataFetchMode="basic";isc.A.showTimelineView=false;isc.A.renderEventsOnDemand=true;isc.A.timelineGranularity="day";isc.A.timelineUnitsPerColumn=1;isc.A.canResizeTimelineEvents=false;isc.A.defaultTimelineColumnSpan=20;isc.A.weekPrefix="Week";isc.A.hoverDelay=0;isc.A.laneGroupStartOpen="first";isc.A.showEventDescriptions=true;isc.A.showEventHeaders=true;isc.A.eventHeaderWrap=true;isc.A.eventHeaderHeight=14;isc.A.allowEventOverlap=true;isc.A.sizeEventsToGrid=true;isc.A.dayViewTitle="Day";isc.A.weekViewTitle="Week";isc.A.monthViewTitle="Month";isc.A.timelineViewTitle="Timeline";isc.A.eventNameFieldTitle="Event Name";isc.A.eventStartDateFieldTitle="From";isc.A.eventEndDateFieldTitle="To";isc.A.eventDescriptionFieldTitle="Description";isc.A.eventLaneFieldTitle="Lane";isc.A.eventSublaneFieldTitle="Sublane";isc.A.eventDurationFieldTitle="Duration";isc.A.eventDurationUnitFieldTitle="&nbsp;";isc.A.eventAllDayFieldTitle="All Day";isc.A.saveButtonTitle="Save Event";isc.A.detailsButtonTitle="Edit Details";isc.A.removeButtonTitle="Remove Event";isc.A.cancelButtonTitle="Cancel";isc.A.monthButtonTitle="${monthName}";isc.A.monthButtonIconSrc="Chevron_Left";isc.A.monthMoreEventsLinkTitle="+ ${eventCount} more...";isc.A.backButtonTitle="Back";isc.A.backButtonIconSrc="Chevron_Left";isc.A.previousButtonHoverText="Previous";isc.A.nextButtonHoverText="Next";isc.A.addEventButtonHoverText="Add an event";isc.A.datePickerHoverText="Choose a date";isc.A.invalidDateMessage="From must be before To";isc.A.showEventEditorErrorsInline=true;isc.A.dayViewConstructor="DaySchedule";isc.A.weekViewConstructor="WeekSchedule";isc.A.monthViewConstructor="MonthSchedule";isc.A.timelineViewConstructor="TimelineView";isc.A.mainViewDefaults={_constructor:isc.TabSet,defaultWidth:"80%",defaultHeight:"100%",tabBarAlign:"right",selectedTab:1};isc.A.dateChooserConstructor="DateChooser";isc.A.dateChooserDefaults={left:0,top:-9999,autoDraw:false,visibility:"hidden",autoHide:true,showCancelButton:true,closeOnEscapeKeypress:true};isc.A.eventDialogConstructor="Window";isc.A.eventDialogDefaults={showHeaderIcon:false,showMinimizeButton:false,showMaximumButton:false,canDragReposition:true,overflow:"visible",bodyProperties:{overflow:"visible"},keepInParentRect:true,maxWidth:400,height:100,visibility:"hidden",autoDraw:false};isc.A.eventEditorLayoutConstructor="Window";isc.A.eventEditorLayoutDefaults={showHeaderIcon:false,showShadow:false,showMinimizeButton:false,showMaximumButton:false,canDragReposition:false,dismissOnEscape:true,visibility:"hidden",autoDraw:false};isc.A.eventEditorConstructor="DynamicForm";isc.A.eventEditorDefaults={padding:4,numCols:9,colWidths:[80,40,80,80,80,80,"*","*","*"],width:"100%",titleWidth:80,wrapItemTitles:false,validateOnExit:true,autoDraw:false};isc.A.eventEditorButtonLayoutConstructor="HLayout";isc.A.eventEditorButtonLayoutDefaults={width:"100%",height:"100%",membersMargin:5,layoutMargin:10};isc.A.saveButtonConstructor="IButton";isc.A.saveButtonDefaults={autoFit:true,click:function(){this.calendar.addEventOrUpdateEventFields()}};isc.A.removeButtonConstructor="IButton";isc.A.removeButtonDefaults={autoFit:true,click:function(){var _1=this.calendar;if(_1.eventRemoveClick(_1.eventEditorLayout.event,_1.getCurrentViewName())!=false){_1.removeEvent(_1.eventEditorLayout.event)}
_1.hideEventEditor()}};isc.A.cancelButtonConstructor="IButton";isc.A.cancelButtonDefaults={autoFit:true,click:function(){this.calendar.hideEventEditor()}};isc.A.addEventButtonConstructor="ImgButton";isc.A.addEventButtonDefaults={title:"",src:"[SKINIMG]actions/add.png",showRollOver:false,showDown:false,showFocused:false,autoDraw:false};isc.A.datePickerButtonConstructor="ImgButton";isc.A.datePickerButtonDefaults={title:"",src:"[SKIN]/controls/date_control.gif",showRollOver:false,showFocused:false,autoDraw:false};isc.A.controlBarIconSize=16;isc.A.controlBarIconBaseStyle="icon";isc.A.controlsBarHeight=34;isc.A.showControlsBar=true;isc.A.controlsBarConstructor="HLayout";isc.A.controlsBarDefaults={defaultLayoutAlign:"center",layoutAlign:"center",width:1,height:1,overflow:"visible",autoDraw:false,membersMargin:5};isc.A.monthButtonConstructor="NavigationButton";isc.A.monthButtonDefaults={padding:8,iconAlign:"left",click:function(){var _1=this.creator,_2=_1.getCurrentViewName();if(_2!="month"){this.previousViewName=_2;this.creator.setCurrentViewName("month");_1.updateMonthButton()}else{this.creator.setCurrentViewName(this.previousViewName);delete this.previousViewName;_1.updateMonthButton()}}};isc.A.previousButtonConstructor="ImgButton";isc.A.previousButtonDefaults={title:"",src:"[SKINIMG]actions/back.png",showFocused:false,width:16,height:16,click:function(){this.creator.previous()},showRollOver:false,showDown:false};isc.A.nextButtonConstructor="ImgButton";isc.A.nextButtonDefaults={title:"",src:"[SKINIMG]actions/forward.png",showFocused:false,width:16,height:16,click:function(){this.creator.next()},showRollOver:false,showDown:false};isc.A.dateLabelConstructor="Label";isc.A.dateLabelDefaults={wrap:false,width:5,contents:"-"};isc.A.dateLabelStyleName=null;isc.A.DAY="day";isc.A.WEEK="week";isc.A.MONTH="month";isc.A.TIMELINE="timeline";isc.A.rowHeight=isc.ListGrid.getInstanceProperty("cellHeight");isc.A.minRowHeight=isc.ListGrid.getInstanceProperty("cellHeight");isc.A.$1716=null;isc.A.zeroLengthEventSize=2;isc.A.$1290="mn";isc.A.dateFormatter=null;isc.A.timeFormatter=null;isc.A.alwaysShowEventHovers=true;isc.A.showIndicatorsInFront=true;isc.A.showCellHovers=false;isc.A.showHeaderHovers=false;isc.A.showViewHovers=true;isc.A.showEventHovers=true;isc.A.showZoneHovers=true;isc.A.showLaneFieldHovers=false;isc.A.showDragHovers=false;isc.A.eventCanvasConstructor="EventCanvas";isc.A.eventCanvasDefaults={autoDraw:false,visibility:"hidden",_redrawWithParent:false};isc.A.showEventCanvasComponents=false;isc.A.eventCanvasComponentConstructor="DetailViewer";isc.A.eventCanvasComponentDefaults={colWidths:[100,"*"],getHoverHTML:function(){return this.creator.getHoverHTML()},handleClick:function(){return isc.EH.STOP_BUBBLING}};isc.A.eventScreenPlaceholderDefaults={_constructor:isc.Label,autoDraw:false,border:"1px solid red",contents:"eventScreen<br>Placeholder",align:"center"};isc.A.eventCanvasContextMenuConstructor="Menu";isc.A.eventCanvasContextMenuStyle="eventWindowContextMenu";isc.A.eventCanvasContextMenuDefaults={};isc.A.useEventCanvasRolloverControls=true;isc.A.eventCanvasGripperConstructor="Img";isc.A.eventCanvasGripperDefaults={width:11,height:10,padding:0,margin:0,overflow:"visible",imageType:"center",autoDraw:false,visibility:"hidden",showDown:false,showOver:false,showRollOver:false,canDrag:true,layoutAlign:"center",cursor:isc.Canvas.MOVE};isc.A.eventCanvasGripperIcon="[SKIN]/Calendar/gripper.png";isc.A.eventCanvasLabelConstructor="Label";isc.A.eventCanvasLabelDefaults={height:1,width:1,autoSize:true,wrap:false,overflow:"visible",autoDraw:false,visibility:"hidden",padding:2,minWidth:40,maxWidth:150,showOver:false,showDown:false,showRollOver:true,layoutAlign:"center",click:function(){},isEventCanvasLabel:true};isc.A.eventCanvasButtonLayoutConstructor="HLayout";isc.A.eventCanvasButtonLayoutDefaults={width:1,height:1,overflow:"visible",autoDraw:false,snapTo:"TR",membersMargin:1,layoutTopMargin:3,layoutRightMargin:3,mouseOver:function(){return isc.EH.STOP_BUBBLING}};isc.A.eventCanvasCloseButtonSize=16;isc.A.eventCanvasCloseIconSize=13;isc.A.eventCanvasCloseButtonConstructor="ImgButton";isc.A.eventCanvasCloseButtonDefaults={autoDraw:false,visibility:"hidden",showDown:false,showRollOver:true,layoutAlign:"center",imageType:"center",src:"[SKIN]/headerIcons/close.png",baseStyle:"eventCanvasCloseButton",click:function(){var _1=this.eventCanvas;this.creator.$174b(_1);return false}};isc.A.eventCanvasContextButtonConstructor="ImgButton";isc.A.eventCanvasContextButtonDefaults={width:11,height:10,autoDraw:false,visibility:"hidden",showDown:false,showRollOver:true,layoutAlign:"left",src:"[SKIN]/headerIcons/arrow_down.png",click:function(){this.creator.$1700(this.eventCanvas);return false}};isc.A.eventCanvasVResizerConstructor="Img";isc.A.eventCanvasVResizerDefaults={width:12,height:6,overflow:"hidden",src:"[SKIN]/Window/v_resizer.png",autoDraw:false,visibility:"hidden",cursor:isc.Canvas.ROW_RESIZE,canDragResize:true};isc.A.eventCanvasHResizerConstructor="Img";isc.A.eventCanvasHResizerDefaults={width:6,height:12,overflow:"hidden",src:"[SKIN]/Window/h_resizer.png",autoDraw:false,visibility:"hidden",cursor:isc.Canvas.COL_RESIZE,canDragResize:true};isc.A.zoneStyleName="zoneCanvas";isc.A.zoneCanvasConstructor="ZoneCanvas";isc.A.zoneTitleOrientation="bottom";isc.A.indicatorStyleName="indicatorCanvas";isc.A.indicatorCanvasConstructor="IndicatorCanvas";isc.A.showColumnLayouts=false;isc.A.columnLayoutDefaults={_constructor:"VLayout",height:"100%",overflow:"auto",styleName:"calendarColumnLayout",border:null,canDrag:false,canDragReposition:false,canDragResize:false,mouseDown:function(){var _1=this.creator;if(_1.canCreateEvents){var _2=this.calendarView.getFieldByName(this.fieldName);var _3=_1.createEventObject({},_2.startDate,_2.endDate);this.creator.showNewEventDialog(_3);return isc.EH.STOP_BUBBLING}},canDragReorder:false,canAcceptDrop:true,canDropComponents:false,showDragPlaceHolder:false,dropTypes:["EventCanvas"],drop:function(){var _1=this.calendar;var _2=isc.EH.dragTarget;if(!_2)return;var _3=this.calendarView.getFieldByName(this.fieldName),_4=isc.DateUtil.getLogicalTimeOnly(_1.getEventStartDate(_2.event)),_5=isc.DateUtil.getLogicalTimeOnly(_1.getEventEndDate(_2.event)),_6=isc.DateUtil.combineLogicalDateAndTime(_3.date,_4),_7=isc.DateUtil.combineLogicalDateAndTime(_3.date,_5);var _8=_1.createEventObject(_2.event,_6,_7)
_2.sortValue=_6.duplicate();this.calendar.updateCalendarEvent(_2.event,_8,null,"mouse");this.addMember(_2);this.hideDropLine();return isc.EH.STOP_BUBBLING},getDropPosition:function(){var _1=this.calendar;var _2=isc.EH.getDragTarget();var _3=_2.event;var _4=_3&&isc.DateUtil.getLogicalTimeOnly(_3[_1.startDateField]);if(_4){for(var i=0;i<this.members.length;i++){var _6=this.members[i].event;var _7=_6&&isc.DateUtil.getLogicalTimeOnly(_6[_1.startDateField]);if(isc.DateUtil.compareDates(_4,_7)>0){break}}
return Math.max(i,0)}
return this.Super("getDropPosition",arguments)},addMember:function(_1){var _2=_1.event&&_1.event[this.calendar.startDateField];if(_2)_1.sortValue=_2.duplicate();else _1.sortValue=null;return this.Super("addMember",arguments)},resort:function(){var _1=this.calendar;this.members.setSort([{property:"sortValue",direction:"ascending"}]);this.reflowNow()},getPrintHTML:function(_1,_2){if(_2){this.delayCall("asyncGetPrintHTML",[_1,_2]);return null}else{return this.asyncGetPrintHTML(_1,_2)}},asyncGetPrintHTML:function(_1,_2){return this.getHandle().innerHTML}};isc.A.eventsOverlapGridLines=true;isc.A.includeRangeCriteria=true;isc.A.allowLongEvents=true;isc.A.newLongEventName="New Event";isc.A.longEventLayoutStyleName="longEventLayout";isc.A.dragGhostSpace=10;isc.A.dragGhostSpaceVAlign="top";isc.A.dragGhostHeight=4;isc.A.dragGhostVAlign="center";isc.A.longEventDragOpacity=30;isc.A.longEventHeight=20;isc.A.minLaneHeight=40;isc.A.longEventSpace=1;isc.A.longEventStyleName="longEvent";isc.A.eventEditorButtons=["saveButton","removeButton","cancelButton"];isc.A.newEventWindowTitle="New Event";isc.A.monthMoreEventsMenuConstructor="Menu";isc.A.monthMoreEventsMenuDefaults={autoDraw:false,visibility:"hidden",keepInParentRect:true};isc.B.push(isc.A.getMinutesPerRow=function isc_Calendar_getMinutesPerRow(_1){_1=_1||this.getSelectedView();if(_1&&_1.verticalEvents)return _1.getTimePerCell("mn");return null},isc.A.getMinutesPerCol=function isc_Calendar_getMinutesPerCol(_1){_1=_1||this.getSelectedView();if(_1&&!_1.verticalEvents)return _1.getTimePerCell("mn");return null},isc.A.getSnapGapMinutes=function isc_Calendar_getSnapGapMinutes(_1,_2,_3){_1=_1||this.getSelectedView();if(_1)return _1.getTimePerSnapGap("mn")},isc.A.getSnapGapPixels=function isc_Calendar_getSnapGapPixels(_1,_2,_3){_1=_1||this.getSelectedView();if(_1.$171x||_1.$27q.snapGapPixels==null||isNaN(_1.$27q.snapGapPixels)){if(_2==null)_2=0;if(_3==null)_3=0;var _4=_1&&_1.verticalEvents==false,_5=this.getSnapGapMinutes(_1,_2,_3),_6=_1.getTimePerCell(),_7;if(_1&&_1.body){_7=_4?_1.body.getColumnWidth(_3):_1.getRowHeight(_1.getRecord(_2),_2)}else{if(_4){var _8=_1&&_1.fieldHeaderLevel;var _9=this.getFieldWidth(_3);_7=_9||(_1&&_1.columnWidth)}else _7=this.rowHeight}
var _10=_7/((_6/_5));delete _1.$171x;_1.$27q.snapGapPixels=Math.max(_10,1)}
return _1.$27q.snapGapPixels},isc.A.addSnapGapsToDate=function isc_Calendar_addSnapGapsToDate(_1,_2,_3){if(!_1)return null;if(_3==0)return _1.duplicate();_2=_2||this.getSelectedView();if(_3==null)_3=1;var _4=this.getSnapGapMinutes(_2),_5=(_4*_3)*60000,_6=_1.duplicate();if(_4==1440)_6.setDate(_6.getDate()+_3);else _6.setTime(_6.getTime()+_5);return _6},isc.A.getRowsPerHour=function isc_Calendar_getRowsPerHour(_1){_1=_1||this.getSelectedView();return Math.floor(60/_1.getTimePerCell("mn"))},isc.A.getRowFromDate=function isc_Calendar_getRowFromDate(_1,_2){var _3=_1.getTimePerCell("mn"),_4=this.getRowsPerHour(_1),_5=Math.floor(_2.getMinutes()/_3),_6=(_2.getMinutes()%_3==0?0:1),_7=(_2.getHours()*_4)+_5+_6;return _7},isc.A.getMinutePixels=function isc_Calendar_getMinutePixels(_1,_2,_3){_3=_3||this.getSelectedView();if(_3.isTimelineView()){var _4=_3.getTimePerCell()/_3.columnWidth;return Math.round(_1/_4)}else if(_3.isDayView()||_3.isWeekView()){var _5=(_2!=null?_2:_3.getRowHeight(_3.getRecord(0),0))*
this.getRowsPerHour(_3);return Math.round((_5/60)*_1)}},isc.A.scrollToTime=function isc_Calendar_scrollToTime(_1,_2){if(!this.isDrawn()){this.$187g=_1;return}
_2=_2||this.getSelectedView();_1=isc.Time.parseInput(_1);if(isc.isA.Date(_1)){var _3=this.getRowFromDate(_2,_1);var _4=_2.getRowHeight(_2.getRecord(0),0)*_3;_2.body.scrollTo(0,_4);_2.redraw()}},isc.A.scrollToStart=function isc_Calendar_scrollToStart(_1){_1=_1||this.getSelectedView();if(_1)_1.scrollToStart()},isc.A.scrollToEnd=function isc_Calendar_scrollToEnd(_1){_1=_1||this.getSelectedView();if(_1)_1.scrollToEnd()},isc.A.moveToEvent=function isc_Calendar_moveToEvent(_1,_2){_2=_2||this.getSelectedView();this.setChosenDate(this.getEventStartDate(_1))},isc.A.scrollToEvent=function isc_Calendar_scrollToEvent(_1,_2,_3){_3=_3||this.getSelectedView();if(_2!=false&&!_3.canScrollToEvent(_1)){_3.$222f=_1;this.setChosenDate(this.getEventStartDate(_1));return}
_3.scrollToEvent(_1)},isc.A.setHideUnusedLanes=function isc_Calendar_setHideUnusedLanes(_1){this.hideUnusedLanes=_1;if(this.dayView&&this.showDayLanes)this.dayView.refreshEvents("setHideUnusedLanes");if(this.timelineView)this.timelineView.refreshEvents("setHideUnusedLanes")},isc.A.getDurationUnitMap=function isc_Calendar_getDurationUnitMap(){var _1=this.durationUnitOptions,_2=isc.DateUtil,_3={};for(var i=0;i<_1.length;i++){_3[_2.getTimeUnitKey(_1[i])]=_2.getTimeUnitTitle(_1[i])+"s"}
return _3},isc.A.setHeaderLevels=function isc_Calendar_setHeaderLevels(_1){this.headerLevels=_1;if(this.timelineView)this.timelineView.rebuild(true)},isc.A.dateIsWeekend=function isc_Calendar_dateIsWeekend(_1){var _2=isc.DateUtil.getLogicalDateOnly(_1);return this.getWeekendDays().contains(_2.getDay())},isc.A.getWeekendDays=function isc_Calendar_getWeekendDays(){return this.weekendDays},isc.A.shouldDisableDate=function isc_Calendar_shouldDisableDate(_1,_2,_3){if(!_1)return false;if(!this.disableWeekends||_3)return false;_2=_2||this.getSelectedView();if(_2.isTimelineView()){if(isc.DateUtil.compareTimeUnits("day",this.timelineGranularity)==1){return false}}
var _4=isc.DateUtil.getLogicalDateOnly(_1);if(this.dateIsWeekend(_4))return true;return false},isc.A.shouldShowDate=function isc_Calendar_shouldShowDate(_1,_2){_2=_2||this.getSelectedView();if(_2.isTimelineView()){if(!this.showWeekends&&this.dateIsWeekend(_1))return false}
return true},isc.A.shouldShowLane=function isc_Calendar_shouldShowLane(_1,_2){_2=_2||this.getSelectedView();if(this.hideUnusedLanes&&!this.laneHasVisibleEvents(_1)){return false}
return true},isc.A.shouldShowEvent=function isc_Calendar_shouldShowEvent(_1,_2){return true},isc.A.getWorkdayStart=function isc_Calendar_getWorkdayStart(_1,_2){return this.workdayStart},isc.A.getWorkdayEnd=function isc_Calendar_getWorkdayEnd(_1,_2){return this.workdayEnd},isc.A.getWorkdayRange=function isc_Calendar_getWorkdayRange(_1,_2){var _3={start:isc.Time.parseInput(this.getWorkdayStart(_1||this.chosenDate)),end:isc.Time.parseInput(this.getWorkdayEnd(_1||this.chosenDate))};return _3},isc.A.getVisibleStartDate=function isc_Calendar_getVisibleStartDate(_1){_1=_1||this.getSelectedView();if(!_1||isc.isAn.emptyString(_1))return null;if((_1.body&&_1.bodies.length>1))return _1.getCellDate(0,0);return _1.startDate},isc.A.getVisibleEndDate=function isc_Calendar_getVisibleEndDate(_1){_1=_1||this.getSelectedView();if(!_1||isc.isAn.emptyString(_1))return null;if(!_1.body||(_1.bodies.length==1&&!_1.isMonthView()))return _1.endDate;return _1.endDate},isc.A.getPeriodStartDate=function isc_Calendar_getPeriodStartDate(_1){_1=_1||this.getSelectedView();if(_1)return _1.getPeriodStartDate()},isc.A.getPeriodEndDate=function isc_Calendar_getPeriodEndDate(_1){_1=_1||this.getSelectedView();if(_1)return _1.getPeriodEndDate()},isc.A.groupLanesBy=function isc_Calendar_groupLanesBy(_1){if(this.timelineView){this.timelineView.groupBy(_1)}},isc.A.setLanes=function isc_Calendar_setLanes(_1,_2){if(!_1){return}
this.checkLaneNames(_1);this.lanes=_1;if(this.timelineView){this.timelineView.setLanes(this.lanes,_2)}
if(this.showDayLanes&&this.dayView){this.dayView.setLanes(this.lanes,_2)}},isc.A.checkLaneNames=function isc_Calendar_checkLaneNames(_1){if(!_1||_1.length==0)return;var _2=this;if(_2.laneNameField&&_2.laneNameField!="name"){_1.map(function(_3){if(!_3.name&&_3[_2.laneNameField]){_2.logInfo("No lane.name provided - mapping to laneNameField ("+_2.laneNameField+") - lane.name is now '"+_3[_2.laneNameField]+"'");_3.name=_3[_2.laneNameField]}})}},isc.A.addLane=function isc_Calendar_addLane(_1,_2){var _3;if(this.timelineViewSelected()){_3=this.timelineView}
else if(this.dayViewSelected()&&this.showDayLanes){_3=this.dayView}
if(!_3){return}
if(!this.lanes)this.lanes=[];if(_2==null)_2=this.lanes.length;this.lanes.add(_1,_2);_3.setLanes(this.lanes)},isc.A.removeLane=function isc_Calendar_removeLane(_1){var _2;if(this.timelineViewSelected())_2=this.timelineView;else if(this.dayViewSelected()&&this.showDayLanes)_2=this.dayView;if(!_2||!this.lanes)return;if(isc.isA.String(_1))_1=this.lanes.find("name",_1);else if(isc.isAn.Object(_1))_1=this.lanes.find("name",_1.name);if(_1){this.lanes.remove(_1);_2.setLanes(this.lanes)}},isc.A.setShowDayLanes=function isc_Calendar_setShowDayLanes(_1){if(this.showDayLanes==_1)return;this.showDayLanes=_1;if(this.dayView){this.dayView.$123r=this.dayView.body.getScrollTop();this.dayView.rebuildFields();if(this.dayViewSelected()){this.dayView.refreshEvents("setShowDayLanes")}else{this.dayView.$123s=true}}},isc.A.initWidget=function isc_Calendar_initWidget(){if(this.startDate&&this.endDate&&this.endDate.getTime()<this.startDate.getTime()){this.logWarn("endDate ("+this.endDate+") is before startDate ("+this.startDate+") - switching values");var _1=this.startDate.duplicate();this.startDate=this.endDate.duplicate();this.endDate=_1}
if(!this.chosenDate){if(this.startDate)this.chosenDate=this.startDate.duplicate();else this.chosenDate=new Date()}
if(!this.showWeekends&&isc.DateUtil.isWeekend(this.chosenDate,this.getWeekendDays())){this.chosenDate=isc.DateUtil.getNextWeekday(this.chosenDate,this.getWeekendDays())}
var _2=isc.Calendar.$1833(this.chosenDate);this.year=_2.getFullYear();this.month=_2.getMonth();this.displayDate=_2.getDate();if(this.twentyFourHourTime==null){this.twentyFourHourTime=isc.Time.use24HourTime}else{if(!this.timeFormatter){this.timeFormatter=this.twentyFourHourTime?"toShortPadded24HourTime":"toShortPaddedTime"}}
if(this.firstDayOfWeek==null)
this.firstDayOfWeek=Number(isc.DateChooser.getInstanceProperty("firstDayOfWeek"));if(!this.weekendDays)this.weekendDays=isc.DateUtil.getWeekendDays();if(this.laneGroupByField&&!isc.isAn.Array(this.laneGroupByField)){this.laneGroupByField=[this.laneGroupByField]}
if(this.showTimelineView){if(this.endDate){this.timelineColumnSpan=Math.round(isc.DateUtil.getPeriodLength(this.startDate,this.endDate,this.timelineGranularity)/this.timelineUnitsPerColumn)}else{if(!this.timelineColumnSpan)this.timelineColumnSpan=this.defaultTimelineColumnSpan}}
if(this.timelineSnapGap!=null){this.snapGap=this.timelineSnapGap;delete this.timelineSnapGap}
if(this.timelineStartDate!=null){this.startDate=this.timelineStartDate.duplicate();delete this.timelineStartDate}
if(this.timelineEndDate!=null){this.endDate=this.timelineEndDate.duplicate();delete this.timelineEndDate}
if(this.timelineLabelFields!=null){this.laneFields=this.timelineLabelFields;this.timelineLabelFields=null}
if(this.eventTypeData!=null){this.lanes=isc.clone(this.eventTypeData);this.eventTypeData=null}
if(this.eventTypeField!=null){this.laneNameField=this.eventTypeField;delete this.eventTypeField}
if(this.showDescription!=null){this.showEventDescriptions=this.showDescription;delete this.showDescription}
if(this.canEditEventType!=null){this.canEditLane=this.canEditEventType;delete this.canEditEventType}
if(this.canDeleteEvents!=null){this.canRemoveEvents=this.canDeleteEvents;delete this.canDeleteEvents}
if(this.longEventLayoutSpace!=null){this.dragGhostSpace=this.longEventLayoutSpace;delete this.longEventLayoutSpace}
var _3=isc.Browser.isTouch?true:false;if(this.canDragCreateEvents==null)this.canDragCreateEvents=!_3;if(this.canDragEvents==null)this.canDragEvents=!_3;if(this.minimalUI==null)this.minimalUI=isc.Browser.isHandset;if(this.minimalUI){this.mainViewDefaults.showTabBar=false;var _4=this;this.orientationEventId=isc.Page.setEvent("orientationChange",function(){_4.pageOrientationChanged()})}
if(this.overlapSortSpecifiers&&!isc.isAn.Array(this.overlapSortSpecifiers)){this.overlapSortSpecifiers=[this.overlapSortSpecifiers]}
if(!this.data)this.data=this.getDefaultData();if(this.canSelectEvents)this.createSelectionModel();this.previousButtonDefaults.prompt=this.previousButtonHoverText;this.nextButtonDefaults.prompt=this.nextButtonHoverText;this.datePickerButtonDefaults.prompt=this.datePickerHoverText;this.addEventButtonDefaults.prompt=this.addEventButtonHoverText;if(this.dataSource)this.autoDetectFieldNames();if(this.showColumnLayouts){this.showLabelColumn=false;this.canResizeEvents=false;this.renderEventsOnDemand=false}
if(this.dragGhostHeight>this.dragGhostSpace){this.dragGhostSpace=this.dragGhostHeight}
this.invokeSuper(isc.Calendar,"initWidget");this.createChildren()},isc.A.updateMonthButton=function isc_Calendar_updateMonthButton(){if(this.getCurrentViewName()=="month"){this.monthButton.setProperties({icon:this.backButtonIconSrc,iconAlign:this.backButtonIconAlign,title:this.backButtonTitle})}else{var _1=this.chosenDate.getMonthName();this.monthButton.setProperties({icon:this.monthButtonIconSrc,iconAlign:this.monthButtonIconAlign,title:this.monthButtonTitle.evalDynamicString(this,{monthName:_1})});this.monthButton.redraw()}},isc.A.pageOrientationChanged=function isc_Calendar_pageOrientationChanged(_1){_1=_1||isc.Page.getOrientation();if(_1=="landscape"&&this.showWeekView)this.setCurrentViewName("week");if(_1=="portrait"&&this.showDayView)this.setCurrentViewName("day")},isc.A.autoDetectFieldNames=function isc_Calendar_autoDetectFieldNames(){this.dataSource=isc.DS.getDataSource(this.dataSource);var _1=this.dataSource,_2=isc.getValues(_1.getFields()),_3=1024000,_4=null,_5;if(this.fieldIsMissing(this.nameField,_1)){this.nameField=_1.getTitleField();if(this.fieldIsMissing(this.nameField,_1)){this.logWarn("Specified field '"+this.nameField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event name field is not present in the DataSource - using DataSource.getTitleField() instead: '"+this.nameField+"'")}}
if(this.fieldIsMissing(this.descriptionField,_1)){_2.sortByProperties(["length"],[false]);_4={length:0};for(var i=0;i<_2.length;i++){_5=_2.get(i);if(!_5.type||_5.type=="text"||_5.type=="string"){if(_5.length>255&&_5.length<_3){this.descriptionField=_5.name;break}else if(_5.length&&_5.length<_3&&_5.length>_4.length){_4=_5}else if(!_5.length){if(!_4)_4=_5}}}
if(_4!=null&&this.fieldIsMissing(this.descriptionField,_1))
this.descriptionField=_4.name;if(this.fieldIsMissing(this.descriptionField,_1)){this.logWarn("Specified field '"+this.descriptionField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event description field is not present in the DataSource - using auto-detected field '"+this.descriptionField+"' instead.")}}
if(this.fieldIsMissing(this.startDateField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if((_5.type=="date"||_5.type=="datetime")){if(_5.name.toLowerCase().indexOf("start")>=0||_5.name.toLowerCase().indexOf("begin")>=0)
{this.startDateField=_5.name;break}else _4=_5}}
if(_4!=null&&this.fieldIsMissing(this.startDateField,_1))
this.startDateField=_4.name;if(this.fieldIsMissing(this.startDateField,_1)){this.logWarn("Specified field '"+this.startDateField+"' is not present in the DataSource and no suitable alternative was auto-detected. A Calendar DataSource requires both start and end date fields. Event creation has been disabled.");this.canCreateEvents=false}else{this.logInfo("Specified event startDate field is not present in the DataSource - using auto-detected field '"+this.startDateField+"' instead.")}}
if(this.fieldIsMissing(this.endDateField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if((_5.type=="date"||_5.type=="datetime")){if(_5.name.toLowerCase().indexOf("end")>=0||_5.name.toLowerCase().indexOf("stop")>=0)
{this.endDateField=_5.name;break}else if(_5.name!=this.startDateField)
_4=_5}}
if(_4!=null&&this.fieldIsMissing(this.endDateField,_1))
this.endDateField=_4.name;if(this.fieldIsMissing(this.endDateField,_1)){this.logWarn("Specified field '"+this.endDateField+"' is not present in the DataSource and no suitable alternative was auto-detected. A Calendar DataSource requires both start and end date fields. Event creation has been disabled.");this.canCreateEvents=false}else{this.logInfo("Specified event endDate field is not present in the DataSource - using auto-detected field '"+this.endDateField+"' instead.")}}
if(this.showTimelineView!=false||(this.showDayView!=false&&this.showDayLanes)){if(this.useSublanes&&this.fieldIsMissing(this.sublaneNameField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if(!_5.type||_5.type=="text"||_5.type=="string"){var _7=_5.name.toLowerCase();if(_7.contains("sublane")){this.sublaneNameField=_5.name;break}}}
if(this.fieldIsMissing(this.sublaneNameField,_1)){this.logWarn("Specified field '"+this.sublaneNameField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event sublane field is not present in the DataSource - using auto-detected field '"+this.sublaneNameField+"' instead.")}}
if(this.fieldIsMissing(this.laneNameField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if(!_5.type||_5.type=="text"||_5.type=="string"){var _7=_5.name.toLowerCase();if(_7.contains("lane")&&_7!=this.sublaneNameField){this.laneNameField=_5.name;break}}}
if(this.fieldIsMissing(this.laneNameField,_1)){this.logWarn("Specified field '"+this.laneNameField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event lane field is not present in the DataSource - using auto-detected field '"+this.laneNameField+"' instead.")}}
var _8=_1&&_1.getField(this.laneNameField);if(_8){if(!isc.SimpleType.inheritsFrom(_8.type,"text")){this.logWarn("Calendar.laneNameField must be set to a text-based field since its values may be used as identifiers.  The specified field '"+this.laneNameField+"' is of type '"+_8.type+"'.")}}}},isc.A.fieldIsMissing=function isc_Calendar_fieldIsMissing(_1,_2){return(!_1||_1==""||(_2&&!_2.getField(_1)))},isc.A.getDefaultData=function isc_Calendar_getDefaultData(){return[]},isc.A.setData=function isc_Calendar_setData(_1){if(this.data==_1)return;if(this.data){this.ignore(this.data,"dataChanged");if(this.data.$31k&&isc.isA.Function(this.data.destroy))
this.data.destroy()}
if(_1)this.data=_1;if(!this.data)return;this.observe(this.data,"dataChanged","observer.dataChanged(arguments)");if(this.hasData()){this.dataChanged("fetch")}},isc.A.getData=function isc_Calendar_getData(){return this.data},isc.A.hasData=function isc_Calendar_hasData(){var _1=this.getDataSource();if(_1&&this.data){if(isc.ResultSet&&isc.isA.ResultSet(this.data)){if(this.data.lengthIsKnown())return true;return false}else if(isc.isAn.Array(this.data)){if(this.data.length>0)return true;return false}}
if(!this.data||(isc.ResultSet&&isc.isA.ResultSet(this.data)&&!this.data.lengthIsKnown()))
{return false}else{return true}},isc.A.dataChanged=function isc_Calendar_dataChanged(){if(this.destroying||this.destroyed)return;var _1=this.getSelectedView();if(_1)_1.refreshEvents();return},isc.A.dataIsAvailable=function isc_Calendar_dataIsAvailable(){if(isc.isAn.Array(this.data))return true;if(this.data.allMatchingRowsCached())return true;return false},isc.A.destroy=function isc_Calendar_destroy(){if(this.orientationEventId)isc.Page.clearEvent("orientationChange",this.orientationEventId);if(this.data){if(this.isObserving(this.data,"dataChanged"))this.ignore(this.data,"dataChanged");if(this.isObserving(this.data,"dataArrived"))this.ignore(this.data,"dataArrived");if(this.data.destroy)this.data.destroy();this.data=null}
if(this.controlsBar)this.controlsBar.destroy();if(this.controlsBarContainer)this.controlsBarContainer.destroy();if(this.dateChooser)this.dateChooser.destroy();if(this.eventCanvasButtonLayout)this.eventCanvasButtonLayout.destroy();if(this.mainLayout)this.mainLayout.destroy();this.Super("destroy",arguments)});isc.evalBoundary;isc.B.push(isc.A.refreshSelectedView=function isc_Calendar_refreshSelectedView(){var _1=this.getSelectedView();if(!_1)return;if(!_1.isDrawn()){_1.$128r=true
return}
if(this.dayViewSelected()){this.dayView.delayedRefreshEvents("refreshSelectedView");if(this.weekView)this.weekView.$123s=true;if(this.monthView)this.monthView.$123s=true}else if(this.weekViewSelected()){this.weekView.delayedRefreshEvents("refreshSelectedView");if(this.dayView)this.dayView.$123s=true;if(this.monthView)this.monthView.$123s=true}else if(this.monthViewSelected()){this.monthView.refreshEvents("refreshSelectedView");if(this.dayView)this.dayView.$123s=true;if(this.weekView)this.weekView.$123s=true}else if(this.timelineViewSelected()){this.timelineView.delayedRefreshEvents("refreshSelectedView")}},isc.A.getSelectedView=function isc_Calendar_getSelectedView(){if(this.dayViewSelected()){return this.dayView}else if(this.weekViewSelected()){return this.weekView}else if(this.monthViewSelected()){return this.monthView}else if(this.timelineViewSelected()){return this.timelineView}},isc.A.getView=function isc_Calendar_getView(_1){if(!_1)return this.getSelectedView();if(_1=="day")return this.dayView;if(_1=="week")return this.weekView;if(_1=="month")return this.monthView;if(_1=="timeline")return this.timelineView},isc.A.setRowHeight=function isc_Calendar_setRowHeight(_1,_2){this.rowHeight=_1;if(this.dayView){this.dayView.setCellHeight(this.rowHeight);this.dayView.refreshEvents("setRowHeight");if(this.scrollToWorkday&&!_2)this.dayView.scrollToWorkdayStart()}
if(this.weekView){this.weekView.setCellHeight(this.rowHeight);this.weekView.refreshEvents("setRowHeight");if(this.scrollToWorkday&&!_2)this.weekView.scrollToWorkdayStart()}},isc.A.getCurrentViewName=function isc_Calendar_getCurrentViewName(){var _1=this.getSelectedView();return _1!=null?_1.viewName:null},isc.A.setCurrentViewName=function isc_Calendar_setCurrentViewName(_1){this.$567=_1;if(this.mainView&&this.mainView.tabs){var _2=this.mainView.tabs.findIndex("viewName",_1);if(_2!=null){this.selectTab(_2)}}
return _1},isc.A.getEventPKs=function isc_Calendar_getEventPKs(_1){if(!this.$129u){_1=_1||this.getDataSource();if(_1){this.$129u=_1.getPrimaryKeyFieldNames()}}
return this.$129u||[]},isc.A.getRandomEventKey=function isc_Calendar_getRandomEventKey(){return"_event_"+(Math.random()*100)+"_"+((Math.random()*Math.random())*100)},isc.A.getEventKey=function isc_Calendar_getEventKey(_1){if(!_1.$232p){if(!this.dataSource){_1.$232p=this.getRandomEventKey();return _1.$232p}else{var _2=this.getEventPKs().duplicate(),_3=this.$1716;if(!_3)_3=isc.StringBuffer.create();if(_2.length>0){_3.append(this.getID(),"_event_");for(var i=0;i<_2.length;i++){_3.append(_1[_2[i]]);if(i==_2.length)break}}
var _5=_3.release(false);_1.$232p=_5}}
return _1.$232p},isc.A.clearViewSelection=function isc_Calendar_clearViewSelection(_1){if(_1){if(_1.clearSelection)_1.clearSelection()}else{if(this.dayView)this.dayView.clearSelection();if(this.weekView)this.weekView.clearSelection();if(this.timelineView)this.timelineView.clearSelection()}},isc.A.getDayDiff=function isc_Calendar_getDayDiff(_1,_2,_3){return Math.abs(isc.DateUtil.$1094(_1,_2,_3,false,this.getWeekendDays()))},isc.A.getEventStartCol=function isc_Calendar_getEventStartCol(_1,_2,_3){var _4=_3||(_2?_2.calendarView:this.getSelectedView()),_5=_2||_4.getCurrentEventCanvas(_1),_6=_4.getEventColumn(_5.getLeft()+1);return _6},isc.A.getEventEndCol=function isc_Calendar_getEventEndCol(_1,_2,_3){var _4=_4||(_2?_2.calendarView:this.getSelectedView()),_5=_2||_4.getCurrentEventCanvas(_1),_6=_4.getEventColumn(_5.getLeft()+_5.getVisibleWidth()+1);return _6},isc.A.getEventLeft=function isc_Calendar_getEventLeft(_1,_2){_2=_2||this.getSelectedView();if(_2.getEventLeft)return _2.getEventLeft(_1);var _3=_2.body.getColumnWidth(0),_4=0;if(_2.isWeekView()){var _4=_2.getColumnLeft(_2.getColFromDate(this.getEventStartDate(_1)))}else if(this.showDayLanes){var _5=_2.completeFields.findIndex("name",_1[this.laneNameField]);if(_5){_4=_2.body.getColumnLeft(_5)}}else{var _5=_2.getColFromDate(this.getEventStartDate(_1));if(_5){_4=_2.body.getColumnLeft(_5)}}
if(this.logIsDebugEnabled("calendar")){this.logDebug('calendar.getEventLeft() = '+_4+' for:'+isc.Log.echoFull(_1),'calendar')}
return _4},isc.A.getEventHeaderHTML=function isc_Calendar_getEventHeaderHTML(_1,_2){if(!_1)return null;var _3=this.getEventStartDate(_1),_4=isc.Time.toShortTime(_3,this.timeFormatter,false),_5=(_2.isTimelineView()?null:_4),_6=(_5?_5+" ":""),_7=_1[this.nameField];var _8=_2.getCurrentEventCanvas(_1);if(_7){if(this.shouldEscapeFieldHTML(this.nameField)||(_8&&_8.escapeHTML)){_7=_7.asHTML()}}
return _6+(_7||"")},isc.A.getEventBodyHTML=function isc_Calendar_getEventBodyHTML(_1,_2){if(!_1)return null;var _3=_1[this.descriptionField];var _4=_2.getCurrentEventCanvas(_1);if(_3){if(this.shouldEscapeFieldHTML(this.descriptionField)||(_4&&_4.escapeHTML)){_3=_3.asHTML()}}
return _3},isc.A.getEventLeadingDate=function isc_Calendar_getEventLeadingDate(_1,_2){if(!_1)return null;var _3=_1[this.leadingDateField];return _3?_3.duplicate():null},isc.A.getEventTrailingDate=function isc_Calendar_getEventTrailingDate(_1,_2){if(!_1)return null;var _3=_1[this.trailingDateField];return _3?_3.duplicate():null},isc.A.getEventStartDate=function isc_Calendar_getEventStartDate(_1,_2){var _3=_1&&_1[this.startDateField];if(!_3)return null;if(!isc.isA.Date(_3)){_3=Date.parseStandardDate(_3);if(!isc.isA.Date(_3))return null;_1[this.startDateField]=_3.duplicate()}
return _3.duplicate()},isc.A.getEventDates=function isc_Calendar_getEventDates(_1,_2){var _3={};_3[this.leadingDateField]=this.getEventLeadingDate(_1);_3[this.startDateField]=this.getEventStartDate(_1);_3[this.endDateField]=this.getEventEndDate(_1);_3[this.trailingDateField]=this.getEventTrailingDate(_1);return _3},isc.A.getEventEndDate=function isc_Calendar_getEventEndDate(_1,_2){if(!_1)return null;var _3=this.getEventDuration(_1),_4=_1[this.endDateField];if(!isc.isA.Date(_4)){_4=Date.parseStandardDate(_4);if(isc.isA.Date(_4))_1[this.endDateField]=_4.duplicate()}
if(_3!=null){var _5=this.getEventDurationUnit(_1)||"mn"
_4=this.getEventStartDate(_1);if(_5){_4=isc.DateUtil.dateAdd(_4,_5,_3,null,null,null,this.firstDayOfWeek)}}
if(!_4)_4=this.getEventStartDate(_1);return _4?_4.duplicate():null},isc.A.isDurationEvent=function isc_Calendar_isDurationEvent(_1){return(!_1[this.endDateField]&&_1[this.durationField]!=null)},isc.A.getEventDuration=function isc_Calendar_getEventDuration(_1,_2){return _1[this.durationField]},isc.A.getEventDurationUnit=function isc_Calendar_getEventDurationUnit(_1,_2){return _1[this.durationUnitField]||this.$1290},isc.A.isZeroLengthEvent=function isc_Calendar_isZeroLengthEvent(_1){var _2=this.isDurationEvent(_1),_3=_2&&this.getEventDuration(_1)==0;return _3},isc.A.setShowWeekends=function isc_Calendar_setShowWeekends(_1){if(_1==this.showWeekends)return;this.showWeekends=_1;this.dayView&&this.dayView.rebuild();this.weekView&&this.weekView.rebuild();this.monthView&&this.monthView.rebuild();this.timelineView&&this.timelineView.rebuild();this.setDateLabel()},isc.A.canEditEvent=function isc_Calendar_canEditEvent(_1,_2){if(!_1)return false;_2=_2||this.getSelectedView();if(_1[this.canEditField]!=null)return _1[this.canEditField];if(_1.duration==0)return this.canEditEvents;if(!_2.allowMultiDayEvents){var _3=isc.DateUtil.getLogicalDateOnly(this.getEventStartDate(_1)),_4=isc.DateUtil.getLogicalDateOnly(isc.DateUtil.adjustDate(this.getEventEndDate(_1),"-1ms"));if(isc.DateUtil.compareLogicalDates(_3,_4)!=0){return false}}
return this.canEditEvents},isc.A.canDragEvent=function isc_Calendar_canDragEvent(_1,_2){_2=_2||this.getSelectedView();if(!_1||!this.canEditEvent(_1,_2))return false;if(_1[this.canDragEventField]!=null)return _1[this.canDragEventField];return this.canDragEvents},isc.A.canResizeEvent=function isc_Calendar_canResizeEvent(_1,_2){_2=_2||this.getSelectedView();if(!_1||!this.canEditEvent(_1,_2)||!this.canDragEvent(_1,_2))return false;if(_2.shouldShowColumnLayouts())return false;if(_1[this.canResizeEventField]!=null)return _1[this.canResizeEventField];else if(this.isZeroLengthEvent(_1))return false;else return this.canResizeEvents},isc.A.canRemoveEvent=function isc_Calendar_canRemoveEvent(_1,_2){if(!_1)return false;if(_1[this.canRemoveField]!=null)return _1[this.canRemoveField];return this.canRemoveEvents&&this.canEditEvent(_1,_2||this.getSelectedView())},isc.A.getDateEditingStyle=function isc_Calendar_getDateEditingStyle(){var _1=this.getSelectedView();if(_1.dateEditingStyle){return _1.dateEditingStyle}
var _2=this.dateEditingStyle;if(!_2){if(this.dataSource)_2=this.getDataSource().getField(this.startDateField).type;if(!_2){switch(this.timelineGranularity){case"day":if(!this.timelineView)_2="date";else if(this.getSnapGapPixels(this.timelineView)<this.timelineView.columnWidth){_2="datetime"}else{_2="date"}
break;case"hour":_2="datetime";break;case"millisecond":case"second":case"minute":_2="time";break;default:_2="date";break}}}
return _2},isc.A.addLaneEvent=function isc_Calendar_addLaneEvent(_1,_2,_3,_4,_5,_6){_6=_6||{};var _7=this.createEventObject(null,_2,_3,_1,_6[this.sublaneNameField],_4,_5);this.addCalendarEvent(_7,_6,"none")},isc.A.getCleanEventRecord=function isc_Calendar_getCleanEventRecord(_1){if(isc.propertyDefined(_1,"overlapProps"))delete _1.overlapProps;if(isc.propertyDefined(_1,"overlapRangeId"))delete _1.overlapRangeId;if(isc.propertyDefined(_1,"slotNum"))delete _1.slotNum;if(isc.propertyDefined(_1,"tagged"))delete _1.tagged;return _1},isc.A.createEventObject=function isc_Calendar_createEventObject(_1,_2,_3,_4,_5,_6,_7){var _8=isc.addProperties({},_1);if(_2)_8[this.startDateField]=_2;if(_3)_8[this.endDateField]=_3;if(_4)_8[this.laneNameField]=_4;if(_5)_8[this.sublaneNameField]=_5;if(_6)_8[this.nameField]=_6;if(_7)_8[this.descriptionField]=_7;delete _8.eventLength;delete _8.__ref;return _8},isc.A.addEvent=function isc_Calendar_addEvent(_1,_2,_3,_4,_5,_6,_7){_5=_5||{};var _8;if(isc.isA.Date(_1)){_8=this.createEventObject(null,_1,_2,_6||_5[this.laneNameField],_5[this.sublaneNameField],_3,_4)}else if(isc.isAn.Object(_1)){_8=_1}else{isc.logWarn('addEvent error: startDate parameter must be either a Date or a CalendarEvent');return}
this.addCalendarEvent(_8,_5,"none",_7)},isc.A.addCalendarEvent=function isc_Calendar_addCalendarEvent(_1,_2,_3,_4){if(!_1)return;if(_4==null&&!isc.isAn.Array(this.data))_4=true;var _5=this.getEventStartDate(_1);if(!isc.isA.Date(_5)){isc.logWarn('addCalendarEvent: passed event has no start date');return}
_1=this.getCleanEventRecord(isc.addProperties(_1,_2));if(_4)this.$53e=true;if(this.dataSource){var _6=this;var _7={componentId:this.ID,willHandleError:true,scenarioCode:_3};if(this.addOperation)_7.operationId=this.addOperation;isc.DataSource.get(this.dataSource).addData(_1,function(_8,_9,_10){_6.processSaveResponse(_8,_10)},_7);return}else{this.$53e=false;this.data.add(_1);this.processSaveResponse({status:0,data:[_1]},{operationType:"add",scenarioCode:_3})}},isc.A.removeEvent=function isc_Calendar_removeEvent(_1,_2){if(_2==null)_2=true;var _3=this.getEventStartDate(_1),_4=this.getEventEndDate(_1);var _5=this;var _6=function(){if(_5.$53b(_3,_4)){_5.dayView.removeEvent(_1)}
if(_5.$53c(_3,_4)){_5.weekView.removeEvent(_1)}
if(_5.$53d(_3,_4)){_5.monthView.refreshEvents("removeEvent")}
if(_5.$131r(_3,_4)){_5.timelineView.removeEvent(_1);if(!_5.dataSource)_5.timelineView.retagLaneEvents(_1[_5.laneNameField])}
if(_5.eventAutoArrange){if(_5.dayView){if(_5.dayView.isSelectedView())_5.dayView.refreshEvents("removeEvent");else _5.dayView.$123s=true}
if(_5.weekView){if(_5.weekView.isSelectedView())_5.weekView.retagDayEvents(_3);else _5.weekView.$123s=true}}
if(_5.eventRemoved)_5.eventRemoved(_1)};if(_2)this.$53e=true;_1=this.getCleanEventRecord(_1);if(this.dataSource){var _7={componentId:this.ID,oldValues:_1,willHandleError:true};if(this.removeOperation)_7.operationId=this.removeOperation;isc.DataSource.get(this.dataSource).removeData(_1,_6,_7);return}else{var _8=this.data[_1]||this.data.find("$232p",_1["$232p"]);if(_8){this.data.remove(_8);_6()}}},isc.A.updateEvent=function isc_Calendar_updateEvent(_1,_2,_3,_4,_5,_6,_7,_8,_9){if(_7==null)_7=true;if(!isc.isAn.Object(_6))_6={};var _10=this.createEventObject(_1,_2,_3,_8||_6[this.laneNameField],_9||_6[this.sublaneNameField],_4,_5);this.updateCalendarEvent(_1,_10,_6,"none",_7)},isc.A.eventSaveError=function isc_Calendar_eventSaveError(_1,_2,_3,_4){return true},isc.A.updateCalendarEvent=function isc_Calendar_updateCalendarEvent(_1,_2,_3,_4,_5){if(_5)this.$53e=true;_3=_3||{};var _6=this.getSelectedView();var _7=_6.getCurrentEventCanvas(_1);if(_7){if(this.dataSource)_6.clearEventCanvas(_7)}
if(this.dataSource){var _8=isc.DataSource.get(this.dataSource);var _9=this.getCleanEventRecord(isc.addProperties({},_2,_3));var _10=this.getCleanEventRecord(isc.addProperties({},_1));var _11={oldValues:_10,componentId:this.ID,willHandleError:true,operationType:"update",scenarioCode:_4};if(this.updateOperation)_11.operationId=this.updateOperation;var _12=this;_8.updateData(_9,function(_14,_15,_8){_12.processSaveResponse(_14,_15,_10)},_11);return}else{var _13=isc.addProperties({},_1);isc.addProperties(_1,_2,_3);this.processSaveResponse({status:0,data:[_1]},{operationType:"update",scenarioCode:_4},_13)}},isc.A.processSaveResponse=function isc_Calendar_processSaveResponse(_1,_2,_3){var _4=isc.isAn.Array(_1.data)?_1.data[0]:_1.data,_5=(_2&&_2.operationType)||(_1&&_1.operationType),_6=_5=="update",_7=_5=="add",_8=this.$1115,_9=this.$1116,_10=this.$278a;var _11=this.getSelectedView();delete this.$1115;delete this.$1116;delete this.$278a;if(_1&&_1.status<0){var _12=this.eventSaveError(_1,_2,_2.scenarioCode);if(_12==false){return}else{var _13=_1?_1.errors:null;if(_1.status==isc.RPCResponse.STATUS_VALIDATION_ERROR){if(_8){if(_13)this.eventDialog.items[0].setErrors(_13,true);this.eventDialog.setEvent(_4||_3);this.displayEventDialog(true);return}else if(_9){this.eventEditorLayout.show();this.eventEditorLayout.setEvent(_4||_3);if(_13)this.eventEditor.setErrors(_13,true);return}}
if(_6&&(_4||_3)){if(_11){_11.addEvent(_4||_3);if(this.canSelectEvents&&(_8||_9)){var _14=_11.getCurrentEventCanvas(_3);if(_14)_14.focus()}}}}
if(_12==true){isc.RPCManager.$a0(_1,_2)}
return}
if(!_4||isc.isA.String(_4)){if(_7){this.logWarn("Calendar Add operation did not return a record. The operation succeeded but no CalendarViews will be refreshed.")
return}else _4=_3}
this.cancelEditing();var _15=this.getEventStartDate(_4),_16=this.getEventEndDate(_4);if(!_15||!_16){this.logWarn("processSaveResponse: event record has no valid "+this.startDateField+"/"+this.endDateField+" field");return}
_4.eventLength=(_16.getTime()-_15.getTime());if(isc.isAn.Array(this.data)){if(_6){var _17=_3?this.data.findIndex("$232p",_3.$232p):-1;if(_17!=-1)isc.addProperties(this.data[_17],_4)}else{this.getEventKey(_4)}
if(this.fixedEventHeight&&_11.isTimelineView())_11.redraw();this.dataChanged();return}
if(_10||!_6){if(!_11.isMonthView())_11.addEvent(_4);if(_11.isMonthView()){_11.refreshEvents("processSaveResponse")}else{_11.$1739()}
return}
var _18=_6&&_3?this.getEventStartDate(_3):null,_19=_6&&_3?this.getEventEndDate(_3):null,_20=_6&&_3?_3[this.laneNameField]:null,_21=_4[this.laneNameField];if(_4[this.durationField]!=null){_4.isDuration=true;_4.isZeroDuration=_4[this.durationField]==0}
if(this.$53b(_15,_16)||(_6&&this.$53b(_18,_19)))
{if(!this.dayViewSelected())this.dayView.$123s=true;else{if(_6){var _11=this.dayView;if(this.showDayLanes){_11.retagLaneEvents(_20);if(_21!=_20)_11.retagLaneEvents(_21)}else{_11.refreshEvents("processSaveResponse")}}else if(_7){_11.refreshEvents("processSaveResponse")}}}
if(this.$53c(_15,_16)){if(!this.weekViewSelected())this.weekView.$123s=true;else{var _11=this.weekView;if(_6){if(!this.showColumnLayouts||(_8||_9)){var _22=isc.DateUtil.getLogicalDateOnly(_18);var _23=isc.DateUtil.getLogicalDateOnly(_15);if(!this.showColumnLayouts){_11.retagDayEvents(_22)}else{var _14=_11.getCurrentEventCanvas(_3);if(_14)_14.setEvent(_4);var _24=_11.getField(_11.getColFromDate(_22));if(_24.eventLayoutID){_11.columnLayoutMap[_24.eventLayoutID].resort()}}
if(isc.DateUtil.compareLogicalDates(_22,_23)!=0){_11.retagDayEvents(_23);if(this.showColumnLayouts){var _25=_11.getField(_11.getColFromDate(_22));if(_25.eventLayoutID){_11.columnLayoutMap[_25.eventLayoutID].resort()}}}}}else if(_7){_11.addEvent(_4,true);_11.retagDayEvents(_15)}}}
if(this.$53d(_15,_16)){if(!this.monthViewSelected())this.monthView.$123s=true;else this.monthView.refreshEvents("processSaveResponse")}
if(this.$131r(_15,_16)){if(!this.timelineViewSelected())this.timelineView.$123s=true;else{var _11=this.timelineView;if(this.fixedEventHeight)_11.redraw();if(_6){if(_20&&_20!=_21)_11.retagLaneEvents(_20);_11.retagLaneEvents(_21)}else if(_7){_11.refreshEvents("processSaveResponse")}}}
if(this.$53e)delete this.$53e;if(this.canSelectEvents&&(_8||_9)){var _14=_11.getCurrentEventCanvas(_3||_4);if(_14)_14.focus()}
if(_6&&this.eventChanged)this.eventChanged(_4);if(_7&&this.eventAdded)this.eventAdded(_4)},isc.A.refreshEvent=function isc_Calendar_refreshEvent(_1){var _2=this.getSelectedView();var _3=_2.getCurrentEventCanvas(_1);if(_3){_3.setEvent(_1)
_3.markForRedraw()}},isc.A.setEventStyle=function isc_Calendar_setEventStyle(_1,_2){_1.eventWindowStyle=_2;var _3=this.getSelectedView().getCurrentEventCanvas(_1);if(_3){_3.setEventStyle(_2);_3.markForRedraw()}},isc.A.eventsAreSame=function isc_Calendar_eventsAreSame(_1,_2){if(!_1||!_2)return false;if(this.dataSource){var _3=isc.DataSource.get(this.dataSource),_4=this.getEventPKs(),_5=true;for(var i=0;i<_4.length;i++){var _7=_4[i];if(_1[_7]!=_2[_7]){_5=false;break}}
return _5}else{return(_1===_2)}},isc.A.shouldEscapeFieldHTML=function isc_Calendar_shouldEscapeFieldHTML(_1){var _2=this.getDataSource(),_1=_2&&_2.getField(_1);return _1&&_1.escapeHTML},isc.A.$141h=function isc_Calendar__getEventHoverHTML(_1,_2,_3){var _4=this,_5=_4.getEventStartDate(_1),_6=_5.toShortDate(this.dateFormatter,true),_7=isc.Time.toShortTime(_5,this.timeFormatter,false),_8=this.getEventEndDate(_1),_9=_8.toShortDate(this.dateFormatter,false),_10=isc.Time.toShortTime(_8,this.timeFormatter,false),_11=_1[_4.nameField],_12=_1[_4.descriptionField],_13=isc.StringBuffer.create();if(isc.DateUtil.compareLogicalDates(_5,_8)!=0){_13.append(_6,"&nbsp;",_7,"&nbsp;-&nbsp;",_9,"&nbsp;",_10)}else{_13.append(_6,"&nbsp;",_7,"&nbsp;-&nbsp;",_10)}
if(_11){if(this.shouldEscapeFieldHTML(this.nameField)||(_2&&_2.escapeHTML))
_11=_11.asHTML();_13.append("<br><br>",_11)}
if(_12){if(this.shouldEscapeFieldHTML(this.descriptionField)||(_2&&_2.escapeHTML))
_12=_12.asHTML();_13.append("<br>",_12)}
var _14=_13.release(false);var _15=this.getEventHoverHTML(_1,_2,_3,_14);if(_15!=_14&&_2&&_2.escapeHTML)_15=_15.asHTML();return _15},isc.A.getEventHoverHTML=function isc_Calendar_getEventHoverHTML(_1,_2,_3,_4){return _4},isc.A.$141i=function isc_Calendar__getZoneHoverHTML(_1,_2,_3){var _4=this.$141h(_1,_2,_3);return this.getZoneHoverHTML(_1,_2,_3,_4)},isc.A.getZoneHoverHTML=function isc_Calendar_getZoneHoverHTML(_1,_2,_3,_4){return _4},isc.A.indicatorClick=function isc_Calendar_indicatorClick(_1,_2){return true},isc.A.$141j=function isc_Calendar__getIndicatorHoverHTML(_1,_2,_3){var _4=this.$141h(_1,_2,_3);return this.getIndicatorHoverHTML(_1,_2,_3,_4)},isc.A.getIndicatorHoverHTML=function isc_Calendar_getIndicatorHoverHTML(_1,_2,_3,_4){return _4},isc.A.$140d=function isc_Calendar__getCellHoverHTML(_1,_2,_3,_4){var _5=_1.getField(_4),_6=null,_7=null;if(!_5)return;if(_5.isLaneField){if(!_1.shouldShowLaneFieldHovers())return;_7=_2&&_2[_5.name];if(_7&&_5.escapeHTML)_7=_7.asHTML();if(_5.hoverHTML){var _8=_5.hoverHTML(_2,_7,_3,_4,_1);if(_8!=_7&&_5.escapeHTML){_8=_8.asHTML()}
_7=_8}}else{if(!_1.shouldShowCellHovers())return;if(_1.isTimelineView()){var _9=_1.getCellDate(_3,_4-(_1.frozenFields?_1.frozenFields.length:0)),_10=_1.getCellEndDate(_3,_4-(_1.frozenFields?_1.frozenFields.length:0));_7=this.formatDateRange(_9,_10)}else{var _6=_1.getDateFromPoint();if(_6){_7="<nobr>"+this.$178v(_6,_1.isMonthView())+"</nobr>"}}}
if(!_5.date||_1.isMonthView()){if(_1.showClippedValuesOnHover&&!_1.cellValueIsClipped(_3,_4))return}
var _11=this.getCellHoverHTML(_1,_2,_3,_4,_6,_7)
if(_11!=_7&&_5&&_5.escapeHTML)_11=_11.asHTML();return _11},isc.A.getCellHoverHTML=function isc_Calendar_getCellHoverHTML(_1,_2,_3,_4,_5,_6){return _6},isc.A.formatDateRange=function isc_Calendar_formatDateRange(_1,_2){return this.$53k(_1,_2,{startDate:_1,endDate:_2})},isc.A.$140e=function isc_Calendar__getHeaderHoverHTML(_1,_2,_3,_4,_5){if(!_1.shouldShowHeaderHovers())return;var _6=_3&&(_3.title||_3.name);if(_6&&_3&&_3.escapeHTML)_6=_6.asHTML();if(_2&&_2.hoverHTML){var _7=_2.hoverHTML(_1,_4,_5,_6);if(_7!=_6&&_3&&_3.escapeHTML){_7=_7.asHTML()}
_6=_7}
var _8=this.getHeaderHoverHTML(_1,_2,_4,_5,_6);if(_8!=_6&&_3&&_3.escapeHTML)_8=_8.asHTML();return _8},isc.A.getHeaderHoverHTML=function isc_Calendar_getHeaderHoverHTML(_1,_2,_3,_4,_5){return _5},isc.A.setShowViewHovers=function isc_Calendar_setShowViewHovers(_1,_2){this.showViewHovers=_1;if(_2){_2.setShowHover(_1)}else{if(this.dayView)this.dayView.setShowHover(_1);if(this.weekView)this.weekView.setShowHover(_1);if(this.monthView)this.monthView.setShowHover(_1);if(this.timelineView)this.timelineView.setShowHover(_1)}},isc.A.$140a=function isc_Calendar__getDragHoverHTML(_1,_2){_2=_2||{};var _3=_2.hoverStyleName||this.hoverStyleName||"";var _4=this.getEventStartDate(_2),_5=this.getEventEndDate(_2),_6="<div style='"+_3+"'><nobr>"+this.$178v(_4)+"</nobr></div><div style='"+_3+"'><nobr>"+this.$178v(_5)+"</nobr></div>";return this.getDragHoverHTML(_1,_2,_6)},isc.A.$178v=function isc_Calendar___getLocalDatetimeString(_1,_2){var _3=isc.DateUtil.getLogicalDateOnly(_1);var _4=isc.DateUtil.getLogicalTimeOnly(_1);var _5=_3.toShortDate(this.dateFormatter);if(!_2){_5+=" "+isc.Time.toShortTime(_4,this.timeFormatter,true)}
return _5},isc.A.getDragHoverHTML=function isc_Calendar_getDragHoverHTML(_1,_2,_3){return _3},isc.A.$53b=function isc_Calendar__shouldRefreshDay(_1,_2){if(!this.dayView||!this.dayView.body)return false;var _3=isc.DateUtil.getLogicalDateOnly(this.dayView.startDate);var _4=isc.DateUtil.getLogicalDateOnly(_1);var _5=isc.DateUtil.getLogicalDateOnly(_2);var _6=isc.DateUtil.compareLogicalDates(_4,_3)==0;var _7=isc.DateUtil.compareLogicalDates(_5,_3)==0;return(_6||_7)},isc.A.$53c=function isc_Calendar__shouldRefreshWeek(_1,_2){if(!this.weekView||!this.weekView.body)return false;var _3=_1.getTime()<this.weekView.endDate.getTime(),_4=_2.getTime()>this.weekView.startDate.getTime();return(_3||_4)},isc.A.$53d=function isc_Calendar__shouldRefreshMonth(_1,_2){if(!this.monthView||!this.monthView.body)return false;var _3=new Date(this.year,this.month,-7,0,0,0).getTime(),_4=new Date(this.year,this.month,37,23,59,59).getTime();return(_1.getTime()<_4&&_2.getTime()>_3)},isc.A.$131r=function isc_Calendar__shouldRefreshTimeline(_1,_2){if(!this.timelineView||!this.timelineView.body)return false;var _3=_1.getTime()<this.timelineView.endDate.getTime(),_4=_2.getTime()>this.timelineView.startDate.getTime();return(_3&&_4)},isc.A.getEventCanvasConstructor=function isc_Calendar_getEventCanvasConstructor(_1,_2){_2=_2||this.getSelectedView();return _2.getEventCanvasConstructor(_1)||this.eventCanvasConstructor},isc.A.showEventCanvasComponent=function isc_Calendar_showEventCanvasComponent(_1){return _1.$220u()},isc.A.createEventCanvasComponent=function isc_Calendar_createEventCanvasComponent(_1){if(!this.showEventCanvasComponent(_1))return;var _2;if(this.eventScreen){_2=isc.RPCManager.createScreen(this.eventScreen);if(!_2){_2=this.createAutoChild("eventScreenPlaceholder")}}else{_2=this.createAutoChild("eventCanvasComponent",{width:"100%",height:this.showColumnLayouts?1:"100%",overflow:this.showColumnLayouts?"visible":"auto",autoDraw:false,dragTarget:_1,hoverMoveWithMouse:_1.hoverMoveWithMouse,getHoverHTML:function(){return this.dragTarget.getHoverHTML()},dataSource:this.getClientOnlyEventDS(_1.calendarView)})}
return _2},isc.A.updateEventCanvasComponent=function isc_Calendar_updateEventCanvasComponent(_1,_2){if(!this.showEventCanvasComponent(_1))return;if(_2){if(this.eventScreen){var _3=this.getDataSource();if(_3){var _4={};_4[_3.ID]=_1.event;_2.setDataContext(_4)}}else{if(_2.setData)_2.setData(_1.event);if(_2.setEvent)_2.setEvent(_1.event)}}},isc.A.getClientOnlyEventDS=function isc_Calendar_getClientOnlyEventDS(_1,_2){var _3={ID:_2,clientOnly:true};var _4=this.eventCanvasComponentProperties,_5=(_4&&_4.dataSource)||this.dataSource;if(_5){_3.inheritsFrom=isc.DataSource.getDataSource(_5).getID()}else{var _6=[{name:this.nameField,width:"*"},{name:this.descriptionField,width:"*"},{name:this.startDateField,type:"datetime",width:"*"},{name:this.endDateField,type:"datetime",width:"*"}];if(_1.usesLanes()){_6.add({name:this.laneNameField,width:"*"})}
_3.fields=_6}
var _7=isc.DataSource.create(_3);return _7},isc.A.getEventCanvasStyle=function isc_Calendar_getEventCanvasStyle(_1,_2,_3){_2=_2||this.getSelectedView();if(_3&&_3.isLongEvent&&this.longEventStyleName&&this.shouldAllowLongEvents()){return this.longEventStyleName}
var _4=this.$131j(_1)||_2.getEventCanvasStyle(_1)||this.eventWindowStyle||this.eventStyleName;return _4},isc.A.$1700=function isc_Calendar__showEventCanvasContextMenu(_1){if(this.showEventCanvasContextMenu==false)return false;var _2=this.getEventCanvasMenuItems(_1);if(_2&&_2.length>0){if(!this.eventCanvasContextMenu)this.addAutoChild("eventCanvasContextMenu");this.eventCanvasContextMenu.setData(_2);_1.contextMenu=this.eventCanvasContextMenu;_1.showContextMenu();return false}
return true},isc.A.$1701=function isc_Calendar__eventCanvasContextClick(_1){return this.$1700(_1)},isc.A.getEventCanvasMenuItems=function isc_Calendar_getEventCanvasMenuItems(_1,_2){return},isc.A.hideEventCanvasControls=function isc_Calendar_hideEventCanvasControls(_1,_2){var _3=_1[_2];if(!_3)return;var _4=["closeButton","contextButton"];for(var _5 in _3){var _6=_3[_5];_6.hide();delete _6.eventCanvas;if(!_4.contains(_5))this.addChild(_6,null,false)}
delete _1[_2]},isc.A.$174c=function isc_Calendar__createEventCanvasControls(_1,_2){var _3={};var _4=this.createAutoChild("eventCanvasButtonLayout");_3.contextButton=this.createAutoChild("eventCanvasContextButton");_4.addMember(_3.contextButton);if(this.canRemoveEvents!=false){_3.closeButton=this.createAutoChild("eventCanvasCloseButton",{width:this.eventCanvasCloseButtonSize,height:this.eventCanvasCloseButtonSize,imageWidth:this.eventCanvasCloseIconSize,imageHeight:this.eventCanvasCloseIconSize});_4.addMember(_3.closeButton)}
_3.buttonLayout=_4;if(this.canResizeEvents!=false){var _5=this.getSelectedView();var _6=(_1&&_1.verticalResize)||_5.verticalEvents;if(!_1||_6){_3.endResizerB=this.getEventCanvasResizer(null,"B",_2)}
if(!_1||!_6){_3.startResizerL=this.getEventCanvasResizer(null,"L",_2);_3.endResizerR=this.getEventCanvasResizer(null,"R",_2)}}
return _3},isc.A.$174d=function isc_Calendar__getRolloverControls(){if(!this.$129e){this.$129e=this.$174c()}
return this.$129e},isc.A.selectSingleEvent=function isc_Calendar_selectSingleEvent(_1,_2){return this.selectEvent(_1,_2,true)},isc.A.selectEvent=function isc_Calendar_selectEvent(_1,_2,_3){var _4=this.getSelection();if(_3){this.deselectAllEvents()}
var _5=_4.select(_1);if(_5){if(!_2){var _6=this.getSelectedView();_2=_6.getCurrentEventCanvas(_1)}
this.selectEventCanvas(_2);this.selectionChanged(_1,_4.getSelection())}
return _5},isc.A.selectEvents=function isc_Calendar_selectEvents(_1){var _2=false;if(_1&&_1.length>0){for(var i=0;i<_1.length;i++){var _4=this.selectEvent(_1[i]);if(_4)_2=true}}
return _2},isc.A.selectEventCanvas=function isc_Calendar_selectEventCanvas(_1){_1.bringToFront();_1.isSelected=true;_1.event.isSelected=true;_1.setEventStyle(_1.$172y.eventStyleName)},isc.A.deselectEvent=function isc_Calendar_deselectEvent(_1,_2){var _3=this.getSelection();var _4=_3.deselect(_1);if(_4){if(!_2){var _5=this.getSelectedView();_2=_5.getCurrentEventCanvas(_1)}
this.deselectEventCanvas(_2);this.selectionChanged(_1,_3.getSelection())}
return _4},isc.A.deselectEvents=function isc_Calendar_deselectEvents(_1){var _2=false;if(_1&&_1.length>0){for(var i=0;i<_1.length;i++){var _4=this.deselectEvent(_1[i]);if(_4)_2=true}}
return _2},isc.A.deselectAllEvents=function isc_Calendar_deselectAllEvents(){var _1=false;var _2=this.getSelectedEvents();for(var i=0;i<_2.length;i++){var _4=this.deselectEvent(_2[i]);if(_4)_1=true}
return _1},isc.A.deselectEventCanvas=function isc_Calendar_deselectEventCanvas(_1){_1.isSelected=false;_1.event.isSelected=false;_1.setEventStyle(_1.$172y.eventStyleName)},isc.A.selectionChanged=function isc_Calendar_selectionChanged(_1,_2){},isc.A.selectionUpdated=function isc_Calendar_selectionUpdated(_1,_2){},isc.A.getSelection=function isc_Calendar_getSelection(){return this.selectionManager},isc.A.clearSelection=function isc_Calendar_clearSelection(){this.deselectAllEvents()},isc.A.getSelectedEvent=function isc_Calendar_getSelectedEvent(){var _1=this.getSelectedEvents();if(_1)_1=_1[0];return _1},isc.A.getSelectedEvents=function isc_Calendar_getSelectedEvents(){var _1=this.getSelection();if(_1)_1=_1.getSelection();return _1},isc.A.$174e=function isc_Calendar__getFocusControls(){if(!this.$174f){this.$174f=this.$174c(null,true)}
return this.$174f});isc.evalBoundary;isc.B.push(isc.A.$174g=function isc_Calendar__focusEventCanvas(_1){if(!_1)return;if(_1.$174h){return}
if(_1.$129e){this.hideEventCanvasControls(_1,"$129e")}
_1.updateRolloverControls();_1.parentElement.scrollIntoView(_1.getLeft(),_1.getTop(),_1.getWidth(),_1.getHeight());if(this.$195l){delete this.$195l;this.selectSingleEvent(_1.event,_1)}},isc.A.$174i=function isc_Calendar__blurEventCanvas(_1){if(!_1||_1.$174h){return}
this.hideEventCanvasControls(_1,"$174f");_1.updateRolloverControls();if(this.$195m){delete this.$195m;this.$195l=true}},isc.A.getEventCanvasGripper=function isc_Calendar_getEventCanvasGripper(_1,_2,_3){_1=_1||{};_1.src=this.getEventCanvasGripperIcon(_2,_3);var _4=this.createAutoChild("eventCanvasGripper",_1);_3.addChild(_4,null,false);return _4},isc.A.getEventCanvasGripperIcon=function isc_Calendar_getEventCanvasGripperIcon(_1,_2){return _1.gripperIcon||this.eventCanvasGripperIcon},isc.A.getEventCanvasLabel=function isc_Calendar_getEventCanvasLabel(_1,_2){var _3=this.createAutoChild("eventCanvasLabel",_1);_2.addChild(_3,null,false);return _3},isc.A.$174b=function isc_Calendar__eventCanvasCloseClick(_1){if(this.eventRemoveClick(_1.event,_1.calendarView.viewName)!=false){this.removeEvent(_1.event,false)}},isc.A.getEventCanvasCloseButton=function isc_Calendar_getEventCanvasCloseButton(_1){var _2=this.creator.eventCanvasCloseButtonSize,_3=this.creator.eventCanvasCloseIconSize;if(this.useEventCanvasRolloverControls){if(!this.eventCanvasCloseButton){this.eventCanvasCloseButton=this.addAutoChild("eventCanvasCloseButton",{width:_2,height:_2,imageWidth:_3,imageHeight:_3})}
return this.eventCanvasCloseButton}else{return this.createAutoChild("eventCanvasCloseButton",{width:_2,height:_2,imageWidth:_3,imageHeight:_3})}},isc.A.getEventCanvasContextButton=function isc_Calendar_getEventCanvasContextButton(_1){if(this.useEventCanvasRolloverControls){if(!this.eventCanvasContextButton){this.eventCanvasContextButton=this.addAutoChild("eventCanvasContextButton")}
return this.eventCanvasContextButton}else{return this.createAutoChild("eventCanvasContextButton")}},isc.A.getEventCanvasResizer=function isc_Calendar_getEventCanvasResizer(_1,_2,_3){var _4="eventCanvasResizer"+_2,_5=_3?null:this[_4];if(!this.useEventCanvasRolloverControls||!_5){var _6="eventCanvas"+(["T","B"].contains(_2)?"V":"H")+"Resizer",_7={snapTo:_2,getEventEdge:function(){return this.snapTo}};_5=this.createAutoChild(_6,_7);if(!_3&&this.useEventCanvasRolloverControls)this[_4]=_5}
return _5},isc.A.setShowZones=function isc_Calendar_setShowZones(_1){this.showZones=_1;var _2=this.timelineView;if(_2&&_2.isSelectedView())_2.refreshEvents("setShowZones");else if(_2)_2.$123s=true},isc.A.setZones=function isc_Calendar_setZones(_1){if(!_1){return}
this.zones=_1;if(this.timelineView){this.timelineView.drawZones()}},isc.A.addZone=function isc_Calendar_addZone(_1){if(!_1)return;this.zones=this.zones||[];this.zones.add(_1);this.setZones(this.zones)},isc.A.removeZone=function isc_Calendar_removeZone(_1){if(!_1||!this.zones)return;if(isc.isA.String(_1))_1=this.zones.find(this.nameField,_1);if(_1){this.zones.remove(_1);this.setZones(this.zones)}},isc.A.zoneClick=function isc_Calendar_zoneClick(_1,_2){return true},isc.A.getZoneCanvas=function isc_Calendar_getZoneCanvas(_1,_2){var _3={calendar:this,calendarView:_2,event:_1,isZoneCanvas:true,styleName:this.getZoneCanvasStyle(_1,_2)};var _4=this.createAutoChild("zoneCanvas",_3,this.zoneCanvasConstructor);if(this.customizeCanvas)this.customizeCanvas(_4,_2);return _4},isc.A.$131j=function isc_Calendar__getEventStyleName(_1){return _1[this.eventWindowStyleField]||_1[this.eventStyleNameField]},isc.A.getZoneCanvasStyle=function isc_Calendar_getZoneCanvasStyle(_1,_2){_2=_2||this.getSelectedView();var _3=this.$131j(_1)||(_2&&_2.zoneStyleName)||this.zoneStyleName;return _3},isc.A.setShowIndicators=function isc_Calendar_setShowIndicators(_1){this.showIndicators=_1;var _2=this.timelineView;if(_2&&_2.isSelectedView())_2.refreshEvents("setShowIndicators");else if(_2)_2.$123s=true},isc.A.getIndicatorCanvas=function isc_Calendar_getIndicatorCanvas(_1,_2){_2=_2||this.getSelectedView();var _3={calendar:this,calendarView:_2,event:_1,isIndicatorCanvas:true,styleName:this.getIndicatorCanvasStyle(_1,_2),dragTarget:_2.eventDragCanvas},_4=this.createAutoChild("indicatorCanvas",_3,this.indicatorCanvasConstructor);if(this.customizeCanvas)this.customizeCanvas(_4,_2);return _4},isc.A.getIndicatorCanvasStyle=function isc_Calendar_getIndicatorCanvasStyle(_1,_2){_2=_2||this.getSelectedView();return this.$131j(_1)||(_2&&_2.indicatorStyleName)||this.indicatorStyleName},isc.A.setIndicators=function isc_Calendar_setIndicators(_1){if(!_1){return}
this.indicators=_1;if(this.timelineView){this.timelineView.drawIndicators()}},isc.A.addIndicator=function isc_Calendar_addIndicator(_1){if(!_1)return;this.indicators=this.indicators||[];this.indicators.add(_1);this.setIndicators(this.indicators)},isc.A.removeIndicator=function isc_Calendar_removeIndicator(_1){if(!_1||!this.indicators)return;if(isc.isA.String(_1))_1=this.indicators.find(this.nameField,_1);if(_1){this.indicators.remove(_1);this.setIndicators(this.indicators)}},isc.A.createColumnLayout=function isc_Calendar_createColumnLayout(_1,_2,_3){if(!this.showColumnLayouts)return;_3=isc.addProperties({},this.columnLayoutProperties,_3);_3.calendar=this;_3.calendarView=_1;_3.fieldName=_2;return this.createAutoChild("columnLayout",_3)},isc.A.$129r=function isc_Calendar__getEventCanvas(_1,_2){var _3=isc.addProperties({calendar:this,calendarView:_2,overflow:this.showColumnLayouts?"visible":(this.showEventCanvasComponents?"auto":"hidden")},this.eventCanvasDefaults,this.eventCanvasProperties);if(_3.hoverAutoFitWidth==null){_3.hoverAutoFitWidth=this.hoverAutoFitWidth}
if(_3.hoverAutoFitMaxWidth==null){_3.hoverAutoFitMaxWidth=this.hoverAutoFitMaxWidth}
var _4=this.getEventCanvasConstructor(_1,_2),_5=this.createAutoChild("eventCanvas",_3,_4);_2.$232l[_5.ID]=_5;_2.$232n[_5.ID]=_1.$232p;_2.$232j[_1.$232p]=_5.ID;return _5},isc.A.$53g=function isc_Calendar__getEventsInRange(_1,_2,_3,_4){var _5=[],_6=this.getWeekendDays(),_7=this.data.getLength(),_8=[],_9=_1.getTime(),_10=_2.getTime();_3=_3||this.getSelectedView();if(_4){var _11=_3.body.getVisibleColumns();if(_11[0]>=0&&_11[1]>=0){for(var i=_11[0];i<=_11[1];i++){_8.add(_3.body.fields[i][this.laneNameField])}}}
for(var i=0;i<_7;i++){var _13=this.data.get(i),_14=this.getEventStartDate(_13),_15=this.getEventEndDate(_13);if(_4&&!_8.contains(_13[this.laneNameField]))continue;if(!_13||!_14)return[];if(this.shouldAllowLongEvents()){if(_15.getTime()>_1.getTime()&&_14.getTime()<_2.getTime()){if(_3&&(_3.isWeekView()||_3.isMonthView()))_5.add(_13);else if(!this.showDayLanes||_8.contains(_13[this.laneNameField]))
_5.add(_13)}}else{if(_14.getTime()>=_1.getTime()&&_14.getTime()<_2.getTime()&&(this.showWeekends||!_6.contains(_14.getDay())))
{if(_3&&(_3.isWeekView()||_3.isMonthView()))_5.add(_13);else if(!this.showDayLanes||_8.contains(_13[this.laneNameField]))
_5.add(_13)}}}
return _5},isc.A.getDayEnd=function isc_Calendar_getDayEnd(_1){return isc.DateUtil.getEndOf(_1,"d",false,this.firstDayOfWeek)},isc.A.isTimeline=function isc_Calendar_isTimeline(){var _1=this.getCurrentViewName()=="timeline";return _1},isc.A.setChosenDate=function isc_Calendar_setChosenDate(_1,_2){var _3=this.getSelectedView();if(!this.showWeekends&&isc.DateUtil.isWeekend(_1)){_1=isc.DateUtil.getNextWeekday(_1,this.getWeekendDays())}
if(this.chosenDate){var _4=isc.DateUtil.getLogicalDateOnly(_1);if(isc.DateUtil.compareLogicalDates(this.chosenDate,_4)==0)
{return}}
var _5=this.month,_6=this.year;this.chosenDate=isc.DateUtil.getLogicalDateOnly(_1);this.year=this.chosenDate.getFullYear();this.month=this.chosenDate.getMonth();this.displayDate=this.chosenDate.getDate();if(this.monthViewSelected()&&(this.month!=_5||this.year!=_6)){this.hideEventDialog();this.cancelGhostDrag()}
if(this.dayView)this.dayView.setChosenDate(this.chosenDate);if(this.weekView)this.weekView.setChosenDate(this.chosenDate);if(this.monthView)this.monthView.setChosenDate(this.chosenDate);if(this.timelineView)this.timelineView.setChosenDate(_1);if(this.monthButton)this.updateMonthButton();this.setDateLabel();this.dateChanged()},isc.A.dateIsWorkday=function isc_Calendar_dateIsWorkday(_1,_2){if(!_1||!this.workdays)return false;var _3=isc.DateUtil.getLogicalDateOnly(_1);return this.workdays.contains(_3.getDay())},isc.A.adjustCriteria=function isc_Calendar_adjustCriteria(_1){return _1},isc.A.shouldIncludeRangeCriteria=function isc_Calendar_shouldIncludeRangeCriteria(_1){_1=_1||this.getSelectedView();if(_1&&_1.includeRangeCriteria!=null)return _1.includeRangeCriteria;return this.includeRangeCriteria},isc.A.$wo=function isc_Calendar__filter(_1,_2,_3,_4,_5){var _6=this.getSelectedView();this.$289c=_3;this.$289d=isc.addProperties({},_4);if(!_6||!_6.isDrawn()){if(!this.$2830&&_6&&_6.isTimelineView()){this.logDebug("$wo called on Timeline: $271e set to true:"+this.getStackTrace())}
this.$2830=true;this.$2831=_3;this.$2832=_4;this.initialCriteria=isc.DS.copyCriteria(_2);return}
if(_6.isTimelineView()){this.logDebug("$wo called on Timeline: "+this.getStackTrace())}
this.initialCriteria=isc.DS.copyCriteria(_2);if(this.shouldIncludeRangeCriteria(_6)){if(_2){_2=isc.DS.removeCriteriaForField(_2,this.startDateField);_2=isc.DS.removeCriteriaForField(_2,this.endDateField)}
var _7=this.getRangeCriteria(_6);if(_7){if(!_2||isc.isA.emptyObject(_2))_2=_7;else{_2=isc.DS.combineCriteria(_2,_7)}
_4=_4||{};_4.sortBy=[{property:this.startDateField,direction:"ascending"},{property:this.endDateField,direction:"ascending"}]}
_2=isc.DS.compressNestedCriteria(_2);this.$2755=isc.DataSource.copyCriteria(_7)}
return this.Super("$wo",arguments)},isc.A.setCriteria=function isc_Calendar_setCriteria(_1){this.initialCriteria=_1},isc.A.getCriteria=function isc_Calendar_getCriteria(){var _1=this.data;if(_1&&_1.getCriteria)return isc.DS.copyCriteria(_1.getCriteria());return isc.DS.copyCriteria(this.initialCriteria)},isc.A.getRangeCriteria=function isc_Calendar_getRangeCriteria(_1){_1=_1||this.getSelectedView();if(!_1){return null}
if(!this.shouldIncludeRangeCriteria(_1))return null;var _2=null,_3=null,_4={},_5=_1.rangeCriteriaMode||this.rangeCriteriaMode||"none";if(_5=="auto"){var _6=this.getLargestScrollableRange();_2=_6[0];_3=_6[1]}else if(_5!="none"){_2=this.getVisibleStartDate(_1);_3=this.getVisibleEndDate(_1)}
if(_2&&_3){_4={_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:this.startDateField,operator:"lessThan",value:_3},{fieldName:this.endDateField,operator:"greaterThan",value:_2}]}}
_4=this.adjustCriteria(_4);return _4},isc.A.next=function isc_Calendar_next(){var _1;if(this.dayViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month,this.displayDate+1);if(!this.showWeekends&&isc.DateUtil.isWeekend(_1)){_1=isc.DateUtil.getNextWeekday(_1,this.getWeekendDays())}}else if(this.weekViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month,this.chosenDate.getDate()+7)}else if(this.monthViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month+1,1)}else if(this.timelineViewSelected()){this.timelineView.nextOrPrev(true);return}
if(this.showDateChooser&&this.dateChooser)this.dateChooser.setData(_1);this.setChosenDate(_1)},isc.A.previous=function isc_Calendar_previous(){var _1;if(this.dayViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month,this.displayDate-1);if(!this.showWeekends&&isc.DateUtil.isWeekend(_1)){_1=isc.DateUtil.getPreviousWeekday(_1,this.getWeekendDays())}}else if(this.weekViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month,this.displayDate-7)}else if(this.monthViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month-1,1)}else if(this.timelineViewSelected()){this.timelineView.nextOrPrev(false);return}
if(this.showDateChooser)this.dateChooser.setData(_1);this.setChosenDate(_1)},isc.A.dataArrived=function isc_Calendar_dataArrived(){if(this.$1746)this.dataChanged();var _1=this.getSelectedView();if(_1&&_1.isTimelineView()||_1.isMonthView())
_1.refreshEvents();return true},isc.A.invalidateCache=function isc_Calendar_invalidateCache(){var _1=this.Super("invalidateCache",arguments);delete this.$2755;this.refreshSelectedView();return _1},isc.A.refreshData=function isc_Calendar_refreshData(){this.invalidateCache()},isc.A.draw=function isc_Calendar_draw(_1,_2,_3,_4){this.$1737=true;this.invokeSuper(isc.Calendar,"draw",_1,_2,_3,_4);if(isc.ResultSet&&isc.isA.ResultSet(this.data)&&this.dataSource){if(!this.isObserving(this.data,"dataArrived")){this.observe(this.data,"dataArrived","observer.dataArrived(arguments[0], arguments[1])")}}
if(this.mainView.isA("TabSet")){if(this.showControlsBar!=false){this.mainView.addChild(this.controlsBar);this.controlsBar.moveAbove(this.mainView.tabBar)}}
if(!isc.isA.TabSet(this.mainView)){this.setChosenDate(this.startDate||this.chosenDate)}else{this.setDateLabel()}
delete this.$1737;if(this.$2830){if(this.autoFetchData||this.$283a){this.refreshData()}}
if(this.$187g){var _5=this.$187g;delete this.$187g;this.scrollToTime(_5)}
this.$283a=true},isc.A.shouldAllowLongEvents=function isc_Calendar_shouldAllowLongEvents(){return this.allowLongEvents},isc.A.getLongEventHTML=function isc_Calendar_getLongEventHTML(_1,_2,_3){if(!_1)return null;var _4="",_5=this.getEventStartDate(_1),_6=this.getEventEndDate(_1),_7=!!_1[this.allDayField],_8=isc.DateUtil.compareLogicalDates(_5,_6)!=0;if(_8){if(_7){_4=_5.toShortDate()+" - "+_6.toShortDate()}else{_4=_5.toShortDatetime()+" - "+_6.toShortDatetime()}}else{_4=_5.toShortDate()}
if(_7)_4=" ["+this.eventAllDayFieldTitle+"] "+_4;var _9=_1[this.nameField];var _10=_3.getCurrentEventCanvas(_1);if(_9){if(this.shouldEscapeFieldHTML(this.nameField)||(_10&&_10.escapeHTML)){_9=_9.asHTML()}}
return"<span style='overflow:hidden; text-overflow:ellipsis;'><nobr>"+(_9?_9+" - ":"")+_4+"</nobr></span>"},isc.A.getLongEventHoverHTML=function isc_Calendar_getLongEventHoverHTML(_1,_2,_3){return this.getLongEventHTML(_1,_2,_3)},isc.A.getLongEventLayoutHoverHTML=function isc_Calendar_getLongEventLayoutHoverHTML(_1,_2){var _3=_1.getMouseDates();if(!_3)return;return isc.DateUtil.format(_3[0],"dddd, dd MMMM yyyy")},isc.A.isLongEvent=function isc_Calendar_isLongEvent(_1,_2){if(!_2&&_1[this.allDayField])return true;var _3=this.getEventStartDate(_1),_4=this.getEventEndDate(_1);if(isc.DateUtil.compareLogicalDates(_3,_4)!=0)return true;return false},isc.A.$232v=function isc_Calendar__getTabPane(_1){var _2={viewName:_1,calendar:this,baseStyle:this.baseStyle,startDate:this.startDate,chosenDate:this.chosenDate,autoDraw:false,hoverMoveWithMouse:this.hoverMoveWithMouse};if(_1=="day"){this.dayView=this.createAutoChild("dayView",isc.addProperties({},_2,{cellHeight:this.rowHeight,enforceVClipping:true}));return this.dayView}else if(_1=="week"){this.weekView=this.createAutoChild("weekView",isc.addProperties({$128r:true},_2,{cellHeight:this.rowHeight,enforceVClipping:true}));return this.weekView}else if(_1=="month"){var _3={};if(this.shouldAllowLongEvents()){_3={showRecordComponents:true,recordComponentPosition:"above",recordComponentPoolingMode:"recycle",canvasHeight:this.longEventHeight,canvasSpacing:this.longEventSpace,createRecordComponent:function(_11,_8){if(_11.isHeaderRow){return}
var _4=this.createAutoChild("longEventsLayout",{calendarView:this,calendar:this.calendar,styleName:this.calendar.longEventLayoutStyleName,handleMouseDown:function(){var _5=this.calendarView,_6=_5.body,_7=_6.getEventRow(),_8=_6.getEventColumn(),_9=_5.getCellStartDate(_7,_8),_10=_5.getCellEndDate(_7,_8);if(!this.calendar.shouldDisableDate(_9,_5)){_5.$288v=true;_5.startGhostDragCreate(_9,_10)}
return false}});this.longEventsLayouts.add(_4);return _4},updateRecordComponent:function(_11,_8,_12,_13){if(_11.isHeaderRow)return;_12.$278n=true;return _12}}}
this.monthView=this.createAutoChild("monthView",isc.addProperties({},_3,_2,{bodyConstructor:"MonthScheduleBody"}));return this.monthView}else if(_1=="timeline"){this.timelineView=this.createAutoChild("timelineView",isc.addProperties({},_2));return this.timelineView}},isc.A.$653=function isc_Calendar__getTabs(){var _1=[];if(this.showDayView!=false){_1.add({title:this.dayViewTitle,pane:null,viewName:"day",name:"day"})}
if(this.showWeekView!=false){_1.add({title:this.weekViewTitle,pane:null,viewName:"week",name:"week"})}
if(this.showMonthView!=false){_1.add({title:this.monthViewTitle,pane:null,viewName:"month",name:"month"})}
if(this.showTimelineView!=false){_1.add({title:this.timelineViewTitle,pane:null,viewName:"timeline",name:"timeline"})}
return _1},isc.A.$655=function isc_Calendar__createTabSet(_1){if(_1.length>1){this.mainView=this.createAutoChild("mainView",{tabs:_1,$8c:function(_7){var _2=this.creator;this.Super("$8c",arguments);var _3=this.getTabPane(_7);if(!_3){this.updateTab(_7,_2.$232v(_7.viewName));_3=this.getTabPane(_7)}
_2.$567=_3.viewName;_2.setDateLabel();var _4=_2.getSelectedView();_2.hideEventDialog();_2.cancelGhostDrag();if(_4.$220m)_4.updateRange();if(_4.isDrawn())_4.redraw();else{_4.$191w=true}
if(_4.$123s){_4.$1739()}
if(!_4.$191w){_2.currentViewChanged(_3.viewName)}}});var _5;if(this.currentViewName){_5=_1.find("viewName",this.currentViewName);if(_5)this.mainView.selectTab(_5)}else if(this.minimalUI){this.pageOrientationChanged()}else{var _6=this.weekView?"week":(this.dayView?"day":(this.monthView?"month":(this.timelineView?"timeline":null)));if(_6){_5=_1.find("viewName",_6);if(_5){this.mainView.selectTab(_5);this.mainView.viewName=_6;this.$567=_6}}}}else{this.mainView=this.$232v(_1[0].viewName)}},isc.A.getLaneMap=function isc_Calendar_getLaneMap(){if(!this.isTimeline()&&!this.showDayLanes)return{};if(this.laneMap)return this.laneMap;var _1=this.showDayLanes?this.lanes:this.canGroupLanes?this.timelineView.getOriginalData():this.timelineView.data,_2={};for(var i=0;i<_1.length;i++){var _4=_1[i].name||_1[i][this.laneNameField],_5=_1[i].title||_4;_2[_4]=_5}
this.laneMap=isc.addProperties({},_2);return _2},isc.A.getSublaneMap=function isc_Calendar_getSublaneMap(_1,_2){_2=_2||this.getSelectedView();var _3={};if(isc.isA.String(_1))_1=_2.getLane(_1);if(_1&&_1.sublanes){for(var i=0;i<_1.sublanes.length;i++){var _5=_1.sublanes[i],_6=_5.name||_5[this.laneNameField],_7=_5.title||_6;_3[_6]=_7}}
return _3},isc.A.getLanePadding=function isc_Calendar_getLanePadding(_1){_1=_1||this.getSelectedView();if(_1&&_1.useLanePadding())return this.laneEventPadding;return 0},isc.A.setLaneTitle=function isc_Calendar_setLaneTitle(_1,_2){var _3=this.getSelectedView();if(_3&&_3.setLaneTitle){return _3.setLaneTitle(_1,_2)}
return false},isc.A.getLaneEvents=function isc_Calendar_getLaneEvents(_1,_2){var _3=isc.isAn.Object(_1)?_1.name:_1;if(!_3||!isc.isA.String(_3))return[];_2=_2||this.getSelectedView();var _4=this.data.findAll(this.laneNameField,_3)||[],_5=[];for(var i=0;i<_4.length;i++){var _7=_4[i];if(!_7)continue;if(this.shouldShowEvent(_7,_2)){_5.add(_7)}}
return _5},isc.A.laneHasVisibleEvents=function isc_Calendar_laneHasVisibleEvents(_1,_2){var _3=isc.isAn.Object(_1)?_1.name:_1;if(!_3||!isc.isA.String(_3))return[];_2=_2||this.getSelectedView();var _4=this.data.findAll(this.laneNameField,_3)||[];for(var i=0;i<_4.length;i++){if(!_4[i])continue;if(this.shouldShowEvent(_4[i],_2))return true}
return false},isc.A.getSublaneEvents=function isc_Calendar_getSublaneEvents(_1,_2,_3){var _4=isc.isAn.Object(_1)?_1.name:_1,_5=isc.isAn.Object(_2)?_2.name:_2;if((!_4||!isc.isA.String(_4))||(!_5||!isc.isA.String(_5))){return[]}
_3=_3||this.getSelectedView();var _6=this.getLaneEvents(_4,_3),_7=_6.findAll(this.sublaneNameField,_5);return _7},isc.A.createChildren=function isc_Calendar_createChildren(){var _1=this.$653();this.$655(_1);var _2=20;if(this.showControlsBar!=false){var _3={};if(this.dateLabelStyleName)_3.styleName=this.dateLabelStyleName;this.dateLabel=this.createAutoChild("dateLabel",_3);this.addEventButton=this.createAutoChild("addEventButton",{baseStyle:this.controlBarIconBaseStyle,width:this.controlBarIconSize,height:this.controlBarIconSize,click:function(){var _4=this.creator;var _5=_4.getSelectedView();var _6=_5.chosenDate.duplicate(),_7=null,_8=_6.duplicate();if(_5.isDayView()){_6=_8;_7=_6.duplicate();_7.setHours(_7.getHours()+1)}else if(_5.isWeekView()){if(_5.startDate.getTime()>_6.getTime()){_6=_5.startDate.duplicate()}
if(!this.showWeekends){var _9=_4.getWeekendDays();for(var i=0;i<_9.length;i++){if(_9.contains(_6.getDay()))_6.setDate(_6.getDate()+1)}}
_6.setMinutes(0);if(_6.getHours()>22){_6.setDate(_6.getDate()+1);_6.setHours(0)}
else _6.setHours(_6.getHours()+1);_7=_6.duplicate();_7.setHours(_7.getHours()+1)}else if(_5.isMonthView()){_8.setDate(1);_6=_8.duplicate();_7=_6.duplicate();_7.setHours(_7.getHours()+1)}else if(_4.isTimeline()){var _11=_4.timelineView,_12=_11.getVisibleDateRange();_6=_12[0];_7=_6.duplicate();_7=_11.addUnits(_7,1,_4.timelineGranularity)}
var _13={};_13[_4.startDateField]=_6;_13[_4.endDateField]=_7;_4.showEventEditor(_13,true)}});this.datePickerButton=this.createAutoChild("datePickerButton",{baseStyle:this.controlBarIconBaseStyle,width:this.controlBarIconSize,height:this.controlBarIconSize,click:function(){var _4=this.creator;var _14=_4.getDateChooser();_14.firstDayOfWeek=_4.firstDayOfWeek;var _15=_4.getSelectedView();var _16=_4.getSelectedView().showDateChooserTimeItem;if(_16==null){var _17=_4.getDateEditingStyle();_16=!(_17=="date")}
if(_16!=null){_14.showTimeItem=_16;_14.showApplyButton=_16}
_14.setData(_15.chosenDate,_16==null);if(!_14.isDrawn())_14.draw();else _14.redraw();_14.placeNear(this.getPageLeft(),this.getPageTop()+this.getHeight());_14.show()}});if(this.minimalUI&&this.showMonthButton!=false&&this.showMonthView!=false){this.monthButton=this.createAutoChild("monthButton",{icon:this.monthButtonIconSrc});this.monthButton.setTopPadding(0);this.monthButton.setBottomPadding(0);this.updateMonthButton()}
this.previousButton=this.createAutoChild("previousButton",{baseStyle:this.controlBarIconBaseStyle,width:this.controlBarIconSize,height:this.controlBarIconSize});this.nextButton=this.createAutoChild("nextButton",{baseStyle:this.controlBarIconBaseStyle,width:this.controlBarIconSize,height:this.controlBarIconSize})}
var _18=[];if(this.monthButton)_18.add(this.monthButton);if(this.showPreviousButton!=false)_18.add(this.previousButton);if(this.showDateLabel!=false)_18.add(this.dateLabel);if(this.showDatePickerButton!=false)_18.add(this.datePickerButton);if(this.canCreateEvents&&this.showAddEventButton!=false)_18.add(this.addEventButton);if(this.showNextButton!=false)_18.add(this.nextButton);var _19={members:_18};if(isc.isA.TabSet(this.mainView))_19.height=this.mainView.tabBarThickness;else _19.height=this.controlsBarHeight;if(this.showControlsBar!=false){this.controlsBar=this.createAutoChild("controlsBar",_19)}
var _4=this;if(!this.children)this.children=[];var _20=[];if(this.showDateChooser){this.addChild(this.getDateChooser());var _21=[];_21.add(this.dateChooser);_20.add(isc.VLayout.create({autoDraw:false,width:"20%",membersMargin:10,layoutTopMargin:10,members:_21}))}
if(this.mainView.isA("TabSet")){_20.add(this.mainView)}else{if(this.showControlsBar!=false){this.controlsBarContainer=this.createAutoChild("controlsBarContainer",{autoDraw:false,height:this.controlsBar.getVisibleHeight(),width:"100%"},isc.HLayout);this.controlsBarContainer.addMember(isc.LayoutSpacer.create({autoDraw:false,width:"*"}));this.controlsBarContainer.addMember(this.controlsBar);this.controlsBarContainer.addMember(isc.LayoutSpacer.create({autoDraw:false,width:"*"}));this.mainLayout=this.createAutoChild("mainLayout",{autoDraw:false,members:[this.controlsBarContainer,this.mainView]},isc.VLayout);_20.add(this.mainLayout)}else{_20.add(this.mainView)}}
this.children.add(isc.HLayout.create({autoDraw:false,overflow:"hidden",width:"100%",height:"100%",members:_20}))},isc.A.getDateChooser=function isc_Calendar_getDateChooser(){if(this.dateChooser)return this.dateChooser;this.dateChooser=this.createAutoChild("dateChooser",{disableWeekends:this.disableChooserWeekends!=null?this.disableChooserWeekends:false,showWeekends:this.showChooserWeekends!=null?this.showChooserWeekends:true,weekendDays:this.getWeekendDays(),chosenDate:this.chosenDate,month:this.month,year:this.year,closeOnEscapeKeypress:true,autoHide:true,autoClose:true,visibility:"hidden",firstDayOfWeek:this.firstDayOfWeek,dataChanged:function(){var _1=this.getData();this.creator.getSelectedView().$2160=true;if(_1){this.creator.setChosenDate(_1);this.creator.getSelectedView().$116v()}
delete this.creator.getSelectedView().$2160;return _1},show:function(){this.Super("show",arguments);this.bringToFront();this.focus()}});this.dateChooser.deparent();return this.dateChooser},isc.A.getEventDialog=function isc_Calendar_getEventDialog(){if(this.eventDialog)return this.eventDialog;var _1=this;this.eventDialog=this.createAutoChild("eventDialog",{items:[isc.DynamicForm.create({autoDraw:false,padding:4,calendar:this,saveOnEnter:true,implicitSave:false,implicitSaveOnBlur:false,useAllDataSourceFields:true,numCols:2,colWidths:[80,"*"],$642:[_1.nameField,_1.laneNameField,_1.sublaneNameField],getCustomValues:function(){if(!this.calendar.eventDialogFields)return;var _2=this.$642;var _3=this.calendar.eventDialogFields;var _4={};for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.name&&!_2.contains(_6.name)){_4[_6.name]=this.getValue(_6.name)}}
return _4},setCustomValues:function(_32){if(!this.calendar.eventDialogFields)return;var _2=this.$642;var _3=this.calendar.eventDialogFields;for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.name&&!_2.contains(_6.name)){this.setValue(_6.name,_32[_6.name])}}},createFields:function(_32){var _1=this.calendar,_7=_1.eventDialog.isNewEvent,_8=_1.isTimeline()||(_1.showDayLanes&&_1.dayViewSelected()),_9=_8&&_1.useSublanes;var _10=[{name:_1.nameField,title:_1.eventNameFieldTitle,type:"text",width:250,wrapTitle:false},{name:_1.laneNameField,title:_1.eventLaneFieldTitle,type:"select",width:150,valueMap:_1.getLaneMap(),showIf:_8?"true":"false",changed:function(_33,_34,_35){var _11=_1.lanes.find("name",_35);if(_35&&_11){var _12=_33.getItem(_1.sublaneNameField);if(_12)_12.setValueMap(_1.getSublaneMap(_11))}}},{name:_1.sublaneNameField,title:_1.eventSublaneFieldTitle,type:"select",width:150,valueMap:[],showIf:_9?"true":"false"},{name:"save",title:_1.saveButtonTitle,editorType:"SubmitItem",endRow:false},{name:"details",title:_1.detailsButtonTitle,type:"button",startRow:false,click:function(_33,_34){var _1=_33.calendar,_13=_1.eventDialog.isNewEvent,_14=_1.eventDialog.event||{},_15=_33.getValue(_1.nameField),_16=_33.getValue(_1.laneNameField),_17=_33.getValue(_1.sublaneNameField);if(_13){_14[_1.nameField]=_15;if(_16)_14[_1.laneNameField]=_16;if(_17)_14[_1.sublaneNameField]=_16}
_1.showEventEditor(_14,_13)}}];if(this.ds){if(this.ds.destroy)this.ds.destroy();this.ds=null}
this.ds=isc.DataSource.create({fields:_10,clientOnly:true});this.setDataSource(this.ds);this.setFields(isc.shallowClone(this.calendar.eventDialogFields))},submit:function(){var _1=this.calendar,_7=_1.eventDialog.isNewEvent,_18=_1.eventDialog.event||{},_19=_1.eventDialog.currentStart,_20=_1.eventDialog.currentEnd,_21=this,_11=null,_22=null;if(!_21.validate())return;if(_1.isTimeline()||(_1.dayViewSelected()&&_1.showDayLanes)){_11=_21.getValue(_1.laneNameField);_22=_21.getValue(_1.sublaneNameField)}
var _23=isc.addProperties({},_21.getCustomValues());_1.hideEventDialog();_1.$1115=true;var _24=_1.createEventObject(_18,_18[_1.startDateField],_18[_1.endDateField],_11,_22,_21.getValue(_1.nameField));if(!_7){_1.updateCalendarEvent(_18,_24,_23,"dialog")}else{_1.addCalendarEvent(_24,_23,"dialog")}},getCalendarView:function(){return this.calendar.getSelectedView()},destroy:function(){if(this.ds){if(this.ds.destroy)this.ds.destroy();this.ds=null}
this.calendar=null;return this.Super("destroy",arguments)}})],setDate:function(_29,_30){var _1=this.creator;if(!_30){if(_29.getHours()==23&&_29.getMinutes()==(60-_1.getSelectedView().getTimePerCell())){_30=isc.DateUtil.createDatetime(_29.getFullYear(),_29.getMonth(),_29.getDate()+1)}else{_30=isc.DateUtil.createDatetime(_29.getFullYear(),_29.getMonth(),_29.getDate(),_29.getHours()+1,_29.getMinutes())}}
this.logicalStartDate=isc.DateUtil.getLogicalDateOnly(_29);this.logicalStartTime=isc.DateUtil.getLogicalTimeOnly(_29);this.logicalEndDate=isc.DateUtil.getLogicalDateOnly(_30);this.logicalEndTime=isc.DateUtil.getLogicalTimeOnly(_30);this.setTitle(_1.$53k(_29,_30,this.event));if(this.isNewEvent){this.event[_1.startDateField]=_29.duplicate();this.event[_1.endDateField]=_30.duplicate()}
this.currentStart=_29;this.currentEnd=_30;this.items[0].setValue(_1.nameField,"")},setLane:function(_11){var _1=this.creator;if(isc.isA.Number(_11))_11=_1.lanes[_11].name;this.items[0].getItem(_1.laneNameField).setValue(_11)},setEvent:function(_14){this.event=_14;var _25=this.items[0],_26=this.items[1],_1=this.creator,_27=_1.getSelectedView(),_13=!!this.isNewEvent,_28=_13||_1.canEditEventLane(_14,_27);if(_27.usesLanes())_25.getItem(_1.laneNameField).setDisabled(!_28);if(_1.eventDialogFields){_25.clearErrors(true);_25.setCustomValues(_14)}
var _29=_1.getEventStartDate(_14),_30=_1.getEventEndDate(_14);if(!_29){_1.logWarn("Event has no valid "+_1.startDateField+" field");return}
this.setDate(_29,_30);if(_27.hasSublanes()&&_14[_1.laneNameField]){var _11=_27.getLane(_14[_1.laneNameField]);if(_11){var _12=_25.getItem(_1.sublaneNameField);_12.setValueMap(_1.getSublaneMap(_11))}}
_25.setValues(_14)},closeClick:function(){this.Super('closeClick',arguments);if(this.creator.canSelectEvents){var _27=this.creator.getSelectedView(),_31=_27&&_27.getCurrentEventCanvas(this.event);if(_31&&_31.$kk()){_31.focus()}}
this.creator.clearViewSelection()},show:function(){if(this.creator.showQuickEventDialog){if(!this.isDrawn())this.draw();this.Super('show',arguments);this.items[0].getItem(this.creator.nameField).focusInItem()}else{this.creator.showEventEditor(this.event,this.isNewEvent)}},hide:function(){var _27=this.creator.getSelectedView();if(_27&&_27.calendar.allowLongEvents){_27.cancelGhostDrag()}
this.Super('hide',arguments);this.moveTo(0,0)},destroy:function(){this.calendar=null;this.Super("destroy",arguments)}});this.eventDialog.form=this.eventDialog.items[0];this.addChild(this.eventDialog);return this.eventDialog});isc.evalBoundary;isc.B.push(isc.A.getEventEditorLayout=function isc_Calendar_getEventEditorLayout(){if(this.eventEditorLayout)return this.eventEditorLayout;var _1=this;this.eventEditor=this.createAutoChild("eventEditor",{useAllDataSourceFields:true,titleWidth:80,width:"100%",height:"100%",calendar:this,initWidget:function(){this.invokeSuper(isc.DynamicForm,"initWidget",arguments);var _1=this.creator;this.timeFormat=_1.timeFormat;this.rebuildFieldList()},rebuildFieldList:function(){var _1=this.creator,_2=_1.getSelectedView(),_3=[],_4=_1.getDateEditingStyle(),_5=_1.showEventEditorErrorsInline;this.showInlineErrors=_5;this.validateOnExit=true;var
_6=[{name:"endType",type:"text",showTitle:false,width:"*",editorType:"SelectItem",textAlign:"right",valueMap:[_1.eventDurationFieldTitle,_1.eventEndDateFieldTitle],endRow:false,changed:function(_19,_74,_75){var _1=_19.calendar;_4=_1.getDateEditingStyle();if(_75==_1.eventDurationFieldTitle){_19.getItem(_1.durationField).show();_19.getItem(_1.durationUnitField).show();if(_4=="time"){_19.getItem("endHours").hide();_19.getItem("endMinutes").hide();_19.getItem("endAMPM").hide()}else{_19.getItem(_1.endDateField).hide()}}else{_19.getItem(_1.durationField).hide();_19.getItem(_1.durationUnitField).hide();if(_4=="time"){_19.getItem("endHours").show();_19.getItem("endMinutes").show();_19.getItem("endAMPM").show()}else{_19.getItem(_1.endDateField).show()}}}},{name:_1.durationField,type:"integer",editorType:"SpinnerItem",title:_1.eventDurationFieldTitle,endRow:false,showTitle:false,width:"*",colSpan:1,defaultValue:1},{name:_1.durationUnitField,type:"text",showTitle:false,endRow:true,title:_1.eventDurationUnitFieldTitle,width:"*",colSpan:1,valueMap:_1.getDurationUnitMap(),defaultValue:"minute"}];this.$642=[_1.nameField,_1.laneNameField,_1.sublaneNameField];this.$642.addList([_1.nameField,_1.descriptionField,_1.allDayField,_1.startDateField,"endType",_1.durationField,_1.durationUnitField,_1.endDateField]);if(_2.usesLanes()){var _7=_1.getLaneMap(),_8={name:_1.laneNameField,title:_1.eventLaneFieldTitle,type:"select",valueMap:_7,endRow:true,width:"*",colSpan:3,changed:function(_19,_74,_75){var _1=_19.calendar;var _9=_1.lanes.find("name",_75);if(_75&&_9){var _10=_19.getItem(_1.sublaneNameField);if(_10)_10.setValueMap(_1.getSublaneMap(_9))}}};_3.add(_8);if(_1.useSublanes){var _11={},_12={name:_1.sublaneNameField,title:_1.eventSublaneFieldTitle,type:"select",valueMap:_11,endRow:true,width:"*",colSpan:3};_3.add(_12)}}
this.numCols=9;_3.add({name:_1.startDateField,title:_1.eventStartDateFieldTitle,type:"datetime",colSpan:2,endRow:!_1.shouldAllowLongEvents(),showIf:function(_74,_75,_19,_41){return _19.getValue("multiDay")&&!_19.getValue("allDay")},changed:function(_19,_74,_75){var _13=_19.calendar.eventEditorLayout;_13.setCurrentStart(_75)}});_3.add({name:"logicalStartDate",title:_1.eventEditorDateFieldTitle,type:"date",colSpan:2,endRow:!_1.shouldAllowLongEvents(),showIf:function(_74,_75,_19,_41){return!_19.getValue("multiDay")||_19.getValue("allDay")},changed:function(_19,_74,_75){var _13=_19.calendar.eventEditorLayout;var _14=_13.currentStart.duplicate();_14.setFullYear(_75.getFullYear());_14.setMonth(_75.getMonth());_14.setDate(_75.getDate());_13.setCurrentStart(_14)}});_3.add({name:_1.allDayField,title:_1.eventAllDayFieldTitle,type:"boolean",colSpan:1,endRow:false,startRow:false,showTitle:false,showIf:function(_74,_75,_19,_41){return _1.shouldAllowLongEvents()&&!_2.isTimelineView()},changed:function(_19,_74,_75){var _15=isc.addProperties({},_19.parentElement.creator.event,_19.getValues());_19.updateFieldsForLongEvent(_15);_19.validate()}});_3.add({name:"multiDay",title:_1.eventMultiDayFieldTitle,type:"boolean",colSpan:1,endRow:true,startRow:false,showTitle:false,showIf:function(_74,_75,_19,_41){return _1.shouldAllowLongEvents()&&!_2.isTimelineView()},changed:function(_19,_74,_75){var _15=isc.addProperties({},_19.parentElement.creator.event,_19.getValues());_19.updateFieldsForLongEvent(_15);_19.validate()}});var _16={name:_1.endDateField,title:_1.eventEndDateFieldTitle,type:"datetime",colSpan:"*",endRow:true,showIf:function(_74,_75,_19,_41){if(_19.creator.allowDurationEvents)
return false;return _19.getValue("multiDay")&&!_19.getValue("allDay")},changed:function(_19,_74,_75){var _13=_19.calendar.eventEditorLayout;_13.setCurrentEnd(_75)}};var _17={name:"logicalEndDate",title:_1.eventEndDateFieldTitle,type:"date",colSpan:2,endRow:!_1.shouldAllowLongEvents(),showIf:function(_74,_75,_19,_41){if(_19.creator.allowDurationEvents)
return false;return _19.getValue("multiDay")&&_19.getValue("allDay")},changed:function(_19,_74,_75){var _13=_19.calendar.eventEditorLayout;var _14=_13.currentEnd.duplicate();_14.setFullYear(_75.getFullYear());_14.setMonth(_75.getMonth());_14.setDate(_75.getDate());_13.setCurrentEnd(_14)}};if(_5){var _18={type:"custom",condition:function(_74){var _19=_74.form,_20=_19.getValue(_1.endDateField),_21=_19.getValue(_1.startDateField);return!_21||!_20||_20>=_21},errorMessage:_1.invalidDateMessage};_16.validators=[_18];_17.validators=[_18]}
_3.add(_16);_3.add(_17);var _22=_1.allowDurationEvents;if(_4=="date"||_4=="datetime"){if(_22)_3.addList(_6);if(!_5){_3.addList([{name:"invalidDate",type:"blurb",width:"*",colSpan:"*",visible:false,defaultValue:_1.invalidDateMessage,cellStyle:this.errorStyle||"formCellError",endRow:true}])}}else if(_4=="time"){var _23=isc.SelectItem.getInstanceProperty("textBoxStyle"),_24=isc.SelectItem.getInstanceProperty("controlStyle"),_25=isc.SelectItem.getInstanceProperty("pickerIconStyle"),_26=isc.SelectItem.getInstanceProperty("pickerIconWidth")+isc.Element.getHMarginSize(_23)+isc.Element.$yp(_23)+4;if(_24){_26+=isc.Element.getHMarginSize(_24);_26+=isc.Element.$yp(_24)}
if(_25){_26+=isc.Element.getHMarginSize(_25);_26+=isc.Element.$yp(_25)}
var _27=20;_30=isc.getValues(this.getTimeValues("hours")).join("<br>");var _28=isc.Canvas.measureContent(_30,_23)+_26+_27;_30=isc.getValues(this.getTimeValues("minutes")).join("<br>");var _29=isc.Canvas.measureContent(_30,_23)+_26;var _30=isc.getValues(this.getTimeValues()).join("<br>");var _31=isc.Canvas.measureContent(_30,_23)+_26;this.numCols=7;this.setColWidths([this.titleWidth,_28,_29,_31,"*","*","*"]);var _32=function(_19){var _1=_19.calendar,_33=_19.getValue("startHours"),_34=_19.getValue("startMinutes"),_35=_19.getValue("endHours"),_36=_19.getValue("endMinutes");if(!_1.twentyFourHourTime){_33=_1.$534(_33,_19.getValue("startAMPM"));_35=_1.$534(_35,_19.getValue("endAMPM"))}
if(_35==0&&_36==0){return!(_33==0&&_34==0)}
return(_35>_33)||(_35==_33&&_36>_34)};var _37={name:"startHours",title:_1.eventStartDateFieldTitle,type:"integer",startRow:true,width:_28,editorType:"select",valueMap:this.getTimeValues("hours"),changed:function(_19,_74,_75){var _13=_19.calendar.eventEditorLayout;var d=_13.currentStart.duplicate();d.setHours(_75);_13.setCurrentStart(d)}};var _39={name:"endHours",type:"integer",width:_28,startRow:true,title:_1.eventEndDateFieldTitle,showTitle:!_22,editorType:"select",valueMap:this.getTimeValues("hours"),changed:function(_19,_74,_75){var _13=_19.calendar.eventEditorLayout;var d=_13.currentEnd.duplicate();d.setHours(_75);_13.setCurrentEnd(d)}};if(_5){_37.validators=[{type:"custom",condition:function(_74){var _19=_74.form,_1=_19.calendar;if(_32(_19)){_19.clearFieldErrors("endHours",true)}else{_19.setFieldErrors("endHours",_1.invalidDateMessage,true)}
return true}}];_39.validators=[{type:"custom",condition:function(_74){return _32(_74.form)},errorMessage:_1.invalidDateMessage}]}
_3.addList([_37,{name:"startMinutes",showTitle:false,type:"integer",width:_29,editorType:"select",valueMap:this.getTimeValues("minutes"),changed:function(_19,_74,_75){var _13=_19.calendar.eventEditorLayout;var d=_13.currentStart.duplicate();d.setMinutes(_75);_13.setCurrentStart(d)}},{name:"startAMPM",showTitle:false,type:"select",width:_31,valueMap:this.getTimeValues(),endRow:true,showIf:function(_74){if(!_74.form)return"false";return _74.form.calendar.twentyFourHourTime?"false":"true"}}]);if(!_5){_3.addList([{name:"invalidDate",type:"blurb",colSpan:4,visible:false,defaultValue:_1.invalidDateMessage,cellStyle:this.errorStyle||"formCellError",endRow:true}])}
if(_22)_3.addList(_6);_3.addList([_39,{name:"endMinutes",showTitle:false,type:"integer",width:_29,editorType:"select",valueMap:this.getTimeValues("minutes"),changed:function(_19,_74,_75){var _13=_19.calendar.eventEditorLayout;var d=_13.currentEnd.duplicate();d.setMinutes(_75);_13.setCurrentEnd(d)}},{name:"endAMPM",showTitle:false,type:"select",width:_31,valueMap:this.getTimeValues(),endRow:true,showIf:function(_74){if(!_74.form)return"false";return _74.form.calendar.twentyFourHourTime?"false":"true"}}])}
_3.addList([{name:_1.nameField,title:_1.eventNameFieldTitle,type:"text",colSpan:"*",width:"*",startRow:true},{name:_1.descriptionField,title:_1.eventDescriptionFieldTitle,type:"textArea",colSpan:"*",width:"*",height:50,startRow:true}]);if(this.ds){if(this.ds.destroy)this.ds.destroy();this.ds=null}
this.ds=isc.DataSource.create({fields:_3,clientOnly:true});this.setDataSource(this.ds);var _40=isc.shallowClone(_1.eventEditorFields);this.setFields(_40);this.$172z=true},updateFieldsForLongEvent:function(_75){var _1=this.calendar,_41=this.getValues();var _42=["startHours","startMinutes","endHours","endMinutes"];if(!_1.twentyFourHourTime)_42.addList(["startAMPM","endAMPM"]);var _43=this.getItem("logicalStartDate");if(_43){_43.setTitle(_41.multiDay?_1.eventStartDateFieldTitle:_1.eventEditorDateFieldTitle)}
if(_41.multiDay){if(_41.allDay){this.hideItem(_1.startDateField);this.hideItem(_1.endDateField);this.showItem("logicalStartDate");this.showItem("logicalEndDate")}else{this.showItem(_1.startDateField);this.showItem(_1.endDateField);this.hideItem("logicalStartDate");this.hideItem("logicalEndDate")}
for(var i=0;i<_42.length;i++){this.hideItem(_42[i])}}else{this.hideItem(_1.startDateField);this.hideItem(_1.endDateField);this.hideItem("logicalEndDate");this.showItem("logicalStartDate");for(var i=0;i<_42.length;i++){if(_41.allDay)this.hideItem(_42[i]);else this.showItem(_42[i])}}
this.parentElement.creator.setTitle(_1.$53k(_75[_1.startDateField],_75[_1.endDateField],_75))},getTimeValues:function(_75){var _45={},_1=this.calendar;if(_75=="hours"){var _46=_1.twentyFourHourTime,_47=_46?24:12,_48=_46?0:1;for(var i=0;i<_47;i++){var _49=(i+_48<10?"0":"")+(i+_48);_45[""+(i+_48)]=_49}}else if(_75=="minutes"){for(var i=0;i<60;i++){var _50=i<10?"0"+i:""+i;_45[i+""]=_50}}else{_45["am"]=isc.Time.AMIndicator;_45["pm"]=isc.Time.PMIndicator}
return _45},$642:["startHours","startMinutes","startAMPM","endHours","endMinutes","endAMPM"],getCustomValues:function(){if(!this.creator.eventEditorFields)return;var _1=this.calendar,_51=this.$642;var _52=this.creator.eventEditorFields;var _53={};for(var i=0;i<_52.length;i++){var _54=_52[i];if(_54.name&&!_51.contains(_54.name)){_53[_54.name]=this.getValue(_54.name)}}
return _53},setCustomValues:function(_41){if(!this.calendar.eventEditorFields)return;var _51=this.$642;var _52=this.calendar.eventEditorFields;for(var i=0;i<_52.length;i++){var _54=_52[i];if(_54.name&&!_51.contains(_54.name)){this.setValue(_54.name,_41[_54.name])}}},destroy:function(){if(this.ds){if(this.ds.destroy)this.ds.destroy();this.ds=null}
this.calendar=null;return this.Super("destroy",arguments)}});this.eventEditorLayout=this.createAutoChild("eventEditorLayout",isc.addProperties({calendar:this,setDate:function(_72,_71,_75,_9,_76){if(!_75)_75="";if(!_71){_71=isc.DateUtil.dateAdd(_72,"h")}
var _1=this.calendar;this.logicalStartDate=isc.DateUtil.getLogicalDateOnly(_72);this.logicalStartTime=isc.DateUtil.getLogicalTimeOnly(_72);this.logicalEndDate=isc.DateUtil.getLogicalDateOnly(_71);this.logicalEndTime=isc.DateUtil.getLogicalTimeOnly(_71);this.setTitle(_1.$53k(_72,_71,this.event));this.currentStart=_72;this.currentEnd=_71;var _4=_1.getDateEditingStyle(),_19=this.items[0];_19.setValue(_1.startDateField,_72.duplicate());_19.setValue(_1.endDateField,_71.duplicate());_19.setValue("logicalStartDate",this.logicalStartDate);_19.setValue("logicalEndDate",this.logicalEndDate);var _55=_1.twentyFourHourTime?"toShortPadded24HourTime":_1.timeFormatter,_56=this.logicalStartTime,_57=this.logicalEndTime;_19.setValue("startHours",_56.getHours());_19.setValue("endHours",_57.getHours());_19.setValue("startMinutes",_56.getMinutes());_19.setValue("endMinutes",_57.getMinutes());if(!_1.twentyFourHourTime){_19.setValue("startAMPM",this.getAMPM(_56.getHours()));_19.setValue("endAMPM",this.getAMPM(_57.getHours()))}},getHours:function(_75){if(this.creator.twentyFourHourTime)return _75;else return this.creator.$53n(_75)},getAMPM:function(_75){if(_75<12)return"am";else return"pm"},createButtonLayout:function(){var _1=this.calendar;this.buttonLayout=_1.createAutoChild("eventEditorButtonLayout");this.saveButton=_1.createAutoChild("saveButton",{title:_1.saveButtonTitle,calendar:this.calendar});this.removeButton=this.calendar.createAutoChild("removeButton",{title:_1.removeButtonTitle,calendar:this.calendar});this.cancelButton=this.calendar.createAutoChild("cancelButton",{title:_1.cancelButtonTitle,calendar:this.calendar});var _58=_1.eventEditorButtons;var _59=[];for(var i=0;i<_58.length;i++){var b=_58[i];if(isc.isAn.Instance(b))_59.add(b);else if(isc.isA.String(b)){if(this[b])_59.add(this[b]);else if(_1[b])_59.add(_1[b]);else if(_1[b+"Defaults"]){this[b]=_1.createAutoChild(b,{calendar:this.calendar});_59.add(this[b])}}}
this.buttonLayout.addMembers(_59);this.addItem(this.calendar.eventEditor);this.addItem(this.buttonLayout)},setCurrentStart:function(_75){var _19=this.items[0];this.currentStart=_75;this.logicalStartDate=isc.DateUtil.createLogicalDate(_75);this.logicalStartTime=isc.DateUtil.createLogicalTime(_75);_19.setValue(_1.startDateField,this.currentStart);_19.setValue("logicalStartDate",this.logicalStartDate);_19.setValue("startHours",this.logicalStartTime.getHours());_19.setValue("startMinutes",this.logicalStartTime.getMinutes());if(!_19.getValue("multiDay")){var _61=isc.DateUtil.createLogicalTime(this.currentEnd);var _62=isc.DateUtil.combineLogicalDateAndTime(this.logicalStartDate,_61);this.setCurrentEnd(_62)}},setCurrentEnd:function(_75){var _19=this.items[0];this.currentEnd=_75;this.logicalEndDate=isc.DateUtil.createLogicalDate(_75);this.logicalEndTime=isc.DateUtil.createLogicalTime(_75);_19.setValue(_1.endDateField,this.currentEnd);_19.setValue("logicalEndDate",this.logicalEndDate);_19.setValue("endHours",this.logicalEndTime.getHours());_19.setValue("endMinutes",this.logicalEndTime.getMinutes())},setEvent:function(_75){if(!this.buttonLayout){this.createButtonLayout()}
var _19=this.items[0],_1=this.calendar,_2=this.view,_63=_19.getItem(_1.laneNameField),_64=_19.getItem(_1.sublaneNameField),_22=_1.allowDurationEvents,_65=_19.getItem("endType"),_66=_19.getItem(_1.durationField),_67=_19.getItem(_1.durationUnitField);if(!_1.twentyFourHourTime){if(_19.getItem("startAMPM"))_19.showItem("startAMPM");if(_19.getItem("endAMPM"))_19.showItem("endAMPM")}else{if(_19.getItem("startAMPM"))_19.hideItem("startAMPM");if(_19.getItem("endAMPM"))_19.hideItem("endAMPM")}
this.event=_75;if(_1.eventEditorFields){_19.clearErrors(true);_19.setCustomValues(_75)}
if(_63){_63.setValueMap(_1.getLaneMap());_63.setValue(_75[_1.laneNameField]);_63.setDisabled(this.isNewEvent?false:!_1.canEditEventLane(_75,_2));var _68=_2.isTimelineView()||(_2.isDayView()&&_1.showDayLanes);if(_68)_63.show();else _63.hide()}
if(_64){_64.setValueMap(_1.getSublaneMap(_75[_1.laneNameField]));_64.setValue(_75[_1.sublaneNameField]);_64.setDisabled(this.isNewEvent?false:!_1.canEditEventSublane(_75));var _68=_1.useSublanes&&(_2.isTimelineView()||(_2.isDayView()&&_1.showDayLanes));if(_68)_64.show();else _64.hide()}
if(_22){var _69=_75[_1.durationField],_70=_75[_1.durationUnitField]||"minute";if(_69!=null){_65.setValue(_1.eventDurationFieldTitle);_66.setValue(_69);_66.show();_67.setValue(_70);_67.show();if(_1.getDateEditingStyle()=="time"){if(_19.getField("endHours"))_19.hideField("endHours");if(_19.getField("endMinutes"))_19.hideField("endMinutes");if(_19.getField("endAMPM"))_19.hideField("endAMPM")}else{_19.hideField(_1.endDateField)}}else{_65.setValue(_1.eventEndDateFieldTitle);_66.hide();_67.hide();var _71=_1.getEventEndDate(_75);if(_1.getDateEditingStyle()=="time"){_19.showField("endHours");_19.setValue("endHours",_71.getHours());_19.showField("endMinutes");_19.setValue("endMinutes",_71.getMinutes())}else{_19.showField(_1.endDateField);_19.setValue(_1.endDateField,_71)}}}
var _72=_1.getEventStartDate(_75),_71=_1.getEventEndDate(_75);if(!_72){_1.logWarn("Event has no valid "+_1.startDateField+" field");return}
this.setDate(_72,_71,_75);if(!_75[_1.nameField]){_75[_1.nameField]=this.getDefaultItemValue(_1.nameField)}
_19.setValue(_1.nameField,_75[_1.nameField]);if(!_75[_1.descriptionField]){_75[_1.descriptionField]=this.getDefaultItemValue(_1.descriptionField)}
_19.setValue(_1.descriptionField,_75[_1.descriptionField]);this.originalStart=this.currentStart.duplicate();this.originalEnd=this.currentEnd.duplicate();var _73=_75[_1.allDayField];_19.setValue(_1.allDayField,_73);_19.setValue("multiDay",_1.isLongEvent(_75,true));_19.updateFieldsForLongEvent(_75);if(!this.isNewEvent&&_1.canRemoveEvent(_75,_2))this.removeButton.show();else this.removeButton.hide()},getDefaultItemValue:function(_75){var _19=this.items[0],_74=_19.getItem(_75);return _74&&_74.defaultValue},hide:function(){this.Super('hide',arguments);this.calendar.clearViewSelection();var _19=this.calendar.eventEditor;if(_19){if(this.calendar.showEventEditorErrorsInline){_19.clearErrors(true)}else{_19.hideItem("invalidDate")}}},sizeMe:function(){this.setWidth(this.calendar.mainView.getVisibleWidth());this.setHeight(this.calendar.mainView.getVisibleHeight());this.setLeft(this.calendar.mainView.getLeft())},draw:function(){var _19=this.items&&this.items[0];if(_19&&!_19.$172z)_19.rebuildFieldList();this.Super("draw",arguments)},items:[this.eventEditor]},this.eventEditorLayoutProperties));this.addChild(this.eventEditorLayout);return this.eventEditorLayout},isc.A.hideEventDialog=function isc_Calendar_hideEventDialog(){if(this.eventDialog&&this.eventDialog.isVisible())this.eventDialog.hide()},isc.A.displayEventDialog=function isc_Calendar_displayEventDialog(_1){var _2=this.eventDialog;if(_1&&_2.$193l){_2.placeNear(_2.$193l[0],_2.$193l[1])}
_2.show()},isc.A.hideEventEditor=function isc_Calendar_hideEventEditor(){if(this.eventEditorLayout&&this.eventEditorLayout.isVisible()){this.eventEditorLayout.hide()}},isc.A.cancelGhostDrag=function isc_Calendar_cancelGhostDrag(_1){_1=_1||this.getSelectedView();if(_1)_1.cancelGhostDrag()},isc.A.addEventOrUpdateEventFields=function isc_Calendar_addEventOrUpdateEventFields(){var _1=this,_2=this.getSelectedView(),_3=_1.eventEditorLayout.isNewEvent,_4=_1.eventEditorLayout.event,_5=_1.eventEditor,_6=_1.getDateEditingStyle(),_7=_5.getValues(),_8=_1.isTimeline()||(_1.dayViewSelected()&&_1.showDayLanes)&&_1.canEditLane,_9=_8?_7[_1.laneNameField]:null,_10=_8&&_1.useSublanes?_7[_1.sublaneNameField]:null,_11=_7["endType"]==this.eventDurationFieldTitle,_12=_11?_7[this.durationField]||1:null,_13=_11?_7[this.durationUnitField]||(_6=="time"?"minute":"hour"):null,_14=_5.valueHasChanged(this.allDayField);var _15=isc.addProperties({},_4,{eventLength:null});_15[this.nameField]=_7[this.nameField];_15[this.descriptionField]=_7[this.descriptionField];if(_9)_15[this.laneNameField]=_9;if(_10)_15[this.sublaneNameField]=_10;if(this.shouldAllowLongEvents()){_15[this.allDayField]=_7[this.allDayField]}
var _16=_7["multiDay"];if(_6=="date"||_6=="datetime"||_16)
{var _17=_7[this.startDateField],_18=!_11?_7[this.endDateField]:null;if(!_11&&_18<_17){if(_1.showEventEditorErrorsInline){_5.setFieldErrors(_1.endDateField,_1.invalidDateMessage,true);_5.setFieldErrors("logicalEndDate",_1.invalidDateMessage,true)}else{_5.showItem("invalidDate")}
return false}
if(!_5.validate())return false;_15[_1.startDateField]=_17;_15[_1.endDateField]=_18}else if(_6=="time"){var _19=_7["startAMPM"],_20=_1.$534(_7["startHours"],_19),_21=_7["startMinutes"];var _22=isc.DateUtil.createDatetime(_1.eventEditorLayout.logicalStartDate,null,null,_20,_21,0,0);_15[_1.startDateField]=_22;if(_11){var _23=_22.getTime(),_24=isc.DateUtil.getEndOf(_22,"D",false),_25=_24.getTime(),_26=isc.DateUtil.convertPeriodUnit(_12,_13,"ms"),_27=Math.min(_23+_26,_25);if(_27!=_23+_26){_12=isc.DateUtil.convertPeriodUnit(_27-_23,"ms",_13);_12=Math.round(_12)}
_15[this.durationField]=_12;_15[this.durationUnitField]=_13}else{var _28=_7["endHours"],_29=_7["endMinutes"];if(!_1.twentyFourHourTime){_28=_1.$534(_28,_7["endAMPM"])}
if((_28<_20&&_28+_29!=0)||(_28==_20&&_29<=_21))
{if(_1.showEventEditorErrorsInline){_5.setFieldErrors("endHours",_1.invalidDateMessage,true)}else{_5.showItem("invalidDate")}
return false}
if(!_5.validate())return false;if(_28==0&&_29==0)_28=24;var _30=isc.DateUtil.getLogicalDateOnly(_22);var _31=isc.DateUtil.createDatetime(_30,null,null,_28,_29,0,0);if(isc.DateUtil.compareDates(_22,_31)==0)
{if(_1.showEventEditorErrorsInline){_5.setFieldErrors("endHours",_1.invalidDateMessage,true)}else{_5.showItem("invalidDate")}
return false}
_15[_1.endDateField]=_31}}else{_15[_1.startDateField]=_7[this.startDateField];_15[_1.endDateField]=_7[this.endDateField]}
_1.$1116=true;if(_2.isTimelineView()){if(_4[_1.leadingDateField]&&_4[_1.startDateField]!=_15[_1.startDateField]){var _32=_4[_1.leadingDateField].duplicate();var _33=isc.DateUtil.getPeriodLength(_4[_1.startDateField],_15[_1.startDateField],"mn");_32.setMinutes(_32.getMinutes()+_33);_15[_1.leadingDateField]=_32}
if(_4[_1.trailingDateField]&&_4[_1.endDateField]!=_15[_1.endDateField]){var _34=_4[_1.trailingDateField].duplicate();var _33=isc.DateUtil.getPeriodLength(_4[_1.endDateField],_15[_1.endDateField],"mn");_34.setMinutes(_34.getMinutes()+_33);_15[_1.trailingDateField]=_34}}
var _35=isc.addProperties({},_5.getCustomValues());_1.hideEventEditor();if(_14)_1.$278a=true;if(!_3){_1.updateCalendarEvent(_4,_15,_35,"editor")}else{_1.addCalendarEvent(_15,_35,"editor",false)}
return true});isc.evalBoundary;isc.B.push(isc.A.setDateLabel=function isc_Calendar_setDateLabel(){var _1=this.getSelectedView();if(!_1||!this.dateLabel)return;var _2=this.getDateLabelText(_1.viewName,_1.labelStartDate||_1.startDate||_1.logicalDate,_1.isDayView()?null:_1.labelEndDate||_1.logicalEndDate||_1.endDate);this.dateLabel.setContents(_2)},isc.A.getDateLabelText=function isc_Calendar_getDateLabelText(_1,_2,_3){var _4=(_1?this.getView(_1):null)||this.getSelectedView();var _5=_4&&_4.getDateLabelText(_2?isc.DateUtil.getLogicalDateOnly(_2):null,_3?isc.DateUtil.getLogicalDateOnly(_3):null);return _5||""},isc.A.dayViewSelected=function isc_Calendar_dayViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="day";else return this.$567=="day"},isc.A.weekViewSelected=function isc_Calendar_weekViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="week";else return this.$567=="week"},isc.A.monthViewSelected=function isc_Calendar_monthViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="month";else return this.$567=="month"},isc.A.timelineViewSelected=function isc_Calendar_timelineViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="timeline";else return this.$567=="timeline"},isc.A.cancelEditing=function isc_Calendar_cancelEditing(){if(this.eventDialog&&this.eventDialog.isVisible()){this.hideEventDialog()}
if(this.eventEditor&&this.eventEditor.isVisible()){this.hideEventEditor()}
var _1=this.getSelectedView();if(_1&&_1.clearSelection)_1.clearSelection();this.cancelGhostDrag()},isc.A.showEventDialog=function isc_Calendar_showEventDialog(_1,_2){if(_2==null)_2=(_1==null);this.$53l(_1,_2)},isc.A.showNewEventDialog=function isc_Calendar_showNewEventDialog(_1){_1=_1||{};this.showEventDialog(_1,true)},isc.A.$53l=function isc_Calendar__showEventDialog(_1,_2){var _3=this.getEventDialog();_3.eventWindow=null;_3.event=null;_3.isNewEvent=_2;_3.moveTo(0,-9999);_3.items[0].createFields();if(!_3.isDrawn())_3.draw();else _3.redraw();var _4=this.getSelectedView();if(_2)_1=_4.getNewEventDefaults(_1);var _5=_4.getCurrentEventCanvas(_1);var _6={};if(_5){if(this.bringEventsToFront)_5.bringToFront();var _7=_5.getPageRect();_6.left=Math.max(_7[0],_4.body.getPageLeft());_6.top=Math.max(_7[1],_4.body.getPageTop())}else{_6=_4.getEditDialogPosition(_1)}
_3.setEvent(_5?_5.event:_1);if(this.eventEditorLayout){this.eventEditorLayout.event=_1;this.eventEditorLayout.isNewEvent=_2}
var _8=this.getPageTop()+this.getHeight();var _9=_3.getVisibleHeight();var _10=_6.top;if(_10+_9>=_8){_10=_8-(_9+2)}
var _11=this.getPageLeft()+this.getWidth();var _12=_3.getVisibleWidth();var _13=_6.left;if(_13+_12>=_11){_13=_11-(_12+2)}
_3.$193l=[_13,_10];_3.placeNear(_3.$193l[0],_3.$193l[1]);_3.show();_3.bringToFront();if(_2){_3.form.setDisabled(false)}else{_3.form.setDisabled(!this.canEditEvent(_1,_4))}
return},isc.A.visibilityChanged=function isc_Calendar_visibilityChanged(_1){if(!_1){this.cancelEditing()}},isc.A.showEventEditor=function isc_Calendar_showEventEditor(_1,_2){if(_2==null)_2=(_1==null);this.$53j(_1,_2)},isc.A.showNewEventEditor=function isc_Calendar_showNewEventEditor(_1){this.showEventEditor(_1,true)},isc.A.$53j=function isc_Calendar__showEventEditor(_1,_2){var _3=this.getEventEditorLayout();if(!_3.isDrawn()){_3.setVisibility(isc.Canvas.INHERIT);_3.draw()}
_3.setWidth(this.mainView.getVisibleWidth());_3.setHeight(this.mainView.getVisibleHeight());_3.setPageLeft(this.mainView.getPageLeft());_3.setPageTop(this.getPageTop());_3.isNewEvent=_2;_3.view=this.getSelectedView();var _4=this.getDateEditingStyle();this.eventEditor.dateEditingStyle=_4;this.eventEditor.rebuildFieldList();if(_1){_3.setEvent(_1)}else{this.eventEditor.clearValues();_3.setTitle(this.newEventWindowTitle);if(this.eventDialog&&this.eventDialog.isVisible()){if(this.eventEditorFields){_3.items[0].setCustomValues(this.eventDialog.items[0].getCustomValues())}
var _5=this.eventDialog.items[0].getValue(this.nameField);var _6=this.eventDialog.items[0].getItem(this.laneNameField);var _7=_6?_6.getValue():null;var _8=new Date();_3.setDate(_8,this.eventDialog.currentEnd,_5,_7)}}
this.hideEventDialog();var _9=this.canEditEvent(_1,this.getSelectedView());this.eventEditor.setDisabled(!_9);_3.saveButton.setDisabled(!_9);_3.show();this.eventEditor.getItem(this.nameField).focusInItem()},isc.A.$53k=function isc_Calendar__getEventDialogTitle(_1,_2,_3){if(!_2)_2=_1||this.getEventEndDate(_3);var _4=isc.DateUtil.getShortDayNames(),_5=isc.DateUtil.getShortMonthNames(),_6=isc.Time.toShortTime(_1,this.timeFormatter),_7=isc.Time.toShortTime(_2,this.timeFormatter),_8;var _9=_3&&this.isLongEvent(_3,true);var _10=_3&&!!_3[this.allDayField];if(_9){_8=_4[_1.getDay()]+", "+_5[_1.getMonth()]+" "+_1.getDate()+(!_10?", "+_6:"")+" - "+_4[_2.getDay()]+", "+_5[_2.getMonth()]+" "+_2.getDate()+(!_10?", "+_7:"")+(_10?" ["+this.eventAllDayFieldTitle+"]":"");return _8}else if(_10){_8=_4[_1.getDay()]+", "+_5[_1.getMonth()]+" "+_1.getDate()+" ["+this.eventAllDayFieldTitle+"]";return _8}
_8=_4[_1.getDay()]+", "+_5[_1.getMonth()]+" "+_1.getDate()+" - "+_6+" - "+_7;return _8},isc.A.$53n=function isc_Calendar__to12HrNotation(_1){if(_1==0)return 12;else if(_1<13)return _1;else return _1-12},isc.A.$534=function isc_Calendar__to24HourNotation(_1,_2){_1=parseInt(_1);if(_2==null)return _1;else if(_2.toLowerCase()=="am"&&_1==12){return 0}else if(_2.toLowerCase()=="pm"&&_1<12){return _1+12}else{return _1}},isc.A.$116j=function isc_Calendar__getCellCSSText(_1,_2,_3,_4){var _5=this.getCellDate(_3,_4,_1);if(!_5)return null;var _6=this.getDateCSSText?this.getDateCSSText(_5,_3,_4,_1):null;if(_6)return _6;if(this.todayBackgroundColor){var _7=isc.DateUtil.$179o(new Date());var _8=isc.DateUtil.compareLogicalDates(_5,_7);if((_8!==false&&_8==0)){return"background-color:"+this.todayBackgroundColor+";"}}
return null},isc.A.getDateHeaderTitle=function isc_Calendar_getDateHeaderTitle(_1,_2,_3,_4){return null},isc.A.getCellDate=function isc_Calendar_getCellDate(_1,_2,_3){_3=_3||this.getSelectedView();var _4;if(_1==null&&_2==null){_1=_3.getEventRow();_2=_3.getEventCol()}
var _5=_3.frozenFields?_3.frozenFields.length:0;if(_3.isDayView()||_3.isWeekView()||_3.isTimelineView()){var _6=_2-_5;_4=_6>=0?_3.getCellDate(_1,_6):null}else if(_3.isMonthView()){if(_2>=_3.getFields().length)
_2=_3.getFields().length-1;var _7=_3.data.get(_1);var _8=_3.getField(_2).$66b;if(_7&&_7["date"+_8]!=null){_4=_7["date"+_8].duplicate();_4=isc.DateUtil.createDatetime(_4,null,null,null,0,0,0,0)}}else{return}
return _4},isc.A.getDateFromPoint=function isc_Calendar_getDateFromPoint(_1,_2,_3,_4){_4=_4||this.getSelectedView();if(_3==null)_3=true;if(_4.getDateFromPoint)return _4.getDateFromPoint(_1,_2,null,_3);if(_1==null&&_2==null){_1=_4.body.getOffsetX();_2=_4.body.getOffsetY()}
var _5=_4.body.getEventColumn(_1),_6=_4.body.getEventRow(_2),_7;if(_4.isMonthView()){_7=this.getCellDate(_6,_5,_4)}else{return}
return _7},isc.A.getLane=function isc_Calendar_getLane(_1,_2){if(!_1)return null;_2=_2||this.getSelectedView();if(_2.getLane)return _2.getLane(_1);return null},isc.A.getEventLane=function isc_Calendar_getEventLane(_1,_2){if(!_1)return null;return this.getLane(_1[this.laneNameField],_2)},isc.A.getSublane=function isc_Calendar_getSublane(_1,_2,_3){if(!_1)return null;_3=_3||this.getSelectedView();if(_3.getSublane)return _3.getSublane(_1,_2);return null},isc.A.getEventSublane=function isc_Calendar_getEventSublane(_1,_2){if(!_1)return null;return this.getSublane(_1[this.laneNameField],_1[this.sublaneNameField],_2)},isc.A.getLaneFromPoint=function isc_Calendar_getLaneFromPoint(_1,_2,_3){_3=_3||this.getSelectedView();if(!_3.usesLanes())return null;if(_3.getLaneFromPoint)return _3.getLaneFromPoint(_1,_2);return null},isc.A.getSublaneFromPoint=function isc_Calendar_getSublaneFromPoint(_1,_2,_3){_3=_3||this.getSelectedView();if(_3.getSublaneFromPoint)return _3.getSublaneFromPoint(_1,_2);return null},isc.A.getDateLeftOffset=function isc_Calendar_getDateLeftOffset(_1,_2){if(_2&&_2.getDateLeftOffset)return _2.getDateLeftOffset(_1)},isc.A.currentViewChanged=function isc_Calendar_currentViewChanged(_1){},isc.A.getDayBodyHTML=function isc_Calendar_getDayBodyHTML(_1,_2,_3,_4,_5){if(!_1||!_2||_2.length==0)return"";var _6=_3.monthView,_7=_1.getDay(),_8=_6.getRecord(_4),_9=_6.getRowHeight(_8,_4)-(_6.cellPadding*2),_10="",_11=null,_12="";var _13=0;if(_3.shouldAllowLongEvents()){_13=_3.dragGhostSpace;var _14=_6.$2777;if(_14&&_14.length>0){var _15=0;for(var d=1;d<=7;d++){var _17=_8["date"+d];if(!_17)continue;var _18=_17.getTime(),_19=_18+86400000,_20=0;for(var e=0;e<_14.length;e++){var _22=_14[e],_23=_22[_3.startDateField],_24=_22[_3.endDateField];if(!_23||!_24)continue;var _25=_23.getTime(),_26=_24.getTime();if(_25<_19&&_26>_18)_20++}
if(_20>_15)_15=_20}
if(_15>0){_13=_15*_3.longEventHeight+(_15-1)*_3.longEventSpace+_3.dragGhostSpace}}}
_9-=_13;for(var i=0;i<_2.length;i++){if(i>0)_10+="<br>";_10+="<nobr>"+_2[i].name+"</nobr>";var _28=isc.Canvas.measureContent(_10,this.dayBodyBaseStyle,true,true);if(_28>=_9){_11=Math.max(0,i-1);break}}
if(_11==null)_11=_2.length;for(var i=0;i<_11;i++){var _29=this.getEventHeaderHTML(_2[i],_6);if(!this.isPrinting){var _30="<a href='javascript:"+this.ID+".monthViewEventClick("+_4+","+_5+","+i+");' class='"+this.calMonthEventLinkStyle+"'>";_12+=_30+_29+"</a><br/>"}else{_12+=_29+"<br/>"}}
if(_11!=_2.length&&!this.isPrinting){var _31="<a href='javascript:"+this.ID+".monthMoreEventsLinkClick("+_4+","+_5+","+_11+");' class='"+this.calMonthEventLinkStyle+"'>",_32=this.monthMoreEventsLinkTitle,_29=_32.evalDynamicString(this,{eventCount:(_2.length-i)});_12+=_31+_29+"</a><br/>"}
return"<div style='white-space:normal;line-height:normal'>"+_12+"</div>"},isc.A.monthViewEventClick=function isc_Calendar_monthViewEventClick(_1,_2,_3){if(this.monthView.isDisabled())return;var _4=this.monthView.getEvents(_1,_2);var _5=_4[_3];if(this.eventClick(_5,"month"))this.showEventEditor(_5)},isc.A.$167z=function isc_Calendar__getMonthMoreEventsMenu(){if(!this.monthMoreEventsMenu){this.monthMoreEventsMenu=this.createAutoChild("monthMoreEventsMenu")}
return this.monthMoreEventsMenu},isc.A.monthMoreEventsLinkClick=function isc_Calendar_monthMoreEventsLinkClick(_1,_2,_3){var _4=this,_5=this.monthView,_6=_5&&_5.getEvents(_1,_2)||[],_7=[];for(var i=_3;i<_6.length;i++){var _9=_6[i];_7.add({title:_9[this.nameField],event:_9,calendar:_4,click:function(){if(this.calendar.eventClick(this.event,"month")){this.calendar.showEventEditor(this.event)}}})}
var _10=this.$167z();_10.setItems(_7);_10.positionContextMenu();_10.show()},isc.A.getMonthViewHoverHTML=function isc_Calendar_getMonthViewHoverHTML(_1,_2){if(_2!=null){var _3="";var _4=this.creator||this;for(var i=0;i<_2.length;i++){var _6=isc.Time.toShortTime(_4.getEventStartDate(_2[i]),_4.timeFormatter,true);_3+="<nobr>"+_6+" "+_2[i][_4.nameField]+"<nobr/><br/>"}
return _3}},isc.A.getDayHeaderHTML=function isc_Calendar_getDayHeaderHTML(_1,_2,_3,_4,_5){return _1.getDate()},isc.A.dayBodyClick=function isc_Calendar_dayBodyClick(_1,_2,_3,_4,_5){return true},isc.A.dayHeaderClick=function isc_Calendar_dayHeaderClick(_1,_2,_3,_4,_5){return true},isc.A.eventClick=function isc_Calendar_eventClick(_1,_2){return true},isc.A.$129v=function isc_Calendar__eventCanvasClick(_1,_2){var _3=_1.event,_4=_1.calendarView,_5=_4.isWeekView(),_6=this.eventClick(_3,_4.viewName),_7=(_2?true:_6)!=false;if(!_2){if(this.canSelectEvents){if(isc.EH.modifierKeyDown()){if(!this.getSelection().isSelected(_3)){this.selectEvent(_3,_1)}else{this.deselectEvent(_3,_1)}}else{this.selectSingleEvent(_3,_1)}
return}else if(this.bringEventsToFront){_1.bringToFront()}}
if(_7){this.clearViewSelection();if(!_4.isTimelineView()){}
if(!this.canEditEvent(_3,_4)){this.showEventEditor(_3)}else{this.showEventDialog(_3)}
return isc.EH.STOP_BUBBLING}
return _6!=false},isc.A.$195n=function isc_Calendar__eventCanvasKeyPress(_1,_2){var _3=_1.calendarView,_4=_1.$172y,_5;if(_2){if(_2=="Enter"){if(_4.canEdit)_5=this.$129v(_1,true)}else if(_2=="Backspace"||_2=="Delete"){if(_4.showCloseButton){var _6=this.getSelectedEvents();for(var i=0;i<_6.length;i++){var _8=_3.getCurrentEventCanvas(_6[i])
this.$174b(_8)}}
_5=false}else if(_2=="Tab"){this.$195m=true}}
return _5},isc.A.eventDoubleClick=function isc_Calendar_eventDoubleClick(_1,_2){return true},isc.A.$195c=function isc_Calendar__eventCanvasDoubleClick(_1){var _2=_1.event,_3=_1.calendarView,_4=_3.isWeekView(),_5=this.eventDoubleClick(_2,_3.viewName)!=false;if(this.canSelectEvents){this.$129v(_1,true)}else if(this.bringEventsToFront){_1.bringToFront()}},isc.A.eventRemoveClick=function isc_Calendar_eventRemoveClick(_1,_2){return true},isc.A.eventMoved=function isc_Calendar_eventMoved(_1,_2,_3){return true},isc.A.eventResized=function isc_Calendar_eventResized(_1,_2){return true},isc.A.timelineEventMoved=function isc_Calendar_timelineEventMoved(_1,_2,_3,_4){return true},isc.A.timelineEventResized=function isc_Calendar_timelineEventResized(_1,_2,_3){return true},isc.A.selectTab=function isc_Calendar_selectTab(_1){if(!this.mainView||!this.mainView.isA("TabSet"))return false;var _2=this.mainView.getSelectedTabNumber();var _3=this.mainView.getTabObject(_1);if(_3){this.mainView.selectTab(_1);if(this.mainView.tabBar){var _4=this.mainView.tabBar.getButton(_1);if(_4)_4.focus();_4=this.mainView.tabBar.getButton(_2);if(_4)_4.stateChanged()}
return true}
return false},isc.A.parentResized=function isc_Calendar_parentResized(){this.Super('parentResized',arguments);if(this.eventEditorLayout&&this.eventEditorLayout.isVisible())this.eventEditorLayout.sizeMe()},isc.A.dateChanged=function isc_Calendar_dateChanged(){return true},isc.A.getActiveDay=function isc_Calendar_getActiveDay(){var _1=this.getActiveTime();if(_1)return _1.getDay()},isc.A.getActiveTime=function isc_Calendar_getActiveTime(){var _1=this.ns.EH,_2=this.getSelectedView();var _3=_2.getEventRow();var _4=_2.getEventColumn();return this.getCellDate(_3,_4,_2)},isc.A.setTimelineRange=function isc_Calendar_setTimelineRange(_1,_2,_3){var _4=this.timelineView;var _5=this.headerLevels&&this.headerLevels.length>1;var _6=!this.showWeekends||this.shouldShowDate!=null;_1=isc.DateUtil.getStartOf(_1,this.timelineGranularity,false,this.firstDayOfWeek);if(!_2){var _7=Math.round(isc.DateUtil.getPeriodLength(_4.startDate,_4.endDate,this.timelineGranularity));_2=isc.DateUtil.dateAdd(_1,this.timelineGranularity,_7,1,null,null,this.firstDayOfWeek)}
var _8=Math.round(isc.DateUtil.getPeriodLength(_1,_2,this.timelineGranularity)/this.timelineUnitsPerColumn);if(_8!=this.timelineColumnSpan){this.timelineColumnSpan=_8;if(this.timelineView)this.timelineView.setTimelineRange(_1,_2)}else{_4.setChosenDate(_1)}
if(_3)this.fireCallback(_3)},isc.A.setResolution=function isc_Calendar_setResolution(_1,_2,_3,_4,_5){this.timelineUnitsPerColumn=_4||1;if(_2)this.timelineGranularity=_2;if(_1){if(!isc.isAn.Array(_1))_1=[_1];this.headerLevels=_1}
if(_1.length>0){this.timelineGranularity=_1[_1.length-1].unit}
var _6=this.timelineView;var _7=_2;var _8=isc.DateUtil.dateAdd(this.startDate,_7,_3,1,null,null,this.firstDayOfWeek);var _9=Math.round(isc.DateUtil.getPeriodLength(this.startDate,_8,this.timelineGranularity)/this.timelineUnitsPerColumn);if(_9!=this.timelineColumnSpan){this.timelineColumnSpan=_9}
if(_6)_6.setChosenDate(this.startDate);if(_5)this.fireCallback(_5)},isc.A.getEventLength=function isc_Calendar_getEventLength(_1,_2){var _3=_1.eventLength,_4=isc.DateUtil;if(_3==null){_3=_4.getPeriodLength(this.getEventStartDate(_1),this.getEventEndDate(_1));_1.eventLength=_3}
if(_2){return _4.convertPeriodUnit(_1.eventLength,"ms",_2)}
return _1.eventLength},isc.A.canEditEventLane=function isc_Calendar_canEditEventLane(_1,_2){_2=_2||this.getSelectedView();if(!_2.usesLanes())return false;var _3=_1[this.canEditLaneField]!=null?_1[this.canEditLaneField]:this.canEditLane!=false;return _3},isc.A.canEditEventSublane=function isc_Calendar_canEditEventSublane(_1,_2){if(!this.useSublanes)return false;var _3=_1[this.canEditSublaneField];if(_3==null)_3=(this.canEditSublane!=false);return _3},isc.A.eventRepositionStart=function isc_Calendar_eventRepositionStart(_1,_2){return true},isc.A.eventRepositionMove=function isc_Calendar_eventRepositionMove(_1,_2,_3){var _4=this.getEventStartDate(_2),_5=this.getEventEndDate(_2);if(this.shouldDisableDate(_4,_3)||this.shouldDisableDate(_5,_3)){return false}
return true},isc.A.eventRepositionStop=function isc_Calendar_eventRepositionStop(_1,_2,_3,_4){return true},isc.A.eventResizeMove=function isc_Calendar_eventResizeMove(_1,_2,_3,_4){var _5=this.getEventStartDate(_2),_6=this.getEventEndDate(_2);if(_5.getTime()==_6.getTime())return false;_6.setTime(_6.getTime()-1);if(((_4.$1172||_4.$159n)&&this.shouldDisableDate(_5,_3))||((_4.$131q||_4.$131g)&&this.shouldDisableDate(_6,_3))){return false}
return true},isc.A.eventResizeStop=function isc_Calendar_eventResizeStop(_1,_2,_3,_4){return true},isc.A.checkForOverlap=function isc_Calendar_checkForOverlap(_1,_2,_3,_4,_5,_6){var _7={},_8=this.startDateField,_9=this.endDateField;_7[_8]=_4.duplicate();_7[_9]=_5.duplicate();_7[this.laneNameField]=_6;var _10=this.data;if(_6){_10=this.getLaneEvents(_6,_1)}
var _11=_1.findOverlappingEvents(_3,_7,null,(_6!=null),_10);if(_11.length==0){return false}else if(_11.length>1){return true}else{var _12=_11[0];if((this.equalDatesOverlap==false?_5>_12[_8]:_5>=_12[_8])&&_4<_12[_8])
{_5=_12[_8].duplicate();_4=_5.duplicate();_4.setMinutes(_4.getMinutes()-this.getEventLength(_3,"minute"));return[_4,_5]}else if((this.equalDatesOverlap==false?_4<_12[_9]:_4<=_12[_9])&&_5>_12[_9])
{_4=_12[_9].duplicate();_5=_4.duplicate();_5.setMinutes(_5.getMinutes()+this.getEventLength(_3,"minute"));return[_4,_5]}else{return true}}},isc.A.getPrintHTML=function isc_Calendar_getPrintHTML(_1,_2){isc.$238m=true;if(_2){this.delayCall("asyncGetPrintHTML",[_1,_2]);return null}else{return this.asyncGetPrintHTML(_1,_2)}},isc.A.asyncGetPrintHTML=function isc_Calendar_asyncGetPrintHTML(_1,_2){var _3="";var _4=this.controlsBar&&this.controlsBar.getHandle();if(_4)_3+=_4.innerHTML;var _5=this.getSelectedView();_3+=_5.getPrintHTML();if(isc.isA.Function(_2))_2(_3);if(_2&&isc.isA.Function(_2.callback))_2.callback(_3);return _3});isc.B._maxIndex=isc.C+270;isc.A=isc.Calendar;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.$1833=function isc_c_Calendar__getAsDisplayDate(_1){if(!isc.Time.$854){return new Date(_1.getFullYear(),_1.getMonth(),_1.getDate())}
var _2=_1.$68g(isc.Time.getUTCHoursDisplayOffset(_1),isc.Time.getUTCMinutesDisplayOffset(_1));return new Date(_2.getUTCFullYear(),_2.getUTCMonth(),_2.getUTCDate())});isc.B._maxIndex=isc.C+1;isc.Calendar.registerStringMethods({getDayBodyHTML:"date,events,calendar,rowNum,colNum",getDayHeaderHTML:"date,events,calendar,rowNum,colNum",dayBodyClick:"date,events,calendar,rowNum,colNum",dayHeaderClick:"date,events,calendar,rowNum,colNum",eventClick:"event,viewName",eventChanged:"event",eventMoved:"newDate,event",eventResized:"newDate,event",backgroundClick:"startDate,endDate",backgroundMouseDown:"startDate",backgroundMouseUp:"startDate,endDate"});isc.defineClass("EventCanvas","VLayout");isc.A=isc.EventCanvas;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.headerSizer=null;isc.B.push(isc.A.getHeaderHeight=function isc_c_EventCanvas_getHeaderHeight(_1,_2,_3,_4,_5){var _6=isc.EventCanvas;if(!_6.headerSizer){_6.headerSizer=isc.Canvas.create({ID:"$151s",autoDraw:false,visibility:"hidden",left:0,top:-1000})}
_6.headerSizer.setProperties({height:_4?1:_3,maxHeight:_4?null:_3,width:_2,maxWidth:_2,overflow:_4?"visible":"hidden",contents:_1,styleName:_5.getHeaderStyle()});if(!_6.headerSizer.isDrawn())_6.headerSizer.draw();else _6.headerSizer.redraw();var _7=_6.headerSizer.getVisibleHeight();_6.headerSizer.hide();_6.headerSizer.clear();return _7});isc.B._maxIndex=isc.C+1;isc.A=isc.EventCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.visibility="hidden";isc.A.autoDraw=false;isc.A.overflow="hidden";isc.A.minHeight=1;isc.A.minWidth=1;isc.A.hideUsingDisplayNone=true;isc.A.showHover=true;isc.A.canHover=true;isc.A.hoverMoveWithMouse=true;isc.A.hoverAutoFitWidth=null;isc.A.hoverAutoFitMaxWidth=null;isc.A.dragType="EventCanvas";isc.A.snapToGrid=false;isc.A.dragAppearance="none";isc.A.canDragResize=true;isc.A.canDragReposition=true;isc.A.isEventCanvas=true;isc.A.isZoneCanvas=false;isc.A.isIndicatorCanvas=false;isc.A.$142u=null;isc.A.labelOffsetX=0;isc.A.labelOffsetY=0;isc.A.titleOrientation="top";isc.A.maxLabelWidth=150;isc.A.showComponent=null;isc.A.allowBodyScroll=false;isc.A.headerLabelDefaults={_constructor:"Canvas",width:"100%",height:1,autoDraw:false,overflow:"visible"};isc.A.bodyLabelDefaults={_constructor:"Canvas",width:"100%",height:"*",overflow:"auto",autoDraw:false};isc.A.leadingTrailingIconDefaults={_constructor:"Img",autoDraw:false,_redrawWithParent:false,getCalendar:function(){return this.creator.calendar},getView:function(){return this.creator.calendarView},getEventCanvas:function(){return this.creator},getEventInstance:function(){return this.creator.event},mouseDown:function(){this.Super("mouseDown",arguments);return isc.EH.STOP_BUBBLING},dragAppearance:"target",dragRepositionStart:function(){this.startTop=this.getTop();this.lastleft=this.getLeft()},dragRepositionMove:function(){this.setTop(this.startTop);var _1=this.getView().getDateFromPoint();var _2=this.getView().getDateLeftOffset(_1);var _3=window[this.lineID];if(this.type=="trail"){_2+=this.getView().getSnapGapPixels();_2-=this.getWidth();if(_2+1<this.getEventCanvas().getLeft()+this.getEventCanvas().getWidth()){this.setLeft(this.lastleft);return}
_3.setWidth(Math.round((_2-_3.getLeft())+this.getWidth()))}else{if(_2-1>this.getEventCanvas().getLeft()){this.setLeft(this.lastleft);return}
_3.setLeft(_2);_3.setWidth(Math.round(this.getEventCanvas().getLeft()-_2))}
this.lastLeft=_2;this.setLeft(_2)},dragRepositionStop:function(){this.setTop(this.startTop);var _1=this.getLeft();if(this.type=="trail")_1-=1;var _2=this.getView().getDateFromPoint(_1+1);var _3=this.getCalendar();var _4=this.getEventInstance();var _5=this.type=="trail"?_3.trailingDateField:_3.leadingDateField;var _6={};_6[_5]=_2;var _7=isc.addProperties({},_4,_6);_3.updateCalendarEvent(_4,_7,null,"mouse");return true}};isc.A.leadingTrailingLineDefaults={_constructor:"Canvas",autoDraw:false,_redrawWithParent:false,height:2,overflow:"hidden",styleName:"eventLine"};isc.A.padding=null;isc.A.showContextButton=false;isc.A.showRolloverControls=true;isc.A.$174j=["closeButton","contextButton"];isc.B.push(isc.A.getShowHeader=function isc_EventCanvas_getShowHeader(){if(this.showHeader!=null)return this.showHeader;if(this.event&&this.event.showHeader!=null)return this.event.showHeader;return this.calendar.showEventHeaders},isc.A.getShowBody=function isc_EventCanvas_getShowBody(){if(this.showBody!=null)return this.showBody;if(this.event&&this.event.showBody!=null)return this.event.showBody;return this.calendar.showEventDescriptions},isc.A.getPartHandle=function isc_EventCanvas_getPartHandle(_1){_1=_1||"canvas";if(_1=="header"&&this.getShowHeader())return this.headerLabel.getHandle();if(_1=="body"&&this.getShowBody())return this.bodyLabel.getHandle();return this.getHandle()},isc.A.$220u=function isc_EventCanvas__shouldShowComponent(){if(this.showComponent==false)return false;return this.calendar.showEventCanvasComponents},isc.A.getComponent=function isc_EventCanvas_getComponent(_1){if(this.component){return this.component}
this.component=this.calendar.createEventCanvasComponent(this,this.calendarView);this.addMember(this.component);return this.component},isc.A.init=function isc_EventCanvas_init(){this.autoFit=this.calendar&&this.calendar.showColumnLayouts;if(this.autoFit){this.height=1;this.overflow="visible"}else{this.overflow="hidden"}
return this.Super("init",arguments)},isc.A.initWidget=function isc_EventCanvas_initWidget(){var _1=this.calendar||{},_2=this.calendarView||{};if(this.verticalResize==null){this.verticalResize=_2.verticalEvents}
this.resizeFrom=[];this.hoverDelay=_1.hoverDelay+1;if(this.useStaticControls==null){this.useStaticControls=(_1.useEventCanvasRolloverControls==false)}
if(this.canFocus==null){this.setCanFocus(_1.canSelectEvents)}
if(_1.showColumnLayouts){this.dragTarget=this;this.dragAppearance="target";this.canDragReposition=true;this.canDrop=true}
this.Super("initWidget",arguments);if(this.shouldShowGripper())this.createGripper();if(this.shouldShowLabel())this.createLabel();this.createHeaderAndBody();this.updateShowHovers()},isc.A.createHeaderAndBody=function isc_EventCanvas_createHeaderAndBody(){if(this.getShowHeader()){var _1={dragTarget:this};if(this.headerHeight!=null){_1.height=this.headerHeight;_1.overflow="hidden"}
if(!this.getShowBody())_1.height="*";this.addAutoChild("headerLabel",_1);this.addMember(this.headerLabel)}
if(this.getShowBody()){var _2={dragTarget:this};if(this.autoFit)_2.overflow="visible";else if(!this.allowBodyScroll)_2.overflow="hidden";this.addAutoChild("bodyLabel",_2)}
if(this.bodyLabel){this.addMember(this.bodyLabel,(this.titleOrientation=="bottom"?0:null))}},isc.A.updateShowHovers=function isc_EventCanvas_updateShowHovers(){if(this.$142u)this.eventProxy=this.calendarView},isc.A.shouldShowGripper=function isc_EventCanvas_shouldShowGripper(){var _1=this.calendar;if(!this.event||!_1.canEditEvent(this.event,this.calendarView)||!_1.canDragEvent(this.event,this.calendarView)){return false}
if(this.showGripper!=null)return this.showGripper;if(this.calendar.isZeroLengthEvent(this.event))return true;return false},isc.A.createGripper=function isc_EventCanvas_createGripper(){if(this.gripper)return;var _1={canDrag:true,dragTarget:this.dragTarget,eventProxy:this,eventCanvas:this,canDragResize:false,styleName:this.gripperStyle||this.styleName+"Gripper"};this.gripper=this.calendar.getEventCanvasGripper(_1,this,this.calendarView)},isc.A.shouldShowLabel=function isc_EventCanvas_shouldShowLabel(){if(!this.event)return false;if(this.showLabel!=null)return this.showLabel;if(this.calendar.isZeroLengthEvent(this.event))return true;return false},isc.A.createLabel=function isc_EventCanvas_createLabel(){if(this.label)return;var _1={canDrag:false,eventCanvas:this,canDragResize:false,canHover:true,showHover:true,showOver:false,showRollOver:false,margin:3,styleName:this.labelStyle||this.styleName+"Gripper",contents:this.getHeaderHTML(),getHoverHTML:function(){return this.eventCanvas.getHoverHTML()}};this.label=this.calendar.getEventCanvasLabel(_1,this.calendarView)},isc.A.parentScrolled=function isc_EventCanvas_parentScrolled(){if(this.gripper||this.label)this.repositionPeers()},isc.A.redraw=function isc_EventCanvas_redraw(){var _1=this.Super("redraw",arguments);if(this.gripper||this.label)this.repositionPeers();return _1},isc.A.draw=function isc_EventCanvas_draw(){var _1=this.Super("draw",arguments);delete this.$221l;this.updateCanvasColors();return _1},isc.A.hide=function isc_EventCanvas_hide(){this.Super("hide",arguments);if(this.gripper)this.gripper.hide();if(this.label)this.label.hide();this.hideLeadingTrailingDates()},isc.A.createLeadingTrailingDates=function isc_EventCanvas_createLeadingTrailingDates(){var _1=this.calendarView;if(!this.leadingIcon){this.leadingLine=this.createAutoChild("leadingTrailingLine",{type:"lead"});this.leadingIcon=this.createAutoChild("leadingTrailingIcon",{width:_1.leadIconSize,height:_1.leadIconSize,lineID:this.leadingLine.getID(),type:"lead",src:_1.leadingEndPointImage,canDragReposition:this.canDragReposition,canDrag:this.canDrag});this.trailingLine=this.createAutoChild("leadingTrailingLine",{type:"trail"});this.trailingIcon=this.createAutoChild("leadingTrailingIcon",{width:_1.trailIconSize,height:_1.trailIconSize,lineID:this.trailingLine.getID(),type:"trail",src:_1.trailingEndPointImage,canDragReposition:this.canDragReposition,canDrag:this.canDrag})}
if(this.leadingLine.parentElement!=_1.body)_1.body.addChild(this.leadingLine,null,false);if(this.leadingIcon.parentElement!=_1.body)_1.body.addChild(this.leadingIcon,null,false);if(this.trailingLine.parentElement!=_1.body)_1.body.addChild(this.trailingLine,null,false);if(this.trailingIcon.parentElement!=_1.body)_1.body.addChild(this.trailingIcon,null,false)},isc.A.hideLeadingTrailingDates=function isc_EventCanvas_hideLeadingTrailingDates(){this.leadingIcon&&this.leadingIcon.hide();this.leadingLine&&this.leadingLine.hide();this.trailingIcon&&this.trailingIcon.hide();this.trailingLine&&this.trailingLine.hide()},isc.A.updateLeadingTrailingDates=function isc_EventCanvas_updateLeadingTrailingDates(_1){if(!this.leadingIcon){this.createLeadingTrailingDates()}
var _2=this.$65t(this.leadingIcon,this.leadingLine);var _3=this.$65t(this.trailingIcon,this.trailingLine);if(this.leadingLine.getWidth()>0){if(!this.leadingLine.isDrawn())this.leadingLine.draw();this.leadingLine.show()}else this.leadingLine.hide();if(_2){if(!this.leadingIcon.isDrawn())this.leadingIcon.draw();this.leadingIcon.show()}else this.leadingIcon.hide();if(this.trailingLine.getWidth()>0){if(!this.trailingLine.isDrawn())this.trailingLine.draw();this.trailingLine.show()}else this.trailingLine.hide();if(_3){if(!this.trailingIcon.isDrawn())this.trailingIcon.draw();this.trailingIcon.show()}else this.trailingIcon.hide()},isc.A.$65t=function isc_EventCanvas__positionIcon(_1,_2){var _3=this.calendar,_4=this.calendarView,_5=this,_6=_5.event,_7=_1.type,_8=_5.getTop(),_9=_5.getLeft(),_10=_5.getVisibleWidth(),_11=_5.getVisibleHeight();var _12=true;var _13=0;var _14=Math.round(_8+((_11-_1.height)/2));if(!_2)_2=window[_1.lineID];var _15=_9;var _16=Math.round(_8+((_11-_2.getHeight())/2));var _17=0;if(_7=="trail"){_12=_4.compareDates(_6[_3.trailingDateField],_4.endDate)>=0;_13=_4.getDateLeftOffset(_6[_3.trailingDateField]);_13+=_4.getSnapGapPixels()-1;_13-=_1.width;_15+=_10;if(_12)_17=(_13+_1.width)-_15;else _17=_4.body.$26a.sum()-_15}else{_12=_4.compareDates(_6[_3.leadingDateField],_4.startDate)<0;_13=_4.getDateLeftOffset(_6[_3.leadingDateField]);_15=Math.max(0,_13);_17=_9-_15}
_2.setRect(Math.round(_15),Math.round(_16),(Math.round(_17)>0?Math.round(_17):null));if(_12){_1.setRect(Math.round(_13),Math.round(_14))}else{_1.hide()}
return _12},isc.A.repositionPeers=function isc_EventCanvas_repositionPeers(_1){if(!this.gripper&&!this.label)return;var _2=this.calendarView,_3=_2.body,_4=this.shouldShowLabel(),_5=this.shouldShowGripper();var _6=_3.getLeft(),_7=_3.getScrollLeft(),_8=_3.getVisibleWidth(),_9=this.isDrawn()?this.getWidth():_2.$732(this.event),_10=this.getLeft()+Math.floor(_9/2);if(_10<_7||_10>_7+_8){if(this.gripper&&this.gripper.isVisible())this.gripper.hide();if(this.label&&this.label.isVisible())this.label.hide();return}
var _11=_3.getTop(),_12=_3.getScrollTop(),_13=_3.getViewportHeight(),_14=this.getTop(),_15=this.getHeight(),_16=_14+_15,_17=false,_18=false;if(_14<_12||_14>_12+_13)_17=true;if(_16<_12||_16>_12+_13+1)_18=true;if(this.gripper){if(_17||!_5)this.gripper.hide();else{var _19=_10+_6-_7,_20=_2.header.getHeight()+_14-_12;if(!_1&&this.isDrawn()&&!this.gripper.isDrawn())this.gripper.draw();_19=Math.floor(_19-Math.floor(this.gripper.getVisibleWidth()/2));_20=Math.floor(_20-(this.gripper.getVisibleHeight()/2));this.gripper.moveTo(_19,_20);if(!_1&&this.isDrawn()&&!this.gripper.isVisible()){this.gripper.show();this.gripper.bringToFront()}}}
if(this.label){if(_18||!_4){this.label.hide()}else{var _19=_10+_6-_7,_20=_2.header.getHeight()+_16-_12,_21=this.getHeaderHTML(),_22=isc.EventCanvas.getHeaderHeight(_21,(this.maxLabelWidth||_9),this.headerHeight,this.getHeaderWrap(),this);this.label.setContents(_21);if(!_1&&this.isDrawn()&&!this.label.isDrawn())this.label.draw();_19=Math.floor(_19-Math.floor(this.label.getVisibleWidth()/2));_20=Math.floor(_20-(_22/2));this.label.moveTo(_19,_20);if(!_1&&this.isDrawn()&&!this.label.isVisible()){this.label.show();this.label.bringToFront()}}}},isc.A.setEvent=function isc_EventCanvas_setEvent(_1,_2,_3,_4){var _5=this.calendar,_6=this.calendarView;var _7=this.$172w(_1,_2,_3,_4);var _8=_1[_5.startDateField];this.sortValue=_8?_8.duplicate():null;this.canDragReposition=_7.canDragMove;this.canDragResize=_7.canDragResize;if(this.canDragReposition==false){this.setCursor(isc.Canvas.DEFAULT)}else{this.setCursor(isc.Canvas.MOVE)}
this.resizeFrom=[];if(_7.canDragResize){if(_7.canDragStartDate){if(!this.verticalResize)this.resizeFrom.add("L")}
if(_7.canDragEndDate){if(!this.verticalResize)this.resizeFrom.add("R");else this.resizeFrom.add("B")}}
if(this.shouldShowGripper())this.createGripper();else if(this.gripper)this.gripper.hide();if(this.shouldShowLabel())this.createLabel();else if(this.label)this.label.hide();this.checkStyle();this.$238s=null;this.$238t=0;if(this.getShowHeader()){this.headerLabel.setContents(this.getHeaderHTML()||"")}
if(this.getShowBody()){this.bodyLabel.setContents(this.getBodyHTML()||"")}
if(this.calendar.showEventCanvasComponent(this)){var _9=this.getComponent(_1);if(_9){this.calendar.updateEventCanvasComponent(this,_9)}}},isc.A.setCursor=function isc_EventCanvas_setCursor(_1){this.Super("setCursor",arguments);if(this.getShowHeader())this.headerLabel.setCursor(this.cursor)
if(this.getShowBody())this.bodyLabel.setCursor(this.cursor)
if(this.component&&this.component.setCursor)this.component.setCursor(this.cursor)},isc.A.$172x=function isc_EventCanvas__getCacheValue(_1){return this.$172y&&this.$172y[_1]},isc.A.$172w=function isc_EventCanvas__updateValueCache(_1,_2,_3,_4){this.$172y={};this.event=_1;if(this.event){var _5=this.calendar,_6=this.calendarView,_7=this.$172y;_7.canEdit=_5.canEditEvent(_1,_6);_7.canDrag=_7.canDragMove=_5.canDragEvent(_1,_6);_7.canDragResize=_5.canResizeEvent(_1,_6);if(this.isLongEvent)_7.canDragResize=false;_7.canRemove=_5.canRemoveEvent(_1,_6);if(this.$239v){_7.canDrag=false;_7.canDragMove=false;_7.canDragResize=false;_7.canRemove=false}
var _8=_5.getEventStartDate(_1),_9=_5.getEventEndDate(_1);_7.eventStartDate=_8?_8.getTime():null;_7.eventEndDate=_9?_9.getTime():null;_7.eventStyleName=_5.getEventCanvasStyle(_1,_6,this);_7.eventLane=_1[_5.laneNameField];var _6=this.calendarView;_7.viewStartDate=_5.getPeriodStartDate(_6).getTime();_7.viewEndDate=_5.getPeriodEndDate(_6).getTime();_7.canDragStartDate=_7.canDragResize&&_7.eventStartDate>=_7.viewStartDate;if(_6.verticalEvents)_7.canDragStartDate=false;_7.canDragEndDate=_7.canDragResize&&_7.eventEndDate&&_7.eventEndDate<=_7.viewEndDate;_7.showCloseButton=_7.canRemove}
return this.$172y},isc.A.createRolloverControls=function isc_EventCanvas_createRolloverControls(){return this.calendar.$174c(this)},isc.A.updateRolloverControls=function isc_EventCanvas_updateRolloverControls(_1){var _2=this.calendar,c=this.$174h||this.$174f||this.$129e;if(!c){if(this.useStaticControls)this.$174h=this.createRolloverControls();else if(this.isFocused())this.$174f=_2.$174e();else if(_1)this.$129e=_2.$174d();c=this.$174h||this.$174f||this.$129e}
if(!c)return;for(var _4 in c){c[_4].eventCanvas=this;this[_4]=c[_4]}
if(this.closeButton)this.closeButton.canFocus=false;if(this.buttonLayout){this.buttonLayout.canFocus=false;this.addChild(this.buttonLayout,null,false)}
if(this.verticalResize){this.startResizer=null;this.endResizer=this.endResizerB}else{this.startResizer=this.startResizerL;this.endResizer=this.endResizerR}
if(this.startResizer){this.startResizer.dragTarget=this.dragTarget;this.addChild(this.startResizer,null,false)}
if(this.endResizer){this.endResizer.dragTarget=this.dragTarget;this.addChild(this.endResizer,null,false)}
var _5=this.$172y||{};if(!this.buttonLayout.isDrawn()&&this.isDrawn())this.buttonLayout.draw();this.buttonLayout.show();this.buttonLayout.bringToFront();if(this.closeButton){if(!_5.showCloseButton)this.closeButton.hide();else{if(!this.closeButton.isDrawn()&&this.isDrawn())this.closeButton.draw();var _6=this.closeButton.getStyleHandle();if(_6){_6["color"]=this.getShowHeader()?this.headerTextColor:this.bodyTextColor}
this.closeButton.show()}}
if(this.contextButton){if(!this.shouldShowContextButton())this.contextButton.hide()
else{var _7=this.calendar.getEventCanvasMenuItems(this,this.calendarView);if(_7){if(!this.contextButton.isDrawn()&&this.isDrawn())this.contextButton.draw();this.contextButton.show()}else this.contextButton.hide()}}
if(this.startResizer){if(!_5.canDragStartDate)this.startResizer.hide();else{if(!this.startResizer.isDrawn()&&this.isDrawn())this.startResizer.draw();this.startResizer.show();this.startResizer.bringToFront()}}
if(this.endResizer){if(!_5.canDragEndDate)this.endResizer.hide();else{if(!this.endResizer.isDrawn()&&this.isDrawn())this.endResizer.draw();this.endResizer.show();this.endResizer.bringToFront()}}},isc.A.markForColorUpdate=function isc_EventCanvas_markForColorUpdate(_1){this.needsColorUpdateOnSetEvent=true},isc.A.setEventStyle=function isc_EventCanvas_setEventStyle(_1,_2,_3){_2=_2||this.headerStyle||(_1+"Header");_3=_3||this.bodyStyle||(_1+"Body");this.baseStyle=_1;if(this.event.isSelected){this.baseStyle+="Selected";_2+="Selected";_3+="Selected";_1+="Selected"}
this.$129w=_3;this.$7m=_2;if(this.gripper){this.gripper.setStyleName(this.gripperStyle||_1+"Gripper")}
if(this.label)this.label.setStyleName(this.labelStyle||_1+"Label");if(this.$172y)delete this.$172y.$184b;if(this.needsColorUpdateOnSetEvent||this.styleName!=_1){delete this.needsColorUpdateOnSetEvent;this.setStyleName(_1);if(this.getShowHeader()){this.headerLabel.setStyleName(this.$7m);var _4=isc.Element.$x5(this.$7m,{color:"color"});this.headerTextColor=_4["color"]}
if(this.getShowBody())this.bodyLabel.setStyleName(this.$129w);this.markForRedraw()}
this.updateCanvasColors()},isc.A.updateCanvasColors=function isc_EventCanvas_updateCanvasColors(){if(!this.event)return;var e=this.event;var _2=false;if(e.textColor||e.backgroundColor||e.borderColor){var _3=this.getStyleHandle();if(_3){_3["background-color"]=e.backgroundColor;if(e.borderColor){_3["border-style"]="solid";_3["border-color"]=e.borderColor}else{_3["border-color"]=null}}
if(e.textColor||e.backgroundColor){var _4=this.bodyLabel?this.bodyLabel.getStyleHandle():null;if(_4){_4["background-color"]=e.backgroundColor;if(e.textColor){_4["color"]=e.textColor;this.bodyTextColor=_4["color"]}}}
_2=true}
if(e.headerTextColor||e.headerBackgroundColor||e.headerBorderColor){var _5=this.headerLabel?this.headerLabel.getStyleHandle():null;if(_5){if(e.headerBackgroundColor)_5["background-color"]=e.headerBackgroundColor;if(e.headerTextColor){_5["color"]=e.headerTextColor;this.headerTextColor=_5["color"]}
if(e.headerBorderColor)_5["border-color"]=e.headerBorderColor}
_2=true}
if(_2)this.markForColorUpdate()},isc.A.getStartDate=function isc_EventCanvas_getStartDate(){return this.$172x("eventStartDate")||this.calendar.getEventStartDate(this.event)},isc.A.getEndDate=function isc_EventCanvas_getEndDate(){return this.$172x("eventEndDate")||this.calendar.getEventEndDate(this.event)},isc.A.getDuration=function isc_EventCanvas_getDuration(){return this.event[this.calendar.durationField]},isc.A.getEventLength=function isc_EventCanvas_getEventLength(_1){if(this.event.eventLength)return this.event.eventLength;return this.calendar.getEventLength(this.event,_1||"minute")},isc.A.isZeroLengthEvent=function isc_EventCanvas_isZeroLengthEvent(){return this.calendar.isZeroLengthEvent(this.event)},isc.A.getHeaderWrap=function isc_EventCanvas_getHeaderWrap(){if(this.headerWrap!=null)return this.headerWrap;return this.calendar.eventHeaderWrap},isc.A.getHeaderHeight=function isc_EventCanvas_getHeaderHeight(_1){var _2;if(_1||this.getShowBody()){var _3=this.$151t(),_4=this.isDrawn()||!this.calendarView.isTimelineView()?this.getWidth():this.calendarView.$732(this.event),_5=_4-(this.calendar.getLanePadding()*2);var _6=isc.EventCanvas.getHeaderHeight(this.getHeaderHTML(),_5,_3,this.getHeaderWrap(),this);_2=_6}else{_2=this.getInnerHeight()}
return _2},isc.A.$151t=function isc_EventCanvas__getDefinedHeaderHeight(){return this.headerHeight!=null?this.headerHeight:this.calendar.eventHeaderHeight},isc.A.getHeaderStyle=function isc_EventCanvas_getHeaderStyle(){return this.$7m},isc.A.getHeaderHTML=function isc_EventCanvas_getHeaderHTML(){if(!this.event){return"No event"}
return this.calendar.getEventHeaderHTML(this.event,this.calendarView)},isc.A.getBodyStyle=function isc_EventCanvas_getBodyStyle(){return this.$129w},isc.A.getBodyHTML=function isc_EventCanvas_getBodyHTML(){if(!this.event){return""}
return this.calendar.getEventBodyHTML(this.event,this.calendarView)},isc.A.willShowHover=function isc_EventCanvas_willShowHover(){if(this.calendar.alwaysShowEventHovers==true)return true;if(this.autoFit)return false;if(this.$238s==null){var _1=this.getInnerWidth();if(this.getShowHeader()){var _2=this.getHeaderHTML()||"";this.$238t+=isc.Canvas.measureContent(_2,this.headerLabel.styleName,true,true,{width:_1,maxWidth:_1});this.$239u=isc.Canvas.measureContent(_2,this.headerLabel.styleName,false,true,{width:_1})}
if(this.getShowBody()){var _3=this.getBodyHTML()||"";this.$238t+=isc.Canvas.measureContent(_3,this.bodyLabel.styleName,true,true,{width:_1,maxWidth:_1});var _4=isc.Canvas.measureContent(_3,this.bodyLabel.styleName,false,true,{width:_1});this.$239u=Math.max((this.$239u||0),_4)}
this.$238s=this.getVisibleHeight()<this.$238t||this.getVisibleWidth()<this.$239u}
return this.$238s},isc.A.getHoverHTML=function isc_EventCanvas_getHoverHTML(){if(this.calendarView&&this.calendarView.shouldShowEventHovers()){if(this.willShowHover()){return this.calendar.$141h(this.event,this,this.calendarView)}}},isc.A.shouldShowCloseButton=function isc_EventCanvas_shouldShowCloseButton(){if(this.showCloseButton!=null)return this.showCloseButton!=false;return this.$172x("showCloseButton")},isc.A.shouldShowContextButton=function isc_EventCanvas_shouldShowContextButton(){if(this.showContextButton!=null)return this.showContextButton!=false;return this.$172x("showContextButton")},isc.A.getRolloverControls=function isc_EventCanvas_getRolloverControls(){return null},isc.A.renderEvent=function isc_EventCanvas_renderEvent(_1,_2,_3,_4,_5){this.setRect(_2,_1,_3,_4);this.checkStyle();if(!this.parentElement||!this.parentElement.isDrawn())return;if(!this.isDrawn())this.draw();this.show();if(_5)this.sendToBack();else this.bringToFront();if(this.shouldShowGripper()||this.shouldShowLabel()){this.repositionPeers()}
if(this.useStaticControls&&!this.isZoneCanvas&&!this.isIndicatorCanvas){this.updateRolloverControls()}},isc.A.checkStyle=function isc_EventCanvas_checkStyle(){var _1=this.calendar.getEventCanvasStyle(this.event,this.calendarView,this);if(this.needsColorUpdateOnSetEvent||this.calendar.canSelectEvents||_1!=this.styleName){this.setEventStyle(_1)}
this.updateCanvasColors()},isc.A.click=function isc_EventCanvas_click(){var _1=this.calendar.$129v(this);return _1},isc.A.doubleClick=function isc_EventCanvas_doubleClick(){this.calendar.$195c(this)},isc.A.handleShowContextMenu=function isc_EventCanvas_handleShowContextMenu(){return this.calendar.$1701(this)},isc.A.mouseUp=function isc_EventCanvas_mouseUp(){return isc.EH.STOP_BUBBLING},isc.A.rightMouseDown=function isc_EventCanvas_rightMouseDown(){if(this.dragTarget&&this.dragTarget!=this){this.dragTarget.eventCanvas=null;this.dragTarget.$1930=true;this.dragTarget.hide();return false}},isc.A.mouseDown=function isc_EventCanvas_mouseDown(){if(!isc.EH.rightButtonDown()){if(this.dragTarget){this.dragTarget.eventCanvas=this;delete this.dragTarget.$1930}}
this.calendar.hideEventDialog();return isc.EH.STOP_BUBBLING},isc.A.focusChanged=function isc_EventCanvas_focusChanged(_1){var _2=isc.EH.getTarget();if(_2!=this&&this.contains(_2))return;if(_1&&!this.$174f){this.calendar.$174g(this)}else if(this.$174f){this.calendar.$174i(this)}},isc.A.keyPress=function isc_EventCanvas_keyPress(){var _1=this.calendar,_2=isc.EventHandler.getKey();var _3=_1.$195n(this,_2);if(_3==false)return;return this.Super("keyPress",arguments)},isc.A.dragRepositionStart=function isc_EventCanvas_dragRepositionStart(){if(this.calendarView.shouldShowColumnLayouts()){this.deparent();this.bringToFront()}},isc.A.handleMouseMove=function isc_EventCanvas_handleMouseMove(){return false},isc.A.handleMouseOver=function isc_EventCanvas_handleMouseOver(){if(this.$174h||this.$174f)return;if(this.showRolloverControls==false)return;if(this.$129e){var _1=isc.EH.lastEvent.target;if(_1==this||_1.eventCanvas==this)return}
this.updateRolloverControls(true)},isc.A.mouseOut=function isc_EventCanvas_mouseOut(){if(this.$174h||this.$174f)return;if(this.showRolloverControls==false||!this.$129e)return;var _1=isc.EH.lastEvent.target;if(_1&&(_1.eventCanvas==this||_1==isc.Hover.hoverCanvas))return;this.calendar.hideEventCanvasControls(this,"$129e")},isc.A.parentResized=function isc_EventCanvas_parentResized(){this.Super('parentResized',arguments);if(this.shouldShowGripper()||this.shouldShowLabel()){this.repositionPeers()}},isc.A.destroy=function isc_EventCanvas_destroy(){if(this.$174h){var _1=["closeButton","contextButton"];for(var _2 in this.$174h){var _3=this.$174h[_2];_3.hide();if(!_1.contains(_2))this.removeChild(_3);_3.destroy();delete this[_2];_3=null}
delete this.$174h}else{if(this.$174f){this.calendar.hideEventCanvasControls(this,"$174f")}else if(this.$129e){this.calendar.hideEventCanvasControls(this,"$129e")}}
if(this.gripper){this.calendarView.removeChild(this.gripper);this.gripper.destroy();this.gripper=null}
if(this.label){this.calendarView.removeChild(this.label);this.label.destroy();this.label=null}
if(this.dragTarget)this.dragTarget=null;if(this.component){this.removeMember(this.component);this.component.destroy();this.component=null}
this.leadingIcon&&this.leadingIcon.destroy();this.leadingLine&&this.leadingLine.destroy();this.trailingIcon&&this.trailingIcon.destroy();this.trailingLine&&this.trailingLine.destroy();this.leadingIcon=this.leadingLine=this.trailingIcon=this.trailingLine=null;this.calendarView=null;this.calendar=null;this.event=null;this.$172y=null;this.Super("destroy",arguments)},isc.A.getPrintHTML=function isc_EventCanvas_getPrintHTML(_1,_2){if(_2){this.delayCall("asyncGetPrintHTML",[_1,_2]);return null}else{return this.asyncGetPrintHTML(_1,_2)}},isc.A.asyncGetPrintHTML=function isc_EventCanvas_asyncGetPrintHTML(_1,_2){var _3=this.getHandle(),_4=isc.StringBuffer.create(),_5=this.calendar,_6=this.calendarView,_7=_6.isTimelineView(),_8=Math.round(_6.frozenBody?_6.frozenBody.getVisibleWidth():0),_9=this.event,_10=0,_11=0,_12=parseInt(_3.style.width),_13=parseInt(_3.style.height),i=(_1&&_1.i?_1.i:1);var _15=_6.body.getTop()+(_6.header?_6.header.getVisibleHeight():0);var _16=_5.headerLevels?_5.headerLevels.length:1;var _17=_6.headerRowPrintHeight*_16;if(_7){_10=_15+this.getTop();_10=_17+this.getTop();_10=_10+1;_11=_8+this.getLeft()}else{_11=_8+this.getLeft();_10=_17+this.getTop();_10+=1;_12=parseInt(_3.style.width);_13=parseInt(_3.style.height)}
if(isc.Browser.isFirefox){_12-=4;_13-=4;if(_7)_11+=1}
var _18=this.styleName;_4.append("<div class='",_18,"' ","style='vertical-align: ",(_5.showEventDescriptions?"top":"middle"),"; ",(_9.backgroundColor?"background-color: "+_9.backgroundColor+";":""),(_9.textColor?"color: "+_9.textColor+";":""),(_9.borderColor?"border-color: "+_9.borderColor+";":""),"overflow: hidden; ","position: absolute; ","left: ",_11,"px; top: ",_10,"px; width: ",_12,"px; height: ",_13,"px; ","z-index:",i+2,";","'>");this.$239v=true;this.setEvent(this.event);this.redraw();var _19=this.getHandle().innerHTML;_4.append(_19);_4.append("</div>");delete this.$239v;this.setEvent(this.event);this.redraw();if(this.label){_10=_10+_13-5;_12=this.label.getVisibleWidth();_13=this.label.getInnerHeight();_11-=Math.floor(_12/2);_4.append("<div class='",_18+"Header","' ","style='overflow:hidden; ","position: absolute; ","padding:2px; ","z-index:",i+2,";","left:",_11,"px; top:",_10,"px; width: ",_12,"px; height: ",_13,"px; ","'>");_4.append(this.getHeaderHTML());_4.append("</div>")}
return _4.release(false)});isc.evalBoundary;isc.B.push();isc.B._maxIndex=isc.C+66;isc.defineClass("ZoneCanvas","EventCanvas");isc.A=isc.ZoneCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.titleOrientation=null;isc.A.showHeader=true;isc.A.showBody=true;isc.A.canEdit=false;isc.A.canDrag=false;isc.A.canDragReposition=false;isc.A.canDragResize=false;isc.A.canRemove=false;isc.A.showRolloverControls=false;isc.A.isEventCanvas=false;isc.A.isZoneCanvas=true;isc.A.maxLabelWidth=null;isc.B.push(isc.A.initWidget=function isc_ZoneCanvas_initWidget(){this.showCloseButton=false;this.canDragReposition=false;this.canDragResize=false;if(this.titleOrientation==null)this.titleOrientation=this.calendar.zoneTitleOrientation;this.$142u=!this.calendarView.shouldShowZoneHovers();this.Super("initWidget",arguments)},isc.A.setEvent=function isc_ZoneCanvas_setEvent(_1,_2,_3,_4){this.event=_1;this.showCloseButton=false;this.canDragReposition=false;this.canDragResize=false;var _5=this.calendar;_2=_2||_5.getZoneCanvasStyle(_1,this.calendarView);this.setEventStyle(_2,_3,_4)},isc.A.click=function isc_ZoneCanvas_click(){if(this.calendar.zoneClick)this.calendar.zoneClick(this.event,this.calendarView.viewName)},isc.A.getHoverHTML=function isc_ZoneCanvas_getHoverHTML(){if(this.calendarView.shouldShowZoneHovers()){var _1=this.calendar.$141i(this.event,this,this.calendarView);return _1}},isc.A.checkStyle=function isc_ZoneCanvas_checkStyle(){},isc.A.updateRolloverControls=function isc_ZoneCanvas_updateRolloverControls(){});isc.B._maxIndex=isc.C+6;isc.defineClass("IndicatorCanvas","EventCanvas");isc.A=isc.IndicatorCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.showHeader=false;isc.A.showBody=false;isc.A.headerSnapTo="B";isc.A.showGripper=true;isc.A.showLabel=true;isc.A.isEventCanvas=false;isc.A.isIndicatorCanvas=true;isc.A.canDrag=true;isc.A.canDragReposition=true;isc.A.dragRepositionCursor=isc.Canvas.MOVE;isc.A.canDragResize=false;isc.A.canRemove=false;isc.A.showRolloverControls=false;isc.B.push(isc.A.initWidget=function isc_IndicatorCanvas_initWidget(){this.showCloseButton=false;this.canDragResize=false;this.Super("initWidget",arguments);if(this.event)this.setEvent(this.event)},isc.A.setEvent=function isc_IndicatorCanvas_setEvent(_1,_2,_3,_4){this.event=_1;var _5=this.$172w(_1,_2,_3,_4);this.canEdit=_5.canEdit;this.canDrag=_5.canDrag;this.canDragResize=false;this.canDragReposition=_5.canDragMove;if(this.canDragReposition==false){this.setCursor(isc.Canvas.DEFAULT)}else{this.setCursor(isc.Canvas.MOVE)}
this.showCloseButton=false;var _6=this.calendar;_2=_2||_6.getIndicatorCanvasStyle(_1,this.calendarView);this.setEventStyle(_2,_3,_4)},isc.A.click=function isc_IndicatorCanvas_click(){if(this.calendar.indicatorClick)this.calendar.indicatorClick(this.event,this.calendarView.viewName)},isc.A.getHoverHTML=function isc_IndicatorCanvas_getHoverHTML(){return this.calendar.$141j(this.event,this,this.calendarView)},isc.A.checkStyle=function isc_IndicatorCanvas_checkStyle(){},isc.A.updateRolloverControls=function isc_IndicatorCanvas_updateRolloverControls(){});isc.B._maxIndex=isc.C+6;isc.ClassFactory.defineClass("Timeline","Calendar");isc.A=isc.Timeline.getPrototype();isc.A.showTimelineView=true;isc.A.showDayView=false;isc.A.showWeekView=false;isc.A.showMonthView=false;isc.A.showControlBar=false;isc.A.labelColumnWidth=75;isc.A.sizeEventsToGrid=false;isc.A.eventDragGap=0;isc.A.eventOverlap=false;isc._nonDebugModules=(isc._nonDebugModules!=null?isc._nonDebugModules:[]);isc._nonDebugModules.push('Calendar');isc.checkForDebugAndNonDebugModules();isc._moduleEnd=isc._Calendar_end=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc.Log&&isc.Log.logIsInfoEnabled('loadTime'))isc.Log.logInfo('Calendar module init time: '+(isc._moduleEnd-isc._moduleStart)+'ms','loadTime');delete isc.definingFramework;if(isc.Page)isc.Page.handleEvent(null,"moduleLoaded",{moduleName:'Calendar',loadTime:(isc._moduleEnd-isc._moduleStart)});}else{if(window.isc&&isc.Log&&isc.Log.logWarn)isc.Log.logWarn("Duplicate load of module 'Calendar'.");}
