PageSourceSearch

https://www.vi.se/_next/static/chunks/6320-0f9f9aafa95e787d.js

js vi.se collected 2026-09-24 19:50:30 UTC 66,038 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6320],{2430:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return a}});var n=i(7437),s=i(2134);function a(e){let{children:t,post:i,ifUserHasAccess:a,ifUserIsMember:l,ifNoPaywall:r,ifPaywall:o,otherwise:c}=e,d=(0,s.Z)(i),u=d.getPaywall();if(!0===l&&d.isMember()||!0===a&&d.hasAccess())return t;if(!0===r){if(!u.active)return t}else if(!0===o&&u.active)return t;return c||(0,n.jsx)(n.Fragment,{})}},2400:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return r}});var n=i(7437),s=i(6393),a=i(2134),l=i(8596);function r(e){var t;let{post:i}=e,{data:r}=(0,a.Z)(i),{data:o}=(0,l.Z)(),{registrationUrl:c,title:d}=null!==(t=null==r?void 0:r.accessInfo)&&void 0!==t?t:{};return c&&(null==o?void 0:o.checkout)?(0,n.jsxs)("section",{className:"Access-info",children:[(0,n.jsx)("div",{className:"Access-info__inner",children:d}),(0,n.jsx)("div",{className:"Access-info__inner",children:o.checkout.access_info_header}),(0,n.jsx)("div",{className:"Access-info__inner",children:o.checkout.access_info_message}),(0,n.jsx)(s.default,{onClick:function(){window.location.assign(c)},isCta:!0,className:"Access-info__inner__button",children:(0,n.jsx)("span",{children:o.checkout.access_info_cta_label})})]}):(0,n.jsx)(n.Fragment,{})}i(1504)},3031:function(e,t,i){"use strict";i.d(t,{default:function(){return o}});var n=i(7437),s=i(2265),a=i(2021),l=i(9733);let r=[];function o(e){var t,i,o,c,d,u,m,h;let{post:_,fixed:f}=e,{post_id:v}=_,p=function(){let{data:e,isLoading:t}=(0,l.Z)("/api/modules/admin_sharer");return{data:e||r,isLoading:t,getLink:i};async function i(e){var t;let{post_id:i,sharer_id:n,expiry:s}=e,a=new URLSearchParams({post_id:i,sharer_id:n,ts:s}).toString(),l=await fetch("/api/modules/admin_sharer?".concat(a),{method:"POST"}),{link:r}=null!==(t=await l.json())&&void 0!==t?t:{};return r||null}}(),[x,j]=(0,s.useState)(),[g,w]=(0,s.useState)(),[b,N]=(0,s.useState)(0),{showMessage:y}=(0,a.Z)();async function S(e){var t;e.preventDefault();let i=await fetch(x,{method:"POST"}),{link:s,article_url:a,shareable_story_id:l}=null!==(t=await i.json())&&void 0!==t?t:{};s&&y({heading:"Delning!",text:(0,n.jsxs)("small",{children:[(0,n.jsx)("p",{children:(0,n.jsx)("b",{children:"L\xe4nk:"})}),(0,n.jsx)("p",{children:(0,n.jsx)("span",{children:s})}),(0,n.jsx)("p",{children:(0,n.jsx)("b",{children:"Firebase Custom data:"})}),(0,n.jsxs)("p",{children:[(0,n.jsx)("b",{children:"article_url"})," ",(0,n.jsx)("br",{})," ",(0,n.jsx)("span",{children:a})]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("b",{children:"shareable_story_id"})," ",(0,n.jsx)("br",{})," ",(0,n.jsx)("span",{children:l})]})]})})}return(0,s.useEffect)(()=>{if(g&&b){let e=new URLSearchParams({post_id:v,sharer_id:g,ts:b}).toString();j("/api/modules/admin_sharer?".concat(e))}},[g,b]),(0,n.jsxs)("div",{className:"AdminBarSharer",children:[(0,n.jsxs)("select",{onChange:function(e){w(e.target.value)},children:[(0,n.jsx)("option",{children:"-- Skapa delning"}),(0,n.jsx)("optgroup",{label:"Betalv\xe4gg",children:null===(i=p.data)||void 0===i?void 0:null===(t=i.paywall)||void 0===t?void 0:t.map(e=>(0,n.jsxs)("option",{value:e.sharer_id,children:[" ",e.sharer_name," "]},e.sharer_id))}),(0,n.jsx)("optgroup",{label:"Standard",children:null===(c=p.data)||void 0===c?void 0:null===(o=c.standard)||void 0===o?void 0:o.map(e=>(0,n.jsxs)("option",{value:e.sharer_id,children:[" ",e.sharer_name," "]},e.sharer_id))}),(0,n.jsx)("optgroup",{label:"Redakt\xf6rer",children:null===(u=p.data)||void 0===u?void 0:null===(d=u.editor)||void 0===d?void 0:d.map(e=>(0,n.jsxs)("option",{value:e.sharer_id,children:[" ",e.sharer_name," "]},e.sharer_id))}),(0,n.jsx)("optgroup",{label:"Skribenter",children:null===(h=p.data)||void 0===h?void 0:null===(m=h.writer)||void 0===m?void 0:m.map(e=>(0,n.jsxs)("option",{value:e.sharer_id,children:[" ",e.sharer_name," "]},e.sharer_id))})]}),g?(0,n.jsxs)("select",{onChange:function(e){N(e.target.value)},children:[(0,n.jsx)("option",{children:"-- Giltighetstid"}),(0,n.jsx)("option",{value:864e5,children:" 1 dag "}),(0,n.jsx)("option",{value:6048e5,children:" 1 vecka "}),(0,n.jsx)("option",{value:26784e5,children:" 1 m\xe5nad "}),(0,n.jsx)("option",{value:80352e5,children:" 3 m\xe5nad "}),(0,n.jsx)("option",{value:31536e6,children:" 1 \xe5r "}),(0,n.jsx)("option",{value:864e9,children:" f\xf6r alltid "})]}):null,x?(0,n.jsx)("a",{onClick:S,target:"_blank",children:"Skapa l\xe4nk"}):null]})}i(2491)},147:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return o}});var n=i(7437),s=i(2265),a=i(883);i(3822);var l=i(1226);i(5990),i(928);var r=i(2134);function o(e){var t;let{postType:i,post:o,hasPlate:c=!0,autoplay:d=!1,disabled:u=!1}
1=e,[m,h]=(0,s.useState)(!1),[_,f]=(0,s.useState)(0),v=(0,s.useRef)(null),p=(0,s.useRef)(!1),x=(0,r.Z)(),j=null==o?void 0:o.post_title;(0,s.useEffect)(()=>{var e,t,i,n,s;return v.current=document.getElementById("audio-track"),null===(e=v.current)||void 0===e||e.addEventListener("playing",w),null===(t=v.current)||void 0===t||t.addEventListener("pause",b),null===(i=v.current)||void 0===i||i.addEventListener("ended",N),null===(n=v.current)||void 0===n||n.addEventListener("timeupdate",y),(null===(s=v.current)||void 0===s?void 0:s.paused)?d&&S():w(),()=>{var e,t,i,n;null===(e=v.current)||void 0===e||e.removeEventListener("playing",w),null===(t=v.current)||void 0===t||t.removeEventListener("pause",b),null===(i=v.current)||void 0===i||i.removeEventListener("ended",N),null===(n=v.current)||void 0===n||n.removeEventListener("timeupdate",y),x.isLoggedIn()||N()}},[]);let g="Audio-player";function w(){var e;(null===(e=v.current)||void 0===e?void 0:e.title)===j?(window.setTimeout(()=>!0,3e3),p.current=!0,h(!0)):(p.current=!1,h(!1))}function b(){var e;(null===(e=v.current)||void 0===e?void 0:e.title)===j&&(p.current=!1,h(!1))}function N(){var e;(null===(e=v.current)||void 0===e?void 0:e.title)===j&&b()}function y(){var e,t,i,n;if((null===(e=v.current)||void 0===e?void 0:e.title)===j){null===(t=v.current)||void 0===t||t.duration;let e=null!==(n=null===(i=v.current)||void 0===i?void 0:i.currentTime)&&void 0!==n?n:0;window.setTimeout(()=>{f(e)},0)}}function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e&&e.preventDefault(),u)return;if(p.current){v.current.pause();return}let t=new CustomEvent("akka_play_track",{detail:{playlist:"",post:o}});window.dispatchEvent(t)}return c?g+=" Audio-player--has-plate":g+=" Audio-player--no-plate",u&&(g+=" Audio-player--disabled"),(0,n.jsxs)("div",{className:g,onClick:e=>e.preventDefault(),children:[(0,n.jsxs)("h2",{className:"Audio-player__heading",children:["Lyssna p\xe5 ","podcast"===i?"podden":"artikeln"]}),(0,n.jsxs)("div",{className:"Audio-player__player",children:[(0,n.jsx)("button",{"aria-label":"Spela upp",className:"Audio-player__play",onClick:S,children:m?(0,n.jsx)(l.dz,{}):(0,n.jsx)(l.sh,{})}),(0,n.jsx)(a.Z,{value:_,onChange:function(e){v.current.pause(),v.current.currentTime=parseFloat(e)},onAfterChange:function(){v.current.play(),window.setTimeout(()=>{p.current=!0,h(!0)},100)},step:.1,min:0,max:null===(t=v.current)||void 0===t?void 0:t.duration,tipFormatter:null})]})]})}},6221:function(e,t,i){"use strict";i.d(t,{Z:function(){return c}});var n=i(7437),s=i(3145),a=i(7648),l=i(3265);i(4157);var r=i(2247);function o(e){let{children:t,content:i,icons:s,tags:a}=e,l=Array.isArray(s)?s:[s],r=Array.isArray(a)?a:[a];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"ContentTags",children:[l.map((e,t)=>(0,n.jsx)("span",{className:"ContentTags__icons",children:e},t)),r.map((e,t)=>(0,n.jsx)("span",{className:"ContentTags__tags",children:e},t))]}),i]})}function c(e){var t;let{children:i,showBorder:c,icons:d,tags:u,post:m,size:h=null,number:_=null,imageOverlay:f=!0,hideWriters:v=!1}=e,{post_title:p,description:x,url:j,post_date:g,post_type:w,featured_image:b,meta:N,primary_category:y={}}=m,{audio_time_minutes:S,audio_file:k,display_time:E,writers:P=[]}=N,L="Blurb";h&&(L+=" Blurb--".concat(h)),j||(L+=" Blurb--no-link"),b||(L+=" Blurb--no-image"),"note"===w&&(L+=" Blurb--note"),c&&(L+=" Blurb--show-border"),null!=_&&(L+=" Blurb__numbered");let C=(0,r.g)(6,{medium:12}),F=null===(t=P[0])||void 0===t?void 0:t.post_title,Z=(0,n.jsxs)("div",{className:"Blurb__description",children:[F&&(0,n.jsx)("span",{className:"Blurb__writer",children:F}),S&&(0,n.jsxs)("span",{className:"Blurb__time",children:[S," min"]})]}),R=(0,n.jsxs)("div",{className:"Blurb__description",children:[(0,n.jsxs)("div",{className:"Blurb__tags",children:[x&&k&&(0,n.jsx)("span",{className:"Blurb__tags__item Blurb__tags__item--icon Blurb__tags__item--audio",children:(0,n.jsx)(l.Z,{})}),(null==y?void 0:y.name)&&(0,n.jsx)("span",{className:"Blurb__tags__item Blurb__tags__item--separator",children:null==y?void 0:y.name})]}),x]}),B=(0,n.jsxs)("div",{className:"Blurb__description",children:[(0,n.jsx)("div",{className:"Blurb__tags",children:F&&(0,n.jsx)("span",{className:"Blurb__tags__item Blurb__tags__item--separator",children:F})}),x]}),M=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"Blurb__description",children:x}
1),k&&(0,n.jsxs)("div",{className:"Blurb__audio",children:[(0,n.jsx)("div",{className:"Blurb__audio__icon",children:(0,n.jsx)(l.Z,{})}),(0,n.jsxs)("div",{className:"Blurb__audio__time",children:[E," min"]})]})]}),I=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"Blurb__description",children:[(0,n.jsx)("div",{className:"Blurb__tags",children:(null==y?void 0:y.name)&&(0,n.jsx)("span",{className:"Blurb__tags__item Blurb__tags__item--separator",children:null==y?void 0:y.name})}),x]}),k&&(0,n.jsxs)("div",{className:"Blurb__audio",children:[(0,n.jsx)("div",{className:"Blurb__audio__icon",children:(0,n.jsx)(l.Z,{})}),(0,n.jsxs)("div",{className:"Blurb__audio__time",children:[E," min"]})]})]}),T=(0,n.jsxs)(n.Fragment,{children:[b&&(0,n.jsx)("figure",{className:"Blurb__image-container",children:(0,n.jsx)(s.default,{src:b.src,alt:"",sizes:C,width:b.width,height:b.height})}),(0,n.jsxs)("div",{className:"Blurb__content",children:[p&&(0,n.jsx)("h3",{className:"Blurb__title",children:p}),h.startsWith("small")&&Z,"medium"===h&&R,"circular"===h&&B,"portrait"===h&&M,"landscape"===h&&I,null==h&&x&&(0,n.jsx)("div",{className:"Blurb__description",children:(0,n.jsx)(o,{content:x,icons:d,tags:u})}),i]})]});return(0,n.jsxs)("article",{className:L,children:[null!=_&&(0,n.jsxs)("div",{className:"Blurb__number",children:[_,"."]}),j?(0,n.jsx)(a.default,{href:j,className:"Blurb__inner Blurb__inner Blurb__link",children:T}):(0,n.jsx)("div",{className:"Blurb__inner",children:T})]})}i(3379)},9850:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return f}});var n=i(7437),s=i(2265),a=i(3600),l=i(2021),r=i(6393),o=i(883);i(3822);var c=i(1226);i(5990);var d=i(928),u=i(5860),m=i(2134);function h(e){var t;let{postType:i,post:a,audioTitle:l,audioFileSrc:r,hasPlate:h=!0,autoplay:_=!1,disabled:f=!1}=e,{post_id:v,masthead:p}=a,x=(0,d.Z)(),j=x.data[v]||0,[g,w]=(0,s.useState)(!1),[b,N]=(0,s.useState)(!1),[y,S]=(0,s.useState)(0),[k,E]=(0,s.useState)(0),P=(0,s.useRef)(null),L=(0,s.useRef)(!1),C=(0,m.Z)();(0,s.useEffect)(()=>{k>j&&(x.updateUserPostPositionListen({post_id:v,position:k}),M("play_progress",{progress:k}))},[k,j]),(0,s.useEffect)(()=>{P.current&&(!0===g?M("play",{}):P.current.currentTime>0&&!1===g&&M("pause",{}))},[g]),(0,s.useEffect)(()=>{var e,t,i,n,s;if(C.isLoggedIn()&&(P.current=document.getElementById("audio-track")),null===(e=P.current)||void 0===e||e.addEventListener("playing",Z),null===(t=P.current)||void 0===t||t.addEventListener("pause",R),null===(i=P.current)||void 0===i||i.addEventListener("ended",B),null===(n=P.current)||void 0===n||n.addEventListener("timeupdate",I),_&&T(),j>0&&j<100){let e=null===(s=P.current)||void 0===s?void 0:s.duration,t=Math.ceil(j*e/100);e&&t&&(P.current.currentTime=t)}},[]);let F="Audio-player";function Z(){var e;(null===(e=P.current)||void 0===e?void 0:e.title)===l&&(window.setTimeout(()=>!0,3e3),L.current=!0,w(!0))}function R(){var e;(null===(e=P.current)||void 0===e?void 0:e.title)===l&&(L.current=!1,w(!1))}function B(){var e;(null===(e=P.current)||void 0===e?void 0:e.title)===l&&R()}function M(e,t){(0,u.L9)(e,{post_id:v,storyId:v,title:l,...t})}function I(){var e,t,i,n,s,a;if((null===(e=P.current)||void 0===e?void 0:e.title)===l){null===(t=P.current)||void 0===t||t.duration;let e=null!==(s=null===(i=P.current)||void 0===i?void 0:i.currentTime)&&void 0!==s?s:0,l=10*Math.floor(Math.ceil(1e3*e/(null!==(a=null===(n=P.current)||void 0===n?void 0:n.duration)&&void 0!==a?a:1))/10/10);window.setTimeout(()=>{S(e),E(l)},0)}}function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e&&e.preventDefault(),!f){if(L.current){P.current.pause();return}if(P.current.play(),"mediaSession"in navigator){let e=p.bg_image_small.src,t={title:l,artwork:[512,384,256,192,128,96].map(t=>{let i=new URL(e);return i.searchParams.set("w",t),i.searchParams.set("h",t),{src:i.toString(),sizes:"".concat(t,"x").concat(t),type:"image/png"}})};navigator.mediaSession.metadata=new MediaMetadata(t)}if(C.isLoggedIn()){let e=new CustomEvent("akka_play_track",{detail:{post:a}});window.dispatchEvent(e)}else P.current.play()}}return h?F+=" Audio-player--has-plate":F+=" Audio-player--no-plate",f&&(F+=" Audio-player--disabled"),(0,n.jsxs)("div",{className:F,onClick:e=>e.preventDefault(),children:[(0,n.jsxs)("h2",{className:"Audio-player__heading",children:["Lyssna p\xe5 ","podcast"===i?"podden":"artikeln"]}),(0,n.jsxs)("div",{className:"Audio-player__player",children:[(0,n.jsx)("button",{"aria-label":"Spela upp",className:"Audio-player__play",onClick:T,children:g?(0,n.jsx)(c.dz,{}):(0,n.jsx)(c.sh,{})}),(0,n.jsx)(o.Z,{value:y,onChange:function(e){P.current.pause(),P.current.currentTime=parseFloat(e)},onAfterChange:function(){P.current.play(),window.setTimeout(()=>{L.current=!0,N(!1),w(!0)},100)},step:.1,min:0,max:null===(t=P.current)||void 0===t?void 0:t.duration,tipFormatter:null})]}),C.isLoggedIn()&&(0,n.jsx)("audio",{ref:P,title:l,src:r})]})}var _=i(6805);function f(e){var t,i;let{post:o,isCompact:d}
1=e,[u,m]=(0,s.useState)(!1),f=(0,a.Z)(),v=(0,_.Z)(),{showMemberMessage:p}=(0,l.Z)(),x=f.isFavoritePost(o)||!1;async function j(e){e.preventDefault(),f.updateFavoritePosts(o.post_id,!x)}let g="Blurb-actions";return u&&(g+=" Blurb-actions--show-player"),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:g,children:[(0,n.jsx)(r.default,{disabled:f.pending,isGhost:!0,isCompact:d,isCompactOnSmallScreens:!d,onClick:j,children:x?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.X1,{}),(0,n.jsx)("span",{children:"Sparat till senare"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.v3,{}),(0,n.jsx)("span",{children:"Spara till senare"})]})}),(null===(t=o.meta)||void 0===t?void 0:t.audio_file)&&(0,n.jsxs)(r.default,{isCompact:d,isCompactOnSmallScreens:!d,onClick:function(e){if(e.preventDefault(),!v.isLoggedIn()||!v.hasAccess())return p();m(!0)},children:[(0,n.jsx)(c.Bb,{}),(0,n.jsx)("span",{children:"Lyssna"})]})]}),u&&(0,n.jsx)(h,{autoplay:!0,hasPlate:!1,post:o,audioTitle:o.post_title,audioFileSrc:null===(i=o.meta)||void 0===i?void 0:i.audio_file})]})}},7684:function(e,t,i){"use strict";i.d(t,{Z:function(){return s}});var n=i(7437);function s(e){let{children:t,fixedSize:i=null,isPerson:s=!1}=e,a=i;a||(a=t.length>=4?"small":"medium");let l="Blurb-list-horizontal__list-item Blurb-list-horizontal__list-item--".concat(a);return s&&(l+=" Blurb-list-horizontal__list-item--isperson"),(0,n.jsx)("div",{className:"container",children:(0,n.jsx)("div",{className:"Blurb-list Blurb-list-horizontal",children:(0,n.jsx)("ul",{className:"Blurb-list__list Blurb-list-horizontal__list",children:null==t?void 0:t.map((e,t)=>(0,n.jsx)("li",{className:l,children:e},t))})})})}},2141:function(e,t,i){"use strict";i.r(t);var n=i(7437),s=i(2265),a=i(5860),l=i(2021),r=i(2134);let o={confirmation_heading:"V\xe4nta! Snart \xe4r du klar",confirmation_message:"Du m\xe5ste nu l\xe5sa upp vi.se f\xf6r l\xe4sning och lyssning. F\xf6r att komma \xe5t l\xe5st inneh\xe5ll vid n\xe4sta bes\xf6k beh\xf6ver du skapa ett konto och logga in. Tryck p\xe5 knappen l\xe4ngst ned i rutan.",confirmation_cta_label:"L\xe5s upp vi.se"};t.default=function(e){let{handleConfirmation:t,post:i,checkout_id:c,meta:d=o}=e,u=(0,s.useRef)(null),m=(0,s.useRef)(null),h=(0,r.Z)(i),[_,f]=(0,s.useState)(),{showMessage:v}=(0,l.Z)();(0,s.useEffect)(()=>{let e=e=>{try{var t;let i="string"==typeof e.data?JSON.parse(e.data):e.data;(null==i?void 0:i.type)==="oo-redirect"&&(null==i?void 0:null===(t=i.detail)||void 0===t?void 0:t.url)&&(window.location.href=i.detail.url)}catch(e){}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]),(0,s.useLayoutEffect)(()=>{if(c){let e=u.current;return e.addEventListener("oo-confirmation",p),()=>{e.removeEventListener("oo-confirmation",p)}}},[u,c]),(0,s.useEffect)(()=>{let{info:e,use_fulfillment_url:i,registrationUrl:n}=_||{};if(e){let i=void 0===_.delay?1e3:_.delay;if(i>200&&window.setTimeout(()=>{var e;return null===(e=m.current)||void 0===e?void 0:e.scrollIntoView()},100),t&&e&&t(e),e&&e.order_id&&setTimeout(()=>{h.setTemporaryAccess({registrationUrl:n,title:"",product:"VITD",...e}),v({heading:d.confirmation_heading,text:d.confirmation_message,ctaLabel:d.confirmation_cta_label,hideClose:!0,redirect:{href:n,delay:1},actions:{register:{href:n,ctaLabel:d.confirmation_cta_label},unlock:!1,login:!1,member:!1},reloadOnClose:!1})},i),e&&e.order_id&&e.widget){var s,l;(0,a.YZ)({currency:e.purchase_currency,value:e.order_amount,transaction_id:e.order_id,items:[{item_name:e.widget.title,item_id:e.widget.id,price:""+e.order_amount,item_brand:"Vi Media",item_category:(null===(s=e.widget.media_connect)||void 0===s?void 0:s.product_code)||"",item_category2:e.widget.slug,item_category3:(null===(l=e.widget.media_connect)||void 0===l?void 0:l.coupon_number)||"",quantity:"1"}]})}}},[_]);let p=async e=>{let{detail:t}=e;if(f(t),t.info&&t.info.order_id&&t.info.widget){var i,n;(0,a.YZ)({currency:t.info.purchase_currency,value:t.info.order_amount,transaction_id:t.info.order_id,items:[{item_name:t.info.widget.title,item_id:t.info.widget.id,price:""+t.info.order_amount,item_brand:"Vi Media",item_category:(null===(i=t.info.widget.media_connect)||void 0===i?void 0:i.product_code)||"",item_category2:t.info.widget.slug,item_category3:(null===(n=t.info.widget.media_connect)||void 0===n?void 0:n.coupon_number)||"",quantity:"1"}]})}};return c?(0,n.jsxs)("div",{ref:m,className:"CheckoutWidget",children:[(0,n.jsx)("script",{async:!0,id:"oo-checkout-script",src:"https://order-order-stage-cdn.aventyret.com/oo-checkout-1.1.16.js",type:"module"}),(0,n.jsx)("oo-checkout",{active:"",state:"checkout",ref:u,api:"https://order.vi.se/api",tenant_id:"98dcd974-5c57-4c73-95d3-6e5e084e683b",checkout_id:c})]}):null}},3273:function(e,t,i){"use strict";i.d(t,{default:function(){return r}});var n=i(7437),s=i(2265),a=i(8510),l=i(3999);function r(){let{consents:e,ready:t}=(0,l.Z)(!0),{installed:i}
1=(0,a.Z)(),[r,o]=(0,s.useState)(1),[c,d]=(0,s.useState)(),[u,m]=(0,s.useState)();return(0,s.useEffect)(()=>{r%5==0&&(d(JSON.stringify(Object.fromEntries(Object.keys(localStorage).map(e=>[e,localStorage.getItem(e)])))),m(JSON.stringify({installed:i,consents:e})))},[r,i,e]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{width:"100%",minHeight:"50px",cursor:"pointer",zIndex:1e4},onClick:function(){o(e=>e+1)}}),u?(0,n.jsx)("textarea",{rows:5,style:{width:"100%"},defaultValue:c}):null,u?(0,n.jsx)("textarea",{rows:5,style:{width:"100%"},defaultValue:u}):null]})}},3217:function(e,t,i){"use strict";i.d(t,{default:function(){return r}});var n=i(7437),s=i(2265),a=i(3145),l=i(2247);function r(e){let{coverImages:t,priority:i=!1}=e,[r,o]=(0,s.useState)(null),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=c.current.clientHeight?c.current.clientWidth/(.95*c.current.clientHeight-102):1;o((Object.keys(t)||[]).reduce((i,n)=>null===i||Math.abs(e-i.aspect_ratio)>Math.abs(e-t[n].aspect_ratio)?t[n]:i,null))},[]);let d=(0,l.g)(32,{medium:32});return((0,l.i)(),t)?(0,n.jsx)("figure",{ref:c,className:"Cover-story__image-container",children:r&&(0,n.jsx)(a.default,{priority:i,sizes:d,src:r.src,alt:"",width:r.width,height:r.height})}):null}},8159:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return l}});var n=i(7437);function s(e){let{type:t,title:i,description:s,children:a}=e;return(0,n.jsx)("div",{className:"Front-page-section Front-page-section--".concat(t),children:(0,n.jsxs)("div",{className:"container",children:[(0,n.jsxs)("header",{className:"Front-page-section__header",children:[(0,n.jsx)("h2",{className:"Front-page-section__title",children:i}),s&&(0,n.jsx)("span",{className:"Front-page-section__description",children:s})]}),a]})})}var a=i(8596);function l(e){var t;let{children:i,title:l=null,description:r=null,type:o="favorites"}=e,{data:c}=(0,a.Z)();return(0,n.jsx)(s,{type:o,title:l||(null===(t=c.post)||void 0===t?void 0:t.series_heading),description:r,children:(0,n.jsx)("ul",{className:"Blurb-list__list Favorites",children:null==i?void 0:i.map((e,t)=>(0,n.jsx)("li",{className:"Favorites__item",children:e},t))})})}i(1330)},5443:function(e,t,i){"use strict";i.d(t,{default:function(){return u}});var n=i(7437),s=i(2265),a=i(3145),l=i(1318),r=i(8947),o=i(732),c=i(6393),d=i(1226);function u(e){let{title:t,tag:i,premium:u,frequency:m,image:h,description:_}=e,{subscriber:f,mutate:v,isLoading:p}=(0,l.R)(),{newsletters:x,mutate:j,isLoading:g}=(0,l.V)(()=>!p&&(null==f?void 0:f.id)),[w,b]=(0,s.useState)(!1),[N,y]=(0,s.useState)(!0);return(0,s.useEffect)(()=>{let e=null==x?void 0:x.filter(e=>e.name===i).pop();b((null==e?void 0:e.value)==="Y")},[x,i]),(0,s.useEffect)(()=>{y(g)},[g]),(0,n.jsxs)("div",{className:"NewsletterItem ".concat(p||g?"NewsletterItem--loading":""),children:[h&&(0,n.jsxs)("figure",{children:[(0,n.jsx)(a.default,{src:h,alt:""}),h&&(0,n.jsx)("figcaption",{className:"NewsletterItem__icon","aria-hidden":"true",style:{backgroundImage:"url(".concat(h,")")}})]}),u&&(0,n.jsx)("div",{className:"NewsletterItem__premium",children:"premium"}),t&&(0,n.jsx)("div",{className:"NewsletterItem__title",children:t}),m&&(0,n.jsx)(o.Z,{className:"NewsletterItem__frequency",html:m}),_&&(0,n.jsx)(o.Z,{className:"NewsletterItem__description",html:_}),i&&(null==f?void 0:f.optout)!==!0&&(0,n.jsxs)(c.default,{disabled:!(null==f?void 0:f.id)||N,onClick:async()=>{console.log("onToggle",{tag:i}),y(!0),w?await (0,r.uI)({tag:i}):await (0,r.cv)({tag:i}),await j(),y(!1)},className:"NewsletterItem__button",isInverted:w,children:[w?(0,n.jsx)(d.X1,{}):(0,n.jsx)(d.mA,{}),w?"Ta bort":"L\xe4gg till"]})]})}i(2672)},1410:function(e,t,i){"use strict";i.d(t,{default:function(){return c}});var n=i(7437),s=i(2265),a=i(1318),l=i(8947),r=i(6393),o=i(1226);function c(e){let{title:t,text:i,button_text:c}=e,{subscriber:d,mutate:u,isLoading:m}=(0,a.R)(),[h,_]=(0,s.useState)(!1),f=async()=>{_(!0),await (0,l.Cp)(),await u(),_(!1)};return m?null:!0===d.optout?(0,n.jsxs)("div",{className:"NewsletterResubscribe",children:[t&&(0,n.jsx)("h2",{className:"NewsletterResubscribe__title",children:t}),i&&(0,n.jsx)("p",{className:"NewsletterResubscribe__text",children:i}),c&&(0,n.jsxs)(r.default,{disabled:h,className:"NewsletterResubscribe__button",onClick:f,isInverted:!1,children:[(0,n.jsx)(o.mA,{}),c]})]}):void 0}i(2672)},625:function(e,t,i){"use strict";i.d(t,{default:function(){return c}});var n=i(7437),s=i(2265),a=i(1318),l=i(8947),r=i(6393),o=i(1226);function c(e){let{title:t,text:i,button_text:c}=e,{subscriber:d,mutate:u,isLoading:m}
1=(0,a.R)(),[h,_]=(0,s.useState)(!1),f=async()=>{_(!0),await (0,l.Ap)(),await u(),_(!1),window.scrollTo(0,0)};return m?null:!1===d.optout?(0,n.jsxs)("div",{className:"NewsletterUnsubscribe",children:[t&&(0,n.jsx)("h2",{className:"NewsletterUnsubscribe__title",children:t}),i&&(0,n.jsx)("p",{className:"NewsletterUnsubscribe__text",children:i}),c&&(0,n.jsxs)(r.default,{disabled:h,className:"NewsletterUnsubscribe__button",onClick:f,isInverted:!0,children:[(0,n.jsx)(o.X1,{}),c]})]}):void 0}i(2672)},5256:function(e,t,i){"use strict";i.d(t,{default:function(){return l}});var n=i(7437),s=i(7648),a=i(9376);function l(e){let{menu:t}=e,i=(0,a.usePathname)();return(null==t?void 0:t.length)?(0,n.jsx)("nav",{className:"Page-menu","aria-label":"Undermeny",children:(0,n.jsx)("ul",{children:t.map(e=>{let t="Page-menu__item";return e.url===i&&(t+=" Page-menu__item--active"),(0,n.jsx)("li",{className:t,children:(0,n.jsx)(s.default,{href:e.url,children:e.title})},e.id)})})}):null}i(5708)},908:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return j}});var n=i(7437),s=i(2265),a=i(732),l=i(2141),r=i(2134),o=i(6393),c=i(8423),d=i(1226);function u(e){let{post:t}=e,i=(0,r.Z)(t),[a,l]=(0,s.useState)(""),[u,m]=(0,s.useState)(!1);(0,s.useEffect)(()=>{/^[^@]+@[^@.]+\.[^@]+$/.test(a)?m(!0):m(!1)},[a]);let h=async()=>{await i.setFreemiumRegistration({email:a,permalink:t.permalink,title:t.title})};return(0,n.jsxs)("div",{className:"PaywallEmail",children:[(0,n.jsx)(c.Z,{className:"PaywallEmail__input",type:"email",name:"email",placeholder:"Skriv din e-postadress h\xe4r",disabled:i.pending,value:a,onChange:e=>{l(e)}}),(0,n.jsxs)(o.default,{className:"PaywallEmail__button",isCta:!0,disabled:!u||i.pending,onClick:h,children:[(0,n.jsx)("span",{children:"L\xe4s vidare"}),(0,n.jsx)(d.Eh,{})]})]})}i(6008);var m=i(5860);i(4629);var h=i(6751),_=i(8596),f=i(7648);let v="email",p="checkout",x=()=>{var e,t;let{data:i}=(0,_.Z)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h2",{className:"Paywall__header",children:null==i?void 0:null===(e=i.checkout)||void 0===e?void 0:e.pwa_heading}),(0,n.jsx)(a.Z,{html:null==i?void 0:null===(t=i.checkout)||void 0===t?void 0:t.pwa_description,className:"Paywall__description"})]})};function j(e){let{post:t,children:i}=e,{active:c,type:d,offer:_,title:j,description:g,footer:w,cta_label:b}=(0,r.Z)(t).getPaywall(),[N,y]=(0,s.useState)("");if((0,s.useEffect)(()=>{y(window.location.href)},[]),(0,s.useEffect)(()=>{c&&d===v?(0,m.L9)("secondPaywallDisplayed"):c&&d===p?(0,m.L9)("thirdPaywallDisplayed"):(0,m.L9)("noPaywallDisplayed")},[]),!c)return(0,n.jsx)(n.Fragment,{children:i});let S=!1;if(_.product_id&&_.coupon_number){let e=new URL("".concat("https://www.vi.se","/api/services/mediaconnect/authorization"));e.searchParams.set("returnUrl",N);let t=new URL("https://order.flowy.se/vimedia/".concat(_.product_id,"/userform"));t.searchParams.set("couponNumber",_.coupon_number),t.searchParams.set("redirectUrl",e),S=t.toString()}return(0,n.jsx)("div",{className:"Paywall",children:(0,n.jsx)("div",{className:"Paywall__outer",children:(0,n.jsx)("div",{className:"Paywall__inner",children:(0,n.jsxs)(h.default,{isPwa:!1,otherwise:(0,n.jsx)(x,{}),children:[(0,n.jsx)("h2",{className:"Paywall__header",children:j}),(0,n.jsx)(a.Z,{html:g,className:"Paywall__description"}),d===p?S?(0,n.jsx)("div",{className:"Paywall__widget",children:(0,n.jsx)(f.default,{href:S,children:(0,n.jsx)(o.default,{className:"Paywall__widget__cta",
1styling:"cta",isCta:!0,linkTo:S,children:b||"Prova p\xe5"})})}):(0,n.jsx)("div",{className:"Paywall__widget",children:(0,n.jsx)(l.default,{post:t,checkout_id:_.checkout_id})}):d===v?(0,n.jsx)("div",{className:"Paywall__email",children:(0,n.jsx)(u,{post:t})}):null,(0,n.jsx)(a.Z,{html:w,className:"Paywall__footer"})]})})})})}},9863:function(e,t,i){"use strict";let n;i.r(t),i.d(t,{default:function(){return y}});var s=i(7437),a=i(2265),l=i(7648),r=i(8596),o=i(1226),c=i(2276),d=i(9733);let u=[];function m(e){let{post:t}=e,i=function(){let{data:e,mutate:t,isLoading:i}=(0,d.Z)("/api/modules/user_post_position_read");return{data:e||u,isLoading:i,updateUserPostPositionRead:n};async function n(e){let{post_id:i,position:n}=e,s=await (0,c.Ko)("/api/modules/user_post_position_read",{post_id:i,position:n});await t(s,{revalidate:!1})}}(),l=i.data[t.post_id]||0,[r,o]=(0,a.useState)(l),[m,h]=(0,a.useState)(l),_=(0,a.useRef)();async function f(e){var t,i;if(!_.current)return;let{top:n,height:s}=null!==(i=null===(t=_.current.closest(".container"))||void 0===t?void 0:t.getBoundingClientRect())&&void 0!==i?i:{};if(!s)return;let a=s-window.innerHeight,l=Math.min(1e3,Math.max(0,Math.ceil(1e3*Math.min(a,-1*n)/a)))/10;o(l),h(10*Math.ceil(l/10))}return(0,a.useEffect)(()=>{m>l&&i.updateUserPostPositionRead({post_id:t.post_id,position:m})},[m,l]),(0,a.useEffect)(()=>(l>0&&l<90?function(e){var t,i;if(!_.current)return;let{top:s,height:a}=null!==(i=null===(t=_.current.closest(".container"))||void 0===t?void 0:t.getBoundingClientRect())&&void 0!==i?i:{};window.scrollTo(0,s+a*e/100),n=window.setTimeout(()=>window.addEventListener("scroll",f),1e3)}(l):window.addEventListener("scroll",f),()=>{window.clearTimeout(n),window.removeEventListener("scroll",f)}),[]),(0,s.jsx)("div",{className:"ReadPosition",ref:_,children:(0,s.jsx)("div",{className:"ReadPosition__bar",style:{width:"".concat(r,"%")}})})}i(7050);var h=i(2430),_=i(2263),f=i(3600),v=i(6393);function p(e){let{post:t={},isCompact:i,className:n=""}=e,a=(0,f.Z)();async function l(e){e.preventDefault(),a.updateFavoritePosts(t.post_id,!a.isFavoritePost(t))}return(0,s.jsx)(v.default,{disabled:a.pending,className:n,isLink:!0,isCompact:i,isCompactOnSmallScreens:!i,onClick:l,children:a.isFavoritePost(t)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Rh,{width:32,height:32}),!i&&(0,s.jsx)("span",{children:"Sparat till senare"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.rj,{width:32,height:32}),!i&&(0,s.jsx)("span",{children:"Spara till senare"})]})})}var x=i(2134);function j(e){let{post:t,isCompact:i=!0,autoplay:n=!1,disabled:l=!1,className:r=""}=e,[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(0),h=(0,a.useRef)(null),_=(0,a.useRef)(!1),f=(0,x.Z)(),p=null==t?void 0:t.post_title;function j(){var e;(null===(e=h.current)||void 0===e?void 0:e.title)===p?(_.current=!0,d(!0)):(_.current=!1,d(!1))}function g(){var e;(null===(e=h.current)||void 0===e?void 0:e.title)===p&&(_.current=!1,d(!1))}function w(){var e;(null===(e=h.current)||void 0===e?void 0:e.title)===p&&g()}function b(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e&&e.preventDefault(),l)return;if(_.current){h.current.pause();return}let i=new CustomEvent("akka_play_track",{detail:{playlist:"favorites",post:t}});window.dispatchEvent(i)}return(0,a.useEffect)(()=>{var e,t,i,s;return h.current=document.getElementById("audio-track"),null===(e=h.current)||void 0===e||e.addEventListener("playing",j),null===(t=h.current)||void 0===t||t.addEventListener("pause",g),null===(i=h.current)||void 0===i||i.addEventListener("ended",w),(null===(s=h.current)||void 0===s?void 0:s.paused)?n&&b():j(),()=>{var e,t,i;null===(e=h.current)||void 0===e||e.removeEventListener("playing",j),null===(t=h.current)||void 0===t||t.removeEventListener("pause",g),null===(i=h.current)||void 0===i||i.removeEventListener("ended",w),f.isLoggedIn()||w()}},[]),(0,s.jsxs)(v.default,{className:"AudioRemoteSimple ".concat(r),disabled:l,isLink:!0,isCompact:i,isCompactOnSmallScreens:!i,onClick:b,children:[c?(0,s.jsx)(o.dz,{}):(0,s.jsx)(o.sh,{}),(0,s.jsxs)("span",{children:[" ",c?"Pausa":"Lyssna"]})]})}i(3822),i(5809);var g=i(6751),w=i(8510);i(2384);let b=0,N=0;function y(e){var t,i;let{post:n}=e,{data:c}=(0,r.Z)(),{installed:d}=(0,w.Z)(),{header:u}=c,[f,v]=(0,a.useState)(!1),[x,y]=(0,a.useState)(!1),S=(0,a.useRef)(!1),k=(0,a.useRef)(null);function E(e){var t;if(!k.current)return;(t=k.current.parentNode.getBoundingClientRect().top-k.current.offsetHeight<0)!==S.
1current&&(t||d?(S.current=!0,window.setTimeout(()=>v(!0),0)):(S.current=!1,v(!1)));let i=window.scrollY<N;if(N=window.scrollY,(window.scrollY>b||!i)&&(b=window.scrollY),window.scrollY+20<b){y(!0);return}x||y(!0)}(0,a.useEffect)(()=>(window.addEventListener("scroll",E),()=>{window.removeEventListener("scroll",E)}),[]),(0,a.useEffect)(()=>{d&&v(!0)},[d]);let P=(0,s.jsx)(g.default,{isPwa:!1,children:(0,s.jsx)(l.default,{className:"Button Button--cta",href:"/medlemskap",children:u.subscribe_text})}),L="Post-header";(f||d)&&(L+=" Post-header--in-view"),x&&(L+=" Post-header--scrolled-up");let C=(null===(t=n.meta)||void 0===t?void 0:t.writers.length)?n.meta.writers[0].post_title:null;return(0,s.jsxs)("div",{ref:k,className:L,children:[(0,s.jsxs)("div",{className:"Post-header__inner container",children:[d?(0,s.jsx)(l.default,{className:"Post-header__back",href:"/","aria-label":"Till startsidan",children:(0,s.jsx)(o.RY,{width:22,height:22})}):(0,s.jsx)(l.default,{className:"Post-header__logo",href:"/","aria-label":"Hem",children:(0,s.jsx)(o.TR,{width:35,height:35})}),(0,s.jsxs)("div",{className:"Post-header__title",children:[(0,s.jsx)("strong",{children:n.post_title}),(0,s.jsx)("br",{}),C]}),(0,s.jsxs)(h.default,{ifUserHasAccess:!0,post:n,otherwise:P,children:[(0,s.jsx)(_.default,{post:n,shortButtonText:!0,isCompact:!0,className:"hide-from-large"}),(0,s.jsx)(p,{post:n,isCompact:!0,className:"hide-from-large"}),(null===(i=n.meta)||void 0===i?void 0:i.audio_file)&&(0,s.jsx)(j,{post:n,isCompact:!0,className:"hide-from-large"}),(0,s.jsx)(_.default,{post:n,isCompact:!0,className:"hide-up-to-medium"}),(0,s.jsx)(p,{post:n,isCompact:!0,className:"hide-up-to-medium"})]}),(0,s.jsx)(g.default,{isPwa:!1,children:(0,s.jsxs)("button",{className:"Post-header__toggle-menu",onClick:function(){console.log("PostHeader:openMenu");let e=new CustomEvent("akka_open_menu",{detail:{}});window.dispatchEvent(e)},children:[(0,s.jsx)(o.v2,{}),(0,s.jsx)("span",{className:"visually-hidden",children:"Meny"})]})})]}),(0,s.jsx)(h.default,{ifUserHasAccess:!0,post:n,children:(0,s.jsx)(m,{post:n})})]})}},65:function(e,t,i){"use strict";i.d(t,{default:function(){return p}});var n=i(7437),s=i(2265),a=i(9376),l=i(3585),r=i(1858);i(3697);var o=i(6455);function c(e){let{filterLabels:t={},filters:i,setFilters:s,articleFormats:a=[],postTags:c=[],writers:u=[],categories:m=[],showPostTags:h=!0}=e,_=d(t,"writer",u,"post_id"),f=d(t,"category",m),v=d(t,"postTag",c);d(t,"articleFormat",a);let p=(e,t)=>{s({...i,[e]:t})};return(0,n.jsx)("form",{className:"Posts-filter",children:(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(l.Z,{label:t.writerLabel,options:_,value:i.writer||"",onChange:e=>p("writer",e)}),h&&(0,n.jsx)(l.Z,{label:t.postTagLabel,options:v,value:i.postTag||"",onChange:e=>p("postTag",e)}),(0,n.jsx)(l.Z,{label:t.categoryLabel,options:f,value:i.category||"",onChange:e=>p("category",e)}),!1,(0,n.jsx)(r.Z,{label:t.onlyFavorites,value:i.favorites,onChange:e=>p("favorites",e)})]})})}function d(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"slug";return[{value:"",text:e["".concat(t,"Placeholder")]},...i.filter(e=>0!==e.count).filter(e=>"uncategorized"!==e.slug).map(e=>({value:e[n],text:(e.name||e.post_title).replace("&amp;","&")})).filter(e=>e.text)]}var u=i(3847),m=i(2276),h=i(6221);i(9850);var _=i(7684);function f(e){let{filterLabels:t={},category:i,postTag:a,articleFormat:l,writer:r,favorites:o,offset:c,page:d,setIsLoading:f,didReachEnd:v,pageSize:p=12}=e;{let{data:e,isLoading:x}=(0,u.ZP)("/api/posts?per_page=".concat(p,"&offset=").concat(c,"&page=").concat(d).concat(i?"&category=".concat(i):"").concat(a?"&tag=".concat(a):"").concat(r?"&writer=".concat(r):"").concat(l?"&article_format=".concat(l):"").concat(o?"&favorites=1":""),m.Vc,{revalidateOnMount:!0});return((0,s.useEffect)(()=>{var t;(null==e?void 0:null===(t=e.posts)||void 0===t?void 0:t.length)===0&&v()},[e,v]),(0,s.useEffect)(()=>{f(x)},[x,f]),(null==e?void 0:e.posts.length)>0)?(0,n.jsx)(_.Z,{posts:e.posts,fixedSize:"medium",children:e.posts.map(e=>(0,n.jsx)(h.Z,{post:e,size:"medium"},e.post_id))}):x||1!==d?null:(0,n.jsx)("em",{children:t.noHits})}}var v=i(7677);function p(e){let{categorySlug:t,postTagSlug:i,offset:l,page:r,dictionary:o,showFilter:d,articleFormats:u=[],postTags:m=[],writers:h=[],categories:_=[],pageSize:p,infiniteScroll:x=!1}=e;
1{let[e,b]=(0,s.useState)({postTag:i,writer:null,category:t,articleFormat:null,favorites:!1}),[N,y]=(0,s.useState)(1),[S,k]=(0,s.useState)(!1),[E,P]=(0,s.useState)(!1),L=(0,a.usePathname)(),C=r+N,F=(0,s.useRef)(E?null:C+1),Z=(0,s.useRef)(E);function j(){window.scrollY+window.innerHeight-document.body.clientHeight>-100&&(S||Z.current||(F.current=F.current+1,y(F.current),k(!0)))}function g(){Z.current=!0,P(!0)}function w(){let e=window.document.querySelector(".Post-content");if(e){let t=e.getBoundingClientRect().top;window.document.body.classList.toggle("site-header-is-sticky",t<0)}}(0,s.useEffect)(()=>{if(x)return window.addEventListener("scroll",j),()=>window.removeEventListener("scroll",j)},[x]),(0,s.useEffect)(()=>("/"===L?window.addEventListener("scroll",w):(window.removeEventListener("scroll",w),window.document.body.classList.remove("site-header-is-sticky")),()=>{window.removeEventListener("scroll",w),window.document.body.classList.remove("site-header-is-sticky")}),[L]);let R=[];for(let t=r+1;t<=C;t++)R.push((0,n.jsx)(f,{filterLabels:o.filter,postTag:e.postTag,category:e.category,writer
1:e.writer,articleFormat:e.articleFormat,favorites:e.favorites,offset:l,page:t,setIsLoading:k,didReachEnd:g,pageSize:p},t));return(0,n.jsxs)(n.Fragment,{children:[d&&(0,n.jsx)(c,{filterLabels:o.filter,filters:e,setFilters:b,articleFormats:u,postTags:m,writers:h,categories:_,showPostTags:!i}),R,S&&(0,n.jsx)(v.Z,{})]})}}},7786:function(e,t,i){"use strict";i.d(t,{default:function(){return _}});var n=i(7437),s=i(2265),a=i(9376),l=i(3847),r=i(2276);i(8423);var o=i(7684),c=i(7677);i(872);var d=i(3585);function u(e){let{totalPages:t,handleSetPage:i,page:s}=e;if(t<=1)return null;let a=[];for(let e=1;e<=t;e++)a.push({text:e,value:e});let l=1===s,r=s>=t;return(0,n.jsxs)("div",{className:"Pagination",children:[(0,n.jsx)("button",{className:"Pagination__previous",onClick:function(){l||i(s-1)},title:"Previous page",disabled:l,children:"<"}),(0,n.jsx)(d.Z,{label:"V\xe4lj sida",optionLabel:"Sida",total:t,onChange:e=>i(e),options:a,labelVisuallyHidden:!0,value:s}),(0,n.jsx)("button",{className:"Pagination__next",onClick:function(){r||i(s+1)},title:"Next page",disabled:r,children:">"})]})}i(6393),i(3949);var m=i(6221);i(9850);var h=i(6455);function _(e){var t;let{searchFields:i={},postTitle:d}=e,_=(0,a.useSearchParams)(),f=(0,a.usePathname)(),v=(0,a.useRouter)(),[p,x]=(0,s.useState)(_.get("query")||""),[j,g]=(0,s.useState)(parseInt(_.get("page"),10)||1),w="/api/search?query=".concat(p,"&page=").concat(j),{data:b,isLoading:N}=(0,l.ZP)(w,{revalidateOnMount:!0},r.Vc),y=(0,s.useRef)(null);(0,s.useEffect)(()=>{y.current&&window.setTimeout(()=>y.current.focus(),10)},[]);let S=null;if(b&&p.length){if(1===b.count)S="1 tr\xe4ff f\xf6r";else{let e="%s tr\xe4ffar f\xf6r".split("%s");e.length>1&&(S="".concat(e[0]).concat(b.count).concat(e[1]))}}return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{children:S?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:S}),"\xa0",(0,n.jsx)("em",{children:b&&p})]}):d}),(0,n.jsx)(h.Z,{children:(0,n.jsx)("form",{className:"Search__form",method:"get",action:"/sokresultat",onSubmit:e=>{e.preventDefault();let t=e.target.querySelector("input").value.replace(/\./g,"");x(t),v.push("".concat(f,"?query=").concat(t)),g(1)},children:(0,n.jsxs)("div",{className:"Text-input",children:[(0,n.jsx)("label",{className:"visually-hidden",htmlFor:"search-input",children:"Skriv din 
1s\xf6kfras h\xe4r"}),(0,n.jsx)("input",{ref:y,className:"Search__input",type:"text",name:"search-input",id:"search-input",defaultValue:p,placeholder:"S\xf6k efter ord eller namn"}),(0,n.jsx)("button",{type:"submit",className:"visually-hidden",children:"S\xf6k"})]})})}),(null==b?void 0:b.posts)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{fixedSize:"medium",children:null==b?void 0:b.posts.map(e=>(0,n.jsx)(m.Z,{post:e,size:"medium"},e.post_id))}),p&&(null===(t=b.posts)||void 0===t?void 0:t.length)<1&&i.text_no_hits&&(0,n.jsx)("p",{children:(0,n.jsx)("em",{children:i.text_no_hits})}),p&&(0,n.jsx)(u,{handleSetPage:function(e){g(parseInt(e,10)),window.scrollTo({top:0,behavior:"smooth"})},totalPages:b.pages,page:j})]}):p&&(0,n.jsx)(c.Z,{})]})})}},4590:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return f}});var n=i(7437);i(7707);var s=i(6751);i(3830);var a=i(6221),l=i(8596);function r(){var e,t;let{data:i}=(0,l.Z)();if(!(null==i?void 0:null===(t=i.footer)||void 0===t?void 0:null===(e=t.morearticles_repeater)||void 0===e?void 0:e.length)>0)return(0,n.jsx)(n.Fragment,{});let{morearticles_repeater:s}=null==i?void 0:i.footer;return(0,n.jsx)("section",{className:"container More-articles",children:s.map((e,t)=>{var i;return e&&(0,n.jsxs)("div",{className:"Column-list",children:[(0,n.jsx)("h2",{className:"Column-list__header",children:(0,n.jsx)("span",{className:"Column-list__header__title",children:e.column_heading})}),(0,n.jsx)("div",{className:"Column-list__posts ",children:null==e?void 0:null===(i=e.column_articles_repeater)||void 0===i?void 0:i.map((t,i)=>{let{post:s}=t;return(0,n.jsx)(a.Z,{post:s,size:e.column_layout||"small",number:!0===e.column_numbered?i+1:null},"".concat(i,"-").concat(null==s?void 0:s.post_id))})})]},t)})})}var o=i(1226),c=i(2265);function d(){var e;let[t,i]=(0,c.useState)(0),{data:s}=(0,l.Z)();if(!(null==s?void 0:null===(e=s.footer)||void 0===e?void 0:e.section2_carousel))return(0,n.jsx)(n.Fragment,{});let{section2_carousel:a=null}=null==s?void 0:s.footer,{carousel_heading:r=null,articles_list_repeater:d=[]}=a;function u(e){i(Math.max(0,t+e)%d.length)}return null==d||d.length,(0,n.jsx)("section",{className:"Site-footer__section2",children:(0,n.jsxs)("div",{className:"Site-footer__carousel-wrapper container",children:[(0,n.jsxs)("div",{className:"Site-footer__carousel",children:[r&&(0,n.jsx)("h2",{children:r}),(0,n.jsx)("div",{className:"Site-footer__blurbs",children:(0,n.jsx)("div",{className:"Site-footer__blurbs-list Site-footer__blurbs-list--step".concat(t),children:d.length?d.map((e,t)=>(0,n.jsxs)("div",{className:"Site-footer__blurb-content",children:[(0,n.jsx)("h3",{className:"Site-footer__blurb-heading",children:null==e?void 0:e.article_heading}),(0,n.jsx)("p",{className:"Site-footer__blurb-excerpt",children:null==e?void 0:e.article_excerpt})]},t)):null})})]}),(0,n.jsxs)("div",{className:"Site-footer__arrows","aria-hidden":"true",children:[(0,n.jsx)("div",{className:"Site-footer__arrows--left",onClick:()=>u(-1),children:(0,n.jsx)(o.RY,{})}),(0,n.jsx)("div",{className:"Site-footer__arrows--right",onClick:()=>u(1),children:(0,n.jsx)(o.RY,{})})]})]})})}var u=i(732);function m(){var e;let{data:t}=(0,l.Z)();if(!(null==t?void 0:null===(e=t.footer)||void 0===e?void 0:e.section3_headings)
1)return(0,n.jsx)(n.Fragment,{});let{section3_headings:i=null,section3_cta:s=null,section3_text:a=null,section3_circle_image_group:r=null,section3_subscription_image_group:c=null}=null==t?void 0:t.footer,{heading:d,subheading_1:m,subheading_2:h}=i,{cta_text_3:_,cta_url_3:f}=s,{text_wysiwyg3:v}=a,{circle_image:p,image_bold_text:x,image_regular_text:j}=r,{subscription_image:g,subscription_image_text:w,subscription_link_text:b,subscription_link_url:N}=c;return(0,n.jsxs)("section",{className:"Site-footer__section3",children:[f&&(0,n.jsx)("div",{className:"Site-footer__cta--3",children:(0,n.jsx)("a",{className:"Site-footer__cta",href:f,children:(0,n.jsxs)("div",{className:"Site-footer__cta-btn",children:[(0,n.jsx)("div",{children:_}),(0,n.jsx)(o.m$,{})]})})}),(0,n.jsxs)("div",{className:"Site-footer__content3",children:[(0,n.jsxs)("div",{className:"Site-footer__col-left--3",children:[(0,n.jsx)("h2",{className:"Site-footer__heading3",children:d}),(0,n.jsxs)("h3",{className:"Site-footer__subheading3",children:[m," ",h]}),(0,n.jsx)(u.Z,{html:v,className:"Site-footer__wysiwyg3"}),(0,n.jsxs)("div",{className:"Site-footer__byline",children:[p?(0,n.jsx)("figure",{children:(0,n.jsx)("img",{src:p.link,alt:"",width:p.width,height:p.height,loading:"lazy"})}):(0,n.jsx)("div",{className:"Site-footer__byline-placeholder"}),(0,n.jsxs)("div",{className:"Site-footer__byline-text",children:[(0,n.jsx)("div",{children:x}),(0,n.jsx)("div",{children:j})]})]})]}),(0,n.jsxs)("div",{className:"Site-footer__col-right--3",children:[(0,n.jsx)("figure",{children:(0,n.jsx)("img",{src:"/images/vi_tidningar_solfjader.jpg",alt:""})}),(0,n.jsxs)("div",{className:"Site-footer__text--right",children:[w,(0,n.jsx)("span",{children:(0,n.jsx)("a",{href:N,children:" ".concat(b)})})]})]})]})]})}var h=i(7648);function _(){var e;let{data:t}=(0,l.Z)(),{header:i}=t;if(!(null==t?void 0:null===(e=t.footer)||void 0===e?void 0:e.section4_wysiwyg))return(0,n.jsx)(n.Fragment,{});let{section4_wysiwyg:s=null,section4_icons_group:a=null}=null==t?void 0:t.footer,{tagline:r}=i,{text_wysiwyg4:c}=s,{icons_repeater:d}=a,m=d.length?d.map((e,t)=>(0,n.jsx)("div",{className:"Site-footer__image-link Site-footer__image-link--".concat(t),children:(0,n.jsx)(h.default,{href:e.icon_url,children:(0,n.jsx)("figure",{children:(0,n.jsx)("img",{src:e.icon.url,alt:""})})})},t)):null;return(0,n.jsxs)("section",{className:"Site-footer__section4",children:[(0,n.jsxs)("div",{className:"Site-footer__col-left--4",children:[(0,n.jsx)(u.Z,{html:c,className:"Site-footer__wysiwyg4"}),(0,n.jsxs)("div",{className:"Site-footer__mail-to",children:[(0,n.jsx)("h3",{children:"Undrar du n\xe5got mer?"}),(0,n.jsxs)("div",{children:["Mejla: ",(0,n.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"})]})]}),(0,n.jsx)("div",{className:"Site-footer__img-links Site-footer__img-links--mobile",children:m||""}),(0,n.jsx)("div",{className:"Site-footer__slogan",children:(0,n.jsxs)(h.default,{className:"Site-footer__logo",href:"/",children:[(0,n.jsx)(o.TR,{}),(0,n.jsx)("div",{children:r})]})})]}),(0,n.jsx)("div",{className:"Site-footer__col-right--4",children:(0,n.jsx)("div",{className:"Site-footer__img-links Site-footer__img-links--desktop",children:m||""})})]})}function f(e){let{children:t}=e,{data:i}=(0,l.Z)();return i.footer?(0,n.jsx)("footer",{className:"Site-footer",children:(0,n.jsx)("div",{className:"Site-footer__wrapper",children:t||(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r,{}),(0,n.jsxs)(s.default,{isPwa:!1,children:[(0,n.jsx)(d,{}),(0,n.jsx)(m,{}),(0,n.jsx)(_,{})]})]})})}):(0,n.jsx)(n.Fragment,{})}},2424:function(e,t,i){"use strict";i.d(t,{default:function(){return x}});var n=i(7437),s=i(7648),a=i(1226);function l(e){let{header:t}=e,i=t.menu_text||"Meny";return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("button",{className:"Site-header__toggle-menu",onClick:function(){console.log("SiteHeaderToggleMenu:openMenu");let e=new CustomEvent("akka_open_menu",{detail:{}});window.dispatchEvent(e)},"aria-label":i,children:[(0,n.jsx)(a.v2,{}),(0,n.jsx)("span",{className:"hide-up-to-medium",children:i})]})})}var r=i(6611);function o(e){let{children:t,...i}=e;return(0,n.jsx)("button",{className:"Client-cta-login",onClick:()=>{window.location.href=(0,r.W)()},...i,children:t})}i(5976);var c=i(2134),d=i(6751),u=i(2265),m=i(4887);function h(e){let{children:t,...i}=e,[s,a]=(0,u.useState)();return(0,u.useEffect)(()=>{a("".concat("https://www.vi.se").concat((0,r.$)()))},[]),(0,n.jsx)("a",{href:s,...i,children:t})}i(993);var _=i(6805);function f(e){let{header:t,navigation:i,toggleMenu:l}=e,r=(0,u.useRef)(null),c=(0,_.Z)().isLoggedIn();function f(e){"Escape"===e.key&&l()}function v(e){r.current&&!r.current.contains(e.target)?l():"A"===e.target.tagName&&l()}(0,u.useEffect)(()=>(window.document.body.classList.add("menu-open"),()=>window.document.body.classList.remove("menu-open")),[]),(0,u.useEffect)(()=>(window.document.addEventListener("keyup",f),window.document.addEventListener("click",v),()=>{window.document.removeEventListener("keyup",f),window.document.removeEventListener("click",v)}),[]);let p="Main-menu";p+=" Main-menu--show";let x=(c?i.primary_navigation_signed_in:i.primary_navigation)||[],j=c?i.primary_navigation_signed_in_pwa:[];return(0,m.createPortal)((0,n.jsxs)("div",{className:p,ref:r,children:[(0,n.jsx)("div",{className:"Main-menu__controls",children:(0,n.jsxs)("button",{className:"Main-menu__close",onClick:l,children:[(0,n.jsx)("span",{className:"visually-hidden",children:"St\xe4ng"}),(0,n.jsx)("span",{className:"Main-menu__close-icon","aria-hidden":"true",children:(0,n.jsx)(a.x8,{width:24,height:24})}),(0,n.jsx)("span",{className:"Main-menu__close-label hide-from-medium",children:"St\xe4ng"})]})}),(0,n.jsxs)("nav",{className:"Main-menu__menu","aria-labelledby":"main-menu-heading",children:[(0,n.jsx)("h2",{className:"Main-menu__heading",id:"main-menu-heading",children:t.menu_heading}),(0,n.jsxs)("ul",{className:"Main-menu__items Main-menu__group",children:[t.home_text&&(0,n.jsx)("li",{children:(0,n.jsxs)(s.default,{href:"/",children:[(0,n.jsx)(a.SK,{}),t.home_text]})}),t.posts_text&&t.posts_url&&(0,n.jsx)("li",{children:(0,n.jsxs)(s.default,{href:t.posts_url,children:[(0,n.jsx)(a.Xy,{}),t.posts_text]})}),c&&t.recently_read_text&&(0,n.jsx)("li",{children:(0,n.jsxs)(s.default,{href:"/historik",children:[(0,n.jsx)(a.W6,{}),t.recently_read_text]})}),c&&t.saved_text&&(0,n.jsx)("li",{children:(0,n.jsxs)(s.default,{href:"/sparade",children:[(0,n.jsx)(a.v3,{}),t.saved_text]})}),c&&t.following_text&&(0,n.jsx)("li",{children:(0,n.jsxs)(s.default,{href:"/foljer",children:[(0,n.jsx)(a.Xd,{}),t.following_text]})}),c&&t.newsletter_text&&(0,n.jsx)("li",{children:(0,n.jsxs)(s.default,{href:"/nyhetsbrev",children:[(0,n.jsx)(a.mA,{}),t.newsletter_text]})})]}),!c&&(0,n.jsxs)("ul",{className:"Main-menu__login Main-menu__group",children:[t.magazine_subscriber_text&&(0,n.jsx)(d.default,{isPwa:!1,children:(0,n.jsx)("li",{children:(0,n.jsxs)(s.default,{href:"/aktivera-digitala-vi",children:[(0,n.jsx)(a.ZD,{}),t.magazine_subscriber_text]})})}),t.register_text&&(0,n.jsx)(d.default,{isPwa:!1,children:(0,n.jsx)("li",{children:(0,n.jsx)(s.default,{href:"/medlemskap",className:"Button Button--cta",children:t.register_text})})}),t.sign_in_text&&(0,n.jsx)("li",{children:(0,n.jsx)(o,{className:"Button Button--secondary",children:t.sign_in_text})})]}),(null==x?void 0:x.length)>0&&(0,n.jsx)(d.default,{isPwa:!1,children:(0,n.jsx)("ul",{className:"Main-menu__items Main-menu__group",children:x.map(e=>{var t;return(0,n.jsx)("li",{children:(null===(t=e.url)||void 0===t?void 0:t.indexOf("http"))===0?(0,n.jsx)("a",{target:"_blank",href:e.url,children:e.title}):(0,n.jsx)(s.default,{href:e.url,children:e.title})},e.id)})})}),(null==j?void 0:j.length)>0&&(0,n.jsx)(d.default,{isPwa:!0,children:(0,n.jsx)("ul",{className:"Main-menu__items Main-menu__group",children:j.map(e=>{var t;return(0,n.jsx)("li",{children:(null===(t=e.url)||void 0===t?void 0:t.indexOf("http"))===0?(0,n.jsx)("a",{target:"_blank",href:e.url,children:e.title}):(0,n.jsx)(s.default,{href:e.url,children:e.title})},e.id)})})}),(0,n.jsxs)("ul",{className:"Main-menu__items Main-menu__group",children:[t.cookie_settings_text&&(0,n.jsx)(d.default,{matchIos:!1,children:(0,n.jsx)("li",{children:(0,n.jsx)(s.default,{href:"#cookies",children:t.cookie_settings_text})})}),c&&t.account_text&&(0,n.jsx)("li",{children:(0,n.jsx)(s.default,{href:"/profil",children:t.account_text})}),c&&t.sign_out_text&&(0,n.jsx)("li",{children:(0,n.jsxs)(h,{children:[(0,n.jsx)(a.RD,{}),t.sign_out_text]})})]})]}),(0,n.jsx)(a.Cp,{className:"Main-menu__bg-logo","aria-hidden":"true"})]}),window.document.body)}function v(e){let{header:t,navigation:i}=e,[r,m]=(0,u.useState)(!1);console.log({openMenu:r}),(0,u.useEffect)(()=>(window.addEventListener("akka_open_menu",h),()=>window.removeEventListener("akka_open_menu",h)),[]);let h=()=>{console.log("SiteHeaderMenu:toggleMenu",{openMenu:r}),m(e=>!e)},_=(0,c.Z)();return(0,n.jsxs)("nav",{className:"Site-header__menu",children:[(0,n.jsxs)("ul",{className:"Site-header__menu-items",children:[!_.isLoggedIn()&&t.sign_in_text&&(0,n.jsx)("li",{className:"Site-header__menu-item Site-header__menu-item--login",children:(0,n.jsxs)(o,{"aria-label":t.sign_in_text,children:[(0,n.jsx)(a.m3,{}),(0,n.jsx)("span",{children:t.sign_in_text})]})}),t.search_text&&(0,n.jsx)("li",{className:"Site-header__menu-item",children:(0,n.jsxs)(s.default,{href:"/sok","aria-label":t.search_text,children:[(0,n.jsx)(a.ol,{}),(0,n.jsx)("span",{className:"hide-up-to-medium",children:t.search_text})]})}),t.subscribe_text&&!_.isMember()&&(0,n.jsx)(d.default,{isPwa:!1,children:(0,n.jsx)("li",{className:"Site-header__menu-item Site-header__menu-item--subscribe",children:(0,n.jsx)(s.default,{href:"/medlemskap",children:t.subscribe_text})})}),_.isLoggedIn()&&t.posts_url&&t.posts_text&&(0,n.jsx)("li",{className:"Site-header__menu-item hide-up-to-medium",children:(0,n.jsxs)(s.default,{href:"/alla-artiklar",children:[(0,n.jsx)(a.Xy,{}),(0,n.jsx)("span",{className:"hide-up-to-medium",children:t.posts_text})]})}),t.magazine_subscriber_text&&!_.isMember()&&(0,n.jsx)(d.default,{isPwa:!1,children:(0,n.jsx)("li",{className:"Site-header__menu-item Site-header__menu-item--multiline Site-header__menu-item--activate hide-up-to-medium",children:(0,n.jsxs)(s.default,{href:"/aktivera-digitala-vi",children:[(0,n.jsx)(a.ZD,{}),(0,n.jsx)("span",{className:"hide-up-to-medium",children:t.magazine_subscriber_text})]})})}),(null==i?void 0:i.primary_navigation)&&(0,n.jsx)(d.default,{isPwa:!1,children:(0,n.jsx)("li",{className:"Site-header__menu-item display-none-on-pwa",children:(0,n.jsx)(l,{header:t})})})]}),r&&(0,n.jsx)(f,{header:t,navigation:i,toggleMenu:h})]})}var p=i(8596);function x(e){let{hideOnMobile:t=!1,hideOnPwa:i=!1}=e,{data:l}=(0,p.Z)(),{navigation:r,header:o}=l;return o?(0,n.jsx)("header",{className:"Site-header ".concat(t?"Site-header--hideOnMobile":""," ").concat(i?"hide-on-pwa":""),children:(0,n.jsxs)("div",{className:"Site-header__inner",children:[(0,n.jsx)(s.default,{className:"Site-header__logo",href:"/","aria-label":"Vi – ".concat(o.tagline),children:(0,n.jsx)(a.TR,{width:35,height:35})}),(0,n.jsx)("div",{className:"Site-header__slogan hide-up-to-large","aria-hidden":"true",children:(0,n.jsx)(s.default,{className:"Site-header__logo",href:"/",children:o.tagline})}),(0,n.jsx)(v,{header:o,navigation:r})]})}):null}i(6083)},3530:function(e,t,i){"use strict";i.d(t,{default:function(){return r}});
1var n=i(2265),s=i(9376),a=i(5860),l=i(6805);function r(e){let{editorCookieName:t}=e,{data:i}=(0,l.Z)(),r=(0,s.usePathname)(),o=(0,s.useParams)();(0,n.useEffect)(()=>{if(null==i?void 0:i.user_id){var e,n,s,l,r,o;(0,a.NA)({editor:!!function(e){let t="; ".concat(document.cookie).split("; ".concat(e,"="));if(2===t.length)return t.pop().split(";").shift()}(t),has_active_membership:null!==(e=i.access)&&void 0!==e&&e,customer_id:null!==(n=i.customer_id_hash)&&void 0!==n?n:null,credential_id:null!==(s=i.credential_id_hash)&&void 0!==s?s:null,user_id:null!==(l=i.user_id_hash)&&void 0!==l?l:null,is_logged_in:null!==(r=i.is_logged_in)&&void 0!==r&&r,user_products:null!==(o=i.products)&&void 0!==o?o:[]})}},[null==i?void 0:i.user_id]),(0,n.useEffect)(()=>{(0,a.D_)()},[r,o])}},2353:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return r}});var n=i(7437),s=i(3145),a=i(7648),l=i(9376);function r(e){let{writers:t,hasSeparator:i=!1,isLink:r=!1}=e,o=(0,l.useRouter)(),c="Writer-list";return i&&(c+=" Writer-list--has-separator"),(0,n.jsx)(n.Fragment,{children:null==t?void 0:t.map((e,t)=>{if(t>0)return null;let i=(0,n.jsxs)(n.Fragment,{children:[e.featured_image&&(0,n.jsx)("figure",{className:"Writer-list__image",children:(0,n.jsx)(s.default,{src:e.featured_image.src,alt:"",sizes:"36px",width:e.featured_image.width,height:e.featured_image.height})}),e.post_title]});return r?(0,n.jsx)(a.default,{href:e.url,className:c},e.id):(0,n.jsx)("button",{className:c,onClick:t=>{t.preventDefault(),o.push(e.url)},children:i},e.id)})})}},3600:function(e,t,i){"use strict";i.d(t,{Z:function(){return c}});var n=i(2276),s=i(2265),a=i(2021),l=i(6805),r=i(9733);let o=[];function c(){let[e,t]=(0,s.useState)(!1),i=(0,l.Z)(),{showLoginMessage:c}=(0,a.Z)(),{data:d,mutate:u,isLoading:m}=(0,r.Z)("/api/modules/favorite_posts");return{data:d||o,pending:e,isLoading:m,updateFavoritePosts:h,isFavoritePost:function(e){let{post_id:t}=e;return(null==d?void 0:d.filter(e=>e.post_id===t).length)>0}};async function h(e,s){if(!i.data.is_logged_in)return c();t(!0),await (0,n.Ko)("/api/modules/favorite_posts",{post_id:e,favorite:s}),await u(),t(!1)}}},928:function(e,t,i){"use strict";i.d(t,{Z:function(){return l}});var n=i(2276),s=i(9733);let a=[];function l(){let{data:e,mutate:t,isLoading:i}=(0,s.Z)("/api/modules/user_post_position_listen");return{data:e||a,isLoading:i,updateUserPostPositionListen:l};async function l(e){let{post_id:i,position:s}=e,a=await (0,n.Ko)("/api/modules/user_post_position_listen",{post_id:i,position:s});await t(a,{revalidate:!1})}}},8749:function(e,t,i){"use strict";i.d(t,{default:function(){return r}});var n=i(7437),s=i(6221);i(9850);var a=i(7684),l=i(3600);function r(e){var t,i;let{searchParams:r}=e,o=(0,l.Z)();return o.isLoading,o.isLoading,(0,n.jsxs)("div",{className:"FavoritePostsList ",children:[(null===(t=o.data)||void 0===t?void 0:t.length)>0&&(0,n.jsx)(a.Z,{fixedSize:"medium",children:o.data.map(e=>(0,n.jsx)(s.Z,{post:e,size:"medium"},e.post_id))}),!(null===(i=o.data)||void 0===i?void 0:i.length)>0&&!o.isLoading&&(0,n.jsx)("em",{children:"Inga artiklar sparade"})]})}},9406:function(e,t,i){"use strict";i.d(t,{default:function(){return d}});var n=i(7437),s=i(7648),a=i(7684),l=i(8674),r=i(6221);i(9850);var o=i(6805),c=i(6316);function d(){let{data:e}=(0,o.Z)(),{data:t}=(0,c.Z)();return(0,n.jsxs)(n.Fragment,{children:[!e.is_logged_in&&(0,n.jsx)("p",{children:(0,n.jsx)("em",{children:"Du \xe4r inte inloggad."})}),e.is_logged_in&&(0,n.jsxs)("div",{className:"Follow-template__list",children:[t.length>0&&(0,n.jsx)(n.Fragment,{}),!t.length&&(0,n.jsx)("p",{children:(0,n.jsx)("em",{children:"Du f\xf6ljer inte n\xe5gra skribenter."})}),t.map(e=>{let t=(e.posts.length,"medium");return(0,n.jsxs)("section",{className:"Follow-template__writer",children:[(0,n.jsx)(l.default,{writer:e,showActions:!0,children:e.posts.length>2&&(0,n.jsx)(s.default,{className:"Button Button--tertiary Button--blocked",href:e.url,children:"Visa alla artiklar"})}),(0,n.jsx)("div",{className:"Follow-template__writer__posts",children:(0,n.jsx)(a.Z,{fixedSize:t,children:e.posts.map(e=>(0,n.jsx)(r.Z,{post:e,size:t,hideWriters:!0},e.post_id))})})]},e.post_id)})]})]})}i(3138)},1682:function(e,t,i){"use strict";i.d(t,{default:function(){return a}});var n=i(7437),s=i(2265);function a(){function e(){let e=window.document.querySelector(".Post-content");
1if(e){let t=e.getBoundingClientRect().top;window.document.body.classList.toggle("site-header-is-sticky",t<0)}}return(0,s.useEffect)(()=>(window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e),window.document.body.classList.remove("site-header-is-sticky")}),[]),(0,n.jsx)(n.Fragment,{})}},5381:function(e,t,i){"use strict";i.d(t,{default:function(){return o}});var n=i(7437),s=i(6221);i(9850);var a=i(7684);i(7677);var l=i(9733);let r=[];function o(e){var t,i,o;let{searchParams:c}=e,d=function(){let{data:e,mutate:t,isLoading:i}=(0,l.Z)("/api/modules/read_history_posts",{revalidateOnMount:!0});return{data:e||r,isLoading:i}}();d.isLoading;let u="HistoryPostList ";d.isLoading&&(u+=" HistoryPostList--loading ");let m=(null===(t=d.data)||void 0===t||t.length,"medium");return(0,n.jsxs)("div",{className:u,children:[(null===(i=d.data)||void 0===i?void 0:i.length)>0&&(0,n.jsx)(a.Z,{fixedSize:m,children:d.data.map(e=>(0,n.jsx)(s.Z,{post:e,size:m},e.post_id))}),!(null===(o=d.data)||void 0===o?void 0:o.length)>0&&!d.isLoading&&(0,n.jsx)("em",{children:"Inga artiklar l\xe4sta"})]})}i(9846)},6298:function(e,t,i){"use strict";i.d(t,{default:function(){return r}});var n=i(7437),s=i(8763),a=i(6393),l=i(2265);function r(e){let{}=e,[t,i]=(0,l.useState)(!1),r=async()=>{i(!0)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.default,{className:"DeleteUserModal",onClick:r,children:"Radera ditt digitala konto"}),(0,n.jsx)(s.Z,{isOpen:t,closeModal:()=>i(!1),children:(0,n.jsxs)("div",{className:"Modal__body",children:[(0,n.jsx)("h2",{children:"Vill du radera ditt digital konto?"}),(0,n.jsx)("div",{className:"DeleteUserModal__description",children:(0,n.jsx)("a",{href:"/api/modules/user_delete",className:"Button Button--inverted DeleteUserModal__button",children:"Radera konto"})})]})})]})}i(2310)},3063:function(e,t,i){"use strict";i.d(t,{default:function(){return f}});var n=i(7437);function s(e){let{className:t="",type:i="text",label:s,children:a,name:l,readOnly:r=!1,disabled:o=!1,rows:c=1,placeholder:d="",onChange:u=()=>{},value:m}=e,h="input_".concat(l),_="FormInput";return t&&(_+=" ".concat(t)),(0,n.jsxs)("div",{className:_,children:[(0,n.jsx)("label",{className:"FormInput__label",htmlFor:h,children:s}),1===c?(0,n.jsx)("input",{className:"FormInput__field",type:i,name:l,id:h,readOnly:r,disabled:o,value:m||"",placeholder:d,onChange:e=>u(e.target.value)}):(0,n.jsx)("textarea",{className:"FormInput__field",type:i,name:l,rows:c,id:h,value:m||"",placeholder:d,onChange:e=>u(e.target.value)}),a&&(0,n.jsx)("div",{className:"FormInput__sublabel",children:a})]})}i(4058);var a=i(6393),l=i(2265),r=i(2809),o=i(3145),c=i(2276);let d=async e=>{let{file:t,name:i,maxSize:n}=e;if(!(null==t?void 0:t.size))return{error:"ERROR_INVALID_FILE"};if(t.size>n)return{error:"ERROR_FILESIZE"};try{let{url:e,s3request:n}=await (0,c.Ko)("/api/modules/user_files3",{name:i,type:t.type,size:t.size}),s=new FormData;if(Object.entries({...n.fields,file:t}).forEach(e=>{let[t,i]=e;s.append(t,i)}),!(await fetch(n.url,{method:"POST",body:s})).ok)return{error:"ERROR_UPLOAD"};return{url:e}}catch(e){return{error:"ERROR_INTERNAL"}}};i(1611);var u=i(7677),m=i(1226);function h(e){let{className:t="",label:i,children:s,name:a,alt:r,onChange:c=()=>{},value:h}=e,[_,f]=(0,l.useState)(h),[v,p]=(0,l.useState)(),[x,j]=(0,l.useState)(!1),g="input_".concat(a),w=(0,l.useRef)(null);(0,l.useEffect)(()=>{h!==_&&c(_),_||(w.current.value="")},[_]);let b=async e=>{e.stopPropagation(),e.preventDefault(),await y(e.dataTransfer.files[0])},N=async e=>{e.preventDefault(),await y(e.target.files[0])},y=async e=>{if(!e)return;j(!0),p(null);let{url:t,error:i}=await d({file:e,name:a,maxSize:1e7});switch(i){case"ERROR_INVALID_FILE":p("Ogiltig bildfil."),j(!1);break;case"ERROR_FILESIZE":p("Bildfilen \xe4r f\xf6r stor. Max 1MB \xe4r till\xe5tet."),j(!1);break;case"ERROR_UPLOAD":p("N\xe5got gick fel n\xe4r bildfilen laddades upp. Prova igen."),j(!1);break;case"ERROR_INTERNAL":p("N\xe5got gick fel n\xe4r bildfilen laddades upp."),j(!1)}f(t)};return t+="FormUpload",x&&(t+=" FormUpload--pending"),(0,n.jsxs)("div",{className:t,children:[(0,n.jsx)("label",{className:"FormUpload__label",htmlFor:g,children:i}),(0,n.jsxs)("div",{className:"FormUpload__dropzone",onClick:()=>{w.current.click()},onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:b,children:[_&&(0,n.jsx)(o.default,{onLoad:()=>{j(!1)},src:_,width:150,height:150,alt:r}),!_&&!x&&(0,n.jsx)(m.gq,{className:"FormUpload__dropzone__upload",width:32,height:32}),x&&(0,n.jsx)(u.Z,{}),_&&!x&&(0,n.jsx)(m.x8,{onClick:e=>{e.stopPropagation(),e.preventDefault(),f(null)},className:"FormUpload__dropzone__clear",width:22,height:22})]}),(0,n.jsx)("input",{ref:w,type:"file",style:{visibility:"hidden",position:"absolute"},accept:"image/png, image/jpeg, image/gif",onChange:N}),v&&(0,n.jsx)("div",{className:"FormUpload__error",children:v}),s&&(0,n.jsx)("div",{className:"FormUpload__sublabel",children:s})]})}i(736);var _=i(6751);function f(){let e=(0,r.Z)(),[t,i]=(0,l.useState)(e.data),[o,c]=(0,l.useState)(!1),d=e=>n=>{i({...t,[e]:n}),c(!0)},u=async()=>{let{first_name:i,last_name:n}=t,s={...t,name:"".concat(i," ").concat(n)};await e.updateUserProfile(s),c(!1)},m=e.pending;return(0,n.jsxs)("div",{className:"ProfileForm",children:[(0,n.jsx)(s,{name:"email",type:"text",label:"E-postadress",placeholder:"E-postadress",isForm:!0,readOnly:!0,disabled:m,value:t.email,className:"Profile-template__email__input",children:(0,n.jsxs)("div",{className:"Profile-template__email__info",children:["(E-postadressen kan \xe4ndras p\xe5"," ",(0,n.jsx)("a",{href:"https://order.flowy.se/vimedia/selfservice",rel:"noreferrer",target:"_blank",children:"Mina sidor"}),")"]})}),(0,n.jsx)(_.default,{isPwa:!1,children:(0,n.jsx)(h,{name:"avatar",label:"Profilbild",alt:"Profilbild",isForm:!0,disabled:m,value:t.avatar,onChange:d("avatar"),className:"Profile-template__image__input"})}),(0,n.jsx)(s,{name:"first_name",type:"text",label:"F\xf6rnamn",placeholder:"F\xf6rnamn",disabled:m,value:t.first_name,onChange:d("first_name"),className:"Profile-template__first_name__input"}),(0,n.jsx)(s,{name:"last_name",type:"text",label:"Efternamn",placeholder:"Efternamn",disabled:m,value:t.last_name,onChange:d("last_name"),className:"Profile-template__last_name__input"}),(0,n.jsx)(s,{name:"bio",type:"text",label:"Beskrivning",placeholder:"Beskrivning",disabled:m,multiline:!0,rows:5,value:t.bio,onChange:d("bio"),className:"Profile-template__bio__input"}),(0,n.jsx)(a.default,{disabled:m,isTertiary:!o,className:"Profile-template__submit",onClick:u,children:"Spara \xe4ndringar"})]})}},1504:function(){},2491:function(){},5990:function(){},5809:function(){},8384:function(){},4157:function(){},8992:function(){},5976:function(){},3379:function(){},5544:function(){},366:function(){},884:function(){},1330:function(){},4058:function(){},1611:function(){},9994:function(){},993:function(){},2672:function(){},8232:function(){},5708:function(){},872:function(){},4629:function(){},6008:function(){},6106:function(){},2384:function(){},3697:function(){},4046:function(){},5490:function(){},7050:function(){},3949:function(){},3830:function(){},7707:function(){},6083:function(){},9233:function(){},7748:function(){},4713:function(){},4528:function(){},3138:function(){},9846:function(){}
1,8377:function(){},4811:function(){},6764:function(){},309:function(){},2310:function(){},736:function(){},6467:function(){},8364:function(){},1813:function(){},3969:function(){}}]);

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.