'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 _acquisitionDateGroup2, _acquisitionSources, _owners, _acquisitionFunding, _acquisitionFundingLi, _fieldCollectionEvent2, _ns2Acquisitions_com;

  var _pluginContext$inputC = pluginContext.inputComponents,
      AutocompleteInput = _pluginContext$inputC.AutocompleteInput,
      CompoundInput = _pluginContext$inputC.CompoundInput,
      DateInput = _pluginContext$inputC.DateInput,
      IDGeneratorInput = _pluginContext$inputC.IDGeneratorInput,
      OptionPickerInput = _pluginContext$inputC.OptionPickerInput,
      StructuredDateInput = _pluginContext$inputC.StructuredDateInput,
      TermPickerInput = _pluginContext$inputC.TermPickerInput,
      TextInput = _pluginContext$inputC.TextInput;
  var config = pluginContext.configHelpers.configKey;
  var _pluginContext$dataTy = pluginContext.dataTypes,
      DATA_TYPE_DATE = _pluginContext$dataTy.DATA_TYPE_DATE,
      DATA_TYPE_FLOAT = _pluginContext$dataTy.DATA_TYPE_FLOAT;
  var extensions = pluginContext.config.extensions;


  return {
    document: Object.assign(_defineProperty({}, config, {
      view: {
        type: CompoundInput,
        props: {
          defaultChildSubpath: 'ns2:acquisitions_common'
        }
      }
    }), extensions.core.fields, {
      'ns2:acquisitions_common': (_ns2Acquisitions_com = {}, _defineProperty(_ns2Acquisitions_com, config, {
        service: {
          ns: 'http://collectionspace.org/services/acquisition'
        }
      }), _defineProperty(_ns2Acquisitions_com, 'acquisitionReferenceNumber', _defineProperty({}, config, {
        cloneable: false,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionReferenceNumber.name',
            'defaultMessage': 'Reference number'
          }
        }),
        required: true,
        searchView: {
          type: TextInput
        },
        view: {
          type: IDGeneratorInput,
          props: {
            idGeneratorName: 'accession,archives,library'
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'accessionDateGroup', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.accessionDateGroup.name',
            'defaultMessage': 'Accession date'
          }
        }),
        view: {
          type: StructuredDateInput
        }
      })), _defineProperty(_ns2Acquisitions_com, 'acquisitionAuthorizer', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionAuthorizer.name',
            'defaultMessage': 'Authorizer'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local'
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'acquisitionAuthorizerDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionAuthorizerDate.name',
            'defaultMessage': 'Date'
          },
          fullName: {
            'id': 'field.acquisitions_common.acquisitionAuthorizerDate.fullName',
            'defaultMessage': 'Authorization date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Acquisitions_com, 'acquisitionDateGroupList', (_acquisitionDateGroup2 = {}, _defineProperty(_acquisitionDateGroup2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_acquisitionDateGroup2, 'acquisitionDateGroup', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionDateGroup.name',
            'defaultMessage': 'Acquisition date'
          }
        }),
        repeating: true,
        view: {
          type: StructuredDateInput
        }
      })), _acquisitionDateGroup2)), _defineProperty(_ns2Acquisitions_com, 'acquisitionMethod', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionMethod.name',
            'defaultMessage': 'Acquisition method'
          }
        }),
        view: {
          type: OptionPickerInput,
          props: {
            source: 'acquisitionMethods'
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'acquisitionSources', (_acquisitionSources = {}, _defineProperty(_acquisitionSources, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_acquisitionSources, 'acquisitionSource', _defineProperty({}, config, {
        repeating: true,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionSource.name',
            'defaultMessage': 'Acquisition source'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _acquisitionSources)), _defineProperty(_ns2Acquisitions_com, 'owners', (_owners = {}, _defineProperty(_owners, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_owners, 'owner', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.owner.name',
            'defaultMessage': 'Owner'
          }
        }),
        repeating: true,
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _owners)), _defineProperty(_ns2Acquisitions_com, 'transferOfTitleNumber', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.transferOfTitleNumber.name',
            'defaultMessage': 'Transfer of title number'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Acquisitions_com, 'creditLine', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.creditLine.name',
            'defaultMessage': 'Credit line'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Acquisitions_com, 'groupPurchasePriceCurrency', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.groupPurchasePriceCurrency.name',
            'defaultMessage': 'Currency'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'currency'
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'groupPurchasePriceValue', _defineProperty({}, config, {
        dataType: DATA_TYPE_FLOAT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.groupPurchasePriceValue.name',
            'defaultMessage': 'Value'
          },
          fullName: {
            'id': 'field.acquisitions_common.groupPurchasePriceValue.fullName',
            'defaultMessage': 'Group purchase price value'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Acquisitions_com, 'objectOfferPriceCurrency', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.objectOfferPriceCurrency.name',
            'defaultMessage': 'Currency'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'currency'
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'objectOfferPriceValue', _defineProperty({}, config, {
        dataType: DATA_TYPE_FLOAT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.objectOfferPriceValue.name',
            'defaultMessage': 'Value'
          },
          fullName: {
            'id': 'field.acquisitions_common.objectOfferPriceValue.fullName',
            'defaultMessage': 'Object offer price value'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Acquisitions_com, 'objectPurchaseOfferPriceCurrency', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.objectPurchaseOfferPriceCurrency.name',
            'defaultMessage': 'Currency'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'currency'
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'objectPurchaseOfferPriceValue', _defineProperty({}, config, {
        dataType: DATA_TYPE_FLOAT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.objectPurchaseOfferPriceValue.name',
            'defaultMessage': 'Value'
          },
          fullName: {
            'id': 'field.acquisitions_common.objectPurchaseOfferPriceValue.fullName',
            'defaultMessage': 'Object purchaser offer price value'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Acquisitions_com, 'objectPurchasePriceCurrency', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.objectPurchasePriceCurrency.name',
            'defaultMessage': 'Currency'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'currency'
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'objectPurchasePriceValue', _defineProperty({}, config, {
        dataType: DATA_TYPE_FLOAT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.objectPurchasePriceValue.name',
            'defaultMessage': 'Value'
          },
          fullName: {
            'id': 'field.acquisitions_common.objectPurchasePriceValue.fullName',
            'defaultMessage': 'Object purchase price value'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Acquisitions_com, 'originalObjectPurchasePriceCurrency', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.originalObjectPurchasePriceCurrency.name',
            'defaultMessage': 'Currency'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'currency'
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'originalObjectPurchasePriceValue', _defineProperty({}, config, {
        dataType: DATA_TYPE_FLOAT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.originalObjectPurchasePriceValue.name',
            'defaultMessage': 'Value'
          },
          fullName: {
            'id': 'field.acquisitions_common.originalObjectPurchasePriceValue.fullName',
            'defaultMessage': 'Original object purchase price value'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Acquisitions_com, 'acquisitionReason', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionReason.name',
            'defaultMessage': 'Acquisition reason'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'acquisitionNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionNote.name',
            'defaultMessage': 'Note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'acquisitionProvisos', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionProvisos.name',
            'defaultMessage': 'Provisos'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Acquisitions_com, 'acquisitionFundingList', (_acquisitionFundingLi = {}, _defineProperty(_acquisitionFundingLi, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_acquisitionFundingLi, 'acquisitionFunding', (_acquisitionFunding = {}, _defineProperty(_acquisitionFunding, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionFunding.name',
            'defaultMessage': 'Funding'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_acquisitionFunding, 'acquisitionFundingCurrency', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionFundingCurrency.name',
            'defaultMessage': 'Currency'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'currency'
          }
        }
      })), _defineProperty(_acquisitionFunding, 'acquisitionFundingValue', _defineProperty({}, config, {
        dataType: DATA_TYPE_FLOAT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionFundingValue.name',
            'defaultMessage': 'Value'
          },
          fullName: {
            'id': 'field.acquisitions_common.acquisitionFundingValue.fullName',
            'defaultMessage': 'Funding value'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_acquisitionFunding, 'acquisitionFundingSource', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.acquisitionFundingSource.name',
            'defaultMessage': 'Funding source'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _defineProperty(_acquisitionFunding, 'acquisitionFundingSourceProvisos', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquistions_common.acquisitionFundingSourceProvisos.name',
            'defaultMessage': 'Source provisos'
          }
        }),
        view: {
          type: TextInput
        }
      })), _acquisitionFunding)), _acquisitionFundingLi)), _defineProperty(_ns2Acquisitions_com, 'fieldCollectionEventNames', (_fieldCollectionEvent2 = {}, _defineProperty(_fieldCollectionEvent2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_fieldCollectionEvent2, 'fieldCollectionEventName', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.acquisitions_common.fieldCollectionEventName.name',
            'defaultMessage': 'Field collection event name'
          }
        }),
        repeating: true,
        view: {
          type: TextInput
        }
      })), _fieldCollectionEvent2)), _ns2Acquisitions_com)
    })
  };
};