"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_TRACKER_COMMENT_REACTIONS = exports.TRACKER_COMMENT_REACTION_VALUES = void 0;
exports.selectCommentReaction = selectCommentReaction;
exports.TRACKER_COMMENT_REACTION_VALUES = [
    "eyes",
    "+1",
    "heart",
    "hooray",
];
exports.DEFAULT_TRACKER_COMMENT_REACTIONS = [
    "eyes",
    "+1",
    "heart",
];
function selectCommentReaction(commentId, reactions) {
    if (reactions.length === 0) {
        return null;
    }
    let hash = 0;
    for (const char of commentId) {
        hash = (hash * 31 + char.charCodeAt(0)) >>> 0;
    }
    const reaction = reactions[hash % reactions.length];
    if (reaction === undefined) {
        return null;
    }
    return reaction;
}
