"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 _lib = _interopRequireDefault(require("@instructure/ui-themeable/lib"));

var _RichContentRenderer = _interopRequireDefault(require("@instructure/quiz-rce/lib/components/RichContentRenderer"));

var _Overlay = _interopRequireDefault(require("../../../../../../common/components/shared/overlay/Overlay"));

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

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

var _dec, _class, _class2, _temp;

var styles = {
  componentId: 'cCwUt',
  template: function template(theme) {
    return "\n\n.cCwUt_edzr{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;min-height:4rem;padding:".concat(theme.instructionsShowWrapperPadding || 'inherit', ";position:relative;width:100%}\n\n.cCwUt_espM{font-size:").concat(theme.instructionsShowTextFontSize || 'inherit', ";overflow:hidden;white-space:normal}");
  },
  'instructionsShowWrapper': 'cCwUt_edzr',
  'instructionsShowText': 'cCwUt_espM'
};
var QuizInstructionsShow = ( // ==========================================
// this component shows the quiz instructions
// has events that allow for toggling
// editing and hover which shows an overlay
// ==========================================
_dec = (0, _lib.default)(_theme.default, styles), _dec(_class = (_temp = _class2 =
/*#__PURE__*/
function (_Component) {
  (0, _inherits2.default)(QuizInstructionsShow, _Component);

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

  (0, _createClass2.default)(QuizInstructionsShow, [{
    key: "render",
    value: function render() {
      return _react.default.createElement("span", {
        "data-automation": "sdk-quiz-instructions-show-wrapper"
      }, _react.default.createElement(_Overlay.default, {
        wrapperClassName: styles.instructionsShowWrapper,
        onClick: this.props.switchOnEditing,
        tabIndex: "-1"
      }, _react.default.createElement("div", {
        "data-automation": "instructions-show-text"
      }, _react.default.createElement(_RichContentRenderer.default, {
        customStyles: styles.instructionsShowText,
        content: this.props.instructions || "Adicionar instru\xE7\xF5es ..."
      }))));
    }
  }]);
  QuizInstructionsShow.displayName = "QuizInstructionsShow";
  return QuizInstructionsShow;
}(_react.Component), _class2.propTypes = {
  instructions: _propTypes.default.string.isRequired,
  switchOnEditing: _propTypes.default.func.isRequired
}, _temp)) || _class);
exports.default = QuizInstructionsShow;