"use strict";

exports.__esModule = true;
exports.default = exports.createInput = exports.inputTypes = void 0;

var _react = _interopRequireDefault(require("react"));

var _index = require("./index");

var _propsClasses, _inputComponents, _propsPropertyName;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var inputTypes = {
  inputBase: "inputBase",
  checkbox: "checkbox",
  checkboxGroup: "checkboxGroup",
  radio: "radio",
  select: "select",
  standaloneRadio: "standaloneRadio",
  switch: "switch"
};
exports.inputTypes = inputTypes;
var propsClasses = (_propsClasses = {}, _defineProperty(_propsClasses, inputTypes.inputBase, _index.InputBaseProps), _defineProperty(_propsClasses, inputTypes.checkbox, _index.CheckboxProps), _defineProperty(_propsClasses, inputTypes.checkboxGroup, _index.CheckboxGroupProps), _defineProperty(_propsClasses, inputTypes.radio, _index.RadioProps), _defineProperty(_propsClasses, inputTypes.select, _index.SelectProps), _defineProperty(_propsClasses, inputTypes.standaloneRadio, _index.StandaloneRadioProps), _defineProperty(_propsClasses, inputTypes.switch, _index.SwitchProps), _propsClasses);
var inputComponents = (_inputComponents = {}, _defineProperty(_inputComponents, inputTypes.inputBase, _index.InputBase), _defineProperty(_inputComponents, inputTypes.checkbox, _index.Checkbox), _defineProperty(_inputComponents, inputTypes.checkboxGroup, _index.CheckboxGroup), _defineProperty(_inputComponents, inputTypes.radio, _index.Radio), _defineProperty(_inputComponents, inputTypes.select, _index.Select), _defineProperty(_inputComponents, inputTypes.standaloneRadio, _index.StandaloneRadio), _defineProperty(_inputComponents, inputTypes.switch, _index.Switch), _inputComponents);
var propsPropertyName = (_propsPropertyName = {}, _defineProperty(_propsPropertyName, inputTypes.inputBase, "inputProps"), _defineProperty(_propsPropertyName, inputTypes.checkbox, "checkboxProps"), _defineProperty(_propsPropertyName, inputTypes.checkboxGroup, "checkboxGroupProps"), _defineProperty(_propsPropertyName, inputTypes.radio, "radioProps"), _defineProperty(_propsPropertyName, inputTypes.select, "selectProps"), _defineProperty(_propsPropertyName, inputTypes.standaloneRadio, "radioProps"), _defineProperty(_propsPropertyName, inputTypes.switch, "switchProps"), _propsPropertyName);

var createInput = function createInput(inputType, _ref) {
  var props = _extends({}, _ref);

  var typePropsInstance = new propsClasses[inputType]();
  var propKeys = Object.keys(props);
  var otherProps = {};
  propKeys.forEach(function (propKey) {
    var _propsClasses$inputTy;

    if (propsClasses[inputType].propNames[propKey] != null) {
      typePropsInstance.set(propKey, props[propKey]);
    } else if (((_propsClasses$inputTy = propsClasses[inputType].ruleNames) == null ? void 0 : _propsClasses$inputTy[propKey]) != null) {
      typePropsInstance.setStyle(propKey, props[propKey]);
    } else {
      otherProps[propKey] = props[propKey];
    }
  });
  return _react.default.createElement(inputComponents[inputType], _objectSpread(_defineProperty({}, propsPropertyName[inputType], typePropsInstance), otherProps));
};

exports.createInput = createInput;
var _default = createInput;
var _default2 = _default;
var _default3 = _default2;
exports.default = _default3;
;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(inputTypes, "inputTypes", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(propsClasses, "propsClasses", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(inputComponents, "inputComponents", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(propsPropertyName, "propsPropertyName", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(createInput, "createInput", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();

;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(inputTypes, "inputTypes", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(propsClasses, "propsClasses", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(inputComponents, "inputComponents", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(propsPropertyName, "propsPropertyName", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(createInput, "createInput", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();