"use strict";

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

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 _reduxRecord = _interopRequireDefault(require("./reduxRecord"));

var QtiImport =
/*#__PURE__*/
function (_ReduxRecord) {
  (0, _inherits2.default)(QtiImport, _ReduxRecord);

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

  (0, _createClass2.default)(QtiImport, [{
    key: "progressNumber",
    value: function progressNumber() {
      switch (this.status) {
        case 'importing':
          return this.progress;

        case 'completed':
          return 1.0;

        default:
          // Scheduled, failed
          return 0.0;
      }
    }
  }, {
    key: "isImporting",
    value: function isImporting() {
      return this.status === 'importing';
    }
  }]);
  return QtiImport;
}((0, _reduxRecord.default)({
  id: 0,
  quizId: null,
  status: null,
  url: null,
  message: null,
  progress: 0.0
}));

exports.default = QtiImport;