PageSourceSearch

https://www.o2.cz/-a338523?field=data&_linka=a1591825

js o2.cz collected 2026-10-01 10:36:22 UTC 48,797 bytes, 125 lines download raw bytes

1var $=Object.defineProperty;var P=(o,e,t)=>e in o?$(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var r=(o,e,t)=>P(o,typeof e!="symbol"?e+"":e,t);
2class j{constructor(e){r(this,"timeout",null);r(this,"paused",!1);r(this,"stopped",!1);r(this,"state","top");r(this,"element");r(this,"lastScrollTop",0);r(this,"lastDirChangeTime",Date.now());r(this,"menuHeight");r(this,"options",{minScroll:50,upMinDuration:150,downMinDuration:150,upMinScroll:0,downMinScroll:0,upTimeoutDuration:5E3,downTimeoutDuration:!1,topClass:{"o3-header--sticky":!1,"o3-header--fixed":!1,"o3-header--hidden":!1},upClass:{"o3-header--fixed":!0,"o3-header--small":!1,"o3-header--hidden":!1},
3downClass:{"o3-header--fixed":!1,"o3-header--hidden":!0},permaClasses:["o3-header--perma"],constClasses:{"o3-header--fixed":!0},protectorClasses:{"o3-header--fixed":"o3-header--opened"}});this.element=e,this.menuHeight=this.element.offsetHeight,this.setTop(),this.attachEventListeners()}attachEventListeners(){["mouseover","mouseout","click"].forEach(e=>this.element.addEventListener(e,this.handleEvent.bind(this))),window.addEventListener("scroll",this.handleScroll.bind(this))}handleEvent(e){switch(e.type){case "mouseover":this.pause();
4break;case "mouseout":this.resume();break;case "click":window.innerWidth<1024?this.resume():this.postpone();break}}handleScroll(){const e=window.pageYOffset||document.documentElement.scrollTop,t=e>this.lastScrollTop?"down":"up",s=this.element.getBoundingClientRect().top;t!==(this.lastScrollTop>e?"up":"down")&&(this.lastDirChangeTime=Date.now()),s>0?(this.setTop(),this.element.style.boxShadow=""):(this.element.style.boxShadow="0px 2px 20px 0px rgba(0, 80, 255, 0.17)",this.checkScroll({pos:e,dir:t,
5t:Date.now(),lastDirChange:this.lastDirChangeTime})),this.lastScrollTop=e<=0?0:e}updateClass(e){Object.keys(e).forEach(t=>{if(!e.hasOwnProperty(t))return;const s=this.options.protectorClasses[t];s&&this.element.classList.contains(s)||t==="o3-header--hidden"&&this.element.classList.contains("o3-header--searching")||t==="o3-header--hidden"&&this.element.classList.contains("o3-header--opened")||(e[t]?this.element.classList.add(t):this.element.classList.remove(t))})}setTop(){this.cancelTimeout(),this.state=
6"top",this.updateClass(this.options.topClass)}setUp(){this.cancelTimeout(),this.paused||this.stopped?this.updateClass({...this.filterClasses(this.options.upClass),...this.options.constClasses}):(this.state="up",this.updateClass(this.options.upClass),this.prepTimeout(this.options.upTimeoutDuration,this.setDown.bind(this)))}setDown(){this.cancelTimeout(),this.paused||this.stopped?this.updateClass({...this.filterClasses(this.options.downClass),...this.options.constClasses}):(this.state="down",this.updateClass(this.options.downClass),
7this.prepTimeout(this.options.downTimeoutDuration,this.setUp.bind(this)))}filterClasses(e){return this.options.permaClasses.reduce((t,s)=>(typeof e[s]<"u"&&(t[s]=e[s]),t),{})}prepTimeout(e,t){typeof e=="number"&&(this.cancelTimeout(),this.timeout=window.setTimeout(t,e))}cancelTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}checkScroll(e){const {minScroll:t,upMinDuration:s,downMinDuration:i,upMinScroll:n,downMinScroll:a}=this.options,l=this.element.getBoundingClientRect().top+
8window.scrollY;e.pos<=t&&l<=t?(this.setTop(),this.element.style.boxShadow=""):e.dir==="up"&&e.t-e.lastDirChange>=s&&(this.stopped||e.pos>=n+this.menuHeight)?this.setUp():e.dir==="down"&&e.t-e.lastDirChange>=i&&(this.stopped||e.pos>=a+this.menuHeight)&&this.setDown()}pause(){!this.stopped&&!this.paused&&this.timeout&&(this.cancelTimeout(),this.paused=!0)}resume(){!this.stopped&&this.paused&&!this.timeout&&(this.paused=!1,this.prepTimeout(this.options.upTimeoutDuration,this.setDown.bind(this)))}postpone(){!this.stopped&&
9this.paused&&(this.cancelTimeout(),this.prepTimeout(this.options.upTimeoutDuration,this.setDown.bind(this)))}}
10class N{constructor(e){r(this,"element");r(this,"wrapElement");r(this,"searchElement");r(this,"focusableElements",[]);r(this,"firstFocusableElement",null);r(this,"lastFocusableElement",null);r(this,"boundHandleFocusIn");r(this,"boundHandleFocusOut");r(this,"focusCheckInterval",null);r(this,"searchInputListener",null);r(this,"searchInputCheckInterval",null);r(this,"boundHandleSearchScroll");r(this,"boundHandleSearchTouchStart");r(this,"boundHandleSearchTouchMove");r(this,"touchStartY",0);r(this,"touchStartTime",
110);r(this,"focusRetryTimeout",null);this.element=e,this.wrapElement=e.querySelectorAll(".js3-header__wrap"),this.searchElement=e.querySelectorAll(".o3-header__search"),this.boundHandleFocusIn=this.handleFocusIn.bind(this),this.boundHandleFocusOut=this.handleFocusOut.bind(this),this.boundHandleSearchScroll=this.handleSearchScroll.bind(this),this.boundHandleSearchTouchStart=this.handleSearchTouchStart.bind(this),this.boundHandleSearchTouchMove=this.handleSearchTouchMove.bind(this),this.element.querySelectorAll(".js3-header__toggle").forEach(n=>
12{n.addEventListener("click",this.toggleMenu.bind(this))}),this.element.querySelectorAll(".js3-header__toggle-search").forEach(n=>
12{n.addEventListener("click",this.toggleSearch.bind(this))}),document.addEventListener("keydown",this.handleKeydown.bind(this)),(new ResizeObserver(this.resize.bind(this))).observe(this.element)}allowScroll(e){e.stopPropagation()}preventScroll(e){e.preventDefault()}handleSearchScroll(){this.element.classList.contains("o3-header--searching")&&this.searchElement.forEach(e=>
13{const t=e.querySelector("input");t&&document.activeElement===t&&t.blur()})}handleSearchTouchStart(e){if(!this.element.classList.contains("o3-header--searching"))return;const t=e.touches[0];t&&(this.touchStartY=t.clientY,this.touchStartTime=Date.now())}handleSearchTouchMove(e){if(!this.element.classList.contains("o3-header--searching"))return;const t=e.touches[0];if(!t||this.touchStartY===0)return;const s=Math.abs(t.clientY-this.touchStartY),i=Date.now()-this.touchStartTime;if(s>10&&i>50){const n=
14e.target,a=n==null?void 0:n.closest("input");(!a||document.activeElement!==a)&&this.searchElement.forEach(l=>{const h=l.querySelector("input");h&&document.activeElement===h&&h.blur()})}}getSearchPlaceholder(){return document.querySelector(".js3-header-search__placeholder")}ensureSearchScrollLock(){if(this.element.classList.contains("o3-header--searching")){document.body.classList.contains("o3-header-no-scroll")||document.body.classList.add("o3-header-no-scroll"),this.lockScroll(),document.addEventListener("wheel",
15this.preventScroll,{passive:!1}),document.addEventListener("touchmove",this.preventScroll,{passive:!1}),this.element.addEventListener("wheel",this.allowScroll,{passive:!1}),this.element.addEventListener("touchmove",this.allowScroll,{passive:!1}),this.element.addEventListener("scroll",this.boundHandleSearchScroll,{passive:!0});const e=this.getSearchPlaceholder();e&&(e.addEventListener("scroll",this.boundHandleSearchScroll,{passive:!0}),e.addEventListener("touchstart",this.boundHandleSearchTouchStart,
16{passive:!0}),e.addEventListener("touchmove",this.boundHandleSearchTouchMove,{passive:!0}))}}toggleMenu(){const e=this.element.classList.contains("o3-header--opened"),t=document.body;e?(this.element.classList.remove("o3-header--opened"),this.wrapElement.forEach(s=>s.classList.remove("o3-header__wrap--wide")),window.innerWidth<=1020&&(document.removeEventListener("wheel",this.preventScroll),document.removeEventListener("touchmove",this.preventScroll),this.element.removeEventListener("wheel",this.allowScroll),
17this.element.removeEventListener("touchmove",this.allowScroll),t.classList.remove("o3-header-no-scroll"),this.disableFocusTrap())):(this.element.classList.add("o3-header--opened"),this.wrapElement.forEach(s=>s.classList.add("o3-header__wrap--wide")),window.innerWidth<=1020&&(document.addEventListener("wheel",this.preventScroll,{passive:!1}),document.addEventListener("touchmove",this.preventScroll,{passive:!1}),this.element.addEventListener("wheel",this.allowScroll,{passive:!1}),this.element.addEventListener("touchmove",
18this.allowScroll,{passive:!1}),t.classList.add("o3-header-no-scroll"),this.enableFocusTrap()))}resize(){const e=this.element.classList.contains("o3-header--searching"),t=this.element.classList.contains("o3-header--opened");e&&this.ensureSearchScrollLock(),window.innerWidth<=1020?t&&!document.body.classList.contains("o3-header-no-scroll")?(document.body.classList.add("o3-header-no-scroll"),document.addEventListener("wheel",this.preventScroll,{passive:!1}),document.addEventListener("touchmove",this.preventScroll,
19{passive:!1}),this.element.addEventListener("wheel",this.allowScroll,{passive:!1}),this.element.addEventListener("touchmove",this.allowScroll,{passive:!1}),this.lockScroll(),this.enableFocusTrap()):!t&&!e&&document.body.classList.contains("o3-header-no-scroll")&&(document.body.classList.remove("o3-header-no-scroll"),document.removeEventListener("wheel",this.preventScroll),document.removeEventListener("touchmove",this.preventScroll),this.element.removeEventListener("wheel",this.allowScroll),this.element.removeEventListener("touchmove",
20this.allowScroll),this.unlockScroll(),this.disableFocusTrap()):!e&&!t&&document.body.classList.contains("o3-header-no-scroll")&&(document.body.classList.remove("o3-header-no-scroll"),document.removeEventListener("wheel",this.preventScroll),document.removeEventListener("touchmove",this.preventScroll),this.element.removeEventListener("wheel",this.allowScroll),this.element.removeEventListener("touchmove",this.allowScroll),this.unlockScroll(),this.disableFocusTrap())}lockScroll(){document.body.style.overflow=
21"hidden"}unlockScroll(){document.body.style.overflow=""}handleKeydown(e){e.key==="Escape"&&this.element.classList.contains("o3-header--searching")&&this.closeSearch(),e.key==="Escape"&&this.element.classList.contains("o3-header--opened")&&window.innerWidth<=1020&&this.toggleMenu(),this.element.classList.contains("o3-header--opened")&&window.innerWidth<=1020&&this.handleFocusTrap(e)}closeSearch(){this.element.classList.remove("o3-header--searching","o3-header--fixed"),document.body.classList.remove("o3-header-no-scroll"),
22this.searchElement.forEach(t=>t.classList.remove("o3-header__search--opened")),this.unlockScroll(),this.removeSearchInputListener(),document.removeEventListener("wheel",this.preventScroll),document.removeEventListener("touchmove",this.preventScroll),this.element.removeEventListener("wheel",this.allowScroll),this.element.removeEventListener("touchmove",this.allowScroll),this.element.removeEventListener("scroll",this.boundHandleSearchScroll),this.element.removeEventListener("touchmove",this.boundHandleSearchScroll);
23const e=this.getSearchPlaceholder();e&&(e.removeEventListener("scroll",this.boundHandleSearchScroll),e.removeEventListener("touchstart",this.boundHandleSearchTouchStart),e.removeEventListener("touchmove",this.boundHandleSearchTouchMove)),this.touchStartY=0,this.touchStartTime=0}toggleSearch(){this.element.classList.contains("o3-header--opened")&&(this.element.classList.remove("o3-header--opened"),this.wrapElement.forEach(e
23=>e.classList.remove("o3-header__wrap--wide"))),this.element.classList.contains("o3-header--searching")?
24this.closeSearch():(this.element.classList.add("o3-header--searching","o3-header--fixed"),this.searchElement.forEach(e=>e.classList.add("o3-header__search--opened")),this.searchElement.forEach(e=>{const t=e.querySelector("input");t&&t.focus()}),this.element.scrollIntoView({behavior:"smooth"}),this.ensureSearchScrollLock(),this.checkSearchInputValue(),setTimeout(()=>{this.checkSearchInputValue();const e=this.getSearchPlaceholder();e&&(e.addEventListener("scroll",this.boundHandleSearchScroll,{passive:!0}),
25e.addEventListener("touchstart",this.boundHandleSearchTouchStart,{passive:!0}),e.addEventListener("touchmove",this.boundHandleSearchTouchMove,{passive:!0}))},100),this.addSearchInputListener())}enableFocusTrap(){this.updateFocusableElements(),document.addEventListener("focusin",this.boundHandleFocusIn),document.addEventListener("focusout",this.boundHandleFocusOut),document.addEventListener("DOMNodeInserted",this.handleDOMChanges.bind(this)),this.hideOtherFocusableElements(),this.makeOtherContentInert(),
26this.startFocusMonitoring(),this.focusMenuWrapper()}disableFocusTrap(){this.focusRetryTimeout!==null&&(clearTimeout(this.focusRetryTimeout),this.focusRetryTimeout=null),this.restoreMenuWrapperFocusability(),this.focusableElements=[],this.firstFocusableElement=null,this.lastFocusableElement=null,document.removeEventListener("focusin",this.boundHandleFocusIn),document.removeEventListener("focusout",this.boundHandleFocusOut),document.removeEventListener("DOMNodeInserted",this.handleDOMChanges.bind(this)),
27this.stopFocusMonitoring(),this.showOtherFocusableElements(),this.removeInertFromOtherContent()}updateFocusableElements(){const e=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex\x3d"-1"])'],t=this.getMenuWrapper();t?this.focusableElements=Array.from(t.querySelectorAll(e.join(", "))).filter(n=>this.isVisibleFocusableElement(n)):this.focusableElements=Array.from(this.element.querySelectorAll(e.join(", "))).filter(n=>
28this.isVisibleFocusableElement(n));let s=null;t?s=t.querySelector('.o3-header__slots a[href], .o3-header__slots button:not([disabled]), .o3-header__slots [tabindex]:not([tabindex\x3d"-1"])'):s=this.element.querySelector('.o3-header__slots a[href], .o3-header__slots button:not([disabled]), .o3-header__slots [tabindex]:not([tabindex\x3d"-1"])'),this.firstFocusableElement=this.isVisibleFocusableElement(s)?s:this.focusableElements[0]||null;const i=this.element.querySelector(".o3-header__close");this.lastFocusableElement=
29this.isVisibleFocusableElement(i)?i:this.focusableElements[this.focusableElements.length-1]||null,this.focusableElements.length===0&&console.warn("No focusable elements found in mobile menu")}getMenuWrapper(){return this.element.querySelector(".o3-header__wrapper")}isVisibleFocusableElement(e){if(!e)return!1;const t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"&&!e.hasAttribute("aria-hidden")&&e.getClientRects().length>0}focusMenuWrapper(e=2){const t=this.getMenuWrapper();
30t&&(this.makeMenuWrapperFocusable(t),t.focus({preventScroll:!0}),!(e<=0)&&(this.focusRetryTimeout!==null&&clearTimeout(this.focusRetryTimeout),this.focusRetryTimeout=window.setTimeout(()=>{this.focusRetryTimeout=null;const s=document.activeElement;s!==null&&(s===t||t.contains(s))||this.focusMenuWrapper(e-1)},16)))}makeMenuWrapperFocusable(e){e.hasAttribute("tabindex")||(e.setAttribute("tabindex","-1"),e.setAttribute("data-header-added-tabindex","true"))}restoreMenuWrapperFocusability(){const e=this.getMenuWrapper();
31!e||e.getAttribute("data-header-added-tabindex")!=="true"||(e.removeAttribute("tabindex"),e.removeAttribute("data-header-added-tabindex"))}handleFocusIn(e){if(!this.element.classList.contains("o3-header--opened")||window.innerWidth>1020)return;const t=this.getMenuWrapper(),s=e.target;if(!t||s.classList.contains("js3-header__toggle")||s.classList.contains("o3-header__close"))return;const i=t.contains(s),n=this.element.contains(s);!i&&!n&&(e.preventDefault(),e.stopPropagation(),setTimeout(()=>{t&&t.focus({preventScroll:!0})},
320))}handleFocusOut(e){if(!this.element.classList.contains("o3-header--opened")||window.innerWidth>1020)return;const t=this.getMenuWrapper(),s=e.target,i=e.relatedTarget;if(!t||s.classList.contains("js3-header__toggle")||s.classList.contains("o3-header__close"))return;const n=t.contains(i),a=this.element.contains(i);i&&!n&&!a&&(e.preventDefault(),e.stopPropagation(),setTimeout(()=>{t&&t.focus({preventScroll:!0})},0))}handleDOMChanges(e){if(!this.element.classList.contains("o3-header--opened")||window.innerWidth>
331020)return;const t=document.activeElement,s=this.element.querySelector(".o3-header__wrapper");if(t&&s){const i=s.contains(t),n=this.element.contains(t);!i&&!n&&setTimeout(()=>{var a;(a=this.firstFocusableElement)==null||a.focus()},0)}}hideOtherFocusableElements(){const e=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not
33([tabindex\x3d"-1"])'],t=document.querySelectorAll(e.join(", ")),s=this.element.querySelector(".o3-header__wrapper");
34t.forEach(i=>{const n=i,a=n===document.activeElement,l=n.classList.contains("js3-header__toggle");if(!s||!s.contains(n)){if(a||l)return;n.hasAttribute("aria-hidden")||(n.setAttribute("data-original-aria-hidden",n.getAttribute("aria-hidden")||""),n.setAttribute("aria-hidden","true"))}})}showOtherFocusableElements(){document.querySelectorAll("[data-original-aria-hidden]").forEach(t=>{const s=t,i=s.getAttribute("data-original-aria-hidden");i===""?s.removeAttribute("aria-hidden"):s.setAttribute("aria-hidden",
35i||""),s.removeAttribute("data-original-aria-hidden")})}makeOtherContentInert(){const e=document.body,t=document.querySelector(".o3-header-tooltip-box");Array.from(e.children).forEach(i=>{const n=i===this.element||i.contains(this.element),a=t?i===t||i.contains(t):!1;!n&&!a&&!i.hasAttribute("data-original-inert")&&(i.setAttribute("data-original-inert",i.getAttribute("inert")||""),i.setAttribute("inert",""))})}removeInertFromOtherContent(){document.querySelectorAll("[data-original-inert]").forEach(t=>
36{const s=t,i=s.getAttribute("data-original-inert");i===""?s.removeAttribute("inert"):s.setAttribute("inert",i||""),s.removeAttribute("data-original-inert")})}startFocusMonitoring(){this.stopFocusMonitoring(),this.focusCheckInterval=window.setInterval(()=>{this.checkFocusLocation()},100)}stopFocusMonitoring(){this.focusCheckInterval!==null&&(clearInterval(this.focusCheckInterval),this.focusCheckInterval=null)}checkFocusLocation(){if(!this.element.classList.contains("o3-header--opened")||window.innerWidth>
371020)return;const e=document.activeElement,t=this.getMenuWrapper();if(!e||!t||e===t||e.classList.contains("js3-header__toggle")||e.classList.contains("o3-header__close"))return;const s=t.contains(e),i=this.element.contains(e);!s&&!i&&t.focus({preventScroll:!0})}moveFocusFromWrapper(e){const t=e?this.lastFocusableElement:this.firstFocusableElement;if(t){t.focus();return}const s=this.getMenuWrapper();s&&s.focus({preventScroll:!0})}handleFocusTrap(e){var t,s;if(e.key==="Tab"){const i=this.getMenuWrapper(),
38n=document.activeElement;if(!i)return;if(n===i){e.preventDefault(),this.moveFocusFromWrapper(e.shiftKey);return}if(!this.firstFocusableElement||!this.lastFocusableElement)return;if(!(i&&i.contains(n))){e.preventDefault(),this.moveFocusFromWrapper(e.shiftKey);return}e.shiftKey?n===this.firstFocusableElement&&(e.preventDefault(),(t=this.lastFocusableElement)==null||t.focus()):n===this.lastFocusableElement&&(e.preventDefault(),(s=this.firstFocusableElement)==null||s.focus())}}checkSearchInputValue(){if(!this.element.classList.contains("o3-header--searching"))return;
39let e=!1;this.searchElement.forEach(t=>{const s=t.querySelector("input");s&&s.value.trim().length>0&&(e=!0)}),e&&this.ensureSearchScrollLock()}addSearchInputListener(){this.removeSearchInputListener(),this.searchInputListener=e=>{e.target&&this.element.classList.contains("o3-header--searching")&&this.checkSearchInputValue()},this.searchElement.forEach(e=>{const t=e.querySelector("input");t&&(this.checkSearchInputValue(),this.searchInputListener&&(t.addEventListener("input",this.searchInputListener),
40t.addEventListener("change",this.searchInputListener),t.addEventListener("paste",this.searchInputListener),t.addEventListener("cut",this.searchInputListener)))}),this.startSearchInputCheckInterval()}startSearchInputCheckInterval(){this.stopSearchInputCheckInterval(),this.searchInputCheckInterval=window.setInterval(()=>{if(this.checkSearchInputValue(),this.element.classList.contains("o3-header--searching")){const e=this.getSearchPlaceholder();e&&(e.addEventListener("scroll",this.boundHandleSearchScroll,
41{passive:!0}),e.addEventListener("touchstart",this.boundHandleSearchTouchStart,{passive:!0}),e.addEventListener("touchmove",this.boundHandleSearchTouchMove,{passive:!0}))}},100)}stopSearchInputCheckInterval(){this.searchInputCheckInterval!==null&&(clearInterval(this.searchInputCheckInterval),this.searchInputCheckInterval=null)}removeSearchInputListener(){this.stopSearchInputCheckInterval(),this.searchInputListener&&(this.searchElement.forEach(e
41=>{const t=e.querySelector("input");t&&(t.removeEventListener("input",
42this.searchInputListener),t.removeEventListener("change",this.searchInputListener),t.removeEventListener("paste",this.searchInputListener),t.removeEventListener("cut",this.searchInputListener))}),this.searchInputListener=null)}}
43class z{constructor(e){r(this,"element");r(this,"resizeObserver");r(this,"intersectionObserver");r(this,"isVisible",!1);r(this,"lastHeight",0);r(this,"lastOffset",0);r(this,"wasSticky",!1);r(this,"maxWidth",1023);this.element=e,this.initObservers(),this.updateOffsets(),this.addEventListeners()}initObservers(){this.resizeObserver=new ResizeObserver(()=>{this.updateHeight(),this.updateOffsets()}),this.resizeObserver.observe(this.element),this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(t=>
44{t.target===this.element&&(this.isVisible=t.isIntersecting,this.updateHeight())})}),this.intersectionObserver.observe(this.element)}addEventListeners(){const e=this.updateOffsets.bind(this);window.addEventListener("scroll",e,{passive:!0}),window.addEventListener("resize",e,{passive:!0}),window.addEventListener("orientationchange",e,{passive:!0})}updateOffsets(){if(window.innerWidth>this.maxWidth){this.setOffset(0);return}const e=window.scrollY||window.pageYOffset,t=this.element.offsetTop;e>=t?this.wasSticky||
45(this.setOffset(0),this.wasSticky=!0):(this.wasSticky&&(this.calculateOffset(),this.wasSticky=!1),e>0&&this.noElementsAbove()&&this.setOffset(0)),this.wasSticky||this.calculateOffset()}calculateOffset(){if(window.innerWidth>this.maxWidth)return;let e=0;if(document.querySelectorAll("body \x3e *:not(header)").forEach(s=>{const i=s.offsetTop+s.offsetHeight,n=this.element.offsetTop;i<=n&&(e+=s.offsetHeight)}),e===0)this.setOffset(0);else{const s=window.innerHeight,i=e/s*100;this.setOffset(Math.round(i*
46100)/100)}}noElementsAbove(){const e=document.querySelectorAll("body \x3e *:not(header)"),t=this.element.offsetTop;return Array.from(e).every(s=>s.offsetTop+s.offsetHeight>t)}setOffset(e){this.element.style.setProperty("--o3-header-offset",`${e}svh`),this.lastOffset=e}updateHeight(){const e=this.isVisible?this.element.offsetHeight:0;if(e!==this.lastHeight){let t=e;this.element.classList.contains("o3-header--fixed")&&this.element.querySelector(".o3-subnav__item")&&window.innerWidth>this.maxWidth&&
47(t-=50),document.body.style.setProperty("--o3-header-height",`${t}px`),this.lastHeight=e}}}
48class U{constructor(e){r(this,"tooltip");r(this,"prefersReducedMotion");r(this,"focusCheckInterval",null);r(this,"boundHandleTabNavigation");this.tooltip=e.querySelectorAll(".js3-header__tooltip"),this.prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.boundHandleTabNavigation=this.handleTabNavigation.bind(this),this.tooltip.forEach(t=>{t.setAttribute("role","button"),t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.hasAttribute("tabindex")||
49t.setAttribute("tabindex","0"),t.addEventListener("click",s=>{s.detail!==0&&this.toggleTooltip(t)}),t.addEventListener("keydown",s=>{const i=s;(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),this.toggleTooltip(t))}),this.attachEventListeners(t)})}attachEventListeners(e){["resize","scroll","click","scroll","orientationchange"].forEach(t=>window.addEventListener(t,s=>this.handleEvent(s,e)))}handleEvent(e,t){const s=document.querySelector(".o3-header-tooltip-box"),i=s==null?void 0:s.querySelector(".o3-header-tooltip__arrow");
50if(!(!s||!i))switch(e.type){case "resize":case "orientationchange":this.updateTooltipPosition(t,s,i);break;case "click":!t.contains(e.target)&&!(s!=null&&s.contains(e.target))&&(this.disableFocusTrap(),this.fadeOutTooltip(s,()=>{this.removeTooltipContainer(),t.setAttribute("aria-expanded","false")}));break;case "scroll":this.disableFocusTrap(),this.fadeOutTooltip(s,()=>{this.removeTooltipContainer(),t.setAttribute("aria-expanded","false")});break}}toggleTooltip(e){let t=document.querySelector(".o3-header-tooltip-box"),
51s;if(t)s=t.querySelector(".o3-header-tooltip__arrow");else{const i=e.querySelector(".o3-header-tooltip__content");
51if(!i)return;t=this.createTooltipContainer(i),s=this.createArrowElement(),t.appendChild(s),document.body.appendChild(t)}if(t.style.visibility==="visible")this.disableFocusTrap(),this.fadeOutTooltip(t,()=>{this.removeTooltipContainer(),e.removeAttribute("aria-describedby"),e.setAttribute("aria-expanded","false")});else{this.updateTooltipPosition(e,t,s),t.style.zIndex="550001",this.fadeInTooltip(t),
52t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true");const i=t.querySelector(".o3-header-tooltip__content");i&&(i.id||(i.id=`tooltip-content-${Math.random().toString(36).substr(2,9)}`),t.setAttribute("aria-describedby",i.id));let n=t.querySelector(".o3-header-tooltip__close");n||(n=document.createElement("button"),n.type="button",n.className="o3-header-tooltip__close d3-btn d3-btn--link",n.textContent="X",n.style.position="absolute",n.style.top="1rem",n.style.right="1rem",n.style.visibility=
53"hidden",n.setAttribute("aria-label","Zav\u0159\u00edt dialog"),n.addEventListener("click",()=>{this.disableFocusTrap(),this.fadeOutTooltip(t,()=>{this.removeTooltipContainer(),e.setAttribute("aria-expanded","false"),e.focus()})}),i&&i.appendChild(n)),this.enableFocusTrap(t),this.trackFocusInTooltip(t,n),e.setAttribute("aria-expanded","true");const a=l=>{l.key==="Escape"&&(l.preventDefault(),this.disableFocusTrap(),this.fadeOutTooltip(t,()=>{this.removeTooltipContainer(),e.setAttribute("aria-expanded",
54"false"),e.focus()}),t.removeEventListener("keydown",a))};t.addEventListener("keydown",a)}}fadeInTooltip(e){e.style.visibility="visible",this.prefersReducedMotion?e.style.opacity="1":(e.style.opacity="0",e.style.transition="opacity 0.15s ease-in",requestAnimationFrame(()=>{e.style.opacity="1"}))}fadeOutTooltip(e,t){this.prefersReducedMotion?(e.style.opacity="0",t()):(e.style.transition="opacity 0.15s ease-out",e.style.opacity="0",e.addEventListener("transitionend",function s(){e.removeEventListener("transitionend",
55s),t()}))}enableFocusTrap(e){e.addEventListener("keydown",this.boundHandleTabNavigation),this.hideOtherFocusableElements(e),this.makeOtherContentInert()}disableFocusTrap(){const e=document.querySelector(".o3-header-tooltip-box");e&&e.removeEventListener("keydown",this.boundHandleTabNavigation),this.stopFocusMonitoring(),this.showOtherFocusableElements(),this.removeInertFromOtherContent()}trackFocusInTooltip(e,t){if(!t)return;const s=()=>{setTimeout(()=>{const n=document.activeElement;e.contains(n)?
56t.style.visibility="visible":t.style.visibility="hidden"},0)};document.addEventListener("focusin",s);const i=this.disableFocusTrap.bind(this);this.disableFocusTrap=()=>{document.removeEventListener("focusin",s),i()}}stopFocusMonitoring(){this.focusCheckInterval!==null&&(clearInterval(this.focusCheckInterval),this.focusCheckInterval=null)}handleTabNavigation(e){if(e.key!=="Tab")return;const t=document.querySelector(".o3-header-tooltip-box");if(!t)return;const s=t.querySelectorAll('a, button, [tabindex]:not([tabindex\x3d"-1"])');
57if(s.length===0)return;const i=s[0],n=s[s.length-1],a=document.activeElement;e.shiftKey?a===i&&(e.preventDefault(),n.focus()):a===n&&(e.preventDefault(),i.focus())}hideOtherFocusableElements(e){const t=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex\x3d"-1"])'];
57document.querySelectorAll(t.join(", ")).forEach(i=>{const n=i;e.contains(n)||n.hasAttribute("aria-hidden")||(n.setAttribute("data-original-aria-hidden",
58n.getAttribute("aria-hidden")||""),n.setAttribute("aria-hidden","true"))})}showOtherFocusableElements(){document.querySelectorAll("[data-original-aria-hidden]").forEach(t=>{const s=t,i=s.getAttribute("data-original-aria-hidden");i===""?s.removeAttribute("aria-hidden"):s.setAttribute("aria-hidden",i||""),s.removeAttribute("data-original-aria-hidden")})}makeOtherContentInert(){const e=document.body;Array.from(e.children).forEach(s=>{!s.classList.contains("o3-header-tooltip-box")&&!s.hasAttribute("data-original-inert")&&
59(s.setAttribute("data-original-inert",s.getAttribute("inert")||""),s.setAttribute("inert",""))})}removeInertFromOtherContent(){document.querySelectorAll("[data-original-inert]").forEach(t=>{const s=t,i=s.getAttribute("data-original-inert");i===""?s.removeAttribute("inert"):s.setAttribute("inert",i||""),s.removeAttribute("data-original-inert")})}createTooltipContainer(e){const t=document.createElement("div");return t.id=`tooltip-${Math.random().toString(36).substr(2,9)}`,t.className="o3-header-tooltip-box",
60t.style.position="absolute",t.style.visibility="hidden",t.style.opacity="0",t.setAttribute("role","tooltip"),t.appendChild(e.cloneNode(!0)),t}removeTooltipContainer(){const e=document.querySelector(".o3-header-tooltip-box");e&&e.remove()}createArrowElement(){const e=document.createElement("div");return e.className="o3-header-tooltip__arrow",e.style.position="absolute",e.style.transform="translateX(-50%)",e}updateTooltipPosition(e,t,s){const i=e.getBoundingClientRect(),n=window.innerWidth,a=t.offsetWidth,
61l=i.left+i.width/2;let h=i.bottom+window.scrollY+10,c=l-a/2+window.scrollX;const u=n<=600?24:n<=1600?32:10;c+a>n-u&&(c=n-a-u),c<u&&(c=u),t.style.top=`${h}px`,t.style.left=`${c}px`;const d=l-c;s.style.left=`${d}px`}}const x=(o,e=200)=>{let t;return(...s)=>{clearTimeout(t),t=setTimeout(()=>o(...s),e)}};function V(o){var e;return((e=document.cookie.split("; ").map(t=>t.split("\x3d")).find(([t])=>t===o))==null?void 0:e[1])||null}
62class Y{constructor({endpoint:e,trackerId:t,clientId:s}){r(this,"endpoint");r(this,"trackerId");r(this,"clientId");r(this,"_ac");this.endpoint=e||"",this.trackerId=t,this.clientId=s||localStorage.getItem("_lb")||"",this._ac=null}cancelOngoing(){var e;(e=this._ac)==null||e.abort(),this._ac=null}async fetch(e){if(!this.endpoint)throw new Error("NO_ENDPOINT");const t=new URL(this.endpoint,window.location.origin);t.searchParams.set("tracker_id",this.trackerId),t.searchParams.set("type","item:5,store:4,page:5"),
63t.searchParams.set("client_id",this.clientId),t.searchParams.set("q",e),this.cancelOngoing(),this._ac=new AbortController;const s=await fetch(t.toString(),{credentials:"omit",signal:this._ac.signal});if(!s.ok)throw new Error(`HTTP ${s.status}`);return s.json()}}
64async function B(o,e){if(!o)return null;let t=o;const s=new URL(t,window.location.origin);!s.searchParams.has("query")&&!s.searchParams.has("q")&&s.searchParams.set("query",e),t=s.toString();const i=await fetch(t,{credentials:"include"});if(!i.ok)throw new Error(`no-results HTTP ${i.status}`);const n=await i.text(),l=(new DOMParser).parseFromString(n,"text/html");return{html:l!=null&&l.body?l.body.innerHTML:n,finalUrl:t}}
65class Q{constructor(e){r(this,"el");r(this,"announcementEl",null);this.el=e,this.createAnnouncementElement()}createAnnouncementElement(){this.announcementEl||(this.announcementEl=document.createElement("div"),this.announcementEl.setAttribute("aria-live","polite"),this.announcementEl.setAttribute("aria-atomic","true"),this.announcementEl.className="d3-sr-only",document.body.appendChild(this.announcementEl))}announce(e){this.announcementEl&&(this.announcementEl.textContent="",setTimeout(()=>{this.announcementEl&&
66(this.announcementEl.textContent=e)},100))}show(){this.el&&(this.el.style.display="block",this.el.hidden=!1,this.resetScroll(),this.announce("V\u00fdsledky vyhled\u00e1v\u00e1n\u00ed jsou k dispozici. Pou\u017eijte Tab pro navigaci mezi v\u00fdsledky."))}hide(){this.el&&(this.el.style.display="none",this.el.hidden=!0,this.resetScroll(),this.announce("V\u00fdsledky vyhled\u00e1v\u00e1n\u00ed jsou skryt\u00e9."))}resetScroll(){this.el&&(this.el.scrollTop=0)}}
67class K{constructor(e){r(this,"placeholder");r(this,"msg");this.placeholder=e,this.msg=e==null?void 0:e.querySelector(".js3-header-search__message"),!this.msg&&this.placeholder&&(this.msg=document.createElement("div"),this.msg.className="js3-header-search__message o3-header-search__message",this.msg.setAttribute("role","alert"),this.msg.setAttribute("aria-live","polite"),this.placeholder.prepend(this.msg))}show(e,t=!1){this.msg&&(this.msg.textContent=e,this.msg.classList.toggle("o3-header-search__error",
68!!t),this.msg.style.display=e?"block":"none")}showHTML(e,t=!0){this.msg&&(this.msg.innerHTML=e||"",this.msg.classList.toggle("o3-header-search__error",!!t),this.msg.style.display=e?"block":"none")}hide(){this.msg&&(this.msg.textContent="",this.msg.innerHTML="",this.msg.style.display="none",this.msg.classList.remove("o3-header-search__error"))}}const _=o=>{const e=Array.isArray(o)?o[0]:o;return typeof e=="string"?e.trim():""},E=(o={})=>_(o.title)||_(o.h1)||_(o.meta_title)||"Bez n\u00e1zvu";
69let f=null,w=null;const H=(o,e)=>{f={day:o,time:e},console.log(`Test time set to: ${o} ${e}`)},D=o=>{w=o,console.log(`Test reconstruction set to: ${o}`)},Z=()=>{f=null,console.log("Reset to real time")},G=()=>{w=null,console.log("Reset reconstruction to real data")};
70if(typeof window<"u"){window.setTestTime=H,window.setTestReconstruction=D,window.resetTestTime=Z,window.resetTestReconstruction=G;try{const o=new URLSearchParams(window.location.search),e=o.get("storeTime"),t=o.get("storeDay");if(e||t){const s=new Date;
70H(t||["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][s.getDay()],e||`${s.getHours()}:${String(s.getMinutes()).padStart(2,"0")}`)}o.has("storeReconstruction")&&D(o.get("storeReconstruction")!=="0")}catch{}}
71const k=o=>{if(!o||o==="Closed")return 0;const [e,t]=o.split(":").map(Number);return(e*60+t)*60*1E3},W={"Pond\u011bl\u00ed":"Monday","\u00dater\u00fd":"Tuesday","St\u0159eda":"Wednesday","\u010ctvrtek":"Thursday","P\u00e1tek":"Friday",Sobota:"Saturday","Ned\u011ble":"Sunday"},X={Mo:"Monday",Tu:"Tuesday",We:"Wednesday",Th:"Thursday",Fr:"Friday",Sa:"Saturday",Su:"Sunday"},C=(o,e)=>!o||!e?{from:"Closed",to:"Closed"}:{from:o,to:e,fromMillis:k(o),toMillis:k(e)},J=o=>{const e={};let t;const s=/\b(Mo|Tu|We|Th|Fr|Sa|Su)\s+(?:(\d{1,2}:\d{2})\s*-\s*(\d{1,2}:\d{2})|off)/g;
72for(;(t=s.exec(o))!==null;)e[X[t[1]]]=C(t[2],t[3]);if(Object.keys(e).length>0)return e;const i=/(Pond\u011bl\u00ed|\u00dater\u00fd|St\u0159eda|\u010ctvrtek|P\u00e1tek|Sobota|Ned\u011ble)(?:(\d{1,2}:\d{2}) - (\d{1,2}:\d{2})|Zav\u0159eno)/g;for(;(t=i.exec(o))!==null;)e[W[t[1]]]=C(t[2],t[3]);return e},ee=o=>`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")}`,te=o=>{if(!Array.isArray(o)||o.length===0)return;if(f)return o.find(t=>W[(t==null?void 0:t.name)||
73""]===f.day);const e=ee(new Date);return o.find(t=>(t==null?void 0:t.date)===e)},se=()=>f?f.day:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][(new Date).getDay()],ie=()=>{if(f)return k(f.time);const o=new Date;return(o.getHours()*60+o.getMinutes())*60*1E3},ne=o=>{var i,n;const e=te(o==null?void 0:o.openingHoursRaw),t=((i=o==null?void 0:o.openToday)==null?void 0:i[0])||(e==null?void 0:e.status)||"",s=((n=o==null?void 0:o.openingHours)==null?void 0:n[0])||"";if(w!==null){if(w)return{text:"V rekonstrukci",
74statusClass:"o3-header-search__address-status--error"}}else if(t.toLowerCase().includes("rekonstr"))return{text:"V rekonstrukci",statusClass:"o3-header-search__address-status--error"};if(e||s)try{const a=e?{}:J(s),l=se(),h=ie(),c=e?C(e.from,e.to):a[l];if(f&&console.log("Debug opening hours:",{currentDay:l,currentTime:h,todayHours:c,hoursMap:a}),c){if(c.from==="Closed")return{text:"Zav\u0159eno",statusClass:"o3-header-search__address-status--error"};const p=h>=c.fromMillis&&h<=c.toMillis,b=h<c.fromMillis,
75v=h>c.toMillis,u=30*60*1E3,d=p&&c.toMillis-h<=u,L=b&&c.fromMillis-h<=u;if(p)return d?{text:`Brzy zav\u00edr\u00e1 (${Math.ceil((c.toMillis-h)/6E4)} min)`,statusClass:"o3-header-search__address-status--waiting"}:{text:`Otev\u0159eno do ${c.to}`,statusClass:"o3-header-search__address-status--available"};if(b)return L?{text:`Brzy otev\u00edr\u00e1 (${Math.ceil((c.fromMillis-h)/6E4)} min)`,statusClass:"o3-header-search__address-status--waiting"}:{text:`Otev\u0159eno od ${c.from}`,statusClass:"o3-header-search__address-status--available"};
76if(v)return{text:"Zav\u0159eno",statusClass:"o3-header-search__address-status--error"}}else if(Object.keys(a).length>0)return{text:"Zav\u0159eno",statusClass:"o3-header-search__address-status--error"}}catch(a){console.error("Error parsing opening hours:",a)}return{text:"Informace o otev\u00edrac\u00ed dob\u011b nen\u00ed dostupn\u00e1",statusClass:"o3-header-search__address-status--waiting"}},oe=o=>{var l,h,c,p,b,v,u;const e=((h=(l=o.attributes)==null?void 0:l.web_url)==null?void 0:h[0])||"#",t=E(o.attributes??
77{}),s=((p=(c=o.attributes)==null?void 0:c.cityName)==null?void 0:p[0])||((u=(v=(b=o.attributes)==null?void 0:b.address)==null?void 0:v[0])==null?void 0:u.city)||"",i=s?t.endsWith(s)?`${t.slice(0,-s.length)}<strong>${s}</strong>`:`${t}, <strong>${s}</strong>`:t,{text:n,statusClass:a}=ne(o.attributes);return`
78    <a href="${e}" class="o3-header-search__item o3-header-search__item--other" role="listitem">
79      <div class="o3-header-search__other-content">
80        <span class="o3-header-search__address">
81          ${i}
82        </span>
83        <span class="o3-header-search__address-status ${a}">
84          ${n}
85        </span>
86      </div>
87    </a>`},re=o=>{const e=o.url||"#",t=E(o.attributes??{});return`
88    <a href="${e}" class="o3-header-search__item o3-header-search__item--other" role="listitem">
89      <div class="o3-header-search__other-content">
90        <span class="o3-header-search__page-title">${t}</span>
91      </div>
92    </a>`},ae=o=>o.replace(/<[^>]*>/g,""),le=o=>{var a,l,h,c,p;const e=((l=(a=o.attributes)==null?void 0:a.web_url)==null?void 0:l[0])||"#",t=E(o.attributes??{}),s=((h=o.attributes)==null?void 0:h.image_link)||"",i=((c=o.attributes)==null?void 0:c.price)??(typeof((p=o.attributes)==null?void 0:p.price_amount)=="number"?o.attributes.price_amount:""),n=ae(t);return`
93    <a href="${e}" class="o3-header-search__item o3-header-search__item--product" role="listitem">
94      <div class="o3-header-search__image">
95        ${s?`<img src="${s}" alt="${n}" width="92" height="119" loading="lazy" decoding="async">`:""}
96      </div>
97      <div class="o3-header-search__description">
98        <div class="o3-header-search__name">${t}</div>
99        <div class="o3-header-search__price">
100          <div class="o3-header-search__price-new">${i??""}</div>
101        </div>
102      </div>
103    </a>`};
104function ce(o){const e=o.item.length+o.store.length+o.page.length;if(e===0)return;const t=[];o.store.length>0&&t.push(`${o.store.length} prodej${o.store.length>1?"ny":"na"}`),o.page.length>0&&t.push(`${o.page.length} str\u00e1n${o.page.length>1?"ky":"ka"}`),o.item.length>0&&t.push(`${o.item.length} produkt${o.item.length>1?"\u016f":""}`);const s=`Nalezeno ${e} v\u00fdsledk\u016f: ${t.join(", ")}.`;let i=document.querySelector('.d3-sr-only[aria-live\x3d"polite"]');i||(i=document.createElement("div"),i.setAttribute("aria-live",
105"polite"),i.setAttribute("aria-atomic","true"),i.className="d3-sr-only",document.body.appendChild(i)),i.textContent="",setTimeout(()=>{i&&(i.textContent=s)},100)}function A(o,e,t){t&&o.forEach((s,i)=>{const n=e[i],a=i+1;s.addEventListener("click",()=>{t(n,a)}),s.addEventListener("auxclick",l=>{l.button===1&&t(n,a)}),s.addEventListener("contextmenu",()=>{t(n,a)})})}
106function y({secStores:o,storesList:e,secPages:t,pagesList:s,secProducts:i,prodGrid:n}){!o||!t||!i||(o.hidden=!0,e==null||e.replaceChildren(),t.hidden=!0,s==null||s.replaceChildren(),i.hidden=!0,n==null||n.replaceChildren())}
107function he(o,e,t,s){var a,l,h;y(e);const i={item:5,store:4,page:5},n={item:[],store:[],page:[]};for(const c of o)n[c.type]&&n[c.type].length<i[c.type]&&n[c.type].push(c);if(ce(n),n.store.length){e.secStores.hidden=!1,e.storesList.innerHTML=n.store.map(oe).join("");const c=e.storesList.querySelectorAll("a");A(c,n.store,s)}if(n.page.length){e.secPages.hidden=!1,e.pagesList.innerHTML=n.page.map(re).join("");const c=e.pagesList.querySelectorAll("a");A(c,n.page,s)}if(n.item.length){e.secProducts.hidden=
108!1,e.prodGrid.innerHTML=n.item.map(le).join("");const c=e.prodGrid.querySelectorAll("a");A(c,n.item,s)}(a=e.root.querySelector(".js3-header-search__stores-link"))==null||a.setAttribute("href",t),(l=e.root.querySelector(".js3-header-search__pages-link"))==null||l.setAttribute("href",t),(h=e.root.querySelector(".js3-header-search__products-link"))==null||h.setAttribute("href",t)}
109class de{constructor(e,{trackerId:t,clientId:s},i={}){r(this,"root");r(this,"input");r(this,"placeholderEl");r(this,"form");r(this,"secStores");r(this,"storesList");r(this,"secPages");r(this,"pagesList");r(this,"secProducts");r(this,"prodGrid");r(this,"selectors");r(this,"noResultsUrl");r(this,"onEnterUrl");r(this,"api");r(this,"placeholder");r(this,"messages");r(this,"fetchAutocomplete");r(this,"showNoResultsFromUrlDebounced");r(this,"notfoundCache",null);const a=Object.assign({},{input:".js3-header-search__input",
110placeholder:".js3-header-search__placeholder",form:"form",secStores:".js3-header-search__stores",storesList:".js3-header-search__stores-list",secPages:".js3-header-search__pages",pagesList:".js3-header-search__pages-list",secProducts:".js3-header-search__products",prodGrid:".js3-header-search__products-grid"},i);this.root=e,this.input=this.root.querySelector(a.input),this.placeholderEl=this.root.querySelector(a.placeholder),this.form=this.root.querySelector(a.form),this.secStores=this.root.querySelector(a.secStores),
111this.storesList=this.root.querySelector(a.storesList),this.secPages=this.root.querySelector(a.secPages),this.pagesList=this.root.querySelector(a.pagesList),this.secProducts=this.root.querySelector(a.secProducts),this.prodGrid=this.root.querySelector(a.prodGrid),this.selectors=a,this.noResultsUrl=e.getAttribute("data-o3-header-autocomplete-no-results")||e.getAttribute("data-ext-search-autocomplete-no-results")||"",this.onEnterUrl=e.getAttribute("data-o3-header-autocomplete-on-enter")||e.getAttribute("data-ext-search-autocomplete-on-enter")||
112"";const l=e.getAttribute("data-o3-header-autocomplete-endpoint")||"";this.api=new Y({endpoint:l,trackerId:t,clientId:s}),this.placeholder=new Q(this.placeholderEl),this.messages=new K(this.placeholderEl),this.fetchAutocomplete=x(this.fetchAutocompleteData.bind(this),220),this.showNoResultsFromUrlDebounced=x(this.showNoResultsFromUrl.bind(this),500),this.bindEvents(),this.placeholder.hide()}encodeQueryForUrl(e){let t=e;try{/%[0-9A-Fa-f]{2}/.test(e)&&(t=decodeURIComponent(e))}catch{t=e}return encodeURIComponent(t)}prepareQueryForApi(e){const t=
113e.trim();return t.includes("#"),t}bindEvents(){var t;if(!this.input)return;this.input.addEventListener("input",()=>{const s=this.prepareQueryForApi(this.input.value);if(s.length<2){this.placeholder.hide(),this.messages.hide(),y(this.dom()),this.api.cancelOngoing();return}this.fetchAutocomplete(s)});const e=()=>{const s=(this.input.value||"").trim();if(!s)return;const i=this.onEnterUrl||"/vyhledavani",n=this.encodeQueryForUrl(s),a=`${i}${i.includes("?")?"\x26":"?"}query=${n}`;window.location.assign(a)};
114(t=this.form)==null||t.addEventListener("submit",s=>{s.preventDefault(),e()}),this.input.addEventListener("keydown",s=>{s.key==="Enter"&&(s.preventDefault(),e())}
114),document.addEventListener("click",s=>{const i=s.target,n=i.closest(".js3-header-search__close");if(n&&this.root.contains(n)){s.preventDefault(),this.input&&(this.input.value="",this.placeholder.hide(),this.messages.hide(),y(this.dom()),this.api.cancelOngoing());return}i.closest(".js3-header__toggle-search")&&(y(this.dom()),this.placeholder.hide(),
115this.messages.hide(),this.api.cancelOngoing())})}async fetchAutocompleteData(e){try{const t=await this.api.fetch(e),{hits:s=[]}=t||{};if(!s.length){y(this.dom()),this.placeholder.show(),this.showNoResultsFromUrlDebounced(e),this.pushNoResultsAnalytics(e);return}this.messages.hide(),this.placeholder.show();const i=this.encodeQueryForUrl(this.input.value.trim()),n=this.onEnterUrl||"/vyhledavani",a=`${n}${n.includes("?")?"\x26":"?"}query=${i}`;he(s,this.dom(),a,l=>{this.pushResultClickAnalytics(l)}),
116this.pushSearchResultsAnalytics(s,e)}catch(t){if((t==null?void 0:t.name)==="AbortError")return;y(this.dom()),this.placeholder.show();const s=(t==null?void 0:t.message)==="NO_ENDPOINT"?"Vyhled\u00e1v\u00e1n\u00ed nen\u00ed dostupn\u00e9.":"Do\u0161lo k chyb\u011b p\u0159i vyhled\u00e1v\u00e1n\u00ed.";this.messages.show(s,!0)}}async showNoResultsFromUrl(e){try{if(this.notfoundCache){this.messages.showHTML(this.notfoundCache.html,!0),this.updateHeaderLinks(this.notfoundCache.finalUrl);return}const t=
117await B(this.noResultsUrl,e);if(!t){this.messages.show("Nena\u0161li jsme \u017e\u00e1dn\u00e9 v\u00fdsledky.",!0);return}this.cacheNoResults(t.html,t.finalUrl),this.messages.showHTML(t.html,!0),this.updateHeaderLinks(t.finalUrl)}catch{this.messages.show("Nena\u0161li jsme \u017e\u00e1dn\u00e9 v\u00fdsledky.",!0)}}cacheNoResults(e,t){this.notfoundCache={html:e,finalUrl:t}}updateHeaderLinks(e){this.root.querySelectorAll(".o3-header-search__header-link").forEach(s=>s.setAttribute("href",e))}dom(){return{root:this.root,
118secStores:this.secStores,storesList:this.storesList,secPages:this.secPages,pagesList:this.pagesList,secProducts:this.secProducts,prodGrid:this.prodGrid}}pushSearchResultsAnalytics(e,t){if(!window.dataLayer)return;const s=e.map((n,a)=>{const l=(n==null?void 0:n.attributes)??{};return{item_id:this.getItemId(n),item_name:E(l),index:a+1,type:this.getItemType(n),price:l.price?parseFloat(l.price):void 0}}),i={event:"view_item_list",ecommerce:{item_list_name:"Autocomplete Results",search_term:t,items:s}};
119window.dataLayer.push(i)}pushNoResultsAnalytics(e){if(!window.dataLayer)return;const t={event:"view_item_list",ecommerce:{item_list_name:"Autocomplete Results",search_term:e,items:[]}};window.dataLayer.push(t)}pushResultClickAnalytics(e){if(!window.dataLayer)return;const t={event:"select_item",ecommerce:{items:[{item_id:this.getItemId(e)}]}};window.dataLayer.push(t)}getItemId(e){var s;const t=(e==null?void 0:e.attributes)??{};return(e==null?void 0:e.type)==="item"&&t.id?String(t.id):(e==null?void 0:
120e.type)==="page"&&t.web_url&&t.web_url[0]?t.web_url[0]:(e==null?void 0:e.type)==="store"&&t.id?String(t.id):((s=t.web_url)==null?void 0:s[0])||(e==null?void 0:e.url)||t.id||"unknown"}getItemType(e){return(e==null?void 0:e.type)||"unknown"}}
121class ue{constructor(){r(this,"elements");this.elements=document.querySelectorAll(".js3-header"),document.readyState==="complete"||document.readyState==="interactive"?this.initializeComponents():document.addEventListener("DOMContentLoaded",this.initializeComponents.bind(this))}initializeComponents(){this.elements.forEach(e=>{e.classList.contains("o3-header--eshop")||(new j(e),new z(e)),new N(e),new U(e);const t=document.querySelector(".js3-header-search");t&&new de(t,{trackerId:t.dataset.o3HeaderAutocompleteTrackerId||
122"36068-43775",clientId:V("_lb")})})}}new ue;
123function pe(o={}){const {triggerClass:e="js3-toggle",toggleClass:t="o3-footer__detail-content--open",target:s,relatedTargets:i,ariaExpanded:n=null,ariaControls:a=null,multiple:l=!1,callback:h,initialState:c=!1}=o,p=document.querySelectorAll(`.${e}`);if(!p.length)return;const b=d=>Array.isArray(d)?d:d.split(" "),v=d=>typeof t=="string"||Array.isArray(t)?b(t):typeof t=="object"?t[d]||[]:[];let u=c;p.forEach((d,L)=>{var O;const T=v(L),I=d.getAttribute("data-o3-toggle-target")||s,F=d.getAttribute("data-o3-toggle-aria-expanded")||
124n,M=d.getAttribute("data-o3-toggle-aria-controls")||a,q=d.getAttribute("data-o3-toggle-multiple")!==null||l,m=[];if(I){const g=document.querySelectorAll(I);m.push(...Array.from(g))}else if(q)if(typeof l=="boolean"||l==="siblings"){const g=Array.from(((O=d.parentElement)==null?void 0:O.children)||[]).filter(S=>S!==d);m.push(...g)}else l==="children"&&m.push(...Array.from(d.children));else d.nextElementSibling&&m.push(d.nextElementSibling);if(i){const g=Array.isArray(i)?i.flatMap(S=>Array.from(document.querySelectorAll(S))):
125Array.from(document.querySelectorAll(i));m.push(...g)}d.addEventListener("click",function(g){g.preventDefault(),m.length&&(u=!u,m.forEach(S=>{T.forEach(R=>S.classList.toggle(R))}),F&&d.setAttribute(F,u.toString()),M&&s&&d.setAttribute(M,m[0].id),h&&h(u,d,m))})})}pe();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.