"use strict";

exports.__esModule = true;
exports.setViewsState = setViewsState;
var _CollectionViewsState = require("./CollectionViewsState");
var _presetsToCategories = require("./presetsToCategories");
function setViewsState(toolbar, viewsProps) {
  const {
    presets,
    onSaveView,
    onSaveViewChanges,
    onDeleteView,
    onRenameView,
    onSetAsDefaultView,
    allItemsViewProps,
    learnMoreLink,
    viewNamePlaceholder
  } = viewsProps;
  const {
    container
  } = toolbar;
  if (container.isPanelLayout) {
    return null;
  }
  return toolbar.viewsState ?? (toolbar.viewsState = new _CollectionViewsState.CollectionViewsState({
    table: toolbar,
    container,
    presets: (0, _presetsToCategories.presetsToCategories)(presets),
    allItemsViewProps,
    onDeleteView,
    onSaveView,
    onSaveViewChanges,
    onSetAsDefaultView,
    onRenameView,
    learnMoreLink,
    viewNamePlaceholder
  }));
}
//# sourceMappingURL=setViewsState.js.map