'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');

var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);

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 _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');

var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);

var _immutable = require('immutable');

var _Bank = require('../../../../common/records/Bank');

var _Bank2 = _interopRequireDefault(_Bank);

var _Item2 = require('../../../../common/records/Item');

var _Item3 = _interopRequireDefault(_Item2);

var _QuizEntry2 = require('../../../../common/records/QuizEntry');

var _QuizEntry3 = _interopRequireDefault(_QuizEntry2);

var _Stimulus = require('../../../../common/records/Stimulus');

var _Stimulus2 = _interopRequireDefault(_Stimulus);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = {
  permutations: [{
    sidebarOpen: [false, true]
  }],
  renderProps: function renderProps(props) {
    var smallStimulusEntry = new FakeQuizEntry(new _Stimulus2.default({ title: 'Small Stimulus' }), {
      id: 'small-stimulus',
      nestedEntryCount: 2
    });
    var largeStimulusEntry = new FakeQuizEntry(new _Stimulus2.default({ title: 'Large Stimulus' }), {
      id: 'large-stimulus',
      nestedEntryCount: 6
    });
    return {
      componentProps: {
        connectDropTarget: function connectDropTarget(el) {
          return el;
        },
        quizEntries: (0, _immutable.List)([new FakeQuizEntry(new FakeItem()), new FakeQuizEntry(new _Bank2.default({ itemEntryCount: 3 })), smallStimulusEntry].concat((0, _toConsumableArray3.default)(smallStimulusEntry.getNestedEntries().toArray()), [largeStimulusEntry], (0, _toConsumableArray3.default)(largeStimulusEntry.getNestedEntries().toArray()))),
        screenreaderNotification: Function.prototype,
        scrollToItem: Function.prototype,
        toggleSidebar: Function.prototype
      }
    };
  }
};

var FakeItem = function (_Item) {
  (0, _inherits3.default)(FakeItem, _Item);

  function FakeItem() {
    (0, _classCallCheck3.default)(this, FakeItem);
    return (0, _possibleConstructorReturn3.default)(this, (FakeItem.__proto__ || Object.getPrototypeOf(FakeItem)).apply(this, arguments));
  }

  (0, _createClass3.default)(FakeItem, [{
    key: 'getInteractionType',
    value: function getInteractionType() {
      return { name: 'Interaction Type Name' };
    }
  }]);
  return FakeItem;
}(_Item3.default);

var FakeQuizEntry = function (_QuizEntry) {
  (0, _inherits3.default)(FakeQuizEntry, _QuizEntry);

  function FakeQuizEntry(entry) {
    var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    var _ref$nestedEntryCount = _ref.nestedEntryCount,
        nestedEntryCount = _ref$nestedEntryCount === undefined ? 0 : _ref$nestedEntryCount,
        params = (0, _objectWithoutProperties3.default)(_ref, ['nestedEntryCount']);
    (0, _classCallCheck3.default)(this, FakeQuizEntry);

    var id = (++quizEntryId).toString();

    var _this2 = (0, _possibleConstructorReturn3.default)(this, (FakeQuizEntry.__proto__ || Object.getPrototypeOf(FakeQuizEntry)).call(this, Object.assign({
      id: id,
      entryType: entry.constructor.name.replace(/^Fake/, '')
    }, params)));

    _this2._entry = entry;

    var nestedEntries = [];
    for (var i = 0; i < nestedEntryCount; i++) {
      nestedEntries.push(new FakeQuizEntry(new FakeItem(), { stimulusQuizEntryId: id }));
    }
    _this2._nestedEntries = (0, _immutable.List)(nestedEntries);
    return _this2;
  }

  (0, _createClass3.default)(FakeQuizEntry, [{
    key: 'getEntry',
    value: function getEntry() {
      return this._entry;
    }
  }, {
    key: 'getNestedEntries',
    value: function getNestedEntries() {
      return this._nestedEntries;
    }
  }]);
  return FakeQuizEntry;
}(_QuizEntry3.default);

var quizEntryId = 0;