1(function(){'use strict';const section=document.querySelector('.proyectos-section');if(!section)return;var debounceTimer=null;function getGrid(){return section.querySelector('.proyectos-grid-wrap')} 2function loadPage(url){const grid=getGrid();if(grid)grid.classList.add('proyectos-grid-wrap--loading');fetch(url).then(function(r){return r.text()}).then(function(html){const doc=new DOMParser().parseFromString(html,'text/html');const newGrid=doc.querySelector('.proyectos-grid-wrap');const curGrid=getGrid();if(newGrid&&curGrid){curGrid.replaceWith(newGrid);attachGridEvents()} 3const cleanUrl=url.split('#')[0];history.pushState({url:cleanUrl},'',cleanUrl)}).catch(function(){const grid=getGrid();if(grid)grid.classList.remove('proyectos-grid-wrap--loading')})} 4function buildSearchUrl(query){const form=section.querySelector('.proyectos-grid__search');const base=form?form.action:window.location.href;const url=new URL(base);const hidden=form?form.querySelector('input[name="servicio"]'):null;if(hidden){url.searchParams.set('servicio',hidden.value)}else{url.searchParams.delete('servicio')} 5if(query){url.searchParams.set('proyectos_search',query)}else{url.searchParams.delete('proyectos_search')} 6return url.toString()} 7function attachGridEvents(){const grid=getGrid();if(!grid)return;grid.querySelectorAll('.proyectos-grid__pill, .wp-block-query-pagination a').forEach(function(link){link.addEventListener('click',function(e){e.preventDefault();loadPage(this.href)})})} 8function attachSearchEvents(){const input=section.querySelector('.proyectos-grid__search-input');if(!input)return;input.addEventListener('input',function(){clearTimeout(debounceTimer);const q=this.value.trim();debounceTimer=setTimeout(function(){loadPage(buildSearchUrl(q))},400)});input.addEventListener('keydown',function(e){if(e.key==='Enter'){e.preventDefault();clearTimeout(debounceTimer);loadPage(buildSearchUrl(this.value.trim()))}});const form=section.querySelector('.proyectos-grid__search');if(form){form.addEventListener('submit',function(e){e.preventDefault()})}} 9window.addEventListener('popstate',function(e){if(e.state&&e.state.url){loadPage(e.state.url)}});function attachFilterPills(){section.querySelectorAll('.proyectos-grid__pill').forEach(function(link){link.addEventListener('click',function(e){e.preventDefault();section.querySelectorAll('.proyectos-grid__pill').forEach(function(p){p.classList.remove('proyectos-grid__pill--active')});this.classList.add('proyectos-grid__pill--active');loadPage(this.href)})})} 10attachSearchEvents();attachFilterPills();attachGridEvents()})()
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.