"use strict";

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

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

function _ramda() {
  const data = _interopRequireDefault(require("ramda"));

  _ramda = function () {
    return data;
  };

  return data;
}

function _lodash() {
  const data = _interopRequireDefault(require("lodash.toarray"));

  _lodash = function () {
    return data;
  };

  return data;
}

function _abstractError() {
  const data = _interopRequireDefault(require("../../../../error/abstract-error"));

  _abstractError = function () {
    return data;
  };

  return data;
}

class DuplicateIds extends _abstractError().default {
  constructor(componentObject) {
    super();
    const componentIds = {};
    Object.keys(componentObject).forEach(key => {
      const fileArr = componentObject[key].map(c => _ramda().default.pluck('relativePath')(c.files));

      const flattendFiles = _ramda().default.flatten((0, _lodash().default)(fileArr));

      componentIds[key] = flattendFiles;
    });
    this.componentObject = componentIds;
  }

}

exports.default = DuplicateIds;