@bigbinary/neetoui 6.2.6 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -257,9 +257,9 @@ const MotionContext = React$3.createContext({});
257
257
  */
258
258
  const PresenceContext = React$3.createContext(null);
259
259
 
260
- const isBrowser$9 = typeof document !== "undefined";
260
+ const isBrowser$b = typeof document !== "undefined";
261
261
 
262
- const useIsomorphicLayoutEffect$2 = isBrowser$9 ? React$3.useLayoutEffect : React$3.useEffect;
262
+ const useIsomorphicLayoutEffect$3 = isBrowser$b ? React$3.useLayoutEffect : React$3.useEffect;
263
263
 
264
264
  const LazyContext = React$3.createContext({ strict: false });
265
265
 
@@ -294,7 +294,7 @@ function useVisualElement(Component, visualState, props, createVisualElement) {
294
294
  * was present on initial render - it will be deleted after this.
295
295
  */
296
296
  const canHandoff = React$3.useRef(Boolean(window.HandoffAppearAnimations));
297
- useIsomorphicLayoutEffect$2(() => {
297
+ useIsomorphicLayoutEffect$3(() => {
298
298
  if (!visualElement)
299
299
  return;
300
300
  visualElement.render();
@@ -485,7 +485,7 @@ function createMotionComponent({ preloadedFeatures, createVisualElement, useRend
485
485
  const { isStatic } = configAndProps;
486
486
  const context = useCreateMotionContext(props);
487
487
  const visualState = useVisualState(props, isStatic);
488
- if (!isStatic && isBrowser$9) {
488
+ if (!isStatic && isBrowser$b) {
489
489
  /**
490
490
  * Create a VisualElement for this component. A VisualElement provides a common
491
491
  * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as
@@ -2807,7 +2807,7 @@ function calcGeneratorVelocity(resolveValue, t, current) {
2807
2807
  return velocityPerSecond(current - resolveValue(prevT), t - prevT);
2808
2808
  }
2809
2809
 
2810
- const safeMin$1 = 0.001;
2810
+ const safeMin$2 = 0.001;
2811
2811
  const minDuration = 0.01;
2812
2812
  const maxDuration$1 = 10.0;
2813
2813
  const minDamping = 0.05;
@@ -2832,7 +2832,7 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
2832
2832
  const a = exponentialDecay - velocity;
2833
2833
  const b = calcAngularFreq(undampedFreq, dampingRatio);
2834
2834
  const c = Math.exp(-delta);
2835
- return safeMin$1 - (a / b) * c;
2835
+ return safeMin$2 - (a / b) * c;
2836
2836
  };
2837
2837
  derivative = (undampedFreq) => {
2838
2838
  const exponentialDecay = undampedFreq * dampingRatio;
@@ -2841,7 +2841,7 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
2841
2841
  const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;
2842
2842
  const f = Math.exp(-delta);
2843
2843
  const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);
2844
- const factor = -envelope(undampedFreq) + safeMin$1 > 0 ? -1 : 1;
2844
+ const factor = -envelope(undampedFreq) + safeMin$2 > 0 ? -1 : 1;
2845
2845
  return (factor * ((d - e) * f)) / g;
2846
2846
  };
2847
2847
  }
@@ -2852,7 +2852,7 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
2852
2852
  envelope = (undampedFreq) => {
2853
2853
  const a = Math.exp(-undampedFreq * duration);
2854
2854
  const b = (undampedFreq - velocity) * duration + 1;
2855
- return -safeMin$1 + a * b;
2855
+ return -safeMin$2 + a * b;
2856
2856
  };
2857
2857
  derivative = (undampedFreq) => {
2858
2858
  const a = Math.exp(-undampedFreq * duration);
@@ -8377,7 +8377,7 @@ const checkAndConvertChangedValueTypes = (visualElement, target, origin = {}, tr
8377
8377
  // Reapply original values
8378
8378
  visualElement.render();
8379
8379
  // Restore scroll position
8380
- if (isBrowser$9 && scrollY !== null) {
8380
+ if (isBrowser$b && scrollY !== null) {
8381
8381
  window.scrollTo({ top: scrollY });
8382
8382
  }
8383
8383
  return { target: convertedTarget, transitionEnd };
@@ -8416,7 +8416,7 @@ const hasReducedMotionListener = { current: false };
8416
8416
 
8417
8417
  function initPrefersReducedMotion() {
8418
8418
  hasReducedMotionListener.current = true;
8419
- if (!isBrowser$9)
8419
+ if (!isBrowser$b)
8420
8420
  return;
8421
8421
  if (window.matchMedia) {
8422
8422
  const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
@@ -9102,7 +9102,7 @@ const motion = /*@__PURE__*/ createMotionProxy((Component, config) => createDomM
9102
9102
 
9103
9103
  function useIsMounted() {
9104
9104
  const isMounted = React$3.useRef(false);
9105
- useIsomorphicLayoutEffect$2(() => {
9105
+ useIsomorphicLayoutEffect$3(() => {
9106
9106
  isMounted.current = true;
9107
9107
  return () => {
9108
9108
  isMounted.current = false;
@@ -9312,7 +9312,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, exi
9312
9312
  // If this is the initial component render, just deal with logic surrounding whether
9313
9313
  // we play onMount animations or not.
9314
9314
  const isInitialRender = React$3.useRef(true);
9315
- useIsomorphicLayoutEffect$2(() => {
9315
+ useIsomorphicLayoutEffect$3(() => {
9316
9316
  isInitialRender.current = false;
9317
9317
  updateChildLookup(filteredChildren, allChildren);
9318
9318
  presentChildren.current = childrenToRender;
@@ -13910,8 +13910,8 @@ function bindGlobalEventListeners() {
13910
13910
  window.addEventListener('blur', onWindowBlur);
13911
13911
  }
13912
13912
 
13913
- var isBrowser$8 = typeof window !== 'undefined' && typeof document !== 'undefined';
13914
- var isIE11 = isBrowser$8 ? // @ts-ignore
13913
+ var isBrowser$a = typeof window !== 'undefined' && typeof document !== 'undefined';
13914
+ var isIE11 = isBrowser$a ? // @ts-ignore
13915
13915
  !!window.msCrypto : false;
13916
13916
 
13917
13917
  var pluginProps = {
@@ -15361,7 +15361,7 @@ function _objectWithoutPropertiesLoose$4(source, excluded) {
15361
15361
  return target;
15362
15362
  }
15363
15363
 
15364
- var isBrowser$7 = typeof window !== 'undefined' && typeof document !== 'undefined';
15364
+ var isBrowser$9 = typeof window !== 'undefined' && typeof document !== 'undefined';
15365
15365
  function preserveRef(ref, node) {
15366
15366
  if (ref) {
15367
15367
  if (typeof ref === 'function') {
@@ -15374,7 +15374,7 @@ function preserveRef(ref, node) {
15374
15374
  }
15375
15375
  }
15376
15376
  function ssrSafeCreateDiv() {
15377
- return isBrowser$7 && document.createElement('div');
15377
+ return isBrowser$9 && document.createElement('div');
15378
15378
  }
15379
15379
  function toDataAttributes(attrs) {
15380
15380
  var dataAttrs = {
@@ -15437,7 +15437,7 @@ function deepPreserveProps(instanceProps, componentProps) {
15437
15437
  });
15438
15438
  }
15439
15439
 
15440
- var useIsomorphicLayoutEffect$1 = isBrowser$7 ? React$3.useLayoutEffect : React$3.useEffect;
15440
+ var useIsomorphicLayoutEffect$2 = isBrowser$9 ? React$3.useLayoutEffect : React$3.useEffect;
15441
15441
  function useMutableBox(initialValue) {
15442
15442
  // Using refs instead of state as it's recommended to not store imperative
15443
15443
  // values in state due to memory problems in React(?)
@@ -15576,7 +15576,7 @@ function TippyGenerator(tippy) {
15576
15576
 
15577
15577
  var deps = [reference].concat(children ? [children.type] : []); // CREATE
15578
15578
 
15579
- useIsomorphicLayoutEffect$1(function () {
15579
+ useIsomorphicLayoutEffect$2(function () {
15580
15580
  var element = reference;
15581
15581
 
15582
15582
  if (reference && reference.hasOwnProperty('current')) {
@@ -15611,7 +15611,7 @@ function TippyGenerator(tippy) {
15611
15611
  };
15612
15612
  }, deps); // UPDATE
15613
15613
 
15614
- useIsomorphicLayoutEffect$1(function () {
15614
+ useIsomorphicLayoutEffect$2(function () {
15615
15615
  var _instance$popperInsta;
15616
15616
 
15617
15617
  // Prevent this effect from running on 1st render
@@ -15647,7 +15647,7 @@ function TippyGenerator(tippy) {
15647
15647
  });
15648
15648
  }
15649
15649
  });
15650
- useIsomorphicLayoutEffect$1(function () {
15650
+ useIsomorphicLayoutEffect$2(function () {
15651
15651
  var _instance$props$poppe;
15652
15652
 
15653
15653
  if (!render) {
@@ -15923,7 +15923,7 @@ var Button = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, r
15923
15923
  });
15924
15924
  Button.displayName = "Button";
15925
15925
 
15926
- var Divider$1 = function Divider(props) {
15926
+ var Divider$2 = function Divider(props) {
15927
15927
  return /*#__PURE__*/React__default["default"].createElement("li", _extends$4({
15928
15928
  className: "neeto-ui-dropdown__popup-divider"
15929
15929
  }, props));
@@ -16196,7 +16196,7 @@ var Dropdown = function Dropdown(_ref2) {
16196
16196
  };
16197
16197
  Dropdown.Menu = Menu$3;
16198
16198
  Dropdown.MenuItem = MenuItem$1;
16199
- Dropdown.Divider = Divider$1;
16199
+ Dropdown.Divider = Divider$2;
16200
16200
 
16201
16201
  var _excluded$D = ["style", "size"];
16202
16202
  var BTN_STYLES = {
@@ -22684,7 +22684,7 @@ var ColorPicker = function ColorPicker(_ref) {
22684
22684
  }, /*#__PURE__*/React__default["default"].createElement(Palette, colorPaletteProps))));
22685
22685
  };
22686
22686
 
22687
- var _excluded$w = ["className", "label", "size", "dropdownClassName", "popupClassName", "dateFormat", "timeFormat", "onChange", "onOk", "picker", "showTime", "type", "nakedInput", "error", "defaultValue", "value", "labelProps", "required", "allowClear"];
22687
+ var _excluded$w = ["className", "label", "size", "dropdownClassName", "popupClassName", "dateFormat", "timeFormat", "onChange", "onOk", "picker", "mode", "showTime", "type", "nakedInput", "error", "defaultValue", "value", "labelProps", "required", "allowClear"];
22688
22688
  function ownKeys$m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
22689
22689
  function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$m(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$m(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22690
22690
  var INPUT_SIZES$2 = {
@@ -22706,43 +22706,59 @@ var IconOverride = function IconOverride(_ref) {
22706
22706
  size: 20
22707
22707
  }));
22708
22708
  };
22709
- var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref2, ref) {
22710
- var _ref2$className = _ref2.className,
22711
- className = _ref2$className === void 0 ? "" : _ref2$className,
22712
- _ref2$label = _ref2.label,
22713
- label = _ref2$label === void 0 ? "" : _ref2$label,
22714
- _ref2$size = _ref2.size,
22715
- size = _ref2$size === void 0 ? INPUT_SIZES$2.medium : _ref2$size,
22716
- _ref2$dropdownClassNa = _ref2.dropdownClassName,
22717
- dropdownClassName = _ref2$dropdownClassNa === void 0 ? "" : _ref2$dropdownClassNa,
22718
- _ref2$popupClassName = _ref2.popupClassName,
22719
- popupClassName = _ref2$popupClassName === void 0 ? "" : _ref2$popupClassName,
22720
- _ref2$dateFormat = _ref2.dateFormat,
22721
- dateFormat = _ref2$dateFormat === void 0 ? "DD/MM/YYYY" : _ref2$dateFormat,
22722
- _ref2$timeFormat = _ref2.timeFormat,
22723
- timeFormat = _ref2$timeFormat === void 0 ? "HH:mm:ss" : _ref2$timeFormat,
22724
- _ref2$onChange = _ref2.onChange,
22725
- onChange = _ref2$onChange === void 0 ? noop$3 : _ref2$onChange,
22726
- _ref2$onOk = _ref2.onOk,
22727
- onOk = _ref2$onOk === void 0 ? noop$3 : _ref2$onOk,
22728
- _ref2$picker = _ref2.picker,
22729
- picker = _ref2$picker === void 0 ? "date" : _ref2$picker,
22730
- _ref2$showTime = _ref2.showTime,
22731
- showTime = _ref2$showTime === void 0 ? false : _ref2$showTime,
22732
- _ref2$type = _ref2.type,
22733
- type = _ref2$type === void 0 ? "date" : _ref2$type,
22734
- _ref2$nakedInput = _ref2.nakedInput,
22735
- nakedInput = _ref2$nakedInput === void 0 ? false : _ref2$nakedInput,
22736
- _ref2$error = _ref2.error,
22737
- error = _ref2$error === void 0 ? "" : _ref2$error,
22738
- defaultValue = _ref2.defaultValue,
22739
- value = _ref2.value,
22740
- labelProps = _ref2.labelProps,
22741
- _ref2$required = _ref2.required,
22742
- required = _ref2$required === void 0 ? false : _ref2$required,
22743
- _ref2$allowClear = _ref2.allowClear,
22744
- allowClear = _ref2$allowClear === void 0 ? true : _ref2$allowClear,
22745
- otherProps = _objectWithoutProperties$1(_ref2, _excluded$w);
22709
+ var Today = function Today(_ref2) {
22710
+ var onClick = _ref2.onClick;
22711
+ return /*#__PURE__*/React__default["default"].createElement("div", {
22712
+ className: "text-center"
22713
+ }, /*#__PURE__*/React__default["default"].createElement("button", {
22714
+ onClick: onClick,
22715
+ className: "neeto-ui-rounded-md hover:neeto-ui-bg-gray-200 px-2 py-1 text-xs font-medium transition duration-300 ease-in-out",
22716
+ "data-cy": "year-month-mode-today"
22717
+ }, "Today"));
22718
+ };
22719
+ var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref3, ref) {
22720
+ var _ref3$className = _ref3.className,
22721
+ className = _ref3$className === void 0 ? "" : _ref3$className,
22722
+ _ref3$label = _ref3.label,
22723
+ label = _ref3$label === void 0 ? "" : _ref3$label,
22724
+ _ref3$size = _ref3.size,
22725
+ size = _ref3$size === void 0 ? INPUT_SIZES$2.medium : _ref3$size,
22726
+ _ref3$dropdownClassNa = _ref3.dropdownClassName,
22727
+ dropdownClassName = _ref3$dropdownClassNa === void 0 ? "" : _ref3$dropdownClassNa,
22728
+ _ref3$popupClassName = _ref3.popupClassName,
22729
+ popupClassName = _ref3$popupClassName === void 0 ? "" : _ref3$popupClassName,
22730
+ _ref3$dateFormat = _ref3.dateFormat,
22731
+ dateFormat = _ref3$dateFormat === void 0 ? "DD/MM/YYYY" : _ref3$dateFormat,
22732
+ _ref3$timeFormat = _ref3.timeFormat,
22733
+ timeFormat = _ref3$timeFormat === void 0 ? "HH:mm:ss" : _ref3$timeFormat,
22734
+ _ref3$onChange = _ref3.onChange,
22735
+ onChange = _ref3$onChange === void 0 ? noop$3 : _ref3$onChange,
22736
+ _ref3$onOk = _ref3.onOk,
22737
+ onOk = _ref3$onOk === void 0 ? noop$3 : _ref3$onOk,
22738
+ _ref3$picker = _ref3.picker,
22739
+ picker = _ref3$picker === void 0 ? "date" : _ref3$picker,
22740
+ _ref3$mode = _ref3.mode,
22741
+ inputMode = _ref3$mode === void 0 ? "date" : _ref3$mode,
22742
+ _ref3$showTime = _ref3.showTime,
22743
+ showTime = _ref3$showTime === void 0 ? false : _ref3$showTime,
22744
+ _ref3$type = _ref3.type,
22745
+ type = _ref3$type === void 0 ? "date" : _ref3$type,
22746
+ _ref3$nakedInput = _ref3.nakedInput,
22747
+ nakedInput = _ref3$nakedInput === void 0 ? false : _ref3$nakedInput,
22748
+ _ref3$error = _ref3.error,
22749
+ error = _ref3$error === void 0 ? "" : _ref3$error,
22750
+ defaultValue = _ref3.defaultValue,
22751
+ value = _ref3.value,
22752
+ labelProps = _ref3.labelProps,
22753
+ _ref3$required = _ref3.required,
22754
+ required = _ref3$required === void 0 ? false : _ref3$required,
22755
+ _ref3$allowClear = _ref3.allowClear,
22756
+ allowClear = _ref3$allowClear === void 0 ? true : _ref3$allowClear,
22757
+ otherProps = _objectWithoutProperties$1(_ref3, _excluded$w);
22758
+ var _useState = React$3.useState(inputMode),
22759
+ _useState2 = _slicedToArray$3(_useState, 2),
22760
+ mode = _useState2[0],
22761
+ setMode = _useState2[1];
22746
22762
  var id = useId(otherProps.id);
22747
22763
  var datePickerRef = useSyncedRef(ref);
22748
22764
  var Component = datePickerTypes[type === null || type === void 0 ? void 0 : type.toLowerCase()];
@@ -22751,6 +22767,17 @@ var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref2, ref) {
22751
22767
  var handleOnChange = function handleOnChange(date, dateString) {
22752
22768
  type === "range" && !date ? onChange([], dateString) : onChange(date, dateString);
22753
22769
  };
22770
+ var renderExtraFooter = function renderExtraFooter() {
22771
+ if (type === "range" || mode === "date") return null;
22772
+ return /*#__PURE__*/React__default["default"].createElement(Today, {
22773
+ onClick: function onClick() {
22774
+ setMode("date");
22775
+ setTimeout(function () {
22776
+ document.querySelector(".ant-picker-today-btn").click();
22777
+ });
22778
+ }
22779
+ });
22780
+ };
22754
22781
  return /*#__PURE__*/React__default["default"].createElement(_ConfigProvider__default["default"], {
22755
22782
  theme: {
22756
22783
  token: _objectSpread$l({}, ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES),
@@ -22807,9 +22834,6 @@ var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref2, ref) {
22807
22834
  }, label && /*#__PURE__*/React__default["default"].createElement(Label, _objectSpread$l({
22808
22835
  required: required
22809
22836
  }, labelProps), label), /*#__PURE__*/React__default["default"].createElement(Component, _extends$4({
22810
- format: format,
22811
- onOk: onOk,
22812
- picker: picker,
22813
22837
  "data-cy": label ? "".concat(hyphenize(label), "-input") : "picker-input",
22814
22838
  defaultValue: convertToDayjsObjects(defaultValue),
22815
22839
  ref: datePickerRef,
@@ -22829,7 +22853,17 @@ var DatePicker = /*#__PURE__*/React$3.forwardRef(function (_ref2, ref) {
22829
22853
  // Will be removed in the next major version
22830
22854
  popupClassName]),
22831
22855
  onChange: handleOnChange
22832
- }, otherProps, {
22856
+ }, _objectSpread$l(_objectSpread$l({
22857
+ format: format,
22858
+ onOk: onOk,
22859
+ picker: picker
22860
+ }, otherProps), type === "date" && {
22861
+ mode: mode,
22862
+ renderExtraFooter: renderExtraFooter,
22863
+ onPanelChange: function onPanelChange(_, mode) {
22864
+ return setMode(mode);
22865
+ }
22866
+ }), {
22833
22867
  nextIcon: /*#__PURE__*/React__default["default"].createElement(IconOverride, {
22834
22868
  icon: neetoIcons.Right
22835
22869
  }),
@@ -22867,7 +22901,7 @@ var customParseFormat$1 = {exports: {}};
22867
22901
 
22868
22902
  var customParseFormat = customParseFormat$1.exports;
22869
22903
 
22870
- var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
22904
+ var __spreadArray$3 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
22871
22905
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
22872
22906
  if (ar || !(i in from)) {
22873
22907
  if (!ar) ar = Array.prototype.slice.call(from, 0, i);
@@ -22958,7 +22992,7 @@ var animationEvents = [
22958
22992
  var transitionEvents = ['onTransitionEnd'];
22959
22993
  var otherEvents = ['onToggle'];
22960
22994
  var changeEvents = ['onChange'];
22961
- var allEvents = __spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2([], clipboardEvents, true), compositionEvents, true), focusEvents, true), formEvents, true), imageEvents, true), keyboardEvents, true), mediaEvents, true), mouseEvents, true), dragEvents, true), selectionEvents, true), touchEvents, true), pointerEvents, true), uiEvents, true), wheelEvents, true), animationEvents, true), transitionEvents, true), changeEvents, true), otherEvents, true);
22995
+ var allEvents = __spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3([], clipboardEvents, true), compositionEvents, true), focusEvents, true), formEvents, true), imageEvents, true), keyboardEvents, true), mediaEvents, true), mouseEvents, true), dragEvents, true), selectionEvents, true), touchEvents, true), pointerEvents, true), uiEvents, true), wheelEvents, true), animationEvents, true), transitionEvents, true), changeEvents, true), otherEvents, true);
22962
22996
  /**
22963
22997
  * Returns an object with on-event callback props curried with provided args.
22964
22998
  * @param {Object} props Props passed to a component.
@@ -22984,8 +23018,6 @@ function makeEventProps(props, getArgs) {
22984
23018
  return eventProps;
22985
23019
  }
22986
23020
 
22987
- function r$3(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$3(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$2(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$3(e))&&(n&&(n+=" "),n+=t);return n}
22988
-
22989
23021
  function r$2(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$2(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$1(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$2(e))&&(n&&(n+=" "),n+=t);return n}
22990
23022
 
22991
23023
  /**
@@ -23142,8 +23174,8 @@ function Mark(_a) {
23142
23174
  } }, number)) : null));
23143
23175
  }
23144
23176
 
23145
- var __assign$8 = (undefined && undefined.__assign) || function () {
23146
- __assign$8 = Object.assign || function(t) {
23177
+ var __assign$e = (undefined && undefined.__assign) || function () {
23178
+ __assign$e = Object.assign || function(t) {
23147
23179
  for (var s, i = 1, n = arguments.length; i < n; i++) {
23148
23180
  s = arguments[i];
23149
23181
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -23151,10 +23183,10 @@ var __assign$8 = (undefined && undefined.__assign) || function () {
23151
23183
  }
23152
23184
  return t;
23153
23185
  };
23154
- return __assign$8.apply(this, arguments);
23186
+ return __assign$e.apply(this, arguments);
23155
23187
  };
23156
23188
  var MinuteMark = React$3.memo(function MinuteMark(props) {
23157
- return React__default["default"].createElement(Mark, __assign$8({}, props));
23189
+ return React__default["default"].createElement(Mark, __assign$e({}, props));
23158
23190
  });
23159
23191
 
23160
23192
  /**
@@ -23902,8 +23934,8 @@ function formatHour(locale, hour) {
23902
23934
  return hour.toLocaleString(locale || getUserLocale() || undefined);
23903
23935
  }
23904
23936
 
23905
- var __assign$7 = (undefined && undefined.__assign) || function () {
23906
- __assign$7 = Object.assign || function(t) {
23937
+ var __assign$d = (undefined && undefined.__assign) || function () {
23938
+ __assign$d = Object.assign || function(t) {
23907
23939
  for (var s, i = 1, n = arguments.length; i < n; i++) {
23908
23940
  s = arguments[i];
23909
23941
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -23911,9 +23943,9 @@ var __assign$7 = (undefined && undefined.__assign) || function () {
23911
23943
  }
23912
23944
  return t;
23913
23945
  };
23914
- return __assign$7.apply(this, arguments);
23946
+ return __assign$d.apply(this, arguments);
23915
23947
  };
23916
- var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
23948
+ var __rest$b = (undefined && undefined.__rest) || function (s, e) {
23917
23949
  var t = {};
23918
23950
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
23919
23951
  t[p] = s[p];
@@ -23925,8 +23957,8 @@ var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
23925
23957
  return t;
23926
23958
  };
23927
23959
  var HourMark = React$3.memo(function HourMark(_a) {
23928
- var _b = _a.formatHour, formatHour$1 = _b === void 0 ? formatHour : _b, locale = _a.locale, number = _a.number, otherProps = __rest$6(_a, ["formatHour", "locale", "number"]);
23929
- return React__default["default"].createElement(Mark, __assign$7({ number: number ? formatHour$1(locale, number) : null }, otherProps));
23960
+ var _b = _a.formatHour, formatHour$1 = _b === void 0 ? formatHour : _b, locale = _a.locale, number = _a.number, otherProps = __rest$b(_a, ["formatHour", "locale", "number"]);
23961
+ return React__default["default"].createElement(Mark, __assign$d({ number: number ? formatHour$1(locale, number) : null }, otherProps));
23930
23962
  });
23931
23963
 
23932
23964
  function isNumberBetween(min, max) {
@@ -24106,8 +24138,8 @@ var __extends = (undefined && undefined.__extends) || (function () {
24106
24138
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
24107
24139
  };
24108
24140
  })();
24109
- var __assign$6 = (undefined && undefined.__assign) || function () {
24110
- __assign$6 = Object.assign || function(t) {
24141
+ var __assign$c = (undefined && undefined.__assign) || function () {
24142
+ __assign$c = Object.assign || function(t) {
24111
24143
  for (var s, i = 1, n = arguments.length; i < n; i++) {
24112
24144
  s = arguments[i];
24113
24145
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -24115,9 +24147,9 @@ var __assign$6 = (undefined && undefined.__assign) || function () {
24115
24147
  }
24116
24148
  return t;
24117
24149
  };
24118
- return __assign$6.apply(this, arguments);
24150
+ return __assign$c.apply(this, arguments);
24119
24151
  };
24120
- var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
24152
+ var __rest$a = (undefined && undefined.__rest) || function (s, e) {
24121
24153
  var t = {};
24122
24154
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24123
24155
  t[p] = s[p];
@@ -24128,9 +24160,9 @@ var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
24128
24160
  }
24129
24161
  return t;
24130
24162
  };
24131
- var isBrowser$6 = typeof document !== 'undefined';
24132
- var isDisplayContentsSupported = isBrowser$6 && 'CSS' in window && 'supports' in window.CSS && CSS.supports('display', 'contents');
24133
- var isMutationObserverSupported = isBrowser$6 && 'MutationObserver' in window;
24163
+ var isBrowser$8 = typeof document !== 'undefined';
24164
+ var isDisplayContentsSupported = isBrowser$8 && 'CSS' in window && 'supports' in window.CSS && CSS.supports('display', 'contents');
24165
+ var isMutationObserverSupported = isBrowser$8 && 'MutationObserver' in window;
24134
24166
  function capitalize(string) {
24135
24167
  return (string.charAt(0).toUpperCase() + string.slice(1));
24136
24168
  }
@@ -24230,12 +24262,12 @@ function alignMainAxis(args) {
24230
24262
  alignAxis(args);
24231
24263
  }
24232
24264
  function alignSecondaryAxis(args) {
24233
- alignAxis(__assign$6(__assign$6({}, args), { axis: args.axis === 'x' ? 'y' : 'x', secondary: true }));
24265
+ alignAxis(__assign$c(__assign$c({}, args), { axis: args.axis === 'x' ? 'y' : 'x', secondary: true }));
24234
24266
  }
24235
24267
  function alignBothAxis(args) {
24236
- var invertAxis = args.invertAxis, invertSecondaryAxis = args.invertSecondaryAxis, commonArgs = __rest$5(args, ["invertAxis", "invertSecondaryAxis"]);
24237
- alignMainAxis(__assign$6(__assign$6({}, commonArgs), { invertAxis: invertAxis }));
24238
- alignSecondaryAxis(__assign$6(__assign$6({}, commonArgs), { invertAxis: invertSecondaryAxis }));
24268
+ var invertAxis = args.invertAxis, invertSecondaryAxis = args.invertSecondaryAxis, commonArgs = __rest$a(args, ["invertAxis", "invertSecondaryAxis"]);
24269
+ alignMainAxis(__assign$c(__assign$c({}, commonArgs), { invertAxis: invertAxis }));
24270
+ alignSecondaryAxis(__assign$c(__assign$c({}, commonArgs), { invertAxis: invertSecondaryAxis }));
24239
24271
  }
24240
24272
  var Fit = /** @class */ (function (_super) {
24241
24273
  __extends(Fit, _super);
@@ -24350,7 +24382,7 @@ var Fit = /** @class */ (function (_super) {
24350
24382
  return Fit;
24351
24383
  }(React$3.Component));
24352
24384
 
24353
- function Divider(_a) {
24385
+ function Divider$1(_a) {
24354
24386
  var children = _a.children;
24355
24387
  return React__default["default"].createElement("span", { className: "react-time-picker__inputGroup__divider" }, children);
24356
24388
  }
@@ -24412,20 +24444,20 @@ function updateInputWidth(element) {
24412
24444
  return width;
24413
24445
  }
24414
24446
 
24415
- var isBrowser$5 = typeof document !== 'undefined';
24416
- var useIsomorphicLayoutEffect = isBrowser$5 ? React$3.useLayoutEffect : React$3.useEffect;
24417
- var isIEOrEdgeLegacy = isBrowser$5 && /(MSIE|Trident\/|Edge\/)/.test(navigator.userAgent);
24418
- var isFirefox = isBrowser$5 && /Firefox/.test(navigator.userAgent);
24419
- function onFocus(event) {
24447
+ var isBrowser$7 = typeof document !== 'undefined';
24448
+ var useIsomorphicLayoutEffect$1 = isBrowser$7 ? React$3.useLayoutEffect : React$3.useEffect;
24449
+ var isIEOrEdgeLegacy$1 = isBrowser$7 && /(MSIE|Trident\/|Edge\/)/.test(navigator.userAgent);
24450
+ var isFirefox$1 = isBrowser$7 && /Firefox/.test(navigator.userAgent);
24451
+ function onFocus$1(event) {
24420
24452
  var target = event.target;
24421
- if (isIEOrEdgeLegacy) {
24453
+ if (isIEOrEdgeLegacy$1) {
24422
24454
  requestAnimationFrame(function () { return target.select(); });
24423
24455
  }
24424
24456
  else {
24425
24457
  target.select();
24426
24458
  }
24427
24459
  }
24428
- function updateInputWidthOnLoad(element) {
24460
+ function updateInputWidthOnLoad$1(element) {
24429
24461
  if (document.readyState === 'complete') {
24430
24462
  return;
24431
24463
  }
@@ -24434,7 +24466,7 @@ function updateInputWidthOnLoad(element) {
24434
24466
  }
24435
24467
  window.addEventListener('load', onLoad);
24436
24468
  }
24437
- function updateInputWidthOnFontLoad(element) {
24469
+ function updateInputWidthOnFontLoad$1(element) {
24438
24470
  if (!document.fonts) {
24439
24471
  return;
24440
24472
  }
@@ -24451,7 +24483,7 @@ function updateInputWidthOnFontLoad(element) {
24451
24483
  }
24452
24484
  document.fonts.addEventListener('loadingdone', onLoadingDone);
24453
24485
  }
24454
- function getSelectionString(input) {
24486
+ function getSelectionString$1(input) {
24455
24487
  /**
24456
24488
  * window.getSelection().toString() returns empty string in IE11 and Firefox,
24457
24489
  * so alternatives come first.
@@ -24469,7 +24501,7 @@ function getSelectionString(input) {
24469
24501
  }
24470
24502
  return null;
24471
24503
  }
24472
- function makeOnKeyPress(maxLength) {
24504
+ function makeOnKeyPress$1(maxLength) {
24473
24505
  if (maxLength === null) {
24474
24506
  return undefined;
24475
24507
  }
@@ -24478,28 +24510,28 @@ function makeOnKeyPress(maxLength) {
24478
24510
  * exceed maxLength.
24479
24511
  */
24480
24512
  return function onKeyPress(event) {
24481
- if (isFirefox) {
24513
+ if (isFirefox$1) {
24482
24514
  // See https://github.com/wojtekmaj/react-time-picker/issues/92
24483
24515
  return;
24484
24516
  }
24485
24517
  var key = event.key, input = event.target;
24486
24518
  var value = input.value;
24487
24519
  var isNumberKey = key.length === 1 && /\d/.test(key);
24488
- var selection = getSelectionString(input);
24520
+ var selection = getSelectionString$1(input);
24489
24521
  if (!isNumberKey || !(selection || value.length < maxLength)) {
24490
24522
  event.preventDefault();
24491
24523
  }
24492
24524
  };
24493
24525
  }
24494
- function Input$3(_a) {
24526
+ function Input$4(_a) {
24495
24527
  var ariaLabel = _a.ariaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, max = _a.max, min = _a.min, name = _a.name, nameForClass = _a.nameForClass, onChange = _a.onChange, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, _b = _a.placeholder, placeholder = _b === void 0 ? '--' : _b, required = _a.required, showLeadingZeros = _a.showLeadingZeros, step = _a.step, value = _a.value;
24496
- useIsomorphicLayoutEffect(function () {
24528
+ useIsomorphicLayoutEffect$1(function () {
24497
24529
  if (!inputRef || !inputRef.current) {
24498
24530
  return;
24499
24531
  }
24500
24532
  updateInputWidth(inputRef.current);
24501
- updateInputWidthOnLoad(inputRef.current);
24502
- updateInputWidthOnFontLoad(inputRef.current);
24533
+ updateInputWidthOnLoad$1(inputRef.current);
24534
+ updateInputWidthOnFontLoad$1(inputRef.current);
24503
24535
  }, [inputRef, value]);
24504
24536
  var hasLeadingZero = showLeadingZeros &&
24505
24537
  value &&
@@ -24508,7 +24540,7 @@ function Input$3(_a) {
24508
24540
  var maxLength = max ? max.toString().length : null;
24509
24541
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
24510
24542
  hasLeadingZero ? React__default["default"].createElement("span", { className: "".concat(className, "__leadingZero") }, "0") : null,
24511
- React__default["default"].createElement("input", { "aria-label": ariaLabel, autoComplete: "off", autoFocus: autoFocus, className: clsx$2("".concat(className, "__input"), "".concat(className, "__").concat(nameForClass || name), hasLeadingZero && "".concat(className, "__input--hasLeadingZero")), "data-input": "true", disabled: disabled, inputMode: "numeric", max: max, min: min, name: name, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onKeyPress: makeOnKeyPress(maxLength), onKeyUp: function (event) {
24543
+ React__default["default"].createElement("input", { "aria-label": ariaLabel, autoComplete: "off", autoFocus: autoFocus, className: clsx$1("".concat(className, "__input"), "".concat(className, "__").concat(nameForClass || name), hasLeadingZero && "".concat(className, "__input--hasLeadingZero")), "data-input": "true", disabled: disabled, inputMode: "numeric", max: max, min: min, name: name, onChange: onChange, onFocus: onFocus$1, onKeyDown: onKeyDown, onKeyPress: makeOnKeyPress$1(maxLength), onKeyUp: function (event) {
24512
24544
  updateInputWidth(event.target);
24513
24545
  if (onKeyUp) {
24514
24546
  onKeyUp(event);
@@ -24516,7 +24548,7 @@ function Input$3(_a) {
24516
24548
  }, placeholder: placeholder, ref: inputRef, required: required, step: step, type: "number", value: value !== null ? value : '' })));
24517
24549
  }
24518
24550
 
24519
- function convert12to24(hour12, amPm) {
24551
+ function convert12to24$1(hour12, amPm) {
24520
24552
  var hour24 = Number(hour12);
24521
24553
  if (amPm === 'am' && hour24 === 12) {
24522
24554
  hour24 = 0;
@@ -24526,33 +24558,33 @@ function convert12to24(hour12, amPm) {
24526
24558
  }
24527
24559
  return hour24;
24528
24560
  }
24529
- function convert24to12(hour24) {
24561
+ function convert24to12$1(hour24) {
24530
24562
  var hour12 = Number(hour24) % 12 || 12;
24531
24563
  return [hour12, Number(hour24) < 12 ? 'am' : 'pm'];
24532
24564
  }
24533
24565
 
24534
- var formatterCache = new Map();
24535
- function getFormatter(options) {
24566
+ var formatterCache$1 = new Map();
24567
+ function getFormatter$1(options) {
24536
24568
  return function formatter(locale, date) {
24537
24569
  var localeWithDefault = locale || getUserLocale();
24538
- if (!formatterCache.has(localeWithDefault)) {
24539
- formatterCache.set(localeWithDefault, new Map());
24570
+ if (!formatterCache$1.has(localeWithDefault)) {
24571
+ formatterCache$1.set(localeWithDefault, new Map());
24540
24572
  }
24541
- var formatterCacheLocale = formatterCache.get(localeWithDefault);
24573
+ var formatterCacheLocale = formatterCache$1.get(localeWithDefault);
24542
24574
  if (!formatterCacheLocale.has(options)) {
24543
24575
  formatterCacheLocale.set(options, new Intl.DateTimeFormat(localeWithDefault || undefined, options).format);
24544
24576
  }
24545
24577
  return formatterCacheLocale.get(options)(date);
24546
24578
  };
24547
24579
  }
24548
- var numberFormatterCache = new Map();
24549
- function getNumberFormatter(options) {
24580
+ var numberFormatterCache$1 = new Map();
24581
+ function getNumberFormatter$1(options) {
24550
24582
  return function (locale, number) {
24551
24583
  var localeWithDefault = locale || getUserLocale();
24552
- if (!numberFormatterCache.has(localeWithDefault)) {
24553
- numberFormatterCache.set(localeWithDefault, new Map());
24584
+ if (!numberFormatterCache$1.has(localeWithDefault)) {
24585
+ numberFormatterCache$1.set(localeWithDefault, new Map());
24554
24586
  }
24555
- var numberFormatterCacheLocale = numberFormatterCache.get(localeWithDefault);
24587
+ var numberFormatterCacheLocale = numberFormatterCache$1.get(localeWithDefault);
24556
24588
  if (!numberFormatterCacheLocale.has(options)) {
24557
24589
  numberFormatterCacheLocale.set(options, new Intl.NumberFormat(localeWithDefault || undefined, options).format);
24558
24590
  }
@@ -24560,14 +24592,14 @@ function getNumberFormatter(options) {
24560
24592
  };
24561
24593
  }
24562
24594
 
24563
- var nines = ['9', '٩'];
24564
- var ninesRegExp = new RegExp("[".concat(nines.join(''), "]"));
24565
- var amPmFormatter = getFormatter({ hour: 'numeric' });
24566
- function getAmPmLabels(locale) {
24567
- var amString = amPmFormatter(locale, new Date(2017, 0, 1, 9));
24568
- var pmString = amPmFormatter(locale, new Date(2017, 0, 1, 21));
24569
- var _a = amString.split(ninesRegExp), am1 = _a[0], am2 = _a[1];
24570
- var _b = pmString.split(ninesRegExp), pm1 = _b[0], pm2 = _b[1];
24595
+ var nines$1 = ['9', '٩'];
24596
+ var ninesRegExp$1 = new RegExp("[".concat(nines$1.join(''), "]"));
24597
+ var amPmFormatter$1 = getFormatter$1({ hour: 'numeric' });
24598
+ function getAmPmLabels$1(locale) {
24599
+ var amString = amPmFormatter$1(locale, new Date(2017, 0, 1, 9));
24600
+ var pmString = amPmFormatter$1(locale, new Date(2017, 0, 1, 21));
24601
+ var _a = amString.split(ninesRegExp$1), am1 = _a[0], am2 = _a[1];
24602
+ var _b = pmString.split(ninesRegExp$1), pm1 = _b[0], pm2 = _b[1];
24571
24603
  if (pm2 !== undefined) {
24572
24604
  // If pm2 is undefined, nine was not found in pmString - this locale is not using 12-hour time
24573
24605
  if (am1 !== pm1) {
@@ -24580,26 +24612,26 @@ function getAmPmLabels(locale) {
24580
24612
  // Fallback
24581
24613
  return ['AM', 'PM'];
24582
24614
  }
24583
- function isValidNumber(num) {
24615
+ function isValidNumber$1(num) {
24584
24616
  return num !== null && num !== false && !Number.isNaN(Number(num));
24585
24617
  }
24586
- function safeMin() {
24618
+ function safeMin$1() {
24587
24619
  var args = [];
24588
24620
  for (var _i = 0; _i < arguments.length; _i++) {
24589
24621
  args[_i] = arguments[_i];
24590
24622
  }
24591
- return Math.min.apply(Math, args.filter(isValidNumber));
24623
+ return Math.min.apply(Math, args.filter(isValidNumber$1));
24592
24624
  }
24593
- function safeMax() {
24625
+ function safeMax$1() {
24594
24626
  var args = [];
24595
24627
  for (var _i = 0; _i < arguments.length; _i++) {
24596
24628
  args[_i] = arguments[_i];
24597
24629
  }
24598
- return Math.max.apply(Math, args.filter(isValidNumber));
24630
+ return Math.max.apply(Math, args.filter(isValidNumber$1));
24599
24631
  }
24600
24632
 
24601
- var __assign$5 = (undefined && undefined.__assign) || function () {
24602
- __assign$5 = Object.assign || function(t) {
24633
+ var __assign$b = (undefined && undefined.__assign) || function () {
24634
+ __assign$b = Object.assign || function(t) {
24603
24635
  for (var s, i = 1, n = arguments.length; i < n; i++) {
24604
24636
  s = arguments[i];
24605
24637
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -24607,9 +24639,9 @@ var __assign$5 = (undefined && undefined.__assign) || function () {
24607
24639
  }
24608
24640
  return t;
24609
24641
  };
24610
- return __assign$5.apply(this, arguments);
24642
+ return __assign$b.apply(this, arguments);
24611
24643
  };
24612
- var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
24644
+ var __rest$9 = (undefined && undefined.__rest) || function (s, e) {
24613
24645
  var t = {};
24614
24646
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24615
24647
  t[p] = s[p];
@@ -24620,20 +24652,20 @@ var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
24620
24652
  }
24621
24653
  return t;
24622
24654
  };
24623
- function Hour12Input(_a) {
24624
- var amPm = _a.amPm, maxTime = _a.maxTime, minTime = _a.minTime, value = _a.value, otherProps = __rest$4(_a, ["amPm", "maxTime", "minTime", "value"]);
24625
- var maxHour = safeMin(12, maxTime &&
24655
+ function Hour12Input$1(_a) {
24656
+ var amPm = _a.amPm, maxTime = _a.maxTime, minTime = _a.minTime, value = _a.value, otherProps = __rest$9(_a, ["amPm", "maxTime", "minTime", "value"]);
24657
+ var maxHour = safeMin$1(12, maxTime &&
24626
24658
  (function () {
24627
- var _a = convert24to12(getHours(maxTime)), maxHourResult = _a[0], maxAmPm = _a[1];
24659
+ var _a = convert24to12$1(getHours(maxTime)), maxHourResult = _a[0], maxAmPm = _a[1];
24628
24660
  if (maxAmPm !== amPm) {
24629
24661
  // pm is always after am, so we should ignore validation
24630
24662
  return null;
24631
24663
  }
24632
24664
  return maxHourResult;
24633
24665
  })());
24634
- var minHour = safeMax(1, minTime &&
24666
+ var minHour = safeMax$1(1, minTime &&
24635
24667
  (function () {
24636
- var _a = convert24to12(getHours(minTime)), minHourResult = _a[0], minAmPm = _a[1];
24668
+ var _a = convert24to12$1(getHours(minTime)), minHourResult = _a[0], minAmPm = _a[1];
24637
24669
  if (
24638
24670
  // pm is always after am, so we should ignore validation
24639
24671
  minAmPm !== amPm ||
@@ -24643,12 +24675,12 @@ function Hour12Input(_a) {
24643
24675
  }
24644
24676
  return minHourResult;
24645
24677
  })());
24646
- var value12 = value ? convert24to12(value)[0].toString() : '';
24647
- return (React__default["default"].createElement(Input$3, __assign$5({ max: maxHour, min: minHour, name: "hour12", nameForClass: "hour", value: value12 }, otherProps)));
24678
+ var value12 = value ? convert24to12$1(value)[0].toString() : '';
24679
+ return (React__default["default"].createElement(Input$4, __assign$b({ max: maxHour, min: minHour, name: "hour12", nameForClass: "hour", value: value12 }, otherProps)));
24648
24680
  }
24649
24681
 
24650
- var __assign$4 = (undefined && undefined.__assign) || function () {
24651
- __assign$4 = Object.assign || function(t) {
24682
+ var __assign$a = (undefined && undefined.__assign) || function () {
24683
+ __assign$a = Object.assign || function(t) {
24652
24684
  for (var s, i = 1, n = arguments.length; i < n; i++) {
24653
24685
  s = arguments[i];
24654
24686
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -24656,9 +24688,9 @@ var __assign$4 = (undefined && undefined.__assign) || function () {
24656
24688
  }
24657
24689
  return t;
24658
24690
  };
24659
- return __assign$4.apply(this, arguments);
24691
+ return __assign$a.apply(this, arguments);
24660
24692
  };
24661
- var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
24693
+ var __rest$8 = (undefined && undefined.__rest) || function (s, e) {
24662
24694
  var t = {};
24663
24695
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24664
24696
  t[p] = s[p];
@@ -24669,15 +24701,15 @@ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
24669
24701
  }
24670
24702
  return t;
24671
24703
  };
24672
- function Hour24Input(_a) {
24673
- var maxTime = _a.maxTime, minTime = _a.minTime, otherProps = __rest$3(_a, ["maxTime", "minTime"]);
24674
- var maxHour = safeMin(23, maxTime && getHours(maxTime));
24675
- var minHour = safeMax(0, minTime && getHours(minTime));
24676
- return React__default["default"].createElement(Input$3, __assign$4({ max: maxHour, min: minHour, name: "hour24", nameForClass: "hour" }, otherProps));
24704
+ function Hour24Input$1(_a) {
24705
+ var maxTime = _a.maxTime, minTime = _a.minTime, otherProps = __rest$8(_a, ["maxTime", "minTime"]);
24706
+ var maxHour = safeMin$1(23, maxTime && getHours(maxTime));
24707
+ var minHour = safeMax$1(0, minTime && getHours(minTime));
24708
+ return React__default["default"].createElement(Input$4, __assign$a({ max: maxHour, min: minHour, name: "hour24", nameForClass: "hour" }, otherProps));
24677
24709
  }
24678
24710
 
24679
- var __assign$3 = (undefined && undefined.__assign) || function () {
24680
- __assign$3 = Object.assign || function(t) {
24711
+ var __assign$9 = (undefined && undefined.__assign) || function () {
24712
+ __assign$9 = Object.assign || function(t) {
24681
24713
  for (var s, i = 1, n = arguments.length; i < n; i++) {
24682
24714
  s = arguments[i];
24683
24715
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -24685,9 +24717,9 @@ var __assign$3 = (undefined && undefined.__assign) || function () {
24685
24717
  }
24686
24718
  return t;
24687
24719
  };
24688
- return __assign$3.apply(this, arguments);
24720
+ return __assign$9.apply(this, arguments);
24689
24721
  };
24690
- var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
24722
+ var __rest$7 = (undefined && undefined.__rest) || function (s, e) {
24691
24723
  var t = {};
24692
24724
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24693
24725
  t[p] = s[p];
@@ -24698,18 +24730,18 @@ var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
24698
24730
  }
24699
24731
  return t;
24700
24732
  };
24701
- function MinuteInput(_a) {
24702
- var hour = _a.hour, maxTime = _a.maxTime, minTime = _a.minTime, _b = _a.showLeadingZeros, showLeadingZeros = _b === void 0 ? true : _b, otherProps = __rest$2(_a, ["hour", "maxTime", "minTime", "showLeadingZeros"]);
24733
+ function MinuteInput$1(_a) {
24734
+ var hour = _a.hour, maxTime = _a.maxTime, minTime = _a.minTime, _b = _a.showLeadingZeros, showLeadingZeros = _b === void 0 ? true : _b, otherProps = __rest$7(_a, ["hour", "maxTime", "minTime", "showLeadingZeros"]);
24703
24735
  function isSameHour(date) {
24704
24736
  return hour === getHours(date).toString();
24705
24737
  }
24706
- var maxMinute = safeMin(59, maxTime && isSameHour(maxTime) && getMinutes(maxTime));
24707
- var minMinute = safeMax(0, minTime && isSameHour(minTime) && getMinutes(minTime));
24708
- return (React__default["default"].createElement(Input$3, __assign$3({ max: maxMinute, min: minMinute, name: "minute", showLeadingZeros: showLeadingZeros }, otherProps)));
24738
+ var maxMinute = safeMin$1(59, maxTime && isSameHour(maxTime) && getMinutes(maxTime));
24739
+ var minMinute = safeMax$1(0, minTime && isSameHour(minTime) && getMinutes(minTime));
24740
+ return (React__default["default"].createElement(Input$4, __assign$9({ max: maxMinute, min: minMinute, name: "minute", showLeadingZeros: showLeadingZeros }, otherProps)));
24709
24741
  }
24710
24742
 
24711
- var __assign$2 = (undefined && undefined.__assign) || function () {
24712
- __assign$2 = Object.assign || function(t) {
24743
+ var __assign$8 = (undefined && undefined.__assign) || function () {
24744
+ __assign$8 = Object.assign || function(t) {
24713
24745
  for (var s, i = 1, n = arguments.length; i < n; i++) {
24714
24746
  s = arguments[i];
24715
24747
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -24717,9 +24749,9 @@ var __assign$2 = (undefined && undefined.__assign) || function () {
24717
24749
  }
24718
24750
  return t;
24719
24751
  };
24720
- return __assign$2.apply(this, arguments);
24752
+ return __assign$8.apply(this, arguments);
24721
24753
  };
24722
- var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
24754
+ var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
24723
24755
  var t = {};
24724
24756
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24725
24757
  t[p] = s[p];
@@ -24730,17 +24762,17 @@ var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
24730
24762
  }
24731
24763
  return t;
24732
24764
  };
24733
- function SecondInput(_a) {
24734
- var hour = _a.hour, maxTime = _a.maxTime, minTime = _a.minTime, minute = _a.minute, _b = _a.showLeadingZeros, showLeadingZeros = _b === void 0 ? true : _b, otherProps = __rest$1(_a, ["hour", "maxTime", "minTime", "minute", "showLeadingZeros"]);
24765
+ function SecondInput$1(_a) {
24766
+ var hour = _a.hour, maxTime = _a.maxTime, minTime = _a.minTime, minute = _a.minute, _b = _a.showLeadingZeros, showLeadingZeros = _b === void 0 ? true : _b, otherProps = __rest$6(_a, ["hour", "maxTime", "minTime", "minute", "showLeadingZeros"]);
24735
24767
  function isSameMinute(date) {
24736
24768
  return hour === getHours(date).toString() && minute === getMinutes(date).toString();
24737
24769
  }
24738
- var maxSecond = safeMin(59, maxTime && isSameMinute(maxTime) && getSeconds(maxTime));
24739
- var minSecond = safeMax(0, minTime && isSameMinute(minTime) && getSeconds(minTime));
24740
- return (React__default["default"].createElement(Input$3, __assign$2({ max: maxSecond, min: minSecond, name: "second", showLeadingZeros: showLeadingZeros }, otherProps)));
24770
+ var maxSecond = safeMin$1(59, maxTime && isSameMinute(maxTime) && getSeconds(maxTime));
24771
+ var minSecond = safeMax$1(0, minTime && isSameMinute(minTime) && getSeconds(minTime));
24772
+ return (React__default["default"].createElement(Input$4, __assign$8({ max: maxSecond, min: minSecond, name: "second", showLeadingZeros: showLeadingZeros }, otherProps)));
24741
24773
  }
24742
24774
 
24743
- function NativeInput(_a) {
24775
+ function NativeInput$1(_a) {
24744
24776
  var ariaLabel = _a.ariaLabel, disabled = _a.disabled, maxTime = _a.maxTime, minTime = _a.minTime, name = _a.name, onChange = _a.onChange, required = _a.required, value = _a.value, valueType = _a.valueType;
24745
24777
  var nativeValueParser = (function () {
24746
24778
  switch (valueType) {
@@ -24776,20 +24808,20 @@ function NativeInput(_a) {
24776
24808
  }, type: "time", value: value ? nativeValueParser(value) : '' }));
24777
24809
  }
24778
24810
 
24779
- function AmPm(_a) {
24811
+ function AmPm$1(_a) {
24780
24812
  var ariaLabel = _a.ariaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, locale = _a.locale, maxTime = _a.maxTime, minTime = _a.minTime, onChange = _a.onChange, onKeyDown = _a.onKeyDown, required = _a.required, value = _a.value;
24781
- var amDisabled = minTime ? convert24to12(getHours(minTime))[1] === 'pm' : false;
24782
- var pmDisabled = maxTime ? convert24to12(getHours(maxTime))[1] === 'am' : false;
24813
+ var amDisabled = minTime ? convert24to12$1(getHours(minTime))[1] === 'pm' : false;
24814
+ var pmDisabled = maxTime ? convert24to12$1(getHours(maxTime))[1] === 'am' : false;
24783
24815
  var name = 'amPm';
24784
- var _b = getAmPmLabels(locale), amLabel = _b[0], pmLabel = _b[1];
24785
- return (React__default["default"].createElement("select", { "aria-label": ariaLabel, autoFocus: autoFocus, className: clsx$2("".concat(className, "__input"), "".concat(className, "__").concat(name)), "data-input": "true", "data-select": "true", disabled: disabled, name: name, onChange: onChange, onKeyDown: onKeyDown, ref: inputRef, required: required, value: value !== null ? value : '' },
24816
+ var _b = getAmPmLabels$1(locale), amLabel = _b[0], pmLabel = _b[1];
24817
+ return (React__default["default"].createElement("select", { "aria-label": ariaLabel, autoFocus: autoFocus, className: clsx$1("".concat(className, "__input"), "".concat(className, "__").concat(name)), "data-input": "true", "data-select": "true", disabled: disabled, name: name, onChange: onChange, onKeyDown: onKeyDown, ref: inputRef, required: required, value: value !== null ? value : '' },
24786
24818
  !value && React__default["default"].createElement("option", { value: "" }, "--"),
24787
24819
  React__default["default"].createElement("option", { disabled: amDisabled, value: "am" }, amLabel),
24788
24820
  React__default["default"].createElement("option", { disabled: pmDisabled, value: "pm" }, pmLabel)));
24789
24821
  }
24790
24822
 
24791
- var __assign$1 = (undefined && undefined.__assign) || function () {
24792
- __assign$1 = Object.assign || function(t) {
24823
+ var __assign$7 = (undefined && undefined.__assign) || function () {
24824
+ __assign$7 = Object.assign || function(t) {
24793
24825
  for (var s, i = 1, n = arguments.length; i < n; i++) {
24794
24826
  s = arguments[i];
24795
24827
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -24797,9 +24829,9 @@ var __assign$1 = (undefined && undefined.__assign) || function () {
24797
24829
  }
24798
24830
  return t;
24799
24831
  };
24800
- return __assign$1.apply(this, arguments);
24832
+ return __assign$7.apply(this, arguments);
24801
24833
  };
24802
- var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
24834
+ var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
24803
24835
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
24804
24836
  if (ar || !(i in from)) {
24805
24837
  if (!ar) ar = Array.prototype.slice.call(from, 0, i);
@@ -24808,24 +24840,24 @@ var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, fr
24808
24840
  }
24809
24841
  return to.concat(ar || Array.prototype.slice.call(from));
24810
24842
  };
24811
- var getFormatterOptionsCache = {};
24812
- var allViews$2 = ['hour', 'minute', 'second'];
24813
- function isInternalInput(element) {
24843
+ var getFormatterOptionsCache$1 = {};
24844
+ var allViews$4 = ['hour', 'minute', 'second'];
24845
+ function isInternalInput$1(element) {
24814
24846
  return element.dataset.input === 'true';
24815
24847
  }
24816
- function findInput(element, property) {
24848
+ function findInput$1(element, property) {
24817
24849
  var nextElement = element;
24818
24850
  do {
24819
24851
  nextElement = nextElement[property];
24820
- } while (nextElement && !isInternalInput(nextElement));
24852
+ } while (nextElement && !isInternalInput$1(nextElement));
24821
24853
  return nextElement;
24822
24854
  }
24823
- function focus(element) {
24855
+ function focus$1(element) {
24824
24856
  if (element) {
24825
24857
  element.focus();
24826
24858
  }
24827
24859
  }
24828
- function renderCustomInputs(placeholder, elementFunctions, allowMultipleInstances) {
24860
+ function renderCustomInputs$1(placeholder, elementFunctions, allowMultipleInstances) {
24829
24861
  var usedFunctions = [];
24830
24862
  var pattern = new RegExp(Object.keys(elementFunctions)
24831
24863
  .map(function (el) { return "".concat(el, "+"); })
@@ -24834,8 +24866,8 @@ function renderCustomInputs(placeholder, elementFunctions, allowMultipleInstance
24834
24866
  return placeholder.split(pattern).reduce(function (arr, element, index) {
24835
24867
  var divider = element && (
24836
24868
  // eslint-disable-next-line react/no-array-index-key
24837
- React__default["default"].createElement(Divider, { key: "separator_".concat(index) }, element));
24838
- var res = __spreadArray$1(__spreadArray$1([], arr, true), [divider], false);
24869
+ React__default["default"].createElement(Divider$1, { key: "separator_".concat(index) }, element));
24870
+ var res = __spreadArray$2(__spreadArray$2([], arr, true), [divider], false);
24839
24871
  var currentMatch = matches && matches[index];
24840
24872
  if (currentMatch) {
24841
24873
  var renderFunction = elementFunctions[currentMatch] ||
@@ -24856,8 +24888,8 @@ function renderCustomInputs(placeholder, elementFunctions, allowMultipleInstance
24856
24888
  return res;
24857
24889
  }, []);
24858
24890
  }
24859
- var formatNumber = getNumberFormatter({ useGrouping: false });
24860
- function TimeInput(_a) {
24891
+ var formatNumber$1 = getNumberFormatter$1({ useGrouping: false });
24892
+ function TimeInput$1(_a) {
24861
24893
  var amPmAriaLabel = _a.amPmAriaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, format = _a.format, hourAriaLabel = _a.hourAriaLabel, hourPlaceholder = _a.hourPlaceholder, _b = _a.isClockOpen, isClockOpenProps = _b === void 0 ? null : _b, locale = _a.locale, _c = _a.maxDetail, maxDetail = _c === void 0 ? 'minute' : _c, maxTime = _a.maxTime, minTime = _a.minTime, minuteAriaLabel = _a.minuteAriaLabel, minutePlaceholder = _a.minutePlaceholder, _d = _a.name, name = _d === void 0 ? 'time' : _d, nativeInputAriaLabel = _a.nativeInputAriaLabel, onChangeProps = _a.onChange, onInvalidChange = _a.onInvalidChange, required = _a.required, secondAriaLabel = _a.secondAriaLabel, secondPlaceholder = _a.secondPlaceholder, valueProps = _a.value;
24862
24894
  var _e = React$3.useState(null), amPm = _e[0], setAmPm = _e[1];
24863
24895
  var _f = React$3.useState(null), hour = _f[0], setHour = _f[1];
@@ -24877,7 +24909,7 @@ function TimeInput(_a) {
24877
24909
  React$3.useEffect(function () {
24878
24910
  var nextValue = valueProps;
24879
24911
  if (nextValue) {
24880
- setAmPm(convert24to12(getHours(nextValue))[1]);
24912
+ setAmPm(convert24to12$1(getHours(nextValue))[1]);
24881
24913
  setHour(getHours(nextValue).toString());
24882
24914
  setMinute(getMinutes(nextValue).toString());
24883
24915
  setSecond(getSeconds(nextValue).toString());
@@ -24900,8 +24932,8 @@ function TimeInput(_a) {
24900
24932
  ]);
24901
24933
  var valueType = maxDetail;
24902
24934
  var formatTime = (function () {
24903
- var level = allViews$2.indexOf(maxDetail);
24904
- var formatterOptions = getFormatterOptionsCache[level] ||
24935
+ var level = allViews$4.indexOf(maxDetail);
24936
+ var formatterOptions = getFormatterOptionsCache$1[level] ||
24905
24937
  (function () {
24906
24938
  var options = { hour: 'numeric' };
24907
24939
  if (level >= 1) {
@@ -24910,10 +24942,10 @@ function TimeInput(_a) {
24910
24942
  if (level >= 2) {
24911
24943
  options.second = 'numeric';
24912
24944
  }
24913
- getFormatterOptionsCache[level] = options;
24945
+ getFormatterOptionsCache$1[level] = options;
24914
24946
  return options;
24915
24947
  })();
24916
- return getFormatter(formatterOptions);
24948
+ return getFormatter$1(formatterOptions);
24917
24949
  })();
24918
24950
  /**
24919
24951
  * Gets current value in a desired format.
@@ -24940,11 +24972,11 @@ function TimeInput(_a) {
24940
24972
  var second = 14;
24941
24973
  var date = new Date(2017, 0, 1, hour24, minute, second);
24942
24974
  return formatTime(locale, date)
24943
- .replace(formatNumber(locale, hour12), 'h')
24944
- .replace(formatNumber(locale, hour24), 'H')
24945
- .replace(formatNumber(locale, minute), 'mm')
24946
- .replace(formatNumber(locale, second), 'ss')
24947
- .replace(new RegExp(getAmPmLabels(locale).join('|')), 'a');
24975
+ .replace(formatNumber$1(locale, hour12), 'h')
24976
+ .replace(formatNumber$1(locale, hour24), 'H')
24977
+ .replace(formatNumber$1(locale, minute), 'mm')
24978
+ .replace(formatNumber$1(locale, second), 'ss')
24979
+ .replace(new RegExp(getAmPmLabels$1(locale).join('|')), 'a');
24948
24980
  })();
24949
24981
  var divider = (function () {
24950
24982
  var dividers = placeholder.match(/[^0-9a-z]/i);
@@ -24954,7 +24986,7 @@ function TimeInput(_a) {
24954
24986
  if (event.target === event.currentTarget) {
24955
24987
  // Wrapper was directly clicked
24956
24988
  var firstInput = event.target.children[1];
24957
- focus(firstInput);
24989
+ focus$1(firstInput);
24958
24990
  }
24959
24991
  }
24960
24992
  function onKeyDown(event) {
@@ -24966,8 +24998,8 @@ function TimeInput(_a) {
24966
24998
  event.preventDefault();
24967
24999
  var input = event.target;
24968
25000
  var property = event.key === 'ArrowLeft' ? 'previousElementSibling' : 'nextElementSibling';
24969
- var nextInput = findInput(input, property);
24970
- focus(nextInput);
25001
+ var nextInput = findInput$1(input, property);
25002
+ focus$1(nextInput);
24971
25003
  break;
24972
25004
  }
24973
25005
  }
@@ -24995,8 +25027,8 @@ function TimeInput(_a) {
24995
25027
  */
24996
25028
  if (Number(value) * 10 > Number(max) || value.length >= max.length) {
24997
25029
  var property = 'nextElementSibling';
24998
- var nextInput = findInput(input, property);
24999
- focus(nextInput);
25030
+ var nextInput = findInput$1(input, property);
25031
+ focus$1(nextInput);
25000
25032
  }
25001
25033
  }
25002
25034
  /**
@@ -25036,7 +25068,7 @@ function TimeInput(_a) {
25036
25068
  var isEveryValueValid = formElements.every(function (formElement) { return formElement.validity.valid; });
25037
25069
  if (isEveryValueFilled && isEveryValueValid) {
25038
25070
  var hour_1 = Number(values.hour24 ||
25039
- (values.hour12 && values.amPm && convert12to24(values.hour12, values.amPm)) ||
25071
+ (values.hour12 && values.amPm && convert12to24$1(values.hour12, values.amPm)) ||
25040
25072
  0);
25041
25073
  var minute_1 = Number(values.minute || 0);
25042
25074
  var second_1 = Number(values.second || 0);
@@ -25061,7 +25093,7 @@ function TimeInput(_a) {
25061
25093
  setAmPm(value);
25062
25094
  break;
25063
25095
  case 'hour12':
25064
- setHour(value ? convert12to24(value, amPm || 'am').toString() : '');
25096
+ setHour(value ? convert12to24$1(value, amPm || 'am').toString() : '');
25065
25097
  break;
25066
25098
  case 'hour24':
25067
25099
  setHour(value);
@@ -25102,7 +25134,7 @@ function TimeInput(_a) {
25102
25134
  throw new Error("Unsupported token: ".concat(currentMatch));
25103
25135
  }
25104
25136
  var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
25105
- return (React__default["default"].createElement(Hour12Input, __assign$1({ key: "hour12" }, commonInputProps, { amPm: amPm, ariaLabel: hourAriaLabel,
25137
+ return (React__default["default"].createElement(Hour12Input$1, __assign$7({ key: "hour12" }, commonInputProps, { amPm: amPm, ariaLabel: hourAriaLabel,
25106
25138
  // eslint-disable-next-line jsx-a11y/no-autofocus
25107
25139
  autoFocus: index === 0 && autoFocus, inputRef: hour12Input, placeholder: hourPlaceholder, showLeadingZeros: showLeadingZeros, value: hour })));
25108
25140
  }
@@ -25111,7 +25143,7 @@ function TimeInput(_a) {
25111
25143
  throw new Error("Unsupported token: ".concat(currentMatch));
25112
25144
  }
25113
25145
  var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
25114
- return (React__default["default"].createElement(Hour24Input, __assign$1({ key: "hour24" }, commonInputProps, { ariaLabel: hourAriaLabel,
25146
+ return (React__default["default"].createElement(Hour24Input$1, __assign$7({ key: "hour24" }, commonInputProps, { ariaLabel: hourAriaLabel,
25115
25147
  // eslint-disable-next-line jsx-a11y/no-autofocus
25116
25148
  autoFocus: index === 0 && autoFocus, inputRef: hour24Input, placeholder: hourPlaceholder, showLeadingZeros: showLeadingZeros, value: hour })));
25117
25149
  }
@@ -25126,7 +25158,7 @@ function TimeInput(_a) {
25126
25158
  throw new Error("Unsupported token: ".concat(currentMatch));
25127
25159
  }
25128
25160
  var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
25129
- return (React__default["default"].createElement(MinuteInput, __assign$1({ key: "minute" }, commonInputProps, { ariaLabel: minuteAriaLabel,
25161
+ return (React__default["default"].createElement(MinuteInput$1, __assign$7({ key: "minute" }, commonInputProps, { ariaLabel: minuteAriaLabel,
25130
25162
  // eslint-disable-next-line jsx-a11y/no-autofocus
25131
25163
  autoFocus: index === 0 && autoFocus, hour: hour, inputRef: minuteInput, placeholder: minutePlaceholder, showLeadingZeros: showLeadingZeros, value: minute })));
25132
25164
  }
@@ -25135,12 +25167,12 @@ function TimeInput(_a) {
25135
25167
  throw new Error("Unsupported token: ".concat(currentMatch));
25136
25168
  }
25137
25169
  var showLeadingZeros = currentMatch ? currentMatch.length === 2 : true;
25138
- return (React__default["default"].createElement(SecondInput, __assign$1({ key: "second" }, commonInputProps, { ariaLabel: secondAriaLabel,
25170
+ return (React__default["default"].createElement(SecondInput$1, __assign$7({ key: "second" }, commonInputProps, { ariaLabel: secondAriaLabel,
25139
25171
  // eslint-disable-next-line jsx-a11y/no-autofocus
25140
25172
  autoFocus: index === 0 && autoFocus, hour: hour, inputRef: secondInput, minute: minute, placeholder: secondPlaceholder, showLeadingZeros: showLeadingZeros, value: second })));
25141
25173
  }
25142
25174
  function renderAmPm(currentMatch, index) {
25143
- return (React__default["default"].createElement(AmPm, __assign$1({ key: "ampm" }, commonInputProps, { ariaLabel: amPmAriaLabel,
25175
+ return (React__default["default"].createElement(AmPm$1, __assign$7({ key: "ampm" }, commonInputProps, { ariaLabel: amPmAriaLabel,
25144
25176
  // eslint-disable-next-line jsx-a11y/no-autofocus
25145
25177
  autoFocus: index === 0 && autoFocus, inputRef: amPmInput, locale: locale, onChange: onChange, value: amPm })));
25146
25178
  }
@@ -25153,10 +25185,10 @@ function TimeInput(_a) {
25153
25185
  a: renderAmPm,
25154
25186
  };
25155
25187
  var allowMultipleInstances = typeof format !== 'undefined';
25156
- return renderCustomInputs(placeholder, elementFunctions, allowMultipleInstances);
25188
+ return renderCustomInputs$1(placeholder, elementFunctions, allowMultipleInstances);
25157
25189
  }
25158
25190
  function renderNativeInput() {
25159
- return (React__default["default"].createElement(NativeInput, { key: "time", ariaLabel: nativeInputAriaLabel, disabled: disabled, maxTime: maxTime, minTime: minTime, name: name, onChange: onChangeNative, required: required, value: value, valueType: valueType }));
25191
+ return (React__default["default"].createElement(NativeInput$1, { key: "time", ariaLabel: nativeInputAriaLabel, disabled: disabled, maxTime: maxTime, minTime: minTime, name: name, onChange: onChangeNative, required: required, value: value, valueType: valueType }));
25160
25192
  }
25161
25193
  return (
25162
25194
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
@@ -25165,41 +25197,23 @@ function TimeInput(_a) {
25165
25197
  renderCustomInputsInternal()));
25166
25198
  }
25167
25199
 
25168
- var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
25169
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25170
- if (ar || !(i in from)) {
25171
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
25172
- ar[i] = from[i];
25173
- }
25174
- }
25175
- return to.concat(ar || Array.prototype.slice.call(from));
25176
- };
25177
- var allViews$1 = ['hour', 'minute', 'second'];
25178
- var allValueTypes = __spreadArray([], allViews$1, true);
25179
- var hourOptionalSecondsRegExp = /^(([0-1])?[0-9]|2[0-3]):[0-5][0-9](:([0-5][0-9]))?$/;
25180
- var isTime = function isTime(props, propName, componentName) {
25200
+ var hourOptionalSecondsRegExp$1 = /^(([0-1])?[0-9]|2[0-3]):[0-5][0-9](:([0-5][0-9]))?$/;
25201
+ var isTime$1 = function isTime(props, propName, componentName) {
25181
25202
  var _a = props, _b = propName, time = _a[_b];
25182
25203
  if (time) {
25183
- if (typeof time !== 'string' || !hourOptionalSecondsRegExp.test(time)) {
25204
+ if (typeof time !== 'string' || !hourOptionalSecondsRegExp$1.test(time)) {
25184
25205
  return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof time, "` supplied to `").concat(componentName, "`, expected time in HH:mm(:ss) format."));
25185
25206
  }
25186
25207
  }
25187
25208
  // Everything is fine
25188
25209
  return null;
25189
25210
  };
25190
- propTypes$1.exports.oneOf(allValueTypes);
25191
- propTypes$1.exports.oneOfType([
25192
- propTypes$1.exports.func,
25193
- propTypes$1.exports.exact({
25194
- current: propTypes$1.exports.any,
25195
- }),
25196
- ]);
25197
- var rangeOf = function (type) {
25211
+ var rangeOf$1 = function (type) {
25198
25212
  return propTypes$1.exports.arrayOf(type);
25199
25213
  };
25200
25214
 
25201
- var __assign = (undefined && undefined.__assign) || function () {
25202
- __assign = Object.assign || function(t) {
25215
+ var __assign$6 = (undefined && undefined.__assign) || function () {
25216
+ __assign$6 = Object.assign || function(t) {
25203
25217
  for (var s, i = 1, n = arguments.length; i < n; i++) {
25204
25218
  s = arguments[i];
25205
25219
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -25207,9 +25221,9 @@ var __assign = (undefined && undefined.__assign) || function () {
25207
25221
  }
25208
25222
  return t;
25209
25223
  };
25210
- return __assign.apply(this, arguments);
25224
+ return __assign$6.apply(this, arguments);
25211
25225
  };
25212
- var __rest = (undefined && undefined.__rest) || function (s, e) {
25226
+ var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
25213
25227
  var t = {};
25214
25228
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
25215
25229
  t[p] = s[p];
@@ -25220,11 +25234,11 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
25220
25234
  }
25221
25235
  return t;
25222
25236
  };
25223
- var isBrowser$4 = typeof document !== 'undefined';
25224
- var baseClassName = 'react-time-picker';
25225
- var outsideActionEvents = ['mousedown', 'focusin', 'touchstart'];
25226
- var allViews = ['hour', 'minute', 'second'];
25227
- var iconProps = {
25237
+ var isBrowser$6 = typeof document !== 'undefined';
25238
+ var baseClassName$1 = 'react-timerange-picker';
25239
+ var outsideActionEvents$1 = ['mousedown', 'focusin', 'touchstart'];
25240
+ var allViews$3 = ['hour', 'minute', 'second'];
25241
+ var iconProps$1 = {
25228
25242
  xmlns: 'http://www.w3.org/2000/svg',
25229
25243
  width: 19,
25230
25244
  height: 19,
@@ -25232,15 +25246,15 @@ var iconProps = {
25232
25246
  stroke: 'black',
25233
25247
  strokeWidth: 2,
25234
25248
  };
25235
- var ClockIcon = (React__default["default"].createElement("svg", __assign({}, iconProps, { className: "".concat(baseClassName, "__clock-button__icon ").concat(baseClassName, "__button__icon"), fill: "none" }),
25249
+ var ClockIcon$1 = (React__default["default"].createElement("svg", __assign$6({}, iconProps$1, { className: "".concat(baseClassName$1, "__clock-button__icon ").concat(baseClassName$1, "__button__icon"), fill: "none" }),
25236
25250
  React__default["default"].createElement("circle", { cx: "9.5", cy: "9.5", r: "7.5" }),
25237
25251
  React__default["default"].createElement("path", { d: "M9.5 4.5 v5 h4" })));
25238
- var ClearIcon = (React__default["default"].createElement("svg", __assign({}, iconProps, { className: "".concat(baseClassName, "__clear-button__icon ").concat(baseClassName, "__button__icon") }),
25252
+ var ClearIcon$1 = (React__default["default"].createElement("svg", __assign$6({}, iconProps$1, { className: "".concat(baseClassName$1, "__clear-button__icon ").concat(baseClassName$1, "__button__icon") }),
25239
25253
  React__default["default"].createElement("line", { x1: "4", x2: "15", y1: "4", y2: "15" }),
25240
25254
  React__default["default"].createElement("line", { x1: "15", x2: "4", y1: "4", y2: "15" })));
25241
- var TimePicker$1 = function TimePicker(props) {
25242
- var amPmAriaLabel = props.amPmAriaLabel, autoFocus = props.autoFocus, className = props.className, clearAriaLabel = props.clearAriaLabel, _a = props.clearIcon, clearIcon = _a === void 0 ? ClearIcon : _a, clockAriaLabel = props.clockAriaLabel, _b = props.clockIcon, clockIcon = _b === void 0 ? ClockIcon : _b, _c = props.closeClock, shouldCloseClockOnSelect = _c === void 0 ? true : _c, dataTestid = props["data-testid"], hourAriaLabel = props.hourAriaLabel, hourPlaceholder = props.hourPlaceholder, disableClock = props.disableClock, disabled = props.disabled, format = props.format, id = props.id, _d = props.isOpen, isOpenProps = _d === void 0 ? null : _d, locale = props.locale, maxTime = props.maxTime, _e = props.maxDetail, maxDetail = _e === void 0 ? 'minute' : _e, minTime = props.minTime, minuteAriaLabel = props.minuteAriaLabel, minutePlaceholder = props.minutePlaceholder, _f = props.name, name = _f === void 0 ? 'time' : _f, nativeInputAriaLabel = props.nativeInputAriaLabel, onClockClose = props.onClockClose, onClockOpen = props.onClockOpen, onChangeProps = props.onChange, onFocusProps = props.onFocus, onInvalidChange = props.onInvalidChange, _g = props.openClockOnFocus, openClockOnFocus = _g === void 0 ? true : _g, required = props.required, value = props.value, secondAriaLabel = props.secondAriaLabel, secondPlaceholder = props.secondPlaceholder, shouldCloseClock = props.shouldCloseClock, shouldOpenClock = props.shouldOpenClock, otherProps = __rest(props, ["amPmAriaLabel", "autoFocus", "className", "clearAriaLabel", "clearIcon", "clockAriaLabel", "clockIcon", "closeClock", 'data-testid', "hourAriaLabel", "hourPlaceholder", "disableClock", "disabled", "format", "id", "isOpen", "locale", "maxTime", "maxDetail", "minTime", "minuteAriaLabel", "minutePlaceholder", "name", "nativeInputAriaLabel", "onClockClose", "onClockOpen", "onChange", "onFocus", "onInvalidChange", "openClockOnFocus", "required", "value", "secondAriaLabel", "secondPlaceholder", "shouldCloseClock", "shouldOpenClock"]);
25243
- var _h = React$3.useState(isOpenProps), isOpen = _h[0], setIsOpen = _h[1];
25255
+ var TimeRangePicker = function TimeRangePicker(props) {
25256
+ var amPmAriaLabel = props.amPmAriaLabel, autoFocus = props.autoFocus, className = props.className, clearAriaLabel = props.clearAriaLabel, _a = props.clearIcon, clearIcon = _a === void 0 ? ClearIcon$1 : _a, clockAriaLabel = props.clockAriaLabel, _b = props.clockIcon, clockIcon = _b === void 0 ? ClockIcon$1 : _b, _c = props.closeClock, shouldCloseClockOnSelect = _c === void 0 ? true : _c, dataTestid = props["data-testid"], disableClock = props.disableClock, disabled = props.disabled, format = props.format, hourAriaLabel = props.hourAriaLabel, hourPlaceholder = props.hourPlaceholder, id = props.id, _d = props.isOpen, isOpenProps = _d === void 0 ? null : _d, locale = props.locale, _e = props.maxDetail, maxDetail = _e === void 0 ? 'minute' : _e, maxTime = props.maxTime, minTime = props.minTime, minuteAriaLabel = props.minuteAriaLabel, minutePlaceholder = props.minutePlaceholder, _f = props.name, name = _f === void 0 ? 'timerange' : _f, nativeInputAriaLabel = props.nativeInputAriaLabel, onChangeProps = props.onChange, onClockClose = props.onClockClose, onClockOpen = props.onClockOpen, onFocusProps = props.onFocus, onInvalidChange = props.onInvalidChange, _g = props.openClockOnFocus, openClockOnFocus = _g === void 0 ? true : _g, _h = props.rangeDivider, rangeDivider = _h === void 0 ? '–' : _h, required = props.required, secondAriaLabel = props.secondAriaLabel, secondPlaceholder = props.secondPlaceholder, shouldCloseClock = props.shouldCloseClock, shouldOpenClock = props.shouldOpenClock, value = props.value, otherProps = __rest$5(props, ["amPmAriaLabel", "autoFocus", "className", "clearAriaLabel", "clearIcon", "clockAriaLabel", "clockIcon", "closeClock", 'data-testid', "disableClock", "disabled", "format", "hourAriaLabel", "hourPlaceholder", "id", "isOpen", "locale", "maxDetail", "maxTime", "minTime", "minuteAriaLabel", "minutePlaceholder", "name", "nativeInputAriaLabel", "onChange", "onClockClose", "onClockOpen", "onFocus", "onInvalidChange", "openClockOnFocus", "rangeDivider", "required", "secondAriaLabel", "secondPlaceholder", "shouldCloseClock", "shouldOpenClock", "value"]);
25257
+ var _j = React$3.useState(isOpenProps), isOpen = _j[0], setIsOpen = _j[1];
25244
25258
  var wrapper = React$3.useRef(null);
25245
25259
  var clockWrapper = React$3.useRef(null);
25246
25260
  React$3.useEffect(function () {
@@ -25287,6 +25301,14 @@ var TimePicker$1 = function TimePicker(props) {
25287
25301
  onChangeProps(value);
25288
25302
  }
25289
25303
  }
25304
+ function onChangeFrom(valueFrom, closeClock) {
25305
+ var _a = Array.isArray(value) ? value : [value], valueTo = _a[1];
25306
+ onChange([valueFrom, valueTo || null], closeClock);
25307
+ }
25308
+ function onChangeTo(valueTo, closeClock) {
25309
+ var valueFrom = (Array.isArray(value) ? value : [value])[0];
25310
+ onChange([valueFrom || null, valueTo], closeClock);
25311
+ }
25290
25312
  function onFocus(event) {
25291
25313
  if (onFocusProps) {
25292
25314
  onFocusProps(event);
@@ -25326,7 +25348,7 @@ var TimePicker$1 = function TimePicker(props) {
25326
25348
  }, [clockWrapper, closeClock, wrapper]);
25327
25349
  var handleOutsideActionListeners = React$3.useCallback(function (shouldListen) {
25328
25350
  if (shouldListen === void 0) { shouldListen = isOpen; }
25329
- outsideActionEvents.forEach(function (event) {
25351
+ outsideActionEvents$1.forEach(function (event) {
25330
25352
  if (shouldListen) {
25331
25353
  document.addEventListener(event, onOutsideAction);
25332
25354
  }
@@ -25346,9 +25368,9 @@ var TimePicker$1 = function TimePicker(props) {
25346
25368
  return function () {
25347
25369
  handleOutsideActionListeners(false);
25348
25370
  };
25349
- }, [handleOutsideActionListeners]);
25371
+ }, [handleOutsideActionListeners, isOpen]);
25350
25372
  function renderInputs() {
25351
- var valueFrom = (Array.isArray(value) ? value : [value])[0];
25373
+ var _a = Array.isArray(value) ? value : [value], valueFrom = _a[0], valueTo = _a[1];
25352
25374
  var ariaLabelProps = {
25353
25375
  amPmAriaLabel: amPmAriaLabel,
25354
25376
  hourAriaLabel: hourAriaLabel,
@@ -25361,12 +25383,15 @@ var TimePicker$1 = function TimePicker(props) {
25361
25383
  minutePlaceholder: minutePlaceholder,
25362
25384
  secondPlaceholder: secondPlaceholder,
25363
25385
  };
25364
- return (React__default["default"].createElement("div", { className: "".concat(baseClassName, "__wrapper") },
25365
- React__default["default"].createElement(TimeInput, __assign({}, ariaLabelProps, placeholderProps, {
25386
+ var commonProps = __assign$6(__assign$6(__assign$6({}, ariaLabelProps), placeholderProps), { className: "".concat(baseClassName$1, "__inputGroup"), disabled: disabled, format: format, isClockOpen: isOpen, locale: locale, maxDetail: maxDetail, maxTime: maxTime, minTime: minTime, onInvalidChange: onInvalidChange, required: required });
25387
+ return (React__default["default"].createElement("div", { className: "".concat(baseClassName$1, "__wrapper") },
25388
+ React__default["default"].createElement(TimeInput$1, __assign$6({}, commonProps, {
25366
25389
  // eslint-disable-next-line jsx-a11y/no-autofocus
25367
- autoFocus: autoFocus, className: "".concat(baseClassName, "__inputGroup"), disabled: disabled, format: format, isClockOpen: isOpen, locale: locale, maxDetail: maxDetail, maxTime: maxTime, minTime: minTime, name: name, onChange: onChange, onInvalidChange: onInvalidChange, required: required, value: valueFrom })),
25368
- clearIcon !== null && (React__default["default"].createElement("button", { "aria-label": clearAriaLabel, className: "".concat(baseClassName, "__clear-button ").concat(baseClassName, "__button"), disabled: disabled, onClick: clear, onFocus: stopPropagation, type: "button" }, typeof clearIcon === 'function' ? React__default["default"].createElement(clearIcon) : clearIcon)),
25369
- clockIcon !== null && !disableClock && (React__default["default"].createElement("button", { "aria-label": clockAriaLabel, className: "".concat(baseClassName, "__clock-button ").concat(baseClassName, "__button"), disabled: disabled, onClick: toggleClock, onFocus: stopPropagation, type: "button" }, typeof clockIcon === 'function' ? React__default["default"].createElement(clockIcon) : clockIcon))));
25390
+ autoFocus: autoFocus, name: "".concat(name, "_from"), onChange: onChangeFrom, value: valueFrom })),
25391
+ React__default["default"].createElement("span", { className: "".concat(baseClassName$1, "__range-divider") }, rangeDivider),
25392
+ React__default["default"].createElement(TimeInput$1, __assign$6({}, commonProps, { name: "".concat(name, "_to"), onChange: onChangeTo, value: valueTo })),
25393
+ clearIcon !== null && (React__default["default"].createElement("button", { "aria-label": clearAriaLabel, className: "".concat(baseClassName$1, "__clear-button ").concat(baseClassName$1, "__button"), disabled: disabled, onClick: clear, onFocus: stopPropagation, type: "button" }, typeof clearIcon === 'function' ? React__default["default"].createElement(clearIcon) : clearIcon)),
25394
+ clockIcon !== null && !disableClock && (React__default["default"].createElement("button", { "aria-label": clockAriaLabel, className: "".concat(baseClassName$1, "__clock-button ").concat(baseClassName$1, "__button"), disabled: disabled, onClick: toggleClock, onFocus: stopPropagation, type: "button" }, typeof clockIcon === 'function' ? React__default["default"].createElement(clockIcon) : clockIcon))));
25370
25395
  }
25371
25396
  function renderClock() {
25372
25397
  if (isOpen === null || disableClock) {
@@ -25374,11 +25399,11 @@ var TimePicker$1 = function TimePicker(props) {
25374
25399
  }
25375
25400
  var clockClassName = props.clockClassName; props.className; // Unused, here to exclude it from clockProps
25376
25401
  props.onChange; // Unused, here to exclude it from clockProps
25377
- var portalContainer = props.portalContainer, value = props.value, clockProps = __rest(props, ["clockClassName", "className", "onChange", "portalContainer", "value"]);
25378
- var className = "".concat(baseClassName, "__clock");
25379
- var classNames = clsx$2(className, "".concat(className, "--").concat(isOpen ? 'open' : 'closed'));
25402
+ var portalContainer = props.portalContainer, value = props.value, clockProps = __rest$5(props, ["clockClassName", "className", "onChange", "portalContainer", "value"]);
25403
+ var className = "".concat(baseClassName$1, "__clock");
25404
+ var classNames = clsx$1(className, "".concat(className, "--").concat(isOpen ? 'open' : 'closed'));
25380
25405
  var valueFrom = (Array.isArray(value) ? value : [value])[0];
25381
- var clock = React__default["default"].createElement(Clock, __assign({ className: clockClassName, value: valueFrom }, clockProps));
25406
+ var clock = React__default["default"].createElement(Clock, __assign$6({ className: clockClassName, value: valueFrom }, clockProps));
25382
25407
  return portalContainer ? (ReactDOM.createPortal(React__default["default"].createElement("div", { ref: clockWrapper, className: classNames }, clock), portalContainer)) : (React__default["default"].createElement(Fit, null,
25383
25408
  React__default["default"].createElement("div", { ref: function (ref) {
25384
25409
  if (ref && !isOpen) {
@@ -25387,13 +25412,13 @@ var TimePicker$1 = function TimePicker(props) {
25387
25412
  }, className: classNames }, clock)));
25388
25413
  }
25389
25414
  var eventProps = React$3.useMemo(function () { return makeEventProps(otherProps); }, [otherProps]);
25390
- return (React__default["default"].createElement("div", __assign({ className: clsx$2(baseClassName, "".concat(baseClassName, "--").concat(isOpen ? 'open' : 'closed'), "".concat(baseClassName, "--").concat(disabled ? 'disabled' : 'enabled'), className), "data-testid": dataTestid, id: id }, eventProps, { onFocus: onFocus, ref: wrapper }),
25415
+ return (React__default["default"].createElement("div", __assign$6({ className: clsx$1(baseClassName$1, "".concat(baseClassName$1, "--").concat(isOpen ? 'open' : 'closed'), "".concat(baseClassName$1, "--").concat(disabled ? 'disabled' : 'enabled'), className), "data-testid": dataTestid, id: id }, eventProps, { onFocus: onFocus, ref: wrapper }),
25391
25416
  renderInputs(),
25392
25417
  renderClock()));
25393
25418
  };
25394
- var isValue = propTypes$1.exports.oneOfType([isTime, propTypes$1.exports.instanceOf(Date)]);
25395
- var isValueOrValueArray = propTypes$1.exports.oneOfType([isValue, rangeOf(isValue)]);
25396
- TimePicker$1.propTypes = {
25419
+ var isValue$1 = propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.instanceOf(Date)]);
25420
+ var isValueOrValueArray$1 = propTypes$1.exports.oneOfType([isValue$1, rangeOf$1(isValue$1)]);
25421
+ TimeRangePicker.propTypes = {
25397
25422
  amPmAriaLabel: propTypes$1.exports.string,
25398
25423
  autoFocus: propTypes$1.exports.bool,
25399
25424
  className: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.arrayOf(propTypes$1.exports.string)]),
@@ -25412,9 +25437,9 @@ TimePicker$1.propTypes = {
25412
25437
  id: propTypes$1.exports.string,
25413
25438
  isOpen: propTypes$1.exports.bool,
25414
25439
  locale: propTypes$1.exports.string,
25415
- maxDetail: propTypes$1.exports.oneOf(allViews),
25416
- maxTime: isTime,
25417
- minTime: isTime,
25440
+ maxDetail: propTypes$1.exports.oneOf(allViews$3),
25441
+ maxTime: isTime$1,
25442
+ minTime: isTime$1,
25418
25443
  minuteAriaLabel: propTypes$1.exports.string,
25419
25444
  minutePlaceholder: propTypes$1.exports.string,
25420
25445
  name: propTypes$1.exports.string,
@@ -25424,28 +25449,1055 @@ TimePicker$1.propTypes = {
25424
25449
  onClockOpen: propTypes$1.exports.func,
25425
25450
  onFocus: propTypes$1.exports.func,
25426
25451
  openClockOnFocus: propTypes$1.exports.bool,
25452
+ rangeDivider: propTypes$1.exports.node,
25427
25453
  required: propTypes$1.exports.bool,
25428
25454
  secondAriaLabel: propTypes$1.exports.string,
25429
25455
  secondPlaceholder: propTypes$1.exports.string,
25430
- value: isValueOrValueArray,
25456
+ value: isValueOrValueArray$1,
25431
25457
  };
25432
- if (isBrowser$4) {
25433
- TimePicker$1.propTypes.portalContainer = propTypes$1.exports.instanceOf(HTMLElement);
25458
+ if (isBrowser$6) {
25459
+ TimeRangePicker.propTypes.portalContainer = propTypes$1.exports.instanceOf(HTMLElement);
25434
25460
  }
25435
25461
 
25436
- var HoverIcon = function HoverIcon(_ref) {
25437
- var _ref$time = _ref.time,
25438
- time = _ref$time === void 0 ? false : _ref$time;
25439
- var _useState = React$3.useState(false),
25440
- _useState2 = _slicedToArray$3(_useState, 2),
25441
- hovered = _useState2[0],
25442
- setHovered = _useState2[1];
25443
- return /*#__PURE__*/React__default["default"].createElement("div", {
25444
- onMouseLeave: function onMouseLeave() {
25445
- return setHovered(false);
25446
- },
25447
- onMouseOver: function onMouseOver() {
25448
- return setHovered(true);
25462
+ function Divider(_a) {
25463
+ var children = _a.children;
25464
+ return React__default["default"].createElement("span", { className: "react-time-picker__inputGroup__divider" }, children);
25465
+ }
25466
+
25467
+ var isBrowser$5 = typeof document !== 'undefined';
25468
+ var useIsomorphicLayoutEffect = isBrowser$5 ? React$3.useLayoutEffect : React$3.useEffect;
25469
+ var isIEOrEdgeLegacy = isBrowser$5 && /(MSIE|Trident\/|Edge\/)/.test(navigator.userAgent);
25470
+ var isFirefox = isBrowser$5 && /Firefox/.test(navigator.userAgent);
25471
+ function onFocus(event) {
25472
+ var target = event.target;
25473
+ if (isIEOrEdgeLegacy) {
25474
+ requestAnimationFrame(function () { return target.select(); });
25475
+ }
25476
+ else {
25477
+ target.select();
25478
+ }
25479
+ }
25480
+ function updateInputWidthOnLoad(element) {
25481
+ if (document.readyState === 'complete') {
25482
+ return;
25483
+ }
25484
+ function onLoad() {
25485
+ updateInputWidth(element);
25486
+ }
25487
+ window.addEventListener('load', onLoad);
25488
+ }
25489
+ function updateInputWidthOnFontLoad(element) {
25490
+ if (!document.fonts) {
25491
+ return;
25492
+ }
25493
+ var font = getFontShorthand(element);
25494
+ if (!font) {
25495
+ return;
25496
+ }
25497
+ var isFontLoaded = document.fonts.check(font);
25498
+ if (isFontLoaded) {
25499
+ return;
25500
+ }
25501
+ function onLoadingDone() {
25502
+ updateInputWidth(element);
25503
+ }
25504
+ document.fonts.addEventListener('loadingdone', onLoadingDone);
25505
+ }
25506
+ function getSelectionString(input) {
25507
+ /**
25508
+ * window.getSelection().toString() returns empty string in IE11 and Firefox,
25509
+ * so alternatives come first.
25510
+ */
25511
+ if (input &&
25512
+ 'selectionStart' in input &&
25513
+ input.selectionStart !== null &&
25514
+ 'selectionEnd' in input &&
25515
+ input.selectionEnd !== null) {
25516
+ return input.value.slice(input.selectionStart, input.selectionEnd);
25517
+ }
25518
+ if ('getSelection' in window) {
25519
+ var selection = window.getSelection();
25520
+ return selection && selection.toString();
25521
+ }
25522
+ return null;
25523
+ }
25524
+ function makeOnKeyPress(maxLength) {
25525
+ if (maxLength === null) {
25526
+ return undefined;
25527
+ }
25528
+ /**
25529
+ * Prevents keystrokes that would not produce a number or when value after keystroke would
25530
+ * exceed maxLength.
25531
+ */
25532
+ return function onKeyPress(event) {
25533
+ if (isFirefox) {
25534
+ // See https://github.com/wojtekmaj/react-time-picker/issues/92
25535
+ return;
25536
+ }
25537
+ var key = event.key, input = event.target;
25538
+ var value = input.value;
25539
+ var isNumberKey = key.length === 1 && /\d/.test(key);
25540
+ var selection = getSelectionString(input);
25541
+ if (!isNumberKey || !(selection || value.length < maxLength)) {
25542
+ event.preventDefault();
25543
+ }
25544
+ };
25545
+ }
25546
+ function Input$3(_a) {
25547
+ var ariaLabel = _a.ariaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, max = _a.max, min = _a.min, name = _a.name, nameForClass = _a.nameForClass, onChange = _a.onChange, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, _b = _a.placeholder, placeholder = _b === void 0 ? '--' : _b, required = _a.required, showLeadingZeros = _a.showLeadingZeros, step = _a.step, value = _a.value;
25548
+ useIsomorphicLayoutEffect(function () {
25549
+ if (!inputRef || !inputRef.current) {
25550
+ return;
25551
+ }
25552
+ updateInputWidth(inputRef.current);
25553
+ updateInputWidthOnLoad(inputRef.current);
25554
+ updateInputWidthOnFontLoad(inputRef.current);
25555
+ }, [inputRef, value]);
25556
+ var hasLeadingZero = showLeadingZeros &&
25557
+ value &&
25558
+ Number(value) < 10 &&
25559
+ (value === '0' || !value.toString().startsWith('0'));
25560
+ var maxLength = max ? max.toString().length : null;
25561
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
25562
+ hasLeadingZero ? React__default["default"].createElement("span", { className: "".concat(className, "__leadingZero") }, "0") : null,
25563
+ React__default["default"].createElement("input", { "aria-label": ariaLabel, autoComplete: "off", autoFocus: autoFocus, className: clsx$1("".concat(className, "__input"), "".concat(className, "__").concat(nameForClass || name), hasLeadingZero && "".concat(className, "__input--hasLeadingZero")), "data-input": "true", disabled: disabled, inputMode: "numeric", max: max, min: min, name: name, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onKeyPress: makeOnKeyPress(maxLength), onKeyUp: function (event) {
25564
+ updateInputWidth(event.target);
25565
+ if (onKeyUp) {
25566
+ onKeyUp(event);
25567
+ }
25568
+ }, placeholder: placeholder, ref: inputRef, required: required, step: step, type: "number", value: value !== null ? value : '' })));
25569
+ }
25570
+
25571
+ function convert12to24(hour12, amPm) {
25572
+ var hour24 = Number(hour12);
25573
+ if (amPm === 'am' && hour24 === 12) {
25574
+ hour24 = 0;
25575
+ }
25576
+ else if (amPm === 'pm' && hour24 < 12) {
25577
+ hour24 += 12;
25578
+ }
25579
+ return hour24;
25580
+ }
25581
+ function convert24to12(hour24) {
25582
+ var hour12 = Number(hour24) % 12 || 12;
25583
+ return [hour12, Number(hour24) < 12 ? 'am' : 'pm'];
25584
+ }
25585
+
25586
+ var formatterCache = new Map();
25587
+ function getFormatter(options) {
25588
+ return function formatter(locale, date) {
25589
+ var localeWithDefault = locale || getUserLocale();
25590
+ if (!formatterCache.has(localeWithDefault)) {
25591
+ formatterCache.set(localeWithDefault, new Map());
25592
+ }
25593
+ var formatterCacheLocale = formatterCache.get(localeWithDefault);
25594
+ if (!formatterCacheLocale.has(options)) {
25595
+ formatterCacheLocale.set(options, new Intl.DateTimeFormat(localeWithDefault || undefined, options).format);
25596
+ }
25597
+ return formatterCacheLocale.get(options)(date);
25598
+ };
25599
+ }
25600
+ var numberFormatterCache = new Map();
25601
+ function getNumberFormatter(options) {
25602
+ return function (locale, number) {
25603
+ var localeWithDefault = locale || getUserLocale();
25604
+ if (!numberFormatterCache.has(localeWithDefault)) {
25605
+ numberFormatterCache.set(localeWithDefault, new Map());
25606
+ }
25607
+ var numberFormatterCacheLocale = numberFormatterCache.get(localeWithDefault);
25608
+ if (!numberFormatterCacheLocale.has(options)) {
25609
+ numberFormatterCacheLocale.set(options, new Intl.NumberFormat(localeWithDefault || undefined, options).format);
25610
+ }
25611
+ return numberFormatterCacheLocale.get(options)(number);
25612
+ };
25613
+ }
25614
+
25615
+ var nines = ['9', '٩'];
25616
+ var ninesRegExp = new RegExp("[".concat(nines.join(''), "]"));
25617
+ var amPmFormatter = getFormatter({ hour: 'numeric' });
25618
+ function getAmPmLabels(locale) {
25619
+ var amString = amPmFormatter(locale, new Date(2017, 0, 1, 9));
25620
+ var pmString = amPmFormatter(locale, new Date(2017, 0, 1, 21));
25621
+ var _a = amString.split(ninesRegExp), am1 = _a[0], am2 = _a[1];
25622
+ var _b = pmString.split(ninesRegExp), pm1 = _b[0], pm2 = _b[1];
25623
+ if (pm2 !== undefined) {
25624
+ // If pm2 is undefined, nine was not found in pmString - this locale is not using 12-hour time
25625
+ if (am1 !== pm1) {
25626
+ return [am1, pm1].map(function (el) { return el.trim(); });
25627
+ }
25628
+ if (am2 !== pm2) {
25629
+ return [am2, pm2].map(function (el) { return el.trim(); });
25630
+ }
25631
+ }
25632
+ // Fallback
25633
+ return ['AM', 'PM'];
25634
+ }
25635
+ function isValidNumber(num) {
25636
+ return num !== null && num !== false && !Number.isNaN(Number(num));
25637
+ }
25638
+ function safeMin() {
25639
+ var args = [];
25640
+ for (var _i = 0; _i < arguments.length; _i++) {
25641
+ args[_i] = arguments[_i];
25642
+ }
25643
+ return Math.min.apply(Math, args.filter(isValidNumber));
25644
+ }
25645
+ function safeMax() {
25646
+ var args = [];
25647
+ for (var _i = 0; _i < arguments.length; _i++) {
25648
+ args[_i] = arguments[_i];
25649
+ }
25650
+ return Math.max.apply(Math, args.filter(isValidNumber));
25651
+ }
25652
+
25653
+ var __assign$5 = (undefined && undefined.__assign) || function () {
25654
+ __assign$5 = Object.assign || function(t) {
25655
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
25656
+ s = arguments[i];
25657
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
25658
+ t[p] = s[p];
25659
+ }
25660
+ return t;
25661
+ };
25662
+ return __assign$5.apply(this, arguments);
25663
+ };
25664
+ var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
25665
+ var t = {};
25666
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
25667
+ t[p] = s[p];
25668
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
25669
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25670
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
25671
+ t[p[i]] = s[p[i]];
25672
+ }
25673
+ return t;
25674
+ };
25675
+ function Hour12Input(_a) {
25676
+ var amPm = _a.amPm, maxTime = _a.maxTime, minTime = _a.minTime, value = _a.value, otherProps = __rest$4(_a, ["amPm", "maxTime", "minTime", "value"]);
25677
+ var maxHour = safeMin(12, maxTime &&
25678
+ (function () {
25679
+ var _a = convert24to12(getHours(maxTime)), maxHourResult = _a[0], maxAmPm = _a[1];
25680
+ if (maxAmPm !== amPm) {
25681
+ // pm is always after am, so we should ignore validation
25682
+ return null;
25683
+ }
25684
+ return maxHourResult;
25685
+ })());
25686
+ var minHour = safeMax(1, minTime &&
25687
+ (function () {
25688
+ var _a = convert24to12(getHours(minTime)), minHourResult = _a[0], minAmPm = _a[1];
25689
+ if (
25690
+ // pm is always after am, so we should ignore validation
25691
+ minAmPm !== amPm ||
25692
+ // If minHour is 12 am/pm, user should be able to enter 12, 1, ..., 11.
25693
+ minHourResult === 12) {
25694
+ return null;
25695
+ }
25696
+ return minHourResult;
25697
+ })());
25698
+ var value12 = value ? convert24to12(value)[0].toString() : '';
25699
+ return (React__default["default"].createElement(Input$3, __assign$5({ max: maxHour, min: minHour, name: "hour12", nameForClass: "hour", value: value12 }, otherProps)));
25700
+ }
25701
+
25702
+ var __assign$4 = (undefined && undefined.__assign) || function () {
25703
+ __assign$4 = Object.assign || function(t) {
25704
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
25705
+ s = arguments[i];
25706
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
25707
+ t[p] = s[p];
25708
+ }
25709
+ return t;
25710
+ };
25711
+ return __assign$4.apply(this, arguments);
25712
+ };
25713
+ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
25714
+ var t = {};
25715
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
25716
+ t[p] = s[p];
25717
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
25718
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25719
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
25720
+ t[p[i]] = s[p[i]];
25721
+ }
25722
+ return t;
25723
+ };
25724
+ function Hour24Input(_a) {
25725
+ var maxTime = _a.maxTime, minTime = _a.minTime, otherProps = __rest$3(_a, ["maxTime", "minTime"]);
25726
+ var maxHour = safeMin(23, maxTime && getHours(maxTime));
25727
+ var minHour = safeMax(0, minTime && getHours(minTime));
25728
+ return React__default["default"].createElement(Input$3, __assign$4({ max: maxHour, min: minHour, name: "hour24", nameForClass: "hour" }, otherProps));
25729
+ }
25730
+
25731
+ var __assign$3 = (undefined && undefined.__assign) || function () {
25732
+ __assign$3 = Object.assign || function(t) {
25733
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
25734
+ s = arguments[i];
25735
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
25736
+ t[p] = s[p];
25737
+ }
25738
+ return t;
25739
+ };
25740
+ return __assign$3.apply(this, arguments);
25741
+ };
25742
+ var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
25743
+ var t = {};
25744
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
25745
+ t[p] = s[p];
25746
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
25747
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25748
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
25749
+ t[p[i]] = s[p[i]];
25750
+ }
25751
+ return t;
25752
+ };
25753
+ function MinuteInput(_a) {
25754
+ var hour = _a.hour, maxTime = _a.maxTime, minTime = _a.minTime, _b = _a.showLeadingZeros, showLeadingZeros = _b === void 0 ? true : _b, otherProps = __rest$2(_a, ["hour", "maxTime", "minTime", "showLeadingZeros"]);
25755
+ function isSameHour(date) {
25756
+ return hour === getHours(date).toString();
25757
+ }
25758
+ var maxMinute = safeMin(59, maxTime && isSameHour(maxTime) && getMinutes(maxTime));
25759
+ var minMinute = safeMax(0, minTime && isSameHour(minTime) && getMinutes(minTime));
25760
+ return (React__default["default"].createElement(Input$3, __assign$3({ max: maxMinute, min: minMinute, name: "minute", showLeadingZeros: showLeadingZeros }, otherProps)));
25761
+ }
25762
+
25763
+ var __assign$2 = (undefined && undefined.__assign) || function () {
25764
+ __assign$2 = Object.assign || function(t) {
25765
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
25766
+ s = arguments[i];
25767
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
25768
+ t[p] = s[p];
25769
+ }
25770
+ return t;
25771
+ };
25772
+ return __assign$2.apply(this, arguments);
25773
+ };
25774
+ var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
25775
+ var t = {};
25776
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
25777
+ t[p] = s[p];
25778
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
25779
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25780
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
25781
+ t[p[i]] = s[p[i]];
25782
+ }
25783
+ return t;
25784
+ };
25785
+ function SecondInput(_a) {
25786
+ var hour = _a.hour, maxTime = _a.maxTime, minTime = _a.minTime, minute = _a.minute, _b = _a.showLeadingZeros, showLeadingZeros = _b === void 0 ? true : _b, otherProps = __rest$1(_a, ["hour", "maxTime", "minTime", "minute", "showLeadingZeros"]);
25787
+ function isSameMinute(date) {
25788
+ return hour === getHours(date).toString() && minute === getMinutes(date).toString();
25789
+ }
25790
+ var maxSecond = safeMin(59, maxTime && isSameMinute(maxTime) && getSeconds(maxTime));
25791
+ var minSecond = safeMax(0, minTime && isSameMinute(minTime) && getSeconds(minTime));
25792
+ return (React__default["default"].createElement(Input$3, __assign$2({ max: maxSecond, min: minSecond, name: "second", showLeadingZeros: showLeadingZeros }, otherProps)));
25793
+ }
25794
+
25795
+ function NativeInput(_a) {
25796
+ var ariaLabel = _a.ariaLabel, disabled = _a.disabled, maxTime = _a.maxTime, minTime = _a.minTime, name = _a.name, onChange = _a.onChange, required = _a.required, value = _a.value, valueType = _a.valueType;
25797
+ var nativeValueParser = (function () {
25798
+ switch (valueType) {
25799
+ case 'hour':
25800
+ return function (receivedValue) { return "".concat(getHours(receivedValue), ":00"); };
25801
+ case 'minute':
25802
+ return getHoursMinutes;
25803
+ case 'second':
25804
+ return getHoursMinutesSeconds;
25805
+ default:
25806
+ throw new Error('Invalid valueType');
25807
+ }
25808
+ })();
25809
+ var step = (function () {
25810
+ switch (valueType) {
25811
+ case 'hour':
25812
+ return 3600;
25813
+ case 'minute':
25814
+ return 60;
25815
+ case 'second':
25816
+ return 1;
25817
+ default:
25818
+ throw new Error('Invalid valueType');
25819
+ }
25820
+ })();
25821
+ function stopPropagation(event) {
25822
+ event.stopPropagation();
25823
+ }
25824
+ return (React__default["default"].createElement("input", { "aria-label": ariaLabel, disabled: disabled, hidden: true, max: maxTime ? nativeValueParser(maxTime) : undefined, min: minTime ? nativeValueParser(minTime) : undefined, name: name, onChange: onChange, onFocus: stopPropagation, required: required, step: step, style: {
25825
+ visibility: 'hidden',
25826
+ position: 'absolute',
25827
+ zIndex: '-999',
25828
+ }, type: "time", value: value ? nativeValueParser(value) : '' }));
25829
+ }
25830
+
25831
+ function AmPm(_a) {
25832
+ var ariaLabel = _a.ariaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, locale = _a.locale, maxTime = _a.maxTime, minTime = _a.minTime, onChange = _a.onChange, onKeyDown = _a.onKeyDown, required = _a.required, value = _a.value;
25833
+ var amDisabled = minTime ? convert24to12(getHours(minTime))[1] === 'pm' : false;
25834
+ var pmDisabled = maxTime ? convert24to12(getHours(maxTime))[1] === 'am' : false;
25835
+ var name = 'amPm';
25836
+ var _b = getAmPmLabels(locale), amLabel = _b[0], pmLabel = _b[1];
25837
+ return (React__default["default"].createElement("select", { "aria-label": ariaLabel, autoFocus: autoFocus, className: clsx$1("".concat(className, "__input"), "".concat(className, "__").concat(name)), "data-input": "true", "data-select": "true", disabled: disabled, name: name, onChange: onChange, onKeyDown: onKeyDown, ref: inputRef, required: required, value: value !== null ? value : '' },
25838
+ !value && React__default["default"].createElement("option", { value: "" }, "--"),
25839
+ React__default["default"].createElement("option", { disabled: amDisabled, value: "am" }, amLabel),
25840
+ React__default["default"].createElement("option", { disabled: pmDisabled, value: "pm" }, pmLabel)));
25841
+ }
25842
+
25843
+ var __assign$1 = (undefined && undefined.__assign) || function () {
25844
+ __assign$1 = Object.assign || function(t) {
25845
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
25846
+ s = arguments[i];
25847
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
25848
+ t[p] = s[p];
25849
+ }
25850
+ return t;
25851
+ };
25852
+ return __assign$1.apply(this, arguments);
25853
+ };
25854
+ var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
25855
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25856
+ if (ar || !(i in from)) {
25857
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
25858
+ ar[i] = from[i];
25859
+ }
25860
+ }
25861
+ return to.concat(ar || Array.prototype.slice.call(from));
25862
+ };
25863
+ var getFormatterOptionsCache = {};
25864
+ var allViews$2 = ['hour', 'minute', 'second'];
25865
+ function isInternalInput(element) {
25866
+ return element.dataset.input === 'true';
25867
+ }
25868
+ function findInput(element, property) {
25869
+ var nextElement = element;
25870
+ do {
25871
+ nextElement = nextElement[property];
25872
+ } while (nextElement && !isInternalInput(nextElement));
25873
+ return nextElement;
25874
+ }
25875
+ function focus(element) {
25876
+ if (element) {
25877
+ element.focus();
25878
+ }
25879
+ }
25880
+ function renderCustomInputs(placeholder, elementFunctions, allowMultipleInstances) {
25881
+ var usedFunctions = [];
25882
+ var pattern = new RegExp(Object.keys(elementFunctions)
25883
+ .map(function (el) { return "".concat(el, "+"); })
25884
+ .join('|'), 'g');
25885
+ var matches = placeholder.match(pattern);
25886
+ return placeholder.split(pattern).reduce(function (arr, element, index) {
25887
+ var divider = element && (
25888
+ // eslint-disable-next-line react/no-array-index-key
25889
+ React__default["default"].createElement(Divider, { key: "separator_".concat(index) }, element));
25890
+ var res = __spreadArray$1(__spreadArray$1([], arr, true), [divider], false);
25891
+ var currentMatch = matches && matches[index];
25892
+ if (currentMatch) {
25893
+ var renderFunction = elementFunctions[currentMatch] ||
25894
+ elementFunctions[Object.keys(elementFunctions).find(function (elementFunction) {
25895
+ return currentMatch.match(elementFunction);
25896
+ })];
25897
+ if (!renderFunction) {
25898
+ return res;
25899
+ }
25900
+ if (!allowMultipleInstances && usedFunctions.includes(renderFunction)) {
25901
+ res.push(currentMatch);
25902
+ }
25903
+ else {
25904
+ res.push(renderFunction(currentMatch, index));
25905
+ usedFunctions.push(renderFunction);
25906
+ }
25907
+ }
25908
+ return res;
25909
+ }, []);
25910
+ }
25911
+ var formatNumber = getNumberFormatter({ useGrouping: false });
25912
+ function TimeInput(_a) {
25913
+ var amPmAriaLabel = _a.amPmAriaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, format = _a.format, hourAriaLabel = _a.hourAriaLabel, hourPlaceholder = _a.hourPlaceholder, _b = _a.isClockOpen, isClockOpenProps = _b === void 0 ? null : _b, locale = _a.locale, _c = _a.maxDetail, maxDetail = _c === void 0 ? 'minute' : _c, maxTime = _a.maxTime, minTime = _a.minTime, minuteAriaLabel = _a.minuteAriaLabel, minutePlaceholder = _a.minutePlaceholder, _d = _a.name, name = _d === void 0 ? 'time' : _d, nativeInputAriaLabel = _a.nativeInputAriaLabel, onChangeProps = _a.onChange, onInvalidChange = _a.onInvalidChange, required = _a.required, secondAriaLabel = _a.secondAriaLabel, secondPlaceholder = _a.secondPlaceholder, valueProps = _a.value;
25914
+ var _e = React$3.useState(null), amPm = _e[0], setAmPm = _e[1];
25915
+ var _f = React$3.useState(null), hour = _f[0], setHour = _f[1];
25916
+ var _g = React$3.useState(null), minute = _g[0], setMinute = _g[1];
25917
+ var _h = React$3.useState(null), second = _h[0], setSecond = _h[1];
25918
+ var _j = React$3.useState(null), value = _j[0], setValue = _j[1];
25919
+ var amPmInput = React$3.useRef(null);
25920
+ var hour12Input = React$3.useRef(null);
25921
+ var hour24Input = React$3.useRef(null);
25922
+ var minuteInput = React$3.useRef(null);
25923
+ var secondInput = React$3.useRef(null);
25924
+ var _k = React$3.useState(isClockOpenProps), isClockOpen = _k[0], setIsClockOpen = _k[1];
25925
+ var lastPressedKey = React$3.useRef();
25926
+ React$3.useEffect(function () {
25927
+ setIsClockOpen(isClockOpenProps);
25928
+ }, [isClockOpenProps]);
25929
+ React$3.useEffect(function () {
25930
+ var nextValue = valueProps;
25931
+ if (nextValue) {
25932
+ setAmPm(convert24to12(getHours(nextValue))[1]);
25933
+ setHour(getHours(nextValue).toString());
25934
+ setMinute(getMinutes(nextValue).toString());
25935
+ setSecond(getSeconds(nextValue).toString());
25936
+ setValue(nextValue);
25937
+ }
25938
+ else {
25939
+ setAmPm(null);
25940
+ setHour(null);
25941
+ setMinute(null);
25942
+ setSecond(null);
25943
+ setValue(null);
25944
+ }
25945
+ }, [
25946
+ valueProps,
25947
+ minTime,
25948
+ maxTime,
25949
+ maxDetail,
25950
+ // Toggling clock visibility resets values
25951
+ isClockOpen,
25952
+ ]);
25953
+ var valueType = maxDetail;
25954
+ var formatTime = (function () {
25955
+ var level = allViews$2.indexOf(maxDetail);
25956
+ var formatterOptions = getFormatterOptionsCache[level] ||
25957
+ (function () {
25958
+ var options = { hour: 'numeric' };
25959
+ if (level >= 1) {
25960
+ options.minute = 'numeric';
25961
+ }
25962
+ if (level >= 2) {
25963
+ options.second = 'numeric';
25964
+ }
25965
+ getFormatterOptionsCache[level] = options;
25966
+ return options;
25967
+ })();
25968
+ return getFormatter(formatterOptions);
25969
+ })();
25970
+ /**
25971
+ * Gets current value in a desired format.
25972
+ */
25973
+ function getProcessedValue(value) {
25974
+ var processFunction = (function () {
25975
+ switch (valueType) {
25976
+ case 'hour':
25977
+ case 'minute':
25978
+ return getHoursMinutes;
25979
+ case 'second':
25980
+ return getHoursMinutesSeconds;
25981
+ default:
25982
+ throw new Error('Invalid valueType');
25983
+ }
25984
+ })();
25985
+ return processFunction(value);
25986
+ }
25987
+ var placeholder = format ||
25988
+ (function () {
25989
+ var hour24 = 21;
25990
+ var hour12 = 9;
25991
+ var minute = 13;
25992
+ var second = 14;
25993
+ var date = new Date(2017, 0, 1, hour24, minute, second);
25994
+ return formatTime(locale, date)
25995
+ .replace(formatNumber(locale, hour12), 'h')
25996
+ .replace(formatNumber(locale, hour24), 'H')
25997
+ .replace(formatNumber(locale, minute), 'mm')
25998
+ .replace(formatNumber(locale, second), 'ss')
25999
+ .replace(new RegExp(getAmPmLabels(locale).join('|')), 'a');
26000
+ })();
26001
+ var divider = (function () {
26002
+ var dividers = placeholder.match(/[^0-9a-z]/i);
26003
+ return dividers ? dividers[0] : null;
26004
+ })();
26005
+ function onClick(event) {
26006
+ if (event.target === event.currentTarget) {
26007
+ // Wrapper was directly clicked
26008
+ var firstInput = event.target.children[1];
26009
+ focus(firstInput);
26010
+ }
26011
+ }
26012
+ function onKeyDown(event) {
26013
+ lastPressedKey.current = event.key;
26014
+ switch (event.key) {
26015
+ case 'ArrowLeft':
26016
+ case 'ArrowRight':
26017
+ case divider: {
26018
+ event.preventDefault();
26019
+ var input = event.target;
26020
+ var property = event.key === 'ArrowLeft' ? 'previousElementSibling' : 'nextElementSibling';
26021
+ var nextInput = findInput(input, property);
26022
+ focus(nextInput);
26023
+ break;
26024
+ }
26025
+ }
26026
+ }
26027
+ function onKeyUp(event) {
26028
+ var key = event.key, input = event.target;
26029
+ var isLastPressedKey = lastPressedKey.current === key;
26030
+ if (!isLastPressedKey) {
26031
+ return;
26032
+ }
26033
+ var isNumberKey = !isNaN(Number(key));
26034
+ if (!isNumberKey) {
26035
+ return;
26036
+ }
26037
+ var max = input.getAttribute('max');
26038
+ if (!max) {
26039
+ return;
26040
+ }
26041
+ var value = input.value;
26042
+ /**
26043
+ * Given 1, the smallest possible number the user could type by adding another digit is 10.
26044
+ * 10 would be a valid value given max = 12, so we won't jump to the next input.
26045
+ * However, given 2, smallers possible number would be 20, and thus keeping the focus in
26046
+ * this field doesn't make sense.
26047
+ */
26048
+ if (Number(value) * 10 > Number(max) || value.length >= max.length) {
26049
+ var property = 'nextElementSibling';
26050
+ var nextInput = findInput(input, property);
26051
+ focus(nextInput);
26052
+ }
26053
+ }
26054
+ /**
26055
+ * Called after internal onChange. Checks input validity. If all fields are valid,
26056
+ * calls props.onChange.
26057
+ */
26058
+ function onChangeExternal() {
26059
+ if (!onChangeProps) {
26060
+ return;
26061
+ }
26062
+ function filterBoolean(value) {
26063
+ return Boolean(value);
26064
+ }
26065
+ var formElements = [
26066
+ amPmInput.current,
26067
+ hour12Input.current,
26068
+ hour24Input.current,
26069
+ minuteInput.current,
26070
+ secondInput.current,
26071
+ ].filter(filterBoolean);
26072
+ var formElementsWithoutSelect = formElements.slice(1);
26073
+ var values = {};
26074
+ formElements.forEach(function (formElement) {
26075
+ values[formElement.name] =
26076
+ formElement.type === 'number'
26077
+ ? 'valueAsNumber' in formElement
26078
+ ? formElement.valueAsNumber
26079
+ : Number(formElement.value)
26080
+ : formElement.value;
26081
+ });
26082
+ var isEveryValueEmpty = formElementsWithoutSelect.every(function (formElement) { return !formElement.value; });
26083
+ if (isEveryValueEmpty) {
26084
+ onChangeProps(null, false);
26085
+ return;
26086
+ }
26087
+ var isEveryValueFilled = formElements.every(function (formElement) { return formElement.value; });
26088
+ var isEveryValueValid = formElements.every(function (formElement) { return formElement.validity.valid; });
26089
+ if (isEveryValueFilled && isEveryValueValid) {
26090
+ var hour_1 = Number(values.hour24 ||
26091
+ (values.hour12 && values.amPm && convert12to24(values.hour12, values.amPm)) ||
26092
+ 0);
26093
+ var minute_1 = Number(values.minute || 0);
26094
+ var second_1 = Number(values.second || 0);
26095
+ var padStart = function (num) { return "0".concat(num).slice(-2); };
26096
+ var proposedValue = "".concat(padStart(hour_1), ":").concat(padStart(minute_1), ":").concat(padStart(second_1));
26097
+ var processedValue = getProcessedValue(proposedValue);
26098
+ onChangeProps(processedValue, false);
26099
+ return;
26100
+ }
26101
+ if (!onInvalidChange) {
26102
+ return;
26103
+ }
26104
+ onInvalidChange();
26105
+ }
26106
+ /**
26107
+ * Called when non-native date input is changed.
26108
+ */
26109
+ function onChange(event) {
26110
+ var _a = event.target, name = _a.name, value = _a.value;
26111
+ switch (name) {
26112
+ case 'amPm':
26113
+ setAmPm(value);
26114
+ break;
26115
+ case 'hour12':
26116
+ setHour(value ? convert12to24(value, amPm || 'am').toString() : '');
26117
+ break;
26118
+ case 'hour24':
26119
+ setHour(value);
26120
+ break;
26121
+ case 'minute':
26122
+ setMinute(value);
26123
+ break;
26124
+ case 'second':
26125
+ setSecond(value);
26126
+ break;
26127
+ }
26128
+ onChangeExternal();
26129
+ }
26130
+ /**
26131
+ * Called when native date input is changed.
26132
+ */
26133
+ function onChangeNative(event) {
26134
+ var value = event.target.value;
26135
+ if (!onChangeProps) {
26136
+ return;
26137
+ }
26138
+ var processedValue = value || null;
26139
+ onChangeProps(processedValue, false);
26140
+ }
26141
+ var commonInputProps = {
26142
+ className: className,
26143
+ disabled: disabled,
26144
+ maxTime: maxTime,
26145
+ minTime: minTime,
26146
+ onChange: onChange,
26147
+ onKeyDown: onKeyDown,
26148
+ onKeyUp: onKeyUp,
26149
+ // This is only for showing validity when editing
26150
+ required: Boolean(required || isClockOpen),
26151
+ };
26152
+ function renderHour12(currentMatch, index) {
26153
+ if (currentMatch && currentMatch.length > 2) {
26154
+ throw new Error("Unsupported token: ".concat(currentMatch));
26155
+ }
26156
+ var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
26157
+ return (React__default["default"].createElement(Hour12Input, __assign$1({ key: "hour12" }, commonInputProps, { amPm: amPm, ariaLabel: hourAriaLabel,
26158
+ // eslint-disable-next-line jsx-a11y/no-autofocus
26159
+ autoFocus: index === 0 && autoFocus, inputRef: hour12Input, placeholder: hourPlaceholder, showLeadingZeros: showLeadingZeros, value: hour })));
26160
+ }
26161
+ function renderHour24(currentMatch, index) {
26162
+ if (currentMatch && currentMatch.length > 2) {
26163
+ throw new Error("Unsupported token: ".concat(currentMatch));
26164
+ }
26165
+ var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
26166
+ return (React__default["default"].createElement(Hour24Input, __assign$1({ key: "hour24" }, commonInputProps, { ariaLabel: hourAriaLabel,
26167
+ // eslint-disable-next-line jsx-a11y/no-autofocus
26168
+ autoFocus: index === 0 && autoFocus, inputRef: hour24Input, placeholder: hourPlaceholder, showLeadingZeros: showLeadingZeros, value: hour })));
26169
+ }
26170
+ function renderHour(currentMatch, index) {
26171
+ if (/h/.test(currentMatch)) {
26172
+ return renderHour12(currentMatch, index);
26173
+ }
26174
+ return renderHour24(currentMatch, index);
26175
+ }
26176
+ function renderMinute(currentMatch, index) {
26177
+ if (currentMatch && currentMatch.length > 2) {
26178
+ throw new Error("Unsupported token: ".concat(currentMatch));
26179
+ }
26180
+ var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
26181
+ return (React__default["default"].createElement(MinuteInput, __assign$1({ key: "minute" }, commonInputProps, { ariaLabel: minuteAriaLabel,
26182
+ // eslint-disable-next-line jsx-a11y/no-autofocus
26183
+ autoFocus: index === 0 && autoFocus, hour: hour, inputRef: minuteInput, placeholder: minutePlaceholder, showLeadingZeros: showLeadingZeros, value: minute })));
26184
+ }
26185
+ function renderSecond(currentMatch, index) {
26186
+ if (currentMatch && currentMatch.length > 2) {
26187
+ throw new Error("Unsupported token: ".concat(currentMatch));
26188
+ }
26189
+ var showLeadingZeros = currentMatch ? currentMatch.length === 2 : true;
26190
+ return (React__default["default"].createElement(SecondInput, __assign$1({ key: "second" }, commonInputProps, { ariaLabel: secondAriaLabel,
26191
+ // eslint-disable-next-line jsx-a11y/no-autofocus
26192
+ autoFocus: index === 0 && autoFocus, hour: hour, inputRef: secondInput, minute: minute, placeholder: secondPlaceholder, showLeadingZeros: showLeadingZeros, value: second })));
26193
+ }
26194
+ function renderAmPm(currentMatch, index) {
26195
+ return (React__default["default"].createElement(AmPm, __assign$1({ key: "ampm" }, commonInputProps, { ariaLabel: amPmAriaLabel,
26196
+ // eslint-disable-next-line jsx-a11y/no-autofocus
26197
+ autoFocus: index === 0 && autoFocus, inputRef: amPmInput, locale: locale, onChange: onChange, value: amPm })));
26198
+ }
26199
+ function renderCustomInputsInternal() {
26200
+ var elementFunctions = {
26201
+ h: renderHour,
26202
+ H: renderHour,
26203
+ m: renderMinute,
26204
+ s: renderSecond,
26205
+ a: renderAmPm,
26206
+ };
26207
+ var allowMultipleInstances = typeof format !== 'undefined';
26208
+ return renderCustomInputs(placeholder, elementFunctions, allowMultipleInstances);
26209
+ }
26210
+ function renderNativeInput() {
26211
+ return (React__default["default"].createElement(NativeInput, { key: "time", ariaLabel: nativeInputAriaLabel, disabled: disabled, maxTime: maxTime, minTime: minTime, name: name, onChange: onChangeNative, required: required, value: value, valueType: valueType }));
26212
+ }
26213
+ return (
26214
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
26215
+ React__default["default"].createElement("div", { className: className, onClick: onClick },
26216
+ renderNativeInput(),
26217
+ renderCustomInputsInternal()));
26218
+ }
26219
+
26220
+ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
26221
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
26222
+ if (ar || !(i in from)) {
26223
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
26224
+ ar[i] = from[i];
26225
+ }
26226
+ }
26227
+ return to.concat(ar || Array.prototype.slice.call(from));
26228
+ };
26229
+ var allViews$1 = ['hour', 'minute', 'second'];
26230
+ var allValueTypes = __spreadArray([], allViews$1, true);
26231
+ var hourOptionalSecondsRegExp = /^(([0-1])?[0-9]|2[0-3]):[0-5][0-9](:([0-5][0-9]))?$/;
26232
+ var isTime = function isTime(props, propName, componentName) {
26233
+ var _a = props, _b = propName, time = _a[_b];
26234
+ if (time) {
26235
+ if (typeof time !== 'string' || !hourOptionalSecondsRegExp.test(time)) {
26236
+ return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof time, "` supplied to `").concat(componentName, "`, expected time in HH:mm(:ss) format."));
26237
+ }
26238
+ }
26239
+ // Everything is fine
26240
+ return null;
26241
+ };
26242
+ propTypes$1.exports.oneOf(allValueTypes);
26243
+ propTypes$1.exports.oneOfType([
26244
+ propTypes$1.exports.func,
26245
+ propTypes$1.exports.exact({
26246
+ current: propTypes$1.exports.any,
26247
+ }),
26248
+ ]);
26249
+ var rangeOf = function (type) {
26250
+ return propTypes$1.exports.arrayOf(type);
26251
+ };
26252
+
26253
+ var __assign = (undefined && undefined.__assign) || function () {
26254
+ __assign = Object.assign || function(t) {
26255
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
26256
+ s = arguments[i];
26257
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
26258
+ t[p] = s[p];
26259
+ }
26260
+ return t;
26261
+ };
26262
+ return __assign.apply(this, arguments);
26263
+ };
26264
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
26265
+ var t = {};
26266
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
26267
+ t[p] = s[p];
26268
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
26269
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
26270
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
26271
+ t[p[i]] = s[p[i]];
26272
+ }
26273
+ return t;
26274
+ };
26275
+ var isBrowser$4 = typeof document !== 'undefined';
26276
+ var baseClassName = 'react-time-picker';
26277
+ var outsideActionEvents = ['mousedown', 'focusin', 'touchstart'];
26278
+ var allViews = ['hour', 'minute', 'second'];
26279
+ var iconProps = {
26280
+ xmlns: 'http://www.w3.org/2000/svg',
26281
+ width: 19,
26282
+ height: 19,
26283
+ viewBox: '0 0 19 19',
26284
+ stroke: 'black',
26285
+ strokeWidth: 2,
26286
+ };
26287
+ var ClockIcon = (React__default["default"].createElement("svg", __assign({}, iconProps, { className: "".concat(baseClassName, "__clock-button__icon ").concat(baseClassName, "__button__icon"), fill: "none" }),
26288
+ React__default["default"].createElement("circle", { cx: "9.5", cy: "9.5", r: "7.5" }),
26289
+ React__default["default"].createElement("path", { d: "M9.5 4.5 v5 h4" })));
26290
+ var ClearIcon = (React__default["default"].createElement("svg", __assign({}, iconProps, { className: "".concat(baseClassName, "__clear-button__icon ").concat(baseClassName, "__button__icon") }),
26291
+ React__default["default"].createElement("line", { x1: "4", x2: "15", y1: "4", y2: "15" }),
26292
+ React__default["default"].createElement("line", { x1: "15", x2: "4", y1: "4", y2: "15" })));
26293
+ var TimePicker$1 = function TimePicker(props) {
26294
+ var amPmAriaLabel = props.amPmAriaLabel, autoFocus = props.autoFocus, className = props.className, clearAriaLabel = props.clearAriaLabel, _a = props.clearIcon, clearIcon = _a === void 0 ? ClearIcon : _a, clockAriaLabel = props.clockAriaLabel, _b = props.clockIcon, clockIcon = _b === void 0 ? ClockIcon : _b, _c = props.closeClock, shouldCloseClockOnSelect = _c === void 0 ? true : _c, dataTestid = props["data-testid"], hourAriaLabel = props.hourAriaLabel, hourPlaceholder = props.hourPlaceholder, disableClock = props.disableClock, disabled = props.disabled, format = props.format, id = props.id, _d = props.isOpen, isOpenProps = _d === void 0 ? null : _d, locale = props.locale, maxTime = props.maxTime, _e = props.maxDetail, maxDetail = _e === void 0 ? 'minute' : _e, minTime = props.minTime, minuteAriaLabel = props.minuteAriaLabel, minutePlaceholder = props.minutePlaceholder, _f = props.name, name = _f === void 0 ? 'time' : _f, nativeInputAriaLabel = props.nativeInputAriaLabel, onClockClose = props.onClockClose, onClockOpen = props.onClockOpen, onChangeProps = props.onChange, onFocusProps = props.onFocus, onInvalidChange = props.onInvalidChange, _g = props.openClockOnFocus, openClockOnFocus = _g === void 0 ? true : _g, required = props.required, value = props.value, secondAriaLabel = props.secondAriaLabel, secondPlaceholder = props.secondPlaceholder, shouldCloseClock = props.shouldCloseClock, shouldOpenClock = props.shouldOpenClock, otherProps = __rest(props, ["amPmAriaLabel", "autoFocus", "className", "clearAriaLabel", "clearIcon", "clockAriaLabel", "clockIcon", "closeClock", 'data-testid', "hourAriaLabel", "hourPlaceholder", "disableClock", "disabled", "format", "id", "isOpen", "locale", "maxTime", "maxDetail", "minTime", "minuteAriaLabel", "minutePlaceholder", "name", "nativeInputAriaLabel", "onClockClose", "onClockOpen", "onChange", "onFocus", "onInvalidChange", "openClockOnFocus", "required", "value", "secondAriaLabel", "secondPlaceholder", "shouldCloseClock", "shouldOpenClock"]);
26295
+ var _h = React$3.useState(isOpenProps), isOpen = _h[0], setIsOpen = _h[1];
26296
+ var wrapper = React$3.useRef(null);
26297
+ var clockWrapper = React$3.useRef(null);
26298
+ React$3.useEffect(function () {
26299
+ setIsOpen(isOpenProps);
26300
+ }, [isOpenProps]);
26301
+ function openClock(_a) {
26302
+ var reason = _a.reason;
26303
+ if (shouldOpenClock) {
26304
+ if (!shouldOpenClock({ reason: reason })) {
26305
+ return;
26306
+ }
26307
+ }
26308
+ setIsOpen(true);
26309
+ if (onClockOpen) {
26310
+ onClockOpen();
26311
+ }
26312
+ }
26313
+ var closeClock = React$3.useCallback(function (_a) {
26314
+ var reason = _a.reason;
26315
+ if (shouldCloseClock) {
26316
+ if (!shouldCloseClock({ reason: reason })) {
26317
+ return;
26318
+ }
26319
+ }
26320
+ setIsOpen(false);
26321
+ if (onClockClose) {
26322
+ onClockClose();
26323
+ }
26324
+ }, [onClockClose, shouldCloseClock]);
26325
+ function toggleClock() {
26326
+ if (isOpen) {
26327
+ closeClock({ reason: 'buttonClick' });
26328
+ }
26329
+ else {
26330
+ openClock({ reason: 'buttonClick' });
26331
+ }
26332
+ }
26333
+ function onChange(value, shouldCloseClock) {
26334
+ if (shouldCloseClock === void 0) { shouldCloseClock = shouldCloseClockOnSelect; }
26335
+ if (shouldCloseClock) {
26336
+ closeClock({ reason: 'select' });
26337
+ }
26338
+ if (onChangeProps) {
26339
+ onChangeProps(value);
26340
+ }
26341
+ }
26342
+ function onFocus(event) {
26343
+ if (onFocusProps) {
26344
+ onFocusProps(event);
26345
+ }
26346
+ if (
26347
+ // Internet Explorer still fires onFocus on disabled elements
26348
+ disabled ||
26349
+ isOpen ||
26350
+ !openClockOnFocus ||
26351
+ event.target.dataset.select === 'true') {
26352
+ return;
26353
+ }
26354
+ openClock({ reason: 'focus' });
26355
+ }
26356
+ var onKeyDown = React$3.useCallback(function (event) {
26357
+ if (event.key === 'Escape') {
26358
+ closeClock({ reason: 'escape' });
26359
+ }
26360
+ }, [closeClock]);
26361
+ function clear() {
26362
+ onChange(null);
26363
+ }
26364
+ function stopPropagation(event) {
26365
+ event.stopPropagation();
26366
+ }
26367
+ var onOutsideAction = React$3.useCallback(function (event) {
26368
+ var wrapperEl = wrapper.current;
26369
+ var clockWrapperEl = clockWrapper.current;
26370
+ // Try event.composedPath first to handle clicks inside a Shadow DOM.
26371
+ var target = ('composedPath' in event ? event.composedPath()[0] : event.target);
26372
+ if (target &&
26373
+ wrapperEl &&
26374
+ !wrapperEl.contains(target) &&
26375
+ (!clockWrapperEl || !clockWrapperEl.contains(target))) {
26376
+ closeClock({ reason: 'outsideAction' });
26377
+ }
26378
+ }, [clockWrapper, closeClock, wrapper]);
26379
+ var handleOutsideActionListeners = React$3.useCallback(function (shouldListen) {
26380
+ if (shouldListen === void 0) { shouldListen = isOpen; }
26381
+ outsideActionEvents.forEach(function (event) {
26382
+ if (shouldListen) {
26383
+ document.addEventListener(event, onOutsideAction);
26384
+ }
26385
+ else {
26386
+ document.removeEventListener(event, onOutsideAction);
26387
+ }
26388
+ });
26389
+ if (shouldListen) {
26390
+ document.addEventListener('keydown', onKeyDown);
26391
+ }
26392
+ else {
26393
+ document.removeEventListener('keydown', onKeyDown);
26394
+ }
26395
+ }, [isOpen, onOutsideAction, onKeyDown]);
26396
+ React$3.useEffect(function () {
26397
+ handleOutsideActionListeners();
26398
+ return function () {
26399
+ handleOutsideActionListeners(false);
26400
+ };
26401
+ }, [handleOutsideActionListeners]);
26402
+ function renderInputs() {
26403
+ var valueFrom = (Array.isArray(value) ? value : [value])[0];
26404
+ var ariaLabelProps = {
26405
+ amPmAriaLabel: amPmAriaLabel,
26406
+ hourAriaLabel: hourAriaLabel,
26407
+ minuteAriaLabel: minuteAriaLabel,
26408
+ nativeInputAriaLabel: nativeInputAriaLabel,
26409
+ secondAriaLabel: secondAriaLabel,
26410
+ };
26411
+ var placeholderProps = {
26412
+ hourPlaceholder: hourPlaceholder,
26413
+ minutePlaceholder: minutePlaceholder,
26414
+ secondPlaceholder: secondPlaceholder,
26415
+ };
26416
+ return (React__default["default"].createElement("div", { className: "".concat(baseClassName, "__wrapper") },
26417
+ React__default["default"].createElement(TimeInput, __assign({}, ariaLabelProps, placeholderProps, {
26418
+ // eslint-disable-next-line jsx-a11y/no-autofocus
26419
+ autoFocus: autoFocus, className: "".concat(baseClassName, "__inputGroup"), disabled: disabled, format: format, isClockOpen: isOpen, locale: locale, maxDetail: maxDetail, maxTime: maxTime, minTime: minTime, name: name, onChange: onChange, onInvalidChange: onInvalidChange, required: required, value: valueFrom })),
26420
+ clearIcon !== null && (React__default["default"].createElement("button", { "aria-label": clearAriaLabel, className: "".concat(baseClassName, "__clear-button ").concat(baseClassName, "__button"), disabled: disabled, onClick: clear, onFocus: stopPropagation, type: "button" }, typeof clearIcon === 'function' ? React__default["default"].createElement(clearIcon) : clearIcon)),
26421
+ clockIcon !== null && !disableClock && (React__default["default"].createElement("button", { "aria-label": clockAriaLabel, className: "".concat(baseClassName, "__clock-button ").concat(baseClassName, "__button"), disabled: disabled, onClick: toggleClock, onFocus: stopPropagation, type: "button" }, typeof clockIcon === 'function' ? React__default["default"].createElement(clockIcon) : clockIcon))));
26422
+ }
26423
+ function renderClock() {
26424
+ if (isOpen === null || disableClock) {
26425
+ return null;
26426
+ }
26427
+ var clockClassName = props.clockClassName; props.className; // Unused, here to exclude it from clockProps
26428
+ props.onChange; // Unused, here to exclude it from clockProps
26429
+ var portalContainer = props.portalContainer, value = props.value, clockProps = __rest(props, ["clockClassName", "className", "onChange", "portalContainer", "value"]);
26430
+ var className = "".concat(baseClassName, "__clock");
26431
+ var classNames = clsx$1(className, "".concat(className, "--").concat(isOpen ? 'open' : 'closed'));
26432
+ var valueFrom = (Array.isArray(value) ? value : [value])[0];
26433
+ var clock = React__default["default"].createElement(Clock, __assign({ className: clockClassName, value: valueFrom }, clockProps));
26434
+ return portalContainer ? (ReactDOM.createPortal(React__default["default"].createElement("div", { ref: clockWrapper, className: classNames }, clock), portalContainer)) : (React__default["default"].createElement(Fit, null,
26435
+ React__default["default"].createElement("div", { ref: function (ref) {
26436
+ if (ref && !isOpen) {
26437
+ ref.removeAttribute('style');
26438
+ }
26439
+ }, className: classNames }, clock)));
26440
+ }
26441
+ var eventProps = React$3.useMemo(function () { return makeEventProps(otherProps); }, [otherProps]);
26442
+ return (React__default["default"].createElement("div", __assign({ className: clsx$1(baseClassName, "".concat(baseClassName, "--").concat(isOpen ? 'open' : 'closed'), "".concat(baseClassName, "--").concat(disabled ? 'disabled' : 'enabled'), className), "data-testid": dataTestid, id: id }, eventProps, { onFocus: onFocus, ref: wrapper }),
26443
+ renderInputs(),
26444
+ renderClock()));
26445
+ };
26446
+ var isValue = propTypes$1.exports.oneOfType([isTime, propTypes$1.exports.instanceOf(Date)]);
26447
+ var isValueOrValueArray = propTypes$1.exports.oneOfType([isValue, rangeOf(isValue)]);
26448
+ TimePicker$1.propTypes = {
26449
+ amPmAriaLabel: propTypes$1.exports.string,
26450
+ autoFocus: propTypes$1.exports.bool,
26451
+ className: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.arrayOf(propTypes$1.exports.string)]),
26452
+ clearAriaLabel: propTypes$1.exports.string,
26453
+ clearIcon: propTypes$1.exports.oneOfType([propTypes$1.exports.node, propTypes$1.exports.func]),
26454
+ clockAriaLabel: propTypes$1.exports.string,
26455
+ clockClassName: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.arrayOf(propTypes$1.exports.string)]),
26456
+ clockIcon: propTypes$1.exports.oneOfType([propTypes$1.exports.node, propTypes$1.exports.func]),
26457
+ closeClock: propTypes$1.exports.bool,
26458
+ 'data-testid': propTypes$1.exports.string,
26459
+ disableClock: propTypes$1.exports.bool,
26460
+ disabled: propTypes$1.exports.bool,
26461
+ format: propTypes$1.exports.string,
26462
+ hourAriaLabel: propTypes$1.exports.string,
26463
+ hourPlaceholder: propTypes$1.exports.string,
26464
+ id: propTypes$1.exports.string,
26465
+ isOpen: propTypes$1.exports.bool,
26466
+ locale: propTypes$1.exports.string,
26467
+ maxDetail: propTypes$1.exports.oneOf(allViews),
26468
+ maxTime: isTime,
26469
+ minTime: isTime,
26470
+ minuteAriaLabel: propTypes$1.exports.string,
26471
+ minutePlaceholder: propTypes$1.exports.string,
26472
+ name: propTypes$1.exports.string,
26473
+ nativeInputAriaLabel: propTypes$1.exports.string,
26474
+ onChange: propTypes$1.exports.func,
26475
+ onClockClose: propTypes$1.exports.func,
26476
+ onClockOpen: propTypes$1.exports.func,
26477
+ onFocus: propTypes$1.exports.func,
26478
+ openClockOnFocus: propTypes$1.exports.bool,
26479
+ required: propTypes$1.exports.bool,
26480
+ secondAriaLabel: propTypes$1.exports.string,
26481
+ secondPlaceholder: propTypes$1.exports.string,
26482
+ value: isValueOrValueArray,
26483
+ };
26484
+ if (isBrowser$4) {
26485
+ TimePicker$1.propTypes.portalContainer = propTypes$1.exports.instanceOf(HTMLElement);
26486
+ }
26487
+
26488
+ var HoverIcon = function HoverIcon(_ref) {
26489
+ var _ref$time = _ref.time,
26490
+ time = _ref$time === void 0 ? false : _ref$time;
26491
+ var _useState = React$3.useState(false),
26492
+ _useState2 = _slicedToArray$3(_useState, 2),
26493
+ hovered = _useState2[0],
26494
+ setHovered = _useState2[1];
26495
+ return /*#__PURE__*/React__default["default"].createElement("div", {
26496
+ onMouseLeave: function onMouseLeave() {
26497
+ return setHovered(false);
26498
+ },
26499
+ onMouseOver: function onMouseOver() {
26500
+ return setHovered(true);
25449
26501
  }
25450
26502
  }, hovered && time ? /*#__PURE__*/React__default["default"].createElement(neetoIcons.Close, {
25451
26503
  size: 16
@@ -25454,7 +26506,29 @@ var HoverIcon = function HoverIcon(_ref) {
25454
26506
  }));
25455
26507
  };
25456
26508
 
25457
- var _excluded$v = ["className", "label", "labelProps", "size", "nakedInput", "required", "value", "onChange", "error", "onBlur"];
26509
+ var FORMAT = "HH:mm";
26510
+ var getFormattedTime = function getFormattedTime(value) {
26511
+ if (dayjs.isDayjs(value)) {
26512
+ return value.toDate();
26513
+ } else if (value instanceof Date || dayjs(value, FORMAT).isValid()) {
26514
+ return value;
26515
+ }
26516
+ return null;
26517
+ };
26518
+ var getFormattedRange = function getFormattedRange(value) {
26519
+ if (!Array.isArray(value)) return null;
26520
+ return value.map(function (item) {
26521
+ return getFormattedTime(item);
26522
+ });
26523
+ };
26524
+ var toDayJs = function toDayJs(value) {
26525
+ if (Array.isArray(value)) return value.map(function (item) {
26526
+ return dayjs(item, FORMAT);
26527
+ });
26528
+ return dayjs(value, FORMAT);
26529
+ };
26530
+
26531
+ var _excluded$v = ["type", "className", "label", "labelProps", "size", "nakedInput", "required", "value", "defaultValue", "onChange", "error", "onBlur"];
25458
26532
  function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25459
26533
  function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25460
26534
  dayjs.extend(customParseFormat);
@@ -25463,9 +26537,14 @@ var INPUT_SIZES$1 = {
25463
26537
  medium: "medium",
25464
26538
  large: "large"
25465
26539
  };
25466
- var FORMAT = "HH:mm";
26540
+ var timeComponents = {
26541
+ range: TimeRangePicker,
26542
+ time: TimePicker$1
26543
+ };
25467
26544
  var TimePickerInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
25468
- var _ref$className = _ref.className,
26545
+ var _ref$type = _ref.type,
26546
+ type = _ref$type === void 0 ? "time" : _ref$type,
26547
+ _ref$className = _ref.className,
25469
26548
  className = _ref$className === void 0 ? "" : _ref$className,
25470
26549
  label = _ref.label,
25471
26550
  labelProps = _ref.labelProps,
@@ -25476,30 +26555,44 @@ var TimePickerInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
25476
26555
  _ref$required = _ref.required,
25477
26556
  required = _ref$required === void 0 ? false : _ref$required,
25478
26557
  inputValue = _ref.value,
25479
- onChange = _ref.onChange,
26558
+ defaultValue = _ref.defaultValue,
26559
+ _ref$onChange = _ref.onChange,
26560
+ onChange = _ref$onChange === void 0 ? noop$3 : _ref$onChange,
25480
26561
  _ref$error = _ref.error,
25481
26562
  error = _ref$error === void 0 ? "" : _ref$error,
25482
26563
  _ref$onBlur = _ref.onBlur,
25483
26564
  onBlur = _ref$onBlur === void 0 ? noop$3 : _ref$onBlur,
25484
26565
  otherProps = _objectWithoutProperties$1(_ref, _excluded$v);
25485
- var value = React$3.useMemo(function () {
25486
- if (neetoCist.isPresent(inputValue) && dayjs(inputValue).isValid()) {
25487
- return inputValue.format(FORMAT);
25488
- }
25489
- return null;
25490
- }, [inputValue]);
26566
+ var _useState = React$3.useState(null),
26567
+ _useState2 = _slicedToArray$3(_useState, 2),
26568
+ value = _useState2[0],
26569
+ setValue = _useState2[1];
25491
26570
  var id = useId(otherProps.id);
25492
26571
  var errorId = "error_".concat(id);
26572
+ React$3.useEffect(function () {
26573
+ if (neetoCist.isNotPresent(inputValue) && neetoCist.isNotPresent(defaultValue)) return;
26574
+ setValue((type === "range" ? getFormattedRange : getFormattedTime)(inputValue || defaultValue));
26575
+ }, [type, inputValue]);
25493
26576
  var handleChange = function handleChange(newValue) {
25494
- var time = dayjs(newValue, FORMAT);
25495
- onChange(time, newValue);
26577
+ setValue(newValue);
26578
+ onChange(toDayJs(newValue), newValue);
26579
+ };
26580
+ var handleShouldCloseClock = function handleShouldCloseClock() {
26581
+ onBlur(toDayJs(value), value);
26582
+ return true;
25496
26583
  };
26584
+ var handleKeyDown = function handleKeyDown(_ref2) {
26585
+ var code = _ref2.code;
26586
+ if (code !== "Enter") return;
26587
+ onBlur(toDayJs(value), value);
26588
+ };
26589
+ var Component = timeComponents[type];
25497
26590
  return /*#__PURE__*/React__default["default"].createElement("div", {
25498
26591
  ref: ref,
25499
26592
  className: "neeto-ui-input__wrapper"
25500
26593
  }, label && /*#__PURE__*/React__default["default"].createElement(Label, _objectSpread$k({
25501
26594
  required: required
25502
- }, labelProps), label), /*#__PURE__*/React__default["default"].createElement(TimePicker$1, _extends$4({
26595
+ }, labelProps), label), /*#__PURE__*/React__default["default"].createElement(Component, _extends$4({
25503
26596
  id: id,
25504
26597
  value: value,
25505
26598
  disableClock: true,
@@ -25510,6 +26603,7 @@ var TimePickerInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
25510
26603
  hourPlaceholder: "HH",
25511
26604
  minutePlaceholder: "mm",
25512
26605
  secondAriaLabel: "ss",
26606
+ shouldCloseClock: handleShouldCloseClock,
25513
26607
  className: classnames$1("neeto-ui-time-picker", [className], {
25514
26608
  "neeto-ui-time-picker--small": size === "small",
25515
26609
  "neeto-ui-time-picker--medium": size === "medium",
@@ -25518,13 +26612,8 @@ var TimePickerInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
25518
26612
  "neeto-ui-time-picker--naked": nakedInput,
25519
26613
  "neeto-ui-time-picker--error": !!error
25520
26614
  }),
25521
- shouldCloseClock: function shouldCloseClock(_ref2) {
25522
- var reason = _ref2.reason;
25523
- if (reason !== "outsideAction") return true;
25524
- onBlur();
25525
- return true;
25526
- },
25527
- onChange: handleChange
26615
+ onChange: handleChange,
26616
+ onKeyDown: handleKeyDown
25528
26617
  }, otherProps)), !!error && typeof error === "string" && /*#__PURE__*/React__default["default"].createElement("p", {
25529
26618
  className: "neeto-ui-input__error",
25530
26619
  "data-cy": "".concat(hyphenize(label), "-input-error"),
@@ -25533,11 +26622,18 @@ var TimePickerInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
25533
26622
  });
25534
26623
  TimePickerInput.displayName = "TimePicker";
25535
26624
 
26625
+ var DATE_FORMAT = "YYYY-MM-DD";
26626
+ var TIME_FORMAT = "HH:mm";
26627
+ var getDateTime = function getDateTime(date, time) {
26628
+ if (neetoCist.isPresent(date) && neetoCist.isPresent(time)) {
26629
+ return dayjs("".concat(date.format(DATE_FORMAT), " ").concat(time.format(TIME_FORMAT)));
26630
+ }
26631
+ return null;
26632
+ };
26633
+
25536
26634
  function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25537
26635
  function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25538
26636
  dayjs.extend(customParseFormat);
25539
- var DATE_FORMAT = "YYYY-MM-DD";
25540
- var TIME_FORMAT = "HH:mm";
25541
26637
  var DateTimePicker = function DateTimePicker(_ref) {
25542
26638
  var _ref$className = _ref.className,
25543
26639
  className = _ref$className === void 0 ? "" : _ref$className,
@@ -25559,10 +26655,12 @@ var DateTimePicker = function DateTimePicker(_ref) {
25559
26655
  _ref$required = _ref.required,
25560
26656
  required = _ref$required === void 0 ? false : _ref$required,
25561
26657
  id = _ref.id,
26658
+ datePickerProps = _ref.datePickerProps,
26659
+ timePickerProps = _ref.timePickerProps,
25562
26660
  _ref$onTimeInputBlur = _ref.onTimeInputBlur,
25563
26661
  onTimeInputBlur = _ref$onTimeInputBlur === void 0 ? noop$3 : _ref$onTimeInputBlur,
25564
- datePickerProps = _ref.datePickerProps,
25565
- timePickerProps = _ref.timePickerProps;
26662
+ _ref$onBlur = _ref.onBlur,
26663
+ onBlur = _ref$onBlur === void 0 ? noop$3 : _ref$onBlur;
25566
26664
  var _useState = React$3.useState(datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.open),
25567
26665
  _useState2 = _slicedToArray$3(_useState, 2),
25568
26666
  open = _useState2[0],
@@ -25592,11 +26690,7 @@ var DateTimePicker = function DateTimePicker(_ref) {
25592
26690
  }, [value, defaultValue]);
25593
26691
  React$3.useEffect(function () {
25594
26692
  if (neetoCist.isNotPresent(changedField)) return;
25595
- if (neetoCist.isPresent(date) && neetoCist.isPresent(time)) {
25596
- onChange(dayjs("".concat(date.format(DATE_FORMAT), " ").concat(time.format(TIME_FORMAT))), changedField);
25597
- } else {
25598
- onChange(null, changedField);
25599
- }
26693
+ onChange(getDateTime(date, time), changedField);
25600
26694
  setChangedField(); // reset to avoid unnecessary trigger on rerender
25601
26695
  }, [date, time, changedField]);
25602
26696
  var handleDateChange = function handleDateChange(newDate) {
@@ -25612,6 +26706,10 @@ var DateTimePicker = function DateTimePicker(_ref) {
25612
26706
  if (newTime.isValid() && !date) setDate(newTime);
25613
26707
  setChangedField("time");
25614
26708
  };
26709
+ var handleTimeBlur = function handleTimeBlur() {
26710
+ onTimeInputBlur(getDateTime(date, time));
26711
+ onBlur(getDateTime(date, time));
26712
+ };
25615
26713
  return /*#__PURE__*/React__default["default"].createElement("div", {
25616
26714
  className: "neeto-ui-input__wrapper"
25617
26715
  }, label && /*#__PURE__*/React__default["default"].createElement(Label, _objectSpread$j({
@@ -25641,7 +26739,7 @@ var DateTimePicker = function DateTimePicker(_ref) {
25641
26739
  error: error,
25642
26740
  nakedInput: nakedInput,
25643
26741
  size: size
25644
- }, "error", !!error), "ref", timeRef), "value", time), "onBlur", onTimeInputBlur), "onChange", handleTimeChange), timePickerProps))), !!error && /*#__PURE__*/React__default["default"].createElement("p", {
26742
+ }, "error", !!error), "ref", timeRef), "value", time), "onBlur", handleTimeBlur), "onChange", handleTimeChange), timePickerProps))), !!error && /*#__PURE__*/React__default["default"].createElement("p", {
25645
26743
  className: "neeto-ui-input__error",
25646
26744
  "data-cy": "".concat(hyphenize(label), "-input-error"),
25647
26745
  id: errorId