function slideTo(e){$("html, body").animate({scrollTop:$(e).offset().top},1e3)}function subscribe(e){$.post("/api/subscribe/",{shopId:e},(function(){location.reload()}))}function deferLinkResource(e,t){var o=document.createElement("link");o.rel=t,o.href=e,document.head.appendChild(o)}function setUpDeferLoading(e,t){t=void 0===t?"":"-"+t,setTimeout((function(){$.each($('[rel="defer-load'+t+'"]'),(function(e,t){$(t).attr("rel",t.attributes["orig-rel"].value)}))}),e)}function setUpCssLoader(){setTimeout((function(){$.each($('[css-loader="defer-load"]'),(function(e,t){$(t).attr("media","screen")}))}),50)}function initCustomCatcherEvent(){$(document).on("beforeSubmit","#emptyBrochureCatcher, #catcher",(function(){var e={emptyBrochureCatcher:registrationAlert,catcher:catcherAlert},t=this.id,o=$(this);return 0===o.find(".has-error").length?$.ajax({url:signupUrl,type:"post",data:o.serialize(),beforeSend:function(){o.find('button[type="submit"] span.fa').removeClass("fa-envelope").addClass("fa-spinner").addClass("fa-spin")},success:function(o){return o=JSON.parse(o),console.log(o),"success"===o.status?(e[t](o.message,"success"),!1):"code"in o&&422===o.code?(e[t](o.errors.email),!1):void e[t](o.message)},complete:function(){o.find("span.fa").removeClass("fa-spin").removeClass("fa-spinner").addClass("fa-envelope"),console.log("complete")},error:function(e){console.log("internal server error"+e)}}):console.log(o.find(".has-error")),!1}))}function initPopupCatcherEvent(){$(document).on("beforeSubmit","#popupCatcher",(function(){var e=$(this),t=$("#subscription-shop_id").val(),o=$("#mailcatcher-email_reg").val();if(e.find(".has-error").length)return!1;submittedCatcher=!0;var n=".js_subscribe-email-flash",a="fa-envelope",i=!1;return $(".modal-content:visible").length&&(n=".modal-content .js_subscribe-email-flash",a="fa-pencil",i=!0),$.ajax({url:signupUrl,type:"post",data:e.serialize(),beforeSend:function(){e.find('button[type="submit"] span.fa').removeClass(a).addClass("fa-spinner").addClass("fa-spin")},success:function(e){if(trackLoginSignup(),"success"==(e=JSON.parse(e)).status)$(n).slideUp(),!1===e.data.skipPhone?($(n).html(""),$(".js_subscribe-tel").show(),$("#phoneModal .mailcatch-close").hide(),closeSubscribeModal(),$("#phoneModal").modal({backdrop:"static",keyboard:!1}),$(".js_flip").addClass("flipInY animated"),$("#mailcatch_hidden_user_id").val(e.user),dataLayer.push({event:"ga.event",event_category:"web",event_action:"register",event_label:e.form,event_value:0}),$("#phoneModal .dismiss").on("click",dismiss=function(t){if(void 0!==e.message){var o=$("<div>");o.html(e.message),o.addClass("alert-success alert fade in"),$(".js_subscribe-tel-flash").html(o),$(this).off("click",dismiss),$(this).attr("data-dismiss","modal"),$(".field-tel").hide(),$("#phoneCatcherSubmit").hide(),$(this).html(catcher_close_modal),redirectByResponse(e)}else closeSubscribeModal(),redirectByResponse(e)})):($(n).slideUp((function(){$(n).html("")})),dataLayer.push({event:"ga.event",event_category:"web",event_action:"register",event_label:e.form,event_value:0}),void 0!==e.verification&&""!=e.verification&&1==e.verification?createRecShopModal("form-subscribe-modal",t,e.user,o,e.recommendationShops):(closeSubscribeModal(),redirectByResponse(e)));else{if("code"in e){if(409==e.code&&i)return $(n).slideUp(),$(".js_subscribe-text").length&&($(".js_subscribe-text").find("h2").text(e.data.title),$(".js_subscribe-text").find(".lead").text(e.data.title)),$(".js_email-subscribe-part").length&&$(".js_email-subscribe-part").hide(),$(".js_psw-subscribe-part").length&&$(".js_psw-subscribe-part").removeClass("hidden"),$("#mailcatch_hidden_is_existing").length&&$("#mailcatch_hidden_is_existing").val(!0),!1;if(422==e.code)return i?registrationAlert(e.errors.email):catcherAlert(e.errors.email),!1}i?registrationAlert(e.message):catcherAlert(e.message)}},complete:function(){e.find("span.fa").removeClass("fa-spin").removeClass("fa-spinner").addClass(a)},error:function(e){console.log("internal server error"+e)}}),!1}))}function createRecShopModal(e,t,o,n,a){$(".languageSwitcher").remove();var i=$("#"+e);let r="";a.forEach((function(e){let o=t==e.id?"selected":"";r+=`\n            <div class="rec-shop ${o}" data-shop-id="${e.id}">\n                <picture>\n                    <img src="${e.logo}" alt="" title="" >\n                </picture>\n                <div class="rec-check">\n                    <i class="fa fa-check" aria-hidden="true"></i>\n                </div>\n                <div class="shop-name">${e.name}</div>\n            </div>\n        `})),i.html(`\n            <h2 class="rec-shop-h2">${jsTranslateReg.rec_shop_h2}</h2>\n            <div class='rec-shop-container'>${r}</div>\n            <div class="rec-btns-container">\n                <div class="rec-shop-skip-btn" onclick="recShopSkip('${e}','${o}','${n}')">${jsTranslateReg.rec_shop_skip_btn}</div>\n                <div class="rec-shop-save-btn" onclick="recShopSave('${e}','${o}','${n}')">${jsTranslateReg.rec_shop_save_btn}</div>\n            </div>\n        `),i.css({"padding-bottom":"50px","padding-top":"50px"}).slideDown(),$("body").on("click",".rec-shop",(function(){$(this).toggleClass("selected")}))}function recShopSave(e,t,o){let n=[];$(".rec-shop.selected").each((function(){n.push($(this).data("shop-id"))})),$.ajax({url:`${subscribeShopsLink}`,type:"POST",data:{userId:t,email:o,shops:n},success:function(e){}}),recShopSkip(e,t,o)}function recShopSkip(e,t,o){let n,a=$("#"+e);n="undefined"==t||"null"==t?`\n            <div class="rec-social-check-container">\n                <span class="rec-social-check">\n                    <i class="fa fa-check" aria-hidden="true"></i>\n                </span>\n            </div>\n            <h2 class="rec-email-h2 rec-social-color">${jsTranslateReg.rec_social_h2}</h2>\n            <div class="rec-social-btn-container">\n                <a href="/" class="rec-social-btn">${jsTranslateReg.rec_social_btn}</a>\n            </div>\n        `:`\n            <div class="rec-email-image"><object type="image/svg+xml" data="${regListSvg}"></object></div>\n            <h2 class="rec-email-h2">${jsTranslateReg.rec_email_h2}</h2>\n            <div class="rec-email-text">${jsTranslateReg.rec_email_text}</div>\n        `,a.slideUp((function(){a.html(n),a.css({"padding-bottom":"50px","padding-top":"50px"}).slideDown()}))}function showResponseMessage(e,t,o){e.find("img").attr("src",tick).css({marginTop:"55px",width:"125px"}),$(".modal-cta").find("h2").html(o.message1).css({color:"#535353"}),$(".modal-cta").find(".lead").html(""),t.slideUp((function(){t.html("<h2>"+o.message2+"</h2>").css({"text-align":"center",color:"#00A3D1"}),t.css({"padding-bottom":"50px"}).slideDown()}))}function customAlert(e,t,o){t=void 0===t?"danger":t;var n=$(o),a=$("<div>").html(e).addClass("alert-"+t+" alert");n.height()>0&&"none"!=n.css("display")?n.html(a):n.hide().html(a).slideDown()}function registrationAlert(e,t){customAlert(e,t,".js_subscribe-email-flash")}function catcherAlert(e,t,o){customAlert(e,t,(o=void 0===o?"body":o)+" .js_subscribe-email-flash-side")}function resendVerifyEmail(e,t,o){var n=$("#form-subscribe-modal .js_subscribe-email-flash"),a=$(".the-page .alert-danger"),i=!1;null===t.closest(".the-page")?0===n.find(".load-info").length&&(i=!0,n.css({position:"relative"}).find("div.alert").css({opacity:"0.8"}).append('<img src="'+preloader+'" style="height:30px;position:absolute;right:0;bottom:0;" class="load-info">')):(a.find(".close").remove(),0===a.find(".load-info").length&&(i=!0,a.css({position:"relative",opacity:"0.8"}).append('<img src="'+preloader+'" style="height:30px;position:absolute;right:5px;top:10px;" class="load-info">'))),i&&$.ajax({url:signupUrl,type:"post",data:{resendVerifyEmail:e},success:function(e,o){if("success"==(e=JSON.parse(e)).status)null==t.closest(".the-page")?n.find("div.alert").css({opacity:"1"}).removeClass("alert-danger").addClass("alert-success").html(e.message).find("img").remove():a.css({opacity:"1"}).removeClass("alert-danger").addClass("alert-success").html(e.message).find("img").remove();else{var i=$("<div>").html(e.message).addClass("alert-danger alert");n.height()>0?n.html(i):n.hide().html(i).slideDown()}},error:function(e){console.log("internal server error "+e)}}),o.preventDefault()}function redirectByResponse(e){void 0!==e.redirect&&""!=e.redirect?window.location.href=e.redirect:window.location.reload()}function initShowHideButton(e){var t=$(e);if(t.length){var o='<span class="fa fa-eye"></span>';t.wrap('<div class="show-hide-wrap"></div>'),t.parent().prepend('<span class="show-hide">'+o+"</span>");var n=t.parent().find(".show-hide");n.on("click",(function(){"password"===t.attr("type")?(t.prop("type","text"),n.html('<span class="fa fa-eye-off"></span>')):(t.prop("type","password"),n.html(o))}))}}function rgb2hex(e){function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}return"#"+t((e=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/))[1])+t(e[2])+t(e[3])}function getQueryParams(){for(var e=window.location.search.substring(1).split("&"),t=[],o=0;o<e.length;o++){var n=e[o].split("="),a=decodeURIComponent(n[0]),i=decodeURIComponent(n[1]||"");t[a]=i}return t}function trackLoginSignup(){let e=CookieManager.getCookie("newRegistration")||!1,t=CookieManager.getCookie("newLogin")||!1;if(e){let t=JSON.parse(decodeURIComponent(e));window.dataLayer.push({event:"ga4.sign_up",event_data:{source:t.source,method:t.method}}),CookieManager.deleteCookie("newRegistration")}if(t){let e=JSON.parse(decodeURIComponent(t));window.dataLayer.push({event:"ga4.login",event_data:{source:e.source,method:e.method}}),CookieManager.deleteCookie("newLogin")}}function getRandomObjectFromArray(e){if(0===e.length)return null;return e[Math.floor(Math.random()*e.length)]}function ensureMaxEntries(e,t){e.length>t&&e.shift()}function observeShopThumbsLoad(){const e=document.querySelector(".skeleton-loader"),t=(e,t)=>{for(const o of e)if("attributes"===o.type&&"class"===o.attributeName){o.target.classList.contains("done")&&(changeThumbsLinksToDetailPage(),t.disconnect())}};if(e&&!e.classList.contains("done")){new MutationObserver(t).observe(e,{attributes:!0})}else changeThumbsLinksToDetailPage()}function changeThumbsLinksToDetailPage(){var e=[1,4];$(".page-body>.letaky-grid .col-sm-3 a").each((function(){let t=$(this).closest(".brochure-thumb");if(t&&e.includes(t.data("brochure-type"))&&!t.data("partner-brochure-id")){let e=$(this).attr("href").split("/")[1];e&&t.data("brochure-id")&&($(this).attr("onclick",`trackDetailBrochureClickMain(${t.data("brochure-id")}, '${$(this).attr("href")}')`),$(this).attr("href",`${e}/${translatedUrlDetail}/?brochureId=${t.data("brochure-id")}`))}}))}function pushSubscriptionChangeListener(e){if(e.current.token){var t=window.location.pathname.split("/");OneSignal.User.addTags({subscription_page:t[1],subscription_shop:shop_name})}}function initFormSubmit(e){var t=$("#login-form");e.preventDefault(),$.ajax({type:"POST",url:t.attr("action")+"?requested_url="+document.URL,data:t.serialize()}).done((function(e){var t=$($.grep($(e),(function(e){return"loginModal"===e.id}))[0]);$("#loginModal .modal-content").html(t.find(".modal-content").html()),initShowHideButton("#modal-login #loginform-password"),initGoogleButton((function(){window.location.reload()}),googleButtonFailed,"login");var o=e.match(/"jQuery\('#login-form'\).+?}], \[]\);"/g)[0],n=(o=o.substring(1,o.length-1)).replaceAll('\\"','"');new Function(n)()}))}function buildFromVariable(e,t){if(void 0===window[e])return!1;let o=window[e];const n=$("#"+o.c),a=o.t;if(n.hasClass("done"))return!1;jsBuilder(o,n,a,t)}function jsBuilder(e,t,o,n){if("replace"===n&&$(t).empty(),$.each(e.d,(function(e,a){var i=o;$.each(a,(function(e,t){var o=new RegExp("{"+e+"}","g");i=i.replace(o,t)})),"before"===n?$(t).before(i):$(t).append(i)})),$(t).addClass("done"),void 0!==e.up&&"1"===e.up&&("undefined"!=typeof lazyLoadInstance?lazyLoadInstance.update():initLazyLoad(),"undefined"!=typeof lazyLoadInstanceLogo?lazyLoadInstanceLogo.update():initLazyLoadLogo()),"undefined"!=typeof customJsContentCallback)return customJsContentCallback($(t))}function buildFromVariables(e,t){void 0===t&&(t="append"),$.each(e,(function(e,o){buildFromVariable(o,t)}))}function buildFromGeneratorVariables(e){var t=[];for(var o in $.each(e,(function(e,o){0===o.p?jsBuilderAjaxCall(o):(void 0===t[o.p]&&(t[o.p]=[]),t[o.p].push(o))})),t){var n=t[o];"event"==o?setUpEventListener(o,n):setUpajaxCalls(o,n)}}function setUpEventListener(e,t){$.each(t,(function(e,t){$("#"+t.d.eventVaraibleId).on("click",(function(e){$("body").trigger("jsContentEvent:"+t.v)})),$("body").on("jsContentEvent:"+t.v,(function(e,o){$("body").off("jsContentEvent:"+t.v),jsBuilderAjaxCall(t,o)}))}))}function setUpajaxCalls(e,t){setTimeout((function(){$.each(t,(function(e,t){jsBuilderAjaxCall(t)}))}),e)}async function jsBuilderAjaxCall(e){if(void 0===e||void 0===e.d||void 0===e.d.hasGeo)return callBackend(e);await this.updateDataWithCoordsAndCallBackend(e)}async function updateDataWithCoordsAndCallBackend(e){return await updateDataWithCoords(e),callBackend(e)}async function updateDataWithCoords(e){try{const t=await GeolocationManager.getCoordinates(!0,"contentGenerator.js updateDataWithCoords");t&&("prod"!==window.env&&console.log(`Coordinates lat:${t.lat}, lon:${t.lon} loaded from strategy '${await GeolocationManager.getCurrentStrategy("contentGenerator updateDataWithCoords")}'`),e.d.lon=Math.round(1e3*t.lon)/1e3,e.d.lat=Math.round(1e3*t.lat)/1e3)}catch(e){console.error(e)}return e}function callBackend(e){return $.ajax({url:e.u,type:"GET",data:e,cache:!0}).done((function(e){jsBuilder(e=JSON.parse(e),$("#"+e.c),e.t,e.m),ab_test_js.get("shop_extended_visual")&&"B"==ab_test_js.get("shop_extended_visual").id&&shopExtendedVisualInit()})).fail((function(){console.log("error loading variable : ",e.v)}))}"undefined"!=typeof GTM_ID&&function(e,t,o,n,a){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var i=t.getElementsByTagName(o)[0],r=t.createElement(o);r.async=!0,r.defer=!0,r.src="https://www.googletagmanager.com/gtm.js?id="+a,i.parentNode.insertBefore(r,i)}(window,document,"script","dataLayer",GTM_ID),trackLoginSignup();var isMobile=!1,isPhone=!1;function brochureViewEvent(){var e=null;void 0!==_COOKIES.functional&&void 0!==_COOKIES.functional.last_brochure&&(e=_COOKIES.functional.last_brochure),"undefined"==typeof brochureId&&(brochureId=null),e!=brochureId&&(CookieManager.setFunctionalCookie("last_brochure",brochureId,"session"),null!=brochureId&&window.dataLayer.push({event:"ga.event",event_category:"web",event_action:"brochure_visit",event_label:"Brochure: "+brochureId,event_value:0}))}function initBrochureEvents(){"undefined"==typeof setUpBrochureEvents||isMobile||setUpBrochureEvents()}function mainInit(){$((function(e){function t(){e(".sticky").each((function(){let t=e(this),o=t.find(".sticky-offset"),n=t.find(".stick"),a=e(window).scrollTop(),i=e("footer").outerHeight(),r=e(document).height(),s=e(window).height(),l=document.querySelector('ins[data-anchor-shown=true][style*="top: 0px"]'),c=0;if(!t.data("placeholder")){const o=e('<div class="sticky-placeholder"></div>');o.height(n.outerHeight()),o.insertAfter(n),t.data("placeholder",o)}let d=t.data("placeholder");if(o.length&&n.length){if(l&&(c=l.offsetHeight),n.outerHeight()>s)return n.css({position:"relative",top:"auto",transition:"none"}),void d.hide();if(a>o.offset().top-10-c){r-a-n.outerHeight()-20-c<i?n.css({position:"absolute",top:r-i-n.outerHeight()-o.offset().top-10+"px",transition:"none"}):(n.css({position:"fixed",top:10+c+"px",transition:"none"}),d.show())}else n.css({position:"relative",top:"auto",transition:"none"}),d.hide()}}))}let o;e(window).on("scroll resize",(function(){clearTimeout(o),o=setTimeout(t,10)})),t()})),"undefined"!=typeof chan&&CookieManager.setCookie("chan_param",chan,1/24),$("body").on("submit","#report",(function(){return $(this).submit((function(){return!1})),!0})),CookieManager.loadCookies(),"cookies-cosent"in _COOKIES==!0&&1==_COOKIES["cookies-cosent"]?$("#cookies-information").fadeOut():$("#cookies-information").fadeIn(),window.innerWidth>1e3&&$("#cpcModal").modal("show"),brochureViewEvent(),setTimeout((function(){initPopupCatcherEvent(),initCustomCatcherEvent(),initBrochureEvents()}),500),setUpDeferLoading(50,"high"),setUpDeferLoading(500,"low"),setUpDeferLoading(1e3,"lowest"),setUpCssLoader(),"undefined"!=typeof WOW&&new WOW({offset:50}).init()}function footerCookieSettings(){let e=document.querySelector("#liCookieSettings");if(window.hyper_cmp){let t=window.hyper_cmp.configs;0===Object.entries(t).length&&e.remove()}else e.remove()}$(window).width()<=991&&!1===isMobile?isMobile=!0:!0===isMobile&&(isMobile=!1),$(window).width()<=480&&!1===isPhone?isPhone=!0:!0===isPhone&&(isPhone=!1),isMobile&&($("#navbar .nav>ul>li.has_child > a").click((function(){var e=$(this).parents("li.has_child");e.hasClass("dropped-down")?(e.find(".dropdown").slideToggle().find(".clearfix").toggleClass("show"),e.removeClass("dropped-down")):($("#navbar .nav>ul>li.has_child.dropped-down").each((function(){var e=$(this);e.find(".dropdown").slideToggle().find(".clearfix").toggleClass("show"),e.removeClass("dropped-down")})),e.find(".dropdown").slideToggle().find(".clearfix").toggleClass("show"),e.addClass("dropped-down"))})),$("#navbar .nav>ul>li>a.is_category").click((function(e){e.preventDefault()}))),$('[data-toggle="collapse"]').click((function(e){e.preventDefault()})),function(e){e.fn.responsiveCollapse=function(t){var o=e.extend({breakPoint:768,overflowItemText:'Více <span class="fa fa-angle-double-down"></span>'},t),n=e(document).width();return this.filter("ul").each((function(){var t=e(this),a=t.parent(),i=e('<li class="dropdown more hide"><a href="#" class="dropdown-toggle" data-toggle="dropdown">'+o.overflowItemText+'</a><ul class="dropdown dropdown-menu dropdown-menu-right"></ul></li>').appendTo(t),r=e(i).find("ul.dropdown"),s=t.outerWidth(),l=e(a).width()-40;function c(){s=t.outerWidth(),l=e(a).width()-40;var c=e(document).width();e(window).width()<o.breakPoint?function(){var o=e(r).children(),n=o.length;if(n>0)for(var a=0;a<n;a++)e(o[a]).insertBefore(t.children(":last-child"));e(i).addClass("hide")}():s>l?function(){var o=t.children(":not(:last-child)"),n=o.length;if(!(n<1)){e(i).removeClass("hide");for(var a=n-1;a>=0&&(e(o[a]).prependTo(r),!((s=t.outerWidth())<l));a--);}}():0<c-n&&function(){var o=e(i).width(),n=e(r).children(),a=n.length;if(a>0)for(var c=0;c<a;c++)if(e(n[c]).insertBefore(t.children(":last-child")),s=t.outerWidth(),c==a-1&&s-o>l||c!=a-1&&s>l){e(n[c]).prependTo(r);break}0==e(r).children().length&&e(i).addClass("hide")}(),n=c}e(window).resize((function(){c()})).trigger("resize")}))}}(jQuery),$(document).ready((function(){mainInit(),footerCookieSettings()})),window.addEventListener("appinstalled",(function(e){dataLayer.push({event:"ga.event",event_category:"web",event_action:"pwa_install",event_label:"installed",event_value:0})})),window.addEventListener("beforeinstallprompt",(function(e){e.userChoice.then((function(e){"accepted"===e.outcome?dataLayer.push({event:"ga.event",event_category:"web",event_action:"pwa_banner",event_label:"accepted",event_value:0}):dataLayer.push({event:"ga.event",event_category:"web",event_action:"pwa_banner",event_label:"refused",event_value:0})}))}));var isPWAinBrowser=!0;function toShopGtmEvent(e){let t="noaffil";1===parseInt($(e).data("gtm-is-affiliate"))&&(t="affil");let o=parseInt($(e).data("gtm-shop"));window.dataLayer.push({event:"ga.event",event_category:"web",event_action:"shop_button_click",event_label:"click_"+t+"_"+o,event_value:0})}function lazyLoadFavourites(e){loadContent($(e).data("url")).then((function(t){$(e).html('<div class="animated fadeIn">'+t+"</div>"),$(document).trigger("intersect-lazy-load",[e]),setTimeout((function(){lazyLoadUpdateAll()}),400)}))}function loadContent(e){return $.ajax({url:e})}function lazyLoadAds(target){const content=$(target).attr("data-content");$(target).html($.parseJSON(content)[0]),setTimeout((function(){try{eval($(target).attr("data-callback"))}catch(e){console.error(e)}}),80)}function newSocialRegistrationModal(){if(CookieManager.getCookie("newSocialRegistration")){let e=CookieManager.getCookie("newSocialRegistration")||null;$.ajax({url:`${topShopsLink}`,type:"POST",data:{shopId:e},success:function(t){t=JSON.parse(t),$("body").append('\n                    <div class="modal fade subscribeModal" id="socialRegistrationModal" role="dialog" style="top: 8vh; display: none;" data-backdrop="static">\n                        <div class="modal-dialog" role="document">\n                            <div class="modal-content">\n                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>\n                              \n                                <div class="tab-content">\n                                    <div class="tab-pane active">\n                                        <div class="modal-body" id="socialRegistrationModalContent" style="padding-bottom: 50px; padding-top: 50px;">\n                                        \n                                        </div>\n                                    </div>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                '),createRecShopModal("socialRegistrationModalContent",e,null,null,t.recommendationShops),$("#socialRegistrationModal").modal("show"),CookieManager.deleteCookie("newSocialRegistration")}})}}function cookiesModalAfterRun(){$(".js_save-cookie-settings").click((function(){$("#cookieModal").modal("hide"),CookieManager.setCookie("cookies-cosent",1,365),$("#cookies-information").hide(),cookie_bar_cookies.forEach((function(e){var t=$("input#"+e).is(":checked")?1:0;CookieManager.setCookie(e,t,365),window.dataLayer.push({event:"ga.event",event_category:"web",event_action:"save_settings",event_label:e+": "+(0==t?"off":"on"),event_value:0})}))})),$(".js_allow-all-cookies").click((function(){$("#cookieModal").modal("hide"),CookieManager.setCookie("cookies-cosent",1,365),$("#cookies-information").hide(),cookie_bar_cookies.forEach((function(e){CookieManager.setCookie(e,1,365)}))})),$('.btn-link[data-target="#cookieModal"]').click((function(){$("#cookieModal").find("input[type='checkbox']").prop("checked",!0),$("#cookieModal").find(".small-on").removeClass("hidden"),$("#cookieModal").find(".small-off").addClass("hidden"),$(".nav.nav-pills.nav-stacked .icon-off").addClass("hidden"),$(".nav.nav-pills.nav-stacked .icon-on").removeClass("hidden"),$(".js_marketing_cookies-alert").addClass("hidden")})),$(".js_cookie-policy").change((function(){var e=$(this).parents(".switch-container").attr("id"),t=e.replace("_switch","-tab"),o=$(this).parents(".switch-container");$(this).is(":checked")?(o.find(".small-on").removeClass("hidden"),o.find(".small-off").addClass("hidden"),$("#"+t+" .icon-off").addClass("hidden"),$("#"+t+" .icon-on").removeClass("hidden"),"marketing_cookies_switch"==e&&$(".js_marketing_cookies-alert").addClass("hidden")):(o.find(".small-off").removeClass("hidden"),o.find(".small-on").addClass("hidden"),$("#"+t+" .icon-on").addClass("hidden"),$("#"+t+" .icon-off").removeClass("hidden"),"marketing_cookies_switch"==e&&$(".js_marketing_cookies-alert").removeClass("hidden"))}))}matchMedia("(display-mode: standalone)").matches?isPWAinBrowser=!1:"standalone"in navigator&&(isPWAinBrowser=!navigator.standalone),isPWAinBrowser||dataLayer.push({event:"ga.event",event_category:"web",event_action:"mobileApp",event_label:"true",event_value:0}),$("#contactFormForm").on("submit",(function(){dataLayer.push({event:"ga.event",event_category:"web",event_action:"contactFormStep2",event_label:"",event_value:0})})),$(".gtm-shop-exit").on("click",(function(){toShopGtmEvent(this)})),function(e,t,o,n){"use strict";var a,i,r,s,l,c=e(t).width(),d=e(t),u="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",h=!1,p=150,g=e([]),m=e([]),f=e([]),v=function(e){try{(adsbygoogle=t.adsbygoogle||[]).push({})}catch(e){console.log(e)}var o=e.data("alOptions").onLoad;"function"==typeof o&&e.find("iframe").one("load",(function(){o(e)}))},y=function(e){return parseInt(t.getComputedStyle(e,":before").getPropertyValue("content").slice(1,-1)||9999)},b=function(){if(!m.length)return!0;var t=d.scrollTop(),o=d.height();m.each((function(){var n=e(this),a=n.data("alOptions").laziness+1,i=n.offset().top;if(i-t>o*a||t-i-n.outerHeight()-o*a>0)return!0;m=m.not(n),g=g.add(n),n.data("alOriginalHTML",n.html()).data("alWidth",y(this)).children(":first").addClass("adsbygoogle"),"undefined"!=typeof adsbygoogle?v(n):f=f.add(n),h||(h=!0,e.ajax({url:u,async:!0,cache:!0,dataType:"script",success:function(){f.each((function(){v(e(this))})),f=e([])}}))}))};d.on("scroll",(i=p,r=b,function(){var e=this,t=arguments,o=+new Date;s&&o<s+i?(clearTimeout(l),l=setTimeout((function(){s=o,r.apply(e,t)}),i)):(s=o,r.apply(e,t))})).on("resize",function(o,n){return function(){if(e(t).width()!=c){c=e(t).width();var i=this,r=arguments,s=+new Date;clearTimeout(a),a=setTimeout((function(){s,n.apply(i,r)}),o)}}}(p,(function(){if(!g.length)return!0;var t=!1;g.each((function(){var o=e(this);o.data("alWidth")!=y(this)&&(g=g.not(o),o.html(o.data("alOriginalHTML")),m=m.add(o),t=!0)})),t&&b()}))),e.fn.adsenseLoader=function(t){return"string"!=typeof t&&(t=e.extend({},{laziness:1,onLoad:!1},t)),this.each((function(){var o=e(this);"destroy"===t?(o.html(o.data("alOriginalHTML")),m=m.not(o),g=g.not(o),f=f.not(o)):(o.data("alOptions",t),m=m.add(o))})),"destroy"!==t&&b(),this},e.adsenseLoaderConfig=function(e){void 0!==e.scriptUrl&&(u=e.scriptUrl),void 0!==e.throttle&&(p=e.throttle)}}(jQuery,window,document),$(".adsense").adsenseLoader({onLoad:function(e){e.addClass("adsense--loaded")}}),function(){"use strict";if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var e=window.document,t=[];n.prototype.THROTTLE_TIMEOUT=100,n.prototype.POLL_INTERVAL=null,n.prototype.USE_MUTATION_OBSERVER=!0,n.prototype.observe=function(e){if(!this._observationTargets.some((function(t){return t.element==e}))){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},n.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter((function(t){return t.element!=e})),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},n.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},n.prototype.takeRecords=function(){var e=this._queuedEntries.slice();return this._queuedEntries=[],e},n.prototype._initThresholds=function(e){var t=e||[0];return Array.isArray(t)||(t=[t]),t.sort().filter((function(e,t,o){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return e!==o[t-1]}))},n.prototype._parseRootMargin=function(e){var t=(e||"0px").split(/\s+/).map((function(e){var t=/^(-?\d*\.?\d+)(px|%)$/.exec(e);if(!t)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(t[1]),unit:t[2]}}));return t[1]=t[1]||t[0],t[2]=t[2]||t[0],t[3]=t[3]||t[1],t},n.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(a(window,"resize",this._checkForIntersections,!0),a(e,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},n.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,i(window,"resize",this._checkForIntersections,!0),i(e,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},n.prototype._checkForIntersections=function(){var e=this._rootIsInDom(),t=e?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(n){var a=n.element,i=r(a),s=this._rootContainsTarget(a),l=n.entry,c=e&&s&&this._computeTargetAndRootIntersection(a,t),d=n.entry=new o({time:window.performance&&performance.now&&performance.now(),target:a,boundingClientRect:i,rootBounds:t,intersectionRect:c});l?e&&s?this._hasCrossedThreshold(l,d)&&this._queuedEntries.push(d):l&&l.isIntersecting&&this._queuedEntries.push(d):this._queuedEntries.push(d)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},n.prototype._computeTargetAndRootIntersection=function(t,o){if("none"!=window.getComputedStyle(t).display){for(var n,a,i,s,c,d,u,h,p=r(t),g=l(t),m=!1;!m;){var f=null,v=1==g.nodeType?window.getComputedStyle(g):{};if("none"==v.display)return;if(g==this.root||g==e?(m=!0,f=o):g!=e.body&&g!=e.documentElement&&"visible"!=v.overflow&&(f=r(g)),f&&(n=f,a=p,i=void 0,s=void 0,c=void 0,d=void 0,u=void 0,h=void 0,i=Math.max(n.top,a.top),s=Math.min(n.bottom,a.bottom),c=Math.max(n.left,a.left),d=Math.min(n.right,a.right),h=s-i,!(p=(u=d-c)>=0&&h>=0&&{top:i,bottom:s,left:c,right:d,width:u,height:h})))break;g=l(g)}return p}},n.prototype._getRootRect=function(){var t;if(this.root)t=r(this.root);else{var o=e.documentElement,n=e.body;t={top:0,left:0,right:o.clientWidth||n.clientWidth,width:o.clientWidth||n.clientWidth,bottom:o.clientHeight||n.clientHeight,height:o.clientHeight||n.clientHeight}}return this._expandRectByRootMargin(t)},n.prototype._expandRectByRootMargin=function(e){var t=this._rootMarginValues.map((function(t,o){return"px"==t.unit?t.value:t.value*(o%2?e.width:e.height)/100})),o={top:e.top-t[0],right:e.right+t[1],bottom:e.bottom+t[2],left:e.left-t[3]};return o.width=o.right-o.left,o.height=o.bottom-o.top,o},n.prototype._hasCrossedThreshold=function(e,t){var o=e&&e.isIntersecting?e.intersectionRatio||0:-1,n=t.isIntersecting?t.intersectionRatio||0:-1;if(o!==n)for(var a=0;a<this.thresholds.length;a++){var i=this.thresholds[a];if(i==o||i==n||i<o!=i<n)return!0}},n.prototype._rootIsInDom=function(){return!this.root||s(e,this.root)},n.prototype._rootContainsTarget=function(t){return s(this.root||e,t)},n.prototype._registerInstance=function(){t.indexOf(this)<0&&t.push(this)},n.prototype._unregisterInstance=function(){var e=t.indexOf(this);-1!=e&&t.splice(e,1)},window.IntersectionObserver=n,window.IntersectionObserverEntry=o}function o(e){this.time=e.time,this.target=e.target,this.rootBounds=e.rootBounds,this.boundingClientRect=e.boundingClientRect,this.intersectionRect=e.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0},this.isIntersecting=!!e.intersectionRect;var t=this.boundingClientRect,o=t.width*t.height,n=this.intersectionRect,a=n.width*n.height;this.intersectionRatio=o?Number((a/o).toFixed(4)):this.isIntersecting?1:0}function n(e,t){var o,n,a,i=t||{};if("function"!=typeof e)throw new Error("callback must be a function");if(i.root&&1!=i.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=(o=this._checkForIntersections.bind(this),n=this.THROTTLE_TIMEOUT,a=null,function(){a||(a=setTimeout((function(){o(),a=null}),n))}),this._callback=e,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(i.rootMargin),this.thresholds=this._initThresholds(i.threshold),this.root=i.root||null,this.rootMargin=this._rootMarginValues.map((function(e){return e.value+e.unit})).join(" ")}function a(e,t,o,n){"function"==typeof e.addEventListener?e.addEventListener(t,o,n||!1):"function"==typeof e.attachEvent&&e.attachEvent("on"+t,o)}function i(e,t,o,n){"function"==typeof e.removeEventListener?e.removeEventListener(t,o,n||!1):"function"==typeof e.detatchEvent&&e.detatchEvent("on"+t,o)}function r(e){var t;try{t=e.getBoundingClientRect()}catch(e){}return t?(t.width&&t.height||(t={top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.right-t.left,height:t.bottom-t.top}),t):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function s(e,t){for(var o=t;o;){if(o==e)return!0;o=l(o)}return!1}function l(e){var t=e.parentNode;return t&&11==t.nodeType&&t.host?t.host:t&&t.assignedSlot?t.assignedSlot.parentNode:t}}(),observeElements(".intersect-lazy-load",{rootMargin:"300px 0px"},{fn:lazyLoadFavourites}),observeElements(".intersect-ads-load",{rootMargin:"100px 0px"},{fn:lazyLoadAds}),$(window).on("load",(function(){$(".nav-wrapper").addClass("overflow-visible"),$(document).width()>1024&&$(".nav ul.navbar-nav").responsiveCollapse({breakPoint:1007,overflowItemText:wrapperTxt+' <span class="fa fa-angle-double-down"></span>'}),$(document).on("intersect-lazy-load",(function(e,t){"/ajax/get-facebook-connect"===$(t).data("url")&&FB.XFBML.parse()}))})),$((function(){newSocialRegistrationModal(),$(".admin-info").on("click",(function(e){e.preventDefault();var t=$("#admindropdown"),o=$(this).data("brochure-id");if(t.hasClass("open"))t.removeClass("open");else{var n=void 0!==o?$(this).attr("href")+"?brochureId="+o:$(this).attr("href");$.ajax({beforeSend:function(){$(".admin-info").html("...")},complete:function(){$(".admin-info").html("i")},dataType:"json",url:n,success:function(e){if(void 0!==e){var o='<table class="admin-info-table">';$.each(e,(function(e,t){o=o+'<tr><td class="admin-info-table__label"><b>'+e+':</b></td><td class="admin-info-table__content"> '+t+"</td></tr>"})),o+="</table>",$(".dropdown-content",t).css({padding:"8px","min-width":"500px",left:"-56px"}).html(o),t.addClass("open")}},error:function(e){302==e.status?(window.alert("Chýbajúce oprávnenie na zozbrazenie obsahu!"),e.stop()):window.alert("Systémová chyba!")}})}}))})),$(".js_hide-notifications-floating").click((function(e){e.preventDefault(),$("#floating-push-dialog").addClass("hidden")})),$(".js_push_notification-switch").click((function(e){e.preventDefault(),$(this).toggleClass("btn-active").trigger("blur")})),$("#allow_cookies").click((function(e){e.preventDefault(),CookieManager.setCookie("cookies-cosent",1,365),cookie_bar_cookies.forEach((function(e){CookieManager.setCookie(e,1,365)})),$("#cookies-information").hide()}));var jqReady="undefined"!=typeof $;function isDocumentInReadyState(){return"complete"==window.document.readyState}function contactFotmAlternativeMail(e,t,o,n,a){if(!jqReady)return!1;var i=$(e).html();$(e).html('<span class="fa fa-spinner fa-spin" style="padding:0"></span>'),1===t?$.ajax({url:modalContactForm1+window.location.search}).done((function(n){$("#contactForm"+t).html(n).modal("show"),$(e).html(i),dataLayer.push({event:"ga.event",event_category:"web",event_action:"contactFormStep"+o,event_label:"",event_value:0})})).fail((function(e){alert(e.message)})):0===t&&$.ajax({url:modalContactForm0,type:"POST",data:{sef:n,name:a}}).done((function(n){$("#contactForm"+t).html(n).modal("show"),$(e).html(i),dataLayer.push({event:"ga.event",event_category:"web",event_action:"contactFormStep"+o,event_label:"",event_value:0})})).fail((function(e){alert(e.message)}))}function cookieConsent(){window.dataLayer.push({event:"ga4.menu_click",event_data:{placement:"bottom_menu",type:"cookie_show_details"}}),window.Didomi&&window.Didomi.notice?window.Didomi.notice.show():window.googlefc&&window.googlefc.callbackQueue&&window.googlefc.callbackQueue.push(window.googlefc.showRevocationMessage)}isDocumentInReadyState()?jqReady=!0:window.document.onReadyStateChange=function(){jqReady=isDocumentInReadyState()},window.onload=function(){jqReady=!0};var Loader=function(){this.stop=function(){setTimeout((function(){$(".modal-loader").hide()}),400)},this.start=function(){$(".modal-loader").show()}};function login(e,t){t.preventDefault();var o=$(e).html(),n=$("#modal-login"),a=n.attr("data-status"),i=new Loader;if(document.getElementById("otp")&&document.getElementById("otp").remove(),"done"!=a)return $.ajax({dataType:"html",method:"POST",url:loginForm,beforeSend:function(){$(e).html('<span class="fa fa-spinner fa-spin" style="padding:0"></span>')},complete:function(){$(e).html(o),initGoogleButton((function(){window.location.reload()}),googleButtonFailed,"login")},success:function(e){e&&(n.html(e).find("#loginModal").modal("show"),n.attr("data-status","done"),$(".js-ggogle-login-btn").attr("data-google-subscribed-to-id",null),$("#google-btn").on("click",(function(){i.start()})),$("#login-form").on("beforeValidate",(function(){i.start()})),$("#login-form").on("afterValidate",(function(){i.stop()})))},error:function(e){alert(e.message)}});n.find("#loginModal").modal("show")}function registration(e,t,o,n,a){if(!jqReady)return!1;if(t.preventDefault(),document.getElementById("otp")&&document.getElementById("otp").remove(),e)var i=$(e).html();var r=$("#modal-registration"),s=r.attr("data-status"),l=new Loader;"done"==s?r.find("#subscribeModal").modal("show"):(e&&$(e).html('<span class="fa fa-spinner fa-spin" style="padding:0"></span>'),$.ajax({url:registrationForm,type:"POST",data:{shop:o}}).done((function(t){r.html(t),drawRegistrationModal(a),setPopupPageInfoForPartnerEvents(),r.attr("data-status","done"),""!==o&&$(".js-ggogle-login-btn").attr("data-google-subscribed-to-id",o),e&&$(e).html(i),$("#google-btn").on("click",(function(){l.start()})),$("#popupCatcher").on("beforeValidate",(function(){l.start()})),$("#popupCatcher").on("afterValidate",(function(){l.stop()})),setRedirectUrl()})).fail((function(e){alert(e.message)})))}function setPopupPageInfoForPartnerEvents(){const e=new URL(window.location);localStorage.setItem("partnerBrochurePopupOpened",JSON.stringify({url:e.pathname,partnerBrochureId:"undefined"!=typeof partnerBrochureId?partnerBrochureId:null}))}var googleInitCount=0;function initGoogleButton(e,t,o,n){if(n=n||300,googleInitCount>=30)return!1;if("function"!=typeof initGoogleButton)googleInitCount+=1,setTimeout(initGoogleButton,100);else{var a=new URL(window.location.href),i="undefined"!=typeof shop_id?shop_id:$("#subscription-shop_id").val()||"";google.accounts.id.initialize({client_id:$("meta[name=google-signin-client_id]").attr("content"),ux_mode:"redirect",login_uri:a.protocol+"//"+a.hostname+"/google-login/login/google-login/?subscribedToId="+i+"&referrer="+window.location.href});var r="google_"+o,s=languageCode+"_"+countryCode;$("#"+r).length&&google.accounts.id.renderButton(document.getElementById(r),{width:n,shape:"circle",locale:s})}}function googleButtonResponse(e){(e="object"==typeof e?e:JSON.parse(e)).status=void 0===e.status?"500":e.status,e.message=void 0===e.message?"":e.message,200==e.status?window.location.reload():"2"===e.status.toString()[0]?registrationAlert(e.message,"success"):registrationAlert(e.message),(new Loader).stop()}function googleButtonFailed(){(new Loader).stop()}var rmFailCount=0;function drawRegistrationModal(e){!$("#subscribeModal")&&rmFailCount<20?(rmFailCount+=1,setTimeout((function(){drawRegistrationModal(e)}),100)):($("#subscribeModal").modal("show"),lazyLoadUpdateAll(),setTimeout((function(){$("#subscribeModal").show(),initGoogleButton(googleButtonResponse,googleButtonFailed,"registration")}),800),void 0!==e&&""!=e&&$("#subscribeModal").on("hidden.bs.modal",(function(){window.location.href=e})))}function setRedirectUrl(){if($('[hreflang="'+$("#switchLanguage").val()+'"]',document).length>0){var e=$('[hreflang="'+$("#switchLanguage").val()+'"]',document).prop("href");$(".redirectUrl",$("form")).val(e)}}function closeSubscribeModal(){$(".subscribeModal.in").fadeOut(200)}function closeCompleteSubscribeModal(){}function clearReferrals(){$(".referrer").val(""),$(".subscription_process_shop_id").val("")}function initRegSuggestionEmails(e,t){if(t&&Array.isArray(t)&&0!==t.length){var o=(Math.random()+1).toString(36).substring(7),n='<ul id="reg-email-suggestion-'+o+'" class="reg-email-suggestion" style="display: none;">';t.forEach((function(e){n+='<li class="reg-email-suggestion--email" data-domain="'+e+'"></li>'})),n+="</ul>",$("#"+e).after(n),$("#"+e).on("change keydown paste input",(function(){var t=$(this).val(),n=t.indexOf("@")>0?t.substring(0,t.indexOf("@")):t,a=t.indexOf("@")>0?t.substring(t.indexOf("@")+1):null,i=!1;$("#reg-email-suggestion-"+o).children(".reg-email-suggestion--email").each((function(){var e=$(this).data("domain");$(this).html(n+e),a?e.startsWith("@"+a)&&e!=="@"+a?($(this).show(),i=!0):$(this).hide():($(this).show(),i=!0)})),i&&t?($("#reg-email-suggestion-"+o).show(),$("#"+e).addClass("reg-email-suggestion-input--active")):($("#reg-email-suggestion-"+o).hide(),$("#"+e).removeClass("reg-email-suggestion-input--active"))})),$("#reg-email-suggestion-"+o+" .reg-email-suggestion--email").on("click",(function(){$("#"+e).val($(this).html()).change()})),$("body").on("click",(function(){$("#"+e+", #reg-email-suggestion-"+o).click((function(){return!1})),$("#reg-email-suggestion-"+o).hide(),$("#"+e).removeClass("reg-email-suggestion-input--active")}))}}function openResetPasswordModal(){$(".modal.in:visible").modal("hide"),$.ajax({dataType:"html",method:"POST",url:"/ajax/reset-password-modal/",success:function(e){e&&$("#modal-reset-password").html(e).find("#resetPasswordModal").modal("show")},error:function(e){alert(e.message)}})}function openRegistrationModalAfterCitySelect(e){console.log("openRegistrationModalAfterCitySelect");const t="undefined"!=typeof IS_GUEST&&IS_GUEST,o=sessionStorage.getItem("regPopupOpenedCityModal");t&&null===o&&(registration(null,e,window.shop_id,null,$(".navigate-brochure.pages-btn-current").attr("href")),setTimeout((function(){document.getElementById("popup-catcher-registration-source").value="location_popup"}),150),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"ga4.sign_up_popup_show",event_data:{source:"location_popup"}}),sessionStorage.setItem("regPopupOpenedCityModal","1"))}function showTopPopup(){$(".floating-mail-catcher.top-pos").trigger("toggle")}function showBottomPopup(){null===window.sessionStorage.getItem("mailcatcher-banner-popup")&&$(".floating-mail-catcher.kimbino-banner, .floating-mail-catcher.only-catcher").addClass("shown")}function tableCollapse(){$(".js_table-collapse").addClass("table-collapsed"),$(".js_table-collapse-btn").click((function(e){e.preventDefault();var t,o=$(this).data("table");t=$("#"+o).hasClass("table-collapsed")?$("#"+o+" table").prop("scrollHeight"):250,$("#"+o).animate({height:t+"px"},500,"linear",(function(){$("#"+o).toggleClass("table-collapsed")})),$(this).toggleClass("collapsed-out")}))}function catcherCounter(e){if("undefined"!=typeof PROCESS_CATCHER_A_TAG_EVENT&&!0===PROCESS_CATCHER_A_TAG_EVENT){let i=$(this).attr("href");if(i&&i.toString().includes("?page=12"))return;if(!$(e.target).closest("#cookies-information, #cookieModal").length){var t;CookieManager.loadCookies();var o="undefined"!=typeof IS_GUEST&&IS_GUEST;isNaN(_COOKIES.catcherCliks)?t=1:(t=_COOKIES.catcherCliks,t++),CookieManager.setCookie("catcherCliks",t,1);var n=isNaN(_COOKIES.regPopupOpened)?0:parseInt(_COOKIES.regPopupOpened),a="undefined"!=typeof ab_test_js&&(ab_test_js.get("one_tap_version_zero")&&"B"===ab_test_js.get("one_tap_version_zero").id||["B","C"].includes(ab_test_js.get("disable_popup_elements")?.id));t>=(ab_test_js.get("push_reg_pop_up")&&"B"==ab_test_js.get("push_reg_pop_up").id?5:4)&&!n&&o&&!a&&($(this).attr("onclick")||(dataLayer.push({event:"ga.event",event_category:"web",event_action:"email_popup",event_label:"",event_value:0}),e.preventDefault(),e.stopPropagation(),CookieManager.setCookie("regPopupOpened",1,1),registration(null,e,shop_id,null,this.getAttribute("href"))))}}}function closeMailCatcherPopup(){$(".floating-mail-catcher.kimbino-banner, .floating-mail-catcher.only-catcher").removeClass("shown"),window.sessionStorage.setItem("mailcatcher-banner-popup","true")}function isPPC(){return!!CookieManager.getCookie("isPPC")}function adsRegenerationElement2(e){"undefined"!=typeof adsbygoogle&&$(e).length>0&&($(e).html("").removeAttr("data-adsbygoogle-status").removeAttr("data-ad-status"),adsbygoogle.push({}))}function adsRegeneration(e){let t=getHrefUrl(e);if(localStorage.getItem("adsRegeneration")){let e=JSON.parse(localStorage.getItem("adsRegeneration"));t===e.lastUrl?e.count=e.count+1:(e.lastUrl=t,e.count=1),localStorage.setItem("adsRegeneration",JSON.stringify(e)),e.count%3==0&&adsRegenerationElement2(".campaign-container[data-area=72] ins, .sticky.stick ins")}else{let e={count:1,lastUrl:t};localStorage.setItem("adsRegeneration",JSON.stringify(e))}}function getHrefUrl(e){let t=e.split("?");return t.length>=2&&(e=t[0]),e}$((function(){$(document).on("click",(function(e){$("#loginModal").is(":visible")&&($(e.target).parents(".modal-content").length||$(e.target).hasClass("fa-eye-off")||$(e.target).hasClass("fa-eye"))})),$(".user-login").on("click",(function(e){e.preventDefault(),clearReferrals(),jqReady&&login(this,e)})),$(".user-registration").on("click",(function(e){e.preventDefault(),jqReady&&registration(this,e,$(this).data("shop"))})),$(document).on("click",".languageSwitcher .change-language",(function(e){e.preventDefault();var t=$(this).closest(".modal-content-wrapper"),o=$(this).data(),n={language:o.language};$("#subscription-shop_id","#subscribeModal").length>0&&(n.shop=$("#subscription-shop_id","#subscribeModal").val()),$.ajax({dataType:"html",method:"POST",data:n,url:o.url,success:function(e){e&&($("#jsCode_popupCatcher, #jsCode_phoneCatcher, #jsCode_login_form_modal",document).remove(),$("li.active",t).removeClass("active"),t.html(e),t.find(".subscribeModal").addClass("in").show(),shadow_layer=$(".modal-backdrop.fade.in")[0],$(shadow_layer).removeClass("in"),t.find(".subscribeModal").modal(),setTimeout((function(){shadow_layer.remove()}),150),setRedirectUrl(),lazyLoadUpdateAll())}})})),$(document).on("shown.bs.modal","#subscribeModal",(function(){$(".js_mailboxleft").addClass("fadeInLeft animated"),$(".js_mailboxright").addClass("fadeInRight animated"),$(".mailboxes").show()})),$(document).on("click",(function(e){let t=!1;if(void 0!==singledayBannerShow.aliexpress_day_2020.start&&void 0!==singledayBannerShow.aliexpress_day_2020.end&&"undefined"!=typeof singledayBannerEnable&&1==singledayBannerEnable){let e=new Date,o=new Date(singledayBannerShow.aliexpress_day_2020.start),n=new Date(singledayBannerShow.aliexpress_day_2020.end);o<=e&&e<=n&&(t=!0)}if(t){let t=sessionStorage.getItem("SingleDayCatcherClicks");isNaN(t)||null===t?t=1:(t=sessionStorage.getItem("SingleDayCatcherClicks"),t=parseInt(t)+1),sessionStorage.setItem("SingleDayCatcherClicks",t),3==t&&(dataLayer.push({event:"ga.event",event_category:"web",event_action:"affiliate_bf_singleday_showed",event_label:"",event_value:0}),e.preventDefault(),e.stopPropagation(),$.ajax({url:singledayBanner,type:"POST"}).done((function(e){$("#modal-single-day").html(e),setTimeout((function(){$("#singledayBanner").modal("show")}),800)})))}})),$(document).on("click","#singledayBanner a",(function(){dataLayer.push({event:"ga.event",event_category:"web",event_action:"affiliate_bf_singleday_click",event_label:"",event_value:0})}))})),isPhone&&$(window).scroll((function(){var e=$(this).scrollTop(),t="200",o=$(".rek-container").first();void 0!==o&&void 0!==o.offset()&&(t=+o.outerHeight()+ +o.offset().top),e>=t&&(showTopPopup(),$(window).off("scroll"))})),$(".floating-mail-catcher.top-pos .show-hide-btn").on("click",(function(e){$(".floating-mail-catcher.top-pos").hasClass("collapsed")?CookieManager.setCookie("mob-catcher-top","0",1/96):CookieManager.setCookie("mob-catcher-top","1",1/96),$(".floating-mail-catcher.top-pos").trigger("toggle",[!1])})),$(".floating-mail-catcher.top-pos").bind("toggle",(function(e){CookieManager.loadCookies(),"mob-catcher-top"in _COOKIES==!1?($(".floating-mail-catcher.top-pos").addClass("shown"),$("body").animate({"padding-top":"58px"})):"mob-catcher-top"in _COOKIES==!0&&"1"==_COOKIES["mob-catcher-top"]?($("body").css({"padding-top":"8px"}),$(".floating-mail-catcher.top-pos").addClass("shown collapsed")):"mob-catcher-top"in _COOKIES==!0&&"0"==_COOKIES["mob-catcher-top"]&&($("body").css({"padding-top":"58px"}),$(".floating-mail-catcher.top-pos").addClass("shown").removeClass("collapsed"))})),isPhone&&setTimeout((function(){showBottomPopup()}),4e3),$(".js-slide-to").click((function(e){e.preventDefault(),slideTo($(this).attr("href"))})),$(".js_table-collapse").length>0&&tableCollapse(),$(document).on("show.bs.modal","#subscribeModal",(function(){$("#form-subscribe-modal").show(),$(".js_subscribe-email-flash").html(""),$("#form-subscribe-modal #mailcatcher-email").val("")})),$("#js_next").click((function(e){e.preventDefault(),$(".js_subscribe-tel").show(),$(".js_flip").addClass("flipInY animated"),$(".js_subscribe-email").hide()})),$("a").on("click",catcherCounter),function(){let e=getQueryParams();["gclid","dclid","fbclid","msclkid","wbraid","gbraid"].some((function(t){return void 0!==e[t]}))&&CookieManager.setCookie("isPPC",!0,1)}();var strs=null;function acData(e,t,o){if(null===strs){findMatches(e,t);var n=new Date;$.ajax({url:searchJsonUrl,type:"GET",data:{time:n.getFullYear()+""+(n.getMonth()+1)+n.getDate()}}).done((function(t){_projects=JSON.parse(t),strs=[],$.each(_projects,(function(e,t){arr={value:t.v+"/",label:t.l,type:"shop",icon:t.i},strs.push(arr),$.each(t.f,(function(e,o){arr={value:t.v+"/"+o.v+"/",label:o.l,type:"letak",icon:o.i,time:o.t,updated:o.u},strs.push(arr)}))})),0===strs.length?strs=null:findMatches(e,o)}))}else findMatches(e,t)}function removeRegexSpecials(e){return e.replace(/[.+*?^$()\[\]{}|\\]+/g,"")}function stripTags(e){return $("<div/>").html(e).text()}function findMatches(e,t){matches_s=[],matches_l=[],substrRegex=[];var o=e.split(" ");$.each(o,(function(e,t){(t=removeRegexSpecials(t)).length>0&&substrRegex.push(new RegExp(t,"i"))})),$.each(strs,(function(e,t){var o=!0;$.each(substrRegex,(function(e,n){n.test(t.label)||n.test(t.value)||(o=!1)})),o&&("shop"==t.type?matches_s.push(t):matches_l.push(t))})),matches_s.sort(dynamicSort("label")),matches_l.sort(dynamicSort("-updated")),0===matches_l.length&&0===matches_s.length&&$("#ac_val").val(""),$("#ac_hint").val(stripTags($("#search-input-box").val())),t(matches_s.concat(matches_l))}var projects=[],th_config={hint:!0,highlight:!0,minLength:0,classNames:{wrapper:"",input:"tt-input js-search-input",hint:"tt-hint",selectable:"tt-selectable",menu:"search-prompt js_search-prompt",dataset:"list-unstyled list-unstyled-kimbino list-row",suggestion:"tt-suggestion",empty:"tt-empty",open:"tt-open",cursor:"active",highlight:"match"}},th_source={name:"kimbino",source:acData,display:function(e){return e.label},templates:{header:`<h3 class="favourite-shops-header">${favourite_shops_text}</h3>`,suggestion:function(e){return getItem(e)}}},th_events="typeahead:select typeahead:autocomplete typeahead:render keyup typeahead:close typeahead:open";function th_callback(e,t){if(fixEsSuggestion(),void 0!==t&&$("#ac_val").val(t.value),"keyup"!=e.type||13!=e.originalEvent.keyCode&&13!=e.originalEvent.which)if("typeahead:close"==e.type)stopEsLookUp();else{if(0==$(".search-input .search-prompt div div.tt-suggestion.active").length&&$($(".search-input .search-prompt div div.tt-suggestion")[0]).addClass("active"),e.originalEvent&&(-1===[37,38,39,40].indexOf(e.originalEvent.keyCode)||-1===[37,38,39,40].indexOf(e.originalEvent.which)))return!0;esSearchEnabled&&esLookUp($("#search-input-box").val())}else redirecting($("#ac_val").val());lazyLoadUpdateAll();var o=document.getElementById("searchbox");"typeahead:open"===e.type?(o.classList.add("open"),stretchDropdown()):"typeahead:close"===e.type&&(o.classList.remove("open"),$(".searchbox").removeClass("borderBottomRightRadius0 borderBottomLeftRadius0"))}function redirecting(e,t){if(void 0===t)t=!1;0===$(".es-search.active").length&&""!=e?searchRoute(e):esRedirect()}$("#search-input-box").bind("typeahead:close",(function(){$(".city-picker-wrapper").css({backgroundColor:"",color:""}),$("#city-picker").css({backgroundColor:"",color:""})})),$("#search-input-box").bind("typeahead:open",(function(){const e=$("header").css("background-color"),t=e.slice(0,-1).replace("rgb","rgba")+", 0.2)",o=$(".searchbox"),n=$(".tt-hint");if($(".magnifier-wrapper > .mobile").is(":visible")){const n=$("#city-picker");n.attr("style",`background-color: ${t} !important;color:#9D9D9D;`),n.css({"--color":e}),o.addClass("js-input-selected"),$(".brand-mobile-overlay").css({display:"flex","background-color":e}),$(".btn-wrapper-mobile-overlay").css({display:"flex","background-color":e}),$(".tt-input").css({height:"36px"})}else $(".city-picker-wrapper").attr("style",`background-color: ${t};color:#9D9D9D`);n.css({background:"rgb(255, 255, 255)",color:"#9D9D9D"}),$(".js_search-prompt").find(".tt-suggestion").length>0&&($(".search-input").hasClass("no-city-picker")&&o.addClass("borderBottomLeftRadius0"),o.addClass("borderBottomRightRadius0"));const a=$(".navbar-btns"),i=$("#toggleNavbarButton");if(a.hasClass("collapsed")||a.trigger("click"),!i.hasClass("collapsed")){i.trigger("click");const e=document.getElementById("svgBurger"),t=document.getElementById("svgX");e.style.display="inline-block",t.style.display="none"}})),$("#search-input-box").bind("typeahead:render",(function(e,t,o,n){const a=$(".searchbox");void 0!==n?($(".search-input").hasClass("no-city-picker")&&a.addClass("borderBottomLeftRadius0"),a.addClass("borderBottomRightRadius0")):a.removeClass("borderBottomLeftRadius0 borderBottomRightRadius0")}));var th_timer=null,lookUpTimeout;function dynamicSort(e){var t=1;return"-"===e[0]&&(t=-1,e=e.substr(1)),function(o,n){return(o[e]<n[e]?-1:o[e]>n[e]?1:0)*t}}function getItem(e){var t="shop"==e.type?"lazyloadLogo":"lazyloadBrochure";return'<div class="'+e.type+'"><a href="javascript:void(0)" onclick="searchRoute(\''+e.value+'\')"><div class="img-container"><picture><img data-src="'+e.icon+'" alt="'+e.label+'" class="'+t+'"></picture></div><div class="search-prompt-query"><p>'+e.label+"</p>"+("letak"==e.type?"<small>"+e.time+"</small>":"")+"</div></a></div>"}function searchRoute(e){$("#search-input-box").val(),$("#ac_hint").val();""!==e&&(window.location=e)}function stopEsLookUp(){clearTimeout(lookUpTimeout)}function esLookUp(e,t){if(void 0===t)t=!1;return clearTimeout(lookUpTimeout),!(""==e||e.length<3)&&(!1===t?(searchingEs(),lookUpTimeout=setTimeout(esLookUp,1e3,e,!0),!0):void $.ajax({url:esSearchJsonUrl,type:"POST",data:{search:e}}).done((function(e){fillEsField(e)})).fail((function(){fillEsField(esSearchError)})))}function searchingEs(){0===$(".es-search").length&&(0===$(".tt-suggestion").length?($(".search-prompt").show(),$(".search-prompt .list-unstyled.list-unstyled-kimbino").append(getEsSearchItem())):$(".tt-suggestion").last().after(getEsSearchItem()))}function fixEsSuggestion(){bug=$(".es-search .es-search"),0!==bug.length&&$(".es-search").html($(".es-search .es-search").html())}function fillEsField(e){esItem=$(".es-search"),0!==esItem.length&&esItem.html(getEsItem(e))}function esRedirect(){window.location=esSearchRedirectUrl+"?q="+stripTags($("#search-input-box").val())}function getEsSearchItem(){return'<div class="es-search letak tt-suggestion tt-selectable"><a href="javascript:void(0)"><div class="img-container" style="background:white">'+esSearchImg+'</div><div class="search-prompt-query"><p><strong>'+stripTags($("#search-input-box").val())+"</strong></p><small>"+esSearching+"</small></div></a></div>"}function getEsItem(e){return'<div class="es-search letak tt-suggestion tt-selectable"><a href="javascript:void(0)" onclick="esRedirect()"><div class="img-container svg" style="background:white"><img src="'+esSearchImgDone+'"></div><div class="search-prompt-query"><p><strong>'+stripTags($("#search-input-box").val())+"</strong></p><small>"+e+"</small></div></a></div>"}function stretchDropdown(){if($(".location-marker.mobile").is(":visible")){const e=-($(".js_search-prompt").offset().left+window.screenY);$(".js_search-prompt").css({left:e+"px  !important",top:"40px !important"})}}th_timer=setInterval((function(){"function"==typeof $("#search-input-box").typeahead&&(clearInterval(th_timer),setTimeout((function(){$("#search-input-box").typeahead(th_config,th_source).on(th_events,th_callback)}),100))}),500);let _plaEl=null,_plaOpen=!0,_plaListener=!1,_plaBgEl=null;const _plaMinimalOffset=24;let _plaIsBackgroundSet=!1,lastScrollTop=0,isScrollingTop=!1,isPlaHidden=!1;function initObserver(){const e=document.body;new MutationObserver((()=>{e.style.padding=""})).observe(e,{attributes:!0,attributeFilter:["style"]})}function showIt(e){$(e).stop().fadeIn("slow"),isPlaHidden=!1}function hideIt(e){$(e).stop().fadeOut("slow"),isPlaHidden=!0}function _plaScrollHandler(e){if(_plaEl)return;const t=document.getElementsByClassName("adsbygoogle adsbygoogle-noablate");if(t.length){_plaSetBackground();for(var o=0;o<t.length;o++)if(null!==t[o].getAttribute("data-anchor-status")&&"INS"===t[o].nodeName){_plaEl=t[o];break}_plaEl&&!_plaListener&&(_plaListener=!0,_plaEl.addEventListener("click",(function(){_plaOpen=!_plaOpen})))}}function _plaSetBackground(){if(_plaIsBackgroundSet)return;_plaIsBackgroundSet=!0,_plaBgEl=document.getElementById("page_level_ad_bg");const e=document.getElementsByTagName("HEADER")[0];_plaBgEl.style.setProperty("background",window.getComputedStyle(e).background)}function _plaFixPadding(){if(!_plaEl)return;const e=_plaEl.clientHeight,t=_plaOpen?e+_plaMinimalOffset-4:_plaMinimalOffset;document.body.style.setProperty("padding-top",`${t}px`,"important"),_plaBgEl.style.setProperty("marginTop",`-${_plaMinimalOffset-4}px`),_plaBgEl.style.setProperty("height",`-${_plaMinimalOffset-4}px`)}window.addEventListener("scroll",_plaScrollHandler,{passive:!0}),"loading"!==document.readyState?initObserver():document.addEventListener("DOMContentLoaded",(function(){initObserver()})),window.addEventListener("scroll",(function(){var e=window.pageYOffset||document.documentElement.scrollTop;if(0===document.documentElement.scrollTop){const e=document.getElementsByClassName("adsbygoogle adsbygoogle-noablate")[1];e&&"displayed"==e.getAttribute("data-anchor-status")&&hideIt(e)}if(e<=lastScrollTop)isScrollingTop=!0;else{isScrollingTop=!1;const e=document.getElementsByClassName("adsbygoogle adsbygoogle-noablate")[1];isPlaHidden&&e&&showIt(e)}lastScrollTop=e<=0?0:e}),!1);const ExternalScriptManager={loadedScripts:[],lastResponse:"",getExternalScript:function(e,t){let o="script-"+e+"-"+t;var n=this;return new Promise(((a,i)=>{if(n.loadedScripts.includes(o)){let e=$("#"+o).html();a(n.buildResponse(o,`already loaded ${o}`,e))}else{let r=`${getExternalScriptUrl}?serviceId=${e}&productIdentifier=${t}`;$.ajax({url:r,type:"GET",success:function(e){if(n.lastResponse=e,""===$(e).html().trim())i("No script loaded");else{var t=$('<div class="external-script" id="'+o+'"></div>');$("body").append(t),$("#"+o).html(e),a(n.buildResponse(o,`loaded ${o}`,e))}},error:function(e,t,o){n.lastResponse=o,bconsole.error("ExternalScriptManagerError: getExternalScript failed ("+r+"): "+o,"tracker-error"),i(o)},complete:function(){n.loadedScripts.push(o)}})}}))},buildResponse:function(e,t,o){return{scriptId:e,enabled:""!==o&&null!=o,message:t,script:o}}},GeolocationStrategyInterface={hasCoordinates(){},setCoordinates(e){},_validateCoordinates(){},_loadCoordinatesFromCookie(){}},strategy={coords:{lon:null,lat:null},name:"default_strategy",geoStrategy:null,hasCoordinates:function(){return this._loadCoordinatesFromCookie(),this._validateCoordinates()},setCoordinates:function(e){this.coords=e},_validateCoordinates:function(){let e="lat"in this.coords&&"lon"in this.coords&&null!==this.coords.lat&&null!==this.coords.lon,t=!0;return"tracker"===this.name&&null===this.geoStrategy&&(t=!1),e&&t},_loadCoordinatesFromCookie:function(){if(GeoStorage.has(this.name)){let e=GeoStorage.get(this.name);this.coords={lat:e.lat,lon:e.lon},"tracker"===this.name&&e.hasOwnProperty("geo_strategy")&&(this.geoStrategy=e.geo_strategy)}}};var user_input_city=Object.create(strategy,{name:{value:"user_input_city"}}),device=Object.create(strategy,{name:{value:"device"},isFallback:{value:!1}}),user_input_branch=Object.create(strategy,{name:{value:"user_input_branch"},isFallback:{value:!1}}),ip_address=Object.create(strategy,{name:{value:"ip_address"},isFallback:{value:!1}}),fallback_capital=Object.create(strategy,{name:{value:"fallback_capital"},isFallback:{value:!0}}),fallback=Object.create(strategy,{name:{value:"fallback"},isFallback:{value:!0}}),tracker=Object.create(strategy,{name:{value:"tracker"},isFallback:{value:!1}});function strategyFactory(e){if(!window.hasOwnProperty(e))throw new Error(`Variable ${e} not found on window.`);return window[e]}const GeoLogger={size:1e3,currentSize:0,messageHistory:[],rowsDiscarded:0,requests:[],log:function(e){this.currentSize>=this.size&&(this.messageHistory.shift(),this.rowsDiscarded+=1),this.messageHistory.push(e),this.currentSize+=1},requesting:function(e){for(let t of this.requests)if(t.from===e)return;this.requests.push({from:e,strategy:null,coordinates:null,done:!1})},responded:function(e,t,o){for(let n of this.requests)if(n.from===e)return n.strategy=t,n.coordinates=JSON.stringify(o),void(n.done=!0)},printHeader:function(){let e=["-----------------------------------------------------------------------","------------------------------ GeoLogger ------------------------------",`- Rows discarded: ${this.rowsDiscarded} / ${this.currentSize}`,"-----------------------------------------------------------------------"];for(const t of this.requests)e.push(`- Req. [${t.done?"DONE":"ERROR"}] [${t.from}]: ${t.strategy} --\x3e ${t.coordinates}`);e.push("-----------------------------------------------------------------------");for(const t of e)console.debug(t)},history:function(){this.printHeader();for(const e of this.messageHistory)console.debug(e)}},GeolocationManager={availableStrategies:["user_input_city","device","user_input_branch","tracker","ip_address","fallback_capital","fallback"],strategiesCascade:["tracker","user_input_city","user_input_branch","ip_address","fallback_capital","fallback"],validationDependency:{user_input_city:{callback:CookieManager.hasCookie,args:["CITY"]}},enabledDeviceStrategy:!0,enabledIpStrategy:!1,currentStrategyName:null,initialized:!1,loadingIpByExternalService:!1,loadingIpByTracker:!1,loadingIpByBackendService:!1,trackerUpdatedWithIpCoordinates:!1,afterInitStack:[],storage:GeoStorage,trackerStrategy:!1,logger:GeoLogger,init:function(){this.strategies={};for(const e of this.availableStrategies){const t=strategyFactory(e);this._validateStrategy(t,t.coords)?this.strategies[e]=t:console.error(`Failed to verify strategy or coordinates: ${JSON.stringify(e)}, coords: ${JSON.stringify(t.coords)}`)}"undefined"!=typeof geo_by_ip_enabled&&!0===geo_by_ip_enabled&&this.enableIpStrategy(),this.loadResources("GeolocationManager.init"),this.purgeEmptyStrategies()},usesTrackerStrategy:function(){return this.trackerStrategy},loadResources:async function(e=""){if(this._needsCoordinates("ip_address",e)){let t=this;return t.logger.log("[loadResources][from:"+e+"] -> loading ip coordinates"),t.loadCoordinatesByExternalService(e).then((()=>{t.logger.log("[loadResources][from:"+e+"] -> ip coordinates loaded"),t._setInitialized()})).catch((async()=>this.loadCoordinatesByIpTracker(e).then((()=>{t.logger.log("[loadResources][from:"+e+"] -> ip coordinates loaded"),t._setInitialized()})).catch((async()=>{t.logger.log("[loadResources][from:"+e+"] -> ip coordinates not loaded"),t._needsCoordinates("fallback_capital",e)&&CapitalCity.loadCoordinates(),t._setInitialized()}))))}this.logger.log("[loadResources][from:"+e+"] - dont need ip coords"),this._setInitialized()},getCoordinates:async function(e=!1,t=""){let o=this;return o.logger.requesting(t),this.loadResources(t).then((()=>{let n=!1,a=!1;for(const i of this.strategiesCascade){if(void 0!==this.validationDependency[i]){const e=this.validationDependency[i];if(!e.callback(...e.args))continue}if(o.logger.log("--\x3e [getCoordinates][from:"+t+"]: checking strategy: "+i),o.logger.log("--\x3e [getCoordinates][from:"+t+"] setting current as: "+i),this._setCurrentStrategy(i,t),this.strategies[i].hasCoordinates()){if(!e&&this.strategies[i].isFallback)return!1;a=i,"tracker"===i&&(o.logger.log("--\x3e [getCoordinates][from:"+t+"] tracker is: "+this.strategies[i].geoStrategy),a=this.strategies[i].geoStrategy),this._setCurrentStrategy(i,t),n=this.strategies[i].coords;break}}return o.logger.log("==> getCoordinates: ["+a+"][from:"+t+"]: coords: "+JSON.stringify(n)),o.logger.responded(t,a,n),n}))},_setCurrentStrategy:function(e,t=""){"tracker"!==e?(this.currentStrategyName=this.strategies[e].name,this.trackerStrategy=!1):void 0!==this.strategies.tracker.geoStrategy&&null!==this.strategies.tracker.geoStrategy&&(this.logger.log("[_setCurrentStrategy]["+t+"] - setting tracker strategy: "+this.strategies[e].geoStrategy),this.currentStrategyName=this.strategies.tracker.geoStrategy,this.trackerStrategy=!0)},getCoordinatesByStrategy:function(e){return!!this.strategies.hasOwnProperty(e)&&this.strategies[e].coords},hasCoordinates:function(e){return this.strategies[e].hasCoordinates()},loadCoordinatesByDevice:function(e,t,o=""){if(this.enabledDeviceStrategy&&"geolocation"in navigator){let n=this;navigator.geolocation.getCurrentPosition((t=>{let a={lat:t.coords.latitude,lon:t.coords.longitude};n.setCoordinates("device",a),e(o)}),(e=>{console.debug(e),n.disableDeviceStrategy(),t(o)}))}},loadCoordinatesByIpTracker:function(e=""){let t=this,o=window.UTracker;return t.logger.log("[loadCoordinatesByIpTracker][from:"+e+"] - starting"),new Promise((async(n,a)=>{t.logger.log("[loadCoordinatesByIpTracker][from:"+e+"] - waiting for ip"),await t._waitForLoadingIp("tracker"),t.loadingIpByTracker=!0,await o.waitForData(),t.logger.log("[loadCoordinatesByIpTracker][from:"+e+"] - waiting for ip DONE");let i=this.getCoordinatesByStrategy("ip_address");t.loadingIpByTracker=!1,i?(null===sessionStorage.getItem("tracker_updated")&&UTracker.userIsAllowed()&&!1===t.trackerUpdatedWithIpCoordinates&&(UTracker.updateData("ip-found").catch((e=>console.log(e))),t.trackerUpdatedWithIpCoordinates=!0,sessionStorage.setItem("tracker_updated","true")),n(i)):a("Coordinates by IP not found")}))},loadCoordinatesByExternalService:async function(e=""){var t=this;return t.logger.log("[loadCoordinatesByExternalService][from:"+e+"] - starting"),new Promise((async(o,n)=>{await t._waitForLoadingIp("external-service"),t.loadingIpByExternalService=!0,await t._waitForLoadingExternalScriptManager(),ExternalScriptManager.getExternalScript(1,"geo_location").then((async a=>{if(t.logger.log("[loadCoordinatesByExternalService][from:"+e+"] - external script loaded"),await t._waitForExternalScriptFunctions(e),a.enabled)if("function"==typeof geotargetly_lat&&"function"==typeof geotargetly_lng){let a={lat:t.coordinatesFormat(geotargetly_lat()),lon:t.coordinatesFormat(geotargetly_lng())};t.coordinatesValid(a)?(t.setCoordinates("ip_address",a,null,Math.floor(178*Math.random()+178)),t.shouldSaveStrategy("ip_address")&&t.setCoordinates("tracker",a,"ip_address"),null===sessionStorage.getItem("tracker_updated")&&UTracker.userIsAllowed()&&!1===t.trackerUpdatedWithIpCoordinates&&(UTracker.updateData("ip-found").catch((e=>console.log(e))),t.trackerUpdatedWithIpCoordinates=!0,sessionStorage.setItem("tracker_updated","true")),t.loadingIpByExternalService=!1,o(a)):(t.logger.log("[loadCoordinatesByExternalService][from:"+e+"] - ERROR: coords not valid"),t.loadingIpByExternalService=!1,n("Coordinates by IP not found (external service)"))}else{t.logger.log("[loadCoordinatesByExternalService][from:"+e+"] - ERROR: script functions not loaded"),t.loadingIpByExternalService=!1;let o=ExternalScriptManager.lastResponse;bconsole.error("GeotargetlyError: Functions not loaded (maybe number of requests exhausted), last script response: "+o,"frontend-error",.5,!0),n("Coordinates by IP not found (external service - script not loaded)")}else t.logger.log("[loadCoordinatesByExternalService][from:"+e+"] - ERROR: script not loaded - disabled"),t.loadingIpByExternalService=!1,n("Script empty (Maybe service not set for country)")})).catch((o=>{t.logger.log("[loadCoordinatesByExternalService][from:"+e+"] - WARNING: "+o),t.loadingIpByExternalService=!1,n()}))}))},loadCoordinatesByIp:function(){let e=this;return new Promise((async(t,o)=>{if(this.enabledIpStrategy)if(await e._waitForLoadingIp("backend-service"),e.loadingIpByBackendService=!0,null===sessionStorage.getItem("ip_requested"))$.ajax({url:`${getGeolocationJsonUrl}?partnerId=${geo_partner_id}`,type:"POST",success:function(n){if("string"==typeof n&&(n=JSON.parse(n)),e.geoLocationIsValid(n)){let o={lat:n.data.lat,lon:n.data.lon};e.setCoordinates("ip_address",o,null,Math.floor(178*Math.random()+178)),e.shouldSaveStrategy("ip_address")&&e.setCoordinates("tracker",o,"ip_address"),UTracker.userIsAllowed()&&UTracker.updateData("ip-found").catch((e=>console.log(e))),t(o)}else o("Coordinates by IP not found")},error:function(e,t,n){o("Coordinates by IP not found")}}).always((function(){e.loadingIpByBackendService=!1,sessionStorage.setItem("ip_requested","true")}));else{let n=this.getCoordinatesByStrategy("ip_address");e.loadingIpByBackendService=!1,n?t(n):o("Coordinates by IP not found")}else o("Coordinates by IP not found")}))},setCoordinates:function(e,t,o=null,n=null){this.logger.log("<--- setCoordinates ["+e+"]["+o+"]");const a=this.strategies[e]||{};if(this._validateStrategy(a,t)){a.setCoordinates(t);let e=a.coords;o&&(e.geo_strategy=o),this.storage.set(a.name,e,n)}else console.error(`Failed to verify strategy or coordinates: ${JSON.stringify(e)}, coords: ${JSON.stringify(t)}`)},disableDeviceStrategy:function(){this.enabledDeviceStrategy=!1},enableDeviceStrategy:function(){this.enabledDeviceStrategy=!0},enableIpStrategy:function(){this.enabledIpStrategy=!0},getCurrentStrategy:async function(e=""){let t=this;return new Promise((async(o,n)=>{t.getCoordinates(!1,"[getCurrentStrategy][from:"+e+"]").then((e=>o(t.currentStrategyName))).catch((e=>{console.error(e),n(e)}))}))},_waitForLoadingIp:function(e){let t=this,o=null;switch(e){case"tracker":o="loadingIpByTracker";break;case"external-service":o="loadingIpByExternalService";break;case"backend-service":o="loadingIpByBackendService";break;default:console.debug("_waitForLoadingIp: no such property:"+e)}return new Promise((e=>{const n=setInterval((()=>{!1===t[o]&&(clearInterval(n),e())}),10)}))},_waitForLoadingExternalScriptManager:function(){return new Promise((e=>{const t=setInterval((()=>{void 0!==ExternalScriptManager&&(clearInterval(t),e())}),10)}))},_waitForExternalScriptFunctions:function(e){let t=this;return new Promise((o=>{let n=1;const a=setInterval((()=>{"function"==typeof geotargetly_lat&&"function"==typeof geotargetly_lng?(clearInterval(a),t.logger.log("[loadCoordinatesByExternalService][from:"+e+"] - external script functions available (iterations: "+n+")"),o()):100===n&&(t.logger.log("[loadCoordinatesByExternalService][from:"+e+"] - ERROR: external script functions not available"),o()),n++}),10)}))},_setInitialized:function(){this.initialized=!0},_checkInterface:function(e,t){for(let o in t)if("function"!=typeof e[o])return console.error("missing implementation for "+o),!1;return!0},_validateStrategy:function(e,t){return this._checkInterface(e,GeolocationStrategyInterface)&&t&&"lat"in t&&"lon"in t},_needsCoordinates:function(e,t){this.logger.log("[_needsCoordinates][from:"+t+"]: starting");for(const o of this.strategiesCascade)if("tracker"!==o){if(this.strategies[o].hasCoordinates())return this.logger.log("[_needsCoordinates][from:"+t+"]: "+o+" -> has coords, return false"),!1;if(this.strategies[o].name===e)return this.logger.log("[_needsCoordinates][from:"+t+"]: "+o+" -> no coords, return true"),!0}else this.logger.log("[_needsCoordinates][from:"+t+"]: tracker -> skip");return console.error("No such strategy found: "+e),!1},shouldSaveStrategy:function(e){for(const t of this.strategiesCascade)if("tracker"!==t){if(this.strategies[t].hasCoordinates()&&this.strategies[t].name!==e)return!1;if(this.strategies[t].name===e)return!0}return!1},replaceTrackerStrategyFromCascade:function(e){const t=this.strategiesCascade.findIndex((t=>t===e));if(-1===t)return!1;if(void 0===this.strategiesCascade[t]+1)return!1;const o=this.strategiesCascade.slice(t+1,this.strategiesCascade.length);for(const t of o)if("tracker"!==t&&t!==e&&this.strategies[t].hasCoordinates())return void this.setCoordinates("tracker",this.strategies[t].coords,t)},coordinatesValid:function(e){return void 0!==e.lat&&void 0!==e.lon&&null!==e.lat&&null!==e.lon},coordinatesFormat:function(e){const t=parseFloat(e);return isNaN(t)?null:t},geoLocationIsValid:function(e){return void 0!==e.data&&this.coordinatesValid(e.data)},purgeEmptyStrategies(){for(const e of this.strategiesCascade)if(GeoStorage.has(e)){const t=GeoStorage.get(e);void 0!==t.lon&&void 0!==t.lat&&null!==t.lon&&"null"!==t.lon&&null!==t.lat&&"null"!==t.lat||GeoStorage.delete(e)}}};GeolocationManager.init();var TrackingPixelManager={lastTime:null,enabled:{null:!0,1:"prod"===window.env||1===window.beta_partner_force_prod_api},append:function(e,t,o=null){if(!Array.isArray(e)||e.length<=0)return console.debug(e),void console.error("Tracking pixels error");if(!0===this.enabled[o]&&!PartnerManager.userHelper.isSamePageRedirect())for(let o of e){if(Array.isArray(t)&&t.length>=0)for(let e of t)o=this.replaceVariable(o,e);1===window.beta_partner_force_prod_api?console.debug("Tracking pixel: ",o):this.createPixel(o)}},createPixel:function(e){$("body").append(`<img src="${e}" style="display:none;" alt="Advertisement"/>`)},replaceVariable:function(e,t){return e.replace(t,this.getUniqueTimestamp())},getUniqueTimestamp:function(){for(;this.lastTime===(new Date).getTime(););return this.lastTime=(new Date).getTime(),this.lastTime},observe:function(e){document.querySelectorAll(`.${e}`);observeElements(`.${e}`,{threshold:.1},{fn:this.observerHandler,args:[this]})},observerHandler:function(e,t){let o=e.getAttribute("data-tracking-pixel-impressions"),n=e.getAttribute("data-tracking-pixel-variables"),a=e.getAttribute("data-partner-id");o&&(o=o.split(" "),n=n.split(" "),o.length>0&&t.append(o,n,a))}};window.addEventListener("load",(function(){TrackingPixelManager.observe("tracking-pixel-thumb")}));var GAPreviewMonitor={observeElements:function(e){observeElements(e,{threshold:.1},{fn:this.pushToDataLayer})},pushToDataLayer:function(e){let t=e.querySelector(".js-leaflet-info"),o=JSON.parse(t.dataset.info),n=e.querySelector("a").href;window.dataLayer.push({event:"ga4.leaflet_thumbnail_show",event_data:{categoryId:o.category,link_url:n,isTop:!!o.top,type:o.type,clickLeafletId:o.leaflet,eventName:window.eventName||null,position:o.position||null,placement:o.placement||null,partnerId:o.partnerId}}),t.remove()}};window.addEventListener("load",(function(){GAPreviewMonitor.observeElements(".js-ga-preview")}));var GaEventDispatcher={events:{strategyEvent:{event:"ga4.geo_strategies",event_data:{strategy:"[to be replaced]"}}},replacementPairs:{strategyEvent:{path:"event_data.strategy",replacement:async()=>{try{await GeolocationManager.getCoordinates(!0,"GaEventDispatcher.replacement")}catch(e){console.error("Cant get coordinates in GaEventDispatcher: "+e)}return await GeolocationManager.getCurrentStrategy("gaEventDispatcher replacement")}}},dispatchStrategyEvent:async function(){if("undefined"!=typeof fireStrategyEvent&&!0===fireStrategyEvent){let e=this;const t=setInterval((async function(){if(void 0!==GeolocationManager){clearInterval(t);let o=await e.replacementPairs.strategyEvent.replacement();const n=e._setNestedValue(e.events.strategyEvent,e.replacementPairs.strategyEvent.path,o);e._dispatch(n)}}),500)}},init:function(){this.dispatchStrategyEvent()},_dispatch:function(e){let t=JSON.parse(JSON.stringify(e));window.dataLayer.push(t)},_setNestedValue:function(e,t,o){const n=t.split(".");let a=e;for(let e=0;e<n.length-1;e++){const t=n[e];a[t]||(a[t]={}),a=a[t]}return a[n[n.length-1]]=o,e}};$(document).ready((function(){GaEventDispatcher.init()})),document.addEventListener("DOMContentLoaded",(function(){$(document).on("click",".js-hide-search-mobile",(function(e){e.preventDefault();const t=$(".city-dropdown-list");t.css({display:"none"}),t.removeClass("full-width-dropdown"),$(".btn-wrapper-mobile-overlay").css({display:"none"}),$(".brand-mobile-overlay").css({display:"none"}),$(".searchbox").removeClass("js-input-selected borderBottomRightRadius0 borderBottomLeftRadius0")})),$(document).on("click",".js-search-input",(function(e){e.preventDefault();const t=$("header").css("background-color");$(".magnifier-wrapper > .mobile").is(":visible")&&($(".brand-mobile-overlay").css({display:"flex","background-color":t}),$(".btn-wrapper-mobile-overlay").css({display:"flex","background-color":t}));const o=t.slice(0,-1).replace("rgb","rgba")+", 0.2)";$(".location-marker.mobile").is(":visible")?($(".searchbox").addClass("js-input-selected"),$(".city-dropdown-list").css({"margin-top":"90px"}),$(".tt-hint").css({background:"rgba(255, 255, 255, 0.8)",color:"#9D9D9D"})):$(".tt-hint").css({background:o,color:"#9D9D9D"}),function(){const e=$(".navbar-btns"),t=$("#toggleNavbarButton");e.hasClass("collapsed")||e.trigger("click");if(!t.hasClass("collapsed")){t.trigger("click");const e=document.getElementById("svgBurger"),o=document.getElementById("svgX");e.style.display="inline-block",o.style.display="none"}}()}))}));class ApiLoader{constructor(e,t,o){this.apiUrl=e,this.cacheDuration=1e3*t,this.cacheKey=`cache_${o}`,this.cacheTimestampKey=`cache_timestamp_${o}`,this.pendingRequests={}}async load(e={}){const t=localStorage.getItem(this.cacheKey),o=localStorage.getItem(this.cacheTimestampKey);if(t&&o){if((new Date).getTime()-o<this.cacheDuration)return Promise.resolve(JSON.parse(t))}if(this.pendingRequests[this.apiUrl])return this.pendingRequests[this.apiUrl];const n=this.fetchAndCacheData(e);return this.pendingRequests[this.apiUrl]=n,n.finally((()=>{delete this.pendingRequests[this.apiUrl]})),n}async fetchAndCacheData(e){try{const t=new URL(this.apiUrl,window.location.origin);e.params&&Object.keys(e.params).forEach((o=>t.searchParams.append(o,e.params[o])));const o=await fetch(t.toString(),e),n=await o.json(),a=(new Date).getTime();return localStorage.setItem(this.cacheKey,JSON.stringify(n)),localStorage.setItem(this.cacheTimestampKey,a.toString()),n}catch(e){throw console.error("API fetch error:",e),e}}}class PromoElement{constructor(e,t){this.shopId=e,this.shopCategoryId=t,this.promoDataInstance=new PromoElementData,this.promoBoostInstance=new PromoElementsBoost,this.whyNotShow=[]}async getPromoBoost(e){let t=null;try{t=await this.promoBoostInstance.getPromoElementsBoostsByKey(e)}catch(t){return this.whyNotShow.push(["Chyba pri vykonávaní AJAXových volaní",e]),null}return t?0===t?.status?(this.whyNotShow.push(["Prvok je deaktivovany",e]),null):"PPC"!==t?.traffic_source||isPPC()?"ORGANIC"===t?.traffic_source&&isPPC()?(this.whyNotShow.push(["Nie si Organic",e]),null):isOnSubdomain()?(this.whyNotShow.push(["Si na subdomene",e]),null):t:(this.whyNotShow.push(["Nie si PPC",e]),null):(this.whyNotShow.push(["Neexistuje promoBoost",e]),null)}isDisabledElementForPartnerBrochure(e,t){return!(!e?.disabled_on_partner_leaflet||!t)}async getPromoElement(e,t=null){try{let o=await this.promoDataInstance.getPromoElementsBySource(this.shopId,this.shopCategoryId,e.source);return!o||o.length<=0?(this.whyNotShow.push(["Neexistuje promoElements"]),null):(t&&(o=o.filter(t)),o[0])}catch(e){return this.whyNotShow.push(["Chyba pri vykonávaní AJAXových volaní"]),null}}async getPromoElements(e,t=null){try{let o=await this.promoDataInstance.getPromoElementsBySource(this.shopId,this.shopCategoryId,e.source,e.limit);return t&&(o=o.filter(t)),!o||o.length<=0?(this.whyNotShow.push(["Neexistuje promoElements"]),null):o}catch(e){return this.whyNotShow.push(["Chyba pri vykonávaní AJAXových volaní"]),null}}checkIsSubpage(e){return"sub_page"===e.type||(this.whyNotShow.push(["Prvok nie je nastaveny na sub_page"]),!1)}checkIsTime(e){return"time"===e.type||(this.whyNotShow.push(["Prvok nie je nastaveny na time"]),!1)}calculateAfterPagePosition(e,t){let o=e.type_value,n=parseInt(o,10);return n<0&&(n=t+n+1),n<1&&(n=1),n}isPromoPageValid(e,t){let o=e.type_value;return parseInt(o,10)<=t}trackExternalSeen(e,t){let o={project:"let",promo_element_source:e,timestamp:14,url_md5:t};UTracker.userActivityUpdate(o,!0)}isExternal(e){return"secret_external"===e?.type}}function createPromoElementsRedirectUrl(e,t={}){let o;o=e?.is_partner?`${secretBrochureRedirectLink}?type=secretBrochure&id=${e.brochure_id}`:e.url;const n=toQueryString(t);return n&&(o+=(o.includes("?")?"&":"?")+n),o}function toQueryString(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}function sendPromoElementImpression(e){"undefined"!=typeof PartnerManager&&e?.partner_data&&PartnerManager.forPartner(1).trackImpression({partnerBrochureId:e?.partner_data?.id},{url:e?.partner_data?.actions?.impression?.url,credentials:e?.partner_data?.actions?.impression?.auth})}function sendPromoElementClick(e){"undefined"!=typeof PartnerManager&&e?.partner_data&&PartnerManager.forPartner(1).trackClick({partnerBrochureId:e?.partner_data?.id},{url:e?.partner_data?.actions?.click?.url,credentials:e?.partner_data?.actions?.click?.auth})}function sendPromoElementPageView(e,t){"undefined"!=typeof PartnerManager&&e?.partner_data&&(PartnerManager.forPartner(1).trackPageView({partnerBrochureId:e?.partner_data?.id,page:t,timeDelta:window.timeDelta||null},{url:e?.partner_data?.actions?.page_view?.url,credentials:e?.partner_data?.actions?.page_view?.auth}),window.timeDelta=performance.now())}async function sendLeafletToTrackerPromo(e){if(void 0!==e&&!UserHelper.isSamePageRedirect()&&!UserHelper.isBot()){let t=null;t=setInterval((async function(){!0===UTracker.uidRequested&&(clearInterval(t),UTracker.userActivityUpdate(e))}),100)}}function checkIsRobot(){const e=navigator.userAgent;return new RegExp([/bot/,/spider/,/crawl/,/APIs-Google/,/AdsBot/,/Googlebot/,/mediapartners/,/Google Favicon/,/FeedFetcher/,/Google-Read-Aloud/,/DuplexWeb-Google/,/googleweblight/,/bing/,/yandex/,/baidu/,/duckduck/,/yahoo/,/ecosia/,/ia_archiver/,/facebook/,/instagram/,/pinterest/,/reddit/,/slack/,/twitter/,/whatsapp/,/youtube/,/semrush/].map((e=>e.source)).join("|"),"i").test(e)}class PromoElementData{constructor(){return PromoElementData.instance||(PromoElementData.instance=this,this.cacheTime=2,this.ajaxUrl="/ajax/get-deals-brochures/",this.storageDataKey="promoElements",this.apiLoader=new ApiLoader(this.ajaxUrl,this.cacheTime,this.storageDataKey),this.data=null,this.cacheTimestamp=null,this.pendingRequest=null),PromoElementData.instance}async getPromoElementsBySource(e,t,o,n=1){try{let a,i=await this.getPromoElements(e,t);return i&&0!==i.length?(a=o?i.filter((e=>e.sources&&e.sources.includes(o))):i,a.slice(0,Math.min(n,a.length))):null}catch(e){throw console.error("Chyba pri načítaní údajov:",e),e}}filterByNonInteractive(e){return e.filter((e=>!1===e.is_interactive))}filterBySource(e,t){return t&&t.length>0?e.filter((e=>t.includes(e?.sources))):e}async getPromoElementsBySourceNotInteractive(e,t,o=[]){let n;try{n=await this.getPromoElements(e,t),n=this.filterBySource(n,o),n=this.filterByNonInteractive(n)}catch(e){console.log("Error while getting promoElements",e)}return n.length>0?n[0]:null}async getPromoElement(e,t,o=[]){try{let o=await this.getPromoElements(e,t);return o?o[0]:null}catch(e){throw console.error("Chyba pri načítaní údajov:",e),e}}async getPromoElementByType(e,t,o=[]){try{let n=await this.getPromoElements(e,t);return o&&o.length>0&&(n=n.filter((e=>o.includes(e?.type)))),n?n[0]:null}catch(e){throw console.error("Chyba pri načítaní údajov:",e),e}}async getPromoElementByTypeNotInteractive(e,t,o=[]){try{let n=await this.getPromoElements(e,t);return o&&o.length>0&&(n=n.filter((e=>o.includes(e?.type)))),n=n.filter((e=>!1===e.is_interactive)),n?n[0]:null}catch(e){throw console.error("Chyba pri načítaní údajov:",e),e}}async getPromoElements(e,t){return this.data&&(new Date).getTime()-this.cacheTimestamp<1e3*this.cacheTime?this.data?.data:(this.pendingRequest||(this.pendingRequest=(async()=>{try{const o=await this.createParametersDataForPromo(e,t),n=this.getFromCache(e,o);return n?this.data=n?.data||[]:(this.data=await this.apiLoader.load({params:o}),this.saveToCache(e,o,this.data)),this.cacheTimestamp=(new Date).getTime(),this.data?.data}catch(e){return console.error("Error loading data:",e),null}finally{this.pendingRequest=null}})()),await this.pendingRequest)}async createParametersDataForPromo(e,t){let o={};if(void 0!==GeolocationManager){let e=await GeolocationManager.getCoordinates(!1,"PromoElementData.createParametersDataForPromo");e&&e.lat&&e.lon&&(o={lat:e.lat,lon:e.lon})}e&&(o.shopId=e),t&&(o.categoryId=parseInt(t));try{let e=await UTracker.userActivityGet(),t=[...e.external_urls,...e.leaflet_ids];o.seen=t.join(",")}catch(e){console.log(e)}return o}saveToCache(e,t,o){const n="promoCache";let a=JSON.parse(localStorage.getItem(n))||[];const i=a.findIndex((t=>t.shopId===e));-1!==i&&a.splice(i,1),a.unshift({shopId:e,params:t,data:o}),a.length>5&&a.pop(),localStorage.setItem(n,JSON.stringify(a))}getFromCache(e,t){return(JSON.parse(localStorage.getItem("promoCache"))||[]).find((o=>o.shopId===e&&JSON.stringify(o.params)===JSON.stringify(t)))||null}}class PromoElementsBoost{constructor(){return PromoElementsBoost.instance||(PromoElementsBoost.instance=this,this.cacheTime=900,this.ajaxUrl="/_api/v1/general/index/",this.storageDataKey="promoElementsBoost",this.apiLoader=new ApiLoader(this.ajaxUrl,this.cacheTime,this.storageDataKey),this.data=null),PromoElementsBoost.instance}async getPromoElementsBoostsByKey(e){if(this.data)return this.data?.data.propagation_settings&&this.data?.data.propagation_settings.hasOwnProperty(e)?this.data.data.propagation_settings[e]:null;try{const t=await this.apiLoader.load();return this.data=t,t?.data.propagation_settings&&t?.data.propagation_settings.hasOwnProperty(e)?t.data.propagation_settings[e]:null}catch(e){return console.error("Error loading data:",e),null}}}class BackButton extends PromoElement{constructor(e,t){super(e,t),this.key="back_button",this.shopId=e,this.shopCategoryId=t,this.promoElements=null,this.promoBoost=null,window.addEventListener("load",this.handlePageLoad.bind(this)),window.name||(window.name=this.generateUniqueTabId(),sessionStorage.removeItem("backButtonTriggered"))}generateUniqueTabId(){return"tab_"+Math.random().toString(36).slice(2,9)}async handlePageLoad(){const e=document.referrer;if(!sessionStorage.getItem("backButtonTriggered")&&(window.history.length<=1||""===e||new URL(e).hostname!==window.location.hostname)){if(sessionStorage.setItem("backButtonTriggered","true"),this.promoBoost=await this.getPromoBoost(this.key),!this.promoBoost)return;if(this.promoElements=await this.getPromoElements(this.promoBoost,(e=>"secret_external"!==e.type)),!this.promoElements)return;this.pushBrochureToHistory(this.promoElements),window.addEventListener("popstate",(e=>{handlePopStateBackButton(e)}))}else this.whyNotShow.push(["Referer nie je z inej stranky"])}pushBrochureToHistory(e){let t=window.location.pathname,o=document.title;(e=this.moveShopIdToEnd(e,this.shopId)).forEach(((t,o)=>{this.updateHistoryState(t,o,e.length)})),this.resetHistoryState(t,o)}moveShopIdToEnd(e,t){const o=e.findIndex((e=>e?.shop_id===t));if(-1!==o){const[t]=e.splice(o,1);e.push(t)}return e}resetHistoryState(e,t){window.history.pushState({},"",e),window.history.replaceState({},"",e),document.title=t}updateHistoryState(e,t,o){let n=o-t,a=createPromoElementsRedirectUrl(e,{backButton:this.getBackButtonType(e,this.shopId,n)});0===t?window.history.replaceState({type:"backButton",url:a},"",a):window.history.pushState({type:"backButton",url:a},"",a),document.title=`Brochure - ${n}`}getBackButtonType(e,t,o){return 1===o&&e?.shop_id==t?"shop_landing_page":"leaflet_"+(o-1)}}function handlePopStateBackButton(e){e&&e.state&&"backButton"===e.state.type&&e.state.url&&window.location.replace(e.state.url)}function gaBackButtonTracking(){let e=new URL(window.location.href).searchParams.get("backButton");window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"ga4.backbutton_redirect",event_data:{link_url:window.location.href,leafletOriginalId:brochureId,type:e||""}})}class ExitPage extends PromoElement{constructor(e,t,o){super(e,t),this.type=o,this.key="exit_page",this.selectedNextTopBrochureLink=void 0,this.promoElement=null,this.promoBoost=null,this.init()}async init(){this.removeEventListeners(),CookieManager.getCookie("exitPage"+this.type)?this.whyNotShow.push(["Uz bol videny pre typ :"+this.type]):(this.promoBoost=await this.getPromoBoost(this.key),this.promoBoost&&(this.isDisabledElementForPartnerBrochure(this.promoBoost,"undefined"!=typeof isPartnerBrochure&&isPartnerBrochure)?this.whyNotShow.push(["Zablokovane na partnerskych letakoch"]):(this.promoElement=await this.getPromoElement(this.promoBoost),this.promoElement&&(this.boundHandleMouseMove=this.handleMouseMove.bind(this),this.boundHandleBlur=this.handleBlur.bind(this),this.hasMouseMove()?document.addEventListener("mousemove",this.boundHandleMouseMove):window.addEventListener("blur",this.boundHandleBlur)))))}handleMouseMove(e){e.clientY<10&&(this.openModal(),document.removeEventListener("mousemove",this.boundHandleMouseMove))}handleBlur(){this.openModal(),window.removeEventListener("blur",this.boundHandleBlur)}openModal(){if(document.getElementById("exitPageModal"))return;this.getPromoElement(this.promoBoost).then((e=>{e&&(this.promoElement=e)}));let e=createPromoElementsRedirectUrl(this.promoElement);this.trackingShow(this.promoElement.url),$("body").append(`\n        <div id="exitPageModal" class="secret-brochure-modal--container"  data-url="${e}" data-tracking-url="${this.promoElement.url}">\n            <div class="secret-brochure-modal--modal">\n                <div class="secret-brochure-modal--close">\n                    <span id="exitPageModalClose" class="secret-brochure-modal--close__btn">\n                        <object data="/img/close_button.svg" type="image/svg+xml" class="secret-brochure-modal--close__object"></object>\n                    </span>\n                </div>\n                <div class="secret-brochure-modal--image">\n                    <span id="exitPageModalImage" data-url="${e}" data-tracking-url="${this.promoElement.url}">\n                        <picture class="logo full">\n                            <source title="" srcset="/img/exit-web/popup_${countryCode}.png" >\n                            <img src="/img/no-img.jpg" alt="" title="">\n                        </picture>\n                    </span>\n                </div>\n            </div>\n        </div>\n        `),CookieManager.setCookie("exitPage"+this.type,!0,1),document.getElementById("exitPageModalClose").addEventListener("click",this.closeSecretBrochureModal.bind(this)),document.getElementById("exitPageModal").addEventListener("click",this.openLinkFromSecretBrochureModal.bind(this))}closeSecretBrochureModal(e){e.preventDefault(),e.stopPropagation(),this.removeModalEventListeners(),document.body.style.overflow="",document.getElementById("exitPageModal").remove()}openLinkFromSecretBrochureModal(e){e.preventDefault(),e.stopPropagation();let t=e.currentTarget.getAttribute("data-url"),o=e.currentTarget.getAttribute("data-tracking-url");this.closeSecretBrochureModal(e),this.trackingClick(o,(()=>{let e="_self";this.isExternal(this.promoElement)&&(e="_blank"),window.open(t,e)}))}hasMouseMove(){return!("ontouchstart"in window||navigator.maxTouchPoints>0)}trackingClick(e,t){this.isExternal(this.promoElement)||sessionStorage.setItem("promo_element_source",this.key),setTimeout((()=>{this.isExternal(this.promoElement)&&(window.dataLayer.push({event:"ga4.partner_url_click",event_data:{link_url:this.promoElement.url,placement:this.key}}),this.trackExternalSeen(this.key,this.promoElement.url_hashed)),window.dataLayer.push({event:"ga4.popup_secret_leaflet_click",event_data:{link_url:e,type:"exit_click",method:"sales"}})}),0),"function"==typeof t&&t()}trackingShow(e){window.dataLayer.push({event:"ga4.popup_secret_leaflet_show",event_data:{link_url:e,type:"exit_click",method:"sales"}})}removeEventListeners(){this.boundHandleMouseMove&&document.removeEventListener("mousemove",this.boundHandleMouseMove),this.boundHandleBlur&&window.removeEventListener("blur",this.boundHandleBlur)}removeModalEventListeners(){const e=document.getElementById("exitPageModalClose"),t=document.getElementById("exitPageModalImage");e&&e.removeEventListener("click",this.closeSecretBrochureModal.bind(this)),t&&t.removeEventListener("click",this.openLinkFromSecretBrochureModal.bind(this))}}class NotificationBell extends PromoElement{constructor(e,t){super(e,t),this.key="notification_bell",this.promoElement=null,this.promoBoost=null,this.url=null,this.handleClick=this.handleClick.bind(this),this.trackClick=this.trackClick.bind(this),this.counterCount,this.init()}async init(){try{if(this.promoBoost=await this.getPromoBoost(this.key),!this.promoBoost)return;if("undefined"!=typeof isPartnerBrochure&&this.isDisabledElementForPartnerBrochure(this.promoBoost,isPartnerBrochure))return void this.whyNotShow.push(["Zablokovane na partnerskych letakoch"]);if(this.promoElement=await this.getPromoElement(this.promoBoost),!this.promoElement)return;this.counterCount=CookieManager.getCookie("notificationBellCount")||3,this.url=createPromoElementsRedirectUrl(this.promoElement),CookieManager.getCookie("notificationBellSeen")||(this.trackShow(),CookieManager.setCookie("notificationBellSeen",!0,1));let e=document.querySelector(".notifications-bell");if(!e){let t=window.innerWidth<1024?document.querySelector(".btns-wrapper"):document.getElementById("user-navbar").parentElement,o=`\n                    <span class="notification-bell-container  ${this.counterCount>=1?"animate":""}">\n                        <span class="notifications-bell">\n                            <span class="notification-bell-image-wrapper">\n                                <img class="notification-bell-image ${this.counterCount>=1?"ring":""}" src="/img/notification-bell.svg" width="18" height="21" alt="Notification bell">\n                            </span>\n                            <span class="notification-bell-counter ${this.counterCount<1?"hidden":""}">${this.counterCount}</span>\n                        </span>\n                    </span>\n                `;t.insertAdjacentHTML("afterbegin",o),e=document.querySelector(".notifications-bell"),e&&(e.addEventListener("click",this.handleClick),this.counterCount>0&&this.animateRingObserver()),this.addSmoothMoveClass(),window.addEventListener("resize",this.moveNotificationBell)}}catch(e){console.error("Error initializing PromoElementsArrow:",e)}}moveNotificationBell(){let e=window.innerWidth<1024?document.querySelector(".btns-wrapper"):document.getElementById("user-navbar").parentElement,t=document.querySelector(".notification-bell-container");e&&t&&e.insertAdjacentElement("afterbegin",t)}addSmoothMoveClass(){let e=document.querySelector(".notification-bell-container");setTimeout((()=>{e.classList.add("smooth-move")}),50)}animateRingObserver(){const e=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&this.resetAnimation()}))}),{threshold:.5}),t=document.querySelector(".notification-bell-image");e.observe(t)}resetAnimation(){let e=document.querySelector(".notification-bell-image");e.classList.remove("ring"),setTimeout((()=>{e.classList.add("ring")}),50)}changeCounter(){let e=document.querySelector(".notification-bell-counter");e&&(this.counterCount<1?e.classList.add("hidden"):e.innerHTML=this.counterCount)}async handleClick(e){e.preventDefault(),e.stopPropagation(),this.url&&(this.newPromoElement=await this.getPromoElement(this.promoBoost),this.newPromoElement&&(this.url=createPromoElementsRedirectUrl(this.newPromoElement),this.trackingUrl=this.newPromoElement.url),this.counterCount>0&&CookieManager.setCookie("notificationBellCount",--this.counterCount,1),this.changeCounter(),this.trackClick((()=>{let e=2===this.counterCount?"_blank":"_self";this.isExternal(this.promoElement)&&(e="_blank"),window.open(this.url,e)})))}trackShow(){this.promoElement&&this.promoElement.url&&window.dataLayer.push({event:"ga4.popup_secret_leaflet_show",event_data:{type:"notification_bell",link_url:this.promoElement.url,method:"sales"}})}trackClick(e){this.isExternal(this.promoElement)||sessionStorage.setItem("promo_element_source",this.key),setTimeout((()=>{this.isExternal(this.promoElement)&&(window.dataLayer.push({event:"ga4.partner_url_click",event_data:{link_url:this.promoElement.url,placement:this.key}}),this.trackExternalSeen(this.key,this.promoElement.url_hashed)),window.dataLayer.push({event:"ga4.popup_secret_leaflet_click",event_data:{type:"notification_bell",link_url:this.promoElement.url,method:"sales"}})}),0),"function"==typeof e&&e()}}function imagePreviewAds(e,t){let o=document.querySelector(e);if(!o)return;o.style.backgroundImage=`linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.5)), url('${t}')`,o.style.backgroundSize="contain",o.style.backgroundPosition="center 20px",o.style.backgroundRepeat="no-repeat";const n={childList:!0,subtree:!0};if(o){new MutationObserver(((t,o)=>handleLogoBackgroundMutation(e,t,o))).observe(o,n)}}function handleLogoBackgroundMutation(e,t,o){for(const n of t)if("childList"===n.type&&(n.target.id.includes("iframe")||"IFRAME"===n.target.nodeName||null!==n.target.querySelector("iframe"))){const t=document.querySelector(e);setTimeout((function(){t.style.backgroundImage="none"}),1e3),o.disconnect()}}function shopExtendedVisualABTest(){["dk"].includes(document.getElementsByTagName("body")[0].dataset.country)&&isPPC()&&(window.ab_test_js=window.ab_test_js||[],ab_test_js.set([{id:"shop_extended_visual",versions:[{id:"A",weight:50},{id:"B",weight:50}]}],[]))}async function shopExtendedVisualInit(){let e=document.querySelector(".skeleton-loader").querySelector(".brochure-thumb.col-sm-3.col-xs-6");if(e.querySelector(".vstoupit-long"))return;let t=e.querySelector(".grid-item").querySelector("a").querySelector(".img-container").querySelector("picture img");if(t){if(!t.getAttribute("src").includes("0_s.jpg"))return;let e=t.getAttribute("src").replace("0_s.jpg","1_s.jpg");if(!await checkImageExists(e))return}if(!e||"4"===e.getAttribute("data-brochure-type"))return;e.className="brochure-thumb col-sm-6 col-xs-12 special-type-test";let o=document.querySelector(".skeleton-loader"),n=Array.from(o.querySelectorAll(".brochure-thumb"));for(let e=0;e<=n.length-2;e++){let t=n[e],a=n[e+1],i=a.getAttribute("data-ad-area"),r=a.getAttribute("data-display"),s=a.getAttribute("data-size"),l=a.getAttribute("data-position");t.setAttribute("data-ad-area",i),t.setAttribute("data-display",r),t.setAttribute("data-size",s),t.setAttribute("data-position",l),o.insertBefore(t,a)}let a=n[n.length-1];a.removeAttribute("data-ad-area"),a.removeAttribute("data-display"),a.removeAttribute("data-size");let i=document.querySelector(".special-type-test"),r=i.querySelector(".grid-item").querySelector("a").querySelector(".img-container");if(r){let e=r.cloneNode(!0);r.parentNode.insertBefore(e,r.nextSibling);let t=e.querySelector("picture img");if(t){let e=t.getAttribute("src");if(e.includes("0_s.jpg")){let o=e.replace("0_s.jpg","1_s.jpg");t.setAttribute("src",o)}}}let s=i.querySelectorAll(".img-container");if(s.length>1){let e=document.createElement("div");e.className="arrow",e.innerHTML='\n            <svg width="10" height="16" viewBox="0 0 10 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n                <path fill-rule="evenodd" clip-rule="evenodd" d="M0.834308 15.6653C0.387994 15.219 0.387994 14.4953 0.834308 14.049L6.47927 8.40406C6.70243 8.18091 6.70242 7.8191 6.47927 7.59594L0.834308 1.95098C0.387994 1.50467 0.387994 0.781049 0.834308 0.334736C1.28062 -0.111579 2.00424 -0.111579 2.45055 0.334736L9.3077 7.19188C9.75401 7.63819 9.75401 8.36181 9.3077 8.80812L2.45055 15.6653C2.00424 16.1116 1.28062 16.1116 0.834308 15.6653Z"/>\n            </svg>\n        ',s[1].appendChild(e),s[1].querySelector(".chips").remove(),s[1].querySelector(".ribbon")&&s[1].querySelector(".ribbon").remove(),s[1].querySelector(".interactive-bag").remove(),s[0].querySelector(".ribbon")&&(s[0].querySelector(".ribbon").innerHTML=`${shopExtendedVisualNew}`)}let l=document.querySelector("header"),c=window.getComputedStyle(l).backgroundColor,d=document.querySelector(".special-type-test .grid-btns > .btn");d&&(d.style.backgroundColor=c,d.style.border=`1px solid ${c}`);let u=document.querySelector(".special-type-test .img-container .arrow svg");u&&(u.style.color=c);let h=i.querySelector(".letak-description").querySelector("a"),p=h.querySelectorAll(".grid-item-content"),g=document.createElement("div");g.className="text-description";let m=document.createElement("div");m.className="logo-description",p.forEach((e=>{g.appendChild(e)})),h.appendChild(g),h.insertBefore(m,g);let f=document.querySelector(".produkt-info-box").querySelector("picture"),v=document.querySelector(".logo-description");if(v&&f){let e=f.cloneNode(!0);v.appendChild(e)}initLazyLoadLogo()}function checkImageExists(e){return new Promise((t=>{let o=new Image;o.onload=function(){t(!0)},o.onerror=function(){t(!1)},o.src=e}))}function pushRegPopUpTest(){["pt","si"].includes(document.getElementsByTagName("body")[0].dataset.country)&&isPPC()&&(window.ab_test_js=window.ab_test_js||[],ab_test_js.set([{id:"push_reg_pop_up",versions:[{id:"A",weight:50},{id:"B",weight:50}]}],[]))}function runConsentMove(){["cz","no","fr","pl","de","fi","at","be","it","nl","se","dk","gr","bg","sk","ro","es","pt","si","gb"].includes(document.getElementsByTagName("body")[0].dataset.country)&&(isPPC()?observeShopThumbsLoad():enableConsentMove())}function enableConsentMove(){let e=document.getElementsByTagName("body")[0].dataset.country,t={cz:[{type:2,weight:100,config:{message_id:"FJpwQtzQ"}}],no:[{type:2,weight:100,config:{message_id:"MXgtgzgU"}}],fr:[{type:2,weight:100,config:{message_id:"npMLkXTc"}}],pl:[{type:1,weight:100,config:{switch_buttons:!0}}],de:[{type:2,weight:100,config:{message_id:"ytYWRj32"}}],fi:[{type:2,weight:100,config:{message_id:"GDKEPcXz"}}],at:[{type:2,weight:100,config:{message_id:"6UHNLyb3"}}],be:[{type:1,weight:100}],it:[{type:2,weight:100,config:{message_id:"xKq6WRUA"}}],nl:[{type:2,weight:100,config:{message_id:"EWA3ZXxw"}}],se:[{type:2,weight:100,config:{message_id:"BTgc9p27"}}],dk:[{type:2,weight:100,config:{message_id:"j4K28rtd"}}],gr:[{type:1,weight:100}],bg:[{type:1,weight:100}],sk:[{type:1,weight:100}],ro:[{type:2,weight:100,config:{message_id:"mfXaDFpW"}}],es:[{type:2,weight:100,config:{message_id:"VTV4gmVF"}}],pt:[{type:2,weight:100,config:{message_id:"3ZNTf3Hb"}}],si:[{type:2,weight:100,config:{message_id:"2amDg78m"}}],gb:[{type:1,weight:100}]};t[e]&&(window.hyper_cmp=window.hyper_cmp||[],hyper_cmp.push((()=>{hyper_cmp.run(t[e])})))}function getCountryData(){const e=document.body.dataset.country;return window.domainTest[env]&&window.domainTest[env][e]?window.domainTest[env][e]:null}function canRunChangeUrlForSecondPage(e,t=!1){const o=getCountryData();if(!o)return!1;const{domain:n,subdomain:a,shopsName:i}=o,r=window.location.href;return!!(t?r.includes(a):r.includes(n)&&!r.includes(a))&&!!i.includes(e)}function changeUrlForSecondPage(e){const t=getCountryData();return t&&(e=e.replace(t.domain,t.subdomain)),e}function changeUrlForPaginator(){canRunChangeUrlForSecondPage(shop_name)&&document.querySelectorAll(".navigate-brochure").forEach((e=>{e.getAttribute("href")?.match(/[?&]page=2($|&)/)&&(e.href=changeUrlForSecondPage(e.href),e.setAttribute("target","_blank"))}))}function isOnSubdomain(){const e=getCountryData();if(!e)return!1;const{subdomain:t}=e;return window.location.href.includes(t)}function changeHrefToDomain(){const e=getCountryData();e&&document.querySelectorAll("a").forEach((function(t){t.classList.contains("navigate-brochure")||(t.href=t.href.replace(e.subdomain,e.domain))}))}document.addEventListener("DOMContentLoaded",(function(){window.notificationBell=new NotificationBell("undefined"!=typeof shop_id?shop_id:null,"undefined"!=typeof shop_category_id?shop_category_id:null)})),window.ab_test_js=window.ab_test_js||[],ab_test_js.push((()=>{shopExtendedVisualABTest()})),window.ab_test_js=window.ab_test_js||[],ab_test_js.push((()=>{pushRegPopUpTest()})),window.domainTest={dev:{sk:{domain:"local.letakomat.sk",subdomain:"p2.local.letakomat.sk",shopsName:["IDEA nábytok"]}},beta:{ch:{domain:"beta.oferlo.ch",subdomain:"p2.beta.oferlo.ch",shopsName:["Aldi"]}},prod:{ie:{domain:"www.offermate.ie",subdomain:"p2.offermate.ie",shopsName:["Lidl"]},ch:{domain:"www.oferlo.ch",subdomain:"p2.oferlo.ch",shopsName:["Aldi"]}}},document.addEventListener("DOMContentLoaded",(function(){runConsentMove(),isOnSubdomain()&&changeHrefToDomain()}));