"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../Class/Functional");
const object_1 = require("../../../../util/object");
const _ids_1 = require("../../../_ids");
class Bundle extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['graph', 'opt'],
            o: ['bundle'],
        }, {
            input: {
                graph: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_BUNDLE);
    }
    f({ graph, opt }, done) {
        const { stringifyBundleData } = this.__system;
        const { snapshot = false } = opt;
        const _bundle = graph.getBundleSpec(snapshot);
        const bundle = (0, object_1.clone)(_bundle);
        stringifyBundleData(bundle);
        done({
            bundle,
        });
    }
}
exports.default = Bundle;
//# sourceMappingURL=index.js.map