import{m as k}from"./vendor-vueform-slider-CCH9_7pb.js";import{d as y,e as u,f as n,i as o,x as m,j as F,t as f,F as V,r as j}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as w,u as i}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as v,a as d,b as M}from"./vendor-vue-shared-DrzsEcag.js";const S={class:"slider-min-max"},B={class:"slider-min-max-item first"},C={class:"label"},P={class:"label"},z={key:0,class:"custom-marks"},$=y({__name:"Flat",props:{field:{}},setup(_){const x=_,{field:s}=w(x),c=(a,l)=>{const e=Number(a);return Number.isFinite(e)?e:l},t=u(()=>c(s.value.min??s.value.minValue,0)),r=u(()=>{const a=c(s.value.max??s.value.maxValue,t.value+100);return a>t.value?a:t.value+1}),p=u(()=>{const a=c(s.value.defaultValue??s.value.default??s.value.value,t.value);return Math.min(r.value,Math.max(t.value,a))}),b=u(()=>{if(s.value.jump)return 1;const a=c(s.value.step,1);return a>0?a:1}),h=u(()=>{var l;return(((l=s.value.scalePoints)==null?void 0:l.trim())||"").split(",").map(e=>Number(e.trim())).filter(e=>!isNaN(e)&&e>=t.value&&e<=r.value)}),g=a=>{const l=Math.max(1,r.value-t.value);return{left:`${(a-t.value)/l*100}%`}},N=a=>{const l=a.toFixed(2);return parseFloat(l).toString()};return(a,l)=>(o(),n("div",{class:d(["slider-wrapper ccb-flat-range-field",{jump:i(s).jump}])},[m("div",S,[m("div",B,[m("span",C,v(t.value),1)]),m("div",{class:d(["slider-min-max-item",{done:p.value>=r.value}])},[m("span",P,v(r.value),1)],2)]),F(i(k),{"model-value":r.value,min:t.value,max:r.value,step:b.value,disabled:!0,"show-tooltip":"focus",class:"custom-slider",format:N},null,8,["model-value","min","max","step"]),i(s).scalePoints?(o(),n("div",z,[(o(!0),n(V,null,j(h.value,e=>(o(),n("div",{key:e,class:"mark",style:M(g(e))},[e!==t.value&&e!==r.value?(o(),n("div",{key:0,class:d(["label",{"label-passed":e<=p.value}])},v(e),3)):f("",!0)],4))),128))])):f("",!0)],2))}});export{$ as default};
//# sourceMappingURL=Flat-DcF9MbA2.js.map
