"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getButtonPaymentKey = void 0;
var _locale = require("@mirai/locale");
var _getButtonPaymentKey = require("./getButtonPaymentKey.l10n");
var _helpers = require("../../helpers");
const {
  BIZUM,
  CARD,
  TPV
} = _helpers.PAYMENT_METHOD;
const {
  ACTION_BOOK_NOW,
  ACTION_FINAL_DETAILS,
  ACTION_PAY_NOW
} = _getButtonPaymentKey.L10N;
const getButtonPaymentKey = function () {
  let {
    cardValidation,
    date,
    method,
    provider
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return [BIZUM, TPV].includes(method) ? date && (0, _locale.dateDiff)((0, _locale.UTC)(new Date()), (0, _locale.parseDate)(date)).days > 0 ? ACTION_BOOK_NOW : ACTION_PAY_NOW : cardValidation && method === CARD && provider === _helpers.PAYMENT_PROVIDER.ADDON ? ACTION_FINAL_DETAILS : ACTION_BOOK_NOW;
};
exports.getButtonPaymentKey = getButtonPaymentKey;
//# sourceMappingURL=getButtonPaymentKey.js.map