"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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;
}

function _scopeComponentsImporter() {
  const data = _interopRequireDefault(require("../../../scope/component-ops/scope-components-importer"));

  _scopeComponentsImporter = function () {
    return data;
  };

  return data;
}

var _default =
/*#__PURE__*/
function () {
  var _modifyCIProps = (0, _bluebird().coroutine)(function* (path, id, ciProps) {
    const scope = yield (0, _scope().loadScope)(path);
    const bitId = yield scope.getParsedId(id);

    const scopeComponentsImporter = _scopeComponentsImporter().default.getInstance(scope);

    const component = yield scopeComponentsImporter.loadComponent(bitId);
    return scope.sources.modifyCIProps({
      source: component,
      ciProps
    });
  });

  function modifyCIProps(_x, _x2, _x3) {
    return _modifyCIProps.apply(this, arguments);
  }

  return modifyCIProps;
}();

exports.default = _default;