"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.templateMoveUnitIntoGraph = void 0;
const util_1 = require("../../spec/util");
function templateMoveUnitIntoGraph(unit_id, graph_id, { getUnitSpec, getUnitMerges, removeUnit, injectUnit, removePinFromMerge }) {
    const unit_spec = getUnitSpec();
    const unit_merges = getUnitMerges();
    removeUnit(unit_id);
    injectUnit(graph_id, unit_id, unit_spec);
    (0, util_1.forEachPinOnMerges)(unit_merges, (merge_id, unit_id, type, pin_id) => {
        removePinFromMerge(merge_id, unit_id, type, pin_id);
    });
}
exports.templateMoveUnitIntoGraph = templateMoveUnitIntoGraph;
//# sourceMappingURL=index.js.map