@auth
<div class="top_navbar">
  <div class="header-wrapper">
    <div id="masthead" class="main-header container">
      <div class="inner-header flex-row logo-left md-logo-center">
        <div id="logo" class="flex-col logo">
          <a href="{{ URL::to('/') }}" title="">
            <!--TODO put site tile-->
            <img class="img-fluid" alt="{{ $setting->nama_web }}" src="https://panel.royalkingz.top/storage/logo/{{ $setting->logo }}" style="max-width: 271px;">
          </a>
        </div>

        <!-- Mobile Left Elements -->
        <div class="flex-col show-for-medium flex-left  fs-lg ">
          <i class="icon-bars"></i>
        </div>
        <!-- Left Elements -->
        <div class="flex-col hide-for-medium flex-left
          flex-grow">
        </div>

        <!-- Desktop Right Elements -->

        <div class="flex-col hide-for-medium flex-right">
          <div class="flex-row top text-right">
            <span class="text-right time">02/03/2024  4:25:6 am</span>
            <div class=" line"></div>
            <div class="social-icons fade-in" id="blk-socialIcons--top-bar" style="flex-wrap:nowrap;">
              <a href="{{ $contacts->facebook }}" target="_blank" i18n-tooltip="@Follow-FB" tooltip="Ikuti di Facebook" data-toggle="tooltip" data-placement="top" title="Follow on Facebook!" class="facebook button icon circle ">
                <i class="icon-facebook"></i>
              </a>
              <!--
                -->
              <a href="{{ $contacts->twitter }}" target="_blank" i18n-tooltip="@Tweet-us" data-toggle="tooltip" data-placement="top" title="Tweet us!" class="twitter  button icon circle  "><i class="icon-twitter "></i></a>
              <!--
                -->
              <a href="{{ $contacts->instagram }}" target="_blank" i18n-tooltip="@Instagram-us" data-toggle="tooltip" data-placement="top" title="Instagram us!" class="instagram  button icon circle "><i class="icon-instagram"></i></a>
              <!--
                -->
              <a href="https://" target="_blank" i18n-tooltip="@See-our-youtube" data-toggle="tooltip" data-placement="top" title="See our youtube video to know more!" class=" youtube button icon circle "><i class="icon-youtube-play"></i></a>

            </div>
            <button class="btn button icon circle share" style="" id="btn-showSocialIcons--top-bar">
              <i class="icon-share" style="left:-1px;"></i>
              <i class="icon-close hide"></i>
            </button>
            <div class=" line"></div>

            <a class="country_detail" href="javascript:void(0);" data-trigger="nifty" data-target="#langModal-mobile">
              <span class="d-inline-block circle-id"></span>
              <span class="contry_name">Indonesia</span>
              <span class="dot"></span>
              <span class="lang_name">indonesian</span>
            </a>
            <div class="  line"></div>

          </div>
          
          <div class="flex-row text-right mid">
            <a class="enlarge" href="{{ URL::to('/') }}/profile/member-level">
              <div class="member_leavel">
                <p class="member_leavel_name">
                  New
                </p>
              </div>
            </a>

            <div class="line"></div>


           <a href="/profile" class="enlarge user-account">
              <div>
                <i class="icon-user-o" style="font-size:1.2rem;"></i>
              </div>
              <div class="text-center">


                <br>
                <span>{{ Auth::user()->name }}</span>
              </div>
            </a>

            <div class="line"></div>


            <a class="pointer button icon" href="/memo" data-toggle="tooltip" data-placement="top" title="Pesan">
              <i class="icon-mail_outline"></i>

              <div class="mail_icon" style="display:none;">
                0
              </div>

            </a>
            <div class="line"></div>


            <a class="pointer" href="javascript:void(0)" onclick="openLiveChat('{{ $contacts->livechat_link }}' , '')" data-toggle="tooltip" data-placement="top" title="Obrolan Langsung">
              <i class="icon-chat1"></i>
            </a>
            <div class="  line"></div>

            <div class="social-icons info_toggle fade-in" id="blk-helpIcons--nexttop-bar" style="flex-wrap:nowrap;">
              <a class="pointer button twitter icon circle" href="{{ URL::to('/') }}/info/how-sportsbook" data-toggle="tooltip" data-placement="top" title="Cara bermain">
                <i class="icon-help-circle"></i>
              </a>
              <a class="pointer button twitter icon circle" href="{{ URL::to('/') }}/info/faq-general" data-toggle="tooltip" data-placement="top" title="Pusat Info">
                <i class="icon-info"></i>
              </a>
            </div>
            <button class="btn button icon circle share" style="" id="btn-showhelpIcons--nexttop-bar">
              <i class="icon-bars"></i>
              <i class="icon-close hide"></i>
            </button>

            <a style="" class="btn btn-primary" href="{{ URL::to('/') }}/logout" i18n="@Logout" onclick="event.preventDefault();
            document.getElementById('logout-form').submit();">KELUAR</a>
            
            <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
            @csrf
          </form>


          </div>

          <div class="acc-panel flex-row last">
            <div class="dropdown">
              <button class="btn btn-link enlarge wallet btn-refresh-wallet">
                <i class="icon-wallet"></i>
                <span class="bal-txt"><img src="{{ asset('images/load.gif') }}" alt="Loader" width="32" height="32"></span>
                <i class="icon-refresh-2"></i>
              </button>
              <button class="btn btn-link wallet" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="icon-chevron-thin-down"></i>
              </button>
              <div class="dropdown-menu wallet-balance-dd">
                <div class="wallet-type">
                  <div class="col-md-6 noSidePadding">
                    Dompet Permainan:
                  </div>
                  <button class="col-md-5 noSidePadding btn-link wallet-balance btn-refresh-wallet">
                    <span class="bal-txt"><img src="{{ asset('images/load.gif') }}" alt="Loader" width="32" height="32"></span>
                  </button>
                  <i class="icon-refresh-2 col-md-1 noSidePadding btn-refresh-wallet"></i>
                </div>
              </div>
            </div>
            <div class="dropdown enlarge">

            </div>
            <div class="dropdown enlarge">
              <button class="btn btn-clear btn-collapse-balances pull-right animation" id="transaction-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Transaksi &nbsp; <i class="icon-chevron-thin-down"></i>
              </button>
              <div class="dropdown-menu transaction-dropdown" aria-labelledby="transaction-dropdown">
                <ul class="drop_link" style="margin-bottom:0">

                  <li><a href="{{ URL::to('/') }}/account/deposit"> <i class="icon-pig"></i> <span>Deposit</span></a>
                  </li>

                  <li><a href="{{ URL::to('/') }}/account/withdrawal"><i class="icon-transfer"></i>
                    <span>Withdraw</span></a></li>

                  <li><a href="{{ URL::to('/') }}/account/history"><i class="icon-history"></i> <span i18n="@History">Pernyataan</span></a></li>
                  <li style="border-bottom: 0"><a href="{{ URL::to('/') }}/refferal"><i class="icon-users"></i>
                    <span>Referral</span></a></li>
                </ul>
              </div>
            </div>
            <a href="{{ URL::to('/') }}/promo/my-promo" class="enlarge"><i class="icon-gift" style="font-size:1.2rem;"></i><span>Promo saya</span>
            </a>

          </div>

        </div>



      </div>
    </div>

  </div>
  <!--Main Nav-->
  @include('layouts.main-nav-desktop')
  <!--END main nav-->
</div>
<script type="text/javascript">

  $(document).ready(function() {
    
    loadBalance();

    function loadBalance() {
      $.ajax({
        type: 'GET',
        url: '/getBal',
        dataType: 'json',
        success: function(response) {

          if (response.data) {
            $('.bal-txt').text(response.data);
          } else {
            $('.bal-txt').text('IDR 0.00');
          }
        },
        error: function(xhr, status, error) {
          console.error('Failed to load balance:', error);
        }
      });
    }

  });
</script>
@else
<div class="top_navbar">
  <div class="header-wrapper">
    <div id="masthead" class="main-header container">
      <div class="inner-header flex-row logo-left md-logo-center">
        <div id="logo" class="flex-col logo">
          <a href="{{ URL::to('/') }}" title="">
            <!--TODO put site tile-->
            <img class="img-fluid" alt="{{ $setting->nama_web }}" src="https://panel.royalkingz.top/storage/logo/{{ $setting->logo }}" style="max-width: 270px;">
          </a>
        </div>

        <!-- Mobile Left Elements -->
        <div class="flex-col show-for-medium flex-left  fs-lg ">
          <i class="icon-bars"></i>
        </div>
        <!-- Left Elements -->
        <div class="flex-col hide-for-medium flex-left
          flex-grow">
        </div>

        <!-- Desktop Right Elements -->
        @auth
         <div class="flex-row text-right mid">
            <a class="enlarge" href="{{ URL::to('/') }}/profile/member-level">
              <div class="member_leavel">
                <p class="member_leavel_name">
                  New
                </p>
              </div>
            </a>

            <div class="line"></div>


           <a href="/profile" class="enlarge user-account">
              <div>
                <i class="icon-user-o" style="font-size:1.2rem;"></i>
              </div>
              <div class="text-center">



                <br>
                <span>{{ Auth::user()->name }}</span>
              </div>
            </a>

            <div class="line"></div>


            <a class="pointer button icon" href="/memo" data-toggle="tooltip" data-placement="top" title="Pesan">
              <i class="icon-mail_outline"></i>

              <div class="mail_icon" style="display:none;">
                0
              </div>

            </a>
            <div class="line"></div>


            <a class="pointer" href="javascript:void(0)" onclick="openLiveChat('{{ $contacts->livechat_link }}' , '')" data-toggle="tooltip" data-placement="top" title="Obrolan Langsung">
              <i class="icon-chat1"></i>
            </a>
            <div class="  line"></div>

            <div class="social-icons info_toggle fade-in" id="blk-helpIcons--nexttop-bar" style="flex-wrap:nowrap;">
              <a class="pointer button twitter icon circle" href="{{ URL::to('/') }}/info/how-sportsbook" data-toggle="tooltip" data-placement="top" title="Cara bermain">
                <i class="icon-help-circle"></i>
              </a>
              <a class="pointer button twitter icon circle" href="{{ URL::to('/') }}/info/faq-general" data-toggle="tooltip" data-placement="top" title="Pusat Info">
                <i class="icon-info"></i>
              </a>
            </div>
            <button class="btn button icon circle share" style="" id="btn-showhelpIcons--nexttop-bar">
              <i class="icon-bars"></i>
              <i class="icon-close hide"></i>
            </button>

            <a style="" class="btn btn-primary" href="{{ URL::to('/') }}/logout" i18n="@Logout">KELUAR</a>


          </div>

          <div class="acc-panel flex-row last">
            <div class="dropdown">
              <button class="btn btn-link enlarge wallet btn-refresh-wallet">
                <i class="icon-wallet"></i>
                <span class="bal-txt">IDR
                  0.00</span>
                <i class="icon-refresh-2"></i>
              </button>
              <button class="btn btn-link wallet" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="icon-chevron-thin-down"></i>
              </button>
              <div class="dropdown-menu wallet-balance-dd">
                <div class="wallet-type">
                  <div class="col-md-6 noSidePadding">
                    Dompet Permainan:
                  </div>
                  <button class="col-md-5 noSidePadding btn-link wallet-balance btn-refresh-wallet">
                    <span class="bal-txt">
                      IDR 0.00
                    </span>
                  </button>
                  <i class="icon-refresh-2 col-md-1 noSidePadding btn-refresh-wallet"></i>
                </div>
                <div class="wallet-type">
                  <div class="col-md-6 noSidePadding">
                    Dompet Referral:
                  </div>
                  <button class="col-md-5 noSidePadding btn-link wallet-balance btn-refresh-wallet-ref">
                    <span class="bal-ref-txt">
                      IDR 0.00
                    </span>
                  </button>
                  <i class="icon-refresh-2 col-md-1 noSidePadding btn-refresh-wallet-ref"></i>
                </div>
              </div>
            </div>
            <div class="dropdown enlarge">

            </div>
            <div class="dropdown enlarge">
              <button class="btn btn-clear btn-collapse-balances pull-right animation" id="transaction-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Transaksi &nbsp; <i class="icon-chevron-thin-down"></i>
              </button>
              <div class="dropdown-menu transaction-dropdown" aria-labelledby="transaction-dropdown">
                <ul class="drop_link" style="margin-bottom:0">

                  <li><a href="{{ URL::to('/') }}/account/deposit"> <i class="icon-pig"></i> <span>Deposit</span></a>
                  </li>

                  <li><a href="{{ URL::to('/') }}/account/withdrawal"><i class="icon-transfer"></i>
                    <span>Withdraw</span></a></li>

                  <li><a href="{{ URL::to('/') }}/account/history"><i class="icon-history"></i> <span i18n="@History">Pernyataan</span></a></li>
                  <li style="border-bottom: 0"><a href="{{ URL::to('/') }}/referral-downline"><i class="icon-users"></i>
                    <span>Referral</span></a></li>
                </ul>
              </div>
            </div>
            <a href="{{ URL::to('/') }}/promo/my-promo" class="enlarge"><i class="icon-gift" style="font-size:1.2rem;"></i><span>Promo saya</span>
            </a>

          </div>
        @else
        <div class="flex-col hide-for-medium flex-right">
          <div class="flex-row top text-right">
            <span class="text-right time">Loading...</span>
            <div class=" line"></div>
            <div class="social-icons fade-in" id="blk-socialIcons--top-bar" style="flex-wrap:nowrap;">
              <a href="{{ $contacts->facebook }}" target="_blank" i18n-tooltip="@Follow-FB" tooltip="Ikuti di Facebook" data-toggle="tooltip" data-placement="top" title="Follow on Facebook!" class="facebook button icon circle ">
                <i class="icon-facebook"></i>
              </a>
              <!--
                -->
              <a href="{{ $contacts->twitter }}" target="_blank" i18n-tooltip="@Tweet-us" data-toggle="tooltip" data-placement="top" title="Tweet us!" class="twitter  button icon circle  "><i class="icon-twitter "></i></a>
              <!--
                -->
              <a href="{{ $contacts->instagram }}" target="_blank" i18n-tooltip="@Instagram-us" data-toggle="tooltip" data-placement="top" title="Instagram us!" class="instagram  button icon circle "><i class="icon-instagram"></i></a>
              <!--
                -->
              <a href="https://" target="_blank" i18n-tooltip="@See-our-youtube" data-toggle="tooltip" data-placement="top" title="See our youtube video to know more!" class=" youtube button icon circle "><i class="icon-youtube-play"></i></a>

            </div>
            <button class="btn button icon circle share" style="" id="btn-showSocialIcons--top-bar">
              <i class="icon-share" style="left:-1px;"></i>
              <i class="icon-close hide"></i>
            </button>
            <div class=" line"></div>

            <a class="country_detail" href="javascript:void(0);" data-trigger="nifty" data-target="#langModal-mobile">
              <span class="d-inline-block circle-id"></span>
              <span class="contry_name">Indonesia</span>
              <span class="dot"></span>
              <span class="lang_name">indonesian</span>
            </a>
            <div class="  line"></div>

          </div>
          <div class="flex-row text-right mid">

            <a class="pointer button twitter icon" href="{{ URL::to('/') }}/info/how-sportsbook" data-toggle="tooltip" data-placement="top" title="Cara bermain">
              <i class="icon-help-circle"></i>
            </a>
            <div class="line"></div>


            <a class="pointer button twitter icon" href="{{ URL::to('/') }}/info/faq-general" data-toggle="tooltip" data-placement="top" title="Pusat Info">
              <i class="icon-info"></i>
            </a>
            <div class="  line"></div>
            <a class="pointer" href="javascript:void(0)" onclick="openLiveChat('{{ $contacts->livechat_link }}' , '')" data-toggle="tooltip" data-placement="top" title="Obrolan Langsung">
              <i class="icon-chat1"></i>
            </a>
            <div class="  line"></div>

            <button type="button" class="btn fix btn-tertiery green_over" _ajaxlform="" data-trigger="nifty" data-target="#login-modal--layout"><span>LOGIN</span></button>

            <a type="button" class="btn fix  btn-accent yellow_over" style="margin-right: 0;" i18n="@Join" href="{{ URL::to('/') }}/register" routerlinkactive="link-active"><span>DAFTAR</span></a>
            
          </div>
        </div>
        @endauth
      </div>
    </div>

  </div>
  <!--Main Nav-->
 @include('layouts.main-nav-desktop')
  <!--END main nav-->
</div>
@endauth