1const S=()=>{document.querySelectorAll("div.js-articles-container[data-id]").forEach(t=>{const i=t.querySelector('input[type="search"][name="text"]'),d=t.querySelector('button[type="submit"][name="submit"]'),s=t.querySelector('input[type="hidden"][name="parent"]'),r=t.querySelector('input[type="hidden"][name="archived"]'),o=t.querySelector('select[name="sort"]'),n=t.querySelector('select[name="category"]'),f=t.querySelector('input[type="hidden"][name="page"]'),v=t.querySelector('input[type="hidden"][name="perPage"]'),h=t.getAttribute("data-url"),p=t.querySelector(".js-articles-results"),u=t.querySelector(".js-toggle-archived");let y;const l=(c=!1)=>{clearTimeout(y),y=setTimeout(()=>{if(!h||!d||!o||!f||!v)return;const a={parent:(s==null?void 0:s.value)||null,page:parseInt(f.value,10),perPage:parseInt(v.value,10),sort:o.value,archived:!1,category:(n==null?void 0:n.value)||null};a.archived=(r==null?void 0:r.value)==="true",c&&(a.page=1),i&&(a.text=i.value),fetch(h,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(e=>{if(e.ok)return e.json();throw new Error("An error occurred.")}).then(e=>{p&&(p.innerHTML=e==null?void 0:e.html),f.value=e==null?void 0:e.page}).catch(e=>{console.error(e)})},200)};if(o&&o.addEventListener("change",()=>{l()}),n&&n.addEventListener("change",()=>{l()}),d&&d.addEventListener("click",c=>{c.preventDefault(),l()}),i&&i.addEventListener("input",()=>{i.value.length>0&&l(!0)}),u&&r){const c=u.getAttribute("data-false"),a=u.getAttribute("data-true");c&&a&&u.addEventListener("click",e=>{e.preventDefault(),r.value==="false"?(r.value="true",u.innerHTML=a):r.value==="true"&&(r.value="false",u.innerHTML=c),l(!0)})}})};export{S as bip};
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.