'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 _ns2Media_common, _document;

  var _pluginContext$inputC = pluginContext.inputComponents,
      CompoundInput = _pluginContext$inputC.CompoundInput,
      IDGeneratorInput = _pluginContext$inputC.IDGeneratorInput,
      TextInput = _pluginContext$inputC.TextInput;
  var config = pluginContext.configHelpers.configKey;


  return {
    document: (_document = {}, _defineProperty(_document, config, {
      view: {
        type: CompoundInput,
        props: {
          defaultChildSubpath: 'ns2:media_common'
        }
      }
    }), _defineProperty(_document, 'ns2:media_common', (_ns2Media_common = {}, _defineProperty(_ns2Media_common, config, {
      service: {
        ns: 'http://collectionspace.org/services/media'
      }
    }), _defineProperty(_ns2Media_common, 'identificationNumber', _defineProperty({}, config, {
      cloneable: false,
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.media_common.identificationNumber.name',
          'defaultMessage': 'Identification number'
        }
      }),
      required: true,
      searchView: {
        type: TextInput
      },
      view: {
        type: IDGeneratorInput,
        props: {
          idGeneratorName: 'media'
        }
      }
    })), _ns2Media_common)), _document)
  };
};