PageSourceSearch

https://www.bkkgs.de/_assets/bfed1638687f5a7f635b354abab9e36d/JavaScript/136.b19c15a49dc7695f2aa3.js

js bkkgs.de collected 2026-10-01 14:09:50 UTC 3,517 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkbkkgs=self.webpackChunkbkkgs||[]).push([[136],{4136:(e,t,r)=>{r.r(t),r.d(t,{QuizResultTeaser1:()=>s});class s{constructor(){this.selectors={container:".quiz-result-teaser--1",services:".quiz-result-teaser__services",list:".quiz-result-teaser__list",template:".quiz-result-teaser__template",fallback:".quiz-result-teaser__fallback"}}init(){document.querySelectorAll(this.selectors.container).forEach((e=>{this.render(e),this.bindMailformSubmit(e)}))}bindMailformSubmit(e){const t=e.querySelector(".quiz-result-teaser__mailform form");t&&t.addEventListener("submit",(()=>{const r=this.readServices(e),s=this.readTopIds(),i=new Map(r.map((e=>[e.id,e]))),n=s.map((e=>i.get(e))).filter(Boolean).map(((e,t)=>`${t+1}. ${e.headline||e.name} — ${e.redirectUrl||""}`.trim())).join("\n");t.querySelectorAll('input[type="hidden"], textarea').forEach((e=>{const t=e.getAttribute("name")||"";("recommendations"===t||/\[recommendations\]/.test(t)||/__recommendations$/.test(t))&&(e.value=n)}))}))}render(e){const t=this.readServices(e),r=this.readTopIds();if(!t||0===t.length||0===r.length)return void e.setAttribute("data-state","empty");const s=e.querySelector(this.selectors.list),i=e.querySelector(this.selectors.template);if(!s||!i||!("content"in i))return void e.setAttribute("data-state","empty");const n=new Map(t.map((e=>[e.id,e]))),a=document.createDocumentFragment();let o=0;r.forEach((e=>{const t=n.get(e);if(!t)return;const r=this.buildItem(i,t);r&&(a.appendChild(r),o++)})),0!==o?(s.replaceChildren(a),e.setAttribute("data-state","ready")):e.setAttribute("data-state","empty")}readServices(e){const t=e.querySelector(this.selectors.services);if(!t||!t.textContent.trim())return[];try{const e=JSON.parse(t.textContent);return Array.isArray(e)?e:[]}catch(e){return console.warn("Quiz-Result-Teaser: Service-Daten konnten nicht geparst werden:",e),[]}}readTopIds(){if("undefined"==typeof window||!window.sessionStorage)return[];try{const e=window.sessionStorage.getItem("bkkgs.quiz.topResults");if(!e)return[];const t=JSON.parse(e);return t&&Array.isArray(t.ids)?"number"==typeof t.ts&&Date.now()-t.ts>144e5?[]:t.ids.filter((e=>"string"==typeof e)):[]}catch(e){return console.warn("Quiz-Result-Teaser: sessionStorage konnte nicht gelesen werden:",e),[]}}buildItem(e,t){const r=e.content.firstElementChild?e.content.firstElementChild.cloneNode(!0):null;if(!r)return null;const s=r.matches("a")?r:r.querySelector("a");s&&t.redirectUrl&&s.setAttribute("href",t.redirectUrl),this.setTextOrRemove(r,".quiz-result-teaser__category",t.category),this.setText(r,".quiz-result-teaser__teaser-headline",t.headline||t.name),this.setText(r,".quiz-result-teaser__text",t.body),this.setText(r,".quiz-result-teaser__cta",t.linkLabel||"Zur Leistung");const i=r.querySelector(".quiz-result-teaser__image"),n=r.querySelector(".quiz-result-teaser__image img"),a=r.querySelector(".quiz-result-teaser__image source"),o=t.headline||t.name||"";if(t.image||t.imageMobile||!i)n&&(n.setAttribute("src",t.image||t.imageMobile||""),n.setAttribute("alt",o),n.setAttribute("loading","lazy")),a&&t.imageMobile?a.setAttribute("srcset",t.imageMobile):a&&!t.imageMobile&&a.remove();else{i.setAttribute("data-empty","");const e=i.querySelector("picture");e&&e.remove()}return r}setTextOrRemove(e,t,r){const s=e.querySelector(t);if(!s)return;const i=(r||"").trim();""!==i?s.textContent=i:s.remove()}setText(e,t,r){const s=e.querySelector(t);s&&(s.textContent=r||"")}}}}]);
2//# sourceMappingURL=136.b19c15a49dc7695f2aa3.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.