1var hsSearch=function(_instance){var func,wait,immediate,timeout,searchTerm="",searchForm=_instance,searchField=_instance.querySelector(".hs-search-field__input"),searchSuggestions=_instance.querySelector(".hs-search-field__suggestions .pwr-suggestions-panel"),emptySearchResults=function(){searchSuggestions&&(searchSuggestions.querySelector(".pwr-suggestions-wrapper").innerHTML=""),searchField.focus(),searchForm.classList.remove("hs-search-field--open")},getSearchResults=function(){const data=new FormData;for(const[key,value]of Object.entries(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];if("limit"!==e.name){var current_value=formParams[e.name];current_value?Array.isArray(current_value)?current_value.push(e.value):formParams[e.name]=[current_value,e.value]:formParams[e.name]=e.value}}return formParams}()))Array.isArray(value)?value.forEach(v=>data.append(key,v)):data.set(key,value);data.set("limit",3),data.set("autocomplete",!0),data.set("analytics",!0),data.set("q",searchTerm);const searchUrl=`/_hcms/v3/site-search/search?${new URLSearchParams(data).toString()}`,request=new XMLHttpRequest;request.open("GET",searchUrl,!0),request.onload=function(){if(request.status>=200&&request.status<400){var data=JSON.parse(request.responseText);data.total>0?(!function(response){var items=[];if(response.results.forEach(function(val,index){items.push("<li id='result"+index+"'><a href='"+val.url+"' focusVisible>"+val.title+"</a></li>")}),emptySearchResults(),searchSuggestions){searchSuggestions.querySelector(".pwr-suggestions-wrapper").innerHTML=items.join("");const suggestionsTitle=searchSuggestions.querySelector(".pwr-suggestions--title");suggestionsTitle&&(null==this.suggestionsTitleStr&&(this.suggestionsTitleStr=suggestionsTitle.innerText),suggestionsTitle.innerText=this.suggestionsTitleStr.replace("{search_term}",searchTerm))}searchForm.classList.add("hs-search-field--open")}(data),trapFocus()):emptySearchResults()}else console.error("Server reached, error retrieving results.")},request.onerror=function(){console.error("Could not reach the server.")},request.send()},trapFocus=function(){for(var tabbable=[],tabbables=searchSuggestions?searchSuggestions.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.which){case 9:!function(e){e.target!=lastTabbable||e.shiftKey?e.target==firstTabbable&&e.shiftKey&&(e.preventDefault(),lastTabbable.focus()):(e.preventDefault(),firstTabbable.focus())}(e);break;case 27:emptySearchResults();break;case 38:!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 40:!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(){searchSuggestions&&((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){9!=e.which&&40!=e.which&&38!=e.which&&27!=e.which&&searchTerm!=searchField.value&&isSearchTermPresent()})};pwr.dom.ready(()=>{var searchField=document.querySelectorAll(".vanilla .hs-search-field");Array.prototype.forEach.call(searchField,function(el){hsSearch(el)})}); 2//# sourceURL=https://143148669.fs1.hubspotusercontent-eu1.net/hubfs/143148669/hub_generated/template_assets/1/265143997631/1786380061591/template_pwr-search.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.