vendor: 8,612 bytes, line 1
1(self.webpackChunk=self.webpackChunk||[]).push([[7884],{62670(e,t,n){var r;r=e=>(()=>{var t={224:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var r=n(5072),a=n.n(r),i=n(7825),o=n.n(i),l=n(7659),c=n.n(l),s=n(5056),d=n.n(s),f=n(540),m=n.n(f),p=n(1113),u=n.n(p),h=n(2731),b={};b.styleTagTransform=u(),b.setAttributes=d(),b.insert=c().bind(null,"head"),b.domAPI=o(),b.insertStyleElement=m(),a()(h.A,b);const v=h.A&&h.A.locals?h.A.locals:void 0},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]}},2731:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(1601),a=n.n(r),i=n(6314),o=n.n(i)()(a());o.push([e.id,'.il-election-barchart-1{--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-1 .barchart-content{min-height:374px}.il-election-barchart-1.article-embed .barchart-content{margin-bottom:14px;border-bottom:1px solid var(--il-election-border-color)}.il-election-barchart-1 a{text-decoration:none !important;color:var(--il-election-text-color)}.il-election-barchart-1 .barchart-container{min-height:245px}.il-election-barchart-1 .barchart-item .item-name{width:85px}.il-election-barchart-1 .barchart-item .item-value{width:52px}@media screen and (min-width: 412px){.il-election-barchart-1 .barchart-content{min-height:348px}}@media screen and (min-width: 940px){.il-election-barchart-1 .barchart-content{min-height:337px}.il-election-barchart-1 .barchart-container{min-height:234px}.il-election-barchart-1 .barchart-item .item-details{flex-direction:column-reverse}.il-election-barchart-1 .barchart-item .item-name{display:none}}html.theme-light .il-election-barchart-1.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-1.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-1.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},5056:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},5072:e=>{var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}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,f="".concat(s," ").concat(d);i[s]=d+1;var m=n(f),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==m)t[m].references++,t[m].updater(p);else{var u=a(p,r);r.byIndex=l,t.splice(l,0,{identifier:f,updater:u,references:1})}o.push(f)}return o}function a(e,t){var n=t.domAPI(t);return n.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;n.update(e=t)}else n.remove()}}e.exports=function(e,a){var i=r(e=e||[],a=a||{});return function(e){e=e||[];for(var o=0;o<i.length;o++){var l=n(i[o]);t[l].references--}for(var c=r(e,a),s=0;s<i.length;s++){var d=n(i[s]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}i=c}}},6314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,a,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],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}
1"),d[2]=n):d[2]=n),a&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=a):d[4]="".concat(a)),t.push(d))}},t}},7659:e=>{var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}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(n)}},7825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var a=void 0!==n.layer;a&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,a&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.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,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},9155:t=>{t.exports=e}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[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 n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 a={};r.r(a),r.d(a,{ILElectionBarChart1:()=>p});var i=r(9155),o=r.n(i);const l={dev:"https://images.dev.vaalit.almamedia.fi",prod:"https://images.vaalit.almamedia.fi"},c={dev:"https://tp.dev.vaalit.almamedia.fi",prod:"https://tp.prod.vaalit.almamedia.fi"},s=({item:e,valueType:t,secondaryValueType:n,multiplier:r,imageUrl:a})=>{const{name:i,value:l,secondaryValue:c,image:s,color:d}=e,f=a&&s,m=n&&!!c&&"hidden"!==n,p="hidden"!==t;return o().createElement("div",{className:"barchart-item"},o().createElement("div",{className:"item-details"},o().createElement("div",{className:"item-name"},i),p&&o().createElement("div",{className:"item-value"},"percent"===t&&`${l.toFixed(1).replace(".",",")} %`,"integer"===t&&l),m&&o().createElement("div",{className:"item-secondary-value"},"percent"===n&&`${c.toFixed(1).replace(".",",")} %`,"integer"===n&&c),f&&o().createElement("div",{className:"item-image",style:{backgroundImage:`url(${a}/${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:n})=>{return o().createElement("div",{className:"barchart-title"},e&&o().createElement(o().Fragment,null,n?n.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},f=({openInNew:e,Link:t,url:n,children:r,className:a})=>{const i=e?{target:"_blank",rel:"noreferrer"}:{};return t?o().createElement(t,{className:`il-election-link ${a||""}`,to:n,openInNew:e},r):o().createElement("a",{className:`il-election-link ${a||""}`,href:n,...i},r)},m=({items:e,timeStamp:t,calculationStatus:n,Link:r,linkTo:a,openInNew:i,linkText:l,valueType:c,secondaryValueType:m,imageUrl:p,municipalityName:u})=>{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"},u),"Ensimmäiset tulokset saatavilla sunnuntaina klo 20:00"));if(void 0===n)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(f,{Link:r,url:a,openInNew:i},o().createElement("div",{className:"barchart-content"},o().createElement(d,{timeStamp:t,calculationStatusPercent:n,municipalityName:u}),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:p}))),o().createElement("div",{className:"barchart-link"},l)))},p=(u=({env:e="prod",Link:t,isArticle:n=!1,linkUrl:r,darkThemeEnabled:a=!1,openInNew:s=!1})=>{const[d,f]=(0,i.useState)(),[p,u]=(0,i.useState)(),h=l[e],b=r?decodeURIComponent(r):"/presidentinvaali-2024/tulospalvelu/1-kierros",v="string"==typeof n?"true"===n:Boolean(n);return(0,i.useEffect)(()=>{(async()=>{const t=await(async(e,t)=>{if(!t||!(t in c))throw new Error(`Invalid env: ${t||"undefined"}`);const n=await fetch(`${c[t]}/tpv-2024-1/timestamp.json`);if(!n.ok)return"election closed";const r=await n.json(),{timestamp:a,isFinal:i}=r;return i?"isFinal":new Date(a).toLocaleTimeString("fi",{hour:"2-digit",minute:"2-digit"}).replace(".",":")})(0,e);if(u(t),"election closed"!==t)try{const t=await(async(e,t)=>{if(!t||!(t in c))throw new Error(`Invalid env: ${t||"undefined"}`);const n=await fetch(`${c[t]}/tpv-2024-1/candidates.json`);if(!n.ok)throw new Error("Fetch failed");const r=await n.json();if(Array.isArray(r))return r.sort((e,t)=>t.totalVotes-e.totalVotes);if(!("koko_maa"in r))throw new Error("Malformed response");return r.koko_maa.sort((e,t)=>t.totalVotes-e.totalVotes)})(0,e);f(t.map(e=>({name:e.lastName,value:e.totalVotePercent,image:e.image,color:e.color})))}catch(e){console.error(e)}})()},[e]),o().createElement("div",{className:`il-election-barchart-1${a?" dark-theme-enabled":""} ${v?" article-embed":""}`},o().createElement(m,{items:d,timeStamp:p,Link:t,linkTo:b,openInNew:s,linkText:"Katso koko tilanne tulospalvelusta >",imageUrl:h,valueType:"percent"}))},function(e){const[t,n]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{r(224),n(!0)},[]),t?o().createElement(u,{...e}):null});var u;return a})(),e.exports=r(n(96540))}}]); 2//# sourceMappingURL=TPVElectionBarChart1.1ab90329e.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.