/* @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,e){return"cc"+(e?"c":"h")+t}function i(t){return Math.round(t)}function o(){return Math.max.apply(0,arguments)}function n(){return Math.min.apply(null,arguments)}function h(t,e,i){return null==t?~~i:r.s2F(t,e)}var r=r||window.exontrol;r.Def.Calendar={},r.Shapes.Calendar={today:{normal:{fillColor:"rgba(0,0,0,0.10)",frameColor:"rgba(0,0,0,0.25)",tfi:{bold:!0}}},gray:{normal:{tfi:{fgColor:"gray"}}},lightgray:{normal:{tfi:{fgColor:"lightgray"}}},select:{normal:{fillColor:"dodgerblue",tfi:{fgColor:"white"}},hover:{tfi:{fgColor:"white"}}},frame:{normal:{frameColor:"black"}},hot:{hover:{frameColor:"black"}},weekend:{normal:{pattern:6,patternColor:"rgba(0,0,0,0.20)"}},prev:{normal:{client:"[x-3]",pad:[0,-3],fillColor:"rgb(192,192,192)",frameColor:"rgb(128,128,128)",text:"▴"},click:{fillColor:"rgb(164,164,164)",pad:[0,-3],tfi:{fgColor:"gray"}}},next:{normal:{pad:[0,-3],fillColor:"rgb(192,192,192)",frameColor:"rgb(128,128,128)",text:"▾"},click:{fillColor:"rgb(164,164,164)",pad:[0,-3],tfi:{fgColor:"gray"}}}},r.Mrg(r,function(){function t(t){return r.IsD(t)}function s(e){return t(e)||function(t){return r.IsI(t)}(e)}function a(t){return t-t%f}function l(e){return a(t(e)?e.getTime():e)}function u(e,i){this.oC=i,(e=r.ToS(e))&&(~e.toLocaleLowerCase().indexOf("freq")?r.ICalendar&&(this.oEx=r.ICalendar.IRecur.Parse(e),(this.valid=this.oEx.valid())&&(this.eval=function(t){return this.gA(this.oC.date[0],this.oC.date[0]).has(l(t))})):(this.gA=function(){},this.oEx=r.E.Create(e,"value"),(this.valid=this.oEx.IsValid())&&(this.eval=function(e){return e=function(e){return t(e)?e:new Date(e)}(e),this.oEx.Evaluate(function(){return e})})))}function p(t){this.init(t)}function c(t,e){this.oE=t,this.oO={},this.setOpts(e)}function g(t,e){this.init(t,e)}function y(t,e,i){this.oC=t,this.nLV=i||0,this.date=this.getDateToView(e),this.rgVP=null,this.size={width:0,height:0},this.table={h:0,v:0},this.nDirExt=null,this.prevExtDate=null,this.nextExtDate=null,this.build()}var f=r.msday,d=r.G;u.prototype.eval=function(t){},u.prototype.gA=function(t,e){var i,o=t.GetYear()-1,n=e.GetYear()+1;return(!this.rgA||othis.rgA.eY)&&(t=Date.Create(o,1,1),i={count:((e=Date.Create(n,12,31))-t)/f,until:e,filter:a},this.oEx.has("DTSTART")||(i.start=t),this.rgA=this.oEx.all(i),this.rgA.sY=o,this.rgA.eY=n),this.rgA};var S={date:null,selectable:null,key:null,shape:null,cursor:null,repetitive:null,toolTip:null,userData:void 0};p.prototype.init=function(t){this.oC=t,this.rgE=new r.Arr,this.rgE.onRemove=t.onDelEvent.bind(t),this.import()},p.prototype.import=function(){var t=this.oC;["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)},p.prototype.resKE=function(){this.mKE=null},p.prototype.resDE=function(){this.mDE=null},p.prototype.resRE=function(){this.rgRE=null,this.resDE()},p.prototype.gDE=function(){return this.mDE||(this.mDE=function(){var t,e,i=new Map;return this.forEach(function(o){o.isRepetitive()||(t=o.getDate().getTime(),!(e=i.get(t))&&i.set(t,e=[]),e.push(o))}),i}.call(this))},p.prototype.gRE=function(){return this.rgRE||(this.rgRE=function(){var t=new r.Arr;return this.forEach(function(e){e.isRepetitive()&&t.add(e)}),t}.call(this))},p.prototype.gE=function(t,e){var i,o,n;return null!=t&&(o=null==e,n=l(t),(o||1&e)&&(i=this.gDE().get(n))&&(i=i.slice()),(o||2&e)&&this.gRE().forEach(function(e){var o=e.gRx();o&&o.eval(t)&&(i=i||[]).push(e)})),i},p.prototype.isSelectable=function(t){var e=!0,i=this.gE(t);return i&&(e=i.forEachU(function(t){return e=e&&t.isSelectable()})),e},p.prototype.Add=function(t){this.bU(),this.resKE(),this.resDE();var e=this.add(new r.Calendar.Event(this,r.IsO(t)&&!r.IsD(t)?t:{date:t}));return this.oC.onAddEvent(e),this.eU(),e},p.prototype.GetCount=function(){return this.rgE.len()},p.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgE.at(t)||null:t instanceof c?e=this.rgE.has(t)?t:null:null==(e=function(t){var e=t.mKE;return null==e&&(t.mKE=e=new Map,t.forEach(function(t){var i=t.getKey();!e.has(i)&&e.set(i,t)})),e}(this).get(t))&&(e=this.rgE.at(t)||null),e},p.prototype.Remove=function(t){this.RemoveRange(this.Item(t))},p.prototype.toA=function(t){return function(t){var e,i=r.Arr.empty;return null!=t&&(e=t,i=new r.Arr,t instanceof r.Arr?e=t.rgE:t instanceof Array||(e=[t]),e.forEach(function(t){i.ann(this.Item(t))},this)),i}.call(this,t)},p.prototype.RemoveRange=function(t){return this.bU(),this.resKE(),this.resDE(),this.resRE(),this.rgE.removeRange(t=this.toA(t)),this.eU(),t.length},p.prototype.Clear=function(){this.bU(),this.resKE(),this.resDE(),this.resRE(),this.rgE.clear(),this.eU()},c.prototype.getType=function(){return"event"},c.prototype.gC=function(){return this.oE.oC},c.prototype.bU=function(){this.oE.bU()},c.prototype.eU=function(){this.oE.eU()},c.prototype.Remove=function(){return this.oE.Remove(this)},c.prototype.GetOptions=function(){return this.oO},c.prototype.SetOptions=function(t){this.bU(),this.setOpts(t),this.eU()},c.prototype.setOpts=function(t){for(var e in t){var i=this[r.setM(e)];i&&i.call(this,t[e])}},c.prototype.GetIndex=function(){return this.oE.indexOf(this)},c.prototype.GetKey=function(){return this.oO.key},c.prototype.SetKey=function(t){this.bU(),this.oE.resKE(),this.oO.key=t,this.eU()},c.prototype.toString=c.prototype.getKey=function(){var t=this.GetIndex();return r.ToS(this.GetKey()||(~(t=this.GetIndex())?t:""))},c.prototype.GetSelectable=function(){return this.oO.selectable},c.prototype.SetSelectable=function(t){this.bU(),this.oO.selectable=t,this.eU()},c.prototype.isSelectable=function(){return null==this.GetSelectable()||this.GetSelectable()},c.prototype.GetShape=function(){return this.oO.shape},c.prototype.SetShape=function(t){this.bU(),this.oO.shape=r.S.A2S(t),this.eU()},c.prototype.getShape=function(){var t=this.GetShape();return t&&t.normal||t},c.prototype.GetCursor=function(){return this.oO.cursor},c.prototype.SetCursor=function(t){this.bU(),this.oO.cursor=t,this.eU()},c.prototype.getCursor=function(){return this.GetCursor()},c.prototype.GetToolTip=function(){return this.oO.toolTip},c.prototype.SetToolTip=function(t){this.bU(),this.oO.toolTip=t,this.oExT=void 0,this.eU()},c.prototype.getToolTip=function(){return r.ToS(this.GetToolTip())},c.prototype.GetDate=function(){return this.oO.date},c.prototype.SetDate=function(t){this.bU(),this.oO.date=t,this.oE.resDE(),this.eU()},c.prototype.getDate=function(){var t=Date.Create(this.GetDate());return new Date(a(t.getTime()))},c.prototype.GetRepetitive=function(){return this.oO.repetitive},c.prototype.SetRepetitive=function(t){this.bU(),this.oO.repetitive=t,this.oE.resRE(),this.oRx=void 0,this.eU(!0)},c.prototype.getRepetitive=c.prototype.gRx=function(){return void 0===this.oRx&&((this.oRx=new u(this.GetRepetitive(),this.gC())).valid||(this.oRx=null)),this.oRx},c.prototype.isRepetitive=function(){return!!this.gRx()},c.prototype.getRepetitiveExpression=function(){return r.ToS(this.isRepetitive()&&this.GetRepetitive()||"")},c.prototype.GetUserData=function(){return this.oO.userData},c.prototype.SetUserData=function(t){this.bU(),this.oO.userData=t,this.eU()},c.prototype.getUserData=function(){return this.GetUserData()},g.version="3.0",g.type="Calendar",g.smooth="Calendar.smooth",g.AutoSizeEnum={exFontSize:-1,exFixedSize:0,exFitClient:1},g.FlowEnum={exLeftToRight:0,exTopToBottom:1},g.ModeEnum={exVertical:0,exHorizontal:1},g.SingleSelEnum={exDisableSel:0,exEnableSel:1,exSingleSel:2,exToggleSel:4,exDisableCtrlSel:8,exDisableShiftSel:16,exDisableDrag:32},g.CollectEnum={exContinue:0,exMonth:1,exWeek:2,exWeekAll:3,exWeekDay:4},g.Options={tfi:null,locale:null,mode:null,flow:null,date:null,autoSize:null,smoothSel:null,smoothScroll:null,locked:null,readOnly:null,selection:null,singleSel:null,allowSwitchView:null,allowScrollByDrag:null,padCal:null,alignCal:null,wheelChange:null,minMonthX:null,maxMonthX:null,minMonthY:null,maxMonthY:null,pad:null,dayLabel:null,dayAlign:null,dayFixedWidth:null,dayFixedHeight:null,dayWeekHeader:null,dayWeekLabel:null,dayWeekNoHeader:null,dayWeekNoLabel:null,dayMonthHeader:null,dayMonthLabel:null,dayMonthAlign:null,dayNonMonth:null,dayNonMonthLabel:null,dayWeekAllLabel:null,monthLabel:null,monthAlign:null,monthYearAlign:null,yearLabel:null,yearAlign:null,yearRangeAlign:null,shapes:null,hlShapes:null,cursors:null,toolTipDelay:null,toolTipPopDelay:null,toolTipWidth:null,events:null},g.Collect=function(t,e,i){t=Date.Date(Date.Create(t));var h=[],s=(e=Date.Create(e||t).copy()).Compare(t),a=r.UnitEnum,l=g.CollectEnum;if(i==l.exWeekDay)if(s)for(var u=!0;u;){var p=t.WeekOff(),c=e.WeekOff();t.GetYear()==e.GetYear()&&t.GetMonth()==e.GetMonth()||(c=s<0?0:r.days-1),t=t.Reset(a.exMonth);for(var y=n(p,c),f=o(p,c),d=t.copy(),S=d.GetMonth();d.GetMonth()==S;)d.WeekOff()>=y&&d.WeekOff()<=f&&h.push(d.copy()),d.NextDay();if(s<0)for(t=t.PrevDay(),u=e.Compare(t)<=0;t.WeekOff()!=r.days-1;)t.PrevDay();else for(t=t.NextMonth(),u=e.Compare(t)>=0;0!=t.WeekOff();)t.NextDay()}else for(var D=t.WeekColDay();D.GetMonth()==t.GetMonth();)h.push(D.copy()),D.NextWeek();else{if(s<0){var v=t;t=e,e=v}switch(i){case l.exMonth:for(t.Reset(a.exMonth),e.Reset(a.exMonth),e.NextMonth().PrevDay();t<=e;)h.push(t.copy()),t.NextDay();break;case l.exWeek:var b=t.GetMonth();for(t.Reset(a.exWeek);t.GetMonth()!=b;)t.NextDay();var L=e.GetMonth();for(e.Reset(a.exWeek),e.NextWeek().PrevDay();e.GetMonth()!=L;)e.PrevDay();for(;t<=e;)h.push(t.copy()),t.NextDay();break;case l.exWeekAll:for(t.Reset(a.exWeek),e.Reset(a.exWeek),e.NextWeek().PrevDay();t<=e;)h.push(t.copy()),t.NextDay();break;default:for(;t<=e;)h.push(t.copy()),t.NextDay()}s<0&&h.reverse()}return h},g.prototype.init=function(t,e){this.lnt=this.lnt||0,this.lnt++,this.lI=0,this.xL=0,this.yL=0,this.lSel=0,this.nLV=0,this.htToday=y.setObject("D",Date.Today()),this.oE=new p(this),this.iLts(),this.oO=r.Cpy(g.Options),this.SetClientRect(t),this.date={0:Date.Today(),1:Date.Today().Reset(16),2:Date.Today().Reset(0)},this.SetOptions(e||r.Def.Calendar,!0),r.CC.GetCanvas(t)&&this.SetCanvas(t),r.DPR.Reg(this),--this.lnt},r.SB.addProto(g.prototype),g.prototype.hideTT=function(){r.TT.Hide()},g.prototype.showTT=function(t,e,i){function o(t,e,i,o){var n;return t&&(null!=t.t?n=e.drawHTMLText(t.t,i,o):t.d&&(n=t.d(e,i,o))),n}if(e){var n=e.call(i||this,t),h=16;n&&r.TT.Show(function(){return{relative:t.target,client:function(){return this.ctxTfi(function(t){var e=r.NRt(n.rtT,this.GetWindowRect())||n.rtT,i=t.fontHeight(),s=[0,0,this.getToolTipWidth(),i],a=o(n,t,s,1024|h),l=a&&a.width||0,u=a&&a.height||0;return l&&u&&[e[0],e[1]+(u>i?0:(e[3]-u)/2),~~(l+1),u]||null})}.call(this),onpaint:function(t,e){this.ctxTfi(function(t){o(n,t,e,h)},this,t)},thisArg:this}},{thisArg:this,ttO:n.o,ttD:this.getToolTipDelay(),ttP:this.getToolTipPopDelay()})}},g.prototype.onAddEvent=function(t){},g.prototype.onDelEvent=function(t){},g.prototype.GetOptions=function(){return this.oO},g.prototype.SetOptions=function(t,e){var i=!1;if(null!=t){var o=[],n=this.GetOptions();if(null!=n){for(var h in n){var s=t[h];void 0!==s&&(o.push(h),n[h]!==s&&(n[h]=r.CpV(s)))}if(e)for(var h in t)h in n||(n[h]=r.CpV(t[h]));(i=0!=o.length)&&(this.bU(),this.nLV=0,o.forEach(function(t){var e=r.setM(t);e in this&&this[e].call(this,n[t])},this),this.eU())}}return i},g.prototype.opt=function(t,e){var i=this.GetOptions()[t];return null==i&&null==(i=r.Def.Calendar[t])&&(i=e),i},g.prototype.GetCanvas=function(){return this.canvas},g.prototype.SetCanvas=function(t,e){this.bU(),this.udefSts(this.oSts),this.oSts=null,this.resAO(),t=r.CC.GetCanvas(t),!e&&r.CC.SetCanvas(this,t),this.canvas=t,r.CC.GetCanvas(this.canvas)&&this.defSts(this.Shortcuts=this.oSts=new r.Sts),this.eU()},r.ComboBox&&(g.prototype.dCBl=function(t,e,i){var o="";this.getSel().forEach(function(t){o+=(o?",":"")+t.toLocaleDateString()}),i.oO.label=o},g.prototype.cCB=function(t){var e=this.gPtr(t),i=y.getObject(this.p2P(e));return!i.type||"D"==i.type||"DNM"==i.type},g.prototype.sCB=function(t){return t&&this.SetSelection(null),this.getSelCount()},g.prototype.SetCanvas=function(t,e){return r.ComboBox.implExHost(t,"onselchange")}(g.prototype.SetCanvas)),g.prototype.SetClientRect=function(t){var e=r.CC.GetCanvas(t);e&&(t=[0,0,e.width,e.height]),this.client=r.C2R(t),!this.visAO()&&this.resAO(),this.nLV=0,this.onRL()},g.prototype.GetClientRect=function(){return this.client.slice()},g.prototype.GetWindowRect=g.prototype.GetClientRect,g.prototype.setAO=function(t){if(this.visAO()){var e,i=!0;this.oEF?e=this.oEF.oAO:(e=t.gAO())&&(i=!1,!e.lU&&this.onSetAO(e),e.onDrawAO(this.drawAO,this)),i&&this.drawAO(t,e)}else this.resAO()},g.prototype.getCursor=function(t){var e,i,o;return this.isSelectable()&&(i=this.getCursors(),!r.H.lA&&this.p2A(t)?e=r.GP.Get("anchor",i):(e=function(t){if(t){var e=this.p2E(t);return e&&e.reverse().forEachU(function(t){return t.getCursor()})}}.call(this,t))||(o=this.p2P(t))&&(e=r.GP.Get(y.getObject(o).type.toLowerCase(),i))),e||null},g.prototype.onmousemove=function(t){var e,i=this.gPtr(t),o=this.getCursor(i);return(e=this.GetCanvas())&&(e.style.cursor=o||"auto"),this.allowTT()&&this.showTT(t,function(t){var e=this.p2T(i);return this.hideTT(),e&&{t:e,rtT:[d.X(i),d.Y(i)+18,0,0]}}),o},g.prototype.onwheel=function(t){if(this.isSelectable()){var e=this.gPtr(t);if(null!=e&&r.PInR(e.x,e.y,this.GetClientRect()))return this.dowheel(t)}return!1},g.prototype.dowheel=function(t){var e=r.WhelInc(t);if(e){var i=this.getWheelChange();if(i)return e<0?this.Next(i):this.Prev(i),!0}return!1},g.prototype.ondown=function(t){var e=this.hitTest(this.gPtr(t));return null!=e&&(e.callback instanceof Function&&e.callback.call(e.thisArg,t,e),!0)},g.prototype.onkeydown=function(t){this.onkey(t,-1)},g.prototype.onkeyup=function(t){this.onkey(t,0)},g.prototype.onkeypress=function(t){this.onkey(t,1)},g.prototype.onkey=function(t,e){switch(null!=this.oSts&&this.oSts.onkey(t,e),e){case-1:r.IsEsc(t)&&this.onEscapeKey()}},g.prototype.GetLayout=function(t){return r.Lay.Save(this.onlayout,this,t)},g.prototype.SetLayout=function(t,e){r.Lay.Load(t,this.onlayout,this,e)},g.prototype.onlayout=function(t){var e,i=this;t.IsSave()?(t.Add("date",this.GetDate().toFormat()),t.Add("sel",function(){var t="";return i.getSel().forEach(function(e){t+=(t?",":"")+e.toFormat()}),t}())):(i.oLts.lock(),i.bU(),i.nLV=0,(e=t.GetValue("date"))&&this.SetDate(e),function(t){i.SetSelection(t&&t.split(","))}(t.GetValue("sel")||null),i.eU(),i.oLts.unlock())},g.prototype.udefSts=function(t){t&&t.RemoveOf(this)},g.prototype.defSts=function(t){},g.prototype.iLts=function(){this.Listeners=this.oLts=new r.Lts,this.oLts.add("ondatechange"),this.oLts.add("onselchanging"),this.oLts.add("onselchange"),this.oLts.add("onclick"),this.oLts.add("onanchorclick")},g.prototype.hitTest=function(t){var e;if(t&&this.isSelectable()&&(e=this.p2P(t)))return{code:e,callback:function(t,e){this.onHTDown(e.code,t)},thisArg:this}},g.prototype.onHTDown=function(t,i){var o=t,n=y.getObject(o);switch(n.type){case"P":case"N":r.RUC(i,function(t){this.onClick(n,t)},this,{client:this.p2rt(o),activeObjects:{oAO:this.gAO(),owner:this,unfreezemask:e(o)+" "+e(o,!0)}});break;default:r.A.Cancel(g.smooth);if(null!=this.gLyt()){var h=null;if(this.getAllowScrollByDrag()&&(h=this.onscrollbydrag),this.allowSelect()&&this.allowSelectByDrag())if(this.isSingleSel())switch(n.type){case"D":case"DNM":h=this.onselectbydrag}else{null!=this.getTypeCollect(n.type)&&(h=this.onselectbydrag)}r.RUR.Do(i,function(t){switch(t.drag.status){case 2:case 7:h&&h.call(this,n,t);break;case 4:case 5:this.onClick(n,t);break;case 3:!this.ondrag&&this.getAllowScrollByDrag()&&(t.drag.setCursor("pointer"),h=this.onscrollbydrag)}},this)}}},g.prototype.onA=function(t,e){t&&(r.H.VisitA(this,t),this.inv(),this.onanchorclick(t))},g.prototype.onClick=function(t,e){var i=g.toClick(e);if(!i.dblClick&&t)switch(t.type){case"P":this.Prev();break;case"N":this.Next();break;case"DMH":this.getAllowSwitchView()&&this.setLayoutView(1,t.date);break;case"MH":this.setLayoutView(2,t.date);break;case"M":this.setLayoutView(0,t.date);break;case"YH":this.setLayoutView(0);break;case"Y":this.setLayoutView(1,t.date);break;default:if(this.allowSelect())if(this.isSingleSel())switch(t.type){case"D":case"DNM":this.lSel++,this.pushLoc(),this.selectModifierEvent(e),this.select(t.date),this.selectModifierEvent(null),this.popLoc(),this.lSel--,this.onSel()}else{var o=this.getTypeCollect(t.type);null!=o&&(this.lSel++,this.pushLoc(),this.selectModifierEvent(e),this.select(g.Collect(t.date,null,o)),this.selectModifierEvent(),this.popLoc(),this.lSel--,this.onSel())}}i=this.toClick(e,i),this.onA(this.p2A(this.gPtr(e)),i),this.onclick(i)},g.toClick=function(t){return{dblClick:t.drag&&(t.drag.long||1!=t.drag.click)||!1,button:r.e2B(t),modifiers:r.ModK(t)}},g.prototype.toClick=function(t,e){var i=this.gPtr(t),o=y.getObject(this.p2P(i));return e.type=o.type,e.date=o.date,e.events=this.p2E(i),e},g.prototype.onclick=function(t){this.oLts.onclick.do(t)},g.prototype.onanchorclick=function(t){this.oLts.onanchorclick.do(t)},g.prototype.onscrollbydrag=function(t,e){switch(e.drag.status){case 2:if(null==this.ondrag)this.ondrag={type:"scroll",oLyt:this.gLyt(),x:this.xL,y:this.yL,date:this.GetDate().copy()},this.lockClientPart("P","N"),this.clip=this.GetClipRect();else if("scroll"==this.ondrag.type){var i=this.isFlowL2R(),o=e.drag.offset[i?"dy":"dx"];this.ondrag.oLyt.extendLayout(-o),this[i?"yL":"xL"]=this.ondrag[i?"y":"x"]+o,this.inv()}break;case 7:if(null!=this.ondrag&&"scroll"==this.ondrag.type){this.clip=null;var n=e.drag.cancel?this.ondrag.date:this.ondrag.oLyt.getExtendDate();null!=n?this.SetSmoothDate(n):this.refresh(),this.ondrag=null}}},g.prototype.onselectbydrag=function(t,e){var i=this.gAO();switch(e.drag.status){case 2:if(null==this.ondrag)this.ondrag={type:"select",canScroll:!0,typeCollect:this.getTypeCollect(t.type),firstInvalidate:!1,date:this.GetDate().copy(),selection:this.rgSel},this.lSel++,this.isSingleSel()||this.selectModifierEvent(e),this.resAO();else{var o=e.drag.current,n=this.GetLayoutRect();if(r.PInR(o.x,o.y,n)){this.ondrag.canScroll=!0;var h=this.p2P(o),s=y.getObject(h),a=null,l=this.ondrag.typeCollect;if(null!=l&&function(t,e){var i=t==e;if(!i)switch(t){case"D":case"DNM":case"DWN":case"DWNN":switch(e){case"D":case"DNM":case"DWN":case"DWNN":i=!0}break;case"DW":switch(e){case"D":case"DNM":i=!0}break;case"DWA":i=!0;break;default:switch(i=!0,e){case"DM":i=!1}}return i}(t.type,s.type)){if(this.pushLoc(),a=g.Collect(t.date,s.date,l),!this.isSingleSel()&&l==g.CollectEnum.exContinue)switch(s.type){case"DWN":case"DWNN":var u=g.Collect(s.date,null,this.getWeekCollect());(a=a||u)!=u&&(a.push.apply(a,u),a.sort(function(t,e){return r.Cmp.D(t,e)}))}this.popLoc()}if(!this.isSingleSel()){this.setHighlightPart({type:"D",date:null!=a?a[0]:t.date},"selStart",-1);var p=s;null!=a&&(p={type:"D",date:a[a.length-1]}),this.setHighlightPart(p,"selEnd",null!=a?-1:0)}this.select(a)||this.ondrag.firstInvalidate||(this.ondrag.firstInvalidate=!0,this.postInvalidate())}else if(this.ondrag.canScroll){this.ondrag.canScroll=!1;var c=this.isFlowL2R(),f=o[c?"y":"x"],d=c?r.TOf(n):r.LOf(n),S=c?r.BOf(n):r.ROf(n);fS&&this.Next()}}break;case 7:if(null!=this.ondrag){this.selectModifierEvent(),this.lSel--,this.isSingleSel()||(this.setHighlightPart(t,"selStart",0),this.setHighlightPart(t,"selEnd",0)),i&&i.rur();e.drag.cancel?(this.rgSel=this.ondrag.selection,this.SetSmoothDate(this.ondrag.date)):this.rfhAO(),this.onSel(),this.ondrag=null}}},g.prototype.onSetAO=function(t){var i=this.getVisibleParts();if(i&&!t.hasOf(this)&&this.isSelectable()){var o=this.getSmoothSel();i.forEach(function(i,n){var h=y.getObject(n),s=this.getTypeShape(h.type);s&&(!r.EyO(s.hover)&&t.set({owner:this,id:e(n),htObject:n,inv:this.inv,hitTest:function(t,e,i){return this.ptInPart(t,e,i.htObject)&&this.isAP(t,e)},duration:o}),!r.EyO(s.click)&&t.set({owner:this,id:e(n,!0),htObject:n,inv:this.inv,hitTest:function(t,e,i){return this.ptInPart(t,e,i.htObject)&&this.isAP(t,e)},actOn:4,duration:o}))},this)}},g.prototype.onLD=function(){this.onRL()},g.prototype.onRL=function(t){this.xL=this.yL=0,this.rgLCP=this.sShs=this.sCrs=this.rgL=this.oLyt=this.oDS=this.oYS=this.oHdS=null,(null==t||t)&&this.resAO()},g.prototype.drawAO=function(t,i){r.H.StoreA(this,function(){i=i||t.gAO();var o=this.getVisibleParts(),n=this.isSelectable();if(o){!n&&r.H.lA++;var h,s=this.GetClientRect(),a=s[0]+this.xL,l=s[1]+this.yL,u=this.clip||s,p=new r.M1;t.selClip(this.clip||s),this.pushLoc(),i&&(h=i.aIDOf(this)),o.forEach(function(o,n){var s=this.getLockClientPart(n);o=s||r.ORt(o.slice(),a,l),(null==this.clip||r.NRt(o,u))&&(function(t){return h&&(h.has(e(t))||h.has(e(t,!0)))}(n)||this.getHighlightShape(n)||n==this.htToday||s?p.push(n,o):this.drawPart(t,n,o,i))},this),p&&p.forEach(function(e,o){this.drawPart(t,o,e,i)},this),this.popLoc(),t.resClip(),!n&&--r.H.lA}})},g.prototype.lockClientPart=function(t){var e=arguments.length;if(0==e)this.rgLCP=null;else{this.rgLCP=this.rgLCP||new r.M1;for(var i=0;i1&&(n+=" - ",n+=r.H.DateNoHTML(i,e.copy().NextYear(h-1))),i=n}}return i},g.prototype.getLabelSize=function(t){var e,i,o={width:0,height:0};return t&&(e=this.gCtx())&&(this.pushLoc(),i=r.HF.Date.MeasureLabel(e,t.text,t.align),o.width=i.width,o.height=i.height,this.popLoc(),o=this.padSize(o)),o},g.isDay=function(t){return"D"==t||"DNM"==t},g.getDay=function(t){if(t){var e=y.getObject(t);if(g.isDay(e.type))return e.date}},g.isMonth=function(t){return"M"==t},g.isYear=function(t){return"Y"==t},g.isToday=function(t){return!function(t,e){return Math.trunc(t/r.msday)-Math.trunc(e/r.msday)}(t,Date.now())},g.isCurrentYear=function(t){return t.GetYear()==Date.Today().GetYear()},g.isCurrentMonth=function(t){return g.isCurrentYear(t)&&t.GetMonth()==Date.Today().GetMonth()},g.compareUnit=function(t,e,i){var o=t.Compare(e);return o&&e.GetUnit(i)==t.GetUnit(i)&&(o=0),o},g.bSCTX=function(t,e,i,o){var n;return e&&(t.drawShape(i,e,o),n=r.TFI.bCTX(t,e.tfi),null!=e.opacity&&((n=n||{}).opacity=t.globalAlpha,t.globalAlpha=e.opacity)),n},g.eSCTX=function(t,e){null!=e.opacity&&(t.globalAlpha=e.opacity),e instanceof r.TFI&&r.TFI.eCTX(t,e)},g.sCTX=function(t,e,i,o,n,h){var r=g.bSCTX(t,e,i,o);n&&n.call(h),r&&g.eSCTX(t,r)},g.prototype.isSelected=function(t){if(null!=this.rgSel)try{var e=Date.Date(t).getTime();if(null!=e){if(this.rgSel instanceof r.Arr)return this.rgSel.has(e);if(this.rgSel==e)return!0}}catch(t){}return!1},g.prototype.isSelectedM=function(t){if(null!=this.rgSel)try{var e=t.GetMonth(),i=t.GetYear();if(this.rgSel instanceof r.Arr){var o=!1;return this.rgSel.forEachU(function(t){var n=new Date(t);if(n.GetYear()==i&&n.GetMonth()==e)return o=!0}),o}var n=new Date(this.rgSel);if(n.GetYear()==i&&n.GetMonth()==e)return!0}catch(t){}return!1},g.prototype.isSelectedY=function(t){if(null!=this.rgSel)try{var e=t.GetYear();if(this.rgSel instanceof r.Arr){var i=!1;return this.rgSel.forEachU(function(t){if(new Date(t).GetYear()==e)return i=!0}),i}if(new Date(this.rgSel).GetYear()==e)return!0}catch(t){}return!1},g.prototype.getSelCount=function(){var t=0;if(null!=this.rgSel){if(this.rgSel instanceof r.Arr)return this.rgSel.len();t++}return t},g.prototype.allowSelect=function(){return this.getSingleSel()},g.prototype.isSingleSel=function(){return this.getSingleSel()&g.SingleSelEnum.exSingleSel},g.prototype.isToggleSel=function(){return this.getSingleSel()&g.SingleSelEnum.exToggleSel},g.prototype.isToggleCtrlSel=function(){return 0==(this.getSingleSel()&g.SingleSelEnum.exDisableCtrlSel)},g.prototype.isShiftSel=function(){return 0==(this.getSingleSel()&g.SingleSelEnum.exDisableShiftSel)},g.prototype.allowSelectByDrag=function(){return 0==(this.getSingleSel()&g.SingleSelEnum.exDisableDrag)},g.prototype.allowScrollByDrag=function(){return!1},g.prototype.getWeekCollect=function(){return g.CollectEnum.exWeek},g.prototype.getTypeCollect=function(t){var e=g.CollectEnum;switch(t){case"D":case"DNM":return e.exContinue;case"DWA":return e.exMonth;case"DWN":case"DWNN":return this.getWeekCollect();case"DW":return e.exWeekDay}return null},g.prototype.onSel=function(){this[this.lSel?"onselchanging":"onselchange"].call(this,this.GetSelection())},g.prototype.onselchanging=function(t){this.oLts.onselchanging.do(t)},g.prototype.onselchange=function(t){this.oLts.onselchange.do(t)},g.prototype.equalSel=function(t){var e=!1;return null==this.rgSel?e=null==t:(e=this.rgSel==t,this.rgSel instanceof r.Arr&&(e=this.rgSel.equal(t))),e},g.prototype.selectModifierEvent=function(t){this.oSelEv=t&&{modifier:r.ModK(t),selection:this.rgSel}},g.prototype.select=function(e){function i(t){var e,i=!this.equalSel(t);if(t&&this.oE.len())if(s(t))t=this.oE.isSelectable(t)?t:null;else{var o=new r.Arr;t.forEach(function(t){this.oE.isSelectable(t)&&o.push(t)},this),t=o}return e=!this.equalSel(t),this.rgSel=t,e&&this.onSel(),i}function h(t){var e=null;if(null!=t)try{var i=null,h=null;t instanceof r.Arr?t.forEach(function(t){i=null==i?t:n(i,t),h=null==h?t:o(h,t)}):i=h=t;var s=null;null!=i&&((s=new Date(i)).isValid()||(s=null));var a=null;null!=h&&((a=new Date(h)).isValid()||(a=null)),s&&a&&(e={min:s,max:a})}catch(t){}return e}var a,l=!1,u=!1;if(null==e)u=null==this.ondrag;else if(0==(e=e instanceof Array?e:[e]).length)u=!0;else if(this.isSingleSel()){var p=e[e.length-1];t(p)?((a=p.getTime())&&null!=this.oSelEv&&(this.isToggleSel()||this.isToggleCtrlSel()&&2&this.oSelEv.modifier)&&this.isSelected(p)&&(a=null),l=i.call(this,a)):u=!0}else{if(a=new r.Arr,e.forEach(function(e){t(e)&&a.push(e.getTime())},this),null!=this.oSelEv){if(this.isShiftSel()&&1&this.oSelEv.modifier&&null!=this.oSelEv.selection){var c=h(this.oSelEv.selection),y=h(a);if(c&&y){var f=g.Collect(c.min.Min(y.min),c.max.Max(y.max));f&&f.forEach(function(t){a.push(t.getTime())})}}if(this.isToggleSel()||this.isToggleCtrlSel()&&2&this.oSelEv.modifier){var d=new r.Arr;null!=this.oSelEv.selection&&d.push(this.oSelEv.selection),a=d.toggle(a)}}l=i.call(this,a.len()?a:null)}return u&&(l=i.call(this,null)),l&&this.postInvalidate(),l},g.prototype.postInvalidate=function(){null!=this.hInv&&clearTimeout(this.hInv);var t=this;this.hInv=setTimeout(function(){this.hInv=null,t.inv()},0)},g.prototype.onEscapeKey=function(){switch(this.nLV){case 2:this.setLayoutView(1);break;case 1:this.setLayoutView(0)}},g.prototype.getObjectShapes=function(t){var e=t.type;if(g.isDay(t.type)){i=t.date;g.isToday(i)&&(e+=",DT"),this.isSelected(i)&&(e+=",DS"),i.IsWknd()&&(e+=",DE")}if(g.isMonth(t.type)){i=t.date;g.isCurrentMonth(i)&&(e+=",MT"),this.isSelectedM(i)&&(e+=",MS")}if(g.isYear(t.type)){var i=t.date;g.isCurrentYear(i)&&(e+=",YT"),this.isSelectedY(i)&&(e+=",YS")}return e},g.prototype.drawPart=function(t,i,o,n){if(!r.EyR(o)){var h,s,a,l,u=y.getObject(i),p=this.getLabel(u.type)||{};h=Date.SetHObj(u.date),s=this.getObjectShapes(u),null!=(a=this.getHighlightShape(i))&&(s+=","+a),l=p.text,"YH"==u.type&&(l=this.getYearRangeCaption(p,u.date)),function(h,s,a,l){var u,p=(h=h||{}).normal||h;this.isSelectable()?n&&(r.EyO(h.hover)||(u=n.get(this,e(i)))&&(g.isDay(l.type)&&!this.oE.isSelectable(l.date)||(p=r.R.Shape(u.state,u.range,{from:p,to:h.hover}))),r.EyO(h.click)||(u=n.get(this,e(i,!0)))&&(p=r.R.Shape(u.state,u.range,{from:p,to:h.click}))):r.EyO(h.disabled)||(p=r.Mrg(r.Cpy(p),h.disabled)),this.drawO(t,o,p,{text:s,formatText:a,ht:i},l)}.call(this,this.getTypeShape(s),l,p.align,u),Date.ResHObj(h)}},g.prototype.drawO=function(t,e,i,o,n){var h,r=g.isDay(n.type)&&this.oE.gE(n.date);r&&r.forEach(function(i){var n=g.bSCTX(t,i.getShape(),e,{ht:o.ht});n&&(h=h||[]).push(n)}),t.drawShape(e,i,o),h&&h.reverse().forEach(function(e){g.eSCTX(t,e)})},g.prototype.BeginUpdate=function(){this.lI++},g.prototype.bU=g.prototype.BeginUpdate,g.prototype.EndUpdate=function(){!--this.lI&&this.rfhAO()},g.prototype.eU=g.prototype.EndUpdate,g.prototype.Update=function(t,e){this.bU(),t&&t.call(e||this),this.eU()},g.prototype.draw=function(t,e,i){},g.prototype.Next=function(t){if(t=~~(null!=t?t:1)){var e=this.GetDate().copy(),i=1,n=this.gLyt();switch(null!=n&&(i=o(i,n.table[this.isFlowL2R()?"h":"v"])),this.nLV){case 1:(e=e.Reset(r.UnitEnum.exYear)).NextYear(i*t);break;case 2:e=e.Reset(r.UnitEnum.exYear),null!=n&&(i=o(1,n.table.h*n.table.v)),e.NextYear(i*t);break;default:(e=e.Reset(r.UnitEnum.exMonth)).NextMonth(i*t)}this.SetSmoothDate(e)}},g.prototype.Prev=function(t){this.Next(-~~(null!=t?t:1))},g.prototype.ctxTfi=function(t,e,i){var o,n;return(i=i||this.gCtx())&&(o=r.TFI.bCTX(i,this.getTfi()),n=t.call(e||this,i),r.TFI.eCTX(i,o)),n},g.prototype.gLyt=function(){var t,e=this.oLyt;return!e&&this.ctxTfi(function(){(e=new y(this,this.date[this.nLV],this.nLV)).addButtons(),t=this.gLyO(e),this.xL=t.x,this.yL=t.y,this.oLyt=e}),e},g.prototype.gLyO=function(t){var e,i={x:0,y:0};return(t=t||this.gLyt())&&(i=function(t,e,i){var o,n,h=t[0],s=t[1];if(null!=e){if((o=(e.width||0)-t[2])<0){var a=i&r.AlignEnum.exAlignCenter,l=i&r.AlignEnum.exAlignRight;(a||l)&&(h+=-o/(a?2:1))}if((n=(e.height||0)-t[3])<0){var u=i&r.AlignEnum.exAlignVCenter,p=i&r.AlignEnum.exAlignBottom;(u||p)&&(s+=-n/(u?2:1))}}return{x:h,y:s}}(this.GetInsideRect(),t.size,this.getAlignCal()),e=this.GetClientRect(),i.x-=e[0],i.y-=e[1]),i},g.prototype.GetLayoutRect=function(){var t,e=this.GetClientRect(),i=this.gLyt();return i&&(t=this.gLyO(i),r.ORt(e,t.x,t.y),e[2]=i.size.width,e[3]=i.size.height),e},g.prototype.GetClipRect=function(){var t=this.GetLayoutRect(),e=this.GetClientRect();return this.isFlowL2R()?(t[0]=e[0],t[2]=e[2]):(t[1]=e[1],t[3]=e[3]),r.NRt(t,e)},g.prototype.getVisibleParts=function(){var t=this.gLyt();return null!=t?t.rgVP:null},g.prototype.ptInPart=function(t,e,i){var o=i==this.p2P([t,e]);if(!o){var n=this.getVisibleParts();if(null!=n){var h=this.GetClientRect();r.PInR(t,e,h)&&(t-=h[0]+this.xL,e-=h[1]+this.yL,(o=n.pInO(t,e,i))&&(n.pInO(t,e,"P")&&(o="P"==i),n.pInO(t,e,"N")&&(o="N"==i)))}}return o},g.prototype.p2P=function(t){var e=null,i=d.X(t),o=d.Y(t);if(null!=this.rgLCP&&(e=this.rgLCP.p2O(i,o)),null==e){var n=this.getVisibleParts();if(null!=n){var h=this.GetClientRect();i-=h[0]+this.xL,o-=h[1]+this.yL,e=n.p2O(i,o)}}return e},g.prototype.p2A=function(t){return r.H.P2A(this,d.X(t),d.Y(t))},g.prototype.p2rt=function(t){var e=this.getLockClientPart(t);if(null==e){var i=this.getVisibleParts();if(null!=i&&null!=(e=i.get(t))){var o=this.GetClientRect(),n=o[0]+this.xL,h=o[1]+this.yL;e=r.ORt(e.slice(),n,h)}}return e},g.prototype.p2D=function(t){if(t)return g.getDay(this.p2P(t))},g.prototype.p2E=function(t){if(t)return this.oE.gE(this.p2D(t))},g.prototype.p2T=function(t){if(t){var e=this.p2E(t);return e&&e.reverse().forEachU(function(t){return t.getToolTip()})}},g.prototype.GetLocale=function(){return this.oO.locale},g.prototype.SetLocale=function(t){this.bU(),this.oO.locale=t||null,this.onLD(),this.eU()},g.prototype.getLocale=function(){return this.GetLocale()},g.prototype.pushLoc=function(){r.Loc.Push(this.getLocale())},g.prototype.popLoc=function(){r.Loc.Pop()},g.prototype.locale=function(t,e){var i;return this.pushLoc(),t&&(i=t.call(e||this)),this.popLoc(),i},g.prototype.GetDate=function(){return Date.Copy(this.date[this.nLV])},g.prototype.SetDate=function(t,e,i){this.bU();var o,n=Date.Create(t,e,i).Reset(r.UnitEnum.exDay),h=this.nLV,s=n.Compare(this.date[h]);return(s||this.refresh==this.smoothRefresh)&&(o=n.Compare(this.date[h]),this.date[h]=n,o&&0==h&&this.ondatechange(n),this.refresh()),this.eU(),s},g.prototype.ondatechange=function(t){this.oLts.ondatechange.do(t)},g.prototype.getLayoutDate=function(){return date},g.prototype.SetSmoothDate=function(t,e,i){var o=this.refresh;this.refresh=this.smoothRefresh,this.SetDate(t,e,i),this.refresh=o},g.prototype.setHighlightPart=function(t,e,i,o){function n(t){null!=t.timeoutID&&(clearTimeout(t.timeoutID),t.timeoutID=null)}if(e=e||"",null!=this.rgHP){null!=(h=this.rgHP.get(e))&&(n(h),this.rgHP.delete(e),0==this.rgHP.size&&(this.rgHP=null))}if((i=null!=i?i:1e3)&&(o=o||this.getTypeHLShape(t.type))){this.rgHP=this.rgHP||new Map;var h=this.rgHP.get(e);if(null!=h&&n(h),h={type:t.type,date:t.date,key:e,htObject:y.setObject(t.type,t.date),shape:o,timeoutID:null},this.rgHP.set(e,h),i>0){var r=this;h.timeoutID=setTimeout(function(){r.setHighlightPart(h,h.key,0),r.rfhAO()},this.getSmoothSel()+i)}}},g.prototype.getHighlightShape=function(t){if(null!=this.rgHP){var e=[];if(this.rgHP.forEach(function(i){i.htObject==t&&e.push(i.shape)}),e.length)return e.join()}},g.prototype.setLayoutView=function(t,e){switch(this.nLV){case 1:if(null!=e)switch(t){case 0:this.setHighlightPart({type:"DM",date:e}),this.nDVP&&e.PrevMonth(this.nDVP);break;case 2:this.setHighlightPart({type:"Y",date:e})}break;case 2:null!=e&&1==t&&(this.setHighlightPart({type:"MH",date:e}),this.nDVP&&e.PrevYear(this.nDVP));break;default:if(this.oDVL=this.oLyt,this.nDVP=null,null!=e){var i=this.getVisibleParts();if(null!=i){var o=0;i.forEachU(function(t,i){var n=y.getObject(i);if("DA"==n.type){if(0==g.compareUnit(n.date,e,r.UnitEnum.exMonth))return this.nDVP=o,!0;o++}},this)}this.setHighlightPart({type:"M",date:e}),this.nDVP&&1==t&&e.PrevYear(this.nDVP)}}this.nLV=t,this.SetSmoothDate(e||this.date[this.nLV])},g.prototype.Refresh=function(){this.bU(),this.onRL(),this.eU()},g.prototype.refresh=g.prototype.Refresh,g.prototype.smoothRefresh=function(){r.A.Cancel(g.smooth);var t,e,i,o,n,h,s,a,l,u,p,c,f,d,S=this.gLyt();S&&(t=this.gLyO(S),i=(e=this.date[this.nLV]).Compare(S.date),this.lockClientPart("P","N"),o=S.rgVP,n=new y(this,e,this.nLV),h=n.rgVP,s=o.forEachU(function(t,e){return h.has(e)&&e},this),a=0,l=0,u=o.get(s),p=h.get(s),u&&p?(a=p[0]-u[0],l=p[1]-u[1]):null!=(c=o.union())&&(this.isFlowL2R()?(a=0,l=-(i<0?r.TOf(c)-n.size.height:r.BOf(c))):(l=0,a=-(i<0?r.LOf(c)-n.size.width:r.ROf(c)))),h.offset(-a,-l),o.add(h),f=this.xL,d=this.yL,l-=d-t.y,(a-=f-t.x)||l?(this.clip=this.GetClipRect(),r.A.Progress(function(t){this.xL=f+t*a,this.yL=d+t*l,1==t&&(this.clip=null,this.lockClientPart(),this.onRL()),this.rfhAO()},{thisArg:this,duration:this.getSmoothScroll(),name:g.smooth,transition:"ease"})):this.rfhAO())},g.prototype.GetAutoSize=function(){return this.oO.autoSize},g.prototype.SetAutoSize=function(t){this.bU(),this.oO.autoSize=t,this.onRL(),this.eU()},g.prototype.getAutoSize=function(){return h(this.opt("autoSize"),r.Calendar.AutoSizeEnum,-1)},g.prototype.GetSmoothSel=function(){return this.oO.smoothSel},g.prototype.SetSmoothSel=function(t){this.bU(),this.oO.smoothSel=t,this.onRL(),this.eU()},g.prototype.getSmoothSel=function(){return o(0,r.ToI(this.opt("smoothSel",125)))},g.prototype.GetSmoothScroll=function(){return this.oO.smoothScroll},g.prototype.SetSmoothScroll=function(t){this.bU(),this.oO.smoothScroll=t,this.onRL(),this.eU()},g.prototype.getSmoothScroll=function(){return o(0,r.ToI(this.opt("smoothScroll",250)))},g.prototype.GetLocked=function(){return this.oO.locked},g.prototype.SetLocked=function(t){this.bU(),this.oO.locked=t,this.onRL(),this.eU()},g.prototype.getLocked=function(){return r.ToB(this.opt("locked",!1))},g.prototype.GetReadOnly=function(){return this.oO.readOnly},g.prototype.SetReadOnly=function(t){this.bU(),this.oO.readOnly=t,this.onRL(),this.eU()},g.prototype.isReadOnly=function(){return this.opt("readOnly",!1)},g.prototype.GetMode=function(){return this.oO.mode},g.prototype.SetMode=function(t){this.bU(),this.oO.mode=t,this.onLD(),this.eU()},g.prototype.getMode=function(){return h(this.opt("mode"),r.Calendar.ModeEnum,1)},g.prototype.GetFlow=function(){return this.oO.flow},g.prototype.SetFlow=function(t){this.bU(),this.oO.flow=t||null,this.onLD(),this.eU()},g.prototype.getFlow=function(){return h(this.opt("flow"),r.Calendar.FlowEnum,0)},g.prototype.isFlowL2R=function(){return 0==this.getFlow()},g.prototype.isH=function(){return 1==this.getMode()},g.prototype.isFitClient=function(){return 1==this.getAutoSize()},g.prototype.GetMinMonthX=function(){return this.oO.minMonthX},g.prototype.SetMinMonthX=function(t){this.bU(),this.oO.minMonthX=t||null,this.onRL(),this.eU()},g.prototype.getMinMonthX=function(){return o(1,r.ToI(this.opt("minMonthX",1)))},g.prototype.GetMaxMonthX=function(){return this.oO.maxMonthX},g.prototype.SetMaxMonthX=function(t){this.bU(),this.oO.maxMonthX=t||null,this.onRL(),this.eU()},g.prototype.getMaxMonthX=function(){return o(1,r.ToI(this.opt("maxMonthX",6)))},g.prototype.GetMinMonthY=function(){return this.oO.minMonthY},g.prototype.SetMinMonthY=function(t){this.bU(),this.oO.minMonthY=t||null,this.onRL(),this.eU()},g.prototype.getMinMonthY=function(){return o(1,r.ToI(this.opt("minMonthY",1)))},g.prototype.GetMaxMonthY=function(){return this.oO.maxMonthY},g.prototype.SetMaxMonthY=function(t){this.bU(),this.oO.maxMonthY=t||null,this.onRL(),this.eU()},g.prototype.getMaxMonthY=function(){return o(1,r.ToI(this.opt("maxMonthY",2)))},g.prototype.getMinMonth=function(){return{x:n(this.getMinMonthX(),this.getMaxMonthX()),y:n(this.getMinMonthY(),this.getMaxMonthY())}},g.prototype.getMaxMonth=function(){return{x:o(this.getMinMonthX(),this.getMaxMonthX()),y:o(this.getMinMonthY(),this.getMaxMonthY())}},g.prototype.GetDayFixedWidth=function(){return this.oO.dayFixedWidth},g.prototype.SetDayFixedWidth=function(t){this.bU(),this.oO.dayFixedWidth=t||null,this.onRL(),this.eU()},g.prototype.getDayFixedWidth=function(){return r.ToI(this.opt("dayFixedWidth",24))},g.prototype.GetDayFixedHeight=function(){return this.oO.dayFixedHeight},g.prototype.SetDayFixedHeight=function(t){this.bU(),this.oO.dayFixedHeight=t||null,this.onRL(),this.eU()},g.prototype.getDayFixedHeight=function(){return r.ToI(this.opt("dayFixedHeight",24))},g.prototype.GetDayLabel=function(){return this.oO.dayLabel},g.prototype.SetDayLabel=function(t){this.bU(),this.oO.dayLabel=t,this.onRL(),this.eU()},g.prototype.getDayLabel=function(){return r.ToS(this.opt("dayLabel","<%d%>"))},g.prototype.GetDayAlign=function(){return this.oO.dayAlign},g.prototype.SetDayAlign=function(t){this.bU(),this.oO.dayAlign=t,this.onRL(),this.eU()},g.prototype.getDayAlign=function(){return r.ToI(this.opt("dayAlign",261))},g.prototype.GetDayWeekHeader=function(){return this.oO.dayWeekHeader},g.prototype.SetDayWeekHeader=function(t){this.bU(),this.oO.dayWeekHeader=t,this.onRL(),this.eU()},g.prototype.getDayWeekHeader=function(){return r.ToB(this.opt("dayWeekHeader",!0))},g.prototype.GetDayWeekLabel=function(){return this.oO.dayWeekLabel},g.prototype.SetDayWeekLabel=function(t){this.bU(),this.oO.dayWeekLabel=t,this.onRL(),this.eU()},g.prototype.getDayWeekLabel=function(){return r.ToS(this.opt("dayWeekLabel","<%d2%>"))},g.prototype.GetDayWeekNoHeader=function(){return this.oO.dayWeekNoHeader},g.prototype.SetDayWeekNoHeader=function(t){this.bU(),this.oO.dayWeekNoHeader=t,this.onRL(),this.eU()},g.prototype.getDayWeekNoHeader=function(){return r.ToB(this.opt("dayWeekNoHeader",!0))},g.prototype.GetDayWeekNoLabel=function(){return this.oO.dayWeekNoLabel},g.prototype.SetDayWeekNoLabel=function(t){this.bU(),this.oO.dayWeekNoLabel=t,this.onRL(),this.eU()},g.prototype.getDayWeekNoLabel=function(){return r.ToS(this.opt("dayWeekNoLabel","<%ww%>"))},g.prototype.GetDayMonthHeader=function(){return this.oO.dayMonthHeader},g.prototype.SetDayMonthHeader=function(t){this.bU(),this.oO.dayMonthHeader=t,this.onRL(),this.eU()},g.prototype.getDayMonthHeader=function(){return r.ToB(this.opt("dayMonthHeader",!0))},g.prototype.GetDayMonthLabel=function(){return this.oO.dayMonthLabel},g.prototype.SetDayMonthLabel=function(t){this.bU(),this.oO.dayMonthLabel=t,this.onRL(),this.eU()},g.prototype.getDayMonthLabel=function(){return r.ToS(this.opt("dayMonthLabel","<%mmmm%> <%yyyy%>"))},g.prototype.GetDayMonthAlign=function(){return this.oO.dayMonthAlign},g.prototype.SetDayMonthAlign=function(t){this.bU(),this.oO.dayMonthAlign=t,this.onRL(),this.eU()},g.prototype.getDayMonthAlign=function(){return r.ToI(this.opt("dayMonthAlign",5))},g.prototype.GetDayNonMonth=function(){return this.oO.dayNonMonth},g.prototype.SetDayNonMonth=function(t){this.bU(),this.oO.dayNonMonth=t,this.onRL(),this.eU()},g.prototype.getDayNonMonth=function(){return r.ToB(this.opt("dayNonMonth",!0))},g.prototype.GetDayNonMonthLabel=function(){return this.oO.dayNonMonthLabel},g.prototype.SetDayNonMonthLabel=function(t){this.bU(),this.oO.dayNonMonthLabel=t,this.onRL(),this.eU()},g.prototype.getDayNonMonthLabel=function(){return r.ToS(this.opt("dayNonMonthLabel","<%d%>"))},g.prototype.GetDayWeekAllLabel=function(){return this.oO.dayWeekAllLabel},g.prototype.SetDayWeekAllLabel=function(t){this.bU(),this.oO.dayWeekAllLabel=t,this.onRL(),this.eU()},g.prototype.getDayWeekAllLabel=function(){return r.ToS(this.opt("dayWeekAllLabel"))},g.prototype.GetMonthLabel=function(){return this.oO.monthLabel},g.prototype.SetMonthLabel=function(t){this.bU(),this.oO.monthLabel=t,this.onRL(),this.eU()},g.prototype.getMonthLabel=function(){return r.ToS(this.opt("monthLabel","<%mmm%>"))},g.prototype.GetMonthAlign=function(){return this.oO.monthAlign},g.prototype.SetMonthAlign=function(t){this.bU(),this.oO.monthAlign=t,this.onRL(),this.eU()},g.prototype.getMonthAlign=function(){return r.ToI(this.opt("monthAlign",262149))},g.prototype.GetMonthYearAlign=function(){return this.oO.monthYearAlign},g.prototype.SetMonthYearAlign=function(t){this.bU(),this.oO.monthYearAlign=t,this.onRL(),this.eU()},g.prototype.getMonthYearAlign=function(){return r.ToI(this.opt("monthYearAlign",4))},g.prototype.GetYearLabel=function(){return this.oO.yearLabel},g.prototype.SetYearLabel=function(t){this.bU(),this.oO.yearLabel=t,this.onRL(),this.eU()},g.prototype.getYearLabel=function(){return r.ToS(this.opt("yearLabel","<%yyyy%>"))},g.prototype.GetYearAlign=function(){return this.oO.yearAlign},g.prototype.SetYearAlign=function(t){this.bU(),this.oO.yearAlign=t,this.onRL(),this.eU()},g.prototype.getYearAlign=function(){return r.ToI(this.opt("yearAlign",5))},g.prototype.GetYearRangeAlign=function(){return this.oO.yearRangeAlign},g.prototype.SetYearRangeAlign=function(t){this.bU(),this.oO.yearRangeAlign=t,this.onRL(),this.eU()},g.prototype.getYearRangeAlign=function(){return r.ToI(this.opt("yearRangeAlign",4))},g.prototype.GetPad=function(){return this.oO.pad},g.prototype.SetPad=function(t){this.bU(),this.oO.pad=t,this.onRL(),this.eU()},g.prototype.getPad=function(){return this.opt("pad",[4,2])},g.prototype.GetShapes=function(){return this.oO.shapes},g.prototype.SetShapes=function(t){this.bU(),this.oO.shapes=t,this.onRL(),this.eU()},g.prototype.getShapes=function(){var t=this.sShs;return null==t&&(this.sShs=t=r.ToS(this.opt("shapes","hot(d,dnm,m,y),today(dt,mt,yt),gray(dw,dwn,dwnn),lightgray(dnm),select(ds,ms,ys),weekend(de),prev(p),next(n)"))),t},g.prototype.GetHlShapes=function(){return this.oO.hlShapes},g.prototype.SetHlShapes=function(t){this.bU(),this.sHLShapes=null,this.oO.hlShapes=t,this.onRL(),this.eU()},g.prototype.getHLShapes=function(){var t=this.sHLShapes;return null==t&&(this.sHLShapes=t=r.ToS(this.opt("hlShapes","frame(m,dm,y),frame(d,dnm)"))),t},g.prototype.getTypeHLShape=function(t){return null!=t?r.GP.GetAll(t.toLowerCase(),this.getHLShapes()):null},g.prototype.getTypeShape=function(t){return null!=t?r.S.GetOf(t.toLowerCase(),this.getShapes(),"Calendar"):null},g.prototype.GetCursors=function(){return this.oO.cursors},g.prototype.SetCursors=function(t){this.bU(),this.oO.cursors=t,this.onRL(),this.eU()},g.prototype.getCursors=function(){var t=this.sCrs;return null==t&&(this.sCrs=t=r.ToS(this.opt("cursors","pointer(p,n,anchor)"))),t},g.prototype.GetSelection=function(){var t=null;return this.rgSel&&(this.rgSel instanceof r.Arr?(t=[],this.rgSel.forEach(function(e){t.push(new Date(e))})):t=new Date(this.rgSel)),t},g.prototype.SetSelection=function(t){this.select(this.toDates(t))},g.prototype.getSel=function(){var t=r.Arr.empty;return this.rgSel&&(t=(this.rgSel instanceof r.Arr?this.rgSel:new r.Arr(this.rgSel)).map(function(t){return new Date(t)})),t},g.prototype.toDates=function(t){var e=null;return null!=t&&(e=[],(r.IsS(t)||!t.forEach?[t]:t).forEach(function(t){(t=Date.Create(t)).isValid()&&e.push(function(t){var e;return(e=t.getTime())%r.msday&&t.setTime(e-e%r.msday),t}(t))})),e},g.prototype.GetSingleSel=function(){return this.oO.singleSel},g.prototype.SetSingleSel=function(t){this.bU(),this.n1S=null,this.oO.singleSel=t,this.onRL(),this.eU()},g.prototype.getSingleSel=function(){var t=this.n1S;return null==t&&(this.n1S=t=h(this.opt("singleSel"),r.Calendar.SingleSelEnum,1)),t},g.prototype.GetAllowSwitchView=function(){return this.oO.allowSwitchView},g.prototype.SetAllowSwitchView=function(t){this.bU(),this.oO.allowSwitchView=t,this.onRL(),this.eU()},g.prototype.getAllowSwitchView=function(){return r.ToB(this.opt("allowSwitchView",!0))},g.prototype.GetPadCal=function(){return this.oO.padCal},g.prototype.SetPadCal=function(t){this.bU(),this.oO.padCal=t,this.onRL(),this.eU()},g.prototype.getPadCal=function(){return this.opt("padCal",4)},g.prototype.GetAlignCal=function(){return this.oO.alignCal},g.prototype.SetAlignCal=function(t){this.bU(),this.oO.alignCal=t,this.onRL(),this.eU()},g.prototype.getAlignCal=function(){return r.ToI(this.opt("alignCal",5))},g.prototype.GetTfi=function(){return this.oO.tfi},g.prototype.SetTfi=function(t){this.bU(),this.oO.tfi=t||null,this.onRL(),this.eU()},g.prototype.getTfi=function(){return this.opt("tfi")},g.prototype.GetWheelChange=function(){return this.oO.wheelChange},g.prototype.SetWheelChange=function(t){this.bU(),this.oO.wheelChange=t,this.onRL(),this.eU()},g.prototype.getWheelChange=function(){return r.ToI(this.opt("wheelChange",1))},g.prototype.GetAllowScrollByDrag=function(){return this.oO.allowScrollByDrag},g.prototype.SetAllowScrollByDrag=function(t){this.bU(),this.oO.allowScrollByDrag=t,this.onRL(),this.eU()},g.prototype.getAllowScrollByDrag=function(){return r.ToB(this.opt("allowScrollByDrag",!0))},g.prototype.GetInsideRect=function(){return r.PRt(this.GetClientRect(),this.getPadCal(),-1)},g.prototype.getDayFixedSize=function(){return{width:this.getDayFixedWidth(),height:this.getDayFixedHeight()}},g.prototype.gDCSize=function(){return y.gDCSize(this,this.getMode())},g.prototype.getDayAutoSize=function(){this.pushLoc();var t,e=this.gCtx(),i=this.getDayAlign(),n=r.HF.Date.MeasureLabel(e,this.getDayLabel(),i),h={width:n.width,height:n.height};return this.getDayNonMonth()&&(t=r.HF.Date.MeasureLabel(e,this.getDayNonMonthLabel(),i),h.width=o(h.width,t.width),h.height=o(h.height,t.height)),this.popLoc(),h},g.prototype.padSize=function(t){var e=[0,0,t.width,t.height];return r.PRt(e,this.getPad()),t.width=e[2],t.height=e[3],t},g.prototype.getYearSize=function(){var t=this.oYS;return null==t&&((t=this.getLabelSize(this.getLabel("Y"))).width=i(t.width),t.height=i(t.height),this.oYS=t),t},g.prototype.getDaySize=function(){var t=this.oDS;if(null==t){switch(this.getAutoSize()){case g.AutoSizeEnum.exFixedSize:t=this.padSize(this.getDayFixedSize());break;case g.AutoSizeEnum.exFitClient:t=this.gDCSize();break;default:t=this.padSize(this.getDayAutoSize())}t.width=i(t.width),t.height=i(t.height),this.oDS=t}return this.oDS},g.prototype.getHeaderSize=function(){var t=this.oHdS;if(null==t){t={width:0,height:0},this.pushLoc();var e=this.gCtx();if(this.getDayMonthHeader()){n=r.HF.Date.MeasureLabel(e,this.getDayMonthLabel(),0);t.height=o(t.height,n.height)}if(this.getDayWeekHeader()){n=r.HF.Date.MeasureLabel(e,this.getDayWeekLabel(),0);if(t.height=o(t.height,n.height),t.width=o(t.width,n.width),this.getDayWeekNoHeader()&&this.getDayWeekAllLabel()){n=r.HF.Date.MeasureLabel(e,this.getDayWeekAllLabel(),0);t.height=o(t.height,n.height),t.width=o(t.width,n.width)}}if(this.getDayWeekNoHeader()){var n=r.HF.Date.MeasureLabel(e,this.getDayWeekNoLabel(),0);t.width=o(t.width,n.width),t.height=o(t.height,n.height)}this.popLoc(),t.width=i(t.width),t.height=i(t.height),this.oHdS=this.padSize(t)}return this.oHdS},g.prototype.Unshuffle=function(){this.Shuffle(0)},g.prototype.Shuffle=function(t){var e=this.getVisibleParts();if(null!=e){null==e.original&&(e.original=e.copy());var i=e.original;(t=null!=t?t:.5)&&(i=e.copy().shuffle(t)),e.morph(i,{inv:this.rfhAO,thisArg:this,duration:this.getSmoothScroll(),name:"shuffle",transition:"ease"})}},g.prototype.GetToolTipDelay=function(){return this.oO.toolTipDelay},g.prototype.SetToolTipDelay=function(t){this.oO.toolTipDelay=t},g.prototype.getToolTipDelay=function(){return this.opt("toolTipDelay",500)},g.prototype.GetToolTipPopDelay=function(){return this.oO.toolTipPopDelay},g.prototype.SetToolTipPopDelay=function(t){this.oO.toolTipPopDelay=t},g.prototype.getToolTipPopDelay=function(){return this.opt("toolTipPopDelay",5e3)},g.prototype.GetToolTipWidth=function(){return this.oO.toolTipWidth},g.prototype.SetToolTipWidth=function(t){this.oO.toolTipWidth=t},g.prototype.getToolTipWidth=function(){return this.opt("toolTipWidth",-1)},g.prototype.allowTT=function(){return r.TT&&this.getToolTipWidth()&&this.getToolTipPopDelay()},g.prototype.GetEvents=function(){return this.oE},g.prototype.SetEvents=function(t){if(this.bU(),this.oE.Clear(),null!=t)if(r.IsO(t))for(var e in t){var i=t[e],o=this.oE.Add(i);i&&null==i.key&&o.SetKey(e)}else(t.forEach&&t||[t]).forEach(function(t){this.oE.Add(t)},this);this.eU()},g.prototype.Event=function(t){return this.oE.Item(t)};return y.prototype.getDateToView=function(t){return Date.Copy(t).Reset(r.UnitEnum.exMonth)},y.setObject=function(t,e){return e?t+":"+e.getTime():t},y.getObject=function(t){var e=r.ToS(t).indexOf(":");return e<0?{type:t}:{type:t.substr(0,e),date:new Date(parseInt(t.substr(e+1)))}},y.prototype.build=function(){switch(this.oC.pushLoc(),this.nLV){case 1:(function(){this.rgVP=new r.M1;var t=this.oC;if(null!=t.oDVL){var e=this.oC.isFlowL2R(),i=t.getHeaderSize(),h=t.oDVL.table.h,s=t.oDVL.table.v,a={width:t.oDVL.size.width/h,height:t.oDVL.size.height/s};if(this.table.h=h,this.table.v=s,!e){var l=s;s=h,h=l}for(var u=this.date.copy().Reset(r.UnitEnum.exYear),p=0,c=0,g=0;gD&&(O=L,L=C,C=O);var M=D/L,w=v/C;if(!e){var O=L;L=C,C=O}for(var x=d[0],m=d[1],E=u.copy(),T=x,k=m,A=0;A0){s=function(t,e){switch(e=e.copy(),t.nLV){case 1:case 2:return e.PrevYear(t.table.h*t.table.v);default:return e.PrevMonth(t.table.h*t.table.v)}}(this,this.prevExtDate||this.date);do{var h=e(this.oC,s,o);h.rgVP.offset(i?0:r.LOf(n)-h.size.width,i?r.TOf(n)-h.size.height:0),this.rgVP.add(h.rgVP),n=this.rgVP.union()}while((i?r.TOf(n):r.LOf(n))-t>0);this.prevExtDate=s}}else if((i?r.BOf(n)-this.size.height:r.ROf(n)-this.size.width)-t<=0){var s=function(t,e){switch(e=e.copy(),t.nLV){case 1:case 2:return e.NextYear(t.table.h*t.table.v);default:return e.NextMonth(t.table.h*t.table.v)}}(this,this.nextExtDate||this.date);do{var a=e(this.oC,s,o);a.rgVP.offset(i?0:r.ROf(n),i?r.BOf(n):0),this.rgVP.add(a.rgVP),n=this.rgVP.union()}while((i?r.BOf(n)-this.size.height:r.ROf(n)-this.size.width)-t<=0);this.nextExtDate=s}}},y.prototype.getExtendDate=function(){var t=this.nDirExt;if(t){var e=this.date.copy(),i=this.oC.isFlowL2R(),o=t<0;t<0&&(t=-t);var n=i?this.size.height:this.size.width;switch(this.nLV){case 1:n/=i?this.table.v:this.table.h;break;case 2:break;default:n/=i?this.table.v:this.table.h}var h=t/n,r=Math.trunc(h);switch(h-r>.15&&r++,this.nLV){case 1:e=(o?e.PrevYear:e.NextYear).call(e,r*(i?this.table.h:this.table.v));break;case 2:e=(o?e.PrevYear:e.NextYear).call(e,r*this.table.h*this.table.v);break;default:e=(o?e.PrevMonth:e.NextMonth).call(e,r*(i?this.table.h:this.table.v))}return e}return null},y.oLay=function(t){var e,i={width:0,height:0};return t&&(e=t.union())&&(i.width=e[2],i.height=e[3],t.offset(-e[0],-e[1])),i},y.gMSize=function(t,e){switch(e){case g.ModeEnum.exVertical:return y.gVMSize(t);default:return y.gHMSize(t)}return{width:0,height:0}},y.gDCSize=function(t,e){switch(e){case g.ModeEnum.exVertical:return y.gVDCSize(t);default:return y.gHDCSize(t)}return{width:0,height:0}},y.gHMSize=function(t){var e={width:0,height:0},i=t.getDaySize(),o=t.getHeaderSize();return t.getDayMonthHeader()&&(e.height+=o.height),t.getDayWeekHeader()&&(e.height+=o.height),t.getDayWeekNoHeader()&&(e.width+=o.width),e.width+=r.days*i.width,e.height+=r.weeks*i.height,e},y.gHDCSize=function(t){function e(t,e,i,o){return(t-e*o)/(e*i)}var i=t.getMaxMonth(),o=t.getHeaderSize(),n=t.GetInsideRect();return{width:e(n[2],i.x,r.days,(t.getDayWeekNoHeader()?1:0)*o.width),height:e(n[3],i.y,r.weeks,((t.getDayMonthHeader()?1:0)+(t.getDayWeekHeader()?1:0))*o.height)}},y.bMZOrder=function(t,e){var i=0;["DA","DMH","DWA","DWH","DWNH","DM"].forEach(function(o){i=e.setZOrd(y.setObject(o,t),i)})},y.prototype.bHM=function(t,e){var i=new r.M1,o=this.oC.getDaySize(),n=this.oC.getHeaderSize(),h=t,s=h.GetMonth(),a=Date.Copy(h).PrevDay(h.WeekOff()),l=Date.Copy(a);i.push(y.setObject("DM",h),[0,0,r.days*o.width,r.weeks*o.height]);for(var u=0,p=0,c=0;c0))),D&&i.push(y.setObject(S?"D":"DNM",a),[u,p,o.width,o.height]),u+=o.width,a.NextDay()}u=0,p+=o.height}if(u=0,p=0,this.oC.getDayWeekHeader()){p-=n.height,a=Date.Copy(l),this.oC.getDayWeekNoHeader()&&(u-=n.width,i.push(y.setObject("DWA",h),[u,p,n.width,n.height]),u+=n.width),i.push(y.setObject("DWH",h),[u,p,r.days*o.width,n.height]);for(var g=0;g0),D&&i.push(y.setObject(S?"DWN":"DWNN",d),[u,p,n.width,o.height]),p+=o.height,a.NextWeek()}}if(this.oC.getDayMonthHeader()){var v=y.oLay(i);i.push(y.setObject("DMH",h),[0,-n.height,v.width,n.height])}var b=y.oLay(i);i.push(y.setObject("DA",h),[0,0,b.width,b.height]),y.bMZOrder(h,i);return{rgVP:i,size:b}},y.gVMSize=function(t){var e={width:0,height:0},i=t.getDaySize(),o=t.getHeaderSize();return t.getDayMonthHeader()&&(e.height+=o.height),t.getDayWeekHeader()&&(e.width+=o.width),t.getDayWeekNoHeader()&&(e.height+=o.height),e.width+=r.weeks*i.width,e.height+=r.days*i.height,e},y.gVDCSize=function(t){function e(t,e,i,o){return(t-e*o)/(e*i)}var i=t.getMaxMonth(),o=t.getHeaderSize(),n=t.GetInsideRect();return{width:e(n[2],i.x,r.weeks,(t.getDayWeekHeader()?1:0)*o.width),height:e(n[3],i.y,r.days,((t.getDayMonthHeader()?1:0)+(t.getDayWeekNoHeader()?1:0))*o.height)}},y.prototype.bVM=function(t,e){var i=new r.M1,o=this.oC.getDaySize(),n=this.oC.getHeaderSize(),h=t,s=h.GetMonth(),a=Date.Copy(h).PrevDay(h.WeekOff()),l=Date.Copy(a);i.push(y.setObject("DM",h),[0,0,r.weeks*o.width,r.days*o.height]);for(var u=0,p=0,c=0;c0))),D&&i.push(y.setObject(S?"D":"DNM",a),[u,p,o.width,o.height]),p+=o.height,a.NextDay()}p=0,u+=o.width}if(u=0,p=0,this.oC.getDayWeekHeader()){u-=n.width,a=Date.Copy(l),this.oC.getDayWeekNoHeader()&&(p-=n.height,i.push(y.setObject("DWA",h),[u,p,n.width,n.height]),p+=n.height),i.push(y.setObject("DWH",h),[u,p,n.width,r.days*o.height]);for(var g=0;g0),D&&i.push(y.setObject(S?"DWN":"DWNN",d),[u,p,o.width,n.height]),u+=o.width,a.NextWeek()}}if(this.oC.getDayMonthHeader()){var v=y.oLay(i);i.push(y.setObject("DMH",h),[0,-n.height,v.width,n.height])}var b=y.oLay(i);return i.push(y.setObject("DA",h),[0,0,b.width,b.height]),y.bMZOrder(h,i),{rgVP:i,size:b}},y.prototype.addButtons=function(){var t,e=this.oC,i=e.getDaySize(),n=e.getHeaderSize(),h=0,s=e.gCtx();s&&(h=4+s.fontHeight()),t={width:o(h,i.width),height:o(h,n.height)};var a=[this.size.width-t.width,0,t.width,t.height];e.getTypeShape("N")&&(this.rgVP.push(y.setObject("N",null),a),a=r.ORt(a.slice(),-t.width,0));e.getTypeShape("P")&&(this.rgVP.push(y.setObject("P",null),a),a=r.ORt(a.slice(),-t.width,0))},r.expO({Count:null},p.prototype),r.expO(r.Mrg({Options:null,Index:null},S),c.prototype),r.expO(r.Mrg({Layout:null,Options:null},g.Options),g.prototype),g.decode=y.getObject,g.EventOptions=S,g.Events=p,g.Event=c,{Calendar:g}}()),t.Calendar=r.Calendar});