"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLoadItems = getLoadItems;
var lodash_1 = require("../../shared/lodash");
var get_preload_items_1 = require("./get-preload-items");
var parse_load_items_1 = require("./parse-load-items");
function getLoadItems(origins, defaultLibrary) {
    if (defaultLibrary === void 0) { defaultLibrary = true; }
    var preLoadItems = get_preload_items_1.getPreloadItems.apply(this, [
        origins,
        { defaultLibrary: defaultLibrary },
    ]);
    var noOrigins = (0, lodash_1.isNil)(origins);
    var aLoadItems;
    if (preLoadItems.length) {
        aLoadItems = noOrigins ? preLoadItems : (0, lodash_1.concat)(preLoadItems, origins);
    }
    else if (!noOrigins) {
        aLoadItems = (0, lodash_1.castArray)(origins);
    }
    if ((0, lodash_1.isNil)(aLoadItems))
        return [];
    return parse_load_items_1.parseLoadItems.call(this, aLoadItems);
}
//# sourceMappingURL=get-load-items.js.map