"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveWorkflowProjectionCurrentLabelNames = resolveWorkflowProjectionCurrentLabelNames;
async function resolveWorkflowProjectionCurrentLabelNames(input) {
    if (input.issueId === input.targetIssue.id) {
        if (input.targetIssueLabelsAreFresh) {
            return input.targetIssue.labelNames ?? [];
        }
        if (typeof input.publisher.ticketTracker.getIssue === "function") {
            return ((await input.publisher.ticketTracker.getIssue(input.issueId))
                .labelNames ?? []);
        }
        return input.targetIssue.labelNames ?? [];
    }
    return ((await input.publisher.ticketTracker.getIssueRecord(input.issueId))
        .labelNames ?? []);
}
