// (C) 2022-2026 GoodData Corporation
import { isEqual } from "lodash-es";
import { insightFilters, insightMeasures, measureFilters, measureLocalId, } from "@gooddata/sdk-model";
function getSourceMeasureFilters(insight) {
    return insightMeasures(insight)
        .map((measure) => ({
        localIdentifier: measureLocalId(measure),
        filters: measureFilters(measure) ?? [],
    }))
        .sort((left, right) => left.localIdentifier.localeCompare(right.localIdentifier));
}
export function shouldRevalidateDrillsAfterInsightChange(originalInsight, newInsight) {
    return (!isEqual(insightFilters(originalInsight), insightFilters(newInsight)) ||
        !isEqual(getSourceMeasureFilters(originalInsight), getSourceMeasureFilters(newInsight)));
}
//# sourceMappingURL=drillRevalidationUtils.js.map