'use strict';

var _ConfigProvider = require('antd/lib/config-provider');
var _Slider = require('antd/lib/slider');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
require('react');
var reactI18next = require('react-i18next');
var constants = require('./constants.js');
var Label = require('./Label.js');
var useId = require('./useId-DXHUzdxd.js');
require('@babel/runtime/helpers/slicedToArray');
require('react-router-dom');
require('@bigbinary/neeto-hotkeys');
require('./overlayManager.js');
var index = require('./index-CNZKW5X0.js');
require('qs');
var jsxRuntime = require('react/jsx-runtime');
require('antd/locale/de_DE');
require('antd/locale/en_US');
require('antd/locale/es_ES');
require('antd/locale/fr_FR');
require('antd/locale/nl_NL');
require('antd/locale/pl_PL');
require('antd/locale/pt_PT');
require('classnames');
require('@bigbinary/neeto-icons/Help');
require('./Button.js');
require('./Spinner.js');
require('./Tooltip.js');
require('@tippyjs/react');
require('tippy.js');
require('@babel/runtime/helpers/classCallCheck');
require('@babel/runtime/helpers/createClass');
require('@bigbinary/neeto-cist');
require('ramda');
require('./index-BgzkP01c.js');
require('@babel/runtime/helpers/toConsumableArray');
require('dayjs');
require('dayjs/plugin/localeData');
require('dayjs/plugin/utc');
require('dayjs/plugin/weekday');
require('dayjs/plugin/weekOfYear');
require('i18next');
require('./usePrefersReducedMotion-D2Ck84HM.js');
require('./Popover.js');
require('./Typography.js');
require('./en-B1i-pQJm.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var _ConfigProvider__default = /*#__PURE__*/_interopDefault(_ConfigProvider);
var _Slider__default = /*#__PURE__*/_interopDefault(_Slider);
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties);

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__default.default(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 ? index.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__default.default(_ref, _excluded);
  var id = useId.useId(otherProps.id);
  var errorId = "error_".concat(id);
  var helpTextId = "helpText_".concat(id);
  var _useTranslation = reactI18next.useTranslation(),
    i18n = _useTranslation.i18n;
  return /*#__PURE__*/jsxRuntime.jsx(_ConfigProvider__default.default, {
    direction: index.getContentDir(),
    locale: constants.ANTD_LOCALE[i18n.language || "en"],
    theme: {
      token: _objectSpread({}, index.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__*/jsxRuntime.jsxs("div", {
      className: "neeto-ui-input__wrapper",
      children: [/*#__PURE__*/jsxRuntime.jsx("div", {
        className: "neeto-ui-input__label-wrapper",
        children: label && /*#__PURE__*/jsxRuntime.jsx(Label, _objectSpread(_objectSpread({
          required: required,
          "data-testid": "".concat(index.hyphenize(label), "-slider-label"),
          htmlFor: id
        }, labelProps), {}, {
          children: label
        }))
      }), /*#__PURE__*/jsxRuntime.jsx(_Slider__default.default, _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__*/jsxRuntime.jsx("p", {
        className: "neeto-ui-input__error",
        "data-testid": "".concat(index.hyphenize(label), "-input-error"),
        id: errorId,
        children: error
      }), helpText && /*#__PURE__*/jsxRuntime.jsx("p", {
        className: "neeto-ui-input__help-text",
        "data-testid": "".concat(index.hyphenize(label), "-input-help"),
        id: helpTextId,
        children: helpText
      })]
    })
  });
};

module.exports = Slider;
//# sourceMappingURL=Slider.js.map
