PageSourceSearch

https://www.aifs.de/hubfs/hub_generated/template_assets/1/10814086…/1790159518494/template_tripfinder.min.js

js aifs.de collected 2026-09-26 01:39:33 UTC 5,592 bytes, 2 lines download raw bytes

1let hsResultsPage=function(_resultsClass){function buildResultsPage(_instance){const form=_instance.querySelector(".hs-trip-search-form"),ageField=form.querySelector('[name="age"]'),termField=form.querySelector('[name="term"]'),limitField=form.querySelector('[name="limit"]'),offsetField=form.querySelector('[name="offset"]'),portalId=form.dataset.portalId,domain=form.dataset.domain;let paramStr="",formDataGroups=[],result="",data=[],tmpData=[],changeTimer=null,wasLoaded=!1,abortcController=new AbortController,signal=abortcController.signal;const resultTemplate=_instance.querySelector(".hs-trip-search-results__template"),resultsSection=_instance.querySelector(".hs-trip-search-results__listing"),errorSection=_instance.querySelector(".hs-trip-search-results__error"),nextLink=(_instance.querySelector(".hs-trip-search-results__pagination"),_instance.querySelector(".hs-trip-search-results__next-page"));let searchParams="",gettingPrerenderData=!0;function onChange(){gettingPrerenderData=!0,offsetField.value=0,loadResults()}function onSubmit(e){e&&e.preventDefault(),resultsSection.classList.add("search-loading"),gettingPrerenderData=!1,resultsSection.innerHTML="",wasLoaded?fillResults(tmpData):loadResults()}function loadResults(){clearTimeout(changeTimer),changeTimer=setTimeout(()=>{formDataGroups=[],result="",paramStr="",termField.value="",form.querySelectorAll("select").forEach(select=>{var selected=[];for(var option of select.selectedOptions)option.disabled||selected.push(`${select.name}${option.value}`);selected.length&&formDataGroups.push(selected)}),ageField&&formDataGroups.push([ageField.checked?"o18":"u18"]),formDataGroups.length&&(result=formDataGroups.reduce((a,b)=>a.reduce((r,v)=>r.concat(b.map(w=>[].concat(v,w))),[])),paramStr=Array.isArray(result[0])?result.map(a=>`${a.join("")}x`).join("|"):result.map(a=>`${a}x`).join("|")),termField.value=paramStr,getTerm()?function(term,offset,limit){const requestUrl=`/_hcms/v3/site-search/search?portalId=${portalId}&domain=${domain}&property=html&length=SHORT&type=SITE_PAGE&q=${term}&limit=${limit}&offset=${offset}`;searchParams=requestUrl;try{abortcController.abort(),abortcController=new AbortController,signal=abortcController.signal,fetch(requestUrl,{signal:signal}).then(response=>{if(!response.ok)throw resultsSection.classList.remove("search-loading"),new Error("Server reached, error retrieving results.");return response.json()}).then(response=>{tmpData=response,fillResults(tmpData),wasLoaded||(data=response),wasLoaded=!0,resultsSection.classList.remove("search-loading")})}catch(err){console.error("Could not reach the server."),resultsSection.classList.remove("search-loading")}}(getTerm(),offsetField.value||"",getLimit()):emptyPagination()},200)}function getTerm(){return termField.value||""}function getLimit(){return limitField.value||100}function fillResults(results=tmpData){results&&(tmpData=results),document.querySelectorAll(".js-total-results").forEach(el=>{el.innerText=results.total}),gettingPrerenderData||(document.querySelectorAll(".js-total-results-submited").forEach(el=>{el.innerText=results.total}),results.total>0?(errorSection&&(errorSection.style.display="none"),results.results.forEach(function(result,i){var title,url,description,newResult;title=result.title,url=result.url,description=result.description,(newResult=document.importNode(resultTemplate.content,!0)).querySelector(".hs-trip-search-results__title").innerHTML=title,newResult.querySelector(".hs-trip-search-results__title").href=url,newResult.querySelector(".hs-trip-search-results__description").innerHTML=description||"",resultsSection.appendChild(newResult)}),function(results){if(!nextLink)return;var updatedLimit=getLimit()||results.limit;function hasNextPage(){return results.offset+results.results.length<results.total}hasNextPage()?(offsetField.value=results.page*updatedLimit+parseInt(updatedLimit),nextLink.removeAttribute("hidden","")):nextLink.setAttribute("hidden","")}(results)):(!function(){errorSection&&(errorSection.style.display="");document.querySelectorAll(".js-total-results, .js-total-results-submited").forEach(el=>{el.innerText=0})}(),emptyPagination()),resultsSection.classList.remove("search-loading"))}function emptyPagination(){nextLink&&nextLink.setAttribute("hidden","")}form.reset(),form.searchEvents={},ageField&&ageField.addEventListener("change",function(){ageField.ageFieldState=ageField.checked}),form.searchEvents.submit=onSubmit,form.searchEvents.change=onChange,form.addEventListener("submit",e=>e.preventDefault()),form.addEventListener("submit",onSubmit),form.addEventListener("reset",function(){resultsSection.classList.add("search-loading"),gettingPrerenderData=!1,resultsSection.innerHTML="",offsetField.value=0,setTimeout(()=>{ageField&&(ageField.checked=ageField.ageFieldState),loadResults()},100)}
1),form.addEventListener("change",onChange),setTimeout(()=>{onSubmit()},1e3),nextLink&&(nextLink.setAttribute("hidden",""),nextLink.addEventListener("click",function(e){e&&e.preventDefault(),resultsSection.classList.add("search-loading"),gettingPrerenderData=!1,loadResults()}))}document.querySelectorAll(_resultsClass).forEach(el=>{buildResultsPage(el)})};if(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)var resultsPages=hsResultsPage(".hs-trip-search-container");else document.addEventListener("DOMContentLoaded",function(){hsResultsPage(".hs-trip-search-container")});
2//# sourceURL=https://19617859.fs1.hubspotusercontent-eu1.net/hubfs/19617859/hub_generated/template_assets/1/108140861736/1790159518494/template_tripfinder.js

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.