"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactIntl = require("react-intl");
var _default = configContext => {
  const {
    CompoundInput,
    DateTimeInput,
    ObjectNameInput,
    OptionPickerInput,
    FieldTextInput,
    TextInput
  } = configContext.inputComponents;
  const {
    DATA_TYPE_DATETIME
  } = configContext.dataTypes;
  const {
    configKey: config
  } = configContext.configHelpers;
  return {
    'ns3:audit_common': {
      [config]: {
        service: {
          ns: 'http://collectionspace.org/services/audit'
        },
        view: {
          type: CompoundInput
        }
      },
      csid: {
        [config]: {
          messages: (0, _reactIntl.defineMessages)({
            name: {
              "id": "field.audit_common.csid.name",
              "defaultMessage": "Audit record identifier"
            }
          }),
          view: {
            type: TextInput,
            props: {
              readOnly: true
            }
          }
        }
      },
      idNumber: {
        [config]: {
          messages: (0, _reactIntl.defineMessages)({
            fullName: {
              "id": "field.audit_common.idNumber.fullName",
              "defaultMessage": "Audit record id"
            },
            name: {
              "id": "field.audit_common.idNumber.name",
              "defaultMessage": "Id"
            }
          }),
          view: {
            type: TextInput,
            props: {
              readOnly: true
            }
          }
        }
      },
      resourceType: {
        [config]: {
          messages: (0, _reactIntl.defineMessages)({
            fullName: {
              "id": "field.audit_common.resourceType.fullName",
              "defaultMessage": "Related record type"
            },
            name: {
              "id": "field.audit_common.resourceType.name",
              "defaultMessage": "Record type"
            }
          }),
          view: {
            type: ObjectNameInput,
            props: {
              readOnly: true
            }
          }
        }
      },
      resourceCSID: {
        [config]: {
          messages: (0, _reactIntl.defineMessages)({
            name: {
              "id": "field.audit_common.resourceCSID.name",
              "defaultMessage": "Audited record identifier"
            }
          }),
          view: {
            type: TextInput,
            props: {
              readOnly: true
            }
          }
        }
      },
      saveMessage: {
        [config]: {
          messages: (0, _reactIntl.defineMessages)({
            name: {
              "id": "field.audit_common.saveMessage.name",
              "defaultMessage": "Save message"
            }
          }),
          view: {
            type: TextInput,
            props: {
              readOnly: true
            }
          }
        }
      },
      eventComment: {
        [config]: {
          messages: {
            name: {
              id: 'field.audit_common.eventComment.name',
              defaultMessage: 'Event comment'
            }
          },
          view: {
            type: TextInput,
            props: {
              readOnly: true
            }
          }
        }
      },
      eventType: {
        [config]: {
          messages: (0, _reactIntl.defineMessages)({
            name: {
              "id": "field.audit_common.eventType.name",
              "defaultMessage": "Audit event type"
            }
          }),
          view: {
            type: OptionPickerInput,
            props: {
              source: 'eventTypes',
              readOnly: true
            }
          }
        }
      },
      principal: {
        [config]: {
          messages: (0, _reactIntl.defineMessages)({
            name: {
              "id": "field.audit_common.principal.name",
              "defaultMessage": "Updated by"
            }
          }),
          view: {
            type: TextInput,
            props: {
              readOnly: true
            }
          }
        }
      },
      eventDate: {
        [config]: {
          dataType: DATA_TYPE_DATETIME,
          messages: (0, _reactIntl.defineMessages)({
            name: {
              "id": "field.audit_common.eventDate.name",
              "defaultMessage": "Updated at"
            }
          }),
          view: {
            type: DateTimeInput,
            props: {
              readOnly: true
            }
          }
        }
      },
      fieldChangedGroupList: {
        [config]: {
          view: {
            type: CompoundInput
          }
        },
        fieldChangedGroup: {
          [config]: {
            repeating: true,
            view: {
              type: CompoundInput
            }
          },
          key: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  "id": "field.audit_common.key.name",
                  "defaultMessage": "Key"
                }
              }),
              view: {
                type: FieldTextInput,
                props: {
                  readOnly: true
                }
              }
            }
          },
          fieldName: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  "id": "field.audit_common.fieldName.name",
                  "defaultMessage": "Field"
                }
              }),
              view: {
                type: TextInput,
                props: {
                  readOnly: true
                }
              }
            }
          },
          originalValue: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  "id": "field.audit_common.originalValue.name",
                  "defaultMessage": "Original value"
                }
              }),
              view: {
                type: TextInput,
                props: {
                  multiline: true,
                  readOnly: true
                }
              }
            }
          },
          newValue: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  "id": "field.audit_common.newValue.name",
                  "defaultMessage": "New value"
                }
              }),
              view: {
                type: TextInput,
                props: {
                  multiline: true,
                  readOnly: true
                }
              }
            }
          },
          changeReason: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  "id": "field.audit_common.changeReason.name",
                  "defaultMessage": "Change reason"
                }
              }),
              view: {
                type: TextInput,
                props: {
                  readOnly: true
                }
              }
            }
          }
        }
      }
    }
  };
};
exports.default = _default;