text: var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n},wijmo;(function(e){(function(t){"use strict";var n=jQuery,r="wijslider",i="ui-slider-handle",s=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype._valueMin=function(){return n.ui.slider.prototype._valueMin.apply(this,arguments)},t.prototype._valueMax=function(){return n.ui.slider.prototype._valueMax.apply(this,arguments)},t.prototype._refreshValue=function(){return n.ui.slider.prototype._refreshValue.apply(this,arguments)},t.prototype._create=function(){return n.ui.slider.prototype._create.apply(this,arguments)},t.prototype._createHandles=function(){return n.ui.slider.prototype._createHandles.apply(this,arguments)},t.prototype.values=function(e,t){return n.ui.slider.prototype.values.apply(this,arguments)},t.prototype.value=function(e){return n.ui.slider.prototype.value.apply(this,arguments)},t.prototype._slide=function(e,t,r){return n.ui.slider.prototype._slide.apply(this,arguments)},t.prototype._change=function(e,t){return n.ui.slider.prototype._change.apply(this,arguments)},t.prototype._normValueFromMouse=function(e){return n.ui.slider.prototype._normValueFromMouse.apply(this,arguments)},t}(e.JQueryUIWidget);t.JQueryUISlider=s;var o=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype._setOption=function(e,t){return e==="values"?(t=this._pre_set_values(t),this.options[e]=t,this._setValuesOption()):e==="disabled"?(this.element.toggleClass(this.options.wijCSS.stateDisabled,!!t),this.options[e]=t):n.ui.slider.prototype._setOption.apply(this,arguments),e==="range"&&this._setRangeOption(t),this},t.prototype._setRangeOption=function(e){var t=this,n=t.options,r;e===!0&&(!n.values||n.values&&n.values.length===0?(r=t._valueMin(),n.values=[r,r]):n.values.length&&n.values.length!==2&&(r=n.values[0],n.values=[r,r]),t._refresh_handle(2)),t._re_createRange(),t._refreshValue()},t.prototype._setValuesOption=function(){var e=this,t=0,r;e._animateOff=!0,e._refreshValue(),n.isArray(e.options.values)&&(t=e.options.values.length);for(r=0;r<t;r++)e._change(null,r);e._animateOff=!1},t.prototype._re_createRange=function(){var e=this,t=e.options,r=t.wijCSS;e.range&&(e.range.remove(),n(".ui-slider-range",e.element).length>0&&n(".ui-slider-range",e.element).remove()),t.range&&(e.range=n("<div></div>").appendTo(e.element).addClass(r.uiSliderRange).addClass(r.header),t.range==="min"?e.range.addClass(r.uiSliderRangeMin):t.range==="max"&&e.range.addClass(r.uiSliderRangeMax))},t.prototype._pre_set_values=function(e){var t=this,n=t.options,r=1,i;return r=e&&e.length?e.length:1,n.range===!0&&(!e||e&&e.length===0?(i=t._valueMin(),e=[i,i]):e.length&&e.length!==2&&(i=e[0],e=[i,i]),r=2),t._refresh_handle(r),t._re_createRange(),e},t.prototype._createHandles=function(){var t=this.options.wijCSS;e.prototype._createHandles.call(this),this.handles.each(function(e){n(this).removeClass("ui-slider-handle").removeClass("ui-state-default").removeClass("ui-corner-all").addClass(i).addClass(t.uiSliderHandle).addClass(t.stateDefault).addClass(t.cornerAll)})},t.prototype._refresh_handle=function(e){var t=this,n=this.options.wijCSS,r=t.handles.length,s="<a class='"+i+" "+n.uiSliderHandle+" "+n.stateDefault+" "+n.cornerAll+"' href='#'></a>",o=[],u;if(r!==e){if(e>r){for(u=r;u<e;u++)o.push(s);t.element.append(o.join(""))}else t.element.find("."+i).eq(e-1).nextAll().remove();t.handles=t.element.find("."+i)}},t.prototype._initState=function(){this._dragFillTarget=!1,this._dragFillStart=0,this._rangeValue=0,this._oldValue1=0,this._oldValue2=0,this._oldX=0,this._oldY=0},t.prototype._create=function(){var t=this,r=t.element,s=t.options,o=s.wijCSS,u,a,f,l,c,h,p,d,v,m,g;window.wijmoApplyWijTouchUtilEvents&&(n=window.wijmoApplyWijTouchUtilEvents(n)),this._initState(),t._oriStyle=r.attr("style");if(r.is(":input")){s.orientation==="horizontal"?u=n("<div></div>").width(r.width()).appendTo(document.body):u=n("<div></div>").height(r.height()).appendTo(document.body),a=r.val();if(a!=="")try{f=a.split(";"),c=f.length;if(c>0){for(l=0;l<c;l++)f[l]=parseInt(f[l],10);c===1?s.value=f[0]:s.values=f}}catch(y){}r.data(t.widgetName,u.wijslider(s)).after(n(document.body).children("div:last")).hide();if(s.disabledState){var b=s.disabled;t.disable(),s.disabled=b}return}e.prototype._create.call(this),t.range&&t.range.removeClass("ui-slider-range").addClass(o.uiSliderRange),r.removeClass("ui-slider").removeClass("ui-slider-"+this.options.orientation).removeClass("ui-widget").removeClass("ui-widget-content").removeClass("ui-corner-all").addClass(o.uiSlider).addClass(s.orientation==="horizontal"?o.uiSliderHorizontal:o.uiSliderVertical).addClass(o.widget).addClass(o.content).addClass(o.cornerAll),r.data("originalStyle",r.attr("style")),r.data("originalContent",r.html()),h=r.width(),p=r.height(),d=n("<div></div>"),s.orientation==="horizontal"?d.addClass(o.wijmoSliderHorizontal):d.addClass(o.wijmoSliderVertical),d.width(h).height(p),v=n("<a><span></span></a>").addClass(o.wijmoSliderDecButton),m=n("<a><span></span></a>").addClass(o.wijmoSliderIncButton),r.wrap(d).before(v).after(m),t._container=r.parent(),t._attachClass(),g=r.find("."+i),t._adjustSliderLayout(v,m,g);if(s.disabledState){var b=s.disabled;t.disable(),s.disabled=b}t.element.is(":hidden")&&t.element.wijAddVisibilityObserver&&t.element.wijAddVisibilityObserver(function(){t._refreshSlider(),t.element.wijRemoveVisibilityObserver&&t.element.wijRemoveVisibilityObserver()},"wijslider"),t._bindEvents()},t.prototype.values=function(e,t){return n.ui.slider.prototype.values.apply(this,arguments)},t.prototype.value=function(e){return n.ui.slider.prototype.value.apply(this,arguments)},t.prototype.refresh=function(){var e=this.element.data("wijslider"),t=this.element.data("wijmo-wijslider");this.destroy(),this.element.data("wijslider",e),this.element.data("wijmo-wijslider",t),this._create()},t.prototype._refreshSlider=function(){var e=this,t=e.options.wijCSS,n,r,s;r=e._container.find("."+t.wijmoSliderDecButton),n=e._container.find("."+t.wijmoSliderIncButton),s=e._container.find("."+i),e._adjustSliderLayout(r,n,s),e._refreshValue()},t.prototype._adjustSliderLayout=function(e,t,n){var r=this,i=r.element,s=r.options,o,u,a,f,l,c,h,p,d,v,m,g;o=r._container.width(),u=r._container.height(),a=e.outerWidth(),f=e.outerHeight(),l=t.outerWidth(),c=t.outerHeight(),h=n.outerWidth(),p=n.outerHeight(),s.orientation==="horizontal"?(d=u/2-f/2,e.css("top",d).css("left",0),v=u/2-c/2,t.css("top",v).css("right",0),i.css("left",a+h/2-1).css("top",u/2-i.outerHeight()/2).width(o-a-l-h-2)):(m=o/2-a/2,e.css("left",m).css("top",0),g=o/2-l/2,t.css("left",g).css("bottom",0),i.css("left",o/2-i.outerWidth()/2).css("top",f+p/2+1).height(u-f-c-p-2))},t.prototype.destroy=function(){var t=this,r,s,o=t.options.wijCSS;r=this._getDecreBtn(),s=this._getIncreBtn(),r.unbind("."+t.widgetName),s.unbind("."+t.widgetName),t.element.removeClass(o.uiSlider).removeClass(o.uiSliderHorizontal).removeClass(o.uiSliderVertical).removeClass(o.widget).removeClass(o.content).removeClass(o.cornerAll).removeClass(i),e.prototype.destroy.call(this),n("a",t.element.parent()).remove(),t.element.unbind("."+t.widgetName),t.element.unwrap(),t._oriStyle===undefined?t.element.removeAttr("style"):t.element.attr("style",t._oriStyle),t.element.removeData(t.widgetName).removeData("originalStyle").removeData("originalContent"),t.disabledDiv&&(t.disabledDiv.remove(),t.disabledDiv=null)},t.prototype._slide=function(t,n,r){var i=this,s=i.options,o=s.minRange,u=r,a;s.range===!0&&(a=i.values(),n===0&&a[1]-o<r?u=a[1]-o:n===1&&a[0]+o>r&&(u=a[0]+o)),e.prototype._slide.call(this,t,n,u)},t.prototype._getDecreBtn=function(){var e=this.element.parent().find("."+this.options.wijCSS.wijmoSliderDecButton);return e},t.prototype._getIncreBtn=function(){var e=this.element.parent().find("."+this.options.wijCSS.wijmoSliderIncButton);return e},t.prototype._attachClass=function(){var e=this.options.wijCSS;this._getDecreBtn().addClass(e.cornerAll).addClass(e.stateDefault).attr("role","button"),this._getIncreBtn().addClass(e.cornerAll).addClass(e.stateDefault).attr("role","button"),this.element.parent().attr("role","slider").attr("aria-valuemin",this.options.min).attr("aria-valuenow","0").attr("aria-valuemax",this.options.max),this.options.orientation==="horizontal"?(this.element.parent().addClass(e.wijmoSliderHorizontal),this._getDecreBtn().find("> span").addClass(e.icon).addClass(e.iconArrowLeft),this._getIncreBtn().find("> span").addClass(e.icon).addClass(e.iconArrowRight)):(this.element.parent().addClass(e.wijmoSliderVertical),this._getDecreBtn().find("> span").addClass(e.icon).addClass(e.iconArrowUp),this._getIncreBtn().find("> span").addClass(e.icon).addClass(e.iconArrowDown))},t.prototype._bindEvents=function(){var e=this,t,n,r;t=this._getDecreBtn(),n=this._getIncreBtn(),r=e.element,t.bind("click."+e.widgetName,e,e._decreBtnClick),n.bind("click."+e.widgetName,e,e._increBtnClick),t.bind("mouseover."+e.widgetName,e,e._decreBtnMouseOver),t.bind("mouseout."+e.widgetName,e,e._decreBtnMouseOut),t.bind("mousedown."+e.widgetName,e,e._decreBtnMouseDown),t.bind("mouseup."+e.widgetName,e,e._decreBtnMouseUp),n.bind("mouseover."+e.widgetName,e,e._increBtnMouseOver),n.bind("mouseout."+e.widgetName,e,e._increBtnMouseOut),n.bind("mousedown."+e.widgetName,e,e._increBtnMouseDown),n.bind("mouseup."+e.widgetName,e,e._increBtnMouseUp),r.bind("mouseup."+e.widgetName,e,e._elementMouseupEvent)},t.prototype._decreBtnMouseOver=function(e){var t=e.data,n,r;if(t.options.disabledState||t.options.disabled)return;n={buttonType:"decreButton"},t._trigger("buttonMouseOver",e,n),r=t._getDecreBtn(),r.addClass(t.options.wijCSS.stateHover)},t.prototype._increBtnMouseOver=function(e){var t=e.data,n,r;if(t.options.disabledState||t.options.disabled)return;n={buttonType:"increButton"},t._trigger("buttonMouseOver",e,n),r=t._getIncreBtn(),r.addClass(t.options.wijCSS.stateHover)},t.prototype._decreBtnMouseOut=function(e){var t=e.data,n,r,i=t.options.wijCSS;if(t.options.disabledState||t.options.disabled)return;n={buttonType:"decreButton"},t._trigger("buttonMouseOut",e,n),r=t._getDecreBtn(),r.removeClass(i.stateHover).removeClass(i.stateActive)},t.prototype._increBtnMouseOut=function(e){var t=e.data,n,r,i=t.options.wijCSS;if(t.options.disabledState||t.options.disabled)return;n={buttonType:"increButton"},t._trigger("buttonMouseOut",e,n),r=t._getIncreBtn(),r.removeClass(i.stateHover).removeClass(i.stateActive)},t.prototype._decreBtnMouseDown=function(e){var t=e.data,r,i;if(t.options.disabledState||t.options.disabled)return;r={buttonType:"decreButton"},t._trigger("buttonMouseDown",e,r),i=t._getDecreBtn(),i.addClass(t.options.wijCSS.stateActive),n(document).bind("mouseup."+t.widgetName,{self:t,ele:i},t._documentMouseUp),t._intervalID!==null&&(window.clearInterval(t._intervalID),t._intervalID=null),t._intervalID=window.setInterval(function(){t._decreBtnHandle(t)},200)},t.prototype._documentMouseUp=function(e){var t=e.data.self,r=e.data.ele;if(t.options.disabledState||t.options.disabled)return;r.removeClass(t.options.wijCSS.stateActive),t._intervalID!==null&&(window.clearInterval(t._intervalID),t._intervalID=null),n(document).unbind("mouseup."+t.widgetName,t._documentMouseUp)},t.prototype._increBtnMouseDown=function(e){var t=e.data,r,i;if(t.options.disabledState||t.options.disabled)return;r={buttonType:"increButton"},t._trigger("buttonMouseDown",e,r),i=t._getIncreBtn(),i.addClass(t.options.wijCSS.stateActive),n(document).bind("mouseup."+t.widgetName,{self:t,ele:i},t._documentMouseUp),t._intervalID!==null&&(window.clearInterval(t._intervalID),t._intervalID=null),t._intervalID=window.setInterval(function(){t._increBtnHandle(t)},200)},t.prototype._decreBtnMouseUp=function(e){var t=e.data,n,r;if(t.options.disabledState||t.options.disabled)return;n={buttonType:"decreButton"},t._trigger("buttonMouseUp",e,n),r=t._getDecreBtn(),r.removeClass(t.options.wijCSS.stateActive),window.clearInterval(t._intervalID)},t.prototype._increBtnMouseUp=function(e){var t=e.data,n,r;if(t.options.disabledState||t.options.disabled)return;n={buttonType:"increButton"},t._trigger("buttonMouseUp",e,n),r=t._getIncreBtn(),r.removeClass(t.options.wijCSS.stateActive),window.clearInterval(t._intervalID)},t.prototype._decreBtnHandle=function(e){e.options.orientation==="horizontal"?e._decre():e._incre()},t.prototype._decreBtnClick=function(e){var t=e.data,n;if(t.options.disabledState||t.options.disabled)return;t._mouseSliding=!1,t._decreBtnHandle(t),n={buttonType:"decreButton",value:t.value()},t._trigger("buttonClick",e,n)},t.prototype._increBtnHandle=function(e){e.options.orientation==="horizontal"?e._incre():e._decre()},t.prototype._increBtnClick=function(e){var t=e.data,n;if(t.options.disabledState||t.options.disabled)return;t._mouseSliding=!1,t._increBtnHandle(t),n={buttonType:"increButton",value:t.value()},t._trigger("buttonClick",e,n)},t.prototype._decre=function(){var e=this,t=e.value(),n=e.options,r=n.min,i=n.step;n.values&&n.values.length?(t=e.values(0),t<=r?e.values(0,r):e.values(0,t-i)):(t=e.value(),t<=r?e.value(r):e.value(t-i)),e.element.parent().attr("aria-valuenow",e.value())},t.prototype._incre=function(){var e=this,t=e.value(),n=e.options,r=n.max,i=n.step,s;n.values&&n.values.length?(s=n.values.length===1?0:1,t=e.values(s),t>=r?e.values(s,r):e.values(s,t+i)):(t=e.value(),t>=r?e.value(r):e.value(t+i)),e.element.parent().attr("aria-valuenow",e.value())},t.prototype._elementMouseupEvent=function(e){var t=e.data;t.options.dragFill&&t.options.range&&(t._dragFillStart>0?t._dragFillStart=0:n.ui.slider.prototype._mouseCapture.apply(t,arguments))},t.prototype._isUISlider=function(e){var t=this.options.wijCSS,r=n(e);return r.hasAllClasses(t.uiSliderRange)&&r.hasAllClasses(t.header)&&r.hasAllClasses(t.cornerAll)||r.hasAllClasses(t.uiSliderRange)&&r.hasAllClasses(t.header)},t.prototype._mouseCapture=function(e){this.element.parent().attr("aria-valuenow",this.value());if(this.options.dragFill){if(this._isUISlider(e.target))return this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),!0;try{return n.ui.slider.prototype._mouseCapture.apply(this,arguments)}catch(t){}}else try{return n.ui.slider.prototype._mouseCapture.apply(this,arguments)}catch(t){}},t.prototype._mouseStart=function(e){if(this.options.dragFill){if(e.target&&this._isUISlider(e.target))return this._setStateForDragFill(e),!0;this._dragFillTarget=!1}return!0},t.prototype._mouseDrag=function(e){return this.options.dragFill?this._processDragFill(e)?!1:n.ui.slider.prototype._mouseDrag.apply(this,arguments):n.ui.slider.prototype._mouseDrag.apply(this,arguments)},t.prototype._mouseStop=function(e){var t=n.ui.slider.prototype._mouseStop.apply(this,arguments);return this.options.dragFill&&this._resetStateForDragFill(),t},t.prototype._setStateForDragFill=function(e){this._dragFillTarget=!0,this._rangeValue=this.values(1)-this.values(0),this._oldValue1=this.values(0),this._oldValue2=this.values(1),this._oldX=e.pageX,this._oldY=e.pageY},t.prototype._resetStateForDragFill=function(){n(document.documentElement).css("cursor","default"),window.setTimeout(function(){this._dragFillTarget=!1,this._dragFillStart=0},500)},t.prototype._processDragFill=function(e){var t,r,i,s,o,u,a,f;return t=e.pageX-this._oldX,r=this.element.outerWidth(),this.options.orientation==="vertical"&&(r=this.element.outerHeight(),t=-(e.pageY-this._oldY)),i=(this.options.max-this.options.min)/r*t,this._dragFillTarget?(this.options.orientation==="vertical"?n(document.documentElement).css("cursor","s-resize"):n(document.documentElement).css("cursor","w-resize"),this._dragFillStart>0&&(s=this._rangeValue,this.values(0,this._oldValue1+i),this.values(1,this._oldValue1+i+s),o=this.values(0),u=this.values(1),o+s>this.options.max&&this.values(0,this.options.max-s),u-s<this.options.min&&this.values(1,this.options.min+s)),this._dragFillStart++,!0):!1},t}(s);t.wijslider=o,o.prototype.widgetEventPrefix="wijslider";var u=function(){function e(){this.wijCSS={uiSliderRange:"ui-slider-range",uiSliderHandle:"ui-slider-handle",wijmoSliderDecButton:"wijmo-wijslider-decbutton",wijmoSliderIncButton:"wijmo-wijslider-incbutton",wijmoSliderHorizontal:"wijmo-wijslider-horizontal",wijmoSliderVertical:"wijmo-wijslider-vertical",uiSliderRangeMax:"ui-slider-range-max",uiSliderRangeMin:"ui-slider-range-min",uiSlider:"ui-slider",uiSliderHorizontal:"ui-slider-horizontal",uiSliderVertical:"ui-slider-vertical"},this.buttonMouseOver=null,this.buttonMouseOut=null,this.buttonMouseDown=null,this.buttonMouseUp=null,this.buttonClick=null,this.dragFill=!0,this.minRange=0,this.animate=!1,this.max=100,this.min=0,this.orientation="horizontal",this.range=!1,this.step=1,this.value=0,this.values=null,this.change=null,this.slide=null,this.start=null,this.stop=null}return e}();n.ui&&n.ui.slider&&(o.prototype.options=n.extend(!0,{},n.ui.slider.prototype.options,e.wijmoWidget.prototype.options,new u),n.wijmo.registerWidget(r,n.ui.slider,o.prototype))})(e.slider||(e.slider={}));var t=e.slider})(wijmo||(wijmo={}));