'use strict';

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

var _scope;

function _load_scope() {
  return _scope = require('../../../scope');
}

var _bitId;

function _load_bitId() {
  return _bitId = require('../../../bit-id');
}

function latestVersions(path, componentIdsStr) {
  var componentIds = componentIdsStr.map(function (id) {
    return (_bitId || _load_bitId()).BitId.parse(id);
  });
  return (0, (_scope || _load_scope()).loadScope)(path).then(function (scope) {
    return scope.latestVersions(componentIds);
  }).then(function (componentsIds) {
    return componentsIds.map(function (componentId) {
      return componentId.toString();
    });
  });
}