"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnhideAllAppObjectsUndoRedo = void 0;
const DispatchStateChangeUC_1 = require("../../Dispatcher/UC/DispatchStateChangeUC");
const Hideable_1 = require("../../Hideable/Entities/Hideable");
const UndoRedoEntity_1 = require("../../UndoRedo/Entities/UndoRedoEntity");
class UnhideAllAppObjectsUndoRedo {
    setIsHiddenOnAppObject(isHidden, appObjID) {
        const hideable = Hideable_1.Hideable.get(appObjID, this.appObjects);
        if (!hideable)
            return;
        hideable.isHidden = isHidden;
    }
    constructor(appObjectIDs, appObjects) {
        this.appObjectIDs = appObjectIDs;
        this.appObjects = appObjects;
        this.undoAction = () => {
            const appObjectIDs = this.appObjectIDs;
            appObjectIDs.forEach((appObjID) => {
                this.setIsHiddenOnAppObject(true, appObjID);
            });
            (0, DispatchStateChangeUC_1.dispatchStateChange)(this.appObjects);
        };
        this.redoAction = () => {
            const appObjectIDs = this.appObjectIDs;
            appObjectIDs.forEach((appObjID) => {
                this.setIsHiddenOnAppObject(false, appObjID);
            });
            (0, DispatchStateChangeUC_1.dispatchStateChange)(this.appObjects);
        };
        const undoRedo = UndoRedoEntity_1.UndoRedoEntity.get(this.appObjects);
        if (!undoRedo) {
            this.appObjects.submitWarning("UnhideAllAppObjectsUndoRedoDTO", "Unable to find UndoRedoEntity");
            return;
        }
        undoRedo.submitAction(this);
    }
}
exports.UnhideAllAppObjectsUndoRedo = UnhideAllAppObjectsUndoRedo;
//# sourceMappingURL=UnhideAllAppObjectsUndoRedo.js.map