/* @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(t){return t instanceof Array}function o(t){return t instanceof p.Arr}function i(t){return t instanceof Function}function n(t){return t instanceof ClipboardEvent}function r(t){return t instanceof p.Schedule.Event}function s(t){return t instanceof p.Schedule.MarkZone}function h(t){return t instanceof p.Schedule.SV}function a(t){return null!=t}function u(t){return null==t}function l(t,e,o){return u(t)?~~o:p.s2F(t,e)}var c,p=p||window.exontrol,f=p.UR,g=Math.max,y=Math.min,S=p.IsO,d=p.ToS;if(p.Calendar){var v=p.Shapes.Calendar;v&&(v.hframe2=void 0,v.today.normal.tfi.bold=!1,v.select.normal={frameColor:"dodgerblue",primitive:"Circle",frameSize:2,pad:1},v.select.hover=void 0)}p.Shapes.Schedule={},p.Mrg(p,function(){function t(t,e,o){this.oT=t,this.init(e,o)}function n(t,e){p.host.call(this,arguments)}return p.Calendar&&(Object.addPrototypeOf(t.prototype,p.Calendar.prototype),t.type=p.Calendar.type),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();(u(t)||t>i)&&(t=i),(u(e)||o>e)&&(e=o)}),o.y=u(t)?(this.GetDate()||Date.Today()).GetYear():t,a(e)&&e.GetYear()!=o.y&&(o.d=e),o},n.version="5.5",n.type="Schedule",n.XML=function(){function t(t){return a(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}}}(),n.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))},n.ShowEventsEnum={exShowAllEvents:-1,exHideEvents:0,exShowRegularEvents:1,exShowRepetitiveEvents:2},n.ShowMarkZoneEnum={exHideMarkZones:0,exShowMarkZonesBack:1,exShowMarkZonesFront:2},n.SelectEventStyleEnum={exSelectCombined:0,exSelectBack:1,exSelectPrimitive:2},n.EventResizableEnum={exNoResizable:0,exResizableStart:1,exResizableEnd:2,exResizableBoth:3},n.OnSelectDateEnum={exFitSelToView:-1,exNoViewChange:0,exEnsureVisibleDate:1},n.ShowViewCompactEnum={exViewCalendar:0,exViewCalendarCompact:-1,exViewSingleRow:1,exViewSingleColumn:2,exViewSingleRowLockHeader:3,exViewSingleWeek:4},n.OnResizeControlEnum={exResizePanelLeft:0,exResizePanelRight:1,exDisableSplitter:128,exHideSplitter:256,exChangePanels:512,exCalendarFit:1024,exCalendarAutoHide:2048},n.SingleSelEnum={exDisableSel:0,exEnableSel:1,exSingleSel:2,exToggleSel:4,exDisableCtrlSel:8,exDisableShiftSel:16,exDisableDrag:32},n.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,paneMinWidthLeft:null,paneMinWidthRight: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,events:null,selection:null,timeScale:null,misc:null,background:null},f&&(n.blockUR=function(t){return function(){var e=this,o=arguments;(this.oT||this).blockUR(function(){t.apply(e,o)})}}),n.bSCTX=function(t,e,o,i){var n;return e&&(t.drawShape(o,e,i),n=p.TFI.bCTX(t,e.tfi),a(e.opacity)&&((n=n||{}).opacity=t.globalAlpha,t.globalAlpha=e.opacity)),n},n.eSCTX=function(t,e){a(e.opacity)&&(t.globalAlpha=e.opacity),p.TFI.eCTX(t,e)},n.sCTX=function(t,e,o,i,r,s){var h=n.bSCTX(t,e,o,i);r&&r.call(s),h&&n.eSCTX(t,h)},n.prototype.init=function(t,e){this.lnt=this.lnt||0,this.lnt++,this.oZ=new n.MarkZones(this),this.oG=new n.Groups(this),this.oE=new n.Events(this),this.lAI=0,this.oSV=null,this.rgSV=[],this.rgSel=null,this.sSA="smth-"+p.Rand(),this.iLts(),this.oCW=new p.CW(t,{AllowXChg:0,ScrollBars:this.defOpt().scrollBars}),this.oCW.oT=this,this.Shortcuts=this.oCW.oSts,f&&(this.oUR=new f.M({oC:this,cU:c.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(),p.expO(n.Options,this,this.oSV),this.cwbU(),this.SetOptions(e,!0),this.cweU(),p.DPR.Reg(this),this.oCW.onCR(),--this.lnt},n.prototype.GetCanvas=function(){return this.oCW.GetCanvas()},n.prototype.defOpt=function(){return p[this.constructor.type].Options},n.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"},n.prototype.roAA=function(){return"scroll,zoom,fit,select"},n.prototype.allP=function(){return"view(Schedule.SV),timescale(Schedule.TimeScale)"},n.prototype.Clear=function(){this.bU(),this.oZ.Clear(),this.oG.Clear(),this.oE.Clear(),this.eU()},n.prototype.p2E=function(t){return this.feSVU(function(e){return e.oW&&e.p2E(t)})},n.prototype.onAddEvent=function(t){this.lAI||(this.onLE(),this.onaddevent(t))},n.prototype.onaddevent=function(t){this.oLts.onaddevent.do(t)},n.prototype.onDelEvent=function(t){this.removeSel(t),this.onLE(),this.onremoveevent(t)},n.prototype.onremoveevent=function(t){this.oLts.onremoveevent.do(t)},n.prototype.onMoveEvent=function(){},n.prototype.onAddGroup=function(t){this.onLE()},n.prototype.onDelGroup=function(t){this.onLE()},n.prototype.onAddMarkZone=function(t){this.onLZ()},n.prototype.onDelMarkZone=function(t){this.onLZ()},n.prototype.feSV=function(t,e){p.Schedule.SV.prototype[t]?this.rgSV.forEach(function(e){e[t].call(e)},this):this.rgSV.forEach(t,e)},n.prototype.feSVU=function(t,e){return p.Schedule.SV.prototype[t]?this.rgSV.forEachU(function(e){e[t].call(e)},this):this.rgSV.forEachU(t,e)},n.prototype.feE=function(t,e){e=e||this,this.oE.forEach(function(o){t.call(e,o)})},n.prototype.feEU=function(t,e){return this.oE.forEachU(t,e||this)},n.prototype.setTimeout=function(){return p.setTimeout.apply(this,arguments)},c=p.Def.UR.Schedule={Update:"Smooth",AddEvent:"AddEvent",RemoveEvent:"RemoveEvent",MoveEvent:"MoveEvent",UpdateEvent:"UpdateEvent"},n.prototype.gUR=function(){return this.oUR&&this.oUR.gUR()},n.prototype.onundoredo=function(t){this.oSV.onChange("undo-redo",t)},n.prototype.BlockUndoRedo=function(t,e){i(t)&&(this.StartBlockUndoRedo(),t.call(e||this),this.EndBlockUndoRedo())},n.prototype.BeginUpdate=function(){this.oCW.CWs().forEach(function(t){t.bU()})},n.prototype.bU=n.prototype.cwbU=n.prototype.BeginUpdate,n.prototype.EndUpdate=function(){1==this.oCW.lR&&this.fU(),this.oCW.CWs().forEach(function(t){t.eU()})},n.prototype.eU=n.prototype.cweU=n.prototype.EndUpdate,n.prototype.Update=function(t,e){this.bU(),t&&t.call(e||this),this.eU()},n.prototype.fU=function(){},n.prototype.bR=function(){this.oCW.CWs().forEach(function(t){t.bR()})},n.prototype.eR=function(){this.oCW.CWs().forEach(function(t){t.eR()})},n.prototype.Refresh=function(){this.bU(),this.oG.resVG(),this.onLD(),this.onUI(),this.eU()},n.prototype.onUI=function(){this.oCW.onUI()},n.prototype.uLD=function(){this.oC&&!t.eqSY(this.oC.gSY(),this.gLDV().sy)&&this.onLD()},n.prototype.onLD=function(t){this.onLE(),this.onLZ(),this.oLDV&&(this.oLDV=null,this.feSV("onLD")),t&&this.setTimeout(function(){this.bU(),this.eU()})},n.prototype.onLE=function(){this.oLE&&(this.oLE=null,this.feSV("onLE"))},n.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)})},n.prototype.onLZ=function(){this.oLZ&&(this.oLZ=null,this.feSV("onLZ"))},n.prototype.onCC=function(t){t<2&&this.onLD(!t)},n.prototype.onSC2=function(t){this.lnt||(this.bR(),this.uLD(),this.oSV.onSC2(),this.eR()),this.oncalselchange(t)},n.prototype.oncalselchange=function(t){this.oLts.oncalselchange.do(t)},n.prototype.resO=function(){this.oLE&&this.oLE.resEO(),this.oLZ&&this.oLZ.resZO()},n.prototype.issD=function(t){return this.oC&&this.oC.isSelected(t)},n.prototype.sD=function(){return this.oC&&this.oC.getSel()||p.Arr.empty},n.prototype.fD=function(){return this.sD().first()||this.oC&&this.oC.GetDate()||Date.Today()},n.prototype.updSPR=function(){this.feSV("updSPR")},n.prototype.iLts=function(){this.Listeners=this.oLts=new p.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")},p.Lts.Onf(n.prototype),n.prototype.addSV=function(t,e){function o(e){return e.repAll("name",t)}var i=null;if(!u(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,p.Mrg({Dock:n?5:4,Size:256},e));i=new p.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 p.ScrollBar(null,null)})}return i},n.prototype.AddScheduleView=function(t,e){this.bU();var o=this.addSV(t,e);return this.eU(),o},n.prototype.delSV=function(t){!u(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&&h(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},n.prototype.RemoveScheduleView=function(t){this.bU(),this.delSV(t),this.eU()},n.prototype.ScheduleView=function(t){var e=this.oCW.W(t+".client");return e&&e.oC&&~this.rgSV.indexOf(e.oC)&&e.oC||null},n.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}),p.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]=g(n[2],e.x),n[3]=g(n[3],e.y)),t.rcAH()&&this!=this.oCW.oHovW?(n[2]=0,n[3]=0):(~(o=t.getPaneMinWidthLeft())&&(n[2]=g(n[2],o)),~(i=t.getPaneMinWidthRight())&&(n[2]=y(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):(u(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 p.ScrollBar(null,null)}),this.addSV("schedule"),this.oSV.aRC()},n.prototype.w2P=function(t){function e(){function t(t){var e=[];return p.B.split(t).forEach(function(t){t.caption&&t.subText&&e.push({n:t.caption,p:function(t){var e=p;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 p.Arr).push(t)),e|=o!=this.isSelected(t);return e}var s=!1,h=2&(i=i||{}).selType,l=function(t){var i=null;if(a(t)){var r=this.oE,s=r.Item;t instanceof n.Events?t==this.oE&&(i=this.oE.rgE):e(t)||o(t)?(i=new p.Arr,t.forEach(function(t){i.ann(s.call(r,t))})):i=s.call(r,t)}return i}.call(this,t);return o(l)?h?l.forEach(function(t){s|=r.call(this,t)},this):(s=!l.equal(this.rgSel))&&(this.isSingleSel()?r.call(this,l.last()):(this.rgSel=new p.Arr,l.forEach(function(t){t.isSelectable()&&this.rgSel.push(t)},this))):s=r.call(this,l),s&&(o(this.rgSel)&&(this.rgSel.len()||(this.rgSel=null)),(u(i.selChange)||i.selChange)&&(this.feSV("invAO"),this.onSel())),s},n.prototype.onSel=function(){this.onselchange(this.GetSelection())},n.prototype.onselchange=function(t){this.oLts.onselchange.do(t)},n.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},n.prototype.gLE=function(){return this.oLE||(this.oLE=this.nLE())},n.prototype.nLE=function(){return new n.LE(this)},n.prototype.gLZ=function(){return this.oLZ||(this.oLZ=this.nLZ())},n.prototype.nLZ=function(){return new n.LZ(this)},n.prototype.gLDV=function(){return this.oLDV||(this.oLDV=this.nLDV())},n.prototype.nLDV=function(){return new n.LDV(this)},p.ComboBox&&(n.prototype.dCBl=function(t,e,o){o.oO.label=this.getSel().join()},n.prototype.cCB=function(t){var e=this.e2V(t);return!e||h(e)},n.prototype.sCB=function(t){return t&&this.SetSelection(null),this.getSelCount()},p.CW.prototype.SetCanvas=function(t,e){return p.ComboBox.implExHost(t,"onselchange,onchange,onscroll")}(p.CW.prototype.SetCanvas)),Object.defineProperty(n.prototype,"Calendar",{get:function(){return this.oC},configurable:!0}),f&&(["SetEvents","Clear"].forEach(function(t){n.prototype[t]=n.blockUR(n.prototype[t])}),n.prototype.nUR=function(t,e,o){this.blockUR(function(i){e.call(o||this,i.New(t))})},n.prototype.blockUR=function(t,e){e=e||this;var o=this.gUR();o?o.Block(function(){t.call(e,o)},this):t.call(e)},n.prototype.onAddEvent=function(t){return function(e){t.apply(this,arguments),this.gUR()&&this.nUR(c.AddEvent,function(t){e.arUR(t)})}}(n.prototype.onAddEvent),n.prototype.onDelEvent=function(t){return function(e){t.apply(this,arguments),this.gUR()&&this.nUR(c.RemoveEvent,function(t){t.del=!0,e.arUR(t)})}}(n.prototype.onDelEvent),n.prototype.onMoveEvent=function(t){return function(e,o){t.apply(this,arguments),this.gUR()&&this.nUR(c.MoveEvent,function(t){e.mvUR(t,o)})}}(n.prototype.onMoveEvent)),p.expO({Canvas:null,Events:null,Groups:null,Layout:null,Statistics:null,Selection:null},n.prototype),{Schedule:n}}()),p.Mrg(p.Schedule,function(){function t(t){var i,n=p.Arr.empty;return a(t)&&(i=t,n=new p.Arr,o(t)?i=t.rgE:e(t)||(i=[t]),i.forEach(function(t){n.ann(this.Item(t))},this)),n}function h(t){return t&&t.getTime?t.getTime():t}function v(t){return"b"+d(t)}function E(t){return v("gh-"+h(t))}function D(t){return v("gc-"+h(t))}function m(t){return v("ash-"+t.s)}function T(t){return v("asc-"+t.s)}function C(t){return t-t%_}function G(t,e){return t&&e?p.Inh(t,e):t||e}function w(t){return t&&!(t.normal||t.hover||t.click||t.disabled)&&(t={normal:t}),t}function b(t){var e,o,i,n,r,s=new p.BiM,h=new Map,a=new Map,u=new Map,l=b.toK;p.B.split(t).forEach(function(t){(o=t.subText)&&(n="get"+p.getP(o),r="Set"+p.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 R(t,e){this.oT=e,(t=d(t))&&(~t.toLocaleLowerCase().indexOf("freq")?p.ICalendar&&(this.oEx=p.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(C(t.getTime()))})):(this.gA=function(){},this.oEx=p.E.Create(t,"value"),(this.valid=this.oEx.IsValid())&&(this.eval=function(t){return this.oEx.Evaluate(function(){return t})})))}function A(t){this.init(t)}function O(t,e){this.oZ=t,this.oO={},this.setOpts(e)}function U(t){this.init(t)}function L(t,e){this.oE=t,this.oO={},this.setOpts(e)}function V(t){this.init(t)}function x(t,e){this.oG=t,this.oO={},this.setOpts(e)}function M(t){this.init(t)}function W(t,e){this.rgE=e.forEach?e:[e],this.init(t)}function H(t){this.init(t)}function k(t){this.init(t)}function I(){this.init()}function P(){this.init()}function Z(t,e){this.oSV=t,this.get(e||0)}function z(t){this.init(t)}function F(t){this.init(t)}function N(t){this.init(t)}var B,K,X=1234,Y=1/24/60/60/2,j=p.G,_=p.msday,q=null,J=24;b.toK=function(t){return p.IsI(t)?~~t:t&&t.toLowerCase&&t.toLowerCase()||t},b.prototype.toK=function(t){var e=b.toK(t);if(this.k.has(e))return e},b.prototype.toO=function(t){var e=this.k.get(this.toK(t));return p.IsI(e)?this.o.get(e):e},b.prototype.toI=function(t){var e=this.k.get(this.toK(t));return p.IsI(e)?e:this.o.getKey(e)},b.prototype.get=function(t){return this.g.get(this.toK(t))},b.prototype.set=function(t){return this.s.get(this.toK(t))},B=function(){function t(t){(t=d(t)).startsWith("=")&&(t=t.substr(1)),this.oEx=p.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=p.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 p.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 p.H.TextNoHTML(this.c)})},{Get:function(t){var i;return a(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={minWidth:16,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},$={majorTimeRulerColor:"#C0C0C0",majorTimeRulerStyle:1,timeScaleMajorTimeRulerColor:"#C0C0C0",timeScaleMajorTimeRulerStyle:1,timeScaleMinorTimeRulerColor:"#C0C0C0",timeScaleMinorTimeRulerStyle:1,groupingButtonCaption:"…",eventContinueDay:"black"};R.prototype.eval=function(t){},R.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)/_,until:e,filter:C},this.oEx.has("DTSTART")||(o.start=t),this.rgA=this.oEx.all(o),this.rgA.sY=i,this.rgA.eY=n),this.rgA};var tt={start:null,end:null,time:null,groupID:null,caption:void 0,visible:null,key:null,shape:null,repetitive:null,eventShape:null,timeScaleShape:null};A.prototype.init=function(t){this.oT=t,this.rgZ=new p.Arr,this.rgZ.onRemove=t.onDelMarkZone.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.rgZ[t].bind(this.rgZ)},this)},A.prototype.onLZ=function(){this.oT.onLZ(),this.resVeS()},A.prototype.resVeS=function(){this.rgVeS=null},A.prototype.resKZ=function(){this.mKZ=null},A.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))},A.prototype.Add=function(t){this.bU(),this.resKZ();var e=arguments,o=this.add(new p.Schedule.MarkZone(this,2==e.length?{start:e[0],end:e[1]}:S(t)?t:{time:t}));return this.oT.onAddMarkZone(o),this.eU(),o},A.prototype.GetCount=function(){return this.rgZ.len()},A.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgZ.at(t)||null:s(t)?e=this.rgZ.has(t)?t:null:u(e=function(t){var e=t.mKZ;return u(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},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.resKZ(),this.rgZ.removeRange(t=this.toA(t)),this.eU(),t.length},A.prototype.Clear=function(){this.bU(),this.oT.resSel(),this.resKZ(),this.rgZ.clear(),this.eU()},O.prototype.ao=function(t){return this[t]||(this[t]={})},O.prototype.getType=function(){return"mark-zone"},O.prototype.gS=function(){return this.oZ.oT},O.prototype.bU=function(){this.oZ.bU()},O.prototype.eU=function(t){t&&this.oZ.onLZ(),this.oZ.eU()},O.prototype.dSV=function(){return this.gS().oSV},O.prototype.Remove=function(){return this.oZ.Remove(this)},O.prototype.GetOptions=function(){return this.oO},O.prototype.SetOptions=function(t){this.bU(),this.setOpts(t),this.eU()},O.prototype.setOpts=function(t){if(S(t))for(var e in t){var o=this[p.setM(e)];o&&o.call(this,t[e])}},O.prototype.GetIndex=function(){return this.oZ.indexOf(this)},O.prototype.GetKey=function(){return this.oO.key},O.prototype.SetKey=function(t){this.bU(),this.oZ.resKZ(),this.oO.key=t,this.eU()},O.prototype.toString=O.prototype.getKey=function(){return d(this.GetKey()||this.GetCaption()||this.GetIndex())},O.prototype.GetVisible=function(){return this.oO.visible},O.prototype.SetVisible=function(t){this.bU(),this.oO.visible=t,this.eU(!0)},O.prototype.isVisible=O.prototype.getVisible=function(){return u(this.GetVisible())||this.GetVisible()},O.prototype.GetShape=function(){return this.oO.shape},O.prototype.SetShape=function(t){this.bU(),this.oO.shape=p.S.A2S(t),this.eU()},O.prototype.getShape=function(){var t=this.GetShape();return t&&t.normal||t},O.prototype.GetCaption=function(){return this.oO.caption},O.prototype.SetCaption=function(t){this.bU(),this.oO.caption=t,this.eU()},O.prototype.getCaption=function(){return d(this.GetCaption())},O.prototype.GetStart=function(){return this.oO.start},O.prototype.SetStart=function(t){this.bU(),this.oO.start=t,this.onSE(),this.eU(!0)},O.prototype.getStart=function(){return new Date(this.se().s)},O.prototype.GetEnd=function(){return this.oO.end},O.prototype.SetEnd=function(t){this.bU(),this.oO.end=t,this.onSE(),this.eU(!0)},O.prototype.getEnd=function(){return new Date(this.se().e)},O.prototype.GetTime=function(){return this.oO.time},O.prototype.SetTime=function(t){this.oO.time=t,this.sse(t,t,!0)},O.prototype.getTime=O.prototype.getStart,O.prototype.onSE=function(){this.oSE=null},O.prototype.se=function(){return this.oSE||(this.oSE=function(){var t=Date.Create(this.GetStart()).getTime(),e=Date.Create(this.GetEnd()).getTime();return{s:y(t,e),e:g(t,e)}}.call(this))},O.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)},O.prototype.GetGroupID=function(){return this.oO.groupID},O.prototype.SetGroupID=function(t){this.bU(),this.oO.groupID=t,this.eU(!0)},O.prototype.getGroupID=O.prototype.GetGroupID,O.prototype.g2=function(){return this.gS().oG.Item(this.getGroupID())},O.prototype.GetRepetitive=function(){return this.oO.repetitive},O.prototype.SetRepetitive=function(t){this.bU(),this.oO.repetitive=t,this.oRx=void 0,this.eU(!0)},O.prototype.getRepetitive=O.prototype.gRx=function(){return void 0===this.oRx&&((this.oRx=new R(this.GetRepetitive())).valid||(this.oRx=null)),this.oRx},O.prototype.isRepetitive=function(){return!!this.gRx()},O.prototype.getRepetitiveExpression=function(){return d(this.isRepetitive()&&this.GetRepetitive()||"")},O.prototype.Nse=function(t,e,o){function i(t,e,i){return!(i<=F.Time.ToDTN(t,o.s)||e>=F.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(C(t)),a=C(e),u=r.s-C(r.s),l=r.e-C(r.e),c=y(u,l),p=g(u,l);(v=h.getTime())<=a;h.NextDay())s.eval(h)&&(f=i(v,v+c,v+p))&&n.push(f)}else if(!(r.e<=t||r.s>=e)){t=g(t,r.s),e=y(e,r.e),n=[];for(var f,S,d=C(t),a=C(e),v=d;v<=a;v=S,t=v)(f=i(v,t,y(e,S=v+_)))&&n.push(f)}return n},O.prototype.Nse2=function(t){var e=this.se();return!(e.e<=t.s||e.s>=t.e)},O.prototype.GetEventShape=function(){return this.oO.eventShape},O.prototype.SetEventShape=function(t){this.bU(),this.oO.eventShape=p.S.A2S(t),this.eU(!0)},O.prototype.getEventShape=function(){var t=this.GetEventShape();return t&&t.normal||t},O.prototype.GetTimeScaleShape=function(){return this.oO.timeScaleShape},O.prototype.SetTimeScaleShape=function(t){this.bU(),this.oO.timeScaleShape=p.S.A2S(t),this.eU()},O.prototype.getTimeScaleShape=function(){var t=this.GetTimeScaleShape();return t&&t.normal||t};var et={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};U.prototype.init=function(t){this.oT=t,this.rgE=new p.Arr,this.rgE.onRemove=t.onDelEvent.bind(t),this.import()},U.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)},U.prototype.onLE=function(){this.oT.onLE()},U.prototype.resKE=function(){this.mKE=null},U.prototype.resRE=function(){this.rgRE=null},U.prototype.gRE=function(){return this.rgRE||(this.rgRE=function(){var t=new p.Arr;return this.forEach(function(e){e.isRepetitive()&&t.add(e)}),t}.call(this))},U.prototype.Add=function(t){this.bU(),this.resKE();var e=arguments,o=this.add(new p.Schedule.Event(this,2==e.length?{start:e[0],end:e[1]}:t));return a(t)&&a(t.selected)&&o.SetSelected(t.selected),this.oT.onAddEvent(o),this.eU(),o},U.prototype.GetCount=function(){return this.rgE.len()},U.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgE.at(t)||null:r(t)?e=this.rgE.has(t)?t:null:u(e=function(t){var e=t.mKE;return u(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},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.resKE(),this.resRE(),this.rgE.removeRange(t=this.toA(t)),this.eU(),t.length},U.prototype.Clear=function(){this.bU(),this.oT.resSel(),this.resKE(),this.resRE(),this.rgE.clear(),this.eU()},U.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(a(t)){i=[i],t=g(0,p.ToI(t,1)-1);for(var n=0;n=F.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(C(t)),a=C(e),u=r.s-C(r.s),l=r.e-C(r.e),c=y(u,l),p=g(u,l);(v=h.getTime())<=a;h.NextDay())s.eval(h)&&(f=i(v,v+c,v+p))&&n.push(f)}else if(!(r.e<=t||r.s>=e)){t=g(t,r.s),e=y(e,r.e),n=[];for(var f,S,d=C(t),a=C(e),v=d;v<=a;v=S,t=v)(f=i(v,t,y(e,S=v+_)))&&n.push(f)}return n},L.prototype.GetMovable=function(){return this.oO.movable},L.prototype.SetMovable=function(t){this.bU(),this.oO.movable=t,this.eU()},L.prototype.isMovable=L.prototype.getMovable=function(){return this.isSelectable()&&p.ToB(this.GetMovable(),!0)},L.prototype.GetResizable=function(){return this.oO.resizable},L.prototype.SetResizable=function(t){this.bU(),this.oO.resizable=t,this.eU()},L.prototype.isResizable=L.prototype.getResizable=function(){var t=0;return this.isSelectable()&&(t=u(t=this.GetResizable())||!0===t?3:t?l(this.GetResizable(),p.Schedule.EventResizableEnum):0),t},L.prototype.GetAllDay=function(){return this.oO.allDay},L.prototype.SetAllDay=function(t){this.bU(),this.oO.allDay=t,this.onSE(),this.eU(!0)},L.prototype.isAllDay=L.prototype.getAllDay=function(){return p.ToB(this.GetAllDay())},L.prototype.isHADE=function(){return this.isAllDay()&&this.dSV().sAD()?1:0},L.prototype.gHADL=function(){var t=this.dSV().gLE().aADE(),e=t&&t.oA2.mEL;return p.ToI(e&&e.get(this),-1)},L.prototype.GetUserData=function(){return this.oO.userData},L.prototype.SetUserData=function(t){this.bU(),this.oO.userData=t,this.xKP(),this.eU()},L.prototype.getUserData=function(){return this.GetUserData()},L.prototype.type=function(){return this.isRepetitive()?2:1},L.prototype.getDisplayMargins=function(t,e){var o,i=this.se(),n=C(i.s),r=C(i.e),s=this.dSV().misc("eventDisplayMarginsSep"),h=p.H.DateNoHTML;return this.isAllDay()?(o=h(t,new Date(n)),r-n>_&&(o+=s+h(t,new Date(r-_)))):(n!=r&&(e=t+" "+e),o=h(e,new Date(i.s))+s+h(e,new Date(i.e))),o},L.prototype.getDisplayShortMargins=function(){var t=this.dSV();return this.getDisplayMargins(t.getShortDateFormat(),t.getShortTimeFormat())},L.prototype.getDisplayLongMargins=function(){var t=this.dSV();return this.getDisplayMargins(t.getLongDateFormat(),t.getLongTimeFormat())},L.prototype.getStartDate=function(){return new Date(C(this.se().s))},L.prototype.getStartTime=function(){var t=this.se().s;return(t-C(t))/_},L.prototype.getEndDate=function(){return new Date(C(this.se().e))},L.prototype.getEndTime=function(){var t=this.se().e;return(t-C(t))/_},L.prototype.getGroupLabel=function(){var t=this.g2();return t&&t.getCaption()||""},L.prototype.getGroupTitle=function(){var t=this.g2();return t&&t.getTitle()||""},L.prototype.GetKnownProperty=function(t){var e,o;return this.mKP=this.mKP||new Map,e=this.mKP.get(t),u(e)&&(o=K.get(t))&&this.mKP.set(t,e=this[o].call(this)),e},L.prototype.SetKnownProperty=function(t,e){var o=K.set(t);o in this&&this[o].call(this,e)},K=new b("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)"),L.prototype.toFormat=function(t){return this.GetKnownProperty(t)},L.prototype.xKP=function(){this.mKP=null},L.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=p.URts(n.e2Rs(this)))&&n.EnsureVisibleClient(t)},L.prototype.genID=function(){var t=this.GetKey();return u(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},L.prototype.coO=function(){var t,e=p.Cpy(this.oO);return e.start=this.getStart().toFormat(),e.end=this.getEnd().toFormat(),"groupID"in e&&(e.groupID=(t=this.g2())&&t.GetID()||q),e},f&&(L.prototype.scUR=function(t){t.o=this.oE,t.i=this.genID()},L.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()}}},L.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())})},L.prototype.uUR=function(t,e,o){this.scUR(t,!0),(t.d=f.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())})},L.prototype.StartUpdateEvent=function(){return this.oE.oT.gUR()&&this.coO()},L.prototype.EndUpdateEvent=function(t){t&&this.oE.oT.nUR(c.UpdateEvent,function(e){this.uUR(e,t,this.coO())},this)},L.prototype.UpdateEvent=function(t,e){if(i(t)){var o=this.StartUpdateEvent();t.call(e||this),this.EndUpdateEvent(o)}});var ot={caption:null,title:null,visible:null,id:null,headerShape:null,eventShape:null,position:null,width:null};V.prototype.init=function(t){this.oT=t,this.rgG=new p.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()},V.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)},V.prototype.onL=function(){this.oT.onLE(),this.oT.onLZ()},V.prototype.resKI=function(){this.mKI=null},V.prototype.Add=function(t){this.bU(),this.resKI();var e=this.add(new p.Schedule.Group(this,S(t)?t:{id:t}));return this.oT.onAddGroup(e),this.eU(),e},V.prototype.GetCount=function(){return this.rgG.len()},V.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgG.at(t)||null:!function(t){return t instanceof p.Schedule.Group}(t)?u(e=this.gKI().get(t))&&(e=this.rgG.at(t)||null):e=this.rgG.has(t)?t:null,e},V.prototype.Remove=function(t){this.RemoveRange(this.Item(t))},V.prototype.toA=function(e){return t.call(this,e)},V.prototype.RemoveRange=function(t){return this.bU(),this.resKI(),this.rgG.removeRange(t=this.toA(t)),this.eU(),t.len()},V.prototype.Clear=function(){this.bU(),this.resKI(),this.rgG.clear(),this.eU()},V.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))},V.prototype.resVG=function(){this.feSV("resGW"),this.rgVG=null},V.prototype.gVG=function(){return this.rgVG||(this.rgVG=function(){var t=new p.Arr;return this.forEach(function(e){e.isVisible()&&t.push(e)}),t}.call(this))},V.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?",":"")+d(e.getWidth())}),t}())&&t.Add("width",e),(e=function(){var t="";return o&&o.forEachI(function(e,o){t+=(o?",":"")+d(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+(X+=X>>2)%16&&o(t)}),this.gE2L().forEach(function(o){c(o)&&function(o){var i,h,l,c=o.Nse(t,e,u),p=q;c&&(a&&!a.has(p=o.g2())||(r&&o.isAllDay()?(c.forEach(function(t){i=C(t.s),!(l=r.get(i))&&r.set(i,l=[]),l.push(o)}),s.set(o,c)):c.forEach(function(t){i=C(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)}),f+=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){f+=t.length}),this.c=f},M.prototype.gE2L=function(){return this.oT.oE},M.prototype.hasE=function(t){return t=C(h(t)),function(t){var e,o;tthis.e&&(e=this.e+_,o=new Date(t).Reset(16).NextMonth().getTime()),(e||o)&&(this.add(e,o),this.s=y(this.s,e),this.e=g(this.e,o),this.oT.onLx(this.s,this.e))}.call(this,t),this.isE(t)},M.prototype.isE=function(t,e){return t=C(h(t)),1&(e=p.ToI(e,-1))&&this.mDGE.has(t)||2&e&&this.oADE&&this.oADE.mDE.has(t)},M.prototype.feEU=function(t,e,o,i){t=C(h(t)),e=p.ToI(e,-1);var n,r,s;if(!n&&1&e&&(r=this.mDGE.get(t))&&r.forEach(function(t){!n&&(n=t.forEachU(function(t){return o.call(i,t.oE)}))}),!n&&2&e&&this.oADE&&(s=this.oADE.mDE.get(t)))for(var a=0,u=s.length;!n&&a=e.e)}var i;if(e)for(var n=0,r=e.length;!i&&n1&&(n=new Map,i=new p.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+(X+=X>>2)%16&&o(t)}),this.gZ2L().forEach(function(o){a(o)&&function(o){var i,r,a=o.Nse(t,e,h),c=s?o.g2():null;a&&(!s||u(o.getGroupID())||s.has(c))&&a.forEach(function(t){i=C(t.s),(r=n.get(i,c)||[]).push({oZ:o,s:t.s,e:t.e}),l++,n.set(i,c,r)})}(o)}),this.c=l},H.prototype.gZ2L=function(){return this.oT.oZ},H.prototype.lVZ=function(t){var e,o,i=new p.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 u(t,e){if(t&&!p.EyR(e)){function o(t){return y(1,g(0,(t/_-h)/a))*c}var n,r=e[0],u=e[1],l=e[2],c=e[3],f=new p.M1;t.forEach(function(t){n=o(t.s-s),f.push(t,[r,u+n,l,g(1,o(t.e-s)-n)])}),i.add(f)}}(o=r.gCnt(t)).gs.forEach(function(t){t.t&&u(e.get(t.t.oG),t.t)}),o.T&&u(e.get(null),o.T)}},this),i},H.prototype.VZ=function(t){return this.lVZ(t.gVD())},H.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))},H.prototype.resZO=function(){this.aZO=null},H.prototype.e2R=function(t){var e=this.allZO(),o=e.z2O.get(t);return o&&1==o.length&&e.o2C.get(o[0])||null},k.prototype.init=function(t){this.doL(t)},k.prototype.doL=function(t){function e(t,e,o){l=(c=t.copy()).getTime(),E.set(e,o,l),D.set(l,[e,o]),m=g(m,e),T=g(T,o)}function o(){++R==O&&(R=0,U++)}function i(){++U==L&&(R++,U=0)}function n(t,e){t.GetMonth()!=e.GetMonth()?(M=g(U,M),(V+=O)==w&&(V=0,x+=M,~d&&x++,M=0),R=e.WeekOff(),U=0):o()}function r(){R++}function s(){U++}function h(t){t.WeekOff()+1==A?(R++,U=0):U++}function a(){return 2==d?s:4==d?h:1==d||3==d?r:C?G?function(t,e){t.GetMonth()!=e.GetMonth()?((x+=L)==b&&(V+=O,x=0),R=e.WeekOff(),U=0):o()}:n:G?function(t,e){t.GetMonth()!=e.GetMonth()?((x+=L)==b&&(V+=O,x=0),R=0,U=e.WeekOff()):i()}:function(t,e){t.GetMonth()!=e.GetMonth()?((V+=O)==w&&(V=0,x+=L),R=0,U=e.WeekOff()):i()}}var u,l,c,f,y,S,d=t.oSV.getShowViewCompact(),v=t.oC,E=new p.M2,D=new Map,m=0,T=0,C=1,G=0,w=1,b=12,R=0,A=p.days,O=A,U=0,L=6,V=0,x=0,M=0;for(this.oT=t,this.sy={y:Date.Today().GetYear()},v&&(this.sy=v.gSY(),C=v.getMode(),G=v.getFlow(),w=v.gLyt().table.h,b=v.gLyt().table.v,v.pushLoc()),C&&d<0&&(w=b=1),this.sy.f=(u=Date.Create(this.sy.y)).copy(),this.sy.t=(f=this.sy.d?this.sy.d:Date.Create(this.sy.y,12,31)).copy(),v&&(d<=0?(R=u.WeekOff(),C||(S=R,R=U,U=S,S=O,O=L,L=S,d<0&&O--)):4==d&&(U=u.WeekOff())),w*=O,b*=L,y=a(),this.s=u.copy();u.Compare(f)<=0;)e(u,V+R,x+U),y(c,u.NextDay());this.e=u.copy(),this.mXYD=E,this.mDXY=D,this.h=m+1,this.v=T+1,v&&v.popLoc()},k.prototype.rdayS=function(){return this.oT.oSV.rdayS()},k.prototype.range=function(){var t=this.rdayS();return[this.h*t[0],this.v*t[1]]},k.prototype.scroll=function(t){function e(t){return~~t}function o(t,o){return t-o*e(t/o)}for(var i=[],n=new p.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],f=t[1],g=e(f/c),y=e((f+t[3])/c),S=-o(f,c),d=g;d<=y;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},k.prototype.d2R=function(t){var e,o,i,n=this.rdayS(),r=n[0],s=n[1];return t&&(t.forEach?t:[t]).forEach(function(t){(i=this.mDXY.get(C(h(t))))&&(e=[i[0]*r,i[1]*s,r,s],o=o?p.URt(o,e):e)},this),o},k.prototype.d2HV=function(t){var e,o,i;return t&&(t.forEach?t:[t]).forEach(function(t){(i=this.mDXY.get(C(h(t))))&&(e?(e[0]=y(e[0],i[0]),e[1]=y(e[1],i[1])):e=i.slice(),o?(o[0]=g(o[0],i[0]),o[1]=g(o[1],i[1])):o=i.slice())},this),e&&o&&[o[0]-e[0]+1,o[1]-e[1]+1]},k.prototype.d2I=function(t){var e=this.mDXY.get(C(h(t)));return e?e[0]+this.h*e[1]:-1},I.prototype.init=function(){this.mC=new Map},I.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 I},P.prototype.Fit=function(t,e,o,i){var n,r,s,h="",a=function(t){var e=this.mC.get(t=d(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=p.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},Z.prototype.reqS=function(){var t=0;return this.C&&(this.isV(0)||(t|=1)),this.isV(this.i+this.M-1)||(t|=2),t},Z.prototype.scroll=function(t){var e=this.oSV,o=this.i,i=g(0,y(o+t||0,this.M-this.C)),n=!1;return(n=o!=i)&&e.Smooth(function(){this.i=i,e.onLE()},this),n},Z.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(z.prototype,p.M1.prototype),z.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(p.ROf(n.r)-p.LOf(t))<1?(n.r=p.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()})}},F.prototype.xA=function(){p.A.Cancel("ss*"),p.A.Cancel(this.sEvcA)},F.prototype.ondown=function(t){return this.isSelectable()&&(this.xA(),this.gAA().Do(this,t),!p.RUR.Rng()&&this.doRUR(t,function(t){switch(t.drag.status){case 4:case 5:this.rurActionClick(null,t)}},this)),!0},F.toClick=function(t){return{uiEvent:t,dblClick:t.drag&&(t.drag.long||1!=t.drag.click)||!1,button:p.e2B(t),modifiers:p.ModK(t)}},F.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)},F.prototype.onClick=function(t){var e=F.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)},F.prototype.onclick=function(t){this.oLts.onclick.do(t)},F.prototype.onA=function(t,e){t&&(p.H.VisitA(this,t),this.inv(),this.onanchorclick(t))},F.prototype.onanchorclick=function(t){this.oLts.onanchorclick.do(t)},F.prototype.onDblClickGR=function(t){if(t)return this.Smooth(function(){this.gVG().forEach(function(t){t.SetWidth()})}),!0},F.prototype.onClickADS=function(t){return t&&(this.slADS(t),this.gADL().scroll(1==t.s?-1:1)),a(this.olADS)},F.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))},F.prototype.sDG=function(t){this.oDG=t},F.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()&&(p.Menu&&function(){var i=o.GetViewRect(),s=o.GetClientRect(),h=i[0]-s[0],a=i[1]-s[1],u=p.NRt(i,p.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?p.ROf(u):i[0]+s[0]+o.unscaled(p.ROf(t.HGB)),y:u?p.BOf(u):i[1]+s[1]+o.unscaled(p.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(","));a(s)&&(i.cwbU(),e(),(s=s.trim())&&s&&s.split(",").forEach(function(e){(t=n.Item(e))&&t.SetVisible(!0)}),i.cweU())}()),!0},F.prototype.onDblClk=function(t){},F.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:j.X(e)-i[0],y:j.Y(e)-i[1],r:o.GetClientRect()}},F.prototype.doRUR=function(t,e,o,i){var n,r,s=this.gAA();return p.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(p.GP.Get("long",this.getCursors())),f&&(n=this.oT.gUR())&&n.sB();break;case 5:this.norurAction(t,2);break;case 3:s.CanDo(t,1)&&(p.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)},F.prototype.bRUR=function(t){return this.gAA().Has("zoom")&&this.exZ(t),t.drag.extra},F.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))},F.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);g(s,h)-y(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)}},F.prototype.onRurScrollD=function(t){var e=this.oT.oRUR;e&&e.c!=this&&e.c.onRurScrollD&&e.c.onRurScrollD.call(e.c,t)},F.prototype.rurScrollD=function(t,e,o){var i,n=a(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)})},F.prototype.rurDrag=function(t,e){function o(t){return!e||u(e.rurAllow)||t==(e.rurAllow&t)}function i(){h.frame=j.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(),y=[{oSV:this,oH:this.GetSI(!0),oV:this.GetSI(!1)}],S=this,d=0,v=0;this.feSV(function(t){t!=this&&y.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:j.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=p.EF.Create(n)}break;case 7:var u=t.drag.cancel?this.oT:this,E=this.oT.oRUR;E&&(E.ao=null),u.bU(),t.drag.cancel?(E&&(E.cancel=!0),this.Smooth(function(){y.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()&&u.onLE(),this.rAO(),u.eU(),p.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),!p.EyR(f)&&function(t){return!0}.call(this,t)){var T=t.drag.current.x,C=t.drag.current.y,G=o(1)&&T-p.LOf(f)||0;G>0&&(G=g(0,T-p.ROf(f)));var w=o(2)&&C-p.TOf(f)||0;w>0&&(w=g(0,C-p.BOf(f))),(D=G||w)&&this.rurScrollD(G,w)}(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})}},F.prototype.onRURDragStart=function(t,e){},F.prototype.onRURDragEnd=function(t,e){},F.prototype.rtSelAbs=function(t){var e=j.Rect(t.from,t.to);if(!p.EyR(e)){var o=this.gLE(),i=this.ar2E(e);i&&i.length&&i.forEach(function(t){e=p.URt(e,o.e2R(t))})}return e},F.prototype.rurAO=function(t){return this.rurE(t)||{}},F.prototype.rurE=function(t){return this.e2E(t)},F.prototype.allowRur=function(t,e){var o=a(t);if(o)switch(e.rurName){case"scroll":o=function(t){return p.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},F.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"+p.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=p.Def.HT.inflate[0]),p.PInR(a,u,[i[0],i[1],n?i[2]/2:0,i[3]],s)?r=e.prev(o.oG):p.PInR(a,u,[p.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},F.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})},F.prototype.t2Y=function(t){t=h(t);var e,o,i,n,r,s=this.gLDV().d2R(t);if(s&&(r=this.gCnt(s))&&(s=r.T))return e=this.gDSE(),o=e.s,i=e.e-o,n=s[3],s[1]+=function(t){return y(1,g(0,(t/_-o)/i))*n}(this.toDSE(t)%_),s[3]=0,this.rtCA(s,!1)},F.prototype.p2CE=function(t){if(this.aCE()){var e=this.htD(t);return e&&(e.tCE||e.aCE)&&this.p2T(t)}},F.prototype.p2HT=function(t){if(this.isSelectable()&&!this.isReadOnly()){var e=this.p2C(t);return this.gVE().p2HT(j.X(e),j.Y(e),null,null,p.Def.HT.inflate[0],p.Def.HT.inflate[1])}},F.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}},F.prototype.p2DH=function(t){var e=this.htD(t);return e&&e.H&&e.dN},F.prototype.p2GB=function(t){var e=this.htD(t);return e&&e.HGB&&e.dN},F.prototype.p2DT=function(t){var e=this.htD(t);return e&&e.T&&e.tN},F.prototype.rurOnlyAO=function(){var t=this.oT.oRUR;return t&&t.w==this.oW&&t.ao||null},F.prototype.onSetAO=function(t){function e(e){var o;e.isSelectable()&&(o=a.toShapes(e))&&(!p.EyO(o.hover)&&t.set({owner:a,id:e.idAOH||(e.idAOH={}),inv:a.inv,hitTest:function(t,o){return a.isAP(t,o)&&e==a.p2E([t,o])},duration:l}),!p.EyO(o.click)&&t.set({owner:a,id:e.idAOC||(e.idAOC={}),inv:a.inv,hitTest:function(t,o){return a.isAP(t,o)&&e==a.p2E([t,o])},actOn:u==e?1:4,duration:l}))}var o,i,n,s,h,t=this.gAO();if(this.isSelectable()&&!t.hasOf(this)){var a=this,u=this.rurOnlyAO(),l=a.getSmooth();r(u)?e(u):(this.sAD()&&(i=a.toShapes("date-all-day-scroll-button"))&&(h=this.gVADS())&&h.forEach(function(e,o){!function(e){!p.EyO(i.hover)&&t.set({owner:a,id:m(e),inv:a.inv,hitTest:function(t,o){return a.isAP(t,o)&&e==a.p2ADS([t,o])},duration:l}),!p.EyO(i.click)&&t.set({owner:a,id:T(e),inv:a.inv,hitTest:function(t,o){return a.isAP(t,o)&&e==a.p2ADS([t,o])},actOn:4,duration:l})}(o)}),this.dGB()&&(o=a.toShapes("grouping-button"))&&(s=this.gVD())&&s.forEach(function(e,i){!function(e){!p.EyO(o.hover)&&t.set({owner:a,id:E(e),inv:a.inv,hitTest:function(t,o){return a.isAP(t,o)&&e==a.p2GB([t,o])},duration:l}),!p.EyO(o.click)&&t.set({owner:a,id:D(e),inv:a.inv,hitTest:function(t,o){return a.isAP(t,o)&&e==a.p2GB([t,o])},actOn:4,duration:l})}(i)}),(n=this.gVE())&&n.forEach(function(t,o){e(o.oE)}),t.rur(this,v("*")))}},F.prototype.hasE=function(t){return this.gLE().hasE(t)},F.prototype.onLE=function(){this.onLZ(),this.feSV(function(t){t.onDV(),t.resVE()})},F.prototype.resVE=function(){this.rgVE=null,this.resVADS(),this.resAO()},F.prototype.resVD=function(){this.rgVD=null,this.resVADS()},F.prototype.resVZ=function(){this.rgVZ=null},F.prototype.resA=function(){this.resVD(),this.resVE(),this.resVZ()},F.prototype.onLD=function(){this.oALE.XC(),this.resA()},F.prototype.onLZ=function(){this.feSV(function(t){t.resVZ()})},F.prototype.bU=function(){this.lI++},F.prototype.eU=function(){--this.lI||this.invAO()},F.prototype.wAO=function(){return this._wAO||(this._wAO=[this.oTS])},F.prototype.rAO=function(){this.bU(),this.eU()},F.prototype.onimg=function(){return this.cwbU(),this.cweU(),!0},F.prototype.islow=function(){return this.getScale()<.5},F.prototype.Smooth=function(t,e,o){function n(t){o.cbkI&&o.cbkI.call(e,t)}function s(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),d(i.GetIndex())+"-"+r}var n=[new Map,new Map],s=new p.M1,h=new p.M1;return e.forEach(function(t,e){h.set(i(e,0),e)}),t.forEach(function(t,e){s.set(e=h.get(i(e,1))||e,t)}),t=s,{from:t,to:e,stkFT:t.smooth(e,function(t,e){return e&&r(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=f.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==y&&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-j.X(e.pt)-i,o.y-j.Y(e.pt)-n),this.onRurScrollD({dx:-i,dy:-n}),this.onUI(),this.cweU()},F.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(),u=r.odayS(),l=r.rdayS(),c=l;n.doRUR(t,function(t){switch(t.drag.status){case 1:break;case 7:t.drag.cancel&&this.Smooth(function(){r.sdayS(u),n.updSPR(),n.SetScroll(a)});break;case 2:n.Smoothless(function(){function u(t){return n.scaled(t-h[0])}function p(t){return n.scaled(t-h[1])}c=n.adayS([g(0,l[0]+t.drag.offset.dx),g(0,l[1]+t.drag.offset.dy)]),o={dx:c[0]-l[0],dy:c[1]-l[1]},i={dx:(a.x+u(t.drag.start.x))*c[0]/l[0]-u(t.drag.current.x)-a.x,dy:(a.y+p(t.drag.start.y))*c[1]/l[1]-p(t.drag.current.y)-a.y},s&&s.onRurDayResizeD&&s.onRurDayResizeD.call(s,o,i,e),r.sdayS([l[0]+o.dx,l[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)}},F.prototype.onRurDayResizeD=function(t,e,o){},F.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(),u=r.odayS(),l=r.rdayS(),c=l;n.doRUR(t,function(t){switch(t.drag.status){case 1:break;case 7:t.drag.cancel&&this.Smooth(function(){r.sdayS(u),n.updSPR(),n.SetScroll(a)});break;case 2:n.Smoothless(function(){function u(t){return n.scaled(t-h[0])}function p(t){return n.scaled(t-h[1])}c=n.adayS([g(0,l[0]+t.drag.offset.dx),g(0,l[1]+t.drag.offset.dy)]),o={dx:c[0]-l[0],dy:c[1]-l[1]},i={dx:(a.x+u(t.drag.start.x))*c[0]/l[0]-u(t.drag.current.x)-a.x,dy:(a.y+p(t.drag.start.y))*c[1]/l[1]-p(t.drag.current.y)-a.y},s&&s.onRurDayResizeD&&s.onRurDayResizeD.call(s,o,i,e),r.sdayS([l[0]+o.dx,l[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)}},F.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 p.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?-y(-s,i.w):y(s,i.Mdx))&&h.Smoothless(function(){o("w"),a.SetWidth(g(0,i.w+s));for(var t=n;s&&t;)t.SetWidth(g(0,r.get(t).w-s)),t.GetWidth()?s=0:(s-=r.get(t).w,t=r.rgO.next(t))})},h.rurDrag(t,e))}},F.prototype.rurGroupDrag=function(t,e){function o(t,e,o){(!s||!s.GetVisible()||!(e.oG==f&&o.getTime()==g))&&r.apply(this,arguments)}function i(t){var e,o,i=u.htD(u.gPtr(t));return i&&i.dN==g&&i.g&&(o=f.GetPosition()-(e=i.oG.GetPosition()))&&{p:e,g:u.rtDropOf(p.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(),f=l&&l.g&&l.oG,g=l&&l.dN;f&&(e.rurDragStart=function(){r=u.drawDG,u.drawDG=o,n=u.rt2C(l.g),s=p.EF.Create({name:"group",visible:!1,client:n,relative:u.GetCanvas(),onpaint:function(t,e){u.ctxScale(t,e,function(e){e.oG=f,r.call(u,t,e,g)},u)},thisArg:u}),h=p.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){p.EF.Destroy(h),p.EF.Destroy(s),u.drawDG=r,u.invAO(),!t.event.drag.cancel&&(a=i(t.event))&&u.Smooth(function(){f.SetPosition(a.p),u.onChange("group",f)})},e.rurDrag=function(t){a=i(t.event),h.SetVisible(a),h.GetVisible()&&h.SetClient(a.g),s.SetClient(p.ORt(n.slice(),t.event.drag.offset.dx,t.event.drag.offset.dy)),s.GetVisible()||(s.SetVisible(!0),u.invAO())},u.rurDrag(t,e))}},F.prototype.cbkEFPaint=function(t){var e=this.toShapes(t);return e&&function(t,o,i,n){o.drawShape(i,e.normal||e)}},F.prototype.fitEFPaint=function(){return this.cbkEFPaint("frameFit")},F.prototype.selEFPaint=function(){return this.cbkEFPaint("frameSel")},F.prototype.rurFit=function(t,e){e.rurOnlyAO={},e.rurEFPaint=this.fitEFPaint(),e.rurDrop=function(t){this.FitToClient(this.rtSelAbs(t))},this.rurDrag(t,e)},F.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(j.Rect(t.from,t.to)),{selChange:!1})&&((this.isToggleSel()||this.isToggleCtrlSel()&&2&p.ModK(t.event))&&(this.oT.rgSel=new p.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)}}},F.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},F.prototype.rurCreate=F.prototype.rurMove=function(t,e){function o(t,e,o){var i=e.s,n=g(e.s,e.e-(o||0)*_);U&&h(t.GetStart())==i&&h(t.GetEnd())==n||t.sse(i,n),U=!0}function i(t,e){function i(i,n){o(i,function(t,e,o){var i={s:e.s,e:e.e};return 1==o?(i.s+=t.dtN,i.s=y(i.s,e.e-rt)):2==o&&(i.e+=t.dtN,i.e=g(i.e,e.s+rt)),i}(t,n,I.r),i.isHADE()),e&&this.onRURChange("resize",i,Z.get(i))}t&&(e?Z.forEach(function(t,e){i.call(this,e,e.se())},this):N&&i.call(this,N.oE,N))}function n(t){var e=this.p2T(this.gPtr(t));return e&&(ht||!x&&!M||(e.tN=C(j.tN)+e.tN%_),m={dtN:function(t,e){return(z&&z.isAllDay()?C(t)-C(e):t-e)||0}(e.tN,j.tN),oG:e.oG,aD:e.aD}),m}function r(t,e,o){var i,n=this.gVE,r=c.call(this),s=this.isSelectable()&&t.gAO()||null;P&&this.gVE().forEach(function(t,e){e.oE==P&&(i=i||new p.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 s(t,e,o,i){function n(e){r=t.globalAlpha,t.globalAlpha=e}var r,s=o.oE==z,h=o.oE==P;(a(J)&&Q?h||s:!h)?a($)&&s&&n($):n(J),b.apply(this,arguments),a(r)&&(t.globalAlpha=r),et&&o.oE==z&&p.Schedule.sCTX(t,et,e,o)}function u(t){return G.call(this,t==z?P:t)}function l(){var t=arguments;E.call(this,function(){w.apply(this,t)})}function c(t){var e,o,i=new p.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(z),o=new W(this.oT,i),n&&z.isAllDay()){var r,s=this.gADL(),h=o.aADE(),a=h&&h.oA2.mEL;a&&(a.set(z,r=y(a.get(z),s.i+s.C-.001)),s.ensure(r))}return o.VE(this)}function f(){}function S(t){var e=A.apply(this,arguments);return t==z&&(e=tt),e}function d(t){var e=O.apply(this,arguments);return t==z&&(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,m,T,G,w,b,R,A,O,U,V,x,M,H,k,I,P,Z,z,N,B,K,X=e.rurName,Y=this.gPtr(t),j=this.p2T(Y),q=function(t,e){if(t&&z)if(e){var i=z.GetOptions(),n=this.oE.Add({start:i.start,end:i.end,groupID:i.groupID,allDay:i.allDay});nt&H&&this.EnsureVisibleClient(n),this.onRURChange("create",n)}else o(z,{s:j.tN+y(0,t.dtN),e:j.tN+g(rt,t.dtN)})},J=this.misc("dragAlpha",!0),Q=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=p.IsS(t)?_*F.Time.ToN(t):t<0?-~~t:p.ToN(t)*_*this.gDSE().m}.call(this),st=this.sGE()&&this.getAllowMoveEventToOtherGroup(),ht=this.getAllowMultiDaysEvent();j&&(x=this.p2CE(Y)||"create"==X,P=(M=(I=this.p2ER(Y))&&I.oE)||!x&&(k=this.p2HT(Y))&&k.o.oE||null,H=x?1:M?2:4,x||(Z=this.getDragEv(P,!0,M),tt=this.misc("formatUpdateEventLabel")),(x&&this.aCE()||Z&&Z.size&&this.aME())&&(x||(q=M?i:function(t,e){function i(i,n){o(i,function(t,e){return{s:e.s+t.dtN,e:e.e+t.dtN}}(t,n),i.isHADE()),st&&(!t.oG||e&&j.oG==t.oG||i.SetGroupID(t.oG.getID())),i.isAllDay()!=t.aD&&(i.SetAllDay(t.aD),e&&o(i,i.se(),i.isAllDay()?2:-1)),e&&this.onRURChange("move",i,Z.get(i))}t&&(e?Z.forEach(function(t,e){i.call(this,e,e.se())},this):N&&i.call(this,N.oE,N))}),e.rurDragEnd=function(t){!ot&&v.call(this,!1),T&&(this.oT.onLE=T),w&&(this.rurScrollD=w),G&&(this.isSelected=G),R&&(this.draw=R),b&&(this.drawE=b),A&&(this.fEsl=A),O&&(this.fEll=O),!t.event.drag.cancel&&(x||D)&&z&&this[x?"Smoothless":"Smooth"](function(){q.call(this,n.call(this,t.event),!0),P&&nt&H&&this.EnsureVisibleClient(P)})},ot||(e.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")||(e.rurAllow=0),e.rurDrag=function(t){var e=2==t.event.drag.status;D=D||e,it&H&&!e||(!z&&function(t){if(!z){z=new L(this.oT.oE,P&&P.GetOptions()||{start:new Date(j.tN),end:new Date(j.tN+rt),groupID:j.oG?j.oG.getID():this.oT.oG.cID(),allDay:j.aD});var e=x?this.getCreateEventLabel():this.getUpdateEventsLabel();a(e)&&(z.SetShortLabel(e),z.SetLongLabel(e)),(N=z.se()).oE=z,x||(G=this.isSelected,this.isSelected=u),b=this.drawE,this.drawE=s,A=this.fEsl,this.fEsl=S,O=this.fEll,this.fEll=d,ot?(T=this.oT.onLE,this.oT.onLE=f,R=this.draw,this.draw=r):(w=this.rurScrollD,this.rurScrollD=l),x&&(B=p.GP.Get("create",this.getCursors()))&&t.event.drag.setCursor(B),this.oT.oRUR.ao=z,!ot&&v.call(this,!0)}}.call(this,t),q.call(this,n.call(this,t.event)),e&&(V||(V=!0,E.call(this,function(){this.rAO()})),ot||(t.frame=function(){K=c.call(this,!0);var t=p.C2R(K.union()),e=t[0],o=t[1],i=this.rtCA(this.rt2C(t),!0);return K.forEach(function(t){p.ORt(t,-e,-o)}),i}.call(this))))},this.rurDrag(t,e)))},F.prototype.onRURChange=function(t,e,o){o&&this.oT.onMoveEvent(e,o),this.onChange(t,e)},F.prototype.rurDragDrop=function(t,e){var o,i=[],n=this.ap2E(this.ptCA(this.gPtr(t)),i);this.isSable(n)&&p.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(p.GP.Get(e.rurName,this.getCursors()))}})},F.prototype.getChange=function(t,e){return{object:e,action:t}},F.prototype.onChange=function(t,e){this.onchange(this.getChange(t,e))},F.prototype.onchange=function(t){this.oLts.onchange.do(t)},F.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=a(t),n=a(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))&&(p.A.Cancel("soom"),p.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"}))}},F.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])},F.prototype.FitToClient=function(t){if(t=t||this.gLE().rtAll(),!p.EyR(t)){var e=this.GetClientRect(),o=y(e[2]/t[2],e[3]/t[3]);this.sdayS(this.rdayS()),this.Soom(100*o,{x:t[0],y:t[1]})}},F.prototype.ToggleDate=function(t){t=h(t);var e=this;e[e.lSh||t&&!e.oTD&&!e.sTS()?"Smoothless":"Smooth"].call(this,e.oTD?function(){e.SetScroll(e.oTD.oScr),e.sdayS(e.oTD.dayS),e.oTD=null}:t&&function(){e.oTD={oScr:e.GetScroll(),dayS:e.odayS()},e.sdayS([-1,-1]),e.EnsureVisibleDate(t)})},F.prototype.name=function(){return(this.oW||{}).name||""},F.prototype.EnsureVisibleClient=function(t,e){if(t){var o=!1,i=t;if(p.IsA(t)||(r(t)&&this.gADL().ensure(t.gHADL()),i=this.o2rt(t)),i){this.updSPR();var n,s=(e=e||{}).allowScale,h=p.ToI(e.allowScroll,3),a=e.nearestFit,u=this.GetScroll(),l=this.getScale(),c=l,f=p.ToI(e.duration,this.getSmooth()),g=function(){var t=this.GetClientRect();return this.gClp(t)||t}.call(this);if(s){var S=this.GetClientRect(),d=this.rtCA(i,!1);c=y(l*S[2]/d[2],l*S[3]/d[3]),s=cJ&&(i=this.back("eventContinueDay",!0))&&(h=function(){var t,e,o,i,n=0;return(t=this.misc("arrowSizeMultiDatesEvent"))&&(o=J,e=this.rdayS(),t.forEach||(t=[t,t]),n=(i=t[0]||0)+y((t[1]||0)-i,(y(e[0],e[1])-o)/(3*o))),n}.call(this))&&(s=this.eCD(o))&&(n=F.dArr,r=t.fillStyle,t.fillStyle=i,1&s&&(n(t,j.R2C(e,18),1,h),e[1]+=h,e[3]-=h),2&s&&(n(t,j.R2C(e,66),2,h),e[3]-=h),4&s&&(n(t,j.R2C(e,36),4,h),e[2]-=h),8&s&&(n(t,j.R2C(e,33),8,h),e[0]+=h,e[2]-=h),t.fillStyle=r),p.PRt(e,this.getPad(),-1)},F.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>F.Time.ToDTN(C(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},F.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)})},F.prototype.gVADS=function(){return void 0===this.rgVADS&&(this.rgVADS=this.sAD()?new z(this):null),this.rgVADS},F.prototype.resVADS=function(){this.rgVADS=void 0},F.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)},F.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())&&(p.EyO(r.hover)||(n=i.get(this,m(o)))&&(s=p.R.Shape(n.state,n.range,{from:s,to:r.hover})),p.EyO(r.click)||(n=i.get(this,T(o)))&&(s=p.R.Shape(n.state,n.range,{from:s,to:r.click}))):p.EyO(r.disabled)||(s=p.Inh(r.disabled,s))),s&&p.Schedule.sCTX(t,s,e,o,function(){!s.draw&&F.dArr(t,j.R2C(e),o.s,8,5)},this)},F.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)})},F.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)})},F.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),p.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)},F.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)},F.prototype.drawAD=function(t,e,o){var i=this.toShape("date-all-day-header");t.drawShape(e,i)},F.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),p.Schedule.sCTX(t,r,n,o,function(){var i,n=e.HC.slice(),r=this.GetPageSize();r.splice(0,0,0,0),(i=p.NRt(n,r))&&(n[0]=i[0],n[2]=i[2]),t.drawHTMLDate(this.oALE.Fit(this.gHDL(),p.WOf(n),o,t),o,n,5)},this),e.HGB&&this.drawGB(t,e.HGB,o)},F.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())&&(p.EyO(r.hover)||(n=i.get(this,E(o)))&&(s=p.R.Shape(n.state,n.range,{from:s,to:r.hover})),p.EyO(r.click)||(n=i.get(this,D(o)))&&(s=p.R.Shape(n.state,n.range,{from:s,to:r.click}))):p.EyO(r.disabled)||(s=p.Inh(r.disabled,s))),p.Schedule.sCTX(t,s,e,o,function(){t.drawHTMLText(this.back("groupingButtonCaption"),e,5)},this)},F.prototype.drawDG=function(t,e,o){var i=e.oG;p.Schedule.sCTX(t,this.toShape("date-grouping-header"),e,o,function(){i&&p.Schedule.sCTX(t,this.toShape(i.GetHeaderShape()),e,o,function(){t.drawHTMLText(i.getCaption(),e,this.misc("formatGroupCaption"))},this)},this)},F.prototype.drawDT=function(t,e,o){p.Schedule.sCTX(t,this.toShape("date-timeScale"),e,o,function(){this.sTS()&&this.drawmM(t,e)},this)},F.prototype.drawmM=function(t,e){var o=this.oTS.gmM();N.drawR(t,e,o.m,this.back("minorTimeRulerColor"),this.back("minorTimeRulerStyle")),N.drawR(t,e,o.M,this.back("majorTimeRulerColor"),this.back("majorTimeRulerStyle"))},F.prototype.altD=function(t){return this.gLDV().d2I(t)%2},F.prototype.dGP=function(t,e){var o=j.cArrSize.t,i=t.lineWidth,n=e[2],r=e[0]+e[2]/2;j.cArrSize.t=1.5,t.lineWidth=n/4,t.drawArr([r,e[1]],[r,e[1]+n/2]),t.drawArr([r,p.BOf(e)],[r,p.BOf(e)-n/2]),t.lineWidth=i,j.cArrSize.t=o},F.prototype.rtDropOf=function(t,e){var o=this.getPad()[1];return t&&[(e?p.LOf(t):p.ROf(t))-8,t[1]-8-o/2,16,t[3]+16+o]||null},F.prototype.resmM=function(){this.oTS.resmM()},F.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;p.Schedule.sCTX(o,h,i,r,function(){t&&t.call(e,o,i,n,r,s)},this)},F.prototype.onDV=function(){this.feSV(function(t){t.oDV=null,t.resHADx(),t.oTS.resmM()})},F.prototype.gDV=function(){var t=this.dSV();return t.oDV||(t.oDV=function(){function t(t){var e=g(0,y(r,n.toH(t)));return r-=e,e}function e(t,e){e&&(c[t]=[s,e],s+=e)}var o,i,n=this,r=n.rdayS()[1],s=0,h=0,a=0,u=0,l=0,c={};return h=t(this.getHeaderDayHeight()),r>0&&(this.sGE()&&(a=t(this.getHeaderGroupHeight())),this.sAD()&&(u=t(-this.gHADH())),(o=this.rTS())&&(l=g(0,r),a&&l+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]))},F.prototype.mGW=function(){var t=new Map;return this.gGW().forEach(function(e){t.set(e[2],[e[0],e[1]])}),t},F.prototype.gCnt=function(t,e){var o,i,n,r={F:t},s=this.gDV(),h=this.gGW(),a=this.isLH(),u=t[0],l=t[1],c=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=y(p.HOf(n),this.toH(1)))&&o+2*(i=this.getPad()[0])<%dddd%>, <%mmmm%> <%d%>, <%yyyy%><|><%dddd%>,<%mmmm%> <%d%>,<%yyyy%><|><%dddd%>, <%mmmm%> <%d%>,`<%yy%><|><%dddd%>, <%mmmm%> <%d%><|><%dddd%>, <%m3%> <%d%><|><|><%d3%>, <%m3%> <%d%><|><%d2%>, <%m3%> <%d%><|><%d1%>, <%m3%> <%d%><|><%d3%> <%d%><|><%d2%> <%d%><|><%d1%> <%d%><|><%d%>")},F.prototype.GetHeaderDayShortLabel=function(){return this.oO.headerDayShortLabel},F.prototype.SetHeaderDayShortLabel=function(t){this.cwbU(),this.oO.headerDayShortLabel=t,this.cweU()},F.prototype.getHeaderDayShortLabel=function(){return this.opt("headerDayShortLabel","<%mmmm%> <%d%><|><%m3%> <%d%><|><%d%><=>(((day(value) = 1) or (month(value+1) != month(value))) ? -1 : 2)")},F.prototype.gHDL=function(){return this.sTS()?this.getHeaderDayLongLabel():this.getHeaderDayShortLabel()},F.prototype.GetDayStartTime=function(){return this.oO.dayStartTime},F.prototype.SetDayStartTime=function(t){this.cwbU(),this.oO.dayStartTime=t,this.resDSE(),this.onLE(),this.cweU()},F.prototype.getDayStartTime=function(){return this.gDSE().s},F.prototype.GetDayEndTime=function(){return this.oO.dayEndTime},F.prototype.SetDayEndTime=function(t){this.cwbU(),this.oO.dayEndTime=t,this.resDSE(),this.onLE(),this.cweU()},F.prototype.getDayEndTime=function(){return this.gDSE().e},F.prototype.gDSE=function(){return this.oDSE||(this.oDSE=function(){var t=F.Time.ToN(this.opt("dayStartTime","08:00")),e=F.Time.ToN(this.opt("dayEndTime","16:00")),o=this.oTS.getTimeZone();return o&&(t+=o,e+=o),{s:y(t,e),e:g(t,e),m:F.Time.ToN(this.oTS.opt("minorTimeRuler","00:15")),M:F.Time.ToN(this.oTS.opt("majorTimeRuler","01:00"))}}.call(this))},F.prototype.resDSE=function(){this.oDSE=null},F.prototype.toDSE=function(t){var e=h(t),o=this.gDSE();return e=F.Time.ToDTN(C(e),g(o.s,y(o.e,(e-C(e))/_))),t&&t.setTime&&t.setTime(e),t},F.prototype.GetTimeScale=function(){return this.oTS.GetOptions()},F.prototype.SetTimeScale=function(t){this.oTS.SetOptions(t)},F.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},F.prototype.rTS=function(){return this.toH(this.misc("requireTimeScaleHeight"))},F.prototype.dTS=function(){return this.toH(this.misc("displayTimeScaleHeight"))},F.prototype.rRD=function(){return this.toH(this.misc("requireRulerDistance"))},F.prototype.SetGroups=function(t){this.oT.SetGroups(t)},F.prototype.SetEvents=function(t){this.oT.SetEvents(t)},F.prototype.GetShowGroupingEvents=function(){return this.oO.showGroupingEvents},F.prototype.SetShowGroupingEvents=function(t){this.cwbU(),this.oO.showGroupingEvents=t,this.oT.oG.resVG(),this.oT.onLE(),this.oT.onLZ(),this.cweU()},F.prototype.getShowGroupingEvents=function(){return this.opt("showGroupingEvents",!1)},F.prototype.sGE=function(){var t;return this.getShowGroupingEvents()&&(t=this.gVG())&&t.len()&&t||null},F.prototype.GetDisplayGroupingButton=function(){return this.oO.displayGroupingButton},F.prototype.SetDisplayGroupingButton=function(t){this.cwbU(),this.oO.displayGroupingButton=t,this.cweU()},F.prototype.getDisplayGroupingButton=function(){return this.opt("displayGroupingButton",!1)},F.prototype.dGB=function(){return this.sTS()&&this.getShowGroupingEvents()&&this.oT.oG.len()&&this.getDisplayGroupingButton()},F.prototype.GetHeaderGroupHeight=function(){return this.oO.headerGroupHeight},F.prototype.SetHeaderGroupHeight=function(t){this.cwbU(),this.oO.headerGroupHeight=t,this.onLE(),this.cweU()},F.prototype.getHeaderGroupHeight=function(){return this.opt("headerGroupHeight",1)},F.prototype.GetApplyGroupingColors=function(){return this.oO.applyGroupingColors},F.prototype.SetApplyGroupingColors=function(t){this.cwbU(),this.oO.applyGroupingColors=t,this.cweU()},F.prototype.getApplyGroupingColors=function(){return this.opt("applyGroupingColors",!0)},F.prototype.GetOnSelectDate=function(){return this.oO.onSelectDate},F.prototype.SetOnSelectDate=function(t){this.bU(),this.oO.onSelectDate=t,this.eU()},F.prototype.getOnSelectDate=function(){return l(this.opt("onSelectDate"),p.Schedule.OnSelectDateEnum,-1)},F.prototype.GetSelectEventStyle=function(){return this.oO.selectEventStyle},F.prototype.SetSelectEventStyle=function(t){this.bU(),this.oO.selectEventStyle=t,this.eU()},F.prototype.getSelectEventStyle=function(){return~~l(this.opt("selectEventStyle"),p.Schedule.SelectEventStyleEnum,0)},F.prototype.onSC2=function(){var t,e,o=this.getOnSelectDate(),i=this.sD(),n=this.gLDV().d2HV(i),r=this.oT.oG;if(this.sDG(i.len()?{d:i.first(),g:r.gVG().first()||r.cID()}:null),o){if(this.bU(),o<0){if(e=this.GetPageSize(),t=[-1,-1],n)for(var s=0;s<2;s++)1!=n[s]&&(t[s]=e[s]/n[s]);this.sdayS(t)}this.EnsureVisibleDate(i,void 0),this.eU()}},F.prototype.GetAllowMoveEventToOtherGroup=function(){return this.oO.allowMoveEventToOtherGroup},F.prototype.SetAllowMoveEventToOtherGroup=function(t){this.bU(),this.oO.allowMoveEventToOtherGroup=t,this.eU()},F.prototype.getAllowMoveEventToOtherGroup=function(){return this.opt("allowMoveEventToOtherGroup",!0)},F.prototype.aDDE=function(){return this.isSelectable()&&!this.isReadOnly()},F.prototype.aCE=function(){return this.gAA().Has("create")&&this.aDDE()&&this.getShowEvents()},F.prototype.aME=function(){return this.gAA().Has("move")&&this.aDDE()},F.prototype.gCEM=function(){return this.aCE()&&g(0,p.ToN(this.misc("createEventMargin")))||0},F.prototype.gEM=function(){var t=this.misc("eventMargin"),e=p.ToN(t[0],t)||0;return[e,p.ToN(t[1],e)]},F.prototype.GetDefaultEventToolTip=function(){return this.oO.defaultEventToolTip},F.prototype.SetDefaultEventToolTip=function(t){this.cwbU(),this.oO.defaultEventToolTip=t,this.oExT=void 0,this.cweU()},F.prototype.getDefaultEventToolTip=function(){if(void 0===this.oExT){var t=d(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&&B.Get(t)||null}return this.oExT},F.prototype.GetDefaultEventShortLabel=function(){return this.oO.defaultEventShortLabel},F.prototype.SetDefaultEventShortLabel=function(t){this.cwbU(),this.oO.defaultEventShortLabel=t,this.oExsL=void 0,this.cweU()},F.prototype.getDefaultEventShortLabel=function(){if(void 0===this.oExsL){var t=d(this.opt("defaultEventShortLabel",""));this.oExsL=t&&B.Get(t)||null}return this.oExsL},F.prototype.GetDefaultEventLongLabel=function(){return this.oO.defaultEventLongLabel},F.prototype.SetDefaultEventLongLabel=function(t){this.cwbU(),this.oO.defaultEventLongLabel=t,this.oExlL=void 0,this.cweU()},F.prototype.getDefaultEventLongLabel=function(){if(void 0===this.oExlL){var t=d(this.opt("defaultEventLongLabel","<%=%256%>"));this.oExlL=t&&B.Get(t)||null}return this.oExlL},F.prototype.GetDefaultEventExtraLabel=function(){return this.oO.defaultEventExtraLabel},F.prototype.SetDefaultEventExtraLabel=function(t){this.cwbU(),this.oO.defaultEventExtraLabel=t,this.oExeL=void 0,this.cweU()},F.prototype.getDefaultEventExtraLabel=function(){if(void 0===this.oExeL){var t=d(this.opt("defaultEventExtraLabel","<%=%256%>"));this.oExeL=t&&B.Get(t)||null}return this.oExeL},F.prototype.GetShortDateFormat=function(){return this.oO.shortDateFormat},F.prototype.SetShortDateFormat=function(t){this.cwbU(),this.oO.shortDateFormat=t,this.cweU()},F.prototype.getShortDateFormat=function(){return d(this.GetShortDateFormat(),"<%loc_sdate%>")},F.prototype.GetShortTimeFormat=function(){return this.oO.shortTimeFormat},F.prototype.SetShortTimeFormat=function(t){this.cwbU(),this.oO.shortTimeFormat=t,this.cweU()},F.prototype.getShortTimeFormat=function(){return d(this.GetShortTimeFormat(),"<%h%>:<%nn%> <%AM/PM%>")},F.prototype.GetLongDateFormat=function(){return this.oO.longDateFormat},F.prototype.SetLongDateFormat=function(t){this.cwbU(),this.oO.longDateFormat=t,this.cweU()},F.prototype.getLongDateFormat=function(){return d(this.GetLongDateFormat(),"<%loc_ldate%>")},F.prototype.GetLongTimeFormat=function(){return this.oO.longTimeFormat},F.prototype.SetLongTimeFormat=function(t){this.cwbU(),this.oO.longTimeFormat=t,this.cweU()},F.prototype.getLongTimeFormat=function(){return d(this.GetLongTimeFormat(),"<%hh%>:<%nn%>:<%ss%> <%AM/PM%>")},F.prototype.GetShowEventLabels=function(){return this.oO.showEventLabels},F.prototype.SetShowEventLabels=function(t){this.cwbU(),this.oO.showEventLabels=t,this.cweU()},F.prototype.getShowEventLabels=function(){return p.ToB(this.GetShowEventLabels(),!0)},F.prototype.GetCreateEventLabel=function(){return this.oO.createEventLabel},F.prototype.SetCreateEventLabel=function(t){this.cwbU(),this.oO.createEventLabel=t,this.cweU()},F.prototype.getCreateEventLabel=function(){return this.opt("createEventLabel")},F.prototype.GetUpdateEventsLabel=function(){return this.oO.updateEventsLabel},F.prototype.SetUpdateEventsLabel=function(t){this.cwbU(),this.oO.updateEventsLabel=t,this.cweU()},F.prototype.getUpdateEventsLabel=function(){return this.opt("updateEventsLabel")},F.prototype.GetShowMarkZone=function(){return this.oO.showMarkZone},F.prototype.SetShowMarkZone=function(t){this.cwbU(),this.oO.showMarkZone=t,this.cweU()},F.prototype.getShowMarkZone=function(){return~~l(this.opt("showMarkZone"),p.Schedule.ShowMarkZoneEnum,2)},F.prototype.GetShowEvents=function(){return this.oO.showEvents},F.prototype.SetShowEvents=function(t){this.cwbU(),this.oO.showEvents=t,this.oT.onLE(),this.cweU()},F.prototype.getShowEvents=function(){return~~l(this.opt("showEvents"),p.Schedule.ShowEventsEnum,-1)},F.prototype.GetShowAllDayHeader=function(){return this.oO.showAllDayHeader},F.prototype.SetShowAllDayHeader=function(t){this.cwbU(),this.oO.showAllDayHeader=t,this.oADL=null,this.oT.onLE(),this.onUI(),this.cweU()},F.prototype.getShowAllDayHeader=function(){return p.ToB(this.GetShowAllDayHeader(),!1)},F.prototype.GetHeaderAllDayEventHeight=function(){return this.oO.headerAllDayEventHeight},F.prototype.SetHeaderAllDayEventHeight=function(t){this.cwbU(),this.oO.headerAllDayEventHeight=t,this.onLE(),this.cweU()},F.prototype.getHeaderAllDayEventHeight=function(){return this.opt("headerAllDayEventHeight",1)},F.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)},F.prototype.gADL=function(){var t=this.gLE().gADRL();return(this.oADL=this.oADL||(this.oADL=new Z(this,t))).get(t)},F.prototype.gHADE=function(){return this.toH(this.getHeaderAllDayEventHeight())+2*this.getPad()[1]},F.prototype.gHADH=function(t){t=t||this.gADL().C;var e=this.gEM()[1];return e+t*(this.gHADE()+e)+this.gCEM()},F.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())),g(1,Math.round((t-2*e)/o))}.call(this))},F.prototype.resHADx=function(){this.nHADx=null},F.prototype.GetAllowMultiDaysEvent=function(){return this.oO.allowMultiDaysEvent},F.prototype.SetAllowMultiDaysEvent=function(t){this.cwbU(),this.oO.allowMultiDaysEvent=t,this.onLE(),this.cweU()},F.prototype.getAllowMultiDaysEvent=function(){return this.opt("allowMultiDaysEvent",!0)},F.prototype.GetAllowAllDayEventScroll=function(){return this.oO.allowAllDayEventScroll},F.prototype.SetAllowAllDayEventScroll=function(t){this.cwbU(),this.oO.allowAllDayEventScroll=t,this.onDV(),this.cweU()},F.prototype.getAllowAllDayEventScroll=function(){return this.opt("allowAllDayEventScroll",null)},F.prototype.e2Rs=function(t,e){var o=[];return this.gLE().feR(t,function(t,i,n){return o.push(i),n+1==e}),o},F.prototype.onCopy=function(){var t=[];return this.getSel().forEach(function(e){e.genID(),t.push(e.coO())}),this.sDG(),{e:t}},F.prototype.onPaste=function(t){var o,i,n,r,s,h=t.e;e(h)&&(o=this.oE.nextID(h.length),i=new Map,h.forEach(function(t,e){i.set(t.key,t.key=o[e])},this),this.oDG&&this.oDG.d&&(h.forEach(function(t){s=C(Date.Create(t.start).getTime()),r=u(r)?s:y(r,s)},this),r=C(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+C(s)+s%_,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))},F.prototype.aCCP=function(){return p.EVis(this.GetCanvas())},F.prototype.Cut=function(){this.aCCP()&&(this.Copy(),this.oT.RemoveSelection())},F.prototype.Copy=function(){if(this.aCCP()){var t=p.win.event,e=JSON.stringify(this.onCopy());n(t)?(p.SEP(t),t.clipboardData.setData("text/plain",e)):p.nav.clipboard.writeText(e)}},F.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%>")},N.prototype.GetMajorTimeRuler=function(){return this.oO.majorTimeRuler},N.prototype.SetMajorTimeRuler=function(t){this.cwbU(),this.oO.majorTimeRuler=t,this.oSV.resDSE(),this.resmM(),this.cweU()},N.prototype.getMajorTimeRuler=function(){return this.oSV.gDSE().M},N.prototype.GetMinorTimeLabel=function(){return this.oO.minorTimeLabel},N.prototype.SetMinorTimeLabel=function(t){this.cwbU(),this.oO.minorTimeLabel=t,this.resmM(),this.cweU()},N.prototype.getMinorTimeLabel=function(){return this.opt("minorTimeLabel",":<%nn%>")},N.prototype.GetMinorTimeRuler=function(){return this.oO.minorTimeRuler},N.prototype.SetMinorTimeRuler=function(t){this.cwbU(),this.oO.minorTimeRuler=t,this.oSV.resDSE(),this.resmM(),this.cweU()},N.prototype.getMinorTimeRuler=function(){return this.oSV.gDSE().m},N.prototype.GetTimeZone=function(){return this.oO.timeZone},N.prototype.SetTimeZone=function(t){this.cwbU(),this.oO.timeZone=t,this.oSV.resDSE(),this.resmM(),this.onLE(),this.cweU()},N.prototype.getTimeZone=function(){return F.Time.ToN(this.opt("timeZone","00:00"),!0)},N.prototype.resmM=function(){this.feSV(function(t){t.oTS.omM=null})},N.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=g(0,y(n,o)))),n}return this.omM||(this.omM=function(){var t,r,s,h,a,u=this.gDV(),l=[],c=[],p={m:c,M:l},f=this.getMajorTimeRuler(),y=0;return u.t&&(t=u.t[1])&&(s=this.getDayStartTime()+y,h=this.getDayEndTime()+y,(a=h-s)>Y&&(r=this.rRD(),1==function(i,u,l){var c,p,f,S,d,v,E=0;if(i>Y){for(f=y;o(f+i,s);)f+=i;if(S=f-s,!l)for(p=0,d=n(S,a,t);p=-.001&&!(c%E)&&u.push({t:f,o:v}),f+=i,c++}return E}.call(this,f,l)&&function(e,s,h){function a(t,e,s){if(s.splice(0),l.length>1)for(var h,a,u=l[0],c=l[1],p=c.o-u.o,g=f,y=u.t,S=c.t,d=r,v=y;o(v,S);)h=n(v-y,g,p),a=!1,e?a=i(v,y):h>=d&&(a=hY&&(p=a.call(this,e,!1,c=[]))&&(u=(g=f/(p+1))/e,u/=5,(g=(u*=5)*e)>Y&&i(g,e)&&a.call(this,g,!0,c=[]),c.length&&l.forEach(function(e){c.forEach(function(o){e.o+o.o<=t&&s.push({t:e.t+o.t,o:e.o+o.o})})}))}.call(this,this.getMinorTimeRuler(),c))),p}.call(this))},N.drawR=function(t,e,o,i,n,r,s){var h,u,l,c=e[0],f=e[1],g=c+e[2];o.length&&(a(i)&&(t.save(),t.beginPath(),t.strokeStyle=i,a(n)&&t.setLineDash(p.IsA(n)?n:[n]),t.strokeStyle=i,o.forEach(function(e){t.moveTo(c,f+e.o),t.lineTo(g,f+e.o)}),t.stroke(),t.restore()),r&&(l=Date.Today(),h=s?c:g,u=256|(s?0:2),o.forEach(function(e){t.drawHTMLDate(r,F.Time.ToDT(l,e.t),[h,f+e.o,0,0],u)})))},N.prototype.drawmM=function(t,e,o){var i=e&&o&&j.X(j.R2C(e))