"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SetCalloutSizeUndoRedo = void 0;
const DispatchStateChangeUC_1 = require("../../Dispatcher/UC/DispatchStateChangeUC");
const UndoRedoEntity_1 = require("../../UndoRedo/Entities/UndoRedoEntity");
class SetCalloutSizeUndoRedo {
    constructor(data, appObjects) {
        this.data = data;
        this.appObjects = appObjects;
        this.undoAction = () => {
            const { callout, undoSize } = this.data;
            callout.size = undoSize;
            (0, DispatchStateChangeUC_1.dispatchStateChange)(this.appObjects);
        };
        this.redoAction = () => {
            const { callout, redoSize } = this.data;
            callout.size = redoSize;
            (0, DispatchStateChangeUC_1.dispatchStateChange)(this.appObjects);
        };
        const undoRedo = UndoRedoEntity_1.UndoRedoEntity.get(appObjects);
        if (!undoRedo) {
            appObjects.submitWarning("SetCalloutSizeUndoRedo", "Unable to find UndoRedoEntity");
            return;
        }
        undoRedo.submitAction(this);
    }
}
exports.SetCalloutSizeUndoRedo = SetCalloutSizeUndoRedo;
//# sourceMappingURL=SetCalloutSizeUndoRedo.js.map