"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeWorkflowIssueDisplayRef = normalizeWorkflowIssueDisplayRef;
exports.workflowIssueRefsMatch = workflowIssueRefsMatch;
exports.normalizeWorkflowIssueGraphLookupKey = normalizeWorkflowIssueGraphLookupKey;
function normalizeWorkflowIssueDisplayRef(value) {
    const normalized = value?.trim();
    if (!normalized) {
        return null;
    }
    return normalized.startsWith("#") ? normalized.slice(1) : normalized;
}
function workflowIssueRefsMatch(left, right) {
    const normalizedLeft = normalizeWorkflowIssueDisplayRef(left);
    const normalizedRight = normalizeWorkflowIssueDisplayRef(right);
    return (normalizedLeft !== null &&
        normalizedRight !== null &&
        normalizedLeft === normalizedRight);
}
function normalizeWorkflowIssueGraphLookupKey(value) {
    const normalized = normalizeWorkflowIssueDisplayRef(value);
    return normalized === null ? null : normalized.toLowerCase();
}
