import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["booleanWidget"];
import deprecate from 'util-deprecate';
import { setLegacyMode } from '../../legacyMode';
var booleanWidget = deprecate(function (_ref) {
  var booleanWidget = _ref.booleanWidget,
      config = _objectWithoutProperties(_ref, _excluded);

  setLegacyMode();
  return _objectSpread({
    widget: {
      0: 'radio',
      1: 'select',
      2: 'switch',
      3: 'switchWithEmptyOption'
    }[booleanWidget]
  }, config);
}, 'config.booleanWidget is deprecated. Use config.widget instead. Example: "widget": "radio"');
export default (function (config) {
  if (config.type === 'boolean') {
    if (config.booleanWidget !== undefined) {
      config = booleanWidget(config);
    }
  }

  return config;
});
//# sourceMappingURL=booleanWidget.js.map