<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
?>

<div id="bx-notifier-panel">
    <a
            href="/personal/my_messenger/"
            class="bx-notifier-message im_counter"
            onclick="window.location.href = '/personal/my_messenger/'">
        <svg>
            <use xlink:href="<?= SITE_TEMPLATE_PATH ?>/img/svgicons.svg#chat_baloon"></use>
        </svg>
        <span>Сообщения:</span>
        <i class="bx-notifier-indicator-count"></i>
    </a>
</div>

<script type="text/javascript">
    <?php
    if ($arResult['MESSENGER_V2']) {
        \Bitrix\Main\UI\Extension::load("im.v2.application.messenger");
        echo CIMMessenger::GetV2TemplateJS($arResult);
    } else {
        echo CIMMessenger::GetTemplateJS([], $arResult);
    }
    ?>
</script>