import{r as t,h as s,g as i}from"./p-3ba9c73c.js";const h=class{constructor(s){t(this,s),this.min=0,this.max=10,this.step=1,this.disabled=!1,this.discrete=!1,this.value=void 0,this.defaultValue=()=>this.max<this.min?this.min:(this.max-this.min)/2+this.min,this.handleChange=t=>{const s=t.target.value;this.setFillWidth(s),this.value=s}}componentDidLoad(){this.value=this.value||this.defaultValue(),this.setFillWidth(this.value)}setFillWidth(t){const s=100/(this.max-this.min)*this.step;this.el.style.setProperty("--fill-width",`${t*s-s*this.min}%`)}render(){return[s("input",{onInput:this.handleChange,type:"range",step:this.step,min:this.min,max:this.max,value:this.value})]}get el(){return i(this)}static get style(){return"bce-slider{--bce-color-l:var(--bce-color-primary-l);--bce-color-n:var(--bce-color-primary-n);--bce-color-d:var(--bce-color-primary-d);--bce-color-t:var(--bce-color-primary-t);--fill-width:0;position:relative;width:100%;height:100%}bce-slider input[type=range]{outline:0;border:0;border-radius:20px;width:100%;-webkit-transition:-webkit-box-shadow .2s ease-in-out;transition:-webkit-box-shadow .2s ease-in-out;transition:box-shadow .2s ease-in-out;transition:box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}\@media screen and (-webkit-min-device-pixel-ratio:0){bce-slider input[type=range]{height:5px;-webkit-appearance:none;background:-webkit-gradient(linear,left top,right top,from(var(--bce-color-n)),color-stop(0,var(--bce-color-light-d)));background:linear-gradient(90deg,var(--bce-color-n) var(--fill-width),var(--bce-color-light-d) 0)}bce-slider input[type=range]::-webkit-slider-runnable-track{height:20px;-webkit-appearance:none}bce-slider input[type=range]::-webkit-slider-thumb{position:relative;-webkit-appearance:none;margin-top:-1px;width:20px;height:20px;background:var(--bce-color-n);border-radius:50%}}bce-slider input[type=range]::-moz-range-progress{background-color:var(--bce-color-n)}bce-slider input[type=range]::-moz-range-track{background-color:var(--bce-color-light-d)}bce-slider input[type=range]::-ms-fill-lower{background-color:var(--bce-color-n)}bce-slider input[type=range]::-ms-fill-upper{background-color:var(--bce-color-light-d)}"}};export{h as bce_slider};