"use strict";

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

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

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

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

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

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

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

var _react = _interopRequireWildcard(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _classnames = _interopRequireDefault(require("classnames"));

var _lib = _interopRequireDefault(require("@instructure/ui-themeable/lib"));

var _theme = _interopRequireDefault(require("./theme"));

var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/lib/format-message"));

var _dec,
    _class,
    _class2,
    _temp,
    _default_enGB_number = Intl.NumberFormat("en-GB", { style: "decimal" }).format;

var styles = {
  componentId: 'CixOW',
  template: function template(theme) {
    return "\n\n.quiz-core__PositionSummary--column {\n  display: flex;\n  flex-flow: column;\n}\n\n.quiz-core__PositionSummary--firstNumberSummary {\n  padding-bottom: ".concat(theme.firstNumberSummaryPadding || 'inherit', ";\n}\n\n.quiz-core__PositionSummary--secondNumberSummary {\n  padding-top: ").concat(theme.secondNumberSummaryPadding || 'inherit', ";\n}\n\n.quiz-core__PositionSummary--numberSummary {\n  color: ").concat(theme.numberSummaryColor || 'inherit', ";\n  font-size: ").concat(theme.numberSummaryFontSize || 'inherit', ";\n  font-weight: ").concat(theme.numberSummaryFontWeight || 'inherit', ";\n  margin: auto;\n}\n\n.quiz-core__PositionSummary--verticalDots {\n  margin: auto;\n  height: 1.5rem;\n  border-left: dotted ").concat(theme.verticalDotsBorderWidth || 'inherit', ";\n  border-color: ").concat(theme.verticalDotsBorderColor || 'inherit', ";\n}\n");
  },
  'column': 'quiz-core__PositionSummary--column',
  'firstNumberSummary': 'quiz-core__PositionSummary--firstNumberSummary',
  'secondNumberSummary': 'quiz-core__PositionSummary--secondNumberSummary',
  'numberSummary': 'quiz-core__PositionSummary--numberSummary',
  'verticalDots': 'quiz-core__PositionSummary--verticalDots'
};
var PositionSummary = (_dec = (0, _lib.default)(_theme.default, styles), _dec(_class = (_temp = _class2 =
/*#__PURE__*/
function (_Component) {
  (0, _inherits2.default)(PositionSummary, _Component);

  function PositionSummary() {
    (0, _classCallCheck2.default)(this, PositionSummary);
    return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(PositionSummary).apply(this, arguments));
  }

  (0, _createClass2.default)(PositionSummary, [{
    key: "render",
    value: function render() {
      return _react.default.createElement("div", {
        className: styles.column
      }, _react.default.createElement("div", {
        className: (0, _classnames.default)([styles.numberSummary, styles.firstNumberSummary])
      }, _default_enGB_number(this.props.firstPosition)), _react.default.createElement("div", {
        className: styles.verticalDots
      }), _react.default.createElement("div", {
        className: (0, _classnames.default)([styles.numberSummary, styles.secondNumberSummary])
      }, _default_enGB_number(this.props.lastPosition)));
    }
  }]);
  PositionSummary.displayName = "PositionSummary";
  return PositionSummary;
}(_react.Component), _class2.propTypes = {
  firstPosition: _propTypes.default.number.isRequired,
  lastPosition: _propTypes.default.number.isRequired
}, _temp)) || _class);
exports.default = PositionSummary;