/*!
*
* Wijmo Library 5.20211.781
* http://wijmo.com/
*
* Copyright(c) GrapeCity, Inc. All rights reserved.
*
* Licensed under the GrapeCity Commercial License.
* sales@wijmo.com
* wijmo.com/products/wijmo-5/license/
*
*/
var wijmo;!function(t){var e;(function(e){var i,s;!function(t){t[t.Zoom=0]="Zoom";t[t.Pan=1]="Pan"}(i=e.MouseAction||(e.MouseAction={}));!function(t){t[t.X=0]="X";t[t.Y=1]="Y";t[t.XY=2]="XY"}(s=e.InteractiveAxes||(e.InteractiveAxes={}));var n=function(){function ChartGestures(e,n){this._chart=null;this._zoomEle=null;this._overlayEle=null;this._wrapperMousedown=null;this._wrapperMouseMove=null;this._wrapperMouseup=null;this._wrapperPointerdown=null;this._wrapperPointerMove=null;this._wrapperPointerup=null;this._wrapperTouchStart=null;this._wrapperTouchMove=null;this._wrapperTouchEnd=null;this._wrapperMouseWheel=null;this._startFirstPt=null;this._minX=null;this._maxX=null;this._minY=null;this._maxY=null;this._threadHold=20;this._clip={};this._selection={};this._startPointers=[];this._mvPointers=[];this._pinchStartEvents=[];this._minXRange=null;this._minYRange=null;this._innerUpdating=!1;this._lastMinX=null;this._lastMaxX=null;this._lastMinY=null;this._lastMaxY=null;this._mouseAction=i.Zoom;this._interactiveAxes=s.X;this._enable=!0;this._scaleX=1;this._scaleY=1;this._posX=0;this._posY=0;e||t.assert(!1,"The FlexChart cannot be null.");this._chart=e;t.copy(this,n);this._initialize()}Object.defineProperty(ChartGestures.prototype,"mouseAction",{get:function(){return this._mouseAction},set:function(e){this._mouseAction=t.asEnum(e,i)},enumerable:!0,configurable:!0});Object.defineProperty(ChartGestures.prototype,"interactiveAxes",{get:function(){return this._interactiveAxes},set:function(e){e!==this._interactiveAxes&&(this._interactiveAxes=t.asEnum(e,s))},enumerable:!0,configurable:!0});Object.defineProperty(ChartGestures.prototype,"enable",{get:function(){return this._enable},set:function(e){e!==this._enable&&(this._enable=t.asBoolean(e,!0))},enumerable:!0,configurable:!0});Object.defineProperty(ChartGestures.prototype,"scaleX",{get:function(){return this._scaleX},set:function(e){if(e!==this._scaleX){this._scaleX=e<0?0:e>1?1:t.asNumber(e);this._seriesGroup&&this._initAxisRangeWithPosAndScale(!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ChartGestures.prototype,"scaleY",{get:function(){return this._scaleY},set:function(e){if(e!==this._scaleY){this._scaleY=e<0?0:e>1?1:t.asNumber(e);this._seriesGroup&&this._initAxisRangeWithPosAndScale(!1)}},enumerable:!0,configurable:!0});Object.defineProperty(ChartGestures.prototype,"posX",{get:function(){return this._posX},set:function(e){if(e!==this._posX){this._posX=e<0?0:e>1?1:t.asNumber(e);this._seriesGroup&&this._initAxisRangeWithPosAndScale(!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ChartGestures.prototype,"posY",{get:function(){return this._posY},set:function(e){if(e!==this._posY){this._posY=e<0?0:e>1?1:t.asNumber(e);this._seriesGroup&&this._initAxisRangeWithPosAndScale(!1)}},enumerable:!0,configurable:!0});ChartGestures.prototype.remove=function(){if(this._zoomEle){this._chart.hostElement.removeChild(this._zoomEle);this._zoomEle=null}t.removeClass(this._chart.hostElement,ChartGestures._CSS_TOUCH_DISABLED);this._switchEvent(!1);this._wrapperMousedown=null;this._wrapperMouseMove=null;this._wrapperMouseup=null;this._wrapperPointerdown=null;this._wrapperPointerMove=null;this._wrapperPointerup=null;this._wrapperTouchStart=null;this._wrapperTouchMove=null;this._wrapperTouchEnd=null;this._wrapperMouseWheel=null};ChartGestures.prototype.reset=function(){var t=this._chart,e=t.axisX,i=t.axisY;this._maxX&&(e.max=this._maxX);this._minX&&(e.min=this._minX);this._maxY&&(i.max=this._maxY);this._minY&&(i.min=this._minY);this._initAxisRangeWithPosAndScale(!0);this._initAxisRangeWithPosAndScale(!1)};ChartGestures.prototype._refreshChart=function(){var t=this._chart,e=t.axisX,i=t.axisY;this._minX=this._getAxisMin(e);this._maxX=this._getAxisMax(e);this._minY=this._getAxisMin(i);this._maxY=this._getAxisMax(i);this._minXRange=.005*(this._maxX-this._minX);this._minYRange=.005*(this._maxY-this._minY);this._initAxisRangeWithPosAndScale(!0);this._initAxisRangeWithPosAndScale(!1)};ChartGestures.prototype._initialize=function(){var e=this._chart.hostElement;this._zoomEle=t.createElement('
');this._zoomEle.style.visibility="visible";e.appendChild(this._zoomEle);t.addClass(e,ChartGestures._CSS_TOUCH_DISABLED);this._overlayEle=this._zoomEle.querySelector("."+ChartGestures._CSS_ZOOM_OVERLAY);this._wrapperMousedown=this._onMousedown.bind(this);this._wrapperMouseMove=this._onMouseMove.bind(this);this._wrapperMouseup=this._onMouseup.bind(this);this._wrapperPointerdown=this._onPointerdown.bind(this);this._wrapperPointerMove=this._onPointerMove.bind(this);this._wrapperPointerup=this._onPointerup.bind(this);this._wrapperMouseWheel=this._onMouseWheel.bind(this);this._wrapperTouchStart=this._onTouchStart.bind(this);this._wrapperTouchMove=this._onTouchMove.bind(this);this._wrapperTouchEnd=this._onTouchEnd.bind(this);this._switchEvent(!0)};ChartGestures.prototype._switchEvent=function(t){var e=this._chart.hostElement,i=t?"addEventListener":"removeEventListener",s=t?"addHandler":"removeHandler";if(e){e[i]("mousedown",this._wrapperMousedown);e[i]("mousemove",this._wrapperMouseMove);document[i]("mouseup",this._wrapperMouseup);if("onpointerdown"in window){e[i]("pointerdown",this._wrapperPointerdown);e[i]("pointermove",this._wrapperPointerMove);document[i]("pointerup",this._wrapperPointerup)}e[i]("wheel",this._wrapperMouseWheel);if("ontouchstart"in window){e[i]("touchstart",this._wrapperTouchStart);e[i]("touchmove",this._wrapperTouchMove);document[i]("touchend",this._wrapperTouchEnd)}this._chart.rendered[s](this._refresh,this)}};ChartGestures.prototype._refresh=function(){var e,i,s,n=this._chart,a=n.axisX,r=n.axisY,h=n.hostElement;this._seriesGroup=h.querySelector(".wj-series-group");e=h.querySelector("."+t.chart.FlexChart._CSS_PLOT_AREA);this._plotOffset=t.getElementRect(e);this._plotBox=e.getBBox();this._zoomEleOffset=t.getElementRect(this._zoomEle);this._overlayEle&&this._overlayEle.removeAttribute("style");if(this._innerUpdating)this._innerUpdating=!1;else{i=!1;s=!1;if(null===this._minX||isNaN(this._minX)||0===this._minX||-1===this._minX||this._lastMinX!==this._getAxisMin(a)){this._minX=this._getAxisMin(a);null===this._minX||isNaN(this._minX)||0===this._minX||-1===this._minX||(i=!0)}if(null===this._maxX||isNaN(this._maxX)||0===this._maxX||-1===this._maxX||this._lastMaxX!==this._getAxisMax(a)){this._maxX=this._getAxisMax(a);null===this._maxX||isNaN(this._maxX)||0===this._maxX||-1===this._maxX||(i=!0)}if(null===this._minY||isNaN(this._minY)||this._lastMinY!==this._getAxisMin(r)){this._minY=this._getAxisMin(r);isNaN(this._minY)||(s=!0)}if(null===this._maxY||isNaN(this._maxY)||this._lastMaxY!==this._getAxisMax(r)){this._maxY=this._getAxisMax(r);isNaN(this._maxY)||(s=!0)}this._minXRange=.005*(this._maxX-this._minX);this._minYRange=.005*(this._maxY-this._minY);i&&null!==this._scaleX&&void 0!==this._scaleX&&1!==this._scaleX&&null!==this._posX&&void 0!==this._posX&&0!==this._posX&&this._initAxisRangeWithPosAndScale(!0);s&&null!==this._scaleY&&void 0!==this._scaleY&&1!==this._scaleY&&null!==this._posY&&void 0!==this._posY&&0!==this._posY&&this._initAxisRangeWithPosAndScale(!1)}};ChartGestures.prototype._onMousedown=function(t){if(this._enable){this._disabledOthersInteraction(!0);this._mouseDown(t);t.preventDefault()}};ChartGestures.prototype._onMouseMove=function(t){if(this._enable){this._mouseMove(t);t.preventDefault()}};ChartGestures.prototype._onMouseup=function(t){if(this._enable){this._mouseup(t);this._disabledOthersInteraction(!1)}};ChartGestures.prototype._onMouseWheel=function(t){var e=-t.deltaY>0?.05:-.05;if(this._enable){this._scaling=!0;this._interactiveAxes!==s.X&&this._interactiveAxes!==s.XY||this._updateAxisByChg(!0,e,-e);this._interactiveAxes!==s.Y&&this._interactiveAxes!==s.XY||this._updateAxisByChg(!1,e,-e);this._scaling=!1;t.preventDefault()}};ChartGestures.prototype._mouseDown=function(e){this._startFirstPt=this._getPoint(e);this._updatePoint(this._startFirstPt);if(this._mouseAction===i.Zoom)this._initOverlay();else{this._seriesGroup.setAttribute("clip-path","url(#"+this._chart._plotrectId+")");t.toggleClass(this._chart.hostElement,ChartGestures._CSS_PANABLE,this._mouseAction===i.Pan)}};ChartGestures.prototype._mouseMove=function(e){var s;if(this._startFirstPt){s=this._getPoint(e);this._updatePoint(s);this._endPoint=new t.Point(s.x,s.y);if(this._mouseAction===i.Zoom)this._updateOverLay(s);else{this._panning=!0;this._panningChart(s.x-this._startFirstPt.x,s.y-this._startFirstPt.y)}}};ChartGestures.prototype._mouseup=function(e){var s=this._endPoint;this._chart.axisX;if(this._startFirstPt&&s){if(this._mouseAction===i.Zoom){this._zoomedChart(s);this._reset()}else{this._pannedChart(s.x-this._startFirstPt.x,s.y-this._startFirstPt.y);this._reset()}t.removeClass(this._chart.hostElement,ChartGestures._CSS_PANABLE)}else{t.removeClass(this._chart.hostElement,ChartGestures._CSS_PANABLE);this._reset()}};ChartGestures.prototype._onPointerdown=function(t){if(this._enable){this._disabledOthersInteraction(!0);switch(t.pointerType){case"touch":this._pointerDown(t);break;case"mouse":this._mouseDown(t)}t.preventDefault()}};ChartGestures.prototype._onPointerMove=function(t){if(this._enable){switch(t.pointerType){case"touch":this._pointerMove(t);break;case"mouse":this._mouseMove(t)}t.preventDefault()}};ChartGestures.prototype._onPointerup=function(t){if(this._enable){switch(t.pointerType){case"touch":this._pointerUp(t);break;case"mouse":this._mouseup(t)}this._disabledOthersInteraction(!1);t.preventDefault()}};ChartGestures.prototype._pointerDown=function(t){t.preventManipulation&&t.preventManipulation();this._seriesGroup.setAttribute("clip-path","url(#"+this._chart._plotrectId+")");this._startPointers.push({id:t.pointerId,x:t.pageX,y:t.pageY});if(1===this._startPointers.length){this._scaling=!1;this._panning=!0}else if(2===this._startPointers.length){this._panning=!1;this._scaling=!0;this._startDistance={x:this._startPointers[0].x-this._startPointers[1].x,y:this._startPointers[0].y-this._startPointers[1].y}}};ChartGestures.prototype._pointerMove=function(e){var i,n,a,r,h=new t.Point(e.pageX,e.pageY),o={},_={};e.preventManipulation&&e.preventManipulation();if(this._panning){if(!this._pointInPlotArea(h))return;this._endPoint=new t.Point(e.pageX,e.pageY);this._panningChart(this._endPoint.x-this._startPointers[0].x,this._endPoint.y-this._startPointers[0].y)}else if(this._scaling){i=this._startPointers[0].id+"";n=this._startPointers[1].id+"";this._mvPointers[e.pointerId+""]={x:e.pageX,y:e.pageY};if(this._mvPointers[i]&&this._mvPointers[n]){if(Math.abs(this._startDistance.x)>this._threadHold&&this._interactiveAxes!==s.Y){a=this._mvPointers[i].x-this._plotOffset.left;r=this._startPointers[0].x-this._plotOffset.left;_.x=Math.abs((this._mvPointers[i].x-this._mvPointers[n].x)/this._startDistance.x);o.x=a-_.x*r;this._clip.x=(this._plotBox.x-a)/_.x+r;this._selection.w=this._plotBox.width/_.x}if(Math.abs(this._startDistance.y)>this._threadHold&&this._interactiveAxes!==s.X){a=this._mvPointers[i].y-this._plotOffset.top;r=this._startPointers[0].y-this._plotOffset.top;_.y=Math.abs((this._mvPointers[i].y-this._mvPointers[n].y)/this._startDistance.y);o.y=a-_.y*r;this._clip.y=(this._plotBox.y-a)/_.y+r;this._selection.h=this._plotBox.height/_.y}this._scalingChart(_,o)}}};ChartGestures.prototype._pointerUp=function(t){t.preventManipulation&&t.preventManipulation();if(this._panning){this._endPoint&&this._pannedChart(this._endPoint.x-this._startPointers[0].x,this._endPoint.y-this._startPointers[0].y);this._reset()}else if(this._scaling){this._scaledChart(t);this._reset()}};ChartGestures.prototype._onTouchStart=function(t){if(this._enable){this._disabledOthersInteraction(!0);if(1==t.touches.length){this._scaling=!1;this._panning=!0;this._startFirstPt=this._getPoint(t)}else if(2==t.touches.length){this._pinchStartEvents=this._getTouchPair(t);this._startDistance=this._touchDistance(t);this._panning=!1;this._scaling=!0}this._seriesGroup&&this._seriesGroup.setAttribute("clip-path","url(#"+this._chart._plotrectId+")");this._chart._hideToolTip();return!0}};ChartGestures.prototype._onTouchMove=function(e){if(this._enable){var i,n,a,r,h,o={},_={},l=e.touches[0],c=new t.Point(l.pageX,l.pageY);e.preventDefault();if(this._panning){if(this._startFirstPt){if(!this._pointInPlotArea(c))return;this._endPoint=new t.Point(l.pageX,l.pageY);this._panningChart(this._endPoint.x-this._startFirstPt.x,this._endPoint.y-this._startFirstPt.y)}}else if(this._scaling){a=this._touchDistance(e);r=this._getTouchPair(e)[0];h=this._pinchStartEvents[0];if(Math.abs(this._startDistance.x)>this._threadHold&&this._interactiveAxes!==s.Y){i=r.pageX-this._plotOffset.left;n=h.pageX-this._plotOffset.left;o.x=Math.abs(a.x/this._startDistance.x);_.x=i-o.x*n;this._clip.x=(this._plotBox.x-i)/o.x+n;this._selection.w=this._plotBox.width/o.x}if(Math.abs(this._startDistance.y)>this._threadHold&&this._interactiveAxes!==s.X){i=r.pageY-this._plotOffset.top;n=h.pageY-this._plotOffset.top;o.y=Math.abs(a.y/this._startDistance.y);_.y=i-o.y*n;this._clip.y=(this._plotBox.y-i)/o.y+n;this._selection.h=this._plotBox.height/o.y}this._scalingChart(o,_)}return!0}};ChartGestures.prototype._onTouchEnd=function(t){if(this._enable){var e=this._endPoint;if(this._panning){if(!this._startFirstPt||!e){this._reset();return}this._pannedChart(e.x-this._startFirstPt.x,e.y-this._startFirstPt.y)}else this._scaling&&this._scaledChart(t);this._reset();this._disabledOthersInteraction(!1);return!0}};ChartGestures.prototype._initOverlay=function(){this._zoomEle.style.visibility="visible";switch(this._interactiveAxes){case s.X:this._overlayEle.style.left=this._startFirstPt.x-this._zoomEleOffset.left+"px";this._overlayEle.style.top=this._plotOffset.top-this._zoomEleOffset.top+"px";break;case s.Y:this._overlayEle.style.left=this._plotBox.x+"px";this._overlayEle.style.top=this._startFirstPt.y-this._zoomEleOffset.top+"px";break;case s.XY:this._overlayEle.style.left=this._startFirstPt.x-this._zoomEleOffset.left+"px";this._overlayEle.style.top=this._startFirstPt.y-this._zoomEleOffset.top+"px"}};ChartGestures.prototype._updateOverLay=function(e){var i=this._startFirstPt.x-e.x,n=this._startFirstPt.y-e.y,a={};switch(this._interactiveAxes){case s.X:if(Math.abs(i)
=this._threadHold){a.width=Math.abs(i)+"px";i>0&&(a.left=e.x-this._zoomEleOffset.left+"px")}if(Math.abs(n)>=this._threadHold){a.height=Math.abs(n)+"px";n>0&&(a.top=e.y-this._zoomEleOffset.top+"px")}}t.setCss(this._overlayEle,a)};ChartGestures.prototype._updatePoint=function(t){var e=this._plotOffset;t.xe.left+e.width&&(t.x=e.left+e.width);t.ye.top+e.height&&(t.y=e.top+e.height)};ChartGestures.prototype._pointInPlotArea=function(t){var e=this._plotOffset;return t.x>=e.left&&t.x<=e.left+e.width&&t.y>=e.top&&t.y<=e.top+e.height};ChartGestures.prototype._zoomedChart=function(t){if(t){this._interactiveAxes!==s.X&&this._interactiveAxes!==s.XY||this._zoomedAxis(t,!0);this._interactiveAxes!==s.Y&&this._interactiveAxes!==s.XY||this._zoomedAxis(t,!1);this._startFirstPt=null}};ChartGestures.prototype._zoomedAxis=function(t,e){var i,s,n=e?this._chart.axisX:this._chart.axisY,a=e?"x":"y",r=e?"left":"top";if(t&&Math.abs(this._startFirstPt[a]-t[a])>this._threadHold){i=n.convertBack(this._startFirstPt[a]-this._plotOffset[r]+this._plotBox[a]);(s=n.convertBack(t[a]-this._plotOffset[r]+this._plotBox[a]))-i!=0&&this._updateAxisRange(n,Math.min(i,s),Math.max(i,s))}};ChartGestures.prototype._panningChart=function(t,e){var i=this._chart.axisX,n=this._chart.axisY,a=this._getTransFormGroups();t=Math.abs(t)0&&i.actualMin.valueOf()===this._minX&&(t=0);r<0&&i.actualMax.valueOf()===this._maxX&&(t=0);var h=n.reversed?-e:e;h>0&&n.actualMax.valueOf()===this._maxY&&(e=0);h<0&&n.actualMin.valueOf()===this._minY&&(e=0);for(var o=0;o(i=Math.min(this._maxX,a.convertBack(this._clip.x+this._selection.w)))){var h=e;e=i;i=h}e-i!=0&&this._updateAxisRange(a,e,i)}if(this._interactiveAxes!==s.X&&void 0!==this._clip.y){i=Math.min(this._maxY,r.convertBack(this._clip.y));if((e=Math.max(this._minY,r.convertBack(this._clip.y+this._selection.h)))>i){h=e;e=i;i=h}e-i!=0&&this._updateAxisRange(r,e,i)}}};ChartGestures.prototype._updateAxisByDistance=function(t,e){var i,s=t?this._chart.axisX:this._chart.axisY,n=t?this._minX:this._minY,a=t?this._maxX:this._maxY,r=s.actualMin.valueOf(),h=s.actualMax.valueOf();if(0!==e){var o=s.reversed?-e:e;if(o>0&&n===r||o<0&&a===h){this._innerUpdating=!0;this._chart.invalidate()}else{i=e/(t?this._plotBox.width:this._plotBox.height);this._updateAxisByChg(t,-i,-i)}}};ChartGestures.prototype._updateAxisByChg=function(t,e,i){var s,n,a=t?this._chart.axisX:this._chart.axisY,r=t?this._minX:this._minY,h=t?this._maxX:this._maxY,o=(a.actualMin.valueOf(),a.actualMax.valueOf(),this._chart._plotRect),_=t?o.left:o.top,l=t?o.width:o.height,c=t?this._minXRange:this._minYRange;if(!isNaN(e)&&!isNaN(i)){if(this._panning){if(a.reversed)if(e<0)if((s=t?a.convertBack(_+e*l):a.convertBack(_+l-e*l))>h){s=h;n=t?a.convertBack(a.convert(s)+l):a.convertBack(a.convert(s)-l)}else n=t?a.convertBack(_+l+i*l):a.convertBack(_-i*l);else if((n=t?a.convertBack(_+l+i*l):a.convertBack(_-i*l))h){n=h;s=t?a.convertBack(a.convert(n)-l):a.convertBack(a.convert(n)+l)}else s=t?a.convertBack(_+e*l):a.convertBack(_+l-e*l);if(s>n){var u=s;s=n;n=u}}else if(this._scaling){if((s=t?a.convertBack(_+e*l):a.convertBack(_+l-e*l))>(n=t?a.convertBack(_+l+i*l):a.convertBack(_-i*l))){u=s;s=n;n=u}sh&&(n=h);n-s=0&&e!=this._minScale&&(this._minScale=t.asNumber(e))},enumerable:!0,configurable:!0});Object.defineProperty(_RangeSlider.prototype,"maxScale",{get:function(){return this._maxScale},set:function(e){e>=0&&e!=this._maxScale&&(this._maxScale=t.asNumber(e))},enumerable:!0,configurable:!0});Object.defineProperty(_RangeSlider.prototype,"seamless",{get:function(){return this._seamless},set:function(e){e!=this._seamless&&(this._seamless=t.asBoolean(e))},enumerable:!0,configurable:!0});_RangeSlider.prototype.onRangeChanged=function(t){this.rangeChanged.raise(this,t)};_RangeSlider.prototype.onRangeChanging=function(t){this.rangeChanging.raise(this,t)};Object.defineProperty(_RangeSlider.prototype,"_isSliding",{get:function(){return null!==this._startPt},enumerable:!0,configurable:!0});Object.defineProperty(_RangeSlider.prototype,"_handleWidth",{get:function(){return this._minHandler.offsetWidth},enumerable:!0,configurable:!0});_RangeSlider.prototype._createSlider=function(e){var i=this._isHorizontal?_RangeSlider._HRANGESLIDER:_RangeSlider._VRANGESLIDER,s=this._isHorizontal?"wj-glyph-left":"wj-glyph-down",n=this._isHorizontal?"wj-glyph-right":"wj-glyph-up";this._rsContainer=e;this._rsContainer.style.visibility=this._isVisible?"visible":"hidden";this._rsEle=t.createElement('');this._rsContainer.appendChild(this._rsEle);if(this._hasButtons){this._decBtn=t.createElement('');this._rsEle.appendChild(this._decBtn);this._incBtn=t.createElement('');this._rsEle.appendChild(this._incBtn)}this._rsContent=t.createElement('');this._rsEle.appendChild(this._rsContent);this._minHandler=this._rsContent.querySelector("."+_RangeSlider._RANGESLIDER_MINHANDLE);this._rangeHandler=this._rsContent.querySelector("."+_RangeSlider._RANGESLIDER_RANGEHANDLE);this._maxHandler=this._rsContent.querySelector("."+_RangeSlider._RANGESLIDER_MAXHANDLE);this._wrapperSliderMousedown=this._onSliderMousedown.bind(this);this._wrapperDocMouseMove=this._onDocMouseMove.bind(this);this._wrapperDocMouseup=this._onDocMouseup.bind(this);this._wrapperRangeSpaceMousedown=this._onRangeSpaceMousedown.bind(this);this._wrapperRangeMouseleave=this._onRangeMouseleave.bind(this);this._wrapperBtnMousedown=this._onBtnMousedown.bind(this);this._switchEvent(!0)};_RangeSlider.prototype._switchEvent=function(t){var e=t?"addEventListener":"removeEventListener";if(this._rsContainer){this._needSpaceClick&&this._rsEle[e]("mousedown",this._wrapperRangeSpaceMousedown);this._rsEle[e]("mouseleave",this._wrapperRangeMouseleave);this._rsContent[e]("mousedown",this._wrapperSliderMousedown);if(this._hasButtons){this._decBtn[e]("mousedown",this._wrapperBtnMousedown);this._incBtn[e]("mousedown",this._wrapperBtnMousedown)}document[e]("mousemove",this._wrapperDocMouseMove);document[e]("mouseup",this._wrapperDocMouseup);if("ontouchstart"in window){this._needSpaceClick&&this._rsEle[e]("touchstart",this._wrapperRangeSpaceMousedown);this._rsContent[e]("touchstart",this._wrapperSliderMousedown);if(this._hasButtons){this._decBtn[e]("touchstart",this._wrapperBtnMousedown);this._incBtn[e]("touchstart",this._wrapperBtnMousedown)}document[e]("touchmove",this._wrapperDocMouseMove);document[e]("touchend",this._wrapperDocMouseup)}}};_RangeSlider.prototype._onSliderMousedown=function(e){if(this._isVisible){this._movingEle=e.srcElement||e.target;this._startPt=e instanceof MouseEvent?new t.Point(e.pageX,e.pageY):new t.Point(e.changedTouches[0].pageX,e.changedTouches[0].pageY);t.removeClass(this._minHandler,_RangeSlider._RANGESLIDER_HANDLE_ACTIVE);t.removeClass(this._maxHandler,_RangeSlider._RANGESLIDER_HANDLE_ACTIVE);this._movingOffset=t.getElementRect(this._movingEle);if(this._movingEle!=this._rangeHandler){this._isHorizontal?this._movingOffset.left+=.5*this._movingEle.offsetWidth:this._movingOffset.top+=.5*this._movingEle.offsetHeight;t.addClass(this._movingEle,_RangeSlider._RANGESLIDER_HANDLE_ACTIVE)}else this._range=this._maxPos-this._minPos;e.preventDefault()}};_RangeSlider.prototype._onDocMouseMove=function(e){if(this._isVisible&&this._startPt){var i=e instanceof MouseEvent?new t.Point(e.pageX,e.pageY):new t.Point(e.changedTouches[0].pageX,e.changedTouches[0].pageY);this._onMove(i)}};_RangeSlider.prototype._onMove=function(e){var i,s=this._startPt,n=this._movingOffset,a=this._plotBox,r=this._range,h=this._movingEle,o=this._minHandler,_=this._rangeHandler,l=this._maxHandler;if(s&&n){(i=this._isHorizontal?(n.left+e.x-s.x-a.x)/a.width:1-(n.top+e.y-s.y-a.y)/a.height)<0?i=0:i>1&&(i=1);if(h===o)if(this._seamless&&0===this._minScale&&i>=this._maxPos){this._minPos=this._maxPos;this._movingEle=l;t.removeClass(this._minHandler,_RangeSlider._RANGESLIDER_HANDLE_ACTIVE);t.addClass(this._maxHandler,_RangeSlider._RANGESLIDER_HANDLE_ACTIVE)}else{i>this._maxPos-this._minScale&&(i=this._maxPos-this._minScale);i
this._minPos+this._maxScale&&(i=this._minPos+this._maxScale);this._maxPos=i}else if(h===_)if(this._isHorizontal){this._minPos=i;this._maxPos=this._minPos+r;if(this._maxPos>=1){this._maxPos=1;this._minPos=this._maxPos-r}}else{this._maxPos=i;this._minPos=this._maxPos-r;if(this._minPos<=0){this._minPos=0;this._maxPos=this._minPos+r}}this._updateElesPosition();this.onRangeChanging()}};_RangeSlider.prototype._onDocMouseup=function(e){if(this._isVisible){this._clearInterval();this._isBtnMousedown=!1;if(this._startPt){this.onRangeChanged();this._startPt=null;this._movingOffset=null}t.removeClass(this._minHandler,_RangeSlider._RANGESLIDER_HANDLE_ACTIVE);t.removeClass(this._maxHandler,_RangeSlider._RANGESLIDER_HANDLE_ACTIVE)}};_RangeSlider.prototype._onRangeSpaceMousedown=function(e){var i=e instanceof MouseEvent?new t.Point(e.pageX,e.pageY):new t.Point(e.changedTouches[0].pageX,e.changedTouches[0].pageY),s=t.getElementRect(this._rsContent),n=t.getElementRect(this._rangeHandler),a=e.srcElement||e.target,r=0;e.stopPropagation();e.preventDefault();if(a===this._rsContent||a===this._rsEle){if(this._isHorizontal){r=n.width/s.width;i.xn.left+n.width&&(r*=1)}else{r=n.height/s.height;i.yn.top+n.height&&(r*=-1)}0!==r&&this._doSliding(r,i)}};_RangeSlider.prototype._onRangeMouseleave=function(t){t.stopPropagation();t.preventDefault();if(this._isBtnMousedown){this._clearInterval();this.onRangeChanged()}};_RangeSlider.prototype._onBtnMousedown=function(e){var i=e.srcElement||e.target,s=0;e.stopPropagation();e.preventDefault();if(t.hasClass(i,_RangeSlider._RANGESLIDER_DECBTN)){if(0===this._minPos)return;s=-.05}else if(t.hasClass(i,_RangeSlider._RANGESLIDER_INCBTN)){if(1===this._maxPos)return;s=.05}this._isBtnMousedown=!0;0!==s&&this._doSliding(s)};_RangeSlider.prototype._refresh=function(e){var i,s,n=0,a=t.getElementRect(this._rsContainer);e&&(this._rangeSliderRect=e);if(this._rangeSliderRect){if(this._hasButtons&&this._buttonsVisible){this._decBtn.style.display="block";this._incBtn.style.display="block";n=this._isHorizontal?this._decBtn.offsetWidth+this._minHandler.offsetWidth/2:this._decBtn.offsetHeight+this._minHandler.offsetHeight/2}else{if(this._hasButtons){this._decBtn.style.display="none";this._incBtn.style.display="none"}n=this._isHorizontal?this._minHandler.offsetWidth/2:this._minHandler.offsetHeight/2}i=this._getRsRect();if(this._isHorizontal){i.left-=this._minHandler.offsetWidth/2;i.width+=this._minHandler.offsetWidth;s={left:n,width:i.width-2*n}}else{i.top-=this._minHandler.offsetHeight/2;i.height+=this._minHandler.offsetHeight;s={top:n,height:i.height-2*n}}t.setCss(this._rsEle,i);t.setCss(this._rsContent,s);a=t.getElementRect(this._rsContent);this._plotBox={x:a.left,y:a.top,width:a.width,height:a.height};this._updateElesPosition()}};_RangeSlider.prototype._updateElesPosition=function(){var t,e,i,s=this._minHandler,n=(this._rangeHandler,this._maxHandler),a=this._plotBox,r=this._isHorizontal;if(a){t=r?{left:this._minPos*a.width-.5*s.offsetWidth}:{top:(1-this._minPos)*a.height-.5*n.offsetHeight};e=r?{left:this._minPos*a.width,width:(this._maxPos-this._minPos)*a.width}:{top:(1-this._maxPos)*a.height,height:(this._maxPos-this._minPos)*a.height};i=r?{left:this._maxPos*a.width-.5*n.offsetWidth}:{top:(1-this._maxPos)*a.height-.5*s.offsetHeight};this._refreshSlider(t,e,i)}};_RangeSlider.prototype._refreshSlider=function(e,i,s){t.setCss(this._minHandler,e);t.setCss(this._rangeHandler,i);t.setCss(this._maxHandler,s)};_RangeSlider.prototype._invalidate=function(){var e,i;if(this._rsContainer){e=this._isHorizontal?_RangeSlider._HRANGESLIDER:_RangeSlider._VRANGESLIDER;i=this._isHorizontal?_RangeSlider._VRANGESLIDER:_RangeSlider._HRANGESLIDER;t.removeClass(this._rsEle,i);t.addClass(this._rsEle,e);[this._rsEle,this._rsContent,this._minHandler,this._maxHandler,this._rangeHandler].forEach((function(t){t.removeAttribute("style")}));this._refresh()}};_RangeSlider.prototype._changeRange=function(t){var e=this._maxPos-this._minPos;if(!(t<0&&0===this._minPos||t>0&&1===this._maxPos)){if(t<0){this._minPos+=t;this._minPos=this._minPos<0?0:this._minPos;this._maxPos=this._minPos+e}else{this._maxPos+=t;this._maxPos=this._maxPos>1?1:this._maxPos;this._minPos=this._maxPos-e}this._updateElesPosition()}};_RangeSlider.prototype._doSliding=function(e,i){t.getElementRect(this._rsContent),t.getElementRect(this._rangeHandler);this._clearInterval();this._startPt=new t.Point;this._changeRange(e);this.onRangeChanged();this._setSlidingInterval(e,i)};_RangeSlider.prototype._setSlidingInterval=function(e,i){var s,n=this;this._slidingInterval=window.setInterval((function(){if(i){t.getElementRect(n._rsContent);s=t.getElementRect(n._rangeHandler);if(n._isHorizontal){if(i.x>=s.left&&i.x<=s.left+s.width){n._clearInterval();return}}else if(i.y>=s.top&&i.y<=s.top+s.height){n._clearInterval();return}}n._changeRange(e);n.onRangeChanged()}),200)};_RangeSlider.prototype._clearInterval=function(){this._slidingInterval&&window.clearInterval(this._slidingInterval)};_RangeSlider.prototype._getRsRect=function(){var t=this._rangeSliderRect,e={};if(t){["left","top","width","height"].forEach((function(i){t[i]&&(e[i]=t[i])}));return e}};_RangeSlider._HRANGESLIDER="wj-chart-hrangeslider";_RangeSlider._VRANGESLIDER="wj-chart-vrangeslider";_RangeSlider._RANGESLIDER_DECBTN="wj-rangeslider-decbtn";_RangeSlider._RANGESLIDER_INCBTN="wj-rangeslider-incbtn";_RangeSlider._RANGESLIDER_RANGEHANDLE="wj-rangeslider-rangehandle";_RangeSlider._RANGESLIDER_MINHANDLE="wj-rangeslider-minhandle";_RangeSlider._RANGESLIDER_MAXHANDLE="wj-rangeslider-maxhandle";_RangeSlider._RANGESLIDER_HANDLE_ACTIVE="wj-rangeslider-handle-active";return _RangeSlider}();e._RangeSlider=i})((e=t.chart||(t.chart={})).interaction||(e.interaction={}))}(wijmo||(wijmo={}));!function(t){var e;(function(e){"use strict";var i;!function(t){t[t.X=0]="X";t[t.Y=1]="Y"}(i=e.Orientation||(e.Orientation={}));var s=function(){function RangeSelector(e,s){this._isVisible=!0;this._orientation=i.X;this._seamless=!1;this._minScale=0;this._maxScale=1;this.rangeChanged=new t.Event;this._chart=t.asType(e,t.chart.FlexChartCore,!1);this._createRangeSelector();t.copy(this,s)}Object.defineProperty(RangeSelector.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){if(e!=this._isVisible){this._isVisible=t.asBoolean(e);this._rangeSlider&&(this._rangeSlider.isVisible=e)}},enumerable:!0,configurable:!0});Object.defineProperty(RangeSelector.prototype,"min",{get:function(){return this._min},set:function(e){if((e=t.asNumber(e,!0,!1))!=this._min){var i=!1;if(null==e||void 0===e||isNaN(e)||null==this._max){this._min=e;i=!0}else if(e<=this._max||void 0===this._max){this._min=e;i=!0}this._rangeSlider&&i&&this._changeRange()}},enumerable:!0,configurable:!0});Object.defineProperty(RangeSelector.prototype,"max",{get:function(){return this._max},set:function(e){if((e=t.asNumber(e,!0,!1))!=this._max){var i=!1;if(null==e||isNaN(e)){this._max=e;i=!0}else if(e>=this._min||void 0===this._min){this._max=e;i=!0}this._rangeSlider&&i&&this._changeRange()}},enumerable:!0,configurable:!0});Object.defineProperty(RangeSelector.prototype,"orientation",{get:function(){return this._orientation},set:function(e){if((e=t.asEnum(e,i))!==this._orientation){this._orientation=e;this._rangeSlider&&(this._rangeSlider.isHorizontal=e==i.X)}},enumerable:!0,configurable:!0});Object.defineProperty(RangeSelector.prototype,"seamless",{get:function(){return this._seamless},set:function(e){if((e=t.asBoolean(e,!0))!=this._seamless){this._seamless=e;this._rangeSlider&&(this._rangeSlider.seamless=e)}},enumerable:!0,configurable:!0});Object.defineProperty(RangeSelector.prototype,"minScale",{get:function(){return this._minScale},set:function(e){if((e=t.asNumber(e))<=1&&e>=0&&e!=this._minScale&&e=0&&e!=this._maxScale&&e>this._minScale){this._maxScale=e;if(this._rangeSlider){this._rangeSlider.maxScale=t.asNumber(e);this._updateMinAndMaxWithScale(!0)}}},enumerable:!0,configurable:!0});RangeSelector.prototype.remove=function(){if(this._rangeSelectorEle){this._chart.hostElement.removeChild(this._rangeSelectorEle);this._switchEvent(!1);this._rangeSelectorEle=null;this._rangeSlider=null}};RangeSelector.prototype.onRangeChanged=function(t){this.rangeChanged.raise(this,t)};RangeSelector.prototype._createRangeSelector=function(){var s=this._chart.hostElement,n=this._orientation===i.X;this._rangeSelectorEle=t.createElement('');this._rangeSlider=new e._RangeSlider(this._rangeSelectorEle,!1,!1,{isHorizontal:n,isVisible:this._isVisible,seamless:this._seamless});s.appendChild(this._rangeSelectorEle);this._switchEvent(!0)};RangeSelector.prototype._switchEvent=function(t){var e=t?"addHandler":"removeHandler";if(this._chart.hostElement){this._rangeSlider.rangeChanged[e](this._updateRange,this);this._chart.rendered[e](this._refresh,this)}};RangeSelector.prototype._refresh=function(){var e,i,s,n=this._chart.hostElement,a=t.getElementRect(this._rangeSelectorEle);e=n.querySelector("."+t.chart.FlexChart._CSS_PLOT_AREA);i=t.getElementRect(e);if((s=e.getBBox())&&s.width&&s.height){this._adjustMinAndMax();this._rangeSlider._refresh({left:s.x,top:i.top-a.top,width:s.width,height:s.height})}};RangeSelector.prototype._adjustMinAndMax=function(){var e=this._chart,s=this._rangeSlider,n=this._min,a=this._max,r=this._orientation===i.X?e.axisX:e.axisY,h=t.isDate(r.actualMin)?r.actualMin.valueOf():r.actualMin,o=t.isDate(r.actualMax)?r.actualMax.valueOf():r.actualMax;this._min=null===n||isNaN(n)||void 0===n||no?h:n;this._max=null===a||isNaN(a)||void 0===a||ao?o:a;var _=this._chart._plotRect;if(_){var l=void 0,c=void 0;if(this._orientation===i.X){l=(r.convert(this._min)-_.left)/_.width;c=(r.convert(this._max)-_.left)/_.width}else{l=(_.top-r.convert(this._min))/_.height+1;c=(_.top-r.convert(this._max))/_.height+1}s._minPos=isNaN(l)?0:l;s._maxPos=isNaN(c)?1:c;this._updateMinAndMaxWithScale(!1)}};RangeSelector.prototype._updateMinAndMaxWithScale=function(t){var e,i=this._rangeSlider,s=!1;if(0!==this._minScale&&i._minPos+this._minScale>i._maxPos){if((e=i._minPos+this._minScale)>1){i._maxPos=1;i._minPos=1-this._minScale}else i._maxPos=e;s=!0}if(1!==this._maxScale&&i._minPos+this._maxScale1){i._maxPos=1;i._minPos=1-this._maxScale}else i._maxPos=e;s=!0}if(s){var n=this._getMinAndMax();this._min=n.min;this._max=n.max;if(t&&this._rangeSelectorEle){this._rangeSlider._refresh();this.onRangeChanged()}}};RangeSelector.prototype._changeRange=function(){this._adjustMinAndMax();if(this._rangeSelectorEle){this._rangeSlider._refresh();this.onRangeChanged()}};RangeSelector.prototype._updateRange=function(){var t;this._rangeSlider;t=this._chart;this._orientation===i.X?t.axisX:t.axisY;var e=this._getMinAndMax();this._min=e.min;this._max=e.max;this.onRangeChanged()};RangeSelector.prototype._getMinAndMax=function(){var t=this._rangeSlider,e=this._chart,s=e._plotRect,n=null,a=null;if(s)if(this._orientation===i.X){n=e.axisX.convertBack(s.left+t._minPos*s.width);a=e.axisX.convertBack(s.left+t._maxPos*s.width)}else{n=e.axisY.convertBack(s.top+(1-t._minPos)*s.height);a=e.axisY.convertBack(s.top+(1-t._maxPos)*s.height)}return{min:n,max:a}};return RangeSelector}();e.RangeSelector=s})((e=t.chart||(t.chart={})).interaction||(e.interaction={}))}(wijmo||(wijmo={}));!function(t){!function(e){e.interaction||(e.interaction={}),t._registerModule("wijmo.chart.interaction",t.chart.interaction)}(t.chart||(t.chart={}))}(wijmo||(wijmo={}));