PageSourceSearch

https://www.poradnikzdrowie.pl/media/desktop/zpr_layouts_web/js/common.min.js?__370b4399

js poradnikzdrowie.pl collected 2026-10-01 11:37:01 UTC 17,181 bytes, 64 lines download raw bytes

1var mobileMenus,isSticky,webVitals
2function throttle(t,n){let i
3return function(){var e=arguments
4i||(t.apply(this,e),i=!0,setTimeout(()=>i=!1,n))}}function debounce(e,t){let n
5return function(){clearTimeout(n),n=setTimeout(()=>e.apply(this,arguments),t)}}function toggleClass(e,t){document.querySelectorAll(e).forEach(function(e){e.classList.toggle(t)})}function hasClass(e,t){return!!e&&e.classList.contains(t)}function prepareitemHrefWithoutSchema(e){var t=e
6return"/"===t[t.length-1]&&(t=t.substr(0,t.length-1)),t=0<=e.indexOf("//")?t.split("//")[1]:t}function sortLinks(e,t){return t<e?1:e<t?-1:0}function filterLinks(e){return!!prepareitemHrefWithoutSchema(e.getAttribute("href")).startsWith(window.location.host)}function prepareItemLinks(e,t="href"){var n,o=[]
7for(i=0;i<e.length;i++)null!==(href_text=e[i].getAttribute(t))&&(n=prepareitemHrefWithoutSchema(e[i].getAttribute(t)),o.push(n))
8return o}function setActiveForParentNode(e){for(var t,n;(e=(t=e).parentNode).getAttribute&&"submenu"!==e.getAttribute("class"););return e.classList?(e.classList.add("active"),n=t.previousElementSibling.getAttribute("data-src"),[t,e,n]):[]}function setActiveForNodeList(e,t,n=!1,i=!0,o="href"){for(var r,e=document.querySelectorAll(e),a=Array.prototype.slice.call(e),s=prepareItemLinks(a=i?a.sort(sortLinks).filter(filterLinks):a,o),c=t.length;0<c;c--)r=t.slice(0,c+1).join("/"),0<=(r=s.indexOf(r))&&(n?(a[r].classList.add("active"),setActiveForParentNode(a[r])):a[r].parentNode.classList.add("active"))}function setActiveSubmenu(){var e,t,n,i,o,r=window.location.pathname,a=window.location.host+window.location.pathname
9for("/"===a[a.length-1]&&(a=a.substr(0,a.length-1)),e=!1,n=0,i=(t=(t=document.querySelectorAll("nav.menu-box > ul > li > a")).length<1?document.querySelectorAll("nav.submenu-box > div.submenu > a.submenu-title"):t).length;n<i;n++)if(0<=(o="/"===(o=t[n].getAttribute("href"))[o.length-1]?o.substr(0,o.length-1):o).indexOf("://")&&o.split("//")[1]===a){e=!0
10break}"/"===r&&!e||(setActiveForNodeList("div.submenu > ul > li > a",r=(a.endsWith(".html")?a.substring(0,a.lastIndexOf("/")):a).split("/"),!0),setActiveForNodeList("div.submenu > a.submenu-title",r,!1,!1,"data-src"),setActiveForNodeList("nav.menu-box > ul > li > a",r))}function appendMoreButton(e){var t=document.createElement("span")
11t.innerHTML="więcej",e.querySelector("span")&&e.querySelector("span").isEqualNode(t)||e.appendChild(t)}function configureSubmenu(){document.querySelectorAll("div.submenu > ul").forEach(function(e){var t,n,i,o,r,a,s,c
12if(750<e.offsetWidth){for(appendMoreButton(e.parentElement.lastElementChild),o=e.children,r=!1,a=i=n=t=0;a<o.length;a++)if(hasClass(o[a].firstElementChild,"active")){r=!0
13break}if(r)for(s=0;s<o.length&&!hasClass(o[s].firstElementChild,"active");s++)if(n+=1,450<(t+=o[s].offsetWidth)){for(c=i;c<n;c++)o[c].style.display="none"
14i=n,t=0}}}),document.querySelectorAll("div.submenu-more").forEach(function(e){e.addEventListener("click",function(e){var t
15for(e.stopImmediatePropagation(),this.parentNode.classList.add("opened"),liArray=this.previousElementSibling.children,t=0;liArray.length>t;t++)liArray[t].style.display=""
16this.style.display="none"})}),document.querySelectorAll("span.submenu-more").forEach(function(e){e.addEventListener("click",function(e){e.stopImmediatePropagation()
17var t=this.closest(".submenu")
18if(t){t.classList.toggle("opened")
19for(var n of t.parentNode.children)n!==t&&n.classList.remove("opened")}})})}(mobileMenus=document.querySelectorAll(".mobile-nav-ham")).forEach(function(e){e.addEventListener("click",function(){toggleClass(".menu-content, .mobile-bars, .mobile-menu, .mobile-box","show")})}),setActiveSubmenu(),isDisabledSubmenu()&&toggleSubmenuDisplay(),configureSubmenu(),isSticky=!1
20let lastScroll=0,defaultAdvMargin=20
21function getScrollDirectionUp(){var e=window.pageYOffset||document.documentElement.scrollTop,t=""
22return t=e<lastScroll,lastScroll=e,t}function stickScreeningHandling(e,t){t.top<=-1?e.style.backgroundAttachment="fixed":e.style.backgroundAttachment="scroll"}function skyScrapperHandling(e,t,n){var i=e.getBoundingClientRect(),o=(e.querySelector(".main-content")||"").getBoundingClientRect(),r=document.querySelector(".zpr_box_sky")||"",a=document.querySelector(".zpr_sky_left")||""
23let s,c
24stickScreeningHandling(e,i),s=t&&(c=getComputedStyle(t,null),n)&&isSticky?parseInt(c.clientHeight)+defaultAdvMargin:defaultAdvMargin,o.top<=s?(r.classList.add("zpr_fixed"),""!==a&&isSticky&&(a.style.top=s+"px")):(r.classList.remove("zpr_fixed"),""!==a&&isSticky&&(a.style.top=defaultAdvMargin+"px"))}let add_active=debounce(function(){10<=times&&clearInterval(interval),times++,document.querySelectorAll("div[class*='zpr_box']:not(.zpr_box_inside0)").forEach(function(e){var t=e.querySelector("[class^='zpr_']")
25t&&50<t.clientHeight&&(e.classList.contains("active")||e.classList.add("active"))}),document.querySelectorAll(".zpr_inside_1,.zpr_inside_2,.zpr_inside_3,.zpr_inside_1_wide,.zpr_inside_2_wide,.zpr_inside_3_wide,.zpr_side_1_noscroll").forEach(function(e){50<e.clientHeight&&!e.classList.contains("active")&&e.classList.add("active")})},300),adScrollHeight=1800,minAdHeight=600,radioStreamTopOffset=115,adsReleased=[],placementsCreated=[],blackl
25istDomain=["player.voxfm.pl"],zprSideBottom=document.querySelector(".zpr_box_side_bottom"),zprHalfPageSticky=document.querySelector(".half_page_sticky"),sideBoxContainer=document.querySelector(".side_box_container"),radioStream=document.querySelector(".vjsRadioStream--st"),sideOne=document.getElementById("side_1"),hookContent=document.querySelector("#hook_content"),hookContentRight=document.querySelector("#hook_content_right")
26function checkRequirementsAndInit(){sideOne&&(sideBoxContainer&&zprSideBottom&&zprHalfPageSticky?blacklistDomain.includes(window.location.hostname)||initSideAdsDivs():console.log("Brak wymaganego elementu div potrzebnego do załadowania reklam side"))}function controlSideHeight(){setAsideHeight(),releaseAds()}function initSideAdsDivs(){setAsideHeight()
27var e,t,n,i,o=Math.min(calculateAdCount(getAsideHeight()),3)
28radioStream&&(e=document.querySelector(".zpr_hp"))&&(e.style.top=radioStreamTopOffset+"px")
29for(let e=2;e<=o;e++)document.querySelector(".zpr_box_half_page"+e)||((t=document.createElement("div")).classList.add("zpr_box_half_page"+e),t.style.visibility="hidden",(n=document.createElement("div")).classList.add("zpr_hp"+e),radioStream&&(n.style.top=radioStreamTopOffset+"px"),(i=document.createElement("div")).id="side_"+e,i.classList.add("zpr_side_"+e),n.appendChild(i),t.appendChild(n),sideBoxContainer.appendChild(t),placementsCreated.push(i.id))}function releaseAds(){!sideOne||blacklistDomain.includes(window.location.hostname)||placementsCreated.forEach(e=>{e=sideBoxContainer.querySelector("#"+e)
30e&&releasePlacement(e)})}function releasePlacement(e){var t
31adsReleased.includes(e.id)||elementInViewport(e)&&(sas_idmnet.cmd.push(function(){sas_idmnet.release(e.id)}),adsReleased.push(e.id),t=e.id.slice(-1),t=sideBoxContainer.querySelector(".zpr_box_half_page"+t))&&(t.style.visibility="visible",setTimeout(setActiveAd(t),1500))}function setActiveAd(e){e&&50<e.clientHeight&&e.classList.add("active")}function getHookContentHeight(){return hookContent.getBoundingClientRect().height}function getHookContentRightHeight(){return hookContentRight?hookContentRight.getBoundingClientRect().height:0}function getAsideHeight(){return getHookContentHeight()-getHookContentRightHeight()}function setAsideHeight(){isVisible(document.querySelector(".gl_wrapper"))&&(sideBoxContainer.style.height=getAsideHeight()+"px")}function isVisible(e){var e=e.getBoundingClientRect(),t=Math.max(document.documentElement.clientHeight,window.innerHeight)
32return!(e.bottom<0||0<=e.top-t)}function calculateAdCount(e){var t=e/adScrollHeight,e=e%adScrollHeight
33return adsCount=Math.floor(t),e>=minAdHeight&&adsCount++,adsCount}function elementInViewport(e){return e.getBoundingClientRect().top<(window.innerHeight||document.documentElement.clientHeight)}window.onload=function(){times=5,interval=setInterval(add_active,600)}
34let scrollTimeout
35function isDisabledSubmenu(){if("undefined"!=typeof disableSubmenu&&("True"==disableSubmenu||"1"==disableSubmenu))return!0}function toggleSubmenuDisplay(){var e
36for(e of document.getElementsByClassName("submenu active"))"none"!=e.style.display?e.style.display="none":e.style.display="flex"}function AddAuthorInfo(){document.querySelectorAll(".element__info").forEach(e=>{e.addEventListener("click",function(){e.style.display="none",e.nextElementSibling.style.display="block"})})}window.addEventListener("scroll",function(){clearTimeout(scrollTimeout),scrollTimeout=setTimeout(()=>{var e=getScrollDirectionUp(),t=document.querySelector(".zpr_screening"),n=document.querySelector("header")||""
37t&&skyScrapperHandling(t,n,e),sideOne&&controlSideHeight()},100)},{passive:!0})
38let MobileMenu={mobileMenus:document.querySelectorAll(".mobile-ham"),init:function(){this.mobileMenus.forEach(e=>{e.addEventListener("click",this.toggleMenu.bind(this))})},toggleMenu:function(){this.toggleClass(".menu-content, .mobile-bars","show"),this.toggleClass("body","body-blocked")},toggleClass:function(e,t){document.querySelectorAll(e).forEach(e=>{e.classList.toggle(t)})}},setVisibilityEvent=("loading"!==document.readyState?(AddAuthorInfo(),checkRequirementsAndInit(),MobileMenu.init()):document.addEventListener("DOMContentLoaded",function(){AddAuthorInfo(),checkRequirementsAndInit(),MobileMenu.init()}),(e,n)=>{var t
39e&&(t=new IntersectionObserver(throttle((e,t)=>
39{e.forEach(e=>{.1<e.intersectionRatio&&(t.unobserve(e.target),requestIdleCallback(()=>{dataLayer.push({event:"module_visibility",module_name:n})}))})},200),{threshold:[.1]}),e)&&t.observe(e)})
40function sendToGTM(e,t,n){dataLayer.push({event:"web-vitals",event_category:"Web Vitals",event_action:e.name,event_value:Math.round("CLS"===e.name?1e3*e.delta:e.delta),event_label:e.id})}document.addEventListener("click",function(e){e=e.target.closest('[data-footer-toggle="services"]')
41e&&e.closest("[data-footer-section]").classList.toggle("site-footer__section--open")}),(webVitals=(e=>{function c(){var e=a()
42return e&&e.activationStart||0}function l(e,t){var n=a(),i="navigate"
43return 0<=o?i="back-forward-cache":n&&(document.prerendering||0<c()?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}}function u(e,t,n){try{var i
44if(PerformanceObserver.supportedEntryTypes.includes(e))return(i=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})})).observe(Object.assign({type:e,buffered:!0},n||{})),i}catch(e){}}function d(t,n,i,o){var r,a
45return function(e){0<=n.value&&(e||o)&&((a=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=a,n.rating=(e=n.value)>i[1]?"poor":e>i[0]?"needs-improvement":"good",t(n))}}function f(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})}function m(){return A<0&&(A=C(),F(),y(function(){setTimeout(function(){A=C(),F()},0)})),{get firstHiddenTime(){return A}}}function t(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()}function n(r,a){a=a||{},t(function(){var t,n=m(),i=l("FCP"),o=u("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<n.firstHiddenTime)&&(i.value=Math.max(e.startTime-c(),0),i.entries.push(e),t(!0))})})
46o&&(t=d(r,i,_,a.reportAllChanges),y(function(e){i=l("FCP"),t=d(r,i,_,a.reportAllChanges),f(function(){i.value=performance.now()-e.timeStamp,t(!0)})}))})}function B(e){e.forEach(function(e){e.interactionId&&(L=Math.min(L,e.interactionId),k=Math.max(k,e.interactionId),O=k?(k-L)/7+1:0)})}function R(t){var e,n
47G.forEach(function(e){return e(t)}),!t.interactionId&&"first-input"!==t.entryType||(n=w[w.length-1],((e=H.get(t.interactionId))||w.length<10||t.duration>n.latency)&&(e?t.duration>e.latency?(e.entries=[t],e.latency=t.duration):t.duration===e.latency&&t.startTime===e.entries[0].startTime&&e.entries.push(t):(n={id:t.interactionId,latency:t.duration,entries:[t]},H.set(n.id,n),w.push(n)),w.sort(function(e,t){return t.latency-e.latency}),10<w.length)&&w.splice(10).forEach(function(e){return H.delete(e.id)}))}function p(e){var t=self.requestIdleCallback||self.setTimeout,n=-1
48return e=S(e),"hidden"===document.visibilityState?e():(n=t(e),b(e)),n}function r(e){document.prerendering?t(function(){return r(e)}):"complete"!==document.readyState?addEventListener("load",function(){return r(e)},!0):setTimeout(e,0)}function D(e){var t,n,i,o,r,a
49e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,i=e,o=function(){U(n,i),a()},r=function(){a()},a=function(){removeEventListener("pointerup",o,z),removeEventListener("pointercancel",r,z)},addEventListener("pointerup",o,z),addEventListener("pointercancel",r,z)):U(t,e))}var s,h,g,i,v,o=-1,y=function(t){addEventListener("pageshow",function(e){e.persisted&&(o=e.timeStamp,t(e))},!0)},a=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]
50if(e&&0<e.responseStart&&e.responseStart<performance.now())return e},b=function(e){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e()})},S=function(e){var t=!1
51return function(){t||(e(),t=!0)}},A=-1,C=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},T=function(e){"hidden"===document.visibilityState&&-1<A&&(A="visibilitychange"===e.type?e.timeStamp:0,N())},F=function(){addEventListener("visibilitychange",T,!0),addEventListener("prerenderingchange",T,!0)},N=function(){removeEventListener("visibilitychange",T,!0),removeEventListener("prerenderingchange",T,!0)},_=[1800,3e3],E=[.1,.25],O=0,L=1/0,k=0,V=function(){return s?O:performance.interactionCount||0},w=[],H=new Map,W=0,G=[],q=[200,500],x=[2500,4e3],M={},I=[800,1800],z={passive:!0,capture:!0},j=new Date,U=function(e,t){h||(h=t,g=e,i=new Date,J(removeEventListener),Y())},Y=function(){var t
520<=g&&g<i-j&&(t={entryType:"first-input",name:h.type,target:h.target,cancelable:h.cancelable,startTime:h.timeStamp,processingStart:h.timeStamp+g},v.forEach(function(e){e(t)}),v=[])},J=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,D,z)})},P=[100,300]
53return e.CLSThresholds=E,e.FCPThresholds=_,e.FIDThresholds=P,e.INPThresholds=q,e.LCPThresholds=x,e.TTFBThresholds=I,e.onCLS=function(a,s){s=s||{},n(S(function(){function e(e){e.forEach(function(e){var t,n
54e.hadRecentInput||(t=o[0],n=o[o.length-1],i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e]))}),i>n.value&&(n.value=i,n.entries=o,t())}var t,n=l("CLS",0),i=0,o=[],r=u("layout-shift",e)
55r&&(t=d(a,n,E,s.reportAllChanges),b(function(){e(r.takeRecords()),t(!0)}),y(function(){n=l("CLS",i=0),t=d(a,n,E,s.reportAllChanges),f(function(){return t()})}),setTimeout(t,0))}))},e.onFCP=n,e.onFID=function(a,s){s=s||{},t(function(){function t(e){e.startTime<n.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),r(!0))}function e(e){e.forEach(t)}var n=m(),i=l("FID"),o=u("first-input",e),r=d(a,i,P,s.reportAllChanges)
56o&&(b(S(function(){e(o.takeRecords()),o.disconnect()})),y(function(){i=l("FID"),r=d(a,i,P,s.reportAllChanges),v=[],g=-1,h=null,J(addEventListener),v.push(t),Y()}))})},e.onINP=function(r,a){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(a=a||{},t(function(){var e,n,i,t,o
57"interactionCount"in performance||(s=s||u("event",B,{type:"event",buffered:!0,durationThreshold:0})),i=l("INP"),o=u("event",t=function(t){p(function(){t.forEach(R)
58e=Math.min(w.length-1,Math.floor((V()-W)/50))
59var e=w[e]
60e&&e.latency!==i.value&&(i.value=e.latency,i.entries=e.entries,n())})},{durationThreshold:null!=(e=a.durationThreshold)?e:40}),n=d(r,i,q,a.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),b(function(){t(o.takeRecords()),n(!0)}),y(function(){W=V(),w.length=0,H.clear(),i=l("INP"),n=d(r,i,q,a.reportAllChanges)}))}))},e.onLCP=function(a,s){s=s||{},t(function(){var t,n,i=m(),o=l("LCP"),e=function(e){(e=s.reportAllChanges?e:e.slice(-1)).forEach(function(e){e.startTime<i.firstHiddenTime&&(o.value=Math.max(e.startTime-c(),0),o.entries=[e],t())})},r=u("largest-contentful-paint",e)
61r&&(t=d(a,o,x,s.reportAllChanges),n=S(function(){M[o.id]||(e(r.takeRecords()),r.disconnect(),M[o.id]=!0,t(!0))}),["keydown","click"].forEach(function(e){addEventListener(e,function(){return p(n)},!0)}),b(n),y(function(e){o=l("LCP"),t=d(a,o,x,s.reportAllChanges),f(function(){o.value=performance.now()-e.timeStamp,M[o.id]=!0,t(!0)})}))})},e.onTTFB=function(t,n){n=n||{}
62var i=l("TTFB"),o=d(t,i,I,n.reportAllChanges)
63r(function(){var e=a()
64e&&(i.value=Math.max(e.responseStart-c(),0),i.entries=[e],o(!0),y(function(){i=l("TTFB",0),(o=d(t,i,I,n.reportAllChanges))(!0)}))})},e})({})).onCLS(sendToGTM),webVitals.onTTFB(sendToGTM),webVitals.onLCP(sendToGTM),webVitals.onINP(sendToGTM)

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.