"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initialGroupingState = exports.groupsReducer = void 0; var _typescriptFsaReducers = require("typescript-fsa-reducers"); var _alerts = require("../../utils/alerts"); var _actions = require("./actions"); /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ const initialGroupingState = {}; exports.initialGroupingState = initialGroupingState; const groupsReducer = (0, _typescriptFsaReducers.reducerWithInitialState)(initialGroupingState).case(_actions.updateGroups, (state, { tableId, ...rest }) => ({ ...state, [tableId]: { activeGroups: [], options: (0, _alerts.getDefaultGroupingOptions)(tableId), ...(state[tableId] ? state[tableId] : {}), ...rest } })); exports.groupsReducer = groupsReducer;