1class t{constructor(){this.timelineSection=null,this.timelineItems=[],this.navigationButtons=[],this.mobileSelect=null,this.isScrolling=!1,this.yearRanges=[{key:"2010 öncesi",selector:"[data-year]"},{key:"2010 - 2020",selector:"[data-year]"},{key:"2020 - sonrası",selector:"[data-year]"}],this.init()}init(){this.cacheDOMElements(),this.validateElements()&&(this.bindEvents(),this.setupIntersectionObserver())}cacheDOMElements(){if(!document.querySelector("section"))return;const t=Array.from(document.querySelectorAll("section")).find(t=>t.querySelector("[data-year-gap]")||t.querySelector(".timeline-dashed"));t&&(this.timelineSection=t,this.navigationButtons=Array.from(this.timelineSection.querySelectorAll("[data-year-gap]")),this.mobileSelect=this.timelineSection.querySelector("select"),this.timelineItems=Array.from(this.timelineSection.querySelectorAll("[data-year]")))}validateElements(){return this.timelineSection&&(this.navigationButtons.length>0||this.mobileSelect)&&this.timelineItems.length>0}bindEvents(){let t;this.navigationButtons.forEach(t=>{t.addEventListener("click",e=>{e.preventDefault();const i=t.getAttribute("data-year-gap");this.scrollToRange(i)})}),this.mobileSelect&&this.mobileSelect.addEventListener("change",t=>{const e=t.target.value;this.scrollToRange(e)}),window.addEventListener("scroll",()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.isScrolling||this.updateActiveNavigation()},200)})}setupIntersectionObserver(){const t=new IntersectionObserver(t=>{this.isScrolling||(clearTimeout(this.observerTimeout),this.observerTimeout=setTimeout(()=>{this.updateActiveNavigationFromObserver(t)},150))},{root:null,rootMargin:"-30% 0px -30% 0px",threshold:[.1,.3,.5,.7]});this.timelineItems.forEach(e=>{t.observe(e)})}updateActiveNavigationFromObserver(t){let e=null,i=0;if(t.forEach(t=>{if(t.isIntersecting){const n=t.boundingClientRect,s=window.innerHeight/2,a=n.top+n.height/2,r=1-Math.abs(s-a)/(window.innerHeight/2),o=t.intersectionRatio*r;o>i&&(i=o,e=t.target)}}),e){const t=parseInt(e.getAttribute("data-year")),i=this.getYearRange(t);this.setActiveNavigation(i)}}getYearRange(t){return t<2010?"2010 öncesi":t>=2010&&t<2020?"2010 - 2020":"2020 - sonrası"}getFirstItemInRange(t){return this.timelineItems.find(e=>{const i=parseInt(e.getAttribute("data-year"));return this.getYearRange(i)===t})}scrollToRange(t){const e=this.getFirstItemInRange(t);if(!e)return;this.isScrolling=!0;const i=document.querySelector('header[role="banner"]')||document.querySelector("header"),n=i?i.getBoundingClientRect().height:0,s=e.offsetTop-n-100;window.scrollTo({top:s,behavior:"smooth"}),setTimeout(()=>{this.isScrolling=!1,this.setActiveNavigation(t)},1e3)}setActiveNavigation(t){this.navigationButtons.forEach(e=>{e.getAttribute("data-year-gap")===t?(e.classList.remove("text-grayQuaternary"),e.classList.add("text-black")):(e.classList.remove("text-black"),e.classList.add("text-grayQuaternary"))}),this.mobileSelect&&(this.mobileSelect.value=t)}updateActiveNavigation(){const t=document.querySelector('header[role="banner"]')||document.querySelector("header"),e=t?t.getBoundingClientRect().height:0;let i=null,n=0;const s=window.innerHeight,a=e+(s-e)/2;if(this.timelineItems.forEach(t=>{const r=t.getBoundingClientRect();if(r.bottom<e||r.top>s)return;const o=Math.max(r.top,e),l=Math.min(r.bottom,s),c=Math.max(0,l-o)/r.height,h=r.top+r.height/2,g=Math.abs(a-h),u=s/2,m=.7*c+.3*Math.max(0,1-g/u);m>n&&c>.2&&(n=m,i=t)}),i){const t=parseInt(i.getAttribute("data-year")),e=this.getYearRange(t),n=this.navigationButtons.find(t=>t.classList.contains("text-black")),s=n?.getAttribute("data-year-gap");s!==e&&this.setActiveNavigation(e)}}}export{t as T};
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.