"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

function _bluebird() {
  const data = require("bluebird");

  _bluebird = function () {
    return data;
  };

  return data;
}

function _scope() {
  const data = require("../../../scope");

  _scope = function () {
    return data;
  };

  return data;
}

function _bitId() {
  const data = require("../../../bit-id");

  _bitId = function () {
    return data;
  };

  return data;
}

var _default =
/*#__PURE__*/
function () {
  var _latestVersions = (0, _bluebird().coroutine)(function* (path, componentIdsStr) {
    const scope = yield (0, _scope().loadScope)(path);
    const bitIds = yield Promise.all(componentIdsStr.map(id => scope.getParsedId(id)));
    const componentsIds = yield scope.latestVersions(bitIds);
    return componentsIds.map(componentId => componentId.toString());
  });

  function latestVersions(_x, _x2) {
    return _latestVersions.apply(this, arguments);
  }

  return latestVersions;
}();

exports.default = _default;