import{u as M}from"./vendor-vue-runtime-dom-B2rky8vu.js";import{m as S}from"./vendor-vueform-slider-CCH9_7pb.js";import{u as j}from"./useAppearanceTypography-BBl5RU11.js";import{d as A,e as m,f as c,i,x as u,j as B,t as _,F as P,r as R}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{u as o,t as z}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as d,b as D,a as p}from"./vendor-vue-shared-DrzsEcag.js";import"./useAppearanceStore-IzenP-G4.js";import"./vendor-pinia-BSPefQhS.js";import"./vendor-axios-xsH4HHeE.js";import"./vendor-vue3-toastify-DBGjcIyK.js";const E={class:"slider-min-max"},L={class:"slider-min-max-item first"},$={class:"label"},q={class:"slider-min-max-item"},G={class:"label"},H={key:0,class:"custom-marks"},Z=A({__name:"Small",props:{field:{}},setup(x){M(a=>({dd7891a8:o(g),"3a03640f":o(k),"9b1c252e":o(b),"2097dc8e":o(h)}));const{formFieldsColor:h,textColor:b,accentColor:g,containerColor:k}=j(),y=x,{field:s}=z(y),n=(a,l)=>{const e=Number(a);return Number.isFinite(e)?e:l},t=m(()=>n(s.value.min??s.value.minValue,0)),r=m(()=>{const a=n(s.value.max??s.value.maxValue,t.value+100);return a>t.value?a:t.value+1}),C=m(()=>{if(s.value.jump)return 1;const a=n(s.value.step,1);return a>0?a:1}),v=m(()=>{const a=Array.isArray(s.value.values)?s.value.values:[],l=a[0]??s.value.default??s.value.defaultValue??t.value,e=a[1]??r.value,f=Math.min(r.value,Math.max(t.value,n(l,t.value))),w=Math.min(r.value,Math.max(f,n(e,r.value)));return[f,w]}),N=a=>{const l=a.toFixed(2);return parseFloat(l).toString()},V=m(()=>{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)}),F=a=>{const l=Math.max(1,r.value-t.value);return{left:`${(a-t.value)/l*100}%`}};return(a,l)=>(i(),c("div",{class:p(["slider-wrapper ccb-small-multi-range-field",{jump:o(s).jump}])},[u("div",E,[u("div",L,[u("span",$,d(t.value),1)]),u("div",q,[u("span",G,d(r.value),1)])]),B(o(S),{style:{margin:"10px 0"},format:N,min:t.value,max:r.value,step:C.value,disabled:!0,"model-value":v.value,"show-tooltip":"focus"},null,8,["min","max","step","model-value"]),o(s).scalePoints?(i(),c("div",H,[(i(!0),c(P,null,R(V.value,e=>(i(),c("div",{key:e,class:"mark",style:D(F(e))},[u("div",{class:p(["tick",{"tick-passed":e>=v.value[0]&&e<=v.value[1]}])},null,2),e!==t.value&&e!==r.value?(i(),c("div",{key:0,class:p(["label",{"label-passed":e<=v.value[0]}])},d(e),3)):_("",!0)],4))),128))])):_("",!0)],2))}});export{Z as default};
//# sourceMappingURL=Small-Da8mSFjF.js.map
