1import{r as c,j as u}from"./chunk-EPOLDU6W-CxgJcEgm.js";import{c as N}from"./middleware-BKlo1DDV.js";import{c as ce,u as de,f as $}from"./select-gxxV5-6Y.js";import{j as ue,b as fe,f as _,e as I,u as C}from"./constants-PvOxmKYJ.js";import{u as me}from"./check-CA7HSvgX.js";import{u as he}from"./TooltipPopover-C9ePVnGo.js";var X=["PageUp","PageDown"],G=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],W={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[H,Se,pe]=ce(M),[q]=fe(M,[pe]),[ge,B]=q(M),J=c.forwardRef((e,t)=>{const{name:n,min:o=0,max:i=100,step:l=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:d=0,defaultValue:w=[o],value:p,onValueChange:s=()=>{},onValueCommit:f=()=>{},inverted:v=!1,form:y,...g}=e,h=c.useRef(new Set),m=c.useRef(0),b=r==="horizontal"?ve:we,[S=[],A]=ue({prop:p,defaultProp:w,onChange:x=>{[...h.current][m.current]?.focus(),s(x)}}),T=c.useRef(S);function k(x){const R=Pe(S,x);j(x,R)}function ae(x){j(x,m.current)}function le(){const x=T.current[m.current];S[m.current]!==x&&f(S)}function j(x,R,{commit:V}={commit:!1}){const F=Ce(l),z=Me(Math.round((x-o)/l)*l+o,F),K=$(z,[o,i]);A((E=[])=>{const P=ye(E,K,R);if(_e(P,d*l)){m.current=P.indexOf(K);const Y=String(P)!==String(E);return Y&&V&&f(P),Y?P:E}else return E})}return u.jsx(ge,{scope:e.__scopeSlider,name:n,disabled:a,min:o,max:i,valueIndexToChangeRef:m,thumbs:h.current,values:S,orientation:r,form:y,children:u.jsx(H.Provider,{scope:e.__scopeSlider,children:u.jsx(H.Slot,{scope:e.__scopeSlider,children:u.jsx(b,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(T.current=S)}),min:o,max:i,inverted:v,onSlideStart:a?void 0:k,onSlideMove:a?void 0:ae,onSlideEnd:a?void 0:le,onHomeKeyDown:()=>!a&&j(o,0,{commit:!0}),onEndKeyDown:()=>!a&&j(i,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:R})=>{if(!a){const z=X.includes(x.key)||x.shiftKey&&G.includes(x.key)?10:1,K=m.current,E=S[K],P=l*z*R;j(E+P,K,{commit:!0})}}})})})})});J.displayName=M;var[Q,Z]=q(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ve=c.forwardRef((e,t)=>{const{min:n,max:o,dir:i,inverted:l,onSlideStart:r,onSlideMove:a,onSlideEnd:d,onStepKeyDown:w,...p}=e,[s,f]=c.useState(null),v=C(t,b=>f(b)),y=c.useRef(void 0),g=de(i),h=g==="ltr",m=h&&!l||!h&&l;function D(b){const S=y.current||s.getBoundingClientRect(),A=[0,S.width],k=U(A,m?[n,o]:[o,n]);return y.current=S,k(b-S.left)}return u.jsx(Q,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width",children:u.jsx(ee,{dir:g,"data-orientation":"horizontal",...p,ref:v,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const S=D(b.clientX);r?.(S)},onSlideMove:b=>{const S=D(b.clientX);a?.(S)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:b=>{const A=W[m?"from-left":"from-right"].includes(b.key);w?.({event:b,direction:A?-1:1})}})})}),we=c.forwardRef((e,t)=>{const{min:n,max:o,inverted:i,onSlideStart:l,onSlideMove:r,onSlideEnd:a,onStepKeyDown:d,...w}=e,p=c.useRef(null),s=C(t,p),f=c.useRef(void 0),v=!i;function y(g){const h=f.current||p.current.getBoundingClientRect(),m=[0,h.height],b=U(m,v?[o,n]:[n,o]);return f.current=h,b(g-h.top)}return u.jsx(Q,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:u.jsx(ee,{"data-orientation":"vertical",...w,ref:s,style:{...w.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const h=y(g.clientY);l?.(h)},onSlideMove:g=>{const h=y(g.clientY);r?.(h)},onSlideEnd:()=>{f.current=void 0,a?.()},onStepKeyDown:g=>{const m=W[v?"from-bottom":"from-top"].includes(g.key);d?.({event:g,direction:m?-1:1})}})})}),ee=c.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:i,onSlideEnd:l,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:d,...w}=e,p=B(M,n);return u.jsx(I.span,{...w,ref:t,onKeyDown:_(e.onKeyDown,s=>{s.key==="Home"?(r(s),s.preventDefault()):s.key==="End"?(a(s),s.preventDefault()):X.concat(G).includes(s.key)&&(d(s),s.preventDefault())}),onPointerDown:_(e.onPointerDown,s=>{const f=s.target;f.setPointerCapture(s.pointerId),s.preventDefault(),p.thumbs.has(f)?f.focus():o(s)}),onPointerMove:_(e.onPointerMove,s=>{s.target.hasPointerCapture(s.pointerId)&&i(s)}),onPointerUp:_(e.onPointerUp,s=>{const f=s.target;f.hasPointerCapture(s.pointerId)&&(f.releasePointerCapture(s.pointerId),l(s))})})}),te="SliderTrack",ne=c.forwardRef((e,t)=>
1{const{__scopeSlider:n,...o}=e,i=B(te,n);return u.jsx(I.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...o,ref:t})});ne.displayName=te;var L="SliderRange",oe=c.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=B(L,n),l=Z(L,n),r=c.useRef(null),a=C(t,r),d=i.values.length,w=i.values.map(f=>se(f,i.min,i.max)),p=d>1?Math.min(...w):0,s=100-Math.max(...w);return u.jsx(I.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...o,ref:a,style:{...e.style,[l.startEdge]:p+"%",[l.endEdge]:s+"%"}})});oe.displayName=L;var O="SliderThumb",re=c.forwardRef((e,t)=>{const n=Se(e.__scopeSlider),[o,i]=c.useState(null),l=C(t,a=>i(a)),r=c.useMemo(()=>o?n().findIndex(a=>a.ref.current===o):-1,[n,o]);return u.jsx(be,{...e,ref:l,index:r})}),be=c.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:i,...l}=e,r=B(O,n),a=Z(O,n),[d,w]=c.useState(null),p=C(t,D=>w(D)),s=d?r.form||!!d.closest("form"):!0,f=he(d),v=r.values[o],y=v===void 0?0:se(v,r.min,r.max),g=Re(o,r.values.length),h=f?.[a.size],m=h?De(h,y,a.direction):0;return c.useEffect(()=>{if(d)return r.thumbs.add(d),()=>{r.thumbs.delete(d)}},[d,r.thumbs]),u.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${y}% + ${m}px)`},children:[u.jsx(H.ItemSlot,{scope:e.__scopeSlider,children:u.jsx(I.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...l,ref:p,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=o})})}),s&&u.jsx(ie,{name:i??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},o)]})});re.displayName=O;var xe="RadioBubbleInput",ie=c.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const i=c.useRef(null),l=C(i,o),r=me(t);return c.useEffect(()=>{const a=i.current;if(!a)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"value").set;if(r!==t&&p){const s=new Event("input",{bubbles:!0});p.call(a,t),a.dispatchEvent(s)}},[r,t]),u.jsx(I.input,{style:{display:"none"},...n,ref:l,defaultValue:t})});ie.displayName=xe;function ye(e=[],t,n){const o=[...e];return o[n]=t,o.sort((i,l)=>i-l)}function se(e,t,n){const l=100/(n-t)*(e-t);return $(l,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Pe(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),o=Math.min(...n);return n.indexOf(o)}function De(e,t,n){const o=e/2,l=U([0,50],[0,o]);return(o-l(t)*n)*n}function Ee(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function _e(e,t){if(t>0){const n=Ee(e);return Math.min(...n)>=t}return!0}function U(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function Ce(e){return(String(e).split(".")[1]||"").length}function Me(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Ae=J,je=ne,Ke=oe,Ie=re;function He({className:e,defaultValue:t,value:n,min:o=0,max:i=100,...l}){const r=Array.isArray(n)?n:Array.isArray(t)?t:[o,i];return u.jsxs(Ae,{"data-slot":"slider",defaultValue:t,value:n,min:o,max:i,className:N("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...l,children:[u.jsx(je,{"data-slot":"slider-track",className:N("bg-secondary relative grow overflow-hidden rounded-none data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:u.jsx(Ke,{"data-slot":"slider-range",className:N("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:r.length},(a,d)=>u.jsx(Ie,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-xs border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},d))]})}export{He as S};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.