/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../../core/accessorSupport/decorators.js";import r from"./SmartMappingSliderBase.js";import i from"./HeatmapSlider/HeatmapSliderViewModel.js";import{globalCss as l}from"../support/globalCss.js";import{messageBundle as a,tsx as o}from"../support/widget.js";var p;const n="esri-heatmap-slider",d={base:n,rampElement:`${n}__ramp`,sliderContainer:`${n}__slider-container`,track:`${n}--interactive-track`};let m=p=class extends r{constructor(e,t){super(e,t),this.messages=null,this.viewModel=new i,this.slider.set({visibleElements:{labels:!1,rangeLabels:!0},labelInputsEnabled:!1,rangeLabelInputsEnabled:!1}),this._rampFillId=`${this.id}-ramp-fill`}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get stops(){return this.viewModel.stops}set stops(e){this.viewModel.stops=e}static fromHeatmapRendererResult(e){return new p({stops:e.renderer.colorStops})}render(){const{state:e,label:t,visibleElements:s}=this,r="disabled"===e,i=this.classes(d.base,l.widget,l.panel,{[l.disabled]:r,[d.track]:!!s.interactiveTrack});return o("div",{"aria-label":t,class:i},r?null:this.renderContent(this._renderRamp(),d.sliderContainer))}_renderRamp(){const{_rampFillId:e,viewModel:t}=this,s=t.getStopInfo();return o("div",{class:d.rampElement},o("svg",{xmlns:"http://www.w3.org/2000/svg"},o("defs",null,this.renderRampFillDefinition(e,s)),o("rect",{fill:`url(#${e})`,height:"100%",width:"100%",x:"0",y:"0"})))}};e([t()],m.prototype,"label",null),e([t(),a("esri/widgets/smartMapping/HeatmapSlider/t9n/HeatmapSlider")],m.prototype,"messages",void 0),e([t()],m.prototype,"stops",null),e([t({type:i})],m.prototype,"viewModel",void 0),m=p=e([s("esri.widgets.smartMapping.HeatmapSlider")],m);const c=m;export{c as default};
