'use strict';

var express = require('express');
var controller = require('./controller.js');
var routes = require('./request-download/routes.js');

/* eslint-disable no-param-reassign */
function Routes({ layoutPath, services }) {
    const router = express.Router({ mergeParams: true });
    const controller$1 = new controller.DownloadReportController(layoutPath, services);
    // Download report
    router.post(['/:reportId/:id/tableId/:tableId', '/:reportId/:id'], controller$1.POST);
    // Request download form routes
    router.use([`/request-download/:reportId/:variantId/tableId/:tableId`, `/request-download/:reportId/:variantId`], routes.default({ layoutPath, services }));
    return router;
}
const DownloadReportRoutes = ({ services, path, layoutPath, }) => {
    const router = express.Router({ mergeParams: true });
    if (services.downloadPermissionService.enabled) {
        router.use(path, Routes({ services, layoutPath }));
    }
    return router;
};

exports.DownloadReportRoutes = DownloadReportRoutes;
exports.Routes = Routes;
//# sourceMappingURL=routes.js.map
