"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../Class/Functional");
const id_1 = require("../../../../client/id");
const weakMerge_1 = require("../../../../weakMerge");
const _ids_1 = require("../../../_ids");
class Graph1 extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['unit'],
            o: ['graph'],
        }, {}, system, _ids_1.ID_GRAPH);
    }
    f({ unit }, done, fail) {
        if ((0, id_1.isBaseSpecId)((0, weakMerge_1.weakMerge)(this.__system.specs, unit.__bundle.specs), unit.__bundle.unit.id)) {
            fail('not a graph');
            return;
        }
        done({
            graph: unit,
        });
    }
}
exports.default = Graph1;
//# sourceMappingURL=index.js.map