<!DOCTYPE html>
<html lang="en">

<head>
    <!--StartHeadStandartCodes-->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="resource-type" content="document">
    <meta name="googlebot" content="Global">
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0,shrink-to-fit=no,user-scalable=0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="revisit-after" content="1 Days">
    <meta name="robots" content="index, follow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!--StartOGTags-->
    <meta property="og:type" content="Website">
    <meta property="og:title"
          content="Ставки на спорт в букмекерской конторе Betera в Беларуси">
    <meta property="og:description"
          content="Официальный сайт букмекерской конторы Betera в Беларуси. Делайте ставки на спорт онлайн на реальные деньги☝">
    <!--EndOGTags-->
    <!--StartTwitterTags-->
    <meta property="twitter:card" content="summarycode">
    <meta property="twitter:title"
          content="Ставки на спорт в букмекерской конторе Betera в Беларуси">
    <meta property="twitter:description"
          content="Официальный сайт букмекерской конторы Betera в Беларуси. Делайте ставки на спорт онлайн на реальные деньги☝">
    <!--EndTwitterTags-->
    <!--StartFavicon-->
    <link rel="mask-icon" href="img/logos/Favicon.png">
    <link rel="shortcut icon" href="img/logos/Favicon.png">
    <!--EndFavicon-->
    <!--start_payments_sprite-->
    <link type="text/css" rel="stylesheet" href="/css/payments_sprite.css?v=2784fafe2bd845be8219d441f34cd811">
    <!--end_payments_sprite-->
    <!--start_providers_sprite-->
    <link type="text/css" rel="stylesheet" href="/css/providers_sprite.css?v=c7f9fafd9cbe49f0a34baabda84a124e">
    <!--end_providers_sprite-->
    <link type="text/css" rel="stylesheet" href="/css/variables.css?v=31460a5b97354a0f84d8bfefcd3eab0c">
		<!--StartFont-->
		<link rel="preconnect" href="https://fonts.gstatic.com">
		<link id="roboto-font"
			href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
			rel="stylesheet">
		<!--EndFont-->
    <!--EndHeadStandartCodes-->
    <!--StartGamificationHeadStandartCodes-->
    <script>
        (function (d, r, b, h, s) { h = d.getElementsByTagName('head')[0]; s = d.createElement('script'); s.onload = b; s.src = r; h.appendChild(s); })
        (document, 'https://libs.smartico.ai/smartico.js', function () {
            _smartico.init('8e34f40c-9731-4f21-b1e8-31836ab362f0-4', { brand_key: '26a806de' });
        });
    </script>
    <script>
        (function () {
            function smartico(e) {
                // Retrieve player data (if available)
                var userId = JSON.parse(localStorage.getItem('authorizationData') || '{}').id || null;

                switch (e.type) {
                    case 'login':
                        window._smartico_user_id = userId;
                        break;
                    case 'logout':
                        window._smartico_user_id = null;
                        break;
                    case 'pageOpen':
                        window._smartico_language = window.location.pathname.split('/')[1] || 'en';
                        break;
                    case 'enterWebsite':
                        window._smartico_language = window.location.pathname.split('/')[1] || 'en';
                        window._smartico_user_id = userId;
                        break;
                    case 'languageChange':
                        // Default to 'en' if language is not provided
                        const newLanguage = e.detail?.lang || window.location.pathname.split('/')[1] || 'en';
                        window._smartico_language = newLanguage;
                        break;
                }
            }
            // Register event listeners
            ['login', 'logout', 'pageOpen', 'enterWebsite', 'languageChange'].forEach(event => {
                document.addEventListener(event, smartico);
            });
        })();
    </script>

    <script>{ "gcm_sender_id": "103953800507" }</script>
    <script>
        importScripts('https://libs.smartico.ai/firebase-app.js');
        importScripts('https://libs.smartico.ai/firebase-messaging.js');
        importScripts('https://libs.smartico.ai/smartico-messaging-core-v2.js');
    </script>
    <script>
        importScripts('https://www.gstatic.com/firebasejs/6.3.4/firebase-app.js');
        importScripts('https://www.gstatic.com/firebasejs/6.3.4/firebase-messaging.js');
        importScripts('https://libs.smartico.ai/smartico-messaging-core.js');
    </script>
    <!--EndGamificationHeadStandartCodes-->
    <!--StartCRMHeadStandartCodes-->
    <!--EndCRMHeadStandartCodes-->
    <!--StartChatsHeadStandartCodes--><!--EndChatsHeadStandartCodes-->
    <!--StartAnalyticsHeadStandartCodes-->
    <!--EndAnalyticsHeadStandartCodes-->
    <!--StartRetailHeadStandartCodes-->
    <!--EndRetailHeadStandartCodes-->
    <!--StartHeadCustomCodes-->
  <style>
    iframe[src^="https://iframes.pm.by/"] {
      width: 1px;
      min-width: 100%;
      min-height: 100%;
      height: 100%;
    }

    iframe[src^="https://iframes.pm.by/"]:not(iframe[src^="https://iframes.pm.by//verification.html"]):not(iframe[src^="https://iframes.pm.by//personalData.html"]) {
      flex-grow: 1;
    }

    div:has(>iframe[src^="https://iframes.pm.by/login.html"]),
    div:has(>iframe[src^="https://iframes.pm.by/registration.html"]),
    div:has(>iframe[src^="https://iframes.pm.by/changePassword.html"]),
    div:has(>iframe[src^="https://iframes.pm.by/restorePassword.html"]) {
      height: auto;
    }

    iframe[src^="https://iframes.pm.by//registration.html"] {
      min-height: 442px !important;
    }
  </style>
  <style>
    @media screen and (min-width: 1024px) {
      #modal-root .tb--modal-lvl2 {
        flex-direction: column;
        justify-content: start;
        height: 100%;
      }

      #modal-root .tb--modal-lvl2::after,
      #modal-root .tb--modal-lvl2::before {
        content: "";
        flex: 100px 0 1;
      }
    }
  </style>
  <style>
    .tb--account-body .tb--modal-popup.tb--log_reg_form {
      width: 100%;
    }

    #modal-root .tb--account-body .tb--profile-body {
      width: 100%;
    }

    #modal-root .tb--account-body .tb--profile-body .tb--profile-right-cont+.tb--modal-popup {
      margin: 0 auto;
      border-radius: 12px;
    }

    @media (max-width: 1023.9px) {
      #modal-root .tb--account-body .tb--profile-body .tb--profile-right-cont+.tb--modal-popup {
        width: 100%;
      }
    }

    @media screen and (max-width: 400px) {
      #modal-root .tb--account-body .tb--profile-body .tb--profile-right-cont+.tb--modal-popup {
        width: 100%;
      }
    }

    @media screen and (min-width: 1024px) {
      .tb--account-body .tb--profile-body .tb--profile-right-cont {
        padding-right: 0;
        margin-right: 24px;
      }
    }

    @media screen and (min-width: 1024px) and (max-width: 1366px) {
      .tb--account-body .tb--profile-body .tb--profile-right-cont {
        min-width: 366px;
      }
    }

    @media screen and (min-width: 1024px) {
      .tb--account-body .tb--profile-body {
        margin: 0 auto;
      }

      .tb--modal-lvl3 {
        min-width: 560px;
      }
    }
  </style>
  <style>
    .tb--ducoments-content {
      background-color: inherit !important;
      padding: 0 !important;
    }

    .tb--ducoments-content .tb--modal-popup {
      width: 100%;
    }
  </style>
<style>
  :root {
    --plus-light-mode-icon: url("https://cdn.cvpm-digi.com/public/40fb8b840bcc48109b6e3ad790c5da81/icons/custompagesicons/plus_light_mode.png");
    --minus-light-mode-icon: url("https://cdn.cvpm-digi.com/public/40fb8b840bcc48109b6e3ad790c5da81/icons/custompagesicons/minus_light_mode.png");
    --minus-icon: url("https://cdn.cvpm-digi.com/public/40fb8b840bcc48109b6e3ad790c5da81/icons/custompagesicons/minus.png");
    --plus-icon: url("https://cdn.cvpm-digi.com/public/40fb8b840bcc48109b6e3ad790c5da81/icons/custompagesicons/plus.png");

    /* extra */
    --grafic-content-first: url("https://pm.by/img/editor/df79ad2a290f48e0aed686d543f3d759.png");
    --grafic-content-second: url("https://pm.by/img/editor/d21a9761501d4b9d819d4512d1ef1a9b.png");
  }

  :root,
  :root[data-theme="dark"] {
    /* background colors */
    --bg-main: #343434;
    --bg-secondary: #2B2827;
    --bg-light: #FFFFFF;
    --bg-content: #3E3E3E;
    --bg-list-cell: #343434;
    --bg-list-cell-toast: #221e1c;
    --bg-modal-view: #1A1A1ABF;
    --bg-custom-content: #1c1a19;
    --bg-promo: #171F24;
    --bg-promo-rgb: 23, 31, 36;
    --bg-custom-content-rgb: 28, 26, 25;

    /* control colors */
    --control-primary: #11e94e;
    --control-primary-hover: #07d742;
    --control-primary-disabled: #0d7a2c;
    --control-disabled: #393939;
    --control-tertiary: #2F2F2F;
    --control-switcher-active: #11e94e;
    --control-switcher-on-disabled: #0D7A2C;
    --control-secondary: #343434;
    --control-secondary-hover: #4B4B4B;
    --control-switcher-knob: #FFFFFF;
    --control-switcher-inactive: #413835;
    --control-switcher-of-disabled: #352F2C;

    /* text colors */
    --text-title: #FDFCFB;
    --text-regular: #EBE3E0;
    --text-subtitle: #DAD3D0;
    --text-body: #BCB5B1;
    --text-disabled: #6D615C;
    --text-always-white: #FFFFFF;
    --text-always-dark: #221E1C;
    --text-link: #11e94e;
    --text-link-light: #EBEBEB;
    --text-error: #FF5A50;
    --text-toast: #221E1C;

    /* icon colors */
    --icon-main: #DED2CC;
    --icon-hover: #E5E1E0;
    --icon-disabled: #DED2CC99;
    --icon-always-white: #FFFFFF;
    --icon-always-dark: #292321;
    --icon-tab-bar: #11e94e;
    --icon-toast: #292321;

    /* input colors */
    --input-outline: #717171;
    --input-focused: #7E7E7E;
    --input-disabled: #353535;
    --input-error: #FF5348;

    /* divider colors */
    --divider-main: #413C3B;

    /* status colors */
    --status-good: #11e94e;
    --status-good-light: #3CB07E;
    --status-process: #39ACFF;
    --status-info: #F98600;
    --status-info-light: #FF8F57;
    --status-bad: #FF5348;
    --status-bad-light: #FF5348;
    --status-promo: #8E1EFB;

    /* border radius */
    --border-radius-m: 10px;

    /* gradients */
    --banner-gradient: linear-gradient(180deg, rgba(var(--bg-promo-rgb), 0.00) 59%,
        rgba(var(--bg-promo-rgb), 0.80) 85%, var(--bg-promo) 100%);

    /* extra */
    --timer-color: #ff5a50;
  }

  .betera-banner {
    display: flex;
    justify-content: center;
    align-items: end;
    height: 500px;
    background: center no-repeat var(--grafic-content-first);
    background-size: 100%;
    position: relative;
  }

  .betera-banner-block {
    position: relative;
    z-index: 2;
  }

  .betera-wrapper {
    font-family: "Roboto", sans-serif;
    background-color: var(--bg-promo);
  }

  .betera-banner-block-title {
    color: var(--text-always-white);
  }

  .betera-mobile-steps {
    display: none;
  }

  .betera-faq_wrapper {
    font-family: "Roboto", sans-serif;
    background-color: var(--bg-custom-content);
    display: flex;
    justify-content: center;
    padding-top: 66px;
  }

  .betera-faq_wrapper nav {
    width: 320px;
  }

  .betera-faq_wrapper nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
    color: var(--text-title);
    position: relative;
  }

  .betera-faq_wrapper nav ul li {
    display: flex;
    align-items: center;
    padding: 14px 0 14px 14px;
    border-bottom: 1px solid var(--divider-main);
    cursor: pointer;
    background: var(--bg-list-cell);
  }

  .betera-faq_wrapper nav ul li:first-child {
    border-top-right-radius: 4px;
    border-top-left-radius: 4px;
  }

  .betera-faq_wrapper nav ul li:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border-bottom: none;
  }

  .betera-faq_wrapper nav ul li span {
    margin-left: 14px;
  }

  .betera-faq_wrapper nav ul li.active {
    background: var(--control-secondary-hover);
  }

  .betera-faq_wrapper nav ul li.active::after {
    content: var(--grafic-content-second);
    width: 24px;
    height: 24px;
    position: absolute;
    right: 5px;
  }

  .betera-faq_wrapper .betera-text-container {
    margin: 0 0 0 44px;
  }

  .betera-faq_wrapper .betera-text-container h1 {
    margin-top: 0;
  }

  .betera-faq_wrapper .betera-text-container img {
    height: 100%;
  }

  .betera-faq_wrapper .betera-text-container-block {
    display: none;
  }

  .betera-faq_wrapper .betera-text-container-block.active {
    display: block;
  }

  .betera-faq_wrapper .footer-nav {
    display: flex;
    flex-wrap: wrap;
    margin: 24px 0;
    gap: 12px;
  }

  .betera-faq_wrapper .footer-nav-block {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 141px;
    padding: 10px 12px;
    gap: 4px;
    border-radius: 8px;
    background: var(--control-secondary);
    color: var(--text-title)
  }

  .betera-faq_wrapper .footer-nav-block.active {
    display: none;
  }

  .betera-faq_wrapper .footer-nav-block span {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: -0.5px;
  }

  .betera-faq_wrapper .select {
    display: none;
    flex-direction: column;
    position: absolute;
    width: 100%;
    max-width: 600px;
    height: auto;
    user-select: none;
    cursor: pointer;
    top: 12px;
  }

  .betera-faq_wrapper .select>label>svg {
    margin-right: 14px;
  }

  .betera-faq_wrapper svg path {
    fill: var(--icon-main);
  }

  .betera-faq_wrapper .option {
    padding: 12px;
    display: flex;
    align-items: center;
    background: var(--bg-list-cell);
    border-top: var(--divider-main);
    position: absolute;
    top: 0;
    width: 100%;
    pointer-events: none;
    order: 2;
    z-index: 1;
    transition: background 0.4s ease-in-out;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: -0.5px;
    color: var(--text-title);
  }

  .betera-faq_wrapper .select .option:nth-of-type(9) {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
  }

  .betera-faq_wrapper .select:focus .option {
    position: relative;
    pointer-events: all;
  }

  .betera-faq_wrapper .select input {
    opacity: 0;
    position: absolute;
    left: -99999px;
  }

  .betera-faq_wrapper .select input:checked+label {
    order: 1;
    z-index: 2;
    background: var(--control-secondary-hover);
    border-top: none;
    position: relative;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }

  .betera-faq_wrapper .select:not(:focus) label {
    border-radius: 4px;
  }

  .betera-faq_wrapper .select input:checked+label:after {
    background-image: var(--plus-light-mode-icon);
    background-size: contain;
    width: 24px;
    height: 24px;
    position: absolute;
    right: 10px;
    pointer-events: none;
    z-index: 3;
  }

  body.light-mode .betera-faq_wrapper .select input:checked+label:after {
    background-image: var(--plus-light-mode-icon);
  }

  .betera-faq_wrapper .select:focus input:checked+label:after {
    background-image: var(--minus-icon);
  }

  body.light-mode .betera-faq_wrapper .select:focus input:checked+label:after {
    background-image: var(--minus-light-mode-icon);
  }

  .tb--modal-header {
    background-color: var(--bg-main) !important;
  }

  .tb--modal-header:before {
    background-color: var(--divider-main) !important;
  }

  .tb--modal-header span.tb--modal-header-txt.tb--text_upercase {
    color: var(--text-title) !important;
  }

  #iframe-modal-close-btn .digi_icon-close,
  .tb--modal-header.tb--flex .tb--modal-close i.digi_icon-close {
    color: var(--icon-main) !important;
  }

  @media (max-width: 964px) {
    .betera-faq_wrapper {
      padding-top: 70px;
    }

    .betera-faq_wrapper nav {
      display: none;
    }

    .betera-faq_wrapper .select {
      display: flex;
    }

    .betera-faq_wrapper .betera-text-container {
      margin: 0;
    }
  }

  @media (max-width: 599px) {

    .betera-faq_wrapper .betera-text-container-block,
    .betera-faq_wrapper .footer-nav {
      padding: 0 8px;
    }

    .betera-faq_wrapper .footer-nav-block {
      width: calc(51% - 12px);
    }
  }

  @media screen and (max-width: 1920px) {
    .betera-banner {
      background-size: auto;
    }
  }

  @media screen and (max-width: 600px) {
    .betera-steps {
      display: none;
    }

    .betera-banner {
      justify-content: flex-start;
    }

    .betera-mobile-steps {
      display: block;
      margin-left: 8px;
    }
  }

  .betera-text-container {
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-body);
    font-size: 14px;
    background-color: transparent;
  }

  .betera-wrapper .betera-text-container {
    padding-top: 20px;
  }

  @media screen and (max-width: 616px) {
    .betera-text-container {
      margin: 0 8px;
    }
  }

  .betera-text-container .center {
    display: flex;
    justify-content: center;
  }

  .betera-text-container h1 {
    font-weight: 700;
    font-size: 16px;
    line-height: 125%;
    letter-spacing: -0.5px;
    color: var(--text-title);
  }

  .betera-text-container h2 {
    font-weight: 700;
    font-size: 18px;
    line-height: 22px;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    color: var(--text-title);
  }

  .betera-text-container .navigation {
    margin: 32px 0;
  }

  .betera-text-container p {
    margin-bottom: 10px;
  }

  .betera-text-container a {
    color: var(--text-link);
    text-decoration: underline;
  }

  .betera-text-container a:has(button) {
    text-decoration: none;
  }

  .betera-text-container ul li a {
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    line-height: 22px;
    letter-spacing: -0.5px;
  }

  .betera-text-container strong {
    font-style: normal;
    font-weight: bold;
    color: var(--text-subtitle);
  }

  .betera-text-container button {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    background: var(--control-primary);
    border-radius: var(--border-radius-m);
    padding: 8px 10px;
    margin: 8px 0 32px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-always-dark);
  }

  .betera-text-container button:hover {
    background: var(--control-primary-hover);
  }

  .betera-text-container ul {
    margin-bottom: 8px;
  }

  div:not(.tb--page-content)>.betera-text-container>ul.unordered-list {
    list-style-type: disc;
    padding-left: 15px;
  }

  div:not(.tb--page-content)>.betera-text-container>ol.ordered-list {
    list-style: decimal;
    padding-left: 15px;
  }

  div:not(.tb--page-content)>.tab-content>ul.unordered-list {
    list-style: disc;
    padding-inline-start: inherit;
  }

  div:not(.tb--page-content)>.tab-content>ol.ordered-list {
    list-style: decimal;
    padding-inline-start: inherit;
  }

  .betera-text-container .tab-input {
    position: absolute;
    opacity: 0;
    z-index: -1;
  }

  .betera-text-container .tabs {
    border-radius: var(--border-radius-m);
    overflow: hidden;
  }

  .betera-text-container .tabs .tab:not(:last-child) .tab-label {
    border-bottom: 1px solid var(--divider-main);
  }

  .betera-text-container .tab {
    position: relative;
    overflow: hidden;
  }

  .betera-text-container .tab-label {
    display: flex;
    align-items: center;
    padding: 14px 12px 14px 45px;
    background: var(--bg-list-cell);
    font-weight: bold;
    cursor: pointer;
    color: var(--text-title);
    font-size: 16px;
    letter-spacing: -0.5px;
  }

  .betera-text-container .tab-label:hover {
    background-color: var(--control-secondary-hover);
  }

  .betera-text-container .tab-label::before {
    position: absolute;
    content: '';
    background-image: var(--plus-icon);
    background-size: contain;
    width: 24px;
    height: 24px;
    text-align: center;
    transition: all 0.35s;
    left: 14px;
  }

  body.light-mode .betera-text-container .tab-label::before {
    background-image: var(--plus-light-mode-icon);
  }

  .betera-text-container .tab-content {
    max-height: 0;
    padding: 0 1em;
    background: var(--bg-secondary);
    transition: all 0.35s;
  }

  .betera-text-container .tab-input:checked+.tab-label::before {
    background-image: var(--minus-icon);
  }

  body.light-mode .betera-text-container .tab-input:checked+.tab-label::before {
    background-image: var(--minus-light-mode-icon);
  }

  .betera-text-container .tab-input:checked~.tab-content {
    max-height: initial;
    padding: 12px;
  }

  .betera-text-container .tab-input:not(:checked)~.tab-content * {
    padding: 0;
    margin: 0;
  }

  .betera-text-container img {
    width: 100%;
    border-radius: 8px;
  }

  .betera-text-container table {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
  }

  .betera-text-container table p {
    margin-bottom: 0;
  }

  .betera-text-container table td {
    padding: 12px 0 12px 12px;
  }

  .betera-text-container table tr:nth-of-type(odd) {
    background-color: var(--bg-secondary);
  }

  .betera-text-container table tr:nth-of-type(1) {
    background-color: var(--bg-list-cell);
  }

  .betera-text-container table tr:nth-of-type(even) {
    background-color: var(--text-always-dark);
  }

  .betera-text-container .betera-notes .betera-note,
  .betera-text-container .betera-notes .betera-note-rules {
    background-color: var(--bg-list-cell);
  }

  .betera-text-container .betera-notes .betera-note .betera-note-title {
    color: var(--text-body);
  }

  .betera-text-container .betera-notes .betera-note .betera-note-text {
    color: var(--text-title);
  }

  .betera-text-container .betera-notes .betera-note-rules .betera-note-text-rules {
    color: var(--text-title);
  }

  .light-mode div#modal-root .tb--log_reg_form {
    background-color: var(--bg-main)
  }

  div#modal-root .modal-stories.tb--modal-lvl1 .tb--modal-lvl2 .tb--modal-lvl3 .tb--modal-popup {
    min-width: 100%;
  }

  #modal-root .tb--acount-body-personal_details .tb--profile-body .tb--modal-popup {
    overflow: visible;
  }
</style>
<script>(function(w,d,s,l,i){
        var isNativeApp = window.navigator.userAgent.includes("MobNative");
        if (isNativeApp) {
          return;
        } w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-TZBH3Q4');</script>

<meta name="google" content="notranslate">
<script>
window.YandexRotorSettings = { WaiterEnabled: true, IsLoaded: function() { return document.title.length > 0; } }
</script>
<style>
    .betera-banner-block {
      display: flex;
      width: 600px;
      padding: 0 8px;
      margin-bottom: 20px;
      flex-direction: column;
      align-items: self-start;
    }

    .betera-banner-block-title {
      font-size: 36px;
    }

    .betera-banner-block-tag {
      font-size: 14px;
      font-weight: 700;
      background: #0235f5;
      border-radius: 39px;
      color: #ffff;
      padding: 4px 8px;
      margin-bottom: 5px;
    }

    .betera-notes {
      display: flex;
      flex-wrap: wrap;
      border-radius: var(--border-radius-m);
      overflow: hidden;
      gap: 2px;
      margin-bottom: 20px;
    }

    .betera-note {
      display: flex;
      background-color: var(--control-secondary);
      padding: 12px;
      align-items: center;
      flex: 1 49%;
    }

    .betera-note-rules {
      display: flex;
      background-color: var(--control-secondary);
      padding: 12px;
      flex-direction: column;
      width: 100%;
    }

    .betera-note-info {
      margin-left: 15px;
      display: flex;
      flex-direction: column;
    }

    .betera-note-title {
      color: var(--text-body);
      font-weight: 400;
      font-size: 14px;
      margin-bottom: 5px;
    }

    .betera-note-text {
      color: var(--text-title);
      font-weight: 700;
      font-size: 24px;
    }

    .betera-note-text-rules {
      display: flex;
      flex-direction: column;
      color: var(--text-title);
      font-weight: 700;
      font-size: 14px;
    }

    .betera-timer-letters {
      font-size: 16px;
    }

    .betera-note img {
      width: auto;
    }

    .betera-games-box {
      background-color: var(--control-secondary);
      padding: 8px;
      border-radius: 8px;
    }

    .betera-games-scroll {
      overflow-x: scroll;
    }

    .betera-games-cards {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      width: 584px;
    }

    .betera-games-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }

    .betera-games-header a {
      display: flex;
      color: var(--text-always-white);
      font-size: 14px;
      font-weight: 400;
      text-decoration: none;
    }

    .betera-games-title {
      color: var(--text-always-white);
      font-size: 18px;
      font-weight: 700;
    }

    .betera-game-card {
      display: flex;
      flex: 1 23%;
    }

    @media screen and (max-width: 599px) {
      .betera-notes {
        flex-direction: column;
      }
    }
  </style>
<style>
  .account-block_sub-menu_item:has(i.category_icon-cash_show) {
    border-radius: 8px;
    background-color: #5758ca;
    color: #ffffff;
    margin: 0 6px;
    padding: 0 6px;
  }

  .account-block_sub-menu_item .account-block_item-icon.category_icon-cash_show {
    color: #ffffff;
  }

  .account-block_sub-menu_item:has(i.category_icon-cash_show)::after {
    content: none;
  }

  .account-block_sub-menu_item:hover i.category_icon-cash_show {
    color: #ffffff;
    background: transparent;
    -webkit-text-fill-color: #ffffff;
    background: #ffffff;
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    background-image: none;
  }

  .tb--mobile-menu .tb--menu-items {
    overflow: hidden;
  }

  .tb--mobile-menu .tb--menu-items .tb--menu-item {
    font-size: 16px;
  }

  .tb--mobile-menu .tb--menu-items .tb--menu-item:has(i.category_icon-cash_show) {
    border-radius: 8px;
    background-color: #5758ca;
    color: #ffffff;
    margin: 6px;
    padding: 12px 10px;
  }

  body.light-mode .tb--mobile-menu .tb--menu-items .tb--menu-item:has(i.category_icon-cash_show) {
    color: #ffffff;
  }

  .tb--mobile-menu .tb--menu-items .tb--menu-item:has(i.category_icon-cash_show)::after {
    bottom: -6px;
  }

  .tb--profile-body div:has(>iframe) {
    width: 100%;
  }

  .tb--acount-body-preferences div:has(>iframe) {
    flex: 1;
  }

  @media only screen and (max-width: 1247.9px) {
    .account-block_items .tb--cp .btn.btn-primary {
      background-color: var(--control-primary);
      color: var(--icon-always-dark);
      border-radius: 6px;
    }
  }

  @media only screen and (min-width: 1360px) {
    body.light-mode .stories-wrapper .page_stories .slick-slider .slick-slide .page_stories_block .story-name {
      color: #ffffff;
      font-weight: 500;
    }
  }

  @media (max-width: 1023.9px) {
    .account-block_items__mob .tb--cp .deposit-btn_text {
      font-size: 14px;
      display: block;
      padding: 0;
      letter-spacing: 0px;
      width: 73px;
      text-overflow: clip
    }

    .account-block_items__mob .tb--cp .deposit-btn {
      width: 100%;
      gap: 4px;
      padding: 8px;
      border-radius: 8px;
    }

    .account-block_items__mob .user-menu {
      order: 2;
    }

    .account-block_items__mob .tb--cp {
      order: 1;
    }

    .account-block_items__mob .account-block_user-select {
      order: 0;
      border-radius: 8px;
    }

    header .burger-btn {
      background: var(--bg-promo);
      border-radius: 8px;
    }

    .account-block_items__mob .user-menu {
      padding: 4px;
      background: var(--bg-promo);
      border-radius: 8px;
    }

    .tb--reg-btn-box .btn.tb--access-btn,
    .tb--login-btn-box .btn.tb--access-btn {
      font-size: 14px;
      font-weight: 600;
      letter-spacing: 0;
      border-radius: 8px;
    }

    .user-menu .account-block_item-icon.digi_icon-user {
      color: var(--text-title);
    }
  }

</style>
  <style>
    img[alt^="dp:"] {
      cursor: pointer;
    }

    .header-mobile-menu .menu--block-item {
      cursor: pointer;
    }

    .more--menu-items .menu--block-item {
      cursor: pointer;
    }

    .menu--block-item,
    .menu-block-medium {
      cursor: pointer;
    }

    .menu-block-medium:hover {
      color: var(--text-color-4);
    }

    .mobile-nav_item {
      cursor: pointer;
    }
  </style>

<script>
    (function(h,o,t,j,a,r){
        h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
        h._hjSettings={hjid:6382048,hjsv:6};
        a=o.getElementsByTagName('head')[0];
        r=o.createElement('script');r.async=1;
        r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
        a.appendChild(r);
    })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
<style>
  .tb--ducoments-content div:has(>iframe) {
    height: 100%;
    display: flex;
    overflow: hidden;
  }

  @media screen and (max-width: 1023.9px) {

    body #modal-root .tb--ducoments-content,
    body #modal-root .tb--modal-popup,
    body #modal-root .tb--documents-content {
      height: 100%;
      margin: 0;
    }

    .tb--ducoments-content div:has(>iframe) {
      overflow: visible;
    }
  }

  @media screen and (max-width: 1023.9px) and (orientation: landscape) {

    body #modal-root .tb--ducoments-content,
    body #modal-root .tb--modal-popup,
    body #modal-root .tb--documents-content {
      overflow: visible;
      height: auto;
    }

  }  

  @media screen and (min-width: 1024px) {
    body #modal-root .tb--modal-account .tb--subhead+.tb--acount-body-documents {
      padding: 0;
    }

    body #modal-root .tb--acount-body-documents .tb--log_reg_form {
      overflow: visible;
      border-radius: 0;
    }
  }
</style>
<style>
  .profile-widget {
    --color-profile-widget-bg: #27275e;
    --color-balance-bg: #5758ca;
    --color-level: #abacff;
    --progress-radius: 6px;

    --br-1: 4px;

    --color-skeleton-bg: #6969ae;
    --skeleton-linear: linear-gradient(90deg,
        #6969ae 0px,
        #7878c7 40px,
        #6969ae 80px);
    --skeleton-duration: 5s;
    --skeleton-linear-size: 600px;
  }

  .account-block_sub-menu_item.tb--flex.tb--justify-between.tb--text_upercase.tb--fs-small:has(+ .profile-widget-container)::after {
    opacity: 0;
  }

  .profile-widget-container {
    padding: 0 12px;
  }

  .profile-widget {
    padding: 8px;
    border-radius: 8px;
    font-family: var(--font-family-1, "Roboto", sans-serif);
    background: var(--color-profile-widget-bg);
    color: var(--text-always-white, #ffffff);
    cursor: pointer;
  }

  .profile-widget__container {
    display: grid;
    gap: 4px;
    grid-template-columns: auto 3fr auto;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
      "avatar name balance"
      "avatar level balance";
  }

  .profile-widget__avatar {
    grid-area: avatar;
    align-self: center;
    width: 32px;
    height: 32px;
    border: 2px solid var(--control-primary, #11e94e);
    border-radius: 50%;
    animation: none;
  }

  .profile-widget__avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .profile-widget__name {
    grid-area: name;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-wrap: nowrap;
    color: var(--text-always-white, #ffffff);
    animation: none;
  }

  .profile-widget__level {
    grid-area: level;
    margin: 0;
    font-size: 11px;
    color: var(--color-level);
    animation: none;
  }

  .progressbar {
    grid-area: progress;
    display: none;
    gap: 4px;
    align-items: center;
    width: 100%;
    animation: none;
  }

  .progressbar__line {
    height: 6px;
    width: 100%;
    border: none;
    border-radius: var(--progress-radius);
    background-color: var(--progress-bg, #5758ca);
  }

  .progressbar__line::-moz-progress-bar {
    border: none;
    background-color: var(--progress-line, #11e94e);
    border-radius: var(--progress-radius);
  }

  .progressbar__line::-webkit-progress-bar {
    border: none;
    background-color: var(--progress-bg, #5758ca);
    border-radius: var(--progress-radius);
  }

  .progressbar__line::-webkit-progress-value {
    background-color: var(--progress-line, #11e94e);
    border-radius: var(--progress-radius);
  }

  .progressbar__points {
    display: flex;
    align-items: center;
    font-size: 12px;
  }

  .points_next-level {
    color: #959595;
  }

  .profile-widget .balance {
    grid-area: balance;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    margin: 4px 0;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 600;
    background: var(--color-balance-bg);
    color: var(--text-always-white, #ffffff);
    animation: none;
  }

  .balance__img {
    width: 16px;
    aspect-ratio: 1 / 1;
  }

  /* skeleton */

  .profile-widget_loading .profile-widget__avatar {
    border: 2px solid var(--color-skeleton-bg);
    background-image: var(--skeleton-linear);
    background-size: var(--skeleton-linear-size);
    animation: shine-lines var(--skeleton-duration) infinite linear;
  }

  .profile-widget_loading .profile-widget__avatar img {
    display: none;
  }

  .profile-widget_loading .profile-widget__name,
  .profile-widget_loading .profile-widget__level {
    margin-right: 7px;
    border-radius: var(--br-1);
    background-image: var(--skeleton-linear);
    background-size: var(--skeleton-linear-size);
    animation: shine-lines var(--skeleton-duration) infinite linear;
    animation-delay: 0.13s;
    color: transparent;
  }

  .profile-widget_loading .balance {
    margin: 0;
    border-radius: var(--br-1);
    background-image: var(--skeleton-linear);
    background-size: 600px;
    animation: shine-lines var(--skeleton-duration) infinite linear;
    color: transparent;
  }

  .profile-widget_loading .balance__img {
    opacity: 0;
  }

  .profile-widget_loading .progressbar {
    border-radius: var(--br-1);
    background-image: var(--skeleton-linear);
    background-size: var(--skeleton-linear-size);
    animation: shine-lines var(--skeleton-duration) infinite linear;
  }

  .profile-widget_loading .progressbar .progressbar__line,
  .profile-widget_loading .progressbar .progressbar__points {
    display: none;
  }

  @media screen and (max-width: 1023px) {
    .profile-widget-container {
      display: none;
      padding: 12px;
    }

    .profile-widget__container {
      grid-template-rows: 16px 16px 16px;
      grid-template-areas:
        "avatar name balance"
        "avatar level balance"
        "progress progress progress";
    }

    .progressbar {
      display: flex;
    }
  }

  @keyframes shine-lines {
    0% {
      background-position: -100px;
    }

    40%,
    100% {
      background-position: 400px;
    }
  }

  .wrapper.tb--has-floating-menu .profile-widget-container,
  .profile-widget-container:has(main > .l5--sidebar .stories-wrapper) {
    display: block;
  }
</style>
<!--EndHeadCustomCodes-->
    <!--StartIconSet-->
    <style>
        @font-face {
            font-family: 'BuilderFont';
            font-weight: normal;
            font-style: normal;
            src: url('/build/fonts/siteIcons/filledIcons/siteIcons.eot');
            src: url('/build/fonts/siteIcons/filledIcons/siteIcons.eot?#iefix') format('embedded-opentype'), url('/build/fonts/siteIcons/filledIcons/siteIcons.woff') format('woff'), url('/build/fonts/siteIcons/filledIcons/siteIcons.woff2') format('woff2'), url('/build/fonts/siteIcons/filledIcons/siteIcons.ttf') format('truetype');
        }

        @font-face {
            font-family: 'PromotionsIcon';
            font-weight: normal;
            font-style: normal;
            src: url('/build/fonts/promotionsIcons/filledIcons/promotionsIcon.eot');
            src: url('/build/fonts/promotionsIcons/filledIcons/promotionsIcon.eot?#iefix') format('embedded-opentype'), url('/build/fonts/promotionsIcons/filledIcons/promotionsIcon.woff') format('woff'), url('/build/fonts/promotionsIcons/filledIcons/promotionsIcon.woff2') format('woff2'), url('/build/fonts/promotionsIcons/filledIcons/promotionsIcon.ttf') format('truetype');
        }
    </style>
    <!--EndIconSet-->
    <!--StartMaintenance-->
    <style>
        .tb--maintenance_page {
            background-image: url(/img/backgrounds/4.png);
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center center;
        }
    </style>
    <!--EndMaintenance-->
    <!--StartStyles-->
    <!--EndStyles-->

    <script type="text/javascript">
        var template = 1;
    </script>
    <!--EndHeadCustomCodes-->
</head>

<body>
  <noscript>You need to enable JavaScript to run this app.</noscript>
  <div id="root"></div>
  <div id="modal-root"></div>
  <script type="text/javascript" src="/version/linuxLoader.js?v1"></script>
  <!--StartBodyStandartCodes-->
  <!--EndBodyStandartCodes-->
  <!--StartGamificationBodyStandartCodes-->

  <!--EndGamificationBodyStandartCodes-->
  <!--StartCRMBodyStandartCodes-->
  <!--EndCRMBodyStandartCodes-->
  <!--StartChatsBodyStandartCodes--><!--EndChatsBodyStandartCodes-->
  <!--StartAnalyticsBodyStandartCodes-->
  <!--EndAnalyticsBodyStandartCodes-->
  <!--StartRetailBodyStandartCodes-->
  <!--EndRetailBodyStandartCodes-->
  <!--StartBodyCustomCodes-->
  <script>
    /*! iFrame Resizer (iframeSizer.min.js ) - v4.3.2 - 2021-10-18
    *  Desc: Force cross domain iframes to size to content.
    *  Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
    *  Copyright: (c) 2021 David J. Bradshaw - dave@bradshaw.net
    *  License: MIT
    */

    !function (u) { var f, l, a, x, M, I, k, r, m, F, i, g, z; function h() { return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver } function O(e, n, i) { e.addEventListener(n, i, !1) } function R(e, n, i) { e.removeEventListener(n, i, !1) } function o(e) { return M + "[" + (e = "Host page: " + (n = e), e = window.top !== window.self ? window.parentIFrame && window.parentIFrame.getId ? window.parentIFrame.getId() + ": " + n : "Nested host page: " + n : e) + "]"; var n } function t(e) { return F[e] ? F[e].log : l } function T(e, n) { s("log", e, n, t(e)) } function E(e, n) { s("info", e, n, t(e)) } function N(e, n) { s("warn", e, n, !0) } function s(e, n, i, t) { !0 === t && "object" == typeof window.console && console[e](o(n), i) } function e(n) { function i() { t("Height"), t("Width"), L(function () { A(y), H(v), l("onResized", y) }, y, "init") } function e() { var e = b.substr(I).split(":"), n = e[1] ? parseInt(e[1], 10) : 0, i = F[e[0]] && F[e[0]].iframe, t = getComputedStyle(i); return { iframe: i, id: e[0], height: n + function (e) { if ("border-box" !== e.boxSizing) return 0; var n = e.paddingTop ? parseInt(e.paddingTop, 10) : 0, e = e.paddingBottom ? parseInt(e.paddingBottom, 10) : 0; return n + e }(t) + function (e) { if ("border-box" !== e.boxSizing) return 0; var n = e.borderTopWidth ? parseInt(e.borderTopWidth, 10) : 0, e = e.borderBottomWidth ? parseInt(e.borderBottomWidth, 10) : 0; return n + e }(t), width: e[2], type: e[3] } } function t(e) { var n = Number(F[v]["max" + e]), i = Number(F[v]["min" + e]), t = e.toLowerCase(), e = Number(y[t]); T(v, "Checking " + t + " is in range " + i + "-" + n), e < i && (e = i, T(v, "Set " + t + " to min value")), n < e && (e = n, T(v, "Set " + t + " to max value")), y[t] = "" + e } function o() { function e() { return t.constructor === Array ? function () { var e = 0, n = !1; for (T(v, "Checking connection is from allowed list of origins: " + t); e < t.length; e++)if (t[e] === i) { n = !0; break } return n }() : (e = F[v] && F[v].remoteHost, T(v, "Checking connection is from: " + e), i === e); var e } var i = n.origin, t = F[v] && F[v].checkOrigin; if (t && "" + i != "null" && !e()) throw new Error("Unexpected message received from: " + i + " for " + y.iframe.id + ". Message was: " + n.data + ". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains."); return 1 } function a(e) { return b.substr(b.indexOf(":") + x + e) } function s(i, t) { var e, n, o; e = function () { var e, n; B("Send Page Info", "pageInfo:" + (e = document.body.getBoundingClientRect(), n = y.iframe.getBoundingClientRect(), JSON.stringify({ iframeHeight: n.height, iframeWidth: n.width, clientHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0), clientWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0), offsetTop: parseInt(n.top - e.top, 10), offsetLeft: parseInt(n.left - e.left, 10), scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, documentHeight: document.documentElement.clientHeight, documentWidth: document.documentElement.clientWidth, windowHeight: window.innerHeight, windowWidth: window.innerWidth })), i, t) }, n = 32, z[o = t] || (z[o] = setTimeout(function () { z[o] = null, e() }, n)) } function r(e) { e = e.getBoundingClientRect(); return S(v), { x: Math.floor(Number(e.left) + Number(k.x)), y: Math.floor(Number(e.top) + Number(k.y)) } } function d(e) { var n = e ? r(y.iframe) : { x: 0, y: 0 }, i = { x: Number(y.width) + n.x, y: Number(y.height) + n.y }; T(v, "Reposition requested from iFrame (offset x:" + n.x + " y:" + n.y + ")"), window.top !== window.self ? window.parentIFrame ? window.parentIFrame["scrollTo" + (e ? "Offset" : "")](i.x, i.y) : N(v, "Unable to scroll to requested position, window.parentIFrame not found") : (k = i, c(), T(v, "--")) } function c() { !1 !== l("onScroll", k) ? H(v) : j() } function u(e) { var n, i = e.split("#")[1] || "", e = decodeURIComponent(i), t = document.getElementById(e) || document.getElementsByName(e)[0]; t ? (n = r(t), T(v, "Moving to in page link (#" + i + ") at x: " + n.x + " y: " + n.y), k = { x: n.x, y: n.y }, c(), T(v, "--")) : window.top !== window.self ? window.parentIFrame ? window.parentIFrame.moveToAnchor(i) : T(v, "In page link #" + i + " not found and window.parentIFrame not found") : T(v, "In page link #" + i + " not found") } function f(e) { var n, i = {}; i = 0 === Number(y.width) && 0 === Number(y.height) ? { x: (n = a(9).split(":"))[1], y: n[0] } : { x: y.width, y: y.height }, l(e, { iframe: y.iframe, screenX: Number(i.x), screenY: Number(i.y), type: y.type }) } function l(e, n) { return W(v, e, n) } function m() { switch (F[v] && F[v].firstRun && F[v] && (F[v].firstRun = !1), y.type) { case "close": C(y.iframe); break; case "message": n = a(6), T(v, "onMessage passed: {iframe: " + y.iframe.id + ", message: " + n + "}"), l("onMessage", { iframe: y.iframe, message: JSON.parse(n) }), T(v, "--"); break; case "mouseenter": f("onMouseEnter"); break; case "mouseleave": f("onMouseLeave"); break; case "autoResize": F[v].autoResize = JSON.parse(a(9)); break; case "scrollTo": d(!1); break; case "scrollToOffset": d(!0); break; case "pageInfo": s(F[v] && F[v].iframe, v), r = v, e("Add ", O), F[r] && (F[r].stopPageInfo = o); break; case "pageInfoStop": F[v] && F[v].stopPageInfo && (F[v].stopPageInfo(), delete F[v].stopPageInfo); break; case "inPageLink": u(a(9)); break; case "reset": P(y); break; case "init": i(), l("onInit", y.iframe); break; default: 0 === Number(y.width) && 0 === Number(y.height) ? N("Unsupported message received (" + y.type + "), this is likely due to the iframe containing a later version of iframe-resizer than the parent page") : i() }function e(n, i) { function t() { F[r] ? s(F[r].iframe, r) : o() } ["scroll", "resize"].forEach(function (e) { T(r, n + e + " listener for sendPageInfo"), i(window, e, t) }) } function o() { e("Remove ", R) } var r, n } var g, h, p, w, b = n.data, y = {}, v = null; "[iFrameResizerChild]Ready" === b ? function () { for (var e in F) B("iFrame requested init", q(e), F[e].iframe, e) }() : M === ("" + b).substr(0, I) && b.substr(I).split(":")[0] in F ? (y = e(), v = y.id, F[v] && (F[v].loaded = !0), (w = y.type in { true: 1, false: 1, undefined: 1 }) && T(v, "Ignoring init message from meta parent page"), !w && (p = !0, F[h = v] || (p = !1, N(y.type + " No settings for " + h + ". Message was: " + b)), p) && (T(v, "Received: " + b), g = !0, null === y.iframe && (N(v, "IFrame (" + y.id + ") not found"), g = !1), g && o() && m())) : E(v, "Ignored: " + b) } function W(e, n, i) { var t = null, o = null; if (F[e]) { if ("function" != typeof (t = F[e][n])) throw new TypeError(n + " on iFrame[" + e + "] is not a function"); o = t(i) } return o } function p(e) { e = e.id; delete F[e] } function C(e) { var n = e.id; if (!1 !== W(n, "onClose", n)) { T(n, "Removing iFrame: " + n); try { e.parentNode && e.parentNode.removeChild(e) } catch (e) { N(e) } W(n, "onClosed", n), T(n, "--"), p(e) } else T(n, "Close iframe cancelled by onClose event") } function S(e) { null === k && T(e, "Get page position: " + (k = { x: window.pageXOffset !== u ? window.pageXOffset : document.documentElement.scrollLeft, y: window.pageYOffset !== u ? window.pageYOffset : document.documentElement.scrollTop }).x + "," + k.y) } function H(e) { null !== k && (window.scrollTo(k.x, k.y), T(e, "Set page position: " + k.x + "," + k.y), j()) } function j() { k = null } function P(e) { T(e.id, "Size reset requested by " + ("init" === e.type ? "host page" : "iFrame")), S(e.id), L(function () { A(e), B("reset", "reset", e.iframe, e.id) }, e, "reset") } function A(o) { function i(e) { function n() { Object.keys(F).forEach(function (e) { function n(e) { return "0px" === (F[i] && F[i].iframe.style[e]) } var i; F[i = e] && null !== F[i].iframe.offsetParent && (n("height") || n("width")) && B("Visibility change", "resize", F[i].iframe, i) }) } function i(e) { T("window", "Mutation observed: " + e[0].target + " " + e[0].type), c(n, 16) } var t; a || "0" !== o[e] || (a = !0, T(r, "Hidden iFrame detected, creating visibility listener"), (t = h()) && function () { var e = document.querySelector("body"); new t(i).observe(e, { attributes: !0, attributeOldValue: !1, characterData: !0, characterDataOldValue: !1, childList: !0, subtree: !0 }) }()) } function e(e) { var n; n = e, o.id ? (o.iframe.style[n] = o[n] + "px", T(o.id, "IFrame (" + r + ") " + n + " set to " + o[n] + "px")) : T("undefined", "messageData id not set"), i(e) } var r = o.iframe.id; F[r] && (F[r].sizeHeight && e("height"), F[r].sizeWidth && e("width")) } function L(e, n, i) { i !== n.type && r && !window.jasmine ? (T(n.id, "Requesting animation frame"), r(e)) : e() } function B(n, i, t, o, e) { function r() { var e; t && "contentWindow" in t && null !== t.contentWindow ? (e = F[o] && F[o].targetOrigin, T(o, "[" + n + "] Sending msg to iframe[" + o + "] (" + i + ") targetOrigin: " + e), t.contentWindow.postMessage(M + i, e)) : N(o, "[" + n + "] IFrame(" + o + ") not found") } function a() { e && F[o] && F[o].warningTimeout && (F[o].msgTimeout = setTimeout(function () { !F[o] || F[o].loaded || s || (s = !0, N(o, "IFrame has not responded within " + F[o].warningTimeout / 1e3 + " seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.")) }, F[o].warningTimeout)) } var s = !1; o = o || t.id, F[o] && (r(), a()) } function q(e) { return e + ":" + F[e].bodyMarginV1 + ":" + F[e].sizeWidth + ":" + F[e].log + ":" + F[e].interval + ":" + F[e].enablePublicMethods + ":" + F[e].autoResize + ":" + F[e].bodyMargin + ":" + F[e].heightCalculationMethod + ":" + F[e].bodyBackground + ":" + F[e].bodyPadding + ":" + F[e].tolerance + ":" + F[e].inPageLinks + ":" + F[e].resizeFrom + ":" + F[e].widthCalculationMethod + ":" + F[e].mouseEvents } function d(t, e) { function n(i) { var e, n = h(); n && (e = n, t.parentNode && new e(function (e) { e.forEach(function (e) { Array.prototype.slice.call(e.removedNodes).forEach(function (e) { e === t && C(t) }) }) }).observe(t.parentNode, { childList: !0 })), O(t, "load", function () { var e, n; B("iFrame.onload", i, t, u, !0), e = F[s] && F[s].firstRun, n = F[s] && F[s].heightCalculationMethod in m, !e && n && P({ iframe: t, height: 0, width: 0, type: "init" }) }), B("init", i, t, u, !0) } function i(e) { var n = e.split("Callback"); 2 === n.length && (this[n = "on" + n[0].charAt(0).toUpperCase() + n[0].slice(1)] = this[e], delete this[e], N(s, "Deprecated: '" + e + "' has been renamed '" + n + "'. The old method will be removed in the next major version.")) } function o(e) { e = e || {}, F[s] = { firstRun: !0, iframe: t, remoteHost: t.src && t.src.split("/").slice(0, 3).join("/") }, function (e) { if ("object" != typeof e) throw new TypeError("Options is not an object") }(e), Object.keys(e).forEach(i, e), function (e) { for (var n in g) Object.prototype.hasOwnProperty.call(g, n) && (F[s][n] = (Object.prototype.hasOwnProperty.call(e, n) ? e : g)[n]) }(e), F[s] && (F[s].targetOrigin = !0 === F[s].checkOrigin ? "" === (e = F[s].remoteHost) || null !== e.match(/^(about:blank|javascript:|file:\/\/)/) ? "*" : e : "*") } var r, a, s = ("" === (r = t.id) && (t.id = (a = e && e.id || g.id + f++, null !== document.getElementById(a) && (a += f++), r = a), l = (e || {}).log, T(r, "Added missing iframe ID: " + r + " (" + t.src + ")")), r); function d(e) { var n = F[s][e]; 1 / 0 !== n && 0 !== n && (t.style[e] = "number" == typeof n ? n + "px" : n, T(s, "Set " + e + " = " + t.style[e])) } function c(e) { if (F[s]["min" + e] > F[s]["max" + e]) throw new Error("Value for min" + e + " can not be greater than max" + e) } s in F && "iFrameResizer" in t ? N(s, "Ignored iFrame, already setup.") : (o(e), function () { switch (T(s, "IFrame scrolling " + (F[s] && F[s].scrolling ? "enabled" : "disabled") + " for " + s), t.style.overflow = !1 === (F[s] && F[s].scrolling) ? "hidden" : "auto", F[s] && F[s].scrolling) { case "omit": break; case !0: t.scrolling = "yes"; break; case !1: t.scrolling = "no"; break; default: t.scrolling = F[s] ? F[s].scrolling : "no" } }(), c("Height"), c("Width"), d("maxHeight"), d("minHeight"), d("maxWidth"), d("minWidth"), "number" != typeof (F[s] && F[s].bodyMargin) && "0" !== (F[s] && F[s].bodyMargin) || (F[s].bodyMarginV1 = F[s].bodyMargin, F[s].bodyMargin = F[s].bodyMargin + "px"), n(q(s)), F[s] && (F[s].iframe.iFrameResizer = { close: C.bind(null, F[s].iframe), removeListeners: p.bind(null, F[s].iframe), resize: B.bind(null, "Window resize", "resize", F[s].iframe), moveToAnchor: function (e) { B("Move to anchor", "moveToAnchor:" + e, F[s].iframe, s) }, sendMessage: function (e) { B("Send Message", "message:" + (e = JSON.stringify(e)), F[s].iframe, s) } })) } function c(e, n) { null === i && (i = setTimeout(function () { i = null, e() }, n)) } function n() { "hidden" !== document.visibilityState && (T("document", "Trigger event: Visibility change"), c(function () { w("Tab Visible", "resize") }, 16)) } function w(i, t) { Object.keys(F).forEach(function (e) { var n; F[n = e] && "parent" === F[n].resizeFrom && F[n].autoResize && !F[n].firstRun && B(i, t, F[e].iframe, e) }) } function b() { O(window, "message", e), O(window, "resize", function () { var e; T("window", "Trigger event: " + (e = "resize")), c(function () { w("Window " + e, "resize") }, 16) }), O(document, "visibilitychange", n), O(document, "-webkit-visibilitychange", n) } function y() { function t(e, n) { n && (function () { if (!n.tagName) throw new TypeError("Object is not a valid DOM element"); if ("IFRAME" !== n.tagName.toUpperCase()) throw new TypeError("Expected <IFRAME> tag, found <" + n.tagName + ">") }(), d(n, e), o.push(n)) } var o; return function () { for (var e = ["moz", "webkit", "o", "ms"], n = 0; n < e.length && !r; n += 1)r = window[e[n] + "RequestAnimationFrame"]; r ? r = r.bind(window) : T("setup", "RequestAnimationFrame not supported") }(), b(), function (e, n) { var i; switch (o = [], (i = e) && i.enablePublicMethods && N("enablePublicMethods option has been removed, public methods are now always available in the iFrame"), typeof n) { case "undefined": case "string": Array.prototype.forEach.call(document.querySelectorAll(n || "iframe"), t.bind(u, e)); break; case "object": t(e, n); break; default: throw new TypeError("Unexpected data type (" + typeof n + ")") }return o } } function v(e) { e.fn ? e.fn.iFrameResize || (e.fn.iFrameResize = function (i) { return this.filter("iframe").each(function (e, n) { d(n, i) }).end() }) : E("", "Unable to bind to jQuery, it is not fully loaded.") } "undefined" != typeof window && (x = "message".length, I = (M = "[iFrameSizer]").length, r = window.requestAnimationFrame, g = { autoResize: !(i = k = null), bodyBackground: null, bodyMargin: null, bodyMarginV1: 8, bodyPadding: null, checkOrigin: !(a = l = !1), inPageLinks: !(F = {}), enablePublicMethods: !(f = 0), heightCalculationMethod: "bodyOffset", id: "iFrameResizer", interval: 32, log: !(m = { max: 1, scroll: 1, bodyScroll: 1, documentElementScroll: 1 }), maxHeight: 1 / 0, maxWidth: 1 / 0, minHeight: 0, minWidth: 0, mouseEvents: !0, resizeFrom: "parent", scrolling: !1, sizeHeight: !0, sizeWidth: !1, warningTimeout: 5e3, tolerance: 0, widthCalculationMethod: "scroll", onClose: function () { return !0 }, onClosed: function () { }, onInit: function () { }, onMessage: function () { N("onMessage function not defined") }, onMouseEnter: function () { }, onMouseLeave: function () { }, onResized: function () { }, onScroll: function () { return !0 } }, z = {}, window.jQuery && v(window.jQuery), "function" == typeof define && define.amd ? define([], y) : "object" == typeof module && "object" == typeof module.exports && (module.exports = y()), window.iFrameResize = window.iFrameResize || y()) }();
    //# sourceMappingURL=iframeResizer.map
  </script>  
<script>
    // Callback function to execute when mutations are observed
    const observerCallback = (mutationsList, observer) => {
      for (let mutation of mutationsList) {
        if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
          mutation.addedNodes.forEach(node => {
            if (node.querySelector) {
              const iframe = node.querySelector('iframe[src^="https://iframes.pm.by"]');
              if (iframe) {
                const wWidth = window.innerWidth;
                if (
                  iframe.src.includes("/personalData.html") ||
                  iframe.src.includes("/verification.html") ||
                  wWidth >= 1024
                ) {
                  iFrameResize({ scrolling: true }, iframe);
                } else {
                  iframe.scrolling = "yes";
                }
              }
            }
          });
        }
      }
    };

    // Create an observer instance linked to the callback function
    const observer = new MutationObserver(observerCallback);

    // Configuration of the observer: observe child additions to the entire document
    const config = { childList: true, subtree: true };

    // Start observing the document for configured mutations
    observer.observe(document.documentElement, config);
  </script>
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TZBH3Q4"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>

<script>
  window.addEventListener('message', (event) => {
    if (event.data && event.data.type === 'requestAuthorizationData') {
      const authorizationDataStr = localStorage.getItem('authorizationData');
      let authorizationData;
      try {
        authorizationData =
          authorizationDataStr && JSON.parse(authorizationDataStr);
      } catch (e) {
        console.log(e);
      }
      event.source.postMessage(
        { type: 'responseAuthorizationData', data: authorizationData },
        '*'
      );
    }
  });
</script>
<script>
      const handleMessage = (event) => {
        if (event.data.type === 'ga_data') {
          try {
            window.dataLayer.push(event.data.ga_event);
          } catch (err) {
            console.error('platform ga_event push error:', err.message);
          }
        }
      };
      window.addEventListener('message', handleMessage, false);
</script>
<script>
  window.addEventListener("message", (event) => {
    if (event.data && event.data.type === "requestAutoLogin") {
      const autologin = new URLSearchParams(document.location.search).get(
        "autologin"
      );
        event.source.postMessage(
          { type: "responseAutoLogin", autologin },
          event.origin
        );
    }
  });
</script>
<script>
window.addEventListener('message', (event) => {
  if (event.data && event.data.type === 'requestCheckEmail') {
    const sid = new URLSearchParams(document.location.search).get('sid');
    const code = new URLSearchParams(document.location.search).get('code');
    const ot = new URLSearchParams(document.location.search).get('ot');
    event.source.postMessage(
      { type: 'responseCheckEmail', sid, code, ot },
      event.origin
    );
  }
});
</script>
<script>
window.addEventListener('message', (event) => {
  if (event.data && event.data.type === 'requestGetReferrer') {
    
    const { referrer } = document

    event.source.postMessage(
      { type: 'responseGetReferrer', data: referrer },
      '*'
    );
  }
});
</script>
<script id="dgb-event">
  document.addEventListener('dgb-event', (event) => {
    var category = event.detail.category
    var name_event = event.detail.name
    var target = event.detail.target
    var rootTarget = event.detail.rootTarget
    var message_th = event.detail?.data?.message_theme
    var message_i = event.detail?.data?.message_id
    var bannersection = event.detail?.data?.bannerSection
    var page_url = event.detail?.data?.page
    var lobby = event.detail?.data?.lobby
    var description = event.detail?.data?.description
    var uniqueurlname = event.detail?.data?.uniqueUrlName
    var bonusid = event.detail?.data?.bonusId
    var blockName = event.detail?.data?.blockName
    var block = event.detail?.data?.block
    var bonustitle = event.detail?.data?.bonusTitle
    var themes = event.detail?.data?.selectedThemes
    var themesid = event.detail?.data?.themeIds?.[0]
    var name = event.detail?.data?.name
    var provider_url = event.detail?.data?.image
    var data = event.detail?.data
    var lobby_url = event.currentTarget?.URL.split('/').slice(-6)[0]
    var lobby_url_top_winners = (event.currentTarget?.URL || event.target?.URL)?.split('/').find(segmentUrl => ['casino-lobby', 'livecasino', 'tvgames-lobby', 'fastgames-lobby', 'virtualsport-lobby'].includes(segmentUrl))
    var category_url = event.srcElement?.URL.split('/').slice(-2)[0]
    var game_url_desktop_web = event.currentTarget?.URL.split('/').slice(-4)[0]
    var game_url_rplc_desktop_web = game_url_desktop_web.replaceAll("%20", ' ').replaceAll("%E2%80%99s", '')
    var provider_url_desktop_web = event.currentTarget?.URL.split('/').slice(-5)[0]
    var widget = event.detail?.data?.widget
    var widget_casino = event.detail?.data?.casino_widget
    var action = event.detail.action
    var error_message = event.detail?.data?.error_message
    var detail_type = event.detail.type
    var game_top_winners = event.detail?.data?.gameUrl
    var provider_top_winners = event.detail?.data?.gameProviderId
    var provider_name = event.detail?.data?.gameProviderName
    var game_bonus = event.detail?.data?.gameTitle
    var bonusactive = event.detail?.data?.isBonusActive
    var input_text = event.detail?.data?.inputText
    var selected_group = event.detail?.data?.selectedGroup
    var IsFirst = event.detail?.data?.IsFirst
    var detail_data_type = event.detail?.data?.type
    var widgetName = event.detail?.data?.widgetName
    var widgetType = event.detail?.data?.widgetType
    var provideridjackpot = event.detail?.data?.providerId
    var event = ''
    var event_category = ''
    var banner_name = ''
    var message_theme = ''
    var message_id = ''
    var page = ''
    var game_name = ''
    var casino_category = ''
    var bonus_id = ''
    var bonus_name = ''
    var casino_theme = ''
    var casino_lobby = ''
    var provider = ''
    var error = ''
    var casino_widget = ''
    var bonus_active = ''
    var stories_block_name = ''
    var stories_name = ''
    var button_name = ''
    var text = ''
    var first_dep = ''
    var name_dg = ''
    var type_groupe = ''
    var widget_name = ''
    var widget_type = ''
    if (provider_url == undefined) { provider_url = '' } else {
      provider_url = provider_url.slice(-2) === '/' ? provider_url.slice(0, -2) : provider_url
      provider_url = provider_url.split('/').slice(-2)[0]
    }
    if (category == 'nav' && (rootTarget == 'mainMenu' || rootTarget == 'header') && target != 'BeteraPass') {
      event = category + '_' + "header" + "_" + target
      event_category = category + "_" + "header"
    } else if (name_event == 'dgb-lobby-navbar-menu-item') {
      event = 'casino_group_left_menu'
      event_category = lobby_url_top_winners + "_" + rootTarget
      type_groupe = detail_data_type
      casino_theme = name
    } else if (rootTarget == 'top-winners-widget' && (target.match(/TopWinners/))) {
      event = category + "_" + target
      event_category = category
      widget_name = widgetName
      widget_type = widgetType
    } else if (rootTarget == 'topWinnersWidget' && name_event == 'dgb-nav-top-winners-widget-game-click') {
      event = category + '_' + rootTarget + '_' + "gamestopwinners"
      event_category = category + '_' + lobby_url_top_winners
      game_name = game_top_winners
      provider = provider_top_winners
      widget_name = widgetName
      widget_type = widgetType
    } else if (rootTarget == 'topWinnersWidget' && name_event != 'dgb-nav-top-winners-widget-game-click') {
      event = category + '_' + rootTarget + '_' + target
      event_category = category + '_' + lobby_url_top_winners
      game_name = game_top_winners
      provider = provider_top_winners
      widget_name = widgetName
      widget_type = widgetType
    } else if (rootTarget == 'card' && name_event == 'dgb-card-game-mobile') {
      event = 'casino' + '_' + rootTarget + '_' + target
      event_category = rootTarget
      game_name = description
      provider = provider_name
    } else if (target == 'jackpot-game' && rootTarget == 'jackpot-widget') {
      event = category + '_' + 'play-btn_' + target
      event_category = category
      game_name = name
      provider = provideridjackpot
    } else if (target == 'game-demo-btn' && name_event.match(/game-demo-bt/)) {
      event = lobby + '_' + target
      event_category = lobby
      game_name = description
      provider = provider_url
      casino_category = category_url
      casino_widget = widget
      widget_name = widgetName
      widget_type = widgetType
    } else if (category == 'nav' && (rootTarget == 'MenuContent' || rootTarget == 'secondaryMenu') && target != 'Tournaments_mob') {
      event = category + '_' + "header_menu" + "_" + target
      event_category = category + "_" + "header"
    } else if (category == 'nav' && (rootTarget == 'secondary-menu') && target != 'Tournaments_mob') {
      event = category + '_' + "header_scnd" + "_" + target
      event_category = category + "_" + "header"
    } else if (category == 'nav' && (rootTarget == 'MenuContent' || rootTarget == 'secondaryMenu') && target == 'Tournaments_mob') {
      event = category + '_' + "header_menu" + "_" + "tournaments"
      event_category = category + "_" + "header"
    } else if (category == 'nav' && (rootTarget == 'secondary-menu') && target == 'Tournaments_mob') {
      event = category + '_' + "header_scnd" + "_" + "tournaments"
      event_category = category + "_" + "header"
    } else if (category == 'nav' && rootTarget == 'Footer') {
      event = target + '_' + rootTarget
      event_category = target
    } else if (category == 'deposit' && detail_type == 'success') {
      event = category + '_' + detail_type
      event_category = category
      error = error_message
      first_dep = IsFirst
    } else if (category == 'deposit' || category == 'withdrawal') {
      event = category + '_' + action
      event_category = category
      error = error_message
    }
    else if (category == 'notification') {
      event = "promocodes" + '_' + detail_type
      event_category = "promocodes"
      error = error_message
    } else if (rootTarget == 'header' || rootTarget == 'framePopup') {
      event = target + '_' + rootTarget
      event_category = target
    } else if (category == 'nav' && rootTarget == 'social') {
      event = rootTarget + '_' + target
      event_category = rootTarget
    } else if (category == 'nav' && rootTarget == 'FeaturedProducts') {
      event = "game_button" + '_' + target
      event_category = "game_button"
    } else if (category == 'nav' && rootTarget == 'FeaturedMenu') {
      event = rootTarget + '_' + target
      event_category = rootTarget
    } else if (rootTarget == 'lobbyMenuGroups') {
      event = lobby + '_' + target
      event_category = lobby
      casino_category = uniqueurlname
      if (isNaN(themesid)) { casino_theme = themes } else { casino_theme = themesid }
    } else if (name_event.match(/search-input/) && (target.match(/ame-search-inpu/))) {
      event = rootTarget + '_' + target
      event_category = rootTarget
      text = input_text
      casino_category = selected_group
    } else if ((target === 'button_show_all') && name_event.match(/lobby-games-button-_show-_all/)) {
      event = category + '_' + target
      event_category = category
      casino_category = category
      casino_widget = widget_casino
    } else if (typeof rootTarget === 'string' && (rootTarget.match(/^Lobby.*$/) || rootTarget.match(/^lobby.*$/))) {
      event = lobby + '_' + target
      event_category = lobby
      game_name = description
      provider = provider_url
      casino_category = category_url
      casino_widget = widget
      widget_name = widgetName
      widget_type = widgetType
      if (isNaN(themesid)) { casino_theme = themes } else { casino_theme = themesid }
    } else if ((target === 'play-btn') && name_event.match(/casino-play-bt/)) {
      event = lobby + '_' + target
      event_category = lobby
      game_name = description
      provider = provider_url
      casino_category = category_url
      casino_widget = widget
      widget_name = widgetName
      widget_type = widgetType
      if (isNaN(themesid)) { casino_theme = themes } else { casino_theme = themesid }
    } else if ((target === 'play-btn') && name_event.match(/-play-bt/)) {
      event = lobby + '_' + target
      event_category = lobby
      game_name = description
      provider = provider_name
      casino_category = rootTarget
      casino_widget = widget
      widget_name = widgetName
      widget_type = widgetType
      if (isNaN(themesid)) { casino_theme = themes } else { casino_theme = themesid }
    } else if (rootTarget === 'system-group-widget') {
      event = category + '_' + target
      event_category = category + '_' + target
      casino_category = category
      casino_theme = uniqueurlname
      widget_name = widgetName
      widget_type = widgetType
    } else if ((target === 'favorite-btn') && name_event.match(/casino-favorite/)) {
      event = lobby + '_' + target
      event_category = lobby
      casino_category = category
      casino_theme = uniqueurlname
      game_name = name
      casino_widget = widget
      provider = provider_name
      widget_name = widgetName
      widget_type = widgetType
    } else if ((target === 'game-info') && name_event.match(/game-inf/)) {
      event = lobby + '_' + target
      event_category = lobby
      casino_category = category
      casino_theme = uniqueurlname
      game_name = name
      casino_widget = widget
      provider = provider_name
      widget_name = widgetName
      widget_type = widgetType
    } else if ((target === 'like-btn') && name_event.match(/-like-bt/)) {
      event = lobby + '_' + target
      event_category = lobby
      casino_category = category
      casino_theme = uniqueurlname
      game_name = name
      casino_widget = widget
      provider = provider_name
      widget_name = widgetName
      widget_type = widgetType
    } else if ((target === 'provider-selection') && name_event.match(/provider-detailed-widget-provider-selectio/)) {
      event = category + '_' + target
      event_category = category
      provider = uniqueurlname
      widget_name = widgetName
      widget_type = widgetType
    } else if ((target === 'all-games-btn') && name_event.match(/provider-detailed-widget-all-games-bt/)) {
      event = category + '_provider_' + target
      event_category = category
      provider = uniqueurlname
      widget_name = widgetName
      widget_type = widgetType
    } else if ((rootTarget === 'random-game-widget') && name_event.match(/-random-game-widget/)) {
      event = category + '_' + target
      event_category = category + '_' + rootTarget
      casino_category = lobby
      game_name = name
      provider = provider_name
      widget_name = widgetName
      widget_type = widgetType
    } else if (category == 'banner' && bannersection.match(/^home_page_top_live_casino.*$/)) {
      event = "top_widget" + '_' + "live_casino"
      event_category = "top_widget"
      banner_name = target
      page = page_url
      widget_name = widgetName
      widget_type = widgetType
    } else if (category == 'banner' && bannersection.match(/^home_page_top_casino.*$/)) {
      event = "top_widget" + '_' + "slots"
      event_category = "top_widget"
      banner_name = target
      page = page_url
    } else if (category == 'banner' && bannersection.match(/^home_page_top_virtual_sport.*$/)) {
      event = "top_widget" + '_' + "virtual_sport"
      event_category = "top_widget"
      banner_name = target
      page = page_url
    } else if (category == 'banner' && bannersection.match(/^home_page_top_tv_games.*$/)) {
      event = "top_widget" + '_' + "tv_games"
      event_category = "top_widget"
      banner_name = target
      page = page_url
    } else if (category == 'banner' && bannersection.match(/^home_page_secondary_section.*$/)) {
      event = "slider_secondary_click"
      event_category = "slider"
      banner_name = target
    } else if (category == 'banner') {
      event = "slider" + '_' + page_url + '_' + "click"
      event_category = "slider"
      banner_name = target
    } else if (typeof rootTarget === 'string' && (category == 'nav' && rootTarget.match(/^account.*$/))) {
      event = rootTarget + '_' + target
      event_category = "my_account"
    } else if (rootTarget == 'offered-games-section') {
      event = rootTarget + '_' + target
      event_category = "my_bonus"
      bonus_id = bonusid
      bonus_name = bonustitle
      game_name = game_bonus
      provider = game_url_desktop_web
      bonus_active = bonusactive
    } else if (typeof rootTarget === 'string' && (rootTarget.match(/^offers.*$/) || rootTarget.match(/^bonus.*$/) || rootTarget.match(/^cancel.*$/) || rootTarget.match(/^activation.*$/) || rootTarget.match(/section$/))) {
      event = rootTarget + '_' + target
      event_category = "my_bonus"
      bonus_id = bonusid
      bonus_name = bonustitle
    } else if (typeof rootTarget === 'string' && (rootTarget.match(/^cashier.*$/))) {
      event = rootTarget + '_' + target
      event_category = "cashier"
    } else if (typeof rootTarget === 'string' && (rootTarget.match(/^deposit.*$/) || rootTarget.match(/^Deposit.*$/))) {
      event = rootTarget + '_' + target
      event_category = "deposit"
    } else if (typeof rootTarget === 'string' && (rootTarget.match(/^withdrawal.*$/) || rootTarget.match(/^Withdrawal.*$/))) {
      event = rootTarget + '_' + target
      event_category = "withdrawal"
    } else if (typeof rootTarget === 'string' && (rootTarget.match(/^transaction.*$/))) {
      event = rootTarget + '_' + target
      event_category = "transaction_history"
    } else if (rootTarget == 'messages') {
      event = rootTarget + '_' + target
      event_category = "messages"
      message_theme = message_th
      message_id = message_i
    } else if (name_event == 'dgb-account-popup-changepasswordform-click') {
      event = "my_account_to_restore_password"
      event_category = "my_account"
    } else if (typeof rootTarget === 'string' && (rootTarget.match(/^multiview.*$/))) {
      event = lobby_url + '_' + target
      event_category = lobby_url
      game_name = game_url_rplc_desktop_web
      provider = provider_url_desktop_web
    } else if (rootTarget == 'historyPopup') {
      event = "casino" + '_' + target
      event_category = "casino_history"
      game_name = name
      provider = provider_url
    } else if (rootTarget == 'promotionsSection') {
      event = rootTarget + '_' + target
      event_category = "promo"
    } else if (rootTarget === undefined && name_event.match(/.*\-block.*$/)) {
      event = "stories_block_click"
      event_category = "stories"
      stories_block_name = target
    } else if (name_event.match(/.*\-story.*$/) && name_event.match(/.*\-block.*$/)) {
      if (name_event.match(/.*\-click.*$/)) {
        event = "stories_click"
        event_category = "stories"
        stories_block_name = rootTarget
        stories_name = target
      } else if (!name_event.match(/.*\-click.*$/)) {
        event = "stories_start_play"
        event_category = "stories"
        stories_block_name = rootTarget
        stories_name = target
      }
    } else if (name_event.match(/.*\-story.*$/) && name_event.match(/.*\-button.*$/)) {
      if (target.match(/.*\lose-butto.*$/)) {
        event = "stories_close"
        event_category = "stories"
        stories_block_name = block
        stories_name = rootTarget
        button_name = target
      } else if (!name_event.match(/.*\-close.*$/) && name_event.match(/.*\-clic.*$/) && target.match(/.*\utton-.*$/)) {
        event = "stories_button_click"
        event_category = "stories"
        stories_block_name = blockName
        stories_name = rootTarget
        button_name = target
      }
    } else {
      event = category + '_' + rootTarget + '_' + target
      event_category = category + '_' + rootTarget
      name_dg = name_event
    }
    dataLayer.push({ 'event': event.toLowerCase(), 'event_category': event_category.toLowerCase(), 'banner_name': banner_name.toLowerCase(), 'message_theme': message_theme, 'message_id': message_id, 'page': page_url, 'game_name': game_name, 'casino_category': casino_category, 'bonus_id': bonus_id, 'bonus_name': bonus_name, 'casino_theme': casino_theme, 'provider': provider, 'error': error, 'casino_widget': casino_widget, 'bonus_active': bonus_active, 'stories_block_name': stories_block_name, 'stories_name': stories_name, 'button_name': button_name, 'text': text, 'first_dep': first_dep, 'name_dg': name_dg, 'type_groupe': type_groupe, 'widget_name': widget_name, 'widget_type': widget_type });
  })
</script>
  <script type="text/javascript" id="UR_initiator">

    class UseresponseChat {
      constructor(iid, chatID) {
        this.iid = iid;
        this.chatID = chatID;
        this.script = document.createElement("script");
        this.email = null;
        this.phoneNumber = null;
        this.authData = null;
      }

      useResponseChat = () => {
        if (!document._fpu_)
          document
            .getElementById("UR_initiator")
            .setAttribute("id", this.iid);

        this.script.type = "text/javascript";
        this.script.async = true;
        this.script.src = `//useresponse.chezaja.by/public/sdk/chat-${this.iid}-${this.chatID}.js`;
        (
          document.getElementsByTagName("head")[0] ||
          document.getElementsByTagName("body")[0]
        ).appendChild(this.script);
        console.log(`useresponse: application extracted.`);
        setTimeout(this.getClientData, 1000);
      };

      getClientData = () => {
        this.authData = localStorage.getItem("authorizationData");
        if (this.authData) {
          console.log(`useresponse: getting client data from server.`);
          const access_token = JSON.parse(this.authData).access_token;
          fetch("https://iframes.pm.by/player-api/api/users", {
            method: "GET",
            headers: new Headers({
              Authorization: `Bearer ${access_token}`,
              "Content-Type": "application/json",
            }),
          })
            .then((response) => response.json())
            .then((result) => {

              this.email = result.email;
              this.phoneNumber = result.phone;
              this.useResponseAuth();
            });
        } else {
          console.log(`useresponse: no client data to get from server.`);
        }
      };

      useResponseAuth = () => {
        if (this.authData) {
          console.log(`useresponse: authentication started.`);
          const userID = JSON.parse(this.authData).id;
          UR.userConfig({
            token:
              "ee0c4112ca9596c6d7809bd071fd4b4726bad715e100820e4d04029ccbf4d5cc",
            userEmail: `${userID}@betera.local`,
            properties: {
              property_170: "https://useresponse.chezaja.by",
              property_172: "188",
            },
          });
        }
      };
    }

    const isNativeApp = window.navigator.userAgent.includes("MobNative");
    if (!isNativeApp) {
      console.log(`useresponse: application started.`);
      const useresponseChat = new UseresponseChat(
        "uriid_da39a3ee5e6b4b0d3255bfef95601890afd80709",
        15
      );
      setTimeout(useresponseChat.useResponseChat, 1500);

      window.addEventListener("message", (event) => {
        if (event.data && event.data.type === "clientAuthorized") {
          setTimeout(useresponseChat.getClientData, 1500);
        }
      });
    }

  </script>
<script>
function getCookie(name) {
  const value = `; ${document.cookie}`;
  const parts = value.split(`; ${name}=`);
  if (parts.length === 2) return parts.pop().split(";").shift();
}

window.addEventListener("message", function (event) {
  let cookieScriptConsent = JSON.parse(
    getCookie("CookieScriptConsent") || "null"
  );

  if (
    cookieScriptConsent &&
    cookieScriptConsent.action === "accept" &&
    (event.data.type === "clientAuthorized" ||
      event.data.type === "clientRegistered")
  ) {
    const d = new Date();
    d.setTime(d.getTime() + 24 * 60 * 60 * 1000 * 90);
    const expires = "expires=" + d.toUTCString() + ";";

    document.cookie = `isAccountExists=1; path=/; domain=pm.by; ${expires}`;
  }
});

</script>
<script>
  window.addEventListener("message", (event) => {
    if (event.data && event.data.type === "requestAllowNotificationFlow") {
      const allowNotificationFlow = new URLSearchParams(document.location.search).get(
        "allowNotificationFlow"
      );
      event.source.postMessage(
        { type: "responseAllowNotificationFlow", data: allowNotificationFlow},
        event.origin
      );
    }
  });
</script>
<style>
.tb--promo-tool-page{
background-attachment: fixed;
}
</style>
<script>
  (() => {
    let isPending = false;

    function getAuthorizationData() {
      let authData;
      try {
        authData = JSON.parse(localStorage.getItem('authorizationData'));
      } catch {
        console.error('Wrong authorizationData');
      }
      return authData;
    }

    function handlerRouteChange(event) {
      if (event?.detail?.type === 'route-change') {
        const authData = getAuthorizationData();

        if (
          !isPending &&
          authData?.access_token &&
          event?.detail?.data?.currentLocation?.pathname &&
          !event?.detail?.data?.currentLocation?.pathname.includes('/popup/')
        ) {
          isPending = true;
          fetch(
            'https://iframes.pm.by/player-api/api/users/agreement/showPopup',
            {
              headers: { Authorization: `Bearer ${authData.access_token}` },
            }
          )
            .then((response) => {
              isPending = false;
              if (response.status === 200) {
                response.json().then((data) => {
                  console.log(
                    'dgb-event removeEventListener for notification popup'
                  );
                  document.removeEventListener('dgb-event', handlerRouteChange);
                  if (data.showAgreementPopup) {
                    window.parent.postMessage(
                      {
                        type: 'dgb-route-change',
                        message: {
                          url:
                            window.location.pathname +
                            '/popup/ad/notification-agreement',
                        },
                      },
                      '*'
                    );
                  }
                });
              }
            })
            .catch((error) => {
              isPending = false;
              console.error(error);
            });
        }
      }
    }

    console.log('dgb-event addEventListener for notification popup');
    document.addEventListener('dgb-event', handlerRouteChange);
  })();
</script>
<script type="application/ld+json">
              {
                  "@context": "http://schema.org",
                  "@type": "Game",
                  "name": "Букмекерская контора Betera",
                  "aggregateRating": {
                      "@type": "AggregateRating",
                      "ratingValue": "5",
                      "ratingCount": "1536"
                  }
              }
</script>
<script>
    var counter = 0;
    var maxAttempts = 600;
    var interval = 100;
    var mobileLink = "[href^='https://betera.onelink.me/8Met/mobile']";
    var mobileAppsLink = "[href^='https://pm.by/ru/pages/mobileapps/']";
    var timer = setInterval(() => {
        var sidebarLinks = document.querySelectorAll(mobileLink);
        var footerLink = document.querySelector(mobileAppsLink);
        var smartLink = window.AF_SMART_SCRIPT_RESULT?.clickURL;
        counter++;
        if (counter > maxAttempts) {
            clearInterval(timer);
        }
        if (sidebarLinks.length && footerLink && smartLink) {
            updateLinks([...sidebarLinks, footerLink], smartLink);
            clearInterval(timer);
        }
    }, interval);
    function updateLinks(links, newHref) {
        links.forEach(link => {
            link.href = newHref;
        });
    }
</script>
  <script type="module">
    const TARGET_SELECTORS = ['account-block_sub-menu_item', 'submenu-txt', 'tb--menu-item', 'tb--menu-item_text', 'menu--block-item', 'tb--featured-menu-slider__item', 'mobile-nav_item', 'tb--wb-banner__img'];
    const TARGET_TEXT_VARIANTS = ['магазин', 'store', 'betera pass'];
    let isDragging = false;
    let isMouseDown = false;
    let lastPageURL = '';
    let lastLocale = '';

    const VIP_STATUSES = [4, 8, 13, 15, 16];
    const DEFAULT_LOCALE = 'ru';

    const MAIN_PATHS = [
      '',
      '/',
      '/ru/',
      '/en/',
      '/ru',
      '/en'
    ]

    const COMMON_BANNER_SMARTICO_PATHS = [
      '/casino-home',
      '/livecasino-home',
      '/tvgames-home',
      '/fastgames-home',
      '/virtualsport-home',
    ];

    const LEGACY_BANNER_SMARTICO_PATHS = [
      '/tvgames-lobby',
      '/fastgames-lobby',
      '/virtualsport-lobby',
    ];

    const SPORT_PAGE_PATHS = [
      '/sport/',
      '/sport',
      '/ru/sport/',
      '/ru/sport',
      '/en/sport/',
      '/en/sport',
      '/ru/sport/popup/accountmenu/',
      '/ru/sport/popup/accountmenu',
      '/en/sport/popup/accountmenu/',
      '/en/sport/popup/accountmenu',

      '/ru/sport/eventview/',
      '/ru/sport/eventview',
      '/en/sport/eventview/',
      '/en/sport/eventview',

      '/ru/sport/live',
      '/en/sport/live',
    ];

    const SUSPENDED_SMARTICO_PROFILE_PATHS = [
      "/popup/documents",
      "/popup/cashier",
      "/popup/withdrawal",
      "/popup/wallet",
      "/app-cashier/deposit",
      "/app-cashier/withdrawal"
    ]

    const SUSPENDED_SMARTICO_PLAY_PATHS = [
      "/play/casino-lobby/",
      "/play-fullscreen/casino-lobby/",
      "/sport/event-details/",
      "/esport/event-details/",
      "/play/livecasino/",
      "/play-fullscreen/livecasino/",
      "/play/tvgames-lobby/",
      "/play-fullscreen/tvgames-lobby/",
      "/play/fastgames-lobby/",
      "/play-fullscreen/fastgames-lobby/",
      "/play/virtualsport-lobby/",
      "/play-fullscreen/virtualsport-lobby/"
    ]

    const getSportStatusID = () => {
      try {
        const authData = JSON.parse(localStorage.getItem("authorizationData"));
        return authData?.sportStatusId ?? null;
      } catch (e) {
        return null;
      }
    }

    const isVipStatus = (status) => {
      return VIP_STATUSES.includes(Number(status));
    }

    const setSmarticoSkin = () => {
      const status = getSportStatusID();

      if (status === null) {
        return;
      }

      if (isVipStatus(status)) {
        _smartico.setSkin('v3_betera_vip');
      } else {
        _smartico.setSkin('v3_bet_era_two_new');
      }
    }

    const safeJSONParse = (str, fallback = null) => {
      try {
        return JSON.parse(str);
      } catch {
        return fallback;
      }
    };

    const getCurrentLanguage = () => {
      const language = safeJSONParse(localStorage.getItem('selected_language')) || window.location.pathname.split('/')[1] || DEFAULT_LOCALE;
      return language;
    }

    const setSmarticoID = () => {
      const authData = safeJSONParse(localStorage.getItem('authorizationData'));
      window._smartico_user_id = authData?.id;
    };

    const setSmarticoLanguage = () => {
      window._smartico_language = getCurrentLanguage();
    };

    const setSmarticoConfig = () => {
      setSmarticoID();
      setSmarticoLanguage();
    };

    const initSmarticoSkinListener = () => {
      let counter = 0;
      const smarticoSkinListenerInterval = setInterval(() => {
        if (_smartico) {
          clearInterval(smarticoSkinListenerInterval);

          _smartico.on('gf_starting', () => {
            setSmarticoSkin();
          })
        }

        if (counter > 30) {
          clearInterval(smarticoSkinListenerInterval);
        }

        counter++;
      }, 200)
    }

    initSmarticoSkinListener();

    setSmarticoConfig();

    const prepareString = (string) => {
      return string.toLowerCase().trim().replace(/[\s\u00A0]+/g, '');
    }

    const isClickedElementTarget = (element) => {
      if (TARGET_SELECTORS.some(targetClass => element.classList.contains(targetClass))) {
        const elementText = prepareString(element.innerText);
        const isTargetText = TARGET_TEXT_VARIANTS.some(variant => elementText.includes(prepareString(variant)));

        if (isTargetText) {
          return true;
        }
      }

      if (element.hasAttribute('alt')) {
        const altAttribute = element.getAttribute('alt');
        if (altAttribute.startsWith('dp:')) {
          return altAttribute;
        }
      }

      const targetElement = element.closest('.tb--story-popup')?.querySelector('.image-block img');

      if (targetElement && targetElement.hasAttribute('alt')) {
        const altAttribute = targetElement.getAttribute('alt');
        if (altAttribute.startsWith('dp:')) {
          return altAttribute;
        }
      }

      return false;
    };

    const getParentNode = (child, parentClass, searchDeep) => {
      let counter = searchDeep;
      let currentElement = child;
      while (counter >= 0) {
        if (currentElement.classList.contains(parentClass)) {
          return currentElement;
        }
        currentElement = currentElement.parentNode;
        counter--;
      }
      return null;
    }

    const getAltAttribute = (imageNode) => {
      const altValue = imageNode.getAttribute('alt');
      return altValue ? altValue : null
    }

    const isClickedElementHasTargetParent = (element, searchDeep) => {
      let counter = searchDeep;
      let currentElement = element;
      while (counter >= 0) {
        currentElement = currentElement.parentNode;
        if (isClickedElementTarget(currentElement))
          return true;
        counter--;
      }
      return false;
    };

    const findWrapperElement = (tag) => {
      let counter = 0;
      return new Promise((resolve, reject) => {
        const wrapperFinderInterval = setInterval(() => {
          const wrapperElement = document.querySelector(tag);
          if (wrapperElement) {
            clearInterval(wrapperFinderInterval);
            resolve(wrapperElement);
          } else if (counter > 10) {
            clearInterval(wrapperFinderInterval);
            reject(new Error('Element not found'));
          }
          counter++;
        }, 300);
      });
    };

    const findNodeInShadowDom = (shadowDomWrapperSelector, shadowDomFindElement) => {
      let counter = 0;
      return new Promise((resolve, reject) => {
        const wrapperFinderInterval = setInterval(() => {
          const wrapperElement = document.querySelector(shadowDomWrapperSelector);
          let findElement = null;

          if (wrapperElement && wrapperElement.hasChildNodes()) {
            for (let i = 0; i < wrapperElement.childNodes.length; i++) {
              let currentElement = wrapperElement.childNodes[i].shadowRoot.querySelector(shadowDomFindElement);
              if (currentElement) {
                findElement = currentElement;
              }
            }
          }

          if (findElement) {
            clearInterval(wrapperFinderInterval);
            resolve(findElement);
          } else if (counter > 10) {
            clearInterval(wrapperFinderInterval);
            reject(new Error('Element not found'));
          }
          counter++;
        }, 300);
      });
    };

    const updateUrlToPopup = (url) => {
      const isDashLastURLSymbol = url.slice(-1) === '/';
      const separator = isDashLastURLSymbol ? '' : '/';
      const urlSubstringIndex = url.indexOf('/popup/');

      if (urlSubstringIndex === -1) {
        return url + `${separator}popup/login`;
      }

      return url.substring(0, urlSubstringIndex) + '/popup/login';
    }

    const handleLogin = () => {
      const isNative = window.navigator.userAgent.toLowerCase().includes('native');
      if (!isNative) {
        const urlToPopup = updateUrlToPopup(window.location.pathname);
        window.parent.postMessage(
          {
            type: 'dgb-route-change',
            message: {
              url:
                urlToPopup,
            },
          },
          '*'
        );
      }
      else {
        window.location.replace('https://pm.by/popup/login');
      }
    }

    const isUserAuth = () => {
      const authData = JSON.parse(localStorage.getItem('authorizationData'));
      return Boolean(authData?.access_token);
    }

    const callSmarticoWidget = (smarticoDeepLink) => {
      if (!isUserAuth()) {
        handleLogin();
      }

      setSmarticoConfig();
      _smartico.dp(smarticoDeepLink);
    }

    const commonListenerHandler = (e, isMobile) => {
      const clickedElement = e.target;
      const parentSearchDeep = isMobile ? 2 : 1;
      const isElementValid = isClickedElementTarget(clickedElement);
      const isElementParentValid = isClickedElementHasTargetParent(clickedElement, parentSearchDeep);
      const deepLink = typeof isElementValid === 'string' ? isElementValid : 'dp:gf';

      const isSmarticoTarget = (isElementValid || isElementParentValid) && !isDragging;

      if (isSmarticoTarget) {
        callSmarticoWidget(deepLink);
      }
    };

    const featuredMenuListener = (e) => {
      const clickedElement = e.target;
      const parentSearchDeep = 2;

      const isElementValid = isClickedElementTarget(clickedElement);
      const isElementParentValid = isClickedElementHasTargetParent(clickedElement, parentSearchDeep);

      const deepLink = typeof isElementValid === 'string' ? isElementValid : 'dp:gf';

      const isSmarticoTarget = (isElementValid || isElementParentValid) && !isDragging;

      if (isSmarticoTarget) {
        callSmarticoWidget(deepLink);
      }
    }

    const promoListenerHandler = (e) => {
      const clickedElement = e.target;
      const isButtonClicked = clickedElement.tagName === 'BUTTON';

      if (!isButtonClicked) {
        return
      }

      const parentNode = getParentNode(clickedElement, 'tb--promotion_item', 3);
      const parentNodeImg = parentNode.querySelector('img');
      const altAttribute = getAltAttribute(parentNodeImg);
      const isBannerImgHasSmarticoAlt = altAttribute.startsWith('dp:') ? true : false;
      const deepLink = isBannerImgHasSmarticoAlt ? altAttribute : '';

      const isSmarticoTarget = isButtonClicked && isBannerImgHasSmarticoAlt;

      if (isSmarticoTarget) {
        callSmarticoWidget(deepLink);
      }
    };

    const sportListenerHandler = (e) => {
      const clickedBanner = e.target;
      const bannerImg = clickedBanner.querySelector('img');
      const altAttribute = getAltAttribute(bannerImg);
      const isBannerImgHasSmarticoAlt = altAttribute && altAttribute.startsWith('dp:');

      if (isBannerImgHasSmarticoAlt) {
        const deepLink = altAttribute;
        callSmarticoWidget(deepLink);
      }
    };

    const initHeaderSmarticoListener = async () => {
      const header = await findWrapperElement('.header-block').catch();
      const modalRoot = await findWrapperElement('#modal-root').catch();

      let mobileMenu = null;
      let mobileBottomMenu = null;

      let isDesktop = window.innerWidth >= 1024;

      const mobileHandler = (e) => commonListenerHandler(e, true);
      const desktopHandler = (e) => commonListenerHandler(e, false);

      const setEventHandlers = async (isDesktopMode) => {
        if (modalRoot) {
          modalRoot.addEventListener('click', mobileHandler);
        }

        if (isDesktopMode) {
          if (header) {
            header.addEventListener('click', desktopHandler);
          }

          if (mobileMenu) {
            mobileMenu.removeEventListener('click', mobileHandler);
          }

          if (mobileBottomMenu) {
            mobileBottomMenu.removeEventListener('click', mobileHandler);
          }
        } else {
          if (header) {
            header.removeEventListener('click', desktopHandler);
          }

          if (!mobileMenu) {
            mobileMenu = await findWrapperElement('.header-mobile-menu').catch();
          }

          if (mobileMenu) {
            mobileMenu.addEventListener('click', mobileHandler);
          }

          if (!mobileBottomMenu) {
            mobileBottomMenu = await findWrapperElement('.mobile-nav_list').catch();
          }

          if (mobileBottomMenu) {
            mobileBottomMenu.addEventListener('click', mobileHandler);
          }
        }
      };

      setEventHandlers(isDesktop);

      window.addEventListener('resize', () => {
        const isDesktopAfterResize = window.innerWidth >= 1024;
        if (isDesktop !== isDesktopAfterResize) {
          isDesktop = isDesktopAfterResize;
          setEventHandlers(isDesktop);
        }
      });
    };

    initHeaderSmarticoListener();

    window.addEventListener('message', (event) => {
      const isAuthorizationEvent = (event.data.type === 'clientAuthorized' || event.data.type === "clientRegistered");

      if (
        isAuthorizationEvent && window.innerWidth < 1024) {
        initHeaderSmarticoListener();
      }
    })

    const initBannerSmarticoListener = async (wrapperSelector) => {
      const bannerWrapper = await findWrapperElement(wrapperSelector).catch();

      const handleMouseDown = () => {
        isDragging = false;
        isMouseDown = true;
      };

      const handleMouseMove = () => {
        if (isMouseDown) {
          isDragging = true;
        }
      };

      const handleMouseUp = () => {
        isMouseDown = false;
        setTimeout(() => {
          isDragging = false;
        }, 10);
      };

      if (bannerWrapper) {
        ['mousedown', 'touchstart'].forEach(eventType => {
          bannerWrapper.addEventListener(eventType, handleMouseDown);
        });

        ['mousemove', 'touchmove'].forEach(eventType => {
          bannerWrapper.addEventListener(eventType, handleMouseMove);
        });

        ['mouseup', 'touchend'].forEach(eventType => {
          bannerWrapper.addEventListener(eventType, handleMouseUp);
        });
      }

      if (bannerWrapper) {
        bannerWrapper.addEventListener('click', (e) => {
          commonListenerHandler(e, false)
        });
      }
    };

    const initPromoSmarticoListener = async () => {
      const promotionBannerWrapper = await findWrapperElement('.tb--promotion_wrapper').catch();

      if (promotionBannerWrapper) {
        promotionBannerWrapper.addEventListener('click', (e) => {
          promoListenerHandler(e);
        });
      }
    }

    const initFeaturedMenuListener = async () => {
      const featuredMenuWrapper = await findWrapperElement('.tb--wb-banner img[alt^="dp"]');

      if (featuredMenuWrapper) {
        featuredMenuWrapper.addEventListener('click', (e) => {
          featuredMenuListener(e);
        });
      }
    }

    const initSportSmarticoListener = async () => {
      const activeParentNode = window.innerWidth >= 1024 ? '#sport_div_iframe' : '#sport_mobile_root';
      const sportBannerWrapper = await findNodeInShadowDom(activeParentNode, '.dgb_banner').catch();

      if (sportBannerWrapper) {
        sportBannerWrapper.addEventListener('click', (e) => {
          sportListenerHandler(e)
        });
      }
    }

    (function () {
      const originalPushState = history.pushState;
      const originalReplaceState = history.replaceState;

      const locationChangeEvent = new Event('locationchange');

      history.pushState = function (...args) {
        const result = originalPushState.apply(this, args);
        window.dispatchEvent(locationChangeEvent);
        return result;
      };

      history.replaceState = function (...args) {
        const result = originalReplaceState.apply(this, args);
        window.dispatchEvent(locationChangeEvent);
        return result;
      };

      window.addEventListener('popstate', () => {
        window.dispatchEvent(locationChangeEvent);
      });

      window.addEventListener('load', () => {
        window.dispatchEvent(locationChangeEvent);
      });

    })();

    let debounceTimer;
    const debounce = (callback, delay) => {
      clearTimeout(debounceTimer);
      debounceTimer = setTimeout(callback, delay);
    };

    const smarticoPopupStyle = document.createElement('style');
    document.head.appendChild(smarticoPopupStyle);

    const hideSmarticoPopup = () => {
      smarticoPopupStyle.textContent = `
        iframe.__btgPromoHolder,
        iframe#__btgPromoHolder {
          display:none;
        }
      `
    }

    const showSmarticoPopup = () => {
      smarticoPopupStyle.textContent = '';
    }

    const handleSmarticoSuspend = (pathname) => {
      const isSuspendedProfilePath = SUSPENDED_SMARTICO_PROFILE_PATHS.some((path) => {
        if (pathname.includes(path)) {
          return true;
        }
      })

      const isSuspendedPlayPath = SUSPENDED_SMARTICO_PLAY_PATHS.some((path) => {
        if (pathname.includes(path)) {
          return true;
        }
      })

      if (isSuspendedProfilePath) {
        hideSmarticoPopup();
        _smartico.suspendPopups(true);
        _smartico.suspendInbox(true);
        _smartico.suspendMiniGames(true);
        return;
      }

      if (isSuspendedPlayPath) {
        hideSmarticoPopup();
        _smartico.suspendPopups(true);
        _smartico.suspendInbox(false);
        _smartico.suspendMiniGames(true);
        return;
      }

      showSmarticoPopup();
      _smartico.suspendPopups(false);
      _smartico.suspendInbox(false);
      _smartico.suspendMiniGames(false);
    }

    window.addEventListener('locationchange', () => {
      debounce(() => {
        const pathname = window.location.pathname;
        const isPageWithCommonBanner = COMMON_BANNER_SMARTICO_PATHS.some(path => pathname.includes(path));
        const isMainPage = MAIN_PATHS.some(path => path === pathname);
        const isNotGameMode = (!pathname.includes("/play/") && isPageWithCommonBanner);
        const isPromoPage = pathname.includes('/pages');
        const isPromoPrevPage = lastPageURL.includes("/pages/");
        const isPlayPrevPage = lastPageURL.includes("/play/");
        const currentLocale = getCurrentLanguage();
        const isLocaleChange = currentLocale !== lastLocale;
        const isLegacyPageWithCommonBanner = LEGACY_BANNER_SMARTICO_PATHS.some(path =>
          pathname.includes(path)
        );
        const isNotGameModeOnLegacyPaths = !pathname.includes("/play/") && isLegacyPageWithCommonBanner;

        handleSmarticoSuspend(pathname);

        if (isLocaleChange) {
          setSmarticoLanguage();
        }

        if (isPromoPage || isPlayPrevPage || isPromoPrevPage || isLocaleChange) {
          initHeaderSmarticoListener();
        }

        if (isNotGameMode) {
          initBannerSmarticoListener('.banners--long-list');
        }

        if (isMainPage || isNotGameModeOnLegacyPaths) {
          initBannerSmarticoListener('.top-banner-section');
        }

        if (isMainPage) {
          initFeaturedMenuListener();
        }

        if (pathname.includes("/promotions")) {
          initPromoSmarticoListener();
        }

        if (SPORT_PAGE_PATHS.includes(pathname)) {
          initSportSmarticoListener();
        }

        lastPageURL = pathname;
        lastLocale = currentLocale;
      }, 500);
    });
  </script>
<script>
    (() => {
      const hasAbTestCookie = document.cookie.includes('abTestCookie');
      const hasAbTestInfo = document.cookie.includes('abTestInfo');
      if (hasAbTestCookie) {
        document.cookie = 'abTestCookie=; path=/; domain=pm.by; expires=Thu, 01 Jan 1970 00:00:00 UTC;';
      }
      if (hasAbTestInfo) {
        document.cookie = 'abTestInfo=; path=/; domain=pm.by; expires=Thu, 01 Jan 1970 00:00:00 UTC;';
      }
    })();
  </script>
    <script type="module">
      const POPUP_BN_STATE_KEY = "POPUP_BN_STATE";
      const SHOW_POPUP_PAGE_NUMBER = 3;
      const STATE_KEYS = {
        FIRST_VISIT: "firstVisit",
        PAGE_VISIT_COUNT: "pageVisitCount",
        POPUP_SHOWN: "popupShown",
        POPUP_PENDING: "popupPending",
        LAST_VISITED_PATH: "lastVisitedPath",
        SKIP_NEXT_PAGE_INCREMENT: "skipNextPageIncrement",
      };

      const BLOCKED_PATHS = [
        "/casino-lobby/popular",
        "/sport/event-details",
        "/popup/",
        "/play/",
      ];

      let isPopupStateCleared = false;

      const getPopupState = () => {
        if (isPopupStateCleared) {
          return {};
        }
        const data = sessionStorage.getItem(POPUP_BN_STATE_KEY);
        return JSON.parse(data || "{}");
      };

      const setPopupState = (updates) => {
        if (isPopupStateCleared) {
          return;
        }
        const state = getPopupState();

        for (let key in updates) {
          if (Object.prototype.hasOwnProperty.call(updates, key)) {
            if (updates[key] === null) {
              delete state[key];
            } else {
              state[key] = updates[key];
            }
          }
        }

        sessionStorage.setItem(POPUP_BN_STATE_KEY, JSON.stringify(state));
      };

      const isBlockedPage = () => {
        const currentPath = window.location.pathname.toLowerCase();
        return BLOCKED_PATHS.some((blockedPath) =>
          currentPath.includes(blockedPath)
        );
      };

      const incrementPageVisitCount = () => {
        const state = getPopupState();

        const lastVisitedPath = state[STATE_KEYS.LAST_VISITED_PATH] || "";
        const currentPath = window.location.pathname;
        const count = Number(state[STATE_KEYS.PAGE_VISIT_COUNT]) || 0;

        if (
          lastVisitedPath.includes("/popup/") &&
          !state[STATE_KEYS.SKIP_NEXT_PAGE_INCREMENT]
        ) {
          setPopupState({ [STATE_KEYS.SKIP_NEXT_PAGE_INCREMENT]: true });
          return count;
        }

        if (state[STATE_KEYS.SKIP_NEXT_PAGE_INCREMENT]) {
          setPopupState({ [STATE_KEYS.SKIP_NEXT_PAGE_INCREMENT]: null });
          return count;
        }

        if (isBlockedPage(lastVisitedPath) || isBlockedPage(currentPath)) {
          return count;
        }

        if (!state[STATE_KEYS.FIRST_VISIT]) {
          setPopupState({ [STATE_KEYS.FIRST_VISIT]: "true" });
          return count;
        }

        setPopupState({ [STATE_KEYS.PAGE_VISIT_COUNT]: String(count + 1) });
        return count + 1;
      };

      const callBetNewsPopup = () => {
        _smartico.action("BetnewsPopup");
        setPopupState({ [STATE_KEYS.POPUP_SHOWN]: "true" });
      };

      const waitingForSmarticoLoad = () => {
        let counter = 0;
        const checkSmartico = setInterval(() => {
          if (typeof _smartico !== "undefined" && _smartico) {
            clearInterval(checkSmartico);
            callBetNewsPopup();
          } else if (counter > 10) {
            clearInterval(checkSmartico);
            setPopupState({ [STATE_KEYS.POPUP_PENDING]: "true" });
          }
          counter++;
        }, 300);
      };

      const showPopup = () => {
        try {
          if (typeof _smartico !== "undefined" && _smartico) {
            callBetNewsPopup();
          } else {
            waitingForSmarticoLoad();
          }
        } catch (e) {
          setPopupState({ [STATE_KEYS.POPUP_PENDING]: "true" });
        }
      };

      const handlePopupLogic = () => {
        const state = getPopupState();

        const isPopupShown = state[STATE_KEYS.POPUP_SHOWN] === "true";
        const isPopupPending = state[STATE_KEYS.POPUP_PENDING] === "true";

        if (isPopupShown || isBlockedPage()) return;

        const pageVisitCount = incrementPageVisitCount();

        if (pageVisitCount >= SHOW_POPUP_PAGE_NUMBER || isPopupPending) {
          showPopup();
          setPopupState({ [STATE_KEYS.POPUP_PENDING]: null });
        }
      };

      const state = getPopupState();
      const isPopupShown = Boolean(state[STATE_KEYS.POPUP_SHOWN]);

      if (!isPopupShown) {
        const onRouteChange = () => {
          const currentPath = window.location.pathname;

          setPopupState({ [STATE_KEYS.LAST_VISITED_PATH]: currentPath });
          handlePopupLogic();
        };

        const overrideHistoryMethods = () => {
          const originalPushState = history.pushState;
          history.pushState = function (...args) {
            originalPushState.apply(this, args);
            onRouteChange();
          };
        };

        onRouteChange();
        overrideHistoryMethods();
      }
    </script>
    <script>
      !(function (t, e, n, s, a, c, i, o, p) {
        (t.AppsFlyerSdkObject = a),
          (t.AF =
            t.AF ||
            function () {
              (t.AF.q = t.AF.q || []).push(
                [Date.now()].concat(Array.prototype.slice.call(arguments))
              );
            }),
          (t.AF.id = t.AF.id || i),
          (t.AF.plugins = {}),
          (o = e.createElement(n)),
          (p = e.getElementsByTagName(n)[0]),
          (o.async = 1),
          (o.src =
            "https://websdk.appsflyer.com?" +
            (c.length > 0 ? "st=" + c.split(",").sort().join(",") + "&" : "") +
            (i.length > 0 ? "af_id=" + i : "")),
          p.parentNode.insertBefore(o, p);
      })(window, document, "script", 0, "AF", "banners", {
        banners: { key: "8a26d087-9cd1-4bca-93a5-b7803c2d1306" },
      });

      var debounceTimer;
      var debounce = (callback, delay) => {
        clearTimeout(debounceTimer);
        debounceTimer = setTimeout(callback, delay);
      };

      window.addEventListener("locationchange", () => {
        debounce(() => {
          var isNative = window.navigator.userAgent
            .toLowerCase()
            .includes("native");
          if (isNative) {
            AF("banners", "hideBanner");
          } else {
            AF("banners", "showBanner");
          }
        }, 500);
      });
    </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.12.2/lottie.min.js"></script>
<script type="module">
  const STORAGE_KEY = "userNotPassedVerification";
  const DAY_IN_MS = 86400000; // 24h
  const POPUP_URL = "/popup/";
  const DEBOUNCE_TIMING = 300;
  const STORAGE_UUID_KEY = 'uuId';
  let debounceTimer;

  const debounce = (callback, delay) => {
    clearTimeout(debounceTimer);
    debounceTimer = setTimeout(callback, delay);
  };

  const callDoVerificationPopup = () => {
    window.parent.postMessage(
      {
        type: "dgb-open-popup",
        message: {
          popupName: 'do-verification-popup',
        },
      },
      "*"
    );
  };

  const storageManager = {
    get: (key) => {
      const data = localStorage.getItem(key);
      return data ? JSON.parse(data) : null;
    },
    set: (key, value) => {
      localStorage.setItem(key, JSON.stringify(value));
    },
  };


  const isNativeApp = () => {
    const userAgent = window.navigator.userAgent;
    const isNative = userAgent.toLowerCase().includes("native");
    return isNative;
  }

  const isPlayerAuth = () => {
    const authData = JSON.parse(localStorage.getItem("authorizationData"));
    return Boolean(authData?.access_token);
  };

  const getAuthToken = () => {
    const authData = JSON.parse(localStorage.getItem("authorizationData"));
    return authData?.access_token;
  };

  const authorizedFetch = async (url, headers) => {
    const token = getAuthToken();

    const response = await fetch(url, {
      headers: {
        Authorization: `Bearer ${token}`,
        "Content-Type": "application/json",
        ...headers,
      },
    });

    if (!response.ok) {
      throw new Error(`Fetch error: ${response.status}`);
    }

    return response.json();
  };

  const isPlayerVerified = async () => {
    const data = await authorizedFetch("/siteapi/Account/GetPlayerData");
    return data.isPhysicalVerified;
  };

  const getPlayerDocumentInfo = async () => {
    const uuId = storageManager.get(STORAGE_UUID_KEY);
    const data = await authorizedFetch("https://iframes.pm.by/verif-api/v1/kyc/self", { "X-Browser-Id": uuId });
    return data.document;
  };

  const processDoVerificationResult = () => {
    const storedTime = storageManager.get(STORAGE_KEY);
    const currentTime = Date.now();

    if (!storedTime || storedTime === null || typeof storedTime !== "number") {
      callDoVerificationPopup();
      storageManager.set(STORAGE_KEY, currentTime);
      return;
    }

    const timeDiff = currentTime - storedTime;
    const remainingTime = Math.max(0, DAY_IN_MS - timeDiff);

    if (timeDiff >= DAY_IN_MS) {
      callDoVerificationPopup();
      storageManager.set(STORAGE_KEY, currentTime);
    } else {
      setTimeout(() => {
        callDoVerificationPopup();
      }, remainingTime);
    }
  }

  const handleDoVerification = async () => {
    const isNative = isNativeApp();

    if (isNative) {
      return;
    }

    const isAuth = isPlayerAuth();

    if (!isAuth) {
      return;
    }

    const isVerified = await isPlayerVerified();

    if (isVerified) {
      return
    }

    const playerDocumentInfo = await getPlayerDocumentInfo();

    if (["rejected", "in_progress"].includes(playerDocumentInfo?.status)) {
      return;
    }

    const isPopupOpened = window.location.pathname.includes(POPUP_URL);

    if (!isPopupOpened) {
      processDoVerificationResult();
      return;
    }

    window.addEventListener("locationchange", () => {
      debounce(() => {
        const isPopupOpened = window.location.pathname.includes(POPUP_URL);

        if (!isPopupOpened) {
          processDoVerificationResult();
        }
      }, DEBOUNCE_TIMING);
    })
  };

  const processVerificationInterruptResult = async () => {
    const uuId = storageManager.get(STORAGE_UUID_KEY);
    const data = await authorizedFetch(
      "https://iframes.pm.by/verif-api/v1/kyc/self", { "X-Browser-Id": uuId }
    );
    const { verified: isVerificationFinished, scenarios } = data;

    const isVerificationInProgress = scenarios && Object.keys(scenarios).length === 0;

    const isPlayerStartedVerification = isVerificationFinished || isVerificationInProgress;

    if (!isPlayerStartedVerification) {
      callDoVerificationPopup();
    }
  };

  const handleVerificationInterrupt = () => {
    const isNative = isNativeApp();

    if (isNative) {
      return;
    }

    let isPopupShown = false;
    let isVerificationPopupOpened = false;

    window.addEventListener("locationchange", () => {
      debounce(() => {
        const pathname = window.location.pathname;

        if (pathname.includes(POPUP_URL)) {
          isVerificationPopupOpened = true;
        }

        if (
          !pathname.includes(POPUP_URL) &&
          !isPopupShown &&
          isVerificationPopupOpened
        ) {
          processVerificationInterruptResult();
          isPopupShown = true;
        }
      }, DEBOUNCE_TIMING);
    });
  };

  document.addEventListener("DOMContentLoaded", () => {
    setTimeout(() => {
      handleDoVerification();
    }, 500)
  });

  window.addEventListener("message", (event) => {
    if (event.data) {
      if (event.data.type === "clientRegistered") {
        handleVerificationInterrupt();
      }
      if (event.data.type === "clientAuthorized") {
        setTimeout(() => {
          handleDoVerification();
        }, 500)
      }
    }
  });
</script>
<script>
  const initUserInformation = () => {
    if (window.hj) {
      window.hj('identify', null, { userId: '' });
    }

    let counter = 0;

    const searchingTimer = setInterval(() => {
      const MAX_TRIES = 30;

      const userLocalStorage = JSON.parse(localStorage.getItem('authorizationData'));
      const userId = userLocalStorage?.id;

      if (userId && window.hj) {
        window.hj("identify", userId, {
          userId: userId ? `${userId}` : "",
        });
        clearInterval(searchingTimer);
      }

      if (counter > MAX_TRIES) {
        clearInterval(searchingTimer);
        window.hj('identify', null, { userId: '' });
      }

      counter++;
    }, 100)
  };

  const appIsNative = window.navigator.userAgent.includes("MobNative");

  if (!appIsNative) {
    initUserInformation();
  }

  window.addEventListener("message", (event) => {
    if (event.data &&
      (event.data.type === "clientAuthorized"
        || event.data.type === "clientRegistered")) {
      initUserInformation();
    }
  });
</script>
    <script type="module">
      const SMARTICO_HASH = "#_smartico_dp";
      const urlHash = window.location.hash;

      const getDeepLinkValue = () => {
        const index = urlHash.indexOf("=");
        return index !== -1 ? urlHash.substring(index + 1) : "dp:gf";
      };

      const handleLogin = () => {
        const baseUrl = window.location.origin;
        const isDashLastURLSymbol = window.location.pathname.slice(-1) === "/";
        const separator = isDashLastURLSymbol ? "" : "/";
        const isNative = window.navigator.userAgent
          .toLowerCase()
          .includes("native");
        if (!isNative) {
          window.parent.postMessage(
            {
              type: "dgb-route-change",
              message: {
                url: `${window.location.pathname}${separator}popup/login`,
              },
            },
            "*"
          );
        } else {
          window.location.replace(`${baseUrl}/popup/login`);
        }
      };

      const getAuthData = (key) => {
        const isUserAuth = Boolean(localStorage[key]);
        if (!isUserAuth) {
          return null;
        }

        return JSON.parse(localStorage.getItem(key));
      };

      const setSmarticoID = () => {
        const authData = getAuthData("authorizationData");
        window._smartico_user_id = authData?.id;
      };

      const openWidget = () => {
        const deepLinkValue = getDeepLinkValue();
        setSmarticoID();
        _smartico.dp(deepLinkValue);
      };

      const init = () => {
        if (!urlHash.includes(SMARTICO_HASH)) {
          return;
        }

        const authData = getAuthData("authorizationData");
        const isUserAuth = authData?.access_token;

        if (!isUserAuth) {
          handleLogin();
        }
      };

      setTimeout(init, 1000);

      window.addEventListener("message", (event) => {
        if (event.data && event.data.type === "clientAuthorized") {
          if (!urlHash.includes(SMARTICO_HASH)) {
            return;
          }

          openWidget();
        }
      });
    </script>
  <script type="module">
    const DEFAULT_LOCALE = "ru";
    const BREAKPOINT_WIDTH = 1024;
    const mediaQuery = window.matchMedia(
      `(min-width: ${BREAKPOINT_WIDTH}px)`
    );
    const SELECTORS = {
      widgetContainer: "profile-widget-container",
      widgetMountPointDesktop:
        ".account-block_user-select .item__right-side.tb--cp + .account-block_sub-menu",
      widgetMountPointMobile: "main.main-block",
    };

    const CONFIG = {
      findDomElementTimeout: 5000,
    };

    let lastPageURL = "";
    let lastLocale = "";

    const isUserAuth = () => {
      const authData = JSON.parse(localStorage.getItem("authorizationData"));
      return Boolean(authData?.access_token);
    };

    const safeJSONParse = (str, fallback = null) => {
      try {
        return JSON.parse(str);
      } catch {
        return fallback;
      }
    };

    const getCurrentLanguage = () => {
      const language =
        safeJSONParse(localStorage.getItem("selected_language")) ||
        window.location.pathname.split("/")[1] ||
        DEFAULT_LOCALE;
      return language;
    };

    const setSmarticoID = () => {
      const authData = safeJSONParse(
        localStorage.getItem("authorizationData")
      );
      window._smartico_user_id = authData?.id;
    };

    const setSmarticoLanguage = () => {
      window._smartico_language = getCurrentLanguage();
    };

    const setSmarticoConfig = () => {
      setSmarticoID();
      setSmarticoLanguage();
    };

    class ProfileWidget {
      constructor() {
        this.root = document.createElement("div");
        this.root.className = SELECTORS.widgetContainer;
        this.root.innerHTML = this.getTemplate();
        this.dom = this.collectDomRefs();
        this.handleClick = this.handleClick.bind(this);
        this.root.addEventListener("click", this.handleClick);
        this.currentLevel = null;
        this.nextLevel = null;
        this.isFinalLevel = false;
      }

      getTemplate() {
        return `
            <div class="profile-widget profile-widget_loading">
              <div class="profile-widget__container">
                <div class="profile-widget__avatar">
                  <img
                    class="profile-widget__avatar-img"
                    src=""
                    alt=""
                  />
                </div>
                <h3 class="profile-widget__name"></h3>
                <p class="profile-widget__level"></p>
                <div class="balance">
                  <img
                    class="balance__img"
                    src="https://cdn.cvpm-digi.com/public/40fb8b840bcc48109b6e3ad790c5da81/icons/bets-icon.png"
                    alt="diamond-icon"
                  />
                  <p class="balance__diamonds"></p>
                </div>
                <div class="progressbar">
                  <progress
                    class="progressbar__line"
                    value="0"
                    max="0"
                    aria-label="прогресс пользователя"
                  ></progress>
                  <div class="progressbar__points">
                    <span class="points points_current">0</span>
                    <span class="points points_separator">/</span>
                    <span class="points points_next-level">0</span>
                  </div>
                </div>
              </div>
            </div>
          `;
      }

      collectDomRefs() {
        return {
          widget: this.root.querySelector(".profile-widget"),
          avatar: this.root.querySelector(".profile-widget__avatar-img"),
          name: this.root.querySelector(".profile-widget__name"),
          levelName: this.root.querySelector(".profile-widget__level"),
          balanceValue: this.root.querySelector(".balance__diamonds"),
          progress: this.root.querySelector(".progressbar__line"),
          pointsCurrent: this.root.querySelector(".points_current"),
          pointsNext: this.root.querySelector(".points_next-level"),
        };
      }

      setLoading(isLoading) {
        this.dom.widget.classList.toggle("profile-widget_loading", isLoading);
      }

      getCurrentAndNextLevels = (profile, allLevels) => {
        const currentLevelId = profile.ach_level_current_id;
        const nextLevelId = profile.ach_level_current_id + 1;

        let currentLevel = null;
        let nextLevel = null;

        for (const level of allLevels) {
          if (level.id === currentLevelId) {
            currentLevel = level;
          } else if (level.id === nextLevelId) {
            nextLevel = level;
          }

          if (currentLevel && nextLevel) {
            break;
          }
        }

        this.currentLevel = currentLevel;
        this.nextLevel = nextLevel;
      };

      render({ profile, allLevels }) {
        if (!profile || !allLevels) return;

        this.getCurrentAndNextLevels(profile, allLevels);

        const {
          avatar_url: avatarUrl = "",
          public_username: username = "",
          ach_level_current: currentLevelName = "",
          ach_diamonds_balance: diamondsBalance = 0,
          ach_points_ever: achPointsEver = 0,
        } = profile;

        const { required_points: requiredPointsCurrent = 0 } =
          this.currentLevel;
        const { required_points: requiredPointsNext = 0 } = this.nextLevel;

        const levelProgressMax = requiredPointsNext - requiredPointsCurrent;
        const pointsBalance = Math.abs(requiredPointsCurrent - achPointsEver);

        this.dom.avatar.src = avatarUrl;
        this.dom.name.textContent = username;
        this.dom.levelName.textContent = currentLevelName;
        this.dom.balanceValue.textContent =
          Number(diamondsBalance).toLocaleString("ru-RU");
        this.dom.progress.value = pointsBalance;
        this.dom.progress.max = levelProgressMax;
        this.dom.pointsCurrent.textContent = pointsBalance;
        this.dom.pointsNext.textContent = levelProgressMax;

        this.setLoading(false);
      }

      handleClick() {
        window._smartico.dp("dp:gf");
      }

      destroy() {
        this.root.remove();
      }
    }

    const profileWidgetInstance = new ProfileWidget();

    class ApiRetryHandler {
      constructor(api, options = {}) {
        this.api = api;
        this.retryInterval = options.retryInterval || 2000;
        this.maxRetries = options.maxRetries || 5;
      }

      async fetchUserProfileWithRetry() {
        let attempts = 0;
        while (attempts < this.maxRetries) {
          try {
            const profile = await this.api.getUserProfile();
            if (
              profile &&
              profile.avatar_url !== undefined &&
              profile.public_username !== undefined
            ) {
              return profile;
            }
            throw new Error("Invalid profile data");
          } catch (error) {
            attempts++;
            if (attempts >= this.maxRetries) {
              throw new Error(
                "Max retries reached for fetching user profile"
              );
            }
            await new Promise((resolve) =>
              setTimeout(resolve, this.retryInterval)
            );
          }
        }
      }

      async fetchAllLevelsWithRetry() {
        let attempts = 0;
        while (attempts < this.maxRetries) {
          try {
            const allLevels = await this.api.getLevels();
            if (allLevels.length > 0) {
              return allLevels;
            }
            throw new Error("Invalid levels data");
          } catch (error) {
            attempts++;
            if (attempts >= this.maxRetries) {
              throw new Error("Max retries reached for fetching levels data");
            }
            await new Promise((resolve) =>
              setTimeout(resolve, this.retryInterval)
            );
          }
        }
      }
    }

    const hasProfileWidgetContainer = (parent) => {
      return parent.querySelector(`.${SELECTORS.widgetContainer}`) !== null;
    };

    async function findDomElement(
      selector,
      timeout = CONFIG.findDomElementTimeout
    ) {
      const existingDomElement = document.querySelector(selector);
      if (existingDomElement) {
        return existingDomElement;
      }

      return new Promise((resolve, reject) => {
        const observer = new MutationObserver(() => {
          const observedDomElement = document.querySelector(selector);
          if (observedDomElement) {
            observer.disconnect();
            clearTimeout(timerId);
            resolve(observedDomElement);
          }
        });

        const timerId = setTimeout(() => {
          observer.disconnect();
          reject(
            new Error(`Element "${selector}" not found within ${timeout} ms`)
          );
        }, timeout);

        observer.observe(document.documentElement, {
          childList: true,
          subtree: true,
        });
      });
    }

    function waitForSmarticoApi(timeout = 5000) {
      const start = performance.now();

      return new Promise((resolve, reject) => {
        const intervalId = setInterval(() => {
          const api = window._smartico.api;

          if (api) {
            clearInterval(intervalId);
            resolve(api);
          }

          if (performance.now() - start > timeout) {
            clearInterval(intervalId);
            reject(new Error("Smartico API is still unavailable."));
          }
        }, 250);
      });
    }

    async function fetchProfileDataWithRetry(api) {
      const handler = new ApiRetryHandler(api, {
        retryInterval: 3000,
        maxRetries: 5,
      });

      const profile = await handler.fetchUserProfileWithRetry();
      const allLevels = await handler.fetchAllLevelsWithRetry();

      return { profile, allLevels };
    }

    async function initProfileWidget() {
      if (!window._smartico) {
        throw new Error("Smartico is not available.");
      }

      if (!isUserAuth()) {
        throw new Error("User is not authorized.");
      }

      setSmarticoConfig();

      try {
        if (window.innerWidth >= BREAKPOINT_WIDTH) {
          const mountPointDesktop = await findDomElement(
            SELECTORS.widgetMountPointDesktop
          );

          if (hasProfileWidgetContainer(mountPointDesktop)) {
            return;
          }

          const containerForWidget = mountPointDesktop.firstElementChild;
          if (!containerForWidget) {
            throw new Error("Mount point has no children to insert before.");
          }

          const beforeNode =
            containerForWidget.firstChild?.nextSibling ?? null;
          containerForWidget.insertBefore(
            profileWidgetInstance.root,
            beforeNode
          );
        } else {
          const mountPointMobile = await findDomElement(
            SELECTORS.widgetMountPointMobile
          );

          if (hasProfileWidgetContainer(mountPointMobile)) {
            return;
          }

          mountPointMobile.prepend(profileWidgetInstance.root);
        }

        profileWidgetInstance.setLoading(true);

        const smarticoApi = await waitForSmarticoApi();
        const { profile, allLevels } = await fetchProfileDataWithRetry(
          smarticoApi
        );

        profileWidgetInstance.render({ profile, allLevels });
      } catch (error) {
        throw new Error(
          `ProfileWidget initialization failed: ${error.message}`
        );
      }
    }

    const initWithSetTimeout = () => {
      setTimeout(() => {
        initProfileWidget();
      }, 1000);
    };
    initWithSetTimeout();

    window.addEventListener("message", (event) => {
      const isAuthorizationEvent =
        event.data.type === "clientAuthorized" ||
        event.data.type === "clientRegistered";

      if (isAuthorizationEvent) {
        initWithSetTimeout();
      }
    });

    let debounceTimer;
    const debounce = (callback, delay) => {
      clearTimeout(debounceTimer);
      debounceTimer = setTimeout(callback, delay);
    };

    window.addEventListener("locationchange", () => {
      debounce(() => {
        const pathname = window.location.pathname;
        const isPromoPage = pathname.includes("/pages");
        const isPlayPrevPage = lastPageURL.includes("/play/");
        const isPromoPrevPage = lastPageURL.includes("/pages/");
        const currentLocale = getCurrentLanguage();
        const isLocaleChange = currentLocale !== lastLocale;

        if (isLocaleChange) {
          setSmarticoLanguage();
        }
        if (
          isPromoPage ||
          isPlayPrevPage ||
          isPromoPrevPage ||
          isLocaleChange
        ) {
          initWithSetTimeout();
        }

        lastPageURL = pathname;
        lastLocale = currentLocale;
      }, 500);
    });

    mediaQuery.addEventListener("change", (event) => {
      profileWidgetInstance.destroy();
      initWithSetTimeout();
    });

    (() => {
      let counter = 0;
      const smarticoListenerInterval = setInterval(() => {
        if (_smartico) {
          clearInterval(smarticoListenerInterval);

          _smartico.on("props_change", (props) => {
            profileWidgetInstance.destroy();
            initProfileWidget();
          });
        }

        if (counter > 30) {
          clearInterval(smarticoListenerInterval);
        }

        counter++;
      }, 200);
    })();
  </script>
<!--EndBodyCustomCodes-->
<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9ed3db747e479926',t:'MTc3NjM0OTUwNA=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>

</html>
