PageSourceSearch

https://www.reputationx.com/wp-content/cache/min/1/wp-content/them…/assets/js/main.js?ver=1789094363

js reputationx.com collected 2026-09-24 19:09:41 UTC 19,622 bytes, 48 lines download raw bytes

1'use strict';document.addEventListener('DOMContentLoaded',function(){var siteHeader=document.querySelector('.site-header');if(siteHeader){var scrollThreshold=50;function handleHeaderScroll(){if(window.scrollY>scrollThreshold){siteHeader.classList.add('is-scrolled')}else{siteHeader.classList.remove('is-scrolled')}}
2window.addEventListener('scroll',handleHeaderScroll,{passive:!0});handleHeaderScroll()}
3var anchorLinks=document.querySelectorAll('a[href^="#"]');anchorLinks.forEach(function(link){link.addEventListener('click',function(e){var targetId=this.getAttribute('href');if(targetId==='#'||targetId===''){return}
4var targetElement=document.querySelector(targetId);if(targetElement){e.preventDefault();targetElement.scrollIntoView({behavior:'smooth',block:'start'});if(history.pushState){history.pushState(null,null,targetId)}}})});var accordionTriggers=document.querySelectorAll('.accordion__trigger');accordionTriggers.forEach(function(trigger){trigger.addEventListener('click',function(e){e.preventDefault();var parentItem=this.closest('.accordion__item');var parentAccordion=this.closest('.accordion');var isCurrentlyOpen=parentItem.classList.contains('is-open');var contentPanelId=this.getAttribute('aria-controls');var contentPanel=contentPanelId?document.getElementById(contentPanelId):parentItem.querySelector('.accordion__content');if(parentAccordion){var openItems=parentAccordion.querySelectorAll('.accordion__item.is-open');openItems.forEach(function(openItem){if(openItem!==parentItem){openItem.classList.remove('is-open');var otherTrigger=openItem.querySelector('.accordion__trigger');if(otherTrigger){otherTrigger.setAttribute('aria-expanded','false')}
5var otherPanelId=otherTrigger?otherTrigger.getAttribute('aria-controls'):null;var otherPanel=otherPanelId?document.getElementById(otherPanelId):openItem.querySelector('.accordion__content');if(otherPanel){otherPanel.setAttribute('aria-hidden','true');otherPanel.setAttribute('hidden','')}}})}
6if(isCurrentlyOpen){parentItem.classList.remove('is-open');this.setAttribute('aria-expanded','false');if(contentPanel){contentPanel.setAttribute('aria-hidden','true');contentPanel.setAttribute('hidden','')}}else{parentItem.classList.add('is-open');this.setAttribute('aria-expanded','true');if(contentPanel){contentPanel.setAttribute('aria-hidden','false');contentPanel.removeAttribute('hidden')}}})});var filterBar=document.querySelector('.pricing-filter__bar');if(filterBar){var filterBtns=filterBar.querySelectorAll('.pricing-filter__btn');var pricingSections=document.querySelectorAll('.pricing-section[data-service]');filterBtns.forEach(function(btn){btn.addEventListener('click',function(){var filterValue=this.getAttribute('data-filter');filterBtns.forEach(function(b){b.classList.remove('is-active');b.setAttribute('aria-selected','false')});this.classList.add('is-active');this.setAttribute('aria-selected','true');pricingSections.forEach(function(section){var service=section.getAttribute('data-service');if(filterValue==='all'||service===filterValue){section.classList.remove('is-hidden')}else{section.classList.add('is-hidden');var openItems=section.querySelectorAll('.accordion__item.is-open');openItems.forEach(function(item){item.classList.remove('is-open');var trigger=item.querySelector('.accordion__trigger');if(trigger)trigger.setAttribute('aria-expanded','false');var panel=item.querySelector('.accordion__content');if(panel){panel.setAttribute('aria-hidden','true');panel.setAttribute('hidden','')}})}});if(filterValue!=='all'){var targetSection=document.querySelector('.pricing-section[data-service="'+filterValue+'"]');if(targetSection){var filterBarEl=document.querySelector('.pricing-filter');var filterBarHeight=filterBarEl?filterBarEl.offsetHeight:0;var headerOffset=filterBarHeight+16;var elementPosition=targetSection.getBoundingClientRect().top+window.scrollY;window.scrollTo({top:elementPosition-headerOffset,behavior:'smooth'})}}})})}
7var pgToc=document.querySelector('.pg__toc');if(pgToc){var pgLinks=Array.prototype.slice.call(pgToc.querySelectorAll('a[href^="#"]'));var pgHeadings=pgLinks.map(function(link){return document.getElementById(link.getAttribute('href').slice(1))}
7).filter(Boolean);if(pgHeadings.length>1&&'IntersectionObserver' in window){var pgObserver=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(!entry.isIntersecting)return;var idx=pgHeadings.indexOf(entry.target);if(idx===-1)return;pgLinks.forEach(function(link,linkIdx){link.classList.toggle('is-active',linkIdx===idx)})})},{root:null,rootMargin:'-80px 0px -60% 0px',threshold:0});pgHeadings.forEach(function(heading){pgObserver.observe(heading)})}}
8var tocList=document.getElementById('toc-list');var postContent=document.getElementById('post-content');if(tocList&&postContent){var headings=postContent.querySelectorAll('.prose h2');var tocWidget=document.getElementById('sidebar-toc');if(headings.length===0){if(tocWidget){tocWidget.classList.add('is-hidden')}}else{var tocLinks=[];headings.forEach(function(heading,index){var slug=heading.textContent.trim().toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'');var baseSlug=slug||'section';var id=baseSlug;var suffix=1;while(document.getElementById(id)){id=baseSlug+'-'+suffix;suffix++}
9heading.setAttribute('id',id);var li=document.createElement('li');li.className='sidebar-toc__item';var link=document.createElement('a');link.className='sidebar-toc__link';link.href='#'+id;link.textContent=heading.textContent.trim();link.setAttribute('data-toc-index',index);li.appendChild(link);tocList.appendChild(li);tocLinks.push(link)});if('IntersectionObserver' in window&&tocLinks.length>0){var observerOptions={root:null,rootMargin:'-80px 0px -60% 0px',threshold:0};var activeIndex=-1;var tocObserver=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){var idx=Array.prototype.indexOf.call(headings,entry.target);if(idx!==-1){activeIndex=idx;tocLinks.forEach(function(tocLink,linkIdx){if(linkIdx===idx){tocLink.classList.add('is-active')}else{tocLink.classList.remove('is-active')}})}}})},observerOptions);
9headings.forEach(function(heading){tocObserver.observe(heading)})}}}
10var copyBtns=document.querySelectorAll('.js-copy-link');copyBtns.forEach(function(btn){btn.addEventListener('click',function(e){e.preventDefault();var url=this.getAttribute('data-url')||window.location.href;var button=this;if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(url).then(function(){showCopiedState(button)})}else{var textarea=document.createElement('textarea');textarea.value=url;textarea.style.position='fixed';textarea.style.left='-9999px';document.body.appendChild(textarea);textarea.select();try{document.execCommand('copy');showCopiedState(button)}catch(err){}
11document.body.removeChild(textarea)}})});function showCopiedState(button){var icon=button.querySelector('i');button.classList.add('is-copied');if(icon){icon.className='fa-solid fa-check'}
12setTimeout(function(){button.classList.remove('is-copied');if(icon){icon.className='fa-solid fa-link'}},2000)}
13var progressBar=document.querySelector('.reading-progress');var progressTarget=postContent||document.querySelector('.guide-content')||document.querySelector('.pg__main');if(progressBar&&progressTarget){var progressFill=progressBar.querySelector('.reading-progress__bar');var ticking=!1;function updateProgressBar(){var article=progressTarget;var articleTop=article.getBoundingClientRect().top+window.scrollY;var articleHeight=article.offsetHeight;var windowHeight=window.innerHeight;var scrollY=window.scrollY;var start=articleTop;var end=articleTop+articleHeight-windowHeight;var progress=0;if(scrollY>=start&&end>start){progress=Math.min(((scrollY-start)/(end-start))*100,100)}else if(scrollY>end){progress=100}
14if(progressFill){progressFill.style.width=progress+'%'}
15if(scrollY>articleTop-windowHeight){progressBar.classList.add('is-visible')}else{progressBar.classList.remove('is-visible')}
16ticking=!1}
17window.addEventListener('scroll',function(){if(!ticking){requestAnimationFrame(updateProgressBar);ticking=!0}},{passive:!0});updateProgressBar()}
18var langToggle=document.querySelector('.language-switcher__toggle');if(langToggle){langToggle.addEventListener('click',function(e){e.stopPropagation();var expanded=this.getAttribute('aria-expanded')==='true';this.setAttribute('aria-expanded',String(!expanded))});document.addEventListener('click',function(e){if(!e.target.closest('.language-switcher')){langToggle.setAttribute('aria-expanded','false')}});document.addEventListener('keydown',function(e){if(e.key==='Escape'){langToggle.setAttribute('aria-expanded','false');langToggle.focus()}})}
19var sliders=document.querySelectorAll('.ts-slider');sliders.forEach(function(slider){var track=slider.querySelector('.ts-slider__track');var slides=slider.querySelectorAll('.ts-slider__slide');var dots=slider.querySelectorAll('.ts-slider__dot');var prevBtn=slider.querySelector('.ts-slider__arrow--prev');var nextBtn=slider.querySelector('.ts-slider__arrow--next');var autoplay=slider.getAttribute('data-autoplay')==='true';var interval=parseInt(slider.getAttribute('data-interval'),10)||6000;var current=0;var total=slides.length;var timer=null;if(total<=1)return;function goTo(index){if(index<0)index=total-1;if(index>=total)index=0;current=index;track.style.transform='translateX(-'+(current*100)+'%)';slides.forEach(function(slide,i){if(i===current){slide.removeAttribute('aria-hidden');slide.removeAttribute('tabindex')}else{slide.setAttribute('aria-hidden','true');slide.setAttribute('tabindex','-1')}});dots.forEach(function(dot,i){dot.classList.toggle('is-active',i===current);dot.setAttribute('aria-selected',i===current?'true':'false')})}
20function startAutoplay(){if(autoplay&&!timer){timer=setInterval(function(){goTo(current+1)},interval)}}
21function stopAutoplay(){if(timer){clearInterval(timer);timer=null}}
22if(prevBtn)prevBtn.addEventListener('click',function(){stopAutoplay();goTo(current-1);startAutoplay()});if(nextBtn)nextBtn.addEventListener('click',function(){stopAutoplay();goTo(current+1);startAutoplay()});dots.forEach(function(dot){dot.addEventListener('click',function(){stopAutoplay();
22goTo(parseInt(this.getAttribute('data-slide'),10));startAutoplay()})});slider.addEventListener('mouseenter',stopAutoplay);slider.addEventListener('mouseleave',startAutoplay);slider.addEventListener('focusin',stopAutoplay);slider.addEventListener('focusout',startAutoplay);slider.addEventListener('keydown',function(e){if(e.key==='ArrowLeft'){stopAutoplay();goTo(current-1);startAutoplay()}
23if(e.key==='ArrowRight'){stopAutoplay();goTo(current+1);startAutoplay()}});var startX=0;var isDragging=!1;track.addEventListener('pointerdown',function(e){if(e.pointerType==='mouse')return;startX=e.clientX;isDragging=!0;stopAutoplay()});track.addEventListener('pointerup',function(e){if(!isDragging)return;isDragging=!1;var diff=startX-e.clientX;if(Math.abs(diff)>50){goTo(diff>0?current+1:current-1)}
24startAutoplay()});startAutoplay()});var counters=document.querySelectorAll('[data-count-to]');if(counters.length>0&&'IntersectionObserver' in window){var counterObserver=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(!entry.isIntersecting)return;var el=entry.target;var target=parseFloat(el.getAttribute('data-count-to'));var prefix=el.getAttribute('data-count-prefix')||'';var suffix=el.getAttribute('data-count-suffix')||'';var duration=2000;var start=0;var startTime=null;var isFloat=target%1!==0;function animate(timestamp){if(!startTime)startTime=timestamp;var progress=Math.min((timestamp-startTime)/duration,1);var eased=1-Math.pow(1-progress,3);var current=eased*target;if(isFloat){el.textContent=prefix+current.toFixed(1)+suffix}else{el.textContent=prefix+Math.floor(current).toLocaleString()+suffix}
25if(progress<1){requestAnimationFrame(animate)}else{if(isFloat){el.textContent=prefix+target.toFixed(1)+suffix}else{el.textContent=prefix+target.toLocaleString()+suffix}}}
26requestAnimationFrame(animate);counterObserver.unobserve(el)})},{threshold:0.3});counters.forEach(function(counter){counterObserver.observe(counter)})}
27var guideSections=document.querySelectorAll('.guide-section[id], .guide-content h2[id]');var guideTocLinks=document.querySelectorAll('.guide-toc__link');if(guideSections.length&&guideTocLinks.length){var activeSectionId=null;var tocObserver=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(entry.isIntersecting){activeSectionId=entry.target.id;guideTocLinks.forEach(function(link){var isActive=link.getAttribute('href')==='#'+activeSectionId;link.classList.toggle('is-active',isActive)})}})},{rootMargin:'-15% 0px -70% 0px',threshold:0});guideSections.forEach(function(section){tocObserver.observe(section)})}
28document.querySelectorAll('.guide-faq__question').forEach(function(question){question.addEventListener('click',function(){var item=this.closest('.guide-faq__item');if(!item)return;var isOpen=item.classList.contains('is-open');var siblings=item.parentElement.querySelectorAll('.guide-faq__item');siblings.forEach(function(s){s.classList.remove('is-open')});if(!isOpen){item.classList.add('is-open')}})});var statModal=document.getElementById('stat-detail-modal');if(statModal){var modalValue=document.getElementById('stat-modal-value');var modalLabel=document.getElementById('stat-modal-label');var modalSource=document.getElementById('stat-modal-source');var previousFocus=null;function openStatModal(card){var value=card.getAttribute('data-stat-value')||'';var label=card.getAttribute('data-stat-label')||'';var detail=card.getAttribute('data-stat-detail')||'';var source=card.getAttribute('data-stat-source')||'';var sourceUrl=card.getAttribute('data-stat-source-url')||'';var year=card.getAttribute('data-stat-year')||'';if(modalValue)modalValue.textContent=value;if(modalLabel){if(detail){var escapedLabel=label.replace(/&/g,'&amp;').replace(/</g,'&lt;');var escapedDetail=detail.replace(/&/g,'&amp;').replace(/</g,'&lt;');modalLabel.innerHTML='<strong>'+escapedLabel+'</strong>'+'<span class="stat-modal__detail">'+escapedDetail+'</span>'}else{modalLabel.textContent=label}}
29if(modalSource){var sourceHtml='';if(source&&sourceUrl){sourceHtml='<a href="'+sourceUrl+'" target="_blank" rel="noopener noreferrer">'+source.replace(/&/g,'&amp;').replace(/</g,'&lt;')+'</a>'}else if(source){sourceHtml=source.replace(/&/g,'&amp;').replace(/</g,'&lt;')}
30if(year){sourceHtml+=(sourceHtml?' &middot; ':'')+year}
31modalSource.innerHTML=sourceHtml;modalSource.style.display=sourceHtml?'':'none'}
32previousFocus=document.activeElement;statModal.removeAttribute('hidden');document.body.style.overflow='hidden';var closeBtn=statModal.querySelector('.stat-modal__close');if(closeBtn){closeBtn.focus()}}
33function closeStatModal(){statModal.setAttribute('hidden','');document.body.style.overflow='';if(previousFocus&&previousFocus.focus){previousFocus.focus()}}
34document.addEventListener('click',function(e){var detailBtn=e.target.closest('.js-stat-detail');if(detailBtn){e.preventDefault();var card=detailBtn.closest('.stat-card');
34if(card){openStatModal(card)}}});var closeTargets=statModal.querySelectorAll('.js-stat-modal-close');closeTargets.forEach(function(el){el.addEventListener('click',function(e){if(e.target===this){closeStatModal()}})});document.addEventListener('keydown',function(e){if(e.key==='Escape'&&!statModal.hasAttribute('hidden')){closeStatModal()}});statModal.addEventListener('keydown',function(e){if(e.key!=='Tab')return;var focusable=statModal.querySelectorAll('button, [href], [tabindex]:not([tabindex="-1"])');if(focusable.length===0)return;var first=focusable[0];var last=focusable[focusable.length-1];if(e.shiftKey){if(document.activeElement===first){e.preventDefault();last.focus()}}else{if(document.activeElement===last){e.preventDefault();first.focus()}}});var shareBtn=statModal.querySelector('.js-stat-share-x');var _baseOpenStatModal=openStatModal;openStatModal=function(card){_baseOpenStatModal(card);if(shareBtn){var value=card.getAttribute('data-stat-value')||'';var label=card.getAttribute('data-stat-label')||'';var statId=card.getAttribute('data-stat-id')||'';var pageUrl=window.location.origin+window.location.pathname;if(statId){pageUrl+='#'+statId}
35var tweetText=value+' — '+label;var intentUrl='https://x.com/intent/tweet?text='+encodeURIComponent(tweetText)+'&url='+encodeURIComponent(pageUrl);shareBtn.setAttribute('href',intentUrl)}}}
36var statCarousel=document.querySelector('.stat-highlight-carousel');if(statCarousel){var carouselSlides=statCarousel.querySelectorAll('.stat-highlight-carousel__slide');var carouselDots=statCarousel.querySelectorAll('.stat-highlight-carousel__dot');var carouselCurrent=0;var carouselTotal=carouselSlides.length;var carouselTimer=null;var carouselInterval=6000;if(carouselTotal>1){function goToSlide(index){if(index<0)index=carouselTotal-1;if(index>=carouselTotal)index=0;carouselCurrent=index;carouselSlides.forEach(function(slide,i){if(i===carouselCurrent){slide.classList.add('is-active')}else{slide.classList.remove('is-active')}});carouselDots.forEach(function(dot,i){if(i===carouselCurrent){dot.classList.add('is-active')}else{dot.classList.remove('is-active')}})}
37function startCarousel(){if(!carouselTimer){carouselTimer=setInterval(function(){goToSlide(carouselCurrent+1)},carouselInterval)}}
38function stopCarousel(){if(carouselTimer){clearInterval(carouselTimer);carouselTimer=null}}
39carouselDots.forEach(function(dot){dot.addEventListener('click',function(){stopCarousel();goToSlide(parseInt(this.getAttribute('data-slide'),10));startCarousel()})});statCarousel.addEventListener('mouseenter',stopCarousel);statCarousel.addEventListener('mouseleave',startCarousel);statCarousel.addEventListener('focusin',stopCarousel);statCarousel.addEventListener('focusout',startCarousel);var prefersReduced=window.matchMedia('(prefers-reduced-motion: reduce)');if(!prefersReduced.matches){startCarousel()}}}
40var hash=window.location.hash;if(hash&&hash.match(/^#stat-\d+$/)){var targetStat=document.querySelector(hash);if(targetStat){setTimeout(function(){targetStat.scrollIntoView({behavior:'smooth',block:'center'});targetStat.classList.add('stat-card--highlight');setTimeout(function(){targetStat.classList.remove('stat-card--highlight')},2000)},500)}}(function(){var states=document.querySelectorAll('.hero__mockup-state');var dots=document.querySelectorAll('.hero__mockup-dot-btn');var visual=document.querySelector('.hero__visual');var urlBar=document.querySelector('.hero__mockup-url-text');if(!states.length)return;var stateKeys=['search','wiki'];var urlLabels={search:'reputationx.com/dashboard',wiki:'en.wikipedia.org/wiki/Acme_Corp'};var current=0;var timer;function goTo(index){states.forEach(function(s){s.classList.remove('hero__mockup-state--active')});dots.forEach(function(d){d.classList.remove('active')});states[index].classList.add('hero__mockup-state--active');if(dots[index]){dots[index].classList.add('active')}
41if(visual){visual.setAttribute('data-active',stateKeys[index])}
42if(urlBar){urlBar.style.opacity='0';setTimeout(function(){urlBar.textContent=urlLabels[stateKeys[index]];urlBar.style.opacity=''},150)}
43current=index}
44function advance(){goTo((current+1)%states.length)}
45function start(){timer=setInterval(advance,5000)}
46function stop(){clearInterval(timer)}
47dots.forEach(function(dot,i){dot.addEventListener('click',function(){stop();goTo(i);start()})});var mockup=document.querySelector('.hero__mockup');if(mockup){mockup.addEventListener('mouseenter',stop);mockup.addEventListener('mouseleave',start)}
48goTo(0);start()})()})

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.