<?php
session_start();
require_once(__DIR__ . '/../../config/db.php');
require_once(__DIR__ . '/../../session.php');
include(__DIR__.'/../layouts/stylesheet.php');
?>

    <link href="/Content/jquery.daterangepicker" rel="stylesheet"/>
    <link href="/Content/zelma-v2-beta-desktop-css" rel="stylesheet"/>
    <link href="/Content/Loyalty/zelma-v2-beta-desktop-css" rel="stylesheet"/>
    <link href="/Content/Theme/zelma-v2-beta-desktop-dark-orange-css" rel="stylesheet"/>

</head>
<body data-online-id="UeT7RcR/Vl8C1o5WiG993UmxqvVuf16QPnArbbWlJiRlh4Cs2WIrsg=="
      style="--expand-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/expand.gif?v=20241125);
      --collapse-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/collapse.gif?v=20241125);
      --play-icon-src: url(//d33egg70nrp50s.cloudfront.net/Images/icons/play.png?v=20241125);
      --jquery-ui-444444-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_444444_256x240.png?v=20241125);
      --jquery-ui-555555-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_555555_256x240.png?v=20241125);
      --jquery-ui-ffffff-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_ffffff_256x240.png?v=20241125);
      --jquery-ui-777620-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_777620_256x240.png?v=20241125);
      --jquery-ui-cc0000-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_cc0000_256x240.png?v=20241125);
      --jquery-ui-777777-src: url(//d33egg70nrp50s.cloudfront.net/Images/jquery-ui/ui-icons_777777_256x240.png?v=20241125);">

    <?php include(__DIR__.'/../layouts/header.php'); ?>
    <?php include(__DIR__.'/../layouts/game-menu.php'); ?>
    </div>

<div class="site-content-container" data-container-background="general">
  <div class="container">
    <div class="row">
      <div class="col-sm-12 loyalty-container">
        <div class="standard-container-with-sidebar" data-style="light">
          <div class="standard-side-menu">
            <h4>
              Akun Saya
            </h4>
            <a href="/desktop/deposit" data-active="false">
              Deposit
            </a>
            <a href="/desktop/withdrawal" data-active="false">
              Penarikan
            </a>
            <a href="/desktop/statement/consolidate" data-active="false">
              Riwayat Taruhan
            </a>
            <a href="/desktop/history/bonus" data-active="false">
              Riwayat Klaim
            </a>
            <a href="/desktop/bonus" data-active="false">
              Klaim Bonus
            </a>
            <h4>
              Personal Center
            </h4>
            <a href="/desktop/account-summary" data-active="false">
              Akun Saya
            </a>
            <a href="/desktop/profile" data-active="false">
              Ubah Profil
            </a>
            <a href="/desktop/password" data-active="false">
              Ubah Kata Sandi
            </a>
            <a href="/desktop/loyalty/rewards" data-active="true">
              Hadiah Loyalitas
            </a>
            <a href="/desktop/mobile-app" data-active="false">
              Unduh Aplikasi Permainan
            </a>
            <a href="/desktop/bank-account" data-active="false">
              Detail Perbankan
            </a>
            <a href="/desktop/messages/inbox" data-active="false">
              Pesan
            </a>
          </div>


            <div>
              <div class="standard-form-content">
                <div class="standard-form-title">Hadiah Loyalitas</div>
                <div class="loyalty-top-bar-container">
                  <div class="loyalty-experience-section">
                    <a href="/desktop/loyalty/benefits">
                      <div class="loyalty-experience-container">
                        <div class="loyalty-badge">
                          <img class="loyalty_level" data-image-path="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/loyalty/badge/" loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/loyalty/badge/bronze.svg?v=20241125" />
                        </div>
                        <div class="loyalty-experience-item">
                          <div class="loyalty-experience-level">
                            <span class="loyalty-level bronze">bronze</span>
                            <div class="loyalty-experience-amount" id="loyalty_experience_amount">
                              <span>0</span>/25,000 EXP
                            </div>
                          </div>
                          <div class="loyalty-experience-bar">
                            <div class="xp-label">EXP</div>
                            <div class="loyalty-experience-progress">
                              <div class="progress loyalty_experience_progress" style="width: 0%"></div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="loyalty-experience-chevron-right">
                        <img class="chevron-right" loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/icons/chevron-right.svg?v=20241125" />
                      </div>
                    </a>
                  </div>
                  <div class="vr"></div>
                  <div class="loyalty-point-section">
                    <div>
                      <div class="loyalty-point-title">
                        <div class="info-container">
                          <button class="info-icon" data-toggle="modal" data-target="#popup_loyalty_point">
                            i
                          </button>
                        </div>
                        <span>Loyalty Point</span>
                      </div>
                      <div class="loyalty-point-amount">
                        <div class="lp-label">LP</div>
                        <div class="loyalty-point loyalty_point">0</div>
                        <div class="refresh-container">
                          <button title="Refresh" class="refresh_balance">
                            <img alt="Refresh Balance" loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/layout/refresh-v2.svg?v=20241125" />
                          </button>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div id="popup_loyalty_point" class="modal popup-modal" role="dialog" aria-label="Popup Modal">
                    <div class="modal-dialog">
                      <div class="modal-content">
                        <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">×</span>
                          </button>
                        </div>
                        <div class="modal-body loyalty-benefit-modal-body">
                          <div class="lp-label">LP</div>
                          <span>Loyalty Point</span>
                          <p>Loyalty Point (LP) adalah point yang dapat digunakan oleh player untuk menukarkan hadiah sesuai dengan harga produk (LP) yang sudah ditentukan.</p>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="loyalty-menu" id="loyalty_menu">
                  <a href="/loyalty/redemption-store" id="loyalty_menu_redemption" target="_blank">
                    <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/loyalty/redemption-icon.svg?v=20241125" />
                    Penukaran
                  </a>
                
                  <a href="/desktop/loyalty/missions" id="loyalty_menu_mission">
                    <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/loyalty/mission-icon.svg?v=20241125" />
                    Misi
                  </a>
                
                  <a href="/loyalty/lucky-draw-result" id="loyalty_menu_lucky_draw" target="_blank">
                    <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/loyalty/lucky-draw-result-icon.svg?v=20241125" />
                    Hasil Lucky Draw
                  </a>
                
                  <a href="/desktop/loyalty/progress-history">
                    <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/loyalty/history-icon.svg?v=20241125" />
                    Riwayat
                  </a>
                  
                  <a href="/desktop/loyalty/how-it-works">
                    <img loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/loyalty/how-it-works-icon.svg?v=20241125" />
                    Cara kerja
                  </a>
                </div>
                
                <div id="page_carousel" class="carousel slide page-carousel" data-ride="carousel" data-interval="5000">
                  <ol class="carousel-indicators">
                    <li class="active" data-target="#page_carousel" data-slide-to="0"></li>
                  </ol>
                
                  <div class="carousel-inner">
                    <div class="item active">
                      <a href="/loyalty/redemption-product/88" target="_self">
                        <img alt="Zoom Lucky Draw - Maret" loading="lazy" src="https://api2-s8j.imgzm.com/images/lrKNLcnj0Sg/id_cbd_51841baa-a7b8-47fe-bc8c-3d7108b04d09_1740768417370.jpg" />
                      </a>
                    </div>
                  </div>
                </div>
        
                <div class="loyalty-reward-container">
                  <div class="tab-filter" id="tab_filter">
                    <input type="radio" class="hidden" id="AllProducts" data-category="AllProducts" checked name="redemption-tab-category">
                    <label class="tab" for="AllProducts">
                      Semua
                    </label>
                    <input type="radio" class="hidden" id="LuckyDrawProducts" data-category="LuckyDrawProducts" name="redemption-tab-category">
                    <label class="tab" for="LuckyDrawProducts">
                      Lucky Draw
                    </label>
                  </div>
                
                  <div id="product_list_container" class="product-list-container">
                    <div>
                      <div class="category-title">
                        <div>LUCKY DRAW</div>
                        <a href="/loyalty/lucky-draw-list" id="loyalty_menu_redemption" target="_blank">Lihat Semua > </a>
                      </div>
                      <div class="lucky-draw-container">
                        <a href="/loyalty/redemption-product/88" target="_blank">
                          <div class="item">
                            <div class="item-thumbnail">
                              <div class="item-countdown">
                                <div>Diundi Dalam:</div>
                                <div class="time-container">
                                  <div class="time">24 Hari</div>
                                </div>
                              </div>
                              <picture>
                                <source srcset="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/loyalty/rewards/cbo-icon.webp?v=20241125" type="image/webp" />
                                <source srcset="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/loyalty/rewards/cbo-icon.png?v=20241125" type="image/png" />
                                <img class="item-rank" loading="lazy" src="//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/loyalty/rewards/cbo-icon.png?v=20241125" />
                              </picture>
                              <img class="item-img" src="https://zmprod-redemption.s3.ap-northeast-1.amazonaws.com/product-images/WLB/thumbnail/7aea7f0e-816d-4c85-93d3-50bdeab44b0e.png" />
                            </div>
                            <div class="item-detail-contaner">
                              <div class="item-name">Zoom Lucky Draw - Maret</div>
                              <div class="item-lp">
                                <div class="item-lp-detail">
                                  <div>LP</div>
                                  <div>
                                    <div class="flash-lp">2,000</div>
                                  </div>
                                </div>
                              </div>
                              <div class="loyalty-reward-button">Tukar</div>
                            </div>
                          </div>
                        </a>
                      </div>
                    </div>
                  </div>
                </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>


<?php include(__DIR__.'/../layouts/footer.php'); ?>

<div id="popup_modal" class="modal popup-modal" role="dialog" data-title="" aria-label="Popup Modal">
  <div class="modal-dialog">
    <div class="modal-content" style="--desktop-popup-alert-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/layout/popup/alert.png?v=20241125);;--desktop-popup-notification-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/desktop/layout/popup/notification.png?v=20241125);;--mobile-popup-alert-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/mobile/layout/popup/alert.png?v=20241125);;--mobile-popup-notification-src: url(//d33egg70nrp50s.cloudfront.net/Images/v-zelma-v2-beta/dark-orange/mobile/layout/popup/notification.png?v=20241125);;--event-giveaway-popper-src: url(//d33egg70nrp50s.cloudfront.net/Images/giveaway/popper.png?v=20241125);">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
        <h4 class="modal-title" id="popup_modal_title">
        </h4>
      </div>
      <div class="modal-body" id="popup_modal_body">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal" id="popup_modal_dismiss_button">
          OK
        </button>
        <button type="button" class="btn btn-secondary" data-dismiss="modal" id="popup_modal_cancel_button" style="display: none">
          Tidak
        </button>
        <button type="button" class="btn btn-primary" id="popup_modal_confirm_button" style="display: none">
          Ya
        </button>
      </div>
    </div>
  </div>
</div>

<script src='/bundles/zelma-v2-beta-desktop-js' defer></script>

<script type="text/javascript">
  window.addEventListener('DOMContentLoaded', () => {
    initializeCurrency({
      conversionRate: 1000,
      locale: "id",
      thousandSeparator: "."
    });
  });
</script>

<script src='/bundles/Loyalty/page-js' defer></script>

<script type="text/javascript">
  const tabFilter = document.getElementById('tab_filter');
  const containers = document.querySelectorAll('.flash-sale-container, .lucky-draw-container, .other-product-container');

  containers.forEach(container => {
    let isDown = false;
    let startX;
    let scrollLeft;

    container.addEventListener('mousedown', (e) => {
      isDown = true;
      container.classList.add('active');
      startX = e.pageX - container.offsetLeft;
      scrollLeft = container.scrollLeft;
      e.preventDefault();
    });

    container.addEventListener('mouseleave', () => {
      isDown = false;
      container.classList.remove('active');
    });

    container.addEventListener('mouseup', () => {
      isDown = false;
      container.classList.remove('active');
    });

    container.addEventListener('mousemove', (e) => {
      if (!isDown) return;
      e.preventDefault();
      const x = e.pageX - container.offsetLeft;
      const walk = (x - startX) * 2;
      container.scrollLeft = scrollLeft - walk;
    });

    container.addEventListener('click', (e) => {
      if (isDown) {
        e.stopPropagation();
        e.preventDefault();
      }
    });
  });
</script>
<script>
  window.addEventListener('DOMContentLoaded', () => {
    initializeRewardsPage();
  });
</script>

<script type="text/javascript">
  navigator.serviceWorker.getRegistrations().then(registrations => {
    for (const registration of registrations) {
      registration.unregister();
    }
  });
</script>

<div class="search-popup-container" id="search_popup_container"></div>

<script src='/bundles/reserve-js' defer></script>

</body>
</html>