// (C) 2021-2026 GoodData Corporation
import { put, select } from "redux-saga/effects";
import { drillableItemsChanged } from "../../events/drill.js";
import { drillActions } from "../../store/drill/index.js";
import { selectActiveOrDefaultTabLocalIdentifier } from "../../store/tabs/tabsSelectors.js";
export function* changeDrillableItemsHandler(ctx, cmd) {
    const { drillableItems } = cmd.payload;
    const activeTabId = yield select(selectActiveOrDefaultTabLocalIdentifier);
    yield put(drillActions.setDrillableItems({ items: drillableItems, tabId: activeTabId }));
    return drillableItemsChanged(ctx, drillableItems, cmd.correlationId);
}
