text: 'use strict';
  
  Object.defineProperty(exports, '__esModule', { value: true });
  
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  
  var _defineProperty = _interopDefault(require('@babel/runtime/helpers/defineProperty'));
  var React = require('react');
  var React__default = _interopDefault(React);
  var PropTypes = require('prop-types');
  var clsx = _interopDefault(require('clsx'));
  var _extends = _interopDefault(require('@babel/runtime/helpers/extends'));
  var _objectWithoutProperties = _interopDefault(require('@babel/runtime/helpers/objectWithoutProperties'));
  var Typography = _interopDefault(require('@material-ui/core/Typography'));
  var styles$5 = require('@material-ui/core/styles');
  var Button = _interopDefault(require('@material-ui/core/Button'));
  var Toolbar = _interopDefault(require('@material-ui/core/Toolbar'));
  var TextField = _interopDefault(require('@material-ui/core/TextField'));
  var IconButton = _interopDefault(require('@material-ui/core/IconButton'));
  var InputAdornment = _interopDefault(require('@material-ui/core/InputAdornment'));
  var rifm = require('rifm');
  var SvgIcon = _interopDefault(require('@material-ui/core/SvgIcon'));
  var _slicedToArray = _interopDefault(require('@babel/runtime/helpers/slicedToArray'));
  var _classCallCheck = _interopDefault(require('@babel/runtime/helpers/classCallCheck'));
  var _createClass = _interopDefault(require('@babel/runtime/helpers/createClass'));
  var _possibleConstructorReturn = _interopDefault(require('@babel/runtime/helpers/possibleConstructorReturn'));
  var _getPrototypeOf = _interopDefault(require('@babel/runtime/helpers/getPrototypeOf'));
  var _inherits = _interopDefault(require('@babel/runtime/helpers/inherits'));
  var reactTransitionGroup = require('react-transition-group');
  var CircularProgress = _interopDefault(require('@material-ui/core/CircularProgress'));
  var DialogActions = _interopDefault(require('@material-ui/core/DialogActions'));
  var DialogContent = _interopDefault(require('@material-ui/core/DialogContent'));
  var Dialog = _interopDefault(require('@material-ui/core/Dialog'));
  var Popover = _interopDefault(require('@material-ui/core/Popover'));
  var Grid = _interopDefault(require('@material-ui/core/Grid'));
  var Tab = _interopDefault(require('@material-ui/core/Tab'));
  var Tabs = _interopDefault(require('@material-ui/core/Tabs'));
  var Paper = _interopDefault(require('@material-ui/core/Paper'));
  
  var MuiPickersContext = React.createContext(null);
  var MuiPickersUtilsProvider = function MuiPickersUtilsProvider(_ref) {
    var Utils = _ref.utils,
        children = _ref.children,
        locale = _ref.locale,
        libInstance = _ref.libInstance;
    var utils = React.useMemo(function () {
      return new Utils({
        locale: locale,
        instance: libInstance
      });
    }, [Utils, libInstance, locale]);
    return React.createElement(MuiPickersContext.Provider, {
      value: utils,
      children: children
    });
  };
  process.env.NODE_ENV !== "production" ? MuiPickersUtilsProvider.propTypes = {
    utils: PropTypes.func.isRequired,
    locale: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
    children: PropTypes.oneOfType([PropTypes.element.isRequired, PropTypes.arrayOf(PropTypes.element.isRequired)]).isRequired
  } : void 0;
  
  var checkUtils = function checkUtils(utils) {
    if (!utils) {
      // tslint:disable-next-line
      throw new Error('Can not find utils in context. You either a) forgot to wrap your component tree in MuiPickersUtilsProvider; or b) mixed named and direct file imports.  Recommendation: use named imports from the module index.');
    }
  };
  function useUtils() {
    var utils = React.useContext(MuiPickersContext);
    checkUtils(utils);
    return utils;
  }
  
  var ClockType;
  
  (function (ClockType) {
    ClockType["HOURS"] = "hours";
    ClockType["MINUTES"] = "minutes";
    ClockType["SECONDS"] = "seconds";
  })(ClockType || (ClockType = {}));
  
  var ClockType$1 = ClockType;
  
  var useStyles = styles$5.makeStyles(function (theme) {
    var textColor = theme.palette.type === 'light' ? theme.palette.primary.contrastText : theme.palette.getContrastText(theme.palette.background["default"]);
    return {
      toolbarTxt: {
        color: styles$5.fade(textColor, 0.54)
      },
      toolbarBtnSelected: {
        color: textColor
      }
    };
  }, {
    name: 'MuiPickersToolbarText'
  });
  
  var ToolbarText = function ToolbarText(_ref) {
    var selected = _ref.selected,
        label = _ref.label,
        _ref$className = _ref.className,
        className = _ref$className === void 0 ? null : _ref$className,
        other = _objectWithoutProperties(_ref, ["selected", "label", "className"]);
  
    var classes = useStyles();
    return React.createElement(Typography, _extends({
      children: label,
      className: clsx(classes.toolbarTxt, className, selected && classes.toolbarBtnSelected)
    }, other));
  };
  
  var ToolbarButton = function ToolbarButton(_ref) {
    var classes = _ref.classes,
        _ref$className = _ref.className,
        className = _ref$className === void 0 ? null : _ref$className,
        label = _ref.label,
        selected = _ref.selected,
        variant = _ref.variant,
        align = _ref.align,
        typographyClassName = _ref.typographyClassName,
        other = _objectWithoutProperties(_ref, ["classes", "className", "label", "selected", "variant", "align", "typographyClassName"]);
  
    return React.createElement(Button, _extends({
      variant: "text",
      className: clsx(classes.toolbarBtn, className)
    }, other), React.createElement(ToolbarText, {
      align: align,
      className: typographyClassName,
      variant: variant,
      label: label,
      selected: selected
    }));
  };
  
  process.env.NODE_ENV !== "production" ? ToolbarButton.propTypes = {
    selected: PropTypes.bool.isRequired,
    label: PropTypes.string.isRequired,
    classes: PropTypes.any.isRequired,
    className: PropTypes.string,
    innerRef: PropTypes.any
  } : void 0;
  ToolbarButton.defaultProps = {
    className: ''
  };
  var styles = styles$5.createStyles({
    toolbarBtn: {
      padding: 0,
      minWidth: '16px',
      textTransform: 'none'
    }
  });
  var ToolbarButton$1 = styles$5.withStyles(styles, {
    name: 'MuiPickersToolbarButton'
  })(ToolbarButton);
  
  var useStyles$1 = styles$5.makeStyles(function (theme) {
    return {
      toolbar: {
        display: 'flex',
        flexDirection: 'row',
        alignItems: 'center',
        justifyContent: 'center',
        height: 100,
        backgroundColor: theme.palette.type === 'light' ? theme.palette.primary.main : theme.palette.background["default"]
      },
      toolbarLandscape: {
        height: 'auto',
        maxWidth: 150,
        padding: 8,
        justifyContent: 'flex-start'
      }
    };
  }, {
    name: 'MuiPickersToolbar'
  });
  
  var PickerToolbar = function PickerToolbar(_ref) {
    var children = _ref.children,
        isLandscape = _ref.isLandscape,
        _ref$className = _ref.className,
        className = _ref$className === void 0 ? null : _ref$className,
        other = _objectWithoutProperties(_ref, ["children", "isLandscape", "className"]);
  
    var classes = useStyles$1();
    return React.createElement(Toolbar, _extends({
      className: clsx(classes.toolbar, className, isLandscape && classes.toolbarLandscape)
    }, other), children);
  };
  
  /** Use it instead of .includes method for IE support */
  function arrayIncludes(array, itemOrItems) {
    if (Array.isArray(itemOrItems)) {
      return itemOrItems.every(function (item) {
        return array.indexOf(item) !== -1;
      });
    }
  
    return array.indexOf(itemOrItems) !== -1;
  }
  
  var center = {
    x: 260 / 2,
    y: 260 / 2
  };
  var basePoint = {
    x: center.x,
    y: 0
  };
  var cx = basePoint.x - center.x;
  var cy = basePoint.y - center.y;
  
  var rad2deg = function rad2deg(rad) {
    return rad * 57.29577951308232;
  };
  
  var getAngleValue = function getAngleValue(step, offsetX, offsetY) {
    var x = offsetX - center.x;
    var y = offsetY - center.y;
    var atan = Math.atan2(cx, cy) - Math.atan2(x, y);
    var deg = rad2deg(atan);
    deg = Math.round(deg / step) * step;
    deg %= 360;
    var value = Math.floor(deg / step) || 0;
    var delta = Math.pow(x, 2) + Math.pow(y, 2);
    var distance = Math.sqrt(delta);
    return {
      value: value,
      distance: distance
    };
  };
  
  var getHours = function getHours(offsetX, offsetY, ampm) {
    var _getAngleValue = getAngleValue(30, offsetX, offsetY),
        value = _getAngleValue.value,
        distance = _getAngleValue.distance;
  
    value = value || 12;
  
    if (!ampm) {
      if (distance < 90) {
        value += 12;
        value %= 24;
      }
    } else {
      value %= 12;
    }
  
    return value;
  };
  var getMinutes = function getMinutes(offsetX, offsetY) {
    var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
    var angleStep = step * 6;
  
    var _getAngleValue2 = getAngleValue(angleStep, offsetX, offsetY),
        value = _getAngleValue2.value;
  
    value = value * step % 60;
    return value;
  };
  var getMeridiem = function getMeridiem(date, utils) {
    return utils.getHours(date) >= 12 ? 'pm' : 'am';
  };
  var convertToMeridiem = function convertToMeridiem(time, meridiem, ampm, utils) {
    if (ampm) {
      var currentMeridiem = utils.getHours(time) >= 12 ? 'pm' : 'am';
  
      if (currentMeridiem !== meridiem) {
        var hours = meridiem === 'am' ? utils.getHours(time) - 12 : utils.getHours(time) + 12;
        return utils.setHours(time, hours);
      }
    }
  
    return time;
  };
  
  var useStyles$2 = styles$5.makeStyles({
    toolbarLandscape: {
      flexWrap: 'wrap'
    },
    toolbarAmpmLeftPadding: {
      paddingLeft: 50
    },
    separator: {
      margin: '0 4px 0 2px',
      cursor: 'default'
    },
    hourMinuteLabel: {
      display: 'flex',
      justifyContent: 'flex-end',
      alignItems: 'flex-end'
    },
    hourMinuteLabelAmpmLandscape: {
      marginTop: 'auto'
    },
    hourMinuteLabelReverse: {
      flexDirection: 'row-reverse'
    },
    ampmSelection: {
      marginLeft: 20,
      marginRight: -20,
      display: 'flex',
      flexDirection: 'column'
    },
    ampmLandscape: {
      margin: '4px 0 auto',
      flexDirection: 'row',
      justifyContent: 'space-around',
      flexBasis: '100%'
    },
    ampmSelectionWithSeconds: {
      marginLeft: 15,
      marginRight: 10
    },
    ampmLabel: {
      fontSize: 18
    }
  }, {
    name: 'MuiPickersTimePickerToolbar'
  });
  function useMeridiemMode(date, ampm, onChange) {
    var utils = useUtils();
    var meridiemMode = getMeridiem(date, utils);
    var handleMeridiemChange = React.useCallback(function (mode) {
      var timeWithMeridiem = convertToMeridiem(date, mode, Boolean(ampm), utils);
      onChange(timeWithMeridiem, false);
    }, [ampm, date, onChange, utils]);
    return {
      meridiemMode: meridiemMode,
      handleMeridiemChange: handleMeridiemChange
    };
  }
  var TimePickerToolbar = function TimePickerToolbar(_ref) {
    var date = _ref.date,
        views = _ref.views,
        ampm = _ref.ampm,
        openView = _ref.openView,
        onChange = _ref.onChange,
        isLandscape = _ref.isLandscape,
        setOpenView = _ref.setOpenView;
    var utils = useUtils();
    var theme = styles$5.useTheme();
    var classes = useStyles$2();
  
    var _useMeridiemMode = useMeridiemMode(date, ampm, onChange),
        meridiemMode = _useMeridiemMode.meridiemMode,
        handleMeridiemChange = _useMeridiemMode.handleMeridiemChange;
  
    var clockTypographyVariant = isLandscape ? 'h3' : 'h2';
    return React.createElement(PickerToolbar, {
      isLandscape: isLandscape,
      className: clsx(isLandscape ? classes.toolbarLandscape : ampm && classes.toolbarAmpmLeftPadding)
    }, React.createElement("div", {
      className: clsx(classes.hourMinuteLabel, ampm && isLandscape && classes.hourMinuteLabelAmpmLandscape, {
        rtl: classes.hourMinuteLabelReverse
      }[theme.direction])
    }, arrayIncludes(views, 'hours') && React.createElement(ToolbarButton$1, {
      variant: clockTypographyVariant,
      onClick: function onClick() {
        return setOpenView(ClockType$1.HOURS);
      },
      selected: openView === ClockType$1.HOURS,
      label: utils.getHourText(date, Boolean(ampm))
    }), arrayIncludes(views, ['hours', 'minutes']) && React.createElement(ToolbarText, {
      label: ":",
      variant: clockTypographyVariant,
      selected: false,
      className: classes.separator
    }), arrayIncludes(views, 'minutes') && React.createElement(ToolbarButton$1, {
      variant: clockTypographyVariant,
      onClick: function onClick() {
        return setOpenView(ClockType$1.MINUTES);
      },
      selected: openView === ClockType$1.MINUTES,
      label: utils.getMinuteText(date)
    }), arrayIncludes(views, ['minutes', 'seconds']) && React.createElement(ToolbarText, {
      variant: "h2",
      label: ":",
      selected: false,
      className: classes.separator
    }), arrayIncludes(views, 'seconds') && React.createElement(ToolbarButton$1, {
      variant: "h2",
      onClick: function onClick() {
        return setOpenView(ClockType$1.SECONDS);
      },
      selected: openView === ClockType$1.SECONDS,
      label: utils.getSecondText(date)
    })), ampm && React.createElement("div", {
      className: clsx(classes.ampmSelection, isLandscape && classes.ampmLandscape, arrayIncludes(views, 'seconds') && classes.ampmSelectionWithSeconds)
    }, React.createElement(ToolbarButton$1, {
      disableRipple: true,
      variant: "subtitle1",
      selected: meridiemMode === 'am',
      typographyClassName: classes.ampmLabel,
      label: utils.getMeridiemText('am'),
      onClick: function onClick() {
        return handleMeridiemChange('am');
      }
    }), React.createElement(ToolbarButton$1, {
      disableRipple: true,
      variant: "subtitle1",
      selected: meridiemMode === 'pm',
      typographyClassName: classes.ampmLabel,
      label: utils.getMeridiemText('pm'),
      onClick: function onClick() {
        return handleMeridiemChange('pm');
      }
    })));
  };
  
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  var PureDateInput = function PureDateInput(_ref) {
    var inputValue = _ref.inputValue,
        inputVariant = _ref.inputVariant,
        validationError = _ref.validationError,
        InputProps = _ref.InputProps,
        onOpen = _ref.openPicker,
        _ref$TextFieldCompone = _ref.TextFieldComponent,
        TextFieldComponent = _ref$TextFieldCompone === void 0 ? TextField : _ref$TextFieldCompone,
        other = _objectWithoutProperties(_ref, ["inputValue", "inputVariant", "validationError", "InputProps", "openPicker", "TextFieldComponent"]);
  
    var PureDateInputProps = React.useMemo(function () {
      return _objectSpread({}, InputProps, {
        readOnly: true
      });
    }, [InputProps]);
    return React.createElement(TextFieldComponent, _extends({
      error: Boolean(validationError),
      helperText: validationError
    }, other, {
      // do not overridable
      onClick: onOpen,
      value: inputValue,
      variant: inputVariant,
      InputProps: PureDateInputProps,
      onKeyDown: function onKeyDown(e) {
        // space
        if (e.keyCode === 32) {
          e.stopPropagation();
          onOpen();
        }
      }
    }));
  };
  PureDateInput.displayName = 'PureDateInput';
  
  var KeyboardIcon = function KeyboardIcon(props) {
    return React__default.createElement(SvgIcon, props, React__default.createElement("path", {
      d: "M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"
    }), React__default.createElement("path", {
      fill: "none",
      d: "M0 0h24v24H0z"
    }));
  };
  
  var getDisplayDate = function getDisplayDate(value, format, utils, isEmpty, _ref) {
    var invalidLabel = _ref.invalidLabel,
        emptyLabel = _ref.emptyLabel,
        labelFunc = _ref.labelFunc;
    var date = utils.date(value);
  
    if (labelFunc) {
      return labelFunc(isEmpty ? null : date, invalidLabel);
    }
  
    if (isEmpty) {
      return emptyLabel || '';
    }
  
    return utils.isValid(date) ? utils.format(date, format) : invalidLabel;
  };
  
  var getComparisonMaxDate = function getComparisonMaxDate(utils, strictCompareDates, date) {
    if (strictCompareDates) {
      return date;
    }
  
    return utils.endOfDay(date);
  };
  
  var getComparisonMinDate = function getComparisonMinDate(utils, strictCompareDates, date) {
    if (strictCompareDates) {
      return date;
    }
  
    return utils.startOfDay(date);
  };
  
  var validate = function validate(value, utils, _ref2) {
    var maxDate = _ref2.maxDate,
        minDate = _ref2.minDate,
        disablePast = _ref2.disablePast,
        disableFuture = _ref2.disableFuture,
        maxDateMessage = _ref2.maxDateMessage,
        minDateMessage = _ref2.minDateMessage,
        invalidDateMessage = _ref2.invalidDateMessage,
        strictCompareDates = _ref2.strictCompareDates;
    var parsedValue = utils.date(value); // if null - do not show error
  
    if (value === null) {
      return '';
    }
  
    if (!utils.isValid(value)) {
      return invalidDateMessage;
    }
  
    if (maxDate && utils.isAfter(parsedValue, getComparisonMaxDate(utils, !!strictCompareDates, utils.date(maxDate)))) {
      return maxDateMessage;
    }
  
    if (disableFuture && utils.isAfter(parsedValue, getComparisonMaxDate(utils, !!strictCompareDates, utils.date()))) {
      return maxDateMessage;
    }
  
    if (minDate && utils.isBefore(parsedValue, getComparisonMinDate(utils, !!strictCompareDates, utils.date(minDate)))) {
      return minDateMessage;
    }
  
    if (disablePast && utils.isBefore(parsedValue, getComparisonMinDate(utils, !!strictCompareDates, utils.date()))) {
      return minDateMessage;
    }
  
    return '';
  };
  function pick12hOr24hFormat(userFormat) {
    var ampm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
    var formats = arguments.length > 2 ? arguments[2] : undefined;
  
    if (userFormat) {
      return userFormat;
    }
  
    return ampm ? formats['12h'] : formats['24h'];
  }
  function makeMaskFromFormat(format, numberMaskChar) {
    return format.replace(/[a-z]/gi, numberMaskChar);
  }
  var maskedDateFormatter = function maskedDateFormatter(mask, numberMaskChar, refuse) {
    return function (value) {
      var result = '';
      var parsed = value.replace(refuse, '');
  
      if (parsed === '') {
        return parsed;
      }
  
      var i = 0;
      var n = 0;
  
      while (i < mask.length) {
        var maskChar = mask[i];
  
        if (maskChar === numberMaskChar && n < parsed.length) {
          var parsedChar = parsed[n];
          result += parsedChar;
          n += 1;
        } else {
          result += maskChar;
        }
  
        i += 1;
      }
  
      return result;
    };
  };
  
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  var KeyboardDateInput = function KeyboardDateInput(_ref) {
    var inputValue = _ref.inputValue,
        inputVariant = _ref.inputVariant,
        validationError = _ref.validationError,
        KeyboardButtonProps = _ref.KeyboardButtonProps,
        InputAdornmentProps = _ref.InputAdornmentProps,
        onOpen = _ref.openPicker,
        onChange = _ref.onChange,
        InputProps = _ref.InputProps,
        mask = _ref.mask,
        _ref$maskChar = _ref.maskChar,
        maskChar = _ref$maskChar === void 0 ? '_' : _ref$maskChar,
        _ref$refuse = _ref.refuse,
        refuse = _ref$refuse === void 0 ? /[^\d]+/gi : _ref$refuse,
        format = _ref.format,
        keyboardIcon = _ref.keyboardIcon,
        disabled = _ref.disabled,
        rifmFormatter = _ref.rifmFormatter,
        _ref$TextFieldCompone = _ref.TextFieldComponent,
        TextFieldComponent = _ref$TextFieldCompone === void 0 ? TextField : _ref$TextFieldCompone,
        other = _objectWithoutProperties(_ref, ["inputValue", "inputVariant", "validationError", "KeyboardButtonProps", "InputAdornmentProps", "openPicker", "onChange", "InputProps", "mask", "maskChar", "refuse", "format", "keyboardIcon", "disabled", "rifmFormatter", "TextFieldComponent"]);
  
    var inputMask = mask || makeMaskFromFormat(format, maskChar); // prettier-ignore
  
    var formatter = React.useMemo(function () {
      return maskedDateFormatter(inputMask, maskChar, refuse);
    }, [inputMask, maskChar, refuse]);
    var position = InputAdornmentProps && InputAdornmentProps.position ? InputAdornmentProps.position : 'end';
  
    var handleChange = function handleChange(text) {
      var finalString = text === '' || text === inputMask ? null : text;
      onChange(finalString);
    };
  
    return React.createElement(rifm.Rifm, {
      key: inputMask,
      value: inputValue,
      onChange: handleChange,
      refuse: refuse,
      format: rifmFormatter || formatter
    }, function (_ref2) {
      var onChange = _ref2.onChange,
          value = _ref2.value;
      return React.createElement(TextFieldComponent, _extends({
        disabled: disabled,
        error: Boolean(validationError),
        helperText: validationError
      }, other, {
        value: value,
        onChange: onChange,
        variant: inputVariant,
        InputProps: _objectSpread$1({}, InputProps, _defineProperty({}, "".concat(position, "Adornment"), React.createElement(InputAdornment, _extends({
          position: position
        }, InputAdornmentProps), React.createElement(IconButton, _extends({
          disabled: disabled
        }, KeyboardButtonProps, {
          onClick: onOpen
        }), keyboardIcon))))
      }));
    });
  };
  KeyboardDateInput.defaultProps = {
    keyboardIcon: React.createElement(KeyboardIcon, null)
  };
  
  function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  var date = PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]);
  var datePickerView = PropTypes.oneOf(['year', 'month', 'day']);
  /* eslint-disable @typescript-eslint/no-object-literal-type-assertion */
  
  var timePickerDefaultProps = {
    ampm: true,
    invalidDateMessage: 'Invalid Time Format'
  };
  var datePickerDefaultProps = {
    minDate: new Date('1900-01-01'),
    maxDate: new Date('2100-01-01'),
    invalidDateMessage: 'Invalid Date Format',
    minDateMessage: 'Date should not be before minimal date',
    maxDateMessage: 'Date should not be after maximal date',
    allowKeyboardControl: true
  };
  var dateTimePickerDefaultProps = _objectSpread$2({}, timePickerDefaultProps, {}, datePickerDefaultProps, {
    showTabs: true
  });
  
  function useOpenState(_ref) {
    var open = _ref.open,
        onOpen = _ref.onOpen,
        onClose = _ref.onClose;
    var setIsOpenState = null;
  
    if (open === undefined || open === null) {
      // The component is uncontrolled, so we need to give it its own state.
      var _useState = React.useState(false);
  
      var _useState2 = _slicedToArray(_useState, 2);
  
      open = _useState2[0];
      setIsOpenState = _useState2[1];
    } // prettier-ignore
  
  
    var setIsOpen = React.useCallback(function (newIsOpen) {
      setIsOpenState && setIsOpenState(newIsOpen);
      return newIsOpen ? onOpen && onOpen() : onClose && onClose();
    }, [onOpen, onClose, setIsOpenState]);
    return {
      isOpen: open,
      setIsOpen: setIsOpen
    };
  }
  
  var useValueToDate = function useValueToDate(utils, _ref) {
    var value = _ref.value,
        initialFocusedDate = _ref.initialFocusedDate;
    var nowRef = React.useRef(utils.date());
    var date = utils.date(value || initialFocusedDate || nowRef.current);
    return date && utils.isValid(date) ? date : nowRef.current;
  };
  
  function useDateValues(props, options) {
    var utils = useUtils();
    var date = useValueToDate(utils, props);
    var format = props.format || options.getDefaultFormat();
    return {
      date: date,
      format: format
    };
  }
  
  function usePickerState(props, options) {
    var autoOk = props.autoOk,
        disabled = props.disabled,
        readOnly = props.readOnly,
        onAccept = props.onAccept,
        _onChange = props.onChange,
        onError = props.onError,
        value = props.value,
        variant = props.variant;
    var utils = useUtils();
  
    var _useOpenState = useOpenState(props),
        isOpen = _useOpenState.isOpen,
        setIsOpen = _useOpenState.setIsOpen;
  
    var _useDateValues = useDateValues(props, options),
        date = _useDateValues.date,
        format = _useDateValues.format;
  
    var _useState = React.useState(date),
        _useState2 = _slicedToArray(_useState, 2),
        pickerDate = _useState2[0],
        setPickerDate = _useState2[1];
  
    React.useEffect(function () {
      // if value was changed in closed state - treat it as accepted
      if (!isOpen && !utils.isEqual(pickerDate, date)) {
        setPickerDate(date);
      }
    }, [date, isOpen, pickerDate, utils]);
    var acceptDate = React.useCallback(function (acceptedDate) {
      _onChange(acceptedDate);
  
      if (onAccept) {
        onAccept(acceptedDate);
      }
  
      setIsOpen(false);
    }, [onAccept, _onChange, setIsOpen]);
    var wrapperProps = React.useMemo(function () {
      return {
        format: format,
        open: isOpen,
        onClear: function onClear() {
          return acceptDate(null);
        },
        onAccept: function onAccept() {
          return acceptDate(pickerDate);
        },
        onSetToday: function onSetToday() {
          return setPickerDate(utils.date());
        },
        onDismiss: function onDismiss() {
          setIsOpen(false);
        }
      };
    }, [acceptDate, format, isOpen, pickerDate, setIsOpen, utils]);
    var pickerProps = React.useMemo(function () {
      return {
        date: pickerDate,
        onChange: function onChange(newDate) {
          var isFinish = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
          setPickerDate(newDate);
  
          if (isFinish && autoOk) {
            acceptDate(newDate);
            return;
          } // simulate autoOk, but do not close the modal
  
  
          if (variant === 'inline' || variant === 'static') {
            _onChange(newDate);
  
            onAccept && onAccept(newDate);
          }
        }
      };
    }, [acceptDate, autoOk, onAccept, _onChange, pickerDate, variant]);
    var validationError = validate(value, utils, props);
    React.useEffect(function () {
      if (onError) {
        onError(validationError, value);
      }
    }, [onError, validationError, value]);
    var inputValue = getDisplayDate(date, format, utils, value === null, props);
    var inputProps = React.useMemo(function () {
      return {
        inputValue: inputValue,
        validationError: validationError,
        openPicker: function openPicker() {
          return !readOnly && !disabled && setIsOpen(true);
        }
      };
    }, [disabled, inputValue, readOnly, setIsOpen, validationError]);
    var pickerState = {
      pickerProps: pickerProps,
      inputProps: inputProps,
      wrapperProps: wrapperProps
    };
    React.useDebugValue(pickerState);
    return pickerState;
  }
  
  function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  function parseInputString(value, utils, format) {
    try {
      return utils.parse(value, format);
    } catch (_unused) {
      return null;
    }
  }
  
  function useKeyboardPickerState(props, options) {
    var _props$format = props.format,
        format = _props$format === void 0 ? options.getDefaultFormat() : _props$format,
        inputValue = props.inputValue,
        _onChange = props.onChange,
        value = props.value;
    var utils = useUtils();
    var displayDate = getDisplayDate(value, format, utils, value === null, props);
  
    var _useState = React.useState(displayDate),
        _useState2 = _slicedToArray(_useState, 2),
        innerInputValue = _useState2[0],
        setInnerInputValue = _useState2[1];
  
    var dateValue = inputValue ? parseInputString(inputValue, utils, format) : value;
    React.useEffect(function () {
      if (value === null || utils.isValid(value)) {
        setInnerInputValue(displayDate);
      }
    }, [displayDate, setInnerInputValue, utils, value]);
    var handleKeyboardChange = React.useCallback(function (date) {
      _onChange(date, date === null ? null : utils.format(date, format));
    }, [format, _onChange, utils]);
  
    var _usePickerState = usePickerState( // Extend props interface
    _objectSpread$3({}, props, {
      value: dateValue,
      onChange: handleKeyboardChange
    }), options),
        innerInputProps = _usePickerState.inputProps,
        wrapperProps = _usePickerState.wrapperProps,
        pickerProps = _usePickerState.pickerProps;
  
    var inputProps = React.useMemo(function () {
      return _objectSpread$3({}, innerInputProps, {
        // reuse validation and open/close logic
        format: wrapperProps.format,
        inputValue: inputValue || innerInputValue,
        onChange: function onChange(value) {
          setInnerInputValue(value || '');
          var date = value === null ? null : utils.parse(value, wrapperProps.format);
  
          _onChange(date, value);
        }
      });
    }, [innerInputProps, innerInputValue, inputValue, _onChange, utils, wrapperProps.format]);
    return {
      inputProps: inputProps,
      wrapperProps: wrapperProps,
      pickerProps: pickerProps
    };
  }
  
  var useStyles$3 = styles$5.makeStyles(function (theme) {
    return {
      day: {
        width: 36,
        height: 36,
        fontSize: theme.typography.caption.fontSize,
        margin: '0 2px',
        color: theme.palette.text.primary,
        fontWeight: theme.typography.fontWeightMedium,
        padding: 0
      },
      hidden: {
        opacity: 0,
        pointerEvents: 'none'
      },
      current: {
        color: theme.palette.primary.main,
        fontWeight: 600
      },
      daySelected: {
        color: theme.palette.primary.contrastText,
        backgroundColor: theme.palette.primary.main,
        fontWeight: theme.typography.fontWeightMedium,
        '&:hover': {
          backgroundColor: theme.palette.primary.main
        }
      },
      dayDisabled: {
        pointerEvents: 'none',
        color: theme.palette.text.hint
      }
    };
  }, {
    name: 'MuiPickersDay'
  });
  var Day = function Day(_ref) {
    var children = _ref.children,
        disabled = _ref.disabled,
        hidden = _ref.hidden,
        current = _ref.current,
        selected = _ref.selected,
        other = _objectWithoutProperties(_ref, ["children", "disabled", "hidden", "current", "selected"]);
  
    var classes = useStyles$3();
    var className = clsx(classes.day, hidden && classes.hidden, current && classes.current, selected && classes.daySelected, disabled && classes.dayDisabled);
    return React.createElement(IconButton, _extends({
      className: className,
      tabIndex: hidden || disabled ? -1 : 0
    }, other), React.createElement(Typography, {
      variant: "body2",
      color: "inherit"
    }, children));
  };
  Day.displayName = 'Day';
  process.env.NODE_ENV !== "production" ? Day.propTypes = {
    current: PropTypes.bool,
    disabled: PropTypes.bool,
    hidden: PropTypes.bool,
    selected: PropTypes.bool
  } : void 0;
  Day.defaultProps = {
    disabled: false,
    hidden: false,
    current: false,
    selected: false
  };
  
  var DayWrapper = function DayWrapper(_ref) {
    var children = _ref.children,
        value = _ref.value,
        disabled = _ref.disabled,
        onSelect = _ref.onSelect,
        dayInCurrentMonth = _ref.dayInCurrentMonth,
        other = _objectWithoutProperties(_ref, ["children", "value", "disabled", "onSelect", "dayInCurrentMonth"]);
  
    var handleClick = React.useCallback(function () {
      return onSelect(value);
    }, [onSelect, value]);
    return React.createElement("div", _extends({
      role: "presentation",
      onClick: dayInCurrentMonth && !disabled ? handleClick : undefined,
      onKeyPress: dayInCurrentMonth && !disabled ? handleClick : undefined
    }, other), children);
  };
  
  var animationDuration = 350;
  var useStyles$4 = styles$5.makeStyles(function (theme) {
    var slideTransition = theme.transitions.create('transform', {
      duration: animationDuration,
      easing: 'cubic-bezier(0.35, 0.8, 0.4, 1)'
    });
    return {
      transitionContainer: {
        display: 'block',
        position: 'relative',
        '& > *': {
          position: 'absolute',
          top: 0,
          right: 0,
          left: 0
        }
      },
      'slideEnter-left': {
        willChange: 'transform',
        transform: 'translate(100%)'
      },
      'slideEnter-right': {
        willChange: 'transform',
        transform: 'translate(-100%)'
      },
      slideEnterActive: {
        transform: 'translate(0%)',
        transition: slideTransition
      },
      slideExit: {
        transform: 'translate(0%)'
      },
      'slideExitActiveLeft-left': {
        willChange: 'transform',
        transform: 'translate(-200%)',
        transition: slideTransition
      },
      'slideExitActiveLeft-right': {
        willChange: 'transform',
        transform: 'translate(200%)',
        transition: slideTransition
      }
    };
  }, {
    name: 'MuiPickersSlideTransition'
  });
  
  var SlideTransition = function SlideTransition(_ref) {
    var children = _ref.children,
        transKey = _ref.transKey,
        slideDirection = _ref.slideDirection,
        _ref$className = _ref.className,
        className = _ref$className === void 0 ? null : _ref$className;
    var classes = useStyles$4();
    var transitionClasses = {
      exit: classes.slideExit,
      enterActive: classes.slideEnterActive,
      // @ts-ignore
      enter: classes['slideEnter-' + slideDirection],
      // @ts-ignore
      exitActive: classes['slideExitActiveLeft-' + slideDirection]
    };
    return React.createElement(reactTransitionGroup.TransitionGroup, {
      className: clsx(classes.transitionContainer, className),
      childFactory: function childFactory(element) {
        return React.cloneElement(element, {
          classNames: transitionClasses
        });
      }
    }, React.createElement(reactTransitionGroup.CSSTransition, {
      mountOnEnter: true,
      unmountOnExit: true,
      key: transKey + slideDirection,
      timeout: animationDuration,
      classNames: transitionClasses,
      children: children
    }));
  };
  
  var ArrowLeftIcon = function ArrowLeftIcon(props) {
    return React__default.createElement(SvgIcon, props, React__default.createElement("path", {
      d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"
    }), React__default.createElement("path", {
      fill: "none",
      d: "M0 0h24v24H0V0z"
    }));
  };
  
  var ArrowRightIcon = function ArrowRightIcon(props) {
    return React__default.createElement(SvgIcon, props, React__default.createElement("path", {
      d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
    }), React__default.createElement("path", {
      fill: "none",
      d: "M0 0h24v24H0V0z"
    }));
  };
  
  var useStyles$5 = styles$5.makeStyles(function (theme) {
    return {
      switchHeader: {
        display: 'flex',
        justifyContent: 'space-between',
        alignItems: 'center',
        marginTop: theme.spacing(0.5),
        marginBottom: theme.spacing(1)
      },
      transitionContainer: {
        width: '100%',
        overflow: 'hidden',
        height: 23
      },
      iconButton: {
        zIndex: 1,
        backgroundColor: theme.palette.background.paper
      },
      daysHeader: {
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center',
        maxHeight: 16
      },
      dayLabel: {
        width: 36,
        margin: '0 2px',
        textAlign: 'center',
        color: theme.palette.text.hint
      }
    };
  }, {
    name: 'MuiPickersCalendarHeader'
  });
  var CalendarHeader = function CalendarHeader(_ref) {
    var currentMonth = _ref.currentMonth,
        onMonthChange = _ref.onMonthChange,
        leftArrowIcon = _ref.leftArrowIcon,
        rightArrowIcon = _ref.rightArrowIcon,
        leftArrowButtonProps = _ref.leftArrowButtonProps,
        rightArrowButtonProps = _ref.rightArrowButtonProps,
        disablePrevMonth = _ref.disablePrevMonth,
        disableNextMonth = _ref.disableNextMonth,
        slideDirection = _ref.slideDirection;
    var utils = useUtils();
    var classes = useStyles$5();
    var theme = styles$5.useTheme();
    var rtl = theme.direction === 'rtl';
  
    var selectNextMonth = function selectNextMonth() {
      return onMonthChange(utils.getNextMonth(currentMonth), 'left');
    };
  
    var selectPreviousMonth = function selectPreviousMonth() {
      return onMonthChange(utils.getPreviousMonth(currentMonth), 'right');
    };
  
    return React.createElement("div", null, React.createElement("div", {
      className: classes.switchHeader
    }, React.createElement(IconButton, _extends({}, leftArrowButtonProps, {
      disabled: disablePrevMonth,
      onClick: selectPreviousMonth,
      className: classes.iconButton
    }), rtl ? rightArrowIcon : leftArrowIcon), React.createElement(SlideTransition, {
      slideDirection: slideDirection,
      transKey: currentMonth.toString(),
      className: classes.transitionContainer
    }, React.createElement(Typography, {
      align: "center",
      variant: "body1"
    }, utils.getCalendarHeaderText(currentMonth))), React.createElement(IconButton, _extends({}, rightArrowButtonProps, {
      disabled: disableNextMonth,
      onClick: selectNextMonth,
      className: classes.iconButton
    }), rtl ? leftArrowIcon : rightArrowIcon)), React.createElement("div", {
      className: classes.daysHeader
    }, utils.getWeekdays().map(function (day, index) {
      return React.createElement(Typography, {
        key: index // eslint-disable-line react/no-array-index-key
        ,
        variant: "caption",
        className: classes.dayLabel
      }, day);
    })));
  };
  CalendarHeader.displayName = 'CalendarHeader';
  process.env.NODE_ENV !== "production" ? CalendarHeader.propTypes = {
    leftArrowIcon: PropTypes.node,
    rightArrowIcon: PropTypes.node,
    disablePrevMonth: PropTypes.bool,
    disableNextMonth: PropTypes.bool
  } : void 0;
  CalendarHeader.defaultProps = {
    leftArrowIcon: React.createElement(ArrowLeftIcon, null),
    rightArrowIcon: React.createElement(ArrowRightIcon, null),
    disablePrevMonth: false,
    disableNextMonth: false
  };
  
  var DIALOG_WIDTH = 310;
  var DIALOG_WIDTH_WIDER = 325;
  var VIEW_HEIGHT = 305;
  
  var useStyles$6 = styles$5.makeStyles(function (theme) {
    return {
      staticWrapperRoot: {
        overflow: 'hidden',
        minWidth: DIALOG_WIDTH,
        display: 'flex',
        flexDirection: 'column',
        backgroundColor: theme.palette.background.paper
      }
    };
  }, {
    name: 'MuiPickersStaticWrapper'
  });
  var StaticWrapper = function StaticWrapper(_ref) {
    var children = _ref.children;
    var classes = useStyles$6();
    return React.createElement("div", {
      className: classes.staticWrapperRoot,
      children: children
    });
  };
  
  var ModalDialog = function ModalDialog(_ref) {
    var children = _ref.children,
        classes = _ref.classes,
        onAccept = _ref.onAccept,
        onDismiss = _ref.onDismiss,
        onClear = _ref.onClear,
        onSetToday = _ref.onSetToday,
        okLabel = _ref.okLabel,
        cancelLabel = _ref.cancelLabel,
        clearLabel = _ref.clearLabel,
        todayLabel = _ref.todayLabel,
        clearable = _ref.clearable,
        showTodayButton = _ref.showTodayButton,
        showTabs = _ref.showTabs,
        wider = _ref.wider,
        other = _objectWithoutProperties(_ref, ["children", "classes", "onAccept", "onDismiss", "onClear", "onSetToday", "okLabel", "cancelLabel", "clearLabel", "todayLabel", "clearable", "showTodayButton", "showTabs", "wider"]);
  
    return React.createElement(Dialog, _extends({
      role: "dialog",
      onClose: onDismiss,
      classes: {
        paper: clsx(classes.dialogRoot, wider && classes.dialogRootWider)
      }
    }, other), React.createElement(DialogContent, {
      children: children,
      className: classes.dialog
    }), React.createElement(DialogActions, {
      classes: {
        root: clsx((clearable || showTodayButton) && classes.withAdditionalAction)
      }
    }, clearable && React.createElement(Button, {
      color: "primary",
      onClick: onClear
    }, clearLabel), showTodayButton && React.createElement(Button, {
      color: "primary",
      onClick: onSetToday
    }, todayLabel), cancelLabel && React.createElement(Button, {
      color: "primary",
      onClick: onDismiss
    }, cancelLabel), okLabel && React.createElement(Button, {
      color: "primary",
      onClick: onAccept
    }, okLabel)));
  };
  ModalDialog.displayName = 'ModalDialog';
  var styles$1 = styles$5.createStyles({
    dialogRoot: {
      minWidth: DIALOG_WIDTH
    },
    dialogRootWider: {
      minWidth: DIALOG_WIDTH_WIDER
    },
    dialog: {
      '&:first-child': {
        padding: 0
      }
    },
    withAdditionalAction: {
      // set justifyContent to default value to fix IE11 layout bug
      // see https://github.com/dmtrKovalenko/material-ui-pickers/pull/267
      justifyContent: 'flex-start',
      '& > *:first-child': {
        marginRight: 'auto'
      }
    }
  });
  var ModalDialog$1 = styles$5.withStyles(styles$1, {
    name: 'MuiPickersModal'
  })(ModalDialog);
  
  var useIsomorphicEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;
  function runKeyHandler(e, keyHandlers) {
    var handler = keyHandlers[e.key];
  
    if (handler) {
      handler(); // if event was handled prevent other side effects (e.g. page scroll)
  
      e.preventDefault();
    }
  }
  function useKeyDown(active, keyHandlers) {
    var keyHandlersRef = React.useRef(keyHandlers);
    keyHandlersRef.current = keyHandlers;
    useIsomorphicEffect(function () {
      if (active) {
        var handleKeyDown = function handleKeyDown(event) {
          runKeyHandler(event, keyHandlersRef.current);
        };
  
        window.addEventListener('keydown', handleKeyDown);
        return function () {
          window.removeEventListener('keydown', handleKeyDown);
        };
      }
    }, [active]);
  }
  
  var ModalWrapper = function ModalWrapper(_ref) {
    var open = _ref.open,
        children = _ref.children,
        okLabel = _ref.okLabel,
        cancelLabel = _ref.cancelLabel,
        clearLabel = _ref.clearLabel,
        todayLabel = _ref.todayLabel,
        showTodayButton = _ref.showTodayButton,
        clearable = _ref.clearable,
        DialogProps = _ref.DialogProps,
        showTabs = _ref.showTabs,
        wider = _ref.wider,
        InputComponent = _ref.InputComponent,
        DateInputProps = _ref.DateInputProps,
        onClear = _ref.onClear,
        onAccept = _ref.onAccept,
        onDismiss = _ref.onDismiss,
        onSetToday = _ref.onSetToday,
        other = _objectWithoutProperties(_ref, ["open", "children", "okLabel", "cancelLabel", "clearLabel", "todayLabel", "showTodayButton", "clearable", "DialogProps", "showTabs", "wider", "InputComponent", "DateInputProps", "onClear", "onAccept", "onDismiss", "onSetToday"]);
  
    useKeyDown(open, {
      Enter: onAccept
    });
    return React.createElement(React.Fragment, null, React.createElement(InputComponent, _extends({}, other, DateInputProps)), React.createElement(ModalDialog$1, _extends({
      wider: wider,
      showTabs: showTabs,
      open: open,
      onClear: onClear,
      onAccept: onAccept,
      onDismiss: onDismiss,
      onSetToday: onSetToday,
      clearLabel: clearLabel,
      todayLabel: todayLabel,
      okLabel: okLabel,
      cancelLabel: cancelLabel,
      clearable: clearable,
      showTodayButton: showTodayButton,
      children: children
    }, DialogProps)));
  };
  process.env.NODE_ENV !== "production" ? ModalWrapper.propTypes = {
    okLabel: PropTypes.node,
    cancelLabel: PropTypes.node,
    clearLabel: PropTypes.node,
    clearable: PropTypes.bool,
    todayLabel: PropTypes.node,
    showTodayButton: PropTypes.bool,
    DialogProps: PropTypes.object
  } : void 0;
  ModalWrapper.defaultProps = {
    okLabel: 'OK',
    cancelLabel: 'Cancel',
    clearLabel: 'Clear',
    todayLabel: 'Today',
    clearable: false,
    showTodayButton: false
  };
  
  var InlineWrapper = function InlineWrapper(_ref) {
    var open = _ref.open,
        wider = _ref.wider,
        children = _ref.children,
        PopoverProps = _ref.PopoverProps,
        onClear = _ref.onClear,
        onDismiss = _ref.onDismiss,
        onSetToday = _ref.onSetToday,
        onAccept = _ref.onAccept,
        showTabs = _ref.showTabs,
        DateInputProps = _ref.DateInputProps,
        InputComponent = _ref.InputComponent,
        other = _objectWithoutProperties(_ref, ["open", "wider", "children", "PopoverProps", "onClear", "onDismiss", "onSetToday", "onAccept", "showTabs", "DateInputProps", "InputComponent"]);
  
    var ref = React.useRef();
    useKeyDown(open, {
      Enter: onAccept
    });
    return React.createElement(React.Fragment, null, React.createElement(InputComponent, _extends({}, other, DateInputProps, {
      inputRef: ref
    })), React.createElement(Popover, _extends({
      open: open,
      onClose: onDismiss,
      anchorEl: ref.current,
      anchorOrigin: {
        vertical: 'bottom',
        horizontal: 'center'
      },
      transformOrigin: {
        vertical: 'top',
        horizontal: 'center'
      },
      children: children
    }, PopoverProps)));
  };
  process.env.NODE_ENV !== "production" ? InlineWrapper.propTypes = {
    onOpen: PropTypes.func,
    onClose: PropTypes.func,
    PopoverProps: PropTypes.object
  } : void 0;
  
  function getWrapperFromVariant(variant) {
    switch (variant) {
      case 'inline':
        return InlineWrapper;
  
      case 'static':
        return StaticWrapper;
  
      default:
        return ModalWrapper;
    }
  }
  var VariantContext = React.createContext(null);
  var Wrapper = function Wrapper(_ref) {
    var variant = _ref.variant,
        props = _objectWithoutProperties(_ref, ["variant"]);
  
    var Component = getWrapperFromVariant(variant);
    return React.createElement(VariantContext.Provider, {
      value: variant || 'dialog'
    }, React.createElement(Component, props));
  };
  
  var findClosestEnabledDate = function findClosestEnabledDate(_ref) {
    var date = _ref.date,
        utils = _ref.utils,
        minDate = _ref.minDate,
        maxDate = _ref.maxDate,
        disableFuture = _ref.disableFuture,
        disablePast = _ref.disablePast,
        shouldDisableDate = _ref.shouldDisableDate;
    var today = utils.startOfDay(utils.date());
  
    if (disablePast && utils.isBefore(minDate, today)) {
      minDate = today;
    }
  
    if (disableFuture && utils.isAfter(maxDate, today)) {
      maxDate = today;
    }
  
    var forward = date;
    var backward = date;
  
    if (utils.isBefore(date, minDate)) {
      forward = utils.date(minDate);
      backward = null;
    }
  
    if (utils.isAfter(date, maxDate)) {
      if (backward) {
        backward = utils.date(maxDate);
      }
  
      forward = null;
    }
  
    while (forward || backward) {
      if (forward && utils.isAfter(forward, maxDate)) {
        forward = null;
      }
  
      if (backward && utils.isBefore(backward, minDate)) {
        backward = null;
      }
  
      if (forward) {
        if (!shouldDisableDate(forward)) {
          return forward;
        }
  
        forward = utils.addDays(forward, 1);
      }
  
      if (backward) {
        if (!shouldDisableDate(backward)) {
          return backward;
        }
  
        backward = utils.addDays(backward, -1);
      }
    } // fallback to today if no enabled days
  
  
    return utils.date();
  };
  var isYearOnlyView = function isYearOnlyView(views) {
    return views.length === 1 && views[0] === 'year';
  };
  var isYearAndMonthViews = function isYearAndMonthViews(views) {
    return views.length === 2 && arrayIncludes(views, 'month') && arrayIncludes(views, 'year');
  };
  var getFormatByViews = function getFormatByViews(views, utils) {
    if (isYearOnlyView(views)) {
      return utils.yearFormat;
    }
  
    if (isYearAndMonthViews(views)) {
      return utils.yearMonthFormat;
    }
  
    return utils.dateFormat;
  };
  
  var withUtils = function withUtils() {
    return function (Component) {
      var WithUtils = function WithUtils(props) {
        var utils = useUtils();
        return React.createElement(Component, _extends({
          utils: utils
        }, props));
      };
  
      WithUtils.displayName = "WithUtils(".concat(Component.displayName || Component.name, ")");
      return WithUtils;
    };
  };
  
  var KeyDownListener = function KeyDownListener(_ref) {
    var onKeyDown = _ref.onKeyDown;
    React.useEffect(function () {
      window.addEventListener('keydown', onKeyDown);
      return function () {
        window.removeEventListener('keydown', onKeyDown);
      };
    }, [onKeyDown]);
    return null;
  };
  
  var Calendar =
  /*#__PURE__*/
  function (_React$Component) {
    _inherits(Calendar, _React$Component);
  
    function Calendar() {
      var _getPrototypeOf2;
  
      var _this;
  
      _classCallCheck(this, Calendar);
  
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
  
      _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Calendar)).call.apply(_getPrototypeOf2, [this].concat(args)));
      _this.state = {
        slideDirection: 'left',
        currentMonth: _this.props.utils.startOfMonth(_this.props.date),
        loadingQueue: 0
      };
  
      _this.pushToLoadingQueue = function () {
        var loadingQueue = _this.state.loadingQueue + 1;
  
        _this.setState({
          loadingQueue: loadingQueue
        });
      };
  
      _this.popFromLoadingQueue = function () {
        var loadingQueue = _this.state.loadingQueue;
        loadingQueue = loadingQueue <= 0 ? 0 : loadingQueue - 1;
  
        _this.setState({
          loadingQueue: loadingQueue
        });
      };
  
      _this.handleChangeMonth = function (newMonth, slideDirection) {
        _this.setState({
          currentMonth: newMonth,
          slideDirection: slideDirection
        });
  
        if (_this.props.onMonthChange) {
          var returnVal = _this.props.onMonthChange(newMonth);
  
          if (returnVal) {
            _this.pushToLoadingQueue();
  
            returnVal.then(function () {
              _this.popFromLoadingQueue();
            });
          }
        }
      };
  
      _this.validateMinMaxDate = function (day) {
        var _this$props = _this.props,
            minDate = _this$props.minDate,
            maxDate = _this$props.maxDate,
            utils = _this$props.utils,
            disableFuture = _this$props.disableFuture,
            disablePast = _this$props.disablePast;
        var now = utils.date();
        return Boolean(disableFuture && utils.isAfterDay(day, now) || disablePast && utils.isBeforeDay(day, now) || minDate && utils.isBeforeDay(day, utils.date(minDate)) || maxDate && utils.isAfterDay(day, utils.date(maxDate)));
      };
  
      _this.shouldDisablePrevMonth = function () {
        var _this$props2 = _this.props,
            utils = _this$props2.utils,
            disablePast = _this$props2.disablePast,
            minDate = _this$props2.minDate;
        var now = utils.date();
        var firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, utils.date(minDate)) ? now : utils.date(minDate));
        return !utils.isBefore(firstEnabledMonth, _this.state.currentMonth);
      };
  
      _this.shouldDisableNextMonth = function () {
        var _this$props3 = _this.props,
            utils = _this$props3.utils,
            disableFuture = _this$props3.disableFuture,
            maxDate = _this$props3.maxDate;
        var now = utils.date();
        var lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, utils.date(maxDate)) ? now : utils.date(maxDate));
        return !utils.isAfter(lastEnabledMonth, _this.state.currentMonth);
      };
  
      _this.shouldDisableDate = function (day) {
        var shouldDisableDate = _this.props.shouldDisableDate;
        return _this.validateMinMaxDate(day) || Boolean(shouldDisableDate && shouldDisableDate(day));
      };
  
      _this.handleDaySelect = function (day) {
        var isFinish = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
        var _this$props4 = _this.props,
            date = _this$props4.date,
            utils = _this$props4.utils;
  
        _this.props.onChange(utils.mergeDateAndTime(day, date), isFinish);
      };
  
      _this.moveToDay = function (day) {
        var utils = _this.props.utils;
  
        if (day && !_this.shouldDisableDate(day)) {
          if (utils.getMonth(day) !== utils.getMonth(_this.state.currentMonth)) {
            _this.handleChangeMonth(utils.startOfMonth(day), 'left');
          }
  
          _this.handleDaySelect(day, false);
        }
      };
  
      _this.handleKeyDown = function (event) {
        var _this$props5 = _this.props,
            theme = _this$props5.theme,
            date = _this$props5.date,
            utils = _this$props5.utils;
        runKeyHandler(event, {
          ArrowUp: function ArrowUp() {
            return _this.moveToDay(utils.addDays(date, -7));
          },
          ArrowDown: function ArrowDown() {
            return _this.moveToDay(utils.addDays(date, 7));
          },
          ArrowLeft: function ArrowLeft() {
            return _this.moveToDay(utils.addDays(date, theme.direction === 'ltr' ? -1 : 1));
          },
          ArrowRight: function ArrowRight() {
            return _this.moveToDay(utils.addDays(date, theme.direction === 'ltr' ? 1 : -1));
          }
        });
      };
  
      _this.renderWeeks = function () {
        var _this$props6 = _this.props,
            utils = _this$props6.utils,
            classes = _this$props6.classes;
        var weeks = utils.getWeekArray(_this.state.currentMonth);
        return weeks.map(function (week) {
          return React.createElement("div", {
            key: "week-".concat(week[0].toString()),
            className: classes.week
          }, _this.renderDays(week));
        });
      };
  
      _this.renderDays = function (week) {
        var _this$props7 = _this.props,
            date = _this$props7.date,
            renderDay = _this$props7.renderDay,
            utils = _this$props7.utils;
        var now = utils.date();
        var selectedDate = utils.startOfDay(date);
        var currentMonthNumber = utils.getMonth(_this.state.currentMonth);
        return week.map(function (day) {
          var disabled = _this.shouldDisableDate(day);
  
          var isDayInCurrentMonth = utils.getMonth(day) === currentMonthNumber;
          var dayComponent = React.createElement(Day, {
            disabled: disabled,
            current: utils.isSameDay(day, now),
            hidden: !isDayInCurrentMonth,
            selected: utils.isSameDay(selectedDate, day)
          }, utils.getDayText(day));
  
          if (renderDay) {
            dayComponent = renderDay(day, selectedDate, isDayInCurrentMonth, dayComponent);
          }
  
          return React.createElement(DayWrapper, {
            value: day,
            key: day.toString(),
            disabled: disabled,
            dayInCurrentMonth: isDayInCurrentMonth,
            onSelect: _this.handleDaySelect
          }, dayComponent);
        });
      };
  
      return _this;
    }
  
    _createClass(Calendar, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        var _this$props8 = this.props,
            date = _this$props8.date,
            minDate = _this$props8.minDate,
            maxDate = _this$props8.maxDate,
            utils = _this$props8.utils,
            disablePast = _this$props8.disablePast,
            disableFuture = _this$props8.disableFuture;
  
        if (this.shouldDisableDate(date)) {
          var closestEnabledDate = findClosestEnabledDate({
            date: date,
            utils: utils,
            minDate: utils.date(minDate),
            maxDate: utils.date(maxDate),
            disablePast: Boolean(disablePast),
            disableFuture: Boolean(disableFuture),
            shouldDisableDate: this.shouldDisableDate
          });
          this.handleDaySelect(closestEnabledDate, false);
        }
      }
    }, {
      key: "render",
      value: function render() {
        var _this$state = this.state,
            currentMonth = _this$state.currentMonth,
            slideDirection = _this$state.slideDirection;
        var _this$props9 = this.props,
            classes = _this$props9.classes,
            allowKeyboardControl = _this$props9.allowKeyboardControl,
            leftArrowButtonProps = _this$props9.leftArrowButtonProps,
            leftArrowIcon = _this$props9.leftArrowIcon,
            rightArrowButtonProps = _this$props9.rightArrowButtonProps,
            rightArrowIcon = _this$props9.rightArrowIcon,
            loadingIndicator = _this$props9.loadingIndicator;
        var loadingElement = loadingIndicator ? loadingIndicator : React.createElement(CircularProgress, null);
        return React.createElement(React.Fragment, null, allowKeyboardControl && this.context !== 'static' && React.createElement(KeyDownListener, {
          onKeyDown: this.handleKeyDown
        }), React.createElement(CalendarHeader, {
          currentMonth: currentMonth,
          slideDirection: slideDirection,
          onMonthChange: this.handleChangeMonth,
          leftArrowIcon: leftArrowIcon,
          leftArrowButtonProps: leftArrowButtonProps,
          rightArrowIcon: rightArrowIcon,
          rightArrowButtonProps: rightArrowButtonProps,
          disablePrevMonth: this.shouldDisablePrevMonth(),
          disableNextMonth: this.shouldDisableNextMonth()
        }), React.createElement(SlideTransition, {
          slideDirection: slideDirection,
          transKey: currentMonth.toString(),
          className: classes.transitionContainer
        }, React.createElement(React.Fragment, null, this.state.loadingQueue > 0 && React.createElement("div", {
          className: classes.progressContainer
        }, loadingElement) || React.createElement("div", null, this.renderWeeks()))));
      }
    }], [{
      key: "getDerivedStateFromProps",
      value: function getDerivedStateFromProps(nextProps, state) {
        var utils = nextProps.utils,
            nextDate = nextProps.date;
  
        if (!utils.isEqual(nextDate, state.lastDate)) {
          var nextMonth = utils.getMonth(nextDate);
          var lastDate = state.lastDate || nextDate;
          var lastMonth = utils.getMonth(lastDate);
          return {
            lastDate: nextDate,
            currentMonth: nextProps.utils.startOfMonth(nextDate),
            // prettier-ignore
            slideDirection: nextMonth === lastMonth ? state.slideDirection : utils.isAfterDay(nextDate, lastDate) ? 'left' : 'right'
          };
        }
  
        return null;
      }
    }]);
  
    return Calendar;
  }(React.Component);
  Calendar.contextType = VariantContext;
  process.env.NODE_ENV !== "production" ? Calendar.propTypes = {
    renderDay: PropTypes.func,
    shouldDisableDate: PropTypes.func,
    allowKeyboardControl: PropTypes.bool
  } : void 0;
  Calendar.defaultProps = {
    minDate: new Date('1900-01-01'),
    maxDate: new Date('2100-01-01'),
    disablePast: false,
    disableFuture: false,
    allowKeyboardControl: true
  };
  var styles$2 = function styles(theme) {
    return {
      transitionContainer: {
        minHeight: 36 * 6,
        marginTop: theme.spacing(1.5)
      },
      progressContainer: {
        width: '100%',
        height: '100%',
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center'
      },
      week: {
        display: 'flex',
        justifyContent: 'center'
      }
    };
  };
  var Calendar$1 = styles$5.withStyles(styles$2, {
    name: 'MuiPickersCalendar',
    withTheme: true
  })(withUtils()(Calendar));
  
  function useViews(views, openTo, onChange) {
    var _React$useState = React.useState(openTo && arrayIncludes(views, openTo) ? openTo : views[0]),
        _React$useState2 = _slicedToArray(_React$useState, 2),
        openView = _React$useState2[0],
        setOpenView = _React$useState2[1];
  
    var handleChangeAndOpenNext = React.useCallback(function (date, isFinish) {
      var nextViewToOpen = views[views.indexOf(openView) + 1];
  
      if (isFinish && nextViewToOpen) {
        // do not close picker if needs to show next view
        onChange(date, false);
        setOpenView(nextViewToOpen);
        return;
      }
  
      onChange(date, Boolean(isFinish));
    }, [onChange, openView, views]);
    return {
      handleChangeAndOpenNext: handleChangeAndOpenNext,
      openView: openView,
      setOpenView: setOpenView
    };
  }
  
  var ClockPointer =
  /*#__PURE__*/
  function (_React$Component) {
    _inherits(ClockPointer, _React$Component);
  
    function ClockPointer() {
      var _getPrototypeOf2;
  
      var _this;
  
      _classCallCheck(this, ClockPointer);
  
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
  
      _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ClockPointer)).call.apply(_getPrototypeOf2, [this].concat(args)));
      _this.state = {
        toAnimateTransform: false,
        previousType: undefined
      };
  
      _this.getAngleStyle = function () {
        var _this$props = _this.props,
            value = _this$props.value,
            isInner = _this$props.isInner,
            type = _this$props.type;
        var max = type === ClockType$1.HOURS ? 12 : 60;
        var angle = 360 / max * value;
  
        if (type === ClockType$1.HOURS && value > 12) {
          angle -= 360; // round up angle to max 360 degrees
        }
  
        return {
          height: isInner ? '26%' : '40%',
          transform: "rotateZ(".concat(angle, "deg)")
        };
      };
  
      return _this;
    }
  
    _createClass(ClockPointer, [{
      key: "render",
      value: function render() {
        var _this$props2 = this.props,
            classes = _this$props2.classes,
            hasSelected = _this$props2.hasSelected;
        return React.createElement("div", {
          style: this.getAngleStyle(),
          className: clsx(classes.pointer, this.state.toAnimateTransform && classes.animateTransform)
        }, React.createElement("div", {
          className: clsx(classes.thumb, hasSelected && classes.noPoint)
        }));
      }
    }]);
  
    return ClockPointer;
  }(React.Component);
  
  ClockPointer.getDerivedStateFromProps = function (nextProps, state) {
    if (nextProps.type !== state.previousType) {
      return {
        toAnimateTransform: true,
        previousType: nextProps.type
      };
    }
  
    return {
      toAnimateTransform: false,
      previousType: nextProps.type
    };
  };
  
  var styles$3 = function styles(theme) {
    return styles$5.createStyles({
      pointer: {
        width: 2,
        backgroundColor: theme.palette.primary.main,
        position: 'absolute',
        left: 'calc(50% - 1px)',
        bottom: '50%',
        transformOrigin: 'center bottom 0px'
      },
      animateTransform: {
        transition: theme.transitions.create(['transform', 'height'])
      },
      thumb: {
        width: 4,
        height: 4,
        backgroundColor: theme.palette.primary.contrastText,
        borderRadius: '100%',
        position: 'absolute',
        top: -21,
        left: -15,
        border: "14px solid ".concat(theme.palette.primary.main),
        boxSizing: 'content-box'
      },
      noPoint: {
        backgroundColor: theme.palette.primary.main
      }
    });
  };
  var ClockPointer$1 = styles$5.withStyles(styles$3, {
    name: 'MuiPickersClockPointer'
  })(ClockPointer);
  
  var Clock =
  /*#__PURE__*/
  function (_React$Component) {
    _inherits(Clock, _React$Component);
  
    function Clock() {
      var _getPrototypeOf2;
  
      var _this;
  
      _classCallCheck(this, Clock);
  
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
  
      _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Clock)).call.apply(_getPrototypeOf2, [this].concat(args)));
      _this.isMoving = false;
  
      _this.handleTouchMove = function (e) {
        _this.isMoving = true;
  
        _this.setTime(e);
      };
  
      _this.handleTouchEnd = function (e) {
        if (_this.isMoving) {
          _this.setTime(e, true);
  
          _this.isMoving = false;
        }
      };
  
      _this.handleMove = function (e) {
        e.preventDefault();
        e.stopPropagation(); // MouseEvent.which is deprecated, but MouseEvent.buttons is not supported in Safari
  
        var isButtonPressed = typeof e.buttons === 'undefined' ? e.nativeEvent.which === 1 : e.buttons === 1;
  
        if (isButtonPressed) {
          _this.setTime(e.nativeEvent, false);
        }
      };
  
      _this.handleMouseUp = function (e) {
        if (_this.isMoving) {
          _this.isMoving = false;
        }
  
        _this.setTime(e.nativeEvent, true);
      };
  
      _this.hasSelected = function () {
        var _this$props = _this.props,
            type = _this$props.type,
            value = _this$props.value;
  
        if (type === ClockType$1.HOURS) {
          return true;
        }
  
        return value % 5 === 0;
      };
  
      return _this;
    }
  
    _createClass(Clock, [{
      key: "setTime",
      value: function setTime(e) {
        var isFinish = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
        var offsetX = e.offsetX,
            offsetY = e.offsetY;
  
        if (typeof offsetX === 'undefined') {
          var rect = e.target.getBoundingClientRect();
          offsetX = e.changedTouches[0].clientX - rect.left;
          offsetY = e.changedTouches[0].clientY - rect.top;
        }
  
        var value = this.props.type === ClockType$1.SECONDS || this.props.type === ClockType$1.MINUTES ? getMinutes(offsetX, offsetY, this.props.minutesStep) : getHours(offsetX, offsetY, Boolean(this.props.ampm));
        this.props.onChange(value, isFinish);
      }
    }, {
      key: "render",
      value: function render() {
        var _this$props2 = this.props,
            classes = _this$props2.classes,
            value = _this$props2.value,
            children = _this$props2.children,
            type = _this$props2.type,
            ampm = _this$props2.ampm;
        var isPointerInner = !ampm && type === ClockType$1.HOURS && (value < 1 || value > 12);
        return React.createElement("div", {
          className: classes.container
        }, React.createElement("div", {
          className: classes.clock
        }, React.createElement("div", {
          role: "menu",
          tabIndex: -1,
          className: classes.squareMask,
          onTouchMove: this.handleTouchMove,
          onTouchEnd: this.handleTouchEnd,
          onMouseUp: this.handleMouseUp,
          onMouseMove: this.handleMove
        }), React.createElement("div", {
          className: classes.pin
        }), React.createElement(ClockPointer$1, {
          type: type,
          value: value,
          isInner: isPointerInner,
          hasSelected: this.hasSelected()
        }), children));
      }
    }]);
  
    return Clock;
  }(React.Component);
  process.env.NODE_ENV !== "production" ? Clock.propTypes = {
    type: PropTypes.oneOf(Object.keys(ClockType$1).map(function (key) {
      return ClockType$1[key];
    })).isRequired,
    value: PropTypes.number.isRequired,
    onChange: PropTypes.func.isRequired,
    children: PropTypes.arrayOf(PropTypes.node).isRequired,
    ampm: PropTypes.bool,
    minutesStep: PropTypes.number,
    innerRef: PropTypes.any
  } : void 0;
  Clock.defaultProps = {
    ampm: false,
    minutesStep: 1
  };
  var styles$4 = function styles(theme) {
    return styles$5.createStyles({
      container: {
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'flex-end',
        margin: "".concat(theme.spacing(2), "px 0 ").concat(theme.spacing(1), "px")
      },
      clock: {
        backgroundColor: 'rgba(0,0,0,.07)',
        borderRadius: '50%',
        height: 260,
        width: 260,
        position: 'relative',
        pointerEvents: 'none',
        zIndex: 1
      },
      squareMask: {
        width: '100%',
        height: '100%',
        position: 'absolute',
        pointerEvents: 'auto',
        outline: 'none',
        touchActions: 'none',
        userSelect: 'none',
        '&:active': {
          cursor: 'move'
        }
      },
      pin: {
        width: 6,
        height: 6,
        borderRadius: '50%',
        backgroundColor: theme.palette.primary.main,
        position: 'absolute',
        top: '50%',
        left: '50%',
        transform: 'translate(-50%, -50%)'
      }
    });
  };
  var Clock$1 = styles$5.withStyles(styles$4, {
    name: 'MuiPickersClock'
  })(Clock);
  
  var positions = {
    0: [0, 40],
    1: [55, 19.6],
    2: [94.4, 59.5],
    3: [109, 114],
    4: [94.4, 168.5],
    5: [54.5, 208.4],
    6: [0, 223],
    7: [-54.5, 208.4],
    8: [-94.4, 168.5],
    9: [-109, 114],
    10: [-94.4, 59.5],
    11: [-54.5, 19.6],
    12: [0, 5],
    13: [36.9, 49.9],
    14: [64, 77],
    15: [74, 114],
    16: [64, 151],
    17: [37, 178],
    18: [0, 188],
    19: [-37, 178],
    20: [-64, 151],
    21: [-74, 114],
    22: [-64, 77],
    23: [-37, 50]
  };
  var useStyles$7 = styles$5.makeStyles(function (theme) {
    var size = theme.spacing(4);
    return {
      clockNumber: {
        width: size,
        height: 32,
        userSelect: 'none',
        position: 'absolute',
        left: "calc((100% - ".concat(typeof size === 'number' ? "".concat(size, "px") : size, ") / 2)"),
        display: 'inline-flex',
        justifyContent: 'center',
        alignItems: 'center',
        borderRadius: '50%',
        color: theme.palette.type === 'light' ? theme.palette.text.primary : theme.palette.text.hint
      },
      clockNumberSelected: {
        color: theme.palette.primary.contrastText
      }
    };
  }, {
    name: 'MuiPickersClockNumber'
  });
  var ClockNumber = function ClockNumber(_ref) {
    var selected = _ref.selected,
        label = _ref.label,
        index = _ref.index,
        isInner = _ref.isInner;
    var classes = useStyles$7();
    var className = clsx(classes.clockNumber, selected && classes.clockNumberSelected);
    var transformStyle = React.useMemo(function () {
      var position = positions[index];
      return {
        transform: "translate(".concat(position[0], "px, ").concat(position[1], "px")
      };
    }, [index]);
    return React.createElement(Typography, {
      component: "span",
      className: className,
      variant: isInner ? 'body2' : 'body1',
      style: transformStyle,
      children: label
    });
  };
  
  var getHourNumbers = function getHourNumbers(_ref) {
    var ampm = _ref.ampm,
        utils = _ref.utils,
        date = _ref.date;
    var currentHours = utils.getHours(date);
    var hourNumbers = [];
    var startHour = ampm ? 1 : 0;
    var endHour = ampm ? 12 : 23;
  
    var isSelected = function isSelected(hour) {
      if (ampm) {
        if (hour === 12) {
          return currentHours === 12 || currentHours === 0;
        }
  
        return currentHours === hour || currentHours - 12 === hour;
      }
  
      return currentHours === hour;
    };
  
    for (var hour = startHour; hour <= endHour; hour += 1) {
      var label = hour.toString();
  
      if (hour === 0) {
        label = '00';
      }
  
      var props = {
        index: hour,
        label: utils.formatNumber(label),
        selected: isSelected(hour),
        isInner: !ampm && (hour === 0 || hour > 12)
      };
      hourNumbers.push(React.createElement(ClockNumber, _extends({
        key: hour
      }, props)));
    }
  
    return hourNumbers;
  };
  var getMinutesNumbers = function getMinutesNumbers(_ref2) {
    var value = _ref2.value,
        utils = _ref2.utils;
    var f = utils.formatNumber;
    return [React.createElement(ClockNumber, {
      label: f('00'),
      selected: value === 0,
      index: 12,
      key: 12
    }), React.createElement(ClockNumber, {
      label: f('05'),
      selected: value === 5,
      index: 1,
      key: 1
    }), React.createElement(ClockNumber, {
      label: f('10'),
      selected: value === 10,
      index: 2,
      key: 2
    }), React.createElement(ClockNumber, {
      label: f('15'),
      selected: value === 15,
      index: 3,
      key: 3
    }), React.createElement(ClockNumber, {
      label: f('20'),
      selected: value === 20,
      index: 4,
      key: 4
    }), React.createElement(ClockNumber, {
      label: f('25'),
      selected: value === 25,
      index: 5,
      key: 5
    }), React.createElement(ClockNumber, {
      label: f('30'),
      selected: value === 30,
      index: 6,
      key: 6
    }), React.createElement(ClockNumber, {
      label: f('35'),
      selected: value === 35,
      index: 7,
      key: 7
    }), React.createElement(ClockNumber, {
      label: f('40'),
      selected: value === 40,
      index: 8,
      key: 8
    }), React.createElement(ClockNumber, {
      label: f('45'),
      selected: value === 45,
      index: 9,
      key: 9
    }), React.createElement(ClockNumber, {
      label: f('50'),
      selected: value === 50,
      index: 10,
      key: 10
    }), React.createElement(ClockNumber, {
      label: f('55'),
      selected: value === 55,
      index: 11,
      key: 11
    })];
  };
  
  var ClockView = function ClockView(_ref) {
    var type = _ref.type,
        onHourChange = _ref.onHourChange,
        onMinutesChange = _ref.onMinutesChange,
        onSecondsChange = _ref.onSecondsChange,
        ampm = _ref.ampm,
        date = _ref.date,
        minutesStep = _ref.minutesStep;
    var utils = useUtils();
    var viewProps = React.useMemo(function () {
      switch (type) {
        case ClockType$1.HOURS:
          return {
            value: utils.getHours(date),
            children: getHourNumbers({
              date: date,
              utils: utils,
              ampm: Boolean(ampm)
            }),
            onChange: function onChange(value, isFinish) {
              var currentMeridiem = getMeridiem(date, utils);
              var updatedTimeWithMeridiem = convertToMeridiem(utils.setHours(date, value), currentMeridiem, Boolean(ampm), utils);
              onHourChange(updatedTimeWithMeridiem, isFinish);
            }
          };
  
        case ClockType$1.MINUTES:
          var minutesValue = utils.getMinutes(date);
          return {
            value: minutesValue,
            children: getMinutesNumbers({
              value: minutesValue,
              utils: utils
            }),
            onChange: function onChange(value, isFinish) {
              var updatedTime = utils.setMinutes(date, value);
              onMinutesChange(updatedTime, isFinish);
            }
          };
  
        case ClockType$1.SECONDS:
          var secondsValue = utils.getSeconds(date);
          return {
            value: secondsValue,
            children: getMinutesNumbers({
              value: secondsValue,
              utils: utils
            }),
            onChange: function onChange(value, isFinish) {
              var updatedTime = utils.setSeconds(date, value);
              onSecondsChange(updatedTime, isFinish);
            }
          };
  
        default:
          throw new Error('You must provide the type for TimePickerView');
      }
    }, [ampm, date, onHourChange, onMinutesChange, onSecondsChange, type, utils]);
    return React.createElement(Clock$1, _extends({
      type: type,
      ampm: ampm,
      minutesStep: minutesStep
    }, viewProps));
  };
  ClockView.displayName = 'TimePickerView';
  process.env.NODE_ENV !== "production" ? ClockView.propTypes = {
    date: PropTypes.object.isRequired,
    onHourChange: PropTypes.func.isRequired,
    onMinutesChange: PropTypes.func.isRequired,
    onSecondsChange: PropTypes.func.isRequired,
    ampm: PropTypes.bool,
    minutesStep: PropTypes.number,
    type: PropTypes.oneOf(Object.keys(ClockType$1).map(function (key) {
      return ClockType$1[key];
    })).isRequired
  } : void 0;
  ClockView.defaultProps = {
    ampm: true,
    minutesStep: 1
  };
  var ClockView$1 = React.memo(ClockView);
  
  var useStyles$8 = styles$5.makeStyles(function (theme) {
    return {
      root: {
        height: 40,
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        cursor: 'pointer',
        outline: 'none',
        '&:focus': {
          color: theme.palette.primary.main,
          fontWeight: theme.typography.fontWeightMedium
        }
      },
      yearSelected: {
        margin: '10px 0',
        fontWeight: theme.typography.fontWeightMedium
      },
      yearDisabled: {
        pointerEvents: 'none',
        color: theme.palette.text.hint
      }
    };
  }, {
    name: 'MuiPickersYear'
  });
  var Year = function Year(_ref) {
    var onSelect = _ref.onSelect,
        forwardedRef = _ref.forwardedRef,
        value = _ref.value,
        selected = _ref.selected,
        disabled = _ref.disabled,
        children = _ref.children,
        other = _objectWithoutProperties(_ref, ["onSelect", "forwardedRef", "value", "selected", "disabled", "children"]);
  
    var classes = useStyles$8();
    var handleClick = React.useCallback(function () {
      return onSelect(value);
    }, [onSelect, value]);
    return React.createElement(Typography, _extends({
      role: "button",
      component: "div",
      tabIndex: disabled ? -1 : 0,
      onClick: handleClick,
      onKeyPress: handleClick,
      color: selected ? 'primary' : undefined,
      variant: selected ? 'h5' : 'subtitle1',
      children: children,
      ref: forwardedRef,
      className: clsx(classes.root, selected && classes.yearSelected, disabled && classes.yearDisabled)
    }, other));
  };
  Year.displayName = 'Year';
  var Year$1 = React.forwardRef(function (props, ref) {
    return React.createElement(Year, _extends({}, props, {
      forwardedRef: ref
    }));
  });
  
  var useStyles$9 = styles$5.makeStyles({
    container: {
      height: 300,
      overflowY: 'auto'
    }
  }, {
    name: 'MuiPickersYearSelection'
  });
  var YearSelection = function YearSelection(_ref) {
    var date = _ref.date,
        onChange = _ref.onChange,
        onYearChange = _ref.onYearChange,
        minDate = _ref.minDate,
        maxDate = _ref.maxDate,
        disablePast = _ref.disablePast,
        disableFuture = _ref.disableFuture,
        animateYearScrolling = _ref.animateYearScrolling;
    var utils = useUtils();
    var classes = useStyles$9();
    var currentVariant = React.useContext(VariantContext);
    var selectedYearRef = React.useRef(null);
    React.useEffect(function () {
      if (selectedYearRef.current && selectedYearRef.current.scrollIntoView) {
        selectedYearRef.current.scrollIntoView({
          block: currentVariant === 'static' ? 'nearest' : 'center',
          behavior: animateYearScrolling ? 'smooth' : 'auto'
        });
      }
    }, []); // eslint-disable-line
  
    var currentYear = utils.getYear(date);
    var onYearSelect = React.useCallback(function (year) {
      var newDate = utils.setYear(date, year);
  
      if (onYearChange) {
        onYearChange(newDate);
      }
  
      onChange(newDate, true);
    }, [date, onChange, onYearChange, utils]);
    return React.createElement("div", {
      className: classes.container
    }, utils.getYearRange(minDate, maxDate).map(function (year) {
      var yearNumber = utils.getYear(year);
      var selected = yearNumber === currentYear;
      return React.createElement(Year$1, {
        key: utils.getYearText(year),
        selected: selected,
        value: yearNumber,
        onSelect: onYearSelect,
        ref: selected ? selectedYearRef : undefined,
        disabled: Boolean(disablePast && utils.isBeforeYear(year, utils.date()) || disableFuture && utils.isAfterYear(year, utils.date()))
      }, utils.getYearText(year));
    }));
  };
  
  var useStyles$a = styles$5.makeStyles(function (theme) {
    return {
      root: {
        flex: '1 0 33.33%',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        cursor: 'pointer',
        outline: 'none',
        height: 75,
        transition: theme.transitions.create('font-size', {
          duration: '100ms'
        }),
        '&:focus': {
          color: theme.palette.primary.main,
          fontWeight: theme.typography.fontWeightMedium
        }
      },
      monthSelected: {
        color: theme.palette.primary.main,
        fontWeight: theme.typography.fontWeightMedium
      },
      monthDisabled: {
        pointerEvents: 'none',
        color: theme.palette.text.hint
      }
    };
  }, {
    name: 'MuiPickersMonth'
  });
  var Month = function Month(_ref) {
    var selected = _ref.selected,
        onSelect = _ref.onSelect,
        disabled = _ref.disabled,
        value = _ref.value,
        children = _ref.children,
        other = _objectWithoutProperties(_ref, ["selected", "onSelect", "disabled", "value", "children"]);
  
    var classes = useStyles$a();
    var handleSelection = React.useCallback(function () {
      onSelect(value);
    }, [onSelect, value]);
    return React.createElement(Typography, _extends({
      role: "button",
      component: "div",
      className: clsx(classes.root, selected && classes.monthSelected, disabled && classes.monthDisabled),
      tabIndex: disabled ? -1 : 0,
      onClick: handleSelection,
      onKeyPress: handleSelection,
      color: selected ? 'primary' : undefined,
      variant: selected ? 'h5' : 'subtitle1',
      children: children
    }, other));
  };
  Month.displayName = 'Month';
  
  var useStyles$b = styles$5.makeStyles({
    container: {
      width: 310,
      display: 'flex',
      flexWrap: 'wrap',
      alignContent: 'stretch'
    }
  }, {
    name: 'MuiPickersMonthSelection'
  });
  var MonthSelection = function MonthSelection(_ref) {
    var disablePast = _ref.disablePast,
        disableFuture = _ref.disableFuture,
        minDate = _ref.minDate,
        maxDate = _ref.maxDate,
        date = _ref.date,
        onMonthChange = _ref.onMonthChange,
        onChange = _ref.onChange;
    var utils = useUtils();
    var classes = useStyles$b();
    var currentMonth = utils.getMonth(date);
  
    var shouldDisableMonth = function shouldDisableMonth(month) {
      var now = utils.date();
      var utilMinDate = utils.date(minDate);
      var utilMaxDate = utils.date(maxDate);
      var firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, utilMinDate) ? now : utilMinDate);
      var lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, utilMaxDate) ? now : utilMaxDate);
      var isBeforeFirstEnabled = utils.isBefore(month, firstEnabledMonth);
      var isAfterLastEnabled = utils.isAfter(month, lastEnabledMonth);
      return isBeforeFirstEnabled || isAfterLastEnabled;
    };
  
    var onMonthSelect = React.useCallback(function (month) {
      var newDate = utils.setMonth(date, month);
      onChange(newDate, true);
  
      if (onMonthChange) {
        onMonthChange(newDate);
      }
    }, [date, onChange, onMonthChange, utils]);
    return React.createElement("div", {
      className: classes.container
    }, utils.getMonthArray(date).map(function (month) {
      var monthNumber = utils.getMonth(month);
      var monthText = utils.format(month, 'MMM');
      return React.createElement(Month, {
        key: monthText,
        value: monthNumber,
        selected: monthNumber === currentMonth,
        onSelect: onMonthSelect,
        disabled: shouldDisableMonth(month)
      }, monthText);
    }));
  };
  
  var getOrientation = function getOrientation() {
    if (typeof window === 'undefined') {
      return 'portrait';
    }
  
    if (window.screen && window.screen.orientation && window.screen.orientation.angle) {
      return Math.abs(window.screen.orientation.angle) === 90 ? 'landscape' : 'portrait';
    } // Support IOS safari
  
  
    if (window.orientation) {
      return Math.abs(Number(window.orientation)) === 90 ? 'landscape' : 'portrait';
    }
  
    return 'portrait';
  };
  
  function useIsLandscape(customOrientation) {
    var _React$useState = React.useState(getOrientation()),
        _React$useState2 = _slicedToArray(_React$useState, 2),
        orientation = _React$useState2[0],
        setOrientation = _React$useState2[1];
  
    var eventHandler = React.useCallback(function () {
      return setOrientation(getOrientation());
    }, []);
    useIsomorphicEffect(function () {
      window.addEventListener('orientationchange', eventHandler);
      return function () {
        return window.removeEventListener('orientationchange', eventHandler);
      };
    }, [eventHandler]);
    var orientationToUse = customOrientation || orientation;
    return orientationToUse === 'landscape';
  }
  
  function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  var viewsMap = {
    year: YearSelection,
    month: MonthSelection,
    date: Calendar$1,
    hours: ClockView,
    minutes: ClockView,
    seconds: ClockView
  };
  var useStyles$c = styles$5.makeStyles({
    container: {
      display: 'flex',
      flexDirection: 'column'
    },
    containerLandscape: {
      flexDirection: 'row'
    },
    pickerView: {
      overflowX: 'hidden',
      minHeight: VIEW_HEIGHT,
      minWidth: DIALOG_WIDTH,
      maxWidth: DIALOG_WIDTH_WIDER,
      display: 'flex',
      flexDirection: 'column',
      justifyContent: 'center'
    },
    pickerViewLandscape: {
      padding: '0 8px'
    }
  }, {
    name: 'MuiPickersBasePicker'
  });
  var Picker = function Picker(_ref) {
    var date = _ref.date,
        views = _ref.views,
        disableToolbar = _ref.disableToolbar,
        onChange = _ref.onChange,
        openTo = _ref.openTo,
        unparsedMinDate = _ref.minDate,
        unparsedMaxDate = _ref.maxDate,
        ToolbarComponent = _ref.ToolbarComponent,
        orientation = _ref.orientation,
        rest = _objectWithoutProperties(_ref, ["date", "views", "disableToolbar", "onChange", "openTo", "minDate", "maxDate", "ToolbarComponent", "orientation"]);
  
    var utils = useUtils();
    var classes = useStyles$c();
    var isLandscape = useIsLandscape(orientation);
  
    var _useViews = useViews(views, openTo, onChange),
        openView = _useViews.openView,
        setOpenView = _useViews.setOpenView,
        handleChangeAndOpenNext = _useViews.handleChangeAndOpenNext;
  
    var minDate = React.useMemo(function () {
      return utils.date(unparsedMinDate);
    }, [unparsedMinDate, utils]);
    var maxDate = React.useMemo(function () {
      return utils.date(unparsedMaxDate);
    }, [unparsedMaxDate, utils]);
    return React.createElement("div", {
      className: clsx(classes.container, isLandscape && classes.containerLandscape)
    }, !disableToolbar && React.createElement(ToolbarComponent, _extends({}, rest, {
      views: views,
      isLandscape: isLandscape,
      date: date,
      onChange: onChange,
      setOpenView: setOpenView,
      openView: openView
    })), React.createElement("div", {
      className: clsx(classes.pickerView, isLandscape && classes.pickerViewLandscape)
    }, openView === 'year' && React.createElement(YearSelection, _extends({}, rest, {
      date: date,
      onChange: handleChangeAndOpenNext,
      minDate: minDate,
      maxDate: maxDate
    })), openView === 'month' && React.createElement(MonthSelection, _extends({}, rest, {
      date: date,
      onChange: handleChangeAndOpenNext,
      minDate: minDate,
      maxDate: maxDate
    })), openView === 'date' && React.createElement(Calendar$1, _extends({}, rest, {
      date: date,
      onChange: handleChangeAndOpenNext,
      minDate: minDate,
      maxDate: maxDate
    })), (openView === 'hours' || openView === 'minutes' || openView === 'seconds') && React.createElement(ClockView, _extends({}, rest, {
      date: date,
      type: openView,
      onHourChange: handleChangeAndOpenNext,
      onMinutesChange: handleChangeAndOpenNext,
      onSecondsChange: handleChangeAndOpenNext
    }))));
  };
  Picker.defaultProps = _objectSpread$4({}, datePickerDefaultProps, {
    views: Object.keys(viewsMap)
  });
  
  function makePickerWithState(_ref) {
    var Input = _ref.Input,
        useState = _ref.useState,
        useOptions = _ref.useOptions,
        getCustomProps = _ref.getCustomProps,
        DefaultToolbarComponent = _ref.DefaultToolbarComponent;
  
    function PickerWithState(props) {
      var allowKeyboardControl = props.allowKeyboardControl,
          ampm = props.ampm,
          animateYearScrolling = props.animateYearScrolling,
          autoOk = props.autoOk,
          dateRangeIcon = props.dateRangeIcon,
          disableFuture = props.disableFuture,
          disablePast = props.disablePast,
          disableToolbar = props.disableToolbar,
          emptyLabel = props.emptyLabel,
          format = props.format,
          forwardedRef = props.forwardedRef,
          hideTabs = props.hideTabs,
          initialFocusedDate = props.initialFocusedDate,
          invalidDateMessage = props.invalidDateMessage,
          invalidLabel = props.invalidLabel,
          labelFunc = props.labelFunc,
          leftArrowButtonProps = props.leftArrowButtonProps,
          leftArrowIcon = props.leftArrowIcon,
          loadingIndicator = props.loadingIndicator,
          maxDate = props.maxDate,
          maxDateMessage = props.maxDateMessage,
          minDate = props.minDate,
          minDateMessage = props.minDateMessage,
          minutesStep = props.minutesStep,
          onAccept = props.onAccept,
          onChange = props.onChange,
          onClose = props.onClose,
          onMonthChange = props.onMonthChange,
          onOpen = props.onOpen,
          onYearChange = props.onYearChange,
          openTo = props.openTo,
          orientation = props.orientation,
          renderDay = props.renderDay,
          rightArrowButtonProps = props.rightArrowButtonProps,
          rightArrowIcon = props.rightArrowIcon,
          shouldDisableDate = props.shouldDisableDate,
          strictCompareDates = props.strictCompareDates,
          timeIcon = props.timeIcon,
          _props$ToolbarCompone = props.ToolbarComponent,
          ToolbarComponent = _props$ToolbarCompone === void 0 ? DefaultToolbarComponent : _props$ToolbarCompone,
          value = props.value,
          variant = props.variant,
          views = props.views,
          other = _objectWithoutProperties(props, ["allowKeyboardControl", "ampm", "animateYearScrolling", "autoOk", "dateRangeIcon", "disableFuture", "disablePast", "disableToolbar", "emptyLabel", "format", "forwardedRef", "hideTabs", "initialFocusedDate", "invalidDateMessage", "invalidLabel", "labelFunc", "leftArrowButtonProps", "leftArrowIcon", "loadingIndicator", "maxDate", "maxDateMessage", "minDate", "minDateMessage", "minutesStep", "onAccept", "onChange", "onClose", "onMonthChange", "onOpen", "onYearChange", "openTo", "orientation", "renderDay", "rightArrowButtonProps", "rightArrowIcon", "shouldDisableDate", "strictCompareDates", "timeIcon", "ToolbarComponent", "value", "variant", "views"]);
  
      var injectedProps = getCustomProps ? getCustomProps(props) : {};
      var options = useOptions(props);
  
      var _useState = useState(props, options),
          pickerProps = _useState.pickerProps,
          inputProps = _useState.inputProps,
          wrapperProps = _useState.wrapperProps;
  
      return React.createElement(Wrapper, _extends({
        variant: variant,
        InputComponent: Input,
        DateInputProps: inputProps
      }, injectedProps, wrapperProps, other), React.createElement(Picker, _extends({}, pickerProps, {
        allowKeyboardControl: allowKeyboardControl,
        ampm: ampm,
        animateYearScrolling: animateYearScrolling,
        dateRangeIcon: dateRangeIcon,
        disableFuture: disableFuture,
        disablePast: disablePast,
        disableToolbar: disableToolbar,
        hideTabs: hideTabs,
        leftArrowButtonProps: leftArrowButtonProps,
        leftArrowIcon: leftArrowIcon,
        loadingIndicator: loadingIndicator,
        maxDate: maxDate,
        minDate: minDate,
        minutesStep: minutesStep,
        onMonthChange: onMonthChange,
        onYearChange: onYearChange,
        openTo: openTo,
        orientation: orientation,
        renderDay: renderDay,
        rightArrowButtonProps: rightArrowButtonProps,
        rightArrowIcon: rightArrowIcon,
        shouldDisableDate: shouldDisableDate,
        strictCompareDates: strictCompareDates,
        timeIcon: timeIcon,
        ToolbarComponent: ToolbarComponent,
        views: views
      })));
    }
  
    return PickerWithState;
  }
  
  function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  var defaultProps = _objectSpread$5({}, timePickerDefaultProps, {
    openTo: 'hours',
    views: ['hours', 'minutes']
  });
  
  function useOptions(props) {
    var utils = useUtils();
    return {
      getDefaultFormat: function getDefaultFormat() {
        return pick12hOr24hFormat(props.format, props.ampm, {
          '12h': utils.time12hFormat,
          '24h': utils.time24hFormat
        });
      }
    };
  }
  
  var TimePicker = makePickerWithState({
    useOptions: useOptions,
    Input: PureDateInput,
    useState: usePickerState,
    DefaultToolbarComponent: TimePickerToolbar
  });
  var KeyboardTimePicker = makePickerWithState({
    useOptions: useOptions,
    Input: KeyboardDateInput,
    useState: useKeyboardPickerState,
    DefaultToolbarComponent: TimePickerToolbar,
    getCustomProps: function getCustomProps(props) {
      return {
        refuse: props.ampm ? /[^\dap]+/gi : /[^\d]+/gi
      };
    }
  });
  TimePicker.defaultProps = defaultProps;
  KeyboardTimePicker.defaultProps = defaultProps;
  
  var useStyles$d = styles$5.makeStyles({
    toolbar: {
      flexDirection: 'column',
      alignItems: 'flex-start'
    },
    toolbarLandscape: {
      padding: 16
    },
    dateLandscape: {
      marginRight: 16
    }
  }, {
    name: 'MuiPickersDatePickerRoot'
  });
  var DatePickerToolbar = function DatePickerToolbar(_ref) {
    var date = _ref.date,
        views = _ref.views,
        setOpenView = _ref.setOpenView,
        isLandscape = _ref.isLandscape,
        openView = _ref.openView;
    var utils = useUtils();
    var classes = useStyles$d();
    var isYearOnly = React.useMemo(function () {
      return isYearOnlyView(views);
    }, [views]);
    var isYearAndMonth = React.useMemo(function () {
      return isYearAndMonthViews(views);
    }, [views]);
    return React.createElement(PickerToolbar, {
      isLandscape: isLandscape,
      className: clsx(!isYearOnly && classes.toolbar, isLandscape && classes.toolbarLandscape)
    }, React.createElement(ToolbarButton$1, {
      variant: isYearOnly ? 'h3' : 'subtitle1',
      onClick: function onClick() {
        return setOpenView('year');
      },
      selected: openView === 'year',
      label: utils.getYearText(date)
    }), !isYearOnly && !isYearAndMonth && React.createElement(ToolbarButton$1, {
      variant: "h4",
      selected: openView === 'date',
      onClick: function onClick() {
        return setOpenView('date');
      },
      align: isLandscape ? 'left' : 'center',
      label: utils.getDatePickerHeaderText(date),
      className: clsx(isLandscape && classes.dateLandscape)
    }), isYearAndMonth && React.createElement(ToolbarButton$1, {
      variant: "h4",
      onClick: function onClick() {
        return setOpenView('month');
      },
      selected: openView === 'month',
      label: utils.getMonthText(date)
    }));
  };
  
  function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$6(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$6(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  var defaultProps$1 = _objectSpread$6({}, datePickerDefaultProps, {
    openTo: 'date',
    views: ['year', 'date']
  });
  
  function useOptions$1(props) {
    var utils = useUtils();
    return {
      getDefaultFormat: function getDefaultFormat() {
        return getFormatByViews(props.views, utils);
      }
    };
  }
  
  var DatePicker = makePickerWithState({
    useOptions: useOptions$1,
    Input: PureDateInput,
    useState: usePickerState,
    DefaultToolbarComponent: DatePickerToolbar
  });
  var KeyboardDatePicker = makePickerWithState({
    useOptions: useOptions$1,
    Input: KeyboardDateInput,
    useState: useKeyboardPickerState,
    DefaultToolbarComponent: DatePickerToolbar
  });
  DatePicker.defaultProps = defaultProps$1;
  KeyboardDatePicker.defaultProps = defaultProps$1;
  
  var TimeIcon = function TimeIcon(props) {
    return React__default.createElement(SvgIcon, props, React__default.createElement("path", {
      d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
    }), React__default.createElement("path", {
      fill: "none",
      d: "M0 0h24v24H0z"
    }), React__default.createElement("path", {
      d: "M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"
    }));
  };
  
  var DateRangeIcon = function DateRangeIcon(props) {
    return React__default.createElement(SvgIcon, props, React__default.createElement("path", {
      d: "M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"
    }), React__default.createElement("path", {
      fill: "none",
      d: "M0 0h24v24H0z"
    }));
  };
  
  var viewToTabIndex = function viewToTabIndex(openView) {
    if (openView === 'date' || openView === 'year') {
      return 'date';
    }
  
    return 'time';
  };
  
  var tabIndexToView = function tabIndexToView(tab) {
    if (tab === 'date') {
      return 'date';
    }
  
    return 'hours';
  };
  
  var useStyles$e = styles$5.makeStyles(function (theme) {
    // prettier-ignore
    var tabsBackground = theme.palette.type === 'light' ? theme.palette.primary.main : theme.palette.background["default"];
    return {
      tabs: {
        color: theme.palette.getContrastText(tabsBackground),
        backgroundColor: tabsBackground
      }
    };
  }, {
    name: 'MuiPickerDTTabs'
  });
  var DateTimePickerTabs = function DateTimePickerTabs(_ref) {
    var view = _ref.view,
        onChange = _ref.onChange,
        dateRangeIcon = _ref.dateRangeIcon,
        timeIcon = _ref.timeIcon;
    var classes = useStyles$e();
    var theme = styles$5.useTheme();
    var indicatorColor = theme.palette.type === 'light' ? 'secondary' : 'primary';
  
    var handleChange = function handleChange(e, value) {
      if (value !== viewToTabIndex(view)) {
        onChange(tabIndexToView(value));
      }
    };
  
    return React.createElement(Paper, null, React.createElement(Tabs, {
      variant: "fullWidth",
      value: viewToTabIndex(view),
      onChange: handleChange,
      className: classes.tabs,
      indicatorColor: indicatorColor
    }, React.createElement(Tab, {
      value: "date",
      icon: React.createElement(React.Fragment, null, dateRangeIcon)
    }), React.createElement(Tab, {
      value: "time",
      icon: React.createElement(React.Fragment, null, timeIcon)
    })));
  };
  DateTimePickerTabs.defaultProps = {
    dateRangeIcon: React.createElement(DateRangeIcon, null),
    timeIcon: React.createElement(TimeIcon, null)
  };
  
  var useStyles$f = styles$5.makeStyles(function (_) {
    return {
      toolbar: {
        paddingLeft: 16,
        paddingRight: 16,
        justifyContent: 'space-around'
      },
      separator: {
        margin: '0 4px 0 2px',
        cursor: 'default'
      }
    };
  }, {
    name: 'MuiPickerDTToolbar'
  });
  var DateTimePickerToolbar = function DateTimePickerToolbar(_ref) {
    var date = _ref.date,
        openView = _ref.openView,
        setOpenView = _ref.setOpenView,
        ampm = _ref.ampm,
        hideTabs = _ref.hideTabs,
        dateRangeIcon = _ref.dateRangeIcon,
        timeIcon = _ref.timeIcon,
        onChange = _ref.onChange;
    var utils = useUtils();
    var classes = useStyles$f();
    var showTabs = !hideTabs && typeof window !== 'undefined' && window.innerHeight > 667;
  
    var _useMeridiemMode = useMeridiemMode(date, ampm, onChange),
        meridiemMode = _useMeridiemMode.meridiemMode,
        handleMeridiemChange = _useMeridiemMode.handleMeridiemChange;
  
    var theme = styles$5.useTheme();
    var rtl = theme.direction === 'rtl';
    return React.createElement(React.Fragment, null, React.createElement(PickerToolbar, {
      isLandscape: false,
      className: classes.toolbar
    }, React.createElement(Grid, {
      container: true,
      justify: "center",
      wrap: "nowrap"
    }, React.createElement(Grid, {
      item: true,
      container: true,
      xs: 5,
      justify: "flex-start",
      direction: "column"
    }, React.createElement("div", null, React.createElement(ToolbarButton$1, {
      variant: "subtitle1",
      onClick: function onClick() {
        return setOpenView('year');
      },
      selected: openView === 'year',
      label: utils.getYearText(date)
    })), React.createElement("div", null, React.createElement(ToolbarButton$1, {
      variant: "h4",
      onClick: function onClick() {
        return setOpenView('date');
      },
      selected: openView === 'date',
      label: utils.getDateTimePickerHeaderText(date)
    }))), React.createElement(Grid, {
      item: true,
      container: true,
      xs: 6,
      justify: "center",
      alignItems: "flex-end",
      direction: rtl ? 'row-reverse' : 'row'
    }, React.createElement(ToolbarButton$1, {
      variant: "h3",
      onClick: function onClick() {
        return setOpenView('hours');
      },
      selected: openView === 'hours',
      label: utils.getHourText(date, ampm)
    }), React.createElement(ToolbarText, {
      variant: "h3",
      label: ":",
      className: classes.separator
    }), React.createElement(ToolbarButton$1, {
      variant: "h3",
      onClick: function onClick() {
        return setOpenView('minutes');
      },
      selected: openView === 'minutes',
      label: utils.getMinuteText(date)
    })), ampm && React.createElement(Grid, {
      item: true,
      container: true,
      xs: 1,
      direction: "column",
      justify: "flex-end"
    }, React.createElement(ToolbarButton$1, {
      variant: "subtitle1",
      selected: meridiemMode === 'am',
      label: utils.getMeridiemText('am'),
      onClick: function onClick() {
        return handleMeridiemChange('am');
      }
    }), React.createElement(ToolbarButton$1, {
      variant: "subtitle1",
      selected: meridiemMode === 'pm',
      label: utils.getMeridiemText('pm'),
      onClick: function onClick() {
        return handleMeridiemChange('pm');
      }
    })))), showTabs && React.createElement(DateTimePickerTabs, {
      dateRangeIcon: dateRangeIcon,
      timeIcon: timeIcon,
      view: openView,
      onChange: setOpenView
    }));
  };
  
  function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$7(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$7(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  var defaultProps$2 = _objectSpread$7({}, dateTimePickerDefaultProps, {
    wider: true,
    orientation: 'portrait',
    openTo: 'date',
    views: ['year', 'date', 'hours', 'minutes']
  });
  
  function useOptions$2(props) {
    var utils = useUtils();
  
    if (props.orientation !== 'portrait') {
      throw new Error('We are not supporting custom orientation for DateTimePicker yet :(');
    }
  
    return {
      getDefaultFormat: function getDefaultFormat() {
        return pick12hOr24hFormat(props.format, props.ampm, {
          '12h': utils.dateTime12hFormat,
          '24h': utils.dateTime24hFormat
        });
      }
    };
  }
  
  var DateTimePicker = makePickerWithState({
    useOptions: useOptions$2,
    Input: PureDateInput,
    useState: usePickerState,
    DefaultToolbarComponent: DateTimePickerToolbar
  });
  var KeyboardDateTimePicker = makePickerWithState({
    useOptions: useOptions$2,
    Input: KeyboardDateInput,
    useState: useKeyboardPickerState,
    DefaultToolbarComponent: DateTimePickerToolbar,
    getCustomProps: function getCustomProps(props) {
      return {
        refuse: props.ampm ? /[^\dap]+/gi : /[^\d]+/gi
      };
    }
  });
  DateTimePicker.defaultProps = defaultProps$2;
  KeyboardDateTimePicker.defaultProps = defaultProps$2;
  
  function useStaticState(_ref) {
    var value = _ref.value,
        _ref$autoOk = _ref.autoOk,
        autoOk = _ref$autoOk === void 0 ? true : _ref$autoOk,
        onChange = _ref.onChange,
        defaultFormat = _ref.defaultFormat;
  
    var _usePickerState = usePickerState({
      value: value,
      onChange: onChange,
      autoOk: autoOk
    }, {
      // just a random format, mostly always not needed for users
      getDefaultFormat: function getDefaultFormat() {
        return defaultFormat || 'MM/dd/yyyy';
      }
    }),
        pickerProps = _usePickerState.pickerProps,
        wrapperProps = _usePickerState.wrapperProps,
        inputProps = _usePickerState.inputProps;
  
    return {
      pickerProps: pickerProps,
      wrapperProps: wrapperProps,
      inputProps: inputProps
    };
  }
  
  exports.Calendar = Calendar$1;
  exports.Clock = Clock$1;
  exports.ClockView = ClockView;
  exports.DatePicker = DatePicker;
  exports.DateTimePicker = DateTimePicker;
  exports.Day = Day;
  exports.KeyboardDatePicker = KeyboardDatePicker;
  exports.KeyboardDateTimePicker = KeyboardDateTimePicker;
  exports.KeyboardTimePicker = KeyboardTimePicker;
  exports.MuiPickersContext = MuiPickersContext;
  exports.MuiPickersUtilsProvider = MuiPickersUtilsProvider;
  exports.Picker = Picker;
  exports.TimePicker = TimePicker;
  exports.TimePickerView = ClockView$1;
  exports.makePickerWithState = makePickerWithState;
  exports.useKeyboardPickerState = useKeyboardPickerState;
  exports.usePickerState = usePickerState;
  exports.useStaticState = useStaticState;
  exports.useUtils = useUtils;
  exports.validate = validate;
  //# sourceMappingURL=material-ui-pickers.js.map
  