'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _immutable = require('immutable');

var _immutable2 = _interopRequireDefault(_immutable);

var _reactIntl = require('react-intl');

var _cspaceInput = require('cspace-input');

var _cspaceLayout = require('cspace-layout');

var _cspaceRefname = require('cspace-refname');

var _DateInputContainer = require('../containers/input/DateInputContainer');

var _DateInputContainer2 = _interopRequireDefault(_DateInputContainer);

var _DateTimeInputContainer = require('../containers/input/DateTimeInputContainer');

var _DateTimeInputContainer2 = _interopRequireDefault(_DateTimeInputContainer);

var _IDGeneratorInputContainer = require('../containers/input/IDGeneratorInputContainer');

var _IDGeneratorInputContainer2 = _interopRequireDefault(_IDGeneratorInputContainer);

var _OptionPickerInputContainer = require('../containers/input/OptionPickerInputContainer');

var _OptionPickerInputContainer2 = _interopRequireDefault(_OptionPickerInputContainer);

var _UploadInputContainer = require('../containers/input/UploadInputContainer');

var _UploadInputContainer2 = _interopRequireDefault(_UploadInputContainer);

var _PermissionsInputContainer = require('../containers/admin/PermissionsInputContainer');

var _PermissionsInputContainer2 = _interopRequireDefault(_PermissionsInputContainer);

var _MiniViewPopupAutocompleteInputContainer = require('../containers/record/MiniViewPopupAutocompleteInputContainer');

var _MiniViewPopupAutocompleteInputContainer2 = _interopRequireDefault(_MiniViewPopupAutocompleteInputContainer);

var _RolesInputContainer = require('../containers/admin/RolesInputContainer');

var _RolesInputContainer2 = _interopRequireDefault(_RolesInputContainer);

var _StructuredDateInputContainer = require('../containers/record/StructuredDateInputContainer');

var _StructuredDateInputContainer2 = _interopRequireDefault(_StructuredDateInputContainer);

var _TermPickerInputContainer = require('../containers/record/TermPickerInputContainer');

var _TermPickerInputContainer2 = _interopRequireDefault(_TermPickerInputContainer);

var _WorkflowStateInput = require('../components/record/WorkflowStateInput');

var _WorkflowStateInput2 = _interopRequireDefault(_WorkflowStateInput);

var _PanelContainer = require('../containers/layout/PanelContainer');

var _PanelContainer2 = _interopRequireDefault(_PanelContainer);

var _Field = require('../components/record/Field');

var _Field2 = _interopRequireDefault(_Field);

var _HierarchyInput = require('../components/record/HierarchyInput');

var _HierarchyInput2 = _interopRequireDefault(_HierarchyInput);

var _InputTable = require('../components/record/InputTable');

var _InputTable2 = _interopRequireDefault(_InputTable);

var _Subrecord = require('../components/record/Subrecord');

var _Subrecord2 = _interopRequireDefault(_Subrecord);

var _URLInput = require('../components/record/URLInput');

var _URLInput2 = _interopRequireDefault(_URLInput);

var _ContentViewer = require('../components/record/ContentViewer');

var _ContentViewer2 = _interopRequireDefault(_ContentViewer);

var _dataTypes = require('../constants/dataTypes');

var dataTypes = _interopRequireWildcard(_dataTypes);

var _searchOperators = require('../constants/searchOperators');

var searchOperators = _interopRequireWildcard(_searchOperators);

var _withBooleanValue = require('../enhancers/withBooleanValue');

var _withBooleanValue2 = _interopRequireDefault(_withBooleanValue);

var _withCsid = require('../enhancers/withCsid');

var _withCsid2 = _interopRequireDefault(_withCsid);

var _configHelpers = require('../helpers/configHelpers');

var _recordDataHelpers = require('../helpers/recordDataHelpers');

var _formatHelpers = require('../helpers/formatHelpers');

var formatHelpers = _interopRequireWildcard(_formatHelpers);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

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

const BaseCheckboxInput = _cspaceInput.components.CheckboxInput,
      CompoundInput = _cspaceInput.components.CompoundInput,
      PasswordInput = _cspaceInput.components.PasswordInput,
      ReadOnlyInput = _cspaceInput.components.ReadOnlyInput,
      RichTextInput = _cspaceInput.components.RichTextInput,
      TextInput = _cspaceInput.components.TextInput;
const labelable = _cspaceInput.enhancers.labelable,
      repeatable = _cspaceInput.enhancers.repeatable;


const AutocompleteInput = repeatable(labelable(_MiniViewPopupAutocompleteInputContainer2.default));
const CheckboxInput = (0, _withBooleanValue2.default)(BaseCheckboxInput);
const DateInput = _DateInputContainer2.default;
const DateTimeInput = _DateTimeInputContainer2.default;
const HierarchyInput = (0, _withCsid2.default)(_HierarchyInput2.default);
const IDGeneratorInput = _IDGeneratorInputContainer2.default;
const OptionPickerInput = _OptionPickerInputContainer2.default;
const PermissionsInput = labelable(_PermissionsInputContainer2.default);
const RolesInput = labelable(_RolesInputContainer2.default);
const StructuredDateInput = _StructuredDateInputContainer2.default;
const TermPickerInput = _TermPickerInputContainer2.default;
const UploadInput = _UploadInputContainer2.default;

exports.default = () => ({
  dataTypes,
  formatHelpers,
  searchOperators,
  config: {
    extensions: {
      // Initialize the default extensions. This makes testing easier, since the plugins that
      // implement these extensions won't necessarily be loaded for tests.

      core: {
        advancedSearch: []
      },
      dimension: {},
      structuredDate: {}
    }
  },
  lib: {
    Immutable: _immutable2.default,
    React: _react2.default
  },
  inputComponents: {
    AutocompleteInput,
    CheckboxInput,
    CompoundInput,
    DateInput,
    DateTimeInput,
    HierarchyInput,
    IDGeneratorInput,
    URLInput: _URLInput2.default,
    OptionPickerInput,
    PasswordInput,
    PermissionsInput,
    RolesInput,
    StructuredDateInput,
    ReadOnlyInput,
    RichTextInput,
    TextInput,
    TermPickerInput,
    UploadInput,
    WorkflowStateInput: _WorkflowStateInput2.default
  },
  layoutComponents: {
    Col: _cspaceLayout.Col,
    Cols: _cspaceLayout.Cols,
    Panel: _PanelContainer2.default,
    Row: _cspaceLayout.Row
  },
  recordComponents: {
    ContentViewer: _ContentViewer2.default,
    Field: _Field2.default,
    InputTable: _InputTable2.default,
    Subrecord: _Subrecord2.default
  },
  configHelpers: {
    configKey: _configHelpers.configKey,
    defineMessages: _reactIntl.defineMessages
  },
  recordDataHelpers: {
    deepGet: _recordDataHelpers.deepGet,
    getPart: _recordDataHelpers.getPart,
    getPartPropertyName: _recordDataHelpers.getPartPropertyName,
    isNewRecord: _recordDataHelpers.isNewRecord
  },
  refNameHelpers: {
    getDisplayName: _cspaceRefname.getDisplayName
  }
});