PageSourceSearch

https://www.bmas.de/static/releases/1403ea0b/public/chunks/pp-question-answer-flow-81gMAbdV.js

js bmas.de collected 2026-10-09 21:41:10 UTC 10,728 bytes, 77 lines download raw bytes

1import{i as t,g as e,A as i,b as s,e as n,c as r,t as o,a,E as d,p as l,q as c,r as h,u as p}from"./pp-accordion-BxQiBdeL.js";import{r as u,n as g}from"./pp-facet-dropdown-D9X7x_dO.js";import{B as v,d as f}from"./pp-highcharts-BYJsNAfN.js";let _=class extends t{static get properties(){return{answerId:{attribute:"answer-id",type:String},srOnly:{attribute:"sr-only",type:Boolean}}}constructor(){super(),this.srOnly=!1,this._children=e(this,["html-collection","pp-headline","pp-answer","pp-image"])}get answerImage(){return this._children?.["pp-image"]?s`
2                <div class="relative h-93 w-82 mt-10 mb-20 mx-auto">
3                    <div class="absolute -top-10 h-93 w-82 mx-auto">
4                        ${this._children?.["pp-image"]}
5                    </div>
6                </div>
7            `:i}get headlineClassMap(){return{"sr-only":this.srOnly}}get footer(){const t=this._children?.["pp-answer"];return t?s`
8                <div class="container bg-module-bg-1">
9                    <div class="row justify-center">
10                        <div class="col-8 border-line-1 border-b-2 mb-40"></div>
11                    </div>
12                </div>
13                ${t}`:i}render(){return s`
14            <div class="relative mx-breakout w-screen">
15                <div class="container bg-module-bg-1">
16                    <div class="row justify-center">
17                        <div class="col-12 lg:col-10 lg:px-120 pb-40 text-center text-text-1">
18                            ${this.answerImage}
19                            <div class="mb-40 typ-heading-3 lg:typ-heading-2 word-wrap ${n(this.headlineClassMap)}">
20                                ${this._children?.["pp-headline"]}
21                            </div>
22                            <div class="typ-body-2 lg:typ-body-1">
23                                <div class="s-editor s-editor--flow">
24                                    ${this._children?.["html-collection"]}
25                                </div>
26                            </div>
27                        </div>
28                    </div>
29                </div>
30            </div>
31            ${this.footer}
32        `}createRenderRoot(){return this}};customElements.define("pp-answer",_);const w=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));class b extends t{static get properties(){return{questionId:{type:String,attribute:"question-id"},first:{type:Boolean}}}constructor(){super(),this._children=e(this,["pp-image","pp-headline","pp-text","pp-tooltip","pp-list-buttons","pp-list-radios","pp-input","pp-button"])}get spacingClassMap(){return{"pt-40":this.first}}get questionImage(){return this._children?.["pp-image"]?s`
33            <div class="relative h-93 w-82 mt-10 mb-20 mx-auto">
34                <div class="absolute -top-10 h-93 w-82 mx-auto">
35                    ${this._children?.["pp-image"]}
36                </div>
37            </div>
38        `:null}get inputWithButton(){const t=this._children?.["pp-input"],e=this._children?.["pp-button"];return t&&e?s`
39                <div class="flex flex-wrap items-start justify-around text-center">
40                    ${t}
41                    ${e}
42                </div>
43            `:i}render(){return s`
44            <div class="relative mx-breakout w-screen">
45                <div class="container bg-module-bg-1">
46                    <div class="row justify-center">
47                        <div class="${n(this.spacingClassMap)} col-12 lg:col-10 lg:px-120 pb-40 text-center text-text-1">
48                            ${this.questionImage}
49                            <div class="mb-40 typ-heading-3 lg:typ-heading-2 word-wrap flex justify-center items-center">
50                                ${this._children?.["pp-headline"]}
51                                ${this._children?.["pp-tooltip"]}
52                            </div>
53                            <div class="mb-40 typ-body-2 lg:typ-body-1">
54                                ${this._children?.["pp-text"]}
55                            </div>
56                            <div class="s-form text-left typ-body-2 lg:typ-body-1">
57                                ${this._children?.["pp-list-radios"]}
58                                ${this._children?.["pp-list-buttons"]}
59                                ${this.inputWithButton}
60                            </div>
61                        </div>
62                        <div class="col-8 border-line-1 border-b-2 mb-40"></div>
63                    </div>
64                </div>
65            </div>
66        `}createRenderRoot(){return this}}customElements.define("pp-question",b);const $=Object.freeze(Object.defineProperty({__proto__:null,default:b},Symbol.toStringTag,{value:"Module"})),m=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const s of i)s._$AO?.(e,!1),m(s,e);return!0},y=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},C=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),S(e)}};function x(t){void 0!==this._$AN?(y(this),this._$AM=t,C(this)):this._$AM=t}function A(t,e=!1,i=0){const s=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size)if(e)if(Array.isArray(s))for(let r=i;r<s.length;r++)m(s[r],!1),y(s[r]);else null!=s&&(m(s,!1),y(s));else m(this,t)}const S=t=>{t.type==o.CHILD&&(t._$AP??=A,t._$AQ??=x)};class O extends r{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),C(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(m(this,t),y(this))}setValue(t){if(u(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class q{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class j{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}}const E=t=>!g(t)&&"function"==typeof t.then,N=1073741823;const T=a(class extends O{constructor(){super(...arguments),this._$Cwt=N,this._$Cbt=[],this._$CK=new q(this),this._$CX=new j}render(...t){return t.find(t=>!E(t))??d}update(t,e){const i=this._$Cbt;let s=i.length;this._$Cbt=e;const n=this._$CK,r=this._$CX;this.isConnected||this.disconnected();for(let o=0;o<e.length&&!(o>this._$Cwt);o++){const t=e[o];if(!E(t))return this._$Cwt=o,t;o<s&&t===i[o]||(this._$Cwt=N,s=0,Promise.resolve(t).then(async e=>{for(;r.get();)await r.get();const i=n.deref();if(void 0!==i){const s=i._$Cbt.indexOf(t);s>-1&&s<i._$Cwt&&(i._$Cwt=s,i.setValue(e))}}))}return d}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}});class D extends t{static get properties(){return{configJson:{type:String,attribute:"config-json"},configJsonData:{type:Object,attribute:"config-json-data"},errorText:{type:String,attribute:"error-text"},loadingText:{type:String,attribute:"loading-text"},dataStore:{type:String,attribute:"data-store"}}}constructor(){super(),this.errorText="Die Verbindung ist unterbrochen. Bitte versuchen sie es später noc
66hmal.",this.loadingText="Laden der Daten...",this._children=e(this,["pp-question","pp-answer","pp-headline","pp-allowance-calculator"])}connectedCallback(){super.connectedCallback(),this.boundButtonClickHandler=this.updateFlowOnEvent.bind(this),this.addEventListener(v,this.boundButtonClickHandler),this.addEventListener(f,this.rerenderFlowOnEvent),this.dataStore&&(window[this.dataStore]={})}disconnectedCallback(){this.removeEventListener(v,this.boundButtonClickHandler),this.removeEventListener(f,this.rerenderFlowOnEvent),super.disconnectedCallback()}getValueForAnswer(t){const{id:e,text:i}=t;if(e&&i){const t=this.configData.questions.find(t=>t.id===e).options.find(t=>t.text===i).value??i;return"input"===t?window[this.dataStore][e]||null:t}return null}storeAnswer(t){const{dataStore:e}=this,{detail:i}=t;i.customEventDetail.startsWith(e)&&(window[e][i.id]=t.type===f?i.value:this.getValueForAnswer(i))}rerenderFlowOnEvent(t){this.dataStore&&this.storeAnswer(t);const e=this.returnQuestion(t.detail.id);this.appendStep(e,t.detail.id)}updateFlowOnEvent(t){this.dataStore&&this.storeAnswer(t);const e=this.searchQuestion(t.detail.id),i=this.findNextStep(e,t.detail.text);if("question"===i.step){const e=this.returnQuestion(i.id);this.appendStep(e,t.detail.id)}if("answer"===i.step){const e=this.returnAnswer(i.id);this.appendStep(e,t.detail.id)}}searchQuestion(t){const e=l(e=>e.id===t,this.configData.questions);return 1===e.length?e[0]:null}findNextStep(t,e){const i=l(t=>t.text===e,t.options);return 1===i.length?i[0].nextQuestion?{step:"question",id:i[0].nextQuestion}:{step:"answer",id:i[0].finalAnswer}:null}returnQuestion(t){const e=l(e=>e.getAttribute("question-id")===t,this._children["pp-question"]);return 1===e.length?e[0]:null}get answers(){return this._children["pp-answer"]?Array.isArray(this._children["pp-answer"])?this._children["pp-answer"]:[this._children["pp-answer"]]:[]}returnAnswer(t){const e=this._children["pp-allowance-calculator"]?[...this.answers,this._children["pp-allowance-calculator"]]:this.answers,i=l(e=>e.getAttribute("answer-id")===t,e);return 1===i.length?i[0]:null}appendStep(t,e){const i=this.renderRoot.querySelector(`[question-id=${e}]`),s=i.parentNode.children,n=c(t=>t.getAttribute("question-id")===e,s),r=h(l)((t,e)=>!(!(e>n)||"PP-QUESTION"!==t.tagName&&"PP-ANSWER"!==t.tagName&&"PP-ALLOWANCE-CALCULATOR"!==t.tagName),s);p(t=>i.parentNode.removeChild(t),r),i.parentNode.appendChild(t);const o=t.getBoundingClientRect();window.scrollTo(0,o.top+window.scrollY-140)}renderFlow(){const t=this.configData.questions[0].id,e=this.returnQuestion(t);return e.setAttribute("first",!0),s`
67            <div class="mb-64 lg:mb-40">
68                <div class="sr-only">
69                    ${this._children["pp-headline"]}
70                </div>
71                ${e}
72            </div>
73            `}async retrieveData(){try{const t=this.configJsonData?this.configJsonData:await this.fetchConfig();return this.classList.remove("hidden"),this.configData=t,this.renderFlow()}catch(t){return s`
74            <p>${this.errorText}</p>
75        `}}async fetchConfig(){const t=await fetch(this.configJson);if(!t.ok)throw new Error("Error fetching data!");return t.json()}render(){return s`
76            ${T(this.retrieveData(),s`<p>${this.loadingText}</p>`)}
77        `}createRenderRoot(){return this}}customElements.define("pp-question-answer-flow",D);const k=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"}));export{w as a,k as b,$ as q};

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.