"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromBundle = fromBundle;
const id_1 = require("../util/id");
const weakMerge_1 = require("../weakMerge");
const fromSpec_1 = require("./fromSpec");
function fromBundle(bundle, specs, classes, branch = {}) {
    const { spec = {}, specs: _specs = {} } = bundle;
    if (!spec.id) {
        spec.id = (0, id_1.uuidNotIn)(specs);
    }
    _specs[spec.id] = spec;
    return (0, fromSpec_1.fromSpec)(spec, (0, weakMerge_1.weakMerge)(_specs, specs), classes, branch);
}
//# sourceMappingURL=fromBundle.js.map