PageSourceSearch

https://www.iltalehti.fi/assets/EPVElectionBarChart.c3ed7ff17.chunk.js

js iltalehti.fi collected 2026-10-01 10:13:28 UTC 16,410 bytes, 2 lines download raw bytes

vendor: 9,171 bytes, line 1
1(self.webpackChunk=self.webpackChunk||[]).push([[9818],{27916(e,t,a){var r;r=e=>(()=>{var t={540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},1113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},1601:e=>{e.exports=function(e){return e[1]}},5056:(e,t,a)=>{e.exports=function(e){var t=a.nc;t&&e.setAttribute("nonce",t)}},5072:e=>{var t=[];function a(e){for(var a=-1,r=0;r<t.length;r++)if(t[r].identifier===e){a=r;break}return a}function r(e,r){for(var i={},o=[],l=0;l<e.length;l++){var c=e[l],s=r.base?c[0]+r.base:c[0],d=i[s]||0,u="".concat(s," ").concat(d);i[s]=d+1;var m=a(u),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==m)t[m].references++,t[m].updater(f);else{var p=n(f,r);r.byIndex=l,t.splice(l,0,{identifier:u,updater:p,references:1})}o.push(u)}return o}function n(e,t){var a=t.domAPI(t);return a.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;a.update(e=t)}else a.remove()}}e.exports=function(e,n){var i=r(e=e||[],n=n||{});return function(e){e=e||[];for(var o=0;o<i.length;o++){var l=a(i[o]);t[l].references--}for(var c=r(e,n),s=0;s<i.length;s++){var d=a(i[s]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}i=c}}},5849:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(1601),n=a.n(r),i=a(6314),o=a.n(i)()(n());o.push([e.id,'.il-election-barchart-epv{--il-election-text-color: #222;--il-election-secondary-text-color: #666;--il-election-bg-color: #fff;--il-election-card-color: #eee;--il-election-link-color: #dc0000;--il-election-border-color: #ddd;--il-election-default-gray: #aeb9bc;--il-election-input-bg-color: #fff;--il-election-input-border-color: #b3b3b3;--il-election-input-text-color: #666;--il-election-hover-gray: #eee;--il-election-hover-color: #f5f5f5;--il-election-active-color: #dc0000;--il-election-active-text-color: #fff;display:flex;flex-direction:column;background-color:var(--il-election-bg-color);padding:0 14px}.il-election-barchart-epv .barchart-content{min-height:366px}.il-election-barchart-epv.article-embed .barchart-content{margin-bottom:14px;border-bottom:1px solid var(--il-election-border-color)}.il-election-barchart-epv a{text-decoration:none !important;color:var(--il-election-text-color)}.il-election-barchart-epv .barchart-container{min-height:263px}.il-election-barchart-epv .barchart-item .item-value,.il-election-barchart-epv .barchart-item .item-secondary-value{text-align:right;font-variant-numeric:tabular-nums;line-height:1}.il-election-barchart-epv .barchart-item .item-name{width:42px;line-height:1}.il-election-barchart-epv .barchart-item .item-value{width:12px;margin-right:14px}.il-election-barchart-epv .barchart-item .item-secondary-value{width:42px;margin-right:14px}@media screen and (min-width: 940px){.il-election-barchart-epv .barchart-content{min-height:337px}.il-election-barchart-epv .barchart-container{min-height:234px}.il-election-barchart-epv .barchart-item .bar{width:100%}.il-election-barchart-epv .barchart-item .item-details{flex-direction:column}.il-election-barchart-epv .barchart-item .item-value,.il-election-barchart-epv .barchart-item .item-secondary-value{text-align:center;margin:0 auto}.il-election-barchart-epv .barchart-item .item-name{width:auto;text-align:center;margin:14px 0 7px}.il-election-barchart-epv .barchart-item .item-value{width:auto;margin-bottom:7px}.il-election-barchart-epv .barchart-item .item-secondary-value{margin-right:0}}html.theme-light .il-election-barchart-epv.dark-theme-enabled{--il-election-text-color: #222;--il-election-secondary-text-color: #666;--il-election-bg-color: #fff;--il-election-card-color: #eee;--il-election-link-color: #dc0000;--il-election-border-color: #ddd;--il-election-default-gray: #aeb9bc;--il-election-input-bg-color: #fff;--il-election-input-border-color: #b3b3b3;--il-election-input-text-color: #666;--il-election-hover-gray: #eee;--il-election-hover-color: #f5f5f5;--il-election-active-color: #dc0000;--il-election-active-text-color: #fff}html.theme-dark .il-election-barchart-epv.dark-theme-enabled{--il-election-text-color: #fff;--il-election-secondary-text-color: #ccc;--il-election-bg-color: #2b2b2b;--il-election-card-color: #3f3f3f;--il-election-link-color: #ff0000;--il-election-border-color: #666;--il-election-default-gray: #aeb9bc;--il-election-input-bg-color: #2b2b2b;--il-election-input-border-color: #999;--il-election-input-text-color: #fff;--il-election-hover-gray: #666;--il-election-hover-color: #3f3f3f;--il-election-active-color: #dc0000;--il-election-active-text-color: #fff}@media(prefers-color-scheme: dark){.il-election-barchart-epv.dark-theme-enabled{--il-election-text-color: #fff;--il-election-secondary-text-color: #ccc;--il-election-bg-color: #2b2b2b;--il-election-card-color: #3f3f3f;--il-election-link-color: #ff0000;--il-election-border-color: #666;--il-election-default-gray: #aeb9bc;--il-election-input-bg-color: #2b2b2b;--il-election-input-border-color: #999;--il-election-input-text-color: #fff;--il-election-hover-gray: #666;--il-election-hover-color: #3f3f3f;--il-election-active-color: #dc0000;--il-election-active-text-color: #fff}}.barchart-item{display:flex;flex-direction:row;margin:0 0 7px;white-space:nowrap}.barchart-item:last-child{margin:0}.barchart-item .item-details{font-size:16px;font-weight:500;display:flex;flex-direction:row;align-items:center;justify-content:space-between}.barchart-item .item-name{text-transform:uppercase;margin-right:14px}.barchart-item .item-image{display:none}.barchart-item .item-value{font-weight:600;white-space:nowrap;text-align:left;margin-right:7px}.barchart-item .bar-wrapper{width:100%}.barchart-item .bar{width:var(--il-election-bar-size);height:20px;border-radius:0 4px 4px 0}@media screen and (min-width: 940px){.barchart-item{height:234px;margin:0;flex-direction:column-reverse;align-items:center}.barchart-item .item-details{font-size:18px;font-weight:600;justify-content:center;width:unset}.barchart-item .item-value,.barchart-item .item-secondary-value{font-size:16px;margin-right:0;width:unset;text-align:center}.barchart-item .item-image{display:inline-block;width:46px;height:46px;border-radius:50%;background-size:cover;margin:14px 0}.barchart-item .bar-wrapper{display:flex;flex-direction:column;height:100%;justify-content:flex-end}.barchart-item .bar{height:var(--il-election-bar-size);width:53px;border-radius:4px 4px 0 0}}.barchart-title{font-size:20px;font-weight:700;margin-bottom:14px;min-height:26px}.barchart-title span{font-weight:500}.barchart-content{box-sizing:border-box;display:flex;flex-direction:column;padding:14px 0;justify-content:center;border-top:1px solid var(--il-election-border-color);font-family:"Encode Sans Condensed",arial,sans-serif;color:var(--il-election-text-color)}.barchart-content .barchart-container{display:flex;flex-direction:column}.barchart-content .barchart-title.election-closed{text-align:center;margin-top:0}.barchart-content .barchart-link{text-align:center;color:var(--il-election-link-color);font-size:15px;font-weight:600;margin-top:14px}@media screen and (min-width: 940px){.barchart-content .barchart-container{flex-direction:row;justify-content:space-between}}@font-face{font-family:"Encode Sans Condensed";font-weight:500;src:url("https://assets.ilcdn.fi/encode-sans-condensed-v10-latin-500.woff2") format("woff2"),url("https://assets.ilcdn.fi/encode-sans-condensed-v10-latin-500.woff") format("woff");font-display:fallback}@font-face{font-family:"Encode Sans Condensed";font-weight:600;src:url("https://assets.ilcdn.fi/encode-sans-condensed-v10-latin-600.woff2") format("woff2"),url("https://assets.ilcdn.fi/encode-sans-condensed-v10-latin-600.woff") format("woff");font-display:fallback}@font-face{font-family:"Encode Sans Condensed";font-weight:700;src:url("https://assets.ilcdn.fi/encode-sans-condensed-v5-latin-700.woff2") format("woff2"),url("https://assets.ilcdn.fi/encode-sans-condensed-v5-latin-700.woff") format("woff");font-display:fallback}',""]);const l=o},5934:(e,t,a)=>{a.r(t),a.d(t,{default:()=>v});var r=a(5072),n=a.n(r),i=a(7825),o=a.n(i),l=a(7659),c=a.n(l),s=a(5056),d=a.n(s),u=a(540),m=a.n(u),f=a(1113),p=a.n(f),h=a(5849),b={};b.styleTagTransform=p(),b.setAttributes=d(),b.insert=c().bind(null,"head"),b.domAPI=o(),b.insertStyleElement=m(),n()(h.A,b);const v=h.A&&h.A.locals?h.A.locals:void 0},6314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var a="",r=void 0!==t[5];return t[4]&&(a+="@supports (".concat(t[4],") {")),t[2]&&(a+="@media ".concat(t[2]," {")),r&&(a+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),a+=e(t),r&&(a+="}"),t[2]&&(a+="}"),t[4]&&(a+="}"),a}).join("")},t.i=function(e,a,r,n,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var l=0;l<this.length;l++){var c=this[l][0];null!=c&&(o[c]=!0)}for(var s=0;s<e.length;s++){var d=[].concat(e[s]);r&&o[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}
1")),d[5]=i),a&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=a):d[2]=a),n&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=n):d[4]="".concat(n)),t.push(d))}},t}},7659:e=>{var t={};e.exports=function(e,a){var r=function(e){if(void 0===t[e]){var a=document.querySelector(e);if(window.HTMLIFrameElement&&a instanceof window.HTMLIFrameElement)try{a=a.contentDocument.head}catch(e){a=null}t[e]=a}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(a)}},7825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(a){!function(e,t,a){var r="";a.supports&&(r+="@supports (".concat(a.supports,") {")),a.media&&(r+="@media ".concat(a.media," {"));var n=void 0!==a.layer;n&&(r+="@layer".concat(a.layer.length>0?" ".concat(a.layer):""," {")),r+=a.css,n&&(r+="}"),a.media&&(r+="}"),a.supports&&(r+="}");var i=a.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,a)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},9155:t=>{t.exports=e}},a={};function r(e){var n=a[e];if(void 0!==n)return n.exports;var i=a[e]={id:e,exports:{}};return t[e](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var n={};r.r(n),r.d(n,{ILElectionBarChartEPV:()=>p});var i=r(9155),o=r.n(i);const l={dev:"https://tp.dev.vaalit.almamedia.fi",prod:"https://tp.prod.vaalit.almamedia.fi"},c=e=>{const t=e.sort((e,t)=>"Muut"===t.abbreviation||"Muut"===e.abbreviation?0:t.totalVotes-e.totalVotes),a=[...t.slice(0,9),{...t.slice(9).reduce((e,t)=>({seats:e.seats+(t.seats||0),totalVotePercent:e.totalVotePercent+(t.totalVotePercent||0),totalVotes:e.totalVotes+(t.totalVotes||0)}),{seats:0,totalVotePercent:0,totalVotes:0}),abbreviation:"Muut",color:"var(--il-election-default-gray)"}];return a.sort((e,t)=>"Muut"===e.abbreviation||"Muut"===t.abbreviation?0:t.seats===e.seats?t.totalVotes-e.totalVotes:t.seats-e.seats),a.map(e=>({name:e.abbreviation,color:e.color,value:e.seats,secondaryValue:e.totalVotePercent}))},s=({item:e,valueType:t,secondaryValueType:a,multiplier:r,imageUrl:n})=>{const{name:i,value:l,secondaryValue:c,image:s,color:d}=e,u=n&&s,m=a&&!!c&&"hidden"!==a,f="hidden"!==t;return o().createElement("div",{className:"barchart-item"},o().createElement("div",{className:"item-details"},o().createElement("div",{className:"item-name"},i),f&&o().createElement("div",{className:"item-value"},"percent"===t&&`${l.toFixed(1).replace(".",",")} %`,"integer"===t&&l),m&&o().createElement("div",{className:"item-secondary-value"},"percent"===a&&`${c.toFixed(1).replace(".",",")} %`,"integer"===a&&c),u&&o().createElement("div",{className:"item-image",style:{backgroundImage:`url(${n}/${s})`}})),o().createElement("div",{className:"bar-wrapper"},o().createElement("div",{className:"bar",style:{"--il-election-bar-size":l*r+"%",backgroundColor:d||"var(--il-election-default-gray)"}})))},d=({timeStamp:e,calculationStatusPercent:t,municipalityName:a})=>{return o().createElement("div",{className:"barchart-title"},e&&o().createElement(o().Fragment,null,a?a.toUpperCase():"KOKO MAA"," ","isFinal"===e?o().createElement("span",null,"- Tilanne tarkastuslaskennan jälkeen"):o().createElement("span",null,"- Tilanne klo ",e,!!t&&o().createElement(o().Fragment,null," ","- Äänistä laskettu"," ",100===(r=t)?"100":r.toFixed(1).replace(".",",")," %"))));var r},u=({openInNew:e,Link:t,url:a,children:r,className:n})=>{const i=e?{target:"_blank",rel:"noreferrer"}:{};return t?o().createElement(t,{className:`il-election-link ${n||""}`,to:a,openInNew:e},r):o().createElement("a",{className:`il-election-link ${n||""}`,href:a,...i},r)},m=({items:e,timeStamp:t,calculationStatus:a,Link:r,linkTo:n,openInNew:i,linkText:l,valueType:c,secondaryValueType:m,imageUrl:f,municipalityName:p})=>{if(!t)return null;if("election closed"===t)return o().createElement("div",{className:"barchart-content"},o().createElement("div",{className:"barchart-title election-closed"},o().createElement("div",{className:"municipality-name"},p),"Ensimmäiset tulokset saatavilla sunnuntaina klo 20:00"));if(void 0===a)return o().createElement("div",{className:"barchart-content"});const h=(e=>{const t=e.reduce((e,t)=>
1t.value<e?e:t.value,0);return 0===t?0:e.length?100/t:100})(e||[]);return o().createElement(u,{Link:r,url:n,openInNew:i},o().createElement("div",{className:"barchart-content"},o().createElement(d,{timeStamp:t,calculationStatusPercent:a,municipalityName:p}),o().createElement("div",{className:"barchart-container"},e?.length&&e.map(e=>o().createElement(s,{key:`barchart-item-${e.name}`,item:e,multiplier:h,secondaryValueType:m,valueType:c,imageUrl:f}))),o().createElement("div",{className:"barchart-link"},l)))},f="epv-2024",p=(h=({env:e="prod",darkThemeEnabled:t=!1,isArticle:a=!1,Link:r,linkUrl:n,openInNew:s=!1})=>{const d=(0,i.useRef)(null),[u,p]=(0,i.useState)(),[h,b]=(0,i.useState)(),[v,g]=(0,i.useState)(),x=n?decodeURIComponent(n):"/eurovaalit-2024/tulospalvelu";return(0,i.useEffect)(()=>{const t=async()=>{try{const t=await(async(e,t)=>{if(!t||!(t in l))throw new Error(`Invalid env: ${t||"undefined"}`);const a=await fetch(`${l[t]}/${e}/timestamp.json`);if(!a.ok)return"election closed";const r=await a.json(),{timestamp:n,isFinal:i}=r;return i?"isFinal":new Date(n).toLocaleTimeString("fi",{hour:"2-digit",minute:"2-digit"}).replace(".",":")})(f,e);p(t)}catch(e){console.error(e)}};return t(),d.current=setInterval(()=>{t()},6e4),()=>{d.current&&clearInterval(d.current)}},[e]),(0,i.useEffect)(()=>{(async()=>{if("election closed"!==u&&u)try{const{recordsWithOther:t,calculationStatusPercent:a}=await(async(e,t)=>{const a=await(async(e,t)=>{if(!t||!(t in l))throw new Error(`Invalid env: ${t||"undefined"}`);const a=await fetch(`${l[t]}/${e}/areas-with-voting-records.json`);if(!a.ok)throw new Error("Fetch failed");return(await a.json()).country})(e,t),{votingRecords:r,calculationStatusPercent:n}=a;return{calculationStatusPercent:n,recordsWithOther:c(r)}})(f,e);b(a),g(t)}catch(e){console.error(e)}})()},[e,u]),o().createElement("div",{className:`il-election-barchart-epv${t?" dark-theme-enabled":""}  ${a?" article-embed":""}`},o().createElement(m,{items:v,valueType:"integer",secondaryValueType:"percent",timeStamp:u,calculationStatus:h,Link:r,linkTo:x,openInNew:s,linkText:"Katso koko tilanne tulospalvelusta"}))},function(e){const[t,a]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{r(5934),a(!0)},[]),t?o().createElement(h,{...e}):null});var h;return n})(),e.exports=r(a(96540))}}]);
2//# sourceMappingURL=EPVElectionBarChart.c3ed7ff17.chunk.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.