"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.layoutUiBundle = void 0;
const DRAWER_OPENED = 'DRAWER_OPENED';
const DRAWER_CLOSED = 'DRAWER_CLOSED';
const layoutUiBundle = {
  name: 'layoutUi',
  reducer: (state = {
    drawerOpen: false,
    beeping: null
  }, {
    type
  }) => {
    if (type === DRAWER_OPENED) {
      return Object.assign({}, state, {
        drawerOpen: true
      });
    }

    if (type === DRAWER_CLOSED) {
      return Object.assign({}, state, {
        drawerOpen: false
      });
    }

    return state;
  },
  selectDrawerIsOpen: state => state.layoutUi.drawerOpen,
  doOpenDrawer: () => ({
    type: DRAWER_OPENED
  }),
  doCloseDrawer: () => ({
    type: DRAWER_CLOSED
  })
};
exports.layoutUiBundle = layoutUiBundle;