import{u as M}from"./vendor-vue-runtime-dom-B2rky8vu.js";import{m as j}from"./vendor-vueform-slider-CCH9_7pb.js";import{u as S}from"./useAppearanceTypography-BBl5RU11.js";import{d as A,e as n,f as c,i,x as m,j as B,t as p,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 v,b as D,a as E}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 L={class:"slider-min-max"},$={class:"slider-min-max-item first"},q={class:"label"},G={class:"slider-min-max-item"},H={class:"label"},I={key:0,class:"custom-marks"},J={key:0,class:"label"},ae=A({__name:"Flat",props:{field:{}},setup(f){M(e=>({"68a399dd":o(b),cd5e9084:o(g),edc66f4c:o(h),"4ccdb08a":o(_),"7a1133ea":o(x)}));const{borderColor:_,formFieldsColor:x,textColor:h,accentColor:b,containerColor:g}=S(),y=f,{field:t}=z(y),u=(e,l)=>{const a=Number(e);return Number.isFinite(a)?a:l},s=n(()=>u(t.value.min??t.value.minValue,0)),r=n(()=>{const e=u(t.value.max??t.value.maxValue,s.value+100);return e>s.value?e:s.value+1}),C=n(()=>{if(t.value.jump)return 1;const e=u(t.value.step,1);return e>0?e:1}),N=n(()=>{const e=Array.isArray(t.value.values)?t.value.values:[],l=e[0]??t.value.default??t.value.defaultValue??s.value,a=e[1]??r.value,d=Math.min(r.value,Math.max(s.value,u(l,s.value))),w=Math.min(r.value,Math.max(d,u(a,r.value)));return[d,w]}),k=e=>{const l=e.toFixed(2);return parseFloat(l).toString()},F=n(()=>{var l;return(((l=t.value.scalePoints)==null?void 0:l.trim())||"").split(",").map(a=>Number(a.trim())).filter(a=>!isNaN(a)&&a>=s.value&&a<=r.value)}),V=e=>{const l=Math.max(1,r.value-s.value);return{left:`${(e-s.value)/l*100}%`}};return(e,l)=>(i(),c("div",{class:E(["slider-wrapper ccb-flat-multi-range-field",{jump:o(t).jump}])},[m("div",L,[m("div",$,[m("span",q,v(s.value),1)]),m("div",G,[m("span",H,v(r.value),1)])]),B(o(j),{style:{margin:"10px 0"},format:k,min:s.value,max:r.value,step:C.value,disabled:!0,"model-value":N.value,"show-tooltip":"focus"},null,8,["min","max","step","model-value"]),o(t).scalePoints?(i(),c("div",I,[(i(!0),c(P,null,R(F.value,a=>(i(),c("div",{key:a,class:"mark",style:D(V(a))},[a!==s.value&&a!==r.value?(i(),c("div",J,v(a),1)):p("",!0)],4))),128))])):p("",!0)],2))}});export{ae as default};
//# sourceMappingURL=Flat--eEiXLAx.js.map
