{# _bud_invite_panel.html — bud btn + slide-out for the gatekeeper      #}
{# game-invite flow on room.html. Server returns {brief,                 #}
{# recipient_display} — no line_text (no Post to append a Line to). JS  #}
{# just shows the Brief banner. Caller must pass `room` in context.     #}
{% include "apps/billboard/_partials/_bud_apparatus.html" with aria_label="Invite a friend" include_suggestions=True %}
<script>
bindBudBtn({
    submitUrl: '{% url "epic:invite_gamer" room.id %}',
    autocompleteUrl: '{% url "billboard:search_buds" %}',
    onSuccess: function (data) {
        if (window.Brief && data.brief) Brief.showBanner(data.brief);
    },
    duplicateTargetSelector: function (data) {
        // Pending RoomInvite duplicates have no recipient_user_id (no
        // visible slot to highlight); selector returning null is fine —
        // showDuplicateBanner's FYI just dismisses without easing.
        if (!data.recipient_user_id) return null;
        return '.gate-slot.filled[data-user-id="' + data.recipient_user_id + '"]';
    },
});
</script>
