text: "use strict";
  
  exports.__esModule = true;
  exports.default = exports.propTypes = exports.defaultLabelProps = void 0;
  
  var _propTypes = _interopRequireDefault(require("prop-types"));
  
  var _react = _interopRequireDefault(require("react"));
  
  var _group = require("@vx/group");
  
  var _shape = require("@vx/shape");
  
  var _point = require("@vx/point");
  
  var _text = require("@vx/text");
  
  var _theme = require("@data-ui/theme");
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  
  var baseLabel = _theme.svgLabel.baseLabel;
  
  var defaultLabelProps = _extends({}, baseLabel, {
    textAnchor: 'start',
    verticalAnchor: 'middle',
    stroke: '#fff',
    strokeWidth: 2,
    paintOrder: 'stroke',
    y: 0,
    dx: '0.4em'
  });
  
  exports.defaultLabelProps = defaultLabelProps;
  var propTypes = {
    label: _propTypes.default.node,
    labelProps: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])),
    reference: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.object]).isRequired,
    stroke: _propTypes.default.string,
    strokeDasharray: _propTypes.default.string,
    strokeLinecap: _propTypes.default.oneOf(['butt', 'square', 'round', 'inherit']),
    strokeWidth: _propTypes.default.number,
    xScale: _propTypes.default.func,
    yScale: _propTypes.default.func
  };
  exports.propTypes = propTypes;
  var defaultProps = {
    label: null,
    labelProps: defaultLabelProps,
    stroke: _theme.color.darkGray,
    strokeDasharray: null,
    strokeLinecap: 'round',
    strokeWidth: 1,
    xScale: null,
    yScale: null
  };
  
  function VerticalReferenceLine(_ref) {
    var label = _ref.label,
        labelProps = _ref.labelProps,
        reference = _ref.reference,
        stroke = _ref.stroke,
        strokeDasharray = _ref.strokeDasharray,
        strokeLinecap = _ref.strokeLinecap,
        strokeWidth = _ref.strokeWidth,
        xScale = _ref.xScale,
        yScale = _ref.yScale;
    if (!xScale || !yScale) return null;
  
    var _yScale$range = yScale.range(),
        y0 = _yScale$range[0],
        y1 = _yScale$range[1];
  
    var scaledRef = //
    xScale(reference) + (xScale.offset || xScale.bandwidth && xScale.bandwidth() / 2 || 0);
    var fromPoint = new _point.Point({
      x: scaledRef,
      y: y0
    });
    var toPoint = new _point.Point({
      x: scaledRef,
      y: y1
    });
    return _react.default.createElement(_group.Group, null, _react.default.createElement(_shape.Line, {
      from: fromPoint,
      to: toPoint,
      stroke: stroke,
      strokeDasharray: strokeDasharray,
      strokeLinecap: strokeLinecap,
      strokeWidth: strokeWidth,
      vectorEffect: "non-scaling-stroke"
    }), !!label && _react.default.createElement(_text.Text, _extends({
      x: scaledRef
    }, defaultLabelProps, labelProps), label));
  }
  
  VerticalReferenceLine.propTypes = propTypes;
  VerticalReferenceLine.defaultProps = defaultProps;
  VerticalReferenceLine.displayName = 'VerticalReferenceLine';
  var _default = VerticalReferenceLine;
  exports.default = _default;