"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactIntl = require("react-intl");
var _default = configContext => {
  const {
    AutocompleteInput,
    CompoundInput,
    HierarchyInput,
    DateInput,
    TextInput,
    TermPickerInput,
    CheckboxInput,
    StructuredDateInput
  } = configContext.inputComponents;
  const {
    configKey: config
  } = configContext.configHelpers;
  const {
    DATA_TYPE_BOOL,
    DATA_TYPE_DATE,
    DATA_TYPE_STRUCTURED_DATE
  } = configContext.dataTypes;
  const {
    extensions
  } = configContext.config;
  return {
    document: {
      [config]: {
        view: {
          type: CompoundInput,
          props: {
            defaultChildSubpath: 'ns2:chronologies_common'
          }
        }
      },
      'rel:relations-common-list': {
        [config]: {
          service: {
            ns: 'http://collectionspace.org/services/relation'
          }
        },
        'relation-list-item': {
          [config]: {
            view: {
              type: HierarchyInput,
              props: {
                messages: (0, _reactIntl.defineMessages)({
                  parent: {
                    "id": "hierarchyInput.chronology.parent",
                    "defaultMessage": "Broader chronology"
                  },
                  children: {
                    "id": "hierarchyInput.chronology.children",
                    "defaultMessage": "Narrower chronologies"
                  },
                  siblings: {
                    "id": "hierarchyInput.chronology.siblings",
                    "defaultMessage": "Adjacent chronologies"
                  }
                })
              }
            }
          }
        }
      },
      ...extensions.core.fields,
      'ns2:chronologies_common': {
        [config]: {
          service: {
            ns: 'http://collectionspace.org/services/chronology'
          }
        },
        ...extensions.authItem.fields,
        ...extensions.associatedAuthority.fields,
        chronologyTermGroupList: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              required: {
                "id": "field.chronologies_common.chronologyTermGroupList.required",
                "defaultMessage": "At least one term display name is required. Please enter a value."
              }
            }),
            required: true,
            view: {
              type: CompoundInput
            }
          },
          chronologyTermGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  "id": "field.chronologies_common.chronologyTermGroup.name",
                  "defaultMessage": "Term"
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput
              }
            },
            termDisplayName: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termDisplayName.fullName",
                    "defaultMessage": "Term display name"
                  },
                  name: {
                    "id": "field.chronologies_common.termDisplayName.name",
                    "defaultMessage": "Display name"
                  }
                }),
                required: true,
                view: {
                  type: TextInput
                }
              }
            },
            termName: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termName.fullName",
                    "defaultMessage": "Term name"
                  },
                  name: {
                    "id": "field.chronologies_common.termName.name",
                    "defaultMessage": "Name"
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            termType: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termType.fullName",
                    "defaultMessage": "Term type"
                  },
                  name: {
                    "id": "field.chronologies_common.termType.name",
                    "defaultMessage": "Type"
                  }
                }),
                view: {
                  type: TermPickerInput,
                  props: {
                    source: 'chronologytermtype'
                  }
                }
              }
            },
            termFlag: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termFlag.fullName",
                    "defaultMessage": "Term flag"
                  },
                  name: {
                    "id": "field.chronologies_common.termFlag.name",
                    "defaultMessage": "Flag"
                  }
                }),
                view: {
                  type: TermPickerInput,
                  props: {
                    source: 'chronologytermflag'
                  }
                }
              }
            },
            termStatus: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termStatus.fullName",
                    "defaultMessage": "Term status"
                  },
                  name: {
                    "id": "field.chronologies_common.termStatus.name",
                    "defaultMessage": "Status"
                  }
                }),
                view: {
                  type: TermPickerInput,
                  props: {
                    source: 'chronologytermstatus'
                  }
                }
              }
            },
            historicalStatus: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.historicalStatus.fullName",
                    "defaultMessage": "Term historical status"
                  },
                  name: {
                    "id": "field.chronologies_common.historicalStatus.name",
                    "defaultMessage": "Historical status"
                  }
                }),
                view: {
                  type: TermPickerInput,
                  props: {
                    source: 'chronologyhistoricalstatus'
                  }
                }
              }
            },
            termQualifier: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termQualifier.fullName",
                    "defaultMessage": "Term qualifier"
                  },
                  name: {
                    "id": "field.chronologies_common.termQualifier.name",
                    "defaultMessage": "Qualifier"
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            termLanguage: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termLanguage.fullName",
                    "defaultMessage": "Term language"
                  },
                  name: {
                    "id": "field.chronologies_common.termLanguage.name",
                    "defaultMessage": "Language"
                  }
                }),
                view: {
                  type: TermPickerInput,
                  props: {
                    source: 'languages'
                  }
                }
              }
            },
            termPrefForLang: {
              [config]: {
                dataType: DATA_TYPE_BOOL,
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termPrefForLang.fullName",
                    "defaultMessage": "Term preferred for lang"
                  },
                  name: {
                    "id": "field.chronologies_common.termPrefForLang.name",
                    "defaultMessage": "Preferred for lang"
                  }
                }),
                view: {
                  type: CheckboxInput
                }
              }
            },
            termSource: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termSource.fullName",
                    "defaultMessage": "Term source name"
                  },
                  groupName: {
                    "id": "field.chronologies_common.termSource.groupName",
                    "defaultMessage": "Source name"
                  },
                  name: {
                    "id": "field.chronologies_common.termSource.name",
                    "defaultMessage": "Name"
                  }
                }),
                view: {
                  type: AutocompleteInput,
                  props: {
                    source: 'citation/local,citation/shared,citation/worldcat'
                  }
                }
              }
            },
            termSourceDetail: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termSourceDetail.fullName",
                    "defaultMessage": "Term source detail"
                  },
                  groupName: {
                    "id": "field.chronologies_common.termSourceDetail.groupName",
                    "defaultMessage": "Source detail"
                  },
                  name: {
                    "id": "field.chronologies_common.termSourceDetail.name",
                    "defaultMessage": "Detail"
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            termSourceID: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termSourceID.fullName",
                    "defaultMessage": "Term source ID"
                  },
                  groupName: {
                    "id": "field.chronologies_common.termSourceID.groupName",
                    "defaultMessage": "Source ID"
                  },
                  name: {
                    "id": "field.chronologies_common.termSourceID.name",
                    "defaultMessage": "ID"
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            termSourceNote: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.termSourceNote.fullName",
                    "defaultMessage": "Term source note"
                  },
                  groupName: {
                    "id": "field.chronologies_common.termSourceNote.groupName",
                    "defaultMessage": "Source note"
                  },
                  name: {
                    "id": "field.chronologies_common.termSourceNote.name",
                    "defaultMessage": "Note"
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            }
          }
        },
        chronologyDateStructuredDateGroup: {
          [config]: {
            dataType: DATA_TYPE_STRUCTURED_DATE,
            messages: (0, _reactIntl.defineMessages)({
              name: {
                "id": "field.chronologies_common.chronologyDateStructuredDateGroup.name",
                "defaultMessage": "Primary date range"
              }
            }),
            view: {
              type: StructuredDateInput
            }
          },
          ...extensions.structuredDate.fields
        },
        chronologyPlaces: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          chronologyPlace: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  "id": "field.chronologies_common.chronologyPlaces.name",
                  "defaultMessage": "Spatial coverage"
                }
              }),
              repeating: true,
              view: {
                type: AutocompleteInput,
                props: {
                  source: 'place/local,place/tgn'
                }
              }
            }
          }
        },
        chronologyType: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                "id": "field.chronologies_common.chronologyType.name",
                "defaultMessage": "Chronology type"
              }
            }),
            view: {
              type: TermPickerInput,
              props: {
                source: 'chronologytypes'
              }
            }
          }
        },
        chronologyNote: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                "id": "field.chronologies_common.chronologyNote.name",
                "defaultMessage": "Chronology note"
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        chronologyDescription: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                "id": "field.chronologies_common.chronologyDescription.name",
                "defaultMessage": "Chronology description"
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        identifierGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          identifierGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  "id": "field.chronologies_common.identifierGroup.name",
                  "defaultMessage": "Resource identifier"
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput,
                props: {
                  tabular: true
                }
              }
            },
            identifierValue: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.identifierValue.fullName",
                    "defaultMessage": "Resource identifier value"
                  },
                  name: {
                    "id": "field.chronologies_common.identifierValue.name",
                    "defaultMessage": "Value"
                  }
                }),
                view: {
                  type: TextInput
                }
              }
            },
            identifierCitation: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.identifierCitation.fullName",
                    "defaultMessage": "Resource identifier citation"
                  },
                  name: {
                    "id": "field.chronologies_common.identifierCitation.name",
                    "defaultMessage": "Citation"
                  }
                }),
                view: {
                  type: AutocompleteInput,
                  props: {
                    source: 'citation/local,citation/worldcat'
                  }
                }
              }
            },
            identifierDate: {
              [config]: {
                dataType: DATA_TYPE_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.identifierDate.fullName",
                    "defaultMessage": "Resource identifier date"
                  },
                  name: {
                    "id": "field.chronologies_common.identifierDate.name",
                    "defaultMessage": "Date"
                  }
                }),
                view: {
                  type: DateInput
                }
              }
            }
          }
        },
        otherDateGroupList: {
          [config]: {
            view: {
              type: CompoundInput
            }
          },
          otherDateGroup: {
            [config]: {
              messages: (0, _reactIntl.defineMessages)({
                name: {
                  "id": "field.chronologies_common.otherDateGroup.name",
                  "defaultMessage": "Alternative date"
                }
              }),
              repeating: true,
              view: {
                type: CompoundInput
              }
            },
            otherDateStructuredDateGroup: {
              [config]: {
                dataType: DATA_TYPE_STRUCTURED_DATE,
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.otherDateStructuredDateGroup.fullName",
                    "defaultMessage": "Alternative date range"
                  },
                  name: {
                    "id": "field.chronologies_common.otherDateStructuredDateGroup.name",
                    "defaultMessage": "Range"
                  }
                }),
                view: {
                  type: StructuredDateInput
                }
              },
              ...extensions.structuredDate.fields
            },
            otherDatePlaces: {
              [config]: {
                view: {
                  type: CompoundInput
                }
              },
              otherDatePlace: {
                [config]: {
                  messages: (0, _reactIntl.defineMessages)({
                    fullName: {
                      "id": "field.chronologies_common.otherDatePlace.fullName",
                      "defaultMessage": "Alternative date spacial coverage"
                    },
                    name: {
                      "id": "field.chronologies_common.otherDatePlace.name",
                      "defaultMessage": "Spatial coverage"
                    }
                  }),
                  repeating: true,
                  view: {
                    type: AutocompleteInput,
                    props: {
                      source: 'place/local,place/tgn'
                    }
                  }
                }
              }
            },
            otherDateCitations: {
              [config]: {
                view: {
                  type: CompoundInput
                }
              },
              otherDateCitation: {
                [config]: {
                  messages: (0, _reactIntl.defineMessages)({
                    fullName: {
                      "id": "field.chronologies_common.otherDateCitation.fullName",
                      "defaultMessage": "Alternative date citation"
                    },
                    name: {
                      "id": "field.chronologies_common.otherDateCitation.name",
                      "defaultMessage": "Citation"
                    }
                  }),
                  repeating: true,
                  view: {
                    type: AutocompleteInput,
                    props: {
                      source: 'citation/local,citation/worldcat'
                    }
                  }
                }
              }
            },
            otherDateNote: {
              [config]: {
                messages: (0, _reactIntl.defineMessages)({
                  fullName: {
                    "id": "field.chronologies_common.otherDateNote.fullName",
                    "defaultMessage": "Alternative date note"
                  },
                  name: {
                    "id": "field.chronologies_common.otherDateNote.name",
                    "defaultMessage": "Note"
                  }
                }),
                view: {
                  type: TextInput,
                  props: {
                    multiline: true
                  }
                }
              }
            }
          }
        }
      }
    }
  };
};
exports.default = _default;