"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Filter_1 = __importDefault(require("./Filter"));
const Translation_1 = require("../../../translations/Translation");
class AmenitiesFilter extends Filter_1.default {
    constructor(selectedAmenities = new Set()) {
        super();
        this.selectedAmenities = selectedAmenities;
    }
    getLabel(t) {
        return t(Translation_1.Translation.Step.Room.Filter.RoomAmenities);
    }
    check(room) {
        var _a, _b;
        if (this.selectedAmenities.size === 0) {
            return room;
        }
        const roomAmenities = ((_b = (_a = room.extraDetails) === null || _a === void 0 ? void 0 : _a.amenities) === null || _b === void 0 ? void 0 : _b.map((a) => a.type || a.description)) || [];
        // Check if the room has all selected amenities
        for (const selectedAmenity of this.selectedAmenities) {
            if (!roomAmenities.includes(selectedAmenity)) {
                return null;
            }
        }
        return room;
    }
}
exports.default = AmenitiesFilter;
//# sourceMappingURL=AmenitiesFilter.js.map