!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";!function(){const e=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(t.target.classList.add("in"),e.unobserve(t.target))}))}),{threshold:.15,rootMargin:"0px 0px -10% 0px"});function t(e){if(!e)return;const t=document.documentElement;null!=e.grain&&t.style.setProperty("--grain-opacity",e.grain),null!=e.effects&&(t.dataset.effects=e.effects?"on":"off"),e.mode&&(t.dataset.mode=e.mode)}document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".reveal").forEach((t=>e.observe(t))),function(){const e=document.querySelector(".progress");if(!e)return;const t=()=>{const t=document.documentElement,n=t.scrollTop,o=t.scrollHeight-t.clientHeight;e.style.width=o>0?n/o*100+"%":"0%"};window.addEventListener("scroll",t,{passive:!0}),t()}(),function(){const e=document.querySelectorAll("[data-parallax]");if(!e.length)return;const t=()=>{e.forEach((e=>{const t=parseFloat(e.dataset.parallax)||.4,n=e.closest(".pinned-section");if(n){const o=n.getBoundingClientRect(),s=n.offsetHeight-window.innerHeight;if(s<=0)return;const c=(Math.max(0,Math.min(1,-o.top/s))-.5)*t*400;e.style.transform=`translate3d(0, ${c}px, 0)`}else{const n=-e.getBoundingClientRect().top*t;e.style.transform=`translate3d(0, ${n}px, 0)`}}))};window.addEventListener("scroll",t,{passive:!0}),t()}(),function(){const e=document.querySelector("[data-typewriter]");if(!e)return;const t=e.textContent.trim();e.innerHTML='<span class="typed"></span><span class="typed-cursor">&nbsp;</span>';const n=e.querySelector(".typed");let o=0;const s=()=>{o<=t.length?(n.textContent=t.slice(0,o),o++,setTimeout(s,55)):setTimeout((()=>{const t=e.querySelector(".typed-cursor");t&&(t.style.opacity="0")}),1500)};setTimeout(s,600)}(),function(){const e=document.querySelector(".menu-btn"),t=document.querySelector(".menu-overlay"),n=document.querySelector(".menu-close");if(!e||!t)return;const o=()=>{t.classList.remove("open"),document.body.style.overflow=""};e.addEventListener("click",(()=>{t.classList.add("open"),document.body.style.overflow="hidden"})),n&&n.addEventListener("click",o),document.addEventListener("keydown",(e=>{"Escape"===e.key&&o()})),t.addEventListener("click",(e=>{e.target===t&&o()}))}(),function(){const e=document.querySelector(".menu-filter"),t=document.querySelector(".menu-list");if(!e||!t)return;let n=t.querySelector(".menu-empty");n||(n=document.createElement("div"),n.className="menu-empty",n.textContent="No chapters match.",t.appendChild(n)),e.addEventListener("input",(()=>{const n=e.value.trim().toLowerCase();let o=!1;t.querySelectorAll(".menu-chapters li").forEach((e=>{const t=e.textContent.toLowerCase(),s=!n||t.includes(n);e.classList.toggle("hidden",!s),s&&(o=!0)})),t.querySelectorAll(".menu-part").forEach((e=>{const t=e.querySelectorAll(".menu-chapters li:not(.hidden)").length;e.style.display=t?"":"none"})),t.classList.toggle("is-empty",!o)}))}(),function(){window.addEventListener("message",(e=>{const n=e.data;n&&"object"==typeof n&&"__re_tweaks_apply"===n.type&&t(n.tweaks)}));try{const e=localStorage.getItem("re_tweaks");e&&t(JSON.parse(e))}catch(e){}}()}))}()}));
//# sourceMappingURL=shared.js.map