"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const hooks_1 = require("../../../../hooks/index.js");
const classnames_1 = __importDefault(require("classnames"));
const react_1 = __importDefault(require("react"));
const HotelDTO_1 = require("../../../../models/Api/HotelDTO");
const RoomstayThemeEngine_1 = __importDefault(require("../../../../providers/RoomstayThemeEngine"));
const AcceptablePaymentCard = ({ isCurrent, isDefault, style }) => {
    var _a;
    const { hotel } = (0, hooks_1.useCurrentHotel)();
    const cardTypes = ((_a = hotel === null || hotel === void 0 ? void 0 : hotel.paymentCardTypes) !== null && _a !== void 0 ? _a : [])
        .map((card) => {
        const mapping = HotelDTO_1.SynxisToVGSCardNameMapping[card];
        if (!mapping) {
            return null;
        }
        return {
            name: HotelDTO_1.SynxisToVGSCardNameMapping[card],
            status: false,
        };
    })
        .filter((obj) => obj);
    return (react_1.default.createElement("div", { className: "u-flex flex-row justify-content-start" }, Object.keys(cardTypes).map((cardKey) => {
        var _a, _b;
        return (react_1.default.createElement("div", { key: cardKey, id: (_a = cardTypes[cardKey]) === null || _a === void 0 ? void 0 : _a.name, className: (0, classnames_1.default)('cc-icon u-flex u-marg-right--light', {
                '-current': isCurrent === null || isCurrent === void 0 ? void 0 : isCurrent(cardKey),
                '-default': isDefault === null || isDefault === void 0 ? void 0 : isDefault(cardKey),
            }), style: Object.assign({ backgroundImage: `url('${RoomstayThemeEngine_1.default.getAssetUrl() + 'assets/img/' + ((_b = cardTypes[cardKey]) === null || _b === void 0 ? void 0 : _b.name) + '.png'}')`, backgroundSize: 'contain' }, style || {}) }));
    })));
};
exports.default = AcceptablePaymentCard;
//# sourceMappingURL=AcceptablePaymentCard.js.map