1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95057,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={formatUrl:function(){return l},formatWithValidation:function(){return d},urlObjectKeys:function(){return o}};for(var n in r)Object.defineProperty(s,n,{enumerable:!0,get:r[n]});let a=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:s}=e,r=e.protocol||"",n=e.pathname||"",l=e.hash||"",o=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:s&&(d=t+(~s.indexOf(":")?`[${s}]`:s),e.port&&(d+=":"+e.port)),o&&"object"==typeof o&&(o=String(a.urlQueryToSearchParams(o)));let c=e.search||o&&`?${o}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||i.test(r))&&!1!==d?(d="//"+(d||""),n&&"/"!==n[0]&&(n="/"+n)):d||(d=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),n=n.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${r}${d}${n}${c}${l}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return l(e)}},18581,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"useMergedRef",{enumerable:!0,get:function(){return n}});let r=e.r(71645);function n(e,t){let s=(0,r.useRef)(null),n=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=s.current;e&&(s.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(s.current=a(e,r)),t&&(n.current=a(t,r))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let s=e(t);return"function"==typeof s?s:()=>e(null)}}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},73668,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"isLocalURL",{enumerable:!0,get:function(){return a}});let r=e.r(18967),n=e.r(52817);function a(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),s=new URL(e,t);return s.origin===t&&(0,n.hasBasePath)(s.pathname)}catch(e){return!1}}},84508,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},22016,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={default:function(){return g},useLinkStatus:function(){return j}};for(var n in r)Object.defineProperty(s,n,{enumerable:!0,get:r[n]});let a=e.r(90809),i=e.r(43476),l=a._(e.r(71645)),o=e.r(95057),d=e.r(8372),c=e.r(18581),u=e.r(18967),x=e.r(5550);e.r(33525);let p=e.r(88540),h=e.r(91949),m=e.r(73668),f=e.r(9396);function g(t){var s,r;let n,a,g,[j,v]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),w=(0,l.useRef)(null),{href:y,as:N,children:k,prefetch:S=null,passHref:C,replace:L,shallow:M,scroll:_,onClick:A,onMouseEnter:E,onTouchStart:P,legacyBehavior:$=!1,onNavigate:T,transitionTypes:B,ref:I,unstable_dynamicOnHover:D,...O}=t;n=k,$&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let R=l.default.useContext(d.AppRouterContext),F=!1!==S,U=!1!==S?null===(r=S)||"auto"===r?f.FetchStrategy.PPR:f.FetchStrategy.Full:f.FetchStrategy.PPR,z="string"==typeof(s=N||y)?s:(0,o.formatUrl)(s);if($){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=l.default.Children.only(n)}let K=$?a&&"object"==typeof a&&a.ref:I,V=l.default.useCallback(e=>(null!==R&&(w.current=(0,h.mountLinkInstance)(e,z,R,U,F,v)),()=>{w.current&&((0,h.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,h.unmountPrefetchableInstance)(e)}),[F,z,R,U,v]),W={ref:(0,c.useMergedRef)(V,K),onClick(t){$||"function"!=typeof A||A(t),$&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!R||t.defaultPrevented||function(t,s,r,n,a,i,o){if("u">typeof window){let d,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;
1if(!(0,m.isLocalURL)(s)){n&&(t.preventDefault(),location.replace(s));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);l.default.startTransition(()=>{u(s,n?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,r.current,o)})}}(t,z,w,L,_,T,B)},onMouseEnter(e){$||"function"!=typeof E||E(e),$&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),R&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){$||"function"!=typeof P||P(e),$&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),R&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,u.isAbsoluteUrl)(z)?W.href=z:$&&!C&&("a"!==a.type||"href"in a.props)||(W.href=(0,x.addBasePath)(z)),g=$?l.default.cloneElement(a,W):(0,i.jsx)("a",{...O,...W,children:n}),(0,i.jsx)(b.Provider,{value:j,children:g})}e.r(84508);let b=(0,l.createContext)(h.IDLE_LINK_STATUS),j=()=>(0,l.useContext)(b);("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},18566,(e,t,s)=>{t.exports=e.r(76562)},23676,62773,29529,21638,25225,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(22016),n=e.i(18566);e.i(14539);var a=e.i(97427);e.i(61978);var i=e.i(52831);function l(){return(0,t.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M16.365 1.43c0 1.14-.42 2.2-1.12 2.99-.85.96-2.24 1.7-3.38 1.61-.14-1.09.44-2.24 1.09-2.96.73-.82 2.05-1.44 3.16-1.49.03.28.05.55.05.85zM20.5 17.03c-.53 1.23-.79 1.78-1.47 2.87-.95 1.52-2.29 3.41-3.95 3.42-1.47.01-1.85-.96-3.85-.95-2 .01-2.42.96-3.9.95-1.66-.01-2.93-1.72-3.88-3.24C1.06 16.15.79 11.4 2.5 8.9c1.02-1.5 2.62-2.4 4.13-2.4 1.53 0 2.5 1 3.77 1 1.23 0 1.98-1 3.75-1 1.35 0 2.78.74 3.8 2-.09.06-2.26 1.32-2.24 3.94.03 3.14 2.76 4.19 2.79 4.2z"})})}function o(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M3 3.5v17l10-8.5L3 3.5zm12 6.5l3.2 2.7L22 10l-4-2.3L15 10zm0 4l3 2.3 4-2.3-3.8-2.7L15 14z"})})}function d(){let e="flex items-center gap-2 rounded-[9px] border border-white/[0.14] bg-surface px-4 py-2.5 font-heading text-[13px] font-semibold text-white transition-colors hover:border-white/30";return(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,t.jsxs)("a",{href:"https://apps.apple.com/is/app/id6790426764",target:"_blank",rel:"noopener noreferrer",className:e,children:[(0,t.jsx)(l,{}),"App Store"]}),(0,t.jsxs)("a",{href:"https://play.google.com/store/apps/details?id=com.beintibilinn.app",target:"_blank",rel:"noopener noreferrer",className:e,children:[(0,t.jsx)(o,{}),"Google Play"]})]})}e.s(["default",0,d],62773);var c=e.i(72299),u=e.i(59141);async function x(e){let t=e.pan.replace(/\s/g,""),s=2===e.expYear.length?`20${e.expYear}`:e.expYear,r=e.expMonth.padStart(2,"0"),n=new URLSearchParams({PAN:t,ExpMonth:r,ExpYear:s,CVC:e.cvc,TokenLifetime:"120"}),a=await fetch("https://ecommerce.borgun.is/rpg/api/token/single",{method:"POST",headers:{Authorization:`Basic ${btoa("361150_puZEyLcIw918++ppKfFwMnhT23EaQ4HNr+:")}`,"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()}),i=await a.json().catch(()=>({})),l=i.Token??i.token;if(!l)throw Error(String(i.Message??i.message??"Kortavinnsla mistókst."));return{token:l,lastFour:t.slice(-4),expiry:`${r}/${s}`}}e.s(["tokenizeCard",0,x],29529);let p=[{key:"monthly",label:"Mánaðaráskrift",months:1,price:1490,renews:"mánaðarlega",badge:null},{key:"quarterly",label:"3 mánaða áskrift",months:3,price:4390,renews:"á 3 mánaða fresti",badge:null},{key:"yearly",label:"Ãrsáskrift",months:12,price:14900,renews:"árlega",badge:"2 mán frÃtt"}],h=e=>e.toLocaleString("de-DE");function m(){return(0,t.jsxs)("svg",{width:"19",height:"19",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,
1children:[(0,t.jsx)("circle",{cx:"9",cy:"21",r:"1"}),(0,t.jsx)("circle",{cx:"20",cy:"21",r:"1"}),(0,t.jsx)("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]})}function f({open:e,onClose:r}){let{user:l,signUp:o}=(0,c.useAuth)(),g=(0,n.useRouter)(),[b,j]=(0,s.useState)(""),[v,w]=(0,s.useState)(""),[y,N]=(0,s.useState)(""),[k,S]=(0,s.useState)(""),[C,L]=(0,s.useState)(""),[M,_]=(0,s.useState)(p[0]),[A,E]=(0,s.useState)("form"),[P,$]=(0,s.useState)(null),T="processing"===A;if((0,s.useEffect)(()=>{let t=e=>{"Escape"===e.key&&"processing"!==A&&r()};return e&&document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,r,A]),!e)return null;let B=async e=>{e.preventDefault(),$(null),E("processing");try{let[e,t]=k.split("/"),s=await x({pan:y,expMonth:(e??"").trim(),expYear:(t??"").trim(),cvc:C});l||await o(b,v);let r=(0,i.httpsCallable)(u.functions,"createSubscription");await r({singleToken:s.token,lastFour:s.lastFour,expiry:s.expiry,plan:M.key}),E("success")}catch(t){let e="Eitthvað fór úrskeiðis. Reyndu aftur.";t instanceof a.FirebaseError?e=t.code.startsWith("auth/")?(0,c.authErrorMessage)(t.code):"functions/already-exists"===t.code?t.message||"Ãú ert nú þegar með virka áskrift.":t.message||e:t instanceof Error&&t.message&&(e=t.message),$(e),E("form")}},I="w-full min-h-12 rounded-[11px] border border-[#2a3852] bg-[#0d1526] px-[15px] py-3 text-[15px] text-ink outline-none placeholder:text-muted focus:border-green",D=e=>(0,t.jsx)("div",{className:"fixed inset-0 z-[100] flex items-start justify-center overflow-y-auto bg-[rgba(6,11,22,0.55)] p-4 py-10 backdrop-blur-md sm:py-14",onClick:T?void 0:r,children:(0,t.jsx)("div",{className:"relative w-full max-w-[460px] rounded-[18px] border border-white/[0.08] bg-[#141d33] p-6 shadow-[0_40px_90px_rgba(0,0,0,0.55)] sm:p-[30px]",onClick:e=>e.stopPropagation(),children:e})});return"success"===A?D((0,t.jsxs)("div",{className:"px-1 pb-2 pt-6 text-center",children:[(0,t.jsx)("span",{className:"mx-auto mb-[22px] flex h-[72px] w-[72px] items-center justify-center rounded-full bg-green",children:(0,t.jsx)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M20 6L9 17l-5-5"})})}),(0,t.jsx)("h2",{className:"mb-2 font-heading text-[23px] font-extrabold text-white",children:"Velkomin um borð! ð"}),(0,t.jsx)("p",{className:"mb-2 text-sm leading-[1.55] text-sub",children:"Ãskriftin er virk â allir þættirnir bÃða þÃn, hér á vefnum og à appinu."}),(0,t.jsxs)("p",{className:"mb-6 text-[12.5px] leading-normal text-muted",children:[M.label," · endurnýjast sjálfkrafa ",M.renews," (",h(M.price)," kr)."]}),(0,t.jsx)("div",{className:"mb-4 flex justify-center",children:(0,t.jsx)(d,{})}),(0,t.jsx)("button",{onClick:()=>{r(),g.push("/spilarinn")},className:"p-2 font-heading text-sm font-bold text-green transition-colors hover:text-green-light",children:"Byrja að horfa â"}),(0,t.jsx)("button",{onClick:()=>{r(),g.push("/minar-sidur")},className:"block w-full py-2 text-sm text-muted hover:text-ink",children:"MÃnar sÃður"})]})):D((0,t.jsxs)(t.Fragment,{children:[!T&&(0,t.jsx)("button",{onClick:r,className:"absolute right-5 top-5 flex p-1 text-muted hover:text-white","aria-label":"Loka",children:(0,t.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})}),T&&(0,t.jsxs)("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-4 roun
1ded-[18px] bg-[#141d33]/95",children:[(0,t.jsx)("span",{className:"h-9 w-9 animate-spin rounded-full border-[3px] border-line border-t-green"}),(0,t.jsx)("p",{className:"text-sm font-medium text-ink",children:"Vinnum úr greiðslunniâ¦"}),(0,t.jsx)("p",{className:"text-xs text-faint",children:"Ãetta tekur örfáar sekúndur."})]}),(0,t.jsx)("h2",{className:"mb-1.5 font-heading text-2xl font-extrabold text-white",children:"Kaupa áskrift"}),(0,t.jsxs)("p",{className:"mb-[22px] text-sm text-[#9aa7bd]",children:["Frá ",(0,t.jsxs)("span",{className:"font-bold text-green",children:[h(Math.round(p[2].price/12))," kr"]})," á mánuði â hættu hvenær sem er."]}),(0,t.jsx)("p",{className:"mb-2.5 font-heading text-xs font-semibold tracking-[0.04em] text-muted",children:"TÃMABIL"}),(0,t.jsx)("div",{role:"radiogroup","aria-label":"TÃmabil",className:"mb-3.5 grid grid-cols-3 gap-2.5",children:p.map(e=>{let s=e.key===M.key;return(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":s,disabled:T,onClick:()=>_(e),className:`relative flex flex-col items-center rounded-[13px] border-2 px-1.5 pb-3 pt-3.5 transition-colors ${s?"border-green bg-[#132a4c]":"border-[#2a3852] bg-[#0d1526] hover:border-[#3a4a68]"}`,children:[e.badge&&(0,t.jsx)("span",{className:"absolute -top-2.5 rounded-full bg-green px-2 py-[2px] font-heading text-[10px] font-bold text-white",children:e.badge}),(0,t.jsxs)("span",{className:"font-heading text-[15px] font-bold text-white",children:[e.months," mán"]}),(0,t.jsx)("span",{className:"mt-[3px] font-heading text-[15px] font-extrabold text-white",children:h(e.price)}),(0,t.jsx)("span",{className:"text-[10px] text-muted",children:1===e.months?"kr/mán":`${h(Math.round(e.price/e.months))} kr/m\xe1n`})]},e.key)})}),(0,t.jsxs)("div",{className:"mb-[22px] flex gap-2.5 rounded-[11px] border border-green/25 bg-green/[0.08] px-3.5 py-3",children:[(0,t.jsx)("span",{className:"mt-px flex-none",children:(0,t.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"#3bbd6a",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,t.jsx)("path",{d:"M23 4v6h-6M1 20v-6h6"}),(0,t.jsx)("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}),(0,t.jsxs)("p",{className:"text-[12.5px] leading-normal text-sub",children:["Ãú greiðir ",(0,t.jsxs)("strong",{className:"text-white",children:[h(M.price)," kr"]})," núna fyrir"," ",1===M.months?"eins mánaðar áskrift":`${M.months} m\xe1nu\xf0i`,". Ãskriftin"," ",(0,t.jsx)("strong",{className:"text-white",children:"endurnýjast sjálfkrafa"})," ",M.renews," á sama verði, þar til þú segir upp. Ãú getur sagt upp hvenær sem er á MÃnu svæði."]})]}),(0,t.jsxs)("form",{onSubmit:B,className:"flex flex-col gap-3",children:[l?(0,t.jsxs)("p",{className:"rounded-[11px] bg-[#0d1526] px-[15px] py-3 text-sm text-muted",children:["Ãskrift fyrir ",(0,t.jsx)("span",{className:"font-semibold text-ink",children:l.email})]}):(0,t.jsx)("input",{type:"email",required:!0,autoComplete:"email",placeholder:"Netfang",value:b,onChange:e=>j(e.target.value),className:I}),(0,t.jsx)("input",{inputMode:"numeric",required:!0,autoComplete:"cc-number",placeholder:"Kortanúmer",value:y,onChange:e=>N(e.target.value.replace(/\D/g,"").slice(0,16).replace(/(.{4})/g,"$1 ").trim()),className:I}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("input",{inputMode:"numeric",required:!0,autoComplete:"cc-exp",placeholder:"MM/ÃÃ",value:k,onChange:e=>{let t;return S((t=e.target.value.replace(/\D/g,"").slice(0,4)).length>=3?`${t.slice(0,2)}/${t.slice(2)}`:t)},className:I}),(0,t.jsx)("input",{inputMode:"numeric",required:!0,autoComplete:"cc-csc",placeholder:"CVC",value:C,onChange:e=>L(e.target.value.replace(/\D/g,"").slice(0,4)),className:I})]}),!l&&(0,t.jsx)("input",{type:"password",required:!0,autoComplete:"new-password",placeholder:"Veldu lykilorð",value:v,onChange:e=>w(e.target.value),className:I}),P&&(0,t.jsx)("p",{className:"text-sm text-danger",children:P}),(0,t.jsxs)("button",{type:"submit",disabled:T,className:"mt-1 flex items-center justify-center gap-[9px] rounded-xl bg-green p-[15px] font-heading text-base font-bold text-white transition-colors hover:bg-green-dark disabled:opacity-60",children:[(0,t.jsx)(m,{}),T?"â¦":`Kaupa \xe1skrift â ${h(M.price)} kr`]}),(0,t.jsxs)("p",{className:"text-center text-[11.5px] leading-normal text-[#6b7a94]",children:["Með þvà að kaupa samþykkir þú skilmála Beint à bÃlinn.",(0,t.jsx)("br",{}),"Endurnýjast sjálfkrafa ",M.renews," þar til sagt er upp."]})]})]}))}function g({href:e,label:s,active:n}){return(0,t.jsx)(r.default,{href:e,className:`flex-none whitespace-nowrap font-heading text-[13px] transition-colors sm:text-sm ${n?"font-semibold text-white":"font-medium text-[#c8d3e6] hover:text-white"}`,children:s})}e.s(["PLANS",0,p,"kr",0,h,"planLabel",0,e=>12===e?"Ãrsáskrift":e>1?`${e} m\xe1na\xf0a \xe1skrift`:"Mánaðaráskrift"],21638),e.s(["default",0,f],25225),e.s(["default",0,function(){let{user:e,loading:a}
1=(0,c.useAuth)(),i=(0,n.usePathname)(),[l,o]=(0,s.useState)(!1);return(0,t.jsxs)("header",{className:"fixed top-0 z-50 w-full bg-navy",children:[(0,t.jsxs)("div",{className:"mx-auto flex h-16 w-full max-w-[1220px] items-center gap-3.5 px-4 sm:gap-7 sm:px-8",children:[(0,t.jsx)(r.default,{href:"/",className:"mr-auto flex flex-none items-center",children:(0,t.jsx)("img",{src:"/brand/logo-gulur.png",alt:"Beint à bÃlinn",className:"h-9 w-auto sm:h-11"})}),(0,t.jsx)(g,{href:"/",label:"ForsÃða",active:"/"===i}),(0,t.jsx)(g,{href:"/spilarinn",label:"Spilarinn",active:"/spilarinn"===i}),(0,t.jsx)(g,{href:e?"/minar-sidur":"/innskra",label:"Mitt svæði",active:"/minar-sidur"===i||"/innskra"===i}),e?(0,t.jsx)(r.default,{href:"/minar-sidur","aria-label":"Mitt svæði",className:"flex h-[38px] w-[38px] flex-none items-center justify-center rounded-full bg-yellow font-heading text-sm font-bold text-navy",children:(0,c.userInitials)(e)}):a?(0,t.jsx)("span",{className:"h-[38px] w-[38px] flex-none rounded-full bg-white/10"}):(0,t.jsx)("button",{onClick:()=>o(!0),className:"hidden flex-none rounded-lg bg-green px-5 py-2.5 font-heading text-sm font-bold text-white transition-colors hover:bg-green-dark sm:block",children:"Kaupa áskrift"})]}),(0,t.jsx)(f,{open:l,onClose:()=>o(!1)})]})}],23676)},13642,e=>{"use strict";var t=e.i(43476),s=e.i(22016);e.s(["default",0,function(){return(0,t.jsx)("footer",{className:"mt-auto w-full bg-navy-deep",children:(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-[1220px] flex-wrap items-center gap-6 px-4 py-6 text-[13px] text-[#7c8aa3] sm:px-8",children:[(0,t.jsx)("img",{src:"/brand/logo-gulur.png",alt:"Beint à bÃlinn",className:"h-7 w-auto"}),(0,t.jsx)(s.default,{href:"/personuvernd",className:"transition-colors hover:text-ink",children:"Persónuvernd"}),(0,t.jsx)("a",{href:"mailto:[email protected]",className:"transition-colors hover:text-ink",children:"Hafa samband"}),(0,t.jsx)("span",{className:"ml-auto",children:"© 2026 Beint à bÃlinn"})]})})}])},28719,e=>{"use strict";var t=e.i(35506);e.s(["collection",()=>t.aR])},17689,e=>{"use strict";var t=e.i(35506);e.s(["doc",()=>t.a9])},10743,e=>{"use strict";e.i(36180);var t=e.i(28719),s=e.i(17689),r=e.i(63802),n=e.i(59141);let a=["janúar","febrúar","mars","aprÃl","maÃ","júnÃ","júlÃ","ágúst","september","október","nóvember","desember"];function i(e){return e?"function"==typeof e.toDate?e.toDate().toISOString():"number"==typeof e.seconds?new Date(1e3*e.seconds).toISOString():"string"==typeof e?e:null:null}async function l(){let e=(await (0,r.getDocs)((0,t.collection)(n.db,"episodes"))).docs.map(e=>{let t=e.data();return{id:e.id,title:t.title??e.id,description:t.description??null,imageUrl:t.imageUrl??null,publishedAt:i(t.publishedAt),durationSec:t.duration??null,episodeNumber:t.episodeNumber??null,series:t.series??"unknown",state:t.state??"unknown",hasVideo:!0===t.hasVideo,muxPlaybackId:t.muxPlaybackId??null,isFree:!0===t.isFree,categories:t.wpCategories??[]}}),s=new Date().toISOString();return e.filter(e=>"main"===e.series&&("published"===e.state||"scheduled"===e.state)&&null!=e.episodeNumber&&(!e.publishedAt||e.publishedAt<=s)).sort((e,t)=>(t.episodeNumber??0)-(e.episodeNumber??0))}function o(e,t){return{id:e,title:t.title??e,description:t.description??null,imageUrl:t.imageUrl??null,publishedAt:i(t.publishedAt),durationSec:t.duration??null,episodeNumber:t.episodeNumber??null,series:t.series??"unknown",state:t.state??"unknown",hasVideo:!0===t.hasVideo,muxPlaybackId:t.muxPlaybackId??null,isFree:!0===t.isFree,categories:t.wpCategories??[]}}async function d(e){let t=await (0,r.getDoc)((0,s.doc)(n.db,"episodes",e));return t.exists()?o(t.id,t.data()):null}async function c(){let e=await (0,r.getDocs)((0,t.collection)(n.db,"episodes")),s=new Date().toISOString();return e.docs.map(e=>o(e.id,e.data())).filter(e=>("published"===e.state||"scheduled"===e.state)&&(!e.publishedAt||e.publishedAt<=s)).sort((e,t)=>(t.publishedAt??"").localeCompare(e.publishedAt??""))}e.s(["CATEGORY_LABELS",0,{bilinn:"Beint à bÃlinn",gestir:"Gestir",grillid:"Beint à Grillið",hringferdin:"Hringferðin",alheims:"Alheimsdraumurinn",husbilinn:"Beint à húsbÃlinn",bilskurinn:"Beint à bÃlskúrinn",liveshow:"Live Show",hljod:"Hljóðþættir"},"episodeThumb",0,function(e,t=640,s=360){return e.hasVideo?e.muxPlaybackId?`https://image.mux.com/${e.muxPlaybackId}/thumbnail.webp?width=${t}&height=${s}&fit_mode=smartcrop`:null:"/audio-cover.png"},"fetchCatalog",0,c,"fetchEpisode",0,d,"fetchPublishedEpisodes",0,l,"formatIsDate",0,function(e,t){if(!e)return"";let s=new Date(e);return`${s.getDate()}. ${a[s.getMonth()]}${t?.year?` ${s.getFullYear()}`:""}`},"searchEpisodes",0,function(e,t){let s=t.trim().toLowerCase();if(""===s)return e;let r=s.match(/\d+/)?parseInt(s.match(/\d+/)[0],10):null,n=null==r?[]:e.filter(e=>e.episodeNumber===r),a=e.filter(e=>!n.includes(e)&&e.title.toLowerCase().includes(s));return[...n,...a]}])},51010,21241,e=>{"use strict";e.i(36180);var t=e.i(28719),s=e.i(63802),r=e.i(17689),n=e.i(35506);e.s(["serverTimestamp",()=>n.b4],21241);var n=n,a=e.i(59141);async function i(e){return(await (0,s.getDocs)((0,t.collection)(a.db,"users",e.toLowerCase(),"playback"))).docs.map(e=>{let t=e.data(),s=t.updatedAt;return{episodeId:e.id,positionSec:"number"==typeof t.positionSec?t.positionSec:0,durationSec:"number"==typeof t.durationSec?t.durationSec:0,played:!0===t.played,updatedAt:"function"==typeof s?.toDate?s.toDate().toISOString():null}}).sort((e,t)=>
1(t.updatedAt??"").localeCompare(e.updatedAt??""))}async function l(e){let r=await (0,s.getDocs)((0,t.collection)(a.db,"users",e.toLowerCase(),"playback")),n=new Set;return r.docs.forEach(e=>{e.data().played&&n.add(e.id)}),n}async function o(e,t){await (0,s.setDoc)((0,r.doc)(a.db,"users",e.toLowerCase(),"playback",t),{played:!0,playedAt:(0,n.b4)()},{merge:!0})}async function d(e,t){return(await (0,s.getDoc)((0,r.doc)(a.db,"users",e.toLowerCase(),"saved_episodes",t))).exists()}async function c(e,t){let i=(0,r.doc)(a.db,"users",e.toLowerCase(),"saved_episodes",t);return(await (0,s.getDoc)(i)).exists()?(await (0,s.deleteDoc)(i),!1):(await (0,s.setDoc)(i,{savedAt:(0,n.b4)()}),!0)}e.s(["fetchPlayedIds",0,l,"fetchProgress",0,i,"isSaved",0,d,"markPlayed",0,o,"toggleSaved",0,c],51010)},88442,e=>{"use strict";var t=e.i(43476);function s({className:e=""}){return(0,t.jsx)("div",{className:`skeleton ${e}`,"aria-hidden":!0})}function r({width:e="w-[252px]"}){return(0,t.jsxs)("div",{className:`${e} flex-none`,children:[(0,t.jsx)(s,{className:"aspect-[16/10] rounded-[11px]"}),(0,t.jsx)(s,{className:"mt-2.5 h-3.5 w-[85%] rounded"}),(0,t.jsx)(s,{className:"mt-2 h-3 w-[55%] rounded"})]})}e.s(["EpisodeGridSkeleton",0,function(){return(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",role:"status","aria-label":"Sæki þætti",children:[0,1,2,3,4,5].map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)(s,{className:"aspect-video rounded-xl"}),(0,t.jsx)(s,{className:"mt-3 h-3.5 w-[80%] rounded"}),(0,t.jsx)(s,{className:"mt-2 h-3 w-[45%] rounded"})]},e))})},"ShelvesSkeleton",0,function(){return(0,t.jsx)("div",{className:"flex flex-col gap-9",role:"status","aria-label":"Sæki þætti",children:[0,1].map(e=>(0,t.jsxs)("section",{children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,t.jsx)("span",{className:"h-5 w-1 rounded-[2px] bg-green/40","aria-hidden":!0}),(0,t.jsx)(s,{className:"h-5 w-40 rounded"})]}),(0,t.jsx)("div",{className:"flex gap-[18px] overflow-hidden px-1 pb-2.5 pt-1",children:[0,1,2,3,4].map(e=>(0,t.jsx)(r,{},e))})]},e))})},"SidebarSkeleton",0,function(){return(0,t.jsx)("div",{className:"flex flex-col gap-1 p-2",role:"status","aria-label":"Sæki þætti",children:[0,1,2,3,4,5,6,7].map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3 p-[9px]",children:[(0,t.jsx)(s,{className:"aspect-[16/10] w-[82px] flex-none rounded-md"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(s,{className:"h-3 w-[75%] rounded"}),(0,t.jsx)(s,{className:"mt-2 h-2.5 w-[40%] rounded"})]})]},e))})}])},52683,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(22016),n=e.i(23676),a=e.i(13642),i=e.i(10743),l=e.i(88442);function o(){return(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-[rgba(6,11,22,0.5)]",children:(0,t.jsx)("span",{className:"flex h-[38px] w-[38px] items-center justify-center rounded-full bg-white/[0.92]",children:(0,t.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"#17335f",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,t.jsx)("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),(0,t.jsx)("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]})})})}function d({episodes:e,entitled:r=null,progress:n}){let[a,o]=(0,s.useState)(null),u=e??a;return((0,s.useEffect)(()=>{void 0===e&&(0,i.fetchCatalog)().then(o).catch(()=>o([]))},[e]),u)?0===u.length?null:(0,t.jsx)("div",{className:"flex flex-col gap-9",children:Object.entries(i.CATEGORY_LABELS).map(([e,s])=>{let a=u.filter(t=>t.categories.includes(e));return 0===a.length?null:(0,t.jsx)(c,{slug:e,label:s,episodes:a,entitled:r,progress:n},e)})}):(0,t.jsx)(l.ShelvesSkeleton,{})}function c({slug:e,label:s,episodes:n,entitled:a,progress:l}){return(0,t.jsxs)("section",{children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,t.jsx)("span",{className:"h-5 w-1 rounded-[2px] bg-green","aria-hidden":!0}),(0,t.jsx)("h2",{className:"text-xl font-bold text-ink",children:s}),(0,t.jsxs)("span",{className:"text-xs font-semibold text-faint",children:[n.length," ",1===n.length?"þáttur":"þættir"]}),(0,t.jsx)(r.default,{href:`/spilarinn?flokkur=${e}`,className:"ml-auto font-heading text-[13px] font-semibold text-green hover:text-green-light",children:"Sjá allt âº"})]}),(0,t.jsx)("div",{className:"rowscroll flex gap-[18px] px-1 pb-2.5 pt-1",children:n.slice(0,12).map(e=>{var s;let n=(0,i.episodeThumb)(e,480,300),d=(s=e.durationSec)?`${Math.round(s/60)} m\xedn`:"",c=!1===a&&!e.isFree,u=l?.get(e.id);return(0,t.jsxs)(r.default,{href:`/thattur/${e.id}`,className:"group w-[252px] flex-none transition-transform duration-150 hover:-translate-y-1",children:[(0,t.jsxs)("div",{className:"stripe relative aspect-[16/10] overflow-hidden rounded-[11px] border border-white/[0.07] transition-colors group-hover:border-green",children:[n&&(0,t.jsx)("img",{src:n,alt:"",loading:"lazy",className:"absolute inset-0 h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.04]"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent to-surface/55"}),null!=e.episodeNumber&&(0,t.jsxs)("span",{className:"absolute left-2 top-2 rounded-[5px] bg-[rgba(6,11,22,0.85)] px-2 py-[3px] font-heading text-[10px] font-bold text-yellow",children:["#",e.episodeNumber]}),c&&(0,t.jsx)(o,{}),void 0!==u&&(0,t.jsx)("span",{className:"absolute inset-x-0 bottom-0 h-1 bg-white/20",children:(0,t.jsx)("span",{className:"block h-full bg-green",style:{width:`${u}%`}})})]}),(0,t.jsx)("h3",{className:"mt-2.5 line-clamp-2 font-heading text-sm font-semibold leading-[1.25] text-ink",children:e.title}),(0,t.jsxs)("p",{className:"mt-[3px] flex items-center gap-1.5 text-xs text-muted",children:[(0,t.jsx)("span",{children:(0,i.formatIsDate)(e.publishedAt)}),d&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"h-[3px] w-[3px] rounded-full bg-[#4a5a75]","aria-hidden":!0}),(0,t.jsx)("span",{children:d})]})]})]},e.id)})})]})}var u=e.i(62773),x=e.i(25225),p=e.i(72299);e.i(61978);var h=e.i(52831),m=e.i(59141);function f({ep:e}){var s;let n=(0,i.episodeThumb)(e);return(0,t.jsxs)(r.default,{href:`/thattur/${e.id}`,className:"group flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"relative aspect-video overflow-hidden rounded-xl border border-line bg-surface-2 shadow-sm transition-all duration-300 group-hover:shadow-md",children:[n&&(0,t.jsx)("img",{src:n,alt:"",loading:"lazy",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]"}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-navy/0 transition-colors duration-300 group-hover:bg-navy/25",children:(0,t.jsx)("span",{className:"flex h-12 w-12 translate-y-1 items-center justify-center rounded-full bg-green text-white opacity-0 shadow-lg transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100",children:(0,t.jsx)("span",{className:"material-symbols-outlined filled text-[22px]",children:"play_arrow"})})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold leading-snug text-ink",children:e.title}),(0,t.jsxs)("p",{className:"mt-1 text-xs font-medium uppercase tracking-wider text-faint",children:[(0,i.formatIsDate)(e.publishedAt),e.durationSec?` \xb7 ${!(s=e.durationSec)?"":`${Math.round(s/60)} m\xedn`}`:""]})]})]})}var g=e.i(51010);let b=["Aðgengilegt à Beint à bÃlinn appinu fyrir Apple og Android tæki ásamt beintibilinn.is","Allir þættir à mynd à appinu og á beintibilinn.is","Aðgangur að öllum Beint à bÃlinn þáttum sem komið hafa út","à aðeins 1.490 kr.- á mánuði"];function j(){return(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#3bbd6a",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,
1children:(0,t.jsx)("path",{d:"M20 6L9 17l-5-5"})})}function v(){return(0,t.jsxs)("svg",{width:"19",height:"19",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,t.jsx)("circle",{cx:"9",cy:"21",r:"1"}),(0,t.jsx)("circle",{cx:"20",cy:"21",r:"1"}),(0,t.jsx)("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]})}function w({onBuy:e,newest:s}){let n=s?(0,i.episodeThumb)(s,960,540):null,a=s?[s.durationSec?`${Math.round(s.durationSec/60)} m\xedn`:null,s.hasVideo?"mynd & hljóð":"hljóð"].filter(Boolean).join(" · "):"";return(0,t.jsx)("div",{className:"bg-[linear-gradient(180deg,#17335f_0%,#122a4f_45%,#0a1220_100%)]",children:(0,t.jsxs)("div",{className:"reveal mx-auto grid w-full max-w-[1220px] items-center gap-11 px-4 pb-11 pt-6 sm:px-8 md:grid-cols-[1.05fr_0.95fr]",children:[(0,t.jsxs)("div",{className:"stripe relative hidden aspect-video overflow-hidden rounded-[18px] shadow-[0_30px_60px_rgba(0,0,0,0.45)] md:block",children:[n&&(0,t.jsx)("img",{src:n,alt:"",className:"absolute inset-0 h-full w-full object-cover"}),(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 top-[55%] bg-gradient-to-b from-transparent to-surface/[0.82]"}),s&&(0,t.jsxs)("div",{className:"pointer-events-none absolute bottom-5 left-[22px] right-[22px] flex items-end justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"mb-[9px] inline-block rounded-[20px] bg-green px-2.5 py-1 font-heading text-[10px] font-bold tracking-[0.05em] text-white",children:"NÃJASTI ÃÃTTUR"}),(0,t.jsx)("p",{className:"font-heading text-[21px] font-bold leading-[1.15] text-white",children:s.title}),(0,t.jsx)("p",{className:"mt-[3px] text-xs text-sub",children:a})]}),(0,t.jsx)(r.default,{href:`/thattur/${s.id}`,className:"pointer-events-auto flex h-[58px] w-[58px] flex-none items-center justify-center rounded-full bg-white/95 shadow-[0_10px_26px_rgba(0,0,0,0.4)] transition-transform hover:scale-105","aria-label":"Spila nýjasta þátt",children:(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"#17335f","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M8 5v14l11-7z"})})})]})]}),(0,t.jsxs)("div",{className:"rounded-2xl bg-white p-7 text-[#14233f] shadow-[0_24px_50px_rgba(0,0,0,0.3)] sm:p-[34px]",children:[(0,t.jsxs)("h1",{className:"mb-5 text-[26px] font-bold leading-[1.12] sm:text-[30px]",children:["Nýr þáttur",(0,t.jsx)("br",{}),"alla fimmtudaga"]}),(0,t.jsx)("p",{className:"mb-3.5 font-heading text-[13px] font-semibold text-[#5b6b85]",children:"Nældu þér à áskrift:"}),(0,t.jsx)("ul",{className:"mb-6 flex flex-col gap-[13px]",children:b.map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-3 text-sm leading-[1.4] text-[#33425c]",children:[(0,t.jsx)("span",{className:"mt-px flex-none",children:(0,t.jsx)(j,{})}),(0,t.jsx)("span",{children:e})]},e))}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3.5",children:[(0,t.jsxs)("button",{onClick:e,className:"flex items-center gap-[9px] rounded-[9px] bg-green px-[26px] py-3.5 font-heading text-[15px] font-bold text-white transition-colors hover:bg-green-dark",children:[(0,t.jsx)(v,{}),"Kaupa áskrift"]}),(0,t.jsx)(r.default,{href:"/innskra",className:"px-1.5 py-3 font-heading text-sm font-semibold text-navy transition-colors hover:text-green",children:"Innskráning"})]})]})]})})}function y({name:e,items:s}){return(0,t.jsx)("div",{className:"bg-[linear-gradient(180deg,#17335f_0%,#122a4f_50%,#0a1220_100%)] pb-2 pt-[34px]",children:(0,t.jsxs)("div",{className:"reveal mx-auto w-full max-w-[1220px] px-4 sm:px-8",children:[(0,t.jsxs)("p",{className:"mb-1.5 font-heading text-[13px] font-semibold tracking-[0.04em] text-yellow",children:["VELKOMIN AFTUR, ",e.toUpperCase()]}),(0,t.jsx)("h1",{className:"mb-[26px] text-[26px] font-bold text-white sm:text-[30px]",children:"Haltu áfram þar sem þú hættir"}),(0,t.jsx)("div",{className:"rowscroll flex gap-[18px] pb-2.5",children:s.map(({ep:e,pct:s,left:n})=>{let a=(0,i.episodeThumb)(e,640,360);return(0,t.jsxs)(r.default,{href:`/thattur/${e.id}`,className:"w-[320px] flex-none",children:[(0,t.jsxs)("div",{className:"stripe relative aspect-video overflow-hidden rounded-[10px]",children:[a&&(0,t.jsx)("img",{src:a,alt:"",loading:"lazy",className:"absolute inset-0 h-full w-full object-cover"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-surface/5 to-surface/55"}),(0,t.jsx)("span",{className:"absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("span",{className:"flex h-[52px] w-[52px] items-center justify-center rounded-full bg-green",children:(0,t.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"#fff","aria-hidden":!0,
1children:(0,t.jsx)("path",{d:"M8 5v14l11-7z"})})})}),(0,t.jsxs)("span",{className:"absolute bottom-3 right-[9px] rounded-[5px] bg-[rgba(6,11,22,0.85)] px-2 py-0.5 text-[11px] font-semibold text-white",children:[n," mÃn eftir"]}),(0,t.jsx)("span",{className:"absolute inset-x-0 bottom-0 h-1 bg-white/20",children:(0,t.jsx)("span",{className:"block h-full bg-green",style:{width:`${s}%`}})})]}),(0,t.jsx)("p",{className:"mt-2.5 truncate font-heading text-[15px] font-semibold text-white",children:e.title})]},e.id)})})]})})}function N(){return(0,t.jsxs)("div",{className:"mt-3.5 grid items-center gap-[30px] rounded-2xl bg-navy p-8 sm:p-10 md:grid-cols-[1.2fr_0.8fr]",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-3 font-heading text-xs font-semibold tracking-[0.08em] text-yellow",children:"APPIÃ"}),(0,t.jsx)("h2",{className:"mb-3 text-[22px] font-bold text-white sm:text-[26px]",children:"Taktu þættina með à bÃlinn"}),(0,t.jsx)("p",{className:"mb-[22px] max-w-[34em] text-sm leading-[1.55] text-sub",children:"Niðurhal fyrir netlausa bÃltúra, myndspilun með einum smelli og áframhald milli sÃma, spjaldtölvu og bÃls."}),(0,t.jsx)(u.default,{})]}),(0,t.jsx)("div",{className:"hidden text-center md:block",children:(0,t.jsx)("img",{src:"/brand/logo-gulur.png",alt:"Beint à bÃlinn",className:"inline-block h-auto w-full max-w-[280px]"})})]})}e.s(["default",0,function(){let{user:e,loading:r}=(0,p.useAuth)(),l=function(){let{user:e,loading:t}=(0,p.useAuth)(),[r,n]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(t)return;if(!e)return void n(!1);let s=!1;return n(null),(0,h.httpsCallable)(m.functions,"getEntitlement")().then(e=>{s||n(!0===e.data.active)}).catch(()=>{s||n(!1)}),()=>{s=!0}},[e,t]),r}(),o=!r&&!e,[c,u]=(0,s.useState)(!1),[b,j]=(0,s.useState)(null),[v,k]=(0,s.useState)([]),[S,C]=(0,s.useState)(""),L=(0,s.useMemo)(()=>S.trim()&&b?(0,i.searchEpisodes)(b,S):null,[b,S]);(0,s.useEffect)(()=>{(0,i.fetchCatalog)().then(j).catch(()=>j([]))},[]),(0,s.useEffect)(()=>{e?.email?(0,g.fetchProgress)(e.email).then(k).catch(()=>k([])):k([])},[e]);let M=(0,s.useMemo)(()=>{if(!b)return[];let e=new Map(b.map(e=>[e.id,e]));return v.map(t=>{let s=e.get(t.episodeId);if(!s)return null;let r=s.durationSec??t.durationSec;return t.played||!r||t.positionSec<30||t.positionSec>r-120?null:{ep:s,pct:Math.min(100,t.positionSec/r*100),left:Math.max(1,Math.round((r-t.positionSec)/60))}}).filter(e=>null!==e).slice(0,10)},[b,v]),_=(0,s.useMemo)(()=>{let e=new Map;for(let{ep:t,pct:s}of M)e.set(t.id,s);return e},[M]),A=e?.displayName?.trim().split(/\s+/)[0]??e?.email?.split("@")[0]??"";return(0,t.jsxs)("div",{className:"flex min-h-screen flex-col pt-16",children:[(0,t.jsx)(n.default,{}),(0,t.jsxs)("main",{className:"flex w-full flex-grow flex-col",children:[o&&(0,t.jsx)(w,{onBuy:()=>u(!0),newest:b?.[0]??null}),e&&M.length>0&&(0,t.jsx)(y,{name:A,items:M}),(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1220px] px-4 pb-14 pt-[26px] sm:px-8",children:[(0,t.jsxs)("div",{className:"mb-6 flex flex-col gap-3.5 sm:flex-row sm:items-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"h-5 w-1 rounded-[2px] bg-green","aria-hidden":!0}),(0,t.jsx)("h2",{className:"text-xl font-bold text-ink",children:L?"Leitarniðurstöður":"Ãættirnir"}),L&&(0,t.jsxs)("span",{className:"text-xs font-semibold text-faint",children:[L.length," ",1===L.length?"þáttur":"þættir"]})]}),(0,t.jsxs)("div",{className:"relative w-full sm:ml-auto sm:w-[340px]",children:[(0,t.jsx)("span",{className:"pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-muted",children:(0,t.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,t.jsx)("path",{d:"M21 21l-4.35-4.35"})]})}),(0,t.jsx)("input",{value:S,onChange:e=>C(e.target.value),placeholder:`Leita \xed ${b?.length||"öllum"} \xfe\xe1ttumâ¦`,className:"min-h-11 w-full rounded-full border border-line bg-surface-2 py-2.5 pl-10 pr-4 text-sm text-ink outline-none transition-colors placeholder:text-muted focus:border-green","aria-label":"Leita à þáttum"}),S&&(0,t.jsx)("button",{onClick:()=>C(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted transition-colors hover:text-ink","aria-label":"Hreinsa leit",children:(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round","aria-hidden":!0,
1children:(0,t.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]})]}),L?L.length>0?(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",children:L.slice(0,24).map(e=>(0,t.jsx)(f,{ep:e},e.id))}):(0,t.jsxs)("p",{className:"py-10 text-center text-sm text-muted",children:["Engir þættir fundust fyrir â",S.trim(),"â"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{episodes:b,entitled:l,progress:_}),(0,t.jsx)(N,{})]})]})]}),(0,t.jsx)(a.default,{}),(0,t.jsx)(x.default,{open:c,onClose:()=>u(!1)})]})}],52683)}]);
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.