1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2426],{77428:function(e,t,r){r.d(t,{H:function(){return s},E:function(){return l}});var n=r(57437),a=r(2265),i=r(37976);let o=(0,a.createContext)({token:null,initiateSignIn:async()=>!1,completeSignIn:async()=>0,refreshSubStatus:async()=>{},markPurchaseCompleted:()=>{},subStatus:0,paymentMethods:null,hasCompletedPurchase:!1}),s=e=>{let{children:t}=e,r=i.S.initiateSignIn.useMutation(),s=i.S.completeSignIn.useMutation(),l=i.S.useUtils(),[c,u]=(0,a.useState)(null),[d,m]=(0,a.useState)(null),[v,h]=(0,a.useState)(null),[f,x]=(0,a.useState)([]),[y,S]=(0,a.useState)(!1),g=(0,a.useCallback)(()=>{S(!0)},[]),b=()=>Array.from({length:11},()=>Math.random().toString(36)[2]||"0").join(""),p=async e=>{let t=b();return m(t),await r.mutateAsync({phoneNumber:e,appHash:"f8c9a7e21d3",nonce:b(),legalConsents:{termsAndConditions:1,privacyPolicy:1,signupTerms:1},state:t}),!0},k=async(e,t)=>{var r;if(!d)throw Error("No state available for verification");let n=await s.mutateAsync({phoneNumber:e,code:t,nonce:b(),state:d}),a=null!==(r=null==n?void 0:n.access_token)&&void 0!==r?r:null==n?void 0:n.accessToken;if(!a)throw Error("No access token received from completeSignIn");let i=btoa(function(e){let t=e.replace(/\D/g,"").replace(/^0047/,"47");if(10===t.length&&t.startsWith("47"))return"+".concat(t);if(8===t.length)return"+47".concat(t);throw Error("Invalid phone number format")}(e)+";"+a);u(i);let o=await l.subscriptionStatus.fetch({accessToken:i});if(3===o){let e=await l.getPaymentMethods.fetch({accessToken:i});e&&x(e.filter(e=>"offline_other"!==e.payment_type))}return h(o),o},j=(0,a.useCallback)(async()=>{c&&h(await l.subscriptionStatus.fetch({accessToken:c}))},[c,l]);return(0,n.jsx)(o.Provider,{value:{token:c,initiateSignIn:p,completeSignIn:k,refreshSubStatus:j,markPurchaseCompleted:g,subStatus:v,paymentMethods:f,hasCompletedPurchase:y},children:t})},l=()=>(0,a.useContext)(o)},87519:function(e,t,r){r.d(t,{f:function(){return s},u:function(){return o}});var n=r(57437),a=r(2265);let i=(0,a.createContext)({bookPageMeta:{},setBookPageMeta:()=>{}}),o=e=>{let{children:t}=e,[r,o]=(0,a.useState)({});return(0,n.jsx)(i.Provider,{value:{bookPageMeta:r,setBookPageMeta:o},children:t})},s=()=>(0,a.useContext)(i)},24065:function(e,t,r){r.d(t,{kB:function(){return o},lB:function(){return s}});var n=r(57437),a=r(2265);let i=(0,a.createContext)({articleListPageLink:"",setArticleListPageLink:()=>{},seriesPageLink:"",setSeriesPageLink:()=>{},searchPageLink:"",setSearchPageLink:()=>{},listPageLink:"",setListPageLink:()=>{},personsPageLink:"",setPersonsPageLink:()=>{},activeCampaignLink:"",setActiveCampaignLink:()=>{},genresListPageLink:"",setGenresListPageLink:()=>{}}),o=e=>{let{children:t}=e,[r,o]=(0,a.useState)(""),[s,l]=(0,a.useState)(""),[c,u]=(0,a.useState)(""),[d,m]=(0,a.useState)(""),[v,h]=(0,a.useState)(""),[f,x]=(0,a.useState)(""),[y,S]=(0,a.useState)("");return(0,n.jsx)(i.Provider,{value:{articleListPageLink:r,setArticleListPageLink:o,seriesPageLink:s,setSeriesPageLink:l,searchPageLink:c,setSearchPageLink:u,listPageLink:d,setListPageLink:m,personsPageLink:v,setPersonsPageLink:h,activeCampaignLink:f,setActiveCampaignLink:x,genresListPageLink:y,setGenresListPageLink:S},children:t})},s=()=>(0,a.useContext)(i)},43278:function(e,t,r){r.d(t,{e3:function(){return o},zh:function(){return i}});var n=r(57437),a=r(2265);let i=(0,a.createContext)({showBanner:!0,setShowBanner:()=>{}}),o=e=>{let{children:t}=e,[r,o]=(0,a.useState)(!0);return(0,n.jsx)(i.Provider,{value:{showBanner:r,setShowBanner:o},children:t})}},69299:function(e,t,r){r.d(t,{hS:function(){return s},mD:function(){return o}});var n=r(57437),a=r(2265);let i=(0,a.createContext)(null),o=e=>{let{siteSettings:t,children:r}=e;return(0,n.jsx)(i.Provider,{value:t,children:r})},s=()=>{let e=(0,a.useContext)(i);if(!e)throw Error("useSiteSettings must be used within a SiteSettingContext.Provider");return e}},59644:function(e,t,r){r.d(t,{TC:function(){return s},f6:function(){return o}});var n=r(57437),a=r(2265);let i=(0,a.createContext)({colorTheme:"primary",setColorTheme:()=>{}}),o=e=>{let{children:t}=e,[r,o]=(0,a.useState)();return(0,n.jsx)(i.Provider,{value:{colorTheme:r,setColorTheme:o},children:t})},s=()=>(0,a.useContext)(i)},52650:function(e,t,r){r.d(t,{Ho:function(){return d.H},u2:function(){return S.u},f3:function(){return c},p0:function(){return h},kB:function(){return x.kB},e3:function(){return y.e3},mD:function(){return n.mD},f6:function(){return m.f6},Eu:function(){return d.E},jt:function(){return u},nB:function(){return f},lB:function(){return x.lB},TC:function(){return m.TC}});var n=r(69299),a=r(57437),i=r(37976),o=r(28364),s=r(2265);let l=(0,s.createContext)({customer:void 0,login:async()=>!1,fetchCustomer:async()=>({}),patchData:async()=>!1,setCustomer:()=>{},token:void 0,setToken:()=>{}}),c=e=>{let{children:t}=e,r=(0,s.useRef)((0,o.s4)()),n=i.S.authenticate.useMutation(),c=i.S.getuser.useQuery({accessToken:r.current},{enabled:!!r.current}
1),u=i.S.patchuser.useMutation(),[d,m]=(0,s.useState)(c.data),[v,h]=(0,s.useState)(void 0),f=(0,s.useCallback)(async()=>{r.current=(0,o.s4)();let e=await c.refetch();return m(e.data),e.data},[]),x=(0,s.useCallback)(async e=>{let{username:t,password:a}=e;try{let e=await n.mutateAsync({username:t,password:a});return(0,o.j1)(e.access_token,e.expires_in),r.current=e.access_token,!0}catch(e){return!1}},[n]),y=(0,s.useCallback)(async e=>{try{return await u.mutateAsync({accessToken:r.current,...e}),m(t=>({...t,...e})),!0}catch(e){return!1}},[u]);return(0,s.useEffect)(()=>{c.data&&m(c.data)},[c.data]),(0,a.jsx)(l.Provider,{value:{customer:d,login:x,fetchCustomer:f,patchData:y,setCustomer:m,token:v,setToken:h},children:t})},u=()=>(0,s.useContext)(l);var d=r(77428),m=r(59644);let v=(0,s.createContext)({customer:{},fetchCustomer:async()=>({}),setCustomer:()=>{}}),h=e=>{let{children:t}=e,{token:r}=(0,d.E)(),n=i.S.getUserFuse.useQuery({accessToken:null!=r?r:""},{enabled:!!r}),[o,l]=(0,s.useState)(),c=(0,s.useCallback)(async()=>{let e=await n.refetch();return l(e.data),e.data},[r]);return(0,s.useEffect)(()=>{n.data&&null!=r&&l(n.data)},[n.data]),(0,a.jsx)(v.Provider,{value:{customer:o,fetchCustomer:c,setCustomer:l},children:t})},f=()=>(0,s.useContext)(v);var x=r(24065),y=r(43278),S=r(87519)},42426:function(e,t,r){r.r(t),r.d(t,{RichText:function(){return P}});var n=r(57437),a=r(12333),i=r(99206),o=r(2265),s=r(65856),l=r(17946);let c=e=>{var t;let r={...e},a=null===(t=e.textContent)||void 0===t?void 0:t.match(/^\[([bB]utton)\]/);if(a&&e.textContent){let t=a[0].length,n=e.textContent.slice(t);r.textContent=n}return(0,n.jsx)(l.ZP,{link:e.metadata,children:(0,n.jsx)(i.wb,{...r})})},u=(0,a.jS)({base:{textDecoration:"underline",_active:{textDecoration:"none"},_focus:{borderRadius:"lg"}},variants:{colorTheme:{primary:{color:"text.tertiary",textDecorationColor:"fern.700",_hover:{color:"text"},_active:{color:"text"}},"surface-secondary-6":{color:"text.secondary.inverted",textDecorationColor:"dandelion.400",_hover:{color:"green.400"},_active:{color:"text.secondary.inverted"}}}}}),d=(e,t)=>{var r;return(0,n.jsx)("span",{className:u({colorTheme:t}),children:(0,n.jsx)(s.r,{variant:"inherit",href:null===(r=e.metadata)||void 0===r?void 0:r.href,children:(0,n.jsx)(i.wb,{...e})})})},m=(e,t)=>{var r,o;return(0,n.jsx)("p",{className:(0,a.iv)({mb:"ingress"===t?7:4,_firstOfType:"first-paragraph-ingress"===t?{textStyle:"body.large"}:void 0}),children:null!==(o=null===(r=e.children)||void 0===r?void 0:r.map((t,r)=>(0,n.jsx)(i.X_,{...t,overrides:e.overrides},r)))&&void 0!==o?o:(0,n.jsx)(i.wb,{...e})})},v=e=>{var t,r;return(0,n.jsx)("h1",{className:(0,a.iv)({textStyle:"display"}),children:null!==(r=null===(t=e.children)||void 0===t?void 0:t.map((t,r)=>(0,n.jsx)(i.X_,{...t,overrides:e.overrides},r)))&&void 0!==r?r:(0,n.jsx)(i.wb,{...e})})},h=e=>(0,n.jsx)("i",{className:e.textContent}),f=e=>(0,n.jsx)("i",{className:(0,a.iv)({fontStyle:"italic"}),children:e.textContent}),x=e=>{var t,r;return(0,n.jsx)("h2",{className:(0,a.iv)({textStyle:"title.small.medium"}),children:null!==(r=null===(t=e.children)||void 0===t?void 0:t.map((t,r)=>(0,n.jsx)(i.X_,{...t,overrides:e.overrides},r)))&&void 0!==r?r:(0,n.jsx)(i.wb,{...e})})},y=e=>{var t,r;return(0,n.jsx)("h3",{className:(0,a.iv)({textStyle:"title.small.bold"}),children:null!==(r=null===(t=e.children)||void 0===t?void 0:t.map((t,r)=>(0,n.jsx)(i.X_,{...t,overrides:e.overrides},r)))&&void 0!==r?r:(0,n.jsx)(i.wb,{...e})})},S=e=>{var t,r;return(0,n.jsx)("h4",{children:null!==(r=null===(t=e.children)||void 0===t?void 0:t.map((t,r)=>(0,n.jsx)(i.X_,{...t,overrides:e.overrides},r)))&&void 0!==r?r:(0,n.jsx)(i.wb,{...e})})},g=e=>(0,n.jsx)("ul",{className:(0,a.iv)({listStyleType:"disc",listStylePosition:"inside",mb:4}),children:(0,n.jsx)(i.wb,{...e})}),b=(e,t)=>{let r=(0,a.jS)({base:{listStyleType:"none",listStylePosition:"inside",counterReset:"item",mb:4,"& li":{display:"block",_before:{content:'counter(item) " "',counterIncrement:"item",fontWeight:700,fontVariantNumeric:"oldstyle-nums tabular-nums",margin:0}}},variants:{colorTheme:{primary:{"& li":{_before:{color:"icon.accent.2"}}},"surface-secondary-6":{"& li":{_before:{color:"icon.accent.1"}}}}}});return(0,n.jsx)("ol",{className:r({colorTheme:t}),children:(0,n.jsx)(i.wb,{...e})})},p=(e,t)=>{let r=(0,a.jS)({base:{_marker:{color:"icon.accent.2",fontWeight:700,margin:0}},variants:{colorTheme:{primary:{},"surface-secondary-6":{_marker:{color:"icon.accent.1"}}}}});return(0,n.jsx)("li",{className:r({colorTheme:t}),children:(0,n.jsx)(i.wb,{...e})})},k=(e,t)=>{let r=(0,a.jS)({base:{textStyle:"title.large.bold",color:"text.secondary",base
1:{my:"6"},md:{my:"7"}},variants:{colorTheme:{primary:{},"surface-secondary-6":{color:"text.secondary.inverted"}}}});return(0,n.jsxs)("blockquote",{className:r({colorTheme:t}),children:["â",(0,n.jsx)(i.wb,{...e}),"â"]})};var j=r(52650);let C=(e,t)=>{var r,n;return(null==e?void 0:null===(n=e.textContent)||void 0===n?void 0:null===(r=n.toLowerCase())||void 0===r?void 0:r.includes("[button]"))?c(e):d(e,t)},w=(e,t)=>({link:e=>C(e,t),paragraph:t=>m(t,e),code:h,heading1:v,heading2:x,emphasized:f,heading3:y,heading4:S,quote:e=>k(e,t),"unordered-list":g,"ordered-list":e=>b(e,t),"list-item":e=>p(e,t)}),T=(0,a.jS)({base:{"& > :last-child":{mb:0}},variants:{textType:{ingress:{textStyle:"body.large"},body:{textStyle:"body.medium"},"first-paragraph-ingress":{textStyle:"body.medium"},base:{textStyle:"body.large",fontSize:"formField.desktop"},inherit:{}}}}),P=(0,o.forwardRef)((e,t)=>{let{richTextJson:r,type:a}=e,[s,l]=(0,o.useState)(),{colorTheme:c}=(0,j.TC)();(0,o.useEffect)(()=>{c&&l(c)});let u=null!=a?a:"body";return r?(0,n.jsx)("div",{ref:t,className:T({textType:u}),children:(0,n.jsx)(i.f_,{json:r,overrides:w(u,null!=s?s:"primary")})}):""});P.displayName="RichText"},28364:function(e,t,r){r.d(t,{j1:function(){return a},s4:function(){return i}});let n="fabel_token",a=(e,t)=>{let r=new Date().getTime()+1e3*t;localStorage.setItem(n,JSON.stringify({token:e,expiresAt:r})),document.cookie="".concat(n,"=").concat(e,"; secure; path=/; SameSite=strict")},i=()=>{try{let e=localStorage.getItem(n);if(!e)return;let{token:t,expiresAt:r}=JSON.parse(e);if(r<new Date().getTime()||!t)return!1;return t}catch(e){return!1}}}}]);
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.