import { jsx as _jsx } from "react/jsx-runtime";
import { cnb } from "cnbuilder";
import { forwardRef } from "react";
import { bem } from "../utils/bem.js";
import { getClosestThumbEventHandlers, getThumbOffsets } from "./sliderUtils.js";
const styles = bem("rmd-slider-track");
/**
 * **Server Component**
 *
 * @internal
 * @since 2.5.0
 * @since 6.0.0 Updated to be internal only.
 */ export const SliderTrack = /*#__PURE__*/ forwardRef(function SliderTrack(props, ref) {
    const { style, className, animate, vertical, disabled, min, max, thumb1Ref, thumb1Value, thumb1Dragging, thumb1DragPercentage, thumb1OnMouseUp, thumb1OnMouseDown, thumb1OnMouseMove, thumb1OnTouchStart, thumb1OnTouchMove, thumb2Ref, thumb2Value, thumb2Dragging, thumb2DragPercentage, thumb2OnMouseUp, thumb2OnMouseDown, thumb2OnMouseMove, thumb2OnTouchStart, thumb2OnTouchMove, isRangeSlider, children, ...remaining } = props;
    return /*#__PURE__*/ _jsx("span", {
        ...remaining,
        ref: ref,
        style: {
            ...style,
            ...getThumbOffsets({
                min,
                max,
                thumb1Value,
                thumb1Dragging,
                thumb1DragPercentage,
                thumb2Value,
                thumb2Dragging,
                thumb2DragPercentage,
                isRangeSlider
            })
        },
        className: cnb(styles({
            animate,
            disabled,
            hoverable: !disabled,
            h: !vertical,
            h1: !vertical && !isRangeSlider,
            h2: !vertical && isRangeSlider,
            v: vertical,
            v1: vertical && !isRangeSlider,
            v2: vertical && isRangeSlider
        }), className),
        ...getClosestThumbEventHandlers({
            vertical,
            isRangeSlider,
            thumb1Ref,
            thumb1Dragging,
            thumb1OnMouseUp,
            thumb1OnMouseDown,
            thumb1OnMouseMove,
            thumb1OnTouchStart,
            thumb1OnTouchMove,
            thumb2Ref,
            thumb2Dragging,
            thumb2OnMouseUp,
            thumb2OnMouseDown,
            thumb2OnMouseMove,
            thumb2OnTouchStart,
            thumb2OnTouchMove
        }),
        children: children
    });
});

//# sourceMappingURL=SliderTrack.js.map