// source --> https://blog.dicomp.com.br/wp-content/themes/Total/assets/js/frontend/sticky/header.min.js?ver=6.3 
!function(e){const t=document.querySelector("#site-header.fixed-scroll");if(!t)return;let s=!1,i=!1,n=!1,r=!1,o=0;const a=t.classList.contains("fixed-scroll--mobile-only"),d=()=>Math.max(window.scrollY||0,0),c=()=>{let e="inner",t=window;return"innerWidth"in window||(e="client",t=document.documentElement||document.body),t[e+"Width"]},l=e=>!!e&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length),p=e=>{const t=e.getBoundingClientRect();return{top:t.top+d(),left:t.left+d(),bottom:t.bottom+d()}},h=()=>{let t=0;document.querySelectorAll(".wpex-sticky-el-offset,#wpadminbar").forEach((e=>{const s=window.getComputedStyle(e).position;l(e)&&((e,t)=>{if("wpadminbar"===e.id)return!0;if(!e||!t)return;return 4===e.compareDocumentPosition(t)})(e,n)&&("fixed"===s||"sticky"===s)&&(t+=e.getBoundingClientRect().height)}));const s=document.body.style.getPropertyValue("--wpex-sticky-topbar-height");return s&&(t+=parseInt(s)),e.offset&&(t+=e.offset),t},y=()=>{let e=t.getBoundingClientRect().height;return Math.round(e)!==e&&(e=e.toFixed(2)),e},u=(()=>{let t=parseInt(e.breakpoint);return a?t-1:t})(),m=(()=>{if(e.startPoint&&!isNaN(e.startPoint))return e.startPoint;const t=document.querySelector(e.startPoint);return t?p(t).top:0})(),g=()=>{switch(a?">":"<"){case"<":return c()<u;case">":return c()>u}};function w(){return d()>o}const f=()=>(m||p(n).top)-h(),k=()=>{s||(n.style.height=t.getBoundingClientRect().height+"px",n.classList.remove("not-sticky"),n.classList.add("is-sticky"),t.classList.remove("dyn-styles"),t.style.top=h()+"px",t.style.width=n.getBoundingClientRect().width+"px",t.classList.contains("transform-prepare")&&t.classList.add("transform-go"),s=!0)},x=()=>{let t=a?e.shrinkOnMobile:e.shrink;return t&&(a||e.mobileSupport&&g())&&(t=e.shrinkOnMobile),t},L=()=>{x()&&w()?!r&&s&&(t.classList.add("sticky-header-shrunk"),r=!0):(t.classList.remove("sticky-header-shrunk"),r=!1)},v=()=>{if(n.classList.remove("is-sticky"),n.classList.add("not-sticky"),e.shrink){let e=(()=>{let e=window.getComputedStyle(t).transitionDuration,s="";return e&&"0s"===e||(s=parseFloat(e)*(e.indexOf("ms")>-1?1:1e3)),s||(s=300),s})();setTimeout((function(){s||(n.style.height="")}),e)}else n.style.height="";t.classList.add("dyn-styles"),t.style.width="",t.style.top="",t.classList.remove("transform-go"),s=!1,t.classList.remove("sticky-header-shrunk"),r=!1};function b(){s&&(m?(t.classList.remove("transform-go"),r&&(t.classList.remove("sticky-header-shrunk"),r=!1)):t.classList.remove("transform-prepare"),v())}const C=()=>{let r=d();if(!l(t)||(a||!e.mobileSupport)&&g())return b(),n.classList.remove("wpex-can-sticky"),t.classList.remove("transform-prepare"),void(e.scrollUp||document.body.style.removeProperty("--wpex-sticky-header-height"));n.classList.add("wpex-can-sticky");let o="",c=!1;if(e.shrink){if(e.shrinkHeight&&!e.scrollUp){const t=parseInt(e.shrinkHeight);document.body.style.setProperty("--wpex-sticky-header-height",`${t}px`)}}else o=y(),i!==o&&(c=!0,i=o),e.scrollUp||!c&&document.body.style.getPropertyValue("--wpex-sticky-header-height")||document.body.style.setProperty("--wpex-sticky-header-height",`${i}px`);s?(!x&&c&&(n.style.height=`${i}px`),t.style.top=h()+"px",t.style.width=n.getBoundingClientRect().width+"px"):0!==r&&r>f()?k():b(),e.shrink&&L()},S=()=>{let i=d();n.classList.contains("wpex-can-sticky")&&(m&&(()=>{var e=d();s&&t.classList.add("transform-go"),e<=0?t.classList.remove("transform-prepare"):w()?t.classList.add("transform-prepare"):t.classList.remove("transform-prepare")})(),0!=i&&i>=f()?k():b(),e.shrink&&L())},P=()=>{b(),C()},B=()=>{n=document.querySelector("#site-header-sticky-wrapper"),n||(n=document.createElement("div"),n.id="site-header-sticky-wrapper",n.className="wpex-sticky-header-holder not-sticky wpex-print-hidden",t.childNodes||(t=[t]),t.nextSibling?t.parentNode.insertBefore(n,t.nextSibling):t.parentNode.appendChild(n),n.appendChild(t)),(()=>{const e=document.querySelector("#site-header.overlay-header");o=e&&"absolute"===window.getComputedStyle(e).position?p(t).top+t.getBoundingClientRect().height:p(n).top+n.getBoundingClientRect().height})(),C(),window.addEventListener("scroll",S,{passive:!0}),window.addEventListener("resize",C),window.addEventListener("orientationchange",P),e.shrink||e.scrollUp||!n.classList.contains("wpex-can-sticky")||window.addEventListener("load",(()=>{setTimeout((()=>{const e=y();i!==e&&(i=e,document.body.style.setProperty("--wpex-sticky-header-height",`${i}px`),n.style.height=`${i}px`)}),0)}))};e.runOnWindowLoad?window.addEventListener("load",(()=>{B()})):B()}(wpex_sticky_header_params);