'use strict';

var PickerButton = require('../PickerButton.cjs');
var PickerTag = require('../PickerTag.cjs');

const Components = { button: PickerButton.default, rangeItem: PickerTag.default };
function toArray(list) {
  if (!list)
    return [];
  return Array.isArray(list) ? list : [list];
}
function getTimeProps(props) {
  const { format, picker, showHour, showMinute, showSecond, use12Hours } = props;
  const firstFormat = toArray(format)[0];
  const showTimeObj = { ...props };
  if (firstFormat && typeof firstFormat === "string") {
    if (!firstFormat.includes("s") && showSecond === void 0)
      showTimeObj.showSecond = false;
    if (!firstFormat.includes("m") && showMinute === void 0)
      showTimeObj.showMinute = false;
    if (!firstFormat.includes("H") && !firstFormat.includes("h") && showHour === void 0)
      showTimeObj.showHour = false;
    if ((firstFormat.includes("a") || firstFormat.includes("A")) && use12Hours === void 0)
      showTimeObj.use12Hours = true;
  }
  if (picker === "time")
    return showTimeObj;
  if (typeof firstFormat === "function") {
    delete showTimeObj.format;
  }
  return {
    showTime: showTimeObj
  };
}

exports.Components = Components;
exports.getTimeProps = getTimeProps;
//# sourceMappingURL=util.cjs.map
