1(function($){'use strict';const utils=window.wpImmoSearchUtils;const addDebugLog=utils.addDebugLog;const lazyLoadImages=utils.lazyLoadImages;const renderTemplate=utils.renderTemplate;if(!window.wpImmoSearchState){window.wpImmoSearchState={}} 2window.wpImmoSearchState.currentLayout=window.wpImmoSearchState.currentLayout||'grid';window.wpImmoSearchState.hasMoreResults=window.wpImmoSearchState.hasMoreResults!==undefined?window.wpImmoSearchState.hasMoreResults:!0;window.wpImmoSearchState.currentPage=window.wpImmoSearchState.currentPage||1;window.wpImmoSearchState.isLoading=window.wpImmoSearchState.isLoading||!1;function initializeSearchResults(){addDebugLog('Initializing search results');const $loadMoreButton=$('#load-more');const $mapToggle=$('#toggle-map-view');$loadMoreButton.off('click').on('click',function(e){e.preventDefault();addDebugLog('Load more button clicked - Page: '+window.wpImmoSearchState.currentPage);if(!window.wpImmoSearchState.isLoading&&window.wpImmoSearchState.hasMoreResults){window.wpImmoSearchState.currentPage++;addDebugLog('Loading page: '+window.wpImmoSearchState.currentPage);window.wpImmoSearchCore.performSearch(!1,!0)}});$mapToggle.off('click').on('click',function(e){e.preventDefault();addDebugLog('Map toggle button clicked');toggleMapView()});addDebugLog('Search results initialized')} 3function initializeLayout(){addDebugLog('Initializing layout (grid only)');const $container=$('#results-container');$container.addClass('grid-layout');window.wpImmoSearchState.currentLayout='grid';addDebugLog('Layout initialized')} 4function initializeSorting(){const $sortSelect=$('#results-sorting');if($sortSelect.length===0){return} 5addDebugLog('Initializing sorting');$sortSelect.off('change').on('change',function(){const initialSearchDone=window.wpImmoSearchFilter&&window.wpImmoSearchFilter.isInitialSearchDone?window.wpImmoSearchFilter.isInitialSearchDone():!0;if(!initialSearchDone){addDebugLog('Skipping sort change - initial search not done yet');return} 6const sortValue=$(this).val();addDebugLog('Sort changed to: '+sortValue);window.wpImmoSearchState.currentPage=1;window.wpImmoSearchCore.performSearch(!0)});addDebugLog('Sorting initialized')} 7function renderResults(results){addDebugLog('Rendering '+results.length+' results');const $container=$('#results-container');const template=$('#result-item-template').html();if(!template){addDebugLog('ERROR: Result item template not found','error');return} 8$container.empty();results.forEach(function(result,index){try{const html=typeof Mustache!=='undefined'?Mustache.render(template,result):renderTemplate(template,result);$container.append(html);addDebugLog('Rendered result '+index+': '+result.title)}catch(error){addDebugLog('Error rendering result '+index+': '+error.message,'error')}});lazyLoadImages();$('.wp-immo-search-results').css('opacity','1');addDebugLog('Results rendered successfully')}
9function appendResults(results){addDebugLog('Appending '+results.length+' results');const $container=$('#results-container');const template=$('#result-item-template').html();if(!template){addDebugLog('ERROR: Result item template not found','error');return} 10results.forEach(function(result,index){try{const html=typeof Mustache!=='undefined'?Mustache.render(template,result):renderTemplate(template,result);$container.append(html);addDebugLog('Appended result '+index+': '+result.title)}catch(error){addDebugLog('Error appending result '+index+': '+error.message,'error')}});lazyLoadImages();addDebugLog('Results appended successfully')} 11function updatePagination(data){const $pagination=$('#results-pagination');const $loadMore=$('#load-more');const $currentPage=$('#pagination-current');const $totalPages=$('#pagination-total');$currentPage.text(data.page);$totalPages.text(data.total_pages);if(window.wpImmoSearchState.hasMoreResults){$pagination.show();$loadMore.show()}else{$loadMore.hide();if(data.total_pages<=1){$pagination.hide()}} 12addDebugLog('Pagination updated - page '+data.page+' of '+data.total_pages)} 13function updateResultCounts(total,page,totalPages){const $resultCountNumber=$('#results-count-number');$resultCountNumber.text('('+total+')');addDebugLog('Updated result counts: '+total+' total results')} 14function toggleMapView(){const $mapContainer=$('#wp-immo-map-container');if($mapContainer.is(':visible')){$mapContainer.slideUp(300);addDebugLog('Map hidden')}else{$mapContainer.slideDown(300);addDebugLog('Map shown');if(window.wpImmoMap&&window.wpImmoMap.invalidateSize){setTimeout(()=>{window.wpImmoMap.invalidateSize();addDebugLog('Map size invalidated')},350)}}} 15function showNoResults(){const $container=$('#results-container');const $noResults=$('#no-results-message');$container.empty();if($noResults.length>0){$noResults.show()}else{$container.html('<div class="no-results"><p>Keine Immobilien gefunden. Bitte passen Sie Ihre Suchkriterien an.</p></div>')} 16addDebugLog('No results message displayed')} 17window.wpImmoSearchResults={initialize:initializeSearchResults,initializeLayout:initializeLayout,initializeSorting:initializeSorting,renderResults:renderResults,appendResults:appendResults,updatePagination:updatePagination,updateResultCounts:updateResultCounts,toggleMapView:toggleMapView,showNoResults:showNoResults};$(document).ready(function(){if(typeof window.wpImmoSearchUtils!=='undefined'){initializeSearchResults();initializeLayout();initializeSorting()}})})(jQuery)
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.