"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getUrlCriptan = void 0;
var _toUrlParams = require("./toUrlParams");
var _ButtonPayment = require("../ButtonPayment.constants");
const getUrlCriptan = _ref => {
  let criptanNumOrder = _ref.criptanNumOrder,
    environment = _ref.environment,
    id = _ref.id,
    locale = _ref.locale,
    tracking = _ref.tracking,
    _ref$urlParams = _ref.urlParams,
    _ref$urlParams2 = _ref$urlParams === void 0 ? {} : _ref$urlParams,
    _ref$urlParams2$hsri = _ref$urlParams2.hsri,
    hsri = _ref$urlParams2$hsri === void 0 ? _ButtonPayment.DEFAULT_HSRI : _ref$urlParams2$hsri,
    idchain = _ref$urlParams2.idchain,
    variant = _ref$urlParams2.variant;
  if (!criptanNumOrder || !id || !locale) return;
  return "".concat(process.env.SERVICE_BOOKING, "/").concat(_ButtonPayment.ENDPOINT.CRIPTAN).concat((0, _toUrlParams.toUrlParams)({
    idTokenProvider: id,
    env: environment,
    hsri,
    idchain,
    lang: locale.split('-')[0],
    numOrder: criptanNumOrder,
    variant,
    version: 2,
    tracking
  }));
};
exports.getUrlCriptan = getUrlCriptan;
//# sourceMappingURL=getUrlCriptan.js.map