"use client";
import{d as C}from"./chunk-SUBVXXYD.js";import{b as $}from"./chunk-QNBAPDGH.js";import{b as S}from"./chunk-3NQOMOHD.js";import{e as y}from"./chunk-CLTGASR6.js";import{a as h,m as t}from"./chunk-3CHPBNY2.js";import{p as d,s as x}from"./chunk-KEPQUAOX.js";import{forwardRef as A,useState as j}from"react";import i from"clsx";var F=h("EulSlider",["root","marked","vertical","disabled","dragging","rail","track","trackFalse","trackInverted","thumb","active","focusVisible","mark","marksWrapper","markActive","markLabel","markLabelActive","green","markChip","red","teal","wrapper","yellow"]),v=r=>y("EulSlider",{markChip:["markChip"],markLabel:["markLabel"],marksWrapper:["marksWrapper"],root:[r.color],wrapper:["wrapper"]}),e=F;var w=t("div")`
  position: relative;
  width: 100%;
  margin-bottom: 20px;
`,L=t("div",{shouldForwardProp:r=>r!=="left"})(({left:r})=>d`
    position: absolute;
    left: ${r}%;
    transform: translateX(-50%);
  `),M=t("div")`
  position: absolute;
  display: flex;
  justify-content: space-between;
  width: 100%;

  & > :first-of-type,
  & > :last-of-type {
    position: relative;
    left: 0;
    transform: none;
  }

  & > :last-of-type {
    right: 0;
    left: auto;
  }
`,W=t("div")`
  position: absolute;
  top: -20px;
  display: flex;
  justify-content: space-between;
  width: 100%;

  & > :first-of-type,
  & > :last-of-type {
    position: relative;
    left: 0;
    transform: none;
  }

  & > :last-of-type {
    right: 0;
    left: auto;
  }
`,P=t("div",{shouldForwardProp:r=>r!=="left"})(({left:r})=>d`
    position: absolute;
    left: ${r}%;
    transform: translateX(-50%);
  `),N=t(x)(({theme:r})=>d`
    & .${e.marksWrapper} {
      align-items: flex-end;
      cursor: pointer;

      & > div:nth-of-type(even) {
        & .${e.markLabel} {
          color: ${r.palette.background[700]};
          font-size: 10px;
        }
      }

      & > div:nth-of-type(odd) {
        & .${e.markLabel} {
          color: ${r.palette.background[800]};
          font-size: 12px;
        }
      }
    }
  `),E=t(C,{shouldForwardProp:r=>!["color","backgroundThumb"].includes(r.toString())})(({backgroundThumb:r,theme:o})=>d`
    position: relative;
    display: inline-block;
    width: 100%;
    height: 6px;
    padding: 16px 0;
    color: ${o.palette.teal[700]};
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;

    &:hover {
      opacity: 1;
    }

    &.${e.disabled} {
      cursor: default;
      pointer-events: none;

      & .${e.track} {
        background-color: #4d5d69;
      }

      & .${e.thumb} {
        border: 5px solid #4d5d69;
      }
    }

    & .${e.rail} {
      position: absolute;
      display: block;
      width: 100%;
      height: 6px;
      background-color: ${o.palette.tealOpaque[700]};
      border-radius: 4px;
      opacity: 0.4;
    }

    & .${e.track} {
      position: absolute;
      display: block;
      height: 6px;
      background-color: currentColor;
      border-radius: 4px;
    }

    & .${e.thumb} {
      position: absolute;
      box-sizing: border-box;
      width: 16px;
      height: 16px;
      margin-top: -5px;
      margin-left: -5px;
      background-color: ${r||o.palette.background[300]};
      border: 5px solid currentColor;
      border-radius: 50%;
      outline: 3px solid ${r||o.palette.background[300]};
    }

    &.${e.green} {
      .${e.track} {
        background-color: ${o.palette.green[800]};
      }
      .${e.thumb} {
        border-color: ${o.palette.green[800]};
      }
    }

    &.${e.red} {
      .${e.track} {
        background-color: ${o.palette.red[800]};
      }

      .${e.thumb} {
        border-color: ${o.palette.red[800]};
      }
    }

    &.${e.teal} {
      .${e.track} {
        background-color: ${o.palette.teal[700]};
      }

      .${e.thumb} {
        border-color: ${o.palette.teal[700]};
      }
    }

    &.${e.yellow} {
      .${e.track} {
        background-color: ${o.palette.yellow[800]};
      }

      .${e.thumb} {
        border-color: ${o.palette.yellow[800]};
      }
    }

    & .${e.focusVisible} {
      box-shadow: 0 0 0 8px rgba(172, 179, 184, 0.16);
    }

    & .${e.mark} {
      position: absolute;
      top: 50%;
      width: 6px;
      height: 6px;
      background-color: currentColor;
      border-radius: 2px;
      transform: translateX(-50%);
      opacity: 0;
    }

    & .${e.markActive} {
      background-color: #fff;
    }

    & .${e.markLabel} {
      position: absolute;
      top: 27px;
      margin-top: 8px;
      color: ${o.palette.background[700]};
      font-size: 10px;
      transform: translateX(-50%);

      &:nth-of-type(4n) {
        top: 25px;
        color: ${o.palette.background[800]};
        font-size: 12px;
      }
    }
  `);import{jsx as l,jsxs as q}from"react/jsx-runtime";var b=A((r,o)=>{let{backgroundThumb:V,className:z,defaultValue:m=0,marks:f,max:c=100,min:p=0,setValue:k,value:g,weight:I,...n}=r,[O,u]=g!=null&&k?[g,k]:j(m),s=v(r);return q(w,{className:i(z,s.wrapper),children:[l(W,{className:i(s.marksWrapper),children:f?.filter(a=>a?.chipLabel).map(a=>l(P,{left:(a.value-p)/(c-p)*100,children:l($,{className:i(s.markChip),color:"grey",onClick:()=>{u(a.value),n.onChange?.(new Event("LabelClickOnChange"),a.value,0),n.onChangeCommitted?.(new Event("LabelClickOnChangeCommitted"),a.value)},uppercase:!0,variant:"outlined",weight:I,children:a.chipLabel},a.value)},a.value))}),l(E,{...n,backgroundThumb:V,classes:{...e,root:i(s.root,e.root)},defaultValue:m,max:c,min:p,onChange:(a,T)=>u(T),ref:o,value:O}),l(N,{className:"test",sx:{alignItems:"baseline",display:"flex",justifyContent:"space-between"},children:l(M,{className:i(s.marksWrapper),children:f?.map(a=>l(L,{left:(a.value-p)/(c-p)*100,children:l(S,{className:i(s.markLabel),onClick:()=>{u(a.value),n.onChange?.(new Event("MarkClickOnChange"),a.value,0),n.onChangeCommitted?.(new Event("MarkClickOnChangeCommitted"),a.value)},children:a.label},a.value)},a.value))})})]})});b.displayName="Slider";b.defaultProps={color:"teal"};var U=b;export{e as a,U as b};
