/* @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(){return Math.max.apply(0,arguments)}function i(){return Math.min.apply(null,arguments)}function o(t){return null!=t}function n(t){return null==t}function r(t,i){var n=!1;if(o(i.gridLineColor)){if(o(i.gridLineColor)){var r=1;o(i.gridLineSize)&&(r=e(0,h.ToN(i.gridLineSize,0))),(n=r>0)&&(t.save(),t.strokeStyle=i.gridLineColor,1!=r&&(t.lineWidth=r),o(i.gridLineDash)&&t.setLineDash(i.gridLineDash),o(i.gridLineJoin)&&(t.lineJoin=i.gridLineJoin),o(i.gridLineCap)&&(t.lineCap=i.gridLineCap))}}return n}function s(t){t.restore()}function a(t){if(h.EyR(t)){var e=l.R2C(t);t=[l.X(e),l.Y(e),0,0]}return new l.Ellipse(t)}function p(t,e){switch(t){case 1:break;case 2:e>=Math.PI&&(e-=Math.PI);break;case 3:e<3*Math.PI/2&&(e>=Math.PI?e-=Math.PI:e>=Math.PI/2&&(e+=Math.PI));break;case 4:e-=Math.PI/2;break;default:e=0}return e}var h=h||window.exontrol,l=h.G,u=h.Gauge,y=u.prototype,f=u.Layer,c=f.prototype,g=u.Layers.prototype,d=u.LayerObject.prototype;h.Shapes.RadialMenu={dfsubitems:{normal:{gridLineColor:"#A4A4A4",frameColor:"#808080",fillColor:"#F4F4F4",pad:-2,primitive:"Ellipse"},hover:{frameColor:"#666666",fillColor:"#A4A4A4",primitive:"Pie"},disabled:{opacity:.5}},dfitems:{normal:{gridLineColor:"#A4A4A4",frameColor:"#808080",fillColor:"#FFFFFF",pad:-2,primitive:"Ellipse"},hover:{frameColor:"#666666",fillColor:"#E4E4E4",primitive:"Pie"},disabled:{opacity:.5}},dfparent:{normal:{gridLineColor:"#A4A4A4",frameColor:"#808080",fillColor:"#F4F4F4",pad:-2,primitive:"Ellipse"},hover:{frameColor:"#666666",fillColor:"#A4A4A4",primitive:"Ellipse"},disabled:{opacity:.5}}},h.RadialMenu=u,u.states="DisplayAngle,"+u.states,u.vAlpha=16,c.isEmpty=function(t){return function(){return t.apply(this,arguments)&&!this.isSubItemsLayer()&&!this.isItemsLayer()&&!this.isParentLayer()}}(c.isEmpty),c.lP2A=function(t){return function(e,i){var o,n=t.apply(this,arguments),r=this.key;return!n&&this.rfeVIU(function(t){var s=t.oA[r];if(s&&s.axy){var a=s.axy[0],p=e,u=i;return a&&(o=l.RPO([p,u],[s.axy[1],s.axy[2]],-a),p=l.X(o),u=l.Y(o)),n=h.H.P2A(s,p,u)}}),n}}(c.lP2A),c.onA=function(t){return function(e,i){t.apply(this,arguments),e&&i.item&&h.H.VisitA(i.item.oA[i.layer.key],e)}}(c.onA),c.refresh_Pointer=function(){var t,e=this.oLys.oT,i=e.nHP,o=i>=0;this.bU(),this.SetVisible(o),this.SetSelectable(!1),(t=e.oVRI.getVRI(i))&&this.SetRotateAngle(l.R2D(t.startAngle+t.sweepAngle/2)),this.eU()},c.isSubItemsLayer=function(){return this==this.oLys.oLSu},c.isItemsLayer=function(){return this==this.oLys.oLIt},c.isParentLayer=function(){return this==this.oLys.oLPa},c.rfeVIU=function(t,e){if(t instanceof Function){if(this.onDrawLayer==this.onDrawParent)return t(this.oLys.oT.oBI,e);if(this.onDrawLayer!=c.onDrawLayer)return this.oLys.oT.oVRI.rforEachIU(t,e)}},f.Drags=h.BiM.Split("move(1),rotate(2),rotamove(3),sweep(4)"),c.GetDisplayAngle=function(){return this.oLys.oT.GetDisplayAngle()},c.SetDisplayAngle=function(t){this.oLys.oT.SetDisplayAngle(t)},c.getShape=function(t){return this.oLys.oT.getShape(t)},c.oVRI=function(){return this.oLys.oT.oVRI},c.isClick=function(){return!!this.oLys.oT.lClk},c.onDrawSubItems=function(t,e){var i=this.oLys.oT,n=~~e[2],p=~~e[3];if(n>0&&p>0){var l=i.getCompatCanvas(n,p);(function(t,e,n){var p=a(e),l=i.getSubItemsClip(e),u=a(l);if(o(n)&&(l[2]!=e[2]||l[2]!=e[2])){var y=(this.isClick()?n.click:n.hover)||n.hover;n=n.normal||n;var f=t.drawShape(e,n),c=o(y)?i.nHP:-1;p=a(f);var g=r(t,n);if(g&&t.selClip(f,n.primitive,n.pArg),this.oVRI().forEach(function(e){if(i.radBk(t,f,e,"SubColor",this),i.isPieEnabled(e.index)&&e.index==c){var o=y.pArg;y.pArg=e,t.drawShape(f,y),y.pArg=o}if(g){t.beginPath(),t.moveTo(p.xm,p.ym);var n=p.a2P(e.startAngle);t.lineTo(n.x,n.y),t.stroke()}},this),g&&(t.resClip(),s(t)),!h.EyR(l)){u=a(t.drawShape(l,{frameColor:n.frameColor,frameSize:n.frameSize,frameDash:n.frameDash,frameJoin:n.frameJoin,frameCap:n.frameCap,pad:n.pad,primitive:n.primitive,pArg:n.pArg}));var d=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.drawShape(h.IRt(l,-.5,-.5),{fillColor:"#000000",pad:n.pad,primitive:n.primitive,pArg:n.pArg}),t.globalCompositeOperation=d}}this.oVRI().forEach(function(e){(function(t,e,i){var o=this.pieToItem(e.pie.index);o&&this.display(t,o,i,this.getDisplaySubItems(),{caption:o.getSubCaption(),image:o.getSubImage(),disabled:!o.isEnabled(),hasChildren:0!=o.visible().length},e)}).call(i,t,{out:p,in:u,pie:e},this)},this)}).call(this,l.getContext("2d"),[0,0,n,p],this.getShape("subitems")),t.drawImage(l,e[0],e[1]),l=null}},c.onDrawItems=function(t,e){var i=this.oLys.oT,n=~~e[2],p=~~e[3];if(n>0&&p>0){var l=i.getCompatCanvas(n,p);(function(t,e,n){var p=a(e),l=i.getItemsClip(e),u=a(l);if(o(n)&&(l[2]!=e[2]||l[2]!=e[2])){var y=(this.isClick()?n.click:n.hover)||n.hover;n=n.normal||n;var f=t.drawShape(e,n),c=a(f),g=f[2]!=f[3],d=o(y)?i.nHP:-1;p=c,g&&(t.selClip(f,n.primitive,n.pArg),f=i.getSubItemsClip(f,!0),p=a(f));var m=r(t,n);if(m&&t.selClip(f,n.primitive,n.pArg),this.oVRI().forEach(function(e){if(i.radBk(t,f,e,"Color",this),i.isPieEnabled(e.index)&&e.index==d){var o=y.pArg;y.pArg=e,t.drawShape(f,y),y.pArg=o}if(m){t.beginPath(),t.moveTo(p.xm,p.ym);var n=p.a2P(e.startAngle);t.lineTo(n.x,n.y),t.stroke()}},this),m&&(t.resClip(),s(t)),!h.EyR(l)){u=a(t.drawShape(l,{frameColor:n.frameColor,frameSize:n.frameSize,frameDash:n.frameDash,frameJoin:n.frameJoin,frameCap:n.frameCap,pad:n.pad,primitive:n.primitive,pArg:n.pArg}));var I=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.drawShape(h.IRt(l,-.5,-.5),{fillColor:"#000000",pad:n.pad,primitive:n.primitive,pArg:n.pArg}),t.globalCompositeOperation=I}g&&(t.resClip(),p=c)}this.oVRI().forEach(function(e){(function(t,e,i){var o=this.pieToItem(e.pie.index);o&&this.display(t,o,i,this.getDisplayItems(),{caption:o.getCaption(),image:o.getImage(),disabled:!o.isEnabled(),hasChildren:0!=o.visible().length},e)}).call(i,t,{out:p,in:u,pie:e},this)},this)}).call(this,l.getContext("2d"),i.getSubItemsClip([0,0,n,p]),this.getShape("items")),t.drawImage(l,e[0],e[1]),l=null}},c.onDrawParent=function(t,e){function i(t,e,i){if(i){var n=o.oBI,r=!n.isEnabled(),s=(this.isClick()?i.click:i.hover)||i.hover;r&&(h.EyO(i.disabled)||(i=s=h.Inh(i.disabled,i.normal||i))),i=i.normal||i,t.drawShape(e,(o.bHP?s:i)||i),function(t,e,i){var o,n=i.oLObj.oLR.getRotateCenter(),r=2*this.getParentSize(),s={out:a(l.C2R(n,r,r)),in:a(l.C2R(n)),pie:{index:-1,startAngle:0,sweepAngle:0}},p=this.getDisplayParent(),h=p.visible,u=this.getParent(e),y=u.caption,f=u.image;16&h?(o=this.gCnt(this.gCtx(),y,f))&&o.rtImage&&(y=null):(1&h||(y=null),2&h||(f=null)),e&&this.display(t,e,i,p,{caption:y,image:f,disabled:!e.isEnabled(),hasChildren:0!=e.visible().length},s)}.call(o,t,n,this)}}var o=this.oLys.oT;i.call(this,t,o.getItemsClip(e),this.getShape("parent"))},d.GetValue=function(t){return function(){switch(this.onDrag){case 4:return this.oLayer.oVRI().getDisplayAngle()}return t.apply(this,arguments)}}(d.GetValue),d.getDValue=function(t){return function(){switch(this.onDrag){case 4:return this.oLayer.oVRI().getDisplayAngle()}return t.apply(this,arguments)}}(d.getDValue),d.setDValue=function(t){return function(e){switch(this.onDrag){case 4:var i=this.oLayer.getLayerRect(this.oLayer.getLayersClientRect()),o=l.Angle(l.R2C(i),e.drag.start,e.drag.current),n=e.value+o;return this.oLayer.oVRI().setDisplayAngle(n)}return t.apply(this,arguments)}}(d.setDValue),d.SetValue=function(t){return function(e){switch(this.onDrag){case 4:this.oLayer.oVRI().setDisplayAngle(e)}t.apply(this,arguments)}}(d.SetValue),g.init=function(t){return function(e){t.apply(this,arguments)}}(g.init),g.getVisibleLayers=function(t){return function(){var e=t.apply(this,arguments);return function(t){return t instanceof h.RadialMenu}(this.oT)&&(this.oT.isExpanded()||(e=this.oT.getCollapseLayers())),e}}(g.getVisibleLayers),g.onChangeLayers=function(t){return function(){t.apply(this,arguments),this.onSubItemsLayer(),this.onItemsLayer(),this.onPointerLayer(),this.onParentLayer()}}(g.onChangeLayers),g.onSubItemsLayer=function(){var t=this.oLSu;t&&void 0!==t._onDrawLayer&&(t.onDrawLayer=t._onDrawLayer,t._onDrawLayer=void 0),(t=this.item("subitems")||this.item("background")||null)&&(t._onDrawLayer=t.onDrawLayer,t.onDrawLayer=t.onDrawSubItems),this.oLSu=t},g.onItemsLayer=function(){var t=this.oLIt;t&&void 0!==t._onDrawLayer&&(t.onDrawLayer=t._onDrawLayer,t._onDrawLayer=void 0),(t=this.item("items")||null)&&(t._onDrawLayer=t.onDrawLayer,t.onDrawLayer=t.onDrawItems),this.oLIt=t},g.onSubItemsLayer=function(){var t=this.oLSu;t&&void 0!==t._onDrawLayer&&(t.onDrawLayer=t._onDrawLayer,t._onDrawLayer=void 0),(t=this.item("subitems")||this.item("background")||null)&&(t._onDrawLayer=t.onDrawLayer,t.onDrawLayer=t.onDrawSubItems),this.oLSu=t},g.onPointerLayer=function(){var t=this.oLPo;t&&void 0!==t._refresh&&(t.refresh=t._refresh,t._refresh=void 0),(t=this.item("pointer")||null)&&(t._refresh=t.refresh,(t.refresh=t.refresh_Pointer).call(t)),this.oLPo=t},g.onParentLayer=function(){var t=this.oLPa;t&&void 0!==t._onDrawLayer&&(t.onDrawLayer=t._onDrawLayer,t._onDrawLayer=void 0),(t=this.item("parent")||null)&&(t._onDrawLayer=t.onDrawLayer,t.onDrawLayer=t.onDrawParent),this.oLPa=t},h.Mrg(h,function(){function t(t,e){this.init(t,e)}function r(t){this.set(t)}function s(t){this.oT=t}function a(t){this.init(t)}function f(t){this.init(null,t)}return Object.addPrototypeOf(t.prototype,y),t.version="3.2",t.type="RadialMenu",t.OnDragLayerEnum={exDoNothing:0,exDoMove:1,exDoRotate:2,exDoRotamove:3,exDoSweep:4},h.Mrg(u.Options,{shapes:null,displayAngle:null,minVisibleCount:null,circular:null,subItemsSize:null,parentSize:null,expanded:null,collapseLayers:null,allowToggleExpand:null,displaySubItems:{},displayItems:{},displayParent:{},items:null,sweepOnSelect:null,highlightAny:null,browseItem:null,parent:null}),t.DisplayRadialEnum={exDisplayRadialFlat:0,exDisplayRadialRotated:1,exDisplayRadialRotated180:2,exDisplayRadialRotated270:3,exDisplayRadialRotated90:4},t.prototype.init=function(t){return function(e,i){this.oVRI=new s(this),this.lClk=0,this.lHov=0,this.nHP=-1,this.Root=this.oR=new f(this),this.oBI=this.oR,this.nBHP=-1,t.apply(this,arguments)}}(t.prototype.init),h.ComboBox&&(t.prototype.dCBl=function(t,e,i){i.oO.label=this.oClkI&&this.oClkI.i&&i.label(2==this.oClkI.ht&&this.oClkI.i.getSubImage()||this.oClkI.i.getImage(),2==this.oClkI.ht&&this.oClkI.i.getSubCaption()||this.oClkI.i.getCaption())||""},t.prototype.cCB=function(t){var e,i=this.htItem(t),o=i.hitTest;return!i.pie&&4!=o||(1==o||2==o)&&(e=i.item)&&(!e.rgC||!e.rgC.len())},t.prototype.sCB=function(t){return t&&(this.oClkI=null),this.oClkI},t.prototype.SetCanvas=function(t,e){return h.ComboBox.implExHost(t,"onselect,onbrowse,onexpand,onchange")}(t.prototype.SetCanvas)),t.prototype.GetLayersClientRect=function(t){return function(){var e=t.apply(this,arguments);if(this.getCircular()){var o=i(e[2],e[3])/2,n=l.R2C(e);e=[n[0]-o,n[1]-o,2*o,2*o]}return e}}(t.prototype.GetLayersClientRect),t.prototype.onSwipe=function(t){return function(e,i,o,n){switch(t.apply(this,arguments),e.GetOnDrag()){case 4:n.push({f:e.GetDisplayAngle(),d:2.66*o*l.Angle(e.oLObj.oLR.getRotateCenter(!0),i,[i.x+i.dx,i.y+i.dy]),c:e.SetDisplayAngle})}}}(t.prototype.onSwipe),t.prototype.getRadius=function(){var t=this.GetLayersClientRect();return e(0,i(t[2],t[3])/2)},t.prototype.onRURStart=function(t){return function(e){t.apply(this,arguments),this.lClk++,this.lHov++,this.Refresh()}}(t.prototype.onRURStart),t.prototype.onRUREnd=function(t){return function(e){t.apply(this,arguments),this.lClk--,this.lHov--,this.onHover(this.gPtr(e)),this.Refresh()}}(t.prototype.onRUREnd),t.prototype.onHover=function(t){return function(e){if(0==this.lHov++){var i=this.p2L(e);this.oPtr=e?[l.X(e),l.Y(e)]:null,t.apply(this,arguments),this.onHoverPie(this.p2IP(e)),this.onHoverParent(i&&i.isParentLayer())}this.lHov--}}(t.prototype.onHover),t.prototype.onHoverPie=function(t){this.isLocked()||this.nHP==t||(this.nHP=t,this.resetILV()&&(this.bU(),function(t){t&&(h.A.Rng(this.sSA)?(o(this.nRefreshLayerID)&&clearTimeout(this.nRefreshLayerID),this.nRefreshLayerID=setTimeout(function(){t.refresh()})):t.refresh())}.call(this,this.oLys.oLPo),this.eU()))},t.prototype.onHoverParent=function(t){this.isLocked()||this.bHP==t||(this.bHP=t,this.oLys.oLPa&&this.oLys.oLPa.refresh())},t.prototype.resetILV=function(){var t=!1,e=this.oLys;return[e.oLSu,e.oLIt,e.oLPa,e.oLPo].forEach(function(e){o(e)&&(t=!0,this.resetLV(e))},this),t},t.prototype.defSts=function(t){return function(e){t.apply(this,arguments),e&&e.Add("Esc",this.GoBack,this)}}(t.prototype.defSts),t.prototype.iLts=function(t){return function(){t.apply(this,arguments),this.oLts.add("onselect"),this.oLts.add("onbrowse"),this.oLts.add("onexpand")}}(t.prototype.iLts),t.prototype.toClick=function(t){return function(e,i){var o;return t.apply(this,arguments),this.htItem(e,i),this.isReadOnly()||h.ComboBox&&4!=i.hitTest&&((o=i.item)&&o.rgC&&o.rgC.len()||(this.oClkI={i:o,ht:i.hitTest})),i}}(t.prototype.toClick),t.prototype.onClick=function(t){return function(e){var i=t.apply(this,arguments);return this.isLocked()||i.dblClick||(this.bHP?function(){!this.isExpanded()||n(this.oBI.oP)?this.onToggleExpand():this.GoBack()}.call(this):this.nHP>=0&&function(t){var e=this.pieToItem(t);e&&e.isEnabled()&&(this.onBrowseItem(e)||this.isReadOnly()||this.onSelect(e))}.call(this,this.nHP)),i}}(t.prototype.onClick),h.ComboBox&&(t.prototype.onClick=function(t){return function(e){this.setTimeout(function(){t.call(this,e);var i=this.GetCanvas().parentElement;i&&i.oCV&&i.oCV.inv&&i.oCV.inv()})}}(t.prototype.onClick)),t.prototype.onSelect=function(t){this.onselect(t)},t.prototype.onselect=function(t){this.oLts.onselect.do(t)},t.prototype.onBrowse=function(t){this.onbrowse(t)},t.prototype.onbrowse=function(t){this.oLts.onbrowse.do(t)},t.prototype.onExpand=function(){this.onexpand(this.oR)},t.prototype.onexpand=function(t){this.oLts.onexpand.do(t)},t.prototype.htItem=function(t,e){e=e||{};var i,n,r,s=this.gPtr(t),a=this.p2LV(s);return e.pie=this.oVRI.getVRI(this.p2IP(s)),e.item=null,(r=o(e.pie))?(n=a.oLayerView.oLayer.isItemsLayer(),e.item=this.pieToItem(e.pie.index)):a&&a.oLayerView&&(i=a.oLayerView.oLayer.isParentLayer())&&(e.item=this.oBI),e.hitTest=i?4:r?n?1:2:0,e},t.prototype.p2I=function(t){return this.pieToItem(this.p2IP(t))},t.prototype.onDrag=function(t){return function(e){this.oLys.onPointerLayer(),t.apply(this,arguments)}}(t.prototype.onDrag),t.prototype.EndUpdate=function(t){return function(){t.apply(this,arguments),this.lI||this.onHover(this.oPtr)}}(t.prototype.EndUpdate),t.prototype.eU=t.prototype.EndUpdate,t.prototype.p2IP=function(t){var e,i,o,n=-1;return t&&(e=this.p2LV(t))&&((i=e.oLayerView.oLayer).isSubItemsLayer()||i.isItemsLayer())&&(o=this.oVRI.VRIFromPointer(t,e.rtView,i.getRotateAngle()))&&(n=o.index),n},t.prototype.defLayers=function(t){return function(){return t.apply(this,arguments)+"[key=subitems][drag=sweep],[key=items][drag=sweep],[key=parent][drag=nothing]"}}(t.prototype.defLayers),t.prototype.getSmooth=function(){return e(0,h.ToN(this.opt("smooth",250)))},t.prototype.GetShapes=function(){return this.oO.shapes},t.prototype.SetShapes=function(t){this.bU(),this.sShs=null,this.oO.shapes=t,this.Refresh(),this.eU()},t.prototype.getShapes=function(){var t=this.sShs;return n(t)&&(n(t=this.GetShapes())&&(t=h.Def.Gauge.shapes),t=h.ToS(t,"dfsubitems(subitems),dfitems(items),dfparent(parent)"),this.sShs=t),t},t.prototype.getShape=function(t){var e=null;return o(t)&&(e=h.S.GetOf(t,this.getShapes(),"RadialMenu")),e},t.prototype.GetDisplayAngle=function(){return this.oO.displayAngle},t.prototype.SetDisplayAngle=function(t){this.bU();var e=this.getDisplayAngle();this.oO.displayAngle=t,this.resetILV(),e!=this.getDisplayAngle()&&this.oLys.onChange(this.oLys.oLSu||this.oLys.oLIt),n(this.oBI.oP)&&(this.bDA=this.getDisplayAngle()),this.eU()},t.prototype.getDisplayAngle=function(){return h.ToN(this.opt("displayAngle",0))},t.prototype.GetMinVisibleCount=function(){return this.oO.minVisibleCount},t.prototype.SetMinVisibleCount=function(t){this.bU(),this.oO.minVisibleCount=t,this.resetILV(),this.eU()},t.prototype.getMinVisibleCount=function(){return i(360,h.ToN(this.opt("minVisibleCount",8)))},t.prototype.GetCircular=function(){return this.oO.circular},t.prototype.SetCircular=function(t){this.bU(),this.oO.circular=t,this.Refresh(),this.eU()},t.prototype.getCircular=function(){return!!this.opt("circular",!0)},t.prototype.getSubItemsClip=function(t,i){var o=(i?1:-1)*e(0,this.getSubItemsSize());return h.IRt(t.slice(),o,o)},t.prototype.GetSubItemsSize=function(){return this.oO.subItemsSize},t.prototype.SetSubItemsSize=function(t){this.bU(),this.oSIS=null,this.oO.subItemsSize=t,this.Refresh(),this.eU()},t.prototype.getSubItemsSize=function(){return n(this.oSIS)&&(this.oSIS=new r(this.opt("subItemsSize","24"))),this.oSIS.eval(this.getRadius())},t.prototype.getItemsClip=function(t){var i=2*e(0,this.getParentSize());return l.C2R(l.R2C(t),i,i)},t.prototype.GetParentSize=function(){return this.oO.parentSize},t.prototype.SetParentSize=function(t){this.bU(),this.oPS=null,this.oO.parentSize=t,this.Refresh(),this.eU()},t.prototype.getParentSize=function(){return n(this.oPS)&&(this.oPS=new r(this.opt("parentSize","24"))),this.oPS.eval(this.getRadius())},t.prototype.GetExpanded=function(){return this.oO.expanded},t.prototype.SetExpanded=function(t){this.smoothExpand(t)||(this.bU(),this.oO.expanded=t,this.oLys.rgSL=void 0,this.onExpand(),this.Refresh(),this.eU())},t.prototype.isExpanded=function(){return!!this.opt("expanded",!0)},t.prototype.smoothExpand=function(t){function e(t){var e=new h.Arr;return t.getVO().forEach(function(t,i){e.push(i.oLayer)}),e}function i(t,e){t.oO.expanded=e,t.oLys.rgSL=void 0,t.onExpand(),t.onRL()}function n(t,e){t.lock(),f.forEach(function(t,i){var n=t.transparency;o(n)&&i.SetTransparency(100*(1-(n.from+e*(n.to-n.from))));var r=t.rotate;o(r)&&i.SetDefaultRotateAngle(r.from+e*(r.to-r.from));var s=t.sweep;o(s)&&i.SetDisplayAngle(s.from+e*(s.to-s.from))}),t.unlock()}h.A.Cancel(this.sSA);var r=this.getSweepOnSelect()&&this.getSmooth();if(r){var s=e(this),a=this.GetExpanded();this.lock(),i(this,t),this.unlock();var p=e(this),u=new h.Arr(s),y=new h.Arr;if(u.push(p),u.forEach(function(t){s.has(t)&&p.has(t)||y.push(t)}),r=0!=y.len()){var f=new Map;y.forEach(function(t){var e,i=p.has(t),o={};o.transparency={restore:t.GetTransparency(),from:i?0:t.getAlpha(),to:i?t.getAlpha():0},t.oLObj.isRotate()?(e=t.GetDefaultRotateAngle(),o.rotate={restore:e,from:i?e+90:e,to:i?e:e+90}):(e=t.GetDisplayAngle(),o.sweep={restore:e,from:i?e+90:e,to:i?e:e+90}),f.set(t,o)},this),t||(this.lock(),i(this,a),this.unlock());var c=this.draw,g=0;this.draw=function(e,i,o){this.getVO().forEach(function(i,o){if(y.has(o.oLayer)){i=i.slice();for(var n=l.C2R(l.R2C(i)),r=0;r<4;r++)i[r]=n[r]+(t?g:1-g)*(n[r]-i[r])}o.draw(e,i)})},n(this,0);var d=!1;h.A.Progress(function(e){g=e,n(this,e),this.Refresh(),!d&&(d=1==e)&&(this.draw=c,this.bU(),this.lock(),f.forEach(function(t,e){o(t.transparency)&&e.SetTransparency(t.transparency.restore),o(t.rotate)&&e.SetDefaultRotateAngle(t.rotate.restore),o(t.sweep)&&e.SetDisplayAngle(t.sweep.restore)}),this.unlock(),i(this,t),this.eU())},{name:this.sSA,thisArg:this,duration:this.getSmooth(),transition:t?"ease-out":"ease-in"})}}return r},t.prototype.GetAllowToggleExpand=function(){return this.oO.allowToggleExpand},t.prototype.SetAllowToggleExpand=function(t){this.oO.allowToggleExpand=t},t.prototype.allowToggleExpand=function(){return this.opt("allowToggleExpand",!0)},t.prototype.onToggleExpand=function(){this.allowToggleExpand()&&this.SetExpanded(!this.isExpanded())},t.prototype.GetCollapseLayers=function(){return this.oO.collapseLayers},t.prototype.SetCollapseLayers=function(t){this.bU(),this.oO.collapseLayers=t,this.oLys.rgSL=void 0,this.Refresh(),this.eU()},t.prototype.getCollapseLayers=function(){return this.opt("collapseLayers","parent")},t.prototype.GetDisplaySubItems=function(){return this.oO.displaySubItems},t.prototype.SetDisplaySubItems=function(t){this.bU(),this.oDSI=void 0,this.oO.displaySubItems=t,this.Refresh(),this.eU()},t.prototype.getDisplaySubItems=function(){return void 0===this.oDSI&&(this.oDSI=h.IsO(this.GetDisplaySubItems())?this.GetDisplaySubItems():null,o(this.oDSI)&&(this.oDSI=h.Inh(this.oDSI,h.Def.Gauge.displaySubItems||{arrow:.35,content:.5,radial:1}))),this.oDSI},t.prototype.GetDisplayItems=function(){return this.oO.displayItems},t.prototype.SetDisplayItems=function(t){this.bU(),this.oDI=void 0,this.oO.displayItems=t,this.Refresh(),this.eU()},t.prototype.getDisplayItems=function(){return void 0===this.oDI&&(this.oDI=h.IsO(this.GetDisplayItems())?this.GetDisplayItems():null,o(this.oDI)&&(this.oDI=h.Inh(this.oDI,h.Def.Gauge.displayItems||{content:.35,radial:1}))),this.oDI},t.prototype.GetDisplayParent=function(){return this.oO.displayParent},t.prototype.SetDisplayParent=function(t){this.bU(),this.oDP=void 0,this.oO.displayParent=t,this.Refresh(),this.eU()},t.prototype.getDisplayParent=function(){return void 0===this.oDP&&(this.oDP=h.IsO(this.GetDisplayParent())?this.GetDisplayParent():null,o(this.oDP)&&(this.oDP=h.Inh(this.oDP,h.Def.Gauge.displayParent||{imageSize:[24,24],visible:16,image:1,caption:1}))),this.oDP},t.prototype.GetParent=function(){return this.oO.parent},t.prototype.SetParent=function(t){this.bU(),this.oO.parent=t,this.eU()},t.prototype.getParent=function(t){var e=this.GetParent();return t&&(n((e=h.Cpy(e)||{}).caption)&&(e.caption=t.getCaption()),n(e.image)&&(e.image=t.getImage())),e},t.prototype.GetItems=function(){return this.oR.Save()},t.prototype.SetItems=function(t){this.bU(),this.oR.Load(t),this.Refresh(),this.eU()},t.prototype.GetSweepOnSelect=function(){return this.oO.sweepOnSelect},t.prototype.SetSweepOnSelect=function(t){this.bU(),this.oO.sweepOnSelect=t,this.Refresh(),this.eU()},t.prototype.getSweepOnSelect=function(){return this.opt("sweepOnSelect",!0)},t.prototype.GoBack=function(){if(this.isSelectable()){var t,e=this.oBI.oP;e&&(t=this.nHP,this.nHP=-1,this.setBI(e),this.nHP=t)}},t.prototype.GetBrowseItem=function(){return this.oBI},t.prototype.SetBrowseItem=function(t){this.setBI(t,!0)},t.prototype.setBI=function(t,e){(function(){this.oLys.forEach(null,function(t){h.H.StoreA(t),t.rfeVIU(function(e){h.H.StoreA(e.oA[t.key])})})}).call(this);var i=this.oR.item(t),r=!0,s=!1;if(e){var p=i;if(n(i)&&t instanceof a)for(t=t.oP;t&&n(i=this.oR.item(t));)t=t.oP;for(n(i)&&(i=this.oR);i.oP&&(!i.isVisible()||!i.visible().length);)i=i.oP;r=p==i}if(i&&i!=this.oBI){var u=i.visible().length;if(s=!i.oP||u>0){var y;if(this.getSweepOnSelect()){var f=r?this.oVRI.getVRI(this.nHP):null,c=n(f);if(c?(y=l.D2R(this.bDA||0),o(i.oP)&&u180?y-=360:I<-180&&(y+=360),this.Smooth(function(){this.SetDisplayAngle(y)},this))}this.resetILV(),this.eU(),this.onBrowse(this.oBI)}}return s},t.prototype.GetHighlightAny=function(){return this.oO.highlightAny},t.prototype.SetHighlightAny=function(t){this.bU(),this.oO.highlightAny=t,this.Refresh(),this.eU()},t.prototype.getHighlightAny=function(){return this.opt("highlightAny",!0)},t.prototype.Item=function(t){return this.oR.Item(t)},t.prototype.pieToItem=function(t){var e=this.oBI.visible();return t>=0&&t=0&&t<(o=this.getVRICount())&&(n=360/o,e={index:t,startAngle:l.D2R(t*n-n/2+this.getDisplayAngle()),sweepAngle:l.D2R(i(359.99,n))}),e},s.prototype.forEach=function(t,e){if(t instanceof Function)for(var i=0,o=this.getVRICount();i=0;a--)n=this.getVRI(a),(o=r.pieToItem(n.index))&&(i=t.call(e,o));return i},s.prototype.VRIFromPointer=function(t,e,i){function o(t){if(i){var e=l.X(t)-a,o=l.Y(t)-p;return[a+(e*s-o*r),p+(o*s+e*r)]}return t}i=l.D2R(i)||0;for(var n=new l.Ellipse(e),r=Math.sin(i),s=Math.cos(i),a=n.xm,p=n.ym,h=[a,p],u=0,y=this.getVRICount(),f=this.getVRI(u),c=f.startAngle,g=c,d=o(n.a2P(c)),m=l.D236(l.Angle(h,d,t));u=m)break}return f},s.prototype.getDisplayAngle=function(){return this.oT.getDisplayAngle()},s.prototype.setDisplayAngle=function(t){var e=this.oT,i=this.getDisplayAngle();return e.lI++,e.SetDisplayAngle(t),e.lI--,i!=this.getDisplayAngle()},s.prototype.getMinVisibleCount=function(){return h.ToN(this.oT.getMinVisibleCount(),1)},t.ItemOptions={visible:!0,enabled:!0,key:null,caption:null,image:null,color:null,subCaption:null,subImage:null,subColor:null,parent:null},a.prototype.init=function(t){this.oO={},this.oA={},t&&(this.oR=t.oR,this.oP=t,this.add())},a.prototype.ownCol=function(t){var e=null;return o(this.oP)&&(e=this.oP.rgC,t&&(e=e||new h.Arr,this.oP.rgC=e)),e},a.prototype.resOwnCol=function(){var t=this.oP;o(t)&&o(t.rgC)&&0==t.rgC.len()&&(t.rgC=null)},a.prototype.resetParentVisible=function(){for(var t=this,e=null;o(e=t.oP);)e.rgV=void 0,t=e},a.prototype.add=function(){var t=this.ownCol(!0);o(t)&&t.push(this)},a.prototype.toString=function(){return this.getKey()},a.prototype.forEach=function(t,e){e=e||this,this.rgC&&this.rgC.forEach(function(i){t.call(e,i),i.forEach(t,e)})},a.prototype.parents=function(){for(var t=[],e=this.oP;o(e);)t.push(e),e=e.oP;return t},a.prototype.descendants=function(){var t=new h.Arr;if(this.rgC){t.push(this.rgC);for(var e=0;e=0&&(n=n||[]).push({o:r,p:p})}e(r,i.subText)}),o(n)&&(n.sort(function(t,e){return t.p-e.p}),n.forEach(function(t){t.o.SetPosition(t.p)}))}var i=this.oR,n=this.oP;return i.bU(),this.Remove(),e(n||this,t),i.eU(),this},a.prototype.Save=function(){function t(e){var i="",o=n(e.oP);if(!o){i=h.B.quoteC(e.getCaption());var r=a.F.Save(e);e.GetPosition()!=e.GetIndex()&&(r=r||new Map).set("pos",e.GetPosition()),i+=h.B.quoteF(r)}var s=[];return e.rgC&&e.rgC.forEachI(function(e){s.push(t(e))}),i+=h.B.quoteS(s,!o&&s.length)}return t(this)},a.prototype.GetOptions=function(){return this.oO},a.prototype.SetOptions=function(t){var e=this.oR;e.bU(),h.IsO(t)?h.Mrg(this.oO,t):this.SetCaption(t),e.onKey(this),e.eU()},a.prototype.GetKey=function(){return this.oO.key},a.prototype.SetKey=function(t){var e=this.oR;e.bU(),this.oO.key=t,e.onKey(this),e.eU()},a.prototype.getKey=function(){var t=this.GetKey();return(t=o(t)?t.toString():"")||this.getPlainCaption()},a.prototype.GetVisible=function(){return this.oO.visible},a.prototype.SetVisible=function(t){var e=this.oR;e.bU(),this.resetParentVisible(),this.oO.visible=t,e.eU()},a.prototype.isVisible=function(){var t=this.GetVisible();return!(!t&&!n(t))&&(!o(this.oP)||this.oP.isVisible())},a.prototype.GetEnabled=function(){return this.oO.enabled},a.prototype.SetEnabled=function(t){var e=this.oR;e.bU(),this.oO.enabled=t,e.eU()},a.prototype.GetDisabled=function(){return!this.GetEnabled()},a.prototype.SetDisabled=function(t){this.SetEnabled(!t)},a.prototype.isEnabled=function(){var t=this.GetEnabled();return!(!t&&!n(t))&&(!o(this.oP)||this.oP.isEnabled())},a.prototype.GetIndex=function(){var t=this.ownCol();return o(t)?t.indexOf(this):-1},a.prototype.GetPosition=function(){var t=this.ownCol();return o(t)?t.getPos(this):-1},a.prototype.SetPosition=function(t){if(o(t)){var e=this.ownCol(),i=this.oR;o(e)&&(i.bU(),this.resetParentVisible(),e.setPos(this,t),i.eU())}},a.prototype.GetCaption=function(){return this.oO.caption},a.prototype.SetCaption=function(t){var e=this.oR;return e.bU(),this.oO.caption=t,e.onKey(this),e.eU(),this},a.prototype.getCaption=function(){return this.GetCaption()},a.prototype.getPlainCaption=function(){return h.H.TextNoHTML(this.getCaption())},a.prototype.GetImage=function(){return this.oO.image},a.prototype.SetImage=function(t){var e=this.oR;e.bU(),this.oO.image=t,e.eU()},a.prototype.getImage=function(){return this.GetImage()},a.prototype.GetColor=function(){return this.oO.color},a.prototype.SetColor=function(t){var e=this.oR;e.bU(),this.oO.color=t,e.eU()},a.prototype.getColor=function(){return this.GetColor()},a.prototype.GetSubCaption=function(){return this.oO.subCaption},a.prototype.SetSubCaption=function(t){var e=this.oR;return e.bU(),this.oO.subCaption=t,e.eU(),this},a.prototype.getSubCaption=function(){return this.GetSubCaption()},a.prototype.GetSubImage=function(){return this.oO.subImage},a.prototype.SetSubImage=function(t){var e=this.oR;e.bU(),this.oO.subImage=t,e.eU()},a.prototype.getSubImage=function(){return this.GetSubImage()},a.prototype.GetSubColor=function(){return this.oO.subColor},a.prototype.SetSubColor=function(t){var e=this.oR;e.bU(),this.oO.subColor=t,e.eU()},a.prototype.getSubColor=function(){return this.GetSubColor()},a.prototype.GetParent=function(){return this.oP},a.prototype.getParent=a.prototype.GetParent,Object.addPrototypeOf(f.prototype,a.prototype),f.prototype.init=function(t){return function(e,i){t.call(this,e),this.lU=0,this.oR=this,this.oT=i,this.mK2I=null}}(f.prototype.init),f.prototype.item=function(t){function e(t,i){if(i=i||new Map,t.oP){var o=t.getKey();i.get(o)||i.set(o,t)}return t.rgC&&t.rgC.forEach(function(t){e(t,i)}),i}return this.has(t)?t:(n(this.mK2I)&&(this.mK2I=e(this)),this.mK2I.get(t)||null)},f.prototype.has=function(t){var e=t==this;if(!e&&t instanceof a&&this.rgC){for(var i=null;(i=t.ownCol())&&i.has(t);t=t.oP);e=t==this}return e},f.prototype.bU=function(){this.lU++,this.oT.bU()},f.prototype.eU=function(){0==--this.lU&&(this.oT.onRL(),this.oT.setBI(this.oT.oBI,!0)),this.oT.eU()},f.prototype.onKey=function(t){this.mK2I=null},f.prototype.onAdd=function(t){t.resetParentVisible(),this.onKey(t)},f.prototype.onRemove=function(t){for(var e in t.oA)h.H.StoreA(t.oA[e]);t.resetParentVisible(),this.onKey(t)},h.expO(h.Mrg({Options:null},u.Options),t.prototype),h.expO(h.Mrg({Options:null,Disabled:null,Index:null,Position:null},t.ItemOptions),a.prototype),{RadialMenu:t}}()),t.RadialMenu=h.RadialMenu});