/* @license Copyright (C) Exontrol. All rights reserved. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):(t="undefined"!=typeof globalThis?globalThis:t||self,e(t.exontrol||{}))}(this,function(t){"use strict";function e(){}function o(t){return t instanceof Array}function i(t){return t instanceof y.Arr}function n(t){return t instanceof Function}function r(t){return t instanceof ClipboardEvent}function s(t){return t instanceof y.Schedule.Event}function h(t){return t instanceof y.Schedule.MarkZone}function a(t){return t instanceof y.Schedule.SV}function u(){return Math.max.apply(0,arguments)}function l(){return Math.min.apply(null,arguments)}function c(t){return null!=t}function p(t){return null==t}function f(t,e,o){return p(t)?~~o:y.s2F(t,e)}var g,y=y||window.exontrol,S=y.UR;if(y.Calendar){var d=y.Shapes.Calendar;d&&(d.hframe2=void 0,d.today.normal.tfi.bold=!1,d.select.normal={frameColor:"dodgerblue",primitive:"Circle",frameSize:2,pad:1},d.select.hover=void 0)}y.Def.Schedule={},y.Shapes.Schedule={},y.Mrg(y,function(){function t(t,e,o){this.oT=t,this.init(e,o)}function r(t,e){this.init(t,e)}return y.Calendar&&Object.addPrototypeOf(t.prototype,y.Calendar.prototype),t.prototype.onLD=function(t){return function(){t&&t.apply(this,arguments),this.oT.onCC(0)}}(t.prototype.onLD),t.prototype.SetClientRect=function(t){return function(){var e,o=!this.lnt,i=o&&this.gLyt().table;t&&t.apply(this,arguments),o&&i&&(e=this.gLyt().table)&&(i.h!=e.h||i.v!=e.v)&&this.oT.onCC(1)}}(t.prototype.SetClientRect),t.prototype.onselchange=function(t){return function(){t&&t.apply(this,arguments),this.oT.onSC2.apply(this.oT,arguments)}}(t.prototype.onselchange),t.prototype.drawO=function(t){return function(e,o,i,n,r){this.gSV().drawSC(t,this,e,o,i,n,r)}}(t.prototype.drawO),t.prototype.eU=function(t){return function(){t.apply(this,arguments),this.oW&&this.oW.onUI()}}(t.prototype.eU),t.prototype.fit=function(){var t=this.gLyt(),e=t.size,o=t.table,i=this.getMinMonth();return{x:16+~~(e.width/o.h*i.x),y:16+~~(e.height/o.v*i.y)}},t.prototype.gSV=function(){return this.oT.oSV},t.eqSY=function(t,e){return t==e||t&&e&&t.y==e.y&&(t.d==e.d||t.d&&e.d&&!t.d.Compare(e.d))},t.prototype.gSY=function(){var t,e,o={};return this.getSel().forEach(function(o){var i=o.GetYear();(p(t)||t>i)&&(t=i),(p(e)||o>e)&&(e=o)}),o.y=p(t)?(this.GetDate()||Date.Today()).GetYear():t,c(e)&&e.GetYear()!=o.y&&(o.d=e),o},r.version="3.2",r.type="Schedule",r.XML=function(){function t(t){return c(t)?t.toLowerCase():t}function e(o){var i,n,r="^"==o.charAt(0);r&&(o=o.substr(1)),~(i=o.indexOf("/"))&&(n=o.substr(i+1),o=o.substr(0,i));for(var s,h=function(e){e=t(e);for(var o,i=[],n=0,r=this.getElementsByTagName("*"),s=r.length;n>=8))+",",i+=(255&(t>>=8))+")"),i||e}}}(),r.allowRurPart=function(t,e,o){return!o||!e||e.indexOf(t)>=0&&(!function(t){return t.split(",").forEachU(function(t){return this.has(t)},this)}.call(o,e)||o.has(t))},r.EventResizableEnum={exNoResizable:0,exResizableStart:1,exResizableEnd:2,exResizableBoth:3},r.OnSelectDateEnum={exFitSelToView:-1,exNoViewChange:0,exEnsureVisibleDate:1},r.ShowViewCompactEnum={exViewCalendar:0,exViewCalendarCompact:-1,exViewSingleRow:1,exViewSingleColumn:2,exViewSingleRowLockHeader:3},r.OnResizeControlEnum={exResizePanelLeft:0,exResizePanelRight:1,exDisableSplitter:128,exHideSplitter:256,exChangePanels:512,exCalendarFit:1024,exCalendarAutoHide:2048},r.SingleSelEnum={exDisableSel:0,exEnableSel:1,exSingleSel:2,exToggleSel:4,exDisableCtrlSel:8,exDisableShiftSel:16,exDisableDrag:32},r.Options={allowUndoRedo:null,undoRedoQueueLength:null,scrollBars:null,tfi:null,locked:null,readOnly:!1,wheelChange:null,smooth:null,shapes:null,cursors:null,singleSel:null,zoom:null,zoomLevels:null,formatText:null,pad:null,imageSize:null,imageAlign:null,allowActions:null,scrollPos:null,toolTipDelay:null,toolTipPopDelay:null,toolTipWidth:null,calendar:null,onResizeControl:null,showViewCompact:null,dayViewWidth:null,dayViewHeight:null,paneWidthLeft:null,paneWidthRight:null,headerDayHeight:null,showHighlightEvent:null,headerDayLongLabel:null,headerDayShortLabel:null,dayStartTime:null,dayEndTime:null,showGroupingEvents:!1,displayGroupingButton:!1,headerGroupHeight:null,applyGroupingColors:null,onSelectDate:null,selectEventStyle:null,allowMoveEventToOtherGroup:null,defaultEventToolTip:null,defaultEventShortLabel:null,defaultEventLongLabel:null,defaultEventExtraLabel:null,shortDateFormat:null,shortTimeFormat:null,longDateFormat:null,longTimeFormat:null,showEventLabels:null,createEventLabel:null,updateEventsLabel:null,showMarkZone:null,showEvents:null,showAllDayHeader:null,headerAllDayEventHeight:null,allowMultiDaysEvent:null,allowAllDayEventScroll:null,markZones:null,groups:null,markZones:null,events:null,selection:null,timeScale:null,misc:null,background:null},S&&(r.blockUR=function(t){return function(){var e=this,o=arguments;(this.oT||this).blockUR(function(){t.apply(e,o)})}}),r.bSCTX=function(t,e,o,i){var n;return e&&(t.drawShape(o,e,i),n=y.TFI.bCTX(t,e.tfi),c(e.opacity)&&((n=n||{}).opacity=t.globalAlpha,t.globalAlpha=e.opacity)),n},r.eSCTX=function(t,e){c(e.opacity)&&(t.globalAlpha=e.opacity),y.TFI.eCTX(t,e)},r.sCTX=function(t,e,o,i,n,s){var h=r.bSCTX(t,e,o,i);n&&n.call(s),h&&r.eSCTX(t,h)},r.prototype.init=function(t,e){this.lnt=this.lnt||0,this.lnt++,this.oZ=new r.MarkZones(this),this.oG=new r.Groups(this),this.oE=new r.Events(this),this.lAI=0,this.oSV=null,this.rgSV=[],this.rgSel=null,this.sSA="smth-"+y.Rand(),this.iLts(),this.oCW=new y.CW(t,{AllowXChg:0,ScrollBars:y.Def.Schedule.scrollBars}),this.oCW.oT=this,this.Shortcuts=this.oCW.oSts,S&&(this.oUR=new S.M({oC:this,cU:g.Update,onUR:this.onundoredo}),this.oUR.oT=this,this.oUR.gUR=function(t){return function(){return!this.oT.isReadOnly()&&t.apply(this,arguments)||null}}(this.oUR.gUR),this.Shortcuts.Add("CTRL + Z",this.Undo,this,"undoes the last action or a sequence of actions"),this.Shortcuts.Add("CTRL + Y",this.Redo,this,"redoes the last action that was undone (reverses the Undo method)")),this.initCW(),this.import(),y.expO(r.Options,this,this.oSV),this.cwbU(),this.SetOptions(e,!0),this.cweU(),y.DPR.Reg(this),this.oCW.onCR(),--this.lnt},r.prototype.defAA=function(){return"fit(Shift+MButton),zoom(Ctrl+MButton,Alt+MButton),group-resize,day-resize(MButton),select(Shift,Ctrl),group-drag,create(Alt),move,scroll"},r.prototype.roAA=function(){return"scroll,zoom,fit,select"},r.prototype.allP=function(){return"view(Schedule.SV),timescale(Schedule.TimeScale)"},r.prototype.Clear=function(){this.bU(),this.oZ.Clear(),this.oG.Clear(),this.oE.Clear(),this.eU()},r.prototype.p2E=function(t){return this.feSVU(function(e){return e.oW&&e.p2E(t)})},r.prototype.onAddEvent=function(t){this.lAI||(this.onLE(),this.onaddevent(t))},r.prototype.onaddevent=function(t){this.oLts.onaddevent.do(t)},r.prototype.onDelEvent=function(t){this.removeSel(t),this.onLE(),this.onremoveevent(t)},r.prototype.onremoveevent=function(t){this.oLts.onremoveevent.do(t)},r.prototype.onMoveEvent=function(){},r.prototype.onAddGroup=function(t){this.onLE()},r.prototype.onDelGroup=function(t){this.onLE()},r.prototype.onAddMarkZone=function(t){this.onLZ()},r.prototype.onDelMarkZone=function(t){this.onLZ()},r.prototype.feSV=function(t,e){y.Schedule.SV.prototype[t]?this.rgSV.forEach(function(e){e[t].call(e)},this):this.rgSV.forEach(t,e)},r.prototype.feSVU=function(t,e){return y.Schedule.SV.prototype[t]?this.rgSV.forEachU(function(e){e[t].call(e)},this):this.rgSV.forEachU(t,e)},r.prototype.feE=function(t,e){e=e||this,this.oE.forEach(function(o){t.call(e,o)})},r.prototype.feEU=function(t,e){return this.oE.forEachU(t,e||this)},r.prototype.setTimeout=function(){return y.setTimeout.apply(this,arguments)},g=y.Def.UR.Schedule={Update:"Smooth",AddEvent:"AddEvent",RemoveEvent:"RemoveEvent",MoveEvent:"MoveEvent",UpdateEvent:"UpdateEvent"},r.prototype.gUR=function(){return this.oUR&&this.oUR.gUR()},r.prototype.onundoredo=function(t){this.oSV.onChange("undo-redo",t)},r.prototype.GetAllowUndoRedo=e,r.prototype.SetAllowUndoRedo=e,r.prototype.GetUndoRedoQueueLength=e,r.prototype.SetUndoRedoQueueLength=e,r.prototype.CanUndo=e,r.prototype.CanRedo=e,r.prototype.StartBlockUndoRedo=e,r.prototype.EndBlockUndoRedo=e,r.prototype.BlockUndoRedo=function(t,e){n(t)&&(this.StartBlockUndoRedo(),t.call(e||this),this.EndBlockUndoRedo())},r.prototype.Undo=e,r.prototype.Redo=e,r.prototype.UndoListAction=function(t,e){},r.prototype.RedoListAction=function(t,e){},r.prototype.UndoRemoveAction=function(t,e){},r.prototype.RedoRemoveAction=function(t,e){},r.prototype.GroupUndoRedoActions=function(t){},r.prototype.BeginUpdate=function(){this.oCW.CWs().forEach(function(t){t.bU()})},r.prototype.bU=r.prototype.cwbU=r.prototype.BeginUpdate,r.prototype.EndUpdate=function(){1==this.oCW.lR&&this.fU(),this.oCW.CWs().forEach(function(t){t.eU()})},r.prototype.eU=r.prototype.cweU=r.prototype.EndUpdate,r.prototype.Update=function(t,e){this.bU(),t&&t.call(e||this),this.eU()},r.prototype.fU=function(){},r.prototype.bR=function(){this.oCW.CWs().forEach(function(t){t.bR()})},r.prototype.eR=function(){this.oCW.CWs().forEach(function(t){t.eR()})},r.prototype.Refresh=function(){this.bU(),this.oG.resVG(),this.onLD(),this.onUI(),this.eU()},r.prototype.onUI=function(){this.oCW.onUI()},r.prototype.uLD=function(){this.oC&&!t.eqSY(this.oC.gSY(),this.gLDV().sy)&&this.onLD()},r.prototype.onLD=function(t){this.onLE(),this.onLZ(),this.oLDV&&(this.oLDV=null,this.feSV("onLD")),t&&this.setTimeout(function(){this.bU(),this.eU()})},r.prototype.onLE=function(){this.oLE&&(this.oLE=null,this.feSV("onLE"))},r.prototype.onLx=function(t,e){t=new Date(t),e=new Date(e),this.oE.gRE().forEach(function(o){var i;o.isVisible()&&(i=o.gRx())&&i.gA(t,e)})},r.prototype.onLZ=function(){this.oLZ&&(this.oLZ=null,this.feSV("onLZ"))},r.prototype.onCC=function(t){t<2&&this.onLD(!t)},r.prototype.onSC2=function(t){this.lnt||(this.bR(),this.uLD(),this.oSV.onSC2(),this.eR()),this.oncalselchange(t)},r.prototype.oncalselchange=function(t){this.oLts.oncalselchange.do(t)},r.prototype.resO=function(){this.oLE&&this.oLE.resEO(),this.oLZ&&this.oLZ.resZO()},r.prototype.issD=function(t){return this.oC&&this.oC.isSelected(t)},r.prototype.sD=function(){return this.oC&&this.oC.getSel()||y.Arr.empty},r.prototype.fD=function(){return this.sD().first()||this.oC&&this.oC.GetDate()||Date.Today()},r.prototype.updSPR=function(){this.feSV("updSPR")},r.prototype.iLts=function(){this.Listeners=this.oLts=new y.Lts,this.oLts.add("onselchange"),this.oLts.add("oncalselchange"),this.oLts.add("onclick"),this.oLts.add("onanchorclick"),this.oLts.add("onscroll"),this.oLts.add("onchange"),this.oLts.add("onaddevent"),this.oLts.add("onremoveevent")},r.prototype.addSV=function(t,e){function o(e){return e.repAll("name",t)}var i=null;if(!p(t)&&t.trim().length||(t="schedule"+this.rgSV.length),!this.oCW.W(t)){var n=!this.rgSV.length,r=(this.oCW.W("main")||this.oCW).Add(t,y.Mrg({Dock:n?5:4,Size:256},e));i=new y.Schedule.SV(this),this.rgSV.push(i),this.oSV=this.oSV||i,!(r.GetDock()%2)&&r.SetPosition(this.oCW.W("schedule").GetPosition()+1),r.Add("client",{Dock:5,HoverExtends:o("control,top,bottom,main.footer,vertical,vscroll,grip,name,name.hscroll"),Extends:o("name.hscroll,vertical"),HScroll:o("name.hscroll"),VScroll:"vscroll",Control:i}),r.Add("time",{Dock:3,Size:i.oTS.getWidth(64),VScroll:"vscroll",Resizable:i.oTS.getAllowResize(!0),Control:i.oTS}),r.Add("hscroll",{Dock:2,Resizable:!1,Size:16,VisibleExtends:o("name.client"),Opacity:0,HoverOpacity:1,Control:new y.ScrollBar})}return i},r.prototype.AddScheduleView=function(t,e){this.bU();var o=this.addSV(t,e);return this.eU(),o},r.prototype.delSV=function(t){!p(t)&&t.trim().length||(t=this.rgSV[this.rgSV.length-1].oW.opW.GetName());var e=!1,o=this.oCW.W(t);if(o){var i=null,n=this.oCW.W(o.GetName()+".client");if(n&&a(i=n.GetC())&&i!=this.oSV){var r=this.rgSV.indexOf(i);(e=r>=0)&&(this.rgSV.splice(r,1),this.oCW.Remove(o))}}return e},r.prototype.RemoveScheduleView=function(t){this.bU(),this.delSV(t),this.eU()},r.prototype.ScheduleView=function(t){var e=this.oCW.W(t+".client");return e&&e.oC&&~this.rgSV.indexOf(e.oC)&&e.oC||null},r.prototype.initCW=function(){function e(){var t="grip",e="",o=null,i=this.oCW.W(t);this.rgSV.forEach(function(i){i.oW&&i.oW.opW&&(t+=","+(e=i.oW.opW.GetShortName()+".hscroll"),o=o||this.oCW.W(e))},this),o&&o.SetSizeExtends(t),i&&i.SetVisibleExtends(t)}var o,i=this,n=this.oCW;if(this.oCW.canvas.addEventListener("dragover",this.localdragover=function(t){return i.ondragover(t)}),this.oCW.canvas.addEventListener("drop",this.localdrop=function(t){return i.ondrop(t)}),this.oCW.onAdd=function(t){return function(){return e.call(i),t.apply(this,arguments)}}(this.oCW.onAdd),this.oCW.onRemove=function(t){return function(){return e.call(i),t.apply(this,arguments)}}(this.oCW.onRemove),this.oCW.SetClientRect=function(t){return function(){t.apply(this,arguments),this.onCR()}}(this.oCW.SetClientRect),this.oCW.onCR=function(){(function(){this.lIC||(this.lIC=this.setTimeout(function(){~this.oT.oSV.getPaneWidthRight()&&this.SetPaneWidthRight(this.getPaneWidthRight()),this.lSh++,this.uLD(),this.sD().len()?this.onSC2():this.EnsureVisibleDate(this.oT.fD()),--this.lSh}))}).call(this.oT.oSV),this.oT.Update()},this.oCW.canAXChg=(this.oCW.canAXChg,function(){}),n=n.Add("control",{Dock:5}),y.Calendar){var r=n.Add("calendar",{Dock:3,Size:196,Control:this.oC=new t(this)});r.aClient=function(){var t,e,o,i,n=this.client;this.IsMinRec()||!(t=this.oC.gSV())||t.oT.lnt||t.lSh||(t.rcCF()&&(e=this.oC.fit(),n[2]=u(n[2],e.x),n[3]=u(n[3],e.y)),t.rcAH()&&this!=this.oCW.oHovW?(n[2]=0,n[3]=0):(~(o=t.getPaneMinWidthLeft())&&(n[2]=u(n[2],o)),~(i=t.getPaneMinWidthRight())&&(n[2]=l(n[2],this.oCW.GetClientRect()[2]-i))))},r.onmIO=function(t){if(this.isAH()){var e=this.oC.oT,o=e.oSV;clearTimeout(this.hmIO),this.hmIO=setTimeout(function(){!function(t){e.Update(function(){t?(r.SetSize(r._autoS),r._autoS=null):(p(r._autoS)&&(r._autoS=r.GetSize()),r.SetSize(0)),o.lSh++,o.onSC2(),--o.lSh})}(!t)},t?512:256)}},r.isAH=function(){return this.oC.gSV().rcAH()},r.onHovI=function(t){return function(){t.apply(this,arguments),this.onmIO(!1)}}(r.onHovI),r.onHovO=function(t){return function(){t.apply(this,arguments),this.onmIO(!0)}}(r.onHovO)}(o=n.Add("main",{Dock:5}).Add("vertical",{Dock:4,Resizable:!1,Size:16,VisibleExtends:"schedule.client,vscroll",Opacity:0,HoverOpacity:1})).Add("grip",{Dock:2,AllowXChg:!1,Size:16,Resizable:!1}),o.Add("vscroll",{Dock:5,AllowXChg:!1,Resizable:!1,Control:new y.ScrollBar}),this.addSV("schedule"),this.oSV.aRC()},r.prototype.w2P=function(t){function e(){function t(t){var e=[];return y.B.split(t).forEach(function(t){t.caption&&t.subText&&e.push({n:t.caption,p:function(t){var e=y;return t.split(".").forEach(function(t){e=e[t]}),e.prototype}(t.subText)})}),e}return this._allP||(this._allP=t.call(this,this.allP()))}var o,i=t&&t.oC&&Object.getPrototypeOf(t.oC);if(i)for(var n,r=e.call(this),s=0,h=r.length;!o&&s1),this.rgSel=null),i&&(this.rgSel=this.rgSel||new y.Arr).push(t)),e|=o!=this.isSelected(t);return e}var s=!1,h=2&(e=e||{}).selType,a=function(t){var e=null;if(c(t)){var n=this.oE,s=n.Item;t instanceof r.Events?t==this.oE&&(e=this.oE.rgE):o(t)||i(t)?(e=new y.Arr,t.forEach(function(t){e.ann(s.call(n,t))})):e=s.call(n,t)}return e}.call(this,t);return i(a)?h?a.forEach(function(t){s|=n.call(this,t)},this):(s=!a.equal(this.rgSel))&&(this.isSingleSel()?n.call(this,a.last()):(this.rgSel=new y.Arr,a.forEach(function(t){t.isSelectable()&&this.rgSel.push(t)},this))):s=n.call(this,a),s&&(i(this.rgSel)&&(this.rgSel.len()||(this.rgSel=null)),(p(e.selChange)||e.selChange)&&(this.feSV("invAO"),this.onSel())),s},r.prototype.onSel=function(){this.onselchange(this.GetSelection())},r.prototype.onselchange=function(t){this.oLts.onselchange.do(t)},r.prototype.onZoom=function(){this.lZ=this.lZ||0,this.lZ++||(this.feSV(function(t){var e=t.oTS.oW;e.SetSize(t.unscaled(e._nS=e._nS||e.GetSize()))},this),this.resO()),--this.lZ},r.prototype.gLE=function(){return this.oLE||(this.oLE=this.nLE())},r.prototype.nLE=function(){return new r.LE(this)},r.prototype.gLZ=function(){return this.oLZ||(this.oLZ=this.nLZ())},r.prototype.nLZ=function(){return new r.LZ(this)},r.prototype.gLDV=function(){return this.oLDV||(this.oLDV=this.nLDV())},r.prototype.nLDV=function(){return new r.LDV(this)},y.ComboBox&&(r.prototype.dCBl=function(t,e,o){o.oO.label=this.getSel().join()},r.prototype.cCB=function(t){var e=this.e2V(t);return!e||a(e)},r.prototype.sCB=function(t){return t&&this.SetSelection(null),this.getSelCount()},y.CW.prototype.SetCanvas=function(t,e){return y.ComboBox.implExHost(t,"onselchange,onchange,onscroll")}(y.CW.prototype.SetCanvas)),Object.defineProperty(r.prototype,"Calendar",{get:function(){return this.oC},configurable:!0}),S&&(["SetEvents","Clear"].forEach(function(t){r.prototype[t]=r.blockUR(r.prototype[t])}),r.prototype.nUR=function(t,e,o){this.blockUR(function(i){e.call(o||this,i.New(t))})},r.prototype.blockUR=function(t,e){e=e||this;var o=this.gUR();o?o.Block(function(){t.call(e,o)},this):t.call(e)},r.prototype.onAddEvent=function(t){return function(e){t.apply(this,arguments),this.gUR()&&this.nUR(g.AddEvent,function(t){e.arUR(t)})}}(r.prototype.onAddEvent),r.prototype.onDelEvent=function(t){return function(e){t.apply(this,arguments),this.gUR()&&this.nUR(g.RemoveEvent,function(t){t.del=!0,e.arUR(t)})}}(r.prototype.onDelEvent),r.prototype.onMoveEvent=function(t){return function(e,o){t.apply(this,arguments),this.gUR()&&this.nUR(g.MoveEvent,function(t){e.mvUR(t,o)})}}(r.prototype.onMoveEvent)),y.expO({Events:null,Groups:null,Layout:null,Statistics:null,Selection:null},r.prototype),{Schedule:r}}()),y.Mrg(y.Schedule,function(){function t(t){var e,n=y.Arr.empty;return c(t)&&(e=t,n=new y.Arr,i(t)?e=t.rgE:o(t)||(e=[t]),e.forEach(function(t){n.ann(this.Item(t))},this)),n}function e(t){return t&&t.getTime?t.getTime():t}function a(t){return"b"+y.ToS(t)}function d(t){return a("gh-"+e(t))}function v(t){return a("gc-"+e(t))}function E(t){return a("ash-"+t.s)}function D(t){return a("asc-"+t.s)}function m(t){return t-t%Y}function T(t,e){return t&&e?y.Inh(t,e):t||e}function C(t){return t&&!(t.normal||t.hover||t.click||t.disabled)&&(t={normal:t}),t}function G(t){var e,o,i,n,r,s=new y.BiM,h=new Map,a=new Map,u=new Map,l=G.toK;y.B.split(t).forEach(function(t){(o=t.subText)&&(n="get"+y.getP(o),r="Set"+y.getP(o),t.flags&&(n=t.flags.get("get")||n,r=t.flags.get("set")||r),e=~~t.caption,i=l(o),s.set(e,o),h.set(i,o),h.set(e,e),a.set(e,n),a.set(i,n),u.set(e,r),u.set(i,r))}),this.o=s,this.k=h,this.g=a,this.s=u}function b(t,e){this.oT=e,(t=y.ToS(t))&&(~t.toLocaleLowerCase().indexOf("freq")?y.ICalendar&&(this.oEx=y.ICalendar.IRecur.Parse(t),(this.valid=this.oEx.valid())&&(this.eval=function(t){var e=this.oT.gLDV().sy;return this.gA(e.f,e.t).has(m(t.getTime()))})):(this.gA=function(){},this.oEx=y.E.Create(t,"value"),(this.valid=this.oEx.IsValid())&&(this.eval=function(t){return this.oEx.Evaluate(function(){return t})})))}function w(t){this.init(t)}function R(t,e){this.oZ=t,this.oO={},this.setOpts(e)}function A(t){this.init(t)}function O(t,e){this.oE=t,this.oO={},this.setOpts(e)}function U(t){this.init(t)}function L(t,e){this.oG=t,this.oO={},this.setOpts(e)}function V(t){this.init(t)}function x(t,e){this.rgE=e.forEach?e:[e],this.init(t)}function M(t){this.init(t)}function W(t){this.init(t)}function H(){this.init()}function I(){this.init()}function k(t,e){this.oSV=t,this.get(e||0)}function P(t){this.init(t)}function Z(t){this.init(t)}function z(t){this.init(t)}var F,N,B=1234,K=1/24/60/60/2,X=y.G,Y=y.msday,j=null,_=24;G.toK=function(t){return y.IsI(t)?~~t:t&&t.toLowerCase&&t.toLowerCase()||t},G.prototype.toK=function(t){var e=G.toK(t);if(this.k.has(e))return e},G.prototype.toO=function(t){var e=this.k.get(this.toK(t));return y.IsI(e)?this.o.get(e):e},G.prototype.toI=function(t){var e=this.k.get(this.toK(t));return y.IsI(e)?e:this.o.getKey(e)},G.prototype.get=function(t){return this.g.get(this.toK(t))},G.prototype.set=function(t){return this.s.get(this.toK(t))},F=function(){function t(t){(t=y.ToS(t)).startsWith("=")&&(t=t.substr(1)),this.oEx=y.E.Create(t)}function e(t){this.c=t}var o=new Map,i=new Map,n=new e;return t.prototype.eval=function(t){return this.oEx.Evaluate(function(e,o){return t.toFormat(e,o)})},e.prototype.evalEv=function(e,o){var n=y.H.SetEObj(function(o){var n=i.get(o);return!n&&i.set(o,n=new t(o)),n.eval(e)},this),r=o.call(this);return y.H.SetEObj(n),r},e.prototype.size=function(t,e,o,i){return this.evalEv(t,function(){return e.sizeHTMLText(this.c,o,i)})},e.prototype.draw=function(t,e,o,i,n){return this.evalEv(t,function(){return e.drawHTMLText(this.c,o,i,n)})},e.prototype.text=function(t){return this.evalEv(t,function(){return y.H.TextNoHTML(this.c)})},{Get:function(t){var i;return c(t)&&!(i=o.get(t))&&o.set(t,i=new e(t)),i||null},Set:function(t){return n.c=t,n},XC:(i.clear(),void o.clear())}}();var q={minHeight:1,requireTimeScaleHeight:4,displayTimeScaleHeight:1,requireRulerDistance:1,groupingButtonPrompt:"Enter the id or index of each visible-group (separated by comma):",arrowSizeMultiDatesEvent:[3,6],createEventMargin:6,eventMargin:3,padSelectEvent:3,formatGroupCaption:262149,dragAlpha:.5,dragAlphaNegate:!1,dragDummyAlpha:1,allowEmptyEvents:1,formatEventShortLabel:262176,formatEventLongLabel:16,formatEventExtraLabel:32808,formatCreateEventLabel:272,formatUpdateEventLabel:272,eventDisplayMarginsSep:" - ",formatMarkZoneCaption:262165,arrangeEventsOnDrag:!1,dragStartOnMove:1,ensureVisibleOnDrag:-1},Q={majorTimeRulerColor:"#C0C0C0",majorTimeRulerStyle:1,timeScaleMajorTimeRulerColor:"#C0C0C0",timeScaleMajorTimeRulerStyle:1,timeScaleMinorTimeRulerColor:"#C0C0C0",timeScaleMinorTimeRulerStyle:1,groupingButtonCaption:"…",eventContinueDay:"black"};b.prototype.eval=function(t){},b.prototype.gA=function(t,e){var o,i=t.GetYear()-1,n=e.GetYear()+1;return(!this.rgA||ithis.rgA.eY)&&(t=Date.Create(i,1,1),o={count:((e=Date.Create(n,12,31))-t)/Y,until:e,filter:m},this.oEx.has("DTSTART")||(o.start=t),this.rgA=this.oEx.all(o),this.rgA.sY=i,this.rgA.eY=n),this.rgA};var J={start:null,end:null,time:null,groupID:null,caption:void 0,visible:null,key:null,shape:null,repetitive:null,eventShape:null,timeScaleShape:null};w.prototype.init=function(t){this.oT=t,this.rgZ=new y.Arr,this.rgZ.onRemove=t.onDelMarkZone.bind(t),this.import()},w.prototype.import=function(){var t=this.oT;["bU","eU"].forEach(function(e){this[e]=t[e].bind(t)},this),["has","len","forEach","forEachU","add","indexOf","getPos","setPos"].forEach(function(t){this[t]=this.rgZ[t].bind(this.rgZ)},this)},w.prototype.onLZ=function(){this.oT.onLZ(),this.resVeS()},w.prototype.resVeS=function(){this.rgVeS=null},w.prototype.resKZ=function(){this.mKZ=null},w.prototype.gVeS=function(){return this.rgVeS||(this.rgVeS=function(){var t=[];return this.forEach(function(e){e.isVisible()&&e.getEventShape()&&t.push(e)}),t}.call(this))},w.prototype.Add=function(t){this.bU(),this.resKZ();var e=arguments,o=this.add(new y.Schedule.MarkZone(this,2==e.length?{start:e[0],end:e[1]}:y.IsO(t)?t:{time:t}));return this.oT.onAddMarkZone(o),this.eU(),o},w.prototype.GetCount=function(){return this.rgZ.len()},w.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgZ.at(t)||null:h(t)?e=this.rgZ.has(t)?t:null:p(e=function(t){var e=t.mKZ;return p(e)&&(t.mKZ=e=new Map,t.forEach(function(t){var o=t.getKey();!e.has(o)&&e.set(o,t)})),e}(this).get(t))&&(e=this.rgZ.at(t)||null),e},w.prototype.Remove=function(t){this.RemoveRange(this.Item(t))},w.prototype.toA=function(e){return t.call(this,e)},w.prototype.RemoveRange=function(t){return this.bU(),this.resKZ(),this.rgZ.removeRange(t=this.toA(t)),this.eU(),t.length},w.prototype.Clear=function(){this.bU(),this.oT.resSel(),this.resKZ(),this.rgZ.clear(),this.eU()},R.prototype.ao=function(t){return this[t]||(this[t]={})},R.prototype.getType=function(){return"mark-zone"},R.prototype.gS=function(){return this.oZ.oT},R.prototype.bU=function(){this.oZ.bU()},R.prototype.eU=function(t){t&&this.oZ.onLZ(),this.oZ.eU()},R.prototype.dSV=function(){return this.gS().oSV},R.prototype.Remove=function(){return this.oZ.Remove(this)},R.prototype.GetOptions=function(){return this.oO},R.prototype.SetOptions=function(t){this.bU(),this.setOpts(t),this.eU()},R.prototype.setOpts=function(t){for(var e in t){var o=this[y.setM(e)];o&&o.call(this,t[e])}},R.prototype.GetIndex=function(){return this.oZ.indexOf(this)},R.prototype.GetKey=function(){return this.oO.key},R.prototype.SetKey=function(t){this.bU(),this.oZ.resKZ(),this.oO.key=t,this.eU()},R.prototype.toString=R.prototype.getKey=function(){return y.ToS(this.GetKey()||this.GetCaption()||this.GetIndex())},R.prototype.GetVisible=function(){return this.oO.visible},R.prototype.SetVisible=function(t){this.bU(),this.oO.visible=t,this.eU(!0)},R.prototype.isVisible=R.prototype.getVisible=function(){return p(this.GetVisible())||this.GetVisible()},R.prototype.GetShape=function(){return this.oO.shape},R.prototype.SetShape=function(t){this.bU(),this.oO.shape=y.S.A2S(t),this.eU()},R.prototype.getShape=function(){var t=this.GetShape();return t&&t.normal||t},R.prototype.GetCaption=function(){return this.oO.caption},R.prototype.SetCaption=function(t){this.bU(),this.oO.caption=t,this.eU()},R.prototype.getCaption=function(){return y.ToS(this.GetCaption())},R.prototype.GetStart=function(){return this.oO.start},R.prototype.SetStart=function(t){this.bU(),this.oO.start=t,this.onSE(),this.eU(!0)},R.prototype.getStart=function(){return new Date(this.se().s)},R.prototype.GetEnd=function(){return this.oO.end},R.prototype.SetEnd=function(t){this.bU(),this.oO.end=t,this.onSE(),this.eU(!0)},R.prototype.getEnd=function(){return new Date(this.se().e)},R.prototype.GetTime=function(){return this.oO.time},R.prototype.SetTime=function(t){this.oO.time=t,this.sse(t,t,!0)},R.prototype.getTime=R.prototype.getStart,R.prototype.onSE=function(){this.oSE=null},R.prototype.se=function(){return this.oSE||(this.oSE=function(){var t=Date.Create(this.GetStart()).getTime(),e=Date.Create(this.GetEnd()).getTime();return{s:l(t,e),e:u(t,e)}}.call(this))},R.prototype.sse=function(t,e,o){this.bU(),this.SetStart(o?t:new Date(t)),this.SetEnd(o?e:new Date(e)),this.eU(!0)},R.prototype.GetGroupID=function(){return this.oO.groupID},R.prototype.SetGroupID=function(t){this.bU(),this.oO.groupID=t,this.eU(!0)},R.prototype.getGroupID=R.prototype.GetGroupID,R.prototype.g2=function(){return this.gS().oG.Item(this.getGroupID())},R.prototype.GetRepetitive=function(){return this.oO.repetitive},R.prototype.SetRepetitive=function(t){this.bU(),this.oO.repetitive=t,this.oRx=void 0,this.eU(!0)},R.prototype.getRepetitive=R.prototype.gRx=function(){return void 0===this.oRx&&((this.oRx=new b(this.GetRepetitive())).valid||(this.oRx=null)),this.oRx},R.prototype.isRepetitive=function(){return!!this.gRx()},R.prototype.getRepetitiveExpression=function(){return y.ToS(this.isRepetitive()&&this.GetRepetitive()||"")},R.prototype.Nse=function(t,e,o){function i(t,e,i){return!(i<=Z.Time.ToDTN(t,o.s)||e>=Z.Time.ToDTN(t,o.e))&&{s:e,e:i}}var n,r=this.se(),s=this.gRx();if(s){n=[];for(var h=new Date(m(t)),a=m(e),c=r.s-m(r.s),p=r.e-m(r.e),f=l(c,p),g=u(c,p);(v=h.getTime())<=a;h.NextDay())s.eval(h)&&(y=i(v,v+f,v+g))&&n.push(y)}else if(!(r.e<=t||r.s>=e)){t=u(t,r.s),e=l(e,r.e),n=[];for(var y,S,d=m(t),a=m(e),v=d;v<=a;v=S,t=v)(y=i(v,t,l(e,S=v+Y)))&&n.push(y)}return n},R.prototype.Nse2=function(t){var e=this.se();return!(e.e<=t.s||e.s>=t.e)},R.prototype.GetEventShape=function(){return this.oO.eventShape},R.prototype.SetEventShape=function(t){this.bU(),this.oO.eventShape=y.S.A2S(t),this.eU(!0)},R.prototype.getEventShape=function(){var t=this.GetEventShape();return t&&t.normal||t},R.prototype.GetTimeScaleShape=function(){return this.oO.timeScaleShape},R.prototype.SetTimeScaleShape=function(t){this.bU(),this.oO.timeScaleShape=y.S.A2S(t),this.eU()},R.prototype.getTimeScaleShape=function(){var t=this.GetTimeScaleShape();return t&&t.normal||t};var $={start:null,end:null,duration:null,groupID:null,caption:void 0,visible:null,enabled:null,key:null,shape:null,cursor:null,selectable:null,selected:null,repetitive:null,toolTip:null,movable:null,resizable:null,allDay:null,userData:void 0,shortLabel:null,longLabel:null,extraLabel:null};A.prototype.init=function(t){this.oT=t,this.rgE=new y.Arr,this.rgE.onRemove=t.onDelEvent.bind(t),this.import()},A.prototype.import=function(){var t=this.oT;["bU","eU"].forEach(function(e){this[e]=t[e].bind(t)},this),["has","len","forEach","forEachU","add","indexOf","getPos","setPos"].forEach(function(t){this[t]=this.rgE[t].bind(this.rgE)},this)},A.prototype.onLE=function(){this.oT.onLE()},A.prototype.resKE=function(){this.mKE=null},A.prototype.resRE=function(){this.rgRE=null},A.prototype.gRE=function(){return this.rgRE||(this.rgRE=function(){var t=new y.Arr;return this.forEach(function(e){e.isRepetitive()&&t.add(e)}),t}.call(this))},A.prototype.Add=function(t){this.bU(),this.resKE();var e=arguments,o=this.add(new y.Schedule.Event(this,2==e.length?{start:e[0],end:e[1]}:t));return c(t)&&c(t.selected)&&o.SetSelected(t.selected),this.oT.onAddEvent(o),this.eU(),o},A.prototype.GetCount=function(){return this.rgE.len()},A.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgE.at(t)||null:s(t)?e=this.rgE.has(t)?t:null:p(e=function(t){var e=t.mKE;return p(e)&&(t.mKE=e=new Map,t.forEach(function(t){var o=t.getKey();!e.has(o)&&e.set(o,t)})),e}(this).get(t))&&(e=this.rgE.at(t)||null),e},A.prototype.Remove=function(t){this.RemoveRange(this.Item(t))},A.prototype.toA=function(e){return t.call(this,e)},A.prototype.RemoveRange=function(t){return this.bU(),this.resKE(),this.resRE(),this.rgE.removeRange(t=this.toA(t)),this.eU(),t.length},A.prototype.Clear=function(){this.bU(),this.oT.resSel(),this.resKE(),this.resRE(),this.rgE.clear(),this.eU()},A.prototype.nextID=function(t){function e(){for(var t="";this.Item(t=o+ ++this.__nextID););return t}this.__nextID=this.__nextID||0;var o="_e",i=e.call(this);if(c(t)){i=[i],t=u(0,y.ToI(t,1)-1);for(var n=0;n=Z.Time.ToDTN(t,o.e))&&{s:e,e:i}}var n,r=this.se(),s=this.gRx();if(s){n=[];for(var h=new Date(m(t)),a=m(e),c=r.s-m(r.s),p=r.e-m(r.e),f=l(c,p),g=u(c,p);(v=h.getTime())<=a;h.NextDay())s.eval(h)&&(y=i(v,v+f,v+g))&&n.push(y)}else if(!(r.e<=t||r.s>=e)){t=u(t,r.s),e=l(e,r.e),n=[];for(var y,S,d=m(t),a=m(e),v=d;v<=a;v=S,t=v)(y=i(v,t,l(e,S=v+Y)))&&n.push(y)}return n},O.prototype.GetMovable=function(){return this.oO.movable},O.prototype.SetMovable=function(t){this.bU(),this.oO.movable=t,this.eU()},O.prototype.isMovable=O.prototype.getMovable=function(){return this.isSelectable()&&y.ToB(this.GetMovable(),!0)},O.prototype.GetResizable=function(){return this.oO.resizable},O.prototype.SetResizable=function(t){this.bU(),this.oO.resizable=t,this.eU()},O.prototype.isResizable=O.prototype.getResizable=function(){var t=0;return this.isSelectable()&&(t=p(t=this.GetResizable())||!0===t?3:t?f(this.GetResizable(),y.Schedule.EventResizableEnum):0),t},O.prototype.GetAllDay=function(){return this.oO.allDay},O.prototype.SetAllDay=function(t){this.bU(),this.oO.allDay=t,this.onSE(),this.eU(!0)},O.prototype.isAllDay=O.prototype.getAllDay=function(){return y.ToB(this.GetAllDay())},O.prototype.isHADE=function(){return this.isAllDay()&&this.dSV().sAD()?1:0},O.prototype.gHADL=function(){var t=this.dSV().gLE().aADE(),e=t&&t.oA2.mEL;return y.ToI(e&&e.get(this),-1)},O.prototype.GetUserData=function(){return this.oO.userData},O.prototype.SetUserData=function(t){this.bU(),this.oO.userData=t,this.xKP(),this.eU()},O.prototype.getUserData=function(){return this.GetUserData()},O.prototype.type=function(){return this.isRepetitive()?2:1},O.prototype.getDisplayMargins=function(t,e){var o,i=this.se(),n=m(i.s),r=m(i.e),s=this.dSV().misc("eventDisplayMarginsSep"),h=y.H.DateNoHTML;return this.isAllDay()?(o=h(t,new Date(n)),r-n>Y&&(o+=s+h(t,new Date(r-Y)))):(n!=r&&(e=t+" "+e),o=h(e,new Date(i.s))+s+h(e,new Date(i.e))),o},O.prototype.getDisplayShortMargins=function(){var t=this.dSV();return this.getDisplayMargins(t.getShortDateFormat(),t.getShortTimeFormat())},O.prototype.getDisplayLongMargins=function(){var t=this.dSV();return this.getDisplayMargins(t.getLongDateFormat(),t.getLongTimeFormat())},O.prototype.getStartDate=function(){return new Date(m(this.se().s))},O.prototype.getStartTime=function(){var t=this.se().s;return(t-m(t))/Y},O.prototype.getEndDate=function(){return new Date(m(this.se().e))},O.prototype.getEndTime=function(){var t=this.se().e;return(t-m(t))/Y},O.prototype.getGroupLabel=function(){var t=this.g2();return t&&t.getCaption()||""},O.prototype.getGroupTitle=function(){var t=this.g2();return t&&t.getTitle()||""},O.prototype.GetKnownProperty=function(t){var e,o;return this.mKP=this.mKP||new Map,e=this.mKP.get(t),p(e)&&(o=N.get(t))&&this.mKP.set(t,e=this[o].call(this)),e},O.prototype.SetKnownProperty=function(t,e){var o=N.set(t);o in this&&this[o].call(this,e)},N=new G("1(start),2(end),3(allDay),4(groupID),5(caption),6(userData),7(duration),8(repetitiveExpression),12(key),256(displayShortMargins),257(displayLongMargins),258(startDate),259(startTime),260(endDate),261(endTime),262(groupLabel),263(groupTitle),264[get=isRepetitive](repetitve)"),O.prototype.toFormat=function(t){return this.GetKnownProperty(t)},O.prototype.xKP=function(){this.mKP=null},O.prototype.EnsureVisible=function(){var t,e=this.getStart(),o=this.oE.oT,i=o.oC,n=o.oSV;e.GetYear()!=i.gSY().y&&(i.SetDate(e),i.SetSelection([e,this.getEnd()])),(t=y.URts(n.e2Rs(this)))&&n.EnsureVisibleClient(t)},O.prototype.genID=function(){var t=this.GetKey();return p(t)&&this.SetKey(t=function(){var t=this.oE,e=this.getKey();return e&&t.Item(e)==this||(e=t.nextID()),e}.call(this)),t},O.prototype.coO=function(){var t,e=y.Cpy(this.oO);return e.start=this.getStart().toFormat(),e.end=this.getEnd().toFormat(),"groupID"in e&&(e.groupID=(t=this.g2())&&t.GetID()||j),e},S&&(O.prototype.scUR=function(t){t.o=this.oE,t.i=this.genID()},O.prototype.arUR=function(t){this.scUR(t),t.d=this.coO(),t.Do=function(t){if(this.del?!t:t)this.o.Remove(this.i);else{var e=this.o.Add(this.d);e&&e.EnsureVisible()}}},O.prototype.mvUR=function(t,e){e&&(this.scUR(t,!0),t.d={from:e,to:this.sea()},t.Do=function(t){var e,o=this.o.Item(this.i);o&&(e=t?this.d.from:this.d.to,o.sse(e.s,e.e),o.SetAllDay(e.a),o.SetGroupID(e.g),o.EnsureVisible())})},O.prototype.uUR=function(t,e,o){this.scUR(t,!0),(t.d=S.diff(e,o))&&(t.Do=function(t){var e=this.o.Item(this.i);e&&(e.SetOptions(t?this.d.from:this.d.to),e.EnsureVisible())})},O.prototype.StartUpdateEvent=function(){return this.oE.oT.gUR()&&this.coO()},O.prototype.EndUpdateEvent=function(t){t&&this.oE.oT.nUR(g.UpdateEvent,function(e){this.uUR(e,t,this.coO())},this)},O.prototype.UpdateEvent=function(t,e){if(n(t)){var o=this.StartUpdateEvent();t.call(e||this),this.EndUpdateEvent(o)}});var tt={caption:null,title:null,visible:null,id:null,headerShape:null,eventShape:null,position:null,width:null};U.prototype.init=function(t){this.oT=t,this.rgG=new y.KAr,this.rgG.K=function(t){return t.getID()},this.rgG.onRemove=t.onDelGroup.bind(t),this.rgG.onChange=this.resVG.bind(this),this.import()},U.prototype.import=function(){var t=this.oT;["bU","eU","feSV"].forEach(function(e){this[e]=t[e].bind(t)},this),["has","len","forEach","forEachU","add","indexOf","getPos","setPos"].forEach(function(t){this[t]=this.rgG[t].bind(this.rgG)},this)},U.prototype.onL=function(){this.oT.onLE(),this.oT.onLZ()},U.prototype.resKI=function(){this.mKI=null},U.prototype.Add=function(t){this.bU(),this.resKI();var e=this.add(new y.Schedule.Group(this,y.IsO(t)?t:{id:t}));return this.oT.onAddGroup(e),this.eU(),e},U.prototype.GetCount=function(){return this.rgG.len()},U.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgG.at(t)||null:!function(t){return t instanceof y.Schedule.Group}(t)?p(e=this.gKI().get(t))&&(e=this.rgG.at(t)||null):e=this.rgG.has(t)?t:null,e},U.prototype.Remove=function(t){this.RemoveRange(this.Item(t))},U.prototype.toA=function(e){return t.call(this,e)},U.prototype.RemoveRange=function(t){return this.bU(),this.resKI(),this.rgG.removeRange(t=this.toA(t)),this.eU(),t.len()},U.prototype.Clear=function(){this.bU(),this.resKI(),this.rgG.clear(),this.eU()},U.prototype.gKI=function(){return this.mKI||(this.mKI=function(){var t,e=new Map;return this.forEach(function(o){!e.has(t=o.getID())&&e.set(t,o)}),e}.call(this))},U.prototype.resVG=function(){this.feSV("resGW"),this.rgVG=null},U.prototype.gVG=function(){return this.rgVG||(this.rgVG=function(){var t=new y.Arr;return this.forEach(function(e){e.isVisible()&&t.push(e)}),t}.call(this))},U.prototype.onlayout=function(t){if(this.len()){var e,o=this.rgG;t.pCtx("G"),t.IsSave()?((e=function(){var t="";return o.rgOE&&o.rgOE.forEach(function(e){t+=(t?",":"")+o.indexOf(e)}),t}())&&t.Add("order",e),(e=function(){var t="";return o&&o.forEachI(function(e,o){t+=(o?",":"")+y.ToS(e.getWidth())}),t}())&&t.Add("width",e),(e=function(){var t="";return o&&o.forEachI(function(e,o){t+=(o?",":"")+y.ToS(e.getVisible()?1:0)}),t}())&&t.Add("visible",e)):((e=t.GetValue("order"))&&function(t){if(t){var e=[];t.split(",").forEach(function(t){e.push(o.at(t))},this),o.setOrd(e)}}(e),(e=t.GetValue("width"))&&function(t){t&&t.split(",").forEach(function(t,e){e>2)%4)&&(c=function(t){return n.len()<4+(B+=B>>2)%16&&o(t)}),this.gE2L().forEach(function(o){c(o)&&function(o){var i,h,l,c=o.Nse(t,e,u),p=j;c&&(a&&!a.has(p=o.g2())||(r&&o.isAllDay()?(c.forEach(function(t){i=m(t.s),!(l=r.get(i))&&r.set(i,l=[]),l.push(o)}),s.set(o,c)):c.forEach(function(t){i=m(t.s),!(h=n.get(i,p))&&n.set(i,p,h=[]),h.push({oE:o,s:t.s,e:t.e})})))}(o)}),n.forEach(function(t){t.forEach(function(t){t.sort(function(t,e){return t.s-e.s||e.e-e.s-(t.e-t.s)}),p+=t.length})}),s&&s.rgO.sort(function(t,e){return t=t.se(),e=e.se(),t.s-e.s||e.e-e.s-(t.e-t.s)}),r&&r.forEach(function(t){p+=t.length}),this.c=p},V.prototype.gE2L=function(){return this.oT.oE},V.prototype.hasE=function(t){return t=m(e(t)),function(t){var e,o;tthis.e&&(e=this.e+Y,o=new Date(t).Reset(16).NextMonth().getTime()),(e||o)&&(this.add(e,o),this.s=l(this.s,e),this.e=u(this.e,o),this.oT.onLx(this.s,this.e))}.call(this,t),this.isE(t)},V.prototype.isE=function(t,o){return t=m(e(t)),1&(o=y.ToI(o,-1))&&this.mDGE.has(t)||2&o&&this.oADE&&this.oADE.mDE.has(t)},V.prototype.feEU=function(t,o,i,n){t=m(e(t)),o=y.ToI(o,-1);var r,s,h;if(!r&&1&o&&(s=this.mDGE.get(t))&&s.forEach(function(t){!r&&(r=t.forEachU(function(t){return i.call(n,t.oE)}))}),!r&&2&o&&this.oADE&&(h=this.oADE.mDE.get(t)))for(var a=0,u=h.length;!r&&a=e.e)}var i;if(e)for(var n=0,r=e.length;!i&&n1&&(n=new Map,i=new y.M1,t.forEach(function(t,n){if(i.len()){r=i.len();for(var s=!1,h=0;!s&&h>2)%4)&&(a=function(t){return n.len()<4+(B+=B>>2)%16&&o(t)}),this.gZ2L().forEach(function(o){a(o)&&function(o){var i,r,a=o.Nse(t,e,h),l=s?o.g2():null;a&&(!s||p(o.getGroupID())||s.has(l))&&a.forEach(function(t){i=m(t.s),(r=n.get(i,l)||[]).push({oZ:o,s:t.s,e:t.e}),u++,n.set(i,l,r)})}(o)}),this.c=u},M.prototype.gZ2L=function(){return this.oT.oZ},M.prototype.lVZ=function(t){var e,o,i=new y.M1,n=this.mDGZ,r=this.oT.oSV,s=r.gDSE(),h=s.s,a=s.e-h;return t.forEach(function(t,s){if(e=n.get(s)){function c(t,e){if(t&&!y.EyR(e)){function o(t){return l(1,u(0,(t/Y-h)/a))*f}var n,r=e[0],c=e[1],p=e[2],f=e[3],g=new y.M1;t.forEach(function(t){n=o(t.s-s),g.push(t,[r,c+n,p,u(1,o(t.e-s)-n)])}),i.add(g)}}(o=r.gCnt(t)).gs.forEach(function(t){t.t&&c(e.get(t.t.oG),t.t)}),o.T&&c(e.get(null),o.T)}},this),i},M.prototype.VZ=function(t){return this.lVZ(t.gVD())},M.prototype.allZO=function(){return this.aZO||(this.aZO=function(){var t=this.oT.gLDV(),e=t.range(),o=[0,0,e[0],e[1]],i=t.scroll(o),n=this.lVZ(i),r=new Map;return n.forEach(function(t,e){var o=r.get(e.oZ);!o&&r.set(e.oZ,o=[]),o.push(e)}),{z2O:r,o2C:n}}.call(this))},M.prototype.resZO=function(){this.aZO=null},M.prototype.e2R=function(t){var e=this.allZO(),o=e.z2O.get(t);return o&&1==o.length&&e.o2C.get(o[0])||null},W.prototype.init=function(t){this.doL(t)},W.prototype.doL=function(t){function e(t,e,o){l=(c=t.copy()).getTime(),v.set(e,o,l),E.set(l,[e,o]),D=u(D,e),m=u(m,o)}function o(){++w==R&&(w=0,A++)}function i(){++A==O&&(w++,A=0)}function n(t,e){t.GetMonth()!=e.GetMonth()?(V=u(A,V),(U+=R)==G&&(U=0,L+=V,~S&&L++,V=0),w=e.WeekOff(),A=0):o()}function r(){w++}function s(){A++}function h(){return 2==S?s:1==S||3==S?r:T?C?function(t,e){t.GetMonth()!=e.GetMonth()?((L+=O)==b&&(U+=R,L=0),w=e.WeekOff(),A=0):o()}:n:C?function(t,e){t.GetMonth()!=e.GetMonth()?((L+=O)==b&&(U+=R,L=0),w=0,A=e.WeekOff()):i()}:function(t,e){t.GetMonth()!=e.GetMonth()?((U+=R)==G&&(U=0,L+=O),w=0,A=e.WeekOff()):i()}}var a,l,c,p,f,g,S=t.oSV.getShowViewCompact(),d=t.oC,v=new y.M2,E=new Map,D=0,m=0,T=1,C=0,G=1,b=12,w=0,R=y.days,A=0,O=6,U=0,L=0,V=0;for(this.oT=t,this.sy={y:Date.Today().GetYear()},d&&(this.sy=d.gSY(),T=d.getMode(),C=d.getFlow(),G=d.gLyt().table.h,b=d.gLyt().table.v,d.pushLoc()),T&&S<0&&(G=b=1),this.sy.f=(a=Date.Create(this.sy.y)).copy(),this.sy.t=(p=this.sy.d?this.sy.d:Date.Create(this.sy.y,12,31)).copy(),d&&S<=0&&(w=a.WeekOff(),T||(g=w,w=A,A=g,g=R,R=O,O=g,S<0&&R--)),G*=R,b*=O,f=h(),this.s=a.copy();a.Compare(p)<=0;)e(a,U+w,L+A),f(c,a.NextDay());this.e=a.copy(),this.mXYD=v,this.mDXY=E,this.h=D+1,this.v=m+1,d&&d.popLoc()},W.prototype.rdayS=function(){return this.oT.oSV.rdayS()},W.prototype.range=function(){var t=this.rdayS();return[this.h*t[0],this.v*t[1]]},W.prototype.scroll=function(t){function e(t){return~~t}function o(t,o){return t-o*e(t/o)}for(var i=[],n=new y.M1,r=this.rdayS(),s=r[0],h=t[0],a=e(h/s),u=e((h+t[2])/s),l=-o(h,s),c=r[1],p=t[1],f=e(p/c),g=e((p+t[3])/c),S=-o(p,c),d=f;d<=g;d++,S+=c){i.push([S,c]);for(var v,E=l,D=a;D<=u;D++,E+=s)(v=this.mXYD.get(D,d))&&n.push(v,[E,S,s,c])}return n.tsc=i,n},W.prototype.d2R=function(t){var o,i,n,r=this.rdayS(),s=r[0],h=r[1];return t&&(t.forEach?t:[t]).forEach(function(t){(n=this.mDXY.get(m(e(t))))&&(o=[n[0]*s,n[1]*h,s,h],i=i?y.URt(i,o):o)},this),i},W.prototype.d2HV=function(t){var o,i,n;return t&&(t.forEach?t:[t]).forEach(function(t){(n=this.mDXY.get(m(e(t))))&&(o?(o[0]=l(o[0],n[0]),o[1]=l(o[1],n[1])):o=n.slice(),i?(i[0]=u(i[0],n[0]),i[1]=u(i[1],n[1])):i=n.slice())},this),o&&i&&[i[0]-o[0]+1,i[1]-o[1]+1]},W.prototype.d2I=function(t){var o=this.mDXY.get(m(e(t)));return o?o[0]+this.h*o[1]:-1},H.prototype.init=function(){this.mC=new Map},H.prototype.Get=function(t,e){function o(e){var o,i=t?function(e){return t.sizeHTMLText(e).width}:function(t){return t.length};return e.forEach(function(t,e){var n=i(t);(!o||o.s",this.aS="<|>",this.mC=new Map,this.oLD=new H},I.prototype.Fit=function(t,e,o,i){var n,r,s,h="",a=function(t){var e=this.mC.get(t=y.ToS(t));return!e&&this.mC.set(t,e=function(t){var e={rgLU:[],rgL:[]},o=t.split(this.s),n=o.length;return n>0&&o[0].split(this.aS).forEach(function(t){e.rgL.push({l:t,w:i&&i.sizeHTMLDate(t,this.oLD.Get(i)).width||0})},this),e.rgLU=e.rgL.slice(),e.rgL.sort(function(t,e){return t.w-e.w}),n>1&&o[1].length&&((e.e=y.E.Create(o[1],"value")).IsValid()?e.e.Evaluate=function(t){return function(e){return t.call(this,e)}}(e.e.Evaluate):e.e=null),e}.call(this,t)),e}.call(this,t);if(a&&(s=a.rgL.length,a.e&&(n=(r=a.e.Evaluate(o))>=0&&r1)))for(var u=!0,l=1;u&&l=this.i+this.C&&(e=2)),e},k.prototype.reqS=function(){var t=0;return this.C&&(this.isV(0)||(t|=1)),this.isV(this.i+this.M-1)||(t|=2),t},k.prototype.scroll=function(t){var e=this.oSV,o=this.i,i=u(0,l(o+t||0,this.M-this.C)),n=!1;return(n=o!=i)&&e.Smooth(function(){this.i=i,e.onLE()},this),n},k.prototype.ensure=function(t){var e=this.isS(t);return~t&&this.scroll(t-(1==e?this.i:2==e?this.i+this.C-1:t))},Object.addPrototypeOf(P.prototype,y.M1.prototype),P.prototype.init=function(t){return function(e){function o(){var t,o,i,n,r,s,h;e.sAD()&&(t=e.gADL()).reqS()&&(i=(o=e.gLE()).aADE())&&((h=e.GetPageSize()).unshift(0,0),n=i.oA2.mEL,r=e.toH(1),function(t,o){function i(e,i){n&&(!t||t.call(o,n))&&r.push(n),e&&i&&(n={r:e,d:[i]})}var n,r=[];return e.gVD().vforEach(function(t,e){n&&Math.abs(y.ROf(n.r)-y.LOf(t))<1?(n.r=y.URt(n.r,t),n.d.push(e)):i(t,e)}),i(),r}.call(this,function(e){for(var i=0,r=0,s=e.d.length;3!=i&&r=0;c++);}function h(){var e,o=0;s();for(var r;co?0:(e[3]-u)/2),~~(a+1),u]||null})}.call(this),onpaint:function(t,e){this.ctxTfi(function(t){i(n,t,e,r)},this,t)},thisArg:this}},{thisArg:this,ttO:n.o,ttD:this.getToolTipDelay(),ttP:this.getToolTipPopDelay()})}},Z.prototype.xA=function(){y.A.Cancel("ss*"),y.A.Cancel(this.sEvcA)},Z.prototype.ondown=function(t){return this.isSelectable()&&(this.xA(),this.gAA().Do(this,t),!y.RUR.Rng()&&this.doRUR(t,function(t){switch(t.drag.status){case 4:case 5:this.rurActionClick(null,t)}},this)),!0},Z.toClick=function(t){return{dblClick:t.drag&&(t.drag.long||1!=t.drag.click)||!1,button:y.e2B(t),modifiers:y.ModK(t)}},Z.prototype.toClick=function(t,e){e.event=this.e2E(t),e.date=this.e2D(t),e.time=this.e2T(t),e.group=this.e2G(t),e.markZone=this.e2Z(t)},Z.prototype.onClick=function(t){var e=Z.toClick(t),o=this.e2V(t),i=this.gPtr(t);o&&(e.view=o,o.toClick&&o.toClick(t,e)),this.sDG(e.date?{d:e.time||e.date,g:e.group}:null),this.onA(this.p2A(i),e),this.onclick(e)},Z.prototype.onclick=function(t){this.oLts.onclick.do(t)},Z.prototype.onA=function(t,e){t&&(y.H.VisitA(this,t),this.inv(),this.onanchorclick(t))},Z.prototype.onanchorclick=function(t){this.oLts.onanchorclick.do(t)},Z.prototype.onDblClickGR=function(t){if(t)return this.Smooth(function(){this.gVG().forEach(function(t){t.SetWidth()})}),!0},Z.prototype.onClickADS=function(t){return t&&(this.slADS(t),this.gADL().scroll(1==t.s?-1:1)),c(this.olADS)},Z.prototype.slADS=function(t){this.olADS&&clearTimeout(this.olADS.h),(this.olADS=t&&{o:t}||null)&&(this.olADS.h=this.setTimeout(function(){clearTimeout(this.olADS.h),this.olADS=null},2048))},Z.prototype.sDG=function(t){this.oDG=t},Z.prototype.onClickGB=function(t){function e(){i.cwbU(),n.gVG().forEach(function(t){t.SetVisible(!1)}),i.cweU()}var o=this,i=o.oT,n=i.oG,r=n.gVG();return t&&t.HGB&&n.len()&&(y.Menu&&function(){var i=o.GetViewRect(),s=o.GetClientRect(),h=i[0]-s[0],a=i[1]-s[1],u=y.NRt(i,y.ORt(o.rt2C(t.HGB),h,a));return o.runCM({items:function(){var t="All[id=-1],[sep]";return n.forEach(function(e){t+=","+e.getTitle(),t+="[chk"+(r.has(e)?"=1":"")+"]",t+="[id="+e.getID()+"]"}),t}(),x:u?y.ROf(u):i[0]+s[0]+o.unscaled(y.ROf(t.HGB)),y:u?y.BOf(u):i[1]+s[1]+o.unscaled(y.BOf(t.HGB)),cbkS:function(t){o.Smooth(function(){-1==t.id?e():n.Item(t.id).SetVisible(t.flags.get("chk")),o.onChange("groups")})}})}()||function(){var t,s=prompt(o.misc("groupingButtonPrompt"),r.join(","));c(s)&&(i.cwbU(),e(),(s=s.trim())&&s&&s.split(",").forEach(function(e){(t=n.Item(e))&&t.SetVisible(!0)}),i.cweU())}()),!0},Z.prototype.onDblClk=function(t){},Z.prototype.e2RUR=function(t){var e=this.gPtr(t),o=this.e2W(t)||this.oW,i=o.GetClientRect();return{w:o,c:o.oC,x:X.X(e)-i[0],y:X.Y(e)-i[1],r:o.GetClientRect()}},Z.prototype.doRUR=function(t,e,o,i){var n,r,s=this.gAA();return y.RUR.Do(t,function(t){switch(t.drag.status){case 1:this.lkTL++,r=this.oT.oRUR=this.e2RUR(t),this.lRURLong&&t.drag.setCursor(y.GP.Get("long",this.getCursors())),S&&(n=this.oT.gUR())&&n.sB();break;case 5:this.norurAction(t,2);break;case 3:s.CanDo(t,1)&&(y.RUR.Cancel(),this.norurAction(t,1)||(this.lRURLong=(this.lRURLong||0)+1,s.Do(this,t,1),--this.lRURLong))}switch(!(r&&r.c&&r.c.bRUR&&r.c.bRUR(t))&&e.call(o,t),r&&r.c&&r.c.eRUR&&r.c.eRUR(t),t.drag.status){case 7:n&&(t.drag.cancel&&n.cB(),n.eB()),r=this.oT.oRUR=null,this.lkTL--}},this,i)},Z.prototype.bRUR=function(t){return this.gAA().Has("zoom")&&this.exZ(t),t.drag.extra},Z.prototype.exZ=function(t){var e;t.drag.extra&&(e=t.drag.extra[0])&&this.zBy(e.offset,this.oT.oRUR.oZI=this.oT.oRUR.oZI||this.p2ZI(e.start))},Z.prototype.rurScroll=function(t,e){if(t){var o={oH:this.GetSI(!0),oV:this.GetSI(!1)};this.doRUR(t,function(t){var i=this.oT.oRUR;switch(t.drag.status){case 1:i.ao=e&&e.rurOnlyAO,this.rAO(),function(t){e&&e.rurScrollS&&e.rurScrollS(t)}(t);break;case 7:i.ao=null,t.drag.cancel?(i.cancel=!0,this.Smooth(function(){this.rurScrollD(0,0,o)})):!t.drag.swipe&&this.rAO(),function(t){e&&e.rurScrollE&&e.rurScrollE(t)}(t);break;case 2:this.oTD=null,!i.dRSD&&this.rurScrollD(-t.drag.offset.dx,-t.drag.offset.dy,o);break;case 6:var n=i.w,r=t.drag.swipe;if(r.dx&&r.dy){var s=Math.abs(r.dx),h=Math.abs(r.dy);u(s,h)-l(s,h)>32&&(s>h?r.dy=0:r.dx=0)}n.SSw.call(n,r);break;case 4:case 5:e&&e.rurStatus&&e.rurStatus.call(e.thisArg||this,t)}},this)}},Z.prototype.onRurScrollD=function(t){var e=this.oT.oRUR;e&&e.c!=this&&e.c.onRurScrollD&&e.c.onRurScrollD.call(e.c,t)},Z.prototype.rurScrollD=function(t,e,o){var i,n=c(o);(o=o||{oH:this.GetSI(!0),oV:this.GetSI(!1)}).oH=o.oH||{pos:0,page:0},o.oV=o.oV||{pos:0,page:0},i={dx:t,dy:e},this.onRurScrollD(i),(n||i.dx||i.dy)&&this.SetScroll({x:o.oH.pos+this.scaled(i.dx),y:o.oV.pos+this.scaled(i.dy)})},Z.prototype.rurDrag=function(t,e){function o(t){return!e||p(e.rurAllow)||t==(e.rurAllow&t)}function i(){h.frame=X.Rect(h.from,h.to),e&&e.rurDrag&&e.rurDrag.call(S,h),h.frame=function(t,e){return n().rtCA(t,e)}(h.frame,!1),c.onRurDragD&&c.onRurDragD.call(c,e,h),e&&e.rurDragD&&e.rurDragD(h),a&&a.SetClient(h.frame)}function n(){return s||(s=function(){var t=l;return a&&a.oO.relative!=l.GetCanvas()&&(t=c),t}())}function r(t,e){return n().ptCA(t,e)}if(t){var s,h,a,l=this,c=this.e2V(t)||l,f=c.getRurDragScrollOut?c.getRurDragScrollOut():c.GetClientRect(),g=[{oSV:this,oH:this.GetSI(!0),oV:this.GetSI(!1)}],S=this,d=0,v=0;this.feSV(function(t){t!=this&&g.push({oSV:t,oH:t.GetSI(!0),oV:t.GetSI(!1)})},this),this.doRUR(t,function(t){switch((h=h||function(t){s=null;var e=r(l.gPtr(t));return{from:e,to:e,event:t,frame:X.Rect(e,e)}}(t)).event=t,t.drag.status){case 1:if(function(){c.onRurDragS&&(e=c.onRurDragS.call(c,e,h)),e&&e.rurDragS&&e.rurDragS(h)}.call(this),S=e&&e.thisArg||S,e&&(this.onRURDragStart(e.rurName,t),e.rurDragStart&&e.rurDragStart.call(S,h)),this.oT.oRUR.ao=e&&e.rurOnlyAO,this.rAO(),e&&e.rurEFPaint){i();var n={name:"frame",client:h.frame,relative:l.GetCanvas(),clip:l.GetCanvas(),inflateClient:8,onpaint:function(t,o){e.rurEFPaint.call(S,h,t,o,this)}};e.rurEFOpts&&e.rurEFOpts.call(S,h,n),a=y.EF.Create(n)}break;case 7:var p=t.drag.cancel?this.oT:this,E=this.oT.oRUR;E&&(E.ao=null),p.bU(),t.drag.cancel?(E&&(E.cancel=!0),this.Smooth(function(){g.forEach(function(t){t.oSV.rurScrollD(0,0,t)}),e&&e.rurCancel&&e.rurCancel.call(S,h)})):!t.drag.click&&e&&e.rurDrop&&e.rurDrop.call(S,h),!this.sRng()&&p.onLE(),this.rAO(),p.eU(),y.EF.Destroy(a),e&&(e.rurDragEnd&&e.rurDragEnd.call(S,h),t.drag.click&&e.rurStatus&&e.rurStatus.call(S,t),this.onRURDragEnd(e.rurName,t)),function(){c.onRurDragE&&c.onRurDragE.call(c,e,h),e&&e.rurDragE&&e.rurDragE(h)}.call(this);break;case 2:var D=!1,m=d!=t.drag.offset.dx||v!=t.drag.offset.dy;if(m&&(d=t.drag.offset.dx,v=t.drag.offset.dy),!y.EyR(f)&&function(t){return!0}.call(this,t)){var T=t.drag.current.x,C=t.drag.current.y,G=o(1)&&T-y.LOf(f)||0;G>0&&(G=u(0,T-y.ROf(f)));var b=o(2)&&C-y.TOf(f)||0;b>0&&(b=u(0,C-y.BOf(f))),(D=G||b)&&this.rurScrollD(G,b)}(D||m)&&(h.to=r(t.drag.current),h.dx=h.to.x-h.from.x,h.dy=h.to.y-h.from.y,i())}},this,{contiguously:!0,client:f})}},Z.prototype.onRURDragStart=function(t,e){},Z.prototype.onRURDragEnd=function(t,e){},Z.prototype.rtSelAbs=function(t){var e=X.Rect(t.from,t.to);if(!y.EyR(e)){var o=this.gLE(),i=this.ar2E(e);i&&i.length&&i.forEach(function(t){e=y.URt(e,o.e2R(t))})}return e},Z.prototype.rurAO=function(t){return this.rurE(t)||{}},Z.prototype.rurE=function(t){return this.e2E(t)},Z.prototype.allowRur=function(t,e){var o=c(t);if(o)switch(e.rurName){case"scroll":o=function(t){return y.Schedule.allowRurPart(this.oT.w2P(e.rurOnlyW),t||"view,timescale",e.rurFlags)}.call(this);break;case"fit":case"select":o=this.e2W(t)==this.oW}return o},Z.prototype.rurAction=function(t,e,o){var i={rurName:t,rurFlags:e,rurOnlyW:this.e2W(o),rurOnlyAO:this.rurAO(o),rurStatus:function(e){this.rurActionClick(t,e)}};if(this.allowRur(o,i)){var n="rur"+y.getP(function(t){for(var e,o="",i=0,n=t.length;i1&&(o=this.htD(t))&&e.has(o.oG)&&(i=o.g)&&(a=(h=this.p2C(t))[0],u=h[1],n=i[2]<2*(s=y.Def.HT.inflate[0]),y.PInR(a,u,[i[0],i[1],n?i[2]/2:0,i[3]],s)?r=e.prev(o.oG):y.PInR(a,u,[y.ROf(i)-(n?i[2]/2:0),i[1],n?i[2]/2:0,i[3]],s)&&e.next(o.oG)&&(r=o.oG)),r},Z.prototype.p2T=function(t){var e=this.htD(t);return e&&(e.T&&{oG:e.oG,tN:e.tN,aD:!1}||e.A&&{oG:e.oG,tN:e.dN,aD:!0})},Z.prototype.t2Y=function(t){t=e(t);var o,i,n,r,s,h=this.gLDV().d2R(t);if(h&&(s=this.gCnt(h))&&(h=s.T))return o=this.gDSE(),i=o.s,n=o.e-i,r=h[3],h[1]+=function(t){return l(1,u(0,(t/Y-i)/n))*r}(this.toDSE(t)%Y),h[3]=0,this.rtCA(h,!1)},Z.prototype.p2CE=function(t){if(this.aCE()){var e=this.htD(t);return e&&(e.tCE||e.aCE)&&this.p2T(t)}},Z.prototype.p2HT=function(t){if(this.isSelectable()&&!this.isReadOnly()){var e=this.p2C(t);return this.gVE().p2HT(X.X(e),X.Y(e),null,null,y.Def.HT.inflate[0],y.Def.HT.inflate[1])}},Z.prototype.p2ER=function(t){if(this.aME()){var e,o,i,n=this.p2HT(t);return n&&n.o&&(e=n.o.oE)&&(o=e.isResizable())&&(1&o&&n.ht&(e.isHADE()?1:16)?i={oE:e,ht:n.ht,r:1}:2&o&&n.ht&(e.isHADE()?4:64)&&(i={oE:e,ht:n.ht,r:2})),i}},Z.prototype.p2DH=function(t){var e=this.htD(t);return e&&e.H&&e.dN},Z.prototype.p2GB=function(t){var e=this.htD(t);return e&&e.HGB&&e.dN},Z.prototype.p2DT=function(t){var e=this.htD(t);return e&&e.T&&e.tN},Z.prototype.rurOnlyAO=function(){var t=this.oT.oRUR;return t&&t.w==this.oW&&t.ao||null},Z.prototype.onSetAO=function(t){function e(e){var o;e.isSelectable()&&(o=u.toShapes(e))&&(!y.EyO(o.hover)&&t.set({owner:u,id:e.idAOH||(e.idAOH={}),inv:u.inv,hitTest:function(t,o){return u.isAP(t,o)&&e==u.p2E([t,o])},duration:c}),!y.EyO(o.click)&&t.set({owner:u,id:e.idAOC||(e.idAOC={}),inv:u.inv,hitTest:function(t,o){return u.isAP(t,o)&&e==u.p2E([t,o])},actOn:l==e?1:4,duration:c}))}var o,i,n,r,h,t=this.gAO();if(this.isSelectable()&&!t.hasOf(this)){var u=this,l=this.rurOnlyAO(),c=u.getSmooth();s(l)?e(l):(this.sAD()&&(i=u.toShapes("date-all-day-scroll-button"))&&(h=this.gVADS())&&h.forEach(function(e,o){!function(e){!y.EyO(i.hover)&&t.set({owner:u,id:E(e),inv:u.inv,hitTest:function(t,o){return u.isAP(t,o)&&e==u.p2ADS([t,o])},duration:c}),!y.EyO(i.click)&&t.set({owner:u,id:D(e),inv:u.inv,hitTest:function(t,o){return u.isAP(t,o)&&e==u.p2ADS([t,o])},actOn:4,duration:c})}(o)}),this.dGB()&&(o=u.toShapes("grouping-button"))&&(r=this.gVD())&&r.forEach(function(e,i){!function(e){!y.EyO(o.hover)&&t.set({owner:u,id:d(e),inv:u.inv,hitTest:function(t,o){return u.isAP(t,o)&&e==u.p2GB([t,o])},duration:c}),!y.EyO(o.click)&&t.set({owner:u,id:v(e),inv:u.inv,hitTest:function(t,o){return u.isAP(t,o)&&e==u.p2GB([t,o])},actOn:4,duration:c})}(i)}),(n=this.gVE())&&n.forEach(function(t,o){e(o.oE)}),t.rur(this,a("*")))}},Z.prototype.hasE=function(t){return this.gLE().hasE(t)},Z.prototype.onLE=function(){this.onLZ(),this.feSV(function(t){t.onDV(),t.resVE()})},Z.prototype.resVE=function(){this.rgVE=null,this.resVADS(),this.resAO()},Z.prototype.resVD=function(){this.rgVD=null,this.resVADS()},Z.prototype.resVZ=function(){this.rgVZ=null},Z.prototype.resA=function(){this.resVD(),this.resVE(),this.resVZ()},Z.prototype.onLD=function(){this.oALE.XC(),this.resA()},Z.prototype.onLZ=function(){this.feSV(function(t){t.resVZ()})},Z.prototype.bU=function(){this.lI++},Z.prototype.eU=function(){--this.lI||this.invAO()},Z.prototype.wAO=function(){return this._wAO||(this._wAO=[this.oTS])},Z.prototype.rAO=function(){this.bU(),this.eU()},Z.prototype.onimg=function(){return this.cwbU(),this.cweU(),!0},Z.prototype.islow=function(){return this.getScale()<.5},Z.prototype.Smooth=function(t,e,o){function i(t){o.cbkI&&o.cbkI.call(e,t)}function r(t){o.cbkT&&o.cbkT.call(e,t)}function h(t){o.cbkR&&o.cbkR.call(e,t)}function a(t){function e(t,e,o){function i(t,e){var i=t[o],r=(n[e].get(i)||0)+1;return n[e].set(i,r),y.ToS(i.GetIndex())+"-"+r}var n=[new Map,new Map],r=new y.M1,h=new y.M1;return e.forEach(function(t,e){h.set(i(e,0),e)}),t.forEach(function(t,e){r.set(e=h.get(i(e,1))||e,t)}),t=r,{from:t,to:e,stkFT:t.smooth(e,function(t,e){return e&&s(e.oE)&&e.oE.isHADE()&&e.oE.oE.Item(e.oE)&&(t=[t[0],t[1]+t[3]/2,t[2],0]),t})}}t.mV2FT=new Map,c.forEach(function(o){var i=p.get(o);i&&t.mV2FT.set(o,{events:e(i.rgVE,o.gVE(),"oE"),zones:e(i.rgVZ,o.gVZ(),"oZ"),scrl:function(t,e){var o=t.GetScroll();return(e.x!=o.x||e.y!=o.y)&&{f:e,t:o}||null}(o,i.oScr),dayS:function(t,e){var o=t.rdayS();return(e[0]!=o[0]||e[1]!=o[1])&&{f:e,t:o,e:t.odayS()}||null}(o,i.dayS),grps:function(t,e){var o;return t==g&&t.sGE()&&(o=t.mGW())&&!function(t,e){var o=e.size==t.size;return o&&e.forEach(function(e,i){o&&(o=function(t,e){var o;if(o=t&&e&&t.length==e.length)for(var i=0,n=t.length;o&&i=e[o])for(;t>=e[o+1]&&oMath.abs(n)?i:n)),o=this.ptCA(e.ptA,!1),this.rurScrollD(o.x-X.X(e.pt)-i,o.y-X.Y(e.pt)-n),this.onRurScrollD({dx:-i,dy:-n}),this.onUI(),this.cweU()},Z.prototype.rurDayResize=function(t,e){if(t){var o,i,n=this,r=n.dSV(),s=e.rurOnlyW&&e.rurOnlyW.oC,h=n.GetClientRect(),a=n.GetScroll(),l=r.odayS(),c=r.rdayS(),p=c;n.doRUR(t,function(t){switch(t.drag.status){case 1:break;case 7:t.drag.cancel&&this.Smooth(function(){r.sdayS(l),n.updSPR(),n.SetScroll(a)});break;case 2:n.Smoothless(function(){function l(t){return n.scaled(t-h[0])}function f(t){return n.scaled(t-h[1])}p=n.adayS([u(0,c[0]+t.drag.offset.dx),u(0,c[1]+t.drag.offset.dy)]),o={dx:p[0]-c[0],dy:p[1]-c[1]},i={dx:(a.x+l(t.drag.start.x))*p[0]/c[0]-l(t.drag.current.x)-a.x,dy:(a.y+f(t.drag.start.y))*p[1]/c[1]-f(t.drag.current.y)-a.y},s&&s.onRurDayResizeD&&s.onRurDayResizeD.call(s,o,i,e),r.sdayS([c[0]+o.dx,c[1]+o.dy]),n.updSPR(),n.SetScroll({x:a.x+i.dx,y:a.y+i.dy})});break;case 4:case 5:e&&e.rurStatus&&e.rurStatus.call(e.thisArg||n,t)}},n)}},Z.prototype.onRurDayResizeD=function(t,e,o){},Z.prototype.rurDayResize=function(t,e){if(t){var o,i,n=this,r=n.dSV(),s=e.rurOnlyW&&e.rurOnlyW.oC,h=n.GetClientRect(),a=n.GetScroll(),l=r.odayS(),c=r.rdayS(),p=c;n.doRUR(t,function(t){switch(t.drag.status){case 1:break;case 7:t.drag.cancel&&this.Smooth(function(){r.sdayS(l),n.updSPR(),n.SetScroll(a)});break;case 2:n.Smoothless(function(){function l(t){return n.scaled(t-h[0])}function f(t){return n.scaled(t-h[1])}p=n.adayS([u(0,c[0]+t.drag.offset.dx),u(0,c[1]+t.drag.offset.dy)]),o={dx:p[0]-c[0],dy:p[1]-c[1]},i={dx:(a.x+l(t.drag.start.x))*p[0]/c[0]-l(t.drag.current.x)-a.x,dy:(a.y+f(t.drag.start.y))*p[1]/c[1]-f(t.drag.current.y)-a.y},s&&s.onRurDayResizeD&&s.onRurDayResizeD.call(s,o,i,e),r.sdayS([c[0]+o.dx,c[1]+o.dy]),n.updSPR(),n.SetScroll({x:a.x+i.dx,y:a.y+i.dy})});break;case 4:case 5:e&&e.rurStatus&&e.rurStatus.call(e.thisArg||n,t)}},n)}},Z.prototype.rurGroupResize=function(t,e){function o(t){t=t||"oW",r.forEach(function(e,o){o.SetWidth(e[t])})}if(t){var i,n,r,s,h=this,a=h.p2GR(h.gPtr(t));a&&(r=function(){var t,e,o=new y.M1,i=0;return h.gGW().forEach(function(t){o.set(e=t[2],{o:t[0],w:t[1],oW:e.GetWidth()}),i+=t[1]}),(t=o.get(a))&&(t.Mdx=i-(t.o+t.w)),o}()).has(a)&&(n=r.rgO.next(a))&&(i=r.get(a))&&(e.rurDragEnd=function(t){t.event.drag.cancel?h.Smooth(function(){o("oW")}):(a.SetWidth(void 0),h.onChange("group",a))},e.rurDrag=function(t){s=h.scaled(t.event.drag.offset.dx),(s=s<0?-l(-s,i.w):l(s,i.Mdx))&&h.Smoothless(function(){o("w"),a.SetWidth(u(0,i.w+s));for(var t=n;s&&t;)t.SetWidth(u(0,r.get(t).w-s)),t.GetWidth()?s=0:(s-=r.get(t).w,t=r.rgO.next(t))})},h.rurDrag(t,e))}},Z.prototype.rurGroupDrag=function(t,e){function o(t,e,o){(!s||!s.GetVisible()||!(e.oG==p&&o.getTime()==f))&&r.apply(this,arguments)}function i(t){var e,o,i=u.htD(u.gPtr(t));return i&&i.dN==f&&i.g&&(o=p.GetPosition()-(e=i.oG.GetPosition()))&&{p:e,g:u.rtDropOf(y.NRt(c,u.rt2C(i.g)),o>0)}||null}if(t){var n,r,s,h,a,u=this,l=u.htD(u.gPtr(t)),c=u.GetClientRect(),p=l&&l.g&&l.oG,f=l&&l.dN;p&&(e.rurDragStart=function(){r=u.drawDG,u.drawDG=o,n=u.rt2C(l.g),s=y.EF.Create({name:"group",visible:!1,client:n,relative:u.GetCanvas(),onpaint:function(t,e){u.ctxScale(t,e,function(e){e.oG=p,r.call(u,t,e,f)},u)},thisArg:u}),h=y.EF.Create({name:"drop",visible:!1,limitClient:!1,relative:u.GetCanvas(),onpaint:function(t,e){u.ctxScale(t,e,function(e){u.dGP(t,e)},u)},thisArg:u})},e.rurDragEnd=function(t){y.EF.Destroy(h),y.EF.Destroy(s),u.drawDG=r,u.invAO(),!t.event.drag.cancel&&(a=i(t.event))&&u.Smooth(function(){p.SetPosition(a.p),u.onChange("group",p)})},e.rurDrag=function(t){a=i(t.event),h.SetVisible(a),h.GetVisible()&&h.SetClient(a.g),s.SetClient(y.ORt(n.slice(),t.event.drag.offset.dx,t.event.drag.offset.dy)),s.GetVisible()||(s.SetVisible(!0),u.invAO())},u.rurDrag(t,e))}},Z.prototype.cbkEFPaint=function(t){var e=this.toShapes(t);return e&&function(t,o,i,n){o.drawShape(i,e.normal||e)}},Z.prototype.fitEFPaint=function(){return this.cbkEFPaint("frameFit")},Z.prototype.selEFPaint=function(){return this.cbkEFPaint("frameSel")},Z.prototype.rurFit=function(t,e){e.rurOnlyAO={},e.rurEFPaint=this.fitEFPaint(),e.rurDrop=function(t){this.FitToClient(this.rtSelAbs(t))},this.rurDrag(t,e)},Z.prototype.rurSelect=function(t,e){if(this.allowSelect()&&this.allowSelectByDrag()){var o=this.e2V(t)||this;if(o.ap2E&&o.ar2E){var i=!1,n=this.getSel();e.rurEFPaint=this.selEFPaint(),e.rurEFOpts=function(t,e){e.clipClient=o.GetClientRect()},e.rurDrag=function(t){!i&&(i=2==t.event.drag.status)&&(this.oT.oRUR.ao={},this.invAO()),i&&this.select(this.isSingleSel()?o.ap2E(t.to):o.ar2E(X.Rect(t.from,t.to)),{selChange:!1})&&((this.isToggleSel()||this.isToggleCtrlSel()&&2&y.ModK(t.event))&&(this.oT.rgSel=new y.Arr(n).toggle(this.oT.rgSel)).isEmpty()&&(this.oT.rgSel=null),this.feSV("invAO"),this.oT.onSel())},e.rurCancel=function(t){this.oT.SetSelection(n)},this.rurDrag(t,e)}}},Z.prototype.getDragEv=function(t,e,o){var i,n,r;return t&&(n=t[o?"isResizable":"isMovable"])&&(r=n.call(t))&&(i=new Map,(e&&this.isSelected(t)&&this.getSel()||[t]).forEach(function(t){r==n.call(t)&&i.set(t,t.sea())})),i},Z.prototype.rurCreate=Z.prototype.rurMove=function(t,o){function i(t,o,i){var n=o.s,r=u(o.s,o.e-(i||0)*Y);L&&e(t.GetStart())==n&&e(t.GetEnd())==r||t.sse(n,r),L=!0}function n(t,e){function o(o,n){i(o,function(t,e,o){var i={s:e.s,e:e.e};return 1==o?(i.s+=t.dtN,i.s=l(i.s,e.e-rt)):2==o&&(i.e+=t.dtN,i.e=u(i.e,e.s+rt)),i}(t,n,k.r),o.isHADE()),e&&this.onRURChange("resize",o,z.get(o))}t&&(e?z.forEach(function(t,e){o.call(this,e,e.se())},this):N&&o.call(this,N.oE,N))}function r(t){var e=this.p2T(this.gPtr(t));return e&&(ht||!M&&!W||(e.tN=m(_.tN)+e.tN%Y),T={dtN:function(t,e){return(F&&F.isAllDay()?m(t)-m(e):t-e)||0}(e.tN,_.tN),oG:e.oG,aD:e.aD}),T}function s(t,e,o){var i,n=this.gVE,r=f.call(this),s=this.isSelectable()&&t.gAO()||null;P&&this.gVE().forEach(function(t,e){e.oE==P&&(i=i||new y.M1).set(e,t)}),this.gVE=function(){return r},R.apply(this,arguments),i&&this.ctxScale(t,e,function(e){i.forEach(function(e,o){this.drawE(t,e,o,s)},this)}),this.gVE=n}function h(t,e,o,i){function n(e){r=t.globalAlpha,t.globalAlpha=e}var r,s=o.oE==F,h=o.oE==P;(c(Q)&&J?h||s:!h)?c($)&&s&&n($):n(Q),w.apply(this,arguments),c(r)&&(t.globalAlpha=r),et&&o.oE==F&&y.Schedule.sCTX(t,et,e,o)}function a(t){return G.call(this,t==F?P:t)}function p(){var t=arguments;E.call(this,function(){b.apply(this,t)})}function f(t){var e,o,i=new y.Arr,n=this.sAD();if(t||(n&&(e=this.gLE().aADE().mDE)&&this.gVD().forEach(function(t,o){i.pushnn(e.get(o))}),this.gVE().forEach(function(t,e){i.add(e.oE)}),i.remove(P)),i.add(F),o=new x(this.oT,i),n&&F.isAllDay()){var r,s=this.gADL(),h=o.aADE(),a=h&&h.oA2.mEL;a&&(a.set(F,r=l(a.get(F),s.i+s.C-.001)),s.ensure(r))}return o.VE(this)}function g(){}function S(t){var e=A.apply(this,arguments);return t==F&&(e=tt),e}function d(t){var e=U.apply(this,arguments);return t==F&&(e=tt),e}function v(t){return this.gCW().lR+=t?1:-1}function E(t,e){var o=this.gCW(),i=o.lR;i&&(o.lR=0),t.call(e||this),i&&(o.lR=i)}var D,T,C,G,b,w,R,A,U,L,V,M,W,H,I,k,P,z,F,N,B,K,X=o.rurName,j=this.gPtr(t),_=this.p2T(j),q=function(t,e){if(t&&F)if(e){var o=F.GetOptions(),n=this.oE.Add({start:o.start,end:o.end,groupID:o.groupID,allDay:o.allDay});nt&H&&this.EnsureVisibleClient(n),this.onRURChange("create",n)}else i(F,{s:_.tN+l(0,t.dtN),e:_.tN+u(rt,t.dtN)})},Q=this.misc("dragAlpha",!0),J=this.misc("dragAlphaNegate"),$=this.misc("dragDummyAlpha",!0),tt=this.misc("formatCreateEventLabel"),et=this.toShape("event-drag"),ot=this.misc("arrangeEventsOnDrag")&&this.gVE().len()<256,it=this.misc("dragStartOnMove"),nt=this.misc("ensureVisibleOnDrag"),rt=function(){var t=this.misc("allowEmptyEvents");return t=y.IsS(t)?Y*Z.Time.ToN(t):t<0?-~~t:y.ToN(t)*Y*this.gDSE().m}.call(this),st=this.sGE()&&this.getAllowMoveEventToOtherGroup(),ht=this.getAllowMultiDaysEvent();_&&(M=this.p2CE(j)||"create"==X,P=(W=(k=this.p2ER(j))&&k.oE)||!M&&(I=this.p2HT(j))&&I.o.oE||null,H=M?1:W?2:4,M||(z=this.getDragEv(P,!0,W),tt=this.misc("formatUpdateEventLabel")),(M&&this.aCE()||z&&z.size&&this.aME())&&(M||(q=W?n:function(t,e){function o(o,n){i(o,function(t,e){return{s:e.s+t.dtN,e:e.e+t.dtN}}(t,n),o.isHADE()),st&&(!t.oG||e&&_.oG==t.oG||o.SetGroupID(t.oG.getID())),o.isAllDay()!=t.aD&&(o.SetAllDay(t.aD),e&&i(o,o.se(),o.isAllDay()?2:-1)),e&&this.onRURChange("move",o,z.get(o))}t&&(e?z.forEach(function(t,e){o.call(this,e,e.se())},this):N&&o.call(this,N.oE,N))}),o.rurDragEnd=function(t){!ot&&v.call(this,!1),C&&(this.oT.onLE=C),b&&(this.rurScrollD=b),G&&(this.isSelected=G),R&&(this.draw=R),w&&(this.drawE=w),A&&(this.fEsl=A),U&&(this.fEll=U),!t.event.drag.cancel&&(M||D)&&F&&this[M?"Smoothless":"Smooth"](function(){q.call(this,r.call(this,t.event),!0),P&&nt&H&&this.EnsureVisibleClient(P)})},ot||(o.rurEFPaint=function(t,e,o,i){K&&this.ctxScale(e,o,function(t){K.forEach(function(t,o){this.drawE(e,t,o)},this)})}),this.gAA().Has("scroll")||(o.rurAllow=0),o.rurDrag=function(t){var e=2==t.event.drag.status;D=D||e,it&H&&!e||(!F&&function(t){if(!F){F=new O(this.oT.oE,P&&P.GetOptions()||{start:new Date(_.tN),end:new Date(_.tN+rt),groupID:_.oG?_.oG.getID():this.oT.oG.cID(),allDay:_.aD});var e=M?this.getCreateEventLabel():this.getUpdateEventsLabel();c(e)&&(F.SetShortLabel(e),F.SetLongLabel(e)),(N=F.se()).oE=F,M||(G=this.isSelected,this.isSelected=a),w=this.drawE,this.drawE=h,A=this.fEsl,this.fEsl=S,U=this.fEll,this.fEll=d,ot?(C=this.oT.onLE,this.oT.onLE=g,R=this.draw,this.draw=s):(b=this.rurScrollD,this.rurScrollD=p),M&&(B=y.GP.Get("create",this.getCursors()))&&t.event.drag.setCursor(B),this.oT.oRUR.ao=F,!ot&&v.call(this,!0)}}.call(this,t),q.call(this,r.call(this,t.event)),e&&(V||(V=!0,E.call(this,function(){this.rAO()})),ot||(t.frame=function(){K=f.call(this,!0);var t=y.C2R(K.union()),e=t[0],o=t[1],i=this.rtCA(this.rt2C(t),!0);return K.forEach(function(t){y.ORt(t,-e,-o)}),i}.call(this))))},this.rurDrag(t,o)))},Z.prototype.onRURChange=function(t,e,o){o&&this.oT.onMoveEvent(e,o),this.onChange(t,e)},Z.prototype.rurDragDrop=function(t,e){var o,i=[],n=this.ap2E(this.ptCA(this.gPtr(t)),i);this.isSable(n)&&y.RUR.D3(t,{object:n,shape:(o=this.e2S({oE:n}))&&(o.normal||o),client:this.rtCA(i,!1),source:this,onpaint:function(t,e){this.source.drawE(t,e,{oE:this.object})},onclick:function(t){e.rurStatus&&(this.oT.oRUR=this.e2RUR(t),e.rurStatus&&e.rurStatus.call(this,t),this.oT.oRUR=null)},onmove:function(t){t.drag.setCursor(y.GP.Get(e.rurName,this.getCursors()))}})},Z.prototype.getChange=function(t,e){return{object:e,action:t}},Z.prototype.onChange=function(t,e){this.onchange(this.getChange(t,e))},Z.prototype.onchange=function(t){this.oLts.onchange.do(t)},Z.prototype.Soom=function(t,e){function o(){var t=this.GetClientRect();r=this.ptCA(e,!1),s={x:t[0],y:t[1]}}var i=c(t),n=c(e);if(i||n){var r,s,h=100*this.getScale();o.call(this),((i&=h!=t)||(n&=r.x!=s.x||r.y!=s.y))&&(y.A.Cancel("soom"),y.A.Progress(function(e){this.cwbU(),i&&this.SetZoom(h+(t-h)*e),n&&(o.call(this),this.rurScrollD((r.x-s.x)*e,(r.y-s.y)*e)),this.cweU()},{name:"soom",thisArg:this,duration:this.getSmooth(),onXDoL:!1,transition:"swipe"}))}},Z.prototype.Home=function(){var t=this.gLDV(),e=t.sy.f;this.oT.oC&&this.oT.oC.SetDate(e),this.Soom(100,t.d2R(e)||[0,0])},Z.prototype.FitToClient=function(t){if(t=t||this.gLE().rtAll(),!y.EyR(t)){var e=this.GetClientRect(),o=l(e[2]/t[2],e[3]/t[3]);this.sdayS(this.rdayS()),this.Soom(100*o,{x:t[0],y:t[1]})}},Z.prototype.ToggleDate=function(t){t=e(t);var o=this;o[o.lSh||t&&!o.oTD&&!o.sTS()?"Smoothless":"Smooth"].call(this,o.oTD?function(){o.SetScroll(o.oTD.oScr),o.sdayS(o.oTD.dayS),o.oTD=null}:t&&function(){o.oTD={oScr:o.GetScroll(),dayS:o.odayS()},o.sdayS([-1,-1]),o.EnsureVisibleDate(t)})},Z.prototype.name=function(){return(this.oW||{}).name||""},Z.prototype.EnsureVisibleClient=function(t,e){if(t){var o=!1,i=t;if(y.IsA(t)||(s(t)&&this.gADL().ensure(t.gHADL()),i=this.o2rt(t)),i){this.updSPR();var n,r=(e=e||{}).allowScale,h=y.ToI(e.allowScroll,3),a=e.nearestFit,u=this.GetScroll(),c=this.getScale(),p=c,f=y.ToI(e.duration,this.getSmooth()),g=function(){var t=this.GetClientRect();return this.gClp(t)||t}.call(this);if(r){var S=this.GetClientRect(),d=this.rtCA(i,!1);p=l(c*S[2]/d[2],c*S[3]/d[3]),r=p_&&(i=this.back("eventContinueDay",!0))&&(h=function(){var t,e,o,i,n=0;return(t=this.misc("arrowSizeMultiDatesEvent"))&&(o=_,e=this.rdayS(),t.forEach||(t=[t,t]),n=(i=t[0]||0)+l((t[1]||0)-i,(l(e[0],e[1])-o)/(3*o))),n}.call(this))&&(s=this.eCD(o))&&(n=Z.dArr,r=t.fillStyle,t.fillStyle=i,1&s&&(n(t,X.R2C(e,18),1,h),e[1]+=h,e[3]-=h),2&s&&(n(t,X.R2C(e,66),2,h),e[3]-=h),4&s&&(n(t,X.R2C(e,36),4,h),e[2]-=h),8&s&&(n(t,X.R2C(e,33),8,h),e[0]+=h,e[2]-=h),t.fillStyle=r),y.PRt(e,this.getPad(),-1)},Z.prototype.eCD=function(t){var e=0,o=t.oE,i=o.isHADE(),n=this.gDSE(),r=!o.isAllDay();return(r?t.so.se().s)&&(e|=i?8:1),(r?t.e>Z.Time.ToDTN(m(t.s),n.e):t.e3?(a-=l*n,t.drawArr([a+(2*c+l),u],[a+c,u])):(u-=l*n,t.drawArr([a,u+(2*c+l)],[a,u+c])),r.w=h,r.t=s},Z.prototype.drawVE=function(t,e,o){this.ctxScale(t,e,function(e){var i=this.isSelectable()&&t.gAO()||null,n=this.gClp(e);n&&t.selClip(n),o.vforEach(function(e,o){this.drawE(t,e,o,i)},this),n&&t.resClip(n)})},Z.prototype.gVADS=function(){return void 0===this.rgVADS&&(this.rgVADS=this.sAD()?new P(this):null),this.rgVADS},Z.prototype.resVADS=function(){this.rgVADS=void 0},Z.prototype.drawVADS=function(t,e){var o=this.gVADS();o&&this.ctxScale(t,e,function(e){o.vforEach(function(e,o){this.drawADS(t,e,o)},this)},this)},Z.prototype.drawADS=function(t,e,o){var i,n,r=this.toShapes("date-all-day-scroll-button"),s=r&&r.normal||r;r&&(this.isEnabled()&&this.oT.oG.len()?(i=t.gAO())&&(y.EyO(r.hover)||(n=i.get(this,E(o)))&&(s=y.R.Shape(n.state,n.range,{from:s,to:r.hover})),y.EyO(r.click)||(n=i.get(this,D(o)))&&(s=y.R.Shape(n.state,n.range,{from:s,to:r.click}))):y.EyO(r.disabled)||(s=y.Inh(r.disabled,s))),s&&y.Schedule.sCTX(t,s,e,o,function(){!s.draw&&Z.dArr(t,X.R2C(e),o.s,8,5)},this)},Z.prototype.drawVZ=function(t,e,o){this.ctxScale(t,e,function(e){var i=this.isSelectable()&&t.gAO()||null,n=this.gClp(e);n&&t.selClip(n),o.vforEach(function(e,o){this.drawZ(t,e,o,i)},this),n&&t.resClip(n)})},Z.prototype.drawVD=function(t,e,o){this.ctxScale(t,e,function(e){var i;o.vforEach(function(e,o){this.issD(o)?(i=i||[]).push({d:o,r:e}):this.drawD(t,e,o)},this),i&&i.forEach(function(e){this.drawD(t,e.r,e.d)},this)})},Z.prototype.drawD=function(t,e,o){var i,n,r=new Date(o),s=this.gCnt(e),h=this.gClp(e);(n=this.toShape("dateAlt"))&&this.altD(r)&&(i=n),y.Schedule.sCTX(t,i,e,r,function(){s.H&&this.drawDH(t,s,r),s.gs.forEach(function(e){e.g&&this.drawDG(t,e.g,r),e.a&&this.drawAD(t,e.a,r),!h&&e.t&&this.drawDT(t,e.t,r)},this),h&&(t.selClip(h),s.gs.forEach(function(e){e.t&&this.drawDT(t,e.t,r)},this),t.resClip()),s.F&&this.drawDF(t,s.F,r)},this)},Z.prototype.drawDF=function(t,e,o){var i,n=this.toShape("date-frame");this.issD(o)&&(i=this.toShape("date-frame-select"))&&(n=i),t.drawShape(e,n)},Z.prototype.drawAD=function(t,e,o){var i=this.toShape("date-all-day-header");t.drawShape(e,i)},Z.prototype.drawDH=function(t,e,o){var i,n=e.H,r=(this.getPad()[0],this.toShape(e.T?"date-header":this.getShowHighlightEvent()&&this.hasE(o)&&(n=e.F)?"uiHighlight":""));e.T&&(i=this.toShape("dateAlt-header"))&&this.altD(o)&&(r=i),y.Schedule.sCTX(t,r,n,o,function(){var i,n=e.HC.slice(),r=this.GetPageSize();r.splice(0,0,0,0),(i=y.NRt(n,r))&&(n[0]=i[0],n[2]=i[2]),t.drawHTMLDate(this.oALE.Fit(this.gHDL(),y.WOf(n),o,t),o,n,5)},this),e.HGB&&this.drawGB(t,e.HGB,o)},Z.prototype.drawGB=function(t,e,o){var i,n,r=this.toShapes("grouping-button"),s=r&&r.normal||r;r&&(this.isEnabled()&&this.oT.oG.len()?(i=t.gAO())&&(y.EyO(r.hover)||(n=i.get(this,d(o)))&&(s=y.R.Shape(n.state,n.range,{from:s,to:r.hover})),y.EyO(r.click)||(n=i.get(this,v(o)))&&(s=y.R.Shape(n.state,n.range,{from:s,to:r.click}))):y.EyO(r.disabled)||(s=y.Inh(r.disabled,s))),y.Schedule.sCTX(t,s,e,o,function(){t.drawHTMLText(this.back("groupingButtonCaption"),e,5)},this)},Z.prototype.drawDG=function(t,e,o){var i=e.oG;y.Schedule.sCTX(t,this.toShape("date-grouping-header"),e,o,function(){i&&y.Schedule.sCTX(t,this.toShape(i.GetHeaderShape()),e,o,function(){t.drawHTMLText(i.getCaption(),e,this.misc("formatGroupCaption"))},this)},this)},Z.prototype.drawDT=function(t,e,o){y.Schedule.sCTX(t,this.toShape("date-timeScale"),e,o,function(){this.sTS()&&this.drawmM(t,e)},this)},Z.prototype.drawmM=function(t,e){var o=this.oTS.gmM();z.drawR(t,e,o.m,this.back("minorTimeRulerColor"),this.back("minorTimeRulerStyle")),z.drawR(t,e,o.M,this.back("majorTimeRulerColor"),this.back("majorTimeRulerStyle"))},Z.prototype.altD=function(t){return this.gLDV().d2I(t)%2},Z.prototype.dGP=function(t,e){var o=X.cArrSize.t,i=t.lineWidth,n=e[2],r=e[0]+e[2]/2;X.cArrSize.t=1.5,t.lineWidth=n/4,t.drawArr([r,e[1]],[r,e[1]+n/2]),t.drawArr([r,y.BOf(e)],[r,y.BOf(e)-n/2]),t.lineWidth=i,X.cArrSize.t=o},Z.prototype.rtDropOf=function(t,e){var o=this.getPad()[1];return t&&[(e?y.LOf(t):y.ROf(t))-8,t[1]-8-o/2,16,t[3]+16+o]||null},Z.prototype.resmM=function(){this.oTS.resmM()},Z.prototype.drawSC=function(t,e,o,i,n,r,s){var h=this.getShowHighlightEvent()&&("D"==s.type||"DNM"==s.type)&&this.hasE(s.date)&&(this.toShape("calendar-uiHighlight")||this.toShape("uiHighlight"))||null;y.Schedule.sCTX(o,h,i,r,function(){t&&t.call(e,o,i,n,r,s)},this)},Z.prototype.onDV=function(){this.feSV(function(t){t.oDV=null,t.resHADx(),t.oTS.resmM()})},Z.prototype.gDV=function(){var t=this.dSV();return t.oDV||(t.oDV=function(){function t(t){var e=u(0,l(r,n.toH(t)));return r-=e,e}function e(t,e){e&&(f[t]=[s,e],s+=e)}var o,i,n=this,r=n.rdayS()[1],s=0,h=0,a=0,c=0,p=0,f={};return h=t(this.getHeaderDayHeight()),r>0&&(this.sGE()&&(a=t(this.getHeaderGroupHeight())),this.sAD()&&(c=t(-this.gHADH())),(o=this.rTS())&&(p=u(0,r),a&&p+at?(n.forEach(function(t){s.set(t,0)}),i.forEach(function(e){s.set(e,o&&e.getWidth()*t/o||0)})):(r=(t-o)/n.length,n.forEach(function(t){s.set(t,r)}),i.forEach(function(t){s.set(t,t.getWidth())})),a.forEach(function(t){h.push([e,r=s.get(t),t]),e+=r}),e||(h[0][1]=t)),h}.call(t,t.rdayS()[0]))},Z.prototype.mGW=function(){var t=new Map;return this.gGW().forEach(function(e){t.set(e[2],[e[0],e[1]])}),t},Z.prototype.gCnt=function(t,e){var o,i,n,r={F:t},s=this.gDV(),h=this.gGW(),a=this.isLH(),u=t[0],c=t[1],p=this.gCEM();return s.h&&(n=t.slice(),a&&(n[1]=0),n[1]+=s.h[0],n[3]=s.h[1],r.H=n,r.HC=n,this.dGB()&&(o=l(y.HOf(n),this.toH(1)))&&o+2*(i=this.getPad()[0]), <%mmmm%> <%d%>, <%yyyy%><|><%dddd%>,<%mmmm%> <%d%>,<%yyyy%><|><%dddd%>, <%mmmm%> <%d%>,`<%yy%><|><%dddd%>, <%mmmm%> <%d%><|><%dddd%>, <%m3%> <%d%><|><%dddd%>, <%d%><|><%d3%>, <%d%><|><%d2%>, <%d%><|><%d1%>, <%d%><|><%d3%><|><%d2%><|><%d%>")},Z.prototype.GetHeaderDayShortLabel=function(){return this.oO.headerDayShortLabel},Z.prototype.SetHeaderDayShortLabel=function(t){this.cwbU(),this.oO.headerDayShortLabel=t,this.cweU()},Z.prototype.getHeaderDayShortLabel=function(){return this.opt("headerDayShortLabel","<%mmmm%> <%d%><|><%m3%> <%d%><|><%d%><=>((( day(value) = 1) or ( month(value+1) != month(value))) ? -1 : 2)")},Z.prototype.gHDL=function(){return this.sTS()?this.getHeaderDayLongLabel():this.getHeaderDayShortLabel()},Z.prototype.GetDayStartTime=function(){return this.oO.dayStartTime},Z.prototype.SetDayStartTime=function(t){this.cwbU(),this.oO.dayStartTime=t,this.resDSE(),this.onLE(),this.cweU()},Z.prototype.getDayStartTime=function(){return this.gDSE().s},Z.prototype.GetDayEndTime=function(){return this.oO.dayEndTime},Z.prototype.SetDayEndTime=function(t){this.cwbU(),this.oO.dayEndTime=t,this.resDSE(),this.onLE(),this.cweU()},Z.prototype.getDayEndTime=function(){return this.gDSE().e},Z.prototype.gDSE=function(){return this.oDSE||(this.oDSE=function(){var t=Z.Time.ToN(this.opt("dayStartTime","08:00")),e=Z.Time.ToN(this.opt("dayEndTime","16:00")),o=this.oTS.getTimeZone();return o&&(t+=o,e+=o),{s:l(t,e),e:u(t,e),m:Z.Time.ToN(this.oTS.opt("minorTimeRuler","00:15")),M:Z.Time.ToN(this.oTS.opt("majorTimeRuler","01:00"))}}.call(this))},Z.prototype.resDSE=function(){this.oDSE=null},Z.prototype.toDSE=function(t){var o=e(t),i=this.gDSE();return o=Z.Time.ToDTN(m(o),u(i.s,l(i.e,(o-m(o))/Y))),t&&t.setTime&&t.setTime(o),t},Z.prototype.GetTimeScale=function(){return this.oTS.GetOptions()},Z.prototype.SetTimeScale=function(t){this.oTS.SetOptions(t)},Z.prototype.sTS=function(){var t,e,o=this.oTS.getVisible();return o&&(e=this.oTS.oW)&&(this.lsTS++||this.oW.oCW.w2R(this.oW)&&(o=e._ovC?e._ovC.v:e.IsMinRec()||(t=this.gDV()).t&&t.t[1]>=this.rTS()),--this.lsTS),o},Z.prototype.rTS=function(){return this.toH(this.misc("requireTimeScaleHeight"))},Z.prototype.dTS=function(){return this.toH(this.misc("displayTimeScaleHeight"))},Z.prototype.rRD=function(){return this.toH(this.misc("requireRulerDistance"))},Z.prototype.SetGroups=function(t){this.oT.SetGroups(t)},Z.prototype.SetEvents=function(t){this.oT.SetEvents(t)},Z.prototype.GetShowGroupingEvents=function(){return this.oO.showGroupingEvents},Z.prototype.SetShowGroupingEvents=function(t){this.cwbU(),this.oO.showGroupingEvents=t,this.oT.oG.resVG(),this.oT.onLE(),this.oT.onLZ(),this.cweU()},Z.prototype.getShowGroupingEvents=function(){return this.opt("showGroupingEvents",!1)},Z.prototype.sGE=function(){var t;return this.getShowGroupingEvents()&&(t=this.gVG())&&t.len()&&t||null},Z.prototype.GetDisplayGroupingButton=function(){return this.oO.displayGroupingButton},Z.prototype.SetDisplayGroupingButton=function(t){this.cwbU(),this.oO.displayGroupingButton=t,this.cweU()},Z.prototype.getDisplayGroupingButton=function(){return this.opt("displayGroupingButton",!1)},Z.prototype.dGB=function(){return this.sTS()&&this.getShowGroupingEvents()&&this.oT.oG.len()&&this.getDisplayGroupingButton()},Z.prototype.GetHeaderGroupHeight=function(){return this.oO.headerGroupHeight},Z.prototype.SetHeaderGroupHeight=function(t){this.cwbU(),this.oO.headerGroupHeight=t,this.onLE(),this.cweU()},Z.prototype.getHeaderGroupHeight=function(){return this.opt("headerGroupHeight",1)},Z.prototype.GetApplyGroupingColors=function(){return this.oO.applyGroupingColors},Z.prototype.SetApplyGroupingColors=function(t){this.cwbU(),this.oO.applyGroupingColors=t,this.cweU()},Z.prototype.getApplyGroupingColors=function(){return this.opt("applyGroupingColors",!0)},Z.prototype.GetOnSelectDate=function(){return this.oO.onSelectDate},Z.prototype.SetOnSelectDate=function(t){this.bU(),this.oO.onSelectDate=t,this.eU()},Z.prototype.getOnSelectDate=function(){return f(this.opt("onSelectDate"),y.Schedule.OnSelectDateEnum,-1)},Z.prototype.GetSelectEventStyle=function(){return this.oO.selectEventStyle},Z.prototype.SetSelectEventStyle=function(t){this.bU(),this.oO.selectEventStyle=t,this.eU()},Z.prototype.getSelectEventStyle=function(){return~~this.opt("selectEventStyle",0)},Z.prototype.onSC2=function(){var t,e,o,i=this.getOnSelectDate(),n=this.sD(),r=this.gLDV().d2HV(n),s=this.getShowViewCompact(),h=s>0&&(2==s?0:1)||null,a=this.oT.oG;if(this.sDG(n.len()?{d:n.first(),g:a.gVG().first()||a.cID()}:null),i){if(this.bU(),i<0){if(e=this.GetPageSize(),t=[-1,-1],r)for(var u=0;u<2;u++)1!=r[u]&&(t[u]=e[u]/r[u]);c(h)&&(t[h]=this.odayS()[h],o=h?1:2),this.sdayS(t)}this.EnsureVisibleDate(n,o),this.eU()}},Z.prototype.GetAllowMoveEventToOtherGroup=function(){return this.oO.allowMoveEventToOtherGroup},Z.prototype.SetAllowMoveEventToOtherGroup=function(t){this.bU(),this.oO.allowMoveEventToOtherGroup=t,this.eU()},Z.prototype.getAllowMoveEventToOtherGroup=function(){return this.opt("allowMoveEventToOtherGroup",!0)},Z.prototype.aDDE=function(){return this.isSelectable()&&!this.isReadOnly()},Z.prototype.aCE=function(){return this.gAA().Has("create")&&this.aDDE()&&this.getShowEvents()},Z.prototype.aME=function(){return this.gAA().Has("move")&&this.aDDE()},Z.prototype.gCEM=function(){return this.aCE()&&u(0,y.ToN(this.misc("createEventMargin")))||0},Z.prototype.gEM=function(){var t=this.misc("eventMargin"),e=y.ToN(t[0],t)||0;return[e,y.ToN(t[1],e)]},Z.prototype.GetDefaultEventToolTip=function(){return this.oO.defaultEventToolTip},Z.prototype.SetDefaultEventToolTip=function(t){this.cwbU(),this.oO.defaultEventToolTip=t,this.oExT=void 0,this.cweU()},Z.prototype.getDefaultEventToolTip=function(){if(void 0===this.oExT){var t=y.ToS(this.opt("defaultEventToolTip","Start: <%=%1%>
End: <%=%2%>
Duration: <%=((1:=int(0:= %7)) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != 0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')%>"));this.oExT=t&&F.Get(t)||null}return this.oExT},Z.prototype.GetDefaultEventShortLabel=function(){return this.oO.defaultEventShortLabel},Z.prototype.SetDefaultEventShortLabel=function(t){this.cwbU(),this.oO.defaultEventShortLabel=t,this.oExsL=void 0,this.cweU()},Z.prototype.getDefaultEventShortLabel=function(){if(void 0===this.oExsL){var t=y.ToS(this.opt("defaultEventShortLabel",""));this.oExsL=t&&F.Get(t)||null}return this.oExsL},Z.prototype.GetDefaultEventLongLabel=function(){return this.oO.defaultEventLongLabel},Z.prototype.SetDefaultEventLongLabel=function(t){this.cwbU(),this.oO.defaultEventLongLabel=t,this.oExlL=void 0,this.cweU()},Z.prototype.getDefaultEventLongLabel=function(){if(void 0===this.oExlL){var t=y.ToS(this.opt("defaultEventLongLabel","<%=%256%>"));this.oExlL=t&&F.Get(t)||null}return this.oExlL},Z.prototype.GetDefaultEventExtraLabel=function(){return this.oO.defaultEventExtraLabel},Z.prototype.SetDefaultEventExtraLabel=function(t){this.cwbU(),this.oO.defaultEventExtraLabel=t,this.oExeL=void 0,this.cweU()},Z.prototype.getDefaultEventExtraLabel=function(){if(void 0===this.oExeL){var t=y.ToS(this.opt("defaultEventExtraLabel","<%=%256%>"));this.oExeL=t&&F.Get(t)||null}return this.oExeL},Z.prototype.GetShortDateFormat=function(){return this.oO.shortDateFormat},Z.prototype.SetShortDateFormat=function(t){this.cwbU(),this.oO.shortDateFormat=t,this.cweU()},Z.prototype.getShortDateFormat=function(){return y.ToS(this.GetShortDateFormat(),"<%loc_sdate%>")},Z.prototype.GetShortTimeFormat=function(){return this.oO.shortTimeFormat},Z.prototype.SetShortTimeFormat=function(t){this.cwbU(),this.oO.shortTimeFormat=t,this.cweU()},Z.prototype.getShortTimeFormat=function(){return y.ToS(this.GetShortTimeFormat(),"<%h%>:<%nn%> <%AM/PM%>")},Z.prototype.GetLongDateFormat=function(){return this.oO.longDateFormat},Z.prototype.SetLongDateFormat=function(t){this.cwbU(),this.oO.longDateFormat=t,this.cweU()},Z.prototype.getLongDateFormat=function(){return y.ToS(this.GetLongDateFormat(),"<%loc_ldate%>")},Z.prototype.GetLongTimeFormat=function(){return this.oO.longTimeFormat},Z.prototype.SetLongTimeFormat=function(t){this.cwbU(),this.oO.longTimeFormat=t,this.cweU()},Z.prototype.getLongTimeFormat=function(){return y.ToS(this.GetLongTimeFormat(),"<%hh%>:<%nn%>:<%ss%> <%AM/PM%>")},Z.prototype.GetShowEventLabels=function(){return this.oO.showEventLabels},Z.prototype.SetShowEventLabels=function(t){this.cwbU(),this.oO.showEventLabels=t,this.cweU()},Z.prototype.getShowEventLabels=function(){return y.ToB(this.GetShowEventLabels(),!0)},Z.prototype.GetCreateEventLabel=function(){return this.oO.createEventLabel},Z.prototype.SetCreateEventLabel=function(t){this.cwbU(),this.oO.createEventLabel=t,this.cweU()},Z.prototype.getCreateEventLabel=function(){return this.opt("createEventLabel")},Z.prototype.GetUpdateEventsLabel=function(){return this.oO.updateEventsLabel},Z.prototype.SetUpdateEventsLabel=function(t){this.cwbU(),this.oO.updateEventsLabel=t,this.cweU()},Z.prototype.getUpdateEventsLabel=function(){return this.opt("updateEventsLabel")},Z.prototype.GetShowMarkZone=function(){return this.oO.showMarkZone},Z.prototype.SetShowMarkZone=function(t){this.cwbU(),this.oO.showMarkZone=t,this.cweU()},Z.prototype.getShowMarkZone=function(){return y.ToI(this.GetShowMarkZone(),2)},Z.prototype.GetShowEvents=function(){return this.oO.showEvents},Z.prototype.SetShowEvents=function(t){this.cwbU(),this.oO.showEvents=t,this.oT.onLE(),this.cweU()},Z.prototype.getShowEvents=function(){return y.ToI(this.GetShowEvents(),-1)},Z.prototype.GetShowAllDayHeader=function(){return this.oO.showAllDayHeader},Z.prototype.SetShowAllDayHeader=function(t){this.cwbU(),this.oO.showAllDayHeader=t,this.oADL=null,this.oT.onLE(),this.onUI(),this.cweU()},Z.prototype.getShowAllDayHeader=function(){return y.ToB(this.GetShowAllDayHeader(),!1)},Z.prototype.GetHeaderAllDayEventHeight=function(){return this.oO.headerAllDayEventHeight},Z.prototype.SetHeaderAllDayEventHeight=function(t){this.cwbU(),this.oO.headerAllDayEventHeight=t,this.onLE(),this.cweU()},Z.prototype.getHeaderAllDayEventHeight=function(){return this.opt("headerAllDayEventHeight",1)},Z.prototype.sAD=function(){return this.getShowAllDayHeader()&&this.getHeaderAllDayEventHeight()&&this.rdayS()[1]>function(){var t=this.toH(this.getHeaderDayHeight())+this.gHADH(1);return this.sGE()&&(t+=this.toH(-this.getHeaderGroupHeight())),t}.call(this)},Z.prototype.gADL=function(){var t=this.gLE().gADRL();return(this.oADL=this.oADL||(this.oADL=new k(this,t))).get(t)},Z.prototype.gHADE=function(){return this.toH(this.getHeaderAllDayEventHeight())+2*this.getPad()[1]},Z.prototype.gHADH=function(t){t=t||this.gADL().C;var e=this.gEM()[1];return e+t*(this.gHADE()+e)+this.gCEM()},Z.prototype.gHADx=function(){return this.nHADx||(this.nHADx=function(){var t=this.rdayS()[1],e=this.gEM()[1],o=this.gHADE()+e;return t-=this.toH(this.getHeaderDayHeight()),this.sGE()&&(t-=this.toH(this.getHeaderGroupHeight())),u(1,Math.round((t-2*e)/o))}.call(this))},Z.prototype.resHADx=function(){this.nHADx=null},Z.prototype.GetAllowMultiDaysEvent=function(){return this.oO.allowMultiDaysEvent},Z.prototype.SetAllowMultiDaysEvent=function(t){this.cwbU(),this.oO.allowMultiDaysEvent=t,this.onLE(),this.cweU()},Z.prototype.getAllowMultiDaysEvent=function(){return this.opt("allowMultiDaysEvent",!0)},Z.prototype.GetAllowAllDayEventScroll=function(){return this.oO.allowAllDayEventScroll},Z.prototype.SetAllowAllDayEventScroll=function(t){this.cwbU(),this.oO.allowAllDayEventScroll=t,this.onDV(),this.cweU()},Z.prototype.getAllowAllDayEventScroll=function(){return this.opt("allowAllDayEventScroll",null)},Z.prototype.e2Rs=function(t,e){var o=[];return this.gLE().feR(t,function(t,i,n){return o.push(i),n+1==e}),o},Z.prototype.onCopy=function(){var t=[];return this.getSel().forEach(function(e){e.genID(),t.push(e.coO())}),this.sDG(),{e:t}},Z.prototype.onPaste=function(t){var e,i,n,r,s,h=t.e;o(h)&&(e=this.oE.nextID(h.length),i=new Map,h.forEach(function(t,o){i.set(t.key,t.key=e[o])},this),this.oDG&&this.oDG.d&&(h.forEach(function(t){s=m(Date.Create(t.start).getTime()),r=p(r)?s:l(r,s)},this),r=m(this.oDG.d)-r,n=this.oDG.g?this.oDG.g.getID():this.oT.oG.cID(),h.forEach(function(t){r&&(s=Date.Create(t.start),t.start=r+m(s)+s%Y,t.end=new Date(t.start+(Date.Create(t.end).getTime()-s)).toFormat(),t.start=new Date(t.start).toFormat()),t.groupID=n},this)),h.forEach(function(t){this.oE.Add(t)},this))},Z.prototype.aCCP=function(){return y.EVis(this.GetCanvas())},Z.prototype.Cut=function(){this.aCCP()&&(this.Copy(),this.oT.RemoveSelection())},Z.prototype.Copy=function(){if(this.aCCP()){var t=y.win.event,e=JSON.stringify(this.onCopy());r(t)?(y.SEP(t),t.clipboardData.setData("text/plain",e)):y.nav.clipboard.writeText(e)}},Z.prototype.Paste=function(){function t(t){this.Smooth(function(){var e,o=this.oE.GetCount();try{this.onPaste(JSON.parse(t))}catch(t){}if(o!=this.oE.GetCount()){for(var i=o,n=this.oE.GetCount();i:<%nn%> <%AM/PM%>")},z.prototype.GetMajorTimeRuler=function(){return this.oO.majorTimeRuler},z.prototype.SetMajorTimeRuler=function(t){this.cwbU(),this.oO.majorTimeRuler=t,this.oSV.resDSE(),this.resmM(),this.cweU()},z.prototype.getMajorTimeRuler=function(){return this.oSV.gDSE().M},z.prototype.GetMinorTimeLabel=function(){return this.oO.minorTimeLabel},z.prototype.SetMinorTimeLabel=function(t){this.cwbU(),this.oO.minorTimeLabel=t,this.resmM(),this.cweU()},z.prototype.getMinorTimeLabel=function(){return this.opt("minorTimeLabel",":<%nn%>")},z.prototype.GetMinorTimeRuler=function(){return this.oO.minorTimeRuler},z.prototype.SetMinorTimeRuler=function(t){this.cwbU(),this.oO.minorTimeRuler=t,this.oSV.resDSE(),this.resmM(),this.cweU()},z.prototype.getMinorTimeRuler=function(){return this.oSV.gDSE().m},z.prototype.GetTimeZone=function(){return this.oO.timeZone},z.prototype.SetTimeZone=function(t){this.cwbU(),this.oO.timeZone=t,this.oSV.resDSE(),this.resmM(),this.onLE(),this.cweU()},z.prototype.getTimeZone=function(){return Z.Time.ToN(this.opt("timeZone","00:00"),!0)},z.prototype.resmM=function(){this.feSV(function(t){t.oTS.omM=null})},z.prototype.gmM=function(){function t(t,e){return Math.abs(t-e)o&&!t(e,o)}function n(t,e,o,i){var n=0;return e&&(n=t*o/e,i&&(n=u(0,l(n,o)))),n}return this.omM||(this.omM=function(){var t,r,s,h,a,l=this.gDV(),c=[],p=[],f={m:p,M:c},g=this.getMajorTimeRuler(),y=0;return l.t&&(t=l.t[1])&&(s=this.getDayStartTime()+y,h=this.getDayEndTime()+y,(a=h-s)>K&&(r=this.rRD(),1==function(i,l,c){var p,f,g,S,d,v,E=0;if(i>K){for(g=y;o(g+i,s);)g+=i;if(S=g-s,!c)for(f=0,d=n(S,a,t);f=-.001&&!(p%E)&&l.push({t:g,o:v}),g+=i,p++}return E}.call(this,g,c)&&function(e,s,h){function a(t,e,s){if(s.splice(0),c.length>1)for(var h,a,u=c[0],l=c[1],p=l.o-u.o,f=g,y=u.t,S=l.t,d=r,v=y;o(v,S);)h=n(v-y,f,p),a=!1,e?a=i(v,y):h>=d&&(a=hK&&(p=a.call(this,e,!1,l=[]))&&(u=(f=g/(p+1))/e,u/=5,(f=(u*=5)*e)>K&&i(f,e)&&a.call(this,f,!0,l=[]),l.length&&c.forEach(function(e){l.forEach(function(o){e.o+o.o<=t&&s.push({t:e.t+o.t,o:e.o+o.o})})}))}.call(this,this.getMinorTimeRuler(),p))),f}.call(this))},z.drawR=function(t,e,o,i,n,r,s){var h,a,u,l=e[0],p=e[1],f=l+e[2];o.length&&(c(i)&&(t.save(),t.beginPath(),t.strokeStyle=i,c(n)&&t.setLineDash(y.IsA(n)?n:[n]),t.strokeStyle=i,o.forEach(function(e){t.moveTo(l,p+e.o),t.lineTo(f,p+e.o)}),t.stroke(),t.restore()),r&&(u=Date.Today(),h=s?l:f,a=256|(s?0:2),o.forEach(function(e){t.drawHTMLDate(r,Z.Time.ToDT(u,e.t),[h,p+e.o,0,0],a)})))},z.prototype.drawmM=function(t,e,o){var i=e&&o&&X.X(X.R2C(e))