"use strict";

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

var _immutable = require("immutable");

var _constants = require("@instructure/quiz-common/lib/constants");

var defaultState = (0, _immutable.fromJS)({
  contextUuid: '',
  outcomesEndpoint: '',
  outcomesToken: ''
});

var _default = function _default() {
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
  var action = arguments.length > 1 ? arguments[1] : undefined;

  switch (action.type) {
    case _constants.SET_CONTEXT_UUID:
      return state.set('contextUuid', action.payload);

    case _constants.SET_OUTCOMES_ENDPOINT:
      return state.set('outcomesEndpoint', action.payload);

    case _constants.SET_OUTCOMES_TOKEN:
      return state.set('outcomesToken', action.payload);

    default:
      return state;
  }
};

exports.default = _default;