text: "use strict";
  
  var _slicedToArray = require("babel-runtime/helpers/sliced-to-array")["default"];
  
  var _Map = require("babel-runtime/core-js/map")["default"];
  
  var _Set = require("babel-runtime/core-js/set")["default"];
  
  var _getIterator = require("babel-runtime/core-js/get-iterator")["default"];
  
  var _interopRequireDefault = require("babel-runtime/helpers/interop-require-default")["default"];
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _coreResolve = require('../core/resolve');
  
  var _coreResolve2 = _interopRequireDefault(_coreResolve);
  
  exports["default"] = function (context) {
    var imported = new _Map();
    return {
      "ImportDeclaration": function ImportDeclaration(n) {
        // resolved path will cover aliased duplicates
        var resolvedPath = (0, _coreResolve2["default"])(n.source.value, context);
  
        if (imported.has(resolvedPath)) {
          imported.get(resolvedPath).add(n.source);
        } else {
          imported.set(resolvedPath, new _Set([n.source]));
        }
      },
  
      "Program:exit": function ProgramExit() {
        var _iteratorNormalCompletion = true;
        var _didIteratorError = false;
        var _iteratorError = undefined;
  
        try {
          for (var _iterator = _getIterator(imported.entries()), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
            var _step$value = _slicedToArray(_step.value, 2);
  
            var _module2 = _step$value[0];
            var nodes = _step$value[1];
  
            if (nodes.size > 1) {
              var _iteratorNormalCompletion2 = true;
              var _didIteratorError2 = false;
              var _iteratorError2 = undefined;
  
              try {
                for (var _iterator2 = _getIterator(nodes), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
                  var node = _step2.value;
  
                  context.report(node, "'" + _module2 + "' imported multiple times.");
                }
              } catch (err) {
                _didIteratorError2 = true;
                _iteratorError2 = err;
              } finally {
                try {
                  if (!_iteratorNormalCompletion2 && _iterator2["return"]) {
                    _iterator2["return"]();
                  }
                } finally {
                  if (_didIteratorError2) {
                    throw _iteratorError2;
                  }
                }
              }
            }
          }
        } catch (err) {
          _didIteratorError = true;
          _iteratorError = err;
        } finally {
          try {
            if (!_iteratorNormalCompletion && _iterator["return"]) {
              _iterator["return"]();
            }
          } finally {
            if (_didIteratorError) {
              throw _iteratorError;
            }
          }
        }
      }
    };
  };
  
  module.exports = exports["default"];