1class SearchForm extends HTMLElement{constructor(){super(),this.form=this.querySelector("form")}connectedCallback(){this.hasAttribute("add-recent-search-on-load")&&this.addFormStateToRecentSearches()}static addRecentSearch(e,r){if(!e||!r)return;let t=[{query:e,uri:r}];const a=localStorage.getItem("recentSearches");if(a){const e=[...JSON.parse(a),...t];t=(c=e.reverse(),o="query",[...new Map(c.map((e=>[e[o],e]))).values()]).reverse(),t.length>5&&(t=t.slice(-5))}var c,o;localStorage.setItem("recentSearches",JSON.stringify(t)),document.querySelectorAll("recent-searches").forEach((e=>e.update()))}addFormStateToRecentSearches(){if(!this.form)return;const e=new FormData(this.form),r=new URLSearchParams(e),t=new URL(`${window.location.origin}${this.form.getAttribute("action")}`),a=window.location.origin,c=t.pathname,o=t.searchParams,n=new URLSearchParams({...Object.fromEntries(o),...Object.fromEntries(r)});SearchForm.addRecentSearch(e.get("q"),`${a}${c}?${n.toString()}`)}}customElements.define("search-form",SearchForm); 2//# sourceMappingURL=search-form.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.