"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TryChallengeAgainUC = void 0;
exports.makeTryChallengeAgainUC = makeTryChallengeAgainUC;
const core_1 = require("@vived/core");
const BaseApp_1 = require("../../BaseApp");
const Entities_1 = require("../Entities");
class TryChallengeAgainUC extends core_1.AppObjectUC {
    static get(appObjects) {
        return (0, core_1.getSingletonComponent)(TryChallengeAgainUC.type, appObjects);
    }
}
exports.TryChallengeAgainUC = TryChallengeAgainUC;
TryChallengeAgainUC.type = "TryChallengeAgainUC";
function makeTryChallengeAgainUC(appObject) {
    return new TryChallengeAgainUCImp(appObject);
}
class TryChallengeAgainUCImp extends TryChallengeAgainUC {
    get challengeEntity() {
        return this.getCachedSingleton(Entities_1.ChallengeEntity.type);
    }
    get baseApp() {
        return this.getCachedSingleton(BaseApp_1.BaseAppState.type);
    }
    constructor(appObject) {
        super(appObject, TryChallengeAgainUC.type);
        this.tryChallengeAgain = () => {
            this.challengeEntity?.resetSelectedChallenge();
            if (this.baseApp) {
                this.baseApp.isReviewing = false;
            }
        };
    }
}
//# sourceMappingURL=TryChallengeAgainUC.js.map