"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountRouter = void 0;
const hooks_1 = require("../../hooks/index.js");
const react_1 = __importDefault(require("react"));
const react_router_dom_1 = require("react-router-dom");
const AccountHomePage_1 = require("./AccountHome/AccountHomePage");
const AccountOutlet_1 = require("./AccountOutlet");
const AccountDetailsCardsPage_1 = require("./Details/AccountDetailsCardsPage");
const AccountDetailsProfilePage_1 = require("./Details/AccountDetailsProfilePage");
const AccountHelpPage_1 = require("./Help/AccountHelpPage");
const AccountReservationSinglePage_1 = require("./Reservations/AccountReservationSinglePage");
const AccountReservationsPage_1 = require("./Reservations/AccountReservationsPage");
const AccountRoutes_1 = require("./AccountRoutes");
const AccountChangePasswordPage_1 = require("./ChangePassword/AccountChangePasswordPage");
const AccountRouter = () => {
    /*
     * We need to use relative paths for the router, but paths defined in AccountRoutes are used elsewhere for links,
     * so we're just going to transform them to relative paths in this router.
     */
    const getRelativePath = (path) => path.replace('/account', '');
    const { isMemberPaymentInformationAvailable } = (0, hooks_1.useCurrentHotel)();
    return (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement(AccountOutlet_1.AccountOutlet, null,
            react_1.default.createElement(react_router_dom_1.Routes, null,
                react_1.default.createElement(react_router_dom_1.Route, { path: getRelativePath(AccountRoutes_1.AccountRoutes.Home.path), element: react_1.default.createElement(AccountHomePage_1.AccountHomePage, null) }),
                react_1.default.createElement(react_router_dom_1.Route, { path: getRelativePath(AccountRoutes_1.AccountRoutes.Reservations.matchPath), element: react_1.default.createElement(AccountReservationsPage_1.AccountReservationPage, null) }),
                react_1.default.createElement(react_router_dom_1.Route, { path: getRelativePath(AccountRoutes_1.AccountRoutes.SingleReservation.matchPath), element: react_1.default.createElement(AccountReservationSinglePage_1.AccountReservationSinglePage, null) }),
                react_1.default.createElement(react_router_dom_1.Route, { path: getRelativePath(AccountRoutes_1.AccountRoutes.ProfileDetails.path), element: react_1.default.createElement(AccountDetailsProfilePage_1.AccountDetailsProfilePage, null) }),
                react_1.default.createElement(react_router_dom_1.Route, { path: getRelativePath(AccountRoutes_1.AccountRoutes.ChangePassword.path), element: react_1.default.createElement(AccountChangePasswordPage_1.AccountChangePasswordPage, null) }),
                isMemberPaymentInformationAvailable && react_1.default.createElement(react_router_dom_1.Route, { path: getRelativePath(AccountRoutes_1.AccountRoutes.CardDetails.path), element: react_1.default.createElement(AccountDetailsCardsPage_1.AccountDetailsCardsPage, null) }),
                react_1.default.createElement(react_router_dom_1.Route, { path: getRelativePath(AccountRoutes_1.AccountRoutes.Help.path), element: react_1.default.createElement(AccountHelpPage_1.AccountHelpPage, null) })))));
};
exports.AccountRouter = AccountRouter;
//# sourceMappingURL=AccountRouter.js.map