1"use strict";(self.webpackChunkndr_unified=self.webpackChunkndr_unified||[]).push([[2378],{8655(t,e,n){n.d(e,{Voting:()=>f});var r=n(1083),i=n(334),o=n.n(i);function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t,e,n,r,i,o,s){try{var l=t[o](s),a=l.value}catch(t){return void n(t)}l.done?e(a):Promise.resolve(a).then(r,i)}function a(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function s(t){l(o,r,i,s,a,"next",t)}function a(t){l(o,r,i,s,a,"throw",t)}s(void 0)})}}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(s,"next",{value:a(0)}),l(s,"throw",{value:a(1)}),l(s,"return",{value:a(2)}),"function"==typeof Symbol&&l(s,Symbol.iterator,{value:function(){return this}}),s;function a(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=e.call(t,o)}catch(t){l=[6,t],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}}var d="has-voted",f=function(){function t(e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,"pollId",void 0),c(this,"numAnswersAllowed",void 0),c(this,"votingElement",void 0),c(this,"votingFormElement",void 0),c(this,"thanksForParticipationElement",void 0),c(this,"votingResultsElement",void 0),c(this,"votingResultItemsWrapper",void 0),c(this,"submitButton",void 0),c(this,"errorNote",void 0),c(this,"isAfterVotingDateElement",!1),c(this,"hasVoted",!1),this.votingElement=e,this.pollId=e.dataset.id,this.votingFormElement=e.querySelector(".js-voting-form"),this.thanksForParticipationElement=e.querySelector(".js-voting-thanks-for-participation"),this.votingResultsElement=e.querySelector(".js-voting-results"),this.votingResultItemsWrapper=e.querySelector(".js-voting-result-items-wrapper"),this.submitButton=e.querySelector(".js-submit"),this.errorNote=e.querySelector(".error-note"),this.isAfterVotingDateElement=!!e.querySelector(".js-after-voting-date");var r=null===(n=this.votingFormElement)||void 0===n?void 0:n.dataset.numAnswers;this.numAnswersAllowed=r?parseInt(r):1,this._initVoting()}var e,n;return e=t,(n=[{key:"_initVoting",value:function(){return a(function(){var t;return h(this,function(e){switch(e.label){case 0:return t=o().getCookie("poll-"+this.pollId),this.hasVoted=t===d,this._initVotingForm(),[4,this._initVotingResults()];case 1:return e.sent(),[2]}})}).call(this)}},{key:"_initVotingForm",value:function(){if(this.votingFormElement){var t=this.votingFormElement.querySelector("form");this._catchUnwantedSubmitFromArdPlayer(t),this._initSubmitButton(),this._showElement(this.votingFormElement),(this.hasVoted||this.isAfterVotingDateElement)&&this._hideElement(this.votingFormElement)}}},{key:"_catchUnwantedSubmitFromArdPlayer",value:function(t){t&&t.addEventListener("submit",function(t){t.preventDefault()})}},{key:"_initVotingResults",value:function(){return a(function(){var t,e,n,i;return h(this,function(o){switch(o.label){case 0:if(this._hideElement(this.votingResultsElement),!this.hasVoted&&!this.isAfterVotingDateElement)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.A.get("/api/aggregatedPoll",{params:{pollId:this.pollId}})];case 2:return t=o.sent(),console.log("Poll results fetched successfully: ",t),console.log("response.status = ",t.status),this.hasVoted&&this._showElement(this.thanksForParticipationElement),e=t.data.pollVotingReport,n=t.data.allowedToRevealResults,e&&n&&(this._updateResults(e),this._showElement(this.votingResultsElement)),[2];case 3:return i=o.sent(),console.error("Error while fetching poll results: ",i),[3,4];case 4:return[2]}})}).call(this)}},{key:"_updateResults",value:function(t){if(t){var e=document.createDocumentFragment(),n=1,r=!0,i=!1,o=void 0;try{for(var s,l=t.accumulatedPollAnswersVotes[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var a=s.value,u=a.pollAnswerId,c=a.numberOfVotes,h=this.votingResultItemsWrapper.querySelector("#pollItem-"+u);if(h){var d=t.totalPoints>0?c/t.totalPoints*100:0,f="".concat(d.toFixed(1),"%");h.querySelector(".js-poll-answer-percentage").textContent=f,h.querySelector(".js-poll-answer-votes").textContent=c+" Stimmen",h.querySelector(".js-voting-item-rank").textContent=n,n++,e.a
1ppendChild(h)}}}catch(t){i=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}this.votingResultItemsWrapper.appendChild(e)}}},{key:"_initSubmitButton",value:function(){var t=this;this.submitButton&&this.submitButton.addEventListener("click",function(e){return a(function(){return h(this,function(t){return this._handleSubmit(),[2]})}).call(t)})}},{key:"_handleSubmit",value:function(){return a(function(){var t,e,n,i,l,a,u,c,f;return h(this,function(h){switch(h.label){case 0:if(this.errorNote,t=this.votingElement.querySelector('input[type="radio"]:checked'),e=Array.from(this.votingElement.querySelectorAll('input[type="checkbox"]:not([id^="privacy"]):checked')),n=document.querySelector("[value=accept]"),this.numAnswersAllowed>1&&e.length!==this.numAnswersAllowed)return this.errorNote.textContent="Bitte genau ".concat(this.numAnswersAllowed," Antworten auswählen."),this._showElement(this.errorNote),[2];if(null===t&&0===e.length)return this.errorNote.textContent="Bitte eine der Antworten auswählen.",this._showElement(this.errorNote),[2];if(n&&!n.checked)return this.errorNote.textContent="Bitte akzeptieren Sie die Datenschutzhinweise.",this._showElement(this.errorNote),[2];if(!(i=this.votingElement.querySelector('input[name="frc-captcha-solution"]').value))return this.errorNote.textContent="Bitte klicken Sie auf das FriendlyCaptcha.",this._showElement(this.errorNote),[2];if(i.length<25)return this.errorNote.textContent="Bitte warten Sie auf das FriendlyCaptcha.",this._showElement(this.errorNote),[2];this._hideElement(this.errorNote),h.label=1;case 1:return h.trys.push([1,3,,4]),l=[null==t?void 0:t.id].concat((m=e.map(function(t){return t.id}),function(t){if(Array.isArray(t))return s(t)}(m)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(m)||function(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}(m)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())).filter(function(t){return void 0!==t}),[4,r.A.post("/api/savePoll",{choiceIds:l,pollId:this.pollId,captchaSolution:i})];case 2:return a=h.sent(),console.log("Poll submitted successfully: ",a),201===a.status?(o().setCookie("poll-"+this.pollId,d,300),this.hasVoted=!0,this._hideElement(this.votingFormElement),this._showElement(this.thanksForParticipationElement),u=a.data.pollVotingReport,c=a.data.allowedToRevealResults,u&&c&&(this._updateResults(u),this._showElement(this.votingResultsElement))):console.error("Unexpected response status: ",a.status),[3,4];case 3:return f=h.sent(),console.error("Error while submitting poll: ",f),[2];case 4:return[2]}var m})}).call(this)}},{key:"_hideElement",value:function(t){t&&(t.blur(),t.classList.add("js-hidden"),t.setAttribute("aria-hidden",!0))}},{key:"_showElement",value:function(t){if(t){t.classList.remove("js-hidden"),t.setAttribute("aria-hidden",!1);var e=t.querySelectorAll(".image-container"),n=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value;this._reevaluateImageSize(l)}}catch(t){r=!0,i=t}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}}}},{key:"_reevaluateImageSize",value:function(t){if(t){var e=t.querySelector('source[type="image/webp"]');if(e){var n=t.offsetWidth;if(n>0)e.setAttribute("sizes","".concat(n,"px"));else{var r=e.getAttribute("sizes")||"400px";e.setAttribute("sizes",r)}}}}}])&&u(e.prototype,n),t}()}}]);
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.