// (C) 2021-2026 GoodData Corporation
import { eventGuard } from "./util.js";
export function dateFilterChanged(ctx, filter, dateFilterOptionLocalId, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.DATE_FILTER.SELECTION_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
            dateFilterOptionLocalId,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link DashboardDateFilterSelectionChanged}.
 *
 * @param obj - object to test
 * @public
 */
export const isDashboardDateFilterSelectionChanged = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.DATE_FILTER.SELECTION_CHANGED");
export function attributeFilterAdded(ctx, added, index, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.ADDED",
        ctx,
        correlationId,
        payload: {
            added,
            index,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardAttributeFilterAdded}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardAttributeFilterAdded = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.ADDED");
export function attributeFilterRemoved(ctx, removed, children, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.REMOVED",
        ctx,
        correlationId,
        payload: {
            removed,
            children,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardAttributeFilterRemoved}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardAttributeFilterRemoved = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.REMOVED");
export function attributeFilterMoved(ctx, moved, fromIndex, toIndex, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.MOVED",
        ctx,
        correlationId,
        payload: {
            moved,
            fromIndex,
            toIndex,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardAttributeFilterMoved}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardAttributeFilterMoved = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.MOVED");
export function attributeFilterSelectionChanged(ctx, filter, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.SELECTION_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link DashboardAttributeFilterSelectionChanged}.
 *
 * @param obj - object to test
 * @public
 */
export const isDashboardAttributeFilterSelectionChanged = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.SELECTION_CHANGED");
export function attributeFilterItemSelectionReplaced(ctx, filter, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER_ITEM.SELECTION_REPLACED",
        ctx,
        correlationId,
        payload: {
            filter,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link DashboardAttributeFilterItemSelectionReplaced}.
 *
 * @param obj - object to test
 * @public
 */
export const isDashboardAttributeFilterItemSelectionReplaced = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER_ITEM.SELECTION_REPLACED");
export function attributeFilterParentChanged(ctx, filter, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.PARENT_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardAttributeFilterParentChanged}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardAttributeFilterParentChanged = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.PARENT_CHANGED");
export function attributeDisplayTitleChanged(ctx, filter, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.TITLE_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardAttributeTitleChanged}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardAttributeFilterTitleChanged = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.TITLE_CHANGED");
export function attributeDisplayFormChanged(ctx, filter, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.DISPLAY_FORM_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
        },
    };
}
export function attributeSelectionModeChanged(ctx, filter, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.SELECTION_MODE_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardAttributeSelectionModeChanged}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardAttributeFilterSelectionModeChanged = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.ATTRIBUTE_FILTER.SELECTION_MODE_CHANGED");
export function dashboardAttributeConfigModeChanged(ctx, filter) {
    return {
        type: "GDC.DASH/EVT.ATTRIBUTE_FILTER_CONFIG.MODE_CHANGED",
        ctx,
        payload: {
            filter,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardAttributeFilterConfigModeChanged}.
 *
 * @param obj - object to test
 * @alpha
 */
export const isDashboardAttributeFilterConfigModeChanged = eventGuard("GDC.DASH/EVT.ATTRIBUTE_FILTER_CONFIG.MODE_CHANGED");
export function dashboardAttributeConfigDisplayAsLabelChanged(ctx, filter, displayAsLabel, correlationId) {
    return {
        type: "GDC.DASH/EVT.ATTRIBUTE_FILTER_CONFIG.DISPLAY_AS_LABEL_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
            displayAsLabel,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardAttributeFilterConfigDisplayAsLabelChanged}.
 *
 * @param obj - object to test
 * @alpha
 */
export const isDashboardAttributeFilterConfigDisplayAsLabelChanged = eventGuard("GDC.DASH/EVT.ATTRIBUTE_FILTER_CONFIG.DISPLAY_AS_LABEL_CHANGED");
export function dashboardAttributeConfigLimitingItemsChanged(ctx, filter) {
    return {
        type: "GDC.DASH/EVT.ATTRIBUTE_FILTER_CONFIG.LIMITING_ITEMS_CHANGED",
        ctx,
        payload: {
            filter,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardAttributeFilterConfigLimitingItemsChanged}.
 *
 * @param obj - object to test
 * @alpha
 */
export const isDashboardAttributeFilterConfigLimitingItemsChanged = eventGuard("GDC.DASH/EVT.ATTRIBUTE_FILTER_CONFIG.LIMITING_ITEMS_CHANGED");
export function filterContextChanged(ctx, filterContext, attributeFilterConfigs, correlationId, tabLocalIdentifier) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.CHANGED",
        ctx,
        correlationId,
        payload: {
            filterContext,
            attributeFilterConfigs,
            tabLocalIdentifier,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link DashboardFilterContextChanged}.
 *
 * @param obj - object to test
 * @public
 */
export const isDashboardFilterContextChanged = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.CHANGED");
export function dateFilterTitleChanged(ctx, filter, filterConfig, correlationId) {
    return {
        type: "GDC.DASH/EVT.DATE_FILTER_CONFIG.TITLE_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
            filterConfig,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardDateFilterTitleChanged}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardDateFilterTitleChanged = eventGuard("GDC.DASH/EVT.DATE_FILTER_CONFIG.TITLE_CHANGED");
export function dateFilterModeChanged(ctx, filter, filterConfig, correlationId) {
    return {
        type: "GDC.DASH/EVT.DATE_FILTER_CONFIG.MODE_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
            filterConfig,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardDateFilterModeChanged}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardDateFilterModeChanged = eventGuard("GDC.DASH/EVT.DATE_FILTER_CONFIG.MODE_CHANGED");
export function dateFilterAdded(ctx, added, index, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.DATE_FILTER.ADDED",
        ctx,
        correlationId,
        payload: {
            added,
            index,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardDateFilterAdded}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardDateFilterAdded = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.DATE_FILTER.ADDED");
export function dateFilterRemoved(ctx, removed, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.DATE_FILTER.REMOVED",
        ctx,
        correlationId,
        payload: {
            removed,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardDateFilterRemoved}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardDateFilterRemoved = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.DATE_FILTER.REMOVED");
export function dateFilterMoved(ctx, moved, fromIndex, toIndex, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.DATE_FILTER.MOVED",
        ctx,
        correlationId,
        payload: {
            moved,
            fromIndex,
            toIndex,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardDateFilterMoved}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardDateFilterMoved = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.DATE_FILTER.MOVED");
export function filterViewCreationSucceeded(ctx, filterView, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.CREATE.SUCCESS",
        ctx,
        correlationId,
        payload: {
            filterView,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterViewCreationSucceeded}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardFilterViewCreationSucceeded = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.CREATE.SUCCESS");
export function filterViewCreationFailed(ctx, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.CREATE.FAILURE",
        ctx,
        correlationId,
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterViewCreationFailed}.
 *
 * @param obj - object to test
 *
 * @alpha
 */
export const isDashboardFilterViewCreationFailed = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.CREATE.FAILURE");
export function filterViewDeletionSucceeded(ctx, filterView, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.DELETE.SUCCESS",
        ctx,
        correlationId,
        payload: {
            filterView,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterViewDeletionSucceeded}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardFilterViewDeletionSucceeded = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.DELETE.SUCCESS");
export function filterViewDeletionFailed(ctx, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.DELETE.FAILURE",
        ctx,
        correlationId,
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterViewDeletionFailed}.
 *
 * @param obj - object to test
 *
 * @alpha
 */
export const isDashboardFilterViewDeletionFailed = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.DELETE.FAILURE");
export function filterViewApplicationSucceeded(ctx, filterView, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.APPLY.SUCCESS",
        ctx,
        correlationId,
        payload: {
            filterView,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterViewApplicationSucceeded}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardFilterViewApplicationSucceeded = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.APPLY.SUCCESS");
export function filterViewApplicationFailed(ctx, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.APPLY.FAILURE",
        ctx,
        correlationId,
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterViewApplicationFailed}.
 *
 * @param obj - object to test
 *
 * @alpha
 */
export const isDashboardFilterViewApplicationFailed = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.APPLY.FAILURE");
export function filterViewDefaultStatusChangeSucceeded(ctx, filterView, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.CHANGE_DEFAULT_STATUS.SUCCESS",
        ctx,
        correlationId,
        payload: {
            filterView,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterViewDefaultStatusChangeSucceeded}.
 *
 * @param obj - object to test
 * @beta
 */
export const isDashboardFilterViewDefaultStatusChangeSucceeded = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.CHANGE_DEFAULT_STATUS.SUCCESS");
export function filterViewDefaultStatusChangeFailed(ctx, filterView, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.CHANGE_DEFAULT_STATUS.FAILURE",
        ctx,
        correlationId,
        payload: {
            filterView,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterViewDefaultStatusChangeFailed}.
 *
 * @param obj - object to test
 *
 * @alpha
 */
export const isDashboardFilterViewDefaultStatusChangeFailed = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.FILTER_VIEW.CHANGE_DEFAULT_STATUS.FAILURE");
/**
 * @alpha
 */
export function filterContextSelectionReset(correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.SELECTION.RESET",
        correlationId,
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterContextSelectionReset}.
 *
 * @param obj - object to test
 *
 * @alpha
 */
export const isDashboardFilterContextSelectionReset = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.SELECTION.RESET");
/**
 * @alpha
 */
export function filterContextWorkingSelectionApplied(ctx, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.WORKING_SELECTION.APPLIED",
        ctx,
        correlationId,
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardFilterContextWorkingSelectionApplied}.
 *
 * @param obj - object to test
 *
 * @alpha
 */
export const isDashboardFilterContextWorkingSelectionApplied = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.WORKING_SELECTION.APPLIED");
export function measureValueFilterAdded(ctx, added, index, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.ADDED",
        ctx,
        correlationId,
        payload: {
            added,
            index,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardMeasureValueFilterAdded}.
 *
 * @param obj - object to test
 * @alpha
 */
export const isDashboardMeasureValueFilterAdded = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.ADDED");
/**
 * Creates the {@link IDashboardMeasureValueFilterRemoved} event.
 *
 * @alpha
 */
export function measureValueFilterRemoved(ctx, removed, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.REMOVED",
        ctx,
        correlationId,
        payload: {
            removed,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardMeasureValueFilterRemoved}.
 *
 * @alpha
 */
export const isDashboardMeasureValueFilterRemoved = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.REMOVED");
/**
 * Creates the {@link IDashboardMeasureValueFilterMoved} event.
 *
 * @alpha
 */
export function measureValueFilterMoved(ctx, filter, index, newIndex, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.MOVED",
        ctx,
        correlationId,
        payload: {
            filter,
            index,
            newIndex,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardMeasureValueFilterMoved}.
 *
 * @alpha
 */
export const isDashboardMeasureValueFilterMoved = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.MOVED");
export function measureValueFilterConditionChanged(ctx, localIdentifier, filter, conditions, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.CONDITION_CHANGED",
        ctx,
        correlationId,
        payload: {
            localIdentifier,
            filter,
            conditions,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardMeasureValueFilterConditionChanged}.
 *
 * @param obj - object to test
 * @alpha
 */
export const isDashboardMeasureValueFilterConditionChanged = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.CONDITION_CHANGED");
export function measureValueFilterDimensionalityChanged(ctx, localIdentifier, filter, dimensionality, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.DIMENSIONALITY_CHANGED",
        ctx,
        correlationId,
        payload: {
            localIdentifier,
            filter,
            dimensionality,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardMeasureValueFilterDimensionalityChanged}.
 *
 * @param obj - object to test
 * @alpha
 */
export const isDashboardMeasureValueFilterDimensionalityChanged = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.DIMENSIONALITY_CHANGED");
/**
 * Creates the {@link IDashboardMeasureValueFilterTitleChanged} event.
 *
 * @alpha
 */
export function dashboardMeasureValueFilterTitleChanged(ctx, filter, correlationId) {
    return {
        type: "GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.TITLE_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardMeasureValueFilterTitleChanged}.
 *
 * @alpha
 */
export const isDashboardMeasureValueFilterTitleChanged = eventGuard("GDC.DASH/EVT.FILTER_CONTEXT.MEASURE_VALUE_FILTER.TITLE_CHANGED");
/**
 * Creates the {@link IDashboardMeasureValueFilterConfigModeChanged} event.
 *
 * @alpha
 */
export function dashboardMeasureValueFilterConfigModeChanged(ctx, filter, correlationId) {
    return {
        type: "GDC.DASH/EVT.MEASURE_VALUE_FILTER_CONFIG.MODE_CHANGED",
        ctx,
        correlationId,
        payload: {
            filter,
        },
    };
}
/**
 * Tests whether the provided object is an instance of {@link IDashboardMeasureValueFilterConfigModeChanged}.
 *
 * @alpha
 */
export const isDashboardMeasureValueFilterConfigModeChanged = eventGuard("GDC.DASH/EVT.MEASURE_VALUE_FILTER_CONFIG.MODE_CHANGED");
