1"use strict";(self.webpackChunkuniversity_of_glasgow=self.webpackChunkuniversity_of_glasgow||[]).push([[9288],{51369:function(e,t,n){n.r(t),n.d(t,{default:function(){return Autocomplete}});class Autocomplete{constructor(e,t,n){this.el=e,this.feed=t,this.resultpage=n,this.inputHandler()}inputHandler(){this.el.addEventListener("input",(e=>{e.target.value.length>=3?fetch(`${this.feed}${e.target.value}`).then((e=>e.json())).then((e=>{this.displayResults(e)})):(this.removeAutocomplete(),this.removeNavHandler())}))}addNavHandler(){window.addEventListener("keypress",this.navHandler)}removeNavHandler(){window.removeEventListener("keypress",this.navHandler)}navHandler(e){}displayResults(e){const t=e.map((e=>`<li><a href="${this.resultpage}${e}">${e}</a></li>`));document.querySelector(".autocomplete")||this.el.insertAdjacentHTML("afterend",'<div class="autocomplete"><ul></ul></div>'),document.querySelector(".autocomplete ul").innerHTML=t.join(""),this.addNavHandler()}removeAutocomplete(){if(document.querySelector(".autocomplete")){const e=document.querySelector(".autocomplete");e.parentNode.removeChild(e)}}}}}]); 2//# sourceMappingURL=gu-autocomplete.2bd84e71.js.map
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.