PageSourceSearch

https://kamppis.huutokaupat.com/hubfs/hub_generated/template_asset…/1789640624142/template_app.min.js

js huutokaupat.com collected 2026-09-24 21:22:17 UTC 11,684 bytes, 2 lines download raw bytes

1const app=()=>{const backToTop=document.querySelector(".aa-back-to-top"),windowHeight=window.innerHeight;if(backToTop){backToTop.addEventListener("click",()=>{document.body.scrollTop=0,document.documentElement.scrollTop=0}),window.onscroll=function(){document.body.scrollTop>windowHeight||document.documentElement.scrollTop>windowHeight?backToTop.classList.add("aa-back-to-top--active"):backToTop.classList.remove("aa-back-to-top--active")}}const header=document.querySelector(".aa-site-header");if(header){const scrollPoint=document.querySelector(".aa-header-scroll-point");new IntersectionObserver(function(payload){payload[0].intersectionRatio?header.classList.remove("aa-site-header--scroll"):header.classList.add("aa-site-header--scroll")}).observe(scrollPoint)}document.querySelectorAll(".aa-navigation-item--children").forEach(element=>{const navItemToggle=element.querySelector(".aa-navigation-toggle");navItemToggle.addEventListener("click",()=>{const toggleExpanded=navItemToggle.getAttribute("aria-expanded"),toggleText=navItemToggle.innerText;"true"==toggleExpanded?(navItemToggle.setAttribute("aria-expanded","false"),navItemToggle.setAttribute("aria-label","Avaa "+toggleText+" valikko")):(navItemToggle.setAttribute("aria-expanded","true"),navItemToggle.setAttribute("aria-label","Sulje "+toggleText+" valikko")),element.classList.toggle("is-active")})});function closeAllMenus(){for(var buttons=document.querySelectorAll("button[aria-expanded][aria-controls]"),i=0;i<buttons.length;i++){var button=buttons[i],menu=button.parentNode;menu&&(menu.classList.remove("is-active"),button.setAttribute("aria-expanded","false"))}}document.querySelectorAll(".aa-navigation-container--primary .aa-navigation-toggle").forEach(element=>{element.addEventListener("focus",()=>{"false"==element.getAttribute("aria-expanded")&&closeAllMenus()})}),document.addEventListener("keydown",event=>{const topNavItemslist=[],topNavItems=document.querySelectorAll(".aa-navigation-container--primary .aa-navigation-item--0");for(;topNavItemslist.length!=topNavItems.length;)topNavItemslist.push(topNavItems[topNavItemslist.length]);const topNavLastItem=topNavItemslist.at(-1),itemList=[],items=document.querySelectorAll(".is-active .aa-navigation-item > a");for(;itemList.length!=items.length;)itemList.push(items[itemList.length]);const index=itemList.indexOf(event.target);var pre=index-1,next=index+1;pre<0&&(pre=0),next>itemList.length&&(next=itemList.length),"Escape"===event.key?closeAllMenus():"ArrowUp"===event.key?itemList.length>0&&-1==index?event.preventDefault():itemList.length>0&&0==pre&&0==index?(event.preventDefault(),document.querySelector(".aa-navigation-item.is-active > .aa-navigation-toggle").focus()):itemList.length>0&&(event.preventDefault(),document.querySelectorAll(".is-active .aa-navigation-item > a")[pre].focus()):"ArrowDown"===event.key?itemList.length>0&&itemList.length==next&&topNavLastItem.classList.contains("is-active")?(event.preventDefault(),document.querySelector(".aa-navigation-container--secondary .aa-navigation-item--0:first-of-type > a").focus(),closeAllMenus()):itemList.length>0&&itemList.length==next?(event.preventDefault(),document.querySelector(".aa-navigation-item.is-active").nextElementSibling.querySelector(".aa-navigation-toggle").focus(),closeAllMenus()):itemList.length>0&&(event.preventDefault(),document.querySelectorAll(".is-active .aa-navigation-item > a")[next].focus()):"ArrowLeft"===event.key||event.key});const hamburgerToggles=document.querySelectorAll(".js-hamburger-toggle"),closeNavPixel=document.querySelector(".aa-close-mobile-nav");hamburgerToggles.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault(),element.classList.toggle("js-hamburger-active"),document.body.classList.toggle("js-nav-open");"true"==element.getAttribute("aria-expanded")?(element.setAttribute("aria-expanded","false"),element.setAttribute("aria-label","Avaa valikko")):(element.setAttribute("aria-expanded","true"),element.setAttribute("aria-label","Sulje valikko"))}),closeNavPixel.addEventListener("focus",()=>{element.focus()})});document.querySelectorAll(".aa-video-thumbnail--file").forEach(element=>{element.addEventListener("click",function(){element.classList.add("is-hidden");(function(elem,selector){let sibling=elem.nextElementSibling;if(!selector)return sibling;for(;sibling;){if(sibling.matches(selector))return sibling;sibling=sibling.nextElementSibling}})(element,"video").play()})});if(document.querySelector(".aa-team-init-isotope")){var iso=new Isotope(".aa-team-init-isotope",{itemSelector:".aa-team-member",layoutMode:"fitRows",transitionDuration:"0"});document.querySelector(".aa-team-filter").addEventListener("click",function(event){if(matchesSelector(event.target,"button")){var filterValue=event.target.getAttribute("data-filter");iso.arrange({filter:filterValue})}})}const isotopeContainer=document.querySelector(".init-isotope");if(isotopeContainer){const isotopeBlog=new Isotope(isotopeContainer,{itemSelector:".aa-column",layoutMode:"fitRows",transitionDuration:"0"});document.querySelectorAll(".aa-blog-listing__tags .js-filtering").forEach(element=>{element.addEventListener("change",event=>{isotopeFilterChange(event.target)})});var isotopeFilters={};function isotopeFilterChange(filterGroup){var isotopeSelectValue=filterGroup.value,isotopeFilterGroup=filterGroup.dataset.f
1ilterGroup;isotopeFilters[isotopeFilterGroup]=isotopeSelectValue;var isotopeFilterValue=Object.values(isotopeFilters).toString().replace(/,/g,"");isotopeBlog.arrange({filter:isotopeFilterValue}),isotopeLoadMore(isotopeInitShow=parseInt(document.querySelector(".aa-blog-posts").dataset.showPosts))}var isotopeInitShow=parseInt(document.querySelector(".aa-blog-posts").dataset.showPosts),isotopeCounter=isotopeInitShow,isotopeButton=document.getElementById("isotope-load-more");function isotopeLoadMore(toShow){isotopeContainer.querySelectorAll(".hidden").forEach(element=>{element.classList.remove("hidden")});var isotopeAddHidden=isotopeBlog.filteredItems.slice(toShow,isotopeBlog.filteredItems.length).map(function(item){return item.element});isotopeAddHidden.forEach(element=>{element.classList.add("hidden")}),isotopeBlog.layout(),0==isotopeAddHidden.length?isotopeButton.style.display="none":isotopeButton.style.display="block"}isotopeLoadMore(isotopeInitShow),isotopeButton.addEventListener("click",()=>{isotopeLoadMore(isotopeCounter+=isotopeInitShow)});const url=window.location.href;if(url.includes("/topic/")||url.includes("/tag/")){let urlTag,isotopeFilterGroupOne,isotopeFilterGroupTwo;urlTag=url.includes("/topic/")?"."+url.split("/topic/").pop():"."+url.split("/tag/").pop(),isotopeFilterGroupOne=document.querySelector('[data-filter-group="filter_one"]'),isotopeFilterGroupTwo=document.querySelector('[data-filter-group="filter_two"]'),isotopeFilterGroupOne.value=decodeURI(urlTag),isotopeFilterGroupTwo.value=decodeURI(urlTag),isotopeFilterChange(isotopeFilterGroupOne),isotopeFilterChange(isotopeFilterGroupTwo)}}};document.addEventListener("DOMContentLoaded",app);class Accordion{constructor(domNode){this.rootEl=domNode,this.buttonEl=this.rootEl.querySelector("button[aria-expanded]");const controlsId=this.buttonEl.getAttribute("aria-controls");this.contentEl=document.getElementById(controlsId),this.open="true"===this.buttonEl.getAttribute("aria-expanded"),this.buttonEl.addEventListener("click",this.onButtonClick.bind(this))}onButtonClick(){this.toggle(!this.open)}toggle(open){open!==this.open&&(this.open=open,this.buttonEl.setAttribute("aria-expanded",`${open}`),open?(this.contentEl.removeAttribute("hidden"),this.rootEl.classList.add("aa-accordion-item__header--open")):(this.contentEl.setAttribute("hidden",""),this.rootEl.classList.remove("aa-accordion-item__header--open")))}open(){this.toggle(!0)}close(){this.toggle(!1)}}const accordions=document.querySelectorAll(".aa-accordion__body > h3");accordions.forEach(accordionEl=>{new Accordion(accordionEl)});var aaSearch=function(_instance){var func,wait,immediate,timeout,KEYS_TAB="Tab",KEYS_ESC="Esc",KEYS_ESCAPE="Escape",KEYS_UP="Up",KEYS_ARROW_UP="ArrowUp",KEYS_DOWN="Down",KEYS_ARROW_DOWN="ArrowDown",searchTerm="",searchForm=_instance,searchField=_instance.querySelector(".aa-search-field__input"),searchResults=_instance.querySelector(".aa-search-field__suggestions"),emptySearchResults=function(){searchResults.innerHTML="",searchField.focus(),searchForm.classList.remove("aa-search-field--open")},getSearchResults=function(){var request=new XMLHttpRequest,requestUrl="/_hcms/search?&term="+encodeURIComponent(searchTerm)+"&limit="+encodeURIComponent(3)+"&autocomplete=true&analytics=true&"+function(){for(var formParams=[],form=_instance.querySelector("form"),i=0;i<form.querySelectorAll("input[type=hidden]").length;i++){var e=form.querySelectorAll("input[type=hidden]")[i];"limit"!==e.name&&formParams.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}return formParams.join("&")}();request.open("GET",requestUrl,!0),request.onload=function(){if(request.status>=200&&request.status<400){var data=JSON.parse(request.responseText);data.total>0?((items=[]).push("<li id='results-for'>Results for \""+(response=data).searchTerm+'"</li>'),response.results.forEach(function(val,index){items.push("<li id='result"+index+"'><a href='"+val.url+"'>"+val.title+"</a></li>")}),emptySearchResults(),searchResults.innerHTML=items.join(""),searchForm.classList.add("aa-search-field--open"),trapFocus()):emptySearchResults()}else console.error("Server reached, error retrieving results.");var response,items},request.onerror=function(){console.error("Could not reach the server.")},request.send()},trapFocus=function(){var tabbable=[];tabbable.push(searchField);for(var tabbables=searchResults.getElementsByTagName("A"),i=0;i<tabbables.length;i++)tabbable.push(tabbables[i]);var firstTabbable=tabbable[0],lastTabbable=tabbable[tabbable.length-1];searchForm.addEventListener("keydown",function(e){switch(e.key){case KEYS_TAB:!function(e){e.target!=lastTabbable||e.shiftKey?e.target==firstTabbable&&e.shiftKey&&(e.preventDefault(),lastTabbable.focus()):(e.preventDefault(),firstTabbable.focus())}(e);break;case KEYS_ESC:case KEYS_ESCAPE:emptySearchResults();break;case KEYS_UP:case KEYS_ARROW_UP:!function(e){e.preventDefault(),e.target==firstTabbable?lastTabbable.focus():tabbable.forEach(function(el){el==e.target&&tabbable[tabbable.indexOf(el)-1].focus()})}(e);break;case KEYS_DOWN:case KEYS_ARROW_DOWN:!function(e){e.preventDefault(),e.target==lastTabbable?firstTabbable.focus():tabbable.forEach(function(el){el==e.target&&tabbable[tabbable.indexOf(el)+1].focus()})}(e)}})},isSearchTermPresent=(func=function(){(searchTerm=searchField.value).length>2?getSearchResults():0==searchTerm.length&&emptySearchResults()},wait=250,function(){var context=this,args=arguments,callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(function(){timeout=null,immediate||func.apply(context,args)},wait||200),callNow&&func.apply(context,args)});searchField.addEventListener("input",function(e){searchTerm!=searchField.value&&isSearchTermPresent()})};if(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState){var searchResults=document.querySelectorAll(".aa-search-field");Array.prototype.forEach.call(searchResults,function(el){aaSearch(el)})}else document.addEventListener("DOMContentLoaded",function(){var searchResults=document.querySelectorAll(".aa-search-field");Array.prototype.forEach.call(searchResults,function(el){aaSearch(el)})});
2//# sourceURL=https://139496624.fs1.hubspotusercontent-eu1.net/hubfs/139496624/hub_generated/template_assets/1/90588234708/1789640624142/template_app.js

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.