/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as t,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Slider/SliderViewModel.js";import{formatDateLabel as s,formatNumberLabel as n}from"../smartMapping/support/utils.js";let o=class extends a{constructor(e){super({...e,suppressDeprecationWarning:!0}),this.average=null,this.bins=null,this.hasTimeData=!1,this.labelFormatFunction=e=>{if(this.hasTimeData)return s(e);const{max:t,min:r,precision:a}=this,o=t-r>10?2:a;return n(parseFloat(e.toFixed(o)))},this.rangeType="equal",this.standardDeviation=null}generateWhereClause(e){const{rangeType:t,state:r,values:a}=this;if("ready"!==r||!a?.length||null==e)return null;const s=a[0],n=a.length>1?a[a.length-1]:null;switch(t){case"equal":return`${e} = ${s}`;case"not-equal":return`${e} <> ${s}`;case"less-than":return`${e} < ${s}`;case"greater-than":return`${e} > ${s}`;case"at-least":return`${e} >= ${s}`;case"at-most":return`${e} <= ${s}`;case"between":return`${e} BETWEEN ${s} AND ${n}`;case"not-between":return`${e} NOT BETWEEN ${s} AND ${n}`;default:return null}}};e([t()],o.prototype,"average",void 0),e([t()],o.prototype,"bins",void 0),e([t()],o.prototype,"hasTimeData",void 0),e([t()],o.prototype,"labelFormatFunction",void 0),e([t()],o.prototype,"rangeType",void 0),e([t()],o.prototype,"standardDeviation",void 0),o=e([r("esri.widgets.HistogramRangeSlider.HistogramRangeSliderViewModel")],o);const i=o;export{i as default};
