"use strict";

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

var _qs = _interopRequireDefault(require("qs"));

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

const VIEWER_WINDOW_NAME = undefined;
exports.VIEWER_WINDOW_NAME = VIEWER_WINDOW_NAME;

const getReportViewerPath = (config, reportCsid, invocationDescriptor, reportParams) => {
  const {
    basename
  } = config;
  const reportParamsJson = reportParams && JSON.stringify(reportParams);
  const queryParams = {
    mode: invocationDescriptor.get('mode'),
    csid: invocationDescriptor.get('csid'),
    outputMIME: invocationDescriptor.get('outputMIME'),
    recordType: invocationDescriptor.get('recordType'),
    params: reportParamsJson
  };
  return "".concat(basename || '', "/report/").concat(reportCsid, "?").concat(_qs.default.stringify(queryParams));
};

exports.getReportViewerPath = getReportViewerPath;