'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 _entryMethods, _fieldCollectionMetho2, _fieldCollectionSourc2, _fieldCollectors, _fieldCollectionEvent2, _insurers, _currentLocationGroup, _currentLocationGroup2, _conditionCheckMethod2, _conditionCheckReason2, _conditionCheckersOrA, _ns2Intakes_common;

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


  return {
    document: Object.assign(_defineProperty({}, config, {
      view: {
        type: CompoundInput,
        props: {
          defaultChildSubpath: 'ns2:intakes_common'
        }
      }
    }), extensions.core.fields, {
      'ns2:intakes_common': (_ns2Intakes_common = {}, _defineProperty(_ns2Intakes_common, config, {
        service: {
          ns: 'http://collectionspace.org/services/intake'
        }
      }), _defineProperty(_ns2Intakes_common, 'entryNumber', _defineProperty({}, config, {
        cloneable: false,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.entryNumber.name',
            'defaultMessage': 'Entry number'
          }
        }),
        required: true,
        searchView: {
          type: TextInput
        },
        view: {
          type: IDGeneratorInput,
          props: {
            idGeneratorName: 'intake,study,evaluation'
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'entryDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.entryDate.name',
            'defaultMessage': 'Entry date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Intakes_common, 'entryReason', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.entryReason.name',
            'defaultMessage': 'Entry reason'
          }
        }),
        view: {
          type: OptionPickerInput,
          props: {
            source: 'entryReasons'
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'entryMethods', (_entryMethods = {}, _defineProperty(_entryMethods, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_entryMethods, 'entryMethod', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.entryMethod.name',
            'defaultMessage': 'Entry method'
          }
        }),
        repeating: true,
        view: {
          type: TermPickerInput,
          props: {
            source: 'entrymethod'
          }
        }
      })), _entryMethods)), _defineProperty(_ns2Intakes_common, 'returnDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.returnDate.name',
            'defaultMessage': 'Return date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Intakes_common, 'currentOwner', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.currentOwner.name',
            'defaultMessage': 'Current owner'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'depositor', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.depositor.name',
            'defaultMessage': 'Name'
          },
          fullName: {
            'id': 'field.intakes_common.depositor.fullName',
            'defaultMessage': 'Depositor name'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'depositorsRequirements', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.despositorsRequirements.name',
            'defaultMessage': 'Requirements'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Intakes_common, 'entryNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.entryNote.name',
            'defaultMessage': 'Entry note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'packingNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.packingNote.name',
            'defaultMessage': 'Packing note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'fieldCollectionDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.fieldCollectionDate.name',
            'defaultMessage': 'Field collection date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Intakes_common, 'fieldCollectionMethods', (_fieldCollectionMetho2 = {}, _defineProperty(_fieldCollectionMetho2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_fieldCollectionMetho2, 'fieldCollectionMethod', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.fieldCollectionMethod.name',
            'defaultMessage': 'Field collection method'
          }
        }),
        repeating: true,
        view: {
          type: TermPickerInput,
          props: {
            source: 'collectionmethod'
          }
        }
      })), _fieldCollectionMetho2)), _defineProperty(_ns2Intakes_common, 'fieldCollectionNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.fieldCollectionNote.name',
            'defaultMessage': 'Field collection note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'fieldCollectionNumber', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.fieldCollectionNumber.name',
            'defaultMessage': 'Field collection number'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Intakes_common, 'fieldCollectionPlace', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.fieldCollectionPlace.name',
            'defaultMessage': 'Field collection place'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Intakes_common, 'fieldCollectionSources', (_fieldCollectionSourc2 = {}, _defineProperty(_fieldCollectionSourc2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_fieldCollectionSourc2, 'fieldCollectionSource', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.fieldCollectionSource.name',
            'defaultMessage': 'Field collection source'
          }
        }),
        repeating: true,
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared'
          }
        }
      })), _fieldCollectionSourc2)), _defineProperty(_ns2Intakes_common, 'fieldCollectors', (_fieldCollectors = {}, _defineProperty(_fieldCollectors, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_fieldCollectors, 'fieldCollector', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.fieldCollector.name',
            'defaultMessage': 'Field collector'
          }
        }),
        repeating: true,
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _fieldCollectors)), _defineProperty(_ns2Intakes_common, 'fieldCollectionEventNames', (_fieldCollectionEvent2 = {}, _defineProperty(_fieldCollectionEvent2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_fieldCollectionEvent2, 'fieldCollectionEventName', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.fieldCollectionEventName.name',
            'defaultMessage': 'Field collection event name'
          }
        }),
        repeating: true,
        view: {
          type: TextInput
        }
      })), _fieldCollectionEvent2)), _defineProperty(_ns2Intakes_common, 'valuer', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.valuer.name',
            'defaultMessage': 'Valuer'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'valuationReferenceNumber', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.valuationReferenceNumber.name',
            'defaultMessage': 'Reference number'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Intakes_common, 'insurers', (_insurers = {}, _defineProperty(_insurers, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_insurers, 'insurer', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.insurer.name',
            'defaultMessage': 'Insurer'
          }
        }),
        repeating: true,
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _insurers)), _defineProperty(_ns2Intakes_common, 'insurancePolicyNumber', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.insurancePolicyNumber.name',
            'defaultMessage': 'Policy number'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Intakes_common, 'insuranceRenewalDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.insuranceRenewalDate.name',
            'defaultMessage': 'Renewal date'
          },
          fullName: {
            'id': 'field.intakes_common.insuranceRenewalDate.fullName',
            'defaultMessage': 'Insurance renewal date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Intakes_common, 'insuranceReferenceNumber', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.insuranceReferenceNumber.name',
            'defaultMessage': 'Reference number'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Intakes_common, 'insuranceNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.insuranceNote.name',
            'defaultMessage': 'Insurance note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'currentLocationGroupList', (_currentLocationGroup2 = {}, _defineProperty(_currentLocationGroup2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_currentLocationGroup2, 'currentLocationGroup', (_currentLocationGroup = {}, _defineProperty(_currentLocationGroup, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.currentLocationGroup.name',
            'defaultMessage': 'Current location'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_currentLocationGroup, 'currentLocation', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.currentLocation.name',
            'defaultMessage': 'Location'
          },
          fullName: {
            'id': 'field.intakes_common.currentLocation.fullName',
            'defaultMessage': 'Current location'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'location/local'
          }
        }
      })), _defineProperty(_currentLocationGroup, 'currentLocationFitness', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.currentLocationFitness.name',
            'defaultMessage': 'Fitness'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'conditionfitness'
          }
        }
      })), _defineProperty(_currentLocationGroup, 'currentLocationNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.currentLocationNote.name',
            'defaultMessage': 'Note'
          }
        }),
        view: {
          type: TextInput
        }
      })), _currentLocationGroup)), _currentLocationGroup2)), _defineProperty(_ns2Intakes_common, 'locationDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.locationDate.name',
            'defaultMessage': 'Location date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Intakes_common, 'normalLocation', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.normalLocation.name',
            'defaultMessage': 'Normal location'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'location/local'
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'conditionCheckMethods', (_conditionCheckMethod2 = {}, _defineProperty(_conditionCheckMethod2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_conditionCheckMethod2, 'conditionCheckMethod', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.conditionCheckMethod.name',
            'defaultMessage': 'Condition check method'
          }
        }),
        repeating: true,
        view: {
          type: TermPickerInput,
          props: {
            source: 'conditioncheckmethod'
          }
        }
      })), _conditionCheckMethod2)), _defineProperty(_ns2Intakes_common, 'conditionCheckReasons', (_conditionCheckReason2 = {}, _defineProperty(_conditionCheckReason2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_conditionCheckReason2, 'conditionCheckReason', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.conditionCheckReason.name',
            'defaultMessage': 'Condition check reason'
          }
        }),
        repeating: true,
        view: {
          type: TermPickerInput,
          props: {
            source: 'conditioncheckreason'
          }
        }
      })), _conditionCheckReason2)), _defineProperty(_ns2Intakes_common, 'conditionCheckersOrAssessors', (_conditionCheckersOrA = {}, _defineProperty(_conditionCheckersOrA, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_conditionCheckersOrA, 'conditionCheckerOrAssessor', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.conditionCheckerOrAssessor.name',
            'defaultMessage': 'Condition check assessor'
          }
        }),
        repeating: true,
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _conditionCheckersOrA)), _defineProperty(_ns2Intakes_common, 'conditionCheckNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.conditionCheckNote.name',
            'defaultMessage': 'Condition check note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Intakes_common, 'conditionCheckDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.conditionCheckDate.name',
            'defaultMessage': 'Condition check date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Intakes_common, 'conditionCheckReferenceNumber', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.intakes_common.conditionCheckReferenceNumber.name',
            'defaultMessage': 'Condition check reference number'
          }
        }),
        view: {
          type: TextInput
        }
      })), _ns2Intakes_common)
    })
  };
};