PageSourceSearch

https://www.politico.eu/wp-content/themes/politico/dist/js/3866.1fed7e2015775d62f3c6.chunk.js

js politico.eu collected 2026-10-01 06:24:30 UTC 10,558 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkpolitico_theme=self.webpackChunkpolitico_theme||[]).push([[3866],{3866:function(t,e,r){r.d(e,{default:function(){return p}});r(5509),r(5223),r(321),r(1927),r(1632),r(4377),r(6771),r(2516),r(8931),r(2514),r(5694),r(2774),r(9536),r(1926),r(4483),r(6215);var a=r(1068),o=r(7723);var l=(t,{seatRadius:e,rowHeight:r},a)=>{const o=a/2;return(({seats:t,startRad:e,endRad:r,seatRadius:a,rowHeight:o,graphicHeight:l})=>{const s=l-a;let i=[],c=0;for(;i.length<t;){const n=s-o*c,d=Math.atan(a/n),u=e+d,h=r-d;if(h<=u||n<=0)break;const m=Math.atan(2.5*a/n),y=Math.min(Math.floor((h-u)/m),t-i.length-1),g=y?(h-u)/y:0;for(let t=0;t<=y;t+=1){const e=y?t*g+u:(u+h)/2;i=i.concat([{x:Math.cos(e)*(s-o*c)+l,y:l-(Math.sin(e)*(s-o*c)+a),angle:e}])}c+=1}return i})({seats:t,startRad:0,endRad:Math.PI,seatRadius:e,rowHeight:r,graphicHeight:o}).map(((t,e)=>({...t,number:e+1}))).sort(((t,e)=>e.angle-t.angle)).map((t=>{const{angle:e,...r}=t;return r}))};const s={};let i=[],c=0;const n={705:5.2,650:5.1,577:6};let d=parseFloat(660);const u={seatRadius:5.5,rowHeight:16.2},h=t=>{const e=t.parentElement.querySelector(".horseshoe-d3-geo-selection")||null,r=t.parentElement.querySelector(".majority-builder");return{geoSelect:e,majorityBuilderCount:r.querySelector(".majority-builder__count"),majorityBuilderLabel:r.querySelector(".majority-builder__label"),legendItems:t.parentElement.querySelectorAll(".eu-legend-entry")}},m=t=>{const{legendItem:e,horseshoeEl:r,majorityBuilderCount:a,majorityBuilderLabel:l}=t,s=e.getAttribute("data-party");let i=parseInt(e.getAttribute("data-seats"),10);const c=r.querySelectorAll("circle.seat").length;e.classList.toggle("active");const n=parseInt(a.innerHTML,10);i=e.classList.contains("active")?i:-i;const d=!1===!!n?i:n+i,u=d-(Math.ceil(c/2)+1);a.innerHTML=d>0?(0,o.__)(`${d} seats selected,`,"politico"):(0,o.__)("Click on a party to form a majority,","politico"),l.innerHTML=u>=0?(0,o.__)(`which is a majority of ${Math.abs(u)}`,"politico"):(0,o.__)(`${Math.abs(u)} more seats needed for majority`,"politico"),0===d?r.querySelectorAll("circle").forEach((t=>t.classList.add("active"))):0===n||Number.isNaN(n)?(r.querySelectorAll(`circle[party="${s}"]`).forEach((t=>t.classList.add("active"))),r.querySelectorAll(`circle:not([party="${s}"])`).forEach((t=>t.classList.remove("active")))):r.querySelectorAll(`circle[party="${s}"]`).forEach((t=>t.classList.toggle("active"))),e.style.backgroundColor=e.style.backgroundColor?"":"#E2EDFB",e.querySelectorAll(".circle")[0].classList.toggle("checked")},y=async t=>{0===d&&(d=t.node().getBoundingClientRect().width),t.append("circle").attr("class","pop-spinner-circle").attr("cx",d/2).attr("cy","200").attr("r","20").attr("fill","none").attr("stroke","#999999").attr("stroke-width","3").attr("stroke-linecap","round");const e=t.node().getAttribute("data-id"),r=t.node().getAttribute("data-geo"),l=t.node().getAttribute("data-elections"),n=t.node().getAttribute("data-source"),g=t.node().getAttribute("data-vote"),p=t.node().getAttribute("data-time"),b=document.getElementById(e),E=b.querySelector(".horseshoe-d3"),A=E.querySelector("svg");c=parseInt(b.querySelector(`.eu-${p}-table`).dataset.seatsTotal,10),i=[...s[p+e]];const f=y.data().filter((t=>t.x&&t.y));t.select("g.parliament-chart").remove(),t.select("circle.pop-spinner-circle").remove();const v=t.append("g").attr("class","parliament-chart").attr("transform","translate(0, 30)").attr("style","width: 100%; height: 100%; display: inline-block;");v.selectAll("circle").data(f).enter().insert("circle").attr("class","seat active").attr("party",(t=>t.party)).attr("cx",(t=>t.x)).attr("cy",(t=>t.y)).attr("number",(t=>t.number)).attr("r",u.seatRadius).attr("fill",(t=>t.color||"#AAA")),v.selectAll("circle.shadow").data(f).enter().insert("circle").attr("class","shadow").attr("party",(t=>t.party)).attr("cx",(t=>t.x)).attr("cy",(t=>t.y)).attr("r",2*u.seatRadius).attr("fill","transparent");const S=[...new Set(f.map((t=>t.party)))];v.append("circle").attr("class","pop-spinner-circle").attr("cx",d/2).attr("cy","200").attr("r","20").attr("fill","none").attr("stroke","#999999").attr("stroke-width","3").attr("stroke-linecap","round");const L=await a.Pq9(`${pollOfPollData.horseshoe}${l}/${n}/${p}/${r}/${g}`).then((t=>(v.select("circle.pop-spinner-circle").remove(),t.geo_data))).catch((t=>console.error("Error fetching data:",t)));
1S.forEach((t=>{const e=f.filter((e=>e.party===t)),r=e.sort(((t,e)=>e.number-t.number)).slice(0,L?L[t]??0:e.length),a=b.querySelector(`.eu-${p}-table tbody tr#legend-${CSS.escape(t)} .circle`);let o=a?getComputedStyle(a).backgroundColor:null;if(!o){const e=`data-${t.trim().toLowerCase()}-color`,r=E.getAttribute(e);r&&(o=r)}const l=new Set(r.map((t=>t.number)));v.selectAll("circle.seat").filter((e=>e.party===t&&l.has(e.number))).style("fill",o||"#AAA")}));const j=L?Object.values(L).reduce(((t,e)=>t+e),0):f.length;v.append("text").attr("transform",`translate(${d/2-35}, 300)`).attr("class","seat-count").text((0,o.sprintf)((0,o._n)("%s seat","%s seats",j),j)),v.append("text").attr("transform",`translate(${d/2-53}, 320)`).attr("class","seat-total").text((0,o.sprintf)((0,o._n)("(of %s seat in total)","(of %s seats in total)",c),c)),v.selectAll("circle").style("cursor","pointer").on("mouseover",(function(){const t=a.Ltv(this).attr("party");a.Ltv(A).selectAll(`circle[party="${t}"].seat`).transition().duration(50).attr("r",1.15*u.seatRadius)})).on("mouseout",(function(){const t=a.Ltv(this).attr("party");a.Ltv(A).selectAll(`circle[party="${t}"].seat`).transition().duration(50).attr("r",u.seatRadius)})),v.selectAll("circle").on("click",(function(){const{party:e}=a.Ltv(this).data()[0],r=t.node().getAttribute("data-time"),{geoSelect:o,majorityBuilderCount:l,majorityBuilderLabel:s}=h(E);if(o&&"EU"!==o.value){o.value="EU";const t=E.querySelector("svg");t.setAttribute("data-geo","EU"),a.Ltv(t).call(y)}const i=E.parentElement.querySelector(`.eu-${r}-table tbody tr#legend-${CSS.escape(e)}`);m({legendItem:i,horseshoeEl:E,geoSelect:o,majorityBuilderCount:l,majorityBuilderLabel:s})}))};y.width=t=>(isNaN(t)||(d=parseFloat(t)),y),y.data=t=>{const e=document.querySelectorAll(".horseshoe-d3");i.forEach((t=>{const r=t.party.trim().toLowerCase();e.forEach((e=>{const a=e.getAttribute(`data-${r}-color`);a&&(t.color=a)}))}));const r=["Theleft","GUENGL","GREENSEFA","GreensEFA","SD","ALDE","Renew","RE","EPP","ECR","ID","PfE","PatriotsforEurope","Patriots","ESN","ENF","NI","NA","NEW","NUPES","NFP","ENS","LR","RN","Other"];if(i.sort(((t,e)=>r.indexOf(t.party)-r.indexOf(e.party))),i=i.reduce(((t,e)=>{const{seats:r=0,x:a,y:o,...l}=e;return[...t,...Array(r).fill(l)]}),[]),t)return i=t.map((({x:t,y:e,...r})=>r)),y;if(d<=0||i.length<=0)return i;if(i.every((t=>t.x&&t.y)))return i;const a=i.length;u.seatRadius=n[c]||5.5;return l(a,u,d).forEach(((t,e)=>{i[e]={...i[e],...t}})),i};const g=t=>{const{legendItems:e,majorityBuilderCount:r,majorityBuilderLabel:a}=t;r.innerHTML="",a.innerHTML=(0,o.__)("Click on a party to form a majority","politico"),e.forEach((t=>{t.classList.remove("active"),t.style.backgroundColor="",t.querySelectorAll(".circle")[0].classList.remove("checked")}))};var p=()=>{const t=document.querySelectorAll(".horseshoe-wrapper");t.length&&t.forEach((t=>{const e=t.querySelector(".horseshoe-d3"),r=t.id,o=e.getAttribute("data-code"),l=e.getAttribute("data-geo"),i=e.getAttribute("data-time"),c=e.getAttribute("data-source"),n=(t=>{const{uniqueId:e,dataElections:r,dataSource:a,dataCode:o,dataGeo:l,dataTime:s,dataVote:i}=t,c=window.matchMedia("screen and (max-width: 768px)").matches?300:380,n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("width",660),n.setAttribute("height",c),n.setAttribute("viewBox",`0 0 660 ${c}`),n.setAttribute("style",`width: 100%; height: ${c-40}px; display: inline-block;`),n.setAttribute("data-id",e),n.setAttribute("data-code",o),n.setAttribute("data-geo",l),n.setAttribute("data-time",s),n.setAttribute("data-source",a),n.setAttribute("data-elections",r),n.setAttribute("data-vote",i),n})({uniqueId:r,dataElections:e.getAttribute("data-elections"),dataSource:c,dataCode:o,dataGeo:l,dataTime:i,dataVote:e.getAttribute("data-vote")});e.appendChild(n);const d=e.parentElement.querySelectorAll(".horseshoe-d3-time-selection span"),{geoSelect:u,majorityBuilderCount:p,majorityBuilderLabel:b,legendItems:E}=h(e);(t=>{const{horseshoeEl:e,timeSelect:r,uniqueId:a}=t;r.forEach((t=>{const r=t.getAttribute("data-time"),o=e.parentElement.querySelectorAll(`.eu-${r}-table .eu-legend-entry`);let l=[],i=0;const c=o.length,n=parseInt(e.parentElement.querySelector(`.eu-${r}-table`).dataset.seatsTotal,10);
1if(o.forEach((t=>{const e=+t.getAttribute("data-seats");i+=e,l.push({seats:e,party:t.getAttribute("data-party"),color:"#D1D1D1"})})),!i)return l=l.map((t=>(t.seats=Math.round(n/c),t))),void(s[r+a]=l);if(i<n){const t=Math.floor(n-i);l[l.length-1].seats+=t}s[r+a]=l}))})({horseshoeEl:e,timeSelect:d,uniqueId:r}),a.Ltv(n).call(y),(t=>{const{timeSelect:e,horseshoeEl:r,majorityBuilderCount:o,majorityBuilderLabel:l,legendItems:s}=t,i=r.parentElement.querySelectorAll(".legend-table");e.forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),e.forEach((t=>{t.classList.remove("active")})),t.target.classList.add("active");const c=t.target.getAttribute("data-time"),n=r.querySelector("svg");n.setAttribute("data-time",c),g({legendItems:s,majorityBuilderCount:o,majorityBuilderLabel:l}),i.forEach((t=>{t.classList.contains(`eu-${c}-table`)?t.classList.remove("hide"):t.classList.add("hide")})),a.Ltv(n).call(y)}))}))})({timeSelect:d,horseshoeEl:e,majorityBuilderCount:p,majorityBuilderLabel:b,legendItems:E}),(t=>{if(!t.geoSelect)return;const{geoSelect:e,horseshoeEl:r,majorityBuilderCount:o,majorityBuilderLabel:l,legendItems:s}=t;e.addEventListener("change",(()=>{const t=e.value;"EU"!==t&&g({legendItems:s,majorityBuilderCount:o,majorityBuilderLabel:l});const i=r.querySelector("svg");i.setAttribute("data-geo",t),a.Ltv(i).call(y)}))})({geoSelect:u,horseshoeEl:e,majorityBuilderCount:p,majorityBuilderLabel:b,legendItems:E}),(t=>{const{legendItems:e,geoSelect:r,horseshoeEl:o,svg:l,majorityBuilderCount:s,majorityBuilderLabel:i}=t;e.forEach((t=>{t.classList.add("pointer"),t.addEventListener("click",(()=>{r&&"EU"!==r.value&&(r.value="EU",o.querySelector("svg").setAttribute("data-geo","EU"),a.Ltv(l).call(y)),m({legendItem:t,horseshoeEl:o,majorityBuilderCount:s,majorityBuilderLabel:i})}))}))})({legendItems:E,geoSelect:u,horseshoeEl:e,svg:n,majorityBuilderCount:p,majorityBuilderLabel:b})}))}}}]);

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.