text: "use strict"
  
  Object.defineProperty(exports, "__esModule", {
    value: true,
  })
  exports.DirectionsRenderer = undefined
  
  var _defineProperty2 = require("babel-runtime/helpers/defineProperty")
  
  var _defineProperty3 = _interopRequireDefault(_defineProperty2)
  
  var _getPrototypeOf = require("babel-runtime/core-js/object/get-prototype-of")
  
  var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf)
  
  var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck")
  
  var _classCallCheck3 = _interopRequireDefault(_classCallCheck2)
  
  var _createClass2 = require("babel-runtime/helpers/createClass")
  
  var _createClass3 = _interopRequireDefault(_createClass2)
  
  var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn")
  
  var _possibleConstructorReturn3 = _interopRequireDefault(
    _possibleConstructorReturn2
  )
  
  var _inherits2 = require("babel-runtime/helpers/inherits")
  
  var _inherits3 = _interopRequireDefault(_inherits2)
  
  var _react = require("react")
  
  var _react2 = _interopRequireDefault(_react)
  
  var _propTypes = require("prop-types")
  
  var _propTypes2 = _interopRequireDefault(_propTypes)
  
  var _MapChildHelper = require("../utils/MapChildHelper")
  
  var _constants = require("../constants")
  
  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : { default: obj }
  }
  
  /**
   * A wrapper around `google.maps.DirectionsRenderer`
   *
   * @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#DirectionsRenderer
   */
  /*
   * -----------------------------------------------------------------------------
   * This file is auto-generated from the corresponding file at `src/macros/`.
   * Please **DO NOT** edit this file directly when creating PRs.
   * -----------------------------------------------------------------------------
   */
  /* global google */
  var DirectionsRenderer = (exports.DirectionsRenderer = (function(
    _React$PureComponent
  ) {
    ;(0, _inherits3.default)(DirectionsRenderer, _React$PureComponent)
  
    /*
     * @see https://developers.google.com/maps/documentation/javascript/3.exp/reference#DirectionsRenderer
     */
    function DirectionsRenderer(props, context) {
      ;(0, _classCallCheck3.default)(this, DirectionsRenderer)
  
      var _this = (0, _possibleConstructorReturn3.default)(
        this,
        (
          DirectionsRenderer.__proto__ ||
          (0, _getPrototypeOf2.default)(DirectionsRenderer)
        ).call(this, props, context)
      )
  
      var directionsRenderer = new google.maps.DirectionsRenderer()
      ;(0, _MapChildHelper.construct)(
        DirectionsRenderer.propTypes,
        updaterMap,
        _this.props,
        directionsRenderer
      )
      directionsRenderer.setMap(_this.context[_constants.MAP])
      _this.state = (0, _defineProperty3.default)(
        {},
        _constants.DIRECTIONS_RENDERER,
        directionsRenderer
      )
      return _this
    }
  
    ;(0, _createClass3.default)(DirectionsRenderer, [
      {
        key: "componentDidMount",
        value: function componentDidMount() {
          ;(0, _MapChildHelper.componentDidMount)(
            this,
            this.state[_constants.DIRECTIONS_RENDERER],
            eventMap
          )
        },
      },
      {
        key: "componentDidUpdate",
        value: function componentDidUpdate(prevProps) {
          ;(0, _MapChildHelper.componentDidUpdate)(
            this,
            this.state[_constants.DIRECTIONS_RENDERER],
            eventMap,
            updaterMap,
            prevProps
          )
        },
      },
      {
        key: "componentWillUnmount",
        value: function componentWillUnmount() {
          ;(0, _MapChildHelper.componentWillUnmount)(this)
          var directionsRenderer = this.state[_constants.DIRECTIONS_RENDERER]
          if (directionsRenderer) {
            directionsRenderer.setMap(null)
          }
        },
      },
      {
        key: "render",
        value: function render() {
          return false
        },
  
        /**
         * Returns the renderer's current set of directions.
         * @type DirectionsResult
         * @public
         */
      },
      {
        key: "getDirections",
        value: function getDirections() {
          return this.state[_constants.DIRECTIONS_RENDERER].getDirections()
        },
  
        /**
         * Returns the panel `<div>` in which the `DirectionsResult` is rendered.
         * @type Node
         * @public
         */
      },
      {
        key: "getPanel",
        value: function getPanel() {
          return this.state[_constants.DIRECTIONS_RENDERER].getPanel()
        },
  
        /**
         * Returns the current (zero-based) route index in use by this `DirectionsRenderer` object.
         * @type number
         * @public
         */
      },
      {
        key: "getRouteIndex",
        value: function getRouteIndex() {
          return this.state[_constants.DIRECTIONS_RENDERER].getRouteIndex()
        },
      },
    ])
    return DirectionsRenderer
  })(_react2.default.PureComponent))
  
  DirectionsRenderer.propTypes = {
    /**
     * @type DirectionsResult
     */
    defaultDirections: _propTypes2.default.any,
  
    /**
     * @type DirectionsRendererOptions
     */
    defaultOptions: _propTypes2.default.any,
  
    /**
     * @type Node
     */
    defaultPanel: _propTypes2.default.any,
  
    /**
     * @type number
     */
    defaultRouteIndex: _propTypes2.default.number,
  
    /**
     * @type DirectionsResult
     */
    directions: _propTypes2.default.any,
  
    /**
     * @type DirectionsRendererOptions
     */
    options: _propTypes2.default.any,
  
    /**
     * @type Node
     */
    panel: _propTypes2.default.any,
  
    /**
     * @type number
     */
    routeIndex: _propTypes2.default.number,
  
    /**
     * function
     */
    onDirectionsChanged: _propTypes2.default.func,
  }
  DirectionsRenderer.contextTypes = (0, _defineProperty3.default)(
    {},
    _constants.MAP,
    _propTypes2.default.object
  )
  exports.default = DirectionsRenderer
  
  var eventMap = {
    onDirectionsChanged: "directions_changed",
  }
  
  var updaterMap = {
    directions: function directions(instance, _directions) {
      instance.setDirections(_directions)
    },
    options: function options(instance, _options) {
      instance.setOptions(_options)
    },
    panel: function panel(instance, _panel) {
      instance.setPanel(_panel)
    },
    routeIndex: function routeIndex(instance, _routeIndex) {
      instance.setRouteIndex(_routeIndex)
    },
  }
  