//>>built
define("demos/calendar/utils",["dojo/_base/declare","dojo/_base/lang","dojo/_base/fx","dojo/store/Memory","dojo/store/Observable"],function(_1,_2,fx,_3,_4){var _5=_2.getObject("demo.utils",true);_5.initHints=function(_6){var _7=["Hint: Create an event by clicking and dragging on the grid while maintaining the control key","Hint: Move an event by clicking on it and dragging it","Hint: Resize an event by clicking on one of its ends and dragging it"];var _8=0;_6.innerHTML=_7[0];setInterval(function(){fx.fadeOut({node:_6,onEnd:function(){_8=_8+1>_7.length-1?0:_8+1;_6.innerHTML=_7[_8];fx.fadeIn({node:_6}).play(500);}}).play(500);},10000);};_5.getStartOfCurrentWeek=function(_9){return _9.floorToWeek(new _9.dateClassObj());};_5.createDefaultStore=function(_a){var _b=[{day:1,start:[10,0],duration:1400},{day:2,start:[10,30],duration:120},{day:2,start:[12,0],duration:240},{day:3,start:[6,0],duration:180},{day:3,start:[0,0],duration:2880,allDay:true}];var _c=[];var _d=_5.getStartOfCurrentWeek(_a);for(var id=0;id<_b.length;id++){var _e={id:id,summary:"New Event "+id,startTime:new _a.dateClassObj(_d.getTime()),endTime:new _a.dateClassObj(_d.getTime()),calendar:id%2==0?"cal1":"cal2",allDay:_b[id].allDay};_e.startTime=_a.dateModule.add(_e.startTime,"day",_b[id].day);_e.startTime.setHours(_b[id].start[0]);_e.startTime.setMinutes(_b[id].start[1]);_e.endTime=_a.dateModule.add(_e.startTime,"minute",_b[id].duration);_c.push(_e);}this.id=id;return new _4(new _3({data:_c}));};_5.configureInteractiveItemCreation=function(_f){var _10=function(_11,d,e){if(!e.ctrlKey||e.shiftKey||e.altKey){return null;}var _12,end;var _13=_f.columnView;var cal=_f.dateModule;if(_11==_13){_12=_f.floorDate(d,"minute",_13.timeSlotDuration);end=cal.add(_12,"minute",_13.timeSlotDuration);}else{_12=_f.floorToDay(d);end=cal.add(_12,"day",1);}var _14={id:_5.id,summary:"New event "+_5.id,startTime:_12,endTime:end,calendar:"cal1",allDay:_11.viewKind=="matrix"};_5.id++;return _14;};_f.set("createOnGridClick",true);_f.set("createItemFunc",_10);};return _5;});