"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[995],{202:(t,e,n)=>{var o=n(624),r=n(591);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function l(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==i(e)?e:String(e)}var u=function(){function t(e){a(this,t),this.element=e.element,this.callbackLeft=e.callbackLeft,this.callbackRight=e.callbackRight,this.threshold=40,this.touchstartX=0,this.touchstartY=0,this.touchendX=0,this.touchendY=0,this.init()}return l(t,[{key:"init",value:function(){var t=this;this.element&&(this.element.addEventListener("touchstart",(function(e){t.touchstartX=e.changedTouches[0].screenX,t.touchstartY=e.changedTouches[0].screenY}),!1),this.element.addEventListener("touchend",(function(e){t.touchendX=e.changedTouches[0].screenX,t.touchendY=e.changedTouches[0].screenY,t.handleGesture()}),!1))}},{key:"handleGesture",value:function(){var t=this.touchendX-this.touchstartX,e=this.touchendY-this.touchstartY;Math.abs(t)>Math.abs(e)&&Math.abs(t)>this.threshold&&Math.abs(e)<this.threshold&&(t>0?this.callbackLeft():this.callbackRight())}}]),t}();const d=function(){function t(e){var n=e.container,o=void 0===n?null:n;a(this,t),this.imageIndex=0,this.container=o,this.images=[],o&&(this.images=o.querySelectorAll(".thumb_image"))}return l(t,[{key:"init",value:function(){var t=this,e=this.container.querySelector(".lightbox"),n=this.container.querySelectorAll("#buttonLeft"),o=this.container.querySelectorAll("#buttonRight"),r=this.container.querySelector("#buttonZoom"),i=this.container.querySelector("#mainImage"),a=this.container.querySelector("#lightboxImage"),c=this.container.querySelector("#buttonClose");n.forEach((function(e){e.addEventListener("click",(function(){t.move(t.imageIndex-1)}))})),o.forEach((function(e){e.addEventListener("click",(function(){t.move(t.imageIndex+1)}))})),this.container.addEventListener("keydown",(function(e){switch(e.key){case"ArrowLeft":t.move(t.imageIndex-1);break;case"ArrowRight":t.move(t.imageIndex+1);break;case"Escape":t.toggleLightbox(!1)}})),null==r||r.addEventListener("click",(function(){t.toggleLightbox(!0),t.showImage()})),null==c||c.addEventListener("click",(function(){t.toggleLightbox(!1)})),e.addEventListener("click",(function(e){e.preventDefault(),e.target.closest(".lightbox_panel")||e.target.closest(".lightbox_title_panel")||e.target.closest(".lightbox_image_container")||t.toggleLightbox(!1)})),this.images.forEach((function(e,n){e.addEventListener("click",(function(){t.imageIndex!==n&&t.move(n)}))})),[i,a].forEach((function(e){new u({element:e,callbackLeft:function(){return t.move(t.imageIndex-1)},callbackRight:function(){return t.move(t.imageIndex+1)}})}))}},{key:"move",value:function(t){var e=this.images.length;this.imageIndex=(t%e+e)%e,this.scrollThumbNavigation(this.imageIndex),this.showImage()}},{key:"toggleLightbox",value:function(t){this.container.querySelector(".lightbox").style.display=t?"flex":"none",document.getElementById("head_wrapper").style.display=t?"none":"block",document.getElementsByTagName("html")[0].style.overflow=t?"hidden":""}},{key:"scrollThumbNavigation",value:function(t){this.container.querySelector(".thumb_navigation").scrollTo({top:0,left:85*t,behavior:"smooth"})}},{key:"showImage",value:function(){this.images.forEach((function(t){return t.classList.remove("active")}));var t=this.images[this.imageIndex],e=t.firstElementChild,n=this.container.querySelector(".gallery_video_item");t.classList.add("active");var o,r=function(t,e){var n;e.src=t.dataset.srcLarge,e.dataset.src=t.dataset.srcLarge,e.srcset=t.dataset.fullSrcset,e.alt=t.alt,e.title=t.title,null===(n=e.closest(".gallery_image_container"))||void 0===n||n.setAttribute("data-animate",!1),setTimeout((function(){var t;null===(t=e.closest(".gallery_image_container"))||void 0===t||t.setAttribute("data-animate",!0)}),0)},i=this.container.querySelector("#lightboxImage"),a=this.container.querySelector("#imageNumber"),c=this.container.querySelectorAll(".img_copyright"),l=this.container.querySelector("#title"),s=this.container.querySelector("#mainImage");(r(e,s),r(e,i),this.container.querySelector(".blurred_background").style.background="url('".concat(e.dataset.srcLarge,"')"),n)&&(n.style.display="1"===(null===(o=e.dataset)||void 0===o?void 0:o.video)?"block":"none");a&&(a.innerText="".concat(this.imageIndex+1,"/").concat(this.images.length)),l.innerText=e.title,i.style.maxHeight="calc(100vh - 156px)",c.forEach((function(t){t.innerText=e.dataset.source}))}}]),t}();function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function h(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,m(o.key),o)}}function m(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=f(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:String(e)}n(237);var p=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(0,o.eA)(),e.is_next_articles&&(this.articlesLoaderConfig={request_url:e.load_more_articles_route,postData:{page:2,article:e.article_id},append_after:!0,container:".append_after",spinner:".articles_spinner",load_trigger:".load_more_articles",beforeAppend:function(){$(".article_item.last").removeClass("last")},callback:function(){n.articlesLoaderConfig.postData.page+=1,window.adsHelper&&(window.adsHelper.newSkyscraper(),window.adsHelper.checkAds(),window.adsHelper.getAds()),$(window).trigger("gaev.article_detail_loadmore",{articleName:n.articleName}),window.lazyLoad(),(0,o.eA)(),n.articlesLoaderConfig.load_trigger?$("#loadMoreArticles").show():$("#loadMoreArticles").closest(".wrap").hide()}},this.articlesLoader=new r.A,$("#loadMoreArticles").click((function(t){t.preventDefault(),n.articlesLoader.loadMore(n.articlesLoaderConfig),$("#loadMoreArticles").hide()}))),this.scrollEvent=null,this.alreadyReportedPositions=[],this.articleId=e.article_id,this.articleName=e.article_name,this.dotData_articleDetail(),(0,o.v0)({canonicalString:e.canonical_string,name:e.article_name,discussionUrl:e.discussion_url,analyticsData:{articleId:e.article_id}});var i=document.querySelector(".article_labels--scroll");i&&function(t){function e(t,e,n,o){var r,i,a=t.scrollLeft,c=e-a,l=performance.now();!function e(){r=performance.now(),i=(r-l)/1e3/n,t.scrollLeft=a+c*function(t){return t<.5?2*t*t:(4-2*t)*t-1}(i),i<1?window.requestAnimationFrame(e):o&&o()}()}function n(t){var e=document.createElement("div");return e.innerHTML=t.trim(),e.firstChild}function o(){return"touch"===t.parentElement.getAttribute("data-scroll")}function r(){t.scrollWidth-t.offsetWidth<=1?o()||t.parentElement.setAttribute("data-scroll","none"):t.scrollWidth-t.offsetWidth-Math.round(t.scrollLeft)<=2?o()||t.parentElement.setAttribute("data-scroll","max"):t.scrollLeft<=1&&(o()||t.parentElement.setAttribute("data-scroll","min"))}var i=n('<svg class="svg left_arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"></path></svg>'),a=n('<svg class="svg right_arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"></path></svg>');t.parentElement.append(i),t.parentElement.append(a),i.addEventListener("mousedown",(function(n){n.stopPropagation(),n.preventDefault(),o()||t.parentElement.setAttribute("data-scroll",""),e(t,t.scrollLeft-240,.3,r)})),a.addEventListener("mousedown",(function(n){n.stopPropagation(),n.preventDefault(),o()||t.parentElement.setAttribute("data-scroll",""),e(t,t.scrollLeft+240,.3,r)})),a.addEventListener("touchstart",(function(n){n.preventDefault(),setTimeout((function(){t.parentElement.setAttribute("data-scroll","touch")}),10),e(t,t.scrollLeft+240,.3,r)})),t.parentElement.setAttribute("data-scroll","min"),t.parentElement.addEventListener("touchmove",(function(e){t.parentElement.setAttribute("data-scroll","touch"),setTimeout((function(){t.parentElement.setAttribute("data-scroll","touch"),i.remove(),a.remove()}),100)})),window.addEventListener("ads.branding",(function(){r()})),r()}(i),$(".szn-btn-add-to-seznam").click((function(t){$(window).trigger("gaev.szn_feed_button_click",{title:n.articleName})})),Array.from(document.querySelectorAll(".article_gallery")).forEach((function(t){new d({container:t}).init()})),this.summaryListScroll()}var e,n,i;return e=t,(n=[{key:"dotData_articleDetail",value:function(){var t=this;window.addEventListener("scroll",(function(e){t.handleScrollArticle(e)}))}},{key:"handleScrollArticle",value:function(t){var e=this;clearTimeout(this.scrollEvent),this.scrollEvent=setTimeout((function(t){e.processScrollToElement(t)}),180)}},{key:"checkPositionToReport",value:function(t,e){var n=[20,40,60,80,100];if(t>=100)return 100;var o=n[e];return t>=o&&t<n[e+1]?o:this.checkPositionToReport(t,e+1)}},{key:"processScrollToElement",value:function(t){var e=document.getElementById("posBox");if(e){var n=e.getBoundingClientRect(),o=(window.innerHeight-n.top)/n.height*100;if(o>=20){var r=this.checkPositionToReport(o,0);-1===this.alreadyReportedPositions.indexOf(r)&&(this.alreadyReportedPositions.push(r),$(window).trigger("dotev.article_scroll",{id:this.articleId,position:r,time:Math.round(performance.now())}))}}}},{key:"summaryListScroll",value:function(){document.querySelectorAll("#summary_list a").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();var e=t.currentTarget.getAttribute("href"),n=document.querySelector(e);n&&(setTimeout((function(){document.body.setAttribute("data-direction","down")}),500),window.scrollTo({top:n.getBoundingClientRect().top+window.scrollY-70,behavior:"smooth"}))}))}))}}])&&h(e.prototype,n),i&&h(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();window.Article=p},591:(t,e,n)=>{function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,i(o.key),o)}}function i(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:String(e)}n.d(e,{A:()=>u});const a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,o=[{key:"request",value:function(t){if(t)return $.ajax({type:t.type||"POST",url:t.url,data:t.data,error:function(e){"function"==typeof t.error&&t.error(e)},beforeSend:function(e,n){"function"==typeof t.beforeSend&&t.beforeSend(e,n)},success:function(e,n,o){"function"==typeof t.success&&t.success(e,n,o)},complete:function(e,n){"function"==typeof t.complete&&t.complete(e,n)}})}}],(n=null)&&r(e.prototype,n),o&&r(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function s(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=c(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:String(e)}const u=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.xhrPending=!1}var e,n,o;return e=t,(n=[{key:"loadMore",value:function(t){var e=this,n=t.request_url,o=t.postData,r=t.callback,i=t.beforeAppend,c=$(t.container),l=t.manual_loading?t.load_btn:null,s=$(t.spinner);0===s.length&&(s=$(".spinner_wrap"));var u={url:n,data:o,type:t.method||"POST",beforeSend:function(){e.xhrPending=!0,s.length&&s.stop().fadeIn(),l&&(l.style.display="none")},success:function(e,n,o){if("function"==typeof e.replace&&0===e.replace(/\s/g,"").length&&$(t.load_trigger).length&&$(t.load_trigger).remove(),200===o.status){var a=e;"application/json"===o.getResponseHeader("content-type")&&e.template&&(a=e.template),c.length?(t.append_type&&"reload"===t.append_type&&c.html(""),i&&"function"==typeof i&&i(),t.append_after?c.last().after(a):c.append(a),void 0!==e.isNext&&!1===e.isNext&&(t.load_trigger=""),window.dispatchEvent(new CustomEvent("loader.append.content"))):t.load_trigger="",r&&"function"==typeof r&&r(e)}},error:function(){},complete:function(t){var n;e.xhrPending=!1,s.length&&s.stop().fadeOut(),l&&(l.style.display=null!=t&&null!==(n=t.responseJSON)&&void 0!==n&&n.isNext?"inline-block":"none")}};a.request(u)}},{key:"onScrollLoad",value:function(t){var e=this;$(t.load_trigger).length&&$(document).on("scroll",(function(){if(!t.disabled){var n=$(t.load_trigger).offset();if("object"===c(n)&&n.hasOwnProperty("top")){var o=n.top,r=$(window).outerHeight();$(window).scrollTop()>o-r&&(e.xhrPending||t&&t.postData&&e.loadMore(t))}}}))}}])&&l(e.prototype,n),o&&l(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}()},624:(t,e,n)=>{n.d(e,{eA:()=>a,v0:()=>r});var o="https://diskuze.seznam.cz/graphql",r=function(t){new Promise((function(t,e){!function e(){setTimeout((function(){window.SZN?t():e()}),250)}()})).then((function(){document.getElementById("discussion")&&window.SZN.DiscussionLoader.load(["embedded"]).then((function(){var e;SZN.Discussion.create("kupi","discussion",{}).loadDiscussion(t.canonicalString,{title:t.name,url:t.discussionUrl},null!==(e=t.analyticsData)&&void 0!==e?e:{})})).catch((function(t){console.error(t)})),document.querySelector(".sc-posts")&&fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationName:"FetchCommentCount",query:"query FetchCommentCount($entityIds: [ID!]!) {discussionSummary(canonicalString_in: $entityIds) {commentsCount}}",variables:{entityIds:[t.canonicalString]}})}).then((function(t){return t.json()})).then((function(t){if(t){var e,n=i(null===(e=t.data)||void 0===e||null===(e=e.discussionSummary)||void 0===e?void 0:e.commentsCount[0]);n&&void 0!==n.count&&n.count>0&&document.querySelectorAll("span.sc-posts").forEach((function(t){t.innerHTML=n.count}))}})).catch((function(t){console.error(t)}))})).catch((function(t){console.error(t)}))},i=function(t){var e=t.count,n="";return 0===e?{text:"Komentáře",count:e}:(1===e&&(n=" příspěvek "),e>1&&e<5&&(n=" příspěvky "),e>=5&&(n=" příspěvků "),{text:n=e+n,count:e})},a=function(){var t,e=[];(document.querySelectorAll(".article_item[data-article-id][data-szn-canonical]:not([data-discuss-load='done'])").forEach((function(t){e.push(t.getAttribute("data-szn-canonical"))})),e.length)&&(t=e,fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationName:"FetchCommentCount",query:"query FetchCommentCount($entityIds: [ID!]!) {discussionSummary(canonicalString_in: $entityIds) {commentsCount}}",variables:{entityIds:t}})})).then((function(t){return t.json()})).then((function(t){t&&t.data.discussionSummary.commentsCount.forEach((function(t){var e=t.discussionId,n=document.querySelector(".article_item[data-szn-canonical='"+e+"']");null==n||n.setAttribute("data-discuss-load","done");var o=document.querySelectorAll("[data-discussion-id='"+e+"'] .count"),r=i(t);null!=o&&o.length&&r&&o.forEach((function(t){t.innerHTML=r.text}))}))})).catch((function(t){console.error(t)}))}},237:(t,e,n)=>{n.r(e)}},t=>{var e;e=202,t(t.s=e)}]);