"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getComponent = void 0;
var _constants = require("./constants");
var _Payment = require("../../Payment/Payment.constants");
var _components = require("../components");
const CARD = _Payment.METHOD.CARD,
  PCIPROXY = _Payment.METHOD.PCIPROXY,
  TPV = _Payment.METHOD.TPV;
const ADDON = _Payment.PROVIDER.ADDON,
  ADYEN = _Payment.PROVIDER.ADYEN,
  PAYCOMET = _Payment.PROVIDER.PAYCOMET;
const getComponent = function () {
  let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
    _ref$cardValidation = _ref.cardValidation,
    cardValidation = _ref$cardValidation === void 0 ? false : _ref$cardValidation,
    method = _ref.method,
    methodConfig = _ref.methodConfig,
    provider = _ref.provider;
  let component;
  const isValidPayment = method === TPV || [CARD, PCIPROXY].includes(method) && cardValidation;
  if (methodConfig && isValidPayment) component = _constants.MODALS[methodConfig.modal];else if (provider === ADDON && isValidPayment) component = _components.FormAddon;else if (provider === ADYEN && isValidPayment) component = _components.FormAdyen;else if (provider === PAYCOMET && isValidPayment) component = _components.FormPaycomet;
  return component;
};
exports.getComponent = getComponent;
//# sourceMappingURL=getComponent.js.map