'use strict';

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

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

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; }

exports.default = function (pluginContext) {
  var _relRelationsCommon, _Object$assign, _conceptTermGroup, _conceptTermGroupList, _conceptRecordTypes, _citationGroup, _citationGroupList, _additionalSourceGrou, _additionalSourceGrou2, _ns2Concepts_common;

  var _pluginContext$inputC = pluginContext.inputComponents,
      AutocompleteInput = _pluginContext$inputC.AutocompleteInput,
      CompoundInput = _pluginContext$inputC.CompoundInput,
      HierarchyInput = _pluginContext$inputC.HierarchyInput,
      OptionPickerInput = _pluginContext$inputC.OptionPickerInput,
      TextInput = _pluginContext$inputC.TextInput,
      TermPickerInput = _pluginContext$inputC.TermPickerInput,
      CheckboxInput = _pluginContext$inputC.CheckboxInput;
  var config = pluginContext.configHelpers.configKey;
  var extensions = pluginContext.config.extensions;


  return {
    document: Object.assign((_Object$assign = {}, _defineProperty(_Object$assign, config, {
      view: {
        type: CompoundInput,
        props: {
          defaultChildSubpath: 'ns2:concepts_common'
        }
      }
    }), _defineProperty(_Object$assign, 'rel:relations-common-list', (_relRelationsCommon = {}, _defineProperty(_relRelationsCommon, config, {
      service: {
        ns: 'http://collectionspace.org/services/relation'
      }
    }), _defineProperty(_relRelationsCommon, 'relation-list-item', _defineProperty({}, config, {
      view: {
        type: HierarchyInput,
        props: {
          messages: (0, _reactIntl.defineMessages)({
            parent: {
              'id': 'hierarchyInput.concept.parent',
              'defaultMessage': 'Broader concept'
            },
            children: {
              'id': 'hierarchyInput.concept.children',
              'defaultMessage': 'Narrower concepts'
            },
            siblings: {
              'id': 'hierarchyInput.concept.siblings',
              'defaultMessage': 'Adjacent concepts'
            }
          })
        }
      }
    })), _relRelationsCommon)), _Object$assign), extensions.core.fields, {
      'ns2:concepts_common': (_ns2Concepts_common = {}, _defineProperty(_ns2Concepts_common, config, {
        service: {
          ns: 'http://collectionspace.org/services/concept'
        }
      }), _defineProperty(_ns2Concepts_common, 'csid', _defineProperty({}, config, {
        cloneable: false
      })), _defineProperty(_ns2Concepts_common, 'inAuthority', _defineProperty({}, config, {
        cloneable: false
      })), _defineProperty(_ns2Concepts_common, 'refName', _defineProperty({}, config, {
        cloneable: false
      })), _defineProperty(_ns2Concepts_common, 'shortIdentifier', _defineProperty({}, config, {
        cloneable: false
      })), _defineProperty(_ns2Concepts_common, 'conceptTermGroupList', (_conceptTermGroupList = {}, _defineProperty(_conceptTermGroupList, config, {
        messages: (0, _reactIntl.defineMessages)({
          required: {
            'id': 'field.concepts_common.conceptTermGroupList.required',
            'defaultMessage': 'At least one term display name is required. Please enter a value.'
          }
        }),
        required: true,
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_conceptTermGroupList, 'conceptTermGroup', (_conceptTermGroup = {}, _defineProperty(_conceptTermGroup, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.conceptTermGroup.name',
            'defaultMessage': 'Term'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_conceptTermGroup, 'termDisplayName', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termDisplayName.name',
            'defaultMessage': 'Display name'
          }
        }),
        required: true,
        view: {
          type: TextInput
        }
      })), _defineProperty(_conceptTermGroup, 'termName', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termName.name',
            'defaultMessage': 'Name'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_conceptTermGroup, 'termType', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termType.name',
            'defaultMessage': 'Type'
          }
        }),
        view: {
          type: OptionPickerInput,
          props: {
            source: 'conceptTermTypes'
          }
        }
      })), _defineProperty(_conceptTermGroup, 'termFlag', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termFlag.name',
            'defaultMessage': 'Flag'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'concepttermflag'
          }
        }
      })), _defineProperty(_conceptTermGroup, 'historicalStatus', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.historicalStatus.name',
            'defaultMessage': 'Historical status'
          }
        }),
        view: {
          type: OptionPickerInput,
          props: {
            source: 'conceptHistoricalStatuses'
          }
        }
      })), _defineProperty(_conceptTermGroup, 'termStatus', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termStatus.name',
            'defaultMessage': 'Status'
          }
        }),
        view: {
          type: OptionPickerInput,
          props: {
            source: 'conceptTermStatuses'
          }
        }
      })), _defineProperty(_conceptTermGroup, 'termQualifier', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termQualifier.name',
            'defaultMessage': 'Qualifier'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_conceptTermGroup, 'termLanguage', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termLanguage.name',
            'defaultMessage': 'Language'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'languages'
          }
        }
      })), _defineProperty(_conceptTermGroup, 'termPrefForLang', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termPrefForLang.name',
            'defaultMessage': 'Preferred for lang'
          }
        }),
        view: {
          type: CheckboxInput
        }
      })), _defineProperty(_conceptTermGroup, 'termSource', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termSource.name',
            'defaultMessage': 'Name'
          },
          fullName: {
            'id': 'field.concepts_common.termSource.fullName',
            'defaultMessage': 'Source name'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'citation/local,citation/shared,citation/worldcat'
          }
        }
      })), _defineProperty(_conceptTermGroup, 'termSourceDetail', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termSourceDetail.name',
            'defaultMessage': 'Detail'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_conceptTermGroup, 'termSourceID', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termSourceID.name',
            'defaultMessage': 'ID'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_conceptTermGroup, 'termSourceNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.termSourceNote.name',
            'defaultMessage': 'Note'
          }
        }),
        view: {
          type: TextInput
        }
      })), _conceptTermGroup)), _conceptTermGroupList)), _defineProperty(_ns2Concepts_common, 'conceptRecordTypes', (_conceptRecordTypes = {}, _defineProperty(_conceptRecordTypes, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_conceptRecordTypes, 'conceptRecordType', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.conceptRecordType.name',
            'defaultMessage': 'Concept type'
          }
        }),
        repeating: true,
        view: {
          type: TermPickerInput,
          props: {
            source: 'concepttype'
          }
        }
      })), _conceptRecordTypes)), _defineProperty(_ns2Concepts_common, 'scopeNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.scopeNote.name',
            'defaultMessage': 'Note'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Concepts_common, 'scopeNoteSource', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.scopeNoteSource.name',
            'defaultMessage': 'Source'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Concepts_common, 'scopeNoteSourceDetail', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.scopeNoteSourceDetail.name',
            'defaultMessage': 'Source detail'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Concepts_common, 'citationGroupList', (_citationGroupList = {}, _defineProperty(_citationGroupList, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_citationGroupList, 'citationGroup', (_citationGroup = {}, _defineProperty(_citationGroup, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.citationGroup.name',
            'defaultMessage': 'Citation'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_citationGroup, 'citationSource', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.citationSource.name',
            'defaultMessage': 'Citation'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationGroup, 'citationSourceDetail', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.citationSourceDetail.name',
            'defaultMessage': 'Source detail'
          }
        }),
        view: {
          type: TextInput
        }
      })), _citationGroup)), _citationGroupList)), _defineProperty(_ns2Concepts_common, 'additionalSourceGroupList', (_additionalSourceGrou2 = {}, _defineProperty(_additionalSourceGrou2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_additionalSourceGrou2, 'additionalSourceGroup', (_additionalSourceGrou = {}, _defineProperty(_additionalSourceGrou, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.additionalSourceGroup.name',
            'defaultMessage': 'Additional source'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_additionalSourceGrou, 'additionalSource', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.additionalSource.name',
            'defaultMessage': 'Name'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_additionalSourceGrou, 'additionalSourceDetail', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.additionalSourceDetail.name',
            'defaultMessage': 'Detail'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_additionalSourceGrou, 'additionalSourceUniqueID', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.additionalSourceUniqueID.name',
            'defaultMessage': 'ID'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_additionalSourceGrou, 'additionalSourceNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.concepts_common.additionalSourceNote.name',
            'defaultMessage': 'Note'
          }
        }),
        view: {
          type: TextInput
        }
      })), _additionalSourceGrou)), _additionalSourceGrou2)), _ns2Concepts_common)
    })
  };
};