import _ConfigProvider from 'antd/lib/config-provider';
import _Slider from 'antd/lib/slider';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import 'react';
import { useTranslation } from 'react-i18next';
import { ANTD_LOCALE } from './constants.js';
import Label from './Label.js';
import { u as useId } from './useId-Jj9hXm-g.js';
import '@babel/runtime/helpers/slicedToArray';
import 'react-router-dom';
import '@bigbinary/neeto-hotkeys';
import './overlayManager.js';
import { h as hyphenize, n as noop, g as getContentDir, A as ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from './index-QWVp_Xt6.js';
import 'qs';
import { jsx, jsxs } from 'react/jsx-runtime';
import 'antd/locale/de_DE';
import 'antd/locale/en_US';
import 'antd/locale/es_ES';
import 'antd/locale/fr_FR';
import 'antd/locale/nl_NL';
import 'antd/locale/pl_PL';
import 'antd/locale/pt_PT';
import 'classnames';
import '@bigbinary/neeto-icons/Help';
import './Button.js';
import './Spinner.js';
import './Tooltip.js';
import '@tippyjs/react';
import 'tippy.js';
import '@babel/runtime/helpers/classCallCheck';
import '@babel/runtime/helpers/createClass';
import '@bigbinary/neeto-cist';
import 'ramda';
import './index-DyUNP5G9.js';
import '@babel/runtime/helpers/toConsumableArray';
import 'dayjs';
import 'dayjs/plugin/localeData';
import 'dayjs/plugin/utc';
import 'dayjs/plugin/weekday';
import 'dayjs/plugin/weekOfYear';
import 'i18next';
import './usePrefersReducedMotion-n4ZJtExQ.js';
import './Popover.js';
import './Typography.js';
import './en-Dmu3B4Vs.js';

var _excluded = ["min", "max", "defaultValue", "onChange", "value", "label", "required", "labelProps", "error", "helpText"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var Slider = function Slider(_ref) {
  var _ref$min = _ref.min,
    min = _ref$min === void 0 ? 0 : _ref$min,
    _ref$max = _ref.max,
    max = _ref$max === void 0 ? 100 : _ref$max,
    _ref$defaultValue = _ref.defaultValue,
    defaultValue = _ref$defaultValue === void 0 ? 0 : _ref$defaultValue,
    _ref$onChange = _ref.onChange,
    onChange = _ref$onChange === void 0 ? noop : _ref$onChange,
    _ref$value = _ref.value,
    value = _ref$value === void 0 ? undefined : _ref$value,
    label = _ref.label,
    _ref$required = _ref.required,
    required = _ref$required === void 0 ? false : _ref$required,
    _ref$labelProps = _ref.labelProps,
    labelProps = _ref$labelProps === void 0 ? {} : _ref$labelProps,
    error = _ref.error,
    helpText = _ref.helpText,
    otherProps = _objectWithoutProperties(_ref, _excluded);
  var id = useId(otherProps.id);
  var errorId = "error_".concat(id);
  var helpTextId = "helpText_".concat(id);
  var _useTranslation = useTranslation(),
    i18n = _useTranslation.i18n;
  return /*#__PURE__*/jsx(_ConfigProvider, {
    direction: getContentDir(),
    locale: ANTD_LOCALE[i18n.language || "en"],
    theme: {
      token: _objectSpread({}, ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES),
      components: {
        Slider: {
          dotActiveBorderColor: "rgb(var(--neeto-ui-primary-500))",
          dotBorderColor: "rgb(var(--neeto-ui-gray-500))",
          handleActiveColor: "rgb(var(--neeto-ui-primary-600))",
          handleColor: "rgb(var(--neeto-ui-primary-500))",
          railBg: "rgb(var(--neeto-ui-gray-200))",
          railHoverBg: "rgb(var(--neeto-ui-gray-300))",
          trackBg: "rgb(var(--neeto-ui-primary-500))",
          trackBgDisabled: "rgb(var(--neeto-ui-gray-100))",
          trackHoverBg: "rgb(var(--neeto-ui-primary-600))",
          // Global overrides
          colorFillContentHover: "rgb(var(--neeto-ui-gray-600))"
        }
      }
    },
    children: /*#__PURE__*/jsxs("div", {
      className: "neeto-ui-input__wrapper",
      children: [/*#__PURE__*/jsx("div", {
        className: "neeto-ui-input__label-wrapper",
        children: label && /*#__PURE__*/jsx(Label, _objectSpread(_objectSpread({
          required: required,
          "data-testid": "".concat(hyphenize(label), "-slider-label"),
          htmlFor: id
        }, labelProps), {}, {
          children: label
        }))
      }), /*#__PURE__*/jsx(_Slider, _objectSpread({
        className: "neeto-ui-w-full",
        tooltip: {
          formatter: null
        }
      }, _objectSpread(_objectSpread({
        defaultValue: defaultValue,
        max: max,
        min: min,
        onChange: onChange,
        value: value
      }, otherProps), {}, {
        id: id
      }))), !!error && /*#__PURE__*/jsx("p", {
        className: "neeto-ui-input__error",
        "data-testid": "".concat(hyphenize(label), "-input-error"),
        id: errorId,
        children: error
      }), helpText && /*#__PURE__*/jsx("p", {
        className: "neeto-ui-input__help-text",
        "data-testid": "".concat(hyphenize(label), "-input-help"),
        id: helpTextId,
        children: helpText
      })]
    })
  });
};

export { Slider as default };
//# sourceMappingURL=Slider.js.map
