"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _reactRouter = require("react-router");

var _reactIntl = require("react-intl");

var _reactHelmet = _interopRequireDefault(require("react-helmet"));

var _classnames = _interopRequireDefault(require("classnames"));

var _ProtectedRouteContainer = _interopRequireDefault(require("../../containers/routes/ProtectedRouteContainer"));

var _PublicRoute = _interopRequireDefault(require("../routes/PublicRoute"));

var _AdminPageContainer = _interopRequireDefault(require("../../containers/pages/AdminPageContainer"));

var _ConfigPage = _interopRequireDefault(require("./ConfigPage"));

var _ContentViewerPageContainer = _interopRequireDefault(require("../../containers/pages/ContentViewerPageContainer"));

var _CreatePageContainer = _interopRequireDefault(require("../../containers/pages/CreatePageContainer"));

var _DashboardPage = _interopRequireDefault(require("./DashboardPage"));

var _ToolPageContainer = _interopRequireDefault(require("../../containers/pages/ToolPageContainer"));

var _LoginPageContainer = _interopRequireDefault(require("../../containers/pages/LoginPageContainer"));

var _LogoutPageContainer = _interopRequireDefault(require("../../containers/pages/LogoutPageContainer"));

var _RecordPageContainer = _interopRequireDefault(require("../../containers/pages/RecordPageContainer"));

var _ReportViewerPageContainer = _interopRequireDefault(require("../../containers/pages/ReportViewerPageContainer"));

var _ResetPasswordPage = _interopRequireDefault(require("./ResetPasswordPage"));

var _SearchPageContainer = _interopRequireDefault(require("../../containers/pages/SearchPageContainer"));

var _SearchResultPageContainer = _interopRequireDefault(require("../../containers/pages/SearchResultPageContainer"));

var _NotificationBarContainer = _interopRequireDefault(require("../../containers/notification/NotificationBarContainer"));

var _RootPage = _interopRequireDefault(require("../../../styles/cspace-ui/RootPage.css"));

var _favicon = _interopRequireDefault(require("../../../images/favicon.png"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const messages = (0, _reactIntl.defineMessages)({
  title: {
    "id": "rootPage.title",
    "defaultMessage": "CollectionSpace"
  }
});
const propTypes = {
  className: _propTypes.default.string,
  intl: _reactIntl.intlShape
};

function RootPage(props) {
  const {
    className,
    intl
  } = props;
  const classes = (0, _classnames.default)(_RootPage.default.common, className);
  const title = intl.formatMessage(messages.title);
  return _react.default.createElement("div", {
    className: classes
  }, _react.default.createElement(_reactHelmet.default, {
    defaultTitle: title,
    titleTemplate: "%s | ".concat(title)
  }, _react.default.createElement("link", {
    rel: "shortcut icon",
    href: _favicon.default
  })), _react.default.createElement(_reactRouter.Switch, null, _react.default.createElement(_PublicRoute.default, {
    path: "/login",
    component: _LoginPageContainer.default
  }), _react.default.createElement(_PublicRoute.default, {
    path: "/logout",
    component: _LogoutPageContainer.default
  }), _react.default.createElement(_PublicRoute.default, {
    path: "/config",
    component: _ConfigPage.default
  }), _react.default.createElement(_PublicRoute.default, {
    path: "/resetpw",
    component: _ResetPasswordPage.default
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/dashboard",
    component: _DashboardPage.default
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/create",
    component: (0, _reactIntl.injectIntl)(_CreatePageContainer.default)
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/tool",
    component: _ToolPageContainer.default
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/admin",
    component: _AdminPageContainer.default
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/search/:recordType?/:vocabulary?",
    component: _SearchPageContainer.default
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/list/:recordType/:vocabulary/:csid/:subresource",
    component: _SearchResultPageContainer.default
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/list/:recordType/:csid/:subresource",
    component: _SearchResultPageContainer.default
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/list/:recordType/:vocabulary?",
    component: _SearchResultPageContainer.default
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/record/:recordType/:path1?/:path2?/:path3?",
    component: _RecordPageContainer.default
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/view/:contentPath+",
    component: _ContentViewerPageContainer.default,
    decorated: false
  }), _react.default.createElement(_ProtectedRouteContainer.default, {
    path: "/report/:reportCsid",
    component: _ReportViewerPageContainer.default,
    decorated: false
  })), _react.default.createElement(_NotificationBarContainer.default, null));
}

RootPage.propTypes = propTypes;

var _default = (0, _reactIntl.injectIntl)(RootPage);

exports.default = _default;