// (C) 2026 GoodData Corporation
import { areObjRefsEqual, idRef, objRefToString, } from "@gooddata/sdk-model";
/**
 * Matches a dashboard MVF measure reference against the identifier used in drill URL placeholders.
 *
 * @internal
 */
export function dashboardMeasureValueFilterMatchesIdentifier(measureRef, identifier, catalogMeasures) {
    const catalogMeasure = catalogMeasures.get(measureRef);
    return (catalogMeasure?.measure.id === identifier ||
        objRefToString(measureRef) === identifier ||
        areObjRefsEqual(measureRef, idRef(identifier, "measure")));
}
/**
 * Matches an insight MVF measure reference against the identifier used in drill URL placeholders.
 *
 * @internal
 */
export function insightMeasureValueFilterMatchesIdentifier(measureRef, identifier) {
    return (objRefToString(measureRef) === identifier || areObjRefsEqual(measureRef, idRef(identifier, "measure")));
}
