'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
var PropTypes = require('prop-types');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);

var MinimapPropTypes = {
  /** The image to render in the minimap */
  src: PropTypes__default.default.string,
  /** size of the image in the minimap */
  width: PropTypes__default.default.number,
  height: PropTypes__default.default.number,
  /** size of the guide overlaid on the minimap image */
  guideWidth: PropTypes__default.default.number,
  guideHeight: PropTypes__default.default.number,
  /** the offsets of the overlaid guide */
  offsetX: PropTypes__default.default.number,
  offsetY: PropTypes__default.default.number
};
var defaultProps = {
  src: null,
  guideWidth: null,
  guideHeight: null,
  width: null,
  height: null,
  offsetX: null,
  offsetY: null
};

/**
 * This renders the minimap component with the appropriate styles. No local state, only a dumb render component
 */
var Minimap = function Minimap(_ref) {
  var src = _ref.src,
    width = _ref.width,
    height = _ref.height,
    guideWidth = _ref.guideWidth,
    guideHeight = _ref.guideHeight,
    offsetX = _ref.offsetX,
    offsetY = _ref.offsetY;
  var minimapStyle = {
    width: width,
    height: height,
    position: 'absolute',
    display: 'block',
    bottom: 10,
    left: 10,
    background: '#fff',
    boxShadow: '0px 0px 2px 0px rgba(0,0,0,0.5)',
    pointerEvents: 'none'
  };
  var guideStyle = {
    width: guideWidth,
    height: guideHeight,
    position: 'absolute',
    display: 'block',
    left: offsetX,
    top: offsetY,
    border: '1px solid rgba(64, 139, 252, 0.8)',
    background: 'rgba(64, 139, 252, 0.1)',
    pointerEvents: 'none'
  };
  return /*#__PURE__*/React__default.default.createElement("div", {
    style: minimapStyle
  }, src && /*#__PURE__*/React__default.default.createElement("img", {
    src: src,
    alt: "Minimap",
    width: minimapStyle.width,
    height: minimapStyle.height
  }), /*#__PURE__*/React__default.default.createElement("div", {
    style: guideStyle
  }));
};
Minimap.defaultProps = defaultProps;
Minimap.propTypes = MinimapPropTypes;
Minimap.__docgenInfo = {
  "description": "This renders the minimap component with the appropriate styles. No local state, only a dumb render component",
  "methods": [],
  "displayName": "Minimap",
  "props": {
    "src": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "The image to render in the minimap",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "guideWidth": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "size of the guide overlaid on the minimap image",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "guideHeight": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "width": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "size of the image in the minimap",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "height": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "offsetX": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "the offsets of the overlaid guide",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "offsetY": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "number"
      },
      "required": false
    }
  }
};
var Minimap$1 = Minimap;

exports.MinimapPropTypes = MinimapPropTypes;
exports.default = Minimap$1;
