function normalizeWorkflowPrListWhereLabels(labels) {
    if (labels === undefined) {
        return undefined;
    }
    return [...new Set(labels)].sort();
}
export function normalizeWorkflowPrListWhere(where) {
    if (where === undefined) {
        return undefined;
    }
    const normalized = {};
    if (where.author !== undefined) {
        normalized.author = where.author;
    }
    if (where.base_branch !== undefined) {
        normalized.base_branch = where.base_branch;
    }
    if (where.head_branch !== undefined) {
        normalized.head_branch = where.head_branch;
    }
    if (where.managed_by_takt !== undefined) {
        normalized.managed_by_takt = where.managed_by_takt;
    }
    const labels = normalizeWorkflowPrListWhereLabels(where.labels);
    if (labels !== undefined) {
        normalized.labels = labels;
    }
    if (where.same_repository !== undefined) {
        normalized.same_repository = where.same_repository;
    }
    if (where.draft !== undefined) {
        normalized.draft = where.draft;
    }
    return Object.keys(normalized).length > 0 ? normalized : undefined;
}
export function workflowPrListWhereEquals(left, right) {
    return JSON.stringify(normalizeWorkflowPrListWhere(left) ?? {})
        === JSON.stringify(normalizeWorkflowPrListWhere(right) ?? {});
}
export function stringifyWorkflowPrListWhere(where) {
    return JSON.stringify(normalizeWorkflowPrListWhere(where) ?? {});
}
//# sourceMappingURL=workflow-system-input-types.js.map