1import{a as ln,b as cn}from"./chunk-6XCVJ4C4.js";import{a as rn}from"./chunk-KLSLXA54.js";import{a as an}from"./chunk-N62CHIIA.js";import{a as on}from"./chunk-RG4L74Y2.js";import{a as g,b as Xi,c as Qi,d as Zi,e as ne,f as en,g as tn,h as Re,j as sn}from"./chunk-MXPFS5GL.js";import{d as nn}from"./chunk-CZRSL6NU.js";import{a as Ki}from"./chunk-F4JR2GIT.js";import{a as b}from"./chunk-5FWKMTUW.js";import{B as P,H as Gi,K as Yi,L as Ji,a as Ii,b as xi,d as Pi,e as qi,f as Hi,g as Bi,h as te,j as R,k as ie,l as J,n as Mt,o as $i,p as Ot,q as Ui,s as Vi,u as _,v as zi,w as Wi}from"./chunk-VJGBCIFP.js";import{b as Mi,c as Oi,d as Ni,e as Fi,f as Pt,g as Di,h as Ri,i as ji}from"./chunk-XCPXRTXT.js";import{a as Nt}from"./chunk-RKBMPTEH.js";import{a as W,b as Ci,c as Ti,d as G,e as Y,f as Li,g as F,h as De,i as Si,j as Ai}from"./chunk-XJLSI5BW.js";import{a as T,c as Ei,d as ki,e as z}from"./chunk-ZOYOJ6FT.js";import{a as _i,b as yi,d as u}from"./chunk-6KHOHYTW.js";var dn=yi((ya,je)=>{(function(i){typeof define=="function"&&define.amd?define([],i):typeof je=="object"&&je.exports?je.exports=i():window.idleCallbackShim=i()})(function(){"use strict";var i,e,t,n,s=typeof window<"u"?window:typeof global!=null?global:this||{},o=s.cancelRequestAnimationFrame&&s.requestAnimationFrame||setTimeout,r=s.cancelRequestAnimationFrame||clearTimeout,a=[],l=0,c=!1,f=7,d=35,h=125,w=0,p=0,v=0,y={get didTimeout(){return!1},timeRemaining:function(){var k=f-(Date.now()-p);return k<0?0:k}},E=M(function(){f=22,h=66,d=0});function M(k){var C,N,x=99,ee=function(){var V=Date.now()-N;V<x?C=setTimeout(ee,x-V):(C=null,k())};return function(){N=Date.now(),C||(C=setTimeout(ee,x))}}function I(){c&&(n&&r(n),t&&clearTimeout(t),c=!1)}function O(){h!=125&&(f=7,h=125,d=35,c&&(I(),xt())),E()}function Ne(){n=null,t=setTimeout(Oo,0)}function Fe(){t=null,o(Ne)}function xt(){c||(e=h-(Date.now()-p),i=Date.now(),c=!0,d&&e<d&&(e=d),e>9?t=setTimeout(Fe,e):(e=0,Fe()))}function Oo(){var k,C,N,x=f>9?9:1;if(p=Date.now(),c=!1,t=null,l>2||p-e-50<i)for(C=0,N=a.length;C<N&&y.timeRemaining()>x;C++)k=a.shift(),v++,k&&k(y);a.length?xt():l=0}function vi(k){return w++,a.push(k),xt(),w}function bi(k){var C=k-1-v;a[C]&&(a[C]=null)}if(!s.requestIdleCallback||!s.cancelIdleCallback)s.requestIdleCallback=vi,s.cancelIdleCallback=bi,s.document&&document.addEventListener&&(s.addEventListener("scroll",O,!0),s.addEventListener("resize",O),document.addEventListener("focus",O,!0),document.addEventListener("mouseover",O,!0),["click","keypress","touchstart","mousedown"].forEach(function(k){document.addEventListener(k,O,{capture:!0,passive:!0})}),s.MutationObserver&&new MutationObserver(O).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));else try{s.requestIdleCallback(function(){},{timeout:0})}catch{(function(C){var N,x;if(s.requestIdleCallback=function(ee,V){return V&&typeof V.timeout=="number"?C(ee,V.timeout):C(ee)},s.IdleCallbackDeadline&&(N=IdleCallbackDeadline.prototype)){if(x=Object.getOwnPropertyDescriptor(N,"timeRemaining"),!x||!x.configurable||!x.get)return;Object.defineProperty(N,"timeRemaining",{value:function(){return x.get.call(this)},enumerable:!0,configurable:!0})}})(s.requestIdleCallback)}return{request:vi,cancel:bi}})});var Pn=yi((Da,xn)=>{"use strict";var or={datawrapper:[{id:"bn-datawrapper"}],everysport:[{id:"bn-everysport"}],expressen:[{id:"bn-expressen"}],facebook:[{id:"bn-facebook"}],fintraffic:[{id:"fintraffic-TD8hJFmm"}],flowplayer:[{id:"bn-flowplayer"}],googlemaps:[{id:"bn-googlemaps"}],googlemapsimage:[{id:"bn-googlemaps"}],googlemapsapimap:[{id:"bn-googlemaps"}],instagram:[{id:"bn-instagram"}],livesportexpressen:[{id:"bn-staylive"}],riddle:[{id:"bn-riddle"}],soundcloud:[{id:"bn-soundcloud"}],spotify:[{id:"bn-spotify"}],staylive:[{id:"bn-staylive"}],stormgeo:[{id:"stormgeo"}],sverigesradio:[{id:"bn-sverigesradio"}],ttvalkompass:[{id:"bn-TT"}],twitter:[{id:"bn-twitter"}],youtube:[{id:"bn-youtube",name:"Youtube (Google Ireland Ltd)"}],ylefielection:[{id:"yle-fi"}],vimeo:[{id:"bn-vimeo"}],bnelectioncomponents:[],election:[],ifragasatt:[],infogram:[],machforms:[],machformsreport:[],machformstipsa:[],patron:[],podspace:[],svtvalkompass:[],vercel:[]},rr=({featureEnabled:i,provider:e})=>
1{let t=or[e];return t?{isConsentRequired:i.didomi&&t.length>0,vendors:t}:null},ar=i=>i?"didomi/javascript":"module";xn.exports={didomiScriptType:ar,getConsentRequirements:rr}});Array.prototype.at||(Array.prototype.at=function(i){let e=Math.trunc(i)||0;return this[e<0?this.length+e:e]});var Tm=u(dn());window.bna??={};window.bna.debug??=!1;function hn(i,e){return`BNA:${e}:${i}`}function No(i,e){window.bna.debug&&console.log(hn(i,e))}function Fo(i,e){window.bna.debug&&console.error(hn(i,e))}var Ft={info:No,error:Fo},un=[],qe,pn=[],Dt=!1,jt,mn=!1,Rt="Event Sorting";function fn(i){for(let e of i)e?.event==="page view"&&!qe?qe=e:e?.event?.startsWith("didomi")?(Dt=Dt||e.event==="didomi-ready",un.push(e)):pn.push(e)}function Do({gtmDataLayerName:i}){return(...e)=>(Array.prototype.push.call(jt,...e),window[i].push(...e))}function Ro({bnDataLayerName:i,gtmDataLayerName:e},t){return(...n)=>{fn(n),Array.prototype.push.call(jt,...n),Dt&&qe&&(window[e].push(...un),window[e].push(qe),window[e].push(...pn),window[i].push=t,Ft.info("All required events received. Switching to normal push.",Rt))}}function gn(i){let{bnDataLayerName:e,gtmDataLayerName:t}=i;if(mn)throw new Error("Event sorting already installed! Invoke installEventSorting only once.");if(typeof e!="string"||e.trim().length===0||typeof t!="string"||t.trim().length===0)throw new TypeError("bnDataLayerName and gtmDataLayerName must be non-empty strings");if(e===t)throw new TypeError("bnDataLayerName and gtmDataLayerName must be different!");window[e]??=[],window[t]??=[],jt=window[e];let n=Do(i),s=Ro(i,n);fn(window[e]),window[e]=new Proxy(window[e],{set:function(o,r,a){return r==="push"?a===n||a===s?(o[r]=a,!0):(Ft.error("Not allowed to overwrite the data layer push method!",Rt),!1):(o[r]=a,!0)}}),window[e].push=s,Object.defineProperty(window[e],"sortedView",{get:()=>Array.from(window[t])}),mn=!0,Ft.info(`Installed successfully with bnDataLayerName: "${e}", gtmDataLayerName: "${t}"`,Rt)}var He,Be,wn=["keyup","mousemove","mouseup","popstate","pushstate","scroll","touchend","touchmove","wheel","visibilitychange"],vn;function bn({dataLayerName:i="dataLayer"}={}){vn=i,window[i]??=[],window.bna??={},window.bna.interactionTimeTracking=Object.freeze({start:jo,stop:_n})}function jo(i={}){let{interactionTimeout:e=1e4}=i;_n(!0),Be=Ho(()=>qo(i),e),wn.forEach(t=>window.addEventListener(t,yn,{passive:!0}))}function _n(i=!0){wn.forEach(e=>window.removeEventListener(e,yn)),i&&En()}function yn(i){if(i.type==="visibilitychange"&&document.visibilityState==="hidden")return En();He=He||Date.now(),Be()}function En(){Be&&Be.flush()}function qo(i={}){let e=Date.now()-He;
1He=null,window[vn].push({event:"active usage",eventParams:{pageViewId:i.pageViewId,duration:e}})}function Ho(i,e){let t,n,s,o=()=>{t=null,i.apply(n,s)},r=function(){n=this,s=arguments,clearTimeout(t),t=setTimeout(o,e)};return r.flush=()=>{t&&(clearTimeout(t),o())},r}var Bo=2;function $o(i,e,t={}){let{useCacheBuster:n=!0}=t,s=new URL(i);n&&s.searchParams.set("z",Date.now());let o=new Blob([e],{type:"application/json; charset=UTF-8"});return navigator.sendBeacon(s,o)}function Uo(){return window.navigator.userAgent}function Vo(){return window.screen?.width?{width:window.screen.width,height:window.screen.height}:void 0}function zo(){return window.document.documentElement?.clientWidth?{width:window.document.documentElement.clientWidth,height:window.document.documentElement.clientHeight}:void 0}function Wo(){return window.crypto?.randomUUID?.()}function Go(i){return new Date(i).toISOString()}function kn(){window.bna??={},window.bna.lib=Object.freeze({version:Bo,sendData:$o,getUserAgent:Uo,getScreenSize:Vo,getViewportSize:zo,getRandomUuid:Wo,timestampToIso8601:Go})}var Mo=u(g());var Yo=_i({
1"../custom-elements/modules/app-update-notice-module.js":()=>import("./app-update-notice-module-SV3YWJJX.js"),
1"../custom-elements/modules/base-embed-module.js":()=>import("./base-embed-module-46DCIPRO.js"),
1"../custom-elements/modules/bonnier-form-module.js":()=>import("./bonnier-form-module-V4FND7F5.js"),
1"../custom-elements/modules/button-module.js":()=>import("./button-module-YRPPJECO.js"),
1"../custom-elements/modules/carousel-module.js":()=>import("./carousel-module-GO44M2CZ.js"),
1"../custom-elements/modules/chatbot-module.js":()=>import("./chatbot-module-V5MQ55BQ.js"),
1"../custom-elements/modules/collapse-container-module.js":()=>import("./collapse-container-module-XELMJYPX.js"),
1"../custom-elements/modules/color-scheme-toggle-module.js":()=>import("./color-scheme-toggle-module-KDWYY6TZ.js"),
1"../custom-elements/modules/content-broker-module.js":()=>import("./content-broker-module-2HS7GJ7C.js"),
1"../custom-elements/modules/fixed-header-module.js":()=>import("./fixed-header-module-KHX4WG3F.js"),
1"../custom-elements/modules/follow-modal-module.js":()=>import("./follow-modal-module-GOYUPN4B.js"),
1"../custom-elements/modules/follow-modification-module.js":()=>import("./follow-modification-module-E6YJ7JPM.js"),
1"../custom-elements/modules/geoguessr-module.js":()=>import("./geoguessr-module-ZAINHMOD.js"),
1"../custom-elements/modules/google-maps-image-embed-module.js":()=>import("./google-maps-image-embed-module-5KQRJFQR.js"),
1"../custom-elements/modules/icon-trim-module.js":()=>import("./icon-trim-module-LAZTISOR.js"),
1"../custom-elements/modules/ifragasatt-embed-module.js":()=>import("./ifragasatt-embed-module-L6KQUBOF.js"),
1"../custom-elements/modules/iframe-embed-module.js":()=>import("./iframe-embed-module-LU4C2HVI.js"),
1"../custom-elements/modules/login-link-module.js":()=>import("./login-link-module-P4FD6KWD.js"),
1"../custom-elements/modules/machforms-embed-module.js":()=>import("./machforms-embed-module-QK3RHTP2.js"),
1"../custom-elements/modules/morreman-blob-module.js":()=>import("./morreman-blob-module-MPFGYLDJ.js"),
1"../custom-elements/modules/newsletter-button-module.js":()=>import("./newsletter-button-module-MVUOM4SZ.js"),
1"../custom-elements/modules/newsletter-widget-module.js":()=>import("./newsletter-widget-module-5AGS3P5O.js"),
1"../custom-elements/modules/reader-module.js":()=>import("./reader-module-E2DU45G3.js"),
1"../custom-elements/modules/receipt-modal-module.js":()=>import("./receipt-modal-module-XYWD4LBD.js"),
1"../custom-elements/modules/riddle-embed-module.js":()=>import("./riddle-embed-module-4G2LHHL6.js"),
1"../custom-elements/modules/search-module.js":()=>import("./search-module-BL6DQKTC.js"),
1"../custom-elements/modules/share-module.js":()=>import("./share-module-B3DFLLC7.js"),
1"../custom-elements/modules/slideshow-module.js":()=>import("./slideshow-module-AYV66GYA.js"),
1"../custom-elements/modules/stories-strip-module.js":()=>import("./stories-strip-module-VBPEKOQC.js"),
1"../custom-elements/modules/stories-strip-swipe.js":()=>import("./stories-strip-swipe-QXDYYKKT.js"),
1"../custom-elements/modules/tab-panel-module.js":()=>import("./tab-panel-module-BGTIGIZF.js"),
1"../custom-elements/modules/tapet-paywall-module.js":()=>import("./tapet-paywall-module-LCZITIBL.js"),
1"../custom-elements/modules/theme-toggler-module.js":()=>import("./theme-toggler-module-VHAXCD5I.js"),
1"../custom-elements/modules/trackable-accordion-module.js":()=>import("./trackable-accordion-module-NF7U3H3F.js"),
1"../custom-elements/modules/video-player-module.js":()=>import("./video-player-module-4W6X7FDI.js")
1});var qt={},m=({element:i,moduleFileName:e})=>{qt[e]?new qt[e](i):Yo(`../custom-elements/modules/${e}`).then(t=>{let n=t.default;typeof n=="function"?(qt[e]=n,new n(i)):console.error("The imported module is not a constructor.")}).catch(t=>{console.error("Couldn't import module:",t)})};var Jo=i=>{let e;return[].slice.call(document.querySelectorAll(".block")).forEach((t,n)=>{t===i&&(e=n)}),e},Ko=i=>{let e;return[].slice.call(i.closest(".block").querySelectorAll("[data-article-uuid]")).forEach((t,n)=>{t===i&&(e=n)}),e},Cn=i=>({articleIds:[].slice.call(i.querySelectorAll("[data-article-uuid]")).map(({dataset:t})=>t&&t.articleUuid).join(","),id:i.dataset.id,name:i.dataset.name||i.dataset.presentation||"undefined",presentation:i.dataset.presentation,segment:i.dataset.segment,type:i.dataset.type,area:i.dataset.type,index:Jo(i)}),Xo=(i,e)=>{i.forEach(t=>{if(!t.isIntersecting)return;let n=t.target;b({element:n,eventName:"block-impression",data:Cn(n)}),e.unobserve(n)})},Tn=()=>{if(((window.lclClientConfig||{}).pageType||"").toLowerCase()!=="startpage")return;let i=document.querySelectorAll(".block"),e={root:null,rootMargin:"0px",threshold:.1};if("IntersectionObserver"in window){let t=new IntersectionObserver(Xo,e);i.forEach(n=>t.observe(n))}window.addEventListener("click",t=>{let n=t.target;if(!(n instanceof HTMLElement))return;let s=n.closest("[data-article-uuid]"),o=n.closest(".block");if(!(s instanceof HTMLElement&&o instanceof HTMLElement))return;let r=s.dataset,a=Object.assign({},Cn(o),{articleInfo:{title:r.articleTitle,path:r.articlePath,id:r.articleUuid,presentation:r.articlePresentation,index:Ko(s)}});b({element:o,eventName:"block-interaction-click",data:a})})};var Qo=i=>{let e=i.target.closest(".article").getAttribute("data-uuid"),t=i.target.querySelector(".accordion__question").textContent;i.target.open&&b({element:i.target,eventName:"q-a-interaction-expand",data:{articleId:e,question:t}})},Ln=()=>{document.querySelectorAll(".article__factbox details").forEach(i=>{i.addEventListener("toggle",Qo)})};var Zo=i=>{let e=i.target.closest(".article__byline-tracking-item"),t=e.nodeName.toLocaleLowerCase(),n=i.target.closest(".article__byline-follow"),s,o,r;if(n)return;e.closest("article").classList.contains("article--opinion")&&e.parentElement.parentElement.classList.contains("article__head-avatar")?r=e.closest(".teaser__avatar").classList.contains("article__head-avatar"):r=e.closest(".article__byline-list").classList.contains("article__byline-tracking--top"),r?(s=[...e.closest("article").querySelectorAll(".article__byline-tracking--top .article__byline-tracking-item")],t==="a"?o=e.getAttribute("href"):o=e.querySelector("div > a").getAttribute("href")):r||(s=[...e.closest("article").querySelectorAll(".article__byline-tracking--bottom .article__byline-tracking-item")],t==="a"?o=e.getAttribute("href"):o=e.querySelector("div > a").getAttribute("href"));let l=s.indexOf(e)+1,c=s.length,f=e.querySelector(".article__byline-name,.article__byline-list-name").textContent,d=o.split("/")[2];b({element:i.target,eventName:"byline-link",data:{authorName:f,authorId:d,position:e.closest(".article__footer")?"bottom":"top",index:l.toString(),avatar:e.querySelector("img")?"visible":"hidden",range:c.toString(),url:window.location.origin+o,componentName:"Article byline"}})},Sn=()=>{let i=document.querySelectorAll(".article__byline-tracking-item");i&&i.forEach(e=>{e.addEventListener("click",Zo)})};var An=()=>{let i=e=>{if(e.origin==="https://cargodisplayads.com"&&e.data.message_id==="displayads_format_height"){let t=document.querySelector(`iframe[src^="https://cargodisplayads.com/${e.data.site_id}"]`);t.height=e.data.height;return}if(e.origin==="https://cargodisplayads.com"&&e.data.message_id==="displayads_ad_shown"){document.querySelector(`iframe[src^="https://cargodisplayads.com/${e.data.site_id}"]`).scrollIntoView(!0);return}if(e.data.id==="weather"){let t=document.querySelector('iframe[src^="/assets/static/weather/"]');t.height=e.data.height}if(!(e.data.isRiddle2Event&&e.data.type==="HeightChanged"))try{let t=er(e);if(!t.height)return;let n=document.querySelector(`[src^="${t.origin||e.origin}"]`)||document.querySelector('[src^="/assets/static/weather/"]');if(n&&!n.closest("lcl-iframe-embed")){let s=t.height;n.height=s,ir(n,s)}}catch(t){console.warn(t)}};window.addEventListener?window.addEventListener("message",i,!1):window.attachEvent("onmessage",i)};
1function er(i){if(typeof i.data=="string")try{return JSON.parse(i.data)}catch{}return i.data}var Ht=new Map,tr=120;function ir(i,e){let t=i.src;clearTimeout(Ht.get(t)),Ht.set(t,setTimeout(()=>{try{if(!document.body.contains(i))return;let n=i.getBoundingClientRect().width;if(n>e){i.classList.remove("ratio-portrait"),i.style.removeProperty("--aspect-ratio");return}let s=Math.round(n/e*100)/100;s&&(i.classList.add("ratio-portrait"),i.style.setProperty("--aspect-ratio",s.toString()))}finally{Ht.delete(t)}},tr))}function nr(i){let e=i.target.closest("[data-depth]"),t;if(e.tagName.toLowerCase()==="a"&&!e.getAttribute("href").startsWith("#")){let n=e.getAttribute("href");t={type:"link click",component:{name:e.getAttribute("data-title")||e.getAttribute("aria-label")},destination:{url:n.startsWith("/")?window.location.origin+n:n,type:n.includes(window.location.hostname)||n.startsWith("/")?"internal":"external"}},b({element:e,eventName:"navigation link click",data:t})}else t={type:e.getAttribute("aria-expanded")==="false"?"expand":"collapse",component:{name:e.getAttribute("data-title")}},b({element:e,eventName:"navigation interaction",data:t})}function sr(i){let e=i.target.closest("lcl-disclosetoggle").previousElementSibling,n={type:i.target.closest("lcl-disclosetoggle > button").getAttribute("aria-expanded")==="false"?"expand":"collapse",component:{name:e.getAttribute("data-title")}};b({element:e,eventName:"navigation interaction",data:n})}var In=()=>{document.querySelectorAll("[data-depth]").forEach(e=>{e.addEventListener("click",nr)}),document.querySelectorAll(".nav-menu__toggle").forEach(e=>{for(e of e.children)e.tagName.toLowerCase()==="lcl-disclosetoggle"&&e.addEventListener("click",sr)})};var Mn=u(Pn());var On=()=>{if(window._cInfo=window._cInfo||[],!T("__codnt")&&(window.lclClientConfig||{}).sifoId){window._cInfo.push({cmd:"_trackContentPath",val:(window.lclClientConfig||{}).mastertag},{cmd:"_trackCustomVar",val:{name:"__isLoggedIn",val:window.lclClientConfig.isLoggedIn||!1}},{cmd:"_trackCustomVar",val:{name:"__contentId",val:window.lclClientConfig.articleId||void 0}},{cmd:"_executeTracking"});let i=document.createElement("script");i.type=(0,Mn.didomiScriptType)(window.lclClientConfig.didomiEnabled),i.dataset.vendor="orvesto",i.defer=!0,i.src=`https://analytics.codigo.se/j/${window.lclClientConfig.sifoId}.js`;let e=document.querySelector("script");e.parentNode.insertBefore(i,e)}};var qn=-1,K=()=>qn,X=i=>{addEventListener("pageshow",e=>{e.persisted&&(qn=e.timeStamp,i(e))},!0)},L=(i,e,t,n)=>{let s,o;return r=>{e.value>=0&&(r||n)&&(o=e.value-(s??0),(o||s===void 0)&&(s=e.value,e.delta=o,e.rating=((a,l)=>a>l[1]?"poor":a>l[0]?"needs-improvement":"good")(e.value,t),i(e)))}},Qt=i=>{requestAnimationFrame(()=>requestAnimationFrame(()=>i()))},Zt=()=>{let i=performance.getEntriesByType("navigation")[0];if(i&&i.responseStart>0&&i.responseStart<performance.now())return i},oe=()=>Zt()?.activationStart??0,j=-1,Hn=new Set,Nn=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,zt=i=>{if(document.visibilityState==="hidden"){if(i.type==="visibilitychange")for(let e of Hn)e();isFinite(j)||(j=i.type==="visibilitychange"?i.timeStamp:0,removeEventListener("prerenderingchange",zt,!0))}},se=(i=!1)=>{if(i&&(j=1/0),j<0){let e=oe();j=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(n=>n.name==="hidden"&&n.startTime>=e)?.startTime)??Nn(),addEventListener("visibilitychange",zt,!0),addEventListener("prerenderingchange",zt,!0),X(()=>{setTimeout(()=>{j=Nn()})})}return{get firstHiddenTime(){return j},onHidden(e){Hn.add(e)}}},S=(i,e=-1,t,n=0,s,o,r)=>{let a=Zt(),l=a?.navigationId||0,c="navigate";return t?c=t:K()>=0?c="back-forward-cache":a&&(document.prerendering||oe()>0?c="prerender":document.wasDiscarded?c="restore":a.type&&(c=a.type.replace(/_/g,"-"))),{name:i,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:c,navigationId:n||l,navigationInteractionId:s,navigationURL:o||a?.name,navigationStartTime:r||0}},Fn=new WeakMap;function Ue(i,e){let t=Fn.get(e);return t||(t=new WeakMap,Fn.set(e,t)),t.get(i)||t.set(i,new e),t.get(i)}var Wt=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},q=(i,e,t={})=>{try{let n=i.filter(s=>PerformanceObserver.supportedEntryTypes.includes(s));if(n.length>0){let s=new PerformanceObserver(o=>{queueMicrotask(()=>{let r=o.getEntries();n.length>1&&r.sort((a,l)=>a.startTime+a.duration-(l.startTime+l.duration)),e(r)})});for(let o of n)s.observe({type:o,buffered:!0,...t});return s}}catch{}},re=i=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint=="function"&&i&&i.reportSoftNavs,Bn=(i,e)=>{if(i.set(e.navigationId,e),i.size>2){let t=i.keys().next().value;t!==void 0&&i.delete(t)}},$n=i=>{let e=!1;return()=>{e||(i(),e=!0)}},Gt=class{l},Ve=i=>{document.prerendering?addEventListener("prerenderingchange",i,!0):i()},Bt=[1800,3e3],ei=(i,e={})=>{let t=re(e);Ve(()=>{let n=Ue(e,Gt),s=se(),o,r=S("FCP"),a=q(["paint"],l=>{for(let c of l)c.name==="first-contentful-paint"&&(a.disconnect(),c.startTime<s.firstHiddenTime&&(r.value=Math.max(c.startTime-oe(),0),r.entries.push(c),r.navigationId=c.navigationId||r.navigationId,o(!0)))});a&&(o=L(i,r,Bt,e.reportAllChanges),X(l=>{r=S("FCP",-1,"back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,K()),o=L(i,r,Bt,e.reportAllChanges),Qt(()=>{r.value=performance.now()-l.timeStamp,o(!0)})})),t&&q(["soft-navigation"],l=>{l.forEach(c=>{n.l&&c.navigationId&&Bn(n.l,c);let f=Math.max((c.presentationTime||c.paintTime||0)-c.startTime,0);r=S("FCP",f,"soft-navigation",c.navigationId,c.interactionId,c.name,c.startTime),o=L(i,r,Bt,e.reportAllChanges),o(!0)})},e)})},Dn=[.1,.25],Un=(i,e={})=>{let t=se();ei($n(()=>
1{let n,s=S("CLS",0),o=Ue(e,Wt),r=(h,w,p,v,y)=>{s=S("CLS",0,h,w,p,v,y),o.i=0,n=L(i,s,Dn,e.reportAllChanges)},a=(h=!1)=>{o.i>s.value&&(s.value=o.i,s.entries=o.o),n(h)},l=h=>{a(!0),r("soft-navigation",h.navigationId,h.interactionId,h.name,h.startTime)},c=h=>{for(let w of h)w.entryType!=="soft-navigation"?o.h(w):l(w);a()},f=["layout-shift"];re(e)&&f.push("soft-navigation");let d=q(f,c);d&&(n=L(i,s,Dn,e.reportAllChanges),t.onHidden(()=>{c(d.takeRecords()),n(!0)}),X(()=>{r("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,K()),Qt(n)}),setTimeout(n))}))},Vn=0,$t=1/0,$e=0,lr=i=>{for(let e of i)e.interactionId&&($t=Math.min($t,e.interactionId),$e=Math.max($e,e.interactionId),Vn=$e?($e-$t)/7+1:0)},Yt,Rn=()=>Yt?Vn:performance.interactionCount??0,cr=()=>{"interactionCount"in performance||Yt||(Yt=q(["event"],lr,{durationThreshold:0}))},Jt=class{u=0;v=[];m=new Map;p;T;_(){return Rn()-this.u}M(){this.u=Rn(),this.v.length=0,this.m.clear()}L(e){let t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||n!==-1||e!=="soft-navigation"&&e!=="back-forward-cache"?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;let t=this.v.at(-1),n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((s,o)=>o.P-s.P),this.v.length>10){let s=this.v.splice(10);for(let o of s)this.m.delete(o.id)}this.T?.(n)}}},zn=i=>{let e="requestIdleCallback"in globalThis?1e3:0,t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState==="hidden")i();else{let s=$n(i),o=-1,r=()=>{n(o),s()};addEventListener("visibilitychange",r,{once:!0,capture:!0}),o=t(()=>{removeEventListener("visibilitychange",r,{capture:!0}),s()},{timeout:e})}},jn=[200,500],Wn=(i,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let t=se();Ve(()=>{cr();let n,s=S("INP"),o=Ue(e,Jt),r=(h,w,p,v,y)=>{o.M(),s=S("INP",-1,h,w,p,v,y),n=L(i,s,jn,e.reportAllChanges)},a=()=>{let h=o.L(s.navigationType);h&&h.P!==s.value&&(s.value=h.P,s.entries=h.entries,n())},l=h=>{a(),n(!0),r("soft-navigation",h.navigationId,h.interactionId,h.name,h.startTime)},c=(h,w=!1)=>{zn(()=>{for(let p of h)p.entryType!=="soft-navigation"?o.h(p):l(p);a(),w&&n(!0)})},f=["event","first-input"];re(e)&&f.push("soft-navigation");let d=q(f,c,{...e,durationThreshold:e.durationThreshold??40});n=L(i,s,jn,e.reportAllChanges),d&&(t.onHidden(()=>{c(d.takeRecords(),!0)}),X(()=>{r("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,K())}))})},Kt=class{p;l;h(e){this.p?.(e)}},Ut=[2500,4e3],Gn=(i,e={})=>{let t=!1,n=re(e);Ve(()=>{let s,o=se(),r=S("LCP"),a=Ue(e,Kt),l=(w,p,v,y,E)=>{r=S("LCP",-1,w,p,v,y,E),s=L(i,r,Ut,e.reportAllChanges),t=!1,w==="soft-navigation"&&(o=se(!0))},c=w=>{a.l&&w.navigationId&&Bn(a.l,w),t||s(!0),l("soft-navigation",w.navigationId,w.interactionId,w.name,w.startTime);let p=w.getLargestInteractionContentfulPaint?.();p&&f([p])},f=w=>{e.reportAllChanges||n||(w=w.slice(-1));for(let p of w){if(!p)continue;if(p.entryType==="soft-navigation"){c(p);continue}let v=0,y=[],E=p.startTime;if(p.entryType==="largest-contentful-paint")v=Math.max(p.startTime-oe(),0),a.h(p),y=[p];else if(p.entryType==="interaction-contentful-paint"){let M=p;if(!r.navigationId||"interactionId"in M&&M.interactionId!=r.navigationInteractionId)continue;E=M.largestContentfulPaint?.renderTime||0,v=Math.max(E-p.startTime,0),M.largestContentfulPaint&&(a.h(M.largestContentfulPaint),y=[M.largestContentfulPaint])}E<o.firstHiddenTime&&(r.value=v,r.entries=y,s())}},d=["largest-contentful-paint"];n&&d.push("interaction-contentful-paint","soft-navigation");let h=q(d,f);if(h){s=L(i,r,Ut,e.reportAllChanges);let w=["keydown","click","visibilitychange"],p=v=>{if(v.isTrusted&&!t){let y=r.id;zn(()=>{if(!t){if(!n){h.disconnect();for(let E of w)removeEventListener(E,p,{capture:!0})}y===r.id&&(t=!0,s(!0))}})}};for(let v of w)addEventListener(v,p,{capture:!0});X(v=>{l("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,K()),s=L(i,r,Ut,e.reportAllChanges),Qt(()=>{r.value=performance.now()-v.timeStamp,t=!0,s(!0)})})}})},Vt=[800,1800],Xt=i=>{document.prerendering?Ve(()=>Xt(i)):document.readyState!=="complete"?addEventListener("load",()=>Xt(i),!0):setTimeout(i)},Yn=(i,e={})=>{let t=re(e),n=S("TTFB"),s=L(i,n,Vt,e.reportAllChanges);Xt(()=>{let o=Zt();if(o){let r=o.responseStart;n.value=Math.max(r-oe(),0),n.entries=[o],s(!0),X(()=>{n=S("TTFB",0,"back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,K()),s=L(i,n,Vt,e.reportAllChanges),s(!0)}),t&&q(["soft-navigation"],a=>{a.forEach(l=>{l.navigationId&&(n=S("TTFB",0,"soft-navigation",l.navigationId,l.interactionId,l.name,l.startTime),n.entries=[l],s=L(i,n,Vt,e.reportAllChanges),s(!0))})},e)}})};var dr=()=>{let i=window.lclClientConfig.pageType;if(i==="StartPage")return"start";if(i==="ArticlePage")return"article"},ti={},ae=({name:i,value:e,rating:t})=>{ti[i]={name:i,value:e,rating:t}},mr=()=>{let i=JSON.stringify({metrics:Object.values(ti),"device.type":"mobile","environment.platform.name":"jalla","content.type":dr(
1)});navigator.sendBeacon("https://rum-reporter-prod.exp.bn.nr/collect",i)},ze=i=>{ti&&(i.type==="visibilitychange"&&document.visibilityState!=="hidden"||(ur(),mr()))},hr=()=>{window.addEventListener("visibilitychange",ze),window.addEventListener("pagehide",ze)},ur=()=>{window.removeEventListener("visibilitychange",ze),window.removeEventListener("pagehide",ze)},Jn=()=>{let{env:i,isDevice:e}=window.lclClientConfig;i==="production"&&e==="m"&&(Un(ae),ei(ae),Wn(ae),Gn(ae),Yn(ae),hr())};var Kn=u(g());var le=()=>new Promise(i=>window.requestAnimationFrame(()=>window.requestAnimationFrame(i))),We=(i,e,t=500)=>new Promise(n=>{let s=window.getComputedStyle(i),o,r=a=>{a.propertyName===e&&(clearTimeout(o),i.removeEventListener("transitionend",r),n())};s.getPropertyValue("transition-property").split(", ").map(a=>a.trim()).includes(e)?(o=setTimeout(n,t),i.addEventListener("transitionend",r)):n()});var pr=["a[href]","button:not([disabled])","input:not([disabled])","textarea:not([disabled])","select:not([disabled])","iframe",'[tabindex]:not([tabindex="-1"])',"[contenteditable]"],ii=pr.join(", ");function ni(i,e,t){let n;return function(){let s=this,o=arguments;clearTimeout(n),n=setTimeout(()=>{n=null,t||i.apply(s,o)},e),t&&!n&&i.apply(s,o)}}var Ge=class extends Kn.default{constructor(){return super(),this._init=this._init.bind(this),this._toggle=this._toggle.bind(this),this._toggles=new Set,this._handleResize=ni(this._handleResize,50).bind(this),this._handleFailure=this._handleFailure.bind(this),this._setClampedHeight=this._setClampedHeight.bind(this),this._makeClamped=this._makeClamped.bind(this),this._handleEscape=this._handleEscape.bind(this),this._handleFocus=this._handleFocus.bind(this),this._handleClick=this._handleClick.bind(this),this._attemptFocusFirst=this._attemptFocusFirst.bind(this),this}static get observedAttributes(){return["open"]}attributeChangedCallback(e,t,n){e==="open"&&(t===null?this._open=!0:this._open=!1)}parsedCallback(){if(window.addEventListener("resize",this._handleResize),!(this._isActivated&&!this._isInvalidated))return this.addEventListener("lcl-disclose:addtoggle",this.addToggle),this._init()}_init(){if(!(!this.clampedElement||!this.clampedElement.dataset)){if(this.clampedElement.dataset.clamped="",this._candidates=this.getCandidates(),this._clampedItems=this.getClampedItems(),this._clampedItems.length===0)return this.deactivate();this.activate()}}_handleFailure(e){console.warn(e)}disconnectedCallback(){window.removeEventListener("resize",this._handleResize)}activate(){return this._prepareTemplates(),this.addEventListener("lcl-disclose:toggle",this._toggle),this.hasAttribute("ispopup")&&(document.addEventListener("focus",this._handleFocus,!0),document.addEventListener("click",this._handleClick,!0),this.addEventListener("keyup",this._handleEscape)),window.addEventListener("pagehide",()=>{this._open=!1}),this._setClampedHeight().then(this._makeClamped).then(()=>{this._isActivated=!0}).catch(this._handleFailure)}deactivate(){return this.removeAttribute("clamped"),this.removeAttribute("open"),this.clampedElement.style.setProperty("--clamped-height","auto"),this.hasAttribute("ispopup")&&(document.removeEventListener("focus",this._handleFocus,!0),document.removeEventListener("click",this._handleClick,!0),this.removeEventListener("keyup",this._handleEscape)),this.removeEventListener("lcl-disclose:toggle",this._toggle),this._isActivated=!1,new Promise(e=>le().then(e,this._handleFailure))}addToggle(e){let t=e.target;t&&(this._toggles.add(t),e.stopPropagation())}set _clampedHeight(e){this._height=`${e}px`}get _clampedHeight(){return this._height}get clampedElement(){if(this._clampedElement)return this._clampedElement;let e=this.getAttribute("element");return e?this._clampedElement=this.querySelector(`#${e}`):this._clampedElement=this,this._clampedElement}set _releasedHeight(e){this._maxHeight=`${e}px`}get _releasedHeight(){return this._maxHeight}get _open(){return this.hasAttribute("open")}set _open(e){e?(this.dispatchEvent(new CustomEvent("lcl-disclose:open")),this._toggles.forEach(t=>
1t.dispatchEvent(new CustomEvent("lcl-disclose:open"))),this.clampedElement.style.setProperty("--clamped-height",this._releasedHeight)):(this.clampedElement.style.setProperty("--clamped-height",this._clampedHeight),this.dispatchEvent(new CustomEvent("lcl-disclose:close")),this._toggles.forEach(t=>t.dispatchEvent(new CustomEvent("lcl-disclose:close"))))}_toggle(e){e.preventDefault(),e.stopPropagation(),this.hasAttribute("open")?this.removeAttribute("open"):(this.setAttribute("open",""),We(this.clampedElement,"height").then(le).then(this._attemptFocusFirst).catch(this._handleFailure))}_handleFocus(){this.contains(document.activeElement)||this._isKeepOpenOnNavElement(document.activeElement)||this.removeAttribute("open")}_handleClick(e){e.target&&e.target instanceof Node&&(this.contains(e.target)||this._isKeepOpenOnNavElement(e.target))||this.removeAttribute("open")}_handleEscape(e){let t=e.key||e.keyCode;(t==="Escape"||t==="Esc"||t===27)&&(this.removeAttribute("open"),e.stopPropagation())}getCandidates(){return Array.from(this.clampedElement.children)}getClampedItems(){return this._candidates.filter(e=>{let t=(window.getComputedStyle(e).getPropertyValue("--clamp")||"").trim()==="on";return t?e.dataset.clamp="":e.removeAttribute("data-clamp"),t})}_setClampedHeight(){return this._clampedHeight=this.clampedElement.clientHeight,this.clampedElement.style.setProperty("--clamped-height",this._clampedHeight),le()}_makeClamped(){this.setAttribute("clamped",""),le().then(()=>{this._initiatedWidth=this.clampedElement.clientWidth,this._releasedHeight=this.clampedElement.scrollHeight}).catch(this._handleFailure)}get _isInvalidated(){return this.clampedElement.clientWidth!==this._initiatedWidth}_handleResize(){this._isInvalidated&&this.deactivate().then(this._init).catch(this._handleFailure)}_prepareTemplates(){Array.from(this.querySelectorAll(`template[data-for="${this.id}"]`)).forEach(t=>{let n=t.getAttribute("data-position"),s=t.content;n==="prepend"?this.prepend(s):this.append(s),t.remove()})}_attemptFocusFirst(){if(!(this.hasAttribute("data-focuscontrol")||this.hasAttribute("focuscontrol")))return;let e=this._clampedItems[0];if(e.matches(ii))e.focus();else{let t=e.querySelector(ii);t&&t.focus()}}_isKeepOpenOnNavElement(e){let t=this.getAttribute("data-keep-open-on-nav");return t?t.split(",").map(s=>document.querySelector(s.trim())).some(s=>s&&s.contains(e)):!1}};var Xn=u(g());var fr=6,gr={major:9,minor:0,patch:20},Ye=class extends Xn.default{parsedCallback(){this._init()}_init(){if(this.isDeprecated){let t=this.querySelector('[data-name="ios-deprecated-notice-template"]').content.cloneNode(!0);this.appendChild(t)}}get isDeprecated(){let{ssoFeature:e}=this.dataset,t=Mt({major:fr,minor:0,patch:0})===!1;return e==="true"&&(t=t||!Mt(gr)),R&&t}};var Qn=u(g());var Q=u(Ki());var Je=class extends Qn.default{constructor(){super();let{token:e}=qi()||{};this._token=e,this._hasPermission=Bi()}parsedCallback(){if(this._settingsWrapper=this.querySelector(".push-settings__settings"),!this._token){this.onInitSettingsError(new Error("No token found!"));return}this._settingsWrapper.children.length===0?this._initWrapper():this._initSettings(),this.registerCloseModalEventListener()}_initWrapper(){let e=this.dataset.defaultTab,{search:t=""}=location,n=t.includes("onboarding=true");return fetch(`/installningar/notiser?token=${this._token}&defaultTab=${e}&hasPermission=${this._hasPermission}${n?"&onboarding=1":""}`).then(s=>{if(!s.ok)throw new Error(`Failed to get settings: ${s.status}`);return s.text()}).then(s=>{let o=document.createRange().createContextualFragment(s);this._settingsWrapper.appendChild(o.firstElementChild),this._initSettings()}).catch(s=>this.onInitSettingsError(s))}_initSettings(){try{let e=["segments","subjects"];this.querySelectorAll(".tabs__tab").forEach((n,s)=>{n.addEventListener("click",()=>{window.history.replaceState(null,"",`${this.dataset.basePath}/${e[s]}`)})}),this.querySelectorAll(".push-settings__list-item").forEach(n=>{if(!(n instanceof HTMLElement))return;let s=n;s.classList.contains("push-settings__subject")?this.initSubjectSetting({setting:s}):this.initSegmentSetting({setting:s})}),this.querySelectorAll(".push-settings__permission a:not([href])").forEach(n=>
1{n.addEventListener("click",()=>{this.querySelectorAll(".push-settings__permission").forEach(s=>s.remove()),Ui()})}),this.setAttribute("initiated","true")}catch(e){this.onInitSettingsError(e)}}_trackNotficationSettingChange({id:e,type:t,title:n}){b({element:this,eventName:"push-setting-changed",data:{type:t,id:e,name:n}})}initSegmentSetting({setting:e}){let{segmentUuid:t,segmentName:n}=e.dataset,s=e.querySelector("input");if(!t||!s)throw new Error("Error in push setup!");s.addEventListener("click",()=>{(s.checked?Mi({token:this._token,id:t}):Oi({token:this._token,id:t})).then(()=>this._trackNotficationSettingChange({id:t,type:"segment",title:n})).catch(r=>this.onUpdateSettingError(r))})}initSubjectSetting({setting:e}){let{subjectId:t,subjectType:n,subjectName:s}=e.dataset,o=this._token,r=e.querySelector("input");if(!t||!r)throw new Error("Error in push setup!");r.addEventListener("click",()=>{(r.checked?Ni({token:o,id:t,type:n,filter:Q.FOLLOW_NOTIFICATION_FILTER_ALL_NEWS}):Fi({token:o,id:t,type:n})).then(()=>this._trackNotficationSettingChange({id:t,type:n,title:s})).catch(l=>this.onUpdateSettingError(l))})}showMessage(e){let t=document.querySelector(`.push-settings template[data-name="${e}"]`);if(t){let n=t.content.cloneNode(!0);this._settingsWrapper.textContent="",this._settingsWrapper.appendChild(n)}}onInitSettingsError(e){console.error(e),this.showMessage("error-unknown"),_(e)}onUpdateSettingError(e){console.error(e),_(e)}_sendOpenModificationModalEvent({subjectId:e,subjectName:t,subjectType:n,subjectFilter:s,focusAfter:o}){this.dispatchEvent(new CustomEvent(Q.FOLLOW_MODIFICATION_OPEN_EVENT_NAME,{bubbles:!0,detail:{subjectName:t,subjectId:e,subjectType:n,subjectFilter:s,focusAfter:o}}))}registerCloseModalEventListener(){document.addEventListener(ne(Q.FOLLOW_MODIFICATION_INNER_MODAL_ID),()=>{window.location.reload()})}};var Ke=class extends HTMLElement{connectedCallback(){"share"in navigator||"clipboard"in navigator?m({element:this,moduleFileName:"share-module.js"}):this.remove()}};var Zn=u(g());var ce=class extends Zn.default{parsedCallback(){this.addEventListener("bad:slotRenderEnded",this),this.addEventListener("bad:collapse",this)}handleEvent(e){let t=e.type.replace("bad:","");try{this["_on"+t](e)}catch(n){_(n)}}_onslotRenderEnded(e){if(e.target instanceof HTMLElement){if(this.badElement=this.querySelector("b-a-d"),this.preamble=this.querySelector(".ad__preamble"),this._isEmpty()){this._oncollapse();return}this.preamble&&this.preamble.removeAttribute("aria-disabled"),this.classList.add("ad--rendered"),this.badElement.removeAttribute("aria-hidden"),this._inspectEventSizes(e),this._scaleableFormat()&&this._sizesFromEvent&&(this._width===1&&this._height===1||(this.style.setProperty("--ad-slot-width",`${this._width}px`),this.style.setProperty("--ad-slot-height",`${this._height}px`)),this._setupResizeObserver(this.badElement)),Yi(this.querySelector("iframe"))}}_oncollapse(){this.classList.remove("ad--rendered"),this.classList.add("ad--hidden")}_isEmpty(){let e=this.badElement.attributes["data-ad-empty"];return e&&e.value}_inspectEventSizes(e){let[t,n]=e.detail&&e.detail.size||[];if(!(t&&n))return!1;this._width=t,this._height=n,this._sizesFromEvent=!0}_scaleableFormat(){let e=this.badElement.getAttribute("slotname");return["panorama","panorama_top","panorama_widget","outsider"].includes(e)}_setupResizeObserver(e){let t=e.firstElementChild;if(!(t&&t instanceof HTMLElement))return;let n=!1;this._rObserver=new window.ResizeObserver(s=>{s.forEach(o=>{if(n){n=!1;return}let r=o.borderBoxSize&&o.borderBoxSize.length?o.borderBoxSize[0]:o.contentRect,a=r.inlineSize||r.width||1/0,l=Math.min(this._width,a);if(this._rObserver.unobserve(this),l<this._width){let c=l/this._width;this.style.setProperty("--ad-slot-scale",`${c}`)}else this.style.removeProperty("--ad-slot-scale");n=!0,this._rObserver.observe(this)})}),this._rObserver.observe(this)}};var es=u(g());var de=class extends es.default{constructor(){super(),this.addEventListener("bad:slotRenderEnded",this),this.addEventListener("bad:collapse",this)}parsedCallback(){if(!(window.lclClientConfig||{}).adsEnabled){this.hide();return}let t=T("bad-freq-rmp")==="1",n=new URL(window.location.href).searchParams.has("google_preview");t&&!n||(this.classList.remove("ad-welcome-deprecated--hidden"),this.failSafe=setTimeout(()=>{this.showUi()},400),this.setupCloseButtonListener(),this.setupAdBlock())}disconnectedCallback(){window.initTapetPopup()}setupAdBlock(){Re().then(e=>{e&&this.hide()}).catch(()=>{})}setupCloseButtonListener(){this.addEventListener("click",e=>{e.target&&e.target instanceof Element&&e.target.closest("[data-close-trigger]")&&this.hide()})}handleEvent(e){let t=e.type.replace("bad:","");try{this["on"+t](e)}catch(n){_(n)}}oncollapse(){this.hide(),window.initTapetPopup()}onslotRenderEnded(e){((e||{}).detail||{}).isEmpty===!0&&this.hide(),this.showUi()}showUi(){this.classList.add("ad-welcome-deprecated--ui-visible")}hide(){this.classList.remove("ad-welcome-deprecated--ui-visible"),this.classList.add("ad-welcome-deprecated--hidden")}};var ts=u(g());var me=class extends ts.default{constructor(){super()}parsedCallback(){if(!(window.lclClientConfig||{}).adsEnabled){this.hide();return}let t=this.parentElement?Array.from(this.parentElement.children):[];this.badAdElements=t.filter(n=>{let s=n.getAttribute("slotname");return n.tagName.toLowerCase()==="b-a-d"&&s&&s.includes("rich_media")}),this.setupAdBlock(),window.addEventListener("bad:collapse",this)}setupAdBlock(){Re().then(e=>{e&&this.hide()}).catch(()=>{})}handleEvent(e){if(e.type==="bad:collapse"){let t=e.target.parentElement.getAttribute("slotname");
1t&&["rich_media_premium","mob_rich_media_premium"].includes(t)&&window.initTapetPopup()}}hide(){this.badAdElements&&this.badAdElements.forEach(e=>e.remove())}};var is=u(g());var si="article-flow-read-articles",Z=7,wr=3,ns=(1+Z)*(wr-1),vr=ns+Z,br=[1,4],Xe=-1,he=class extends is.default{parsedCallback(){this.initiated||(this.initiated=!0,Pi&&this._init())}_init(){let e=this.querySelector(".article");if(!e||!e.dataset)return;let{uuid:t,published:n,title:s,path:o,storyUuids:r,nativeCustomerId:a,articleType:l}=e.dataset;this.native=l==="native"||l==="native politisk",this.initialArticle={id:t,firstPublishTime:n,headline:s,linkUrl:o,articleType:l,native:this.native},this.addEventListener("lcl:article-flow-load-next-item",this),this.addEventListener("lcl:article-flow-view-this-item",this),this.addEventListener("lcl:article-flow-view-previous-item",this),this.addEventListener("lcl:article-flow-bonnier-page-view",this),this.addEventListener("lcl:article-flow-bonnier-page-view-previous",this),this.articleList=new Promise(c=>{if(this.path="top-articles-list",this.filterViewed=!0,this.loadAll=!0,this.count=vr,r){this.count=Z,this.filterViewed=!1,this.loadAll=!0;let f=r.split(",")[0];this.path=`subject-articles-list/${f}`}if(this.native){if(!a)return c([]);this.count=Z,this.filterViewed=!1,this.loadAll=!0,this.path=`native-articles-list/${a}`}return this._handleArticleLoad=this._handleArticleLoad.bind(this),this.getConsentString().then(()=>this.loadArticleList()).then(f=>{if(f.length===0){let d=this.querySelector(".article__flow-indicator");d&&d.remove()}return f.splice(0,0,this.initialArticle),c(f)})}),window.dataLayer&&window.dataLayer.push({event:"bonnier news standard page view"})}handleEvent(e){let t=[].slice.call(this.children).indexOf(e.target);if(t!==-1)switch(e.type){case"lcl:article-flow-load-next-item":this._handleArticleLoad(t);break;case"lcl:article-flow-view-this-item":this._handleArticleView(t),t>0&&b({element:document.body,eventName:"page view",data:{node:e.target.querySelector(".article"),section:window.lclClientConfig.mastertag,pageType:"virtual-article"}});break;case"lcl:article-flow-view-previous-item":this.previousIndex=Math.max(t-1,0),this.previousElement=this.children[this.previousIndex],this.previousElement&&b({element:document.body,eventName:"page view",data:{node:this.previousElement.querySelector(".article"),section:window.lclClientConfig.mastertag,pageType:"virtual-article"}}),this._handleArticleReturn(t);break;case"lcl:article-flow-bonnier-page-view":window.dataLayer&&t>0&&t!==Xe&&(Xe=t,window.dataLayer.push({event:"bonnier news standard page view"}));break;case"lcl:article-flow-bonnier-page-view-previous":window.dataLayer&&t-1!==Xe&&(Xe=t-1,window.dataLayer.push({event:"bonnier news standard page view"}));break}}getConsentString(){return window.lclClientConfig.nativeFromContentBroker!=="true"?Promise.resolve():De().then(e=>{let t=e.getCurrentUserStatus();this._consentString=t.consent_string||""}).catch(e=>{console.warn("Failed to initialize Content Broker Widget due to Didomi error:",e)})}loadArticleList(e){let t=new URLSearchParams;t.set("size",String(this.count)),t.set("offset",String(e)),this._consentString&&t.set("consentString",this._consentString),t.set("articlePath",window.location.pathname),t.set("articleId",this.initialArticle.id),Nt&&t.set("pageViewId",Nt);let n=fetch(`/article-flow/${this.path}?${t.toString()}`).then(o=>o.json()),s=this.filterViewed?this._getViewedArticles():Promise.resolve({viewedArticles:[],viewedNativeInFlow:[]});return Promise.all([n,s]).then(([o,r])=>{let{viewedArticles:a,viewedNativeInFlow:l}=r,c=[],f=[],{nativeScrollArticles:d,list:h}=o;d?(f=d.filter(v=>!l.includes(v.id)),c=h):c=o;let p=c.filter(v=>!a.includes(v.id)&&(this.initialArticle||{}).id!==v.id).slice(0,Z);return br.forEach((v,y)=>{f.length>y&&p.splice(v,0,f[y])}),p}).catch(o=>(_(o),[]))}addArticle(e){let t=document.createRange().createContextualFragment(e);return this.appendChild(t.firstElementChild)}_postArticleAdd(e){}_handleArticleLoad(e){this.articleList&&this.articleList.then(t=>!this.loadAll&&e===t.length-1?(this.offset=(this.offset||0)+Z,this.loadArticleList(this.offset).then(n=>(n&&t.push(...n),t))):t).then(t=>{let n=e+1;if(n===t.length)return;
1let s=t[e],o=t[n],r=new URLSearchParams;r.append("index",n.toString()),o.native&&r.append("native","true"),this.initialArticle.native&&r.append("preventNativeBanner","true"),s.native&&r.append("preventTopPanorama","true"),t.length>e+2&&t[e+2].native&&r.append("forceBottomPanorama","true"),fetch(`/article-flow/article/${o.id}?${r.toString()}`).then(a=>{if(a.status===200)return a.text();if(a.status===401)return;throw a.status===404?(t.splice(n,1),this._handleArticleLoad(e),new Error("Missing article from article flow list")):new Error("Failed to fetch article flow item: "+a.status)}).then(a=>a&&this.addArticle(a)).then(a=>a&&this._postArticleAdd(a)).catch(a=>{Wi(l=>{l.setExtra("id",o.id),l.setExtra("headline",o.headline),_(a)})})})}_handleArticleView(e){this.articleList&&this.articleList.then(t=>{let n=t[e];if(!n)return;this._setArticleViewed(n.id,n.native);let{pathname:s,search:o,hash:r}=document.location,a=s+o+r,l=(n.linkUrl.startsWith("/")?"":"/")+n.linkUrl;l!==a&&(zi({message:"Article "+e}),history.replaceState(null,"",l+o+r),document.title=n.headline)})}_handleArticleReturn(e){this.articleList&&this.articleList.then(()=>{let t=Math.max(e-1,0);this._handleArticleView(t)})}_setArticleViewed(e,t){sessionStorage&&G(W.functional).then(n=>{n&&(window.lclClientConfig.namespace==="hbl"?Y("hufvudstadsbladet-ab").then(s=>{s&&this._storeViewedArticle(e,t)}).catch(s=>{_(s)}):this._storeViewedArticle(e,t))}).catch(n=>{_(n)})}_getViewedArticles(){if(!sessionStorage)return{viewedArticles:[],viewedNativeInFlow:[]};let e=sessionStorage.getItem(si),t=e?JSON.parse(e):[];return Array.isArray(t)?{viewedArticles:t,viewedNativeInFlow:[]}:t}_storeViewedArticle(e,t){requestIdleCallback(()=>{let{viewedArticles:n,viewedNativeInFlow:s=[]}=this._getViewedArticles();if(t){s.push(e),sessionStorage.setItem(si,JSON.stringify({viewedArticles:n,viewedNativeInFlow:s}));return}n.includes(e)||(n.push(e),n.length>ns&&n.splice(0,1),sessionStorage.setItem(si,JSON.stringify({viewedArticles:n,viewedNativeInFlow:s})))})}};var ss=u(g()),ue=class extends ss.default{parsedCallback(){if(this.initiated)return;this.initiated=!0;let t=[].slice.call(this.parentElement.childNodes).indexOf(this),n=this.querySelector(".article");n&&(n.dataset.index=t.toString(),"IntersectionObserver"in window&&requestAnimationFrame(()=>{let s=document.createElement("div");s.classList.add("article-flow__item-load-trigger"),this.appendChild(s),this.loadObserver=new IntersectionObserver(this._handleLoadIntersect.bind(this)).observe(s);let o=document.createElement("div");o.classList.add("article-flow__item-view-trigger"),this.appendChild(o),new IntersectionObserver(this._handleViewIntersect.bind(this),{threshold:1}).observe(o);let r=n.querySelector(".article__title");r&&new IntersectionObserver(this._handleTitleIntersect.bind(this),{threshold:1}).observe(r)}))}_handleViewIntersect(e){let{isIntersecting:t,boundingClientRect:n}=e[0];t?(this.wasVisible=!0,this.dispatchEvent(new Event("lcl:article-flow-view-this-item",{bubbles:!0}))):this.wasVisible&&n.top>0&&this.dispatchEvent(new Event("lcl:article-flow-view-previous-item",{bubbles:!0}))}_handleTitleIntersect(e){let{isIntersecting:t,boundingClientRect:n}=e[0];t?this._titleWasVisible=!0:this._titleWasVisible&&(this._titleWasVisible=!1,n.top<0?this.dispatchEvent(new Event("lcl:article-flow-bonnier-page-view",{bubbles:!0})):this.dispatchEvent(new Event("lcl:article-flow-bonnier-page-view-previous",{bubbles:!0})))}_handleLoadIntersect(e,t){let{isIntersecting:n,target:s}=e[0];if(n){let o=new Event("lcl:article-flow-load-next-item",{bubbles:!0});this.dispatchEvent(o),t.unobserve(s)}}};var rs=u(g());var _r=i=>{i.setAttribute("role","button"),i.addEventListener("keyup",e=>{e.code==="Space"&&(e.preventDefault(),i.click())})},os=_r;var pe=class extends rs.default{constructor(){super(),this._toggle=this._toggle.bind(this),this._handleOpen=this._handleOpen.bind(this),this._handleClose=this._handleClose.bind(this)}parsedCallback(){this._init()}disconnectedCallback(){this.removeEventListener("click",this._toggle),this.removeEventListener("lcl-disclose:open",this._handleOpen,!0),this.removeEventListener("lcl-disclose:close",this._handleClose,!0)}_init(){this._ctrl=this.querySelector("button, a"),this._ctrl&&(this._ctrl instanceof HTMLAnchorElement&&os(this._ctrl),this._hasPopup=this.hasAttribute("haspopup")&&this.getAttribute("haspopup")!==""&&this.getAttribute("haspopup"),this._ctrl.setAttribute("aria-expanded",this._ctrl.getAttribute("aria-expanded")||"false"),this._hasPopup&&(this._ctrl.setAttribute("aria-haspopup","true"),this._ctrl.setAttribute("aria-controls",this._hasPopup)),this.addEventListener("click",this._toggle),this.addEventListener("lcl-disclose:open",this._handleOpen),this.addEventListener("lcl-disclose:close",this._handleClose),this.dispatchEvent(new CustomEvent("lcl
1-disclose:addtoggle",{bubbles:!0})))}_toggle(e){e.target instanceof Node&&(e.target===this._ctrl||this._ctrl.contains(e.target))&&(this.dispatchEvent(new CustomEvent("lcl-disclose:toggle",{bubbles:!0})),e.preventDefault())}_handleOpen(e){e.target===this&&(this._ctrl.setAttribute("aria-expanded","true"),e.stopPropagation())}_handleClose(e){e.target===this&&(this._ctrl.setAttribute("aria-expanded","false"),e.stopPropagation())}};var as=u(g()),fe=class extends as.default{parsedCallback(){this.template=this.querySelector("template"),this.template&&(this.appendChild(this.template.content),this.template.remove())}};var oi=i=>{if(i.hasAttribute("disabled"))return!1;if(i.tabIndex>0||i.isContentEditable||i.tabIndex===0&&i.getAttribute("tabIndex")!==null)return!0;switch(i.nodeName){case"A":return!!i.hasAttribute("href");case"INPUT":return i.type!=="hidden"&&i.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Qe=class{constructor(){this._lastFocus=null,this._ignoreFocusChanges=!1}setup(e={}){if(!e.element||!e.element.parentNode)throw new Error("FocusTrap setup() must be called with an options object containing an element key, pointing to an attached DOM element.");this.element=e.element,this.preEl=this._makeFocusableDiv(),this.postEl=this._makeFocusableDiv(),this.element.parentNode.insertBefore(this.preEl,this.element),this.element.parentNode.insertBefore(this.postEl,this.element.nextSibling)}handleEvent(e){e.type!=="focus"||this._ignoreFocusChanges||!e.target||(this.element&&e.target instanceof Node&&this.element.contains(e.target)?this._lastFocus=e.target:(this.focusFirst(this.element),this._lastFocus===document.activeElement&&this.focusLast(this.element),this._lastFocus=document.activeElement))}enable(){document.addEventListener("focus",this,!0)}disable(){document.removeEventListener("focus",this,!0)}_makeFocusableDiv(){let e=document.createElement("div");return e.setAttribute("aria-hidden","false"),e.tabIndex=0,e}focusFirst(e=this.element){if(!e)return!1;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(this.attemptFocus(n)||this.focusFirst(n))return!0}return!1}focusLast(e=this.element){if(!e)return!1;for(let t=e.children.length-1;t>=0;t--){let n=e.children[t];if(this.attemptFocus(n)||this.focusLast(n))return!0}return!1}attemptFocus(e){if(!oi(e))return!1;this._ignoreFocusChanges=!0;try{e.focus()}catch{}return this._ignoreFocusChanges=!1,document.activeElement===e}};var H=()=>new Promise(i=>window.requestAnimationFrame(()=>window.requestAnimationFrame(i)));function ri(i){let{FocusTrap:e,ScrollLock:t,Backdrop:n}=i;
1if(!e)throw new Error("ModalDialog needs an implementation of FocusTrap");class s extends HTMLElement{constructor(){super(),this.focusAfter=null,this._isInitialized=!1,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.focusTrap=new e,t&&(this.scrollLock=new t),n&&(this.backdrop=new n)}connectedCallback(){this._isInitialized||this._init()}disconnectedCallback(){this.hasAttribute("active")&&(this.deactivate(),this.backdrop&&this.backdrop.remove())}_init(){this._setRole(),this.setAttribute("aria-modal","true"),this.setAttribute("tabindex","-1"),this.backdrop&&this.backdrop.setup({dialog:this}),this.scrollLock&&this.scrollLock.setup({target:this}),this.focusTrap.setup({element:this}),this._isInitialized=!0}async activate(r,a){this.removeAttribute("hidden"),this.scrollLock&&this.scrollLock.enable(),this.backdrop&&await this.backdrop.show(),this.focusTrap.enable();let l;return a&&(a instanceof Element?l=a:typeof a=="string"&&(l=document.getElementById(a))),this.focusAfter=l||this.focusAfter,H().then(()=>this._setFocus(r))}_setFocus(r){let a=null;if(typeof r=="string"?a=document.getElementById(r):r instanceof HTMLElement&&(a=r),a)return a.focus();if(this.hasAttribute("aria-labelledby")){let l=this.getAttribute("aria-labelledby"),c=l&&document.getElementById(l.split(" ")[0]);if(c&&oi(c))return c.focus()}return this.focus()}async deactivate(){this.focusTrap.disable(),this.scrollLock&&this.scrollLock.disable(),this.setAttribute("hidden",""),this.backdrop&&await this.backdrop.hide()}_setRole(){let r=this.hasAttribute("alert")?"alertdialog":"dialog";this.setAttribute("role",r)}}return s}function ai(i){let e=[],t=i&&i.parentNode&&i.parentNode.firstElementChild;for(;t;)t!==i&&e.push(t),t=t.nextElementSibling;return e}var yr={dialogOpenClass:"lcl-modal-open"},ge=class{constructor(e){this.settings=Object.assign({},yr,e),this.classNames={openClass:this.settings.dialogOpenClass},this._openDialogList=[],this._ariaHidden=[],this._handleEscape=this._handleEscape.bind(this),this.replace=this.replace.b
1ind(this),document.addEventListener("keyup",this._handleEscape),document.addEventListener("lcl-modal:open",this),document.addEventListener("lcl-modal:close",this),document.addEventListener("lcl-modal:replace",this)}destroy(){this.unmodalize(),document.removeEventListener("keyup",this._handleEscape),document.removeEventListener("lcl-modal:open",this),document.removeEventListener("lcl-modal:close",this),document.removeEventListener("lcl-modal:replace",this)}handleEvent(e){let{id:t,focusAfter:n,focusFirst:s}=e.detail||{};switch(e.type){case"lcl-modal:open":this.open(t,n,s);break;case"lcl-modal:close":this.close();break;case"lcl-modal:replace":this.replace(t,n,s);break;default:break}}open(e,t,n){let s=this.getCurrent();s?s.focusTrap.disable():document.body.classList.add(this.classNames.openClass),this.unmodalize();let o=document.getElementById(e);if(!o)throw new Error(`No element found with id="${e}".`);this._openDialogList.push(o),this.modalize(o),o.activate(n,t)}replace(e,t,n){let s=this.getCurrent(),o=t||s&&s.focusAfter;this.unmodalize(),s&&(this._openDialogList.pop(),s.deactivate()),this.open(e,o,n)}close(){let e=this.getCurrent();if(e)if(e.deactivate(),this.unmodalize(),this._openDialogList.pop(),this._openDialogList.length>0){let t=this.getCurrent();this.modalize(t),t&&t.activate(e.focusAfter)}else document.body.classList.remove(this.classNames.openClass),e.focusAfter&&H().then(()=>{e.focusAfter.focus()}).catch(()=>{})}closeCurrent(){return this.getCurrent()?(this.close(),!0):!1}getCurrent(){return this._openDialogList&&this._openDialogList.length?this._openDialogList[this._openDialogList.length-1]:null}_handleEscape(e){let t=e.key||e.keyCode;(t==="Escape"||t==="Esc"||t===27)&&this.closeCurrent()&&e.stopPropagation()}modalize(e){!e||e===document.body||(ai(e).forEach(t=>{t.hasAttribute("aria-hidden")||t.matches("script,link,meta,noscript,template")||(t.setAttribute("aria-hidden","true"),this._ariaHidden.push(t))}),this.modalize(e.parentElement))}unmodalize(){this._ariaHidden.forEach(e=>e.removeAttribute("aria-hidden")),this._ariaHidden=[]}};var Er={baseClass:"local-modal-backdrop",activeClass:"local-modal-backdrop--active",dialog:void 0},we=class{constructor(e={}){this.settings=Object.assign({},Er,e),this.classNames={base:this.settings.baseClass,active:this.settings.activeClass}}setup(e={}){this.settings.dialog=e.dialog,this.element=this.injectElement(this.createElement())}injectElement(e){let t=this.settings.dialog;return t&&t.parentElement?t.parentElement.insertBefore(e,t):document.body.appendChild(e)}createElement(){let e=document.createElement("div");return e.classList.add(this.classNames.base),e}async show(){return this.element&&this.element.classList.add(this.classNames.active),H()}async hide(){return this.element&&this.element.classList.remove(this.classNames.active),H()}remove(){return this.element&&this.element.remove()}};var et=function(){return typeof window>"u"},li=function(e){e=e||navigator.userAgent;var t=/(iPad).*OS\s([\d_]+)/.test(e),n=!t&&/(iPhone\sOS)\s([\d_]+)/.test(e),s=/(Android);?[\s/]+([\d.]+)?/.test(e),o=n||t;return{ios:o,android:s}};function cs(i){if(et())return!1;if(!i)throw new Error("options must be provided");var e=!1,t={get passive(){e=!0}},n=function(){},s="__TUA_BSL_TEST_PASSIVE__";window.addEventListener(s,n,t),window.removeEventListener(s,n,t);var o=i.capture;return e?i:typeof o<"u"?o:!1}function ds(i){return!1}function ci(){return"__BSL_PREVENT_DEFAULT__"in window||(window.__BSL_PREVENT_DEFAULT__=function(i){i.cancelable&&i.preventDefault()}),window.__BSL_PREVENT_DEFAULT__}function ms(i){return i?Array.isArray(i)?i:[i]:[]}function kr(i){var e=window.getComputedStyle(i),t=e.flexDirection;return{column:t==="column-reverse",row:t==="row-reverse"}}function Cr(i,e,t){var n=i.scrollTop,s=i.scrollLeft,o=i.scrollWidth,r=i.scrollHeight,a=i.clientWidth,l=i.clientHeight,c=kr(i),f,d;c.column?(f=t>0&&Math.abs(n)+l+1>=r,d=t<0&&Math.abs(n)<=1):(f=t>0&&n===0,d=t<0&&n+l+1>=r);var h,w;return c.row?(h=e>0&&Math.abs(s)+a+1>=o,w=e<0&&Math.abs(s)<=1):(h=e>0&&s===0,w=e<0&&s+a+1>=o),{isOnTop:f,isOnBottom:d,isOnLeft:h,isOnRight:w}}var Ze={lockedNum:0,lockedElements:[],unLockCallback:null,documentListenerAdded:!1,initialClientPos:{clientX:0,clientY:0}};function tt(i){if(et())return Ze;if(!i?.useGlobalLockState)return tt.lockState;var e="__BSL_LOCK_STATE__"in window?Object.assign(Object.assign({},Ze),window.__BSL_LOCK_STATE__):Ze;return window.__BSL_LOCK_STATE__=e,e}tt.lockState=Ze;function Tr(i,e,t){if(e){var n=i.targetTouches[0].clientX-t.clientX,s=i.targetTouches[0].clientY-t.clientY,o=Math.abs(s)>Math.abs(n),r=Cr(e,n,s),a=r.isOnTop,l=r.isOnBottom,c=r.isOnLeft,f=r.isOnRight;if(o&&(a||l)||!o&&(c||f))return ci()(i)}return i.stopPropagation(),!0}function ls(i){var e,t=document.documentElement,n=Object.assign({},t.style),s=(e=i?.withPaddingRight)!==null&&e!==void 0?e:!0,o=window.innerWidth-t.clientWidth,r=parseInt(window.getComputedStyle(t).paddingRight,10);return t.style.overflow="hidden",t.style.boxSizing="border-box",s&&(t.style.paddingRight="".concat(o+r,"px")),function(){["overflow","boxSizing","paddingRight"].forEach(function(a){t.style[a]=n[a]||""})}}function Lr(i){var e=document.documentElement,t=document.body,n=e.scrollTop||t.scrollTop,s=Object.assign({},e.style),o=Object.assign({},t.style);return e.style.height="100%",e.style.overflow="hidden",t.style.top="-".concat(n,"px"),t.style.width="100%",t.style.height="auto",t.style.position="fixed",t.style.overflow=i?.overflowType||"hidden",function(){e.style.height=s.height||"",e.style.overflow=s.overflow||"",["top","width","height","overflow","position"].forEach(function(a){t.style[a]=o[a]||""});var r="scrollBehavior"in document.documentElement.style;r?window.scrollTo({top:n,behavior:"instant"}):window.scrollTo(0,n)}}function hs(i,e){if(!et()){ds(i);var t=li(),n=tt(e);t.ios?(ms(i).filter(function(s){return s&&n.lockedElements.indexOf(s)===-1}
1).forEach(function(s){s.ontouchstart=function(o){var r=o.targetTouches[0],a=r.clientX,l=r.clientY;n.initialClientPos={clientX:a,clientY:l}},s.ontouchmove=function(o){Tr(o,s,n.initialClientPos)},n.lockedElements.push(s)}),Sr(n),e?.setOverflowForIOS&&(n.unLockCallback=ls(e))):n.lockedNum<=0&&(n.unLockCallback=t.android?Lr(e):ls(e)),n.lockedNum+=1}}function us(i,e){var t;if(!et()){ds(i);var n=tt(e);n.lockedNum-=1,!(n.lockedNum>0)&&((t=n.unLockCallback)===null||t===void 0||t.call(n),li().ios&&(ms(i).forEach(function(s){var o=n.lockedElements.indexOf(s);s&&o!==-1&&(s.ontouchmove=null,s.ontouchstart=null,n.lockedElements.splice(o,1))}),Ar(n)))}}function Sr(i){li().ios&&(i.documentListenerAdded||(document.addEventListener("touchmove",ci(),cs({passive:!1})),i.documentListenerAdded=!0))}function Ar(i){i.documentListenerAdded&&(document.removeEventListener("touchmove",ci(),cs({passive:!1})),i.documentListenerAdded=!1)}var ve=class{setup(e={}){if(!e.target)throw new Error("Missing target when constructing scroll lock.");this.target=e.target}enable(){hs(this.target)}disable(){us(this.target)}};var Ir=ri({FocusTrap:Qe,Backdrop:we,ScrollLock:ve}),zl=new ge,ps=Ir;var fs=u(g());var xr=new Set(["everysportwidgets","riddle","bnelectioncomponents"]),be=class extends fs.default{parsedCallback(){if(this.hasAttribute("data-deactivated")&&(this.deactivated=!0),this.overrideCmp=this.getAttribute("data-override-cmp"),this.vendors=this.getAttribute("data-vendors"),this.vendorConsents=Object.fromEntries(this.vendorsArray.map(e=>[e,!1])),this.placeholderText=this.getAttribute("data-placeholder-text"),this.placeholderTextBlocked=this.getAttribute("data-placeholder-text-blocked"),this.placeholderElement=this.querySelector(".lcl-resource__placeholder-text"),!window.lclClientConfig.didomiEnabled||this.overrideCmp==="true")this.activate();else for(let e of this.vendorsArray)window.didomiOnReady.push(t=>{F(e,n=>{this.vendorConsents[e]=n.enabled,this.checkConsent()})})}get articleElement(){return this.closest(".article")}get placeholder(){return this.placeholderElement&&this.placeholderElement.textContent}set placeholder(e){this.placeholderElement&&(this.placeholderElement.textContent=e)}get iframe(){return this.querySelector("iframe")}get vendorsArray(){return(this.getAttribute("data-vendors")||"").split(",")}checkConsent(){let e=Object.values(this.vendorConsents).every(t=>t===!0);!this.deactivated&&e?this.activate():this.block()}async block(){if(this.removeAttribute("active"),this.setAttribute("blocked",""),this.iframe.src="about:blank",this.placeholder=this.placeholderTextBlocked,this.approveVendorButton=this.querySelector(".lcl-resource__approve-all"),this.approveVendorButton&&this.vendorsArray[0]){let e=await Si(this.vendorsArray[0]);if(!e)return;this.approveVendorButton.textContent=`Godk\xE4nn kakor fr\xE5n ${e.name}`,this.handleApproveClick=async()=>{await Promise.all(this.vendorsArray.map(async t=>await Ai(t)))},this.approveVendorButton.removeEventListener("click",this.handleApproveClick),this.approveVendorButton.addEventListener("click",this.handleApproveClick)}}activate(){this.setAttribute("active",""),this.removeAttribute("blocked");let e=this.iframe,t=this.dataset.supplier,n=e.getAttribute("data-src");if(n.includes("/assets/static/weather"))e.src=n;else{let s=new URL(n);if(t==="ifragasatt"&&(this.dedupeIfragasatt(),new URLSearchParams(window.location.search).has("ifr-dir-postId")&&document.querySelector('lcl-resource[data-supplier="ifragasatt"]')===this&&this.iframe.scrollIntoView({behavior:"smooth",block:"start"})),xr.has(t)&&s.searchParams.set("color_scheme",P()?"dark":"light"),t==="riddle"&&P()){let o=on();o&&s.searchParams.set("palette",o)}if(t==="ifragasatt"&&P()&&(s=new URL(s.toString().replace("light.css","dark.css"))),t==="datawrapper"){let o=!!document.querySelector("#storytelling-switch-article-color-scheme:not(:checked)");(P()||o)&&s.searchParams.set("color_scheme","dark")}e.src=s.toString()}}dedupeIfragasatt(){let e=this.iframe.id,t=document.querySelectorAll(`#${e}`);Array.from(t).filter(n=>n!==this.iframe).forEach(n=>n.remove())}};var gs=u(g());var di={all:9,none:18};var _e=class extends gs.default{parsedCallback(){this.hasAttribute("data-deactivated")&&(this.deactivated=!0),this.playerLoaded=!1,this.trackingInitiated=!1,this.vendor=this.getAttribute("data-vendors"),F("bonniernews-reynolds",this.allowSharingDeliverance.bind(this)),F(this.vendor,this.shouldBeActivated.bind(this))}get articleElement(){return this.closest("article")}get iframe(){return this.querySelector("iframe")}shouldBeActivated(e){this.deactivated||this.activate(e.enabled)}allowSharingDeliverance(e){this.shareDeliverance=e.enabled}initVideoTracking(e){if(this.trackingInitiated)return;this.trackingInitiated=!0;let t=new URL(e.src),n=t.origin,s=t.pathname.split("/").pop();window.addEventListener("message",o=>{o.origin!==n||s!==o.data.resourceId||o&&b({element:e,eventName:"video-tracking-event",data:{...o.data,published:e.closest("article[data-published]").getAttribute("data-published")}})})}activate(e){this.setAttribute("active",""),this.removeAttribute("blocked");let t=this.iframe;this.playerLoaded&&this.sendConsentMessage(t,e),t.addEventListener("load",()=>{this.playerLoaded=!0,this.sendConsentMessage(t,e),this.setAttribute("loaded","true"),this.initVideoTracking(t)}),this.setIframeSrc(t)}sendConsentMessage(e,t){let n={consent:t?di.all:di.none};e.contentWindow.postMessage(n,{targetOrigin:"*"})}setIframeSrc(e){let t=e.getAttribute("data-src");Promise.allSettled([this.getGeoTargetingData(),window.ppid().then(n=>{if(!n)throw new Error("Missing ppid");return{ppid:n}}),this.getBonnierInsightsTargeting()]).then(n=>n.filter(s=>s.status==="fulfilled").map(s=>s.value)).then(n=>{e.src=`${t}?${this.queryString(n)}`}).catch(()=>{e.src=`${t}?${this.queryString()}`})}getBonnierInsightsTargeting(){let e=this.getClientId();if(!e)return Promise.reject("Missing clientId");let t=`https://elmer.bonniernews.se/v1/segment/${e}?purpose=personalized-ads`;return fetch(t,{headers:{"x-bn-origin":"jalla"}}).then(s=>{if(s.status!==200)throw new Error(`Got status ${s.status} when calling elmer, reason: ${s.statusText}`);return s.json()}).then(s=>({bi:s.marketing_segments})).catch(s=>{throw console.error("Failed to collect bonnier insights targeting",s),s})}getGeoTargetingData(){return fetch("https://context.bonad.io/v2/geo").then(e=>{if(e.status!==200)throw new Error(`Got status ${e.status} when calling context, reason: ${e.statusText}`);return e.json()}).catch(e=>{throw console.error("Failed to collect context targeting",e),e})}queryString(e){let t=(e||[]).reduce((s,o)=>
1(Object.entries(o).forEach(([r,a])=>{s[r]=Array.isArray(a)?a.join(","):a}),s),{}),n={article_id:this.articleElement.dataset.uuid,article_type:this.articleElement.dataset.articleType,categories:`${this.articleElement.dataset.tagUuids},${this.articleElement.dataset.tagHierarchicalIds}`,tags:ln(this.articleElement).filter(s=>s).join(",")};return new URLSearchParams({ta:T("_ta_")||new URLSearchParams(window.location.search).get("_ta_"),canonical_url:`${location.origin}${location.pathname}`,color_scheme:P()?"dark":"light",unit_id:this.unitId(),rc:this.getClientId(),isLoggedIn:this.getIsLoggedIn(),...n,...t})}getIsLoggedIn(){return window.lclClientConfig&&window.lclClientConfig.isLoggedIn||!1}getClientId(){return T("bnacid")}unitId(){try{return window.lclClientConfig.bam.bamData.mobile.path.split("/").slice(0,4).join("/")}catch{return""}}};var ws=u(g());var ye=class extends ws.default{parsedCallback(){this.hasAttribute("data-deactivated")&&(this.deactivated=!0),this.vendor=this.getAttribute("data-vendors"),F(this.vendor,this.shouldBeActivated.bind(this)),this.handleMessage=e=>{let t=this.iframe;if(!t)return;let n=t.getAttribute("data-src")||t.src;if(!n)return;let s,o;try{let a=new URL(n,window.location.origin);s=a.origin,o=a.pathname.split("/").pop()}catch{return}if(e.origin!==s||!e.data||e.data.type!=="staylive_event"||e.data.resourceId&&o&&e.data.resourceId!==o)return;let r=e.data.payload;!r||!r.type||r.type==="pause"&&r.currentTime>=r.duration||b({element:t,eventName:"staylive-tracking-event",data:r})},window.addEventListener("message",this.handleMessage)}get iframe(){return this.querySelector("iframe")}shouldBeActivated(e){this.deactivated||this.activate(e.enabled)}activate(e){if(!e){this.setAttribute("blocked",""),this.removeAttribute("active");return}this.setAttribute("active",""),this.removeAttribute("blocked");let t=this.iframe;if(!t)return;let n=t.getAttribute("data-src");n&&(t.src=n,t.addEventListener("load",()=>{this.setAttribute("loaded","true")}))}disconnectedCallback(){window.removeEventListener("message",this.handleMessage)}};var Pr="strossle-widget",Mr="strosslei-ttYzMyhk";window.strossle=window.strossle||function(){(window.strossle.q=window.strossle.q||[]).push(arguments)};var Or=(i,e)=>{let t=document.createElement("script");t.id="strossle",t.src="https://assets.strossle.com/strossle-widget-sdk/1/strossle-widget-sdk.js",document.querySelector("head").appendChild(t),t.addEventListener("load",i),t.addEventListener("error",e)},vs=[],bs=()=>new Promise(i=>{let e=i,t=()=>i();bs=()=>Promise.resolve(),Y(Mr).then(n=>{n&&Or(e,t)}).catch(n=>{_(n)})}),Ee=class extends HTMLElement{_getDeviceType(){return J?"app":window.matchMedia("(min-width: 72em)").matches?"desktop":"mobile"}_activateWidget(){let e=this._getDeviceType(),t=this.getAttribute("type"),n=window.lclClientConfig.strossle,s=vs.indexOf(this),o=`${Pr}-${s}`;this.classList.add(o);let r=n[t];window.strossle(r[e],`.${o}`)}connectedCallback(){if(this.setAttribute("data-enabled","false"),!!window.lclClientConfig.adsEnabled)return this.setAttribute("data-enabled","true"),vs.push(this),bs().then(this._activateWidget.bind(this))}};var Nr="strossle2-widget",Fr="strosslei-ttYzMyhk";window._mgq=window._mgq||[];var Dr=(i,e,t)=>{let n=document.createElement("script");n.id="strossle2",n.src=`https://jsc.native.azerion.com/site/${i}.js`,document.querySelector("head").appendChild(n),n.addEventListener("load",e),n.addEventListener("error",t)},_s=[],ys=i=>new Promise(e=>{let t=e,n=()=>e();ys=()=>Promise.resolve(),Y(Fr).then(s=>{s&&Dr(i,t,n)}).catch(s=>{_(s)})}),ke=class extends HTMLElement{_getDeviceType(){return J?"app":window.matchMedia("(min-width: 72em)").matches?"desktop":"mobile"}_activateWidget(){let e=this._getDeviceType(),t=this.getAttribute("type")||"startpage",n=window.lclClientConfig.strossle2,s=_s.indexOf(this),o=`${Nr}-${s}`;this.classList.add(o);let r=n[t];if(!r||!r[e])return;let a=r[e],l=document.createElement("div");l.setAttribute("data-type","_mgwidget"),l.setAttribute("data-widget-id",a),this.appendChild(l),window._mgq.push(["_mgc.load"])}connectedCallback(){if(this.setAttribute("data-enabled","false"),!window.lclClientConfig.adsEnabled)return;let e=window.lclClientConfig.strossle2;if(!(!e||!e.siteId))return this.setAttribute("data-enabled","true"),_s.push(this),ys(e.siteId).then(this._activateWidget.bind(this))}};var it=class extends HTMLElement{constructor(){super(),window.addEventListener("scroll",()=>{this.classList.toggle("visible",window.scrollY>1e3)},{passive:!0})}};var nt=class extends HTMLElement{connectedCallback(){m({element:this,moduleFileName:"newsletter-button-module.js"})}};var mi,hi,B,$,st=class extends HTMLElement{connectedCallback(){this.article=this.closest(".article"),mi?this.initLightbox():import("./photoswipe-lightbox.esm-ZZR632WD.js").then(e=>{mi=e.default,this.initLightbox()}).catch(e=>console.error("Failed to load lightbox script:",e))}initLightbox(){let e="a[data-pswp-width][data-pswp-height]:not([data-lightbox-added])",t=`${e}:not(lcl-lightbox[slideshow] a)`,n;this.getAttribute("slideshow")&&(t=this,n=e),this.lightbox=new mi({gallery:t,children:n,bgOpacity:1,closeTitle:"St\xE4ng",zoomTitle:"F\xF6rstora",arrowPrevTitle:"F\xF6reg\xE5ende",arrowNextTitle:"N\xE4sta",indexIndicatorSep:" av ",pswpModule:()=>import("./photoswipe.esm-LCUIGPTE.js")}),this.lightbox.addFilter("thumbEl",(s,o)=>{let r=s;return!r&&o.element.parentElement&&(r=o.element.parentElement.querySelector("img")),r}),Ji(this.lightbox),this.lightbox.addFilter("placeholderSrc",(s,o)=>o.element?o.element.currentSrc||o.element.src:s),this.loadLightboxStyle().then(()=>{this.createCaptionPlugin()}).catch(s=>console.error("Failed to initialize lightbox caption plugin:",s))}createCaptionPlugin(){hi?this.initCaptionPlugin():import("./photoswipe-dynamic-caption-plugin.esm-5CMK5AKF.js").then(e=>{hi=e.default,this.initCaptionPlugin()}).catch(e=>console.error("Failed to load lightbox caption plugin script:",e))}
1initCaptionPlugin(){this.captionPlugin=new hi(this.lightbox,{type:"below",captionContent:e=>e.data.element.dataset.pswpCaption}),this.loadCaptionPluginStyle().then(()=>{this.lightbox.init()}).catch(e=>console.error("Failed to initialize Lightbox:",e))}loadLightboxStyle(){return B?Promise.resolve(B):new Promise(e=>{B=document.createElement("link"),B.rel="stylesheet",B.href=window.lclClientConfig.photoswipeCss,document.head.append(B),e(B)})}loadCaptionPluginStyle(){return $?Promise.resolve($):new Promise(e=>{$=document.createElement("link"),$.rel="stylesheet",$.href=window.lclClientConfig.photoswipeDynamicCaptionPluginCss,document.head.append($),e($)})}};var Es=["auth_action","ios_auth_action"],ks=()=>{if(URLSearchParams){let i=new URLSearchParams(window.location.search);if(Es.some(t=>i.has(t))){for(let n of Es)i.delete(n);let t=i.toString().length>0?"?"+i.toString():"";window.history.replaceState({},"",decodeURIComponent(`${window.location.pathname}${t}`))}}};function Cs(i){return new Promise((e,t)=>{let n=document.querySelector(i);if(n){e(n);return}new MutationObserver((s,o)=>{let r=document.querySelector(i);r&&(e(r),o.disconnect())}).observe(document.documentElement,{childList:!0,subtree:!0})})}var ot=class extends HTMLElement{connectedCallback(){this.elementSelector&&Cs(this.elementSelector).then(e=>{e&&this.replaceSelfWithElement(e)}).catch(e=>{console.error(e)})}get elementSelector(){return this.getAttribute("selector")}replaceSelfWithElement(e){this.parentElement.replaceChild(e,this)}};var Ts=u(g()),Ce=class extends Ts.default{parsedCallback(){m({element:this,moduleFileName:"search-module.js"})}};var Ls=u(g()),Te=class extends Ls.default{parsedCallback(){this.activate()}get iframe(){return this.querySelector("iframe")}activate(){let e=this.iframe,t=new URL(e.src).origin;window.addEventListener("message",n=>{if(n.origin!==t||!e)return;let{height:s,location:o,track:r}=n.data.jobAds||{};if(s)e.height=s;else if(o){let a=new URLSearchParams(window.location.search);a.set("jobAdsURL",o),window.history.replaceState({},"",decodeURIComponent(window.location.pathname+"?"+a)),e.contentWindow.postMessage({jobAds:{location:window.location.href}},"*"),o.includes("/framtidsforetag")&&b({element:e,eventName:"page view",data:{content:"jobads list page",tags:"mittjobb",mastertag:"mittjobb",pageType:"externalContent"}})}else if(r)if(r.name){b({element:e,eventName:r.name,data:{...r.data,mastertag:"mittjobb"}});let a;r.name==="jobads-listings-page-view"?a="jobads list page":r.name==="jobads-details-page-view"&&(a="jobads detail page"),b({element:e,eventName:"page view",data:{advertiser:r.data.advertiser,content:a,tags:"mittjobb",mastertag:"mittjobb",pageType:"externalContent"}})}else b({element:e,eventName:r.event,data:{...r}})})}};var Ss=()=>{let i=document.querySelector("main.page-subject, main.page-section");if(!i)return;let e=document.querySelectorAll("[data-tracking-categories]");if(!e.length)return;let t={};e.forEach(s=>{let o=s.getAttribute("data-tracking-categories");o&&o.split(",").forEach(a=>{t[a]!==void 0?t[a]+=1:t[a]=1})});let n=Object.entries(t).sort((s,o)=>o[1]-s[1]).shift()[0];i.setAttribute("data-tracking-category",n)};var As=u(g());var rt=class extends As.default{parsedCallback(){m({element:this,moduleFileName:"carousel-module.js"})}};var at=class extends HTMLElement{connectedCallback(){m({element:this,moduleFileName:"newsletter-widget-module.js"})}};var Is=u(g());var Le=class extends Is.default{parsedCallback(){this._button=this.querySelector("button"),this._button.addEventListener("click",this._handleClick.bind(this)),this._label=this.querySelector("label"),this._disabled=!1,this._states=[...this.querySelectorAll(".state-button__state")].reduce((e,t)=>{e[t.dataset.name]=t,t.style.display="flex";let n=Math.ceil(t.getBoundingClientRect().width);return n&&(t.style.width=`${n}px`),t.style.removeProperty("display"),e},{}),this._init()}_init(){this._updateVisualState({state:this._active.name,animate:!1}),this._button.style.opacity="1",this.dataset.sharedId&&tn(`lcl-state-button:state-updated:${this.dataset.sharedId}`,e=>{if(e.target!==this){let{state:t}=e.detail;this._updateVisualState({state:t})}})}get _active(){return this.dataset.state&&{name:this.dataset.state,element:this._states[this.dataset.state]}}_updateVisualState({state:e,animate:t=!0}){let n=this._active.name;if(e===n)return Promise.resolve();this.dataset.state=e;let s=this._states[e],o=this._states[n];if(this._label.textContent=s.dataset.description,this._button.setAttribute("aria-label",s.dataset.label),this._button.style.width=s.style.width,t)return o.classList.add("hide"),We(o,"opacity").then(()=>{s.classList.remove("hidden"),o.classList.add("hidden"),o.classList.remove("hide"),this._button.classList.remove(`button--${o.dataset.variant}`),this._button.classList.add(`button--${s.dataset.variant}`)});s.classList.remove("hidden"),o.classList.add("hidden"),this._button.classList.remove(`button--${o.dataset.variant}`),this._button.classList.add(`button--${s.dataset.variant}`)}_handleClick(e){if(this._disabled)return e.preventDefault();this._disabled=!0;let t=this._active.name,n=!1,s=this._peekNextState({fromState:t});s&&(this._updateVisualState({state:s}),n=!0),this._updateState(t).then(o=>{n||this._updateVisualState({state:o}),this._track({fromState:t,toState:o}),this.dataset.sharedId&&this.dispatchEvent(new CustomEvent(`lcl-state-button:state-updated:${this.dataset.sharedId}`,{bubbles:!0,detail:{state:o}}))}).catch(o=>{this._updateVisualState({state:t}),_(o)}).finally(()=>{this._disabled=!1})}_track({fromState:e,toState:t}){throw new Error("function must be implemented in subclass!")}_peekNextState({fromState:e}){throw new Error("function must be implemented in subclass!")}_updateState(e){throw new Error("function must be implemented in subclass!")}};var A=u(Ki()),Se=class extends Le{parsedCallback(){if(this._button=this.querySelector("button"),this._subjectId=this.dataset.subjectId,this._subjectName=this.dataset.subjectName,this._subjectType=this.dataset.subjectType,this._token=Hi(),super.parsedCallback(),"IntersectionObserver"in window)if(new IntersectionObserver(t=>{t.forEach(({isIntersecting:n})=>{n&&b({element:this,eventName:"follow-in-view",data:{type:this._subjectType,id:this._subjectId,name:this._subjectName,state:this._active.name}})})},{threshold:1}).observe(this),this.dataset.lazyLoadState){let t=new IntersectionObserver(n=>
1{n.forEach(s=>{s.isIntersecting&&(t.disconnect(),this._updateFromLoadedState())})},{rootMargin:"100%"});t.observe(this)}else this._updateFromLoadedState();else this._updateFromLoadedState();this._firebaseToken=T("firebaseToken"),this._withPush=!1,this._firebaseToken&&(this._withPush=!0),this._withPush&&(this._resolve=void 0,this._reject=void 0,document.addEventListener("lcl-follow-modal:follow-push-state-changed",e=>{this._resolve&&this._resolve(e.detail.state)}),document.addEventListener(ne(A.FOLLOW_MODIFICATION_INNER_MODAL_ID),e=>{this._resolve&&this._resolve(this._active.name)}),document.addEventListener(ne(A.FOLLOW_CONFIRMATION_INNER_MODAL_ID),e=>{this._resolve&&this._resolve("unfollow_no_push")}))}_updateFromLoadedState(){ji().then(e=>{let{followState:t="follow"}=e.find(n=>n.id===this._subjectId)||{};this._updateVisualState({state:t,animate:!1})}).catch(e=>console.error(e))}_updateState(e){if(this._withPush)return new Promise((t,n)=>{this._resolve=t,this._reject=n,e==="follow"?Pt({id:this._subjectId,type:this._subjectType}).then(()=>{this._sendOpenConfirmationModalEvent()}).catch(s=>{n(s)}):this._sendOpenModificationModalEvent()});{let t=e==="follow",n=t?"unfollow":"follow";return(t?Pt:Di)({id:this._subjectId,type:this._subjectType,token:this._token}).then(()=>{Ri(this._subjectId,n),t&&this._sendOpenConfirmationModalEvent()}).then(()=>n)}}_peekNextState({fromState:e}){if(!this._withPush)return e==="follow"?"unfollow":"follow"}_track({fromState:e,toState:t}){if(this._withPush){if(e!=="follow"&&t!=="follow")return;let n="follow";t==="follow"&&e!==t&&(n="unfollow"),b({element:this,eventName:"follow-interaction-click",data:{action:n,type:this._subjectType,id:this._subjectId,name:this._subjectName}})}else b({element:this,eventName:"follow-interaction-click",data:{action:e,type:this._subjectType,id:this._subjectId,name:this._subjectName}})}_sendOpenModificationModalEvent(){this.dispatchEvent(new CustomEvent(A.FOLLOW_MODIFICATION_OPEN_EVENT_NAME,{bubbles:!0,detail:{subjectName:this._subjectName,subjectId:this._subjectId,subjectType:this._subjectType,subjectFilter:this._active.name==="unfollow_with_push"?A.FOLLOW_NOTIFICATION_FILTER_ALL_NEWS:A.FOLLOW_NOTIFICATION_FILTER_NONE,focusAfter:this._button,currentState:this._active.name}}))}_sendOpenConfirmationModalEvent(){this.dispatchEvent(new CustomEvent(A.FOLLOW_CONFIRMATION_OPEN_EVENT_NAME,{bubbles:!0,detail:{subjectName:this._subjectName,subjectId:this._subjectId,subjectType:this._subjectType,focusAfter:this._button}}))}};var xs=u(g());var lt=class extends xs.default{connectedCallback(){m({element:this,moduleFileName:"receipt-modal-module.js"})}};var Ps=u(g());var ct=class extends Ps.default{parsedCallback(){m({element:this,moduleFileName:"follow-modal-module.js"})}};var Ms=u(g());var dt=class extends Ms.default{connectedCallback(){m({element:this,moduleFileName:"tapet-paywall-module.js"})}};var Os=u(g());var Ae=class extends Os.default{parsedCallback(){this._button=this.querySelector('div[class="load-button__container"]'),this._loading=this.querySelector(".load-content__loading"),this._button.addEventListener("click",this._handleClick.bind(this)),this._pageNumber=1,this._size=20,this._listenToContentChanges(),this._init()}_init(){return fetch(`/api/load-content?size=${this._size}&pageNumber=${this._pageNumber}`).then(e=>{if(!e.ok)throw new Error("Could not fetch items!");return e.json()}).then(e=>{let{html:t,hasNextPage:n,nextOffset:s}=e;this._hasNextPage=n,this._nextOffset=s,this.addFollowedArticles(t),this._hasNextPage&&(this._contentBlock=this.querySelector("div.block__main"),this._show())}).catch(e=>{console.error(e)}).finally(()=>{this._loading.remove()})}addFollowedArticles(e){let t=document.createRange().createContextualFragment(e);this.prepend(t)}_handleClick(){this._pageNumber++,fetch(`/api/load-content?pagePosition=${this._nextOffset}&size=${this._size}&pageNumber=${this._pageNumber}`).then(e=>{if(!e.ok)throw new Error("Could not fetch items!");return e.json()}).then(e=>{let{html:t,hasNextPage:n,nextOffset:s}=e;this._hasNextPage=n,this._nextOffset=s,n?this._show():this._hide();let o=this._removeDuplicatesConsideringDOM(t);document.querySelector("div.follows-page__body").appendChild(o)}).catch(e=>{console.error(e)})}_hide(){this._button.style.visibility="hidden"}_show(){this._button.style.visibility="visible",this._moveButton()}_moveButton(){this._contentBlock.appendChild(this._button)}_removeDuplicatesConsideringDOM(e){let n=document.createRange().createContextualFragment(e),s={};return document.querySelectorAll("div.chronology__content[data-title]").forEach(l=>{let c=l.getAttribute("data-title");s[c]=!0}),n.querySelectorAll("div.chronology__content[data-title]").forEach(l=>{let c=l.getAttribute("data-title");s[c]?l.remove():s[c]=!0}),n.querySelector('div[class="chronology__content"]').setAttribute("id",`load-index-${this._pageNumber}`),n}_listenToContentChanges(){document.addEventListener("lcl-follow-modal:subject-unfollowed",()=>{this._reloadContent()})}_reloadContent(){this.innerHTML="",this.appendChild(this._loading),this._init().then(()=>{this.focus()}).catch(e=>{_(e)})}};var Ns=u(g());var Ie=class extends Ns.default{parsedCallback(){this.notificationIcons=document.querySelectorAll(".icon-notification-badge");let e=this.dataset.ignorePath;if(te||window.location.pathname===e||window.location.pathname!=="/"){this.remove();return}let t=window.lclClientConfig;t&&t.isLoggedIn!==!1?this._init():this.remove()}_init(){fetch("/api/notification-badge").then(e=>{if(!e.ok)throw new Error("Could not get badge info");return e.json()}).then(e=>{let{showBadge:t}=e;this.notificationIcons.forEach((n,s)=>{let o=document.createElement("p");o.style.display="none",o.textContent="Nytt inneh\xE5ll har publicerats som du f\xF6ljer.";let r=`follow-notification-badge-id-${s}`;if(o.setAttribute("id",r),t){n.classList.add("visible");let a=n.closest("a");a.setAttribute("aria-describedby",r),a.append(o),Ot(!0)}else n.classList.remove("visible"),o.remove(),Ot(!1)})}).catch(e=>e)}};var Fs=u(g()),xe=class extends Fs.default{parsedCallback(){this._items=[...this.querySelectorAll(".tabs__tab")].map(e=>({tab:e,panel:this.querySelector(`#${CSS.escape(e.getAttribute("aria-controls"))}`)})),this._init()}
1_init(){this._items.forEach(({tab:t})=>{t.addEventListener("click",()=>{this._select({tab:t})})}),this.style.setProperty("--tabs-count",this._items.length.toString());let e=Number.parseInt(this.dataset.defaultSelected);this._select({tab:this._items[e].tab})}_select({tab:e}){this._items.forEach((t,n)=>{let{tab:s,panel:o}=t;s===e?(o.removeAttribute("hidden"),s.setAttribute("aria-selected","true"),this.style.setProperty("--tabs-selection",n.toString())):(o.setAttribute("hidden","true"),s.setAttribute("aria-selected","false"))})}};var Ds=u(g());var mt=class extends Ds.default{parsedCallback(){m({element:this,moduleFileName:"follow-modification-module.js"})}};var Rs=u(g()),ht=class extends Rs.default{parsedCallback(){this._setupPrintEventListener()}_setupPrintEventListener(){this.querySelector(".crossword-print-button").addEventListener("click",()=>{window.print()})}};var js=u(g());var ut=class extends js.default{connectedCallback(){m({element:this,moduleFileName:"collapse-container-module.js"})}};var qs=u(g());var pt=class extends qs.default{connectedCallback(){m({element:this,moduleFileName:"button-module.js"})}};var Hs=u(g());var ft=class extends Hs.default{connectedCallback(){m({element:this,moduleFileName:"morreman-blob-module.js"})}};var Bs=u(g());var gt=class extends Bs.default{connectedCallback(){m({element:this,moduleFileName:"slideshow-module.js"})}};var $s=u(g());var wt=class extends $s.default{connectedCallback(){m({element:this,moduleFileName:"fixed-header-module.js"})}};var Us=u(g());var vt=class extends Us.default{connectedCallback(){m({element:this,moduleFileName:"color-scheme-toggle-module.js"})}};var ui=!1,Rr=i=>{let e=document.createElement("script");return e.src=i,document.body.append(e),e.addEventListener("load",$r),e},jr=new Set(["/dygnet-runt","/livesport","/blaljus","/naringsliv"]),qr=()=>{let i=window.location.pathname;return jr.has(i)?`&context=${encodeURIComponent(i)}`:""},Hr=async()=>{try{let i=await fetch("/api/tapet-context-config"),{popup:e}=await i.json(),t=window.location.pathname,n=e.find(s=>s.identifier===t);return n?`&context=${encodeURIComponent(n.context)}`:""}catch(i){return _(i),""}},Br=async()=>{let{namespace:i,marketingTitleCode:e,credentialsId:t="",tapetOrigin:n="",tapetContextCsv:s,articleId:o="",sectionId:r=""}=window.lclClientConfig,a=t,l=T("bnacid")||"",c=nn(),f=s==="true"?await Hr():qr(),d=new URL(`${i}/sdk.js`,`${n}/`);d.searchParams.set("clientId",l),d.searchParams.set("userId",a),d.searchParams.set("userGroup",c),d.searchParams.set("brand",e),d.searchParams.set("needsConsent","false"),f&&d.searchParams.set("context",new URLSearchParams(f).get("context")||""),d.searchParams.set("articleId",o||r||""),d.searchParams.set("articleUrl",window.location.href);let h=d.toString();Rr(h)},$r=()=>{(window.tapetSdk||[]).push(e=>e.init())},Vs=i=>{i&&i.remove(),ui=!1},zs=()=>{G(W.marketingAndContent).then(i=>{let e=document.querySelector(".bn-tapet");if(!i){Vs(e);return}F("bonniernews-reynolds",t=>{if(!t.enabled){Vs(e);return}t.enabled&&!ui&&(ui=!0,Br().catch(_))})}).catch(i=>{_(i)})},Ws=()=>{zs(),Li(zs)},Gs=()=>{if(R||ie||te)return;T("bad-freq-rmp")==="1"&&Ws()};window.initTapetPopup=()=>{R||ie||te||Ws()};var Ys=()=>{let i=document.querySelector(".color-scheme-modal-button"),e="appearance-modal";i&&i.addEventListener("click",t=>{let n=new CustomEvent(Zi(e),{bubbles:!0,detail:{focusAfter:i}});document.dispatchEvent(n)})};var Ur=()=>{let i=!!document.querySelector("#storytelling-switch-article-color-scheme:not(:checked)"),e=document.documentElement;if(i&&!P()){let n=document.querySelector("#storytelling-switch-article-color-scheme");e=n&&n.closest("article")||document.documentElement}let t=getComputedStyle(e);return{background:t.getPropertyValue("--color-background").trim(),color:t.getPropertyValue("--color-text").trim()}},Pe=i=>{let{background:e,color:t}=Ur();try{i.contentWindow&&i.contentWindow.postMessage({type:"betty:style",css:` 2 html, body, li.highlighted { 3 background-color: ${e} !important; 4 } 5 body, p, h1, h2, h3, h4, h5, h6, 6 li, dt, dd, label, legend, figcaption, 7 blockquote, th, td, caption, 8 span.description, .form_description, .label, 9 #main_body form li:not(.media_video, .file) div { 10 color: ${t} !important; 11 } 12 `},"*")}catch{}},Js=!1,Vr=()=>{let i=P(),e=i||Js!==i;return Js=i,e},pi=()=>{Vr()&&document.querySelectorAll("iframe").forEach(Pe)},fi=i=>{i.addEventListener("load",()=>{P()&&(Pe(i),setTimeout(()=>Pe(i),300),setTimeout(()=>Pe(i),1e3),setTimeout(()=>Pe(i),2e3))})},Ks=()=>{pi(),document.querySelectorAll("iframe").forEach(fi),new MutationObserver(i=>
12{i.forEach(({addedNodes:e})=>{e.forEach(t=>{t.nodeName==="IFRAME"?fi(t):t.querySelectorAll&&t.querySelectorAll("iframe").forEach(fi)})})}).observe(document.body,{childList:!0,subtree:!0}),new MutationObserver(pi).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),document.addEventListener("change",i=>{i.target&&i.target.id==="storytelling-switch-article-color-scheme"&&pi()})};var zr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Wr(i){let e=new Date,t=zr.indexOf(i),n=new Date(e.setDate(e.getDate()-t));return`${n.getFullYear()}${Math.floor(n.getMonth()/2)}`}function Gr(i){return i!=null&&typeof i.then=="function"}function Xs(i,e){return Gr(i)?i.then(e):e(i)}function Yr(i,{hashFunction:e,toBase64Function:t,toHexFunction:n}){return Xs(e(i),s=>{let[o]=t(s),r=Wr(o);return Xs(e(i+r),n)})}var Qs=Yr;var Jr=async i=>window.crypto.subtle.digest("SHA-256",new TextEncoder().encode(i)).then(e=>Array.from(new Uint8Array(e))),Kr=i=>i.map(e=>e.toString(16).padStart(2,"0")).join(""),Xr=i=>{let e=i.map(t=>String.fromCharCode(t)).join("");return window.btoa(e)},Qr=i=>{if(window.crypto)return Qs(i,{hashFunction:Jr,toBase64Function:Xr,toHexFunction:Kr})},Zr=()=>{let i=z();return i?i.user.id||i.sub:null},ea=async()=>{let i=Zr();return i?Qr(`bn-ppid:${i}`):""},ta=()=>{window.ppid=ea},Zs=ta;var eo=()=>{let i=z(),e=window.lclClientConfig||{};if(e.isLoggedIn=!!i,i){let{user:{namespace:t,id:n},email:s}=i;e.credentialsId=`${t}://${n}`,e.userEmail=s}};var ia="plusALLT_fi",to=()=>{let i=document.querySelector(".site-header__plus-allt-button");if(!i)return;let e=z();if(!e)return;let{allEntitlements:t}=e;if(!t||!t.includes(ia))return;let n=i.cloneNode(!0);n.setAttribute("context","hbl"),i.replaceWith(n)};var na=(i,e)=>e.includes(i),io=()=>{let i="gd_nt_web",e=ki("bnidtoken");if(!e)return;let{allEntitlements:t}=e;window.didomiOnReady.push(()=>{na(i,t)&&Ti()})};var no=u(g()),Me=class extends no.default{parsedCallback(){m({element:this,moduleFileName:"geoguessr-module.js"})}};var so=u(g()),bt=class extends so.default{parsedCallback(){m({element:this,moduleFileName:"content-broker-module.js"})}};var sa=i=>{let e=document.createElement("meta");e.setAttribute("name","bad:device"),e.setAttribute("content",i),document.head.appendChild(e);let t=R?"ios":ie?"android":"";if(t&&!window.lclClientConfig.isGenerikApp){let n=document.createElement("meta");n.setAttribute("name","bad:app"),n.setAttribute("content",t),document.head.appendChild(n)}},oa=i=>{let e=document.createElement("script");return e.src=i,e.type="module",document.head.appendChild(e),e},oo=()=>{if(window.lclClientConfig.adsEnabled){let i=window.lclClientConfig.badScriptUrl,e=window.lclClientConfig.isDevice==="m"?"mobile":"desktop";sa(e),oa(i),window.bamData=window.lclClientConfig.bam&&window.lclClientConfig.bam.bamData[e]}};var ro=u(g());var _t=class extends ro.default{connectedCallback(){m({element:this,moduleFileName:"theme-toggler-module.js"})}};var ao=()=>{window.addEventListener("@seenthis_metric",i=>{let e=ra(i.detail);e&&e.length>0&&e.forEach(t=>{window.dataLayer.push(t)})})};function ra(i){let{secureBaseUrl:e}=window.lclClientConfig,t=[],{name:n,mode:s,storyKey:o,videoId:r,duration:a,totalDuration:l}
12=i,c=l&&Math.round(l*1e3),f=a===void 0?void 0:Math.round(a*1e3),d=i?.extended?.meta?.title,h=s===2,{muted:w,visible:p}=i.extended||{},v={title:d,playlist:{id:o},id:{value:r},mediaLength:c,mediaType:"video",canonicalUrl:e,playerName:"Seenthis",content:{id:r,system:"Seenthis"},time:{currentTime:f,percent:void 0},fullscreen:h,muted:w,visible:p},E={onvideostarted:[{contentType:"all",eventType:"start",time:{percent:"0%"},events:["video all start"]},{contentType:"content",eventType:"start",time:{percent:"0%"},events:["video content start"]}],onvideoended:{contentType:"content",eventType:"milestone",time:{percent:"100%"},events:["video content milestone"]},onprogress25:{contentType:"content",eventType:"milestone",time:{percent:"25%"},events:["video content milestone"]},onprogress50:{contentType:"content",eventType:"milestone",time:{percent:"50%"},events:["video content milestone"]},onprogress75:{contentType:"content",eventType:"milestone",time:{percent:"75%"},events:["video content milestone"]},onprogress90:{contentType:"content",eventType:"milestone",time:{percent:"90%"},events:["video content milestone"]},adimpression:{contentType:"ad",eventType:"start",time:{percent:"0%"},events:["video ad start"]},adcomplete:{contentType:"ad",eventType:"milestone",time:{percent:"100%"},events:["video ad milestone"]},onvideopulse:{contentType:"content",eventType:"pulse",time:{percent:void 0},events:["video content pulse"]},onvideoplay:{contentType:"content",eventType:"interaction",interaction:{isInteraction:!0,name:"resume"},events:["video content interaction"]},onvideopause:{contentType:"content",eventType:"interaction",interaction:{isInteraction:!0,name:"pause"},events:["video content interaction"]},onmutechanged:{contentType:"content",eventType:"interaction",interaction:{isInteraction:!0,name:w?"mute":"unmute"},events:["video content interaction"]}}[n];if(E&&(Array.isArray(E)?E:[E]).forEach(I=>{let O={...v,contentType:I?.contentType,eventType:I?.eventType,time:{...v?.time,...I?.time},interaction:I?.interaction,fullscreen:I?.fullscreen??v?.fullscreen,mediaIndex:I?.mediaIndex};if(h||I?.fullscreen){if(n==="onvideostarted"&&f>0)return;n!=="onvideoended"&&t.push(...I.events.map(Ne=>({event:Ne,media:O}))),n==="onvideoended"&&Math.round(a)===Math.round(l)&&t.push(...I.events.map(Fe=>({event:Fe,media:O})))}}),t.length!==0)return t}var lo=u(g());var yt=class extends lo.default{connectedCallback(){m({element:this,moduleFileName:"login-link-module.js"})}};var co=u(g());var Et=class extends co.default{connectedCallback(){m({element:this,moduleFileName:"trackable-accordion-module.js"})}};var mo=u(g());var kt=class extends mo.default{connectedCallback(){m({element:this,moduleFileName:"bonnier-form-module.js"})}};var ho=u(g());var Ct=class extends ho.default{connectedCallback(){m({element:this,moduleFileName:"video-player-module.js"})}};var D=window.lclClientConfig||{},po="autoLoginAttempt",aa=()=>{try{let i=D.autoLoginDomains;return i?JSON.parse(i):[]}catch{return[]}},la=["expressen.se","dn.se"],ca=[...aa(),...la],gi="AutoLoginAttempt",fo=()=>{try{return window.localStorage.getItem(gi)}catch{return null}},da=()=>{try{let i=Date.now()+864e5;window.localStorage.setItem(gi,i.toString())}catch(i){_(i)}},uo=()=>{try{window.localStorage.removeItem(gi)}catch(i){_(i)}},ma=()=>{let i=fo();if(!i)return!0;let e=Number.parseInt(i,10);return Date.now()>e},ha=()=>{document.documentElement.dataset.autoLogin="true",setTimeout(()=>{delete document.documentElement.dataset.autoLogin},5e3)},ua=i=>{try{let e=new URL(i,window.location.origin),t=window.location.hostname;return e.hostname===t?{internal:!0,trusted:!0}:{internal:!1,trusted:ca.some(n=>e.hostname===n||e.hostname.endsWith(`.${n}`))}}catch{return{internal:!1,trusted:!1}}},pa=(i=3e3)=>Promise.race([De(),new Promise(e=>setTimeout(()=>e(null),i))]),fa=async(i,e)=>{try{if(e){if(ma()&&uo(),fo()||!await pa(3e3))return!1;if(!await G(W.functional))return uo(),!1;da()}let t=new URL(i);t.searchParams.set(po,"true"),D.bnSource&&t.searchParams.set("bnSource",D.bnSource);let n=`${window.lclClientConfig.idServiceOrigin}/autologin?returnUri=`+encodeURIComponent(t.toString());return window.location.href=n,!0}catch(t){return _(t),!1}},go=()=>{J||window.generikApp||!D.autoLoginEnabled||D.namespace==="hbl"||D.isFailover||((D.isLoggedIn||D.env==="development")&&new URLSearchParams(window.location.search).get(po)==="true"&&ha(),(document.querySelectorAll("a")||[]).forEac
12h(i=>{i.addEventListener("click",async e=>{if(!i.href)return;let t=ua(i.href);if(!t||!t.trusted||t.internal&&D.isLoggedIn)return;try{if(new URL(i.href).pathname==="/logga-in")return}catch{return}e.preventDefault(),await fa(i.href,t.internal)||(window.location.href=i.href)})}))};var wo=u(g());var Tt=class extends wo.default{static get observedAttributes(){return["active-tab"]}connectedCallback(){m({element:this,moduleFileName:"tab-panel-module.js"})}attributeChangedCallback(e,t,n){let s=this._module;s&&s.attributeChangedCallback(e,t,n)}};var vo=function(i){if((window.lclClientConfig||{}).viewTransitionEnabled!=="true")return;let e=i||{},t={duration:e.duration!==void 0?e.duration:300,fallback:e.fallback!==void 0?e.fallback:"fade",respectReducedMotion:e.respectReducedMotion!==void 0?e.respectReducedMotion:!0,onBeforeTransition:e.onBeforeTransition!==void 0?e.onBeforeTransition:null,onAfterTransition:e.onAfterTransition!==void 0?e.onAfterTransition:null},n="startViewTransition"in document,s="navigation"in window,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=function(){return n&&!(t.respectReducedMotion&&o)},a=function(d,h){let w=new URL(d).pathname,p=new URL(h).pathname,v=w.split("/").filter(Boolean).length,y=p.split("/").filter(Boolean).length,E=y>v?"forward":y<v?"back":"same";document.documentElement.dataset.vtFrom=w,document.documentElement.dataset.vtTo=p,document.documentElement.dataset.vtDirection=E},l=function(){let d=document.documentElement.dataset;delete d.vtFrom,delete d.vtTo,delete d.vtDirection},c=function(d){return(document.querySelector("[data-vt-container]")||document.querySelector("main")||document.body).animate([{opacity:1},{opacity:0}],{duration:t.duration/2,easing:"ease-in",fill:"forwards"}).finished.then(()=>{d()})},f=function(d,h){let w=h||{},p=location.href;return t.onBeforeTransition&&t.onBeforeTransition(p,d),w.direction?document.documentElement.dataset.vtDirection=w.direction:a(p,d),r()?document.startViewTransition(()=>{location.href=d}).finished.then(()=>{l(),t.onAfterTransition&&t.onAfterTransition(p,d)},()=>{l(),t.onAfterTransition&&t.onAfterTransition(p,d)}):t.fallback==="fade"?c(()=>{location.href=d}).then(()=>{t.onAfterTransition&&t.onAfterTransition(p,d)}):(t.onAfterTransition&&t.onAfterTransition(p,d),location.href=d,Promise.resolve())};return s&&window.navigation.addEventListener("navigate",d=>{if(!(!d.canIntercept||d.hashChange||d.downloadRequest))try{a(location.href,d.destination.url)}catch{}}),!n&&t.fallback==="fade"&&(document.documentElement.classList.add("vt-entering"),window.addEventListener("DOMContentLoaded",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.documentElement.classList.remove("vt-entering")})})})),{supported:n,active:r(),config:Object.freeze(Object.assign({},t)),navigate:function(d,h){return f(new URL(d,location.href).href,h)}}};var Lt=class extends HTMLElement{connectedCallback(){this._update=this._update.bind(this),window.addEventListener("scroll",this._update,{passive:!0}),this._update(),this._scrollGutter=window.innerWidth-document.documentElement.clientWidth;let e=this.querySelector("lcl-disclose");e&&(e.addEventListener("lcl-disclose:open",this._open.bind(this)),e.addEventListener("lcl-disclose:close",this._close.bind(this))),document.querySelectorAll("lcl-disclose[ispopup]").forEach(t=>{t.addEventListener("lcl-disclose:open",()=>{this._positionPopup(t),this._startTrackingPopup(t)}),t.addEventListener("lcl-disclose:close",()=>{this._stopTrackingPopup(t);let n=t.querySelector(".site-nav__sub-links");
12n&&(n.style.position="",n.style.top="",n.style.left="")})})}disconnectedCallback(){cancelAnimationFrame(this._raf),window.removeEventListener("scroll",this._update),this._activePopupListeners&&this._activePopupListeners.forEach((e,t)=>{this._stopTrackingPopup(t)})}_startTrackingPopup(e){this._activePopupListeners||(this._activePopupListeners=new Map);let t=()=>this._positionPopup(e);window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t,{passive:!0}),this._activePopupListeners.set(e,t)}_stopTrackingPopup(e){if(!this._activePopupListeners)return;let t=this._activePopupListeners.get(e);t&&(window.removeEventListener("scroll",t),window.removeEventListener("resize",t),this._activePopupListeners.delete(e))}_positionPopup(e){let t=e.querySelector(".site-nav__links-btn"),n=e.querySelector(".site-nav__sub-links");if(!t||!n)return;let s=t.getBoundingClientRect();n.style.position="fixed",n.style.top=`${Math.round(s.bottom)}px`,n.style.left=`${Math.round(s.left)}px`,n.style.zIndex="9999";let o=n.offsetHeight,a=window.innerHeight*.8,l=Math.round(s.bottom)+o;n.classList.toggle("site-nav__sub-links--overflow",l>=a)}_open(e){document.documentElement.classList.add("no-scroll"),this._update()}_close(e){document.documentElement.classList.remove("no-scroll"),cancelAnimationFrame(this._raf)}_update(){cancelAnimationFrame(this._raf),this._raf=requestAnimationFrame(()=>this._measure())}_measure(){let e=this.querySelector("[data-panel]");if(!e)return;let n=(this.closest(".site-nav")||this).getBoundingClientRect(),s=this.getAttribute("container-selector")||".site-nav__inner",o=this.closest(s)||document.querySelector(s),r;o&&(r=o.getBoundingClientRect());let a=window.innerWidth,l=e.style;l.position="fixed",l.top=`${Math.round(n.bottom)}px`,r?l.right=`${Math.round(a-r.right-this._scrollGutter)}px`:l.right="0"}};var bo=u(g());var St=class extends bo.default{connectedCallback(){m({element:this,moduleFileName:"chatbot-module.js"})}};var _o=()=>{let i=document.querySelector(".site-mastermind-toggle");i&&i.addEventListener("click",()=>{let e=new CustomEvent("lcl-modal:open:site-mastermind-modal",{bubbles:!0,detail:{focusAfter:i}});document.dispatchEvent(e)})};var yo=()=>{(window.lclClientConfig||{}).stickyHeaderEnabled==="true"&&document.documentElement.classList.contains("sticky-header")&&(document.documentElement.querySelector(".site-nav.app-menu")||document.addEventListener("DOMContentLoaded",()=>{let i=document.querySelector(".site-nav");if(!i)return;let e=document.querySelector("[data-scroll]")||window,t=i.offsetHeight,n=i.getBoundingClientRect().top+(e===window?window.scrollY:e.scrollTop),s=10,o=e===window?window.scrollY:e.scrollTop,r=!1,a=document.createElement("div");a.style.height=t+"px",a.style.display="none",i.parentNode.insertBefore(a,i),i.style.transition="transform 0.3s ease";let l=()=>{i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.right="0",i.style.zIndex="100",a.style.display="block"},c=()=>{i.style.position="",i.style.top="",i.style.left="",i.style.right="",i.style.zIndex="",i.style.transform="",a.style.display="none"};e.addEventListener("scroll",()=>{r||(r=!0,requestAnimationFrame(()=>{let f=e===window?window.scrollY:e.scrollTop,d=f-o,h=d>0;f<=n?c():(l(),h&&d>s?i.style.transform=`translateY(-${t}px)`:h||(i.style.transform="")),o=f,r=!1}))},{passive:!0})}))};var ko=u(g());var ga="article-flow-read-articles",wa=new Set(["matchy","matchy personalized","content-broker-widget local","content-broker-widget plusallt","matchy sport local","matchy sport plusallt","algo","read-by-others"]),Co="related-article-ab-test-override",va={A:"story",B:"read-by-others",C:"matchy",D:"matchy personalized",E:"algo",F:"content-broker-widget local",G:"content-broker-widget plusallt",H:"matchy sport local",I:"matchy sport plusallt"},ba={matchy:"Mer att l\xE4sa","matchy personalized":"Mer f\xF6r dig","content-broker-widget local":"Mer sport","content-broker-widget plusallt":"Mer sport","matchy sport local":"Mer sport","matchy sport plusallt":"Mer sport",story:"Relaterat",algo:"Toppnyheter","read-by-others":"Andra l\xE4ser"},Eo={"content-broker-widget local":"a13a657a-c5e9-4941-ba2a-eec1a736306f","content-broker-widget plusallt":"1141bdc7-ed5d-4eaa-a3b7-156cefa6b54a"},To=()=>{let i=T(Co);return i?i.toUpperCase():null},_a=()=>{let i=To();return i&&va[i]||null},wi=class extends ko.default{parsedCallback(){this._container=this.querySelector(".related-articles__content"),this._skeleton=this.querySelector(".related-articles__skeleton"),this._articleId=this.dataset.articleId,this._articleLinkUrl=this.dataset.articleLinkUrl,this._isAbTest=this.dataset.isAbTest==="true",this._storyId=this.dataset.storyId,this._mode=this.dataset.mode,this._title=this.dataset.title,this._impressionTracked=!1,this._impressionObserver=null;let e=_a();if(this._isOverride=!!e,e&&(this._isAbTest=!0,this._mode=e,this._title=ba[e]||this._title,this._renderOverrideBanner()),!["matchy","matchy personalized","content-broker-widget local","content-broker-widget plusallt","matchy sport local","matchy sport plusallt","story","algo","read-by-others"].includes(this._mode)){this._remove(`Ogiltigt l\xE4ge: "${this._mode}"`);return}if(!this._articleId||!this._mode){this._remove(this._articleId?"Saknar mode":"Saknar articleId");return}this._initLazyFetch()}_initLazyFetch(){this._lazyFetchObserver=new IntersectionObserver(e=>{e.forEach(t=>{t.isIntersecting&&(this._lazyFetchObserver.disconnect(),this._fetchRelatedArticles())})},{rootMargin:"100%"}),this._lazyFetchObserver.observe(this)}_resolveEndpoint(){switch(this._mode){case"matchy":return"/api/related-articles/matchy-sim
12ilar";case"matchy personalized":return"/api/related-articles/matchy-personalized";case"content-broker-widget local":return"/api/related-articles/content-broker-widget";case"content-broker-widget plusallt":return"/api/related-articles/content-broker-widget?plusallt=true";case"matchy sport local":return"/api/related-articles/matchy-sport";case"matchy sport plusallt":return"/api/related-articles/matchy-sport?plusallt=true";case"story":return"/api/related-articles/story";case"algo":return"/api/related-articles/algo";case"read-by-others":return"/api/related-articles/read-by-others";default:return null}}_getViewedArticleIds(){try{let e=sessionStorage.getItem(ga);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:t.viewedArticles||[]}catch{return[]}}async _fetchRelatedArticles(){try{let e=this._resolveEndpoint();if(!e){this._remove(`Ingen endpoint f\xF6r l\xE4ge: "${this._mode}"`);return}let t=new URL(e,window.location.origin);if(t.searchParams.set("articleId",this._articleId),this._articleLinkUrl&&t.searchParams.set("articleLinkUrl",this._articleLinkUrl),this._storyId&&t.searchParams.set("storyId",this._storyId),wa.has(this._mode)){let a=this._getViewedArticleIds();a.length&&t.searchParams.set("excludeArticleIds",JSON.stringify(a))}this._title&&t.searchParams.set("title",this._title),this._isOverride&&t.searchParams.set("debug","true"),console.log("[related-articles] fetching",t.toString());let n=await fetch(t.toString());if(!n.ok){console.warn("[related-articles] server error",n.status,n.statusText,t.toString()),this._remove(`Serverfel ${n.status} ${n.statusText}`);return}let{html:s,debugCurl:o,resolvedMode:r}=await n.json();if(r&&(this._mode=r),this._curlPre&&(this._curlPre.textContent=o||"(ingen debug-info fr\xE5n servern)"),!s){console.warn("[related-articles] empty response (no html)",t.toString()),this._remove("Tom respons fr\xE5n API (inget html)");return}this._hideSkeleton(),this._renderContent(s),this._initImpressionTracking()}catch(e){console.error("Failed to fetch related articles:",e),this._remove(`Fetch-fel: ${e instanceof Error?e.message:String(e)}`)}}_renderContent(e){if(this._container){let t=document.createRange().createContextualFragment(e);this._container.appendChild(t),this._container.classList.remove("related-articles__content--hidden"),this._initTeaserLinkTracking()}}_initImpressionTracking(){this._impressionObserver=new IntersectionObserver(e=>{e.forEach(t=>{t.isIntersecting&&!this._impressionTracked&&(this._impressionTracked=!0,this._impressionObserver.disconnect(),this._trackImpression(),this._trackAbTest())})},{threshold:.5}),this._impressionObserver.observe(this)}_initTeaserLinkTracking(){if(!this._container)return;let e=this._container.querySelectorAll("a[href]"),t=String(e.length);e.forEach((n,s)=>{n instanceof HTMLAnchorElement&&n.addEventListener("click",()=>{this._trackTeaserLinkClick({index:String(s+1),range:t,title:n.dataset.articleTitle||(n.textContent?n.textContent.trim():""),url:n.href})})})}_trackImpression(){b({element:this,eventName:"related-articles-impression",data:{mode:this._mode,blockTitle:this._title,isAbTest:this._isAbTest}})}_trackAbTest(){this._isAbTest&&b({element:this,eventName:"related-articles-ab-test",data:{mode:this._mode,blockTitle:this._title}})}_trackTeaserLinkClick({index:e,range:t,title:n,url:s}){b({element:this,eventName:"related-articles-link-click",data:{mode:this._mode,index:e,range:t,title:n,url:s,blockTitle:this._title,isAbTest:this._isAbTest}})}_renderOverrideBanner(){let e=To(),t=this.querySelector(".related-articles");if(!t||!e)return;let n=document.createElement("div");n.className="related-articles__test-grp-override";let s=Eo[this._mode];n.innerHTML=`Forcerad grp: <br>${e} (${this._mode})${s?`<br>Widget-ID: ${s}`:""}<br>`;let o=document.createElement("button");o.textContent="Ta bort override",o.style.marginTop="5px",o.style.fontSize="12px",o.addEventListener("click",()=>{Ei(Co,{path:"/"}),window.location.reload()}),n.appendChild(o);let r=document.createElement("details");r.style.marginTop="6px";let a=document.createElement("summary");a.style.cssText="cursor:pointer;font-size:11px;",a.textContent="Visa cURL";let l=document.createElement("pre");l.style.cssText="font-size:10px;white-space:pre-wrap;word-break:break-all;margin:4px 0 0;",l.textContent="V\xE4ntar p\xE5 anrop\u2026",r.appendChild(a),r.appendChild(l),n.appendChild(r),this._curlPre=l,t.prepend(n)}_hideSkeleton(){this._skeleton&&this._skeleton.remove()}_remove(e="Ok\xE4nd anledning"){if(this._lazyFetchObserver&&this._lazyFetchObserver.disconnect(),this._impressionObserver&&this._impressionObserver.disconnect(),this._isOverride){this._hideSkeleton(),this._showOverrideNoTeaserReason(e);return}this.remove()}_showOverrideNoTeaserReason(e){if(!this._container)return;let t=document.createElement("div");t.className="related-articles__test-grp-override",t.style.margin="12px 0";let n=Eo[this._mode];if(n){let s=document.createElement("a");s.href=`https://joja.bonniernews.se/edit/poof-widget/${n}?view=list`,s.target="_blank",s.rel="noopener",s.textContent=`\xD6ppna widget ${n} i Joja`,t.appendChild(document.createTextNode(`Inga teasers visas. Anledning: ${e}. `)),t.appendChild(s),t.appendChild(document.createTextNode(" (Detta ser bara du \u2014 du har satt en lokal kaka s
12om overridar testgrupp.)"))}else t.textContent=`Inga teasers visas. Anledning: ${e}. (Detta ser bara du \u2014 du har satt en lokal kaka som overridar testgrupp.)`;this._container.appendChild(t),this._container.classList.remove("related-articles__content--hidden")}},Lo=wi;var So=u(g());var Oe=class extends So.default{parsedCallback(){m({element:this,moduleFileName:"icon-trim-module.js"})}};var Ao=u(g());var At=class extends Ao.default{connectedCallback(){m({element:this,moduleFileName:"stories-strip-module.js"})}};var Io=u(g());var It=class extends Io.default{connectedCallback(){/NWT (iOS|Android)/i.test(navigator.userAgent)&&m({element:this,moduleFileName:"app-update-notice-module.js"})}};var xo=(i,e)=>{xi({event:i,eventParams:{category:"valet 2026"},engagement:{type:"click",component:{name:e}}})},Po=()=>{window.addEventListener("message",i=>{if(i.origin!=="https://valkompassen.api.tt.se"||i.data?.source!=="valkompassen.api.tt.se"||typeof i.data!="object")return;let e;switch(i.data.event){case"sections_selected":e=i.data?.message?.sections?.[0]==="speed"?"snabbkompass":"standardkompass",xo("valkompass start",e);break;case"results_available":e=i.data?.message?.result?.categories?.[0]?.id==="speed"?"snabbkompass":"standardkompass",xo("valkompass complete",e);break}})};var U=i=>class extends Mo.default{parsedCallback(){m({element:this,moduleFileName:i})}};Vi();$i();Ci();io();cn();ks();rn(window.lclClientConfig||{});window.customElements.define("lcl-ad",ce);window.customElements.define("lcl-article-flow-item",ue);window.customElements.define("lcl-article-flow",he);window.customElements.define("lcl-button",pt);window.customElements.define("lcl-disclose",Ge);window.customElements.define("lcl-disclosetoggle",pe);window.customElements.define("lcl-share",Ke);window.customElements.define("lcl-ios-deprecated-notice",Ye);window.customElements.define("lcl-jsonly",fe);window.customElements.define("lcl-tapet-paywall",dt);window.customElements.define("lcl-push-settings",Je);window.customElements.define("lcl-resource",be);window.customElements.define("lcl-base-embed",U("base-embed-module.js"));window.customElements.define("lcl-iframe-embed",U("iframe-embed-module.js"));window.customElements.define("lcl-ifragasatt-embed",U("ifragasatt-embed-module.js"));window.customElements.define("lcl-google-maps-image-embed",U("google-maps-image-embed-module.js"));window.customElements.define("lcl-machforms-embed",U("machforms-embed-module.js"));window.customElements.define("lcl-riddle-embed",U("riddle-embed-module.js"));window.customElements.define("lcl-flowplayer-resource",_e);window.customElements.define("lcl-staylive-resource",ye);window.customElements.define("lcl-collapse-container",ut);window.customElements.define("lcl-welcome-deprecated",de);window.customElements.define("lcl-welcome",me);window.customElements.define("lcl-content-discovery",Ee);window.customElements.define("lcl-strossle2",ke);window.customElements.define("lcl-scroll-to-top",it);window.customElements.define("lcl-newsletter-button",nt);window.customElements.define("lcl-newsletter-widget",at);window.customElements.define("lcl-modal",ps);window.customElements.define("lcl-kidnapper",ot);window.customElements.define("lcl-jobads",Te);window.customElements.define("lcl-search",Ce);window.customElements.define("lcl-bonnier-form",kt);window.customElements.define("lcl-lightbox",st);window.customElements.define("lcl-carousel",rt);window.customElements.define("lcl-reader",U("reader-module.js"));window.customElements.define("lcl-modal-container",en);window.customElements.define("lcl-receipt-modal",lt);window.customElements.define("lcl-follow-modal",ct);window.customElements.define("lcl-follow-button",Se);window.customElements.define("lcl-login-link",yt);window.customElements.define("lcl-load-content",Ae);window.customElements.define("lcl-notification-badge",Ie);window.customElements.define("lcl-tabs",xe);window.customElements.define("lcl-follow-modification",mt);window.customElements.define("lcl-crossword",ht);window.customElements.define("lcl-morreman-blob",ft);window.customElements.define("lcl-theme-toggler",_t);window.customElements.define("lcl-slideshow",gt);window.customElements.define("lcl-fixed-header",wt);window.customElements.define("lcl-color-scheme-toggle",vt);window.customElements.define("lcl-geoguessr",Me);window.customElements.define("lcl-content-broker",bt);window.customElements.define("lcl-trackable-accordion",Et);window.customElements.define("lcl-video-player",Ct);window.customElements.define("lcl-tab-panel",Tt);window.customElements.define("lcl-full-menu",Lt);window.customElements.define("lcl-chatbot",St);window.customElements.define("lcl-related-articles",Lo);window.customElements.define("lcl-icon-trim",Oe);window.customElements.define("lcl-stories-strip",At);window.customElements.define("lcl-app-update-notice",It);addEventListener("DOMContentLoaded",()=>{window.document.querySelector("bn-plusallt-widget")&&import("./widget-74XXOTIW.js").then(i=>{window.customElements.define("bn-plusallt-widget",i.default)}).catch(console.warn)});window.requestIdleCallback(()=>Qi());window.requestIdleCallback(()=>Xi());window.requestIdleCallback(()=>Tn());eo();to();gn({bnDataLayerName:"dataLayer",gtmDataLayerName:"dl1749641053928"});kn();bn();Ii();sn();An();On();Ss();Jn();Ln();Sn();In();an();ao();Po();Ys();Gi();Ks();Zs();Gs();oo();go();vo();_o();yo(); 13/*! Bundled license information: 14 15tua-body-scroll-lock/dist/tua-bsl.mjs: 16 (** 17 * tua-body-scroll-lock v1.6.3 18 * (c) 2026 Evinma, BuptStEve 19 * @license MIT 20 *) 21*/ 22//# sourceMappingURL=main-Q3MTAF4I.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.