import{jsx as i,jsxs as e}from"react/jsx-runtime";import{forwardRef as o,useRef as t,useMemo as a}from"react";import r from"../../hooks/useMergeRefs.js";import{NOOP as s}from"../../utils/function-utils.js";import{ensureDefaultValue as d,bem as l}from"./SliderHelpers.js";import{SliderProvider as n}from"./SliderContext.js";import m from"./SliderBase/SliderBase.js";import c from"./SliderInfix.js";import{SliderColor as f}from"./SliderConstants.js";import"./Slider.scss.js";import{BASE_SIZES as u}from"../../constants/sizes.js";var v=o((function(o,f){var u=o.ariaLabel,p=o.ariaLabelledby,x=o.className,j=o.color,b=o["data-testid"],S=void 0===b?"l3-slider":b,h=o.disabled,g=void 0!==h&&h,L=o.id,k=o.max,z=void 0===k?100:k,I=o.min,O=void 0===I?0:I,C=o.onChange,F=void 0===C?s:C,V=o.ranged,w=void 0!==V&&V,T=o.step,y=void 0===T?1:T,B=o.showValue,M=void 0!==B&&B,N=o.size,P=void 0===N?v.sizes.SMALL:N,R=o.value,W=o.defaultValue,X=void 0===W?0:W,A=o.valueFormatter,E=void 0===A?function(i){return"".concat(i,"%")}:A,H=o.valueText,q=o.indicateSelection,D=void 0!==q&&q,G=o.prefix,J=o.postfix,K=o.selectionIndicatorWidth,Q=void 0===K?"60px":K,U=t(null),Y=r({refs:[f,U]}),Z=a((function(){return{prefix:G,postfix:J,indicateSelection:D,selectionIndicatorWidth:Q}}),[G,J,D,Q]);return i(n,Object.assign({ariaLabel:u,ariaLabelledby:p,color:j,"data-testid":S,disabled:g,infixOptions:Z,max:z,min:O,onChange:F,ranged:w,showValue:M,size:P,step:y,value:R,defaultValue:d(X,O,z,w),valueFormatter:E,valueText:H},{children:e("div",Object.assign({className:l("",{disabled:g,"value-shown":M},x),"data-testid":S,id:L,ref:Y},{children:[i(c,{kind:c.kinds.PREFIX}),i(m,{}),i(c,{kind:c.kinds.POSTFIX})]}))}))}));Object.assign(v,{sizes:u,colors:f});var p=v;export{p as default};
