<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top barra navbar-custom">
  <div class="container">
    <div style="display: flex; flex-direction: row; align-items: center; gap: 0.5rem;">
      <?php if (isset($_SESSION["Logo"])) {
        echo "<img src=\"" . MODULOS . "LogoCliente/getLogoFromSession\" style=\"height: 32px; width: auto;\" />";
      } ?>
      <a class="navbar-brand logo" href="#">DialVox</a>
    </div>
    <div class="d-inline-block mr-1">
      <span class="d-flex align-items-center">
        <?php if (PING_WEB_ACTIVO) { ?>
          <div class="d-flex align-items-center mr-2">

            <img src="<?= IMG; ?>wifi_1_1.svg" id="ping_icon" width="24" />
          </div>
          <span id="ping_value" class="font-weight-bold text-secondary mx-1" style="font-size: 0.8rem">
            0ms
          </span>
        <?php } ?>
        <div class="d-flex align-items-center">
          <img src="<?= IMG; ?>ping_tel_1.png" id="ping_icon2" width="24" />
        </div>
        <span id="ping_value2" class="font-weight-bold text-secondary" style="font-size: 0.8rem; margin-right: 2rem; margin-left: 0.3rem">
          0ms
        </span>

        <span id='agent_status' style='font-size: 0.8rem;font-weight: bold;'></span>
        <span id='pause_time_left' style='font-size: 0.8rem;font-weight:bold;margin-left:0.7rem;'></span>
        <span style='font-size: 0.8rem;font-weight: bold;margin-left: 6px;' class="text-info"><?php echo lang("llamadasPendientes"); ?>: <span id='ringing_calls'>0</span></span>


      </span>
    </div>

    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarResponsive">
      <ul class="navbar-nav ml-auto">
        <li class="nav-item">
          <a class="nav-link text-dark" style="font-weight: bold;" href="#" id="agent_campana"></a>
        </li>
        <li class="nav-item">
          <a href="#" class="nav-link text-dark" style="font-weight: bold;" id="actual-ingroup-name">
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link text-dark" href="#" id="agent-user-container">
            <?= $_SESSION["Usuario"]; ?>
          </a>
        </li>
        <li class="nav-item dropleft" style="cursor: pointer;">
          <div class="dropdown">
            <a class="nav-link" href="#" role="button" id="dispositivosDeAudio" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              <i class="fas fa-headset mx-2"></i>
            </a>
            <div class="dropdown-menu p-3" style="width: 15rem;">
              <p>Dispositivos de audio</p>
              <div style="display: flex; flex-direction: column; gap: 0.4rem;" id="dispositivos-container">
              </div>
            </div>
          </div>
        </li>
        <div class="nav-item" style="cursor: pointer;" id="reconnectButton">
          <a class="nav-link">
            <i class="fa fas fa-redo"></i>
          </a>
        </div>
        <li class="nav-item" style="cursor: pointer;">
          <a class="nav-link" onclick="prepareLogs()" id="sendLogs">
            <i class="fas fa-bug mx-2"></i>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#" onclick="solicitaAyudaPorQueSoyUnInutil()">
            <?php echo lang("solicitaAyuda"); ?>
          </a>
        </li>
        <li class="nav-item active">
          <a class="nav-link" href="#" onclick='salir()'><?php echo lang("salir"); ?>
            <span class="sr-only">(current)</span>
          </a>
        </li>
        <li class="mt-2" style="display: none;">
          <div id="banderaPais">---</div>
        </li>
        <li class="mt-2" style="display: none;">
          <select id="idioma" onchange="cambiaridiomaAgente()">
            <option value="en">USA - Ingles</option>
            <option value="es">MEX - Español</option>
          </select>
        </li>
      </ul>
    </div>
  </div>
</nav>
<?php $idioma = "es";
if (isset($_COOKIE["idioma"])) {
  $idioma = isset($_COOKIE["idioma"]) ? $_COOKIE["idioma"] : "es";
}
?>