"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const start_1 = require("../../../../../start");
const _ids_1 = require("../../../../_ids");
class NewGraph extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['bundle'],
            o: ['graph'],
        }, {
            output: {
                graph: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_NEW_GRAPH);
    }
    f({ bundle }, done) {
        // console.log('NewGraph', 'f', bundle)
        const { spec = {}, specs = {} } = bundle;
        // RETURN
        for (const specId in specs) {
            this.__system.specs[specId] = specs[specId];
        }
        const graph = (0, start_1.start)(this.__system, spec);
        done({ graph });
    }
}
exports.default = NewGraph;
//# sourceMappingURL=index.js.map