1(()=>{var H=a=>{let c=`; ${document.cookie}`.split(`; ${a}=`);return c.length===2?c.pop().split(";").shift():null},V=(a,o)=>{document.querySelectorAll(`.vote-button[data-postid="${o}"]`).forEach(r=>{r.dataset.option===a?r.classList.add("active"):r.classList.remove("active")})},U=a=>{let o=H(`user_voted_${a}`);o&&V(o,a)},_={},z=(a,o)=>{if(_[o])return Promise.resolve();_[o]=!0;let r=`/${window.location.pathname.split("/")[1]}`;return fetch(`${window.location.origin}${r}/wp-json/kumppanisisallot/vote/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({option:a,post_id:o})}).then(u=>u.json()).then(()=>{V(a,o),document.cookie=`user_voted_${o}=${a}; path=/`}).catch(u=>{console.error("Error:",u)}).finally(()=>{setTimeout(()=>{_[o]=!1},2e3)})},R=()=>{document.querySelectorAll(".vote-button:not(.initialized)").forEach(o=>{let{option:c,postid:r}=o.dataset;o.addEventListener("click",()=>{z(c,r)}),o.classList.add("initialized"),U(r)})},N={init:R};var I={digitalData:{pageInstanceID:"",version:{almaVersion:"2.3",specificationVersion:"1.0"},product:[{productInfo:{organization:{organizationName:""},xandrLineItemIds:[]}}],page:{pageInfo:{pageID:"",sysEnv:"responsive",pageTitle:"",language:"fi-FI",geoRegion:"FI",publisher:"",locationProtocol:document.location.protocol.slice(0,-1),issueDate:"",locationHost:"",locationPathName:"",locationHref:"",referrer:document.referrer},category:{primaryCategory:"",pageType:"article",tags:[]},attributes:{environment:"",userAgentHeader:navigator.userAgent,contentCharge:"free",content:{cid:""}}}},pushStateOverride(){let a=window.history.pushState;window.history.pushState=function(o,c,r){a.call(window.history,o,c,r);let u=new Event("pushState");window.dispatchEvent(u)}},getPostIdFromClassName(a){let o=a.match(/post-(\d+)/);return o?o[1]:null},updateDigitalData(a,o){if(a){let{digital_data:c,postTitle:r,url:u,publisher:f,locationHost:m,locationPathName:x,issueDate:B,tags:l,authors:b,organizationName:D,xandrLineItemIds:A}=a;if(c){let{prefix:k,pageID:w,environment:S,primaryCategory:p}=c;Object.assign(this.digitalData,{pageInstanceID:`${w}_${k}_${S}`||"",page:{pageInfo:{pageID:w,pageTitle:r,locationHost:m,locationHref:u,locationPathName:x,publisher:f,issueDate:B},category:{primaryCategory:p,tags:l},attributes:{environment:S,authors:b,content:{cid:w}}},product:[{productInfo:{organization:{organizationName:D},xandrLineItemIds:A||[]}}]})}else console.error("digitalDataFromResponse is undefined")}else console.error("data is undefined");typeof o=="function"&&o()},currentPostId:null,isLoading:!1,hasMorePosts:!0,loadedPostsIds:[],observer:null,fetchedPostsCount:0,fetchNextPost(a){window.location.search.includes("preview=true")||window.location.search.includes("preview=1")||a.forEach(c=>{if(c.isIntersecting&&this.currentPostId&&!this.isLoading&&this.hasMorePosts&&this.fetchedPostsCount<10){this.isLoading=!0,this.observer.unobserve(c.target);let r=c.target,u=r,f=r.closest(".load-more-container");if(f){let l=f.nextElementSibling;l&&l.querySelector(".supersisalto-showcase")&&(u=l)}let m=document.createElement("div");m.className="loading-indicator py-8 text-center",m.innerHTML=` 2 <style> 3 .loader-spinner { 4 display: inline-block; 5 width: 40px; 6 height: 40px; 7 } 8 .loader-spinner::after { 9 content: ""; 10 display: block; 11 width: 32px; 12 height: 32px; 13 margin: 4px; 14 border-radius: 50%; 15 border: 4px solid #d1d5db; 16 border-color: #d1d5db transparent #d1d5db transparent; 17 animation: loader-spinner 1.2s linear infinite; 18 } 19 @keyframes loader-spinner { 20 0% { 21 transform: rotate(0deg); 22 } 23 100% { 24 transform: rotate(360deg); 25 } 26 } 27 </style> 28 <div class="loader-spinner"></div> 29 `,u.insertAdjacentElement("afterend",m);let B=`/${window.location.pathname.split("/")[1]}`;fetch(`${window.location.origin}${B}/wp-json/kumppanisisallot/next-post/?id=${this.currentPostId}&blog_id=${window.nextPostData.blogId}
29&loaded_posts=${this.loadedPostsIds.join(",")}&template=${window.nextPostData.template}`).then(l=>l.json()).then(l=>{let b=document.querySelector(".loading-indicator");if(b&&b.remove(),l&&l.html){this.fetchedPostsCount+=1;let A=new DOMParser().parseFromString(l.html,"text/html"),k=A.querySelector(".post");if(this.updateDigitalData(l),window.digitalData=this.digitalData,window.location.search.includes("preview=true")||window.location.search.includes("preview=1")||(document.title=this.digitalData.page.pageInfo.pageTitle,l.url&&window.history.pushState({},"",l.url)),k){let E=this.getPostIdFromClassName(k.className);this.loadedPostsIds.push(E),this.currentPostId=E,k.querySelectorAll(".vote-button").forEach(P=>{P.setAttribute("data-postid",E)})}let S=document.querySelector(".post:last-child");S&&S.querySelectorAll(".vote-button").forEach(h=>{h.setAttribute("data-postid",this.currentPostId)});let p=A.querySelector(".load-more-container"),y=A.querySelector(".supersisalto-showcase"),O=y?y.closest(".content-wrapper"):null;if(p){let E=p.querySelector("aside");E&&E.classList.add("mobile__hidden");let h=null,P=document.querySelectorAll(".load-more-container");if(P.length>0){let L=P[P.length-1],q=L.nextElementSibling;q&&q.querySelector(".supersisalto-showcase")?h=q:h=L}h&&(h.insertAdjacentElement("afterend",p),O&&p.insertAdjacentElement("afterend",O)),N.init(),this.replaceImageUrls();let v=p.querySelector(".post-end-marker");v&&this.observer.observe(v)}this.loadedPostsIds.push(this.currentPostId),this.isLoading=!1}else l&&l.hasMore===!1&&(this.hasMorePosts=!1,this.isLoading=!1,this.observer.disconnect())}).catch(l=>{console.error("Error:",l);let b=document.querySelector(".loading-indicator");b&&b.remove(),this.isLoading=!1})}})},replaceImageUrls(){(window.location.href.includes("https://www.iltalehti.fi/kumppanisisallot")||window.location.href.includes("https://kumppanisisallot.fi/iltalehti"))&&document.querySelectorAll(".entry-featured-image img, .entry-content img, .sidebar-showcase img").forEach(o=>{let r=o.getAttribute("src").replace("https://www.iltalehti.fi/kumppanisisallot","https://amrkumppanit.wpenginepowered.com/iltalehti");o.setAttribute("src",r);let u=o.getAttribute("srcset");if(u){let f=u.split(",").map(m=>m.replace("https://www.iltalehti.fi/kumppanisisallot","https://amrkumppanit.wpenginepowered.com/iltalehti")).join(",");o.setAttribute("srcset",f)}})},triggerFetchNextPost(){let a={isIntersecting:!0};this.fetchNextPost([a])},init(){document.addEventListener("DOMContentLoaded",()=>{this.pushStateOverride();let a=document.querySelector(".post"),o=document.querySelector(".post-end-marker");a&&(I.currentPostId=I.getPostIdFromClassName(a.className),I.currentPostId&&I.loadedPostsIds.push(I.currentPostId),I.observer=new IntersectionObserver(c=>{if(c[0].isIntersecting){let r=document.querySelectorAll(".post");if(r.length>0){let f=r[r.length-1].className.match(/post-(\d+)/);I.currentPostId=f?f[1]:null}else console.error("No post element found");I.currentPostId&&I.fetchNextPost(c)}},{rootMargin:"100px"}),I.observer.observe(document.querySelector(".post-end-marker")))})}},F=I;!document.body.classList.contains("is-preview")&&!document.body.classList.contains("has-vev-embed")&&F.init();N.init();document.documentElement.classList.toggle("dark",!document.body.classList.contains("has-vev-embed")&&(localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches));localStorage.theme="light";localStorage.theme="dark";localStorage.removeItem("theme");document.addEventListener("DOMContentLoaded",function(){let a=document.querySelectorAll(".tab-button"),o=document.querySelectorAll(".tab-content");a.forEach(t=>{t.addEventListener("click",function(){a.forEach(e=>e.classList.remove("active","border-b-4","border-black")),o.forEach(e=>e.classList.remove("active")),o.forEach(e=>e.classList.add("hidden")),this.classList.add("active","border-b-4","border-black");let i=this.getAttribute("data-tab"),n=document.getElementById(i);n&&(n.classList.add("active"),n.classList.remove("hidden"))})});let c=document.getElementById("user-search-toggle"),r=document.getElementById("user-search-overlay"),u=document.getElementById("user-search-input"),f=document.getElementById("user-search-results"),m=[];
29if(c&&r){let t=function(){c.classList.add("active"),r.classList.add("active"),document.body.style.overflow="hidden",m.length===0&&n(),setTimeout(()=>{u.focus()},100)},i=function(){c.classList.remove("active"),r.classList.remove("active"),document.body.style.overflow="",u.value="",e(m)},n=function(){f.innerHTML='<div class="user-search-loading">Ladataan...</div>';let d=new FormData;d.append("action","get_authors_with_posts"),d.append("nonce",themeAjax.nonce),fetch(themeAjax.ajaxUrl,{method:"POST",body:d}).then(s=>s.json()).then(s=>{s.success?(m=s.data.users,e(m)):f.innerHTML='<div class="no-results">Virhe ladattaessa k\xE4ytt\xE4ji\xE4.</div>'}).catch(s=>{console.error("Error fetching users:",s),f.innerHTML='<div class="no-results">Virhe ladattaessa k\xE4ytt\xE4ji\xE4.</div>'})},e=function(d){if(d.length===0){f.innerHTML='<div class="no-results">Ei tuloksia.</div>';return}let s=[...d].sort((C,$)=>C.name.localeCompare($.name,"fi")),g="",M="";s.forEach(C=>{let $=C.name.charAt(0).toUpperCase();$!==g&&(g=$,M+=`<div class="user-letter-divider">${g}</div>`),M+=` 30 <a href="${C.url}" class="user-item"> 31 <div class="user-info"> 32 <span class="user-name">${C.name}</span> 33 </div> 34 </a> 35 `}),f.innerHTML=M};c.addEventListener("click",function(d){d.stopPropagation(),r.classList.contains("active")?i():t()}),r.addEventListener("click",function(d){d.target===r&&i()}),document.addEventListener("keydown",function(d){d.key==="Escape"&&r.classList.contains("active")&&i()}),u&&u.addEventListener("input",function(d){let s=d.target.value.toLowerCase().trim();if(s===""){e(m);return}let g=m.filter(M=>M.name.toLowerCase().includes(s));e(g)})}let x=document.getElementById("iltalehti-scroll-nav");if(x){let e=function(){n||(n=!0,requestAnimationFrame(()=>{let s=t.getBoundingClientRect().bottom<0;s!==i&&(x.classList.add("iltalehti-scroll-nav--animated"),x.classList.toggle("iltalehti-scroll-nav--visible",s),x.setAttribute("aria-hidden",String(!s)),i=s),n=!1}))},t=document.querySelector(".site-header")||document.body,i=!1,n=!1;window.addEventListener("scroll",e,{passive:!0})}let B=document.getElementById("etuovi-apua-btn"),l=document.getElementById("etuovi-apua-dropdown");B&&l&&(B.addEventListener("click",function(t){t.stopPropagation();let i=this.getAttribute("aria-expanded")==="true";this.setAttribute("aria-expanded",i?"false":"true"),l.hidden=i}),document.addEventListener("click",function(t){!t.target.closest("#etuovi-apua-btn")&&!t.target.closest("#etuovi-apua-dropdown")&&(B.setAttribute("aria-expanded","false"),l.hidden=!0)}));let b=document.getElementById("vuokraovi-apua-btn"),D=document.getElementById("vuokraovi-apua-dropdown");b&&D&&(b.addEventListener("click",function(t){t.stopPropagation();let i=this.getAttribute("aria-expanded")==="true";this.setAttribute("aria-expanded",i?"false":"true"),D.hidden=i}),document.addEventListener("click",function(t){!t.target.closest("#vuokraovi-apua-btn")&&!t.target.closest("#vuokraovi-apua-dropdown")&&(b.setAttribute("aria-expanded","false"),D.hidden=!0)}));let A=document.getElementById("etuovi-nav");if(A){let t=A.querySelectorAll(".etuovi-nav__toggle");t.forEach(function(i){i.addEventListener("click",function(){let n=this.dataset.dropdown,e=document.getElementById(n),d=this.getAttribute("aria-expanded")==="true";t.forEach(function(s){s.setAttribute("aria-expanded","false");let g=document.getElementById(s.dataset.dropdown);g&&(g.hidden=!0)}),!d&&e&&(this.setAttribute("aria-expanded","true"),e.hidden=!1)})}),document.addEventListener("click",function(i){i.target.closest("#etuovi-nav")||t.forEach(function(n){n.setAttribute("aria-expanded","false");let e=document.getElementById(n.dataset.dropdown);e&&(e.hidden=!0)})})}let k=document.getElementById("vuokraovi-nav");if(k){let t=k.querySelectorAll(".etuovi-nav__toggle");t.forEach(function(i){i.addEventListener("click",function(){let n=this.dataset.dropdown,e=document.getElementById(n),d=this.getAttribute("aria-expanded")==="true";
35t.forEach(function(s){s.setAttribute("aria-expanded","false");let g=document.getElementById(s.dataset.dropdown);g&&(g.hidden=!0)}),!d&&e&&(this.setAttribute("aria-expanded","true"),e.hidden=!1)})}),document.addEventListener("click",function(i){i.target.closest("#vuokraovi-nav")||t.forEach(function(n){n.setAttribute("aria-expanded","false");let e=document.getElementById(n.dataset.dropdown);e&&(e.hidden=!0)})})}let w=document.getElementById("etuovi-mobile-open"),S=document.getElementById("etuovi-mobile-close"),p=document.getElementById("etuovi-mobile-drawer"),y=document.getElementById("etuovi-mobile-overlay");function O(){p&&(p.classList.add("is-open"),p.setAttribute("aria-hidden","false"),y&&(y.classList.add("is-visible"),y.setAttribute("aria-hidden","false")),document.body.style.overflow="hidden",w&&w.setAttribute("aria-expanded","true"))}function E(){p&&(p.classList.remove("is-open"),p.setAttribute("aria-hidden","true"),y&&(y.classList.remove("is-visible"),y.setAttribute("aria-hidden","true")),document.body.style.overflow="",w&&w.setAttribute("aria-expanded","false"))}w&&w.addEventListener("click",O),S&&S.addEventListener("click",E),y&&y.addEventListener("click",E),document.addEventListener("keydown",function(t){t.key==="Escape"&&p&&p.classList.contains("is-open")&&E()}),p&&p.querySelectorAll(".etuovi-mobile-accordion-btn").forEach(function(t){t.addEventListener("click",function(){let i=this.getAttribute("data-panel"),n=document.getElementById(i),e=this.getAttribute("aria-expanded")==="true";p.querySelectorAll(".etuovi-mobile-accordion-btn").forEach(function(d){d.setAttribute("aria-expanded","false");let s=document.getElementById(d.getAttribute("data-panel"));s&&(s.hidden=!0)}),!e&&n&&(this.setAttribute("aria-expanded","true"),n.hidden=!1)})});let h=document.getElementById("vuokraovi-mobile-open"),P=document.getElementById("vuokraovi-mobile-close"),v=document.getElementById("vuokraovi-mobile-drawer"),L=document.getElementById("vuokraovi-mobile-overlay");function q(){v&&(v.classList.add("is-open"),v.setAttribute("aria-hidden","false"),L&&(L.classList.add("is-visible"),L.setAttribute("aria-hidden","false")),document.body.style.overflow="hidden",h&&h.setAttribute("aria-expanded","true"))}function T(){v&&(v.classList.remove("is-open"),v.setAttribute("aria-hidden","true"),L&&(L.classList.remove("is-visible"),L.setAttribute("aria-hidden","true")),document.body.style.overflow="",h&&h.setAttribute("aria-expanded","false"))}h&&h.addEventListener("click",q),P&&P.addEventListener("click",T),L&&L.addEventListener("click",T),document.addEventListener("keydown",function(t){t.key==="Escape"&&v&&v.classList.contains("is-open")&&T()}),v&&v.querySelectorAll(".etuovi-mobile-accordion-btn").forEach(function(t){t.addEventListener("click",function(){let i=this.getAttribute("data-panel"),n=document.getElementById(i),e=this.getAttribute("aria-expanded")==="true";v.querySelectorAll(".etuovi-mobile-accordion-btn").forEach(function(d){d.setAttribute("aria-expanded","false");let s=document.getElementById(d.getAttribute("data-panel"));s&&(s.hidden=!0)}),!e&&n&&(this.setAttribute("aria-expanded","true"),n.hidden=!1)})});let j=document.querySelector(".netti-header");if(j){let t=j.querySelectorAll("[data-netti-dropdown]");t.forEach(function(i){i.addEventListener("click",function(n){n.stopPropagation();let e=document.getElementById(this.dataset.nettiDropdown),d=this.getAttribute("aria-expanded")==="true";t.forEach(function(s){s.setAttribute("aria-expanded","false");let g=document.getElementById(s.dataset.nettiDropdown);g&&(g.hidden=!0)}),!d&&e&&(this.setAttribute("aria-expanded","true"),e.hidden=!1)})}),document.addEventListener("click",function(i){i.target.closest(".netti-header")||t.forEach(function(n){n.setAttribute("aria-expanded","false");let e=document.getElementById(n.dataset.nettiDropdown);e&&(e.hidden=!0)})}),document.addEventListener("keydown",function(i){i.key==="Escape"&&t.forEach(function(n){n.setAttribute("aria-expanded","false");let e=document.getElementById(n.dataset.nettiDropdown);e&&(e.hidden=!0)})})}});})();
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.