- <!DOCTYPE html>
- {% if app.request.locale in('ua') %}
- <html lang="uk" prefix="og: https://ogp.me/ns#">
- {% else %}
- <html lang="ru" prefix="og: https://ogp.me/ns#">
- {% endif %}
- <head>
-     {% block gtm %}
-     {% endblock gtm %}
-     <link rel="preload" as="style" href="{{ asset('/bundles/core/css/preloader.css') }}">
-     <link rel="preload" as="style"  href="{{ asset('/bundles/core/css/bootstrap_build/bootstrap.css') }}">
-     <link rel="stylesheet" media="print" onload="this.media='all'" as="style" href="{{ asset('/bundles/core/css/core.css') }}">
-     <link rel="preconnect" href="https://www.googletagmanager.com">
-     {% block robots %}
-         {% if app.environment == 'dev' %}
-             <meta name="robots" content="noindex, nofollow">
-             <meta name="google-site-verification" content="FWJj2KVU8sswZ4I7nJAffMG7Tj8xgkCr3XX-FgBmAus" />
-         {% elseif seoMeta.robots %}
-             <meta name="robots" content="{{ seoMeta.robots }}">
-         {% endif %}
-     {% endblock robots %}
-     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-     <meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=0">
-     {% if dealer is defined %}
-     <link rel="alternate" type="application/rss+xml" title="{{ dealer.name }}" href="https://{{ dealer.domain }}/rss/"/>
-     {% endif %}
-     {% block head %}
-     {% endblock head %}
-     {% block ogtagStatic %}
-         {% include '@DcSite/Modules/og-tag.html.twig' %}
-     {% endblock ogtagStatic %}
-     {% block ogtagDynamicImage %}
-         {% if dealer is defined and dealer.brand is defined and dealer.brand.logo is defined  %}<meta property="og:image" content="{{ app.request.httpHost }}{{ sonata_path(dealer.brand.logo, 'reference') }}">{% else %}<meta property="og:image" content="/bundles/portal/img/front/logo.jpg" />{% endif %}
-     {% endblock ogtagDynamicImage %}
-     {% block ogtagDynamic %}
-     {% endblock ogtagDynamic %}
-     {% block canonical %}
-         {% if app.request.attributes.get('_route_params')['_locale'] is defined %}
-             {% if app.request.host != 'vidi.ua' %}
-                 <link rel="canonical"
-                       href="{{ url(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}"/>
-             {% else %}
-                 <link rel="canonical" href="{{ app.request.uri }}"/>
-             {% endif %}
-             {% if app.request.get('variation') %}
-                 {% for locale in allowed_locales %}
-                     <link rel="alternate" hreflang="{% if locale == 'ua' %}uk-ua{% else %}ru-ua{% endif %}"
-                           href="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')|merge({'_locale': locale, 'variation': app.request.get('variation')}))) }}"/>
-                 {% endfor %}
-                 <link rel="alternate" hreflang="x-default"
-                       href="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')|merge({'_locale': 'ua', 'variation': app.request.get('variation')}))) }}"/>
-             {% else %}
-                 {% for locale in allowed_locales %}
-                     <link rel="alternate" hreflang="{% if locale == 'ua' %}uk-ua{% else %}ru-ua{% endif %}"
-                           href="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')|merge({'_locale': locale}))) }}"/>
-                 {% endfor %}
-                 <link rel="alternate" hreflang="x-default"
-                       href="{{ absolute_url(path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')|merge({'_locale': 'ua'}))) }}"/>
-             {% endif %}
-         {% endif %}
-     {% endblock canonical %}
-     {% include '@DcSite/Modules/pixel-code.html.twig' %}
- </head>
- <body class="dealer">
- {% block bodyGtm %}
- {% endblock bodyGtm %}
- <div id="preloader">
-     <div id="fountainG">
-         <div id="fountainG_1" class="fountainG"></div>
-         <div id="fountainG_2" class="fountainG"></div>
-         <div id="fountainG_3" class="fountainG"></div>
-         <div id="fountainG_4" class="fountainG"></div>
-         <div id="fountainG_5" class="fountainG"></div>
-         <div id="fountainG_6" class="fountainG"></div>
-         <div id="fountainG_7" class="fountainG"></div>
-         <div id="fountainG_8" class="fountainG"></div>
-     </div>
- </div>
- {% if not app.request.host starts with 'loyalty.' %}
- <iframe style="display: none" src="{{ path('my_ios_cross_domain_auth') }}"></iframe>
- {% endif %}
- {% block socialPreview %}
- {% endblock socialPreview %}
- {% block body %}
- {% endblock body %}
- {% include '@My/Modules/auth.html.twig' %}
- {% block coreMessage %}
-     <div id="vidiCoreMessageWrapper"></div>
- {% endblock coreMessage %}
- {% block initJsApp %}
-     {% set urlResult = backLoginUrl is defined and backLoginUrl ? backLoginUrl : path('my_about_car') %}
-     {% if app.environment != 'dev' %}
-         <script src="{{ asset('bundles/core/js/core.js') }}"></script>
-         <script type="text/javascript">
-             window.app = new ViDiApp({
-                 version: '{{ asset_version(asset('/bundles/core/js/core.js')) }}',
-                 message: {
-                     templateUrl: '{{ path('core_message_load_template') }}',
-                     text: {
-                         btnCancel: '{{ 'app.message.cancel'|trans({},'core') }}',
-                     }
-                 },
-                 http: {
-                     requestErrorText: '{{ 'app.http.server_error'|trans({},'core') }}',
-                 },
-                 preLoader: {
-                     templateUrl: '{{ path('core_preloader_load_template') }}',
-                     preLoaderCss: '{{ asset('/bundles/core/css/preloader.css') }}',
-                 },
-                 authOptions: {
-                     checkUrl: '{{ absolute_url(path('my_cross_domain_auth')) }}',
-                     loginUrl: '{{ path('core_cross_domain_auth') }}',
-                 },
-                 leadForms: {
-                     captchaUrl: '{{ path('base_capthcha_init') }}',
-                     text: {
-                         successTitle: '{{ 'modules.sps_form_title'|trans({}, 'dc_base') }}',
-                         successText: '{{ 'modules.sps_form_subtitle'|trans({}, 'dc_base') }}',
-                         buttonText: '{{ 'pages.base.ok'|trans({}, 'dc_base') }}'
-                     },
-                     href: {
-                         buttonSuccess: null,
-                     },
-                 },
-                 favoriteOptions: {
-                     addUrl: '{{ path('portal_add_favl') }}',
-                     removeUrl: '{{ path('portal_remove_favl') }}',
-                 },
-                 user: {
-                     id: {% if app.user %}{{ app.user.id }}{% else %}false{% endif %},
-                     name: {% if app.user %}'{{ app.user.fullName }}'{% else %}null{% endif %},
-                 },
-                 requiredJs: [
-                     {
-                         path: '{{ asset('/bundles/core/js/jquery-2.2.4.slim.min.js') }}',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/bootstrap/popper.min.js') }}',
-                     },
-                     {
-                         //path: '{{ asset('/bundles/core/js/vue/vue.min.js') }}',
-                         path: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.js',
-                     },
-                 ],
-                 coreJs: [
-                     {
-                         path: '{{ asset('/bundles/core/js/track.js') }}',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/message.js') }}',
-                         onLoadEvent: 'messageLoad',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/http.js') }}',
-                         onLoadEvent: 'httpLoad',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/preloader.js') }}',
-                         onLoadEvent: 'preLoaderLoad',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/lead-form.js') }}',
-                         onLoadEvent: 'leadFormsLoad',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/favorit.js') }}',
-                         onLoadEvent: 'favoritLoad',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/compare.js') }}',
-                         onLoadEvent: 'compareLoad',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/lazy-init.js') }}',
-                         onLoadEvent: 'lazyInitLoad',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/bootstrap/bootstrap.min.js') }}',
-                     },
-                     {
-                         path: '{{ asset('/bundles/core/js/mask.js') }}',
-                     },
-                 ],
-                 coreCss: [
-                     '{{ asset('/bundles/core/css/bootstrap_build/bootstrap.css') }}',
-                     '{{ asset('/bundles/core/css/core.css') }}',
-                     '{{ asset('/bundles/core/css/modules/core-modal/core-modal.css') }}',
-                     '{{ asset('/bundles/core/css/modules/core-modal/modal-fw.css') }}',
-                     '{{ asset('/bundles/core/css/lead-form.css') }}',
-                 ],
-             });
-             app.onCustomEvent('appInit', function () {
-                 app.loadJs('{{ asset('bundles/my/js/register.js') }}', function () {
-                     initAuthRegistration({
-                         locale: '{{ app.request.locale }}',
-                         fbAuthUrl: '{{ path('my_auth_fb_user') }}',
-                         googleAuthUrl: '{{ path('my_auth_google_user') }}',
-                         registerConfoirmUrl: '{{ path('my_register_confirm') }}',
-                         profileUrl: '{{ urlResult }}',
-                         getCodeUrl: '{{ path('my_register_get_code') }}',
-                         resendCodeUrl: '{{ path('my_register_resend_reg_code') }}',
-                         loginCodeUrl: '{{ path('core_register_code_login') }}',
-                         refererUrl: {{ refererUrl is defined ? refererUrl|json_encode|raw : 'null' }},
-                         messageRegisterSuccessTitle: '{{ 'app.message.register.success_title'|trans({},'core') }}',
-                         messageRegisterSuccessText: '{{ 'app.message.register.success_text'|trans({},'core') }}',
-                         messageLoginErrorPassword: '{{ 'app.message.login.error_password'|trans({}, 'core') }}',
-                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}'
-                     });
-                 });
-                 app.loadJs('{{ asset('bundles/my/js/recovery.js') }}', function () {
-                     initAuthRecovery({
-                         locale: '{{ app.request.locale }}',
-                         getCodeRecoveryUrl: '{{ path('my_recovery_get_code') }}',
-                         recoveryConfirmCodeUrl: '{{ path('my_recovery_confirm_code') }}',
-                         recoverySetPasswordUrl: '{{ path('my_recovery_set_password') }}',
-                         messageRecoverySuccessTitle: '{{ 'app.message.recovery.success_title'|trans({}, 'core') }}',
-                         messageRecoverySuccessText: '{{ 'app.message.recovery.success_text'|trans({}, 'core') }}',
-                         messageLoginErrorPassword: '{{ 'app.message.login.error_password'|trans({}, 'core') }}',
-                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}',
-                         profileUrl: '{{ path('my_about_car') }}',
-                     });
-                 });
-                 app.loadJs('{{ asset('bundles/my/js/change-phone.js') }}', function () {
-                     initAuthChangePhone({
-                         locale: '{{ app.request.locale }}',
-                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}',
-                         getCodeChangePhoneUrl: '{{ path('my_change_phone_get_code') }}',
-                         setNewPhoneUrl: '{{ path('my_change_phone_set_phone') }}',
-                         loginCodeUrl: '{{ path('core_register_code_login') }}',
-                         confirmNewPhoneUrl: "{{ path('my_confirm_new_phone') }}",
-                         profileUrl: '{{ path('my_about_car') }}',
-                     });
-                 });
-             });
-         </script>
-     {% else %}
-         <script src="{{ asset('bundles/core/js/prod.core.js') }}"></script>
-         <script type="text/javascript">
-             window.app = new ViDiApp({
-                 version: '{{ asset_version(asset('/bundles/core/js/prod.core.js')) }}',
-                 message: {
-                     templateUrl: '{{ path('core_message_load_template') }}',
-                     text: {
-                         btnCancel: '{{ 'app.message.cancel'|trans({},'core') }}',
-                     }
-                 },
-                 http: {
-                     requestErrorText: '{{ 'app.http.server_error'|trans({},'core') }}',
-                 },
-                 preLoader: {
-                     templateUrl: '{{ path('core_preloader_load_template') }}',
-                     preLoaderCss: '{{ asset('/bundles/core/css/preloader.css') }}',
-                 },
-                 authOptions: {
-                     checkUrl: '{{ absolute_url(path('my_cross_domain_auth')) }}',
-                     loginUrl: '{{ path('core_cross_domain_auth') }}',
-                 },
-                 leadForms: {
-                     captchaUrl: '{{ path('base_capthcha_init') }}',
-                     text: {
-                         successTitle: '{{ 'modules.sps_form_title'|trans({}, 'dc_base') }}',
-                         successText: '{{ 'modules.sps_form_subtitle'|trans({}, 'dc_base') }}',
-                     },
-                     href: {
-                         buttonSuccess: null,
-                     },
-                 },
-                 favoriteOptions: {
-                     addUrl: '{{ path('portal_add_favl') }}',
-                     removeUrl: '{{ path('portal_remove_favl') }}',
-                 },
-                 user: {
-                     id: {% if app.user %}{{ app.user.id }}{% else %}false{% endif %},
-                     name: {% if app.user %}'{{ app.user.fullName }}'{% else %}null{% endif %},
-                 },
-                 requiredJs: [
-                     {
-                         path: '{{ asset('/bundles/core/js/prod.cor.min.js') }}',
-                     },
-                 ],
-                 coreCss: [
-                     '{{ asset('/bundles/core/css/core.prod.css') }}',
-                     '{{ asset('/bundles/core/css/lead-form.css') }}',
-                 ],
-             });
-             app.onCustomEvent('appInit', function () {
-                 app.loadJs('{{ asset('bundles/my/js/register.js') }}', function () {
-                     initAuthRegistration({
-                         locale: '{{ app.request.locale }}',
-                         fbAuthUrl: '{{ path('my_auth_fb_user') }}',
-                         googleAuthUrl: '{{ path('my_auth_google_user') }}',
-                         registerConfoirmUrl: '{{ path('my_register_confirm') }}',
-                         profileUrl: '{{ urlResult }}',
-                         getCodeUrl: '{{ path('my_register_get_code') }}',
-                         resendCodeUrl: '{{ path('my_register_resend_reg_code') }}',
-                         loginCodeUrl: '{{ path('core_register_code_login') }}',
-                         loginCodeUrlA: '{{ path('core_register_code_login') }}',
-                         refererUrl: {{ refererUrl is defined ? refererUrl|json_encode|raw : 'null' }},
-                         messageRegisterSuccessTitle: '{{ 'app.message.register.success_title'|trans({},'core') }}',
-                         messageRegisterSuccessText: '{{ 'app.message.register.success_text'|trans({},'core') }}',
-                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}'
-                     });
-                 });
-                 app.loadJs('{{ asset('bundles/my/js/recovery.js') }}', function () {
-                     initAuthRecovery({
-                         locale: '{{ app.request.locale }}',
-                         getCodeRecoveryUrl: '{{ path('my_recovery_get_code') }}',
-                         recoveryConfirmCodeUrl: '{{ path('my_recovery_confirm_code') }}',
-                         recoverySetPasswordUrl: '{{ path('my_recovery_set_password') }}',
-                         messageRecoverySuccessTitle: '{{ 'app.message.recovery.success_title'|trans({}, 'core') }}',
-                         messageRecoverySuccessText: '{{ 'app.message.recovery.success_text'|trans({}, 'core') }}',
-                         messageLoginErrorPassword: '{{ 'app.message.login.error_password'|trans({}, 'core') }}',
-                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}',
-                         profileUrl: '{{ path('my_about_car') }}',
-                     });
-                 });
-                 app.loadJs('{{ asset('bundles/my/js/change-phone.js') }}', function () {
-                     initAuthChangePhone({
-                         locale: '{{ app.request.locale }}',
-                         messageLoginErrorEmail: '{{ 'app.message.login.error_email'|trans({}, 'core') }}',
-                         getCodeChangePhoneUrl: '{{ path('my_change_phone_get_code') }}',
-                         setNewPhoneUrl: '{{ path('my_change_phone_set_phone') }}',
-                     });
-                 });
-             });
-         </script>
-     {% endif %}
- {% endblock initJsApp %}
- <script>
-     function isLoyaltySubdomain() {
-         return window.location.hostname.startsWith('loyalty.');
-     }
-     app.onCustomEvent('appInit', function () {
-         app.onCustomEvent('coreAuthInit', function () {
-             Auth.setOnLogoinCallback(function (user, token = null, url = null) {
-                 if (url) {
-                     window.location.href = url;
-                 } else {
-                     window.location.reload();
-                 }
-             });
-         });
-         window.addEventListener("message", function (e) {
-             if(e.data.dataType != 'crossAuth') {
-                 return false;
-             }
-             if (isLoyaltySubdomain() || !e.isTrusted) {
-                 return false;
-             }
-             // if(app.user.id && !e.data.token) {
-             //     $.ajax({
-             //         url: '/logout-user',
-             //         method: 'GET',
-             //         xhrFields: {
-             //             withCredentials: true
-             //         },
-             //         success: function (response) {
-             //             window.location.reload();
-             //         }
-             //     });
-             // }
-             if (app.user.id) {
-                 return false;
-             }
-             $.ajax({
-                 url: '{{ absolute_url(path('core_cross_domain_auth')) }}',
-                 method: 'POST',
-                 data: {token: e.data.token, rnew: 1},
-                 xhrFields: {
-                     withCredentials: true
-                 },
-                 success: function (response) {
-                     if (response.success) {
-                         window.location.reload();
-                     }
-                 }
-             });
-         });
-     });
- </script>
- {% block coreBottomJs %}
-     <script>
-         app.onCustomEvent('appInit', function () {
-             app.loadCss('{{ asset('/bundles/core/css/modules/core-modal/core-modal.css') }}');
-             app.loadCss('{{ asset('/bundles/core/css/modules/core-modal/modal-fw.css') }}');
-         });
-     </script>
- {% endblock coreBottomJs %}
- {% if app.user %}
-     <script type="text/javascript">
-         window.dataLayer = window.dataLayer || [];
-         window.dataLayer.push({'user_id': {{ app.user.id }}});
-     </script>
- {% endif %}
- {% if helpCrunch is defined and dealer is defined and (dealer.id != 16 and dealer.id != 27 and dealer.id != 8) %}
- <script type="text/javascript">
-     window.helpcrunchSettings = {
-         organization: '{{ helpCrunch['organization'] }}',
-         appId: '{{ helpCrunch['appId'] }}',
-     };
- </script>
- <script type="text/javascript">
-     (function(w,d){var hS=w.helpcrunchSettings;if(!hS||!hS.organization){return;}var widgetSrc='https://'+hS.organization+'.widget.helpcrunch.com/';w.HelpCrunch=function(){w.HelpCrunch.q.push(arguments)};w.HelpCrunch.q=[];function r(){if (d.querySelector('script[src="' + widgetSrc + '"')) { return; }var s=d.createElement('script');s.async=1;s.type='text/javascript';s.src=widgetSrc;(d.body||d.head).appendChild(s);}if(d.readyState === 'complete'||hS.loadImmediately){r();} else if(w.attachEvent){w.attachEvent('onload',r)}else{w.addEventListener('load',r,false)}})(window, document)
- </script>
- {% endif %}
- </body>
- </html>